From 466ed8ca1530981a6edc300b38cae8aef9dd9897 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 18 Oct 2026 23:50:03 +0000 Subject: [PATCH 01/21] Merge 3.15 into 3.14 --- about.po | 2 +- bugs.po | 2 +- builtins/constants.po | 2 +- builtins/exceptions.po | 2 +- builtins/functions.po | 2 +- builtins/index.po | 2 +- builtins/stdtypes.po | 2 +- builtins/threadsafety.po | 2 +- builtins/time-complexity.po | 2 +- c-api/abstract.po | 2 +- c-api/allocation.po | 2 +- c-api/apiabiversion.po | 2 +- c-api/arg.po | 2 +- c-api/bool.po | 2 +- c-api/buffer.po | 2 +- c-api/bytearray.po | 2 +- c-api/bytes.po | 2 +- c-api/call.po | 2 +- c-api/capsule.po | 4 +- c-api/cell.po | 2 +- c-api/code.po | 4 +- c-api/codec.po | 2 +- c-api/complex.po | 2 +- c-api/concrete.po | 2 +- c-api/contextvars.po | 2 +- c-api/conversion.po | 2 +- c-api/coro.po | 2 +- c-api/curses.po | 2 +- c-api/datetime.po | 2 +- c-api/descriptor.po | 2 +- c-api/dict.po | 2 +- c-api/exceptions.po | 2 +- c-api/extension-modules.po | 2 +- c-api/file.po | 2 +- c-api/float.po | 2 +- c-api/frame.po | 2 +- c-api/function.po | 2 +- c-api/gcsupport.po | 2 +- c-api/gen.po | 2 +- c-api/hash.po | 2 +- c-api/import.po | 2 +- c-api/index.po | 2 +- c-api/init.po | 2 +- c-api/init_config.po | 2 +- c-api/interp-lifecycle.po | 2 +- c-api/intro.po | 2 +- c-api/iter.po | 2 +- c-api/iterator.po | 2 +- c-api/lifecycle.po | 2 +- c-api/list.po | 2 +- c-api/long.po | 2 +- c-api/mapping.po | 2 +- c-api/marshal.po | 2 +- c-api/memory.po | 2 +- c-api/memoryview.po | 2 +- c-api/method.po | 2 +- c-api/module.po | 2 +- c-api/monitoring.po | 2 +- c-api/none.po | 4 +- c-api/number.po | 2 +- c-api/object.po | 2 +- c-api/objimpl.po | 2 +- c-api/perfmaps.po | 2 +- c-api/picklebuffer.po | 2 +- c-api/profiling.po | 2 +- c-api/refcounting.po | 2 +- c-api/reflection.po | 2 +- c-api/sequence.po | 2 +- c-api/set.po | 2 +- c-api/slice.po | 2 +- c-api/stable.po | 2 +- c-api/structures.po | 2 +- c-api/subinterpreters.po | 2 +- c-api/synchronization.po | 2 +- c-api/sys.po | 2 +- c-api/threads.po | 2 +- c-api/time.po | 2 +- c-api/tls.po | 2 +- c-api/tuple.po | 2 +- c-api/type.po | 2 +- c-api/typehints.po | 2 +- c-api/typeobj.po | 2 +- c-api/unicode.po | 2 +- c-api/utilities.po | 2 +- c-api/veryhigh.po | 2 +- c-api/weakref.po | 2 +- contents.po | 2 +- copyright.po | 2 +- deprecations/c-api-pending-removal-in-3.14.po | 2 +- deprecations/c-api-pending-removal-in-3.15.po | 2 +- deprecations/c-api-pending-removal-in-3.16.po | 2 +- deprecations/c-api-pending-removal-in-3.18.po | 2 +- .../c-api-pending-removal-in-future.po | 2 +- deprecations/index.po | 2 +- deprecations/pending-removal-in-3.13.po | 2 +- deprecations/pending-removal-in-3.14.po | 2 +- deprecations/pending-removal-in-3.15.po | 2 +- deprecations/pending-removal-in-3.16.po | 2 +- deprecations/pending-removal-in-3.17.po | 2 +- deprecations/pending-removal-in-3.18.po | 2 +- deprecations/pending-removal-in-3.19.po | 2 +- deprecations/pending-removal-in-future.po | 2 +- distributing/index.po | 2 +- extending/building.po | 2 +- extending/embedding.po | 2 +- extending/extending.po | 2 +- extending/index.po | 2 +- extending/newtypes.po | 2 +- extending/newtypes_tutorial.po | 2 +- extending/windows.po | 2 +- faq/design.po | 2 +- faq/extending.po | 2 +- faq/general.po | 2 +- faq/gui.po | 2 +- faq/index.po | 2 +- faq/installed.po | 2 +- faq/library.po | 2 +- faq/programming.po | 2 +- faq/windows.po | 2 +- glossary.po | 4 +- howto/a-conceptual-overview-of-asyncio.po | 2 +- howto/annotations.po | 2 +- howto/argparse-optparse.po | 2 +- howto/argparse.po | 2 +- howto/clinic.po | 2 +- howto/cporting.po | 2 +- howto/curses.po | 2 +- howto/descriptor.po | 2 +- howto/enum.po | 2 +- howto/free-threading-extensions.po | 2 +- howto/free-threading-python.po | 2 +- howto/functional.po | 2 +- howto/gdb_helpers.po | 2 +- howto/index.po | 2 +- howto/instrumentation.po | 2 +- howto/ipaddress.po | 2 +- howto/isolating-extensions.po | 2 +- howto/logging-cookbook.po | 2 +- howto/logging.po | 2 +- howto/mro.po | 2 +- howto/perf_profiling.po | 2 +- howto/pyporting.po | 2 +- howto/regex.po | 2 +- howto/remote_debugging.po | 2 +- howto/sockets.po | 2 +- howto/sorting.po | 2 +- howto/timerfd.po | 2 +- howto/unicode.po | 2 +- howto/urllib2.po | 2 +- improve-page-nojs.po | 2 +- improve-page.po | 2 +- installing/index.po | 4 +- library/__future__.po | 2 +- library/__main__.po | 2 +- library/_thread.po | 2 +- library/abc.po | 2 +- library/aifc.po | 2 +- library/allos.po | 2 +- library/annotationlib.po | 2 +- library/archiving.po | 2 +- library/argparse.po | 2 +- library/array.po | 2 +- library/ast.po | 2 +- library/asynchat.po | 2 +- library/asyncio-api-index.po | 2 +- library/asyncio-dev.po | 2 +- library/asyncio-eventloop.po | 2 +- library/asyncio-exceptions.po | 2 +- library/asyncio-extending.po | 2 +- library/asyncio-future.po | 2 +- library/asyncio-graph.po | 2 +- library/asyncio-llapi-index.po | 2 +- library/asyncio-platforms.po | 2 +- library/asyncio-policy.po | 2 +- library/asyncio-protocol.po | 2 +- library/asyncio-queue.po | 2 +- library/asyncio-runner.po | 2 +- library/asyncio-stream.po | 2 +- library/asyncio-subprocess.po | 2 +- library/asyncio-sync.po | 2 +- library/asyncio-task.po | 2 +- library/asyncio-threading.po | 2 +- library/asyncio-tools.po | 2 +- library/asyncio.po | 2 +- library/asyncore.po | 2 +- library/atexit.po | 2 +- library/audioop.po | 2 +- library/audit_events.po | 2 +- library/base64.po | 2 +- library/bdb.po | 2 +- library/binary.po | 2 +- library/binascii.po | 2 +- library/bisect.po | 2 +- library/builtins.po | 2 +- library/bz2.po | 2 +- library/calendar.po | 2 +- library/cgi.po | 4 +- library/cgitb.po | 2 +- library/chunk.po | 2 +- library/cmath.po | 4 +- library/cmd.po | 2 +- library/cmdline.po | 2 +- library/cmdlinelibs.po | 2 +- library/code.po | 2 +- library/codecs.po | 2 +- library/codeop.po | 2 +- library/collections.abc.po | 2 +- library/collections.po | 2 +- library/colorsys.po | 2 +- library/compileall.po | 2 +- library/compression.po | 2 +- library/compression.zstd.po | 2 +- library/concurrency.po | 2 +- library/concurrent.futures.po | 2 +- library/concurrent.interpreters.po | 2 +- library/concurrent.po | 2 +- library/configparser.po | 2 +- library/constants.po | 2 +- library/contextlib.po | 2 +- library/contextvars.po | 2 +- library/copy.po | 2 +- library/copyreg.po | 2 +- library/crypt.po | 2 +- library/crypto.po | 2 +- library/csv.po | 2 +- library/ctypes.po | 2 +- library/curses.ascii.po | 2 +- library/curses.panel.po | 2 +- library/curses.po | 2 +- library/custominterp.po | 2 +- library/dataclasses.po | 2 +- library/datatypes.po | 2 +- library/datetime.po | 2 +- library/dbm.po | 2 +- library/debug.po | 2 +- library/decimal.po | 2 +- library/development.po | 2 +- library/devmode.po | 2 +- library/dialog.po | 2 +- library/difflib.po | 2 +- library/dis.po | 2 +- library/distribution.po | 2 +- library/distutils.po | 2 +- library/doctest.po | 2 +- library/email.charset.po | 2 +- library/email.compat32-message.po | 2 +- library/email.contentmanager.po | 2 +- library/email.encoders.po | 2 +- library/email.errors.po | 2 +- library/email.examples.po | 2 +- library/email.generator.po | 2 +- library/email.header.po | 2 +- library/email.headerregistry.po | 2 +- library/email.iterators.po | 2 +- library/email.message.po | 2 +- library/email.mime.po | 2 +- library/email.parser.po | 2 +- library/email.po | 2 +- library/email.policy.po | 2 +- library/email.utils.po | 2 +- library/ensurepip.po | 2 +- library/enum.po | 4 +- library/errno.po | 2 +- library/exceptions.po | 2 +- library/faulthandler.po | 2 +- library/fcntl.po | 2 +- library/filecmp.po | 2 +- library/fileformats.po | 2 +- library/fileinput.po | 2 +- library/filesys.po | 2 +- library/fnmatch.po | 2 +- library/fractions.po | 2 +- library/frameworks.po | 2 +- library/ftplib.po | 2 +- library/functional.po | 2 +- library/functions.po | 4 +- library/functools.po | 2 +- library/gc.po | 2 +- library/getopt.po | 2 +- library/getpass.po | 2 +- library/gettext.po | 2 +- library/glob.po | 2 +- library/graphlib.po | 2 +- library/grp.po | 2 +- library/gzip.po | 2 +- library/hashlib.po | 2 +- library/heapq.po | 2 +- library/hmac.po | 2 +- library/html.entities.po | 2 +- library/html.parser.po | 2 +- library/html.po | 2 +- library/http.client.po | 2 +- library/http.cookiejar.po | 2 +- library/http.cookies.po | 2 +- library/http.po | 2 +- library/http.server.po | 2 +- library/i18n.po | 2 +- library/idle.po | 2 +- library/imaplib.po | 2 +- library/imghdr.po | 2 +- library/imp.po | 2 +- library/importlib.metadata.po | 4 +- library/importlib.po | 10 ++--- library/importlib.resources.abc.po | 2 +- library/importlib.resources.po | 2 +- library/index.po | 2 +- library/inspect.po | 2 +- library/internet.po | 2 +- library/intro.po | 2 +- library/io.po | 2 +- library/ipaddress.po | 2 +- library/ipc.po | 2 +- library/itertools.po | 2 +- library/json.po | 6 +-- library/keyword.po | 2 +- library/language.po | 2 +- library/linecache.po | 2 +- library/locale.po | 2 +- library/logging.config.po | 2 +- library/logging.handlers.po | 2 +- library/logging.po | 2 +- library/lzma.po | 2 +- library/mailbox.po | 2 +- library/mailcap.po | 2 +- library/markup.po | 2 +- library/marshal.po | 2 +- library/math.po | 2 +- library/mimetypes.po | 2 +- library/mm.po | 2 +- library/mmap.po | 2 +- library/modulefinder.po | 2 +- library/modules.po | 2 +- library/msilib.po | 2 +- library/msvcrt.po | 2 +- library/multiprocessing.po | 2 +- library/multiprocessing.shared_memory.po | 2 +- library/netdata.po | 2 +- library/netrc.po | 2 +- library/nis.po | 2 +- library/nntplib.po | 2 +- library/numbers.po | 2 +- library/numeric.po | 2 +- library/operator.po | 2 +- library/optparse.po | 2 +- library/os.path.po | 2 +- library/os.po | 2 +- library/ossaudiodev.po | 2 +- library/pathlib.po | 2 +- library/pdb.po | 2 +- library/persistence.po | 2 +- library/pickle.po | 2 +- library/pickletools.po | 2 +- library/pipes.po | 2 +- library/pkgutil.po | 2 +- library/platform.po | 2 +- library/plistlib.po | 2 +- library/poplib.po | 2 +- library/posix.po | 2 +- library/pprint.po | 2 +- library/profile.po | 2 +- library/pty.po | 2 +- library/pwd.po | 2 +- library/py_compile.po | 2 +- library/pyclbr.po | 2 +- library/pydoc.po | 2 +- library/pyexpat.po | 2 +- library/python.po | 2 +- library/queue.po | 2 +- library/quopri.po | 2 +- library/random.po | 2 +- library/re.po | 2 +- library/readline.po | 2 +- library/removed.po | 2 +- library/reprlib.po | 2 +- library/resource.po | 2 +- library/rlcompleter.po | 2 +- library/runpy.po | 2 +- library/sched.po | 2 +- library/secrets.po | 2 +- library/security_warnings.po | 2 +- library/select.po | 2 +- library/selectors.po | 2 +- library/shelve.po | 2 +- library/shlex.po | 2 +- library/shutil.po | 2 +- library/signal.po | 2 +- library/site.po | 2 +- library/smtpd.po | 2 +- library/smtplib.po | 2 +- library/sndhdr.po | 2 +- library/socket.po | 2 +- library/socketserver.po | 2 +- library/spwd.po | 2 +- library/sqlite3.po | 2 +- library/ssl.po | 2 +- library/stat.po | 2 +- library/statistics.po | 2 +- library/stdtypes.po | 2 +- library/string.po | 4 +- library/string.templatelib.po | 2 +- library/stringprep.po | 2 +- library/struct.po | 4 +- library/subprocess.po | 2 +- library/sunau.po | 2 +- library/superseded.po | 2 +- library/symtable.po | 2 +- library/sys.monitoring.po | 2 +- library/sys.po | 2 +- library/sys_path_init.po | 2 +- library/sysconfig.po | 2 +- library/syslog.po | 2 +- library/tabnanny.po | 2 +- library/tarfile.po | 2 +- library/telnetlib.po | 2 +- library/tempfile.po | 2 +- library/termios.po | 2 +- library/test.po | 2 +- library/text.po | 2 +- library/textwrap.po | 2 +- library/threading.po | 2 +- library/threadsafety.po | 2 +- library/time-complexity.po | 2 +- library/time.po | 2 +- library/timeit.po | 2 +- library/tk.po | 2 +- library/tkinter.colorchooser.po | 2 +- library/tkinter.dnd.po | 2 +- library/tkinter.font.po | 2 +- library/tkinter.messagebox.po | 2 +- library/tkinter.po | 4 +- library/tkinter.scrolledtext.po | 2 +- library/tkinter.ttk.po | 2 +- library/token.po | 2 +- library/tokenize.po | 2 +- library/tomllib.po | 10 ++--- library/trace.po | 2 +- library/traceback.po | 2 +- library/tracemalloc.po | 2 +- library/tty.po | 2 +- library/turtle.po | 2 +- library/types.po | 2 +- library/typing.po | 2 +- library/unicodedata.po | 2 +- library/unittest.mock-examples.po | 5 +-- library/unittest.mock.po | 2 +- library/unittest.po | 2 +- library/unix.po | 2 +- library/urllib.error.po | 2 +- library/urllib.parse.po | 2 +- library/urllib.po | 2 +- library/urllib.request.po | 2 +- library/urllib.robotparser.po | 2 +- library/uu.po | 2 +- library/uuid.po | 2 +- library/venv.po | 2 +- library/warnings.po | 2 +- library/wave.po | 2 +- library/weakref.po | 2 +- library/webbrowser.po | 2 +- library/windows.po | 2 +- library/winreg.po | 2 +- library/winsound.po | 2 +- library/wsgiref.po | 2 +- library/xdrlib.po | 2 +- library/xml.dom.minidom.po | 2 +- library/xml.dom.po | 2 +- library/xml.dom.pulldom.po | 2 +- library/xml.etree.elementtree.po | 2 +- library/xml.po | 2 +- library/xml.sax.handler.po | 2 +- library/xml.sax.po | 2 +- library/xml.sax.reader.po | 2 +- library/xml.sax.utils.po | 2 +- library/xmlrpc.client.po | 2 +- library/xmlrpc.po | 2 +- library/xmlrpc.server.po | 2 +- library/zipapp.po | 2 +- library/zipfile.po | 2 +- library/zipimport.po | 2 +- library/zlib.po | 2 +- library/zoneinfo.po | 2 +- license.po | 2 +- reference/compound_stmts.po | 2 +- reference/datamodel.po | 2 +- reference/executionmodel.po | 2 +- reference/expressions.po | 2 +- reference/grammar.po | 2 +- reference/import.po | 2 +- reference/index.po | 2 +- reference/introduction.po | 2 +- reference/lexical_analysis.po | 2 +- reference/simple_stmts.po | 2 +- reference/toplevel_components.po | 2 +- sphinx.po | 2 +- tutorial/appendix.po | 10 ++++- tutorial/appetite.po | 2 +- tutorial/classes.po | 39 ++++++++++++++++++- tutorial/controlflow.po | 20 +++++----- tutorial/datastructures.po | 2 +- tutorial/errors.po | 2 +- tutorial/floatingpoint.po | 2 +- tutorial/index.po | 2 +- tutorial/inputoutput.po | 2 +- tutorial/interactive.po | 2 +- tutorial/interpreter.po | 2 +- tutorial/introduction.po | 2 +- tutorial/modules.po | 2 +- tutorial/stdlib.po | 2 +- tutorial/stdlib2.po | 2 +- tutorial/venv.po | 2 +- tutorial/whatnow.po | 2 +- using/android.po | 2 +- using/cmdline.po | 2 +- using/configure.po | 2 +- using/editors.po | 2 +- using/index.po | 2 +- using/ios.po | 2 +- using/mac.po | 2 +- using/unix.po | 2 +- using/windows.po | 2 +- whatsnew/2.0.po | 2 +- whatsnew/2.1.po | 2 +- whatsnew/2.2.po | 2 +- whatsnew/2.3.po | 2 +- whatsnew/2.4.po | 2 +- whatsnew/2.5.po | 2 +- whatsnew/2.6.po | 2 +- whatsnew/2.7.po | 2 +- whatsnew/3.0.po | 2 +- whatsnew/3.1.po | 2 +- whatsnew/3.10.po | 2 +- whatsnew/3.11.po | 4 +- whatsnew/3.12.po | 6 +-- whatsnew/3.13.po | 14 +++---- whatsnew/3.14.po | 2 +- whatsnew/3.2.po | 2 +- whatsnew/3.3.po | 2 +- whatsnew/3.4.po | 2 +- whatsnew/3.5.po | 2 +- whatsnew/3.6.po | 2 +- whatsnew/3.7.po | 2 +- whatsnew/3.8.po | 2 +- whatsnew/3.9.po | 2 +- whatsnew/changelog.po | 2 +- whatsnew/index.po | 2 +- 545 files changed, 631 insertions(+), 589 deletions(-) diff --git a/about.po b/about.po index 77bc15a07..9e288807b 100644 --- a/about.po +++ b/about.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: TENMYO Masakazu, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../about.rst:3 diff --git a/bugs.po b/bugs.po index 574d67aa8..6d3ed01dd 100644 --- a/bugs.po +++ b/bugs.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: TENMYO Masakazu, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../bugs.rst:5 diff --git a/builtins/constants.po b/builtins/constants.po index 888c19d72..c46fa2ed8 100644 --- a/builtins/constants.po +++ b/builtins/constants.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../builtins/constants.rst:4 diff --git a/builtins/exceptions.po b/builtins/exceptions.po index 106fde657..fabca3bdc 100644 --- a/builtins/exceptions.po +++ b/builtins/exceptions.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../builtins/exceptions.rst:4 diff --git a/builtins/functions.po b/builtins/functions.po index 3e707994f..dbf0d35f3 100644 --- a/builtins/functions.po +++ b/builtins/functions.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../builtins/functions.rst:5 diff --git a/builtins/index.po b/builtins/index.po index f4a8601ee..df4fa45e9 100644 --- a/builtins/index.po +++ b/builtins/index.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2026-09-13 17:09+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../builtins/index.rst:5 diff --git a/builtins/stdtypes.po b/builtins/stdtypes.po index 3004708a7..8131d1644 100644 --- a/builtins/stdtypes.po +++ b/builtins/stdtypes.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../builtins/stdtypes.rst:8 diff --git a/builtins/threadsafety.po b/builtins/threadsafety.po index bd1b17464..3c04dde18 100644 --- a/builtins/threadsafety.po +++ b/builtins/threadsafety.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2026-09-13 17:09+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../builtins/threadsafety.rst:5 diff --git a/builtins/time-complexity.po b/builtins/time-complexity.po index d953f0abd..185d0ef79 100644 --- a/builtins/time-complexity.po +++ b/builtins/time-complexity.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../builtins/time-complexity.rst:5 diff --git a/c-api/abstract.po b/c-api/abstract.po index 47db780f4..76d907464 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/abstract.rst:7 diff --git a/c-api/allocation.po b/c-api/allocation.po index 1ed7b4a11..abb8544cd 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/allocation.rst:6 diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index ecbe5790b..464c5b177 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/apiabiversion.rst:7 diff --git a/c-api/arg.po b/c-api/arg.po index 041638a83..f4ad318c1 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Maciej Olko, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/arg.rst:6 diff --git a/c-api/bool.po b/c-api/bool.po index 97218c5d6..235949b5e 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/bool.rst:6 diff --git a/c-api/buffer.po b/c-api/buffer.po index 935bbfc2f..f0a419d66 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/buffer.rst:11 diff --git a/c-api/bytearray.po b/c-api/bytearray.po index 88b1de921..18c89dd4d 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/bytearray.rst:6 diff --git a/c-api/bytes.po b/c-api/bytes.po index f4627ff17..e291d137c 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/bytes.rst:6 diff --git a/c-api/call.po b/c-api/call.po index 6d6ef8068..1986d213c 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/call.rst:6 diff --git a/c-api/capsule.po b/c-api/capsule.po index 11c9f7f70..56a09df1b 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/capsule.rst:6 @@ -278,7 +278,7 @@ msgstr "" #: ../../c-api/capsule.rst:8 msgid "object" -msgstr "オブジェクト" +msgstr "object" #: ../../c-api/capsule.rst:8 msgid "Capsule" diff --git a/c-api/cell.po b/c-api/cell.po index 7c4488bcc..8807d4306 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/cell.rst:6 diff --git a/c-api/code.po b/c-api/code.po index 1a559ed6a..b3ae95950 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/code.rst:8 @@ -466,7 +466,7 @@ msgstr "" #: ../../c-api/code.rst:3 msgid "object" -msgstr "オブジェクト" +msgstr "object" #: ../../c-api/code.rst:3 msgid "code" diff --git a/c-api/codec.po b/c-api/codec.po index b39a28567..7fe952f92 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/codec.rst:4 diff --git a/c-api/complex.po b/c-api/complex.po index 96ca06731..fb6555de2 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/complex.rst:6 diff --git a/c-api/concrete.po b/c-api/concrete.po index 0cbe37d8e..66a42a986 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/concrete.rst:8 diff --git a/c-api/contextvars.po b/c-api/contextvars.po index fda738ee5..2c711cc5f 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/contextvars.rst:6 diff --git a/c-api/conversion.po b/c-api/conversion.po index 78a8a43f5..88eae0e5f 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/conversion.rst:6 diff --git a/c-api/coro.po b/c-api/coro.po index 81374e5a5..022c9c31a 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/coro.rst:6 diff --git a/c-api/curses.po b/c-api/curses.po index 704e6c64d..88b1ba99a 100644 --- a/c-api/curses.po +++ b/c-api/curses.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-11-11 14:16+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/curses.rst:4 diff --git a/c-api/datetime.po b/c-api/datetime.po index e32d6683f..5b2075cf6 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/datetime.rst:6 diff --git a/c-api/descriptor.po b/c-api/descriptor.po index c708d5645..63ea8c061 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/descriptor.rst:6 diff --git a/c-api/dict.po b/c-api/dict.po index e69901ff8..e63cda5f3 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/dict.rst:6 diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 93beb25cc..486584d60 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/exceptions.rst:8 diff --git a/c-api/extension-modules.po b/c-api/extension-modules.po index c27b237be..6e8a9fce1 100644 --- a/c-api/extension-modules.po +++ b/c-api/extension-modules.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/extension-modules.rst:6 diff --git a/c-api/file.po b/c-api/file.po index a43a8c4e1..71d9de901 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/file.rst:6 diff --git a/c-api/float.po b/c-api/float.po index 7bb5e1bc4..0975be105 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/float.rst:6 diff --git a/c-api/frame.po b/c-api/frame.po index 68f4a1f90..158ec84be 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/frame.rst:4 diff --git a/c-api/function.po b/c-api/function.po index 4178d85cb..a825b5b03 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/function.rst:6 diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index c1f4cef09..c26ae5534 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/gcsupport.rst:6 diff --git a/c-api/gen.po b/c-api/gen.po index 2153b6256..ce9e3324f 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/gen.rst:6 diff --git a/c-api/hash.po b/c-api/hash.po index 581bd12ea..91fb86b17 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/hash.rst:4 diff --git a/c-api/import.po b/c-api/import.po index 622edb9f7..d6d321838 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/import.rst:6 diff --git a/c-api/index.po b/c-api/index.po index fdd58b2be..42e728f79 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/index.rst:5 diff --git a/c-api/init.po b/c-api/init.po index b7a8a2730..7ead7cc48 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/init.rst:4 diff --git a/c-api/init_config.po b/c-api/init_config.po index 8dbed2d98..cd87ec208 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/init_config.rst:7 diff --git a/c-api/interp-lifecycle.po b/c-api/interp-lifecycle.po index a164e237a..25492984e 100644 --- a/c-api/interp-lifecycle.po +++ b/c-api/interp-lifecycle.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/interp-lifecycle.rst:6 diff --git a/c-api/intro.po b/c-api/intro.po index 4dc31d1cb..3358f5a86 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/intro.rst:8 diff --git a/c-api/iter.po b/c-api/iter.po index bffbf7283..67212c550 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/iter.rst:6 diff --git a/c-api/iterator.po b/c-api/iterator.po index fc456648c..6ba9e8090 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/iterator.rst:6 diff --git a/c-api/lifecycle.po b/c-api/lifecycle.po index 901ed40d0..1655fbf06 100644 --- a/c-api/lifecycle.po +++ b/c-api/lifecycle.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/lifecycle.rst:6 diff --git a/c-api/list.po b/c-api/list.po index 2a1134d9b..766d0bd8f 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/list.rst:6 diff --git a/c-api/long.po b/c-api/long.po index cdd4cc12f..9c286baf2 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/long.rst:6 diff --git a/c-api/mapping.po b/c-api/mapping.po index a4995c333..d5b6cd494 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/mapping.rst:6 diff --git a/c-api/marshal.po b/c-api/marshal.po index 0f44b5be4..f9176f86f 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/marshal.rst:6 diff --git a/c-api/memory.po b/c-api/memory.po index 42db0cdf9..6c3163242 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/memory.rst:8 diff --git a/c-api/memoryview.po b/c-api/memoryview.po index 26ba78447..771d45409 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/memoryview.rst:9 diff --git a/c-api/method.po b/c-api/method.po index 7feb6ef56..8f1d9cecb 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/method.rst:6 diff --git a/c-api/module.po b/c-api/module.po index 977e79d86..2feae0822 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/module.rst:6 diff --git a/c-api/monitoring.po b/c-api/monitoring.po index 61e8e3844..ede1b8418 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/monitoring.rst:6 diff --git a/c-api/none.po b/c-api/none.po index e5709e3f2..3d46264c6 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/none.rst:6 @@ -56,7 +56,7 @@ msgstr "関数から :c:data:`Py_None` を返します。" #: ../../c-api/none.rst:8 msgid "object" -msgstr "オブジェクト" +msgstr "object" #: ../../c-api/none.rst:8 msgid "None" diff --git a/c-api/number.po b/c-api/number.po index 0daa04370..f2ef63315 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/number.rst:6 diff --git a/c-api/object.po b/c-api/object.po index 789fe4f8f..59d6c311d 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/object.rst:6 diff --git a/c-api/objimpl.po b/c-api/objimpl.po index 6dfd9a221..488e1f0c7 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/objimpl.rst:7 diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po index 37c1f9e4d..96962cfdd 100644 --- a/c-api/perfmaps.po +++ b/c-api/perfmaps.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/perfmaps.rst:6 diff --git a/c-api/picklebuffer.po b/c-api/picklebuffer.po index 642997628..55645aaa2 100644 --- a/c-api/picklebuffer.po +++ b/c-api/picklebuffer.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/picklebuffer.rst:9 diff --git a/c-api/profiling.po b/c-api/profiling.po index 9946b2ff3..a91a85d39 100644 --- a/c-api/profiling.po +++ b/c-api/profiling.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/profiling.rst:6 diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 06bbf4f49..0e881a4c9 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/refcounting.rst:8 diff --git a/c-api/reflection.po b/c-api/reflection.po index 75f73e5ab..e3ec7b998 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/reflection.rst:6 diff --git a/c-api/sequence.po b/c-api/sequence.po index 2b6415cd6..5b1a285fa 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/sequence.rst:6 diff --git a/c-api/set.po b/c-api/set.po index 4af9ec6ca..46b07d4ea 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/set.rst:6 diff --git a/c-api/slice.po b/c-api/slice.po index 3e5d9dbff..6f0b3b377 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/slice.rst:6 diff --git a/c-api/stable.po b/c-api/stable.po index 4dcb5c7e6..84dfbbe63 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/stable.rst:7 diff --git a/c-api/structures.po b/c-api/structures.po index 556cb9a5c..9587038e1 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/structures.rst:6 diff --git a/c-api/subinterpreters.po b/c-api/subinterpreters.po index 9cd1675e6..0f9d1b788 100644 --- a/c-api/subinterpreters.po +++ b/c-api/subinterpreters.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/subinterpreters.rst:6 diff --git a/c-api/synchronization.po b/c-api/synchronization.po index d1b895748..7dd7bfb25 100644 --- a/c-api/synchronization.po +++ b/c-api/synchronization.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/synchronization.rst:6 diff --git a/c-api/sys.po b/c-api/sys.po index 45e019a1e..acd2fd6a0 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/sys.rst:6 diff --git a/c-api/threads.po b/c-api/threads.po index 24f824944..e56a0b9c6 100644 --- a/c-api/threads.po +++ b/c-api/threads.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/threads.rst:6 diff --git a/c-api/time.po b/c-api/time.po index e29d6d9d5..33588d15c 100644 --- a/c-api/time.po +++ b/c-api/time.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/time.rst:6 diff --git a/c-api/tls.po b/c-api/tls.po index a15ecb232..cf6a2fa4e 100644 --- a/c-api/tls.po +++ b/c-api/tls.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/tls.rst:6 diff --git a/c-api/tuple.po b/c-api/tuple.po index d10640264..b2ecb873a 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/tuple.rst:6 diff --git a/c-api/type.po b/c-api/type.po index 3363f9655..30d28dcc5 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/type.rst:6 diff --git a/c-api/typehints.po b/c-api/typehints.po index 99d4fd1d6..3541e0c3a 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/typehints.rst:6 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 25f37e9c9..4486b3482 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/typeobj.rst:6 diff --git a/c-api/unicode.po b/c-api/unicode.po index 89b86ccea..8fd82d808 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/unicode.rst:6 diff --git a/c-api/utilities.po b/c-api/utilities.po index 67850cdac..9ad008c99 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/utilities.rst:7 diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 76506249c..23702a33a 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/veryhigh.rst:8 diff --git a/c-api/weakref.po b/c-api/weakref.po index 2d87b69e3..b791dc7ab 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/weakref.rst:6 diff --git a/contents.po b/contents.po index 68ea80bb0..b3ef37424 100644 --- a/contents.po +++ b/contents.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../contents.rst:3 diff --git a/copyright.po b/copyright.po index ca92a964a..d7ed47ada 100644 --- a/copyright.po +++ b/copyright.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: よっちゃん, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../copyright.rst:3 diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po index 1cb75e174..51e18a3b4 100644 --- a/deprecations/c-api-pending-removal-in-3.14.po +++ b/deprecations/c-api-pending-removal-in-3.14.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:2 diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po index 77391954c..0625fe49e 100644 --- a/deprecations/c-api-pending-removal-in-3.15.po +++ b/deprecations/c-api-pending-removal-in-3.15.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:2 diff --git a/deprecations/c-api-pending-removal-in-3.16.po b/deprecations/c-api-pending-removal-in-3.16.po index a8d218a1e..c5acf0455 100644 --- a/deprecations/c-api-pending-removal-in-3.16.po +++ b/deprecations/c-api-pending-removal-in-3.16.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/c-api-pending-removal-in-3.16.rst:2 diff --git a/deprecations/c-api-pending-removal-in-3.18.po b/deprecations/c-api-pending-removal-in-3.18.po index 16dda633c..7b99a8d28 100644 --- a/deprecations/c-api-pending-removal-in-3.18.po +++ b/deprecations/c-api-pending-removal-in-3.18.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po index 367edd985..c6fcd4d1a 100644 --- a/deprecations/c-api-pending-removal-in-future.po +++ b/deprecations/c-api-pending-removal-in-future.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 diff --git a/deprecations/index.po b/deprecations/index.po index 30bf32ccf..af54b0e24 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/index.rst:2 diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po index be7d7baed..b90035bed 100644 --- a/deprecations/pending-removal-in-3.13.po +++ b/deprecations/pending-removal-in-3.13.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-3.13.rst:2 diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index efcf11284..810619fed 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-3.14.rst:2 diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 13d0490ad..2f95e3054 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-3.15.rst:2 diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po index b06caaa87..26057586a 100644 --- a/deprecations/pending-removal-in-3.16.po +++ b/deprecations/pending-removal-in-3.16.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-3.16.rst:2 diff --git a/deprecations/pending-removal-in-3.17.po b/deprecations/pending-removal-in-3.17.po index c108c497c..5c8af27cc 100644 --- a/deprecations/pending-removal-in-3.17.po +++ b/deprecations/pending-removal-in-3.17.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-3.17.rst:2 diff --git a/deprecations/pending-removal-in-3.18.po b/deprecations/pending-removal-in-3.18.po index 54c1165b8..4420f4035 100644 --- a/deprecations/pending-removal-in-3.18.po +++ b/deprecations/pending-removal-in-3.18.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2026-01-07 14:20+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-3.18.rst:2 diff --git a/deprecations/pending-removal-in-3.19.po b/deprecations/pending-removal-in-3.19.po index 53d8a1907..c17f6db93 100644 --- a/deprecations/pending-removal-in-3.19.po +++ b/deprecations/pending-removal-in-3.19.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-3.19.rst:2 diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index d7ee86c72..fe1c1a00a 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../deprecations/pending-removal-in-future.rst:2 diff --git a/distributing/index.po b/distributing/index.po index eb264883b..63737da7b 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../distributing/index.rst:10 diff --git a/extending/building.po b/extending/building.po index 9ed75d764..0db96c45b 100644 --- a/extending/building.po +++ b/extending/building.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/building.rst:7 diff --git a/extending/embedding.po b/extending/embedding.po index ee945b8eb..2025b3839 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/embedding.rst:8 diff --git a/extending/extending.po b/extending/extending.po index eba104d94..7dbd941a4 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/extending.rst:8 diff --git a/extending/index.po b/extending/index.po index f843dc404..4d8034e3d 100644 --- a/extending/index.po +++ b/extending/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/index.rst:5 diff --git a/extending/newtypes.po b/extending/newtypes.po index 356bfc2b1..370eaba93 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/newtypes.rst:7 diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 8bf49f133..b2843b454 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/newtypes_tutorial.rst:7 diff --git a/extending/windows.po b/extending/windows.po index a2bee8ed7..b909c4020 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/windows.rst:8 diff --git a/faq/design.po b/faq/design.po index 29e8a4e55..29e95b8b7 100644 --- a/faq/design.po +++ b/faq/design.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: TENMYO Masakazu, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/design.rst:3 diff --git a/faq/extending.po b/faq/extending.po index 276c82a0a..35cdb2068 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/extending.rst:3 diff --git a/faq/general.po b/faq/general.po index 5aeb8d611..92a0b7e65 100644 --- a/faq/general.po +++ b/faq/general.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: TENMYO Masakazu, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/general.rst:5 diff --git a/faq/gui.po b/faq/gui.po index d39268708..f577854e6 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: TENMYO Masakazu, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/gui.rst:5 diff --git a/faq/index.po b/faq/index.po index 268f705b6..aa09c303d 100644 --- a/faq/index.po +++ b/faq/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/index.rst:5 diff --git a/faq/installed.po b/faq/installed.po index 9f3deb35b..094827014 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/installed.rst:3 diff --git a/faq/library.po b/faq/library.po index 5fb2330f5..e8660c465 100644 --- a/faq/library.po +++ b/faq/library.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Maciej Olko, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/library.rst:5 diff --git a/faq/programming.po b/faq/programming.po index c757783e5..9ab3de75e 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: TENMYO Masakazu, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/programming.rst:5 diff --git a/faq/windows.po b/faq/windows.po index 4f8505666..57be11c1e 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/windows.rst:9 diff --git a/glossary.po b/glossary.po index 12cf3d0df..a2b403405 100644 --- a/glossary.po +++ b/glossary.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../glossary.rst:5 @@ -108,7 +108,7 @@ msgstr "" #: ../../glossary.rst:47 msgid "annotation" -msgstr "annotation" +msgstr "注釈" #: ../../glossary.rst:49 msgid "" diff --git a/howto/a-conceptual-overview-of-asyncio.po b/howto/a-conceptual-overview-of-asyncio.po index f5d8e58ee..9f04abad8 100644 --- a/howto/a-conceptual-overview-of-asyncio.po +++ b/howto/a-conceptual-overview-of-asyncio.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/a-conceptual-overview-of-asyncio.rst:5 diff --git a/howto/annotations.po b/howto/annotations.po index 3d8cd26c3..847af7660 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: digdugdog, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/annotations.rst:5 diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po index 9cb0f45da..fb5bcd1f7 100644 --- a/howto/argparse-optparse.po +++ b/howto/argparse-optparse.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/argparse-optparse.rst:8 diff --git a/howto/argparse.po b/howto/argparse.po index 5c32708f5..8649fccf9 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/argparse.rst:5 diff --git a/howto/clinic.po b/howto/clinic.po index 8ded29592..26cde45ec 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/clinic.rst:8 diff --git a/howto/cporting.po b/howto/cporting.po index 17ab1a28b..228048a6e 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/cporting.rst:7 diff --git a/howto/curses.po b/howto/curses.po index 39c220f6f..857700d1f 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/curses.rst:5 diff --git a/howto/descriptor.po b/howto/descriptor.po index 78817f12a..b94735137 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/descriptor.rst:5 diff --git a/howto/enum.po b/howto/enum.po index 216a740de..de6e0c973 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/enum.rst:5 diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po index a24d89637..c251b2c0d 100644 --- a/howto/free-threading-extensions.po +++ b/howto/free-threading-extensions.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/free-threading-extensions.rst:7 diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index 4dc1621ec..25e2b035a 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/free-threading-python.rst:5 diff --git a/howto/functional.po b/howto/functional.po index 740c8d547..2efc40d6c 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/functional.rst:5 diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po index 49b06932e..90b9f4b89 100644 --- a/howto/gdb_helpers.po +++ b/howto/gdb_helpers.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/gdb_helpers.rst:5 diff --git a/howto/index.po b/howto/index.po index 9bffe166f..38e8f83bb 100644 --- a/howto/index.po +++ b/howto/index.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/index.rst:5 diff --git a/howto/instrumentation.po b/howto/instrumentation.po index bad3672db..f4bd3371a 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/instrumentation.rst:7 diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 947b0187d..eb673e5d9 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/ipaddress.rst:9 diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 49f5e3139..741da489e 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/isolating-extensions.rst:7 diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 46e6a6e0f..5b970ca0b 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/logging-cookbook.rst:5 diff --git a/howto/logging.po b/howto/logging.po index 0cb5526d3..bc484376a 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/logging.rst:5 diff --git a/howto/mro.po b/howto/mro.po index 10e752939..29f41c1e7 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/mro.rst:4 diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index f8318c882..9f0b5af27 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/perf_profiling.rst:7 diff --git a/howto/pyporting.po b/howto/pyporting.po index 54c2b90d3..c94a56419 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/pyporting.rst:7 diff --git a/howto/regex.po b/howto/regex.po index 3b3dbac0b..f057fe814 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/regex.rst:5 diff --git a/howto/remote_debugging.po b/howto/remote_debugging.po index 9b88c68d2..774ebe39d 100644 --- a/howto/remote_debugging.po +++ b/howto/remote_debugging.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/remote_debugging.rst:4 diff --git a/howto/sockets.po b/howto/sockets.po index 220bf6b69..5b0a8916d 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/sockets.rst:5 diff --git a/howto/sorting.po b/howto/sorting.po index 89ad8700d..9f2886add 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/sorting.rst:4 diff --git a/howto/timerfd.po b/howto/timerfd.po index 966487f6e..a432326f9 100644 --- a/howto/timerfd.po +++ b/howto/timerfd.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/timerfd.rst:5 diff --git a/howto/unicode.po b/howto/unicode.po index 4eef1d2a9..1232aa8fb 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/unicode.rst:5 diff --git a/howto/urllib2.po b/howto/urllib2.po index 0e46426f1..125f7b95a 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/urllib2.rst:5 diff --git a/improve-page-nojs.po b/improve-page-nojs.po index 9c3c80390..539547c11 100644 --- a/improve-page-nojs.po +++ b/improve-page-nojs.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2026-02-19 14:44+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../improve-page-nojs.rst:5 diff --git a/improve-page.po b/improve-page.po index 7155edb3d..1626f8a2f 100644 --- a/improve-page.po +++ b/improve-page.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2026-02-19 14:44+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../improve-page.rst:5 diff --git a/installing/index.po b/installing/index.po index 124d1fcbf..5f64bddec 100644 --- a/installing/index.po +++ b/installing/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../installing/index.rst:7 @@ -116,7 +116,7 @@ msgstr "" #: ../../installing/index.rst:54 msgid "" "The use of ``venv`` is now recommended for creating virtual environments." -msgstr "仮想環境の作成には、 ``venv`` の使用をお勧めします。" +msgstr "仮想環境の作成には、 ``venv`` の使用が今は推奨されています。" #: ../../installing/index.rst:59 msgid "" diff --git a/library/__future__.po b/library/__future__.po index 51457420b..2b8d573e1 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/__future__.rst:2 diff --git a/library/__main__.po b/library/__main__.po index e4cd7ef8a..a76985276 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Inada Naoki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/__main__.rst:2 diff --git a/library/_thread.po b/library/_thread.po index 5fe2e5c85..584f5cd0b 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/_thread.rst:2 diff --git a/library/abc.po b/library/abc.po index cb0db1bf6..e98e34d41 100644 --- a/library/abc.po +++ b/library/abc.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: 甲斐 智丈, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/abc.rst:2 diff --git a/library/aifc.po b/library/aifc.po index 4942c005a..cebcd430d 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/aifc.rst:2 diff --git a/library/allos.po b/library/allos.po index 6845185d2..ed5e593ee 100644 --- a/library/allos.po +++ b/library/allos.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/allos.rst:5 diff --git a/library/annotationlib.po b/library/annotationlib.po index a4bad3581..be9b96b40 100644 --- a/library/annotationlib.po +++ b/library/annotationlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/annotationlib.rst:2 diff --git a/library/archiving.po b/library/archiving.po index 38d6e0c57..316b87287 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/archiving.rst:5 diff --git a/library/argparse.po b/library/argparse.po index bff0ef792..b0b20242c 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/argparse.rst:2 diff --git a/library/array.po b/library/array.po index 415335a17..acb48f462 100644 --- a/library/array.po +++ b/library/array.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/array.rst:2 diff --git a/library/ast.po b/library/ast.po index 5d4b98a84..0d7d49d38 100644 --- a/library/ast.po +++ b/library/ast.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ast.rst:2 diff --git a/library/asynchat.po b/library/asynchat.po index 9b2b5669c..f012e513a 100644 --- a/library/asynchat.po +++ b/library/asynchat.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asynchat.rst:2 diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index 5ba35f823..c272264c4 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-api-index.rst:6 diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index c7790b7b3..5db947c12 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-dev.rst:7 diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 5580bb684..2e35d176a 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-eventloop.rst:8 diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index fc8b37b65..eedbbc191 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-exceptions.rst:8 diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index 0fbdfd359..46dcd8eb5 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-extending.rst:6 diff --git a/library/asyncio-future.po b/library/asyncio-future.po index db0eaaa78..f7cb11f61 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-future.rst:8 diff --git a/library/asyncio-graph.po b/library/asyncio-graph.po index ce3ee52bb..e53d5c9ea 100644 --- a/library/asyncio-graph.po +++ b/library/asyncio-graph.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-graph.rst:8 diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 3dae2a249..b7655b874 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-llapi-index.rst:6 diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 98128dcb9..d79ee9c38 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-platforms.rst:9 diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 81426ea31..453da4b4e 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-policy.rst:8 diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index cc3e13ccf..eff4bb281 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-protocol.rst:9 diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 9ea485f0f..78e38861a 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-queue.rst:7 diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 9c35e3335..9d286da9f 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-runner.rst:6 diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index c51b43665..1672efd94 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-stream.rst:7 diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index 75888b1d4..db9e35167 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-subprocess.rst:7 diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index 46e5604d8..9916652b7 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-sync.rst:7 diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 80d914973..fa56e475a 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-task.rst:6 diff --git a/library/asyncio-threading.po b/library/asyncio-threading.po index 6723acf0d..a0ec84704 100644 --- a/library/asyncio-threading.po +++ b/library/asyncio-threading.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2026-06-11 17:36+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-threading.rst:6 diff --git a/library/asyncio-tools.po b/library/asyncio-tools.po index 9420a6f3c..fe3e55a56 100644 --- a/library/asyncio-tools.po +++ b/library/asyncio-tools.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-tools.rst:7 diff --git a/library/asyncio.po b/library/asyncio.po index 98053d806..bd8a112c9 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio.rst:107 diff --git a/library/asyncore.po b/library/asyncore.po index b8e91cf3c..b2465c6bd 100644 --- a/library/asyncore.po +++ b/library/asyncore.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:00+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncore.rst:2 diff --git a/library/atexit.po b/library/atexit.po index 6110c5063..91fc7b342 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/atexit.rst:2 diff --git a/library/audioop.po b/library/audioop.po index f105909c2..8136aac28 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/audioop.rst:2 diff --git a/library/audit_events.po b/library/audit_events.po index bf019a629..9272db57a 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/audit_events.rst:6 diff --git a/library/base64.po b/library/base64.po index 743fad95a..6ec46ad21 100644 --- a/library/base64.po +++ b/library/base64.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/base64.rst:2 diff --git a/library/bdb.po b/library/bdb.po index c92bfccfb..079ba54bc 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/bdb.rst:2 diff --git a/library/binary.po b/library/binary.po index 6df301cbe..afc57702d 100644 --- a/library/binary.po +++ b/library/binary.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/binary.rst:5 diff --git a/library/binascii.po b/library/binascii.po index a9c6a65e8..f88640335 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/binascii.rst:2 diff --git a/library/bisect.po b/library/bisect.po index 0a32e87a5..6d5af59ec 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/bisect.rst:2 diff --git a/library/builtins.po b/library/builtins.po index a87ddda8c..a2ea8cc52 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/builtins.rst:2 diff --git a/library/bz2.po b/library/bz2.po index 53f2e899e..c1432d952 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/bz2.rst:2 diff --git a/library/calendar.po b/library/calendar.po index 396eaf323..37e35cef1 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/calendar.rst:2 diff --git a/library/cgi.po b/library/cgi.po index 82c98c71b..909eedd0b 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cgi.rst:2 @@ -33,7 +33,7 @@ msgid "" "Python 3.11. The removal was decided in :pep:`594`." msgstr "" "このモジュールは今や Python 標準ライブラリの一部ではありません。このモジュー" -"ルは Python 3.11 で非推奨となったあと、 :ref:`Python 3.13 で削除` されました。削除の決定は :pep:`594` でなされました。" #: ../../library/cgi.rst:14 diff --git a/library/cgitb.po b/library/cgitb.po index c126c1321..9b93afa24 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cgitb.rst:2 diff --git a/library/chunk.po b/library/chunk.po index 9718c81c1..2044fbbbf 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/chunk.rst:2 diff --git a/library/cmath.po b/library/cmath.po index 61ea55e6f..cc95582ce 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cmath.rst:2 @@ -583,7 +583,7 @@ msgstr "" #: ../../library/cmath.rst:300 msgid ":pep:`485` -- A function for testing approximate equality" -msgstr ":pep:`485` -- 近似的に等しいことを調べる関数" +msgstr ":pep:`485` -- A function for testing approximate equality" #: ../../library/cmath.rst:304 msgid "Constants" diff --git a/library/cmd.po b/library/cmd.po index 05bf0906c..4b349fa85 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cmd.rst:2 diff --git a/library/cmdline.po b/library/cmdline.po index d15814eb8..a122ce002 100644 --- a/library/cmdline.po +++ b/library/cmdline.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cmdline.rst:5 diff --git a/library/cmdlinelibs.po b/library/cmdlinelibs.po index 521d9c6ea..6a5d19441 100644 --- a/library/cmdlinelibs.po +++ b/library/cmdlinelibs.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cmdlinelibs.rst:5 diff --git a/library/code.po b/library/code.po index 0dacf7534..cdaeaf7cb 100644 --- a/library/code.po +++ b/library/code.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/code.rst:2 diff --git a/library/codecs.po b/library/codecs.po index b0f5020cc..54d169994 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/codecs.rst:2 diff --git a/library/codeop.po b/library/codeop.po index a48deff6c..43ef5d6bb 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/codeop.rst:2 diff --git a/library/collections.abc.po b/library/collections.abc.po index fe34a6b57..611598877 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/collections.abc.rst:2 diff --git a/library/collections.po b/library/collections.po index 1ce5234de..16cef95e1 100644 --- a/library/collections.po +++ b/library/collections.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/collections.rst:2 diff --git a/library/colorsys.po b/library/colorsys.po index 1a1b7741a..a79ed505f 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/colorsys.rst:2 diff --git a/library/compileall.po b/library/compileall.po index 5aed1c3e4..74444d3bf 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/compileall.rst:2 diff --git a/library/compression.po b/library/compression.po index 6a3111e11..d2ce6d994 100644 --- a/library/compression.po +++ b/library/compression.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/compression.rst:2 diff --git a/library/compression.zstd.po b/library/compression.zstd.po index b73ac7152..75711265a 100644 --- a/library/compression.zstd.po +++ b/library/compression.zstd.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/compression.zstd.rst:2 diff --git a/library/concurrency.po b/library/concurrency.po index c41a138e7..2a1eabfe1 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrency.rst:5 diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 0e171e9b5..0a4bf5fa5 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrent.futures.rst:2 diff --git a/library/concurrent.interpreters.po b/library/concurrent.interpreters.po index d57cf9a10..c111c0b58 100644 --- a/library/concurrent.interpreters.po +++ b/library/concurrent.interpreters.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrent.interpreters.rst:2 diff --git a/library/concurrent.po b/library/concurrent.po index d056f7f68..0fa2e7d47 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrent.rst:2 diff --git a/library/configparser.po b/library/configparser.po index d0e777fb0..ecd34e128 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/configparser.rst:2 diff --git a/library/constants.po b/library/constants.po index a8919758b..229747c5b 100644 --- a/library/constants.po +++ b/library/constants.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/constants.rst:4 diff --git a/library/contextlib.po b/library/contextlib.po index ece751a18..2def6f8d6 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/contextlib.rst:2 diff --git a/library/contextvars.po b/library/contextvars.po index 93cf5c6e0..cc2078607 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/contextvars.rst:2 diff --git a/library/copy.po b/library/copy.po index bc80fd713..da634aecd 100644 --- a/library/copy.po +++ b/library/copy.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/copy.rst:2 diff --git a/library/copyreg.po b/library/copyreg.po index b9c399088..a4c378bc1 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/copyreg.rst:2 diff --git a/library/crypt.po b/library/crypt.po index 11edcb476..22f33479e 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/crypt.rst:2 diff --git a/library/crypto.po b/library/crypto.po index 330f7661c..3b29177c7 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/crypto.rst:5 diff --git a/library/csv.po b/library/csv.po index 80bdd0d96..ff9029fa1 100644 --- a/library/csv.po +++ b/library/csv.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/csv.rst:2 diff --git a/library/ctypes.po b/library/ctypes.po index 6fc3dfa7d..5d8d09275 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ctypes.rst:2 diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 6947fc6a7..222fad33a 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/curses.ascii.rst:2 diff --git a/library/curses.panel.po b/library/curses.panel.po index 0cf53897b..311666040 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/curses.panel.rst:2 diff --git a/library/curses.po b/library/curses.po index a1ceb7dec..4e12a1eb0 100644 --- a/library/curses.po +++ b/library/curses.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/curses.rst:2 diff --git a/library/custominterp.po b/library/custominterp.po index 3600d9f68..3b6553b85 100644 --- a/library/custominterp.po +++ b/library/custominterp.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/custominterp.rst:5 diff --git a/library/dataclasses.po b/library/dataclasses.po index 1d4497a9a..9feb22b19 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dataclasses.rst:2 diff --git a/library/datatypes.po b/library/datatypes.po index 5b6034eec..460bc4813 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/datatypes.rst:5 diff --git a/library/datetime.po b/library/datetime.po index b590502df..03ca406ff 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/datetime.rst:2 diff --git a/library/dbm.po b/library/dbm.po index 8f7b50b92..234559d63 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dbm.rst:2 diff --git a/library/debug.po b/library/debug.po index bcc5b1afd..e2029f892 100644 --- a/library/debug.po +++ b/library/debug.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/debug.rst:3 diff --git a/library/decimal.po b/library/decimal.po index 9a65a224e..cc4712fce 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/decimal.rst:2 diff --git a/library/development.po b/library/development.po index 3348ddd46..f494f50e2 100644 --- a/library/development.po +++ b/library/development.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/development.rst:5 diff --git a/library/devmode.po b/library/devmode.po index eaccb4ece..cad45ed5d 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/devmode.rst:4 diff --git a/library/dialog.po b/library/dialog.po index c57f1dda6..2047e04e4 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dialog.rst:2 diff --git a/library/difflib.po b/library/difflib.po index 8b30e9d51..27557a5a1 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/difflib.rst:2 diff --git a/library/dis.po b/library/dis.po index 8e703ece8..20e180eab 100644 --- a/library/dis.po +++ b/library/dis.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dis.rst:2 diff --git a/library/distribution.po b/library/distribution.po index 91bfe1341..606d09aa9 100644 --- a/library/distribution.po +++ b/library/distribution.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/distribution.rst:3 diff --git a/library/distutils.po b/library/distutils.po index 0a0932822..b46c8877c 100644 --- a/library/distutils.po +++ b/library/distutils.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:01+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/distutils.rst:2 diff --git a/library/doctest.po b/library/doctest.po index 1cf235b74..bb198a8c7 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/doctest.rst:2 diff --git a/library/email.charset.po b/library/email.charset.po index 381d6eec0..eaf9c398f 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.charset.rst:2 diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 84d4606ee..8331101f0 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.compat32-message.rst:4 diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index c9a5615c2..be1ba60a3 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.contentmanager.rst:2 diff --git a/library/email.encoders.po b/library/email.encoders.po index 554a506ab..f13a26c4c 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.encoders.rst:2 diff --git a/library/email.errors.po b/library/email.errors.po index 750dea8fa..c34afa260 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.errors.rst:2 diff --git a/library/email.examples.po b/library/email.examples.po index ce9f28bb4..1348d152d 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.examples.rst:4 diff --git a/library/email.generator.po b/library/email.generator.po index 9575d6c58..148fe72e3 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.generator.rst:2 diff --git a/library/email.header.po b/library/email.header.po index 9f3ef66a1..ee65d097d 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.header.rst:2 diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 2f461df4b..21f291b82 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.headerregistry.rst:2 diff --git a/library/email.iterators.po b/library/email.iterators.po index 144d16b01..5377a24be 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.iterators.rst:2 diff --git a/library/email.message.po b/library/email.message.po index 826144f99..9ec280c49 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.message.rst:2 diff --git a/library/email.mime.po b/library/email.mime.po index e6341cac1..b5bf71cb2 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.mime.rst:2 diff --git a/library/email.parser.po b/library/email.parser.po index 00ad0ad4e..e8cc71d1f 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.parser.rst:2 diff --git a/library/email.po b/library/email.po index 662937d58..f407f483a 100644 --- a/library/email.po +++ b/library/email.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.rst:2 diff --git a/library/email.policy.po b/library/email.policy.po index f2464c559..0ab95277e 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.policy.rst:2 diff --git a/library/email.utils.po b/library/email.utils.po index 927b22696..3932e6723 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.utils.rst:2 diff --git a/library/ensurepip.po b/library/ensurepip.po index 2b9992442..05da4226c 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ensurepip.rst:2 diff --git a/library/enum.po b/library/enum.po index 3cc545005..618738bd0 100644 --- a/library/enum.po +++ b/library/enum.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Masahiro Ito, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/enum.rst:2 @@ -423,7 +423,7 @@ msgstr "新しく作成するEnumの名前。" #: ../../library/enum.rst:0 msgid "names" -msgstr "names" +msgstr "名前" #: ../../library/enum.rst:197 msgid "The names/values of the members for the new Enum." diff --git a/library/errno.po b/library/errno.po index ff89a8551..9dc9d5279 100644 --- a/library/errno.po +++ b/library/errno.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/errno.rst:2 diff --git a/library/exceptions.po b/library/exceptions.po index 74027514b..b4342807b 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/exceptions.rst:4 diff --git a/library/faulthandler.po b/library/faulthandler.po index 1d7cec121..0d49b451f 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/faulthandler.rst:2 diff --git a/library/fcntl.po b/library/fcntl.po index 5401bf476..366e8c63e 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fcntl.rst:2 diff --git a/library/filecmp.po b/library/filecmp.po index f7a3ba95c..597f369f6 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/filecmp.rst:2 diff --git a/library/fileformats.po b/library/fileformats.po index 7f184744a..95257723f 100644 --- a/library/fileformats.po +++ b/library/fileformats.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fileformats.rst:5 diff --git a/library/fileinput.po b/library/fileinput.po index 98bef83c4..2fb292113 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fileinput.rst:2 diff --git a/library/filesys.po b/library/filesys.po index 35f6f2ea0..3992a59b7 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/filesys.rst:5 diff --git a/library/fnmatch.po b/library/fnmatch.po index c858e30de..2b656d4f0 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fnmatch.rst:2 diff --git a/library/fractions.po b/library/fractions.po index b84ea717a..d6e808bc1 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fractions.rst:2 diff --git a/library/frameworks.po b/library/frameworks.po index c75da3991..e7310a77d 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:01+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/frameworks.rst:7 diff --git a/library/ftplib.po b/library/ftplib.po index 95941b6fe..dd413abde 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ftplib.rst:2 diff --git a/library/functional.po b/library/functional.po index dc4899a31..ca440f224 100644 --- a/library/functional.po +++ b/library/functional.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/functional.rst:3 diff --git a/library/functions.po b/library/functions.po index 32f437472..8a62f6125 100644 --- a/library/functions.po +++ b/library/functions.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: TENMYO Masakazu, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/functions.rst:5 ../../library/functions.rst:11 @@ -2848,7 +2848,7 @@ msgid "" "``mode``, ``flags``." msgstr "" "引数 ``path``, ``mode``, ``flags`` を指定して :ref:`監査イベント ` " -"``open`` を送出します。 " +"``open`` を送出します。" #: ../../library/functions.rst:1545 msgid "" diff --git a/library/functools.po b/library/functools.po index 78da239de..5a86d7d77 100644 --- a/library/functools.po +++ b/library/functools.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/functools.rst:2 diff --git a/library/gc.po b/library/gc.po index 0d1e20a20..1cad1a327 100644 --- a/library/gc.po +++ b/library/gc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/gc.rst:2 diff --git a/library/getopt.po b/library/getopt.po index af999066e..e2a24a15a 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/getopt.rst:2 diff --git a/library/getpass.po b/library/getpass.po index a6a83b73d..092133470 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/getpass.rst:2 diff --git a/library/gettext.po b/library/gettext.po index 68a01015b..c59d5a243 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/gettext.rst:2 diff --git a/library/glob.po b/library/glob.po index 5eae0d7ef..78a39a0c0 100644 --- a/library/glob.po +++ b/library/glob.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/glob.rst:2 diff --git a/library/graphlib.po b/library/graphlib.po index 63acfbc83..f4a4dbd3d 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/graphlib.rst:2 diff --git a/library/grp.po b/library/grp.po index 4526db454..b064e3db7 100644 --- a/library/grp.po +++ b/library/grp.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/grp.rst:2 diff --git a/library/gzip.po b/library/gzip.po index a0cde3858..952a520f2 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/gzip.rst:2 diff --git a/library/hashlib.po b/library/hashlib.po index 41db6a94a..6ef762047 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/hashlib.rst:2 diff --git a/library/heapq.po b/library/heapq.po index 8eda71aad..f0fc5b2d3 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/heapq.rst:2 diff --git a/library/hmac.po b/library/hmac.po index 735941d0b..c1777f5d1 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/hmac.rst:2 diff --git a/library/html.entities.po b/library/html.entities.po index 5858ba897..be513dff6 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/html.entities.rst:2 diff --git a/library/html.parser.po b/library/html.parser.po index c9fa73173..64eb36e67 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/html.parser.rst:2 diff --git a/library/html.po b/library/html.po index bc250fd20..fe1cf491e 100644 --- a/library/html.po +++ b/library/html.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/html.rst:2 diff --git a/library/http.client.po b/library/http.client.po index b5ce4d7bf..889fb5eb0 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/http.client.rst:2 diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 566404fd1..39f3a87bd 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/http.cookiejar.rst:2 diff --git a/library/http.cookies.po b/library/http.cookies.po index a7f6834bb..9d38a7607 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/http.cookies.rst:2 diff --git a/library/http.po b/library/http.po index 8b823dcd9..8685c1d67 100644 --- a/library/http.po +++ b/library/http.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/http.rst:2 diff --git a/library/http.server.po b/library/http.server.po index 7665de3f1..57c6cd144 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/http.server.rst:2 diff --git a/library/i18n.po b/library/i18n.po index 50d793685..45dddec8a 100644 --- a/library/i18n.po +++ b/library/i18n.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/i18n.rst:5 diff --git a/library/idle.po b/library/idle.po index bccea2cfe..1931005e4 100644 --- a/library/idle.po +++ b/library/idle.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/idle.rst:4 diff --git a/library/imaplib.po b/library/imaplib.po index ad06729d0..7ce781af9 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/imaplib.rst:2 diff --git a/library/imghdr.po b/library/imghdr.po index 8632590a1..616f224b3 100644 --- a/library/imghdr.po +++ b/library/imghdr.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/imghdr.rst:2 diff --git a/library/imp.po b/library/imp.po index 7c5a644f8..7b6352f30 100644 --- a/library/imp.po +++ b/library/imp.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:01+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/imp.rst:2 diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index afd4f346b..220ade567 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/importlib.metadata.rst:5 @@ -192,7 +192,7 @@ msgstr "" #: ../../library/importlib.metadata.rst:117 msgid "Functional API" -msgstr "機能 API" +msgstr "関数 API" #: ../../library/importlib.metadata.rst:119 msgid "This package provides the following functionality via its public API." diff --git a/library/importlib.po b/library/importlib.po index 1325591b7..07b2cbd56 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/importlib.rst:2 @@ -1593,10 +1593,10 @@ msgstr "" "う。 ``_whiz`` がバイナリモジュール ``sources/foo/bar/_whiz.abi3.so`` で実装" "されており、 ``sources`` のアプリケーションバンドルからの相対パスが ``sys." "path`` に登録されています。このモジュールは ``Frameworks/foo.bar._whiz." -"framework/foo.bar._whiz`` (フレームワーク名はモジュールの完全なインポートパ" -"スから命名されています)として、 ``Info.plist`` ファイルをバイナリをフレーム" -"ワークとして識別する ``.framework`` ディレクトリ内に設置して配布しなければな" -"りません。 ``foo.bar._whiz`` モジュールは、元の場所で、 ``Frameworks/foo.bar." +"framework/foo.bar._whiz`` (フレームワーク名はモジュールの完全なインポートパス" +"から命名されています) として、バイナリをフレームワークとして識別する ``Info." +"plist`` ファイルを ``.framework`` ディレクトリ内に設置して配布しなければなり" +"ません。 ``foo.bar._whiz`` モジュールは、元の場所で、 ``Frameworks/foo.bar." "_whiz/foo.bar._whiz`` のパスを含む ``sources/foo/bar/_whiz.abi3.fwork`` マー" "カーファイルに記述されます。 また、フレームワークは、 ``.fwork`` へのパスを含" "む ``Frameworks/foo.bar._whiz.framework/foo.bar._whiz.origin`` も含まなければ" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index d5fd045d2..ac9ad53e5 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/importlib.resources.abc.rst:2 diff --git a/library/importlib.resources.po b/library/importlib.resources.po index ec4d52107..4a4f3d1ad 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/importlib.resources.rst:2 diff --git a/library/index.po b/library/index.po index f9318a069..a453e0d87 100644 --- a/library/index.po +++ b/library/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/index.rst:5 diff --git a/library/inspect.po b/library/inspect.po index 919fffa34..e07800db2 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/inspect.rst:2 diff --git a/library/internet.po b/library/internet.po index 52a51b84a..eeb7485d2 100644 --- a/library/internet.po +++ b/library/internet.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/internet.rst:5 diff --git a/library/intro.po b/library/intro.po index 8e7fbac82..b98e1ac43 100644 --- a/library/intro.po +++ b/library/intro.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/intro.rst:5 diff --git a/library/io.po b/library/io.po index f0b355db5..c9b40760c 100644 --- a/library/io.po +++ b/library/io.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/io.rst:2 diff --git a/library/ipaddress.po b/library/ipaddress.po index 9ffb534aa..111538b9e 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ipaddress.rst:2 diff --git a/library/ipc.po b/library/ipc.po index 884e9ba9a..c0224840d 100644 --- a/library/ipc.po +++ b/library/ipc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ipc.rst:5 diff --git a/library/itertools.po b/library/itertools.po index 0f091dd8b..2770ffe29 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/itertools.rst:2 diff --git a/library/json.po b/library/json.po index f8e2dd320..e6720b52c 100644 --- a/library/json.po +++ b/library/json.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/json.rst:2 @@ -597,7 +597,7 @@ msgstr "object" #: ../../library/json.rst:394 msgid "dict" -msgstr "dict" +msgstr "辞書" #: ../../library/json.rst:396 ../../library/json.rst:492 msgid "array" @@ -613,7 +613,7 @@ msgstr "string" #: ../../library/json.rst:398 ../../library/json.rst:494 msgid "str" -msgstr "str" +msgstr "文字列" #: ../../library/json.rst:400 msgid "number (int)" diff --git a/library/keyword.po b/library/keyword.po index f55186e55..036ca69e7 100644 --- a/library/keyword.po +++ b/library/keyword.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/keyword.rst:2 diff --git a/library/language.po b/library/language.po index 3944f74a0..6b1845dcd 100644 --- a/library/language.po +++ b/library/language.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/language.rst:5 diff --git a/library/linecache.po b/library/linecache.po index 814c61d28..755ac23c8 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/linecache.rst:2 diff --git a/library/locale.po b/library/locale.po index d4373d239..ef30eb443 100644 --- a/library/locale.po +++ b/library/locale.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/locale.rst:2 diff --git a/library/logging.config.po b/library/logging.config.po index 5a59e7d7e..d4d248bdc 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/logging.config.rst:2 diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 6b2098a1f..cdff2b1f7 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/logging.handlers.rst:2 diff --git a/library/logging.po b/library/logging.po index d00642cf2..0d3003372 100644 --- a/library/logging.po +++ b/library/logging.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/logging.rst:2 diff --git a/library/lzma.po b/library/lzma.po index 15b2cdbcc..91f86085b 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/lzma.rst:2 diff --git a/library/mailbox.po b/library/mailbox.po index 55a8fca0b..dfb9d5aec 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/mailbox.rst:2 diff --git a/library/mailcap.po b/library/mailcap.po index f783b852c..c6b870b2f 100644 --- a/library/mailcap.po +++ b/library/mailcap.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/mailcap.rst:2 diff --git a/library/markup.po b/library/markup.po index 240425fbb..650d133c4 100644 --- a/library/markup.po +++ b/library/markup.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/markup.rst:5 diff --git a/library/marshal.po b/library/marshal.po index 1cd90c114..0462c3614 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/marshal.rst:2 diff --git a/library/math.po b/library/math.po index 2d4fa8619..5c5423e0c 100644 --- a/library/math.po +++ b/library/math.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/math.rst:2 diff --git a/library/mimetypes.po b/library/mimetypes.po index 692edf5c2..a5129985f 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/mimetypes.rst:2 diff --git a/library/mm.po b/library/mm.po index 258b23da5..617a3bf5e 100644 --- a/library/mm.po +++ b/library/mm.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/mm.rst:5 diff --git a/library/mmap.po b/library/mmap.po index 91e96eee9..c270e0734 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/mmap.rst:2 diff --git a/library/modulefinder.po b/library/modulefinder.po index 0425c342d..2b69bfae7 100644 --- a/library/modulefinder.po +++ b/library/modulefinder.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/modulefinder.rst:2 diff --git a/library/modules.po b/library/modules.po index 249173bc8..feeae2f71 100644 --- a/library/modules.po +++ b/library/modules.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/modules.rst:5 diff --git a/library/msilib.po b/library/msilib.po index f3a51fb13..919e0ac37 100644 --- a/library/msilib.po +++ b/library/msilib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/msilib.rst:2 diff --git a/library/msvcrt.po b/library/msvcrt.po index 190a47241..4b9ae33b4 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/msvcrt.rst:2 diff --git a/library/multiprocessing.po b/library/multiprocessing.po index f80c91a19..af60dbfa7 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/multiprocessing.rst:2 diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 6fb493c2d..5c02f0ab3 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/multiprocessing.shared_memory.rst:2 diff --git a/library/netdata.po b/library/netdata.po index 3ad517001..e56a80d03 100644 --- a/library/netdata.po +++ b/library/netdata.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/netdata.rst:6 diff --git a/library/netrc.po b/library/netrc.po index 12a01279c..e33bf02e0 100644 --- a/library/netrc.po +++ b/library/netrc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/netrc.rst:2 diff --git a/library/nis.po b/library/nis.po index 8738a198b..173c3d033 100644 --- a/library/nis.po +++ b/library/nis.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/nis.rst:2 diff --git a/library/nntplib.po b/library/nntplib.po index 338cda1cc..41a381c3b 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/nntplib.rst:2 diff --git a/library/numbers.po b/library/numbers.po index edac0e0ae..37e2dc992 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/numbers.rst:2 diff --git a/library/numeric.po b/library/numeric.po index 2a3659a9e..266022faf 100644 --- a/library/numeric.po +++ b/library/numeric.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/numeric.rst:6 diff --git a/library/operator.po b/library/operator.po index 50533baff..61be1c51e 100644 --- a/library/operator.po +++ b/library/operator.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/operator.rst:2 diff --git a/library/optparse.po b/library/optparse.po index 93522adda..2448c3560 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/optparse.rst:2 diff --git a/library/os.path.po b/library/os.path.po index b75fb9791..6318715c7 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/os.path.rst:2 diff --git a/library/os.po b/library/os.po index da5313dab..047ff8dce 100644 --- a/library/os.po +++ b/library/os.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/os.rst:2 diff --git a/library/ossaudiodev.po b/library/ossaudiodev.po index a9f15a527..57ecf8087 100644 --- a/library/ossaudiodev.po +++ b/library/ossaudiodev.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ossaudiodev.rst:2 diff --git a/library/pathlib.po b/library/pathlib.po index 046b748da..fad4c9a76 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pathlib.rst:2 diff --git a/library/pdb.po b/library/pdb.po index 677d85eff..fe1f7f363 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pdb.rst:4 diff --git a/library/persistence.po b/library/persistence.po index 04b037d5f..545bfb060 100644 --- a/library/persistence.po +++ b/library/persistence.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/persistence.rst:5 diff --git a/library/pickle.po b/library/pickle.po index bdb8ee91c..db80fe43b 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Masahiro Ito, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pickle.rst:2 diff --git a/library/pickletools.po b/library/pickletools.po index 8b09793cc..27b8d805f 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pickletools.rst:2 diff --git a/library/pipes.po b/library/pipes.po index dbd166713..0d9fbe168 100644 --- a/library/pipes.po +++ b/library/pipes.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pipes.rst:2 diff --git a/library/pkgutil.po b/library/pkgutil.po index 86ffd36ef..8938e06ca 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pkgutil.rst:2 diff --git a/library/platform.po b/library/platform.po index f1e45c78a..9f518b678 100644 --- a/library/platform.po +++ b/library/platform.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/platform.rst:2 diff --git a/library/plistlib.po b/library/plistlib.po index 11b816c1a..6a4bda713 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/plistlib.rst:2 diff --git a/library/poplib.po b/library/poplib.po index 4fa8e7a33..aeae685c5 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/poplib.rst:2 diff --git a/library/posix.po b/library/posix.po index 794bf5f4b..4bbec47f4 100644 --- a/library/posix.po +++ b/library/posix.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/posix.rst:2 diff --git a/library/pprint.po b/library/pprint.po index 2e242f425..f193aa002 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pprint.rst:2 diff --git a/library/profile.po b/library/profile.po index 25e07a796..ab9afe32f 100644 --- a/library/profile.po +++ b/library/profile.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/profile.rst:5 diff --git a/library/pty.po b/library/pty.po index aa712e53b..4d2cab498 100644 --- a/library/pty.po +++ b/library/pty.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pty.rst:2 diff --git a/library/pwd.po b/library/pwd.po index 89d0e25ee..47b7b390a 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pwd.rst:2 diff --git a/library/py_compile.po b/library/py_compile.po index 1cebbc53f..0a9c3b1b6 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/py_compile.rst:2 diff --git a/library/pyclbr.po b/library/pyclbr.po index cfa17f1aa..26c5fa634 100644 --- a/library/pyclbr.po +++ b/library/pyclbr.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pyclbr.rst:2 diff --git a/library/pydoc.po b/library/pydoc.po index 4d9426fca..2a38480ff 100644 --- a/library/pydoc.po +++ b/library/pydoc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pydoc.rst:2 diff --git a/library/pyexpat.po b/library/pyexpat.po index 078bc8450..83e7bdd40 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/pyexpat.rst:2 diff --git a/library/python.po b/library/python.po index b8b1aea93..ac46b5820 100644 --- a/library/python.po +++ b/library/python.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/python.rst:5 diff --git a/library/queue.po b/library/queue.po index 0fba1c85f..f82be1e11 100644 --- a/library/queue.po +++ b/library/queue.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/queue.rst:2 diff --git a/library/quopri.po b/library/quopri.po index 0e6668be8..f3a0a8674 100644 --- a/library/quopri.po +++ b/library/quopri.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/quopri.rst:2 diff --git a/library/random.po b/library/random.po index 7f6de8fe5..9f2eb16d5 100644 --- a/library/random.po +++ b/library/random.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/random.rst:2 diff --git a/library/re.po b/library/re.po index bb6e5fad8..fc18e7450 100644 --- a/library/re.po +++ b/library/re.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/re.rst:2 diff --git a/library/readline.po b/library/readline.po index f14b9f381..2e54027ee 100644 --- a/library/readline.po +++ b/library/readline.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/readline.rst:2 diff --git a/library/removed.po b/library/removed.po index f7c9e590e..111f5c454 100644 --- a/library/removed.po +++ b/library/removed.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/removed.rst:7 diff --git a/library/reprlib.po b/library/reprlib.po index b52391321..62cdfbef3 100644 --- a/library/reprlib.po +++ b/library/reprlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/reprlib.rst:2 diff --git a/library/resource.po b/library/resource.po index 4217caefc..7891a95cc 100644 --- a/library/resource.po +++ b/library/resource.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/resource.rst:2 diff --git a/library/rlcompleter.po b/library/rlcompleter.po index 3624ac872..36c6a6729 100644 --- a/library/rlcompleter.po +++ b/library/rlcompleter.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/rlcompleter.rst:2 diff --git a/library/runpy.po b/library/runpy.po index 1fa5b4690..468117b50 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Inada Naoki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/runpy.rst:2 diff --git a/library/sched.po b/library/sched.po index ff1a7f7d6..442243470 100644 --- a/library/sched.po +++ b/library/sched.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sched.rst:2 diff --git a/library/secrets.po b/library/secrets.po index 81f1ccc9b..66bdd88a5 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/secrets.rst:2 diff --git a/library/security_warnings.po b/library/security_warnings.po index fde47db20..ba58cbc95 100644 --- a/library/security_warnings.po +++ b/library/security_warnings.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/security_warnings.rst:6 diff --git a/library/select.po b/library/select.po index f19906b88..890f640bf 100644 --- a/library/select.po +++ b/library/select.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/select.rst:2 diff --git a/library/selectors.po b/library/selectors.po index 9ef3d22a6..7a5eeea0a 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/selectors.rst:2 diff --git a/library/shelve.po b/library/shelve.po index 05ad85bd3..ee33ede68 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/shelve.rst:2 diff --git a/library/shlex.po b/library/shlex.po index f5ddcaf97..fdae2c122 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/shlex.rst:2 diff --git a/library/shutil.po b/library/shutil.po index 398fd07b2..a53b03666 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/shutil.rst:2 diff --git a/library/signal.po b/library/signal.po index c98c5d441..99cc3e1e6 100644 --- a/library/signal.po +++ b/library/signal.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/signal.rst:2 diff --git a/library/site.po b/library/site.po index 977dbf8a5..9fa883703 100644 --- a/library/site.po +++ b/library/site.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/site.rst:2 diff --git a/library/smtpd.po b/library/smtpd.po index 4f00367e4..b3f4ba3a7 100644 --- a/library/smtpd.po +++ b/library/smtpd.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:01+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/smtpd.rst:2 diff --git a/library/smtplib.po b/library/smtplib.po index c3c22af7d..499fe35d2 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/smtplib.rst:2 diff --git a/library/sndhdr.po b/library/sndhdr.po index fcd86c53d..cc0f60290 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sndhdr.rst:2 diff --git a/library/socket.po b/library/socket.po index d22425b8e..5de56d8b5 100644 --- a/library/socket.po +++ b/library/socket.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/socket.rst:2 diff --git a/library/socketserver.po b/library/socketserver.po index a7bdfd083..2ca5746bb 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/socketserver.rst:2 diff --git a/library/spwd.po b/library/spwd.po index 80feca721..86ea524f8 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/spwd.rst:2 diff --git a/library/sqlite3.po b/library/sqlite3.po index f972354dc..090422ec4 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sqlite3.rst:2 diff --git a/library/ssl.po b/library/ssl.po index 3570ee410..5805e2419 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ssl.rst:2 diff --git a/library/stat.po b/library/stat.po index ad10c00b1..f76b42e9e 100644 --- a/library/stat.po +++ b/library/stat.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/stat.rst:2 diff --git a/library/statistics.po b/library/statistics.po index 3aeeb9b47..0635f0651 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/statistics.rst:2 diff --git a/library/stdtypes.po b/library/stdtypes.po index b56b119cb..947a24575 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/stdtypes.rst:8 diff --git a/library/string.po b/library/string.po index d223e6b74..4dd75c915 100644 --- a/library/string.po +++ b/library/string.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/string.rst:2 @@ -1809,7 +1809,7 @@ msgstr "# (hash)" #: ../../library/string.rst:452 msgid ", (comma)" -msgstr ", (カンマ)" +msgstr ", (comma)" #: ../../library/string.rst:452 msgid "_ (underscore)" diff --git a/library/string.templatelib.po b/library/string.templatelib.po index 55b573674..c6e4dc266 100644 --- a/library/string.templatelib.po +++ b/library/string.templatelib.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/string.templatelib.rst:2 diff --git a/library/stringprep.po b/library/stringprep.po index 8170ece04..a5c20e054 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/stringprep.rst:2 diff --git a/library/struct.po b/library/struct.po index 0ff63e26c..cc48ae042 100644 --- a/library/struct.po +++ b/library/struct.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/struct.rst:2 @@ -445,7 +445,7 @@ msgstr "" #: ../../library/struct.rst:255 ../../library/struct.rst:257 #: ../../library/struct.rst:273 msgid "int" -msgstr "整数" +msgstr "int" #: ../../library/struct.rst:232 ../../library/struct.rst:234 #: ../../library/struct.rst:238 ../../library/struct.rst:240 diff --git a/library/subprocess.po b/library/subprocess.po index 237aaaef2..9e8fcf3f8 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/subprocess.rst:2 diff --git a/library/sunau.po b/library/sunau.po index ca3bce8f2..9626a9ae8 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sunau.rst:2 diff --git a/library/superseded.po b/library/superseded.po index c7a10c366..1d39424be 100644 --- a/library/superseded.po +++ b/library/superseded.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2025-09-16 00:01+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/superseded.rst:5 diff --git a/library/symtable.po b/library/symtable.po index 52bc4a78b..89cae2521 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/symtable.rst:2 diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index c70a4eee5..bc4d4d8ce 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sys.monitoring.rst:2 diff --git a/library/sys.po b/library/sys.po index 3e426ffba..284aac604 100644 --- a/library/sys.po +++ b/library/sys.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sys.rst:2 diff --git a/library/sys_path_init.po b/library/sys_path_init.po index da1628191..f0e79eb00 100644 --- a/library/sys_path_init.po +++ b/library/sys_path_init.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sys_path_init.rst:4 diff --git a/library/sysconfig.po b/library/sysconfig.po index 828ad5f36..14b9028f6 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/sysconfig.rst:2 diff --git a/library/syslog.po b/library/syslog.po index e0013365f..ee4a896c8 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/syslog.rst:2 diff --git a/library/tabnanny.po b/library/tabnanny.po index 7ca283ae9..0226667d8 100644 --- a/library/tabnanny.po +++ b/library/tabnanny.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tabnanny.rst:2 diff --git a/library/tarfile.po b/library/tarfile.po index 4a2c433d4..c0e0fbc2e 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tarfile.rst:2 diff --git a/library/telnetlib.po b/library/telnetlib.po index f0cd70349..f2df6ef97 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/telnetlib.rst:2 diff --git a/library/tempfile.po b/library/tempfile.po index 55d26f9de..577b6e422 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tempfile.rst:2 diff --git a/library/termios.po b/library/termios.po index e0b53aff8..213772a59 100644 --- a/library/termios.po +++ b/library/termios.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/termios.rst:2 diff --git a/library/test.po b/library/test.po index 40991bc85..0fd49106a 100644 --- a/library/test.po +++ b/library/test.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/test.rst:2 diff --git a/library/text.po b/library/text.po index e24aa6966..4e2067584 100644 --- a/library/text.po +++ b/library/text.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/text.rst:6 diff --git a/library/textwrap.po b/library/textwrap.po index b5de70406..48cbfb9ac 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/textwrap.rst:2 diff --git a/library/threading.po b/library/threading.po index 7f6336e9c..10a826a78 100644 --- a/library/threading.po +++ b/library/threading.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/threading.rst:2 diff --git a/library/threadsafety.po b/library/threadsafety.po index dadb6ea23..e8793d51f 100644 --- a/library/threadsafety.po +++ b/library/threadsafety.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2026-02-27 14:38+0000\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/threadsafety.rst:5 diff --git a/library/time-complexity.po b/library/time-complexity.po index 399308b59..acb3b8b58 100644 --- a/library/time-complexity.po +++ b/library/time-complexity.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/time-complexity.rst:5 diff --git a/library/time.po b/library/time.po index 4f5315dc4..af38111fa 100644 --- a/library/time.po +++ b/library/time.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/time.rst:2 diff --git a/library/timeit.po b/library/timeit.po index 1c93b31f4..2c013a54f 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/timeit.rst:2 diff --git a/library/tk.po b/library/tk.po index 0dd8698aa..58b266521 100644 --- a/library/tk.po +++ b/library/tk.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tk.rst:5 diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index dbe548414..9b1228579 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.colorchooser.rst:2 diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index 3752acc4b..97c17b20d 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.dnd.rst:2 diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 362e58f40..f58a815cd 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.font.rst:2 diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index 805d491ca..e83413f9c 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.messagebox.rst:2 diff --git a/library/tkinter.po b/library/tkinter.po index 48d2d9973..2e12f44ab 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.rst:2 @@ -1322,7 +1322,7 @@ msgstr "" #: ../../library/tkinter.rst:793 msgid "boolean" -msgstr "boolean" +msgstr "ブール値" #: ../../library/tkinter.rst:794 msgid "" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index ec27c45ee..c42796878 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.scrolledtext.rst:2 diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 77605b2c5..733c56026 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.ttk.rst:2 diff --git a/library/token.po b/library/token.po index 942739427..f3a3f3501 100644 --- a/library/token.po +++ b/library/token.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/token.rst:2 diff --git a/library/tokenize.po b/library/tokenize.po index 16cf9536f..f65f78eab 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tokenize.rst:2 diff --git a/library/tomllib.po b/library/tomllib.po index a8517541d..64e2fc4b1 100644 --- a/library/tomllib.po +++ b/library/tomllib.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tomllib.rst:2 @@ -224,7 +224,7 @@ msgstr "辞書" #: ../../library/tomllib.rst:136 msgid "string" -msgstr "文字列" +msgstr "string" #: ../../library/tomllib.rst:136 msgid "str" @@ -236,7 +236,7 @@ msgstr "整数" #: ../../library/tomllib.rst:138 msgid "int" -msgstr "整数" +msgstr "int" #: ../../library/tomllib.rst:140 msgid "float" @@ -292,11 +292,11 @@ msgstr "datetime.time" #: ../../library/tomllib.rst:152 msgid "array" -msgstr "配列" +msgstr "array" #: ../../library/tomllib.rst:152 msgid "list" -msgstr "リスト" +msgstr "list" #: ../../library/tomllib.rst:154 msgid "table" diff --git a/library/trace.po b/library/trace.po index 0956bf70d..119ee3d11 100644 --- a/library/trace.po +++ b/library/trace.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/trace.rst:2 diff --git a/library/traceback.po b/library/traceback.po index 073b1beb3..763936550 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/traceback.rst:2 diff --git a/library/tracemalloc.po b/library/tracemalloc.po index 6810a9789..fbf057328 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tracemalloc.rst:2 diff --git a/library/tty.po b/library/tty.po index e4ec6e23c..9213332e5 100644 --- a/library/tty.po +++ b/library/tty.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tty.rst:2 diff --git a/library/turtle.po b/library/turtle.po index 5a734840d..be40c18a1 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/turtle.rst:3 diff --git a/library/types.po b/library/types.po index b1156ad6b..4b2a6694a 100644 --- a/library/types.po +++ b/library/types.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/types.rst:2 diff --git a/library/typing.po b/library/typing.po index 8ff3b0a06..c1b9fa8cf 100644 --- a/library/typing.po +++ b/library/typing.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: digdugdog, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/typing.rst:3 diff --git a/library/unicodedata.po b/library/unicodedata.po index 25a94948c..4e5744e6f 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/unicodedata.rst:2 diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index e7212fd4f..88fc042ee 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/unittest.mock-examples.rst:2 @@ -465,8 +465,7 @@ msgid "" "read :ref:`where to patch `." msgstr "" ":func:`patch` では探索される名前空間内のオブジェクトにパッチをあてることが重" -"要です。通常は単純ですが、クイックガイドには :ref:`where-to-patch` を読んでく" -"ださい。" +"要です。通常は単純ですが、詳しくは :ref:`where-to-patch` を参照してください。" #: ../../library/unittest.mock-examples.rst:397 msgid "" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index edf48c4d3..724059a0a 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/unittest.mock.rst:2 diff --git a/library/unittest.po b/library/unittest.po index 52a76b616..bb3db3744 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/unittest.rst:2 diff --git a/library/unix.po b/library/unix.po index 282aa0358..ebb84a459 100644 --- a/library/unix.po +++ b/library/unix.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/unix.rst:5 diff --git a/library/urllib.error.po b/library/urllib.error.po index ffec48c4b..a4f27a7e4 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/urllib.error.rst:2 diff --git a/library/urllib.parse.po b/library/urllib.parse.po index e5097a921..b94138d90 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/urllib.parse.rst:2 diff --git a/library/urllib.po b/library/urllib.po index a566dc290..cf49149bc 100644 --- a/library/urllib.po +++ b/library/urllib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/urllib.rst:2 diff --git a/library/urllib.request.po b/library/urllib.request.po index 41fca4939..af12f870c 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/urllib.request.rst:2 diff --git a/library/urllib.robotparser.po b/library/urllib.robotparser.po index 95297e43d..17a62fde6 100644 --- a/library/urllib.robotparser.po +++ b/library/urllib.robotparser.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/urllib.robotparser.rst:2 diff --git a/library/uu.po b/library/uu.po index d58cf318b..ece1d07d5 100644 --- a/library/uu.po +++ b/library/uu.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/uu.rst:2 diff --git a/library/uuid.po b/library/uuid.po index 40c30b9cf..76e9171be 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/uuid.rst:2 diff --git a/library/venv.po b/library/venv.po index 696aa8bc0..0a41fb121 100644 --- a/library/venv.po +++ b/library/venv.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/venv.rst:2 diff --git a/library/warnings.po b/library/warnings.po index 2f8a52f6b..6623f12de 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/warnings.rst:2 diff --git a/library/wave.po b/library/wave.po index 1578fb5c9..92ff538a7 100644 --- a/library/wave.po +++ b/library/wave.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/wave.rst:2 diff --git a/library/weakref.po b/library/weakref.po index 525bfc600..ce96411d5 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/weakref.rst:4 diff --git a/library/webbrowser.po b/library/webbrowser.po index f846a8230..64c12c0b2 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/webbrowser.rst:2 diff --git a/library/windows.po b/library/windows.po index 8b593e93f..e6e502385 100644 --- a/library/windows.po +++ b/library/windows.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/windows.rst:5 diff --git a/library/winreg.po b/library/winreg.po index ed448f5bd..a28875678 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/winreg.rst:2 diff --git a/library/winsound.po b/library/winsound.po index e627f0cbc..d84e0c358 100644 --- a/library/winsound.po +++ b/library/winsound.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/winsound.rst:2 diff --git a/library/wsgiref.po b/library/wsgiref.po index c188af784..8f6a029f1 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/wsgiref.rst:2 diff --git a/library/xdrlib.po b/library/xdrlib.po index bd73135dc..7f7d86c20 100644 --- a/library/xdrlib.po +++ b/library/xdrlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: souma987, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xdrlib.rst:2 diff --git a/library/xml.dom.minidom.po b/library/xml.dom.minidom.po index 8a2eb025a..f77e2eeb7 100644 --- a/library/xml.dom.minidom.po +++ b/library/xml.dom.minidom.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.dom.minidom.rst:2 diff --git a/library/xml.dom.po b/library/xml.dom.po index 6ff8e0128..18510b7ac 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.dom.rst:2 diff --git a/library/xml.dom.pulldom.po b/library/xml.dom.pulldom.po index a3cc77db3..87043b345 100644 --- a/library/xml.dom.pulldom.po +++ b/library/xml.dom.pulldom.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.dom.pulldom.rst:2 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index ac879b682..936fc14f8 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.etree.elementtree.rst:2 diff --git a/library/xml.po b/library/xml.po index 75be7b8e4..b3156c995 100644 --- a/library/xml.po +++ b/library/xml.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.rst:4 diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index caf5d40a0..a9b29f953 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.sax.handler.rst:2 diff --git a/library/xml.sax.po b/library/xml.sax.po index 89e8b18d1..8e32ae170 100644 --- a/library/xml.sax.po +++ b/library/xml.sax.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.sax.rst:2 diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index 29c03390e..c56a5a9c9 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.sax.reader.rst:2 diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po index 59a1aea0a..83e0d150f 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xml.sax.utils.rst:2 diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 0298e4508..d4936945b 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xmlrpc.client.rst:2 diff --git a/library/xmlrpc.po b/library/xmlrpc.po index a74abfe50..b8515f011 100644 --- a/library/xmlrpc.po +++ b/library/xmlrpc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xmlrpc.rst:2 diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index f5437a1f7..c45b9fcc6 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xmlrpc.server.rst:2 diff --git a/library/zipapp.po b/library/zipapp.po index deec9f8f7..a16cec563 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/zipapp.rst:2 diff --git a/library/zipfile.po b/library/zipfile.po index 495f3ed50..06a322415 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/zipfile.rst:2 diff --git a/library/zipimport.po b/library/zipimport.po index 4e88e9f4d..048fe1dda 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/zipimport.rst:2 diff --git a/library/zlib.po b/library/zlib.po index b8834c37c..884c4db2a 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/zlib.rst:2 diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 5cb2820ef..aa13c433f 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/zoneinfo.rst:2 diff --git a/license.po b/license.po index 5230e0b3d..f4f506afd 100644 --- a/license.po +++ b/license.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../license.rst:7 diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 7599dedba..360f6b1c4 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/compound_stmts.rst:5 diff --git a/reference/datamodel.po b/reference/datamodel.po index 02cd732b0..c126aa1c0 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/datamodel.rst:6 diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 225a7ee86..f268f5663 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/executionmodel.rst:6 diff --git a/reference/expressions.po b/reference/expressions.po index b2bf468d8..44e20f888 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/expressions.rst:6 diff --git a/reference/grammar.po b/reference/grammar.po index d716be4a9..d7a7b9c26 100644 --- a/reference/grammar.po +++ b/reference/grammar.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/grammar.rst:4 diff --git a/reference/import.po b/reference/import.po index af97568c5..ab27b8526 100644 --- a/reference/import.po +++ b/reference/import.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/import.rst:6 diff --git a/reference/index.po b/reference/index.po index 47cd0e5d0..e49d499fe 100644 --- a/reference/index.po +++ b/reference/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/index.rst:5 diff --git a/reference/introduction.po b/reference/introduction.po index 51fcb1ad2..ff5dcc00a 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/introduction.rst:6 diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 111be1757..4cda45c15 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/lexical_analysis.rst:6 diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index c33dd49de..db352fa41 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/simple_stmts.rst:6 diff --git a/reference/toplevel_components.po b/reference/toplevel_components.po index aaf0632af..e2f9dcc0d 100644 --- a/reference/toplevel_components.po +++ b/reference/toplevel_components.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../reference/toplevel_components.rst:6 diff --git a/sphinx.po b/sphinx.po index 4ad47f090..7b6f8180d 100644 --- a/sphinx.po +++ b/sphinx.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tools/templates/_docs_by_version.html:10 diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 189316bef..e39102b52 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/appendix.rst:5 @@ -50,6 +50,14 @@ msgid "" "kbd:`F3` enters \"paste mode\", which makes pasting larger blocks of code " "easier. Press :kbd:`F3` to return to the regular prompt." msgstr "" +"Python 3.13 からは、新しい対話型シェルがデフォルトで使われます。 これは、色付" +"け、複数行編集、履歴ブラウズ、貼り付けモードをサポートしています。 色付けを" +"無効にするには、 :ref:`using-on-controlling-color` を参照してください。 ファ" +"ンクションキーはいくつかの追加機能を提供します。 :kbd:`F1` は、対話型ヘルプブ" +"ラウザ :mod:`pydoc` に入ります。 :kbd:`F2` はコマンドライン履歴を、出力も :" +"term:`>>` や :term:`...` プロンプトも表示せずにブラウズできます。 :kbd:`F3` " +"は「ペーストモード」に入り、より大きなブロックコードの貼り付けが簡単になりま" +"す。 :kbd:`F3` を押すと通常のプロンプトに戻ります。" #: ../../tutorial/appendix.rst:27 msgid "" diff --git a/tutorial/appetite.po b/tutorial/appetite.po index 3822a70db..ef557d194 100644 --- a/tutorial/appetite.po +++ b/tutorial/appetite.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/appetite.rst:5 diff --git a/tutorial/classes.po b/tutorial/classes.po index 1187be6a9..828f9ffc9 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/classes.rst:5 @@ -914,6 +914,10 @@ msgid "" "class variable because just a single list would be shared by all *Dog* " "instances::" msgstr "" +":ref:`tut-object` で述べたように、共有データはリストや辞書のような :term:" +"`mutable` オブジェクトで予期せぬ作用を生じることがあります。例えば、以下の" +"コードの *tricks* リストはクラス変数として使われるべきではありません、なぜな" +"ら単一のリストがすべての *Dog* インスタンスで共有されてしまうからです::" #: ../../tutorial/classes.rst:428 msgid "" @@ -1423,6 +1427,8 @@ msgid "" "In some cases multiple inheritance is not allowed; see :ref:`multiple-" "inheritance` for details." msgstr "" +"いくつかの場合では多重継承が許されません。詳細は :ref:`multiple-inheritance` " +"を見てください。" #: ../../tutorial/classes.rst:673 msgid "Private Variables" @@ -1929,6 +1935,27 @@ msgid "" ">>> list(g)\n" "[1, 2, 3, 4, 5]" msgstr "" +">>> sum(i*i for i in range(10)) # 平方和\n" +"285\n" +"\n" +">>> xvec = [10, 20, 30]\n" +">>> yvec = [7, 5, 3]\n" +">>> sum(x*y for x,y in zip(xvec, yvec)) # ドット積\n" +"260\n" +"\n" +">>> unique_words = set(word for line in page for word in line.split())\n" +"\n" +">>> valedictorian = max((student.gpa, student.name) for student in " +"graduates)\n" +"\n" +">>> data = 'golf'\n" +">>> list(data[i] for i in range(len(data)-1, -1, -1))\n" +"['f', 'l', 'o', 'g']\n" +"\n" +">>> x = [[1,2,3], [], [4, 5]]\n" +">>> g = (*i for i in x)\n" +">>> list(g)\n" +"[1, 2, 3, 4, 5]" #: ../../tutorial/classes.rst:937 msgid "" @@ -1939,22 +1966,30 @@ msgid "" "parentheses. That is to say, the following two pieces of code are " "semantically equivalent::" msgstr "" +"多くの場合、ジェネレータ式は括弧で囲む必要があります。 ただし特例として、唯" +"一の実引数として関数に渡す場合(前述の ``sum``, ``set``, ``max``, ``list`` の" +"例のように)は、ジェネレータ式を追加の括弧で囲む必要がありません。 すなわ" +"ち、次の2つのコード片は意味的に等価です::" #: ../../tutorial/classes.rst:944 msgid "" ">>> f(x for x in y)\n" ">>> f((x for x in y))" msgstr "" +">>> f(x for x in y)\n" +">>> f((x for x in y))" #: ../../tutorial/classes.rst:947 msgid "as are the following::" -msgstr "" +msgstr "以下も同様です::" #: ../../tutorial/classes.rst:949 msgid "" ">>> f(*x for x in y)\n" ">>> f((*x for x in y))" msgstr "" +">>> f(*x for x in y)\n" +">>> f((*x for x in y))" #: ../../tutorial/classes.rst:954 msgid "Footnotes" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index bfefc75f6..41e737a8e 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/controlflow.rst:5 @@ -658,7 +658,7 @@ msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "" "複数のリテラルを ``|`` (\"or\")を使用して組み合わせて1つのパターンにできま" -"す::" +"す。" #: ../../tutorial/controlflow.rst:320 msgid "" @@ -689,10 +689,10 @@ msgid "" " case _:\n" " raise ValueError(\"Not a point\")" msgstr "" -"# point(座標) は (x, y) のタプル\n" +"# point は (x, y) のタプル\n" "match point:\n" " case (0, 0):\n" -" print(\"原点\")\n" +" print(\"Origin\")\n" " case (0, y):\n" " print(f\"Y={y}\")\n" " case (x, 0):\n" @@ -700,7 +700,7 @@ msgstr "" " case (x, y):\n" " print(f\"X={x}, Y={y}\")\n" " case _:\n" -" raise ValueError(\"座標ではない\")" +" raise ValueError(\"Not a point\")" #: ../../tutorial/controlflow.rst:339 msgid "" @@ -776,10 +776,10 @@ msgid "" "attribute to the ``var`` variable)::" msgstr "" "いくつかの組み込みクラスでは位置引数が使用でき、属性の順番を提供します(例: " -"データクラス)。クラスの ``__match_args__`` 特殊属性によって、パターンの中で属" -"性の明確な位置を定義することもできます。(\"x\", \"y\")が設定された場合、以下" -"のすべてのパターンは等価です(すべて属性 ``y`` が ``var`` 変数に結びつけられま" -"す)::" +"データクラス)。クラスの ``__match_args__`` 特殊属性でによって、パターンの中で" +"属性の明確な位置を定義することもできます。(\"x\", \"y\")が設定された場合、以" +"下のすべてのパターンは等価です(すべて属性 ``y`` が ``var`` 変数に関連づけられ" +"ます)::" #: ../../tutorial/controlflow.rst:374 msgid "" @@ -866,7 +866,7 @@ msgid "" msgstr "" "パターンに ``if`` 節を追加できます。これは \"ガード\" と呼ばれます。ガードが" "falseの場合、``match`` は次のcaseブロックの処理に移動します。ガードを評価する" -"前に値が取り込まれることに注意してください::" +"前に値が取り出されることに注意してください::" #: ../../tutorial/controlflow.rst:411 msgid "" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 18ef95ba8..237f83b7f 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Masahiro Ito, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/datastructures.rst:5 diff --git a/tutorial/errors.po b/tutorial/errors.po index cefc05e6f..02d32e1cf 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/errors.rst:5 diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index a5efeebc9..ff95551d7 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/floatingpoint.rst:10 diff --git a/tutorial/index.po b/tutorial/index.po index 881264931..86989ae6b 100644 --- a/tutorial/index.po +++ b/tutorial/index.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Masahiro Ito, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/index.rst:5 diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 37d3e5355..97757e89d 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/inputoutput.rst:5 diff --git a/tutorial/interactive.po b/tutorial/interactive.po index 4ac5c60ee..427a20dc3 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/interactive.rst:5 diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index 091f711a0..d5c49d799 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/interpreter.rst:5 diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 402499668..97d15ee74 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/introduction.rst:5 diff --git a/tutorial/modules.po b/tutorial/modules.po index d9b2875b6..b0eb462e4 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/modules.rst:5 diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index df089f33d..8771bc127 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/stdlib.rst:5 diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index 3f5edb113..c21184203 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/stdlib2.rst:5 diff --git a/tutorial/venv.po b/tutorial/venv.po index 9a35fb889..1bcc8c0a5 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/venv.rst:6 diff --git a/tutorial/whatnow.po b/tutorial/whatnow.po index 1506d0d6e..8bb7d24a5 100644 --- a/tutorial/whatnow.po +++ b/tutorial/whatnow.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../tutorial/whatnow.rst:5 diff --git a/using/android.po b/using/android.po index c9723a888..f8ea1fd9d 100644 --- a/using/android.po +++ b/using/android.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/android.rst:5 diff --git a/using/cmdline.po b/using/cmdline.po index 9ca697f2d..9e40d5fd5 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/cmdline.rst:9 diff --git a/using/configure.po b/using/configure.po index 18ae5d58e..ec117cda6 100644 --- a/using/configure.po +++ b/using/configure.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/configure.rst:3 diff --git a/using/editors.po b/using/editors.po index 6ef4c3c48..9f432bcab 100644 --- a/using/editors.po +++ b/using/editors.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/editors.rst:7 diff --git a/using/index.po b/using/index.po index 46888605f..38eee617b 100644 --- a/using/index.po +++ b/using/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/index.rst:5 diff --git a/using/ios.po b/using/ios.po index 1fe8c8bf9..6ad2ee587 100644 --- a/using/ios.po +++ b/using/ios.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/ios.rst:5 diff --git a/using/mac.po b/using/mac.po index f80f6c488..e8d81ef3f 100644 --- a/using/mac.po +++ b/using/mac.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/mac.rst:7 diff --git a/using/unix.po b/using/unix.po index aac01b61f..1a4d9a716 100644 --- a/using/unix.po +++ b/using/unix.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/unix.rst:7 diff --git a/using/windows.po b/using/windows.po index 1f65225c7..8309b20c3 100644 --- a/using/windows.po +++ b/using/windows.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/windows.rst:13 diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 382c76467..66c36ab7a 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.0.rst:3 diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index b2f95cf94..710c8b96b 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.1.rst:3 diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 7efc14760..b298d0517 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.2.rst:3 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 32958958c..71b062366 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.3.rst:3 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 20ed91285..7e010abb8 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.4.rst:3 diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index a98236847..eec3d3318 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.5.rst:3 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 65204a57f..e39c0ac0a 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.6.rst:5 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 5431c9565..aa5c7ff56 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/2.7.rst:3 diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 14c2195ab..8aa8d0986 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.0.rst:3 diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 3b6bba963..b260646a0 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.1.rst:3 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 5ef1fcfc6..9c1504c1b 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Takanori Suzuki , 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.10.rst:3 diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 5554f4e68..9b2c0c182 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.11.rst:3 @@ -88,7 +88,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:79 msgid "Interpreter improvements:" -msgstr "インタープリタの改善:" +msgstr "インタプリタの改善:" #: ../../whatsnew/3.11.rst:81 msgid ":ref:`whatsnew311-pep657`" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index a5fa6b423..ff361e521 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.12.rst:4 @@ -100,7 +100,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:90 msgid "New syntax features:" -msgstr "新たな構文機能:" +msgstr "新たな文法機能:" #: ../../whatsnew/3.12.rst:92 msgid "" @@ -122,7 +122,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" -msgstr "インタープリタの改善:" +msgstr "インタプリタの改善:" #: ../../whatsnew/3.12.rst:100 msgid "" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 1d95175f0..aabe5f7e8 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.13.rst:4 @@ -119,7 +119,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:98 msgid "Interpreter improvements:" -msgstr "インタープリタの改善点:" +msgstr "インタプリタの改善:" #: ../../whatsnew/3.13.rst:100 msgid "" @@ -182,7 +182,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:122 msgid "Python data model improvements:" -msgstr "Python のデータモデルの改善点:" +msgstr "Python のデータモデルの改善:" #: ../../whatsnew/3.13.rst:124 msgid "" @@ -202,7 +202,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:129 msgid "Significant improvements in the standard library:" -msgstr "標準ライブラリーの顕著な改善点:" +msgstr "標準ライブラリーの顕著な改善" #: ../../whatsnew/3.13.rst:131 msgid "" @@ -264,7 +264,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:145 msgid "Security improvements:" -msgstr "セキュリティの改善点:" +msgstr "セキュリティの改善:" #: ../../whatsnew/3.13.rst:147 msgid "" @@ -278,7 +278,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:150 msgid "C API improvements:" -msgstr "C API の改善点:" +msgstr "C API の改善:" #: ../../whatsnew/3.13.rst:152 msgid "" @@ -1176,7 +1176,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:627 msgid "array" -msgstr "配列" +msgstr "array" #: ../../whatsnew/3.13.rst:629 msgid "" diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index c45e1f090..407dd59cd 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: python-doc bot, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.14.rst:4 diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 1f8d63c31..459c658ac 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.2.rst:3 diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index bc4f10054..f604a9403 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.3.rst:3 diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 5f3697155..11d7b8330 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.4.rst:3 diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index e39b26410..303a66f58 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.5.rst:3 diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 1b338d644..b096e6c97 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.6.rst:3 diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index fc825da0d..e2b265b04 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Masahiro Ito, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.7.rst:3 diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 9a20428cd..a8e733550 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: b785ccb154ea7c5e4722f287fb17d327_f3b4082, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.8.rst:3 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 35496a72f..48b86a5b4 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/3.9.rst:3 diff --git a/whatsnew/changelog.po b/whatsnew/changelog.po index 366eb5119..b2821fd46 100644 --- a/whatsnew/changelog.po +++ b/whatsnew/changelog.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Cheesecake, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/changelog.rst:7 diff --git a/whatsnew/index.po b/whatsnew/index.po index ea5ebe2b7..0e62491c6 100644 --- a/whatsnew/index.po +++ b/whatsnew/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../whatsnew/index.rst:5 From 0eb1c83e37d41d48b4c7cadfcb87b0ccd0f61ff8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 19 Oct 2026 04:32:19 +0000 Subject: [PATCH 02/21] Merge 3.15 into 3.14 --- builtins/stdtypes.po | 2 +- glossary.po | 2 +- library/stdtypes.po | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtins/stdtypes.po b/builtins/stdtypes.po index 8131d1644..f67ad8f71 100644 --- a/builtins/stdtypes.po +++ b/builtins/stdtypes.po @@ -11400,7 +11400,7 @@ msgstr "コンテキスト管理" #: ../../builtins/stdtypes.rst:6140 msgid "annotation" -msgstr "注釈" +msgstr "annotation" #: ../../builtins/stdtypes.rst:6140 msgid "type annotation; type hint" diff --git a/glossary.po b/glossary.po index a2b403405..2142dea27 100644 --- a/glossary.po +++ b/glossary.po @@ -108,7 +108,7 @@ msgstr "" #: ../../glossary.rst:47 msgid "annotation" -msgstr "注釈" +msgstr "annotation" #: ../../glossary.rst:49 msgid "" diff --git a/library/stdtypes.po b/library/stdtypes.po index 947a24575..7b00d79ec 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -11049,7 +11049,7 @@ msgstr "コンテキスト管理" #: ../../library/stdtypes.rst:5869 msgid "annotation" -msgstr "注釈" +msgstr "annotation" #: ../../library/stdtypes.rst:5869 msgid "type annotation; type hint" From 1e9efba25283c2579d9d9d5fb8455563c8b86652 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 19 Oct 2026 23:54:30 +0000 Subject: [PATCH 03/21] Merge 3.15 into 3.14 --- tutorial/interpreter.po | 127 ++++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 57 deletions(-) diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index d5c49d799..a6b65cdd4 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -24,11 +24,11 @@ msgstr "" #: ../../tutorial/interpreter.rst:5 msgid "Using the Python Interpreter" -msgstr "Python インタプリタを使う" +msgstr "Python インタープリタを使う" #: ../../tutorial/interpreter.rst:11 msgid "Invoking the Interpreter" -msgstr "インタプリタを起動する" +msgstr "インタープリタを起動する" #: ../../tutorial/interpreter.rst:13 msgid "" @@ -37,14 +37,14 @@ msgid "" "available; putting :file:`/usr/local/bin` in your Unix shell's search path " "makes it possible to start it by typing the command:" msgstr "" -"Python が使用可能な環境では、インタプリタは一般的に |" +"Python が使用可能な環境では、インタープリタは一般的に |" "usr_local_bin_python_x_dot_y_literal| にインストールされています。使用してい" "る Unix シェルの検索パスに :file:`/usr/local/bin` を追加すると、次のコマンド" -"でインタプリタを開始できます:" +"をシェルに入力してインタープリタを起動できます:" #: ../../tutorial/interpreter.rst:17 msgid "python3.15" -msgstr "" +msgstr "python3.15" #: ../../tutorial/interpreter.rst:21 msgid "" @@ -53,10 +53,10 @@ msgid "" "local Python guru or system administrator. (E.g., :file:`/usr/local/python` " "is a popular alternative location.)" msgstr "" -"[#]_ どのディレクトリに Python インタプリタをインストールするかはインストール" -"時に選択できるので、インタプリタは他のディレクトリにあるかもしれません; 身近" -"な Python に詳しい人か、システム管理者に聞いてみてください。 (例えば、その他" -"の場所としては :file:`/usr/local/python` が一般的です。)" +"[#]_ インタープリタのインストール先ディレクトリはインストール時に選択できるの" +"で、別の場所にある場合もあります。身近な Python に詳しい人か、システム管理者" +"に確認してください。(例えば、 :file:`/usr/local/python` もよく使われる場所で" +"す。)" #: ../../tutorial/interpreter.rst:26 msgid "" @@ -66,7 +66,7 @@ msgid "" "can use the :file:`py` command. See :ref:`setting-envvars` for other ways to " "launch Python." msgstr "" -":ref:`Microsoft ストア ` からPythonのインストールを行った " +":ref:`Microsoft ストア ` から Python をインストールした " "Windows マシンでは、 |python_x_dot_y_literal| コマンドが利用できます。\n" ":ref:`py.exe ランチャ ` をインストールした場合、 :file:`py` コマン" "ドが使えます。\n" @@ -80,10 +80,10 @@ msgid "" "exit status. If that doesn't work, you can exit the interpreter by typing " "the following command: ``quit()``." msgstr "" -"ファイル終端文字 (Unixでは :kbd:`Control-D` 、DOS や Windows では :kbd:" -"`Control-Z`) を一次プロンプト (訳注: '>>>' のこと) に入力すると、インタプリタ" -"が終了ステータス 0 で終了します。もしこの操作がうまく働かないなら、コマンド: " -"``quit()`` と入力すればインタプリタを終了できます。" +"ファイル終端文字 (Unix では :kbd:`Control-D` 、Windows では :kbd:`Control-" +"Z`) を一次プロンプトに入力すると、インタープリタは終了ステータス 0 で終了しま" +"す。この操作で終了できない場合は、 ``quit()`` と入力してインタープリタを終了" +"できます。" #: ../../tutorial/interpreter.rst:36 msgid "" @@ -97,6 +97,14 @@ msgid "" "available; you'll only be able to use backspace to remove characters from " "the current line." msgstr "" +"ほとんどのシステムでは、インタープリタの行編集機能として、対話型の編集、履歴" +"置換、コード補完を利用できます。コマンドライン編集が使えるかどうかを確かめる" +"には、Python のプロンプトで単語を入力してから左矢印キー (または :kbd:" +"`Control-b`) を押すのがおそらく最も手軽な方法です。カーソルが動けば、コマンド" +"ライン編集が利用できます。キーの使い方については、付録の :ref:`tut-" +"interacting` を参照してください。何も起こらないか、 ``^[[D`` や ``^B`` のよう" +"な文字列が表示される場合は、コマンドライン編集を利用できません。その場合、現" +"在の行から文字を削除するにはバックスペースを使うしかありません。" #: ../../tutorial/interpreter.rst:46 msgid "" @@ -105,10 +113,10 @@ msgid "" "interactively; when called with a file name argument or with a file as " "standard input, it reads and executes a *script* from that file." msgstr "" -"インタプリタは Unix シェルと同じように使えます。標準入力が端末に接続された状" -"態では、コマンドを対話的に読み込んで実行します。ファイル名を引数に指定する" -"か、``python3 < filename`` のように標準入力ファイルとして指定すると、インタプ" -"リタはファイルから *スクリプト* を読み込んで実行します。" +"インタープリタは Unix シェルに似た動作をします。標準入力が端末 (tty) に接続さ" +"れた状態で起動すると、コマンドを対話的に読み込んで実行します。ファイル名を引" +"数に指定するか、ファイルを標準入力として起動すると、そのファイルから *スクリ" +"プト* を読み込んで実行します。" #: ../../tutorial/interpreter.rst:51 msgid "" @@ -118,11 +126,11 @@ msgid "" "characters that are special to the shell, it is usually advised to quote " "*command* in its entirety." msgstr "" -"インタプリタを ``python -c command [arg] ...`` のように起動する方法もありま" +"インタープリタを ``python -c command [arg] ...`` のように起動する方法もありま" "す。この形式では、シェルの :option:`-c` オプションと同じように、 *command* に" -"指定した文を実行します。 Python 文には、スペースなどのシェルにとって特殊な意" -"味をもつ文字がしばしば含まれるので、 *command* 全体をクォート(訳注: ``'``)で" -"囲っておいたほうが良いでしょう。" +"指定した文を実行します。Python の文には空白や、シェルにとって特殊な意味を持つ" +"文字が含まれることが多いため、通常は *command* 全体を引用符で囲むことをお勧め" +"します。" #: ../../tutorial/interpreter.rst:57 msgid "" @@ -168,19 +176,19 @@ msgid "" "interpreter's option processing but left in ``sys.argv`` for the command or " "module to handle." msgstr "" -"スクリプト名と引数を指定してインタプリタを起動した場合、スクリプト名やスクリ" -"プト名以後に指定した引数は、文字列のリストに変換されて ``sys`` モジュールの " -"``argv`` 変数に格納されます。 ``import sys`` とすることでこのリストにアクセス" -"できます。 \n" -"``sys.argv`` には少なくとも一つ要素が入っています。スクリプト名も引数も指定し" -"なければ、 ``sys.argv[0]`` は空の文字列になります。\n" +"インタープリタにスクリプト名とその後に続く引数を渡すと、それらは文字列のリス" +"トに変換され、 ``sys`` モジュールの ``argv`` 変数に代入されます。 ``import " +"sys`` を実行すると、このリストにアクセスできます。\n" +"リストには少なくとも一つの要素があります。スクリプト名も引数も指定しない場" +"合、 ``sys.argv[0]`` は空文字列になります。\n" "スクリプト名の代わりに ``'-'`` (標準入力を意味します) を指定すると、 ``sys." "argv[0]`` は ``'-'`` になります。\n" -":option:`-c` *command* を使うと、 ``sys.argv[0]`` は ``'-c'`` になります。 :" -"option:`-m` *module* を使った場合、 ``sys.argv[0]`` はモジュールのフルパスに" -"なります。 Python インタープリタは、:option:`-c` *command* や :option:`-m` " -"*module* の後ろに指定したオプションは無視します。無視された引数は、``sys." -"argv`` を使って *command* や *module* から参照できます。" +":option:`-c` *command* を使うと、 ``sys.argv[0]`` は ``'-c'`` になります。 :" +"option:`-m` *module* を使うと、 ``sys.argv[0]`` は見つかったモジュールのフル" +"パスになります。\n" +":option:`-c` *command* や :option:`-m` *module* の後に指定したオプションは、" +"Python インタープリタのオプションとしては処理されず、コマンドやモジュールが処" +"理できるように ``sys.argv`` に残されます。" #: ../../tutorial/interpreter.rst:89 msgid "Interactive Mode" @@ -195,15 +203,14 @@ msgid "" "dots (``...``). The interpreter prints a welcome message stating its version " "number and a copyright notice before printing the first prompt:" msgstr "" -"インタプリタが命令を端末 (tty) やコマンドプロンプトから読み取っている場合、イ" -"ンタプリタは *対話モード (interactive mode)* で動作しているといいます。\n" -"このモードでは、インタプリタは *一次プロンプト (primary prompt)* を表示して、" -"ユーザにコマンドを入力するよう促します。一次プロンプトは普通、三つの「大なり" -"記号」 (``>>>``) です。継続行では、インタプリタは *二次プロンプト (secondary " -"prompt)* を表示します。二次プロンプトは、デフォルトでは三つのドット (``..." -"``) です。\n" -"インタプリタは、最初のプロンプトを出す前にバージョン番号と著作権表示から始ま" -"る起動メッセージを出力します:" +"インタープリタが端末 (tty) からコマンドを読み込んでいるとき、 *対話モード " +"(interactive mode)* で動作しているといいます。\n" +"このモードでは、 *一次プロンプト (primary prompt)* を表示して、次のコマンドの" +"入力を促します。一次プロンプトは通常、三つの大なり記号 (``>>>``) です。継続行" +"では *二次プロンプト (secondary prompt)* を表示します。二次プロンプトは、デ" +"フォルトでは三つのドット (``...``) です。\n" +"インタープリタは、最初のプロンプトを表示する前に、バージョン番号と著作権表示" +"を含む起動メッセージを出力します:" #: ../../tutorial/interpreter.rst:98 msgid "" @@ -214,14 +221,20 @@ msgid "" "information.\n" ">>>" msgstr "" +"$ python3.15\n" +"Python 3.15 (default, May 7 2025, 15:46:04)\n" +"[GCC 10.2.0] on linux\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" +">>>" #: ../../tutorial/interpreter.rst:108 msgid "" "Continuation lines are needed when entering a multi-line construct. As an " "example, take a look at this :keyword:`if` statement::" msgstr "" -"継続行は、複数行の構文を入力するときに使います。例えば、 :keyword:`if` 文は継" -"続行を使用します ::" +"複数行にわたる構文を入力するには、継続行が必要です。例として、次の :keyword:" +"`if` 文を見てみましょう::" #: ../../tutorial/interpreter.rst:111 msgid "" @@ -243,7 +256,7 @@ msgstr "対話モードについての詳細は :ref:`tut-interac` を参照し #: ../../tutorial/interpreter.rst:124 msgid "The Interpreter and Its Environment" -msgstr "インタプリタとその環境" +msgstr "インタープリタとその環境" #: ../../tutorial/interpreter.rst:130 msgid "Source Code Encoding" @@ -259,21 +272,21 @@ msgid "" "properly, your editor must recognize that the file is UTF-8, and it must use " "a font that supports all the characters in the file." msgstr "" -"デフォルトでは、Python のソースコードは UTF-8 でエンコードされているものとし" -"て扱われます。UTF-8 では、世界中のほとんどの言語の文字を、同時に文字列リテラ" -"ル、識別子、コメントなどに書けます。--- ただし、標準ライブラリは識別子に " -"ASCII 文字のみを利用していて、その他のポータブルなコードもその慣習に従うべき" -"です。それらの文字を正しく表示するためには、エディターはそのファイルが UTF-8 " -"である事を識別して、そのファイルに含まれている文字を全てサポートしたフォント" -"を使わなければなりません。" +"デフォルトでは、Python のソースファイルは UTF-8 でエンコードされているものと" +"して扱われます。このエンコーディングでは、世界中のほとんどの言語の文字を、文" +"字列リテラル、識別子、コメントで同時に使えます。ただし、標準ライブラリでは識" +"別子に ASCII 文字だけを使っており、移植性を重視するコードもこの慣習に従うべき" +"です。これらの文字を全て正しく表示するには、エディタがファイルのエンコーディ" +"ングを UTF-8 と認識し、ファイル内の全ての文字に対応したフォントを使う必要があ" +"ります。" #: ../../tutorial/interpreter.rst:140 msgid "" "To declare an encoding other than the default one, a special comment line " "should be added as the *first* line of the file. The syntax is as follows::" msgstr "" -"デフォルトエンコーディング以外のエンコーディングを使用するには、ファイルの *" -"先頭* の行に特別なコメントを追加しなければなりません。書式は以下の通りです::" +"デフォルト以外のエンコーディングを宣言するには、ファイルの *先頭* の行に特別" +"なコメントを追加します。書式は次の通りです::" #: ../../tutorial/interpreter.rst:143 msgid "# -*- coding: encoding -*-" @@ -326,6 +339,6 @@ msgid "" "executable named ``python``, so that it does not conflict with a " "simultaneously installed Python 2.x executable." msgstr "" -"Unixでは、Python 3.x インタープリタの実行ファイルはデフォルトでは ``python`` " -"という名前ではインストールされません。同時にインストールされた Python 2.x 実" -"行ファイルと衝突させないためです。" +"Unix では、Python 3.x インタープリタの実行ファイルはデフォルトでは " +"``python`` という名前ではインストールされません。同時にインストールされた " +"Python 2.x 実行ファイルと衝突させないためです。" From 69ce6048509e17f8f92fb4f99d703d70c4141a46 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 20 Oct 2026 09:19:29 +0000 Subject: [PATCH 04/21] Merge 3.15 into 3.14 --- bugs.po | 3 +- builtins/stdtypes.po | 29 +++-- c-api/arg.po | 60 ++++----- c-api/typeobj.po | 8 +- extending/extending.po | 66 +++++----- glossary.po | 16 ++- howto/argparse.po | 2 +- howto/enum.po | 4 +- howto/logging-cookbook.po | 10 +- library/argparse.po | 5 +- library/array.po | 10 +- library/asyncio-dev.po | 4 +- library/asyncio-protocol.po | 6 +- library/bdb.po | 6 +- library/codecs.po | 8 +- library/collections.abc.po | 8 +- library/curses.po | 10 +- library/datetime.po | 29 +++-- library/dbm.po | 2 +- library/decimal.po | 60 ++++----- library/doctest.po | 66 +++++----- library/email.header.po | 4 +- library/gettext.po | 4 +- library/gzip.po | 14 +-- library/http.server.po | 4 +- library/importlib.po | 14 +-- library/io.po | 8 +- library/itertools.po | 2 +- library/locale.po | 6 +- library/logging.po | 8 +- library/mailbox.po | 14 +-- library/mmap.po | 4 +- library/multiprocessing.po | 6 +- library/optparse.po | 76 ++++++------ library/os.po | 18 +-- library/pathlib.po | 20 +-- library/platform.po | 4 +- library/poplib.po | 4 +- library/profile.po | 18 +-- library/pyexpat.po | 2 +- library/runpy.po | 4 +- library/shlex.po | 10 +- library/shutil.po | 8 +- library/signal.po | 5 +- library/socket.po | 16 +-- library/sqlite3.po | 55 ++++---- library/stdtypes.po | 29 +++-- library/subprocess.po | 4 +- library/sys.po | 12 +- library/tarfile.po | 1 - library/tempfile.po | 4 +- library/threading.po | 41 +++--- library/time.po | 16 +-- library/tkinter.ttk.po | 4 +- library/typing.po | 2 +- library/unittest.mock.po | 16 +-- library/unittest.po | 27 ++-- library/urllib.request.po | 2 +- library/xml.dom.po | 8 +- library/xml.etree.elementtree.po | 4 +- library/xml.po | 7 +- library/xml.sax.reader.po | 8 +- library/xmlrpc.server.po | 8 +- library/zipimport.po | 2 +- reference/compound_stmts.po | 18 +-- reference/datamodel.po | 22 ++-- reference/executionmodel.po | 12 +- reference/expressions.po | 2 +- reference/import.po | 16 +-- reference/simple_stmts.po | 18 +-- reference/toplevel_components.po | 4 +- tutorial/controlflow.po | 27 ++-- tutorial/errors.po | 8 +- tutorial/floatingpoint.po | 207 +++++++++++++++++-------------- tutorial/inputoutput.po | 2 +- tutorial/interactive.po | 8 +- tutorial/introduction.po | 4 +- tutorial/modules.po | 2 +- tutorial/stdlib2.po | 38 +++--- whatsnew/2.0.po | 22 ++-- whatsnew/2.2.po | 27 ++-- whatsnew/2.3.po | 84 ++++++------- whatsnew/2.4.po | 4 +- whatsnew/2.5.po | 20 +-- whatsnew/2.6.po | 6 +- whatsnew/3.0.po | 16 +-- whatsnew/3.1.po | 16 +-- whatsnew/3.10.po | 14 +-- whatsnew/3.13.po | 4 +- whatsnew/3.14.po | 2 +- whatsnew/3.2.po | 48 +++---- whatsnew/3.3.po | 97 +++++++-------- whatsnew/3.4.po | 45 ++++--- whatsnew/3.7.po | 3 +- 94 files changed, 861 insertions(+), 870 deletions(-) diff --git a/bugs.po b/bugs.po index 6d3ed01dd..e303c52b8 100644 --- a/bugs.po +++ b/bugs.po @@ -68,8 +68,7 @@ msgid "" "`_ instead." msgstr "" "このドキュメントの翻訳に関する不備や改善の提案の場合は、代わりに `翻訳用リポ" -"ジトリ `_ へ報告してくださ" -"い。" +"ジトリ `_ へ報告してください。" #: ../../bugs.rst:31 msgid "" diff --git a/builtins/stdtypes.po b/builtins/stdtypes.po index f67ad8f71..5d9aecc31 100644 --- a/builtins/stdtypes.po +++ b/builtins/stdtypes.po @@ -7342,7 +7342,7 @@ msgstr "" #: ../../builtins/stdtypes.rst:4938 msgid "Here is an example with a non-byte format::" -msgstr ":class:`~memoryview.format` が単バイト単位ではない例を示します::" +msgstr "``format`` が単バイト単位ではない例を示します::" #: ../../builtins/stdtypes.rst:4940 msgid "" @@ -8020,9 +8020,9 @@ msgid "" "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -"空でない :class:`set` (:class:`frozenset` ではない) は、:class:`set` コンスト" -"ラクタに加え、要素を波括弧中にカンマで区切って列挙することでも生成できます。" -"例: ``{'jack', 'sjoerd'}``。" +"空でない ``set`` (``frozenset`` ではない) は、:class:`set` コンストラクタに加" +"え、要素を波括弧中にカンマで区切って列挙することでも生成できます。例: " +"``{'jack', 'sjoerd'}``。" #: ../../builtins/stdtypes.rst:5422 msgid "The constructors for both classes work the same:" @@ -8035,11 +8035,11 @@ msgid "" "sets of sets, the inner sets must be :class:`frozenset` objects. If " "*iterable* is not specified, a new empty set is returned." msgstr "" -"*iterable* から要素を取り込んだ、新しい :class:`set` もしくは :class:" -"`frozenset` オブジェクトを返します。 集合の要素は :term:`ハッシュ可能 " -"` なものでなくてはなりません。集合の集合を表現するためには、内側の" -"集合は :class:`frozenset` オブジェクトでなくてはなりません。*iterable* が指定" -"されない場合、新しい空の集合が返されます。" +"*iterable* から要素を取り込んだ、新しい ``set`` もしくは ``frozenset`` オブ" +"ジェクトを返します。 集合の要素は :term:`ハッシュ可能 ` なものでな" +"くてはなりません。集合の集合を表現するためには、内側の集合は :class:" +"`frozenset` オブジェクトでなくてはなりません。*iterable* が指定されない場合、" +"新しい空の集合が返されます。" #: ../../builtins/stdtypes.rst:5433 msgid "Sets can be created by several means:" @@ -9092,12 +9092,11 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" "Python の :term:`ジェネレータ ` と :class:`contextlib." -"contextmanager` :term:`デコレータ ` はこのプロトコルの簡便な実装" -"方法を提供します。ジェネレータ関数を :class:`contextlib.contextmanager` デコ" -"レータでデコレートすると、デコレートされないジェネレータ関数が作成するイテ" -"レータの代わりに、必要な :meth:`~contextmanager.__enter__` および :meth:" -"`~contextmanager.__exit__` メソッドを実装したコンテキストマネージャを返すよう" -"になります。" +"contextmanager` デコレータはこのプロトコルの簡便な実装方法を提供します。ジェ" +"ネレータ関数を :class:`contextlib.contextmanager` デコレータでデコレートする" +"と、デコレートされないジェネレータ関数が作成するイテレータの代わりに、必要" +"な :meth:`~contextmanager.__enter__` および :meth:`~contextmanager.__exit__` " +"メソッドを実装したコンテキストマネージャを返すようになります。" #: ../../builtins/stdtypes.rst:6130 msgid "" diff --git a/c-api/arg.po b/c-api/arg.po index f4ad318c1..bad97e1e7 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -116,10 +116,10 @@ msgid "" msgstr "" "形式としては ``y*`` そして ``s*`` 埋める :c:type:`Py_buffer` 構造体。これは" "ロックします 根底 バッファ これにより、呼び出し元はその後、バッファを内部でも" -"使用できるようになります:c:type:`Py_BEGIN_ALLOW_THREADS` ブロック リスクなし" -"に 可変 データが再サイズ化または破壊される。その結果、**電話をかけなければな" -"らない** :c:func:`PyBuffer_Release` データ処理が完了した後(または早期終了の" -"場合)。" +"使用できるようになります :c:type:`Py_BEGIN_ALLOW_THREADS` ブロック リスクな" +"しに 可変 データが再サイズ化または破壊される。その結果、**電話をかけなければ" +"ならない** :c:func:`PyBuffer_Release` データ処理が完了した後(または早期終了" +"の場合)。" #: ../../c-api/arg.rst:57 msgid "" @@ -139,11 +139,11 @@ msgid "" "corresponding Python object, and shares the lifetime of this object. You " "won't have to release any memory yourself." msgstr "" -"他の形式では :class:`str` または 読み出し専用 :term:`bytes-like オブジェクト" -"`、例えば :class:`bytes`, および提供する ``const char *`` ポインタ その " -"バッファ. この場合 バッファ「借用」されています:これは対応するPythonオブジェ" -"クトによって管理され、このオブジェクトのライフサイクルを共有します。メモリを" -"自分で解放する必要はありません。 " +"他の形式では :class:`str` または 読み出し専用 :term:`bytes-like オブジェクト " +"`、例えば :class:`bytes`, および提供する ``const char " +"*`` ポインタ その バッファ. この場合 バッファ「借用」されています:これは対応" +"するPythonオブジェクトによって管理され、このオブジェクトのライフサイクルを共" +"有します。メモリを自分で解放する必要はありません。 " #: ../../c-api/arg.rst:70 msgid "" @@ -759,10 +759,10 @@ msgid "" "`strong reference` to the object is not created (i.e. its reference count is " "not increased). The pointer stored is not ``NULL``." msgstr "" -"Python オブジェクトを(変換なしで)C オブジェクトのポインターに格納します。 " -"これにより、C プログラムは渡された実際のオブジェクトを受け取ります。新しい :" -"term: 強参照 オブジェクトが作成されていません (すなわち、その参照カウント 増" -"加しません)。その ポインタ 保存されていない ``NULL``." +"Python オブジェクトを変換せずに C オブジェクトのポインタに格納します。これに" +"より、C プログラムは渡されたオブジェクトそのものを受け取ります。オブジェクト" +"への新しい :term:`強参照 ` は作成されません(つまり、参照カ" +"ウントは増加しません)。格納されるポインタは ``NULL`` ではありません。" #: ../../c-api/arg.rst:326 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" @@ -1124,14 +1124,14 @@ msgstr "" "数の型を指定する 。関数 これを使用する メソッド 彼らの パラメータ 次のように" "宣言する必要があります :c:macro:`METH_VARARGS` に 関数 にメソッド テーブル。" "実際のパラメーターを含むタプルは *args* として渡す必要があります。必ずタプル" -"でなければなりません。タプルの長さは、*min*以上で*max*以下でなければなりませ" -"ん。*min*と*max*は等しい場合もあります。関数には追加の引数を渡す必要があり、" -"各引数はポインターでなければならない ~へ:c:expr:`PyObject*` 変数;これらは" -"*args*の値で埋められる;これらは:term:を含む :term:`借用参照 `。*args* で指定されていないオプションパラメーターに対応する変数は" -"初期化されません。これらの変数は呼び出し元で初期化する必要があります。これ 関" -"数 成功した場合にtrueを返し、*args*がタプルでない場合または要素の数が間違って" -"いる場合にfalseを返します。失敗した場合、例外が設定されます。" +"でなければなりません。タプルの長さは、 *min* 以上で *max* 以下でなければなり" +"ません。 *min* と *max* は等しい場合もあります。関数には追加の引数を渡す必要" +"があり、各引数はポインターでなければならない ~へ :c:expr:`PyObject*` 変数;" +"これらは *args* の値で埋められる;これらは :term:`借用参照 ` を含みます。 *args* で指定されていないオプションパラメーターに対" +"応する変数は初期化されません。これらの変数は呼び出し元で初期化する必要があり" +"ます。これ 関数 成功した場合にtrueを返し、 *args* がタプルでない場合または要" +"素の数が間違っている場合にfalseを返します。失敗した場合、例外が設定されます。" #: ../../c-api/arg.rst:563 msgid "" @@ -1460,12 +1460,12 @@ msgid "" "func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If " "no exception has been raised yet, :exc:`SystemError` is set." msgstr "" -"Python オブジェクトをそのまま渡すものの、それに対する新しい :term:`強参照` を" -"作成する(つまり、その参照カウントが1増加します)。渡されたオブジェクトが " -"``NULL`` ポインタ, この問題は、引数を生成する呼び出しがエラーを検出し、例外を" -"設定したため発生したものと推測されます。したがって、:c:func:`Py_BuildValue` " -"戻ってきます ``NULL`` しかし、そうはならない 送出 例外。 例外がまだ発生してい" -"ない場合、:exc:`SystemError` 設定されています。" +"Python オブジェクトをそのまま渡すものの、それに対する新しい :term:`強参照 " +"` を作成する(つまり、その参照カウントが1増加します)。渡さ" +"れたオブジェクトが ``NULL`` ポインタ, この問題は、引数を生成する呼び出しがエ" +"ラーを検出し、例外を設定したため発生したものと推測されます。したがって、:c:" +"func:`Py_BuildValue` 戻ってきます ``NULL`` しかし、そうはならない 送出 例" +"外。 例外がまだ発生していない場合、:exc:`SystemError` 設定されています。" #: ../../c-api/arg.rst:743 msgid "``S`` (object) [PyObject \\*]" @@ -1485,9 +1485,9 @@ msgid "" "Useful when the object is created by a call to an object constructor in the " "argument list." msgstr "" -"同じです ``O``, ただし、新しい :term:`強参照` を作成しません。オブジェクトが" -"引数リスト内のオブジェクトコンストラクターの呼び出しによって作成される場合に" -"便利です。" +"同じです ``O``, ただし、新しい :term:`強参照 ` を作成しませ" +"ん。オブジェクトが引数リスト内のオブジェクトコンストラクターの呼び出しによっ" +"て作成される場合に便利です。" #: ../../c-api/arg.rst:751 msgid "``O&`` (object) [*converter*, *anything*]" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 4486b3482..a844998b5 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -2168,10 +2168,10 @@ msgid "" "this handler.)" msgstr "" "オプションのポインタで、組み込みの演算 :func:`str` を実装している関数を指しま" -"す。(:class:`str` が型の一つになったため、 :func:`str` は :class:`str` のコン" -"ストラクタを呼び出すことに注意してください。このコンストラクタは実際の処理を" -"行う上で :c:func:`PyObject_Str` を呼び出し、さらに :c:func:`PyObject_Str` が" -"このハンドラを呼び出すことになります。)" +"す。(:class:`str` が型の一つになったため、 :func:`str` は ``str`` のコンスト" +"ラクタを呼び出すことに注意してください。このコンストラクタは実際の処理を行う" +"上で :c:func:`PyObject_Str` を呼び出し、さらに :c:func:`PyObject_Str` がこの" +"ハンドラを呼び出すことになります。)" #: ../../c-api/typeobj.rst:1057 msgid "The signature is the same as for :c:func:`PyObject_Str`::" diff --git a/extending/extending.po b/extending/extending.po index 7dbd941a4..66e5a1e02 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -162,9 +162,9 @@ msgstr "" ":c:func:`malloc` の呼び出し失敗は、常に例外にしなくてはなりません --- :c:" "func:`malloc` (または :c:func:`realloc`) を直接呼び出しているコードは、 :c:" "func:`PyErr_NoMemory` を呼び出して、失敗を示す値を返さねばなりません。オブ" -"ジェクトを生成する全ての関数 (例えば :c:func:`PyLong_FromLong`) は :c:func:" -"`PyErr_NoMemory` の呼び出しを済ませてしまうので、この規則が関係するのは直接 :" -"c:func:`malloc` を呼び出すコードだけです。" +"ジェクトを生成する全ての関数 (例えば :c:func:`PyLong_FromLong`) は " +"``PyErr_NoMemory()`` の呼び出しを済ませてしまうので、この規則が関係するのは直" +"接 :c:func:`malloc` を呼び出すコードだけです。" #: ../../extending/extending.rst:79 msgid "" @@ -536,15 +536,15 @@ msgid "" "handle the exception. If this is not possible or desirable, the exception " "should be cleared by calling :c:func:`PyErr_Clear`. For example::" msgstr "" -"とはいえ、戻り値を :c:func:`Py_DECREF` する前には、値が ``NULL`` でないか" -"チェックしておくことが重要です。もし ``NULL`` なら、呼び出した Python 関数は" -"例外を送出して終了させられています。 :c:func:`PyObject_CallObject` を呼び出し" -"ているコード自体もまた Python から呼び出されているのであれば、今度は C コード" -"が自分を呼び出している Python コードにエラー標示値を返さねばなりません。それ" -"により、インタプリタはスタックトレースを出力したり、例外を処理するための " -"Python コードを呼び出したりできます。例外の送出が不可能だったり、したくないの" -"なら、 :c:func:`PyErr_Clear` を呼んで例外を消去しておかねばなりません。例えば" -"以下のようにします::" +"とはいえ、戻り値を ``Py_DECREF()`` する前には、値が ``NULL`` でないかチェック" +"しておくことが重要です。もし ``NULL`` なら、呼び出した Python 関数は例外を送" +"出して終了させられています。 :c:func:`PyObject_CallObject` を呼び出している" +"コード自体もまた Python から呼び出されているのであれば、今度は C コードが自分" +"を呼び出している Python コードにエラー標示値を返さねばなりません。それによ" +"り、インタプリタはスタックトレースを出力したり、例外を処理するための Python " +"コードを呼び出したりできます。例外の送出が不可能だったり、したくないのな" +"ら、 :c:func:`PyErr_Clear` を呼んで例外を消去しておかねばなりません。例えば以" +"下のようにします::" #: ../../extending/extending.rst:320 msgid "" @@ -687,10 +687,10 @@ msgid "" "probably crash or at least overwrite random bits in memory. So be careful!" msgstr "" ":c:func:`PyArg_ParseTuple` は Python 側から与えられた引数が必要な型になってい" -"るか調べるのに対し、 :c:func:`PyArg_ParseTuple` は呼び出しの際に渡された C 変" -"数のアドレスが有効な値を持つか調べられないことに注意してください: ここで間違" -"いを犯すと、コードがクラッシュするかもしれませんし、少なくともでたらめなビッ" -"トをメモリに上書きしてしまいます。慎重に!" +"るか調べるのに対し、 ``PyArg_ParseTuple()`` は呼び出しの際に渡された C 変数の" +"アドレスが有効な値を持つか調べられないことに注意してください: ここで間違いを" +"犯すと、コードがクラッシュするかもしれませんし、少なくともでたらめなビットを" +"メモリに上書きしてしまいます。慎重に!" #: ../../extending/extending.rst:405 msgid "" @@ -896,8 +896,8 @@ msgid "" "This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is " "declared as follows::" msgstr "" -":c:func:`Py_BuildValue` は :c:func:`PyArg_ParseTuple` の対極に位置するもので" -"す。この関数は以下のように定義されています::" +"``Py_BuildValue()`` は :c:func:`PyArg_ParseTuple` の対極に位置するものです。" +"この関数は以下のように定義されています::" #: ../../extending/extending.rst:559 msgid "PyObject *Py_BuildValue(const char *format, ...);" @@ -910,10 +910,10 @@ msgid "" "not output) must not be pointers, just values. It returns a new Python " "object, suitable for returning from a C function called from Python." msgstr "" -":c:func:`Py_BuildValue` は、 :c:func:`PyArg_ParseTuple` の認識する一連の書式" -"単位に似た書式単位を認識します。ただし (関数への出力ではなく、入力に使われ" -"る) 引数はポインタではなく、ただの値でなければなりません。 Python から呼び出" -"された C 関数が返す値として適切な、新たな Python オブジェクトを返します。" +"``Py_BuildValue()`` は、 :c:func:`PyArg_ParseTuple` の認識する一連の書式単位" +"に似た書式単位を認識します。ただし (関数への出力ではなく、入力に使われる) 引" +"数はポインタではなく、ただの値でなければなりません。 Python から呼び出された " +"C 関数が返す値として適切な、新たな Python オブジェクトを返します。" #: ../../extending/extending.rst:566 msgid "" @@ -926,14 +926,14 @@ msgid "" "that format unit. To force it to return a tuple of size 0 or one, " "parenthesize the format string." msgstr "" -":c:func:`PyArg_ParseTuple` とは一つ違う点があります: :c:func:" -"`PyArg_ParseTuple` は第一引数をタプルにする必要があります (Python の引数リス" -"トは内部的には常にタプルとして表現されるからです) が、 :c:func:" -"`Py_BuildValue` はタプルを生成するとは限りません。 :c:func:`Py_BuildValue` は" -"書式文字列中に書式単位が二つかそれ以上入っている場合にのみタプルを構築しま" -"す。書式文字列が空なら、 ``None`` を返します。きっかり一つの書式単位なら、そ" -"の書式単位が記述している何らかのオブジェクトになります。サイズが 0 や 1 のタ" -"プル返させたいのなら、書式文字列を丸括弧で囲います。" +":c:func:`PyArg_ParseTuple` とは一つ違う点があります: ``PyArg_ParseTuple()`` " +"は第一引数をタプルにする必要があります (Python の引数リストは内部的には常にタ" +"プルとして表現されるからです) が、 :c:func:`Py_BuildValue` はタプルを生成する" +"とは限りません。 ``Py_BuildValue()`` は書式文字列中に書式単位が二つかそれ以上" +"入っている場合にのみタプルを構築します。書式文字列が空なら、 ``None`` を返し" +"ます。きっかり一つの書式単位なら、その書式単位が記述している何らかのオブジェ" +"クトになります。サイズが 0 や 1 のタプル返させたいのなら、書式文字列を丸括弧" +"で囲います。" #: ../../extending/extending.rst:574 msgid "" @@ -1175,9 +1175,9 @@ msgid "" "properly, as well as the previous owner)." msgstr "" ":c:func:`Py_INCREF` を呼び出すと、借用参照を所有参照に変更できます。この操作" -"は参照の借用元の状態には影響しません --- :c:func:`Py_INCREF` は新たな所有参照" -"を生成し、参照の所有者が担うべき全ての責任を課します (つまり、新たな参照の所" -"有者は、以前の所有者と同様、参照の放棄を適切に行わねばなりません)。" +"は参照の借用元の状態には影響しません --- ``Py_INCREF()`` は新たな所有参照を生" +"成し、参照の所有者が担うべき全ての責任を課します (つまり、新たな参照の所有者" +"は、以前の所有者と同様、参照の放棄を適切に行わねばなりません)。" #: ../../extending/extending.rst:714 msgid "Ownership Rules" diff --git a/glossary.po b/glossary.po index 2142dea27..fc99bbec5 100644 --- a/glossary.po +++ b/glossary.po @@ -1210,9 +1210,9 @@ msgid "" "filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" "c:type:`PyConfig`." msgstr "" -"term:`ファイルシステムのエンコーディングとエラーハンドラ ` は、Pythonの開始時に:c:func:`PyConfig_Read` 関数" -"により設定されます。 :c:type:`PyConfig` のメンバー :c:member:`~PyConfig." +":term:`ファイルシステムのエンコーディングとエラーハンドラ ` は、Python の開始時に :c:func:`PyConfig_Read` 関" +"数により設定されます。 :c:type:`PyConfig` のメンバー :c:member:`~PyConfig." "filesystem_encoding` と :c:member:`~PyConfig.filesystem_errors` を参照してく" "ださい。" @@ -1465,7 +1465,7 @@ msgid "" "variable, range, and an optional :keyword:`!if` clause. The combined " "expression generates values for an enclosing function::" msgstr "" -"(ジェネレータ式) :term:`iterator <イテレータ>` を返す :term:`式 " +"(ジェネレータ式) :term:`イテレータ ` を返す :term:`式 " "` です。\n" "普通の式に、ループ変数を定義する :keyword:`!for` 節、範囲、そして省略可能な :" "keyword:`!if` 節がつづいているように見えます。\n" @@ -2027,8 +2027,7 @@ msgstr "" "なるリストを返す、コンパクトな方法です。 ``result = ['{:#04x}'.format(x) for " "x in range(256) if x % 2 == 0]`` とすると、 0 から 255 までの偶数を 16進数表" "記 (0x..) した文字列からなるリストを生成します。 :keyword:`if` 節はオプション" -"です。 :keyword:`if` 節がない場合、 ``range(256)`` の全ての要素が処理されま" -"す。" +"です。 ``if`` 節がない場合、 ``range(256)`` の全ての要素が処理されます。" #: ../../glossary.rst:962 msgid "lock" @@ -2525,9 +2524,8 @@ msgid "" "an :term:`argument` (or in some cases, arguments) that the function can " "accept. There are five kinds of parameter:" msgstr "" -"(仮引数) 名前付の実体で :term:`関数 ` (や :term:`メソッド " -"` ) の定義において関数が受ける :term:`実引数 ` を指定しま" -"す。仮引数には5種類あります:" +"(仮引数) 名前付の実体で :term:`関数 ` (やメソッド ) の定義において" +"関数が受ける :term:`実引数 ` を指定します。仮引数には5種類あります:" #: ../../glossary.rst:1204 msgid "" diff --git a/howto/argparse.po b/howto/argparse.po index 8649fccf9..20ea0140a 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -31,7 +31,7 @@ msgid "" "This tutorial is intended to be a gentle introduction to :mod:`argparse`, " "the recommended command-line parsing module in the Python standard library." msgstr "" -"このチュートリアルでは、:mod:`argparse` を丁寧に説明します。:mod:`argparse` " +"このチュートリアルでは、:mod:`argparse` を丁寧に説明します。 ``argparse`` " "は、Python 標準ライブラリの一部であり、おすすめのコマンドライン引数の解析モ" "ジュールです。" diff --git a/howto/enum.po b/howto/enum.po index de6e0c973..16cc18bd8 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -1711,8 +1711,8 @@ msgid "" "the class::" msgstr "" "enum サブクラスに追加のメソッドを与えた場合、後述の `Planet`_ クラスのよう" -"に、そのメソッドはメンバーの :func:`dir` に表示されますが、クラスの :func:" -"`dir` には表示されません::" +"に、そのメソッドはメンバーの :func:`dir` に表示されますが、クラスの " +"``dir()`` には表示されません::" #: ../../howto/enum.rst:1034 msgid "" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 5b970ca0b..7e641ae5d 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -1313,11 +1313,11 @@ msgstr "" "ログ記録に残しておきたいと思ったとしましょう。 *extra* パラメータをこの目的に" "使うこともできますが、いつでもこの方法で情報を渡すのが便利なやり方とも限りま" "せん。また接続ごとに :class:`Logger` インスタンスを生成する誘惑に駆られるかも" -"しれませんが、生成した :class:`Logger` インスタンスはガーベジコレクションで回" -"収されないので、これは良いアイデアとは言えません。この例は現実的な問題ではな" -"いかもしれませんが、 :class:`Logger` インスタンスの個数がアプリケーションの中" -"でログ記録が行われるレベルの粒度に依存する場合、 :class:`Logger` インスタンス" -"の個数が事実上無制限にならないと、管理が難しくなります。" +"しれませんが、生成した ``Logger`` インスタンスはガーベジコレクションで回収さ" +"れないので、これは良いアイデアとは言えません。この例は現実的な問題ではないか" +"もしれませんが、 :class:`Logger` インスタンスの個数がアプリケーションの中でロ" +"グ記録が行われるレベルの粒度に依存する場合、 :class:`Logger` インスタンスの個" +"数が事実上無制限にならないと、管理が難しくなります。" #: ../../howto/logging-cookbook.rst:884 msgid "Using LoggerAdapters to impart contextual information" diff --git a/library/argparse.po b/library/argparse.po index b0b20242c..20a06bad0 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -1750,8 +1750,9 @@ msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -"もし type_ キーワードが default_ キーワードとともに使用された場合、default_ " -"の値が文字列のときのみ、type converter による変換などが行われます。" +"もし type_ キーワードが default_ キーワードとともに使用された場合、" +"``default`` の値が文字列のときのみ、type converter による変換などが行われま" +"す。" #: ../../library/argparse.rst:1089 msgid "" diff --git a/library/array.po b/library/array.po index acb48f462..b80f50d72 100644 --- a/library/array.po +++ b/library/array.po @@ -396,11 +396,11 @@ msgid "" "backward compatibility and should be avoided in new code. The buffer " "interface is documented in :ref:`bufferobjects`." msgstr "" -"C やC++ で書いたコードからアレイオブジェクトを使う場合 (:meth:`buffer_info` " -"の情報を使う意味のある唯一の方法です) は、アレイオブジェクトでサポートしてい" -"るバッファインターフェースを使う方がより理にかなっています。このメソッドは後" -"方互換性のために保守されており、新しいコードでの使用は避けるべきです。バッ" -"ファインターフェースの説明は :ref:`bufferobjects` にあります。" +"C やC++ で書いたコードからアレイオブジェクトを使う場合 (``buffer_info()`` の" +"情報を使う意味のある唯一の方法です) は、アレイオブジェクトでサポートしている" +"バッファインターフェースを使う方がより理にかなっています。このメソッドは後方" +"互換性のために保守されており、新しいコードでの使用は避けるべきです。バッファ" +"インターフェースの説明は :ref:`bufferobjects` にあります。" #: ../../library/array.rst:178 msgid "" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 5db947c12..a20eac946 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -185,8 +185,8 @@ msgid "" "`concurrent.futures.Future` to access the result::" msgstr "" "別の OS スレッドからコルーチンオブジェクトをスケジュールする場合は、 :func:" -"`run_coroutine_threadsafe` メソッドを使ってください。 :func:" -"`run_coroutine_threadsafe` は結果にアクセスするための :class:`concurrent." +"`run_coroutine_threadsafe` メソッドを使ってください。 " +"``run_coroutine_threadsafe()`` は結果にアクセスするための :class:`concurrent." "futures.Future` オブジェクトを返します:" #: ../../library/asyncio-dev.rst:89 diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index eff4bb281..e7ed72d7c 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -879,9 +879,9 @@ msgid "" "means a regular EOF is received, or the connection was aborted or closed by " "this side of the connection." msgstr "" -"引数は例外オブジェクトまたは :const:`None` になります。:const:`None` のとき、" -"通常の EOF が受信されたか、あるいはコネクションがこちら側から中止またはクロー" -"ズされたことを意味します。" +"引数は例外オブジェクトまたは :const:`None` になります。 ``None`` のとき、通常" +"の EOF が受信されたか、あるいはコネクションがこちら側から中止またはクローズさ" +"れたことを意味します。" #: ../../library/asyncio-protocol.rst:514 msgid "Flow Control Callbacks" diff --git a/library/bdb.po b/library/bdb.po index 079ba54bc..d32ce6982 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -65,9 +65,9 @@ msgid "" msgstr "" "ブレークポイントは :attr:`bpbynumber` という名前のリストで番号によりインデッ" "クスされ、 :attr:`bplist` により ``(file, line)`` の形でインデックスされま" -"す。 :attr:`bpbynumber` は :class:`Breakpoint` クラスのインスタンスを指してい" -"ます。一方 :attr:`bplist` は、同じ行に複数のブレークポイントが設定される場合" -"があるので、インスタンスのリストを指しています。" +"す。 ``bpbynumber`` は :class:`Breakpoint` クラスのインスタンスを指していま" +"す。一方 ``bplist`` は、同じ行に複数のブレークポイントが設定される場合がある" +"ので、インスタンスのリストを指しています。" #: ../../library/bdb.rst:33 msgid "" diff --git a/library/codecs.po b/library/codecs.po index 54d169994..ab9027a18 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -1529,8 +1529,8 @@ msgstr "" "また、バイト列から文字列オブジェクトを再生成することは *デコード* と呼ばれま" "す。\n" "テキストをシリアライズするコーデックには多くの種類があります。\n" -"それらは、集合的に term:`テキストエンコーディング ` と呼ばれま" -"す。" +"それらは、集合的に :term:`テキストエンコーディング ` と呼ばれ" +"ます。" #: ../../library/codecs.rst:968 msgid "" @@ -3273,8 +3273,8 @@ msgstr "" "ベルを要求通りに ACE に変換します。逆に、入力のバイト文字列を ``.`` 区切り文" "字でラベルに分解し、 ACE ラベルを Unicode に変換します。さらに、 :mod:" "`socket` モジュールは Unicode ホスト名を ACE に透過的に変換するため、アプリ" -"ケーションはホスト名を :mod:`socket` モジュールに渡す際にホスト名の変換に煩わ" -"されることがありません。その上で、ホスト名を関数パラメタとして持つ、 :mod:" +"ケーションはホスト名を ``socket`` モジュールに渡す際にホスト名の変換に煩わさ" +"れることがありません。その上で、ホスト名を関数パラメタとして持つ、 :mod:" "`http.client` や :mod:`ftplib` のようなモジュールでは Unicode ホスト名を受理" "します (:mod:`http.client` でもまた、 :mailheader:`Host` フィールドにある " "IDNA ホスト名を、フィールド全体を送信する場合に透過的に送信します)。" diff --git a/library/collections.abc.po b/library/collections.abc.po index 611598877..5ec2d5ce6 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -645,8 +645,8 @@ msgstr "" #: ../../library/collections.abc.rst:265 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" -"読み出し専用の :term:`シーケンス ` およびミュータブルな :term:`シー" -"ケンス ` の ABC です。" +"読み出し専用の :term:`シーケンス ` およびミュータブルなシーケンス" +"の ABC です。" #: ../../library/collections.abc.rst:267 msgid "" @@ -713,8 +713,8 @@ msgstr "読み出し専用でミュータブルな :ref:`集合 ` の #: ../../library/collections.abc.rst:316 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -"読み出し専用の :term:`マッピング ` およびミュータブルな :term:`マッ" -"ピング ` の ABC です。" +"読み出し専用の :term:`マッピング ` およびミュータブルなマッピングの " +"ABC です。" #: ../../library/collections.abc.rst:323 msgid "" diff --git a/library/curses.po b/library/curses.po index 4e12a1eb0..463d17984 100644 --- a/library/curses.po +++ b/library/curses.po @@ -304,11 +304,11 @@ msgid "" msgstr "" "仮想スクリーンは :meth:`~window.addstr` のような書き込み操作をウィンドウに" "行った後に :meth:`~window.noutrefresh` を呼び出して更新することができます。通" -"常の:meth:`~window.refresh` 呼び出しは、単に :meth:`!noutrefresh` を呼んだ後" -"に :func:`!doupdate`を呼ぶだけです; 複数のウィンドウを更新しなければならない" -"場合、すべてのウィンドウに対して :meth:`!noutrefresh` を呼び出した後、一度だ" -"け :func:`!doupdate` を呼ぶことで、パフォーマンスを向上させることができ、おそ" -"らくスクリーンのちらつきも押さえることができます。" +"常の :meth:`~window.refresh` 呼び出しは、単に :meth:`!noutrefresh` を呼んだ" +"後に :func:`!doupdate` を呼ぶだけです; 複数のウィンドウを更新しなければならな" +"い場合、すべてのウィンドウに対して :meth:`!noutrefresh` を呼び出した後、一度" +"だけ :func:`!doupdate` を呼ぶことで、パフォーマンスを向上させることができ、お" +"そらくスクリーンのちらつきも押さえることができます。" #: ../../library/curses.rst:195 msgid "" diff --git a/library/datetime.po b/library/datetime.po index 03ca406ff..06a09508d 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -1408,8 +1408,8 @@ msgstr "" #: ../../library/datetime.rst:816 msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -":class:`date` オブジェクト ``d`` において、``str(d)`` は ``d.isoformat()`` と" -"等価です。" +"``date`` オブジェクト ``d`` において、``str(d)`` は ``d.isoformat()`` と等価" +"です。" #: ../../library/datetime.rst:821 msgid "Return a string representing the date::" @@ -2201,8 +2201,8 @@ msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -"aware な :class:`datetime` インスタンスと naive な :class:`datetime` インスタ" -"ンスの等価比較では :exc:`TypeError` は送出されません。" +"aware な :class:`datetime` インスタンスと naive な ``datetime`` インスタンス" +"の等価比較では :exc:`TypeError` は送出されません。" #: ../../library/datetime.rst:1370 msgid "Return :class:`date` object with same year, month and day." @@ -2302,12 +2302,11 @@ msgid "" "object from an aware datetime *dt* without conversion of date and time data, " "use ``dt.replace(tzinfo=None)``." msgstr "" -"単に :class:`timezone` オブジェクト *tz* を :class:`datetime` オブジェクト " -"*dt* に追加したいだけで、日付や時刻データへの調整を行わないのなら、``dt." -"replace(tzinfo=tz)`` を使ってください。単に aware な :class:`datetime` オブ" -"ジェクト *dt* から :class:`!timezone` オブジェクトを除去したいだけで、日付や" -"時刻データの変換を行わないのなら、``dt.replace(tzinfo=None)`` を使ってくださ" -"い。" +"単に :class:`timezone` オブジェクト *tz* を ``datetime`` オブジェクト *dt* に" +"追加したいだけで、日付や時刻データへの調整を行わないのなら、``dt." +"replace(tzinfo=tz)`` を使ってください。単に aware な ``datetime`` オブジェク" +"ト *dt* から :class:`!timezone` オブジェクトを除去したいだけで、日付や時刻" +"データの変換を行わないのなら、``dt.replace(tzinfo=None)`` を使ってください。" #: ../../library/datetime.rst:1433 msgid "" @@ -3516,8 +3515,8 @@ msgstr "" "デフォルトの 実装で呼び出されます。 :meth:`datetime.astimezone` から呼ばれた" "場合、 ``dt.tzinfo`` は *self* であり、 *dt* の日付および時刻データは UTC 時" "刻を表しているものとして見えます。 :meth:`fromutc` の目的は、 *self* のローカ" -"ル時刻に等しい :class:`datetime` オブジェクトを返すことにより日付と時刻データ" -"メンバを修正することにあります。" +"ル時刻に等しい ``datetime`` オブジェクトを返すことにより日付と時刻データメン" +"バを修正することにあります。" #: ../../library/datetime.rst:2296 msgid "" @@ -4827,9 +4826,9 @@ msgid "" "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, 0 is substituted for them." msgstr "" -":class:`date` オブジェクトには、時、分、秒、マイクロ秒の値がないため、それら" -"の書式コードを使うことができません。\n" -"無理矢理使った場合、これらの値は0に置き換えられます。" +":class:`date` オブジェクトに時、分、秒、マイクロ秒の書式コードを使うべきでは" +"ありません。:class:`date` オブジェクトはこれらの値を持たないためです。使用し" +"た場合は、これらの値に 0 が代入されます。" #: ../../library/datetime.rst:2790 msgid "" diff --git a/library/dbm.po b/library/dbm.po index 234559d63..3e50c5bfd 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -71,7 +71,7 @@ msgstr "" "サポートされているモジュールそれぞれによって送出される可能性のある例外を含む" "タプル。これにはユニークな例外があり、最初の要素として同じく :exc:`dbm." "error` という名前の例外が含まれます --- :exc:`dbm.error` が送出される場合、後" -"者(訳注:タプルの ``dbm.error`` ではなく例外 :exc:`dbm.error`)が使用されます。" +"者(訳注:タプルの ``dbm.error`` ではなく例外 ``dbm.error``)が使用されます。" #: ../../library/dbm.rst:37 msgid "" diff --git a/library/decimal.po b/library/decimal.po index cc4712fce..f96351b5a 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -84,7 +84,7 @@ msgid "" "multiplicands. For instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * " "1.20`` gives ``1.5600``." msgstr "" -":mod:`decimal` モジュールでは、有効桁数の表記が取り入れられており、例えば " +"``decimal`` モジュールでは、有効桁数の表記が取り入れられており、例えば " "``1.30 + 1.20`` は ``2.50`` になります。すなわち、末尾のゼロは有効数字を示す" "ために残されます。こうした仕様は通貨計算を行うアプリケーションでは慣例です。" "乗算の場合、「教科書的な」アプローチでは、乗算の被演算子すべての桁数を使いま" @@ -97,9 +97,9 @@ msgid "" "alterable precision (defaulting to 28 places) which can be as large as " "needed for a given problem:" msgstr "" -"ハードウェアによる 2 進浮動小数点表現と違い、:mod:`decimal` モジュールでは計" -"算精度をユーザが変更できます(デフォルトでは 28 桁です)。この桁数はほとんどの" -"問題解決に十分な大きさです:" +"ハードウェアによる 2 進浮動小数点表現と違い、 ``decimal`` モジュールでは計算" +"精度をユーザが変更できます(デフォルトでは 28 桁です)。この桁数はほとんどの問" +"題解決に十分な大きさです:" #: ../../library/decimal.rst:67 msgid "" @@ -112,10 +112,10 @@ msgid "" msgstr "" "二進と十進の浮動小数点は、いずれも広く公開されている標準仕様のもとに実装され" "ています。組み込みの浮動小数点型では、標準仕様で提唱されている機能のほんのさ" -"さやかな部分を利用できるにすぎませんが、:mod:`decimal` では標準仕様が要求して" -"いる全ての機能を利用できます。必要に応じて、プログラマは値の丸めやシグナル処" -"理を完全に制御できます。この中には全ての不正確な操作を例外でブロックして正確" -"な算術を遵守させるオプションもあります。" +"さやかな部分を利用できるにすぎませんが、 ``decimal`` では標準仕様が要求してい" +"る全ての機能を利用できます。必要に応じて、プログラマは値の丸めやシグナル処理" +"を完全に制御できます。この中には全ての不正確な操作を例外でブロックして正確な" +"算術を遵守させるオプションもあります。" #: ../../library/decimal.rst:74 msgid "" @@ -145,9 +145,9 @@ msgid "" "``+0``." msgstr "" "十進数型は変更不能です。これは符号、係数部、そして指数を持ちます。有効桁数を" -"残すために、仮数部の末尾にあるゼロは切り詰められません。 :mod:`decimal` で" -"は、 ``Infinity``, ``-Infinity``, および ``NaN`` といった特殊な値も定義されて" -"います。標準仕様では ``-0`` と ``+0`` も区別します。" +"残すために、仮数部の末尾にあるゼロは切り詰められません。 ``decimal`` では、 " +"``Infinity``, ``-Infinity``, および ``NaN`` といった特殊な値も定義されていま" +"す。標準仕様では ``-0`` と ``+0`` も区別します。" #: ../../library/decimal.rst:88 msgid "" @@ -177,8 +177,8 @@ msgid "" msgstr "" "シグナルとは、演算の過程で生じる例外的条件です。個々のシグナルは、アプリケー" "ションそれぞれの要求に従って、無視されたり、単なる情報とみなされたり、例外と" -"して扱われたりします。 :mod:`decimal` モジュールには、 :const:`Clamped`, :" -"const:`InvalidOperation`, :const:`DivisionByZero`, :const:`Inexact`, :const:" +"して扱われたりします。 ``decimal`` モジュールには、 :const:`Clamped`, :const:" +"`InvalidOperation`, :const:`DivisionByZero`, :const:`Inexact`, :const:" "`Rounded`, :const:`Subnormal`, :const:`Overflow`, :const:`Underflow`, およ" "び :const:`FloatOperation` といったシグナルがあります。" @@ -213,9 +213,9 @@ msgid "" "current context with :func:`getcontext` and, if necessary, setting new " "values for precision, rounding, or enabled traps::" msgstr "" -"普通、 :mod:`decimal` を使うときには、モジュールをインポートし、現在の演算コ" -"ンテキストを :func:`getcontext` で調べ、必要なら、精度、丸め、有効なトラップ" -"を設定します::" +"普通、 ``decimal`` を使うときには、モジュールをインポートし、現在の演算コンテ" +"キストを :func:`getcontext` で調べ、必要なら、精度、丸め、有効なトラップを設" +"定します::" #: ../../library/decimal.rst:125 msgid "" @@ -236,10 +236,10 @@ msgid "" "values such as ``NaN`` which stands for \"Not a number\", positive and " "negative ``Infinity``, and ``-0``::" msgstr "" -":class:`Decimal` インスタンスは、整数、文字列、浮動小数点数、またはタプルから" -"構成できます。整数や浮動小数点数からの構成は、整数や浮動小数点数の値を正確に" -"変換します。 :class:`Decimal` は \"非数 (Not a Number)\" を表す ``NaN`` や正" -"負の ``Infinity`` (無限大)、 ``-0`` といった特殊な値も表現できます::" +"``Decimal`` インスタンスは、整数、文字列、浮動小数点数、またはタプルから構成" +"できます。整数や浮動小数点数からの構成は、整数や浮動小数点数の値を正確に変換" +"します。 ``Decimal`` は \"非数 (Not a Number)\" を表す ``NaN`` や正負の " +"``Infinity`` (無限大)、 ``-0`` といった特殊な値も表現できます::" #: ../../library/decimal.rst:139 msgid "" @@ -293,8 +293,8 @@ msgid "" "digits input. Context precision and rounding only come into play during " "arithmetic operations." msgstr "" -"新たな :class:`Decimal` の有効桁数は入力の桁数だけで決まります。演算コンテキ" -"ストにおける精度や値丸めの設定が影響するのは算術演算の間だけです。" +"新たな ``Decimal`` の有効桁数は入力の桁数だけで決まります。演算コンテキストに" +"おける精度や値丸めの設定が影響するのは算術演算の間だけです。" #: ../../library/decimal.rst:180 msgid "" @@ -511,9 +511,9 @@ msgid "" msgstr "" "ほとんどのプログラムでは、開始時に一度だけ現在の演算コンテキストを修正しま" "す。また、多くのアプリケーションでは、データから :class:`Decimal` への変換は" -"ループ内で一度だけキャストして行います。コンテキストを設定し、 :class:" -"`Decimal` オブジェクトを生成できたら、ほとんどのプログラムは他の Python 数値" -"型と全く変わらないかのように :class:`Decimal` を操作できます。" +"ループ内で一度だけキャストして行います。コンテキストを設定し、 ``Decimal`` オ" +"ブジェクトを生成できたら、ほとんどのプログラムは他の Python 数値型と全く変わ" +"らないかのように ``Decimal`` を操作できます。" #: ../../library/decimal.rst:357 msgid "Decimal objects" @@ -604,7 +604,7 @@ msgstr "" "*context* 引数の目的は、 *value* が正しくない形式の文字列であった場合に行う処" "理を決めることにあります; 演算コンテキストが :const:`InvalidOperation` をト" "ラップするようになっていれば、例外を送出します。それ以外の場合には、コンスト" -"ラクタは値が ``NaN`` の :class:`Decimal` を返します。" +"ラクタは値が ``NaN`` の ``Decimal`` を返します。" #: ../../library/decimal.rst:408 msgid "Once constructed, :class:`Decimal` objects are immutable." @@ -1611,8 +1611,8 @@ msgid "" "described below. In addition, the module provides three pre-made contexts:" msgstr "" "新たなコンテキストは、以下で説明する :class:`Context` コンストラクタを使って" -"生成できます。その他にも、 :mod:`decimal` モジュールでは作成済みのコンテキス" -"トを提供しています:" +"生成できます。その他にも、 ``decimal`` モジュールでは作成済みのコンテキストを" +"提供しています:" #: ../../library/decimal.rst:1062 msgid "" @@ -1909,8 +1909,8 @@ msgstr "" "を生成して、算術演算を適用するというアプローチをとります。演算はアクティブな" "スレッドにおける現在のコンテキストの下で行われます。もう一つのアプローチは、" "コンテキストのメソッドを使った特定のコンテキスト下での計算です。コンテキスト" -"のメソッドは :class:`Decimal` クラスのメソッドに似ているので、ここでは簡単な" -"説明にとどめます。" +"のメソッドは ``Decimal`` クラスのメソッドに似ているので、ここでは簡単な説明に" +"とどめます。" #: ../../library/decimal.rst:1253 msgid "Returns the absolute value of *x*." diff --git a/library/doctest.po b/library/doctest.po index bb198a8c7..b44e868c0 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -381,8 +381,8 @@ msgid "" "locations." msgstr "" "デフォルトでは、 :func:`testfile` は自分自身を呼び出したモジュールのあるディ" -"レクトリを探します。その他の場所にあるファイルを見に行くように :func:" -"`testfile` に指示するためのオプション引数についての説明は :ref:`doctest-" +"レクトリを探します。その他の場所にあるファイルを見に行くように " +"``testfile()`` に指示するためのオプション引数についての説明は :ref:`doctest-" "basic-api` 節を参照してください。" #: ../../library/doctest.rst:235 @@ -563,7 +563,7 @@ msgid "" "shell." msgstr "" "ほとんどの場合、対話コンソールセッション上でのコピー/ペーストはうまく動作し" -"ます。とはいえ、:mod:`doctest` は特定の Python シェルの振る舞いを正確にエミュ" +"ます。とはいえ、 ``doctest`` は特定の Python シェルの振る舞いを正確にエミュ" "レーションしようとするわけではありません。" #: ../../library/doctest.rst:366 @@ -1083,8 +1083,8 @@ msgid "" ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " "to the module containing the exception under test." msgstr "" -":mod:`doctest` モジュールの :const:`IGNORE_EXCEPTION_DETAIL` フラグが、 テス" -"トされている例外を含むモジュールの名前を無視するようになりました。" +"``doctest`` モジュールの :const:`IGNORE_EXCEPTION_DETAIL` フラグが、 テストさ" +"れている例外を含むモジュールの名前を無視するようになりました。" #: ../../library/doctest.rst:666 msgid "" @@ -1485,8 +1485,8 @@ msgid "" "absolute path (i.e., it may not begin with ``/``)." msgstr "" "*module_relative* が ``True`` (デフォルト) の場合、*filename* は OS に依存し" -"ないモジュールの相対パスになります。デフォルトでは、このパスは関数 :func:" -"`testfile` を呼び出しているモジュールからの相対パスになります; ただし、" +"ないモジュールの相対パスになります。デフォルトでは、このパスは関数 " +"``testfile()`` を呼び出しているモジュールからの相対パスになります; ただし、" "*package* 引数を指定した場合には、パッケージからの相対になります。OS への依存" "性を除くため、*filename* ではパスを分割する文字に ``/`` を使わなければなら" "ず、絶対パスにしてはなりません (パス文字列を ``/`` で始めてはなりません)。" @@ -1800,7 +1800,7 @@ msgstr "" #: ../../library/doctest.rst:1067 msgid "Options may be provided as keyword arguments:" -msgstr ":func:`DocFileSuite` には、キーワード引数でオプションを指定できます:" +msgstr "``DocFileSuite()`` には、キーワード引数でオプションを指定できます:" #: ../../library/doctest.rst:1069 msgid "" @@ -2164,7 +2164,7 @@ msgid "" "names." msgstr "" "単一の名前空間内で実行される doctest 実行例の集まりです。コンストラクタの引数" -"は :class:`DocTest` インスタンス中の同名の属性の初期化に使われます。" +"は ``DocTest`` インスタンス中の同名の属性の初期化に使われます。" #: ../../library/doctest.rst:1271 msgid "" @@ -2239,8 +2239,8 @@ msgid "" "attributes of the same names." msgstr "" "ひとつの Python 文と、それに対する期待する出力からなる、単一の対話的モードの" -"実行例です。コンストラクタの引数は :class:`Example` インスタンス中の同名の属" -"性の初期化に使われます。" +"実行例です。コンストラクタの引数は ``Example`` インスタンス中の同名の属性の初" +"期化に使われます。" #: ../../library/doctest.rst:1328 msgid "" @@ -2340,9 +2340,9 @@ msgid "" "The optional argument *parser* specifies the :class:`DocTestParser` object " "(or a drop-in replacement) that is used to extract doctests from docstrings." msgstr "" -"オプション引数 *parser* には、 docstring から :class:`DocTest` を抽出するのに" -"使う :class:`DocTestParser` オブジェクト (またはその代替となるオブジェクト) " -"を指定します。" +"オプション引数 *parser* には、 docstring から ``DocTest`` を抽出するのに使" +"う :class:`DocTestParser` オブジェクト (またはその代替となるオブジェクト) を" +"指定します。" #: ../../library/doctest.rst:1397 msgid "" @@ -2408,9 +2408,9 @@ msgid "" "imported from other modules. (Contained objects with modules other than " "*module* are ignored.)" msgstr "" -"他のモジュールから import されたオブジェクトに対して :class:`DocTestFinder` " -"が :class:`DocTest` を抽出するのを避けるために使います。 (*module* 由来でない" -"オブジェクトを無視します。)" +"他のモジュールから import されたオブジェクトに対して ``DocTestFinder`` が " +"``DocTest`` を抽出するのを避けるために使います。 (*module* 由来でないオブジェ" +"クトを無視します。)" #: ../../library/doctest.rst:1426 msgid "To find the name of the file containing the object." @@ -2484,9 +2484,9 @@ msgid "" "error messages." msgstr "" "指定した文字列からすべての doctest 実行例を抽出し、 :class:`Example` オブジェ" -"クトからなるリストにして返します。各 :class:`Example` の行番号は 0 から数えま" -"す。オプション引数 *name* はこの文字列につける名前で、エラーメッセージにしか" -"使われません。" +"クトからなるリストにして返します。各 ``Example`` の行番号は 0 から数えます。" +"オプション引数 *name* はこの文字列につける名前で、エラーメッセージにしか使わ" +"れません。" #: ../../library/doctest.rst:1478 msgid "" @@ -2789,8 +2789,8 @@ msgstr "デバッグ" #: ../../library/doctest.rst:1694 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -":mod:`doctest` では、doctest 実行例をデバッグするメカニズムをいくつか提供して" -"います:" +"``doctest`` では、doctest 実行例をデバッグするメカニズムをいくつか提供してい" +"ます:" #: ../../library/doctest.rst:1696 msgid "" @@ -2817,7 +2817,7 @@ msgid "" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" ":func:`DocTestSuite` の生成する :mod:`unittest` テストケースは、 :meth:" -"`debug` メソッドをサポートしています。 :meth:`debug` は :class:`unittest." +"`debug` メソッドをサポートしています。 ``debug()`` は :class:`unittest." "TestCase` で定義されています。" #: ../../library/doctest.rst:1707 @@ -3049,8 +3049,8 @@ msgid "" msgstr "" ":class:`DebugRunner` クラス自体や :class:`DebugRunner` クラスが送出する特殊な" "例外は、テストフレームワークの作者にとって非常に興味のあるところですが、ここ" -"では概要しか述べられません。詳しくはソースコード、とりわけ :class:" -"`DebugRunner` の docstring (それ自体 doctest です!) を参照してください:" +"では概要しか述べられません。詳しくはソースコード、とりわけ ``DebugRunner`` " +"の docstring (それ自体 doctest です!) を参照してください:" #: ../../library/doctest.rst:1854 msgid "" @@ -3196,19 +3196,19 @@ msgid "" "functionality seemingly at random. It's a different attitude, and produces " "different results, blurring the distinction between testing and explaining." msgstr "" -"説明テキストの作成をけちらなければ、:mod:`doctest` は回帰テストの優れたツール" -"にもなり得ます。説明文と実行例を交互に記述していけば、実際に何をどうしてテス" -"トしているのかもっと簡単に把握できるようになるでしょう。もちろん、コードベー" -"スのテストに詳しくコメントを入れるのも手ですが、そんなことをするプログラマは" -"ほとんどいません。多くの人々が、:mod:`doctest` のアプローチをとった方がきれい" -"にテストを書けると気づいています。おそらく、これは単にコード中にコメントを書" -"くのが少し面倒だからという理由でしょう。私はもう少し穿った見方もしています。" +"説明テキストの作成をけちらなければ、 ``doctest`` は回帰テストの優れたツールに" +"もなり得ます。説明文と実行例を交互に記述していけば、実際に何をどうしてテスト" +"しているのかもっと簡単に把握できるようになるでしょう。もちろん、コードベース" +"のテストに詳しくコメントを入れるのも手ですが、そんなことをするプログラマはほ" +"とんどいません。多くの人々が、 ``doctest`` のアプローチをとった方がきれいにテ" +"ストを書けると気づいています。おそらく、これは単にコード中にコメントを書くの" +"が少し面倒だからという理由でしょう。私はもう少し穿った見方もしています。" "doctest ベースのテストを書くときの自然な態度は、自分のソフトウェアのよい点を" "説明しようとして、実行例を使って説明しようとするときの態度そのものだからだ、" "という理由です。それゆえに、テストファイルは自然と単純な機能の解説から始め、" "論理的により複雑で境界条件的なケースに進むような形になります。結果的に、一見" "ランダムに見えるような個別の機能をテストしている個別の関数の集まりではなく、" -"首尾一貫した説明ができるようになるのです。:mod:`doctest` によるテストの作成は" +"首尾一貫した説明ができるようになるのです。 ``doctest`` によるテストの作成は" "まったく別の取り組み方であり、テストと説明の区別をなくして、まったく違う結果" "を生み出すのです。" diff --git a/library/email.header.po b/library/email.header.po index ee65d097d..fdd4db289 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -226,8 +226,8 @@ msgid "" msgstr "" "いずれの場合でも、 :rfc:`2822` 準拠のヘッダを :rfc:`2047` の規則を用いて生成" "する際、文字列は指定された文字セットの出力コーデックを用いてエンコードされま" -"す。出力コーデックを用いて文字列がエンコードできないときは :exc:" -"`UnicodeError` が発生します。" +"す。出力コーデックを用いて文字列がエンコードできないときは ``UnicodeError`` " +"が発生します。" #: ../../library/email.header.rst:115 msgid "" diff --git a/library/gettext.po b/library/gettext.po index c59d5a243..b6c161ad5 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -209,8 +209,8 @@ msgstr "" "`LANGUAGE` 、 :envvar:`LC_ALL` 、 :envvar:`LC_MESSAGES` 、および :envvar:" "`LANG` が検索されます。空でない値を返した最初の候補が *languages* 変数として" "使われます。この環境変数は言語名をコロンで分かち書きしたリストを含んでいなけ" -"ればなりません。 :func:`find` はこの文字列をコロンで分割し、言語コードの候補" -"リストを生成します。" +"ればなりません。 ``find()`` はこの文字列をコロンで分割し、言語コードの候補リ" +"ストを生成します。" #: ../../library/gettext.rst:137 msgid "" diff --git a/library/gzip.po b/library/gzip.po index 952a520f2..37aeee63f 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -167,10 +167,10 @@ msgid "" "IOBase.truncate` method. At least one of *fileobj* and *filename* must be " "given a non-trivial value." msgstr "" -":class:`GzipFile` クラスのコンストラクタです。:class:`GzipFile` オブジェクト" -"は :meth:`~io.IOBase.truncate` メソッドを除くほとんどの :term:`ファイルオブ" -"ジェクト ` のメソッドをシミュレートします。少なくとも *fileobj* " -"および *filename* は有効な値でなければなりません。" +":class:`GzipFile` クラスのコンストラクタです。 ``GzipFile`` オブジェクトは :" +"meth:`~io.IOBase.truncate` メソッドを除くほとんどの :term:`ファイルオブジェク" +"ト ` のメソッドをシミュレートします。少なくとも *fileobj* およ" +"び *filename* は有効な値でなければなりません。" #: ../../library/gzip.rst:84 msgid "" @@ -257,9 +257,9 @@ msgstr "" "圧縮したデータの後ろにさらに何か追加したい場合もあるので、:class:`GzipFile` " "オブジェクトの :meth:`!close` メソッド呼び出しは *fileobj* を閉じません。\n" "このため、書き込みのためにオープンした :class:`io.BytesIO` オブジェクトを " -"*fileobj* として渡し、(:class:`GzipFile` を :meth:`close` した後に) :class:" -"`io.BytesIO` オブジェクトの :meth:`~io.BytesIO.getvalue` メソッドを使って書き" -"込んだデータの入っているメモリバッファを取得することができます。" +"*fileobj* として渡し、(``GzipFile`` を ``close()`` した後に) :class:`io." +"BytesIO` オブジェクトの :meth:`~io.BytesIO.getvalue` メソッドを使って書き込ん" +"だデータの入っているメモリバッファを取得することができます。" #: ../../library/gzip.rst:127 msgid "" diff --git a/library/http.server.po b/library/http.server.po index 57c6cd144..03f67b737 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -60,8 +60,8 @@ msgid "" msgstr "" "クラス :class:`HTTPServer` は :class:`socketserver.TCPServer` のサブクラスで" "す。\n" -":class:`HTTPServer` は HTTP ソケットを生成してリクエスト待ち (listen) を行" -"い、リクエストをハンドラに渡します。\n" +"``HTTPServer`` は HTTP ソケットを生成してリクエスト待ち (listen) を行い、リク" +"エストをハンドラに渡します。\n" "サーバを作成して動作させるためのコードは以下のようになります::" #: ../../library/http.server.rst:31 diff --git a/library/importlib.po b/library/importlib.po index 07b2cbd56..f46ec2697 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -424,9 +424,9 @@ msgstr "" "一方のモジュールが :keyword:`from` ... :keyword:`import` ... を使って、オブ" "ジェクトを他方のモジュールからインポートしているなら、他方のモジュールを :" "func:`reload` で呼び出しても、そのモジュールからインポートされたオブジェクト" -"を再定義することはできません --- この問題を回避する一つの方法は、 :keyword:" -"`from` 文を再度実行することで、もう一つの方法は :keyword:`!from` 文の代わり" -"に :keyword:`!import` と限定的な名前 (*module.name*) を使うことです。" +"を再定義することはできません --- この問題を回避する一つの方法は、 :keyword:`!" +"from` 文を再度実行することで、もう一つの方法は ``from`` 文の代わりに :" +"keyword:`!import` と限定的な名前 (*module.name*) を使うことです。" #: ../../library/importlib.rst:200 msgid "" @@ -702,10 +702,10 @@ msgid "" "a code object (as would be the case, for example, for a built-in module). " "Raise an :exc:`ImportError` if loader cannot find the requested module." msgstr "" -"モジュールの :class:`code` オブジェクトを返すか、 (例えば組み込みモジュールの" -"場合に) モジュールがコードオブジェクトを持たなければ ``None`` を返します。要" -"求されたモジュールをローダーが見つけられなかった場合は :exc:`ImportError` を" -"送出します。" +"モジュールの ``code`` オブジェクトを返すか、 (例えば組み込みモジュールの場合" +"に) モジュールがコードオブジェクトを持たなければ ``None`` を返します。要求さ" +"れたモジュールをローダーが見つけられなかった場合は :exc:`ImportError` を送出" +"します。" #: ../../library/importlib.rst:435 msgid "" diff --git a/library/io.po b/library/io.po index c9b40760c..0b4acd034 100644 --- a/library/io.po +++ b/library/io.po @@ -419,10 +419,10 @@ msgid "" "allowed to raise :exc:`UnsupportedOperation` if they do not support a given " "operation." msgstr "" -"I/O 階層の最上位には抽象基底クラスの :class:`IOBase` があります。 :class:" -"`IOBase` ではストリームに対して基本的なインターフェースを定義しています。 し" -"かしながら、ストリームに対する読み込みと書き込みが分離されていないことに注意" -"してください。 実装においては与えられた操作をサポートしない場合は :exc:" +"I/O 階層の最上位には抽象基底クラスの :class:`IOBase` があります。 ``IOBase`` " +"ではストリームに対して基本的なインターフェースを定義しています。 しかしなが" +"ら、ストリームに対する読み込みと書き込みが分離されていないことに注意してくだ" +"さい。 実装においては与えられた操作をサポートしない場合は :exc:" "`UnsupportedOperation` を送出することが許されています。" #: ../../library/io.rst:262 diff --git a/library/itertools.po b/library/itertools.po index 2770ffe29..bf69b1ea2 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -1307,7 +1307,7 @@ msgid "" msgstr "" ":func:`tee` はかなり大きなメモリ領域を使用するかもしれません (使用するメモリ" "量はiterableの大きさに依存します)。一般には、一つのイテレータが他のイテレータ" -"よりも先にほとんどまたは全ての要素を消費するような場合には、 :func:`tee` より" +"よりも先にほとんどまたは全ての要素を消費するような場合には、 ``tee()`` より" "も :func:`list` を使った方が高速です。" #: ../../library/itertools.rst:763 diff --git a/library/locale.po b/library/locale.po index ef30eb443..a1c9ddff8 100644 --- a/library/locale.po +++ b/library/locale.po @@ -667,9 +667,9 @@ msgid "" "is not necessary or desired, *do_setlocale* should be set to ``False``." msgstr "" "システムによっては、ユーザの設定を取得するために :func:`setlocale` を呼び出す" -"必要があるため、この関数はスレッド安全ではありません。 :func:`setlocale` を呼" -"び出す必要がない、または呼び出したくない場合、 *do_setlocale* を ``False`` に" -"設定する必要があります。" +"必要があるため、この関数はスレッド安全ではありません。 ``setlocale()`` を呼び" +"出す必要がない、または呼び出したくない場合、 *do_setlocale* を ``False`` に設" +"定する必要があります。" #: ../../library/locale.rst:399 msgid "" diff --git a/library/logging.po b/library/logging.po index 0d3003372..7bf78bab7 100644 --- a/library/logging.po +++ b/library/logging.po @@ -1675,7 +1675,7 @@ msgstr "" ":class:`LogRecord` の生成は、レコードを生成するために使用されるファクトリを提" "供することにより、さらに設定可能になりました。ファクトリは :func:" "`getLogRecordFactory` と :func:`setLogRecordFactory` を使用して設定することが" -"できます (ファクトリのシグネチャに関しては :func:`setLogRecordFactory` を参" +"できます (ファクトリのシグネチャに関しては ``setLogRecordFactory()`` を参" "照)。" #: ../../library/logging.rst:948 @@ -2492,9 +2492,9 @@ msgid "" "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -"*level* パラメータは、 :const:`INFO` のような整数定数の代わりに 'INFO' のよう" -"なレベルの文字列表現も受け付けます。この場合、この関数は関連するレベルの数値" -"表現を返します。" +"*level* パラメータは、 ``INFO`` のような整数定数の代わりに 'INFO' のようなレ" +"ベルの文字列表現も受け付けます。この場合、この関数は関連するレベルの数値表現" +"を返します。" #: ../../library/logging.rst:1313 msgid "" diff --git a/library/mailbox.po b/library/mailbox.po index dfb9d5aec..71bcafd4f 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -289,11 +289,11 @@ msgid "" "unless a custom message factory was specified when the :class:`!Mailbox` " "instance was initialized." msgstr "" -"(*key*, *message*) ペア、ただし *key* はキーで *message* はメッセージ表現、の" -"イテレータを返します。メッセージは適切な形式ごとの :class:`Message` サブクラ" -"スのインスタンスとして表現されるのが普通ですが、 :class:`!Mailbox` インスタン" -"スが初期化されるときに指定すればお好みのメッセージファクトリを使うこともでき" -"ます。" +"(*key*, *message*) ペア、ただし *key* はキーで *message* はメッセージ表現、" +"の :term:`イテレータ ` を返します。メッセージは適切な形式ごとの :" +"class:`Message` サブクラスのインスタンスとして表現されるのが普通ですが、 :" +"class:`!Mailbox` インスタンスが初期化されるときに指定すればお好みのメッセージ" +"ファクトリを使うこともできます。" #: ../../library/mailbox.rst:179 msgid "" @@ -905,7 +905,7 @@ msgid "" "close` on the :class:`!mbox` instance may yield unpredictable results or " "raise an exception." msgstr "" -":class:`!mbox` インスタンスに対し :meth:`~Mailbox.flush` や meth:`~Mailbox." +":class:`!mbox` インスタンスに対し :meth:`~Mailbox.flush` や :meth:`~Mailbox." "close` を呼び出した後でファイルを使用すると予期しない結果を引き起こしたり例外" "が送出されたりすることがあります。" @@ -1321,7 +1321,7 @@ msgid "" "close` on the :class:`!MMDF` instance may yield unpredictable results or " "raise an exception." msgstr "" -":class:`!MMDF` インスタンスに対し :meth:`~Mailbox.flush` や meth:`~Mailbox." +":class:`!MMDF` インスタンスに対し :meth:`~Mailbox.flush` や :meth:`~Mailbox." "close` を呼び出した後でファイルを使用すると予期しない結果を引き起こしたり例外" "が送出されたりすることがあります。" diff --git a/library/mmap.po b/library/mmap.po index c270e0734..9145852a4 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -348,8 +348,8 @@ msgid "" "in a ValueError exception being raised. This will not close the open file." msgstr "" "メモリマップファイルを閉じます。この呼出しの後にオブジェクトの他のメソッドの" -"呼出すことは、 :exc:`ValueError` 例外の送出を引き起こします。このメソッドは開" -"いたファイルのクローズはしません。" +"呼出すことは、 ``ValueError`` 例外の送出を引き起こします。このメソッドは開い" +"たファイルのクローズはしません。" #: ../../library/mmap.rst:199 msgid "``True`` if the file is closed." diff --git a/library/multiprocessing.po b/library/multiprocessing.po index af60dbfa7..17d92e8f6 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -2284,7 +2284,7 @@ msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -"よく似た :class:`threading.BoundedSemaphore` とは、次の一点だけ異なります。 " +"よく似た ``threading.BoundedSemaphore`` とは、次の一点だけ異なります。 " "``acquire`` メソッドの第一引数名は *block* で、:meth:`Lock.acquire` と一致し" "ています。" @@ -4783,8 +4783,8 @@ msgid "" "between processes rather than using the lower level synchronization " "primitives." msgstr "" -"プロセス間の通信には、:mod:`threading` モジュールの低レベルな同期プリミティブ" -"を使うのではなく、キューやパイプを使うのが良いでしょう。" +"プロセス間の通信には、 ``threading`` モジュールの低レベルな同期プリミティブを" +"使うのではなく、キューやパイプを使うのが良いでしょう。" #: ../../library/multiprocessing.rst:3065 msgid "Picklability" diff --git a/library/optparse.po b/library/optparse.po index 2448c3560..0606dbc25 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -640,8 +640,8 @@ msgid "" "First, you need to import the OptionParser class; then, early in the main " "program, create an OptionParser instance::" msgstr "" -"まず、:class:`OptionParser` クラスを import しておかなければなりません。次" -"に、プログラムの冒頭で :class:`OptionParser` インスタンスを生成しておきます::" +"まず、 ``OptionParser`` クラスを import しておかなければなりません。次に、プ" +"ログラムの冒頭で ``OptionParser`` インスタンスを生成しておきます::" #: ../../library/optparse.rst:361 msgid "" @@ -714,8 +714,8 @@ msgid "" "argv[1:]``.)" msgstr "" "(お望みなら、 :meth:`~OptionParser.parse_args` に自作の引数リストを渡してもか" -"まいません。とはいえ、実際にはそうした必要はほとんどないでしょう: :mod:" -"`optionparser` はデフォルトで ``sys.argv[1:]`` を使うからです。)" +"まいません。とはいえ、実際にはそうした必要はほとんどないでしょう: このメソッ" +"ドはデフォルトで ``sys.argv[1:]`` を使うからです。)" #: ../../library/optparse.rst:397 msgid ":meth:`~OptionParser.parse_args` returns two values:" @@ -1027,7 +1027,7 @@ msgid "" "of OptionParser, which you can call at any time before calling :meth:" "`~OptionParser.parse_args`::" msgstr "" -"デフォルト値をすっきりと指定するには、 :class:`OptionParser` の :meth:" +"デフォルト値をすっきりと指定するには、 ``OptionParser`` の :meth:" "`set_defaults` メソッドを使います。このメソッドは :meth:`~OptionParser." "parse_args` を呼び出す前ならいつでも使えます::" @@ -1690,8 +1690,7 @@ msgstr "" #: ../../library/optparse.rst:975 msgid "pass it an Option instance (as returned by :func:`make_option`)" -msgstr "" -"(:func:`make_option` などが返す) :class:`Option` インスタンスを渡します" +msgstr "(:func:`make_option` などが返す) ``Option`` インスタンスを渡します" #: ../../library/optparse.rst:977 msgid "" @@ -1699,18 +1698,17 @@ msgid "" "acceptable to :func:`make_option` (i.e., to the Option constructor), and it " "will create the Option instance for you" msgstr "" -":func:`make_option` に (すなわち :class:`Option` のコンストラクタに) 位置引数" -"とキーワード引数の組み合わせを渡して、 :class:`Option` インスタンスを生成させ" -"ます" +":func:`make_option` に (すなわち ``Option`` のコンストラクタに) 位置引数と" +"キーワード引数の組み合わせを渡して、 ``Option`` インスタンスを生成させます" #: ../../library/optparse.rst:981 msgid "" "The other alternative is to pass a list of pre-constructed Option instances " "to the OptionParser constructor, as in::" msgstr "" -"もう一つの方法は、あらかじめ作成しておいた :class:`Option` インスタンスからな" -"るリストを、以下のようにして :class:`OptionParser` のコンストラクタに渡すとい" -"うものです::" +"もう一つの方法は、あらかじめ作成しておいた ``Option`` インスタンスからなるリ" +"ストを、以下のようにして ``OptionParser`` のコンストラクタに渡すというもので" +"す::" #: ../../library/optparse.rst:984 msgid "" @@ -1742,10 +1740,10 @@ msgid "" "strings, e.g. ``-f`` and ``--file``. You can specify any number of short or " "long option strings, but you must specify at least one overall option string." msgstr "" -"各々の :class:`Option` インスタンス、は ``-f`` や ``--file`` といった同義のコ" -"マンドラインオプションからなる集合を表現しています。一つの :class:`Option` に" -"は任意の数のオプションを短い形式でも長い形式でも指定できます。ただし、少なく" -"とも一つは指定しなければなりません。" +"各々の ``Option`` インスタンス、は ``-f`` や ``--file`` といった同義のコマン" +"ドラインオプションからなる集合を表現しています。一つの ``Option`` には任意の" +"数のオプションを短い形式でも長い形式でも指定できます。ただし、少なくとも一つ" +"は指定しなければなりません。" #: ../../library/optparse.rst:1007 msgid "" @@ -2355,7 +2353,7 @@ msgid "" "every option." msgstr "" "現在のオプションパーザ内の全てのオプションに対する完全なヘルプメッセージを出" -"力します。ヘルプメッセージは :class:`OptionParser` のコンストラクタに渡した " +"力します。ヘルプメッセージは ``OptionParser`` のコンストラクタに渡した " "``usage`` 文字列と、各オプションに渡した :attr:`~Option.help` 文字列から生成" "します。" @@ -2594,8 +2592,8 @@ msgid "" "OptionParser provides several methods to help you out:" msgstr "" "オプションパーザのデフォルトの振る舞いは、ある程度カスタマイズすることができ" -"ます。また、オプションパーザの中を調べることもできます。:class:" -"`OptionParser` は幾つかのヘルパーメソッドを提供しています:" +"ます。また、オプションパーザの中を調べることもできます。 ``OptionParser`` は" +"幾つかのヘルパーメソッドを提供しています:" #: ../../library/optparse.rst:1495 msgid "" @@ -2650,16 +2648,16 @@ msgid "" "Returns the Option instance with the option string *opt_str*, or ``None`` if " "no options have that option string." msgstr "" -"オプション文字列 *opt_str* に対する :class:`Option` インスタンスを返します。" -"該当するオプションがなければ ``None`` を返します。" +"オプション文字列 *opt_str* に対する ``Option`` インスタンスを返します。該当す" +"るオプションがなければ ``None`` を返します。" #: ../../library/optparse.rst:1525 msgid "" "Return ``True`` if the OptionParser has an option with option string " "*opt_str* (e.g., ``-q`` or ``--verbose``)." msgstr "" -":class:`OptionParser` に(``-q`` や ``--verbose`` のような) オプション " -"*opt_str* がある場合、``True`` を返します。" +"``OptionParser`` に(``-q`` や ``--verbose`` のような) オプション *opt_str* が" +"ある場合、``True`` を返します。" #: ../../library/optparse.rst:1530 msgid "" @@ -2696,8 +2694,8 @@ msgid "" "(This is particularly true if you've defined your own OptionParser subclass " "with some standard options.)" msgstr "" -"(とりわけ、:class:`OptionParser` から標準的なオプションを備えた自前のサブクラ" -"スを定義してしまった場合にはよく起きます。)" +"(とりわけ、 ``OptionParser`` から標準的なオプションを備えた自前のサブクラスを" +"定義してしまった場合にはよく起きます。)" #: ../../library/optparse.rst:1551 msgid "" @@ -3038,7 +3036,7 @@ msgstr "``option``" #: ../../library/optparse.rst:1749 msgid "is the Option instance that's calling the callback" -msgstr "コールバックを呼び出している :class:`Option` のインスタンスです" +msgstr "コールバックを呼び出している ``Option`` のインスタンスです" #: ../../library/optparse.rst:1751 msgid "``opt_str``" @@ -3081,9 +3079,9 @@ msgid "" "is the OptionParser instance driving the whole thing, mainly useful because " "you can access some other interesting data through its instance attributes:" msgstr "" -"現在のオプション解析の全てを駆動している :class:`OptionParser` インスタンスで" -"す。この変数が有用なのは、この値を介してインスタンス属性としていくつかの興味" -"深いデータにアクセスできるからです:" +"現在のオプション解析の全てを駆動している ``OptionParser`` インスタンスです。" +"この変数が有用なのは、この値を介してインスタンス属性としていくつかの興味深い" +"データにアクセスできるからです:" #: ../../library/optparse.rst:1769 msgid "``parser.largs``" @@ -3422,16 +3420,16 @@ msgid "" "A tuple of type names; in your subclass, simply define a new tuple :attr:" "`TYPES` that builds on the standard one." msgstr "" -":attr:`TYPES` は型名のタプルです。新しく作るサブクラスでは、タプル :attr:" -"`TYPES` を単純に標準のものを利用して新しく定義すると良いでしょう。" +"``TYPES`` は型名のタプルです。新しく作るサブクラスでは、タプル :attr:`TYPES` " +"を単純に標準のものを利用して新しく定義すると良いでしょう。" #: ../../library/optparse.rst:1991 msgid "" "A dictionary mapping type names to type-checking functions. A type-checking " "function has the following signature::" msgstr "" -":attr:`TYPE_CHECKER` は辞書で型名を型チェック関数に対応付けるものです。型" -"チェック関数は以下のようなシグネチャを持ちます::" +"``TYPE_CHECKER`` は辞書で型名を型チェック関数に対応付けるものです。型チェック" +"関数は以下のようなシグネチャを持ちます::" #: ../../library/optparse.rst:1994 msgid "def check_mytype(option, opt, value)" @@ -3746,11 +3744,11 @@ msgid "" "destinations in question; they can just leave the default as ``None`` and :" "meth:`ensure_value` will take care of getting it right when it's needed." msgstr "" -"``values`` に ``attr`` 属性が無いか ``None`` だった場合に、 :meth:" -"`ensure_value` は最初に ``value`` をセットし、それから ``value`` を返します。" -"この振る舞いは ``\"extend\"``, ``\"append\"``, ``\"count\"`` のように、データ" -"を変数に集積し、またその変数がある型 (最初の二つはリスト、最後のは整数) であ" -"ると期待されるアクションを作るのにとても使い易いものです。 :meth:" +"``values`` に ``attr`` 属性が無いか ``None`` だった場合に、 " +"``ensure_value()`` は最初に ``value`` をセットし、それから ``value`` を返しま" +"す。この振る舞いは ``\"extend\"``, ``\"append\"``, ``\"count\"`` のように、" +"データを変数に集積し、またその変数がある型 (最初の二つはリスト、最後のは整" +"数) であると期待されるアクションを作るのにとても使い易いものです。 :meth:" "`ensure_value` を使えば、作ったアクションを使うスクリプトはオプションに保存先" "にデフォルト値をセットすることに煩わされずに済みます。デフォルトを ``None`` " "にしておけば :meth:`ensure_value` がそれが必要になったときに適当な値を返して" diff --git a/library/os.po b/library/os.po index 047ff8dce..450c81f37 100644 --- a/library/os.po +++ b/library/os.po @@ -162,9 +162,9 @@ msgid "" "filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" "c:type:`PyConfig`." msgstr "" -"term:`ファイルシステムのエンコーディングとエラーハンドラ ` は、Pythonの開始時に:c:func:`PyConfig_Read` 関数" -"により設定されます。 :c:type:`PyConfig` のメンバー :c:member:`~PyConfig." +":term:`ファイルシステムのエンコーディングとエラーハンドラ ` は、Python の開始時に :c:func:`PyConfig_Read` 関" +"数により設定されます。 :c:type:`PyConfig` のメンバー :c:member:`~PyConfig." "filesystem_encoding` と :c:member:`~PyConfig.filesystem_errors` を参照してく" "ださい。" @@ -764,7 +764,7 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" "プロセスの制御端末にログインしているユーザー名を返します。ほとんどの場合、:" -"func:`getpass.getuser` を使う方が便利です。なぜなら、:func:`getpass.getuser` " +"func:`getpass.getuser` を使う方が便利です。なぜなら、 ``getpass.getuser()`` " "は、ユーザーを見つけるために、環境変数 :envvar:`LOGNAME` や :envvar:" "`USERNAME` を調べ、さらには ``pwd.getpwuid(os.getuid())[0]`` まで調べに行くか" "らです。" @@ -2608,8 +2608,8 @@ msgid "" msgstr "" ":data:`os.supports_fd` を使うことで、そのプラットフォーム上で *path* にファイ" "ル記述子を指定できるかどうかを確認することができます。この機能が利用可能でな" -"い場合、 :data:`os.supports_fd` の利用は :exc:`NotImplementedError` 例外を送" -"出します。" +"い場合、 ``os.supports_fd`` の利用は :exc:`NotImplementedError` 例外を送出し" +"ます。" #: ../../library/os.rst:2073 msgid "" @@ -6773,9 +6773,9 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" "(:mod:`subprocess` モジュールが、新しいプロセスを実行して結果を取得するため" -"の、より強力な機能を提供しています。この関数の代わりに :mod:`subprocess` モ" -"ジュールを利用することが推奨されています。 :mod:`subprocess` モジュールのド" -"キュメントの、 :ref:`subprocess-replacements` セクションを参照してください )" +"の、より強力な機能を提供しています。この関数の代わりに ``subprocess`` モ" +"ジュールを利用することが推奨されています。 ``subprocess`` モジュールのドキュ" +"メントの、 :ref:`subprocess-replacements` セクションを参照してください )" #: ../../library/os.rst:5475 msgid "" diff --git a/library/pathlib.po b/library/pathlib.po index fad4c9a76..e8f3cac89 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -67,7 +67,7 @@ msgstr "" "あなたが今までこのモジュールを使用したことがない場合や、タスクに適しているの" "がどのクラスかわからない場合は、 :class:`Path` はきっとあなたに必要なもので" "しょう。\n" -":class:`Path` はコードが実行されているプラットフォーム用の :ref:`具象パス " +"``Path`` はコードが実行されているプラットフォーム用の :ref:`具象パス " "` のインスタンスを作成します。" #: ../../library/pathlib.rst:35 @@ -244,8 +244,8 @@ msgstr "" "*pathsegments* の各要素は、パスの構成要素を表す文字列か、パスオブジェクトなど" "の、 :class:`os.PathLike` インターフェースを実装するオブジェクトである必要が" "あります。\n" -":class:`os.PathLike` インターフェースでは、 :meth:`~os.PathLike.__fspath__` " -"メソッドが文字列を返します::" +"``os.PathLike`` インターフェースでは、 :meth:`~os.PathLike.__fspath__` メソッ" +"ドが文字列を返します::" #: ../../library/pathlib.rst:129 msgid "" @@ -1121,8 +1121,8 @@ msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -"現在のパスの :attr:`name` 部分を変更したパスを返します。オリジナルパスに :" -"attr:`name` 部分がない場合は ValueError が送出されます::" +"現在のパスの :attr:`name` 部分を変更したパスを返します。オリジナルパスに " +"``name`` 部分がない場合は ValueError が送出されます::" #: ../../library/pathlib.rst:669 msgid "" @@ -1144,8 +1144,8 @@ msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -"現在のパスの :attr:`stem` 部分を変更したパスを返します。オリジナルパスに :" -"attr:`stem` 部分がない場合は ValueError が送出されます::" +"現在のパスの :attr:`stem` 部分を変更したパスを返します。オリジナルパスに " +"``stem`` 部分がない場合は ValueError が送出されます::" #: ../../library/pathlib.rst:686 msgid "" @@ -1576,9 +1576,9 @@ msgid "" msgstr "" ":meth:`~Path.exists`, :meth:`~Path.is_dir`, :meth:`~Path.is_file`, :meth:" "`~Path.is_mount`, :meth:`~Path.is_symlink`, :meth:`~Path.is_block_device`, :" -"meth:`~Path.is_char_device`, :meth:`~Path.is_socket` は、OSレベルで表現不能な" -"文字を含むパスに対して、例外を送出する代わりに ``False`` を返すようになりまし" -"た。 " +"meth:`~Path.is_char_device`, :meth:`~Path.is_fifo`, :meth:`~Path.is_socket` " +"は、OSレベルで表現不能な文字を含むパスに対して、例外を送出する代わりに " +"``False`` を返すようになりました。 " #: ../../library/pathlib.rst:1008 msgid "" diff --git a/library/platform.po b/library/platform.po index 9f518b678..810f375ca 100644 --- a/library/platform.po +++ b/library/platform.po @@ -164,8 +164,8 @@ msgid "" "release string, to get the macOS version rather than the darwin version." msgstr "" "macOSでは、 :func:`mac_ver` が空でないリリース文字列を返すとき、darwin のバー" -"ジョンではなく macOS のバージョンを取得するために、この関数は :func:" -"`mac_ver` を使うようになりました。" +"ジョンではなく macOS のバージョンを取得するために、この関数は ``mac_ver()`` " +"を使うようになりました。" #: ../../library/platform.rst:89 msgid "Returns the (real) processor name, e.g. ``'amdk6'``." diff --git a/library/poplib.po b/library/poplib.po index aeae685c5..b789e7df2 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -54,8 +54,8 @@ msgid "" "protocol layer." msgstr "" "加えて、このモジュールはクラス :class:`POP3_SSL` を提供しています。\n" -":class:`POP3_SSL` は SSL を下層のプロトコルレイヤーとして使う POP3 サーバへ" -"の接続をサポートしています。" +"``POP3_SSL`` は SSL を下層のプロトコルレイヤーとして使う POP3 サーバへの接続" +"をサポートしています。" #: ../../library/poplib.rst:23 msgid "" diff --git a/library/profile.po b/library/profile.po index ab9afe32f..b3fe33f3e 100644 --- a/library/profile.po +++ b/library/profile.po @@ -536,10 +536,10 @@ msgid "" "length 2, then you will get an especially fast version of the dispatch " "routine." msgstr "" -":func:`your_time_func` は単一の数値、あるいは (:func:`os.times` と同じよう" -"に) その合計が累計時間を示すリストを返すようになっていなければなりません。関" -"数が1つの数値、あるいは長さ2の数値のリストを返すようになっていれば、ディス" -"パッチルーチンには特別な高速化バージョンが使われます。" +"``your_time_func()`` は単一の数値、あるいは (:func:`os.times` と同じように) " +"その合計が累計時間を示すリストを返すようになっていなければなりません。関数が1" +"つの数値、あるいは長さ2の数値のリストを返すようになっていれば、ディスパッチ" +"ルーチンには特別な高速化バージョンが使われます。" #: ../../library/profile.rst:335 msgid "" @@ -565,11 +565,11 @@ msgid "" "``your_integer_time_func`` returns times measured in thousands of seconds, " "you would construct the :class:`Profile` instance as follows::" msgstr "" -":func:`your_time_func` は単一の数値を返すようになっていなければなりません。単" -"一の整数を返すのであれば、クラスコンストラクタの第二引数に単位時間当たりの実" -"際の持続時間を渡せます。例えば ``your_integer_time_func`` が 1000 分の 1 秒単" -"位で計測した時間を返すとすると、 :class:`Profile` インスタンスを以下のように" -"構築出来ます::" +"``your_time_func()`` は単一の数値を返すようになっていなければなりません。単一" +"の整数を返すのであれば、クラスコンストラクタの第二引数に単位時間当たりの実際" +"の持続時間を渡せます。例えば ``your_integer_time_func`` が 1000 分の 1 秒単位" +"で計測した時間を返すとすると、 :class:`Profile` インスタンスを以下のように構" +"築出来ます::" #: ../../library/profile.rst:351 msgid "pr = profiling.tracing.Profile(your_integer_time_func, 0.001)" diff --git a/library/pyexpat.po b/library/pyexpat.po index 83e7bdd40..e6e80cbb7 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -911,7 +911,7 @@ msgid "" "`DefaultHandler` callback, if provided." msgstr "" "このハンドラが与えられておらず、 :attr:`DefaultHandler` コールバックが指定さ" -"れていれば、外部エンティティは :attr:`DefaultHandler` で報告されます。" +"れていれば、外部エンティティは ``DefaultHandler`` で報告されます。" #: ../../library/pyexpat.rst:720 msgid "" diff --git a/library/runpy.po b/library/runpy.po index 468117b50..99beffe4b 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -210,8 +210,8 @@ msgid "" "`None` and to ``''`` otherwise." msgstr "" "``__name__`` は、オプション引数 *run_name* が :const:`None` でない場合は " -"*run_name* に設定されます。 *run_name* が :const:`None` の場合は " -"``''`` に設定されます。" +"*run_name* に設定されます。 *run_name* が ``None`` の場合は ``''`` " +"に設定されます。" #: ../../library/runpy.rst:137 msgid "" diff --git a/library/shlex.po b/library/shlex.po index fdae2c122..c7ee75735 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -408,11 +408,11 @@ msgid "" "original input stream. Source requests may be stacked any number of levels " "deep." msgstr "" -"このメンバ変数は標準で :const:`None` を取ります。この値に文字列を代入すると、" -"その文字列は多くのシェルにおける ``source`` キーワードに似た、字句解析レベル" -"でのインクルード要求として認識されます。すなわち、その直後に現れるトークンを" -"ファイル名として新たなストリームを開き、そのストリームを入力として、EOF に到" -"達するまで読み込まれます。新たなストリームの EOF に到達した時点で :meth:`~io." +"このメンバ変数は標準で ``None`` を取ります。この値に文字列を代入すると、その" +"文字列は多くのシェルにおける ``source`` キーワードに似た、字句解析レベルでの" +"インクルード要求として認識されます。すなわち、その直後に現れるトークンをファ" +"イル名として新たなストリームを開き、そのストリームを入力として、EOF に到達す" +"るまで読み込まれます。新たなストリームの EOF に到達した時点で :meth:`~io." "IOBase.close` が呼び出され、入力は元の入力ストリームに戻されます。ソースリク" "エストは任意のレベルの深さまでスタックしてかまいません。" diff --git a/library/shutil.po b/library/shutil.po index a53b03666..c8e6b9a87 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -75,7 +75,7 @@ msgid "" "file position of the *fsrc* object is not 0, only the contents from the " "current file position to the end of the file will be copied." msgstr "" -":term::`file-like object ` *fsrc* の内容を *fdst* へコピーしま" +":term:`file-like object ` *fsrc* の内容を *fdst* へコピーしま" "す。整数値 *length* は与えられた場合バッファサイズを表します。特に *length* " "が負の場合、チャンク内のソースデータを繰り返し操作することなくデータをコピー" "します。デフォルトでは、制御不能なメモリ消費を避けるためにデータはチャンク内" @@ -196,7 +196,7 @@ msgid "" "and return." msgstr "" "パーミッションを *src* から *dst* にコピーします。ファイルの内容、オーナー、" -"グループには影響しません。 *src* と *dst* は :term`path-like object ` または文字列でファイルのパス名を指定します。 *follow_symlinks* " "が偽で、*src* および *dst* がシンボリックリンクの場合、 :func:`copymode` は " "(リンク先ではなく) *dst* 自体のモードを変更します。この機能は全てのプラット" @@ -551,8 +551,8 @@ msgstr "" "それ以外のプラットフォームでは、 :func:`rmtree` の実装はシンボリックリンク攻" "撃の影響を受けます。適当なタイミングと環境で攻撃者はファイルシステム上のシン" "ボリックリンクを操作して、それ以外の方法ではアクセス不可能なファイルを削除す" -"ることが出来ます。アプリケーションは、どちらのバージョンの :func:`rmtree` が" -"利用されているかを知るために関数のデータ属性 :data:`rmtree." +"ることが出来ます。アプリケーションは、どちらのバージョンの ``rmtree()`` が利" +"用されているかを知るために関数のデータ属性 :data:`rmtree." "avoids_symlink_attacks` を利用することができます。" #: ../../library/shutil.rst:329 diff --git a/library/signal.po b/library/signal.po index 99cc3e1e6..e2b627951 100644 --- a/library/signal.po +++ b/library/signal.po @@ -401,7 +401,7 @@ msgid "" "SIGVTALRM upon expiration." msgstr "" "プロセスの実行時間だけデクリメントするインターバルタイマーです。タイマーが発" -"火したときに :const:`SIGVTALRM` を送ります。" +"火したときに ``SIGVTALRM`` を送ります。" #: ../../library/signal.rst:332 msgid "" @@ -413,8 +413,7 @@ msgstr "" "プロセスの実行中と、システムがそのプロセスのために実行している時間だけデクリ" "メントするインターバルタイマーです。ITIMER_VIRTUAL と組み合わせて、このタイ" "マーはよくアプリケーションがユーザー空間とカーネル空間で消費した時間のプロ" -"ファイリングに利用されます。タイマーが発火したときに :const:`SIGPROF` を送り" -"ます。" +"ファイリングに利用されます。タイマーが発火したときに ``SIGPROF`` を送ります。" #: ../../library/signal.rst:340 msgid "" diff --git a/library/socket.po b/library/socket.po index 5de56d8b5..6ce2199e1 100644 --- a/library/socket.po +++ b/library/socket.po @@ -1429,9 +1429,9 @@ msgstr "" "ホスト名を ``'100.50.200.5'`` のようなIPv4形式のアドレスに変換します。ホスト" "名としてIPv4アドレスを指定した場合、その値は変換せずにそのまま返ります。 :" "func:`gethostbyname` APIへのより完全なインターフェイスが必要であれば、 :func:" -"`gethostbyname_ex` を参照してください。 :func:`gethostbyname` は、IPv6名前解" -"決をサポートしていません。IPv4/ v6のデュアルスタックをサポートする場合は :" -"func:`getaddrinfo` を使用します。" +"`gethostbyname_ex` を参照してください。 ``gethostbyname()`` は、IPv6名前解決" +"をサポートしていません。IPv4/ v6のデュアルスタックをサポートする場合は :func:" +"`getaddrinfo` を使用します。" #: ../../library/socket.rst:1089 ../../library/socket.rst:1105 msgid "" @@ -1944,8 +1944,8 @@ msgstr "" "(デフォルト値), :const:`SOCK_DGRAM`, :const:`SOCK_RAW` または他の ``SOCK_`` " "定数の何れかを指定します。プロトコル番号は通常省略するか、または0を指定します" "が、アドレスファミリーに :const:`AF_CAN` を指定した場合は、プロトコル番号に" -"は const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP`, :const:`CAN_J1939` " -"のいずれかを指定すべきです。" +"は :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP`, :const:" +"`CAN_J1939` のいずれかを指定すべきです。" #: ../../library/socket.rst:1490 msgid "" @@ -2035,7 +2035,7 @@ msgstr "" #: ../../library/socket.rst:1556 ../../library/socket.rst:1650 msgid "The socket is now non-inheritable." -msgstr "ソケットが :ref:`継承不可 ` になりました。" +msgstr "ソケットが継承不可になりました。" #: ../../library/socket.rst:1559 ../../library/socket.rst:1786 #: ../../library/socket.rst:1801 ../../library/socket.rst:1878 @@ -2882,8 +2882,8 @@ msgid "" "depends on settings of the listening socket:" msgstr "" ":func:`getdefaulttimeout` が :const:`None` でない場合、 :meth:`~socket." -"accept` メソッドが返すソケットでは、そのタイムアウトが継承されます。 :const:" -"`None` である場合、待機中のソケットの設定によって動作は異なります。" +"accept` メソッドが返すソケットでは、そのタイムアウトが継承されます。 " +"``None`` である場合、待機中のソケットの設定によって動作は異なります。" #: ../../library/socket.rst:2228 msgid "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 090422ec4..f6138fa95 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -289,8 +289,8 @@ msgid "" "The result is a :class:`list` of two :class:`!tuple`\\s, one per row, each " "containing that row's ``score`` value." msgstr "" -"結果は、2 つの :class:`タプル ` の :class:`リスト ` で、 それぞ" -"れのタプルにその行の ``score`` 値が含まれています。" +"結果は、2 つの :class:`!タプル` の :class:`リスト ` で、 それぞれのタプ" +"ルにその行の ``score`` 値が含まれています。" #: ../../library/sqlite3.rst:175 msgid "" @@ -2461,12 +2461,12 @@ msgid "" "arguments, a :class:`Cursor` object and the :class:`!tuple` of row values, " "and returns a custom object representing an SQLite row." msgstr "" -"この :class:`カーソル ` から取得された行の表現方法を制御します。 " -"``None`` の場合、行は :class:`タプル ` として表されます。 :class:" -"`sqlite3.Row` に設定することもできます。 そしてまた、 :class:`Cursor` オブ" -"ジェクトと、 行の値の :class:`タプル ` の、 2 つの引数を受け取り、 " -"SQLite の行(row)を表すカスタム・オブジェクトを返す、 :term:`呼び出し可能オブ" -"ジェクト ` に設定することもできます。" +"この :class:`!カーソル` から取得された行の表現方法を制御します。 ``None`` の" +"場合、行は :class:`タプル ` として表されます。 :class:`sqlite3.Row` に" +"設定することもできます。 そしてまた、 :class:`Cursor` オブジェクトと、 行の値" +"の :class:`!タプル` の、 2 つの引数を受け取り、 SQLite の行(row)を表すカスタ" +"ム・オブジェクトを返す、 :term:`呼び出し可能オブジェクト ` に設定す" +"ることもできます。" #: ../../library/sqlite3.rst:1711 msgid "" @@ -2474,10 +2474,9 @@ msgid "" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -":class:`カーソル・オブジェクト ` の作成時に :attr:`Connection." -"row_factory` の値をこの属性のデフォルト値として設定します。この属性に割り当て" -"ても、親接続(parent connection)の :attr:`Connection.row_factory` には影響しま" -"せん。" +":class:`!カーソル・オブジェクト` の作成時に :attr:`Connection.row_factory` の" +"値をこの属性のデフォルト値として設定します。この属性に割り当てても、親接続" +"(parent connection)の :attr:`Connection.row_factory` には影響しません。" #: ../../library/sqlite3.rst:1730 msgid "Row objects" @@ -3373,9 +3372,9 @@ msgid "" "rolling back." msgstr "" ":class:`Connection` オブジェクトは、コンテキスト・マネージャーとして使用で" -"き、コンテキスト・マネージャーとして使用すると、 :keyword:`with` ブロックを離" -"れるときに、開いているトランザクションを自動的にコミットまたはロールバックし" -"ます。 :keyword:`with` 文のブロックが例外なく終了すると、トランザクションはコ" +"き、コンテキスト・マネージャーとして使用すると、 ``with`` ブロックを離れると" +"きに、開いているトランザクションを自動的にコミットまたはロールバックしま" +"す。 :keyword:`with` 文のブロックが例外なく終了すると、トランザクションはコ" "ミットされます。このコミットが失敗した、または、 ``with`` 文のブロックで" "キャッチされなかった例外が発生した場合、トランザクションはロールバックされま" "す。 :attr:`~Connection.autocommit` が ``False`` の場合、コミット後またはロー" @@ -3497,9 +3496,9 @@ msgid "" "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" "デフォルトでは、 :mod:`!sqlite3` は各行(row)を :class:`タプル ` として" -"表します。 :class:`タプル ` があなたのニーズと合わない場合は、 :" -"class:`sqlite3.Row` クラスまたはカスタム :attr:`~Cursor.row_factory` を使用で" -"きます。" +"表します。 :class:`!タプル` があなたのニーズと合わない場合は、 :class:" +"`sqlite3.Row` クラスまたはカスタム :attr:`~Cursor.row_factory` を使用できま" +"す。" #: ../../library/sqlite3.rst:2506 msgid "" @@ -3520,11 +3519,11 @@ msgid "" "To use :class:`!Row` as a row factory, assign it to the :attr:`!row_factory` " "attribute:" msgstr "" -":class:`!Row` は、 :class:`タプル ` に対してメモリ・オーバーヘッドと" -"パフォーマンスへの影響を最小限に抑えながら、列(row)へのインデックスによるアク" -"セスと、列への(大文字と小文字を区別しない)名前によるアクセスを提供します。 :" -"class:`!Row` を行工場(row factory)として使用するには、 :attr:`!row_factory` " -"属性に割り当てます:" +":class:`!Row` は、 :class:`!タプル` に対してメモリ・オーバーヘッドとパフォー" +"マンスへの影響を最小限に抑えながら、列(row)へのインデックスによるアクセスと、" +"列への(大文字と小文字を区別しない)名前によるアクセスを提供します。 :class:`!" +"Row` を行工場(row factory)として使用するには、 :attr:`!row_factory` 属性に割" +"り当てます:" #: ../../library/sqlite3.rst:2516 msgid "" @@ -3580,8 +3579,8 @@ msgstr "" msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -"これを使うと、クエリは :class:`タプル ` の代わりに :class:`!dict` を" -"返すようになります:" +"これを使うと、クエリは :class:`!タプル` の代わりに :class:`!dict` を返すよう" +"になります:" #: ../../library/sqlite3.rst:2555 msgid "" @@ -3809,9 +3808,9 @@ msgid "" msgstr "" ":attr:`Connection.autocommit` が :data:`LEGACY_TRANSACTION_CONTROL` (これがデ" "フォルトです)に設定されている場合、トランザクションの振る舞いは :attr:" -"`Connection.isolation_level` 属性を使用して制御されます。 :data:" -"`LEGACY_TRANSACTION_CONTROL` 以外の場合、 :attr:`!isolation_level` は効果があ" -"りません。" +"`Connection.isolation_level` 属性を使用して制御されます。 " +"``LEGACY_TRANSACTION_CONTROL`` 以外の場合、 :attr:`!isolation_level` は効果が" +"ありません。" #: ../../library/sqlite3.rst:2709 msgid "" diff --git a/library/stdtypes.po b/library/stdtypes.po index 7b00d79ec..42299862f 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -7017,7 +7017,7 @@ msgstr "" #: ../../library/stdtypes.rst:4667 msgid "Here is an example with a non-byte format::" -msgstr ":class:`~memoryview.format` が単バイト単位ではない例を示します::" +msgstr "``format`` が単バイト単位ではない例を示します::" #: ../../library/stdtypes.rst:4669 msgid "" @@ -7695,9 +7695,9 @@ msgid "" "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -"空でない :class:`set` (:class:`frozenset` ではない) は、:class:`set` コンスト" -"ラクタに加え、要素を波括弧中にカンマで区切って列挙することでも生成できます。" -"例: ``{'jack', 'sjoerd'}``。" +"空でない ``set`` (``frozenset`` ではない) は、:class:`set` コンストラクタに加" +"え、要素を波括弧中にカンマで区切って列挙することでも生成できます。例: " +"``{'jack', 'sjoerd'}``。" #: ../../library/stdtypes.rst:5151 msgid "The constructors for both classes work the same:" @@ -7710,11 +7710,11 @@ msgid "" "sets of sets, the inner sets must be :class:`frozenset` objects. If " "*iterable* is not specified, a new empty set is returned." msgstr "" -"*iterable* から要素を取り込んだ、新しい :class:`set` もしくは :class:" -"`frozenset` オブジェクトを返します。 集合の要素は :term:`ハッシュ可能 " -"` なものでなくてはなりません。集合の集合を表現するためには、内側の" -"集合は :class:`frozenset` オブジェクトでなくてはなりません。*iterable* が指定" -"されない場合、新しい空の集合が返されます。" +"*iterable* から要素を取り込んだ、新しい ``set`` もしくは ``frozenset`` オブ" +"ジェクトを返します。 集合の要素は :term:`ハッシュ可能 ` なものでな" +"くてはなりません。集合の集合を表現するためには、内側の集合は :class:" +"`frozenset` オブジェクトでなくてはなりません。*iterable* が指定されない場合、" +"新しい空の集合が返されます。" #: ../../library/stdtypes.rst:5162 msgid "Sets can be created by several means:" @@ -8767,12 +8767,11 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" "Python の :term:`ジェネレータ ` と :class:`contextlib." -"contextmanager` :term:`デコレータ ` はこのプロトコルの簡便な実装" -"方法を提供します。ジェネレータ関数を :class:`contextlib.contextmanager` デコ" -"レータでデコレートすると、デコレートされないジェネレータ関数が作成するイテ" -"レータの代わりに、必要な :meth:`~contextmanager.__enter__` および :meth:" -"`~contextmanager.__exit__` メソッドを実装したコンテキストマネージャを返すよう" -"になります。" +"contextmanager` デコレータはこのプロトコルの簡便な実装方法を提供します。ジェ" +"ネレータ関数を :class:`contextlib.contextmanager` デコレータでデコレートする" +"と、デコレートされないジェネレータ関数が作成するイテレータの代わりに、必要" +"な :meth:`~contextmanager.__enter__` および :meth:`~contextmanager.__exit__` " +"メソッドを実装したコンテキストマネージャを返すようになります。" #: ../../library/stdtypes.rst:5859 msgid "" diff --git a/library/subprocess.po b/library/subprocess.po index 9e8fcf3f8..5c87c9b18 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -107,7 +107,7 @@ msgstr "" "`frequently-used-arguments` で説明されています (そのためここではキーワード専" "用引数の表記に省略されています)。関数の完全な使用法を説明しても大部分が :" "class:`Popen` コンストラクターの内容と同じになります - この関数のほとんどの引" -"数は :class:`Popen` インターフェイスに渡されます。(*timeout*、*input* および " +"数は ``Popen`` インターフェイスに渡されます。(*timeout*、*input* および " "*check* は除く。)" #: ../../library/subprocess.rst:50 @@ -556,7 +556,7 @@ msgid "" msgstr "" "このモジュールの中で、根底のプロセス生成と管理は :class:`Popen` クラスによっ" "て扱われます。簡易関数によってカバーされないあまり一般的でないケースを開発者" -"が扱えるように、:class:`Popen` クラスは多くの柔軟性を提供しています。" +"が扱えるように、 ``Popen`` クラスは多くの柔軟性を提供しています。" #: ../../library/subprocess.rst:365 msgid "" diff --git a/library/sys.po b/library/sys.po index 284aac604..daefb85a5 100644 --- a/library/sys.po +++ b/library/sys.po @@ -1245,9 +1245,9 @@ msgid "" "filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" "c:type:`PyConfig`." msgstr "" -"term:`ファイルシステムのエンコーディングとエラーハンドラ ` は、Pythonの開始時に:c:func:`PyConfig_Read` 関数" -"により設定されます。 :c:type:`PyConfig` のメンバー :c:member:`~PyConfig." +":term:`ファイルシステムのエンコーディングとエラーハンドラ ` は、Python の開始時に :c:func:`PyConfig_Read` 関" +"数により設定されます。 :c:type:`PyConfig` のメンバー :c:member:`~PyConfig." "filesystem_encoding` と :c:member:`~PyConfig.filesystem_errors` を参照してく" "ださい。" @@ -3136,9 +3136,9 @@ msgid "" "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" "標準ストリームにバイナリーデータの読み書きを行うには下位のバイナリー :data:" -"`~io.TextIOBase.buffer` オブジェクトを使用してください。例えば :class:" -"`bytes` を :data:`stdout` に書き出す場合は ``sys.stdout.buffer." -"write(b'abc')`` を使用してください。" +"`~io.TextIOBase.buffer` オブジェクトを使用してください。例えば ``bytes`` を :" +"data:`stdout` に書き出す場合は ``sys.stdout.buffer.write(b'abc')`` を使用して" +"ください。" #: ../../library/sys.rst:2216 msgid "" diff --git a/library/tarfile.po b/library/tarfile.po index c0e0fbc2e..f4c013ece 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -1075,7 +1075,6 @@ msgstr "" "*member* が一般ファイルまたはリンクの場合、:class:`io.BufferedReader` オブ" "ジェクトが返されます。\n" "存在するそれ以外のメンバーでは、 :const:`None` が返されます。\n" -"それ以外の場合、:const:`None` が返されます。\n" "アーカイブに *member* が存在しない場合は :exc:`KeyError` が送出されます。" #: ../../library/tarfile.rst:624 diff --git a/library/tempfile.po b/library/tempfile.po index 577b6e422..e3f7d7a26 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -100,8 +100,8 @@ msgid "" "`tempfile-examples`). On completion of the context or destruction of the " "file object the temporary file will be removed from the filesystem." msgstr "" -"返されたオブジェクトを :term:コンテキストマネージャ `として" -"使うことができます (:ref:`tempfile-examples` を参照してください)。\n" +"返されたオブジェクトを :term:`コンテキストマネージャ ` とし" +"て使うことができます (:ref:`tempfile-examples` を参照してください)。\n" "コンテキストの完了やファイルオブジェクトの破壊で、一時ファイルはファイルシス" "テムから削除されます。" diff --git a/library/threading.po b/library/threading.po index 10a826a78..2f6b3783f 100644 --- a/library/threading.po +++ b/library/threading.po @@ -686,8 +686,8 @@ msgid "" "method in a separate thread of control." msgstr "" "ひとたびスレッドオブジェクトを生成すると、スレッドの :meth:`~Thread.start` メ" -"ソッドを呼び出して活動を開始しなければなりません。 :meth:`start` メソッド は" -"それぞれのスレッドの :meth:`~Thread.run` メソッドを起動します。" +"ソッドを呼び出して活動を開始しなければなりません。 ``start()`` メソッド はそ" +"れぞれのスレッドの :meth:`~Thread.run` メソッドを起動します。" #: ../../library/threading.rst:473 msgid "" @@ -778,10 +778,10 @@ msgstr "" "\"ダミースレッドオブジェクト (dummy thread objects)\" が作成される場合があり" "ます。ダミースレッドは、 \"外来スレッド (alien thread)\" に相当するスレッドオ" "ブジェクトです。ダミースレッドは、C コードから直接生成されたスレッドのよう" -"な、 :mod:`threading` モジュールの外で開始された処理スレッドです。ダミース" -"レッドオブジェクトには限られた機能しかなく、常に生存中、かつデーモンスレッド" -"であるとみなされ、 :ref:`join ` できません。また、外来ス" -"レッドの終了を検出するのは不可能なので、ダミースレッドは削除できません。" +"な、 ``threading`` モジュールの外で開始された処理スレッドです。ダミースレッド" +"オブジェクトには限られた機能しかなく、常に生存中、かつデーモンスレッドである" +"とみなされ、 :ref:`join ` できません。また、外来スレッドの" +"終了を検出するのは不可能なので、ダミースレッドは削除できません。" #: ../../library/threading.rst:515 msgid "" @@ -887,9 +887,9 @@ msgid "" "object's :meth:`~Thread.run` method to be invoked in a separate thread of " "control." msgstr "" -"このメソッドは、スレッドオブジェクトあたり一度しか呼び出してはなりません。 :" -"meth:`~Thread.start` は、オブジェクトの :meth:`~Thread.run` メソッドが個別の" -"処理スレッド中で呼び出されるように調整します。" +"このメソッドは、スレッドオブジェクトあたり一度しか呼び出してはなりません。 " +"``start()`` は、オブジェクトの :meth:`~Thread.run` メソッドが個別の処理スレッ" +"ド中で呼び出されるように調整します。" #: ../../library/threading.rst:569 msgid "" @@ -1665,7 +1665,7 @@ msgid "" msgstr "" "根底にあるロックが :class:`RLock` である場合、 :meth:`release` メソッドでは" "ロックは解放されません。というのも、ロックが再帰的に複数回獲得されている場合" -"には、 :meth:`release` によって実際にアンロックが行われないかもしれないからで" +"には、 ``release()`` によって実際にアンロックが行われないかもしれないからで" "す。その代わり、ロックが再帰的に複数回獲得されていても確実にアンロックを行え" "る :class:`RLock` クラスの内部インターフェースを使います。その後ロックを再獲" "得する時に、もう一つの内部インターフェースを使ってロックの再帰レベルを復帰し" @@ -1765,8 +1765,8 @@ msgid "" "lock, its caller should." msgstr "" "注意: 起こされたスレッドは実際にロックを再獲得できるまで :meth:`wait` 呼び出" -"しから戻りません。 :meth:`notify` はロックを解放しないので、 :meth:`notify` " -"呼び出し側は明示的にロックを解放しなければなりません。" +"しから戻りません。 :meth:`notify` はロックを解放しないので、 ``notify()`` 呼" +"び出し側は明示的にロックを解放しなければなりません。" #: ../../library/threading.rst:1095 msgid "" @@ -1896,10 +1896,9 @@ msgid "" "zero on entry and other threads are waiting for it to become larger than " "zero again, wake up *n* of those threads." msgstr "" -"内部カウンタを *n* インクリメントして、セマフォを解放します。 :meth:" -"`release` 処理に入ったときにカウンタがゼロであり、カウンタの値がゼロより大き" -"くなるのを待っている別のスレッドがあった場合、それらのスレッドから *n* 個を起" -"こします。" +"内部カウンタを *n* インクリメントして、セマフォを解放します。 ``release()`` " +"処理に入ったときにカウンタがゼロであり、カウンタの値がゼロより大きくなるのを" +"待っている別のスレッドがあった場合、それらのスレッドから *n* 個を起こします。" #: ../../library/threading.rst:1171 msgid "Added the *n* parameter to release multiple waiting threads at once." @@ -1949,7 +1948,7 @@ msgid "" "methods when they need to connect to the server::" msgstr "" "作業スレッドは、ひとたび立ち上がると、サーバへ接続する必要が生じたときにセマ" -"フォの :meth:`acquire` および :meth:`release` メソッドを呼び出します::" +"フォの ``acquire()`` および ``release()`` メソッドを呼び出します::" #: ../../library/threading.rst:1204 msgid "" @@ -2001,10 +2000,10 @@ msgid "" "flag is initially false." msgstr "" "イベントオブジェクトを実装しているクラスです。イベントは :meth:`~Event.set` " -"メソッドを使うと :const:`True` に、 :meth:`clear` メソッドを使うと :const:" -"`False` にセットされるようなフラグを管理します。 :meth:`wait` メソッドは、全" -"てのフラグが true になるまでブロックするようになっています。フラグの初期値は " -"false です。" +"メソッドを使うと ``True`` に、 :meth:`clear` メソッドを使うと ``False`` に" +"セットされるようなフラグを管理します。 :meth:`wait` メソッドは、全てのフラグ" +"が true になるまでブロックするようになっています。フラグの初期値は false で" +"す。" #: ../../library/threading.rst:1240 msgid "Return ``True`` if and only if the internal flag is true." diff --git a/library/time.po b/library/time.po index af38111fa..27dcf3b3f 100644 --- a/library/time.po +++ b/library/time.po @@ -1058,9 +1058,9 @@ msgstr "" "ます; このパラメーターの値はデフォルトでは ``\"%a %b %d %H:%M:%S %Y\"`` で、:" "func:`ctime` が返すフォーマットに一致します。*string* が *format* に従って解" "釈できなかった場合、例外 :exc:`ValueError` が送出されます。解析しようとする " -"*string* が解析後に余分なデータを持っていた場合、:exc:`ValueError` が送出され" -"ます。欠落したデータについて、適切な値を推測できない場合はデフォルトの値で埋" -"められ、その値は ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)`` です。*string* も " +"*string* が解析後に余分なデータを持っていた場合、 ``ValueError`` が送出されま" +"す。欠落したデータについて、適切な値を推測できない場合はデフォルトの値で埋め" +"られ、その値は ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)`` です。*string* も " "*format* も文字列でなければなりません。" #: ../../library/time.rst:627 @@ -1218,8 +1218,8 @@ msgid "" msgstr "" ":func:`mktime` の呼び出し時に、:attr:`tm_isdst` は夏時間が有効な場合は 1、そ" "うでない場合は 0 に設定されることがあります。\n" -"値が -1 の場合は夏時間について不明なことを表していて、普通 :attr:`tm_isdst` " -"は正しい状態に設定されます。" +"値が -1 の場合は夏時間について不明なことを表していて、普通 ``tm_isdst`` は正" +"しい状態に設定されます。" #: ../../library/time.rst:710 msgid "" @@ -1227,9 +1227,9 @@ msgid "" "class:`struct_time`, or having elements of the wrong type, a :exc:" "`TypeError` is raised." msgstr "" -":class:`struct_time` を引数とする関数に正しくない長さの :class:`struct_time` " -"や要素の型が正しくない :class:`struct_time` を与えた場合には、 :exc:" -"`TypeError` が送出されます。" +":class:`struct_time` を引数とする関数に正しくない長さの ``struct_time`` や要" +"素の型が正しくない ``struct_time`` を与えた場合には、 :exc:`TypeError` が送出" +"されます。" #: ../../library/time.rst:716 msgid "" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 733c56026..db43b7433 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -1362,8 +1362,8 @@ msgid "" "will just mask the widget." msgstr "" "macOS では、最上位のウィンドウにはデフォルトで組み込みのサイズグリップが含ま" -"れています。組み込みのグリップが :class:`Sizegrip` を隠してしまうので、 :" -"class:`Sizegrip` を追加しても問題ありません。" +"れています。組み込みのグリップが :class:`Sizegrip` を隠してしまうので、 " +"``Sizegrip`` を追加しても問題ありません。" #: ../../library/tkinter.ttk.rst:805 msgid "Bugs" diff --git a/library/typing.po b/library/typing.po index c1b9fa8cf..4700d25aa 100644 --- a/library/typing.po +++ b/library/typing.po @@ -1986,7 +1986,7 @@ msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -"Optionalは ``X | None`` のように書けるようになりました。 ref:`union型の表現 " +"Optionalは ``X | None`` のように書けるようになりました。 :ref:`union型の表現 " "` を参照ください。" #: ../../library/typing.rst:1168 diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 724059a0a..a437c7667 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -89,8 +89,8 @@ msgid "" msgstr "" ":class:`Mock` および :class:`MagicMock` オブジェクトはアクセスしたすべての属" "性とメソッドを作成し、どのように使用されたかについての詳細な情報を格納しま" -"す。戻り値を指定したり利用できる属性を制限するために :class:`Mock` および :" -"class:`MagicMock` を設定でき、どのよう使用されたかについてアサートできます:" +"す。戻り値を指定したり利用できる属性を制限するために ``Mock`` および " +"``MagicMock`` を設定でき、どのよう使用されたかについてアサートできます:" #: ../../library/unittest.mock.rst:70 msgid "" @@ -197,7 +197,7 @@ msgstr "" "mock によってマジックメソッドに関数 (あるいは他の Mock インスタンス) を割り当" "てることができ、それらは適切に呼び出されます。\n" ":class:`MagicMock` クラスは、すべてのマジックメソッドがあらかじめ作成されてい" -"る点を除けば :class:`Mock` クラスと一緒です (まあ、とにかく便利ってこと)。" +"る点を除けば ``Mock`` クラスと一緒です (まあ、とにかく便利ってこと)。" #: ../../library/unittest.mock.rst:160 msgid "" @@ -813,9 +813,9 @@ msgid "" "the object they are replacing / masquerading as:" msgstr "" "通常、オブジェクトの :attr:`!__class__` 属性はその型を返します。 :attr:`!" -"spec` を設定したオブジェクトの場合、 :attr:`!__class__` は代わりに :attr:" -"`spec` のクラスを返します。これにより、置き換え / 偽装しているオブジェクトに" -"対する :func:`isinstance` も通過することができます:" +"spec` を設定したオブジェクトの場合、 :attr:`!__class__` は代わりに :attr:`!" +"spec` のクラスを返します。これにより、置き換え / 偽装しているオブジェクトに対" +"する :func:`isinstance` も通過することができます:" #: ../../library/unittest.mock.rst:771 msgid "" @@ -919,7 +919,7 @@ msgid "" "__get__` and :meth:`~object.__set__` methods so you can specify a return " "value when it is fetched." msgstr "" -":class:`property` もしくは:term:`デスクリプタ ` として使われるた" +":class:`property` もしくは :term:`デスクリプタ ` として使われるた" "めのモックです。 :class:`PropertyMock` は、 :meth:`~object.__get__` と :meth:" "`~object.__set__` メソッドを提供し、戻り値を指定することができます。" @@ -1460,7 +1460,7 @@ msgid "" "`MagicMock` if patch is creating one for you." msgstr "" "patch が :class:`MagicMock` を生成する場合、 *spec* と *spec_set* キーワード" -"引数は :class:`MagicMock` に渡されます。" +"引数は ``MagicMock`` に渡されます。" #: ../../library/unittest.mock.rst:1446 msgid "" diff --git a/library/unittest.po b/library/unittest.po index bb3db3744..8dc637c63 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -756,8 +756,7 @@ msgstr "" "テストは多くなり、それらの設定は繰り返しになるかもしれません。\n" "幸いにも、:meth:`~TestCase.setUp` メソッドを実装することで設定コードをくくり" "出すことができます。\n" -"テストフレームワークは実行するテストごとに自動的に :meth:`~TestCase.setUp` を" -"呼びます::" +"テストフレームワークは実行するテストごとに自動的に ``setUp()`` を呼びます::" #: ../../library/unittest.rst:394 msgid "" @@ -1409,8 +1408,8 @@ msgid "" "Previous versions of ``run`` did not return the result. Neither did calling " "an instance." msgstr "" -"以前のバージョンの ``run`` は結果オブジェクトを返しませんでした。また :class:" -"`TestCase` インスタンスを呼び出した場合も同様でした。" +"以前のバージョンの ``run`` は結果オブジェクトを返しませんでした。また " +"``TestCase`` インスタンスを呼び出した場合も同様でした。" #: ../../library/unittest.rst:809 msgid "" @@ -2571,9 +2570,9 @@ msgid "" "fair\" with the framework. The initial value of this attribute is :exc:" "`AssertionError`." msgstr "" -":meth:`test` メソッドが送出する例外を指定するクラス属性です。例えばテストフ" -"レームワークで追加情報を付した特殊な例外が必要になる場合、この例外のサブクラ" -"スとして作成します。この属性の初期値は :exc:`AssertionError` です。" +"テストメソッドが送出する例外を指定するクラス属性です。例えばテストフレーム" +"ワークで追加情報を付した特殊な例外が必要になる場合、この例外のサブクラスとし" +"て作成します。この属性の初期値は :exc:`AssertionError` です。" #: ../../library/unittest.rst:1497 msgid "" @@ -3158,9 +3157,9 @@ msgid "" msgstr "" ":class:`TestCase` クラスを基底クラスとしてクラス階層を構築するとテストフィク" "スチャや補助的な関数をうまく共用することができますが、基底クラスに直接インス" -"タンス化できないテストメソッドがあると、この :meth:`loadTestsFromModule` を使" -"うことができません。この場合でも、 fixture が全て別々で定義がサブクラスにある" -"場合は使用することができます。" +"タンス化できないテストメソッドがあると、この ``loadTestsFromModule()`` を使う" +"ことができません。この場合でも、 fixture が全て別々で定義がサブクラスにある場" +"合は使用することができます。" #: ../../library/unittest.rst:1898 msgid "" @@ -3506,7 +3505,7 @@ msgid "" "was explicitly signalled using the :ref:`assert\\* methods `." msgstr "" ":class:`TestCase` と例外のトレースバック情報をフォーマットした文字列の 2 要素" -"タプルからなるリスト。それぞれのタプルは ref:`assert\\* メソッド ` を使って見つけ出した失敗に対応します。" #: ../../library/unittest.rst:2099 @@ -3597,7 +3596,7 @@ msgid "" "TestRunner` objects should respect this flag and return without running any " "additional tests." msgstr "" -"このメソッドを呼び出して :class:`TestResult` の :attr:`shouldStop` 属性に " +"このメソッドを呼び出して ``TestResult`` の :attr:`shouldStop` 属性に " "``True`` をセットすることで、実行中のテストは中断しなければならないというシグ" "ナルを送ることができます。 :class:`!TestRunner` オブジェクトはこのフラグを順" "守してそれ以上のテストを実行することなく復帰しなければなりません。" @@ -3787,8 +3786,8 @@ msgid "" "used instead of repeatedly creating new instances." msgstr "" ":class:`TestLoader` のインスタンスで、共用することが目的です。 :class:" -"`TestLoader` をカスタマイズする必要がなければ、新しい :class:`TestLoader` オ" -"ブジェクトを作らずにこのインスタンスを使用します。" +"`TestLoader` をカスタマイズする必要がなければ、新しい ``TestLoader`` オブジェ" +"クトを作らずにこのインスタンスを使用します。" #: ../../library/unittest.rst:2302 msgid "" diff --git a/library/urllib.request.po b/library/urllib.request.po index af12f870c..19e413c80 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -1106,7 +1106,7 @@ msgid "" msgstr "" "与えられた *url* (リクエストオブジェクトでも文字列でもかまいません) を開きま" "す。オプションとして *data* を与えることができます。 引数、戻り値、および送出" -"される例外は :func:`urlopen` と同じです (:func:`urlopen` の場合、標準でインス" +"される例外は :func:`urlopen` と同じです (``urlopen()`` の場合、標準でインス" "トールされている グローバルな :class:`OpenerDirector` の :meth:`open` メソッ" "ドを呼び出します) 。 オプションの *timeout* 引数は、接続開始のようなブロック" "する処理におけるタイムアウト時間を 秒数で指定します。(指定しなかった場合は、" diff --git a/library/xml.dom.po b/library/xml.dom.po index 18510b7ac..3da712603 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -995,8 +995,8 @@ msgid "" "Remember that it inherits properties from :class:`Node`." msgstr "" ":class:`Document` は XML ドキュメント全体を表現し、その構成要素である要素、属" -"性、処理命令、コメント等を持ちます。 :class:`Document` は :class:`Node` から" -"プロパティを継承していることを思い出してください。" +"性、処理命令、コメント等を持ちます。 ``Document`` は :class:`Node` からプロパ" +"ティを継承していることを思い出してください。" #: ../../library/xml.dom.rst:617 msgid "The one and only root element of the document." @@ -1147,8 +1147,8 @@ msgid "" ":class:`Element` is a subclass of :class:`Node`, so inherits all the " "attributes of that class." msgstr "" -":class:`Element` は :class:`Node` のサブクラスです。このため :class:`Node` ク" -"ラスの全ての属性を継承します。" +":class:`Element` は :class:`Node` のサブクラスです。このため ``Node`` クラス" +"の全ての属性を継承します。" #: ../../library/xml.dom.rst:757 msgid "" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 936fc14f8..f492fd9f3 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -170,8 +170,8 @@ msgid "" "functions may create an :class:`ElementTree`. Check the documentation to be " "sure." msgstr "" -":func:`fromstring` は XML を文字列から :class:`Element` に直接パースします。:" -"class:`Element` はパースされた木のルート要素です。他のパース関数は :class:" +":func:`fromstring` は XML を文字列から :class:`Element` に直接パースします。 " +"``Element`` はパースされた木のルート要素です。他のパース関数は :class:" "`ElementTree` を作成するかもしれません。ドキュメントをきちんと確認してくださ" "い。" diff --git a/library/xml.po b/library/xml.po index b3156c995..a48d0a35e 100644 --- a/library/xml.po +++ b/library/xml.po @@ -210,10 +210,9 @@ msgid "" "files. For an attacker it can reduce the amount of transmitted data by three " "magnitudes or more." msgstr "" -"解凍爆弾 (あるいは `ZIP 爆弾 `_) " -"は、gzip 圧縮 HTTP ストリームや LZMA 圧縮ファイルなどの圧縮された XML スト" -"リームをパースできる全ての XML ライブラリに対し行われます。\n" +"解凍爆弾 (あるいは `ZIP 爆弾 `_) は、gzip 圧縮 HTTP ストリームや " +"LZMA 圧縮ファイルなどの圧縮された XML ストリームをパースできる全ての XML ライ" +"ブラリに対し行われます。\n" "攻撃者は送信データ量を1/3以下に減らすことができます。" #: ../../library/xml.rst:122 diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index c56a5a9c9..1a396c3e1 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -291,8 +291,8 @@ msgid "" msgstr "" "機能名 *featurename* に値 *value* を設定します。その機能が認識できないとき" "は、 :exc:`SAXNotRecognizedException` を送出します。また、パーサが指定された" -"機能や設定をサポートしていないときは、 :exc:`SAXNotSupportedException` を送出" -"します。" +"機能や設定をサポートしていないときは、 ``SAXNotSupportedException`` を送出し" +"ます。" #: ../../library/xml.sax.reader.rst:187 msgid "" @@ -312,8 +312,8 @@ msgid "" msgstr "" "属性名 *propertyname* に値 *value* を設定します。その機能が認識できないとき" "は、 :exc:`SAXNotRecognizedException` を送出します。また、パーサが指定された" -"機能や設定をサポートしていないときは、 :exc:`SAXNotSupportedException` を送出" -"します。" +"機能や設定をサポートしていないときは、 ``SAXNotSupportedException`` を送出し" +"ます。" #: ../../library/xml.sax.reader.rst:202 msgid "IncrementalParser Objects" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index c45b9fcc6..8cbac6b8c 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -191,8 +191,8 @@ msgstr "" "タスクを実行するのに下層の関数を呼び出す場合、その関数は ``func(*params)`` の" "ように引数リストを展開して呼び出されます。\n" ":meth:`_dispatch` の返り値は結果としてクライアントに返されます。\n" -"*instance* に :meth:`_dispatch` メソッドがない場合、リクエストされたメソッド" -"名にマッチする属性を検索します。" +"*instance* に ``_dispatch()`` メソッドがない場合、リクエストされたメソッド名" +"にマッチする属性を検索します。" #: ../../library/xmlrpc.server.rst:108 msgid "" @@ -469,8 +469,8 @@ msgstr "" "*instance* に :meth:`_dispatch` メソッドがあった場合、リクエストされたメソッ" "ド名と引数で :meth:`_dispatch` を呼び出します。\n" "返り値は結果としてクライアントに返されます。\n" -"*instance* に :meth:`_dispatch` メソッドがなかった場合、リクエストされたメ" -"ソッド名にマッチする属性を検索します。\n" +"*instance* に ``_dispatch()`` メソッドがなかった場合、リクエストされたメソッ" +"ド名にマッチする属性を検索します。\n" "リクエストされたメソッド名がピリオドを含む場合、モジュール名の各要素が個々に" "検索され、簡単な階層的検索が実行されます。\n" "その検索で発見された値をリクエストの引数で呼び出し、クライアントに返り値を返" diff --git a/library/zipimport.po b/library/zipimport.po index 048fe1dda..42b76a8bd 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -121,7 +121,7 @@ msgstr "" #: ../../library/zipimport.rst:51 msgid ":mod:`importlib` - The implementation of the import machinery" -msgstr ":mod:`importlib` - :keyword:`import` の実装" +msgstr ":mod:`importlib` - ``import`` の実装" #: ../../library/zipimport.rst:52 msgid "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 360f6b1c4..56272725b 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -138,8 +138,8 @@ msgstr "" ":keyword:`if` 文は、式を一つ一つ評価してゆき、真になるまで続けて、真になった" "節のスイートだけを選択します (真: true と偽: false の定義については、 :ref:" "`booleans` 節を参照してください); 次に、選択したスイートを実行します (そし" -"て、 :keyword:`if` 文の他の部分は、実行や評価をされません)。全ての式が偽に" -"なった場合、 :keyword:`else` 節があれば、そのスイートが実行されます。" +"て、 ``if`` 文の他の部分は、実行や評価をされません)。全ての式が偽になった場" +"合、 :keyword:`else` 節があれば、そのスイートが実行されます。" #: ../../reference/compound_stmts.rst:109 msgid "The :keyword:`!while` statement" @@ -159,9 +159,9 @@ msgid "" "the suite of the :keyword:`!else` clause, if present, is executed and the " "loop terminates." msgstr "" -":keyword:`while` 文は式を繰り返し真偽評価し、真であれば最初のスイートを実行し" -"ます。式が偽であれば (最初から偽になっていることもありえます)、 :keyword:`!" -"else` 節がある場合にはそれを実行し、ループを終了します。" +"``while`` 文は式を繰り返し真偽評価し、真であれば最初のスイートを実行します。" +"式が偽であれば (最初から偽になっていることもありえます)、 :keyword:`!else` 節" +"がある場合にはそれを実行し、ループを終了します。" #: ../../reference/compound_stmts.rst:133 msgid "" @@ -322,9 +322,9 @@ msgid "" "the exception)." msgstr "" ":keyword:`!except` 節のヘッダにある式を値評価するときに例外が発生すると、元々" -"のハンドラ検索はキャンセルされ、新たな例外に対する例外ハンドラの検索を現在" -"の :keyword:`except` 節の外側のコードや呼び出しスタックに対して行います (:" -"keyword:`try` 文全体が例外を発行したかのように扱われます)。" +"のハンドラ検索はキャンセルされ、新たな例外に対する例外ハンドラの検索を現在の " +"``except`` 節の外側のコードや呼び出しスタックに対して行います (:keyword:" +"`try` 文全体が例外を発行したかのように扱われます)。" #: ../../reference/compound_stmts.rst:270 msgid "" @@ -566,7 +566,7 @@ msgid "" "finally` statement, the :keyword:`!finally` clause is also executed 'on the " "way out.'" msgstr "" -":keyword:`try`...\\ :keyword:`!finally` 文の :keyword:`try` スイート内で :" +":keyword:`!try`...\\ :keyword:`!finally` 文の :keyword:`try` スイート内で :" "keyword:`return` 、 :keyword:`break` 、または :keyword:`continue` 文が実行さ" "れた場合、 :keyword:`!finally` 節も、この文を '抜け出る途中に' 実行されます。" diff --git a/reference/datamodel.po b/reference/datamodel.po index c126aa1c0..34538f86b 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -64,10 +64,10 @@ msgid "" "an object itself). Like its identity, an object's :dfn:`type` is also " "unchangeable. [#]_" msgstr "" -"オブジェクトの型はオブジェクトがサポートする操作 (例: :func:`len` をサポート" -"するか) と、オブジェクトが取りうる値を決定します。 :func:`type` 関数はオブ" -"ジェクトの型 (型自体もオブジェクトです) を返します。同一性と同じく、オブジェ" -"クトの型(:dfn:`type`) も変更不可能です。 [#]_" +"オブジェクトの型はオブジェクトがサポートする操作 (例: ``len()`` をサポートす" +"るか) と、オブジェクトが取りうる値を決定します。 :func:`type` 関数はオブジェ" +"クトの型 (型自体もオブジェクトです) を返します。同一性と同じく、オブジェクト" +"の型(:dfn:`type`) も変更不可能です。 [#]_" #: ../../reference/datamodel.rst:46 msgid "" @@ -2489,9 +2489,9 @@ msgstr "" "インスタンスが (:meth:`__new__` によって) 生成された後、それが呼び出し元に返" "される前に呼び出されます。引数はクラスのコンストラクタ式に渡したものです。基" "底クラスとその派生クラスがともに :meth:`__init__` メソッドを持つ場合、派生ク" -"ラスの :meth:`__init__` メソッドは基底クラスの :meth:`__init__` メソッドを明" -"示的に呼び出して、インスタンスの基底クラス部分が適切に初期化されること保証し" -"なければなりません。例えば、 ``super().__init__([args...])`` 。" +"ラスの :meth:`__init__` メソッドは基底クラスの ``__init__()`` メソッドを明示" +"的に呼び出して、インスタンスの基底クラス部分が適切に初期化されること保証しな" +"ければなりません。例えば、 ``super().__init__([args...])`` 。" #: ../../reference/datamodel.rst:2019 msgid "" @@ -2516,9 +2516,9 @@ msgstr "" "インスタンスが破棄されるときに呼び出されます。\n" "これはファイナライザや (適切ではありませんが) デストラクタとも呼ばれます。\n" "基底クラスが :meth:`__del__` メソッドを持っている場合は、派生クラスの :meth:" -"`__del__` メソッドは何であれ、基底クラスの :meth:`__del__` メソッドを明示的" -"に呼び出して、インスタンスの基底クラス部分をきちんと確実に削除しなければなり" -"ません。" +"`__del__` メソッドは何であれ、基底クラスの ``__del__()`` メソッドを明示的に" +"呼び出して、インスタンスの基底クラス部分をきちんと確実に削除しなければなりま" +"せん。" #: ../../reference/datamodel.rst:2038 msgid "" @@ -2999,7 +2999,7 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" "クラスのインスタンスに対する属性アクセスを実装するために、無条件に呼び出され" -"ます。クラスが :meth:`__getattr__` も定義している場合、 :meth:`__getattr__` " +"ます。クラスが :meth:`__getattr__` も定義している場合、 ``__getattr__()`` " "は、 :meth:`__getattribute__` で明示的に呼び出すか、 :exc:`AttributeError` 例" "外を送出しない限り呼ばれません。このメソッドは (計算された) 属性値を返す" "か、 :exc:`AttributeError` 例外を送出します。このメソッドが再帰的に際限なく呼" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index f268f5663..0296fa5f9 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -149,8 +149,8 @@ msgid "" "A target occurring in a :keyword:`del` statement is also considered bound " "for this purpose (though the actual semantics are to unbind the name)." msgstr "" -":keyword:`del` 文で指定される対象は、(:keyword:`del` の意味付けは、実際は名前" -"の解放 (unbind) ですが) 文の目的上、束縛済みのものとみなされます。" +":keyword:`del` 文で指定される対象は、(``del`` の意味付けは、実際は名前の解放 " +"(unbind) ですが) 文の目的上、束縛済みのものとみなされます。" #: ../../reference/executionmodel.rst:84 msgid "" @@ -591,10 +591,10 @@ msgstr "" "Python インタプリタは、ランタイムエラー (ゼロ除算など) が検出されると例外を送" "出します。Python プログラムから、 :keyword:`raise` 文を使って明示的に例外を送" "出することもできます。例外ハンドラ (exception handler) は、 :keyword:" -"`try` ... :keyword:`except` 文で指定することができます。 :keyword:`try` 文" -"の :keyword:`finally` 節を使うとクリーンアップコード (cleanup code) を指定で" -"きます。このコードは例外は処理しませんが、先行するコードブロックで例外が起き" -"ても起きなくても実行されます。" +"`try` ... :keyword:`except` 文で指定することができます。 ``try`` 文の :" +"keyword:`finally` 節を使うとクリーンアップコード (cleanup code) を指定できま" +"す。このコードは例外は処理しませんが、先行するコードブロックで例外が起きても" +"起きなくても実行されます。" #: ../../reference/executionmodel.rst:374 msgid "" diff --git a/reference/expressions.po b/reference/expressions.po index 44e20f888..e6d79d010 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -3068,7 +3068,7 @@ msgstr "" "るテストを行います: ``x is y`` は、 *x* と *y* が同じオブジェクトを指すとき、" "かつそのときに限り真になります。\n" "オブジェクトの同一性は :meth:`id` 関数を使って判定されます。\n" -"``x is not y`` は :keyword:`is` の真値を反転したものになります。 [#]_" +"``x is not y`` は ``is`` の真値を反転したものになります。 [#]_" #: ../../reference/expressions.rst:2316 msgid "Boolean operations" diff --git a/reference/import.po b/reference/import.po index ab27b8526..03717274b 100644 --- a/reference/import.po +++ b/reference/import.po @@ -451,13 +451,13 @@ msgid "" msgstr "" "Python にはデフォルトのファインダーとインポーターがいくつかあります。 1 つ目" "のものは組み込みモジュールの見つけ方を知っていて、 2 つ目のものは凍結されたモ" -"ジュール (訳注: freeze ツールで処理されたモジュールのこと。 :doc:`プログラミ" -"ング FAQ <../faq/programming>` の「どうしたら Python スクリプトからスタンドア" -"ロンバイナリを作れますか?」の項目を参照) の見つけ方を知っています。 3 つ目の" -"ものは :term:`インポートパス ` からモジュールを探します。 :term:" -"`インポートパス ` はファイルシステムのパスや zip ファイルの位置" -"を示すリストです。このリストは、 URL で特定できるもののような、位置を示すこと" -"のできる任意のリソースの検索にまで拡張することもできます。" +"ジュール (訳注: freeze ツールで処理されたモジュールのこと。プログラミング " +"FAQ の「どうしたら Python スクリプトからスタンドアロンバイナリを作れます" +"か?」の項目を参照) の見つけ方を知っています。 3 つ目のものは :term:`インポー" +"トパス ` からモジュールを探します。 :term:`インポートパス " +"` はファイルシステムのパスや zip ファイルの位置を示すリストで" +"す。このリストは、 URL で特定できるもののような、位置を示すことのできる任意の" +"リソースの検索にまで拡張することもできます。" #: ../../reference/import.rst:244 msgid "" @@ -808,7 +808,7 @@ msgid "" msgstr "" ":meth:`~importlib.abc.Loader.exec_module` の呼び出し中に :exc:`ImportError` " "以外の例外が送出され、伝播されてきたとしても、モジュールをロードできない場合" -"は :exc:`ImportError` を送出すべきです。" +"は ``ImportError`` を送出すべきです。" #: ../../reference/import.rst:441 msgid "" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index db352fa41..ab900391f 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -565,9 +565,9 @@ msgid "" "happens. It is useful as a placeholder when a statement is required " "syntactically, but no code needs to be executed, for example::" msgstr "" -":keyword:`pass` はヌル操作 (null operation) です --- :keyword:`pass` が実行さ" -"れても、何も起きません。 :keyword:`pass` は、構文法的には文が必要だが、コード" -"としては何も実行したくない場合のプレースホルダとして有用です。例えば::" +":keyword:`pass` はヌル操作 (null operation) です --- ``pass`` が実行されて" +"も、何も起きません。 ``pass`` は、構文法的には文が必要だが、コードとしては何" +"も実行したくない場合のプレースホルダとして有用です。例えば::" #: ../../reference/simple_stmts.rst:434 msgid "" @@ -902,8 +902,8 @@ msgid "" "It terminates the nearest enclosing loop, skipping the optional :keyword:`!" "else` clause if the loop has one." msgstr "" -":keyword:`break` 文は、文を囲う最も内側のループを終了させ、ループにオプション" -"の :keyword:`!else` 節がある場合にはそれをスキップします。" +"``break`` 文は、文を囲う最も内側のループを終了させ、ループにオプションの :" +"keyword:`!else` 節がある場合にはそれをスキップします。" #: ../../reference/simple_stmts.rst:700 msgid "" @@ -936,8 +936,8 @@ msgid "" msgstr "" ":keyword:`continue` 文は :keyword:`for` ループや :keyword:`while` ループ内の" "ネストで構文法的にのみ現れますが、ループ内の関数定義やクラス定義の中には現れ" -"ません。 :keyword:`continue` 文は、文を囲う最も内側のループの次の周期に処理を" -"継続します。" +"ません。 ``continue`` 文は、文を囲う最も内側のループの次の周期に処理を継続し" +"ます。" #: ../../reference/simple_stmts.rst:729 msgid "" @@ -1399,8 +1399,8 @@ msgid "" "imported in the usual way at the time the future statement is executed." msgstr "" "future 文の実行時における直接的な意味付けは、 import 文と同じです。標準モ" -"ジュール :mod:`__future__` があり、これについては後で述べます。 :mod:" -"`__future__` は、 future 文が実行される際に通常の方法で import されます。" +"ジュール :mod:`__future__` があり、これについては後で述べます。 " +"``__future__`` は、 future 文が実行される際に通常の方法で import されます。" #: ../../reference/simple_stmts.rst:1028 msgid "" diff --git a/reference/toplevel_components.po b/reference/toplevel_components.po index e2f9dcc0d..b1fe321b3 100644 --- a/reference/toplevel_components.po +++ b/reference/toplevel_components.po @@ -59,8 +59,8 @@ msgstr "" "み変数と標準モジュールが利用可能で、かつ :mod:`sys` (様々なシステムサービ" "ス)、 :mod:`builtins` (組み込み関数、例外、および ``None``)、 :mod:" "`__main__` の 3 つを除く全てのモジュールが初期化されていない状態で動作しま" -"す。 :mod:`__main__` は、完全なプログラムを実行する際に、ローカルおよびグロー" -"バルな名前空間を提供するために用いられます。" +"す。 ``__main__`` は、完全なプログラムを実行する際に、ローカルおよびグローバ" +"ルな名前空間を提供するために用いられます。" #: ../../reference/toplevel_components.rst:36 msgid "" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 41e737a8e..9b58716ec 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -115,11 +115,11 @@ msgid "" "pun intended):" msgstr "" "Python の :keyword:`for` 文は、読者が C 言語や Pascal 言語で使いなれているか" -"もしれない :keyword:`for` 文とは少し違います。 (Pascal のように) 常に算術型の" -"数列にわたる反復を行ったり、 (C のように) 繰返しステップと停止条件を両方とも" -"ユーザが定義できるようにするのとは違い、Python の :keyword:`!for` 文は、任意" -"のシーケンス型 (リストまたは文字列) にわたって反復を行います。反復の順番は" -"シーケンス中に要素が現れる順番です。例えば:" +"もしれない ``for`` 文とは少し違います。 (Pascal のように) 常に算術型の数列に" +"わたる反復を行ったり、 (C のように) 繰返しステップと停止条件を両方ともユーザ" +"が定義できるようにするのとは違い、Python の :keyword:`!for` 文は、任意のシー" +"ケンス型 (リストまたは文字列) にわたって反復を行います。反復の順番はシーケン" +"ス中に要素が現れる順番です。例えば:" #: ../../tutorial/controlflow.rst:63 msgid "" @@ -532,8 +532,8 @@ msgid "" "The :keyword:`pass` statement does nothing. It can be used when a statement " "is required syntactically but the program requires no action. For example::" msgstr "" -":keyword:`pass` 文は何もしません。 :keyword:`pass` は、文を書くことが構文上要" -"求されているが、プログラム上何の動作もする必要がない時に使われます::" +":keyword:`pass` 文は何もしません。 ``pass`` は、文を書くことが構文上要求され" +"ているが、プログラム上何の動作もする必要がない時に使われます::" #: ../../tutorial/controlflow.rst:263 msgid "" @@ -1037,10 +1037,9 @@ msgid "" "parameters. The statements that form the body of the function start at the " "next line, and must be indented." msgstr "" -":keyword:`def` は関数の *定義 (definition)* を導くキーワードです。 :keyword:" -"`def` の後には、関数名と仮引数を丸括弧で囲んだリストを続けなければなりませ" -"ん。関数の実体を構成する実行文は次の行から始め、インデントされていなければな" -"りません。" +":keyword:`def` は関数の *定義 (definition)* を導くキーワードです。 ``def`` の" +"後には、関数名と仮引数を丸括弧で囲んだリストを続けなければなりません。関数の" +"実体を構成する実行文は次の行から始め、インデントされていなければなりません。" #: ../../tutorial/controlflow.rst:495 msgid "" @@ -1226,9 +1225,9 @@ msgstr "" "る型のメソッドで同じ名前のメソッドを持つことができ、あいまいさを生じることは" "ありません。 (*クラス (class)* を使うことで、自前のオブジェクト型とメソッドを" "定義することもできます。 :ref:`tut-classes` 参照) 例で示されているメソッド :" -"meth:`append` は、リストオブジェクトで定義されています; このメソッドはリスト" -"の末尾に新たな要素を追加します。この例での :meth:`~list.append` は ``result " -"= result + [a]`` と等価ですが、より効率的です。" +"meth:`~list.append` は、リストオブジェクトで定義されています; このメソッドは" +"リストの末尾に新たな要素を追加します。この例での ``append()`` は ``result = " +"result + [a]`` と等価ですが、より効率的です。" #: ../../tutorial/controlflow.rst:579 msgid "More on Defining Functions" diff --git a/tutorial/errors.po b/tutorial/errors.po index 02d32e1cf..993d3b684 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -490,10 +490,10 @@ msgid "" "exception. For example::" msgstr "" ":keyword:`try` ... :keyword:`except` 文には、オプションで *else 節 (else " -"clause)* を設けることができます。 :keyword:`else` 節を設ける場合、全ての :" -"keyword:`except` 節よりも後ろに置かなければなりません。 :keyword:`else` 節は " -"*try 節* で全く例外が送出されなかったときに実行されるコードを書くのに役立ちま" -"す。例えば次のようにします::" +"clause)* を設けることができます。 ``else`` 節を設ける場合、全ての ``except`` " +"節よりも後ろに置かなければなりません。 ``else`` 節は *try 節* で全く例外が送" +"出されなかったときに実行されるコードを書くのに役立ちます。例えば次のようにし" +"ます::" #: ../../tutorial/errors.rst:222 msgid "" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index ff95551d7..6ee8399e7 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -36,13 +36,11 @@ msgid "" "values, the only real difference being that the first is written in base 10 " "fractional notation, and the second in base 2." msgstr "" -"浮動小数点数はコンピューターのハードウェア上は2進数(binary)の分数で表されま" -"す。\n" -"たとえば、**10進数** の分数では ``0.625`` は 6/10 + 2/100 + 5/1000 という値を" -"持ち、**2進数** の分数では ``0.101`` は 1/2 + 0/4 + 1/8 という値を持ちま" -"す。\n" -"この2つの分数はまったく同じ値を持ち、唯一異なる点は1つ目が10進数の分数で書か" -"れており、2つ目は2進数の分数で書かれているということです。" +"浮動小数点数は、コンピューターのハードウェア上では 2 進小数で表されます。\n" +"例えば、 **10 進小数** の ``0.625`` は 6/10 + 2/100 + 5/1000 という値を持ち、" +"同様に **2 進小数** の ``0.101`` は 1/2 + 0/4 + 1/8 という値を持ちます。\n" +"この二つの小数は同じ値を表しています。違いは、前者が 10 進法、後者が 2 進法の" +"小数表記で書かれていることだけです。" #: ../../tutorial/floatingpoint.rst:19 msgid "" @@ -51,17 +49,17 @@ msgid "" "point numbers you enter are only approximated by the binary floating-point " "numbers actually stored in the machine." msgstr "" -"残念なことに、ほとんどの小数は 2 進法の分数として正確に表わすことができませ" -"ん。その結果、一般に、入力した 10 進の浮動小数点数は、 2 進法の浮動小数点数で" -"近似された後、実際にマシンに記憶されます。" +"残念ながら、ほとんどの 10 進小数は 2 進小数として正確に表せません。そのため、" +"入力した 10 進の浮動小数点数に対して、実際にコンピューターに格納される 2 進の" +"浮動小数点数は、一般に近似値にすぎません。" #: ../../tutorial/floatingpoint.rst:24 msgid "" "The problem is easier to understand at first in base 10. Consider the " "fraction 1/3. You can approximate that as a base 10 fraction::" msgstr "" -"最初は基数 10 を使うと問題を簡単に理解できます。分数 1/3 を考えてみましょう。" -"分数 1/3 は、基数 10 の分数として、以下のように近似することができます::" +"まず 10 進法で考えると、この問題を理解しやすくなります。分数 1/3 を考えてみま" +"しょう。これは 10 進小数で次のように近似できます::" #: ../../tutorial/floatingpoint.rst:27 msgid "0.3" @@ -85,8 +83,8 @@ msgid "" "result will never be exactly 1/3, but will be an increasingly better " "approximation of 1/3." msgstr "" -"となり、以後同様です。何個桁数を増やして書こうが、結果は決して厳密な 1/3 には" -"なりません。しかし、少しづつ正確な近似にはなっていくでしょう。" +"というように続きます。何桁まで書いても、結果が正確に 1/3 になることはありませ" +"んが、桁数を増やすほど 1/3 に近い近似値になります。" #: ../../tutorial/floatingpoint.rst:41 msgid "" @@ -94,9 +92,8 @@ msgid "" "decimal value 0.1 cannot be represented exactly as a base 2 fraction. In " "base 2, 1/10 is the infinitely repeating fraction ::" msgstr "" -"同様に、基数を 2 とした表現で何桁使おうとも、10 進数の 0.1 は基数を 2 とした" -"小数で正確に表現することはできません。基数 2 では、1/10 は循環小数 " -"(repeating fraction) となります ::" +"同様に、2 進法で何桁使っても、10 進数の 0.1 を 2 進小数として正確に表すことは" +"できません。2 進法では、1/10 は次のように無限に繰り返す循環小数になります::" #: ../../tutorial/floatingpoint.rst:45 msgid "0.0001100110011001100110011001100110011001100110011..." @@ -111,11 +108,11 @@ msgid "" "fraction is ``3602879701896397 / 2 ** 55`` which is close to but not exactly " "equal to the true value of 1/10." msgstr "" -"どこか有限の桁で止めると、近似値を得ることになります。近年の殆どのコンピュー" -"タでは float 型は、最上位ビットから数えて最初の 53 ビットを分子、2 の冪乗を分" -"母とした、二進小数で近似されます。1/10 の場合は、二進小数は " -"``3602879701896397 / 2 ** 55`` となります。これは、1/10 に近いですが、厳密に" -"同じ値ではありません。" +"有限のビット数で打ち切ると、得られるのは近似値です。現在のほとんどのコン" +"ピューターでは、浮動小数点数は、最上位ビットから数えて最初の 53 ビットを分子" +"に使い、2 の冪乗を分母とする分数で近似されます。1/10 の場合、この分数は " +"``3602879701896397 / 2 ** 55`` です。これは 1/10 に近い値ですが、正確に等しい" +"わけではありません。" #: ../../tutorial/floatingpoint.rst:54 msgid "" @@ -125,11 +122,11 @@ msgid "" "if Python were to print the true decimal value of the binary approximation " "stored for 0.1, it would have to display::" msgstr "" -"値が表示される方法のために、ほとんどのユーザは、近似に気づきません。Python は" -"マシンに格納されている二進近似値の10進小数での近似値を表示するので、格納され" -"ている値が元の10進小数の近似値でしか無いことを忘れがちです。ほとんどのマシン" -"で、もし Python が2進数で近似された 0.1 の近似値をそのまま10進数で表示してい" -"たら、その結果は次のようになったでしょう::" +"値の表示方式によって、ほとんどのユーザーはこの近似に気づきません。Python が表" +"示するのは、コンピューターに格納された 2 進の近似値を正確に 10 進数で表した値" +"ではなく、それをさらに 10 進数で近似した値です。ほとんどのコンピューターで、" +"0.1 に対して格納された 2 進の近似値を Python が正確に 10 進数で表示するとすれ" +"ば、次のように表示する必要があります::" #: ../../tutorial/floatingpoint.rst:60 msgid "" @@ -160,8 +157,9 @@ msgid "" "Just remember, even though the printed result looks like the exact value of " "1/10, the actual stored value is the nearest representable binary fraction." msgstr "" -"表示された結果が正確に 1/10 であるように見えたとしても、実際に格納されている" -"値は最も近く表現できる二進小数であるということだけは覚えておいてください。" +"表示された結果が正確に 1/10 であるように見えても、実際に格納されている値は、" +"表現可能な 2 進小数のうち 1/10 に最も近い値だということを覚えておいてくださ" +"い。" #: ../../tutorial/floatingpoint.rst:74 msgid "" @@ -173,12 +171,12 @@ msgid "" "values share the same approximation, any one of them could be displayed " "while still preserving the invariant ``eval(repr(x)) == x``." msgstr "" -"幾つかの異なる10進数の値が、同じ2進有理数の近似値を共有しています。例えば、" -"``0.1`` と ``0.10000000000000001`` と " +"興味深いことに、異なる多くの 10 進数が、最も近い近似値として同じ 2 進小数に対" +"応します。例えば、``0.1`` と ``0.10000000000000001`` と " "``0.1000000000000000055511151231257827021181583404541015625`` はどれも " -"``3602879701896397 / 2 ** 55`` に近似されます。同じ近似値を共有しているので、" -"どの10進数の値も ``eval(repr(x)) == x`` という条件を満たしたまま同じように表" -"示されます。" +"``3602879701896397 / 2 ** 55`` で近似されます。これらの 10 進数は同じ近似値に" +"対応するため、どれを選んで表示しても、 ``eval(repr(x)) == x`` という条件を保" +"てます。" #: ../../tutorial/floatingpoint.rst:82 msgid "" @@ -187,10 +185,10 @@ msgid "" "Starting with Python 3.1, Python (on most systems) is now able to choose the " "shortest of these and simply display ``0.1``." msgstr "" -"昔の Python は、プロンプトと :func:`repr` ビルトイン関数は 17 桁の有効数字を" -"持つ ``0.10000000000000001`` のような10進数の値を選んで表示していました。 " -"Python 3.1 からは、ほとんどの場面で ``0.1`` のような最も短い桁数の10進数の値" -"を選ぶようになりました。" +"以前は、Python のプロンプトと組み込み関数 :func:`repr` は、有効数字 17 桁の " +"``0.10000000000000001`` を選んで表示していました。Python 3.1 以降は、ほとんど" +"のシステムで、これらのうち最も短い表現を選び、単に ``0.1`` と表示できるように" +"なりました。" #: ../../tutorial/floatingpoint.rst:87 msgid "" @@ -225,6 +223,14 @@ msgid "" ">>> repr(math.pi)\n" "'3.141592653589793'" msgstr "" +">>> format(math.pi, '.12g') # 有効数字 12 桁で表示\n" +"'3.14159265359'\n" +"\n" +">>> format(math.pi, '.2f') # 小数点以下 2 桁で表示\n" +"'3.14'\n" +"\n" +">>> repr(math.pi)\n" +"'3.141592653589793'" #: ../../tutorial/floatingpoint.rst:107 msgid "" @@ -239,8 +245,8 @@ msgid "" "One illusion may beget another. For example, since 0.1 is not exactly 1/10, " "summing three values of 0.1 may not yield exactly 0.3, either:" msgstr "" -"もう一つの錯覚を紹介します。例えば、0.1 が正確には 1/10 ではないために、それ" -"を3回足した値もまた正確には 0.3 ではありません:" +"一つの錯覚が別の錯覚を生むこともあります。例えば、0.1 は正確には 1/10 ではな" +"いため、0.1 を三つ足した結果も正確に 0.3 になるとは限りません:" #: ../../tutorial/floatingpoint.rst:113 msgid "" @@ -273,8 +279,8 @@ msgid "" "Though the numbers cannot be made closer to their intended exact values, " "the :func:`math.isclose` function can be useful for comparing inexact values:" msgstr "" -"数値を意図した正確な値に近づけることはできませんが、 :func:`math.isclose` 関" -"数は不正確な値を比べるのに便利です: " +"これらの数値を意図した正確な値にさらに近づけることはできませんが、誤差を含む" +"値を比較するには :func:`math.isclose` 関数が役立ちます:" #: ../../tutorial/floatingpoint.rst:130 msgid "" @@ -309,13 +315,13 @@ msgid "" "Point `_ for a more complete " "account of other common surprises." msgstr "" -"このように2進数の浮動小数点の演算には多くの驚きがあります。「0.1」の問題につ" -"いて詳しい説明は、「表現エラー」セクションで行います。2進数の浮動小数点の仕組" +"2 進浮動小数点演算には、このような意外な挙動が数多くあります。「0.1」の問題に" +"ついて詳しい説明は、「表現誤差」セクションで行います。2進数の浮動小数点の仕組" "みと、実際によく遭遇する問題各種についての分かりやすい概要は、 `Examples of " "Floating Point Problems `_ を参照してください。その他よくある驚きの より詳細" -"な説明は `The Perils of Floating Point `_ も参照してください。" +"floating-point-problems/>`_ を参照してください。その他のよく見られる意外な挙" +"動について、より詳しくは `The Perils of Floating Point `_ も参照してください。" #: ../../tutorial/floatingpoint.rst:152 msgid "" @@ -327,12 +333,12 @@ msgid "" "decimal arithmetic and that every float operation can suffer a new rounding " "error." msgstr "" -"究極的にいうと、\"容易な答えはありません\"。ですが、浮動小数点数のことを過度" -"に警戒しないでください! Python の float 型操作におけるエラーは浮動小数点処理" -"ハードウェアから受けついたものであり、ほとんどのマシン上では一つの演算あたり" -"高々 2\\*\\*53 分の 1 です。この誤差はほとんどの作業で充分以上のものですが、" -"浮動小数点演算は 10 進の演算ではなく、浮動小数点の演算を新たに行うと、新たな" -"丸め誤差の影響を受けることを心にとどめておいてください。" +"その記事の終わり近くにもあるように、「簡単な答えはありません」。とはいえ、浮" +"動小数点数を過度に警戒しないでください。Python の浮動小数点演算の誤差は浮動小" +"数点演算を行うハードウェアに由来し、ほとんどのコンピューターでは演算ごとに" +"高々 2\\*\\*53 分の 1 程度です。これはほとんどの用途で十分な精度です。ただ" +"し、10 進の演算ではないこと、そして浮動小数点演算のたびに新たな丸め誤差が生じ" +"る可能性があることを覚えておく必要があります。" #: ../../tutorial/floatingpoint.rst:159 msgid "" @@ -342,11 +348,10 @@ msgid "" "expect. :func:`str` usually suffices, and for finer control see the :meth:" "`str.format` method's format specifiers in :ref:`formatstrings`." msgstr "" -"異常なケースが存在する一方で、普段の浮動小数点演算の利用では、単に最終的な結" -"果の値を必要な 10 進の桁数に丸めて表示するのなら、最終的には期待通りの結果を" -"得ることになるでしょう。たいては :func:`str` で十分ですが、きめ細かな制御をし" -"たければ、 :ref:`formatstrings` にある :meth:`str.format` メソッドのフォー" -"マット仕様を参照してください。" +"極端なケースはあるものの、普段の浮動小数点演算では最終結果の表示を必要な 10 " +"進の桁数に丸めるだけで、たいていは期待する結果が得られます。通常は :func:" +"`str` で十分ですが、より細かく制御するには、 :ref:`formatstrings` にある :" +"meth:`str.format` メソッドの書式指定子を参照してください。" #: ../../tutorial/floatingpoint.rst:165 msgid "" @@ -374,9 +379,9 @@ msgid "" "statistical operations supplied by the SciPy project. See ." msgstr "" -"あなたが浮動小数点演算のヘビーユーザーなら、SciPy プロジェクトが提供している " -"NumPy パッケージやその他の数学用パッケージを調べてみるべきです。 を参照してください。" +"浮動小数点演算を頻繁に使う場合は、NumPy パッケージや、SciPy プロジェクトが提" +"供するその他の数学・統計演算用の多くのパッケージを調べてみてください。 " +" を参照してください。" #: ../../tutorial/floatingpoint.rst:177 msgid "" @@ -384,9 +389,9 @@ msgid "" "*do* want to know the exact value of a float. The :meth:`float." "as_integer_ratio` method expresses the value of a float as a fraction:" msgstr "" -"Python は *本当に* float の正確な値が必要なレアケースに対応するためのツールを" -"提供しています。 :meth:`float.as_integer_ratio` メソッドは float の値を有理数" -"として表現します:" +"浮動小数点数の正確な値を *本当に* 知りたいというまれな場合に役立つツールも、" +"Python は提供しています。 :meth:`float.as_integer_ratio` メソッドは、浮動小数" +"点数の値を分数として表します:" #: ../../tutorial/floatingpoint.rst:182 msgid "" @@ -463,10 +468,9 @@ msgid "" "difference in overall accuracy so that the errors do not accumulate to the " "point where they affect the final total:" msgstr "" -"別の便利なツールとして、合計処理における精度のロスを緩和してくれる :func:" -"`sum` 関数があります。これは累計加算中の丸めに拡張精度を使います。これによ" -"り、誤差が最終的な合計値に影響を与えるまで蓄積されなくなり、結果が改善されま" -"す:" +"もう一つ便利なのが、合計を求める際の精度の低下を抑える :func:`sum` 関数です。" +"累計に値を加えていく途中の丸め処理に拡張精度を使います。これにより、誤差が蓄" +"積して最終的な合計値に影響するのを抑え、結果の精度を改善できる場合があります:" #: ../../tutorial/floatingpoint.rst:222 msgid "" @@ -488,6 +492,10 @@ msgid "" "uncommon cases where large magnitude inputs mostly cancel each other out " "leaving a final sum near zero:" msgstr "" +":func:`math.fsum` はさらに進んで、累計に値を加える際に「失われた桁」を全て追" +"跡し、結果を得るまでの丸めを一度だけに抑えます。これは :func:`sum` より低速で" +"すが、絶対値の大きい入力値が互いにほぼ打ち消し合い、最終的な合計がゼロに近く" +"なるようなまれな場合には、より正確な結果が得られます:" #: ../../tutorial/floatingpoint.rst:235 msgid "" @@ -509,10 +517,24 @@ msgid "" "digits!\n" "-0.0051575902860057365" msgstr "" +">>> arr = [-0.10430216751806065, -266310978.67179024, 143401161448607.16,\n" +"... -143401161400469.7, 266262841.31058735, -0.003244936839808227]\n" +">>> float(sum(map(Fraction, arr))) # 正確に合計し、一度だけ丸める\n" +"8.042173697819788e-13\n" +">>> math.fsum(arr) # 一度だけ丸める\n" +"8.042173697819788e-13\n" +">>> sum(arr) # 拡張精度で複数回丸める\n" +"8.042178034628478e-13\n" +">>> total = 0.0\n" +">>> for x in arr:\n" +"... total += x # 標準精度で複数回丸める\n" +"...\n" +">>> total # 単純な加算では正しい桁が一つもない!\n" +"-0.0051575902860057365" #: ../../tutorial/floatingpoint.rst:256 msgid "Representation Error" -msgstr "表現エラー" +msgstr "表現誤差" #: ../../tutorial/floatingpoint.rst:258 msgid "" @@ -532,10 +554,10 @@ msgid "" "Fortran, and many others) often won't display the exact decimal number you " "expect." msgstr "" -"表現エラー(:dfn:`Representation error`)は、いくつかの (実際にはほとんどの) " -"10 進の小数が 2 進法 (基数 2)の分数として表現できないという事実に関係していま" -"す。これは Python (あるいは Perl, C, C++, Java, Fortran. およびその他多く) が" -"期待通りの正確な 10 進数を表示できない主要な理由です。" +"表現誤差 (:dfn:`Representation error`) とは、一部の (実際にはほとんどの) 10 " +"進小数を 2 進小数として正確に表せないことを指します。これが、Python (あるい" +"は Perl、C、C++、Java、Fortran など多くの言語) で、期待した正確な 10 進数が表" +"示されないことがよくある主な理由です。" #: ../../tutorial/floatingpoint.rst:267 msgid "" @@ -547,13 +569,12 @@ msgid "" "fraction it can of the form *J*/2**\\ *N* where *J* is an integer containing " "exactly 53 bits. Rewriting ::" msgstr "" -"なぜそうなるのでしょう? 1/10 は2進法の小数で厳密に表現できません。少なくと" -"も2000年以降、ほぼすべてのマシンは IEEE 754 2進数の浮動小数点演算を用いてお" -"り、ほぼすべてのプラットフォームでは Python の浮動小数点を IEEE 754 binary64 " -"\"倍精度 (double precision)\" 値に対応付けます。 IEEE 754 binary64 値は 53 " -"ビットの精度を持つため、計算機に入力を行おうとすると、可能な限り 0.1 を最も近" -"い値の分数に変換し、*J*/2**\\ *N* の形式にしようと努力します。*J* はちょうど " -"53 ビットの精度の整数です。 ::" +"なぜそうなるのでしょうか。1/10 は 2 進小数として正確に表せません。少なくとも " +"2000 年以降、ほぼ全てのコンピューターは IEEE 754 の 2 進浮動小数点演算を使" +"い、ほぼ全てのプラットフォームで Python の浮動小数点数は IEEE 754 binary64 の" +"「倍精度」値に対応しています。IEEE 754 binary64 の値は 53 ビットの精度を持つ" +"ため、0.1 を入力すると、コンピューターは *J*/2**\\ *N* の形で表せる分数のうち" +"最も近い値に変換します。ここで *J* はちょうど 53 ビットの整数です。次の式::" #: ../../tutorial/floatingpoint.rst:276 msgid "1 / 10 ~= J / (2**N)" @@ -572,8 +593,8 @@ msgid "" "and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< " "2**53``), the best value for *N* is 56:" msgstr "" -"となります。 *J* は厳密に 53 ビットの精度を持っている (``>= 2**52`` だが ``< " -"2**53`` ) ことを思い出すと、 *N* として最適な値は 56 になります:" +"となります。 *J* がちょうど 53 ビットの整数である (``>= 2**52`` かつ ``< " +"2**53``) ことを思い出すと、 *N* として最適な値は 56 になります:" #: ../../tutorial/floatingpoint.rst:285 msgid "" @@ -588,8 +609,8 @@ msgid "" "That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. " "The best possible value for *J* is then that quotient rounded:" msgstr "" -"すなわち、56 は *J* をちょうど 53 ビットの精度のままに保つ *N* の唯一の値で" -"す。*J* の取りえる値はその商を丸めたものです:" +"つまり、 *J* がちょうど 53 ビットになる *N* の値は 56 だけです。このとき、 " +"*J* として最適な値は、その商を丸めたものになります:" #: ../../tutorial/floatingpoint.rst:293 msgid "" @@ -605,8 +626,7 @@ msgstr "" msgid "" "Since the remainder is more than half of 10, the best approximation is " "obtained by rounding up:" -msgstr "" -"剰余が 10 の半分以上なので、最良の近似は切り上げて丸めたものになります。:" +msgstr "余りが 10 の半分より大きいため、切り上げると最もよい近似が得られます:" #: ../../tutorial/floatingpoint.rst:302 msgid "" @@ -629,7 +649,7 @@ msgstr "7205759403792794 / 2 ** 56" #: ../../tutorial/floatingpoint.rst:314 msgid "" "Dividing both the numerator and denominator by two reduces the fraction to::" -msgstr "分子と分母を2で割って分数を小さくします::" +msgstr "分子と分母を 2 で割って約分すると、次のようになります::" #: ../../tutorial/floatingpoint.rst:316 msgid "3602879701896397 / 2 ** 55" @@ -651,9 +671,8 @@ msgid "" "So the computer never \"sees\" 1/10: what it sees is the exact fraction " "given above, the best IEEE 754 double approximation it can get:" msgstr "" -"つまり、計算機は 1/10 を \"理解する\" ことは決してありません。計算機が理解で" -"きるのは、上記のような厳密な分数であり、IEEE 754 の倍精度浮動小数点数で得られ" -"るもっともよい近似は以下になります::" +"つまり、コンピューターが扱っている値は 1/10 そのものではなく、上に示した分数" +"の正確な値です。これは、IEEE 754 の倍精度で表せる、1/10 の最もよい近似値です:" #: ../../tutorial/floatingpoint.rst:325 msgid "" @@ -685,10 +704,10 @@ msgid "" "displaying the full decimal value, many languages (including older versions " "of Python), round the result to 17 significant digits:" msgstr "" -"これは、計算機が記憶している正確な数値が、10 進数値 " -"0.1000000000000000055511151231257827021181583404541015625 にほぼ等しいという" -"ことです。多くの言語 (古いバージョンの Python を含む) では、完全な 10 進値を" -"表示するのではなく、結果を有効数字 17 桁に丸めます:" +"これは、コンピューターに格納されている数値が、10 進数の " +"0.1000000000000000055511151231257827021181583404541015625 と正確に等しいこと" +"を意味します。多くの言語 (古いバージョンの Python を含む) では、全ての桁を " +"10 進数で表示する代わりに、結果を有効数字 17 桁に丸めます:" #: ../../tutorial/floatingpoint.rst:343 msgid "" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 97757e89d..8d50028a4 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -560,7 +560,7 @@ msgid "" "`print` works: it always adds spaces between its arguments.)" msgstr "" "(各カラムの間のスペース一個分は :func:`print` の動作で追加されていることに注" -"意してください。 :func:`print` は常に引数間に空白を追加します。)" +"意してください。 ``print()`` は常に引数間に空白を追加します。)" #: ../../tutorial/inputoutput.rst:267 msgid "" diff --git a/tutorial/interactive.po b/tutorial/interactive.po index 427a20dc3..156228133 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -65,10 +65,10 @@ msgstr "" "す。 ``string.a`` のようなドットで区切られた式については、最後の ``'.'`` まで" "の式を評価し、結果として得られたオブジェクトの属性から補完候補を示します。 :" "meth:`~object.__getattr__` メソッドを持ったオブジェクトが式に含まれている場" -"合、 :meth:`~object.__getattr__` がアプリケーション定義のコードを実行するかも" -"しれないので注意してください。デフォルトの設定ではあなたのユーザーディレクト" -"リの :file:`.python_history` という名前のファイルに履歴を保存します。 履歴は" -"次回の対話的なインタプリタのセッションで再び利用することができます。" +"合、 ``__getattr__()`` がアプリケーション定義のコードを実行するかもしれないの" +"で注意してください。デフォルトの設定ではあなたのユーザーディレクトリの :file:" +"`.python_history` という名前のファイルに履歴を保存します。 履歴は次回の対話的" +"なインタプリタのセッションで再び利用することができます。" #: ../../tutorial/interactive.rst:36 msgid "Alternatives to the Interactive Interpreter" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 97d15ee74..59c4cd5ee 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -1239,8 +1239,8 @@ msgid "" msgstr "" ":func:`print` 関数は、与えられた引数の値を書き出します。これは (前に電卓の例" "でやったような) 単に出力したい式を書くのとは、複数の引数や浮動小数点量や文字" -"列に対する扱い方が違います。:func:`print` 関数では、文字列は引用符無しで出力" -"され、要素の間に空白が挿入されて、このように出力の書式が整えられます::" +"列に対する扱い方が違います。 ``print()`` 関数では、文字列は引用符無しで出力さ" +"れ、要素の間に空白が挿入されて、このように出力の書式が整えられます::" #: ../../tutorial/introduction.rst:550 msgid "" diff --git a/tutorial/modules.po b/tutorial/modules.po index b0eb462e4..d550baea9 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -673,7 +673,7 @@ msgid "" "defines. It returns a sorted list of strings::" msgstr "" "組込み関数 :func:`dir` は、あるモジュールがどんな名前を定義しているか調べるた" -"めに使われます。 :func:`dir` はソートされた文字列のリストを返します::" +"めに使われます。 ``dir()`` はソートされた文字列のリストを返します::" #: ../../tutorial/modules.rst:314 msgid "" diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index c21184203..5c5fe8848 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -110,8 +110,8 @@ msgid "" "direct way of formatting numbers with group separators::" msgstr "" ":mod:`locale` モジュールは、文化により異なるデータ表現形式のデータベースにア" -"クセスします。 :mod:`locale` の :func:`format` 関数の grouping 属性を使えば、" -"数値を適切な桁区切り文字によりグループ化された形式に変換できます::" +"クセスします。 ``locale`` の ``format_string()`` 関数の grouping 属性を使え" +"ば、数値を適切な桁区切り文字によりグループ化された形式に変換できます::" #: ../../tutorial/stdlib2.rst:57 msgid "" @@ -197,11 +197,10 @@ msgid "" "placeholders such as the current date, image sequence number, or file " "format::" msgstr "" -"区切り文字はデフォルトは ``$`` ですが、:class:`~string.Template` のサブクラス" -"を派生すると変更することができます。例えば、画像ブラウザ用に一括で名前を変更" -"するユーティリティを作っていたとして、現在の日付や画像のシーケンス番号、ファ" -"イル形式といったプレースホルダにパーセント記号を使うことにしたら、次のように" -"なります::" +"区切り文字はデフォルトは ``$`` ですが、 ``Template`` のサブクラスを派生すると" +"変更することができます。例えば、画像ブラウザ用に一括で名前を変更するユーティ" +"リティを作っていたとして、現在の日付や画像のシーケンス番号、ファイル形式と" +"いったプレースホルダにパーセント記号を使うことにしたら、次のようになります::" #: ../../tutorial/stdlib2.rst:107 msgid "" @@ -336,9 +335,9 @@ msgid "" "events, condition variables, and semaphores." msgstr "" "マルチスレッドアプリケーションを作る上で最も難しい問題は、データやリソースを" -"共有するスレッド間の調整 (coordination)です。この問題を解決するため、:mod:" -"`threading` モジュールではロックやイベント、状態変数、セマフォといった数々の" -"同期プリミティブを提供しています。" +"共有するスレッド間の調整 (coordination)です。この問題を解決するため、 " +"``threading`` モジュールではロックやイベント、状態変数、セマフォといった数々" +"の同期プリミティブを提供しています。" #: ../../tutorial/stdlib2.rst:202 msgid "" @@ -401,13 +400,12 @@ msgid "" "`~logging.DEBUG`, :const:`~logging.INFO`, :const:`~logging.WARNING`, :const:" "`~logging.ERROR`, and :const:`~logging.CRITICAL`." msgstr "" -"デフォルトでは、:meth:`~logging.Logger.info` と :meth:`~logging.Logger." -"debug` による出力は抑制され、出力は標準エラーに送信されます。選択可能な送信先" -"には、email、データグラム、ソケット、HTTP サーバへの送信などがあります。新た" -"にフィルタを作成すると、:const:`~logging.DEBUG`、:const:`~logging.INFO`、:" -"const:`~logging.WARNING`、:const:`~logging.ERROR`、:const:`~logging." -"CRITICAL` といったメッセージのプライオリティによって異なる送信先を選択するこ" -"とができます。" +"デフォルトでは、 ``info()`` と ``debug()`` による出力は抑制され、出力は標準エ" +"ラーに送信されます。選択可能な送信先には、email、データグラム、ソケット、" +"HTTP サーバへの送信などがあります。新たにフィルタを作成すると、:const:" +"`~logging.DEBUG`、:const:`~logging.INFO`、:const:`~logging.WARNING`、:const:" +"`~logging.ERROR`、:const:`~logging.CRITICAL` といったメッセージのプライオリ" +"ティによって異なる送信先を選択することができます。" #: ../../tutorial/stdlib2.rst:240 msgid "" @@ -656,9 +654,9 @@ msgid "" "decimal quantities." msgstr "" "上の例で、:class:`~decimal.Decimal` を使った計算では、末尾桁のゼロが保存され" -"ており、有効数字2桁の被乗数から自動的に有効数字を 4 桁と判断しています。:" -"class:`~decimal.Decimal` は手計算と 同じ方法で計算を行い、2 進浮動小数が 10 " -"進小数成分を正確に表現できないことに よって起きる問題を回避しています。" +"ており、有効数字2桁の被乗数から自動的に有効数字を 4 桁と判断しています。 " +"``Decimal`` は手計算と 同じ方法で計算を行い、2 進浮動小数が 10 進小数成分を正" +"確に表現できないことに よって起きる問題を回避しています。" #: ../../tutorial/stdlib2.rst:385 msgid "" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 66c36ab7a..ec5d81331 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -349,11 +349,11 @@ msgid "" "installation by calling the ``sys.setdefaultencoding(encoding)`` function in " "a customized version of :file:`site.py`." msgstr "" -"Unicode 文字列は普通の文字列と全く似ていて、 :term:`immutable` なシーケンス型" -"です。添え字でアクセス出来、スライス出来ますが、インプレイスに変更することは" -"出来ません。Unicode 文字列は ``encode( [encoding] )`` メソッドを持っていて、" -"これは望みのエンコーディングでエンコードした 8 ビット文字列を返します。エン" -"コーディングは文字列で名前付けられていて、例えば ``'ascii'``, ``'utf-8'``, " +"Unicode 文字列は普通の文字列と全く似ていて、 immutable なシーケンス型です。添" +"え字でアクセス出来、スライス出来ますが、インプレイスに変更することは出来ませ" +"ん。Unicode 文字列は ``encode( [encoding] )`` メソッドを持っていて、これは望" +"みのエンコーディングでエンコードした 8 ビット文字列を返します。エンコーディン" +"グは文字列で名前付けられていて、例えば ``'ascii'``, ``'utf-8'``, " "``'iso-8859-1'`` のようなものです。コーデック API は、新しいエンコーディング" "を実装し、Python プログラム全体を通して利用可能となるよう登録するために定義さ" "れています。エンコーディングが指定されない場合はデフォルトのエンコーディング" @@ -641,7 +641,7 @@ msgstr "" "シーケンス群は同じ長さである必要はありません。それらは並列でイテレートされる " "*のではなく* 左から右の順で周ります。続くパラグラフでもっとわかりやすく説明し" "ます。生成されるリストの要素は一連の *expression* の値となります。最後の :" -"keyword:`if` 節はオプショナルです。これがあれば *expression* は *condition* " +"keyword:`!if` 節はオプショナルです。これがあれば *expression* は *condition* " "が真の場合にのみ評価・追加されます。" #: ../../whatsnew/2.0.rst:307 @@ -817,8 +817,8 @@ msgid "" "operate." msgstr "" "変わらない一つのこと、華やかなエイプリルフールのジョークではありませんが、そ" -"れは Python 文字列が :term:`immutable` だということです。ですので文字列メソッ" -"ドは新しい文字列を返し、それが操作する文字列を変更しません。" +"れは Python 文字列が immutable だということです。ですので文字列メソッドは新し" +"い文字列を返し、それが操作する文字列を変更しません。" #: ../../whatsnew/2.0.rst:415 msgid "" @@ -2058,9 +2058,9 @@ msgid "" "M. Kuchling.)" msgstr "" ":mod:`mmap`: Windows、Unix 両方でのメモリマップドファイルへのインターフェイス" -"です。ファイル内容をメモリに直接マッピング出来、それは :term:`mutable` な文字" -"列であるかのように振る舞い、これにより読み書き出来ます。それらは例えば :mod:" -"`re` モジュールのような普通は文字列を期待するような関数にさえも渡せます。" +"です。ファイル内容をメモリに直接マッピング出来、それは mutable な文字列である" +"かのように振る舞い、これにより読み書き出来ます。それらは例えば :mod:`re` モ" +"ジュールのような普通は文字列を期待するような関数にさえも渡せます。" "(Contributed by Sam Rushing, with some extensions by A.M. Kuchling.)" #: ../../whatsnew/2.0.rst:1110 diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index b298d0517..a78a68675 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -1002,20 +1002,19 @@ msgid "" "explanation of the interaction between :keyword:`!yield` and exceptions.)" msgstr "" "ジェネレータ関数を呼び出すと、単一の値の代わりにイテレータプロトコルに対応し" -"たオブジェクトを返します。上の例で :keyword:`!yield` を実行したとき、ジェネ" -"レータは :keyword:`!return` 文のようにして ``i`` の値を生成します。 " -"``yield`` と ``return`` 文の大きな違いは、 ``yield`` に到達した段階でジェネ" -"レータの実行状態が一時停止になって、ローカル変数が保存される点です。次回その" -"ジェネレータの ``.next()`` メソッドを呼ぶと、 :keyword:`!yield` の直後から関" -"数が実行を再開します。(複雑な理由により、 :keyword:`!yield` は :keyword:`!" -"try`...\\ :keyword:`finally` の :keyword:`!try` ブロック内に含めることは許さ" -"れていません; :pep:`255` に :keyword:`!yield` と例外の相互作用についての詳細" -"説明がありますので参照して下さい。) --- (---訳注: Python 2.5 の PEP 342 で :" -"keyword:`try`...\\ :keyword:`finally` 内に置けないという制約はなくなりまし" -"た。また、 :keyword:`try`...\\ :keyword:`finally` の :keyword:`try` 、とここ" -"であえて特定しているのは、同じく 2.5 の PEP 341 によって try/except/finally " -"の一体化されるまでは、 ``finally`` の ``try`` と ``except`` の ``try`` が別物" -"だったからです。---)" +"たオブジェクトを返します。上の例で :keyword:`yield` を実行したとき、ジェネ" +"レータは :keyword:`return` 文のようにして ``i`` の値を生成します。 ``yield`` " +"と ``return`` 文の大きな違いは、 ``yield`` に到達した段階でジェネレータの実行" +"状態が一時停止になって、ローカル変数が保存される点です。次回そのジェネレータ" +"の ``.next()`` メソッドを呼ぶと、 :keyword:`!yield` の直後から関数が実行を再" +"開します。(複雑な理由により、 :keyword:`!yield` は :keyword:`!try`...\\ :" +"keyword:`finally` の :keyword:`!try` ブロック内に含めることは許されていませ" +"ん; :pep:`255` に :keyword:`!yield` と例外の相互作用についての詳細説明があり" +"ますので参照して下さい。) --- (---訳注: Python 2.5 の PEP 342 で :keyword:" +"`try`...\\ ``finally`` 内に置けないという制約はなくなりました。また、 " +"``try``...\\ ``finally`` の ``try`` 、とここであえて特定しているのは、同じく " +"2.5 の PEP 341 によって try/except/finally の一体化されるまでは、 " +"``finally`` の ``try`` と ``except`` の ``try`` が別物だったからです。---)" #: ../../whatsnew/2.2.rst:584 msgid "Here's a sample usage of the :func:`!generate_ints` generator::" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 71b062366..a12b93c93 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -111,11 +111,10 @@ msgstr "" "えられ、2.6 では非推奨となり、3.0 では削除されています。ので、集合型について" "知りたければここよりも 2.4 のビルトインの方から読んだ方が良いです。---) --- " "新しいモジュール :mod:`!sets` には、集合データ型の実装が含まれています。 :" -"class:`Set` クラスは :term:`mutable` の集合のためのクラスで、メンバの追加と削" -"除が出来ます。 :class:`!ImmutableSet` は変更できない集合のためのクラスなの" -"で、:class:`!ImmutableSet` のインスタンスを辞書のキーとして利用出来ます。集合" -"型は辞書の上に構築されているので、集合内の要素はハッシュ可能でなければなりま" -"せん。" +"class:`Set` クラスは mutable の集合のためのクラスで、メンバの追加と削除が出来" +"ます。 :class:`!ImmutableSet` は変更できない集合のためのクラスなので、:class:" +"`!ImmutableSet` のインスタンスを辞書のキーとして利用出来ます。集合型は辞書の" +"上に構築されているので、集合内の要素はハッシュ可能でなければなりません。" #: ../../whatsnew/2.3.rst:50 msgid "Here's a simple example::" @@ -303,20 +302,19 @@ msgid "" "explanation of the interaction between :keyword:`!yield` and exceptions.)" msgstr "" "ジェネレータ関数を呼び出すと、単一の値の代わりにイテレータプロトコルに対応し" -"たオブジェクトを返します。上の例で :keyword:`!yield` を実行したとき、ジェネ" -"レータは :keyword:`!return` 文のようにして ``i`` の値を生成します。 " -"``yield`` と ``return`` 文の大きな違いは、 ``yield`` に到達した段階でジェネ" -"レータの実行状態が一時停止になって、ローカル変数が保存される点です。次回その" -"ジェネレータの ``.next()`` メソッドを呼ぶと、 :keyword:`!yield` の直後から関" -"数が実行を再開します。(複雑な理由により、 :keyword:`!yield` は :keyword:`!" -"try`...\\ :keyword:`finally` の :keyword:`!try` ブロック内に含めることは許さ" -"れていません; :pep:`255` に :keyword:`!yield` と例外の相互作用についての詳細" -"説明がありますので参照して下さい。) --- (---訳注: Python 2.5 の PEP 342 で :" -"keyword:`try`...\\ :keyword:`finally` 内に置けないという制約はなくなりまし" -"た。また、 :keyword:`try`...\\ :keyword:`finally` の :keyword:`try` 、とここ" -"であえて特定しているのは、同じく 2.5 の PEP 341 によって try/except/finally " -"の一体化されるまでは、 ``finally`` の ``try`` と ``except`` の ``try`` が別物" -"だったからです。---)" +"たオブジェクトを返します。上の例で :keyword:`yield` を実行したとき、ジェネ" +"レータは :keyword:`return` 文のようにして ``i`` の値を生成します。 ``yield`` " +"と ``return`` 文の大きな違いは、 ``yield`` に到達した段階でジェネレータの実行" +"状態が一時停止になって、ローカル変数が保存される点です。次回そのジェネレータ" +"の ``.next()`` メソッドを呼ぶと、 :keyword:`!yield` の直後から関数が実行を再" +"開します。(複雑な理由により、 :keyword:`!yield` は :keyword:`!try`...\\ " +"``finally`` の :keyword:`!try` ブロック内に含めることは許されていません; :" +"pep:`255` に :keyword:`!yield` と例外の相互作用についての詳細説明がありますの" +"で参照して下さい。) --- (---訳注: Python 2.5 の PEP 342 で :keyword:`try`..." +"\\ ``finally`` 内に置けないという制約はなくなりました。また、 ``try``...\\ " +"``finally`` の ``try`` 、とここであえて特定しているのは、同じく 2.5 の PEP " +"341 によって try/except/finally の一体化されるまでは、 ``finally`` の " +"``try`` と ``except`` の ``try`` が別物だったからです。---)" #: ../../whatsnew/2.3.rst:169 msgid "Here's a sample usage of the :func:`!generate_ints` generator::" @@ -562,9 +560,9 @@ msgid "" "path``. For example:" msgstr "" "新たなモジュール :mod:`zipimport` が、ZIP フォーマットの書庫からモジュールの" -"インポートをサポートします。 :mod:`zipimport` を明示的にインポートする必要は" -"ありません; ``sys.path`` に ZIP 形式書庫が追加されるとそれは自動的にインポー" -"トされます。例えば::" +"インポートをサポートします。 ``zipimport`` を明示的にインポートする必要はあり" +"ません; ``sys.path`` に ZIP 形式書庫が追加されるとそれは自動的にインポートさ" +"れます。例えば::" #: ../../whatsnew/2.3.rst:296 msgid "" @@ -655,11 +653,11 @@ msgstr "" "Python はいまや (ファイルシステムの制約の範囲内での) 任意の Unicode 文字列" "を :func:`open` 組み込み関数をはじめとするファイル名が期待される全ての関数で" "許容します。 :func:`os.listdir` に Unicode 文字列が渡されれば、Python は今で" -"は Unicode 文字列のリストを返します。新しい関数 :func:`os.getcwdu` は " +"は Unicode 文字列のリストを返します。新しい関数 :func:`!os.getcwdu` は " "Unicode 文字列でカレントディレクトリを返します(訳注: ちなみに Python 3 での " "Unicode 周りの大改造に伴いこの関数はなくなり、代わりに「あえてバイト列のほう" -"を返す」 が追加されています(:func:`!os.getcwdu` がもはや Unicode を返すの" -"で)。)。" +"を返す」 ``os.getcwdb()`` が追加されています(``os.getcwd()`` が Unicode を返" +"すので)。)。" #: ../../whatsnew/2.3.rst:350 msgid "" @@ -1585,12 +1583,11 @@ msgid "" "assignment to extended and regular slices. Assignment to a regular slice " "can be used to change the length of the sequence::" msgstr "" -"リストや配列のような :term:`mutable` なシーケンスに対して、拡張スライスを代入" -"や削除に使えますが、拡張スライスと普通のスライスではいくつかの違いがありま" -"す。普通のスライスで代入を行えば、シーケンスの長さを変更出来ます (---訳注: 念" -"のため。Python 3 の range は list を直接返す関数ではなくジェネレータなので、" -"以下例は ``a = list(range(3))`` などとしないと動作しません。続く例でも同じで" -"す。---)::" +"リストや配列のような mutable なシーケンスに対して、拡張スライスを代入や削除に" +"使えますが、拡張スライスと普通のスライスではいくつかの違いがあります。普通の" +"スライスで代入を行えば、シーケンスの長さを変更出来ます (---訳注: 念のため。" +"Python 3 の range は list を直接返す関数ではなくジェネレータなので、以下例は " +"``a = list(range(3))`` などとしないと動作しません。続く例でも同じです。---)::" #: ../../whatsnew/2.3.rst:893 msgid "" @@ -3043,8 +3040,8 @@ msgid "" "Once created, instances of the date/time classes are all immutable. There " "are a number of methods for producing formatted strings from objects::" msgstr "" -"構築後の日付時刻クラスのインスタンスは全て :term:`immutable` です。オブジェク" -"トから書式文字列を生成する数多くのメソッドがあります::" +"構築後の日付時刻クラスのインスタンスは全て immutable です。オブジェクトから書" +"式文字列を生成する数多くのメソッドがあります::" #: ../../whatsnew/2.3.rst:1701 msgid "" @@ -3086,15 +3083,14 @@ msgid "" "`~datetime.datetime`." msgstr "" "インスタンスは比較可能で、ハッシュ出来、文字列に変換出来ます (結果は :meth:" -"`~datetime.datetime.isoformat` メソッドのものと同じです)。 と :class:" -"`~datetime.datetime` はお互いに減算演算が可能で、 :class:`~datetime." -"timedelta` インスタンスを加算することも出来ます。最も大きな不足機能としては、" -"文字列を解析して :class:`~datetime.date` や :class:`~datetime.datetime` へ戻" -"すための標準ライブラリサポートはありません。(---訳注: 2 点。「比較可能」の意" -"味は 2.3 から 2.4 で意味が変わっています。2.4 で :class:`~datetime.date` と :" -"class:`~datetime.datetime` の比較は出来なくなりました。2.3 では出来ていまし" -"た。文字列からの :class:`~datetime.datetime` 構築は 2.5 で :meth:`~datetime." -"strptime` が追加されています。---)" +"`~datetime.datetime.isoformat` メソッドのものと同じです)。 :class:`~datetime." +"date` と :class:`~datetime.datetime` はお互いに減算演算が可能で、 :class:" +"`~datetime.timedelta` インスタンスを加算することも出来ます。最も大きな不足機" +"能としては、文字列を解析して :class:`~datetime.date` や :class:`~datetime." +"datetime` へ戻すための標準ライブラリサポートはありません。(---訳注: 2 点。" +"「比較可能」の意味は 2.3 から 2.4 で意味が変わっています。2.4 で ``date`` と " +"``datetime`` の比較は出来なくなりました。2.3 では出来ていました。文字列から" +"の ``datetime`` 構築は 2.5 で ``strptime()`` が追加されています。---)" #: ../../whatsnew/2.3.rst:1727 msgid "" @@ -3120,8 +3116,8 @@ msgstr "" "規に追加された :mod:`optparse` モジュール (元々 Optik と呼ばれていたもので" "す) は Unix の慣習に従ったもっと念入りなコマンドライン解析を行い、自動的に :" "option:`!--help` のための出力をし、異なったオプションに対して異なったアクショ" -"ンを実行出来ます。 (---訳注: 2.7 以降は :mod:`optparse` よりも新しい :mod:" -"`argparse` を使ってください。---)" +"ンを実行出来ます。 (---訳注: 2.7 以降は ``optparse`` よりも新しい " +"``argparse`` を使ってください。---)" #: ../../whatsnew/2.3.rst:1742 msgid "" diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 7e010abb8..71674bc01 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -128,8 +128,8 @@ msgid "" "is immutable and hashable, it may be used as a dictionary key or as a member " "of another set." msgstr "" -":func:`frozenset` 型は :func:`set` の :term:`immutable` 版です。 immutable か" -"つハッシュ可能なので、辞書のキーやほかの set のメンバとして使えるでしょう。" +":func:`frozenset` 型は :func:`set` の immutable 版です。 immutable かつハッ" +"シュ可能なので、辞書のキーやほかの set のメンバとして使えるでしょう。" #: ../../whatsnew/2.4.rst:75 msgid "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index eec3d3318..82457ea09 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -1518,11 +1518,11 @@ msgstr "" "`Exception` 派生にするのが肝要です。捕捉例外を特定しない ``except:`` は " "Python 3.0 から取り除かれるべきであることが提案されていますが、Guido van " "Rossum はこれをどうするかまだ決めていません。 (---訳注: 2.7 では raise は「新" -"スタイルクラスであれば」 :exc:`BaseException` 派生であることを要求されます" -"が、旧スタイルクラスであればなんでも許されてしまう点ではあまり変わっていませ" -"ん。これについての警告は :option:`!-3` などで受けることが出来ます。Python " -"3.0 でようやく全ての例外が :exc:`BaseException` 派生であることが強制されるよ" -"うになりました。 また、 ``except:`` は 3.4 でも残っています。---)" +"スタイルクラスであれば」 ``BaseException`` 派生であることを要求されますが、旧" +"スタイルクラスであればなんでも許されてしまう点ではあまり変わっていません。こ" +"れについての警告は :option:`!-3` などで受けることが出来ます。Python 3.0 でよ" +"うやく全ての例外が ``BaseException`` 派生であることが強制されるようになりまし" +"た。 また、 ``except:`` は 3.4 でも残っています。---)" #: ../../whatsnew/2.5.rst:856 msgid "" @@ -1905,11 +1905,11 @@ msgstr "" "``unichr(128)`` や ``chr(128)`` を探そうとすると :class:`UnicodeDecodeError` " "例外が起こっていたでしょう。2.5 での、 辞書を実装している :file:`dictobject." "c` のほかの変更により、これは揉み消すのではなく、引き続き例外を起こします(訳" -"注: 原文では this exception といっているので :class:`UnicodeDecodeError` が起" -"こるように読めるのですが、2.5 時点での振る舞いは確認出来ていませんが 2.7 で" -"は :class:`UnicodeWarning` とともに :exc:`KeyError` が発生する、のようになる" -"はずです。2.6 以降の What's New でのこれに関する言及はありませんが変更があっ" -"たのかもしれません)。" +"注: 原文では this exception といっているので ``UnicodeDecodeError`` が起こる" +"ように読めるのですが、2.5 時点での振る舞いは確認出来ていませんが 2.7 では " +"``UnicodeWarning`` とともに ``KeyError`` が発生する、のようになるはずです。" +"2.6 以降の What's New でのこれに関する言及はありませんが変更があったのかもし" +"れません)。" #: ../../whatsnew/2.5.rst:1088 msgid "" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index e39c0ac0a..595238eab 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -1662,9 +1662,9 @@ msgid "" "Instances of the :class:`bytes` type are immutable just as strings are. A " "new :class:`bytearray` type stores a mutable sequence of bytes::" msgstr "" -":class:`bytes` 型のインスタンスは単に文字列と同じで :term:`immutable` で" -"す。 :class:`bytearray` 型が、バイト列を :term:`mutable` シーケンスとして格納" -"するものとして新しく追加されました::" +":class:`bytes` 型のインスタンスは単に文字列と同じで immutable です。 :class:" +"`bytearray` 型が、バイト列を mutable シーケンスとして格納するものとして新しく" +"追加されました::" #: ../../whatsnew/2.6.rst:996 msgid "" diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 8aa8d0986..fe2fe2489 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -1267,7 +1267,7 @@ msgstr "" "組み込みの新しい文字列書式化操作で、文字列の ``%`` 演算子を置き換えるもので" "す。(しかしながら ``%`` 演算子はまだサポートされます; Python 3.1 で非推奨とな" "り、将来のいつかの時点で削除されます。) 完全な詳細は :pep:`3101` をお読み下さ" -"い。 (--- 訳注: `Python 2.6 で既にあった変更`_ での対応する記述に書いた訳注を" +"い。 (--- 訳注: 「Python 2.6 で既にあった変更」での対応する記述に書いた訳注を" "参照。---)" #: ../../whatsnew/3.0.rst:685 @@ -1292,8 +1292,8 @@ msgstr "" ":pep:`352`: 全ての例外は (直接的にまたは間接的に) :exc:`BaseException` を継承" "しなければなりません。\n" ":exc:`BaseException` は例外階層の根です。\n" -"これは勧告としては新しくありませんが、:exc:`BaseException` 継承の *要求* は新" -"しいです。\n" +"これは勧告としては新しくありませんが、 ``BaseException`` 継承の *要求* は新し" +"いです。\n" "(Python 2.6 は依然として昔のクラスを送出するのを許容しており、捕捉するものに" "ついての制限はありません。)\n" "結果として文字列例外は終に本当の意味で、完全になくなりました。" @@ -1649,9 +1649,9 @@ msgid "" "For porting existing Python 2.5 or 2.6 source code to Python 3.0, the best " "strategy is the following:" msgstr "" -"(---訳注: 今では独立したクックブック :ref:`pyporting-howto` があるのでそちら" -"をご覧下さい。---) 既存の Python 2.5 や 2.6 のソースコードを Python 3.0 に移" -"植する最良の策は以下の通りです:" +"(---訳注: 今では独立したクックブック How to port Python 2 Code to Python 3 が" +"あるのでそちらをご覧下さい。---) 既存の Python 2.5 や 2.6 のソースコードを " +"Python 3.0 に移植する最良の策は以下の通りです:" #: ../../whatsnew/3.0.rst:903 msgid "(Prerequisite:) Start with excellent test coverage." @@ -1705,8 +1705,8 @@ msgstr "" "生成します。2016 時点でも Python 2.7 はかなり元気 (予定では 2020 年までは公式" "にサポートされる) ですので両バージョン (ただし今だと 2.7 と 3.2 以降) で変更" "なしで動作するものを必要とすることは、残念ながらまだ多いでしょう (あなたが" -"作っているのがライブラリであるならば)。これについては :ref:`pyporting-howto` " -"に少し書かれています。 ---)" +"作っているのがライブラリであるならば)。これについては How to port Python 2 " +"Code to Python 3 に少し書かれています。 ---)" #: ../../whatsnew/3.0.rst:929 msgid "" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index b260646a0..edd63dfad 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -87,9 +87,9 @@ msgstr "" "定ファイルを読み込み、編集した後、元の順序で書きなおすことができます。:func:" "`collections.namedtuple` の *_asdict()* メソッドは、タプルの順序と同じ順序の" "順序付き辞書を返すようになりました。:mod:`json` モジュールのデコーダーが " -"OrderedDict をビルドするのをサポートするために、 :class:`~json.JSONDecoder` " -"クラスのコンストラクタに *object_pairs_hook* 引数が追加されました。 `PyYAML " -"`_ などの外部のライブラリでもサポートされています。" +"OrderedDict をビルドするのをサポートするために、 ``JSONDecoder`` クラスのコン" +"ストラクタに *object_pairs_hook* 引数が追加されました。 `PyYAML `_ などの外部のライブラリでもサポートされています。" #: ../../whatsnew/3.1.rst:79 msgid ":pep:`372` - Ordered Dictionaries" @@ -429,9 +429,9 @@ msgid "" "implementing a widget's behavior from the code implementing its appearance." msgstr "" "Tk のテーマ付きウィジェットへのアクセスを提供する、新しい :mod:`tkinter.ttk` " -"モジュールが追加されました。 :mod:`tkinter.ttk` の基本的なアイディアは、拡張" -"可能性のためにウィジェットの動作を実装するコードと見た目を記述するコードを分" -"離することです。" +"モジュールが追加されました。 ``tkinter.ttk`` の基本的なアイディアは、拡張可能" +"性のためにウィジェットの動作を実装するコードと見た目を記述するコードを分離す" +"ることです。" #: ../../whatsnew/3.1.rst:261 msgid "(Contributed by Guilherme Polo; :issue:`2983`.)" @@ -650,8 +650,8 @@ msgid "" msgstr "" ":mod:`unittest` に特定のテストメソッドやテストクラス全体をスキップする仕組み" "のサポートが追加されました。さらに、この機能はテスト結果を「意図的な失敗」と" -"することができ、テストが失敗しても :class:`TestResult` の失敗数にはカウントさ" -"れなくなります::" +"することができ、テストが失敗しても ``TestResult`` の失敗数にはカウントされな" +"くなります::" #: ../../whatsnew/3.1.rst:366 msgid "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 9c1504c1b..cea2abbe2 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -300,10 +300,10 @@ msgid "" "itself, instead of just where the problem is detected. In this way, instead " "of displaying (before Python 3.10):" msgstr "" -"インタープリタによって発生する:exc:`SyntaxError` 例外は、これまで問題が検出さ" -"れた箇所のみを強調表示していましたが、今後は構文エラーを構成する式全体の範囲" -"を強調表示するようになりました。このため、( Python 3.10 以前で)次のように表" -"示されていたものが、" +"インタープリタによって発生する :exc:`SyntaxError` 例外は、これまで問題が検出" +"された箇所のみを強調表示していましたが、今後は構文エラーを構成する式全体の範" +"囲を強調表示するようになりました。このため、( Python 3.10 以前で)次のように" +"表示されていたものが、" #: ../../whatsnew/3.10.rst:199 msgid "" @@ -337,8 +337,8 @@ msgid "" "exceptions have been incorporated. Some of the most notable ones are as " "follows:" msgstr "" -"多くの新しい種類の:exc:`SyntaxError` 例外に対して、より具体的でわかりやすいエ" -"ラーメッセージが追加されました。その中でも特に注目すべきものを以下に示しま" +"多くの新しい種類の :exc:`SyntaxError` 例外に対して、より具体的でわかりやすい" +"エラーメッセージが追加されました。その中でも特に注目すべきものを以下に示しま" "す。" #: ../../whatsnew/3.10.rst:222 @@ -505,7 +505,7 @@ msgid "" "kind of block was expecting an indentation, including the location of the " "statement:" msgstr "" -"多くの:exc:`IndentationError` 例外において、どの種類のブロックでインデントが" +"多くの :exc:`IndentationError` 例外において、どの種類のブロックでインデントが" "期待されていたのか、その文の位置に関する情報が追加されるようになりました。" #: ../../whatsnew/3.10.rst:341 diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index aabe5f7e8..06b140d78 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -273,7 +273,7 @@ msgid "" "flags." msgstr "" ":func:`ssl.create_default_context` がデフォルトのフラグとして :data:`ssl." -"VERIFY_X509_PARTIAL_CHAIN` と:data:`ssl.VERIFY_X509_STRICT` をセットするよう" +"VERIFY_X509_PARTIAL_CHAIN` と :data:`ssl.VERIFY_X509_STRICT` をセットするよう" "になりました。" #: ../../whatsnew/3.13.rst:150 @@ -2778,7 +2778,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:1758 msgid "turtle" -msgstr ":mod:`turtle`" +msgstr "``turtle``" #: ../../whatsnew/3.13.rst:1760 msgid "" diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index 407dd59cd..68f30ebb8 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -3140,7 +3140,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:1969 msgid "turtle" -msgstr ":mod:`turtle`" +msgstr "``turtle``" #: ../../whatsnew/3.14.rst:1971 msgid "" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 459c658ac..da4d187aa 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -76,11 +76,11 @@ msgid "" "memory structures can still be built, but will need to be recompiled for " "every feature release." msgstr "" -"Python 3.2 より、このことに関する別のアプローチが利用可能になりました。(:c:" -"macro:`Py_LIMITED_API` を定義することで) 制限された API のみ使うようにする拡" -"張モジュールは、数多くの内部実装を利用出来ない代わりに将来のいくつものリリー" -"スで安定であることを約束された API 集合だけ使うことになります。結果として、こ" -"のモードで 3.2 のためにビルドされた拡張モジュールは 3.3、3.4、…でも動作するで" +"Python 3.2 より、このことに関する別のアプローチが利用可能になりました。" +"(``Py_LIMITED_API`` を定義することで) 制限された API のみ使うようにする拡張モ" +"ジュールは、数多くの内部実装を利用出来ない代わりに将来のいくつものリリースで" +"安定であることを約束された API 集合だけ使うことになります。結果として、この" +"モードで 3.2 のためにビルドされた拡張モジュールは 3.3、3.4、…でも動作するで" "しょう。なお、メモリ構造の詳細を曝すような拡張モジュールでは、相変わらず全て" "の Python 公式リリースごとに再ビルドする必要があるでしょう。" @@ -842,8 +842,8 @@ msgstr "" "浮動小数点数または複素数に対する :func:`str` は :func:`repr` 表現と同じになり" "ました。以前は :func:`str` 形式のほうが短い表現になっていましたがこれは単に困" "惑させるものでした。 :func:`repr` がデフォルトで可能ななかでの一番短い表現を" -"するようになったので、 :func:`str` があえて短い表現を取ろうとする必要性がなく" -"なりました。" +"するようになったので、 ``str()`` があえて短い表現を取ろうとする必要性がなくな" +"りました。" #: ../../whatsnew/3.2.rst:532 msgid "(Proposed and implemented by Mark Dickinson; :issue:`9337`.)" @@ -955,8 +955,8 @@ msgstr "" "新たな警告カテゴリ :exc:`ResourceWarning` が追加されました。これはリソース消" "費やクリーンアップについての潜在的な問題が検出されると発行されます。これは通" "常のリリースビルドではデフォルトでは黙殺しますが、 :mod:`warnings` モジュール" -"で意味付けを変更 (訳注: :ref:`warning-filter` 参照) するかコマンドラインオプ" -"ションで有効に出来ます。" +"で意味付けを変更 (訳注: 警告フィルタ参照) するかコマンドラインオプションで有" +"効に出来ます。" #: ../../whatsnew/3.2.rst:600 msgid "" @@ -1422,7 +1422,8 @@ msgid "" "For sorting examples and a brief sorting tutorial, see the `Sorting HowTo " "`_ tutorial." msgstr "" -"ソートの例と簡単なチュートリアルは :ref:`sortinghowto` を参照して下さい。" +"ソートの例と簡単なチュートリアルは `ソートの HowTo `_ を参照して下さい。" #: ../../whatsnew/3.2.rst:842 msgid "itertools" @@ -1680,8 +1681,8 @@ msgid "" msgstr "" "さらに、 :class:`~datetime.timedelta` オブジェクトは今では :class:`float` を" "掛けることができ、 :class:`float` や :class:`int` で割ることができます。ま" -"た、 :class:`~datetime.timedelta` オブジェクトは別の :class:`~datetime." -"timedelta` で割ることが出来ます。" +"た、 :class:`~datetime.timedelta` オブジェクトは別の ``timedelta`` で割ること" +"が出来ます。" #: ../../whatsnew/3.2.rst:1007 msgid "" @@ -2118,8 +2119,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:1270 msgid "Formerly, this would have only been usable as a context manager::" msgstr "" -"ContextDecorator が使われる前の 3.1 までの :func:`~contextlib." -"contextmanager` では、これはコンテキストマネージャとして使えるだけでした::" +"ContextDecorator が使われる前の 3.1 までの ``contextmanager()`` では、これは" +"コンテキストマネージャとして使えるだけでした::" #: ../../whatsnew/3.2.rst:1272 msgid "" @@ -2726,10 +2727,10 @@ msgstr "" "うになりました。with ブロックを抜ける際に無条件にソケットをクローズします (ク" "ローズ処理で発生する :exc:`socket.error` は無視されます)。 (Contributed by " "Giampaolo Rodolà; :issue:`9794`.) (---訳注: リファレンスもそうなのですが、" -"「 :func:`socket.create_connection` が with をサポート」というのは実態とは違" -"うんじゃないかと思います(この関数のユーザからは同じにみえたとしても)。実際に" -"は :class:`socket.socket` がコンテキストマネージャをサポートしています。 " -"`socket.py `_ 参照。--)" +"「 ``socket.create_connection()`` が with をサポート」というのは実態とは違う" +"んじゃないかと思います(この関数のユーザからは同じにみえたとしても)。実際には " +"``socket.socket`` がコンテキストマネージャをサポートしています。 `socket.py " +"`_ 参照。--)" #: ../../whatsnew/3.2.rst:1636 msgid "ssl" @@ -3246,9 +3247,9 @@ msgstr "" ":mod:`inspect` モジュールに新たな関数 :func:`~inspect.getgeneratorstate` が追" "加されました。これで簡単にジェネレータイテレータの現在状態を識別出来ます (---" "訳注: generator-iterator という用語を使っている箇所は Python ドキュメント全体" -"通して多くはないのですが 2.x の :ref:`yield` 説明中に登場します。ジェネレータ" -"と同じ意味です。なお getgeneratorstate はジェネレータでないイテレータには使え" -"ません。---)::" +"通して多くはないのですが 2.x の yield 文説明中に登場します。ジェネレータと同" +"じ意味です。なお getgeneratorstate はジェネレータでないイテレータには使えませ" +"ん。---)::" #: ../../whatsnew/3.2.rst:1889 msgid "" @@ -3897,9 +3898,8 @@ msgid "" "API changes." msgstr "" "解決のためには任意の email メッセージをパースするために、 :mod:`email` パッ" -"ケージのバイナリサポートが利用されました (---訳注: :class:`~email.generator." -"BytesGenerator` や :func:`~email.message_from_bytes` など)。また、API の変更" -"も必要となりました。" +"ケージのバイナリサポートが利用されました (---訳注: ``BytesGenerator`` や " +"``message_from_bytes()`` など)。また、API の変更も必要となりました。" #: ../../whatsnew/3.2.rst:2280 msgid "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index f604a9403..7a236f74f 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -244,9 +244,9 @@ msgid "" msgstr "" "memoryview オブジェクトに、 PEP-3118 準拠の getbufferproc() が追加されていま" "す\n" -"(訳注: :ref:`buffer-structs` 参照)。これはコンシューマの要求型をチェックしま" -"す。多くの新機能が追加されており、これらのほとんどが不連続配列とサブオフセッ" -"トを持つ配列に完全な一般化をもたらすものです。" +"(訳注: バッファオブジェクト構造体 (buffer object structure) 参照)。これはコン" +"シューマの要求型をチェックします。多くの新機能が追加されており、これらのほと" +"んどが不連続配列とサブオフセットを持つ配列に完全な一般化をもたらすものです。" #: ../../whatsnew/3.3.rst:155 msgid "" @@ -255,11 +255,10 @@ msgid "" "basic and compound flags. The memory layout of non-contiguous and multi-" "dimensional NumPy-style arrays is explained." msgstr "" -":ref:`ドキュメント ` が更新され、エキスポータ(提供側)とコン" -"シューマ(利用側)両方についての責務をより明確に詳細化しています。 :ref:`バッ" -"ファ要求のフラグ ` が、基本フラグと組合せフラグでグルー" -"プ分けされています。不連続配列と多次元の NumPy スタイル行列のメモリレイアウト" -"について説明されています。" +"ドキュメントが更新され、エキスポータ(提供側)とコンシューマ(利用側)両方につい" +"ての責務をより明確に詳細化しています。バッファ要求のフラグが、基本フラグと組" +"合せフラグでグループ分けされています。不連続配列と多次元の NumPy スタイル行列" +"のメモリレイアウトについて説明されています。" #: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1125 msgid "Features" @@ -270,17 +269,16 @@ msgid "" "All native single character format specifiers in struct module syntax " "(optionally prefixed with '@') are now supported." msgstr "" -"struct モジュールの構文の全ての native :ref:`format-characters` をサポートす" -"るようになりました ('@' プレフィクスが付いていても良いです)。 (訳注: :attr:" -"`~memoryview.format` 参照。)" +"struct モジュールの構文の全ての native 書式指定文字をサポートするようになりま" +"した ('@' プレフィクスが付いていても良いです)。 (訳注: ``format`` 参照。)" #: ../../whatsnew/3.3.rst:166 msgid "" "With some restrictions, the cast() method allows changing of format and " "shape of C-contiguous arrays." msgstr "" -"いくつかの制限はありますが、 :meth:`~memoryview.cast` メソッドでフォーマット" -"変更と C-:term:`contiguous` 配列の形状 (shape) の変更を行うことが出来ます。" +"いくつかの制限はありますが、 ``cast()`` メソッドでフォーマット変更と C-" +"contiguous 配列の形状 (shape) の変更を行うことが出来ます。" #: ../../whatsnew/3.3.rst:169 msgid "" @@ -296,9 +294,9 @@ msgid "" "One-dimensional memoryviews of hashable (read-only) types with formats B, b " "or c are now hashable. (Contributed by Antoine Pitrou in :issue:`13411`.)" msgstr "" -"'B', 'b', 'c' いずれかのフォーマットの :term:`hashable` な (読み出し専用の) " -"型の1次元メモリビューもまた、 hashable です。 (Contributed by Antoine Pitrou " -"in :issue:`13411`.)" +"'B', 'b', 'c' いずれかのフォーマットの hashable な (読み出し専用の) 型の1次元" +"メモリビューもまた、 hashable です。 (Contributed by Antoine Pitrou in :" +"issue:`13411`.)" #: ../../whatsnew/3.3.rst:176 msgid "" @@ -312,16 +310,15 @@ msgstr "API の変更" #: ../../whatsnew/3.3.rst:182 msgid "The maximum number of dimensions is officially limited to 64." -msgstr "最大 :attr:`次元 ` は公式に 64 に制限されています。" +msgstr "最大 ``次元`` は公式に 64 に制限されています。" #: ../../whatsnew/3.3.rst:184 msgid "" "The representation of empty shape, strides and suboffsets is now an empty " "tuple instead of ``None``." msgstr "" -"空の :attr:`~memoryview.shape`, 空の :attr:`~memoryview.strides`, 空の :attr:" -"`~memoryview.suboffsets` を表現するのに以前は ``None`` を用いていましたが今で" -"はこれは空のタプルです。" +"空の ``shape``, 空の ``strides``, 空の ``suboffsets`` を表現するのに以前は " +"``None`` を用いていましたが今ではこれは空のタプルです。" #: ../../whatsnew/3.3.rst:187 msgid "" @@ -331,8 +328,7 @@ msgid "" msgstr "" "フォーマット 'B' (unsigned bytes) での memoryview 要素へのアクセスは整数を返" "すようになりました (struct モジュールでの構文に従っています)。bytes オブジェ" -"クトが欲しければまずビューを 'c' で :meth:`~memoryview.cast` しなければなりま" -"せん。" +"クトが欲しければまずビューを 'c' で ``cast()`` しなければなりません。" #: ../../whatsnew/3.3.rst:191 msgid "" @@ -813,9 +809,8 @@ msgid "" "final value to the outer generator::" msgstr "" "ですが普通のループとは違って ``yield from`` ではサブジェネレータは、呼び出し" -"側スコープから :meth:`~generator.send` されたり :meth:`~generator.throw` され" -"た値を直接受け取ることができ、また、外側のジェネレータに最終的な値を返せま" -"す::" +"側スコープから ``send()`` されたり ``throw()`` された値を直接受け取ることがで" +"き、また、外側のジェネレータに最終的な値を返せます::" #: ../../whatsnew/3.3.rst:428 msgid "" @@ -2028,9 +2023,9 @@ msgid "" "instances now return :const:`False` instead of raising :exc:`TypeError` (:" "issue:`15006`)." msgstr "" -"naive な :class:`~datetime.datetime` インスタンスと aware な :class:" -"`~datetime.datetime` インスタンスの等価比較で、 :exc:`TypeError` を投げずに :" -"const:`False` を返すようになりました。 (:issue:`15006`)." +"naive な :class:`~datetime.datetime` インスタンスと aware な ``datetime`` イ" +"ンスタンスの等価比較で、 :exc:`TypeError` を投げずに :const:`False` を返すよ" +"うになりました。 (:issue:`15006`)." #: ../../whatsnew/3.3.rst:1084 msgid "" @@ -2157,9 +2152,9 @@ msgid "" "The :exc:`~decimal.FloatOperation` signal optionally enables stricter " "semantics for mixing floats and Decimals." msgstr "" -":exc:`~decimal.FloatOperation` :ref:`シグナル ` により、" -"float と Decimal の混合の厳密なセマンティクスを有効に出来ます。(---訳注: 使用" -"例が :ref:`decimal-tutorial` にあります。---)" +":exc:`~decimal.FloatOperation` シグナルにより、float と Decimal の混合の厳密" +"なセマンティクスを有効に出来ます。(---訳注: 使用例が Quick-start tutorial に" +"あります。---)" #: ../../whatsnew/3.3.rst:1130 msgid "" @@ -2448,9 +2443,9 @@ msgid "" "The new policies are instances of :class:`~email.policy.EmailPolicy`, and " "add the following additional controls:" msgstr "" -"その新規ポリシーは :class:`~email.policy.EmailPolicy` のインスタンス (訳注: :" -"data:`email.policy.default` や :data:`email.policy.SMTP` など) です。これには" -"以下の制御が追加されています:" +"その新規ポリシーは :class:`~email.policy.EmailPolicy` のインスタンス (訳注: " +"``email.policy.default`` や ``email.policy.SMTP`` など) です。これには以下の" +"制御が追加されています:" #: ../../whatsnew/3.3.rst:1271 msgid "refold_source" @@ -2634,9 +2629,9 @@ msgid "" "email header, convert it into an aware :class:`~datetime.datetime`, or a " "naive :class:`~datetime.datetime` if the offset is ``-0000``." msgstr "" -":func:`~email.utils.parsedate_to_datetime`: email ヘッダからの日付文字列を渡" -"すと、 aware な、または naive な :class:`~datetime.datetime` に変換します。オ" -"フセットが ``-0000`` の場合に naive で返します。" +":func:`~email.utils.parsedate_to_datetime`: email ヘッダの日付文字列を aware " +"な :class:`~datetime.datetime` に変換します。オフセットが ``-0000`` の場合" +"は、naive な :class:`~datetime.datetime` に変換します。" #: ../../whatsnew/3.3.rst:1364 msgid "" @@ -2664,9 +2659,9 @@ msgid "" "issue:`8594`.)" msgstr "" ":class:`ftplib.FTP` に新しいキーワード引数 ``source_address`` が追加されまし" -"た。 ``(host, port)`` の形で指定し、これは外に向かうソケットを作成する際に :" -"meth:`~socket.socket.bind` 呼び出し内でのソースアドレスとして用いられます。 " -"(Contributed by Giampaolo Rodolà in :issue:`8594`.)" +"た。 ``(host, port)`` の形で指定し、これは外に向かうソケットを作成する際に " +"``bind()`` 呼び出し内でのソースアドレスとして用いられます。 (Contributed by " +"Giampaolo Rodolà in :issue:`8594`.)" #: ../../whatsnew/3.3.rst:1379 msgid "" @@ -2903,8 +2898,8 @@ msgid "" "logger." msgstr "" ":func:`~logging.basicConfig` 関数がオプショナルな ``handlers`` 引数をサポート" -"するようになりました。これはルートロガーに追加するハンドラ群の :term:`イテラ" -"ブル ` です。" +"するようになりました。これはルートロガーに追加するハンドラ群のイテラブルで" +"す。" #: ../../whatsnew/3.3.rst:1507 msgid "" @@ -2996,7 +2991,7 @@ msgid "" "`~multiprocessing.pool.Pool.map_async` functions. (Contributed by Hynek " "Schlawack in :issue:`12708`.)" msgstr "" -":func:`map` と :func:`itertools.starmap` との関係と同じ、既存の :meth:" +"``map()`` と :func:`itertools.starmap` との関係と同じ、既存の :meth:" "`multiprocessing.pool.Pool.map` と :meth:`~multiprocessing.pool.Pool." "map_async` に対応する :meth:`multiprocessing.pool.Pool.starmap` と :meth:" "`~multiprocessing.pool.Pool.starmap_async` が追加されました。 (Contributed " @@ -3634,7 +3629,7 @@ msgid "" "instead of a RuntimeError: OSError has an errno attribute." msgstr "" ":func:`signal.signal` と :func:`signal.siginterrupt` は RuntimeError ではな" -"く :exc:`OSError` を投げるようになりました: OSError は errno 属性を持っていま" +"く ``OSError`` を投げるようになりました: OSError は errno 属性を持っていま" "す。" #: ../../whatsnew/3.3.rst:1848 @@ -3672,9 +3667,9 @@ msgid "" msgstr "" "クラス :class:`~smtplib.SMTP`, :class:`~smtplib.SMTP_SSL`, :class:`~smtplib." "LMTP` に新しいキーワード引数 ``source_address`` が追加されました。 ``(host, " -"port)`` の形で指定し、これは外に向かうソケットを作成する際に :meth:`~socket." -"socket.bind` 呼び出し内でのソースアドレスとして用いられます。(Contributed by " -"Paulo Scardine in :issue:`11281`.)" +"port)`` の形で指定し、これは外に向かうソケットを作成する際に ``bind()`` 呼び" +"出し内でのソースアドレスとして用いられます。(Contributed by Paulo Scardine " +"in :issue:`11281`.)" #: ../../whatsnew/3.3.rst:1868 msgid "" @@ -4715,10 +4710,10 @@ msgid "" "with sys.platform.startswith('linux'), or directly sys.platform == 'linux' " "if you don't need to support older Python versions." msgstr "" -":issue:`12326`: Linux では、 :attr:`sys.platform` はもはやメジャーバージョン" -"番号を含みません。 これは今では常に 'linux' です。以前はこれは Python のビル" -"ドに使われた Linux バージョンに依存した ``'linux2'`` や ``'linux3'`` でし" -"た。 ``sys.platform == 'linux2'`` などとするのではなく、 ``sys.platform." +":issue:`12326`: Linux では、 ``sys.platform`` はもはやメジャーバージョン番号" +"を含みません。 これは今では常に 'linux' です。以前はこれは Python のビルドに" +"使われた Linux バージョンに依存した ``'linux2'`` や ``'linux3'`` でした。 " +"``sys.platform == 'linux2'`` などとするのではなく、 ``sys.platform." "startswith('linux')`` とするか、古い Python バージョンのサポートが不要であれ" "ば直接的に ``sys.platform == 'linux'`` として下さい。" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 11d7b8330..50b2e9ad0 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -838,8 +838,8 @@ msgid "" msgstr "" ":class:`int` コンストラクタの *base* 引数に、 ``__index__`` メソッドを持つ任" "意のオブジェクトを渡せるようになりました。(Contributed by Mark Dickinson in :" -"issue:`16772`.) (---訳注: `Python API の変更`_ に同じ :issue:`16772` を発端と" -"する変更が書かれているのでそちらも参照して下さい。 ---)" +"issue:`16772`.) (---訳注: 「Python API の変更」に同じ issue 16772 を発端とす" +"る変更が書かれているのでそちらも参照して下さい。 ---)" #: ../../whatsnew/3.4.rst:439 msgid "" @@ -1419,9 +1419,9 @@ msgid "" "``distb(tb)``)." msgstr "" ":class:`~dis.Bytecode` にはクラスメソッド :meth:`~dis.Bytecode." -"from_traceback` もあります。トレースバックから :class:`~dis.Bytecode` を構築" -"します。(``print(Bytecode.from_traceback(tb).dis())`` は :func:`~dis.distb` " -"を使って ``distb(tb)`` とするのと同じです。)" +"from_traceback` もあります。トレースバックから ``Bytecode`` を構築します。" +"(``print(Bytecode.from_traceback(tb).dis())`` は ``distb()`` を使って " +"``distb(tb)`` とするのと同じです。)" #: ../../whatsnew/3.4.rst:766 msgid "" @@ -1468,9 +1468,8 @@ msgstr "" "なりました。2 つの新オプション ``-o`` と ``-f`` が追加されています。 ``-o`` " "によりコマンドラインから :ref:`doctest オプション ` を指定す" "ることが出来ます。 ``-f`` は ``-o FAIL_FAST`` の速記法です (:mod:`unittest` " -"CLI でサポートされる似たオプション :ref:`サポートされる同じオプション " -"` に似せるためです)。 (Contributed by R. " -"David Murray in :issue:`11390`.)" +"CLI でサポートされる似たオプションサポートされる同じオプションに似せるためで" +"す)。 (Contributed by R. David Murray in :issue:`11390`.)" #: ../../whatsnew/3.4.rst:787 msgid "" @@ -1495,10 +1494,10 @@ msgid "" msgstr "" ":meth:`~email.message.Message.as_string` メソッドが、その文字列表現を生成する" "のに使うデフォルトポリシーを上書き出来る *policy* 引数を取るようになりまし" -"た。つまり :class:`~email.message.Message` を作り直したり ``flattern`` メソッ" -"ドの書式化パラメータのためだけに :mod:`~email.generator` を使うことなしに、 " -"``as_string`` をより多くの状況で使えるということになります。(Contributed by " -"R. David Murray in :issue:`18600`.)" +"た。つまり ``Message`` を作り直したり ``flattern`` メソッドの書式化パラメータ" +"のためだけに :mod:`~email.generator` を使うことなしに、 ``as_string`` をより" +"多くの状況で使えるということになります。(Contributed by R. David Murray in :" +"issue:`18600`.)" #: ../../whatsnew/3.4.rst:801 msgid "" @@ -1909,8 +1908,8 @@ msgid "" "get_source` methods." msgstr "" ":mod:`importlib.util` に :func:`~importlib.util.decode_source` 関数が追加され" -"ました。 :term:`universal newlines` 処理を使って bytes からソースをデコードし" -"ます。 :meth:`.InspectLoader.get_source` メソッドを実装するのに便利です。" +"ました。 universal newlines 処理を使って bytes からソースをデコードします。 :" +"meth:`.InspectLoader.get_source` メソッドを実装するのに便利です。" #: ../../whatsnew/3.4.rst:1017 msgid "" @@ -2536,7 +2535,7 @@ msgid "" "with` block. (Contributed by Filip Gruszczyński in :issue:`13896`.)" msgstr "" ":class:`~shelve.Shelf` がコンテキスト管理プロトコルをサポートするようになりま" -"した: :keyword:`!with` ブロックで使うとブロックの終了時に自動的にクローズされ" +"した: :keyword:`with` ブロックで使うとブロックの終了時に自動的にクローズされ" "ます。 (Contributed by Filip Gruszczyński in :issue:`13896`.)" #: ../../whatsnew/3.4.rst:1360 @@ -2695,8 +2694,8 @@ msgstr "" ":class:`~ssl.SSLContext` のメソッド :meth:`~ssl.SSLContext." "load_verify_locations` にオプショナル引数 *cadata* が追加されました。これに" "は PEM あるいは DER エンコードの証明書を直接指定できます。前者の場合は文字列" -"で、後者では :term:`bytes-like object` で指定します。(Contributed by " -"Christian Heimes in :issue:`18138`.)" +"で、後者では bytes-like object で指定します。(Contributed by Christian " +"Heimes in :issue:`18138`.)" #: ../../whatsnew/3.4.rst:1446 msgid "" @@ -2837,8 +2836,8 @@ msgid "" msgstr "" ":func:`~subprocess.check_output` が *input* 引数を受け付けるようになりまし" "た。これは実行するコマンドにとっての ``stdin`` を供給するのに使われます (訳" -"注: :func:`~subprocess.run` のドキュメント参照)。 (Contributed by Zack " -"Weinberg in :issue:`16624`.)" +"注: ``run()`` のドキュメント参照)。 (Contributed by Zack Weinberg in :issue:" +"`16624`.)" #: ../../whatsnew/3.4.rst:1523 msgid "" @@ -3032,8 +3031,8 @@ msgstr "" ":class:`~urllib.request.Request` クラスで使われる HTTP メソッドを、サブクラス" "で :class:`~urllib.request.Request.method` 属性をセットすることにより指定出来" "るようになりました。 (Contributed by Jason R Coombs in :issue:`18978`.) (---" -"訳注: :class:`~urllib.request.Request.method` は 3.3 で追加されたが、コンスト" -"ラクタに渡されたものが設定されるだけだった。---)" +"訳注: ``method`` は 3.3 で追加されたが、コンストラクタに渡されたものが設定さ" +"れるだけだった。---)" #: ../../whatsnew/3.4.rst:1635 msgid "" @@ -4020,7 +4019,7 @@ msgid "" "The site module adding a \"site-python\" directory to sys.path, if it " "exists, is deprecated (:issue:`19375`)." msgstr "" -":mod:`site` モジュールは \"site-python\" ディレクトリが存在すればこれを sys." +"``site`` モジュールは \"site-python\" ディレクトリが存在すればこれを sys." "path に加えていましたが、これは非推奨となりました。 (:issue:`19375`)" #: ../../whatsnew/3.4.rst:2157 @@ -4398,7 +4397,7 @@ msgid "" msgstr "" ":func:`inspect.getfullargspec` は、 :func:`inspect.signature` を前提とした再" "実装がなされました。これにより、かつて扱えていたよりも遥かに広い種類の呼び出" -"し可能 (callable) を扱うようになりました (訳注: 例えば :func:`open` などは " +"し可能 (callable) を扱うようになりました (訳注: 例えば ``open()`` などは " "Python 3.3 までは扱えなかった)。Python 3.4 系列の経過のなかで、追加で組み込み" "や拡張モジュールの callable がシグニチャのメタデータを持つことが期待されてい" "ます。 :func:`inspect.getfullargspec` が非 Python callable で失敗することを前" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index e2b265b04..67427ef80 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -121,8 +121,7 @@ msgid "" "spec." msgstr "" ":ref:`dict ` オブジェクトの挿入順序を保存するという性質が、公" -"式に Python 言語仕様の一部であると `宣言されました `_ 。" +"式に Python 言語仕様の一部であると `宣言されました `_ 。" #: ../../whatsnew/3.7.rst:90 msgid "Significant improvements in the standard library:" From 266eb4866c69e01858b3aec4c56dc241c18c02ae Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 20 Oct 2026 23:49:41 +0000 Subject: [PATCH 05/21] Merge 3.15 into 3.14 --- tutorial/venv.po | 140 ++++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/tutorial/venv.po b/tutorial/venv.po index 1bcc8c0a5..8d26399d3 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -39,10 +39,10 @@ msgid "" "bug has been fixed or the application may be written using an obsolete " "version of the library's interface." msgstr "" -"Python アプリケーションはよく標準ライブラリ以外のパッケージやモジュールを利用" -"します。またアプリケーションがあるバグ修正を必要としていたり、過去のバージョ" -"ンのインターフェイスに依存しているために、ライブラリの特定のバージョンを必要" -"とすることもあります。" +"Python アプリケーションは、標準ライブラリに含まれないパッケージやモジュールを" +"よく使います。特定のバグの修正が必要だったり、古いバージョンのライブラリのイ" +"ンターフェイスに依存していたりするため、ライブラリの特定のバージョンが必要に" +"なることもあります。" #: ../../tutorial/venv.rst:17 msgid "" @@ -52,11 +52,11 @@ msgid "" "are in conflict and installing either version 1.0 or 2.0 will leave one " "application unable to run." msgstr "" -"そのため、1つのインストールされたPythonが全てのアプリケーションの要求に対応す" -"ることは不可能です。もしアプリケーションAがあるモジュールのバージョン 1.0 を" -"要求していて、別のアプリケーションBが同じモジュールのバージョン 2.0 を要求し" -"ている場合、2つの要求は衝突していて、1.0 と 2.0 のどちらかのバージョンをイン" -"ストールしても片方のアプリケーションが動きません。" +"このため、1つの Python 環境ですべてのアプリケーションの要求を満たせるとは限り" +"ません。アプリケーション A があるモジュールのバージョン 1.0 を必要とし、アプ" +"リケーション B がバージョン 2.0 を必要とする場合、両者の要求は衝突します。" +"1.0 と 2.0 のどちらをインストールしても、片方のアプリケーションは動作しませ" +"ん。" #: ../../tutorial/venv.rst:23 msgid "" @@ -64,9 +64,9 @@ msgid "" "self-contained directory tree that contains a Python installation for a " "particular version of Python, plus a number of additional packages." msgstr "" -"この問題の解決策は :term:`仮想環境` を作ることです。仮想" -"環境とは、特定のバージョンの Python と幾つかの追加パッケージを含んだ Python " -"インストールを構成するディレクトリです。" +"この問題は :term:`仮想環境 ` を作ることで解決できます。" +"仮想環境とは、特定のバージョンの Python といくつかの追加パッケージを含む自己" +"完結したディレクトリ構造です。" #: ../../tutorial/venv.rst:27 msgid "" @@ -77,12 +77,11 @@ msgid "" "application B requires a library be upgraded to version 3.0, this will not " "affect application A's environment." msgstr "" -"別のアプリケーションはそれぞれ別の仮想環境を使うことができます。先の例にあっ" -"た要求の衝突を解決する場合、アプリケーションAが固有の仮想環境を持ってそこにラ" -"イブラリのバージョン 1.0 をインストールし、アプリケーションBが持つ別の仮想環" -"境にライブラリのバージョン 2.0 をインストールすることができます。そしてアプリ" -"ケーションBがライブラリのバージョンを 3.0 に更新することを要求する場合も、ア" -"プリケーションAに影響しません。" +"アプリケーションごとに異なる仮想環境を使うことができます。先ほどの例では、ア" +"プリケーション A 専用の仮想環境にバージョン 1.0 をインストールし、アプリケー" +"ション B 用の仮想環境にバージョン 2.0 をインストールすれば要求の衝突を解決で" +"きます。アプリケーション B のためにライブラリをバージョン 3.0 に更新する必要" +"があっても、アプリケーション A の環境には影響しません。" #: ../../tutorial/venv.rst:36 msgid "Creating Virtual Environments" @@ -95,10 +94,10 @@ msgid "" "was run (as reported by the :option:`--version` option). For instance, " "executing the command with ``python3.12`` will install version 3.12." msgstr "" -"仮想環境の作成・管理に使われるモジュールは、 :mod:`venv` と呼ばれます。 :mod:" -"`venv` は、コマンドが実行された Python のバージョン (:option:`--version` オプ" -"ションで表示される) をインストールします。例えば、 ``python3.12`` でコマンド" -"を実行すると、バージョン 3.12 がインストールされます。" +"仮想環境の作成と管理には :mod:`venv` モジュールを使います。:mod:`venv` はその" +"コマンドを実行したバージョンの Python をインストールします。このバージョン" +"は :option:`--version` オプションで確認できます。例えば ``python3.12`` でコマ" +"ンドを実行すると、バージョン 3.12 がインストールされます。" #: ../../tutorial/venv.rst:44 msgid "" @@ -106,8 +105,8 @@ msgid "" "place it, and run the :mod:`venv` module as a script with the directory " "path::" msgstr "" -"仮想環境を作るには、仮想環境を置くディレクトリを決めて、 そのディレクトリのパ" -"スを指定して、 :mod:`venv` をスクリプトとして実行します::" +"仮想環境を作るには、配置先のディレクトリを決めます。そのパスを指定して :mod:" +"`venv` モジュールをスクリプトとして実行してください::" #: ../../tutorial/venv.rst:47 msgid "python -m venv tutorial-env" @@ -119,8 +118,8 @@ msgid "" "also create directories inside it containing a copy of the Python " "interpreter and various supporting files." msgstr "" -"これは ``tutorial-env`` ディレクトリがなければ作成して、その中に Python イン" -"タプリタ、その他関連するファイルのコピーを含むサブディレクトリを作ります。" +"``tutorial-env`` ディレクトリがなければ作成されます。その中にサブディレクトリ" +"も作られ、Python インタープリタのコピーや各種の補助ファイルが配置されます。" #: ../../tutorial/venv.rst:53 msgid "" @@ -130,18 +129,18 @@ msgid "" "prevents clashing with ``.env`` environment variable definition files that " "some tooling supports." msgstr "" -"仮想環境の一般的なディレクトリの場所は ``.venv`` です。この名前は、通常はシェ" -"ルで隠されているため、ディレクトリが存在する理由を説明する名前を付けても、邪" -"魔にはなりません。また、一部のツールでサポートされている ``.env`` 環境変数定" -"義ファイルによるクラッシュも防止します。" +"仮想環境のディレクトリには ``.venv`` という名前がよく使われます。この名前なら" +"ディレクトリの用途が分かり、通常はシェルで非表示になるため邪魔になりません。" +"また、一部のツールが使う環境変数定義ファイル ``.env`` との名前の衝突も避けら" +"れます。" #: ../../tutorial/venv.rst:59 msgid "Once you've created a virtual environment, you may activate it." -msgstr "仮想環境を作ったら、それを有効化する必要があります。" +msgstr "仮想環境を作ったら、有効化することができます。" #: ../../tutorial/venv.rst:61 msgid "On Windows, run::" -msgstr "Windows の場合::" +msgstr "Windows では次を実行します::" #: ../../tutorial/venv.rst:63 msgid "tutorial-env\\Scripts\\activate" @@ -149,7 +148,7 @@ msgstr "tutorial-env\\Scripts\\activate" #: ../../tutorial/venv.rst:65 msgid "On Unix or MacOS, run::" -msgstr "Unix や Mac OS の場合::" +msgstr "Unix や macOS では次を実行します::" #: ../../tutorial/venv.rst:67 msgid "source tutorial-env/bin/activate" @@ -161,9 +160,9 @@ msgid "" "or :program:`fish` shells, there are alternate ``activate.csh`` and " "``activate.fish`` scripts you should use instead.)" msgstr "" -"(このスクリプトは bash shell で書かれています。 :program:`csh` や :program:" -"`fish` を利用している場合、代わりに利用できる ``activate.csh`` と ``activate." -"fish`` スクリプトがあります。)" +"(このスクリプトは bash シェル用です。:program:`csh` や :program:`fish` を使っ" +"ている場合は、代わりに ``activate.csh`` や ``activate.fish`` スクリプトを使っ" +"てください。)" #: ../../tutorial/venv.rst:74 msgid "" @@ -172,9 +171,9 @@ msgid "" "running ``python`` will get you that particular version and installation of " "Python. For example:" msgstr "" -"仮想環境を有効化すると、シェルのプロンプトに利用中の仮想環境が表示されるよう" -"になり、``python`` を実行するとその仮想環境の Python を実行するようになりま" -"す::" +"仮想環境を有効化すると、使用中の仮想環境がシェルのプロンプトに表示されます。" +"また、``python`` を実行するとその仮想環境の Python が起動するように環境が変更" +"されます。例えば次のようになります:" #: ../../tutorial/venv.rst:79 msgid "" @@ -206,6 +205,10 @@ msgid "" "version the virtual environment is using. The best practice is to ``unset " "PYTHONPATH`` in bash or the equivalent for the shell you are using." msgstr "" +"仮想環境を有効化しても ``PYTHONPATH`` 変数は一切変更されないことに注意してく" +"ださい。仮想環境の Python バージョンと互換性のないコードへのパスが含まれてい" +"ると、予期しない結果になることがあります。bash では ``unset PYTHONPATH`` を実" +"行し、ほかのシェルでも同等の操作で設定を解除することをお勧めします。" #: ../../tutorial/venv.rst:96 msgid "To deactivate a virtual environment, type::" @@ -230,10 +233,10 @@ msgid "" "Package Index `_. You can browse the Python Package Index " "by going to it in your web browser." msgstr "" -" :program:`pip` と呼ばれるプログラムでパッケージをインストール、アップグレー" -"ド、削除することができます。デフォルトでは ``pip`` は `Python Package Index " -"`_ からパッケージをインストールします。ブラウザを使って " -"Python Package Index を閲覧することができます。" +":program:`pip` というプログラムを使って、パッケージのインストール、アップグ" +"レード、削除ができます。デフォルトでは ``pip`` は `Python Package Index " +"`_ からパッケージをインストールします。Python Package " +"Index はウェブブラウザで閲覧できます。" #: ../../tutorial/venv.rst:110 msgid "" @@ -241,17 +244,16 @@ msgid "" "etc. (Consult the :ref:`installing-index` guide for complete documentation " "for ``pip``.)" msgstr "" -"``pip`` は \"install\" 、 \"uninstall\" 、 \"freeze\" など、いくつかのサブコ" -"マンドを持っています。 (``pip`` の完全なドキュメントは :ref:`installing-" -"index` ガイドを参照してください。)" +"``pip`` には \"install\"、\"uninstall\"、\"freeze\" などのサブコマンドがあり" +"ます。(``pip`` の詳しいドキュメントについては :ref:`installing-index` ガイド" +"を参照してください。)" #: ../../tutorial/venv.rst:114 msgid "" "You can install the latest version of a package by specifying a package's " "name:" msgstr "" -"パッケージ名を指定してそのパッケージの最新版をインストールすることができま" -"す::" +"パッケージ名を指定すると、そのパッケージの最新版をインストールできます:" #: ../../tutorial/venv.rst:116 msgid "" @@ -274,8 +276,8 @@ msgid "" "You can also install a specific version of a package by giving the package " "name followed by ``==`` and the version number:" msgstr "" -"パッケージ名のあとに ``==`` とバージョン番号を付けることで、特定のバージョン" -"のパッケージをインストールすることもできます::" +"パッケージ名の後に ``==`` とバージョン番号を付けると、特定のバージョンをイン" +"ストールすることもできます:" #: ../../tutorial/venv.rst:128 msgid "" @@ -298,10 +300,10 @@ msgid "" "number to get that version, or you can run ``python -m pip install --" "upgrade`` to upgrade the package to the latest version:" msgstr "" -"同じコマンドを再び実行した場合、``pip`` は要求されたバージョンがインストール" -"済みだと表示して何もしません。別のバージョン番号を指定すればそのバージョンを" -"インストールしますし、``python -m pip install --upgrade`` を実行すればその" -"パッケージを最新版に更新します::" +"このコマンドを再実行しても、``pip`` は指定されたバージョンがインストール済み" +"であることを確認して何もしません。別のバージョン番号を指定すれば、そのバー" +"ジョンをインストールできます。また、``python -m pip install --upgrade`` を実" +"行すればパッケージを最新版に更新できます:" #: ../../tutorial/venv.rst:141 msgid "" @@ -326,13 +328,13 @@ msgid "" "``python -m pip uninstall`` followed by one or more package names will " "remove the packages from the virtual environment." msgstr "" -"``python -m pip uninstall`` コマンドに削除するパッケージ名を1つ以上指定しま" -"す。" +"``python -m pip uninstall`` の後に1つ以上のパッケージ名を指定すると、それらの" +"パッケージが仮想環境から削除されます。" #: ../../tutorial/venv.rst:154 msgid "" "``python -m pip show`` will display information about a particular package:" -msgstr "``python -m pip show`` は指定されたパッケージの情報を表示します::" +msgstr "``python -m pip show`` は指定したパッケージの情報を表示します:" #: ../../tutorial/venv.rst:156 msgid "" @@ -367,8 +369,8 @@ msgid "" "``python -m pip list`` will display all of the packages installed in the " "virtual environment:" msgstr "" -"``python -m pip list`` は仮想環境にインストールされた全てのパッケージを表示し" -"ます::" +"``python -m pip list`` は仮想環境にインストールされているすべてのパッケージを" +"表示します:" #: ../../tutorial/venv.rst:174 msgid "" @@ -393,9 +395,9 @@ msgid "" "expects. A common convention is to put this list in a ``requirements.txt`` " "file:" msgstr "" -"``python -m pip freeze`` はインストールされたパッケージ一覧を、``python -m " -"pip install`` が解釈するフォーマットで生成します。一般的な慣習として、このリ" -"ストを ``requirements.txt`` というファイルに保存します:" +"``python -m pip freeze`` もインストール済みのパッケージ一覧を出力しますが、こ" +"ちらは ``python -m pip install`` が受け付ける形式を使います。この一覧は通常、" +"``requirements.txt`` というファイルに保存します:" #: ../../tutorial/venv.rst:187 msgid "" @@ -417,9 +419,9 @@ msgid "" "shipped as part of an application. Users can then install all the necessary " "packages with ``install -r``:" msgstr "" -"``requirements.txt`` をバージョン管理システムにコミットして、アプリケーション" -"の一部として配布することができます。ユーザーは必要なパッケージを ``install -" -"r`` でインストールできます::" +"``requirements.txt`` はバージョン管理システムにコミットし、アプリケーションの" +"一部として配布できます。ユーザーは ``install -r`` で必要なパッケージをすべて" +"インストールできます:" #: ../../tutorial/venv.rst:199 msgid "" @@ -452,7 +454,7 @@ msgid "" "want to make it available on the Python Package Index, consult the `Python " "packaging user guide`_." msgstr "" -"``pip`` にはたくさんのオプションがあります。 ``pip`` の完全なドキュメントは :" -"ref:`installing-index` を参照してください。パッケージを作成してそれを Python " -"Package Index で公開したい場合、 `Python packaging user guide`_ を参照してく" -"ださい。" +"``pip`` にはほかにも多くのオプションがあります。``pip`` の詳しいドキュメント" +"については :ref:`installing-index` ガイドを参照してください。作成したパッケー" +"ジを Python Package Index で公開するには、`Python packaging user guide`_ を参" +"照してください。" From c3f226953635a1467fb53bed808e64f81a96e02c Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 21 Oct 2026 10:06:44 +0000 Subject: [PATCH 06/21] Merge 3.15 into 3.14 --- builtins/functions.po | 4 +- library/abc.po | 8 ++-- library/base64.po | 8 ++-- library/functions.po | 4 +- library/hashlib.po | 2 +- library/inspect.po | 4 +- tutorial/appendix.po | 2 +- tutorial/datastructures.po | 80 ++++++++++++++++++++------------------ whatsnew/3.12.po | 2 +- 9 files changed, 60 insertions(+), 54 deletions(-) diff --git a/builtins/functions.po b/builtins/functions.po index dbf0d35f3..a7d5552e7 100644 --- a/builtins/functions.po +++ b/builtins/functions.po @@ -3922,8 +3922,8 @@ msgid "" ":class:`super` objects are now :mod:`pickleable ` and :mod:" "`copyable `." msgstr "" -":class:`super` オブジェクトは :term:`pickle 可能 ` かつ :term:`コピー" -"可能 ` になりました。" +":class:`super` オブジェクトは :mod:`pickle 可能 ` かつ :mod:`コピー可" +"能 ` になりました。" #: ../../builtins/functions.rst:2158 msgid "" diff --git a/library/abc.po b/library/abc.po index e98e34d41..307c22884 100644 --- a/library/abc.po +++ b/library/abc.po @@ -53,10 +53,10 @@ msgid "" "term:`hashable` or if it is a :term:`mapping`." msgstr "" ":mod:`collections` モジュール には、抽象基底クラス から派生するいくつかの具象" -"クラスがある。もちろん、これらはさらに派生させることができる。さらに、:mod:" -"`collections.抽象基底クラス` サブモジュールには、クラスやインスタンス が特定" -"のインターフェース 、たとえば 、:term:`hashable`であるか、:term:`mapping`であ" -"るかをテストするために使用できる抽象基底クラス があります。" +"クラスがある。もちろん、これらはさらに派生させることができる。さらに、 :mod:" +"`collections.abc` サブモジュールには、クラスやインスタンス が特定のインター" +"フェース 、たとえば 、 :term:`hashable` であるか、 :term:`mapping` であるかを" +"テストするために使用できる抽象基底クラス があります。" #: ../../library/abc.rst:23 msgid "" diff --git a/library/base64.po b/library/base64.po index 6ec46ad21..ac13cc3f2 100644 --- a/library/base64.po +++ b/library/base64.po @@ -371,16 +371,16 @@ msgid "" "Similar to :func:`b32encode` but uses the Extended Hex Alphabet, as defined " "in :rfc:`4648`." msgstr "" -":func:`b32encode`に似ていますが、:rfc:`4648`で定義されているようにExtended " -"Hex Alphabetを使用します。" +":func:`b32encode` に似ていますが、 :rfc:`4648` で定義されているように" +"Extended Hex Alphabetを使用します。" #: ../../library/base64.rst:237 msgid "" "Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined " "in :rfc:`4648`." msgstr "" -":func:`b32decode`に似ていますが、:rfc:`4648`で定義されているようにExtended " -"Hex Alphabetを使用します。" +":func:`b32decode` に似ていますが、 :rfc:`4648` で定義されているように" +"Extended Hex Alphabetを使用します。" #: ../../library/base64.rst:240 msgid "" diff --git a/library/functions.po b/library/functions.po index 8a62f6125..2e1a10c38 100644 --- a/library/functions.po +++ b/library/functions.po @@ -3925,8 +3925,8 @@ msgid "" ":class:`super` objects are now :mod:`pickleable ` and :mod:" "`copyable `." msgstr "" -":class:`super` オブジェクトは :term:`pickle 可能 ` かつ :term:`コピー" -"可能 ` になりました。" +":class:`super` オブジェクトは :mod:`pickle 可能 ` かつ :mod:`コピー可" +"能 ` になりました。" #: ../../library/functions.rst:2141 msgid "" diff --git a/library/hashlib.po b/library/hashlib.po index 6ef762047..acef7d13b 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -156,7 +156,7 @@ msgid "" "To obtain the digest of the byte string ``b\"Nobody inspects the spammish " "repetition\"``::" msgstr "" -"``b\"Nobody inspects the spammish repetition\"``というバイト文字列のダイジェ" +"``b\"Nobody inspects the spammish repetition\"`` というバイト文字列のダイジェ" "ストを取得するには次のようにします::" #: ../../library/hashlib.rst:110 diff --git a/library/inspect.po b/library/inspect.po index e07800db2..d2d6e80a5 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -1604,8 +1604,8 @@ msgstr "" #: ../../library/inspect.rst:924 msgid ":class:`!Signature` objects are now picklable and :term:`hashable`." msgstr "" -":class:`!Signature` オブジェクトは pickle 可能かつ :term:`ハッシュ可能` にな" -"りました。" +":class:`!Signature` オブジェクトは pickle 可能かつ :term:`ハッシュ可能 " +"` になりました。" #: ../../library/inspect.rst:929 msgid "A special class-level marker to specify absence of a return annotation." diff --git a/tutorial/appendix.po b/tutorial/appendix.po index e39102b52..55b2e9bc3 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -55,7 +55,7 @@ msgstr "" "無効にするには、 :ref:`using-on-controlling-color` を参照してください。 ファ" "ンクションキーはいくつかの追加機能を提供します。 :kbd:`F1` は、対話型ヘルプブ" "ラウザ :mod:`pydoc` に入ります。 :kbd:`F2` はコマンドライン履歴を、出力も :" -"term:`>>` や :term:`...` プロンプトも表示せずにブラウズできます。 :kbd:`F3` " +"term:`>>>` や :term:`...` プロンプトも表示せずにブラウズできます。 :kbd:`F3` " "は「ペーストモード」に入り、より大きなブロックコードの貼り付けが簡単になりま" "す。 :kbd:`F3` を押すと通常のプロンプトに戻ります。" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 237f83b7f..6d95b3486 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -76,6 +76,8 @@ msgid "" "Remove the first item from the list whose value is equal to *value*. It " "raises a :exc:`ValueError` if there is no such item." msgstr "" +"*value* と等しい値を持つ最初の要素をリストから削除します。該当する要素がなけ" +"れば :exc:`ValueError` を送出します。" #: ../../tutorial/datastructures.rst:49 msgid "" @@ -98,6 +100,8 @@ msgid "" "Return zero-based index of the first occurrence of *value* in the list. " "Raises a :exc:`ValueError` if there is no such item." msgstr "" +"リスト内で *value* が最初に現れる位置のインデックスを返します。インデックス" +"は 0 から数えます。該当する要素がなければ :exc:`ValueError` を送出します。" #: ../../tutorial/datastructures.rst:67 msgid "" @@ -112,7 +116,7 @@ msgstr "" #: ../../tutorial/datastructures.rst:76 msgid "Return the number of times *value* appears in the list." -msgstr "" +msgstr "*value* がリスト内に現れる回数を返します。" #: ../../tutorial/datastructures.rst:82 msgid "" @@ -219,11 +223,11 @@ msgid "" "an item from the top of the stack, use :meth:`~list.pop` without an explicit " "index. For example::" msgstr "" -"リスト型のメソッドのおかげで、簡単にリストをスタックとして使えます。スタック" -"では、最後に追加された要素が最初に取り出されます (\"last-in, first-out\")。ス" -"タックの一番上に要素を追加するには :meth:`~list.append` を使います。スタック" -"の一番上から要素を取り出すには :meth:`~list.pop` をインデックスを指定せずに使" -"います。例えば以下のようにします::" +"リストのメソッドを使えば、リストを簡単にスタックとして使えます。スタックは最" +"後に追加した要素を最初に取り出す「後入れ先出し」の仕組みです。スタックの一番" +"上に要素を追加するには :meth:`~list.append` を使います。一番上から要素を取り" +"出すには、インデックスを指定せずに :meth:`~list.pop` を使います。例えば次のよ" +"うにします::" #: ../../tutorial/datastructures.rst:144 msgid "" @@ -272,15 +276,20 @@ msgid "" "(because all of the other elements have to be shifted by one). See :ref:" "`time-complexity` for more information." msgstr "" +"リストは最初に追加した要素を最初に取り出す「先入れ先出し」のキューとしても使" +"えますが、この用途では効率がよくありません。リストの末尾での追加や取り出しは" +"高速ですが、先頭での挿入や取り出しには時間がかかります。他のすべての要素を1つ" +"ずつずらす必要があるためです。詳しくは :ref:`time-complexity` を参照してくだ" +"さい。" #: ../../tutorial/datastructures.rst:173 msgid "" "To implement a queue, use :class:`collections.deque` which was designed to " "have fast appends and pops from both ends. For example::" msgstr "" -"キューの実装には、 :class:`collections.deque` を使うと良いでしょう。このクラ" -"スは良く設計されていて、高速な追加(append)と取り出し(pop)を両端に対して実" -"現しています。例えば以下のようにします::" +"キューの実装には :class:`collections.deque` を使います。このクラスは両端で要" +"素を高速に追加・取り出しできるように設計されています。例えば次のように使いま" +"す::" #: ../../tutorial/datastructures.rst:176 msgid "" @@ -299,11 +308,11 @@ msgstr "" ">>> queue = deque([\"Eric\", \"John\", \"Michael\"])\n" ">>> queue.append(\"Terry\") # Terry が到着\n" ">>> queue.append(\"Graham\") # Graham が到着\n" -">>> queue.popleft() # 最初に到着した人が去って行った\n" +">>> queue.popleft() # 最初に到着した人が去る\n" "'Eric'\n" -">>> queue.popleft() # 2番目の人も去って行った\n" +">>> queue.popleft() # 2番目に到着した人が去る\n" "'John'\n" -">>> queue # キューに残っているものは到着順\n" +">>> queue # 残っている人を到着順に表示\n" "deque(['Michael', 'Terry', 'Graham'])" #: ../../tutorial/datastructures.rst:191 @@ -317,10 +326,9 @@ msgid "" "operations applied to each member of another sequence or iterable, or to " "create a subsequence of those elements that satisfy a certain condition." msgstr "" -"リスト内包表記はリストを生成する簡潔な手段を提供しています。主な利用場面は、" -"あるシーケンスや iterable (イテレート可能オブジェクト) のそれぞれの要素に対し" -"てある操作を行った結果を要素にしたリストを作ったり、ある条件を満たす要素だけ" -"からなる部分シーケンスを作成することです。" +"リスト内包表記を使うとリストを簡潔に作れます。シーケンスやイテラブルの各要素" +"に操作を適用した結果から新しいリストを作るときによく使います。また、特定の条" +"件を満たす要素だけを取り出して部分シーケンスを作ることもできます。" #: ../../tutorial/datastructures.rst:198 msgid "For example, assume we want to create a list of squares, like::" @@ -348,9 +356,9 @@ msgid "" "exists after the loop completes. We can calculate the list of squares " "without any side effects using::" msgstr "" -"これはループが終了した後にも存在する ``x`` という名前の変数を作る (または上書" -"きする) ことに注意してください。以下のようにして平方のリストをいかなる副作用" -"もなく計算することができます::" +"このコードは ``x`` という名前の変数を作るか、既存の変数を上書きします。この変" +"数がループ終了後も残ることに注意してください。次のように書けば、副作用なしで" +"平方のリストを計算できます::" #: ../../tutorial/datastructures.rst:211 msgid "squares = list(map(lambda x: x**2, range(10)))" @@ -377,12 +385,11 @@ msgid "" "which follow it. For example, this listcomp combines the elements of two " "lists if they are not equal::" msgstr "" -"リスト内包表記は、括弧の中の 式、 :keyword:`!for` 句、そして0個以上の :" -"keyword:`!for` か :keyword:`!if` 句で構成されます。\n" -"リスト内包表記の実行結果は、 :keyword:`!for` と :keyword:`!if` 句のコンテキス" -"ト中で式を評価した結果からなる新しいリストです。\n" -"例えば、次のリスト内包表記は2つのリストの要素から、違うもの同士をペアにしま" -"す。" +"リスト内包表記は、式とそれに続く :keyword:`!for` 句、さらに0個以上の :" +"keyword:`!for` 句または :keyword:`!if` 句を角括弧で囲んだものです。式に続く :" +"keyword:`!for` 句と :keyword:`!if` 句に従って式を評価し、その結果を要素とする" +"新しいリストを作ります。例えば次のリスト内包表記は、2つのリストから等しくない" +"要素同士を組み合わせてペアを作ります::" #: ../../tutorial/datastructures.rst:226 msgid "" @@ -421,16 +428,15 @@ msgid "" "Note how the order of the :keyword:`for` and :keyword:`if` statements is the " "same in both these snippets." msgstr "" -":keyword:`for` と :keyword:`if` 文が両方のコードで同じ順序になっていることに" -"注目してください。" +"どちらのコードでも :keyword:`for` 文と :keyword:`if` 文の順序が同じであること" +"に注目してください。" #: ../../tutorial/datastructures.rst:243 msgid "" "If the expression is a tuple (e.g. the ``(x, y)`` in the previous example), " "it must be parenthesized. ::" msgstr "" -"式がタプルの場合 (例: 上の例で式が ``(x, y)`` の場合) は、タプルに円括弧が必" -"要です。 ::" +"式がタプルの場合は前の例の ``(x, y)`` のように丸括弧で囲む必要があります。 ::" #: ../../tutorial/datastructures.rst:246 msgid "" @@ -463,29 +469,29 @@ msgid "" "[1, 2, 3, 4, 5, 6, 7, 8, 9]" msgstr "" ">>> vec = [-4, -2, 0, 2, 4]\n" -">>> # 値を2倍にした新しいリストを作成\n" +">>> # 値を2倍にした新しいリストを作る\n" ">>> [x*2 for x in vec]\n" "[-8, -4, 0, 4, 8]\n" -">>> # フィルターでリストから負の数値を除外\n" +">>> # リストから負の数を除く\n" ">>> [x for x in vec if x >= 0]\n" "[0, 2, 4]\n" -">>> # 全ての要素に関数を適用\n" +">>> # すべての要素に関数を適用する\n" ">>> [abs(x) for x in vec]\n" "[4, 2, 0, 2, 4]\n" -">>> # 各要素に対してメソッド呼び出し\n" +">>> # 各要素のメソッドを呼び出す\n" ">>> freshfruit = [' banana', ' loganberry ', 'passion fruit ']\n" ">>> [weapon.strip() for weapon in freshfruit]\n" "['banana', 'loganberry', 'passion fruit']\n" -">>> # (number, square) という2要素のタプルのリストを作成\n" +">>> # (number, square) のような2要素のタプルのリストを作る\n" ">>> [(x, x**2) for x in range(6)]\n" "[(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)]\n" -">>> # タプルは丸括弧で囲まないといけない、そうでなければエラーが発生する\n" +">>> # タプルを丸括弧で囲まないとエラーになる\n" ">>> [x, x**2 for x in range(6)]\n" " File \"\", line 1\n" " [x, x**2 for x in range(6)]\n" " ^^^^^^^\n" "SyntaxError: did you forget parentheses around the comprehension target?\n" -">>> # リスト内包表記で2つの 'for' を使って、リストをフラットにする\n" +">>> # 2つの 'for' を持つリスト内包表記でリストをフラットにする\n" ">>> vec = [[1,2,3], [4,5,6], [7,8,9]]\n" ">>> [num for elem in vec for num in elem]\n" "[1, 2, 3, 4, 5, 6, 7, 8, 9]" @@ -493,7 +499,7 @@ msgstr "" #: ../../tutorial/datastructures.rst:274 msgid "" "List comprehensions can contain complex expressions and nested functions::" -msgstr "リスト内包表記の式には、複雑な式や関数呼び出しのネストができます::" +msgstr "リスト内包表記では複雑な式や入れ子になった関数呼び出しも使えます::" #: ../../tutorial/datastructures.rst:276 msgid "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index ff361e521..bd8c7aa70 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -339,7 +339,7 @@ msgid "" "`generic classes ` and :ref:`functions `::" msgstr "" -":pep:`695` は :ref:`ジェネリッククラス ` と :ref:`関数 " +":pep:`695` は :ref:`ジェネリッククラス ` と :ref:`関数 " "` を作成するための、よりコンパクトで明示的な新しい方法を紹" "介します::" From 44db460bc2ec3f92a9dba424291f4cee67bcea8e Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 23 Oct 2026 13:26:02 +0000 Subject: [PATCH 07/21] Merge 3.15 into 3.14 --- tutorial/appetite.po | 120 ++++++++++----------- tutorial/index.po | 56 +++++----- tutorial/interpreter.po | 125 +++++++++++----------- tutorial/introduction.po | 225 ++++++++++++++++++--------------------- 4 files changed, 252 insertions(+), 274 deletions(-) diff --git a/tutorial/appetite.po b/tutorial/appetite.po index ef557d194..9ecda86eb 100644 --- a/tutorial/appetite.po +++ b/tutorial/appetite.po @@ -34,11 +34,11 @@ msgid "" "of photo files in a complicated way. Perhaps you'd like to write a small " "custom database, or a specialized GUI application, or a simple game." msgstr "" -"コンピュータを使っていろいろな作業をしていると、自動化したい作業が出てくるで" -"しょう。たとえば、たくさんのテキストファイルで検索-置換操作を行いたい、大量の" -"写真ファイルを込み入ったやりかたでファイル名を整理して変更したり、などです。" -"ちょっとした専用のデータベースや、何か専用のGUIアプリケーション、シンプルな" -"ゲームを作りたいかもしれません。" +"コンピュータでさまざまな作業をしていると、いずれ自動化したい作業が出てくるで" +"しょう。例えば、多数のテキストファイルをまとめて検索・置換したり、大量の写真" +"ファイルの名前や配置を複雑な手順で変更したりする作業です。用途に合わせた小さ" +"なデータベースや専用の GUI アプリケーション、簡単なゲームを作りたくなることも" +"あるでしょう。" #: ../../tutorial/appetite.rst:13 msgid "" @@ -49,15 +49,16 @@ msgid "" "written a program that could use an extension language, and you don't want " "to design and implement a whole new language for your application." msgstr "" -"あなたがプロのソフト開発者として、C/C++/Java ライブラリを扱う必要があるけど" -"も、通常の編集/コンパイル/テスト/再コンパイルのサイクルを遅すぎると感じている" -"かもしれません。上記ライブラリのためのテストを書くことにうんざりしているかも" -"しれません。または、拡張言語を持つアプリケーションを書いているなら、そのため" -"に新しい言語一式の設計と実装をしたくないでしょう。" +"ソフトウェア開発の仕事で複数の C/C++/Java ライブラリを使っていると、コードの" +"作成・コンパイル・テスト・再コンパイルという一連の作業に時間がかかりすぎると" +"感じるかもしれません。そうしたライブラリのテストスイートを書いていて、テスト" +"コードの作成が面倒だと感じることもあるでしょう。あるいは、作成したプログラム" +"に拡張言語を導入したくても、そのためだけにまったく新しい言語を設計・実装した" +"くはないかもしれません。" #: ../../tutorial/appetite.rst:20 msgid "Python is just the language for you." -msgstr "Pythonはそんなあなたのための言語です。" +msgstr "Python はそんなあなたにぴったりの言語です。" #: ../../tutorial/appetite.rst:22 msgid "" @@ -68,12 +69,12 @@ msgid "" "draft program. Python is simpler to use, available on Windows, macOS, and " "Unix operating systems, and will help you get the job done more quickly." msgstr "" -"そういった処理は、Unix シェルスクリプトや Windows バッチファイルで書くことも" -"できます。しかし、シェルスクリプトはファイル操作やテキストデータの操作には向" -"いていますが、GUIアプリケーションやゲームにはむいていません。C/C++/Java プロ" -"グラムを書くこともできますが、最初の試し書きだけでもかなりの時間がかかってし" -"まいます。Pythonはもっと簡単に利用でき、Windows、macOS、そして Unix オペレー" -"ティングシステムで動作し、あなたの仕事をすばやく片付ける助けになるでしょう。" +"こうした作業の一部は Unix シェルスクリプトや Windows バッチファイルで処理でき" +"ます。シェルスクリプトはファイルの移動やテキストデータの変更が得意です。しか" +"し、GUI アプリケーションやゲームにはあまり向いていません。C/C++/Java でプログ" +"ラムを書くこともできますが、最初の試作品を作るだけでもかなりの開発時間がかか" +"ることがあります。Python はもっと手軽に使え、Windows、macOS、Unix で動作しま" +"す。作業をより早く終える助けになるでしょう。" #: ../../tutorial/appetite.rst:29 msgid "" @@ -86,13 +87,13 @@ msgid "" "problem domain than Awk or even Perl, yet many things are at least as easy " "in Python as in those languages." msgstr "" -"Python は簡単に利用できますが、本物のプログラミング言語であり、シェルスクリプ" -"トやバッチファイルよりも多くの機構があり、大きなプログラムの開発にも適してい" -"ます。一方では、Python は C よりたくさんのエラーチェックを実行時に行ってお" -"り、また可変長配列や辞書などの高級な型を組込みで持つ *超高級言語(very-high-" -"level language)* です。Python は Awk や Perl などよりも汎用的なデータ型を備え" -"ており、より多くの領域で利用できます。また、Pythonはこれらの言語と比べても、" -"少なくとも同じぐらいには簡単です。" +"Python は手軽に使える一方で、本格的なプログラミング言語でもあります。シェルス" +"クリプトやバッチファイルに比べ、プログラムを構造化する仕組みや大規模なプログ" +"ラムの開発を支える機能が充実しています。また、C よりも多くのエラーチェックを" +"行います。*超高水準言語* である Python には、柔軟な配列や辞書といった高レベル" +"のデータ型が組み込まれています。汎用性の高いデータ型を備えているため、Awk や " +"Perl よりも幅広い問題に対応できます。それでいて、多くの処理はこれらの言語に劣" +"らず簡単に書けます。" #: ../../tutorial/appetite.rst:37 msgid "" @@ -103,12 +104,11 @@ msgid "" "file I/O, system calls, sockets, and even interfaces to graphical user " "interface toolkits like Tk." msgstr "" -"Python では、プログラムをモジュールに分割して、他の Python プログラムで再利用" -"できます。Python には膨大な標準モジュールが付属していて、プログラムを作る上で" -"の基盤として、あるいは Python プログラミングを学ぶためのサンプルとして利用で" -"きます。標準モジュールには、ファイル I/O、システムコール、ソケットといった機" -"能や、Tk のようなグラフィカルユーザインターフェースツールキットを使うためのイ" -"ンターフェイスなども提供しています。" +"Python ではプログラムをモジュールに分割し、他の Python プログラムで再利用でき" +"ます。豊富な標準モジュールも付属しており、プログラムを作る際の土台としても、" +"Python プログラミングを学び始める際の例としても利用できます。ファイル I/O、シ" +"ステムコール、ソケットなどの機能や、Tk のような GUI ツールキットへのインター" +"フェースを提供するモジュールもあります。" #: ../../tutorial/appetite.rst:44 msgid "" @@ -119,11 +119,10 @@ msgid "" "functions during bottom-up program development. It is also a handy desk " "calculator." msgstr "" -"Python はインタプリタ言語です。コンパイルやリンクの必要がないので、プログラム" -"を開発する際にかなりの時間を節約できます。インタプリタは対話的にも使えるの" -"で、言語の様々な機能について実験してみたり、書き捨てのプログラムを書いたり、" -"ボトムアップでプログラムを開発する際に、関数をテストしたりといったことが簡単" -"にできます。便利な電卓にもなります。" +"Python はインタープリタ言語です。コンパイルやリンクが不要なので、プログラム開" +"発の時間を大幅に節約できます。インタープリタは対話的にも使えるため、言語の機" +"能を試したり、書き捨てのプログラムを書いたり、ボトムアップでのプログラム開発" +"中に関数をテストしたりするのも簡単です。手軽な卓上電卓としても使えます。" #: ../../tutorial/appetite.rst:50 msgid "" @@ -131,23 +130,21 @@ msgid "" "written in Python are typically much shorter than equivalent C, C++, or " "Java programs, for several reasons:" msgstr "" -"Python では、とてもコンパクトで読みやすいプログラムを書けます。Python で書か" -"れたプログラムは大抵、同じ機能の C 言語, C++ 言語や Java のプログラムよりもは" -"るかに短くなります。これには以下のようないくつかの理由があります:" +"Python ではコンパクトで読みやすいプログラムを書けます。Python のプログラムは" +"通常、同じ処理を行う C/C++/Java のプログラムよりもずっと短くなります。その理" +"由は次のとおりです:" #: ../../tutorial/appetite.rst:54 msgid "" "the high-level data types allow you to express complex operations in a " "single statement;" -msgstr "高レベルのデータ型によって、複雑な操作を一つの実行文で表現できます。" +msgstr "高レベルのデータ型を使えば複雑な操作を1つの文で表現できます。" #: ../../tutorial/appetite.rst:57 msgid "" "statement grouping is done by indentation instead of beginning and ending " "brackets;" -msgstr "" -"実行文のグループ化を、グループの開始や終了の括弧ではなくインデントで行えま" -"す。" +msgstr "文は開始と終了を表す括弧ではなくインデントでまとめます。" #: ../../tutorial/appetite.rst:60 msgid "no variable or argument declarations are necessary." @@ -163,13 +160,13 @@ msgid "" "Python interpreter into an application written in C and use it as an " "extension or command language for that application." msgstr "" -"Python には *拡張性* があります: C 言語でプログラムを書く方法を知っているな" -"ら、簡単に新たな組み込み関数やモジュールを、簡単にインタプリタに追加できま" -"す。これによって、いちばん時間のかかる処理を高速化したり、ベンダ特有のグラ" -"フィクスライブラリなどの、 バイナリ形式でしか手に入らないライブラリを Python " -"にリンクしたりできます。その気になれば、Python インタプリタを C で書かれたア" -"プリケーションにリンクして、アプリケーションに対する拡張言語や命令言語として" -"も使えます。" +"Python には *拡張性* があります。C でプログラムを書く方法を知っていれば、新し" +"い組み込み関数やモジュールをインタープリタに簡単に追加できます。これにより、" +"重要な処理を最大限に高速化したり、ベンダー独自のグラフィックスライブラリのよ" +"うにバイナリ形式でしか提供されていないライブラリを Python プログラムにリンク" +"したりできます。Python にすっかり夢中になったら、C で書かれたアプリケーション" +"に Python インタープリタをリンクし、そのアプリケーションの拡張言語や命令言語" +"として使うこともできます。" #: ../../tutorial/appetite.rst:70 msgid "" @@ -177,10 +174,9 @@ msgid "" "Circus\" and has nothing to do with reptiles. Making references to Monty " "Python skits in documentation is not only allowed, it is encouraged!" msgstr "" -"ところで、この言語は BBC のショー番組、\"モンティパイソンの空飛ぶサーカス " -"(Monty Python's Flying Circus)\" から取ったもので、爬虫類とは関係ありません。" -"このドキュメントでは、モンティパイソンの寸劇への参照が許可されているだけでな" -"く、むしろ推奨されています!" +"ちなみに Python という名前は BBC の番組「Monty Python's Flying Circus」に由来" +"し、爬虫類とは関係ありません。ドキュメントでモンティ・パイソンの寸劇に触れる" +"ことは、許されているだけでなく推奨されています!" #: ../../tutorial/appetite.rst:74 msgid "" @@ -188,10 +184,9 @@ msgid "" "more detail. Since the best way to learn a language is to use it, the " "tutorial invites you to play with the Python interpreter as you read." msgstr "" -"さて、皆さんはもう Python にワクワクして、もうちょっと詳しく調べてみたくなっ" -"たはずです。プログラミング言語を習得する最良の方法は使ってみることですから、" -"このチュートリアルではみなさんが読んだ内容を Python インタプリタで試してみる" -"ことをおすすめします。" +"Python に興味が湧いてきて、もっと詳しく知りたくなったのではないでしょうか。言" +"語を学ぶには実際に使ってみるのが一番です。このチュートリアルを読みながら " +"Python インタープリタでいろいろ試してみてください。" #: ../../tutorial/appetite.rst:78 msgid "" @@ -199,8 +194,8 @@ msgid "" "This is rather mundane information, but essential for trying out the " "examples shown later." msgstr "" -"次の章では、まずインタプリタの使い方を説明します。これはわかりきった内容かも" -"しれませんが、後に説明する例題を試してみる上で不可欠なことです。" +"次の章ではインタープリタの使い方を説明します。地味な内容ですが、この先に出て" +"くる例を試すために欠かせません。" #: ../../tutorial/appetite.rst:82 msgid "" @@ -209,7 +204,6 @@ msgid "" "and data types, through functions and modules, and finally touching upon " "advanced concepts like exceptions and user-defined classes." msgstr "" -"チュートリアルの残りの部分では、Python プログラム言語と実行システムの様々な機" -"能を例題を交えて紹介します。単純な式、実行文、データ型から始めて、関数とモ" -"ジュールを経て、最後には例外処理やユーザ定義クラスといったやや高度な概念にも" -"触れます。" +"以降の章では Python 言語とシステムのさまざまな機能を例とともに紹介します。簡" +"単な式や文、データ型から始めて関数やモジュールへと進み、最後には例外やユー" +"ザー定義クラスといった高度な概念にも触れます。" diff --git a/tutorial/index.po b/tutorial/index.po index 86989ae6b..f2525d3ee 100644 --- a/tutorial/index.po +++ b/tutorial/index.po @@ -33,8 +33,8 @@ msgid "" "This tutorial is designed for *programmers* that are new to the Python " "language, **not** *beginners* who are new to programming." msgstr "" -"このチュートリアルはPython言語を初めて使う *プログラマー* 向けに設計されてお" -"り、プログラミングが初めての *初心者* 向け **ではありません** 。" +"このチュートリアルは Python を初めて学ぶ *プログラマー* 向けです。プログラミ" +"ングを初めて学ぶ *初心者* 向け **ではありません** 。" #: ../../tutorial/index.rst:11 msgid "" @@ -44,11 +44,11 @@ msgid "" "with its interpreted nature, make it an ideal language for scripting and " "rapid application development in many areas on most platforms." msgstr "" -"Python は強力で、学びやすいプログラミング言語です。効率的な高レベルデータ構造" -"と、シンプルで効果的なオブジェクト指向プログラミング機構を備えています。\n" -"Python は、洗練された文法・動的なデータ型付け・インタープリタであることなどか" -"ら、スクリプティングや高速アプリケーション開発(Rapid Application " -"Development: RAD)に理想的なプログラミング言語となっています。" +"Python は学びやすく強力なプログラミング言語です。効率的な高レベルのデータ構造" +"と、シンプルながら効果的なオブジェクト指向プログラミングの仕組みを備えていま" +"す。洗練された構文と動的型付けを持つインタープリタ言語でもあります。こうした" +"特徴から、ほとんどのプラットフォームで幅広い分野のスクリプト作成や迅速なアプ" +"リケーション開発に理想的な言語です。" #: ../../tutorial/index.rst:17 msgid "" @@ -58,10 +58,11 @@ msgid "" "site also contains distributions of and pointers to many free third party " "Python modules, programs and tools, and additional documentation." msgstr "" -"Python Web サイト(https://www.python.org) は、 Python インタープリタと標準ラ" -"イブラリのソースコードと、主要プラットフォームごとにコンパイル済みのバイナリ" -"ファイルを無料で配布しています。また、Python Web サイトには、無料のサードパー" -"ティモジュールやプログラム、ツール、ドキュメントなども紹介しています。" +"Python インタープリタと充実した標準ライブラリは、Python のウェブサイト " +"https://www.python.org/ から無料で入手できます。主要なすべてのプラットフォー" +"ム向けにソースコードまたはバイナリ形式で提供されており、自由に再配布できま" +"す。このサイトでは、無料で利用できる多くのサードパーティ製の Python モジュー" +"ル、プログラム、ツールの配布物やリンク、追加のドキュメントも公開しています。" #: ../../tutorial/index.rst:23 msgid "" @@ -69,9 +70,9 @@ msgid "" "implemented in C or C++ (or other languages callable from C). Python is also " "suitable as an extension language for customizable applications." msgstr "" -"Python インタプリタは、簡単に C/C++ 言語などで実装された関数やデータ型を組み" -"込み、拡張できます。また、アプリケーションのカスタマイズを行う、拡張言語とし" -"ても適しています。" +"C や C++ (または C から呼び出せる他の言語) で実装した新しい関数やデータ型を追" +"加して、Python インタープリタを簡単に拡張できます。Python はカスタマイズ可能" +"なアプリケーションの拡張言語にも適しています。" #: ../../tutorial/index.rst:27 msgid "" @@ -81,11 +82,10 @@ msgid "" "Python interpreter handy for hands-on experience, but all examples are self-" "contained, so the tutorial can be read off-line as well." msgstr "" -"このチュートリアルは、Python 言語の基本的な概念と機能を、形式ばらずに紹介しま" -"す。一般的なプログラミンの基礎知識があることを前提として書かれていることに注" -"意してください。読むだけではなく、Pythonインタープリタで実際にサンプルを実行" -"すると理解が深まりますが、サンプルはそれぞれ独立していますので、ただ読むだけ" -"でも良いでしょう。" +"このチュートリアルでは Python 言語とシステムの基本的な概念や機能を形式ばらず" +"に紹介します。一般的なプログラミングの基礎知識があることを前提としています。" +"実際に試せるように Python インタープリタを用意しておくと役立ちます。ただし、" +"例はそれぞれ単独で理解できるので、オフラインで読むこともできます。" #: ../../tutorial/index.rst:33 msgid "" @@ -95,6 +95,11 @@ msgid "" "`extending-index` and :ref:`c-api-index`. There are also several books " "covering Python in depth." msgstr "" +"標準のオブジェクトやモジュールの説明は :ref:`builtins-index` と :ref:" +"`library-index` を参照してください。 :ref:`reference-index` では言語をより厳" +"密に定義しています。C や C++ で拡張を書くには :ref:`extending-index` と :ref:" +"`c-api-index` を読んでください。Python を詳しく解説した書籍もいくつかありま" +"す。" #: ../../tutorial/index.rst:38 msgid "" @@ -105,13 +110,12 @@ msgid "" "write Python modules and programs, and you will be ready to learn more about " "the various Python library modules described in :ref:`library-index`." msgstr "" -"このチュートリアルは、Python全体を対象とした、包括的な解説書ではありません。" -"よく使われる機能に限っても、全ては紹介していません。その代わり、このチュート" -"リアルでは、Pythonのもっとも特徴的な機能を中心に紹介して、この言語の持ち味" -"や、スタイルを感じられるようにしています。このチュートリアルを読み終えると、" -"Python のモジュールやプログラムを読み書きできるようになっているでしょう。ま" -"た、:ref:`library-index` のさまざまな Python ライブラリモジュールを、詳しく調" -"べられるようになっているはずです。" +"このチュートリアルはすべての機能を網羅するものではなく、よく使われる機能に" +"限ってもすべてを扱うわけではありません。その代わりに Python の特に注目すべき" +"機能を数多く紹介し、言語の持ち味やスタイルをつかめるようにしています。読み終" +"えるころには Python のモジュールやプログラムを読み書きできるようになり、 :" +"ref:`library-index` で説明されているさまざまな Python ライブラリモジュールに" +"ついてさらに学ぶ準備も整うでしょう。" #: ../../tutorial/index.rst:45 msgid "The :ref:`glossary` is also worth going through." diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index a6b65cdd4..1fe544f74 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -53,10 +53,9 @@ msgid "" "local Python guru or system administrator. (E.g., :file:`/usr/local/python` " "is a popular alternative location.)" msgstr "" -"[#]_ インタープリタのインストール先ディレクトリはインストール時に選択できるの" -"で、別の場所にある場合もあります。身近な Python に詳しい人か、システム管理者" -"に確認してください。(例えば、 :file:`/usr/local/python` もよく使われる場所で" -"す。)" +"[#]_ インストール先ディレクトリはインストール時に選択できるため、インタープリ" +"タが別の場所にある場合もあります。身近な Python に詳しい人やシステム管理者に" +"確認してください。(例えば :file:`/usr/local/python` もよく使われる場所です。)" #: ../../tutorial/interpreter.rst:26 msgid "" @@ -82,8 +81,8 @@ msgid "" msgstr "" "ファイル終端文字 (Unix では :kbd:`Control-D` 、Windows では :kbd:`Control-" "Z`) を一次プロンプトに入力すると、インタープリタは終了ステータス 0 で終了しま" -"す。この操作で終了できない場合は、 ``quit()`` と入力してインタープリタを終了" -"できます。" +"す。この操作で終了できない場合は ``quit()`` と入力してインタープリタを終了で" +"きます。" #: ../../tutorial/interpreter.rst:36 msgid "" @@ -97,14 +96,14 @@ msgid "" "available; you'll only be able to use backspace to remove characters from " "the current line." msgstr "" -"ほとんどのシステムでは、インタープリタの行編集機能として、対話型の編集、履歴" -"置換、コード補完を利用できます。コマンドライン編集が使えるかどうかを確かめる" -"には、Python のプロンプトで単語を入力してから左矢印キー (または :kbd:" -"`Control-b`) を押すのがおそらく最も手軽な方法です。カーソルが動けば、コマンド" -"ライン編集が利用できます。キーの使い方については、付録の :ref:`tut-" -"interacting` を参照してください。何も起こらないか、 ``^[[D`` や ``^B`` のよう" -"な文字列が表示される場合は、コマンドライン編集を利用できません。その場合、現" -"在の行から文字を削除するにはバックスペースを使うしかありません。" +"ほとんどのシステムでは対話的な編集、履歴置換、コード補完をインタープリタの行" +"編集機能として利用できます。コマンドライン編集が使えるかどうかを確認するに" +"は、Python のプロンプトで単語を入力してから左矢印キー (または :kbd:`Control-" +"b`) を押すのがおそらく最も手軽です。カーソルが動けばコマンドライン編集を利用" +"できます。キーの使い方については付録の :ref:`tut-interacting` を参照してくだ" +"さい。何も起こらないか、 ``^[[D`` や ``^B`` のような文字列が表示される場合は" +"コマンドライン編集を利用できません。その場合、現在の行から文字を削除するには" +"バックスペースを使うしかありません。" #: ../../tutorial/interpreter.rst:46 msgid "" @@ -127,10 +126,10 @@ msgid "" "*command* in its entirety." msgstr "" "インタープリタを ``python -c command [arg] ...`` のように起動する方法もありま" -"す。この形式では、シェルの :option:`-c` オプションと同じように、 *command* に" -"指定した文を実行します。Python の文には空白や、シェルにとって特殊な意味を持つ" -"文字が含まれることが多いため、通常は *command* 全体を引用符で囲むことをお勧め" -"します。" +"す。シェルの :option:`-c` オプションと同じように、この形式では *command* に指" +"定した文を実行します。Python の文には空白やシェルにとって特殊な意味を持つ文字" +"が含まれることが多いため、通常は *command* 全体を引用符で囲むことをお勧めしま" +"す。" #: ../../tutorial/interpreter.rst:57 msgid "" @@ -138,9 +137,9 @@ msgid "" "``python -m module [arg] ...``, which executes the source file for *module* " "as if you had spelled out its full name on the command line." msgstr "" -"Python のモジュールには、スクリプトとしても便利に使えるものがあります。 " -"``python -m module [arg] ...`` のように起動すると、 *module* のソースファイル" -"を、フルパスを指定して起動したかのように実行できます。" +"Python のモジュールにはスクリプトとしても便利に使えるものがあります。 " +"``python -m module [arg] ...`` のように起動すると、コマンドラインでフルパスを" +"指定した場合と同じように *module* のソースファイルを実行できます。" #: ../../tutorial/interpreter.rst:61 msgid "" @@ -148,9 +147,8 @@ msgid "" "script and enter interactive mode afterwards. This can be done by passing :" "option:`-i` before the script." msgstr "" -"スクリプトファイルを使用する場合、スクリプトの実行が完了した後、そのまま対話" -"モードに入れると便利なことがあります。これには :option:`-i` をスクリプト名の" -"前に追加します。" +"スクリプトの実行後にそのまま対話モードに入れると便利なことがあります。これに" +"は :option:`-i` をスクリプトファイル名の前に指定します。" #: ../../tutorial/interpreter.rst:65 msgid "All command line options are described in :ref:`using-on-general`." @@ -176,19 +174,19 @@ msgid "" "interpreter's option processing but left in ``sys.argv`` for the command or " "module to handle." msgstr "" -"インタープリタにスクリプト名とその後に続く引数を渡すと、それらは文字列のリス" -"トに変換され、 ``sys`` モジュールの ``argv`` 変数に代入されます。 ``import " -"sys`` を実行すると、このリストにアクセスできます。\n" -"リストには少なくとも一つの要素があります。スクリプト名も引数も指定しない場" -"合、 ``sys.argv[0]`` は空文字列になります。\n" -"スクリプト名の代わりに ``'-'`` (標準入力を意味します) を指定すると、 ``sys." +"インタープリタに渡したスクリプト名とその後に続く引数は、文字列のリストに変換" +"されて ``sys`` モジュールの ``argv`` 変数に代入されます。 ``import sys`` を実" +"行するとこのリストにアクセスできます。\n" +"リストには少なくとも1つの要素があります。スクリプト名も引数も指定しない場合" +"は ``sys.argv[0]`` が空文字列になります。\n" +"スクリプト名の代わりに標準入力を意味する ``'-'`` を指定すると、 ``sys." "argv[0]`` は ``'-'`` になります。\n" -":option:`-c` *command* を使うと、 ``sys.argv[0]`` は ``'-c'`` になります。 :" -"option:`-m` *module* を使うと、 ``sys.argv[0]`` は見つかったモジュールのフル" -"パスになります。\n" +":option:`-c` *command* を使うと ``sys.argv[0]`` は ``'-c'`` になります。 :" +"option:`-m` *module* を使うと ``sys.argv[0]`` は見つかったモジュールのフルパ" +"スになります。\n" ":option:`-c` *command* や :option:`-m` *module* の後に指定したオプションは、" -"Python インタープリタのオプションとしては処理されず、コマンドやモジュールが処" -"理できるように ``sys.argv`` に残されます。" +"Python インタープリタのオプションとしては処理されません。コマンドやモジュール" +"が処理できるように ``sys.argv`` に残されます。" #: ../../tutorial/interpreter.rst:89 msgid "Interactive Mode" @@ -203,14 +201,14 @@ msgid "" "dots (``...``). The interpreter prints a welcome message stating its version " "number and a copyright notice before printing the first prompt:" msgstr "" -"インタープリタが端末 (tty) からコマンドを読み込んでいるとき、 *対話モード " +"端末 (tty) からコマンドを読み込んでいるとき、インタープリタは *対話モード " "(interactive mode)* で動作しているといいます。\n" -"このモードでは、 *一次プロンプト (primary prompt)* を表示して、次のコマンドの" -"入力を促します。一次プロンプトは通常、三つの大なり記号 (``>>>``) です。継続行" -"では *二次プロンプト (secondary prompt)* を表示します。二次プロンプトは、デ" -"フォルトでは三つのドット (``...``) です。\n" -"インタープリタは、最初のプロンプトを表示する前に、バージョン番号と著作権表示" -"を含む起動メッセージを出力します:" +"このモードでは *一次プロンプト (primary prompt)* を表示して次のコマンドの入力" +"を促します。一次プロンプトは通常、3つの大なり記号 (``>>>``) です。継続行では " +"*二次プロンプト (secondary prompt)* を表示します。二次プロンプトはデフォルト" +"で3つのドット (``...``) です。\n" +"最初のプロンプトを表示する前に、インタープリタはバージョン番号と著作権表示を" +"含む起動メッセージを出力します:" #: ../../tutorial/interpreter.rst:98 msgid "" @@ -233,8 +231,8 @@ msgid "" "Continuation lines are needed when entering a multi-line construct. As an " "example, take a look at this :keyword:`if` statement::" msgstr "" -"複数行にわたる構文を入力するには、継続行が必要です。例として、次の :keyword:" -"`if` 文を見てみましょう::" +"複数行にわたる構文を入力するには継続行が必要です。例として次の :keyword:`if` " +"文を見てみましょう::" #: ../../tutorial/interpreter.rst:111 msgid "" @@ -272,21 +270,21 @@ msgid "" "properly, your editor must recognize that the file is UTF-8, and it must use " "a font that supports all the characters in the file." msgstr "" -"デフォルトでは、Python のソースファイルは UTF-8 でエンコードされているものと" -"して扱われます。このエンコーディングでは、世界中のほとんどの言語の文字を、文" -"字列リテラル、識別子、コメントで同時に使えます。ただし、標準ライブラリでは識" -"別子に ASCII 文字だけを使っており、移植性を重視するコードもこの慣習に従うべき" -"です。これらの文字を全て正しく表示するには、エディタがファイルのエンコーディ" -"ングを UTF-8 と認識し、ファイル内の全ての文字に対応したフォントを使う必要があ" -"ります。" +"デフォルトでは Python のソースファイルは UTF-8 でエンコードされているものとし" +"て扱われます。このエンコーディングでは、文字列リテラル、識別子、コメントに世" +"界中のほとんどの言語の文字を同時に使えます。ただし、標準ライブラリの識別子に" +"使われるのは ASCII 文字だけです。移植性が必要なコードもこの慣習に従うべきで" +"す。これらの文字をすべて正しく表示するには、エディタがファイルのエンコーディ" +"ングを UTF-8 と認識し、ファイル内のすべての文字に対応したフォントを使う必要が" +"あります。" #: ../../tutorial/interpreter.rst:140 msgid "" "To declare an encoding other than the default one, a special comment line " "should be added as the *first* line of the file. The syntax is as follows::" msgstr "" -"デフォルト以外のエンコーディングを宣言するには、ファイルの *先頭* の行に特別" -"なコメントを追加します。書式は次の通りです::" +"デフォルト以外のエンコーディングを宣言するには、ファイルの *先頭* 行に特別な" +"コメントを追加します。書式は次のとおりです::" #: ../../tutorial/interpreter.rst:143 msgid "# -*- coding: encoding -*-" @@ -295,16 +293,16 @@ msgstr "# -*- coding: encoding -*-" #: ../../tutorial/interpreter.rst:145 msgid "where *encoding* is one of the valid :mod:`codecs` supported by Python." msgstr "" -"*encoding* には、Python が :mod:`codecs` でサポートしている有効なエンコーディ" -"ングを指定します。" +"*encoding* には Python が :mod:`codecs` でサポートする有効なエンコーディング" +"を指定します。" #: ../../tutorial/interpreter.rst:147 msgid "" "For example, to declare that Windows-1252 encoding is to be used, the first " "line of your source code file should be::" msgstr "" -"例えば、Windows-1252 エンコーディングを使用するには、ソースコードファイルの先" -"頭行は下記のようにします::" +"例えば Windows-1252 エンコーディングを使うことを宣言するには、ソースコード" +"ファイルの先頭行を次のようにします::" #: ../../tutorial/interpreter.rst:150 msgid "# -*- coding: cp1252 -*-" @@ -316,10 +314,9 @@ msgid "" "a :ref:`UNIX \"shebang\" line `. In this case, the encoding " "declaration should be added as the second line of the file. For example::" msgstr "" -"ソースコードが :ref:`UNIX \"shebang\" 行 ` で始まる場合には、*先" -"頭行* のルールは当てはまりません。\n" -"この場合には、エンコーディングの宣言はファイルの2行目に追加します。\n" -"例えば以下のようになります::" +"ソースコードが :ref:`UNIX \"shebang\" 行 ` で始まる場合は、*先頭" +"行* に宣言するというルールの例外です。この場合はファイルの2行目にエンコーディ" +"ングの宣言を追加します。例えば次のようにします::" #: ../../tutorial/interpreter.rst:156 msgid "" @@ -339,6 +336,6 @@ msgid "" "executable named ``python``, so that it does not conflict with a " "simultaneously installed Python 2.x executable." msgstr "" -"Unix では、Python 3.x インタープリタの実行ファイルはデフォルトでは " -"``python`` という名前ではインストールされません。同時にインストールされた " -"Python 2.x 実行ファイルと衝突させないためです。" +"同時にインストールされた Python 2.x の実行ファイルとの衝突を避けるため、Unix " +"では Python 3.x インタープリタの実行ファイルはデフォルトで ``python`` 以外の" +"名前でインストールされます。" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 59c4cd5ee..12d3b911b 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -36,16 +36,11 @@ msgid "" "that a secondary prompt on a line by itself in an example means you must " "type a blank line; this is used to end a multi-line command." msgstr "" -"以下のサンプルでは、入力と出力はプロンプト (:term:`>>>` や :term:`...`) の有" -"無で区別します: 例を実際に試す場合は、プロンプトが表示されているときに、サン" -"プル中のプロンプトから後ろの内容全てを入力します。 \n" -"\n" -"プロンプトが先頭にない行は、インタプリタからの出力です。サンプル中には二次プ" -"ロンプト (:term:`...`) だけが表示されている行がありますが、これは空行を入力し" -"なければならないことを意味しています\n" -"\n" -" 空行の入力は、複数の行からなる命令の終わりを、インタプリタに教えるために使わ" -"れます。" +"以下の例ではプロンプト (:term:`>>>` と :term:`...`) の有無で入力と出力を区別" +"します。例を試すには、プロンプトが表示されているときに例のプロンプトより後ろ" +"の内容をすべて入力してください。プロンプトで始まらない行はインタープリタの出" +"力です。例の中で二次プロンプトだけがある行は、空行を入力することを意味しま" +"す。この空行で複数行にわたるコマンドの入力を終えます。" #: ../../tutorial/introduction.rst:16 msgid "" @@ -53,9 +48,9 @@ msgid "" "hovering over or tapping a code example), which strips prompts and omits " "output, to copy and paste the input lines into your interpreter." msgstr "" -"\"Copy\" ボタン(コード例にマウスオーバーまたはタップすると右上に表示されます)" -"を使用すると、プロンプトと出力を取り除いてコピーされ、インタープリターに入力" -"行をコピー&ペーストできます。" +"コード例にマウスポインタを重ねるかタップすると、右上に「Copy」ボタンが表示さ" +"れます。このボタンを使うとプロンプトと出力を除いた入力行だけをコピーし、イン" +"タープリタに貼り付けられます。" #: ../../tutorial/introduction.rst:22 msgid "" @@ -67,13 +62,12 @@ msgid "" "Since comments are to clarify code and are not interpreted by Python, they " "may be omitted when typing in examples." msgstr "" -"このマニュアルにあるサンプルの多くは、対話プロンプトで入力されるものでもコメ" -"ントを含んでいます。 Python におけるコメント文は、ハッシュ文字 ``#`` で始ま" -"り、物理行の終わりまで続きます。コメントは行の先頭にも、空白やコードの後にも" -"書くことができますが、文字列リテラルの内部に置くことはできません。文字列リテ" -"ラル中のハッシュ文字はただのハッシュ文字です。コメントはコードを明快にするた" -"めのものであり、Pythonはコメントを解釈しません。なので、サンプルコードを実際" -"に入力して試して見るときは、コメントを省いても大丈夫です。" +"対話プロンプトで入力する例も含め、このマニュアルの多くの例にはコメントが付い" +"ています。Python のコメントはハッシュ文字 ``#`` で始まり、物理行の末尾まで続" +"きます。コメントは行の先頭や空白・コードの後に書けますが、文字列リテラルの中" +"には書けません。文字列リテラル内のハッシュ文字は単なるハッシュ文字です。コメ" +"ントはコードをわかりやすくするためのもので、Python は解釈しません。そのため、" +"例を入力するときには省略できます。" #: ../../tutorial/introduction.rst:30 msgid "Some examples::" @@ -100,9 +94,8 @@ msgid "" "Let's try some simple Python commands. Start the interpreter and wait for " "the primary prompt, ``>>>``. (It shouldn't take long.)" msgstr "" -"それでは、簡単な Python コマンドをいくつか試してみましょう。インタプリタを起" -"動して、一次プロンプト、 ``>>>`` が現れるのを待ちます。 (そう長くはかからない" -"はずです)" +"簡単な Python コマンドをいくつか試してみましょう。インタープリタを起動し、一" +"次プロンプト ``>>>`` が表示されるのを待ちます。(すぐに表示されるはずです。)" #: ../../tutorial/introduction.rst:50 msgid "Numbers" @@ -115,11 +108,9 @@ msgid "" "operators ``+``, ``-``, ``*`` and ``/`` can be used to perform arithmetic; " "parentheses (``()``) can be used for grouping. For example::" msgstr "" -"インタプリタは、簡単な電卓のように動作します: 式を入力すると、その結果が表示" -"されます。\n" -"式の文法は素直なものです: 演算子 ``+`` 、 ``-`` 、 ``*`` 、 ``/`` によって算" -"術演算を行うことができ、丸括弧 (``()``) をグループ化に使うことができます。\n" -"例えば::" +"インタープリタは簡単な電卓のように動作し、式を入力するとその値を表示します。" +"式の構文は単純です。演算子 ``+`` 、 ``-`` 、 ``*`` 、 ``/`` で算術演算を行" +"い、丸括弧 (``()``) で式をまとめられます。例えば次のように使います::" #: ../../tutorial/introduction.rst:58 msgid "" @@ -138,7 +129,7 @@ msgstr "" "20\n" ">>> (50 - 5*6) / 4\n" "5.0\n" -">>> 8 / 5 # 除算は常に浮動小数点数(float)を返す\n" +">>> 8 / 5 # 除算は常に浮動小数点数を返す\n" "1.6" #: ../../tutorial/introduction.rst:67 @@ -147,9 +138,9 @@ msgid "" "ones with a fractional part (e.g. ``5.0``, ``1.6``) have type :class:" "`float`. We will see more about numeric types later in the tutorial." msgstr "" -"整数 (例えば、 ``2`` 、 ``4`` 、 ``20``) は :class:`int` 型であり、小数部を持" -"つ数 (例えば、 ``5.0`` 、 ``1.6``) は :class:`float` 型です。数値型については" -"後のチュートリアルでさらに見ていきます。" +"整数 (例えば ``2`` 、 ``4`` 、 ``20``) は :class:`int` 型で、小数部を持つ数 " +"(例えば ``5.0`` 、 ``1.6``) は :class:`float` 型です。数値型についてはこの" +"チュートリアルの後の節で詳しく説明します。" #: ../../tutorial/introduction.rst:71 msgid "" @@ -157,8 +148,9 @@ msgid "" "get an integer result you can use the ``//`` operator; to calculate the " "remainder you can use ``%``::" msgstr "" -"除算 (``/``) は常に浮動小数点数を返します。 ``//`` 演算子は :term:`整数除算 " -"` を行い、整数値を返します; 剰余は、``%`` で求めます。::" +"除算 (``/``) は常に浮動小数点数を返します。 :term:`切り捨て除算 ` で整数の結果を得るには ``//`` 演算子を使います。剰余は ``%`` で求" +"められます::" #: ../../tutorial/introduction.rst:75 msgid "" @@ -175,7 +167,7 @@ msgstr "" ">>> 17 / 3 # 除算は浮動小数点数を返す\n" "5.666666666666667\n" ">>>\n" -">>> 17 // 3 # 整数除算は小数部を破棄する\n" +">>> 17 // 3 # 切り捨て除算は小数部を切り捨てる\n" "5\n" ">>> 17 % 3 # % 演算子は剰余を返す\n" "2\n" @@ -186,7 +178,7 @@ msgstr "" msgid "" "With Python, it is possible to use the ``**`` operator to calculate powers " "[#]_::" -msgstr "Python では、冪乗を計算するのに ``**`` 演算子が使えます [#]_::" +msgstr "Python では ``**`` 演算子で冪乗を計算できます [#]_::" #: ../../tutorial/introduction.rst:87 msgid "" @@ -205,8 +197,8 @@ msgid "" "The equal sign (``=``) is used to assign a value to a variable. Afterwards, " "no result is displayed before the next interactive prompt::" msgstr "" -"等号 (``=``) は変数に値を代入するときに使います。代入を行っても、結果は出力さ" -"れず、次の入力プロンプトが表示されます。::" +"等号 (``=``) は変数に値を代入するときに使います。代入後は結果を表示せずに次の" +"対話プロンプトに進みます::" #: ../../tutorial/introduction.rst:95 msgid "" @@ -225,8 +217,8 @@ msgid "" "If a variable is not \"defined\" (assigned a value), trying to use it will " "give you an error::" msgstr "" -"変数が \"定義\" されていない (つまり値が代入されていない) 場合、その変数を使" -"おうとするとエラーが発生します::" +"「定義」されていない (値が代入されていない) 変数を使おうとするとエラーになり" +"ます::" #: ../../tutorial/introduction.rst:103 msgid "" @@ -245,8 +237,8 @@ msgid "" "There is full support for floating point; operators with mixed type operands " "convert the integer operand to floating point::" msgstr "" -"浮動小数点を完全にサポートしています。演算対象の値(オペランド)に複数の型が入" -"り混じっている場合、演算子は整数のオペランドを浮動小数点型に変換します::" +"浮動小数点数も全面的にサポートしています。整数と浮動小数点数が混在する演算で" +"は、演算子が整数のオペランドを浮動小数点数に変換します::" #: ../../tutorial/introduction.rst:111 msgid "" @@ -262,9 +254,9 @@ msgid "" "``_``. This means that when you are using Python as a desk calculator, it " "is somewhat easier to continue calculations, for example::" msgstr "" -"対話モードでは、最後に表示された結果は変数 ``_`` に代入されます。このことを利" -"用すると、Python を電卓として使うときに、計算を連続して行う作業が多少楽になり" -"ます。以下に例を示します::" +"対話モードでは最後に表示された式の値が変数 ``_`` に代入されます。この変数を使" +"うと、Python を電卓として使うときに続きの計算が少し楽になります。例えば次のよ" +"うに使います::" #: ../../tutorial/introduction.rst:118 msgid "" @@ -292,9 +284,9 @@ msgid "" "assign a value to it --- you would create an independent local variable with " "the same name masking the built-in variable with its magic behavior." msgstr "" -"この変数には読取りだけを行い、明示的な代入を行ってはいけません --- そんなこと" -"をすれば、同じ名前で別のローカル変数が生成され、元の特別な動作をする組み込み" -"変数を覆い隠してしておかしなことになってしまうかもしれません。" +"この変数は読み取り専用として扱い、明示的に値を代入しないでください。代入する" +"と同じ名前の別のローカル変数が作られ、特別な動作をする組み込み変数が隠されて" +"しまいます。" #: ../../tutorial/introduction.rst:131 msgid "" @@ -304,10 +296,10 @@ msgid "" "`, and uses the ``j`` or ``J`` suffix to indicate the " "imaginary part (e.g. ``3+5j``)." msgstr "" -":class:`int` と :class:`float` に加え、 Python は :class:`~decimal.Decimal` " -"や :class:`~fractions.Fraction` などの他の数値型もサポートしています。 :ref:`" -"複素数 ` も組み込み型としてサポートしており、 ``j`` もしくは " -"``J`` 接尾辞を使って虚部を示します (例: ``3+5j``)。" +"Python は :class:`int` と :class:`float` のほかに、 :class:`~decimal." +"Decimal` や :class:`~fractions.Fraction` などの数値型もサポートしています。 :" +"ref:`複素数 ` も組み込みでサポートしており、接尾辞 ``j`` また" +"は ``J`` で虚部を表します (例: ``3+5j``)。" #: ../../tutorial/introduction.rst:141 msgid "Text" @@ -321,12 +313,12 @@ msgid "" "\"``Yay! :)``\". They can be enclosed in single quotes (``'...'``) or double " "quotes (``\"...\"``) with the same result [#]_." msgstr "" -"Python は数値だけでなくテキスト (いわゆる「文字列」である :class:`str` 型に" -"よって表現されます) を扱うことができます。\n" -"``!`` のような文字や ``rabbit`` のような単語、 ``Paris`` のような名前、 " -"``Got your back.`` ような文もすべて文字列です。\n" -"文字列はシングルクォート (``'...'``) またはダブルクォート (``\"...\"``) で囲" -"み、どちらを使っても違いはありません [#]_ 。" +"Python は数値だけでなくテキストも扱えます。テキストは :class:`str` 型で表さ" +"れ、一般に「文字列」と呼ばれます。 \"``!``\" のような文字、 \"``rabbit``\" の" +"ような単語、 \"``Paris``\" のような名前、 \"``Got your back.``\" や " +"\"``Yay! :)``\" のような文や表現などです。文字列はシングルクォート " +"(``'...'``) またはダブルクォート (``\"...\"``) で囲み、どちらを使っても同じ結" +"果になります [#]_ 。" #: ../../tutorial/introduction.rst:149 msgid "" @@ -349,10 +341,8 @@ msgid "" "To quote a quote, we need to \"escape\" it, by preceding it with ``\\``. " "Alternatively, we can use the other type of quotation marks::" msgstr "" -"クォートの中でクォートを使いたい場合、 ``\\`` を前に付け加えることで「エス" -"ケープ」をする必要があります。\n" -"もしくは、文字列で使用したいクォートとは別の方のクォートで囲むこともできま" -"す。" +"文字列を囲むクォートと同じクォートを文字列の中に書くには、直前に ``\\`` を付" +"けて「エスケープ」します。別の種類のクォートで文字列を囲む方法もあります::" #: ../../tutorial/introduction.rst:161 msgid "" @@ -385,10 +375,9 @@ msgid "" "omitting the enclosing quotes and by printing escaped and special " "characters::" msgstr "" -"Python シェルでは、文字列を定義するときと文字列が出力されるときでは見え方が異" -"なることがあります。\n" -":func:`print` 関数を使うと、両端のクォートがなくなり、エスケープされた文字や" -"特殊文字が表示されるため、より読みやすい形で出力できます。" +"Python シェルでは文字列を定義するときと出力するときで見た目が異なることがあり" +"ます。 :func:`print` 関数は文字列を囲むクォートを省き、エスケープされた文字や" +"特殊文字を表示して読みやすく出力します::" #: ../../tutorial/introduction.rst:176 msgid "" @@ -413,8 +402,8 @@ msgid "" "characters, you can use *raw strings* by adding an ``r`` before the first " "quote::" msgstr "" -"``\\`` に続く文字を特殊文字として解釈されたくない場合は、最初の引用符の前に " -"``r`` を付けた *raw strings* が使えます::" +"``\\`` に続く文字を特殊文字として解釈させたくない場合は、最初のクォートの前" +"に ``r`` を付けて *raw string* (生の文字列) にできます::" #: ../../tutorial/introduction.rst:187 msgid "" @@ -424,6 +413,11 @@ msgid "" ">>> print(r'C:\\this\\name') # note the r before the quote\n" "C:\\this\\name" msgstr "" +">>> print('C:\\this\\name') # ここでは \\t はタブ、\\n は改行を表す\n" +"C: his\n" +"ame\n" +">>> print(r'C:\\this\\name') # クォートの前の r に注目\n" +"C:\\this\\name" #: ../../tutorial/introduction.rst:193 msgid "" @@ -431,9 +425,9 @@ msgid "" "odd number of ``\\`` characters; see :ref:`the FAQ entry ` for more information and workarounds." msgstr "" -"raw文字列には微妙な面があります: raw文字列は奇数個の``\\`` 文字では終了できま" -"せん。詳細と解決方法については :ref:`the FAQ entry ` を参照してください。 " +"raw string には注意点が1つあります。末尾に奇数個の ``\\`` を連続して置くこと" +"はできません。詳しい説明と回避方法は :ref:`FAQ の該当項目 ` を参照してください。" #: ../../tutorial/introduction.rst:198 msgid "" @@ -443,10 +437,10 @@ msgid "" "adding a ``\\`` at the end of the line. In the following example, the " "initial newline is not included::" msgstr "" -"文字列リテラルは複数行にまたがって書けます。1 つの方法は三連引用符 " +"文字列リテラルは複数行にまたがって書けます。1つの方法は三重引用符 " "(``\"\"\"...\"\"\"`` や ``'''...'''``) を使うことです。改行文字は自動的に文字" -"列に含まれますが、行末に ``\\`` を付けることで含めないようにすることもできま" -"す。次の例では最初の改行は含まれません::" +"列に含まれますが、行末に ``\\`` を付けると改行文字を含めずに済みます。次の例" +"では最初の改行は含まれません::" #: ../../tutorial/introduction.rst:204 msgid "" @@ -476,9 +470,7 @@ msgstr "" msgid "" "Strings can be concatenated (glued together) with the ``+`` operator, and " "repeated with ``*``::" -msgstr "" -"文字列は ``+`` 演算子で連結させる (くっつけて一つにする) ことができ、``*`` 演" -"算子で反復させることができます::" +msgstr "文字列は ``+`` 演算子で連結し、 ``*`` 演算子で繰り返せます::" #: ../../tutorial/introduction.rst:218 msgid "" @@ -495,8 +487,8 @@ msgid "" "Two or more *string literals* (i.e. the ones enclosed between quotes) next " "to each other are automatically concatenated. ::" msgstr "" -"連続して並んでいる複数の *文字列リテラル* (つまり、引用符に囲われた文字列) " -"は、自動的に連結されます。 ::" +"2つ以上の *文字列リテラル* (クォートで囲んだもの) を隣り合わせに書くと、自動" +"的に連結されます::" #: ../../tutorial/introduction.rst:225 msgid "" @@ -509,7 +501,7 @@ msgstr "" #: ../../tutorial/introduction.rst:228 msgid "" "This feature is particularly useful when you want to break long strings::" -msgstr "この機能は、長い文字列を改行したいときにとても役に立ちます::" +msgstr "この機能は長い文字列を複数行に分けて書きたいときに特に便利です::" #: ../../tutorial/introduction.rst:230 msgid "" @@ -526,7 +518,9 @@ msgstr "" #: ../../tutorial/introduction.rst:235 msgid "" "This only works with two literals though, not with variables or expressions::" -msgstr "これは 2 つのリテラルどうしに対してのみ働き、変数や式には働きません::" +msgstr "" +"ただし、このように連結できるのは2つのリテラルどうしだけです。変数や式には使え" +"ません::" #: ../../tutorial/introduction.rst:237 msgid "" @@ -557,7 +551,7 @@ msgstr "" #: ../../tutorial/introduction.rst:249 msgid "" "If you want to concatenate variables or a variable and a literal, use ``+``::" -msgstr "変数どうしや変数とリテラルを連結したい場合は、``+`` を使ってください::" +msgstr "変数どうしや変数とリテラルを連結するには ``+`` を使います::" #: ../../tutorial/introduction.rst:251 msgid "" @@ -573,9 +567,8 @@ msgid "" "index 0. There is no separate character type; a character is simply a string " "of size one::" msgstr "" -"文字列は *インデックス* (添字) を指定して文字を取得できます。最初の文字のイン" -"デックスは 0 になります。文字を表す、専用のデータ型は用意されていません; 文字" -"とは、単に長さが 1 の文字列です::" +"文字列では *インデックス* (添字) を指定して文字を取得できます。最初の文字のイ" +"ンデックスは 0 です。文字専用の型はなく、1文字も長さ1の文字列として扱います::" #: ../../tutorial/introduction.rst:258 msgid "" @@ -594,8 +587,7 @@ msgstr "" #: ../../tutorial/introduction.rst:264 msgid "" "Indices may also be negative numbers, to start counting from the right::" -msgstr "" -"インデックスには、負の値も指定できまます。この場合、右から数えていきます::" +msgstr "インデックスに負の数を指定すると、右から数えて文字を取得できます::" #: ../../tutorial/introduction.rst:266 msgid "" @@ -623,9 +615,8 @@ msgid "" "used to obtain individual characters, *slicing* allows you to obtain a " "substring::" msgstr "" -"インデクス表記に加え、 *スライス* もサポートされています。インデクス表記は" -"個々の文字を取得するのに使いますが、 *スライス* を使うと部分文字列を取得する" -"ことができます::" +"インデックス指定に加えて *スライス* も使えます。インデックス指定では個々の文" +"字を取得し、 *スライス* では部分文字列を取得できます::" #: ../../tutorial/introduction.rst:278 msgid "" @@ -644,9 +635,8 @@ msgid "" "Slice indices have useful defaults; an omitted first index defaults to zero, " "an omitted second index defaults to the size of the string being sliced. ::" msgstr "" -"スライスのインデックスには、便利なデフォルト値があります; 最初のインデックス" -"を省略すると、0 と見なされます。二番め のインデックスを省略すると、スライスす" -"る文字列のサイズとみなされます。 ::" +"スライスのインデックスには便利なデフォルト値があります。最初のインデックスを" +"省略すると 0 になり、2つ目を省略すると対象の文字列の長さになります::" #: ../../tutorial/introduction.rst:286 msgid "" @@ -669,8 +659,8 @@ msgid "" "Note how the start is always included, and the end always excluded. This " "makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" msgstr "" -"開始値は常に含まれ、終了値は常に含まれないことに注意してください。なので " -"``s[:i] + s[i:]`` は常に ``s`` と等しくなります::" +"開始位置の文字は常に含まれ、終了位置の文字は常に含まれません。このため ``s[:" +"i] + s[i:]`` は常に ``s`` と等しくなります::" #: ../../tutorial/introduction.rst:296 msgid "" @@ -691,10 +681,9 @@ msgid "" "Then the right edge of the last character of a string of *n* characters has " "index *n*, for example::" msgstr "" -"スライスの使い方をおぼえる良い方法は、インデックスが文字と文字の *あいだ " -"(between)* を指しており、最初の文字の左端が 0 になっていると考えることです。" -"そうすると、 *n* 文字からなる文字列中の最後の文字の右端はインデックス *n* と" -"なります。例えばこうです::" +"スライスの仕組みを覚えるには、インデックスが文字と文字の *間* を指し、最初の" +"文字の左端を 0 と考えるとよいでしょう。すると、長さ *n* の文字列では最後の文" +"字の右端のインデックスが *n* になります。例えば次のようになります::" #: ../../tutorial/introduction.rst:306 msgid "" @@ -717,9 +706,9 @@ msgid "" "from *i* to *j* consists of all characters between the edges labeled *i* and " "*j*, respectively." msgstr "" -"1行目の数字は文字列の 0 から 6 までのインデックスの位置を示しています; 2行目" -"は対応する負のインデックスを示しています。*i* から *j* までのスライスは、それ" -"ぞれ *i* と付いた境界から *j* と付いた境界までの全ての文字から成っています。" +"数字の1行目は文字列内のインデックス 0 から 6 の位置を示し、2行目は対応する負" +"のインデックスを示しています。*i* から *j* までのスライスには、*i* と *j* の" +"印を付けた境界の間にあるすべての文字が含まれます。" #: ../../tutorial/introduction.rst:317 msgid "" @@ -727,9 +716,8 @@ msgid "" "indices, if both are within bounds. For example, the length of " "``word[1:3]`` is 2." msgstr "" -"正のインデックスの場合、スライスされたシーケンスの長さは、スライスの両端のイ" -"ンデックスが範囲内にあるかぎり、インデックス間の差になります。例えば、 " -"``word[1:3]`` の長さは 2 になります。" +"両端のインデックスが非負で文字列の範囲内にある場合、スライスの長さは2つのイン" +"デックスの差になります。例えば ``word[1:3]`` の長さは 2 です。" #: ../../tutorial/introduction.rst:321 msgid "Attempting to use an index that is too large will result in an error::" @@ -742,7 +730,7 @@ msgid "" " File \"\", line 1, in \n" "IndexError: string index out of range" msgstr "" -">>> word[42] # the word only has 6 characters\n" +">>> word[42] # 文字列は6文字しかない\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "IndexError: string index out of range" @@ -751,9 +739,7 @@ msgstr "" msgid "" "However, out of range slice indexes are handled gracefully when used for " "slicing::" -msgstr "" -"しかし、スライスで範囲外のインデックスを使ったときは、上手く対応して扱ってく" -"れます::" +msgstr "一方、スライスではインデックスが範囲外でもエラーになりません::" #: ../../tutorial/introduction.rst:331 msgid "" @@ -772,8 +758,8 @@ msgid "" "Python strings cannot be changed --- they are :term:`immutable`. Therefore, " "assigning to an indexed position in the string results in an error::" msgstr "" -"Python の文字列は変更できません -- つまり :term:`不変 ` です。従っ" -"て、文字列のインデックスで指定したある場所に代入を行うとエラーが発生します::" +"Python の文字列は :term:`不変 ` で、内容を変更できません。そのた" +"め、文字列のインデックスで指定した位置に代入するとエラーになります::" #: ../../tutorial/introduction.rst:339 msgid "" @@ -797,7 +783,7 @@ msgstr "" #: ../../tutorial/introduction.rst:348 msgid "If you need a different string, you should create a new one::" -msgstr "元の文字列と別の文字列が必要な場合は、新しく文字列を作成してください::" +msgstr "別の文字列が必要な場合は新しく作成します::" #: ../../tutorial/introduction.rst:350 msgid "" @@ -813,7 +799,7 @@ msgstr "" #: ../../tutorial/introduction.rst:355 msgid "The built-in function :func:`len` returns the length of a string::" -msgstr "組込み関数 :func:`len` は文字列の長さ (length) を返します::" +msgstr "組み込み関数 :func:`len` は文字列の長さを返します::" #: ../../tutorial/introduction.rst:357 msgid "" @@ -834,8 +820,7 @@ msgid "" "Strings are examples of *sequence types*, and support the common operations " "supported by such types." msgstr "" -"文字列は代表的な *シーケンス型* で、シーケンス型でサポートされている共通の操" -"作をサポートしています。" +"文字列は *シーケンス型* の一種で、シーケンス型に共通する操作を使えます。" #: ../../tutorial/introduction.rst:368 msgid ":ref:`string-methods`" @@ -845,9 +830,7 @@ msgstr ":ref:`string-methods`" msgid "" "Strings support a large number of methods for basic transformations and " "searching." -msgstr "" -"文字列は、基本的な変換や検索を行うための数多くのメソッドをサポートしていま" -"す。" +msgstr "文字列には基本的な変換や検索を行うためのメソッドが数多くあります。" #: ../../tutorial/introduction.rst:372 msgid ":ref:`f-strings`" @@ -864,7 +847,7 @@ msgstr ":ref:`formatstrings`" #: ../../tutorial/introduction.rst:376 msgid "Information about string formatting with :meth:`str.format`." msgstr "" -":meth:`str.format` を使った文字列のフォーマットについての情報があります。" +":meth:`str.format` を使った文字列のフォーマットについて説明しています。" #: ../../tutorial/introduction.rst:378 msgid ":ref:`old-string-formatting`" @@ -875,8 +858,8 @@ msgid "" "The old formatting operations invoked when strings are the left operand of " "the ``%`` operator are described in more detail here." msgstr "" -"文字列が ``%`` 演算子の左オペランドである場合に呼び出される古いフォーマット操" -"作について、詳しく記述されています。" +"文字列を ``%`` 演算子の左オペランドに指定して行う従来のフォーマット操作につい" +"て、詳しく説明しています。" #: ../../tutorial/introduction.rst:386 msgid "Lists" From 632d51cc24fcdc0ecf088d7c5fff17650777effa Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 23 Oct 2026 23:51:26 +0000 Subject: [PATCH 08/21] Merge 3.15 into 3.14 --- tutorial/introduction.po | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 12d3b911b..cf8138cfc 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -929,7 +929,7 @@ msgid "" "type, i.e. it is possible to change their content::" msgstr "" ":term:`不変 ` な文字列とは違って、リストは :term:`可変 ` " -"型ですので、要素を入れ替えられます::" +"型ですので、内容を変更できます::" #: ../../tutorial/introduction.rst:415 msgid "" @@ -976,7 +976,8 @@ msgid "" msgstr "" "単純な代入ではPythonは決してデータをコピーしません。リストを変数に代入する" "と、その変数は *既存のリスト* を参照します。ある変数を通してリストに任意の変" -"更を行うと、そのリストを参照したすべての他の変数を通して確認できます。::" +"更を行うと、同じリストを参照している他のすべての変数からもその変更を確認でき" +"ます。::" #: ../../tutorial/introduction.rst:435 msgid "" @@ -1118,7 +1119,7 @@ msgid "" "follows::" msgstr "" "もちろん、2 たす 2 よりももっと複雑な課題にも Python を使えます。\n" -"例えば、`Fibonacci series `_ の先頭の部分列は次のように書けます::" #: ../../tutorial/introduction.rst:502 @@ -1181,14 +1182,14 @@ msgid "" "than), ``>`` (greater than), ``==`` (equal to), ``<=`` (less than or equal " "to), ``>=`` (greater than or equal to) and ``!=`` (not equal to)." msgstr "" -":keyword:`while` は、条件 (ここでは `` a < 10``) が真である限り実行を繰り返" -"し (ループし) ます。Python では、C 言語と同様に、ゼロでない整数値は真となり、" -"ゼロは偽です。条件式には、文字列値やリスト値なども使えます。それ以外のシーケ" -"ンスも、条件式として使用できます。長さが 1 以上のシーケンスは真で、空のシーケ" -"ンスは偽になります。サンプルで使われている条件テストはシンプルな比較です。標" -"準的な比較演算子は C 言語と同様です: すなわち、 ``<`` (より小さい)、 ``>`` " -"(より大きい)、 ``==`` (等しい)、 ``<=`` (より小さいか等しい)、 ``>=`` (より大" -"きいか等しい)、および ``!=`` (等しくない)、です。" +":keyword:`while` は、条件 (ここでは ``a < 10``) が真である限り実行を繰り返し " +"(ループし) ます。Python では、C 言語と同様に、ゼロでない整数値は真となり、ゼ" +"ロは偽です。条件式には、文字列値やリスト値なども使えます。それ以外のシーケン" +"スも、条件式として使用できます。長さが 1 以上のシーケンスは真で、空のシーケン" +"スは偽になります。サンプルで使われている条件テストはシンプルな比較です。標準" +"的な比較演算子は C 言語と同様です: すなわち、 ``<`` (より小さい)、 ``>`` (よ" +"り大きい)、 ``==`` (等しい)、 ``<=`` (より小さいか等しい)、 ``>=`` (より大き" +"いか等しい)、および ``!=`` (等しくない)、です。" #: ../../tutorial/introduction.rst:534 msgid "" @@ -1202,14 +1203,14 @@ msgid "" "that each line within a basic block must be indented by the same amount." msgstr "" "ループの *本体 (body)* は、 *インデント (indent, 字下げ)* されています: イン" -"デントは Python において、実行文をグループにまとめる方法です。対話的プロンプ" -"トでは、インデントされた各行を入力するにはタブや (複数個の) スペースを使わな" -"ければなりません。実用的には、もっと複雑な処理を入力する場合はテキストエディ" -"タを使うことになるでしょう。 ほとんどのテキストエディタは、自動インデント機能" -"を持っています。複合文を対話的に入力するときには、入力完了のしるしとして最後" -"に空行を入力します。これは、パーザはどれが最後の行を入力なのか、判断できない" -"ためです。基本的なブロック内では、全ての行は同じだけインデントされていなけれ" -"ばならないので注意してください。" +"デントは Python において、文をグループにまとめる方法です。対話的プロンプトで" +"は、インデントされた各行を入力するにはタブや (複数個の) スペースを使わなけれ" +"ばなりません。実用的には、もっと複雑な処理を入力する場合はテキストエディタを" +"使うことになるでしょう。 ほとんどのテキストエディタは、自動インデント機能を" +"持っています。複合文を対話的に入力するときには、入力完了のしるしとして最後に" +"空行を入力します。パーザには最後の行の入力が終わったかどうかを判断できないた" +"めです。基本的なブロック内では、全ての行は同じだけインデントされていなければ" +"ならないので注意してください。" #: ../../tutorial/introduction.rst:543 msgid "" From 0582da0ad972bb350a26d4000bccd928455ae80b Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 24 Oct 2026 23:49:41 +0000 Subject: [PATCH 09/21] Merge 3.15 into 3.14 --- reference/simple_stmts.po | 5 +- tutorial/controlflow.po | 223 +++++++++++++++++-------------------- tutorial/datastructures.po | 107 +++++++++--------- tutorial/modules.po | 114 ++++++++++--------- 4 files changed, 216 insertions(+), 233 deletions(-) diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index ab900391f..9070b88a6 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -1006,13 +1006,12 @@ msgstr "" "要求したモジュールが無事に取得できた場合、次の 3 つのうちの 1 つの方法でロー" "カル名前空間で使えるようになります:" -#: ../../reference/simple_stmts.rst:786 msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -"モジュール名の後に :keyword:`!as` が続いていた場合は、 :keyword:`!as` の後ろ" -"の名前を直接、インポートされたモジュールが束縛します。" +"モジュール名の後に :keyword:`!as` を続けると、\n" +":keyword:`!as` の後ろの名前がインポートしたモジュールに直接束縛されます。" #: ../../reference/simple_stmts.rst:788 msgid "" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 9b58716ec..cf08d6f32 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -90,21 +90,18 @@ msgstr "" "elif` ... :keyword:`!elif` ... は、他の言語における ``switch`` 文や " "``case`` 文の代用となります。" -#: ../../tutorial/controlflow.rst:39 msgid "" "If you're comparing the same value to several constants, or checking for " "specific types or attributes, you may also find the :keyword:`!match` " "statement useful. For more details see :ref:`tut-match`." msgstr "" -"いくつかの定数と同じ値かを比較する場合や、特定の型や属性かを確認する場合に" -"は、:keyword:`!match` 文が便利です。詳細は :ref:`tut-match` を参照してくださ" -"い。" +"同じ値を複数の定数と比較する場合や、特定の型や属性を確認する場合には、:" +"keyword:`!match` 文も便利です。詳細は :ref:`tut-match` を参照してください。" #: ../../tutorial/controlflow.rst:46 msgid ":keyword:`!for` Statements" msgstr ":keyword:`!for` 文" -#: ../../tutorial/controlflow.rst:51 msgid "" "The :keyword:`for` statement in Python differs a bit from what you may be " "used to in C or Pascal. Rather than always iterating over an arithmetic " @@ -115,11 +112,11 @@ msgid "" "pun intended):" msgstr "" "Python の :keyword:`for` 文は、読者が C 言語や Pascal 言語で使いなれているか" -"もしれない ``for`` 文とは少し違います。 (Pascal のように) 常に算術型の数列に" -"わたる反復を行ったり、 (C のように) 繰返しステップと停止条件を両方ともユーザ" -"が定義できるようにするのとは違い、Python の :keyword:`!for` 文は、任意のシー" -"ケンス型 (リストまたは文字列) にわたって反復を行います。反復の順番はシーケン" -"ス中に要素が現れる順番です。例えば:" +"もしれない ``for`` 文とは少し違います。 (Pascal のように) 常に等差数列にわた" +"る反復を行ったり、 (C のように) 繰返しステップと停止条件を両方ともユーザが定" +"義できるようにするのとは違い、Python の :keyword:`!for` 文は、任意のシーケン" +"ス型 (リストまたは文字列) にわたって反復を行います。反復の順番はシーケンス中" +"に要素が現れる順番です。例えば:" #: ../../tutorial/controlflow.rst:63 msgid "" @@ -141,16 +138,14 @@ msgstr "" "window 6\n" "defenestrate 12" -#: ../../tutorial/controlflow.rst:72 msgid "" "Code that modifies a collection while iterating over that same collection " "can be tricky to get right. Instead, it is usually more straight-forward to " "loop over a copy of the collection or to create a new collection::" msgstr "" -"コレクションオブジェクトの値を反復処理をしているときに、そのコレクションオブ" -"ジェクトを変更するコードは理解するのが面倒になり得ます。\n" -"そうするよりも、コレクションオブジェクトのコピーに対して反復処理をするか、新" -"しいコレクションオブジェクトを作成する方が通常は理解しやすいです::" +"コレクションを反復処理しながらそのコレクションを変更するコードを正しく書くの" +"は難しいことがあります。通常は、コレクションのコピーを反復処理するか、新しい" +"コレクションを作成する方が簡単です。 ::" #: ../../tutorial/controlflow.rst:76 msgid "" @@ -186,13 +181,12 @@ msgstr "" msgid "The :func:`range` Function" msgstr ":func:`range` 関数" -#: ../../tutorial/controlflow.rst:96 msgid "" "If you do need to iterate over a sequence of numbers, the built-in function :" "func:`range` comes in handy. It generates arithmetic progressions::" msgstr "" "数列にわたって反復を行う必要がある場合、組み込み関数 :func:`range` が便利で" -"す。この関数は算術型の数列を生成します::" +"す。この関数は等差数列を生成します。 ::" #: ../../tutorial/controlflow.rst:99 msgid "" @@ -308,7 +302,6 @@ msgstr "" "の連続した要素を返すオブジェクトです。しかし実際にリストを作るわけではないの" "で、スペースの節約になります。" -#: ../../tutorial/controlflow.rst:148 msgid "" "We say such an object is :term:`iterable`, that is, suitable as a target for " "functions and constructs that expect something from which they can obtain " @@ -316,6 +309,10 @@ msgid "" "the :keyword:`for` statement is such a construct, while an example of a " "function that takes an iterable is :func:`sum`::" msgstr "" +"このようなオブジェクトを :term:`イテラブル ` と呼びます。つまり、要" +"素が :term:`尽きる ` まで順に取得できるものを必要とする関数や構文" +"で使えます。これまでに見た :keyword:`for` 文がそのような構文の例で、イテラブ" +"ルを受け取る関数の例には :func:`sum` があります。 ::" #: ../../tutorial/controlflow.rst:154 msgid "" @@ -325,24 +322,24 @@ msgstr "" ">>> sum(range(4)) # 0 + 1 + 2 + 3\n" "6" -#: ../../tutorial/controlflow.rst:157 msgid "" "Later we will see more functions that return iterables and take iterables as " "arguments. In chapter :ref:`tut-structures`, we will discuss :func:`list` " "in more detail." msgstr "" +"イテラブルを返す関数や、イテラブルを引数に取る関数は後でさらに紹介します。 :" +"ref:`tut-structures` の章では :func:`list` について詳しく説明します。" #: ../../tutorial/controlflow.rst:164 msgid ":keyword:`!break` and :keyword:`!continue` Statements" msgstr ":keyword:`!break` 文と :keyword:`!continue` 文" -#: ../../tutorial/controlflow.rst:166 msgid "" "The :keyword:`break` statement breaks out of the innermost enclosing :" "keyword:`for` or :keyword:`while` loop::" msgstr "" -":keyword:`break` 文は、その `break` 文を内包している最も内側にある :keyword:" -"`for` 文または :keyword:`while` 文から抜け出すことができます::" +":keyword:`break` 文は、その文を囲む最も内側の :keyword:`for` ループまたは :" +"keyword:`while` ループを抜けます。 ::" #: ../../tutorial/controlflow.rst:169 msgid "" @@ -454,7 +451,6 @@ msgid "" "for prime numbers::" msgstr "その例として、素数を探索する :keyword:`!for` 文を以下に示します::" -#: ../../tutorial/controlflow.rst:221 msgid "" ">>> for n in range(2, 10):\n" "... for x in range(2, n):\n" @@ -477,11 +473,11 @@ msgstr "" ">>> for n in range(2, 10):\n" "... for x in range(2, n):\n" "... if n % x == 0:\n" -"... print(n, 'は', x, '*', n//x, 'と等しい')\n" +"... print(n, 'equals', x, '*', n//x)\n" "... break\n" "... else:\n" "... # 因数が見つからないとループは最後まで実行される\n" -"... print(n, 'は素数です')\n" +"... print(n, 'is a prime number')\n" "...\n" "2 is a prime number\n" "3 is a prime number\n" @@ -500,7 +496,6 @@ msgstr "" "(そう、これは正しいコードです。よく見てください: ``else`` 節は ``if`` 文 **で" "はなく** 、 ``for`` ループに属しています。)" -#: ../../tutorial/controlflow.rst:242 msgid "" "One way to think of the else clause is to imagine it paired with the ``if`` " "inside the loop. As the loop executes, it will run a sequence like if/if/if/" @@ -508,8 +503,12 @@ msgid "" "condition is ever true, a ``break`` will happen. If the condition is never " "true, the ``else`` clause outside the loop will execute." msgstr "" +"else 節を理解するには、ループ内の ``if`` と対になると考える方法があります。" +"ループが実行されるにつれて if/if/if/else のように処理が進みます。 ``if`` は" +"ループの内側にあり、何度も実行されます。条件が一度でも真になれば ``break`` が" +"実行されます。一度も真にならなければ、ループの外側にある ``else`` 節が実行さ" +"れます。" -#: ../../tutorial/controlflow.rst:248 msgid "" "When used with a loop, the ``else`` clause has more in common with the " "``else`` clause of a :keyword:`try` statement than it does with that of " @@ -519,9 +518,9 @@ msgid "" "handling`." msgstr "" "ループの ``else`` 句は、 ``if`` 文の ``else`` よりも :keyword:`try` 文の " -"``else`` に似ています。 文の ``else`` 句は例外が発生しなかった時に実行され、" -"ループの ``else`` 句は ``break`` されなかった場合に実行されます。 ``try`` 文" -"と例外についての詳細は :ref:`tut-handling` を参照してください。" +"``else`` に似ています。 ``try`` 文の ``else`` 句は例外が発生しなかった時に実" +"行され、ループの ``else`` 句は ``break`` されなかった場合に実行されます。 " +"``try`` 文と例外についての詳細は :ref:`tut-handling` を参照してください。" #: ../../tutorial/controlflow.rst:258 msgid ":keyword:`!pass` Statements" @@ -599,7 +598,6 @@ msgstr "" msgid ":keyword:`!match` Statements" msgstr ":keyword:`!match` 文" -#: ../../tutorial/controlflow.rst:293 msgid "" "A :keyword:`match` statement takes an expression and compares its value to " "successive patterns given as one or more case blocks. This is superficially " @@ -609,17 +607,16 @@ msgid "" "also extract components (sequence elements or object attributes) from the " "value into variables. If no case matches, none of the branches is executed." msgstr "" -":keyword:`match` 文は1つの式を指定し、その値と次に続く1つ以上のcaseブロックに" -"指定されたパターンを比較します。この機能はCやJava、JavaScript(や他の多数の言" -"語)のswitch文と表面的には似ていますが、RustやHaskellのパターンマッチングによ" -"り似ています。最初にマッチしたパターンのみが実行され、コンポーネント(シーケン" -"スの要素やオブジェクトの属性)から値を取り出して変数に代入することもできます。" -"どのcaseにもマッチしない場合はどの分岐も実行されません。" +":keyword:`match` 文は式を受け取り、その値を1つ以上の case ブロックに指定され" +"たパターンと順に比較します。表面的には C、Java、JavaScript などの switch 文に" +"似ていますが、Rust や Haskell などのパターンマッチングにより近いものです。最" +"初にマッチしたパターンのブロックだけが実行されます。また、値から構成要素 " +"(シーケンスの要素やオブジェクトの属性) を取り出して変数に代入することもできま" +"す。どの case にもマッチしなければ、どの分岐も実行されません。" -#: ../../tutorial/controlflow.rst:302 msgid "" "The simplest form compares a subject value against one or more literals::" -msgstr "最も単純な形式は、対象の値に対して1つ以上のリテラルです::" +msgstr "最も単純な形式では、対象の値を1つ以上のリテラルと比較します。 ::" #: ../../tutorial/controlflow.rst:304 msgid "" @@ -668,11 +665,12 @@ msgstr "" "case 401 | 403 | 404:\n" " return \"Not allowed\"" -#: ../../tutorial/controlflow.rst:323 msgid "" "Patterns can look like unpacking assignments, and can be used to bind " "variables::" -msgstr "パターンはアンパック代入ができ、変数に結びつけられます::" +msgstr "" +"パターンはアンパック代入に似た形で書くことができ、変数に値を結びつけるために" +"使えます。 ::" #: ../../tutorial/controlflow.rst:326 msgid "" @@ -719,14 +717,14 @@ msgstr "" "4番目のパターンは2つの値を取り込みます。\n" "これは、アンパック代入 ``(x, y) = point`` と概念的に似ています。" -#: ../../tutorial/controlflow.rst:346 msgid "" "If you are using classes to structure your data you can use the class name " "followed by an argument list resembling a constructor, but with the ability " "to capture attributes into variables::" msgstr "" -"データを構造化するためにクラスを使っている場合は、クラス名の後ろにコンストラ" -"クターのように引数のリストを指定できます。属性の値は変数に取り込まれます。" +"データを構造化するためにクラスを使っている場合は、クラス名の後にコンストラク" +"ターに似た引数リストを指定できます。これにより属性の値を変数に取り込めま" +"す。 ::" #: ../../tutorial/controlflow.rst:350 msgid "" @@ -882,9 +880,8 @@ msgstr "" " case Point(x, y):\n" " print(f\"対角線上ではない\")" -#: ../../tutorial/controlflow.rst:417 msgid "Several other key features of this statement:" -msgstr "この文のその他のいくつか重要な特徴::" +msgstr "この文には、ほかにも次のような重要な特徴があります:" #: ../../tutorial/controlflow.rst:419 msgid "" @@ -936,19 +933,19 @@ msgstr "" "この例では入力から2番目の要素を ``p2`` として取り込みます(入力が2つのポイン" "トのシーケンスである場合)" -#: ../../tutorial/controlflow.rst:440 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." msgstr "" -"ほとんどのリテラルは同一性を比較しますが、シングルトンの ``True``、" -"``False``、``None`` では識別値を比較します。" +"ほとんどのリテラルは値が等しいかどうかで比較しますが、シングルトンの " +"``True``、``False``、``None`` は同一のオブジェクトかどうかで比較します。" -#: ../../tutorial/controlflow.rst:443 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variables::" msgstr "" +"名前付きの定数もパターンで使えます。値を取り込む変数と解釈されないよう、ドッ" +"トを含む名前にする必要があります。 ::" #: ../../tutorial/controlflow.rst:446 msgid "" @@ -1004,7 +1001,6 @@ msgstr "" "フィボナッチ数列 (Fibonacci series) を任意の上限値まで書き出すような関数を作" "成できます::" -#: ../../tutorial/controlflow.rst:473 msgid "" ">>> def fib(n): # write Fibonacci series less than n\n" "... \"\"\"Print a Fibonacci series less than n.\"\"\"\n" @@ -1018,8 +1014,8 @@ msgid "" ">>> fib(2000)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597" msgstr "" -">>> def fib(n): # nまでのフィボナッチ数を出力する\n" -"... \"\"\"nまでのフィボナッチ数をprintする。\"\"\"\n" +">>> def fib(n): # n 未満のフィボナッチ数列を出力する\n" +"... \"\"\"n 未満のフィボナッチ数列を出力する。\"\"\"\n" "... a, b = 0, 1\n" "... while a < n:\n" "... print(a, end=' ')\n" @@ -1041,7 +1037,6 @@ msgstr "" "後には、関数名と仮引数を丸括弧で囲んだリストを続けなければなりません。関数の" "実体を構成する実行文は次の行から始め、インデントされていなければなりません。" -#: ../../tutorial/controlflow.rst:495 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" @@ -1051,13 +1046,13 @@ msgid "" "through code; it's good practice to include docstrings in code that you " "write, so make a habit of it." msgstr "" -"関数の本体の記述する文の最初の行は文字列リテラルにすることもできます。その場" -"合、この文字列は関数のドキュメンテーション文字列 (documentation string)、また" -"は :dfn:`docstring` と呼ばれます。 (docstring については :ref:`tut-" -"docstrings` でさらに扱っています。) ドキュメンテーション文字列を使ったツール" -"には、オンライン文書や印刷文書を自動的に生成したり、ユーザが対話的にコードか" -"ら直接閲覧できるようにするものがあります。自分が書くコードにドキュメンテー" -"ション文字列を入れるのはよい習慣です。書く癖をつけてください。" +"関数本体の最初の文は文字列リテラルにすることもできます。その場合、この文字列" +"は関数のドキュメンテーション文字列 (documentation string)、または :dfn:" +"`docstring` と呼ばれます。 (docstring については :ref:`tut-docstrings` でさら" +"に扱っています。) ドキュメンテーション文字列を使ったツールには、オンライン文" +"書や印刷文書を自動的に生成したり、ユーザが対話的にコードから直接閲覧できるよ" +"うにするものがあります。自分が書くコードにドキュメンテーション文字列を入れる" +"のはよい習慣です。書く癖をつけてください。" #: ../../tutorial/controlflow.rst:502 msgid "" @@ -1153,15 +1148,13 @@ msgstr "" ">>> print(fib(0))\n" "None" -#: ../../tutorial/controlflow.rst:542 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" msgstr "" -"フィボナッチ数列の数からなるリストを出力する代わりに、値を返すような関数を書" -"くのは簡単です::" +"フィボナッチ数列を出力する代わりに、数列の値を含むリストを返す関数も簡単に書" +"けます。 ::" -#: ../../tutorial/controlflow.rst:545 msgid "" ">>> def fib2(n): # return Fibonacci series up to n\n" "... \"\"\"Return a list containing the Fibonacci series up to n.\"\"\"\n" @@ -1176,8 +1169,8 @@ msgid "" ">>> f100 # write the result\n" "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]" msgstr "" -">>> def fib2(n): # nまでのフィボナッチ数を返す\n" -"... \"\"\"nまでのフィボナッチ数を含むリストを返す。\"\"\"\n" +">>> def fib2(n): # n 未満のフィボナッチ数列を返す\n" +"... \"\"\"n 未満のフィボナッチ数列を含むリストを返す。\"\"\"\n" "... result = []\n" "... a, b = 0, 1\n" "... while a < n:\n" @@ -1193,17 +1186,15 @@ msgstr "" msgid "This example, as usual, demonstrates some new Python features:" msgstr "この例は Python の新しい機能を示しています:" -#: ../../tutorial/controlflow.rst:560 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " "off the end of a function also returns ``None``." msgstr "" -":keyword:`return` 文では、関数から一つ値を返します。 :keyword:`!return` の引" -"数となる式がない場合、 ``None`` が返ります。関数が終了したときにも ``None`` " -"が返ります。" +":keyword:`return` 文は値を返して関数を終了します。式を指定しない :keyword:`!" +"return` は ``None`` を返します。関数本体の末尾に到達した場合も ``None`` を返" +"します。" -#: ../../tutorial/controlflow.rst:564 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -1220,14 +1211,14 @@ msgstr "" "文 ``result.append(a)`` では、リストオブジェクト ``result`` の *メソッド " "(method)* を呼び出しています。メソッドとは、オブジェクトに '属している' 関数" "のことで、 ``obj`` を何らかのオブジェクト (式であっても構いません)、 " -"``methodname`` をそのオブジェクトで定義されているメソッド名とすると、 ``obj." -"methodname`` と書き表されます。異なる型は異なるメソッドを定義しています。異な" -"る型のメソッドで同じ名前のメソッドを持つことができ、あいまいさを生じることは" -"ありません。 (*クラス (class)* を使うことで、自前のオブジェクト型とメソッドを" -"定義することもできます。 :ref:`tut-classes` 参照) 例で示されているメソッド :" -"meth:`~list.append` は、リストオブジェクトで定義されています; このメソッドは" -"リストの末尾に新たな要素を追加します。この例での ``append()`` は ``result = " -"result + [a]`` と等価ですが、より効率的です。" +"``methodname`` をそのオブジェクトの型で定義されているメソッド名とすると、 " +"``obj.methodname`` と書き表されます。異なる型は異なるメソッドを定義していま" +"す。異なる型のメソッドで同じ名前のメソッドを持つことができ、あいまいさを生じ" +"ることはありません。 (*クラス (class)* を使うことで、自前のオブジェクト型とメ" +"ソッドを定義することもできます。 :ref:`tut-classes` 参照) 例で示されているメ" +"ソッド :meth:`~list.append` は、リストオブジェクトで定義されています; このメ" +"ソッドはリストの末尾に新たな要素を追加します。この例での ``append()`` は " +"``result = result + [a]`` と等価ですが、より効率的です。" #: ../../tutorial/controlflow.rst:579 msgid "More on Defining Functions" @@ -1343,16 +1334,16 @@ msgstr "" msgid "will print ``5``." msgstr "は ``5`` を出力します。" -#: ../../tutorial/controlflow.rst:631 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " "dictionary, or instances of most classes. For example, the following " "function accumulates the arguments passed to it on subsequent calls::" msgstr "" -"**重要な警告:** デフォルト値は 1 度だけしか評価されません。デフォルト値がリ" -"ストや辞書のような変更可能なオブジェクトの時にはその影響がでます。例えば以下" -"の関数は、後に続く関数呼び出しで関数に渡されている引数を累積します::" +"**重要な警告:** デフォルト値は1度しか評価されません。このことは、デフォルト値" +"がリスト、辞書、多くのクラスのインスタンスなどのミュータブルなオブジェクトで" +"ある場合に影響します。例えば、次の関数は呼び出されるたびに渡された引数を蓄積" +"します。 ::" #: ../../tutorial/controlflow.rst:636 msgid "" @@ -1435,16 +1426,15 @@ msgstr "" " print(\"-- Lovely plumage, the\", type)\n" " print(\"-- It's\", state, \"!\")" -#: ../../tutorial/controlflow.rst:674 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " "of the following ways::" msgstr "" -"は、必須引数 (``voltage``) とオプション引数 (``state``、``action``、" -"``type``) を受け付けます。この関数は以下のいずれかの方法で呼び出せます::" +"は、1つの必須引数 (``voltage``) と3つのオプション引数 (``state``、" +"``action``、``type``) を受け付けます。この関数は以下のいずれかの方法で呼び出" +"せます。 ::" -#: ../../tutorial/controlflow.rst:678 msgid "" "parrot(1000) # 1 positional " "argument\n" @@ -1459,10 +1449,9 @@ msgstr "" "parrot(1000) # 1つの位置引数\n" "parrot(voltage=1000) # 1つのキーワード引数\n" "parrot(voltage=1000000, action='VOOOOOM') # 2つのキーワード引数\n" -"parrot(action='VOOOOOM', voltage=1000000) # 2つのキーワード引" -"数 \n" +"parrot(action='VOOOOOM', voltage=1000000) # 2つのキーワード引数\n" "parrot('a million', 'bereft of life', 'jump') # 3つの位置引数\n" -"parrot('a thousand', state='pushing up the daisies') # 1との位置引数と1つの" +"parrot('a thousand', state='pushing up the daisies') # 1つの位置引数と1つの" "キーワード引数" #: ../../tutorial/controlflow.rst:685 @@ -1869,14 +1858,13 @@ msgstr "" "TypeError: combined_example() got some positional-only arguments passed as " "keyword arguments: 'pos_only'" -#: ../../tutorial/controlflow.rst:875 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " "as a key::" msgstr "" "最後に、位置引数 ``name`` と ``name`` をキーとして持つ ``**kwds`` の間に潜在" -"的な衝突がある関数定義を考えてみましょう。" +"的な衝突がある関数定義を考えてみましょう。 ::" #: ../../tutorial/controlflow.rst:877 msgid "" @@ -1886,14 +1874,12 @@ msgstr "" "def foo(name, **kwds):\n" " return 'name' in kwds" -#: ../../tutorial/controlflow.rst:880 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" msgstr "" -"キーワードに ``'name'`` を入れても、先頭の引数と同じになってしまうため、この" -"関数が ``True`` を返すような呼び出しの方法はありません。例えば、次のように" -"なってしまいます::" +"キーワード引数 ``'name'`` は常に最初の引数に結びつけられるため、この関数が " +"``True`` を返す呼び出し方はありません。例えば次のようになります。 ::" #: ../../tutorial/controlflow.rst:883 msgid "" @@ -1945,11 +1931,10 @@ msgstr "" msgid "Recap" msgstr "要約" -#: ../../tutorial/controlflow.rst:904 msgid "" "The use case will determine which parameters to use in the function " "definition::" -msgstr "使用例で、関数定義でどの種類の引数を使うかべきかがわかると思います::" +msgstr "関数定義でどの種類の引数を使うかは、用途に応じて決めます。 ::" #: ../../tutorial/controlflow.rst:906 msgid "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" @@ -1959,7 +1944,6 @@ msgstr "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" msgid "As guidance:" msgstr "ガイドとしては、" -#: ../../tutorial/controlflow.rst:910 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -1967,34 +1951,27 @@ msgid "" "is called or if you need to take some positional parameters and arbitrary " "keywords." msgstr "" -"もし引数の名前をユーザーに知らせる必要がないなら、位置専用引数を使用しましょ" -"う。これは引数の名前がユーザーにとって意味がなく、関数が呼ばれたときの引数の" -"順序が問題であり、または、位置引数と任意のキーワードを使用する必要がある場合" -"に便利です。" +"呼び出し側が引数名を使って指定できないようにしたい場合は、位置専用引数を使い" +"ます。引数名に特に意味がない場合や、呼び出し時の引数の順序を固定したい場合、" +"いくつかの位置引数と任意のキーワード引数を受け取りたい場合に便利です。" -#: ../../tutorial/controlflow.rst:915 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " "relying on the position of the argument being passed." msgstr "" -"引数の名前に意味があり、それにより関数の定義がより明らかになる、または、ユー" -"ザーが引数の順番に縛られることを避けたほうがいいと考えるのなら、キーワード専" -"用引数を使用しましょう。" +"引数名に意味があり、名前を明示した方が関数定義を理解しやすい場合や、呼び出し" +"側が引数の位置に依存するのを防ぎたい場合は、キーワード専用引数を使います。" -#: ../../tutorial/controlflow.rst:918 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." -msgstr "" -"APIの場合、将来引数の名前が変更された場合にAPIの変更ができなくなることを防ぐ" -"ために、位置専用引数を使用しましょう。" +msgstr "API では位置専用引数を使うと、将来引数名を変更しても互換性を保てます。" #: ../../tutorial/controlflow.rst:924 msgid "Arbitrary Argument Lists" msgstr "任意引数リスト" -#: ../../tutorial/controlflow.rst:929 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -2003,8 +1980,8 @@ msgid "" msgstr "" "最後に、最も使うことの少ない選択肢として、関数が任意の個数の引数で呼び出せる" "よう指定する方法があります。これらの引数はタプル (:ref:`tut-tuples` を参照) " -"に格納されます。可変個の引数の前に、ゼロ個かそれ以上の引数があっても構いませ" -"ん。 ::" +"に格納されます。可変個の引数の前に、ゼロ個かそれ以上の通常の引数があっても構" +"いません。 ::" #: ../../tutorial/controlflow.rst:934 msgid "" @@ -2212,11 +2189,12 @@ msgstr "" "し、まとめの行と残りの記述部分を視覚的に分離します。つづく行は一つまたはそれ" "以上の段落で、対象物の呼び出し規約や副作用について記述します。" -#: ../../tutorial/controlflow.rst:1042 msgid "" "The Python parser strips indentation from multi-line string literals when " "they serve as module, class, or function docstrings." msgstr "" +"複数行の文字列リテラルがモジュール、クラス、関数のドキュメンテーション文字列" +"として使われる場合、Python のパーサーはそのインデントを取り除きます。" #: ../../tutorial/controlflow.rst:1045 msgid "Here is an example of a multi-line docstring::" @@ -2293,7 +2271,6 @@ msgstr "" "間に置かれたリテラル ``->`` によって定義され、その後に式が続きます。次の例は" "必須の引数とオプション引数、そして戻り値のアノテーションを持っています::" -#: ../../tutorial/controlflow.rst:1089 msgid "" ">>> def f(ham: str, eggs: str = 'eggs') -> str:\n" "... print(\"Annotations:\", f.__annotations__)\n" @@ -2312,16 +2289,15 @@ msgstr "" "... return ham + ' and ' + eggs\n" "...\n" ">>> f('spam')\n" -"アノテーション: {'ham': , 'return': , 'eggs': " -"}\n" -"引数: spam eggs\n" +"Annotations: {'ham': , 'return': , 'eggs': }\n" +"Arguments: spam eggs\n" "'spam and eggs'" #: ../../tutorial/controlflow.rst:1102 msgid "Intermezzo: Coding Style" msgstr "間奏曲: コーディングスタイル" -#: ../../tutorial/controlflow.rst:1106 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -2329,6 +2305,11 @@ msgid "" "than others. Making it easy for others to read your code is always a good " "idea, and adopting a nice coding style helps tremendously for that." msgstr "" +"これから、より長く複雑な Python のコードを書くようになるので、ここで *コー" +"ディングスタイル* について説明します。ほとんどの言語ではさまざまなスタイルで" +"コードを書けます (より正確には、コードを *整形* できます) が、スタイルによっ" +"て読みやすさは異なります。他の人が読みやすいコードを書くことは常に大切で、よ" +"いコーディングスタイルを採用すると大いに役立ちます。" #: ../../tutorial/controlflow.rst:1112 msgid "" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 6d95b3486..056df0474 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -52,12 +52,11 @@ msgstr "" msgid "Add an item to the end of the list. Similar to ``a[len(a):] = [x]``." msgstr "リストの末尾に要素を一つ追加します。``a[len(a):] = [x]`` と同様です。" -#: ../../tutorial/datastructures.rst:27 msgid "" "Extend the list by appending all the items from the iterable. Similar to " "``a[len(a):] = iterable``." msgstr "" -"イテラブルのすべての要素を対象のリストに追加し、リストを拡張します。" +"``iterable`` のすべての要素をリストの末尾に追加します。\n" "``a[len(a):] = iterable`` と同様です。" #: ../../tutorial/datastructures.rst:34 @@ -185,17 +184,17 @@ msgstr "" ">>> fruits.pop()\n" "'pear'" -#: ../../tutorial/datastructures.rst:121 msgid "" "You might have noticed that methods like ``insert``, ``remove`` or ``sort`` " "that only modify the list have no return value printed -- they return the " "default ``None``. [#]_ This is a design principle for all mutable data " "structures in Python." msgstr "" -"``insert``, ``remove``, ``sort`` などのリストを操作するメソッドの戻り値が表示" -"されていないことに気が付いたかもしれません。これらのメソッドは ``None`` を返" -"しています。[#]_ これは Python の変更可能なデータ構造全てについての設計上の原" -"則となっています。" +"``insert``、``remove``、``sort`` など、リストの変更だけを行うメソッドの戻り値" +"が表示されていないことに気が付いたかもしれません。\n" +"これらのメソッドはデフォルトの ``None`` を返しています。\n" +"[#]_ これは Python の変更可能なデータ構造全てについての設計上の原則となってい" +"ます。" #: ../../tutorial/datastructures.rst:126 msgid "" @@ -608,13 +607,12 @@ msgstr "" ">>> transposed\n" "[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]" -#: ../../tutorial/datastructures.rst:324 msgid "" "In the real world, you should prefer built-in functions to complex flow " "statements. The :func:`zip` function would do a great job for this use case::" msgstr "" -"実際には複雑な流れの式よりも組み込み関数を使う方が良いです。この場合 :func:" -"`zip` 関数が良い仕事をしてくれるでしょう::" +"実際のコードでは、複雑な制御フローの文よりも組み込み関数を優先すべきです。\n" +"この用途には :func:`zip` 関数が適しています。 ::" #: ../../tutorial/datastructures.rst:327 msgid "" @@ -705,7 +703,6 @@ msgstr "" msgid "The :keyword:`!del` statement" msgstr ":keyword:`!del` 文" -#: ../../tutorial/datastructures.rst:378 msgid "" "There is a way to remove an item from a list given its index instead of its " "value: the :keyword:`del` statement. This differs from the :meth:`~list." @@ -714,10 +711,12 @@ msgid "" "earlier by assignment of an empty list to the slice). For example::" msgstr "" "リストから要素を削除する際、値を指定する代わりにインデックスを指定する方法が" -"あります。それが :keyword:`del` 文です。これは :meth:`~list.pop` メソッドと違" -"い、値を返しません。 :keyword:`!del` 文はリストからスライスを除去したり、リス" -"ト全体を削除することもできます(以前はスライスに空のリストを代入して行っていま" -"した)。例えば以下のようにします::" +"あります。\n" +"それが :keyword:`del` 文です。\n" +"これは :meth:`~list.pop` メソッドと違い、値を返しません。\n" +":keyword:`!del` 文はリストからスライスを除去したり、リストの全要素を削除する" +"こともできます(以前はスライスに空のリストを代入して行っていました)。\n" +"例えば以下のようにします。 ::" #: ../../tutorial/datastructures.rst:384 msgid "" @@ -810,7 +809,6 @@ msgid "" "(0, 1, 2, 3, 4)" msgstr "" -#: ../../tutorial/datastructures.rst:439 msgid "" "As you see, on output tuples are always enclosed in parentheses, so that " "nested tuples are interpreted correctly; they may be input with or without " @@ -820,10 +818,11 @@ msgid "" "which contain mutable objects, such as lists." msgstr "" "ご覧のとおり、タプルの表示には常に丸括弧がついていて、タプルのネストが正しく" -"解釈されるようになっています。タプルを書くときは必ずしも丸括弧で囲まなくても" -"いいですが、(タプルが大きな式の一部だった場合は) 丸括弧が必要な場合もありま" -"す。タプルの要素を代入することはできません。しかし、タプルにリストのような変" -"更可能型を含めることはできます。" +"解釈されるようになっています。\n" +"タプルを書くときは必ずしも丸括弧で囲まなくてもいいですが、(タプルが大きな式の" +"一部だった場合は) 丸括弧が必要な場合もあります。\n" +"タプルの各要素に代入することはできません。\n" +"しかし、タプルにリストのような変更可能なオブジェクトを含めることはできます。" #: ../../tutorial/datastructures.rst:446 msgid "" @@ -908,7 +907,6 @@ msgstr "" msgid "Sets" msgstr "集合型" -#: ../../tutorial/datastructures.rst:487 msgid "" "Python also includes a data type for :ref:`sets `. A set is an " "unordered collection with no duplicate elements. Basic uses include " @@ -916,10 +914,12 @@ msgid "" "support mathematical operations like union, intersection, difference, and " "symmetric difference." msgstr "" -"Python には、 :ref:`sets ` を扱うためのデータ型もあります。集合と" -"は、重複する要素をもたない、順序づけられていない要素の集まりです。 Set オブ" -"ジェクトは、和 (union)、積 (intersection)、差 (difference)、対称差 " -"(symmetric difference)といった数学的な演算もサポートしています。" +"Python には、 :ref:`sets ` を扱うためのデータ型もあります。\n" +"集合とは、重複する要素をもたない、順序づけられていない要素の集まりです。\n" +"基本的な用途には、要素が含まれるかどうかの判定や、重複する要素の除去がありま" +"す。\n" +"``set`` オブジェクトは、和 (union)、積 (intersection)、差 (difference)、\n" +"対称差 (symmetric difference)といった数学的な演算もサポートしています。" #: ../../tutorial/datastructures.rst:493 msgid "" @@ -1146,13 +1146,12 @@ msgstr "" ">>> 'jack' not in tel\n" "False" -#: ../../tutorial/datastructures.rst:601 msgid "" "The :func:`dict` constructor builds dictionaries directly from sequences of " "key-value pairs::" msgstr "" -":func:`dict` コンストラクタは、キーと値のペアのタプルを含むリストから辞書を生" -"成します::" +":func:`dict` コンストラクタは、キーと値のペアからなるシーケンスから直接辞書を" +"生成します。 ::" #: ../../tutorial/datastructures.rst:604 msgid "" @@ -1162,11 +1161,10 @@ msgstr "" ">>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])\n" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" -#: ../../tutorial/datastructures.rst:607 msgid "" "In addition, dict comprehensions can be used to create dictionaries from " "arbitrary key and value expressions::" -msgstr "さらに、辞書内包表現を使って、任意のキーと値のペアから辞書を作れます::" +msgstr "さらに、辞書内包表記ではキーと値に任意の式を使って辞書を作れます。 ::" #: ../../tutorial/datastructures.rst:610 msgid "" @@ -1318,13 +1316,13 @@ msgstr "" "3\n" "1" -#: ../../tutorial/datastructures.rst:681 msgid "" "To loop over a sequence in sorted order, use the :func:`sorted` function " "which returns a new sorted list while leaving the source unaltered. ::" msgstr "" "シーケンスをソートされた順序でループするには、 :func:`sorted` 関数を使いま" -"す。この関数は元の配列を変更せず、ソート済みの新たな配列を返します。 ::" +"す。\n" +"この関数は元のシーケンスを変更せず、ソート済みの新たなリストを返します。 ::" #: ../../tutorial/datastructures.rst:684 msgid "" @@ -1350,17 +1348,17 @@ msgstr "" "orange\n" "pear" -#: ../../tutorial/datastructures.rst:695 msgid "" "Using :func:`set` on a sequence eliminates duplicate elements. The use of :" "func:`sorted` in combination with :func:`set` over a sequence is an " "idiomatic way to loop over unique elements of the sequence in sorted " "order. ::" msgstr "" -"シーケンスに :func:`set` を使うと、重複要素が除去されます。\n" -"シーケンスに :func:`set` を使った上で、 :func:`sorted` を使うという組み合わせ" -"方は、順番が整列されているシーケンスで、同一要素に 1 度のみループでアクセスす" -"る慣用的な方法です。" +"シーケンスに :func:`set` を使うと、重複する要素を取り除けます。\n" +":func:`sorted` と :func:`set` を組み合わせると、シーケンスの要素から重複を除" +"き、\n" +"ソート順にループできます。\n" +"これはよく使われる書き方です。 ::" #: ../../tutorial/datastructures.rst:699 msgid "" @@ -1382,13 +1380,12 @@ msgstr "" "orange\n" "pear" -#: ../../tutorial/datastructures.rst:708 msgid "" "It is sometimes tempting to change a list while you are looping over it; " "however, it is often simpler and safer to create a new list instead. ::" msgstr "" -"ときどきループ内でリストを変更したい誘惑に駆られるでしょうが、代わりに新しい" -"リストを作ってしまうほうがより簡単で安全なことが、ままあります ::" +"リストを反復処理しながらそのリストを変更したくなることもありますが、代わりに" +"新しいリストを作る方が簡単で安全なことがよくあります。 ::" #: ../../tutorial/datastructures.rst:711 msgid "" @@ -1512,7 +1509,6 @@ msgstr "" msgid "Comparing Sequences and Other Types" msgstr "シーケンスとその他の型の比較" -#: ../../tutorial/datastructures.rst:773 msgid "" "Sequence objects typically may be compared to other objects with the same " "sequence type. The comparison uses *lexicographical* ordering: first the " @@ -1528,16 +1524,21 @@ msgid "" "of the same type::" msgstr "" "概して、シーケンスオブジェクトは、同じシーケンス型の他のオブジェクトと比較で" -"きます。比較には *辞書的な (lexicographical)* 順序が用いられます。まず、最初" -"の二つの要素を比較し、その値が等しくなければその時点で比較結果が決まります。" -"等しければ次の二つの要素を比較し、以降シーケンスの要素が尽きるまで続けます。" +"きます。\n" +"比較には *辞書的な (lexicographical)* 順序が用いられます。\n" +"まず、二つのシーケンスの先頭要素同士を比較し、その値が等しくなければその時点" +"で比較結果が決まります。\n" +"等しければ次の二つの要素を比較し、以降シーケンスの要素が尽きるまで続けま" +"す。\n" "比較しようとする二つの要素がいずれも同じシーケンス型であれば、そのシーケンス" -"間での辞書比較を再帰的に行います。二つのシーケンスの全ての要素の比較結果が等" -"しくなれば、シーケンスは等しいとみなされます。片方のシーケンスがもう一方の先" -"頭部分にあたる部分シーケンスならば、短い方のシーケンスが小さいシーケンスとみ" -"なされます。文字列に対する辞書的な順序づけには、個々の文字ごとに ASCII 順序を" -"用います。以下に、同じ型のオブジェクトを持つシーケンス間での比較を行った例を" -"示します:: " +"間での辞書比較を再帰的に行います。\n" +"二つのシーケンスの全ての要素の比較結果が等しくなれば、シーケンスは等しいとみ" +"なされます。\n" +"片方のシーケンスがもう一方の先頭部分にあたる部分シーケンスならば、短い方の" +"シーケンスが小さいシーケンスとみなされます。\n" +"文字列に対する辞書的な順序づけには、個々の文字ごとに Unicode コードポイントの" +"数値による順序を用います。\n" +"以下に、同じ型のシーケンス間での比較を行った例を示します。 ::" #: ../../tutorial/datastructures.rst:785 msgid "" @@ -1575,11 +1576,9 @@ msgstr "" msgid "Footnotes" msgstr "脚注" -#: ../../tutorial/datastructures.rst:802 msgid "" "Other languages may return the mutated object, which allows method chaining, " "such as ``d->insert(\"a\")->remove(\"b\")->sort();``." msgstr "" -"他の言語では変更可能なオブジェクトを返して、``d->insert(\"a\")-" -">remove(\"b\")->sort();`` のようなメソッドチェインを許している場合もありま" -"す。" +"他の言語では変更後のオブジェクトを返して、``d->insert(\"a\")->remove(\"b\")-" +">sort();`` のようなメソッドチェインを許している場合もあります。" diff --git a/tutorial/modules.po b/tutorial/modules.po index d550baea9..df8edb63b 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -27,7 +27,6 @@ msgstr "" msgid "Modules" msgstr "モジュール" -#: ../../tutorial/modules.rst:7 msgid "" "If you quit from the Python interpreter and enter it again, the definitions " "you have made (functions and variables) are lost. Therefore, if you want to " @@ -39,13 +38,15 @@ msgid "" "programs without copying its definition into each program." msgstr "" "Python インタプリタを終了させ、再び起動すると、これまでに行ってきた定義 (関数" -"や変数) は失われています。ですから、より長いプログラムを書きたいなら、テキス" -"トエディタを使ってインタプリタへの入力を用意しておき、手作業の代わりにファイ" -"ルを入力に使って動作させるとよいでしょう。この作業を *スクリプト (script)* の" -"作成と言います。プログラムが長くなるにつれ、メンテナンスを楽にするために、ス" -"クリプトをいくつかのファイルに分割したくなるかもしれません。また、いくつかの" -"プログラムで書いてきた便利な関数について、その定義をコピーすることなく個々の" -"プログラムで使いたいと思うかもしれません。" +"や変数) は失われています。\n" +"ですから、より長いプログラムを書きたいなら、\n" +"テキストエディタを使ってインタプリタへの入力を用意しておき、手作業の代わりに" +"ファイルを入力に使って動作させるとよいでしょう。\n" +"この作業を *スクリプト (script)* の作成と言います。\n" +"プログラムが長くなるにつれ、メンテナンスを楽にするために、スクリプトをいくつ" +"かのファイルに分割したくなるかもしれません。\n" +"また、自分で書いた便利な関数を、定義を各プログラムにコピーせずに複数のプログ" +"ラムで使いたいと思うかもしれません。" #: ../../tutorial/modules.rst:16 msgid "" @@ -76,7 +77,6 @@ msgstr "" "のテキストエディタを使って、現在のディレクトリに以下の内容のファイル :file:" "`fibo.py` を作成してみましょう::" -#: ../../tutorial/modules.rst:28 msgid "" "# Fibonacci numbers module\n" "\n" @@ -100,7 +100,7 @@ msgstr "" "# フィボナッチ数のモジュール\n" "\n" "def fib(n):\n" -" \"\"\"nまでのフィボナッチ数を出力する\"\"\"\n" +" \"\"\"n 未満のフィボナッチ数列を出力する\"\"\"\n" " a, b = 0, 1\n" " while a < n:\n" " print(a, end=' ')\n" @@ -108,7 +108,7 @@ msgstr "" " print()\n" "\n" "def fib2(n):\n" -" \"\"\"nまでのフィボナッチ数を返す\"\"\"\n" +" \"\"\"n 未満のフィボナッチ数列を返す\"\"\"\n" " result = []\n" " a, b = 0, 1\n" " while a < n:\n" @@ -280,13 +280,12 @@ msgstr "" "からです。しかし、対話セッションでキータイプの量を減らすために使うのは構わな" "いでしょう。" -#: ../../tutorial/modules.rst:118 msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -"モジュール名の後に :keyword:`!as` が続いていた場合は、 :keyword:`!as` の後ろ" -"の名前を直接、インポートされたモジュールが束縛します。" +"モジュール名の後に :keyword:`!as` を続けると、\n" +":keyword:`!as` の後ろの名前がインポートしたモジュールに直接束縛されます。" #: ../../tutorial/modules.rst:123 msgid "" @@ -350,15 +349,15 @@ msgstr "Python モジュールを ::" msgid "python fibo.py " msgstr "python fibo.py " -#: ../../tutorial/modules.rst:155 msgid "" "the code in the module will be executed, just as if you imported it, but " "with the ``__name__`` set to ``\"__main__\"``. That means that by adding " "this code at the end of your module::" msgstr "" -"と実行すると、``__name__`` に ``__main__`` が設定されている点を除いて import " -"したときと同じようにモジュール内のコードが実行されます。つまりモジュールの末" -"尾に::" +"と実行すると、モジュール内のコードは import したときと同じように実行されます" +"が、\n" +"``__name__`` には文字列 ``\"__main__\"`` が設定されます。\n" +"この違いを利用するために、モジュールの末尾に次のコードを追加します。 ::" #: ../../tutorial/modules.rst:159 msgid "" @@ -401,20 +400,20 @@ msgstr "" ">>> import fibo\n" ">>>" -#: ../../tutorial/modules.rst:177 msgid "" "This is often used either to provide a convenient user interface to a " "module, or for testing purposes (running the module as a script executes a " "test suite)." msgstr "" -"この方法はモジュールに便利なユーザインターフェースを提供したり、テストのため" -"に (スクリプトをモジュールとして起動しテストスイートを実行して) 使われます。" +"この方法はモジュールに便利なユーザインターフェースを提供したり、テストを行っ" +"たりするためによく使われます。\n" +"後者では、モジュールをスクリプトとして実行するとテストスイートが実行されま" +"す。" #: ../../tutorial/modules.rst:184 msgid "The Module Search Path" msgstr "モジュール検索パス" -#: ../../tutorial/modules.rst:188 msgid "" "When a module named :mod:`!spam` is imported, the interpreter first searches " "for a built-in module with that name. These module names are listed in :data:" @@ -424,9 +423,11 @@ msgid "" msgstr "" ":mod:`!spam` という名前のモジュールをインポートするとき、インタープリタはまず" "その名前の組み込みモジュールを探します。モジュール名の一覧は :data:`sys." -"builtin_module_names` にあります。見つからなかった場合は、 :file:`spam.py` と" -"いう名前のファイルを :data:`sys.path` にあるディレクトリのリストから探しま" -"す。 :data:`sys.path` は以下の場所に初期化されます:" +"builtin_module_names` にあります。\n" +"見つからなかった場合は、\n" +":file:`spam.py` という名前のファイルを :data:`sys.path` にあるディレクトリの" +"リストから探します。\n" +":data:`sys.path` は次の場所を基に初期化されます。" #: ../../tutorial/modules.rst:194 msgid "" @@ -558,15 +559,14 @@ msgstr "" "を持ち、通常のコンパイル済みモジュールよりサイズが小さくなります。将来のリ" "リースでは最適化の影響が変わる可能性があります。" -#: ../../tutorial/modules.rst:253 msgid "" "A program doesn't run any faster when it is read from a ``.pyc`` file than " "when it is read from a ``.py`` file; the only thing that's faster about ``." "pyc`` files is the speed with which they are loaded." msgstr "" -"``.pyc`` ファイルや ``.pyo`` ファイルから読み出されたとしても、プログラムは " -"``.py`` ファイルから読み出されたときより何ら高速に動作するわけではありませ" -"ん。``.pyc`` ファイルで高速化されるのは、読み込みにかかる時間だけです。" +"``.pyc`` ファイルから読み出されたとしても、プログラムは ``.py`` ファイルから" +"読み出されたときより何ら高速に動作するわけではありません。\n" +"``.pyc`` ファイルで高速化されるのは、読み込みにかかる時間だけです。" #: ../../tutorial/modules.rst:257 msgid "" @@ -588,7 +588,6 @@ msgstr "" msgid "Standard Modules" msgstr "標準モジュール" -#: ../../tutorial/modules.rst:271 msgid "" "Python comes with a library of standard modules, described in a separate " "document, the Python Library Reference (\"Library Reference\" hereafter). " @@ -602,15 +601,20 @@ msgid "" "into every Python interpreter. The variables ``sys.ps1`` and ``sys.ps2`` " "define the strings used as primary and secondary prompts::" msgstr "" -"Python は標準モジュールライブラリを同梱していて、別の Python ライブラリリファ" -"レンスというドキュメントで解説しています。幾つかのモジュールは言語のコアには" -"アクセスしないものの、効率や、システムコールなどOSの機能を利用するために、イ" -"ンタープリター内部にビルトインされています。そういったモジュールセットはまた" -"プラットフォームに依存した構成オプションです。例えば、 :mod:`winreg` モジュー" -"ルは Windows システムでのみ提供されています。 1つ注目に値するモジュールとし" -"て、 :mod:`sys` モジュールは、全ての Python インタープリターにビルトインされ" -"ています。 ``sys.ps1`` と ``sys.ps2`` という変数は一次プロンプトと二次プロン" -"プトに表示する文字列を定義しています::" +"Python は標準モジュールのライブラリを同梱していて、別のドキュメント「Python " +"ライブラリリファレンス」(以下「ライブラリリファレンス」) で解説しています。\n" +"一部のモジュールはインタープリターに組み込まれていて、言語の中核には含まれな" +"い操作を提供します。\n" +"これらが組み込まれているのは、効率を高めたり、\n" +"システムコールなどのオペレーティングシステムの基本機能を利用できるようにした" +"りするためです。\n" +"どのモジュールを組み込むかは構成オプションで指定し、動作するプラットフォーム" +"にも依存します。\n" +"例えば、:mod:`winreg` モジュールは Windows システムでのみ提供されています。\n" +"特に注目したいのが、すべての Python インタープリターに組み込まれている :mod:" +"`sys` モジュールです。\n" +"``sys.ps1`` と ``sys.ps2`` という変数は、一次プロンプトと二次プロンプトに使わ" +"れる文字列を定義しています。 ::" #: ../../tutorial/modules.rst:283 msgid "" @@ -769,14 +773,14 @@ msgstr "" "変数、モジュール、関数、その他の、すべての種類の名前をリストすることに注意し" "てください。" -#: ../../tutorial/modules.rst:352 msgid "" ":func:`dir` does not list the names of built-in functions and variables. If " "you want a list of those, they are defined in the standard module :mod:" "`builtins`::" msgstr "" -":func:`dir` は、組込みの関数や変数の名前はリストしません。これらの名前からな" -"るリストが必要なら、標準モジュール :mod:`builtins` で定義されています::" +":func:`dir` は組込みの関数や変数の名前を列挙しません。\n" +"その名前の一覧が必要な場合は、定義元の標準モジュール :mod:`builtins` を調べま" +"す。 ::" #: ../../tutorial/modules.rst:356 msgid "" @@ -942,13 +946,13 @@ msgstr "" " karaoke.py\n" " ..." -#: ../../tutorial/modules.rst:438 msgid "" "When importing the package, Python searches through the directories on ``sys." "path`` looking for the package subdirectory." msgstr "" -"パッケージを import する際、 Python は ``sys.path`` 上のディレクトリを検索し" -"て、トップレベルのパッケージの入ったサブディレクトリを探します。" +"パッケージを import する際、Python は ``sys.path`` 上のディレクトリを検索" +"し、\n" +"パッケージに対応するサブディレクトリを探します。" #: ../../tutorial/modules.rst:441 msgid "" @@ -1212,23 +1216,21 @@ msgstr "" "のみを公開 (export) するように設計されてはいますが、それでもやはり製品のコー" "ドでは良いことではないと考えます。" -#: ../../tutorial/modules.rst:556 msgid "" "Remember, there is nothing wrong with using ``from package import " "specific_submodule``! In fact, this is the recommended notation unless the " "importing module needs to use submodules with the same name from different " "packages." msgstr "" -"``from package import specific_submodule`` を使っても何も問題はないことに留意" -"してください!実際この表記法は、import を行うモジュールが他のパッケージと同じ" -"名前を持つサブモジュールを使わなければならない場合を除いて推奨される方式で" -"す。" +"``from package import specific_submodule`` を使っても問題はありません。\n" +"実際には、import を行うモジュールで異なるパッケージの同名のサブモジュールを使" +"う必要がある場合を除き、\n" +"この書き方が推奨されます。" #: ../../tutorial/modules.rst:565 msgid "Intra-package References" msgstr "パッケージ内参照" -#: ../../tutorial/modules.rst:567 msgid "" "When packages are structured into subpackages (as with the :mod:`!sound` " "package in the example), you can use absolute imports to refer to submodules " @@ -1237,10 +1239,12 @@ msgid "" "package, it can use ``from sound.effects import echo``." msgstr "" "パッケージが (前述の例の :mod:`!sound` パッケージのように) サブパッケージの集" -"まりに構造化されている場合、絶対 import を使って兄弟関係にあるパッケージを参" -"照できます。例えば、モジュール :mod:`!sound.filters.vocoder` で :mod:`!sound." -"effects` パッケージの :mod:`!echo` モジュールが必要な場合、 ``from sound." -"effects import echo`` が使えます。" +"まりに構造化されている場合、\n" +"絶対 import を使って兄弟関係にあるパッケージのサブモジュールを参照できま" +"す。\n" +"例えば、モジュール :mod:`!sound.filters.vocoder` で :mod:`!sound.effects` " +"パッケージの :mod:`!echo` モジュールが必要な場合、\n" +"``from sound.effects import echo`` が使えます。" #: ../../tutorial/modules.rst:573 msgid "" From bdc63bd3c6214706c762cb7bfa14b5abb9fe82f2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Oct 2026 05:08:33 +0000 Subject: [PATCH 10/21] Merge 3.15 into 3.14 --- howto/descriptor.po | 17 ++- howto/regex.po | 51 ++++----- library/logging.po | 29 ++--- library/zipapp.po | 3 +- reference/datamodel.po | 36 +++--- reference/expressions.po | 3 +- tutorial/appendix.po | 24 ++-- tutorial/classes.po | 241 ++++++++++++++++++++------------------- tutorial/errors.po | 67 +++++------ tutorial/inputoutput.po | 23 ++-- tutorial/interactive.po | 11 +- tutorial/stdlib.po | 38 +++--- tutorial/stdlib2.po | 6 +- tutorial/whatnow.po | 11 +- 14 files changed, 276 insertions(+), 284 deletions(-) diff --git a/howto/descriptor.po b/howto/descriptor.po index b94735137..972b12b00 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -31,13 +31,12 @@ msgstr "デスクリプタ ガイド" msgid "Contents" msgstr "内容" -#: ../../howto/descriptor.rst:10 msgid "" ":term:`Descriptors ` let objects customize attribute lookup, " "storage, and deletion." msgstr "" -":term:`デスクリプタ ` を使うと、オブジェクトの属性検索、保存、削" -"除をカスタマイズできます。" +":term:`デスクリプタ ` を使うと、オブジェクトの属性の検索、保存、" +"削除をカスタマイズできます。" #: ../../howto/descriptor.rst:13 msgid "This guide has four major sections:" @@ -979,17 +978,16 @@ msgid "" "__getattribute__` method for object returned by :func:`super`." msgstr "" -#: ../../howto/descriptor.rst:792 msgid "" "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." "__mro__`` for the base class ``B`` immediately following ``A`` and then " "returns ``B.__dict__['m'].__get__(obj, A)``. If not a descriptor, ``m`` is " "returned unchanged." msgstr "" -"``super(A, obj).m`` のようなドットを使ったルックアップは ``obj.__class__." -"__mro__`` を探索して、 ``A`` の直前のクラス ``B`` をまず探し、 ``B." -"__dict__['m'].__get__(obj, A)`` を返します。もしデスクリプタでなければ ``m`` " -"を変更せずに返します。" +"``super(A, obj).m`` のようにドット記法で属性を検索すると、``obj.__class__." +"__mro__`` の中で ``A`` の直後にある基底クラス ``B`` を探し、\n" +"``B.__dict__['m'].__get__(obj, A)`` を返します。\n" +"``m`` がデスクリプタでなければ、そのまま返します。" #: ../../howto/descriptor.rst:797 msgid "" @@ -1053,9 +1051,8 @@ msgid "Non-data descriptors may be overridden by instance dictionaries." msgstr "" "非データデスクリプタは、インスタンス辞書にオーバーライドされることがある" -#: ../../howto/descriptor.rst:830 msgid "Automatic name notification" -msgstr "自動的の名前の伝達" +msgstr "名前の自動通知" #: ../../howto/descriptor.rst:832 msgid "" diff --git a/howto/regex.po b/howto/regex.po index f057fe814..a2be449a6 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -83,7 +83,6 @@ msgstr "" "化までは扱いません、それにはマッチングエンジンの内部に対する十分な理解が必要" "だからです。" -#: ../../howto/regex.rst:40 msgid "" "The regular expression language is relatively small and restricted, so not " "all possible string processing tasks can be done using regular expressions. " @@ -93,11 +92,13 @@ msgid "" "be slower than an elaborate regular expression, it will also probably be " "more understandable." msgstr "" -"正規表現言語は相対的に小さく、制限されています、そのため正規表現を使ってあら" -"ゆる文字列処理作業を行なえるわけではありません。正規表現を使って行うことので" -"きる作業もあります、ただ表現はとても複雑なものになります。それらの場合では、" -"Python コードを書いた方がいいでしょう; Python コードは念入りに作られた正規表" -"現より遅くなりますが、おそらくより読み易いでしょう。" +"正規表現の言語は比較的小規模で機能も限られているため、あらゆる文字列処理を正" +"規表現で行えるわけではありません。\n" +"正規表現で処理することは *できても*、その正規表現が非常に複雑になってしまう作" +"業もあります。\n" +"そうした場合は、処理を Python コードで書いた方がよいかもしれません。\n" +"Python コードは工夫を凝らした正規表現より遅くなりますが、おそらく理解しやすく" +"なるでしょう。" #: ../../howto/regex.rst:49 msgid "Simple patterns" @@ -185,17 +186,17 @@ msgstr "" "ベットのみにマッチしたい場合、 ``[a-z]`` の正規表現をつかうことになるでしょ" "う。" -#: ../../howto/regex.rst:90 msgid "" "Metacharacters (except ``\\``) are not active inside classes. For example, " "``[akm$]`` will match any of the characters ``'a'``, ``'k'``, ``'m'``, or " "``'$'``; ``'$'`` is usually a metacharacter, but inside a character class " "it's stripped of its special nature." msgstr "" -"(``\\`` を除く) 特殊文字は文字クラスの内部では有効になりません。例えば、 " -"``[akm$]`` は ``'a'``, ``'k'``, ``'m'``, または ``'{TX-PL-LABEL}#x27;`` のい" -"ずれかにマッチします; ``'{TX-PL-LABEL}#x27;`` は通常は特殊文字ですが、文字ク" -"ラス内部ではその特別な性質は取り除かれます。" +"文字クラスの内部では、``\\`` を除く特殊文字は特別な意味を持ちません。\n" +"例えば ``[akm$]`` は ``'a'``、``'k'``、``'m'``、``'$'`` のいずれかにマッチし" +"ます。\n" +"``'$'`` は通常は特殊文字ですが、文字クラスの内部ではその特別な意味を失いま" +"す。" #: ../../howto/regex.rst:95 msgid "" @@ -239,7 +240,6 @@ msgstr "" "``'\\'`` で始まるいくつかの特殊シーケンスは、数字、アルファベット、空白文字以" "外など、よく使う文字集合を表しています。" -#: ../../howto/regex.rst:113 msgid "" "Let's take an example: ``\\w`` matches any alphanumeric character. If the " "regex pattern is expressed in bytes, this is equivalent to the class ``[a-zA-" @@ -249,12 +249,12 @@ msgid "" "in a string pattern by supplying the :const:`re.ASCII` flag when compiling " "the regular expression." msgstr "" -"一つ例をお見せしましょう: ``\\w`` は任意の英数字文字にマッチします。バイト列" -"パターンに対しては、これは文字クラス ``[a-zA-Z0-9_]`` と等価です。ユニコード" -"パターンに対しては、 ``\\w`` は :mod:`unicodedata` モジュールで提供されてい" -"る Unicode データベースで letters としてマークされている全ての文字とマッチし" -"ます。正規表現のコンパイル時に :const:`re.ASCII` フラグを与えることにより、 " -"``\\w`` を、より制限された定義で使うことが出来ます。" +"例えば、``\\w`` は任意の英数字にマッチします。\n" +"バイト列のパターンでは、これは文字クラス ``[a-zA-Z0-9_]`` と同じです。\n" +"文字列のパターンでは、``\\w`` は :mod:`unicodedata` モジュールが提供する " +"Unicode データベースで文字 (letter) とされるすべての文字にマッチします。\n" +"正規表現のコンパイル時に :const:`re.ASCII` フラグを指定すると、\n" +"文字列のパターンでも ``\\w`` のマッチ対象を ``[a-zA-Z0-9_]`` に制限できます。" #: ../../howto/regex.rst:121 msgid "" @@ -517,7 +517,6 @@ msgid "" "``'b'``, so it succeeds." msgstr "再び ``b`` を試みる。今回の現在位置の文字は ``'b'`` なので成功。" -#: ../../howto/regex.rst:217 msgid "" "The end of the RE has now been reached, and it has matched ``'abcb'``. This " "demonstrates how the matching engine goes as far as it can at first, and if " @@ -526,13 +525,13 @@ msgid "" "``[bcd]*``, and if that subsequently fails, the engine will conclude that " "the string doesn't match the RE at all." msgstr "" -"正規表現の終端に達して、 ``'abcd'`` にマッチしました。\n" -"この説明は、マッチングエンジンが最初に到達できるところまで進みマッチしなかっ" -"た場合、逐次戻って再度残りの正規表現とのマッチを次々と試みること様子を示して" -"います。\n" -"正規表現エンジンは ``[bcd]*`` の 0 回マッチを試すところまで戻り、その後続の正" -"規表現とのマッチに失敗した場合には、エンジンは正規表現と文字列が完全にマッチ" -"しないと結論づけることになります。" +"これで正規表現の末尾に達し、``'abcb'`` にマッチしました。\n" +"この例が示すように、マッチングエンジンはまず可能な限り先へ進みます。\n" +"マッチしなければ少しずつ後戻りし、残りの正規表現とのマッチを繰り返し試みま" +"す。\n" +"``[bcd]*`` が 0 回マッチする場合まで後戻りしても残りの正規表現がマッチしなけ" +"れば、\n" +"その文字列はこの正規表現にマッチしないと判断します。" #: ../../howto/regex.rst:224 msgid "" diff --git a/library/logging.po b/library/logging.po index 7bf78bab7..00a3cfe2c 100644 --- a/library/logging.po +++ b/library/logging.po @@ -1256,7 +1256,6 @@ msgstr "*validate* パラメータが追加されました。" msgid "Added the *defaults* parameter." msgstr "*defaults* パラメータが追加されました。" -#: ../../library/logging.rst:707 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -1274,19 +1273,21 @@ msgid "" "the next formatter to handle the event doesn't use the cached value, but " "recalculates it afresh." msgstr "" -"レコードの属性辞書が、文字列を書式化する演算で被演算子として使われます。書式" -"化された結果の文字列を返します。辞書を書式化する前に、二つの準備段階を経ま" -"す。レコードの *message* 属性が *msg* % *args* を使って処理されます。書式化さ" -"れた文字列が ``'(asctime)'`` を含むなら、 :meth:`formatTime` が呼び出され、イ" -"ベントの発生時刻を書式化します。例外情報が存在する場合、 :meth:" -"`formatException` を使って書式化され、メッセージに追加されます。ここで注意し" -"ていただきたいのは、書式化された例外情報は *exc_text* にキャッシュされるとい" -"う点です。これが有用なのは例外情報がピックル化されて回線上を送ることができる" -"からですが、しかし二つ以上の :class:`Formatter` サブクラスで例外情報の書式化" -"をカスタマイズしている場合には注意が必要になります。この場合、フォーマッタが" -"書式化を終えるごとにキャッシュをクリアして( *ext_text* 属性に ``None`` を設" -"定して)、次のフォーマッタがキャッシュされた値を使わずに新鮮な状態で再計算す" -"るようにしなければならないことになります。" +"レコードの属性辞書を使って文字列を書式化し、その結果を返します。\n" +"書式化の前にはいくつかの準備処理を行います。\n" +"まず、レコードの ``message`` 属性を ``msg % args`` で計算します。\n" +"次に、書式文字列に ``'(asctime)'`` が含まれていれば、:meth:`formatTime` を呼" +"び出してイベントの発生時刻を書式化します。\n" +"例外情報があれば、:meth:`formatException` で書式化してメッセージの末尾に追加" +"します。\n" +"書式化した例外情報は ``exc_text`` 属性にキャッシュされます。\n" +"これにより例外情報を pickle 化してネットワーク経由で送信できますが、\n" +"例外情報の書式化をカスタマイズする :class:`Formatter` のサブクラスを複数使う" +"場合には注意が必要です。\n" +"この場合、各フォーマッタが書式化を終えた後に ``exc_text`` 属性を ``None`` に" +"設定してキャッシュを消去する必要があります。\n" +"そうすると、次のフォーマッタはキャッシュされた値を使わずに例外情報を書式化し" +"直します。" #: ../../library/logging.rst:723 msgid "" diff --git a/library/zipapp.po b/library/zipapp.po index a16cec563..451fb0804 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -71,11 +71,10 @@ msgstr "" msgid "Command-Line Interface" msgstr "コマンドラインインターフェイス" -#: ../../library/zipapp.rst:42 msgid "" "When called as a program from the command line, the following form is used:" msgstr "" -"コマンドラインからプログラムとして呼び出す場合は、次の形式を使用います:" +"コマンドラインからプログラムとして呼び出す場合は、次の形式を使用します。" #: ../../library/zipapp.rst:44 msgid "$ python -m zipapp source [options]" diff --git a/reference/datamodel.po b/reference/datamodel.po index 34538f86b..100978d42 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -2416,7 +2416,6 @@ msgstr "" msgid "Basic customization" msgstr "基本的なカスタマイズ" -#: ../../reference/datamodel.rst:1983 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -2425,12 +2424,15 @@ msgid "" "(the call to the class). The return value of :meth:`__new__` should be the " "new object instance (usually an instance of *cls*)." msgstr "" -"クラス *cls* の新しいインスタンスを作るために呼び出されます。 :meth:" -"`__new__` は静的メソッドで (このメソッドは特別扱いされているので、明示的に静" -"的メソッドと宣言する必要はありません)、インスタンスを生成するよう要求されてい" -"るクラスを第一引数にとります。残りの引数はオブジェクトのコンストラクタの式 " -"(クラスの呼び出し文) に渡されます。 :meth:`__new__` の戻り値は新しいオブジェ" -"クトのインスタンス (通常は *cls* のインスタンス) でなければなりません。" +"クラス ``cls`` の新しいインスタンスを作るために呼び出されます。\n" +":meth:`__new__` は静的メソッドで、インスタンスを生成する対象のクラスを最初の" +"引数に取ります\n" +"(特別扱いされるため、静的メソッドであると明示的に宣言する必要はありませ" +"ん)。\n" +"残りの引数は、オブジェクトのコンストラクタ式 (クラスの呼び出し) に渡されたも" +"のです。\n" +":meth:`__new__` は新しいオブジェクトのインスタンス (通常は ``cls`` のインスタ" +"ンス) を返す必要があります。" #: ../../reference/datamodel.rst:1990 msgid "" @@ -3179,7 +3181,6 @@ msgid "" "does not implement any of these protocols." msgstr "" -#: ../../reference/datamodel.rst:2492 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -3187,10 +3188,12 @@ msgid "" "the attribute was accessed through, or ``None`` when the attribute is " "accessed through the *owner*." msgstr "" -"オーナークラス(クラス属性アクセスの場合)や、クラスのインスタンス(インスタ" -"ンス属性アクセスの場合)の属性取得時に呼び出されます。 *instance* を通じて属" -"性をアクセスする時に、オプションの *owner* 引数はオーナークラスです。 " -"*owner* を通じて属性アクセスするときは ``None`` です。" +"オーナークラスの属性 (クラス属性アクセス) またはそのクラスのインスタンスの属" +"性 (インスタンス属性アクセス) を取得するために呼び出されます。\n" +"オプション引数 ``owner`` はオーナークラスです。\n" +"``instance`` は、インスタンスを通じて属性にアクセスした場合はそのインスタン" +"ス、\n" +"``owner`` を通じてアクセスした場合は ``None`` です。" #: ../../reference/datamodel.rst:2498 msgid "" @@ -3351,16 +3354,15 @@ msgstr "" msgid "Super Binding" msgstr "super 束縛 (Super Binding)" -#: ../../reference/datamodel.rst:2571 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -"``super(A, a).x`` のようなドットを使ったルックアップは ``a.__class__." -"__mro__`` を探索して、 ``A`` の前のクラス ``B`` をまず探し、 ``B." -"__dict__['x'].__get__(a, A)`` を返します。もしデスクリプタでなければ ``x`` を" -"変更せずに返します。" +"``super(A, a).x`` のようにドット記法で属性を検索すると、``a.__class__." +"__mro__`` の中で ``A`` の後にある基底クラス ``B`` を探し、\n" +"``B.__dict__['x'].__get__(a, A)`` を返します。\n" +"``x`` がデスクリプタでなければ、そのまま返します。" #: ../../reference/datamodel.rst:2608 msgid "" diff --git a/reference/expressions.po b/reference/expressions.po index e6d79d010..d0ea72759 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -3649,9 +3649,8 @@ msgstr "例外" msgid "NameError" msgstr "NameError" -#: ../../reference/expressions.rst:139 msgid "mangling" -msgstr "難号化" +msgstr "マングリング" #: ../../reference/expressions.rst:139 msgid "private" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 55b2e9bc3..4f2eeade2 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -30,14 +30,14 @@ msgstr "付録" msgid "Interactive Mode" msgstr "対話モード" -#: ../../tutorial/appendix.rst:13 msgid "" "There are two variants of the interactive :term:`REPL`. The classic basic " "interpreter is supported on all platforms with minimal line control " "capabilities." msgstr "" -"対話型の :term:`REPL` は2種類あります。 クラシックな基本インタープリタは最低" -"限の行制御機能を持つ全プラットフォームでサポートされています。" +"対話型の :term:`REPL` には 2 種類あります。\n" +"従来の基本インタープリタはすべてのプラットフォームで使え、入力行を操作するた" +"めの最小限の機能を備えています。" #: ../../tutorial/appendix.rst:17 msgid "" @@ -191,7 +191,6 @@ msgstr "" "が入ったファイル名に設定します。この機能は Unix シェルの :file:`.profile` に" "似ています。" -#: ../../tutorial/appendix.rst:98 msgid "" "This file is only read in interactive sessions, not when Python reads " "commands from a script, and not when :file:`/dev/tty` is given as the " @@ -201,14 +200,15 @@ msgid "" "qualification in the interactive session. You can also change the prompts " "``sys.ps1`` and ``sys.ps2`` in this file." msgstr "" -"このファイルは対話セッションのときだけ読み出されます。 Python がコマンドをス" -"クリプトから読み出しているときや、 :file:`/dev/tty` がコマンドの入力元として" -"明示的に指定されている(この場合対話的セッションのように動作します) *わけでは" -"ない* 場合にはこのファイルは読み出されません。ファイル内のコマンドは、対話的" -"コマンドが実行される名前空間と同じ名前空間内で実行されます。このため、ファイ" -"ル内で定義されていたり import されたオブジェクトは、そのまま対話セッション内" -"で使うことができます。また、このファイル内で ``sys.ps1`` や ``sys.ps2`` を変" -"更して、プロンプトを変更することもできます。" +"このファイルが読み込まれるのは対話セッションだけです。\n" +"Python がスクリプトからコマンドを読み込む場合や、:file:`/dev/tty` をコマンド" +"の入力元として明示的に指定した場合には読み込まれません。\n" +"後者は、この点を除けば対話セッションと同じように動作します。\n" +"このファイルは対話コマンドと同じ名前空間で実行されます。\n" +"そのため、ファイル内で定義またはインポートしたオブジェクトは、対話セッション" +"で名前を修飾せずに使えます。\n" +"このファイルで ``sys.ps1`` と ``sys.ps2`` を設定すれば、プロンプトも変更でき" +"ます。" #: ../../tutorial/appendix.rst:106 msgid "" diff --git a/tutorial/classes.po b/tutorial/classes.po index 828f9ffc9..ccf90f9e7 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -43,7 +43,6 @@ msgstr "" "クラスのインスタンスは、その状態を変更するための (そのクラスが定義する) メ" "ソッドも持てます。" -#: ../../tutorial/classes.rst:13 msgid "" "Compared with other programming languages, Python's class mechanism adds " "classes with a minimum of new syntax and semantics. It is a mixture of the " @@ -56,17 +55,18 @@ msgid "" "nature of Python: they are created at runtime, and can be modified further " "after creation." msgstr "" -"Python は、他のプログラミング言語と比較して、最小限の構文と意味付けを使ってク" -"ラスを言語に追加しています。Python のクラスは、C++ と Modula-3 のクラスメカニ" -"ズムを混ぜたものです。Python のクラス機構はオブジェクト指向プログラミングの標" -"準的な機能を全て提供しています。クラスの継承メカニズムは、複数の基底クラスを" -"持つことができ、派生クラスで基底クラスの任意のメソッドをオーバライドすること" -"ができます。メソッドでは、基底クラスのメソッドを同じ名前で呼び出すことができ" -"ます。オブジェクトには任意の種類と数のデータを格納することができます。モ" -"ジュールと同じく、クラス機構も Python の動的な性質に従うように設計されていま" -"す。クラスは実行時に生成され、生成後に変更することができます。" +"Python のクラス機構は、ほかのプログラミング言語に比べて、新しく覚える構文や規" +"則を最小限に抑えています。\n" +"その仕組みは C++ と Modula-3 のクラス機構を組み合わせたものです。\n" +"Python のクラスは、オブジェクト指向プログラミングの標準的な機能をすべて備えて" +"います。\n" +"複数の基底クラスを継承でき、派生クラスでは基底クラスのどのメソッドもオーバー" +"ライドできます。\n" +"また、メソッドから基底クラスの同名のメソッドを呼び出せます。\n" +"オブジェクトに格納するデータの種類や数も自由です。\n" +"モジュールと同様に、クラスも Python の動的な性質を持っています。\n" +"クラスは実行時に作られ、作成後に変更することもできます。" -#: ../../tutorial/classes.rst:23 msgid "" "In C++ terminology, normally class members (including the data members) are " "*public* (except see below :ref:`tut-private`), and all member functions are " @@ -80,17 +80,20 @@ msgid "" "(arithmetic operators, subscripting etc.) can be redefined for class " "instances." msgstr "" -"C++ の用語で言えば、通常のクラスメンバ (データメンバも含む) は (:ref:`tut-" -"private` に書かれている例外を除いて) *public* であり、メンバ関数はすべて *仮" -"想関数(virtual)* です。 Modula-3 にあるような、オブジェクトのメンバをメソッド" -"から参照するための短縮した記法は使えません: メソッド関数の宣言では、オブジェ" -"クト自体を表す第一引数を明示しなければなりません。第一引数のオブジェクトはメ" -"ソッド呼び出しの際に暗黙の引数として渡されます。 Smalltalk に似て、クラスはそ" -"れ自体がオブジェクトです。そのため、 import や名前変更といった操作が可能で" -"す。 C++ や Modula-3 と違って、ユーザーは組込み型を基底クラスにして拡張を行え" -"ます。また、C++ とは同じで Modula-3 とは違う点として、特別な構文を伴うほとん" -"どの組み込み演算子 (算術演算子 (arithmetic operator) や添字表記) はクラスイン" -"スタンスで使うために再定義できます。" +"C++ の用語で言うと、クラスメンバはデータメンバも含めて通常 *public* です\n" +"(例外については :ref:`tut-private` を参照してください)。\n" +"メンバ関数はすべて *仮想関数 (virtual)* です。\n" +"Modula-3 と同様に、メソッド内からオブジェクトのメンバを参照するための短縮記法" +"はありません。\n" +"メソッド関数の宣言では、オブジェクト自体を表す引数を最初に明示します。\n" +"メソッドを呼び出すと、この引数にオブジェクトが暗黙的に渡されます。\n" +"Smalltalk と同様に、クラス自体もオブジェクトなので、インポートしたり別の名前" +"を付けたりできます。\n" +"C++ や Modula-3 と違って、組み込み型を基底クラスにして拡張することもできま" +"す。\n" +"また、C++ と同様に、算術演算子や添字表記など特別な構文を使う組み込み演算子の" +"多くは、\n" +"クラスインスタンスに対する動作を再定義できます。" #: ../../tutorial/classes.rst:34 msgid "" @@ -108,7 +111,6 @@ msgstr "" msgid "A Word About Names and Objects" msgstr "名前とオブジェクトについて" -#: ../../tutorial/classes.rst:45 msgid "" "Objects have individuality, and multiple names (in multiple scopes) can be " "bound to the same object. This is known as aliasing in other languages. " @@ -123,17 +125,23 @@ msgid "" "the caller will see the change --- this eliminates the need for two " "different argument passing mechanisms as in Pascal." msgstr "" -"オブジェクトには個体性があり、同一のオブジェクトに(複数のスコープから) 複数の" -"名前を割り当てることができます。この機能は他の言語では別名づけ(alias) として" -"知られています。 Python を一見しただけでは、別名づけの重要性は分からないこと" -"が多く、変更不能な基本型 (数値、文字列、タプル)を扱うときには無視して差し支え" -"ありません。しかしながら、別名付けは、リストや辞書や他の多くの型など、変更可" -"能な型を扱う Python コード上で驚くべき効果があります。別名付けはいくつかの点" -"でポインタのように振舞い、このことは通常はプログラムに利するように使われま" -"す。例えば、オブジェクトの受け渡しは、実装上はポインタが渡されるだけなのでコ" -"ストの低い操作になります。また、関数があるオブジェクトを引数として渡されたと" -"き、関数の呼び出し側からオブジェクトに対する変更を見ることができます --- これ" -"により、 Pascal にあるような二つの引数渡し機構をもつ必要をなくしています。" +"オブジェクトはそれぞれ固有の存在ですが、同じオブジェクトに複数のスコープから" +"複数の名前を束縛できます。\n" +"ほかの言語では、これをエイリアス (別名) と呼びます。\n" +"Python を学び始めたばかりでは、この仕組みの重要性は分かりにくいかもしれませ" +"ん。\n" +"数値、文字列、タプルのようなイミュータブル (変更できない) な基本型を扱うとき" +"は、気にしなくても問題ありません。\n" +"一方、リストや辞書など多くの型のミュータブル (変更できる) なオブジェクトを扱" +"うコードでは、\n" +"エイリアスによって意外な動作が起こることがあります。\n" +"エイリアスはいくつかの点でポインタのように振る舞うため、通常はその性質をプロ" +"グラムに役立てられます。\n" +"例えば、オブジェクトを渡す際に実装上渡されるのはポインタだけなので、処理の負" +"担は小さくなります。\n" +"また、関数が引数として受け取ったオブジェクトを変更すると、呼び出し側からもそ" +"の変更が見えます。\n" +"このため、Pascal のように引数の渡し方を 2 種類用意する必要がありません。" #: ../../tutorial/classes.rst:61 msgid "Python Scopes and Namespaces" @@ -284,9 +292,9 @@ msgstr "" "外側の(enclosing)関数のスコープは、近いほうから順に探され、ローカルでもグロー" "バルでもない名前を持っています。" -#: ../../tutorial/classes.rst:123 msgid "the next-to-last scope contains the current module's global names" -msgstr "次のスコープは、現在のモジュールのグローバルな名前を持っています。" +msgstr "" +"最後から 2 番目のスコープは現在のモジュールのグローバルな名前を持っています。" #: ../../tutorial/classes.rst:124 msgid "" @@ -340,7 +348,6 @@ msgstr "" "ル\" 時の静的な名前解決の方向に進化しているので、動的な名前解決に頼ってはいけ" "ません! (事実、ローカルな変数は既に静的に決定されています。)" -#: ../../tutorial/classes.rst:146 msgid "" "A special quirk of Python is that -- if no :keyword:`global` or :keyword:" "`nonlocal` statement is in effect -- assignments to names always go into the " @@ -351,14 +358,14 @@ msgid "" "particular, :keyword:`import` statements and function definitions bind the " "module or function name in the local scope." msgstr "" -"Python の特徴として、:keyword:`global` や :keyword:`nonlocal` 文が有効でない" -"場合は、名前に対する参照は常に最も内側のスコープに対して有効になります。\n" -"代入はデータをコピーしません。オブジェクトを名前に束縛するだけです。削除も同" -"様で、``del x`` は、ローカルスコープの名前空間から ``x`` に対する拘束を取り" -"除きます。\n" -"つまるところ、新しい名前を与えるようなすべての操作は、ローカルスコープを使っ" -"て行われます。 :keyword:`import` 文、関数の定義は、モジュールや関数名をローカ" -"ルスコープの名前に拘束します。" +":keyword:`global` 文や :keyword:`nonlocal` 文が有効でない場合、\n" +"Python では名前への代入は常に最も内側のスコープで行われます。\n" +"代入はデータをコピーせず、名前をオブジェクトに束縛するだけです。\n" +"削除も同様で、``del x`` はローカルスコープの名前空間から ``x`` の束縛を削除し" +"ます。\n" +"新しい名前を導入する操作はすべてローカルスコープを使います。\n" +"例えば :keyword:`import` 文や関数定義は、モジュール名や関数名をローカルスコー" +"プで束縛します。" #: ../../tutorial/classes.rst:154 msgid "" @@ -710,7 +717,6 @@ msgstr "" "スオブジェクトが理解できる唯一の操作は、属性の参照です。有効な属性名には " "(データ属性およびメソッドの) 二種類あります。" -#: ../../tutorial/classes.rst:328 msgid "" "*Data attributes* correspond to \"instance variables\" in Smalltalk, and to " "\"data members\" in C++. Data attributes need not be declared; like local " @@ -719,11 +725,13 @@ msgid "" "following piece of code will print the value ``16``, without leaving a " "trace::" msgstr "" -"*データ属性 (Data attribute)* は、 Smalltalk の \"インスタンス変数\" や C+" -"+の \"データメンバ\" に相当します。データ属性を宣言する必要はありません。ロー" -"カル変数と同様に、これらの属性は最初に代入された時点で湧き出てきます。例え" -"ば、上で生成した :class:`!MyClass` のインスタンス ``x`` に対して、次のコード" -"を実行すると、跡を残さず値 ``16`` を印字します:" +"*データ属性 (data attribute)* は Smalltalk の「インスタンス変数」や C++ の" +"「データメンバ」に相当します。\n" +"データ属性を宣言する必要はありません。\n" +"ローカル変数と同様に、初めて値を代入したときに作られます。\n" +"例えば、``x`` が上で作成した :class:`!MyClass` のインスタンスなら、\n" +"次のコードは値 ``16`` を表示した後、追加した ``counter`` 属性を削除しま" +"す。 ::" #: ../../tutorial/classes.rst:334 msgid "" @@ -836,7 +844,6 @@ msgstr "" "スオブジェクトを最初の引数の前に挿入した引数リストで、メソッドに対応する関数" "を呼び出すことと等価です。" -#: ../../tutorial/classes.rst:385 msgid "" "In general, methods work as follows. When a non-data attribute of an " "instance is referenced, the instance's class is searched. If the name " @@ -846,17 +853,17 @@ msgid "" "argument list is constructed from the instance object and the argument list, " "and the function object is called with this new argument list." msgstr "" -"一般的に、メソッドは以下のように動作します。インスタンスの非データ属性が参照" -"されたときは、そのインスタンスのクラスが検索されます。その名前が有効なクラス" -"属性を表している関数オブジェクトなら、インスタンスオブジェクトと関数オブジェ" -"クトの両方への参照がメソッドオブジェクトにパックされます。メソッドオブジェク" -"トが引数リストと共に呼び出されるとき、インスタンスオブジェクトと渡された引数" -"リストから新しい引数リストを作成して、元の関数オブジェクトを新しい引数リスト" -"で呼び出します。" +"メソッドは一般に次のように動作します。\n" +"インスタンスの非データ属性を参照すると、そのインスタンスのクラスから属性を探" +"します。\n" +"見つかった属性が関数オブジェクトなら、インスタンスと関数の両方への参照をまと" +"めてメソッドオブジェクトにします。\n" +"そのメソッドを呼び出すと、渡された引数の先頭にインスタンスを加えた新しい引数" +"リストが作られます。\n" +"そして、その引数リストで関数を呼び出します。" -#: ../../tutorial/classes.rst:398 msgid "Class and Instance Variables" -msgstr "クラスとインスタンス変数" +msgstr "クラス変数とインスタンス変数" #: ../../tutorial/classes.rst:400 msgid "" @@ -1001,13 +1008,12 @@ msgstr "" msgid "Random Remarks" msgstr "いろいろな注意点" -#: ../../tutorial/classes.rst:473 msgid "" "If the same attribute name occurs in both an instance and in a class, then " "attribute lookup prioritizes the instance::" msgstr "" -"インスタンスとクラスの両方で同じ属性名が使用されている場合、属性検索はインス" -"タンスが優先されます。" +"インスタンスとクラスに同じ名前の属性がある場合、属性の検索ではインスタンス側" +"が優先されます。 ::" #: ../../tutorial/classes.rst:476 msgid "" @@ -1396,7 +1402,6 @@ msgstr "" "る言語で call-next-method として知られており、単一継承しかない言語の super 呼" "び出しよりも強力です。" -#: ../../tutorial/classes.rst:653 msgid "" "Dynamic ordering is necessary because all cases of multiple inheritance " "exhibit one or more diamond relationships (where at least one of the parent " @@ -1411,16 +1416,21 @@ msgid "" "properties make it possible to design reliable and extensible classes with " "multiple inheritance. For more detail, see :ref:`python_2.3_mro`." msgstr "" -"動的順序付けが必要なのは、すべての多重継承で1つ以上のダイヤモンド継承 (少な" -"くとも 1 つの祖先クラスに対して最下位クラスから到達する経路が複数ある状態) が" -"見られるためです。例えば、全ての新形式のクラスは :class:`object` を継承してい" -"るので、どの多重継承でも :class:`object` への到達経路が複数あります。基底クラ" -"スが複数回アクセスされないようにするために、動的アルゴリズムで検索順序を線形" -"化します。それは、各クラスで指定されている左から右への順序は崩さず、各々の祖" -"先クラスを一度だけ呼び出し、かつ単調になる (つまり祖先クラスの検索順序に影響" -"を与えずにクラスをサブクラス化できる) ように行います。まとめると、これらの特" -"徴のおかげで信頼性と拡張性のある多重継承したクラスを設計することができるので" -"す。詳細は、 :ref:`python_2.3_mro` を見てください。" +"検索順序を動的に決める必要があるのは、どの多重継承にも 1 つ以上のダイヤモンド" +"関係があるためです。\n" +"これは、最も下位のクラスから同じ祖先クラスに複数の経路でたどり着ける関係を指" +"します。\n" +"例えば、すべてのクラスは :class:`object` を継承するので、多重継承では :class:" +"`object` に至る経路が複数あります。\n" +"同じ基底クラスを何度もたどらないように、動的なアルゴリズムで検索順序を一列に" +"並べます。\n" +"この順序は、各クラスで指定した基底クラスの左から右への順序を保ち、各祖先クラ" +"スを一度だけたどるように決まります。\n" +"さらに、サブクラスを作っても祖先クラス同士の優先順位が変わらない「単調性」を" +"保ちます。\n" +"こうした性質により、信頼性が高く拡張しやすい多重継承のクラスを設計できま" +"す。\n" +"詳しくは :ref:`python_2.3_mro` を参照してください。" #: ../../tutorial/classes.rst:666 msgid "" @@ -1449,7 +1459,6 @@ msgstr "" "ソッドであれデータメンバであれ) 非 public なAPIとして扱います。これらは、予告" "なく変更されるかもしれない実装の詳細として扱われるべきです。" -#: ../../tutorial/classes.rst:685 msgid "" "Since there is a valid use-case for class-private members (namely to avoid " "name clashes of names with names defined by subclasses), there is limited " @@ -1460,14 +1469,17 @@ msgid "" "stripped. This mangling is done without regard to the syntactic position of " "the identifier, as long as it occurs within the definition of a class." msgstr "" -"クラスのプライベートメンバについて適切なユースケース(特にサブクラスで定義され" -"た名前との衝突を避ける場合)があるので、名前マングリング (:dfn:`name " -"mangling`) と呼ばれる、限定されたサポート機構があります。 ``__spam`` (先頭に" -"二個以上の下線文字、末尾に一個以下の下線文字) という形式の識別子は、 " -"``_classname__spam`` へとテキスト置換されるようになりました。ここで " -"``classname`` は、現在のクラス名から先頭の下線文字をはぎとった名前になりま" -"す。このような難号化 (mangle) は、識別子の文法的な位置にかかわらず行われるの" -"で、クラス定義内に現れた識別子全てに対して実行されます。" +"クラスのプライベートメンバは、サブクラスで定義された名前との衝突を避けるのに" +"役立ちます。\n" +"この用途のために、Python は名前マングリング (:dfn:`name mangling`) という限定" +"的な仕組みを備えています。\n" +"``__spam`` のように、先頭に 2 個以上、末尾に 1 個以下のアンダースコアを持つ識" +"別子は、\n" +"テキスト上で ``_classname__spam`` に置き換えられます。\n" +"``classname`` は現在のクラス名から先頭のアンダースコアを取り除いたもので" +"す。\n" +"対象の識別子がクラス定義内にあれば、構文上の位置に関係なくこの変換が行われま" +"す。" #: ../../tutorial/classes.rst:696 msgid "" @@ -1538,19 +1550,17 @@ msgstr "" "``MappingSubclass`` クラスでは ``_MappingSubclass__update`` にそれぞれ置き換" "えるからです。" -#: ../../tutorial/classes.rst:726 msgid "" "Note that the mangling rules are designed mostly to avoid accidents; it " "still is possible to access or modify a variable that is considered " "private. This can even be useful in special circumstances, such as in the " "debugger." msgstr "" -"難号化の規則は主に不慮の事故を防ぐためのものだということに注意してください; " -"確信犯的な方法で、プライベートとされている変数にアクセスしたり変更することは" -"依然として可能なのです。デバッガのような特殊な状況では、この仕様は便利ですら" -"あります。" +"名前マングリングの主な目的は、名前の衝突などの事故を防ぐことです。\n" +"プライベートとされている変数にも、アクセスしたり値を変更したりすることはでき" +"ます。\n" +"デバッガなどでは、この性質が役立つこともあります。" -#: ../../tutorial/classes.rst:730 msgid "" "Notice that code passed to ``exec()`` or ``eval()`` does not consider the " "classname of the invoking class to be the current class; this is similar to " @@ -1559,25 +1569,25 @@ msgid "" "applies to ``getattr()``, ``setattr()`` and ``delattr()``, as well as when " "referencing ``__dict__`` directly." msgstr "" -"``exec()`` や ``eval()`` へ渡されたコードでは、呼出し元のクラス名を現在のクラ" -"スと見なさないことに注意してください。この仕様は ``global`` 文の効果と似てお" -"り、その効果もまた同様に、バイトコンパイルされたコードに制限されています。同" -"じ制約が ``getattr()`` と ``setattr()`` と ``delattr()`` にも適用されます。ま" -"た、``__dict__`` を直接参照するときにも適用されます。" +"``exec()`` や ``eval()`` に渡したコードでは、呼び出し元のクラスは名前マングリ" +"ングに使う現在のクラスとして扱われません。\n" +"これは ``global`` 文と同様で、効果が及ぶのは一緒にバイトコンパイルされるコー" +"ドの範囲だけです。\n" +"``getattr()``、``setattr()``、``delattr()`` を使う場合や、``__dict__`` を直接" +"参照する場合も同じ制約があります。" #: ../../tutorial/classes.rst:741 msgid "Odds and Ends" msgstr "残りのはしばし" -#: ../../tutorial/classes.rst:743 msgid "" "Sometimes it is useful to have a data type similar to the Pascal \"record\" " "or C \"struct\", bundling together a few named data items. The idiomatic " "approach is to use :mod:`dataclasses` for this purpose::" msgstr "" -"Pascal の \"レコード (record)\" や、C 言語の \"構造体 (struct)\" のような、名" -"前つきのデータ要素を一まとめにするデータ型があると便利なことがあります。慣用" -"的な手法として、この目的のために :mod:`dataclasses` を使用します。" +"Pascal のレコードや C の構造体のように、名前付きのデータ項目をまとめる型があ" +"ると便利なことがあります。\n" +"Python では、この用途に :mod:`dataclasses` を使うのが一般的です。 ::" #: ../../tutorial/classes.rst:747 msgid "" @@ -1611,7 +1621,6 @@ msgstr "" ">>> john.salary\n" "1000" -#: ../../tutorial/classes.rst:763 msgid "" "A piece of Python code that expects a particular abstract data type can " "often be passed a class that emulates the methods of that data type " @@ -1620,12 +1629,14 @@ msgid "" "and :meth:`~io.TextIOBase.readline` that get the data from a string buffer " "instead, and pass it as an argument." msgstr "" -"ある特定の抽象データ型を要求する Python コードの断片に、そのデータ型のメソッ" -"ドをエミュレーションするクラスを代わりに渡すことができます。例えば、ファイル" -"オブジェクトから何らかのデータを構築する関数がある場合、 :meth:`~io." -"TextIOBase.read` と :meth:`~io.TextIOBase.readline` を持つクラスを定義して、" -"ファイルではなく文字列バッファからデータを取得するようにしておき、引数として" -"渡すことができます。" +"特定の抽象データ型を想定した Python コードには、その型と同じように動くメソッ" +"ドを備えたクラスを代わりに使えることがよくあります。\n" +"例えば、ファイルオブジェクトから読み取ったデータをフォーマットする関数がある" +"とします。\n" +"ファイルの代わりに文字列バッファからデータを読み取る\n" +":meth:`~io.TextIOBase.read` と :meth:`~io.TextIOBase.readline` メソッドを持つ" +"クラスを定義すれば、\n" +"そのインスタンスをこの関数の引数として渡せます。" #: ../../tutorial/classes.rst:775 msgid "" @@ -1888,7 +1899,6 @@ msgstr "" msgid "Generator Expressions" msgstr "ジェネレータ式" -#: ../../tutorial/classes.rst:907 msgid "" "Some simple generators can be coded succinctly as expressions using a syntax " "similar to list comprehensions but with parentheses instead of square " @@ -1897,14 +1907,12 @@ msgid "" "compact but less versatile than full generator definitions and tend to be " "more memory friendly than equivalent list comprehensions." msgstr "" -"単純なジェネレータなら式として簡潔にコーディングできます。\n" -"その式はリスト内包表記に似た構文を使いますが、角括弧ではなく丸括弧で囲いま" -"す。\n" -"ジェネレータ式は、関数の中でジェネレータをすぐに使いたいような状況のために用" -"意されています。\n" -"ジェネレータ式は完全なジェネレータの定義よりコンパクトですが、ちょっと融通の" -"効かないところがあります。\n" -"同じ内容を返すリスト内包表記よりはメモリに優しいことが多いという利点がありま" +"単純なジェネレータは、リスト内包表記の角括弧を丸括弧に替えたような構文で、短" +"い式として書けます。\n" +"このジェネレータ式は、ジェネレータを関数の引数として渡し、その関数ですぐに使" +"う場合に適しています。\n" +"ジェネレータを関数として定義するより用途は限られますが、短く書けます。\n" +"また、同じ内容のリスト内包表記よりメモリ使用量を抑えられることが多くなりま" "す。" #: ../../tutorial/classes.rst:914 @@ -2022,6 +2030,5 @@ msgstr "メソッド" msgid "name" msgstr "name" -#: ../../tutorial/classes.rst:682 msgid "mangling" -msgstr "難号化" +msgstr "マングリング" diff --git a/tutorial/errors.po b/tutorial/errors.po index 993d3b684..ac0ebbd79 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -162,11 +162,10 @@ msgstr "" "意義な慣習ですが) 必ずしも成り立ちません。標準例外の名前は組み込みの識別子で" "す (予約語ではありません)。" -#: ../../tutorial/errors.rst:73 msgid "" "The rest of the line provides detail based on the type of exception and what " "caused it." -msgstr "残りの行は例外の詳細で、その例外の型と何が起きたかに依存します。" +msgstr "その行の残りの部分には、例外の型と原因に応じた詳細が表示されます。" #: ../../tutorial/errors.rst:76 msgid "" @@ -190,7 +189,6 @@ msgstr "" msgid "Handling Exceptions" msgstr "例外を処理する" -#: ../../tutorial/errors.rst:89 msgid "" "It is possible to write programs that handle selected exceptions. Look at " "the following example, which asks the user for input until a valid integer " @@ -199,13 +197,12 @@ msgid "" "generated interruption is signalled by raising the :exc:`KeyboardInterrupt` " "exception. ::" msgstr "" -"例外を選別して処理するようなプログラムを書くことができます。以下の例を見てく" -"ださい。この例では、有効な文字列が入力されるまでユーザに入力を促しますが、" -"ユーザがプログラムに (:kbd:`Control-C` か、またはオペレーティングシステムがサ" -"ポートしている何らかのキーを使って) 割り込みをかけてプログラムを中断させるこ" -"とができるようにしています。ユーザが生成した割り込みは、 :exc:" -"`KeyboardInterrupt` 例外が送出されることで通知されるということに注意してくだ" -"さい。 ::" +"特定の例外を処理するプログラムを書くことができます。\n" +"次の例は有効な整数が入力されるまでユーザに入力を求めますが、\n" +"ユーザは :kbd:`Control-C` などオペレーティングシステムがサポートする操作でプ" +"ログラムを中断できます。\n" +"ユーザによる割り込みは :exc:`KeyboardInterrupt` 例外の送出によって通知されま" +"す。 ::" #: ../../tutorial/errors.rst:95 msgid "" @@ -357,7 +354,6 @@ msgstr "" "の *引数 (arguments)* とも呼ばれます。引数の有無および引数の型は、例外の型に" "依存します。" -#: ../../tutorial/errors.rst:160 msgid "" "The *except clause* may specify a variable after the exception name. The " "variable is bound to the exception instance which typically has an ``args`` " @@ -365,10 +361,11 @@ msgid "" "types define :meth:`~object.__str__` to print all the arguments without " "explicitly accessing ``.args``. ::" msgstr "" -"except節は例外名の後に変数を指定できます。その変数は例外インスタンスに紐付け" -"られ、一般的には引数を保持する ``args`` 属性を持ちます。利便性のため、組み込" -"み例外型には :meth:`~object.__str__` が定義されており、明示的に ``.args`` を" -"参照せずとも すべての引数を表示できます。" +"*except 節* では例外名の後に変数を指定できます。\n" +"その変数は例外インスタンスに束縛されます。\n" +"例外インスタンスは通常、引数を保持する ``args`` 属性を持ちます。\n" +"組み込み例外型は利便性のために :meth:`~object.__str__` を定義しており、\n" +"明示的に ``.args`` を参照しなくてもすべての引数を表示できます。 ::" #: ../../tutorial/errors.rst:166 msgid "" @@ -443,14 +440,14 @@ msgstr "" "かし良い例外処理の手法とは、処理対象の例外の型をできる限り詳細に書き、予期し" "ない例外はそのまま伝わるようにすることです。" -#: ../../tutorial/errors.rst:199 msgid "" "The most common pattern for handling :exc:`Exception` is to print or log the " "exception and then re-raise it (allowing a caller to handle the exception as " "well)::" msgstr "" -":exc:`Exception` に対する最も一般的な例外処理のパターンでは、例外を表示あるい" -"はログ出力してから再度送出します(呼び出し側でも例外を処理できるようにします):" +":exc:`Exception` に対する最も一般的な処理のパターンは、例外を表示またはログに" +"記録してから再送出し、\n" +"呼び出し側でも処理できるようにすることです。 ::" #: ../../tutorial/errors.rst:203 msgid "" @@ -643,14 +640,14 @@ msgstr "" msgid "Exception Chaining" msgstr "例外の連鎖" -#: ../../tutorial/errors.rst:295 msgid "" "If an unhandled exception occurs inside an :keyword:`except` section, it " "will have the exception being handled attached to it and included in the " "error message::" msgstr "" -":keyword:`except` 節の中で未処理の例外が発生した場合、その未処理の例外は処理" -"された例外のエラーメッセージに含まれます::" +":keyword:`except` 節の中で未処理の例外が発生すると、\n" +"その例外には処理中だった例外が関連付けられ、エラーメッセージにも含まれま" +"す。 ::" #: ../../tutorial/errors.rst:299 msgid "" @@ -716,11 +713,11 @@ msgid "" "RuntimeError: Failed to open database" msgstr "" -#: ../../tutorial/errors.rst:347 msgid "" "It also allows disabling automatic exception chaining using the ``from " "None`` idiom::" -msgstr "また、自動的な例外の連鎖を無効にするには ``from None`` を指定します。" +msgstr "" +"また、自動的な例外の連鎖を無効にするには ``from None`` を指定します。 ::" #: ../../tutorial/errors.rst:350 msgid "" @@ -746,16 +743,16 @@ msgstr "" msgid "User-defined Exceptions" msgstr "ユーザー定義例外" -#: ../../tutorial/errors.rst:368 msgid "" "Programs may name their own exceptions by creating a new exception class " "(see :ref:`tut-classes` for more about Python classes). Exceptions should " "typically be derived from the :exc:`Exception` class, either directly or " "indirectly." msgstr "" -"プログラム上で新しい例外クラスを作成することで、独自の例外を指定することがで" -"きます (Python のクラスについては :ref:`tut-classes` 参照)。例外は、典型的" -"に :exc:`Exception` クラスから、直接または間接的に派生したものです。" +"新しい例外クラスを作成すると、プログラム独自の例外に名前を付けられます\n" +"(Python のクラスについては :ref:`tut-classes` を参照してください)。\n" +"通常、例外クラスは :exc:`Exception` クラスから直接または間接的に派生させるべ" +"きです。" #: ../../tutorial/errors.rst:372 msgid "" @@ -825,17 +822,16 @@ msgstr "" "せるか否かに関わらず、 :keyword:`!finally` 節は実行されます。以下では、例外が" "発生するという更に複雑なケースを議論します:" -#: ../../tutorial/errors.rst:409 msgid "" "If an exception occurs during execution of the :keyword:`!try` clause, the " "exception may be handled by an :keyword:`except` clause. If the exception is " "not handled by an :keyword:`!except` clause, the exception is re-raised " "after the :keyword:`!finally` clause has been executed." msgstr "" -"もし :keyword:`!try` 文の実行中に例外が発生したら、その例外は :keyword:" -"`except` 節によって処理されるでしょう。もしその例外が :keyword:`!except` 節に" -"よって処理されなければ、 :keyword:`!finally` 節が実行された後に、その例外が再" -"送出されます。" +":keyword:`!try` 節の実行中に発生した例外は、:keyword:`except` 節で処理される" +"ことがあります。\n" +":keyword:`!except` 節で処理されなかった例外は、:keyword:`!finally` 節の実行後" +"に再送出されます。" #: ../../tutorial/errors.rst:415 msgid "" @@ -1113,16 +1109,15 @@ msgid "" ">>>" msgstr "" -#: ../../tutorial/errors.rst:605 msgid "" "Note that the exceptions nested in an exception group must be instances, not " "types. This is because in practice the exceptions would typically be ones " "that have already been raised and caught by the program, along the following " "pattern::" msgstr "" -"例外グループの中に含める例外は、型ではなくインスタンスである必要があることに" -"注意してください。これは一般的に、以下のパターンようにプログラムで送出された" -"複数の例外を捕捉することが多いためです。::" +"例外グループに含める例外は、型ではなくインスタンスでなければなりません。\n" +"実際には、次のパターンのようにプログラムがすでに送出して捕捉した例外をまとめ" +"ることが多いためです。 ::" #: ../../tutorial/errors.rst:610 msgid "" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 8d50028a4..fdd7fd8b6 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -231,16 +231,16 @@ msgstr "" msgid "Formatted string literals" msgstr "フォーマット済み文字列リテラル" -#: ../../tutorial/inputoutput.rst:117 msgid "" ":ref:`Formatted string literals ` (also called f-strings for " "short) let you include the value of Python expressions inside a string by " "prefixing the string with ``f`` or ``F`` and writing expressions as " "``{expression}``." msgstr "" -":ref:`フォーマット済み文字リテラル ` (短くして f-string とも呼びま" -"す) では、文字列の頭に ``f`` か ``F`` を付け、式を ``{expression}`` と書くこ" -"とで、 Python の式の値を文字列の中に入れ込めます。" +"文字列の先頭に ``f`` または ``F`` を付け、文字列の中に ``{expression}`` の形" +"式で式を書くと、\n" +":ref:`フォーマット済み文字列リテラル ` (略して f-string) を使って " +"Python の式の値を文字列に埋め込めます。" #: ../../tutorial/inputoutput.rst:122 msgid "" @@ -313,14 +313,13 @@ msgstr "" ">>> print(f'私のホバークラフトは {animals!r} でいっぱいです。')\n" "私のホバークラフトは 'ウナギ' でいっぱいです。" -#: ../../tutorial/inputoutput.rst:151 msgid "" "The ``=`` specifier can be used to expand an expression to the text of the " "expression, an equal sign, then the representation of the evaluated " "expression:" msgstr "" -"``=`` 指定子を使用すると式を展開して、式、イコール記、式を評価した文字列表" -"現、の形式で表示されます。" +"``=`` 指定子を使うと、式のテキスト、``=``、式を評価した値の ``repr()`` 結果を" +"順に表示できます。" #: ../../tutorial/inputoutput.rst:160 msgid "" @@ -611,7 +610,6 @@ msgstr "" msgid "Old string formatting" msgstr "古い文字列書式設定方法" -#: ../../tutorial/inputoutput.rst:290 msgid "" "The % operator (modulo) can also be used for string formatting. Given " "``format % values`` (where *format* is a string), ``%`` conversion " @@ -619,10 +617,11 @@ msgid "" "*values*. This operation is commonly known as string interpolation. For " "example::" msgstr "" -"% 演算子 (剰余) は文字列のフォーマットでも使えます。 ``format % values`` " -"(*format* は文字列) という文字列が与えられた場合、 *format* 中の ``%`` 変換指" -"定はゼロあるいは *values* の余りの要素に置換えられます。この操作は文字列補間" -"として知られています。例えば::" +"剰余を求める ``%`` 演算子は、文字列の書式化にも使えます。\n" +"``format % values`` (``format`` は文字列) と書くと、``format`` 内の ``%`` 変" +"換指定が ``values`` の 0 個以上の要素で置き換えられます。\n" +"この操作は一般に文字列補間と呼ばれます。\n" +"例えば、次のように使います。 ::" #: ../../tutorial/inputoutput.rst:297 msgid "" diff --git a/tutorial/interactive.po b/tutorial/interactive.po index 156228133..c6ebb7c88 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -90,7 +90,6 @@ msgstr "" "もよいかもしれません。括弧やクォートなどの対応をチェックする (あるいは指示す" "る) コマンドも有用でしょう。" -#: ../../tutorial/interactive.rst:45 msgid "" "One alternative enhanced interactive interpreter that has been around for " "quite some time is IPython_, which features tab completion, object " @@ -98,8 +97,8 @@ msgid "" "customized and embedded into other applications. Another similar enhanced " "interactive environment is bpython_." msgstr "" -"より優れた対話的インタープリタの代替の一つに IPython_ があります。このイン" -"タープリタは、様々なところで使われていて、タブ補完、オブジェクト探索や先進的" -"な履歴管理といった機能を持っています。他のアプリケーションにカスタマイズされ" -"たり、組込まれこともあります。別の優れたインタラクティブ環境としては " -"bpython_ があります。" +"機能を強化した対話的インタープリタの一つに、以前からある IPython_ がありま" +"す。\n" +"タブ補完、オブジェクトの調査、高度な履歴管理などの機能を備えています。\n" +"柔軟にカスタマイズでき、他のアプリケーションに組み込むこともできます。\n" +"同様に機能を強化した対話的環境として bpython_ もあります。" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 8771bc127..e59c3431e 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -360,7 +360,6 @@ msgstr "" msgid "Dates and times" msgstr "" -#: ../../tutorial/stdlib.rst:212 msgid "" "The :mod:`datetime` module supplies classes for manipulating dates and times " "in both simple and complex ways. While date and time arithmetic is " @@ -368,11 +367,11 @@ msgid "" "for output formatting and manipulation. The module also supports objects " "that are timezone aware. ::" msgstr "" -":mod:`datetime` モジュールは、日付や時刻を操作するためのクラスを、単純な方法" -"と複雑な方法の両方で提供しています。日付や時刻に対する算術がサポートされてい" -"る一方、実装では出力のフォーマットや操作のための効率的なデータメンバ抽出に重" -"点を置いています。このモジュールでは、タイムゾーンに対応したオブジェクトもサ" -"ポートしています。 ::" +":mod:`datetime` モジュールは、日付や時刻の単純な操作から複雑な操作まで行える" +"クラスを提供します。\n" +"日付や時刻の算術演算にも対応していますが、出力のフォーマットや各種操作に必要" +"な属性を効率よく取り出すことに重点を置いています。\n" +"タイムゾーンを扱えるオブジェクトもサポートしています。 ::" #: ../../tutorial/stdlib.rst:218 msgid "" @@ -476,7 +475,6 @@ msgstr "" "高い品質のソフトウェアを開発するための一つのアプローチは、各関数に対して開発" "と同時にテストを書き、開発の過程で頻繁にテストを走らせるというものです。" -#: ../../tutorial/stdlib.rst:288 msgid "" "The :mod:`doctest` module provides a tool for scanning a module and " "validating tests embedded in a program's docstrings. Test construction is " @@ -485,12 +483,12 @@ msgid "" "example and it allows the doctest module to make sure the code remains true " "to the documentation::" msgstr "" -":mod:`doctest` モジュールでは、モジュールを検索してプログラムの docstring に" -"埋め込まれたテストの評価を行うためのツールを提供しています。テストの作り方は" -"単純で、典型的な呼び出し例とその結果を docstring にカット&ペーストするだけで" -"す。この作業は、ユーザに使用例を与えるという意味でドキュメントの情報を増やす" -"と同時に、ドキュメントに書かれているコードが正しい事を確認できるようになりま" -"す::" +":mod:`doctest` モジュールは、モジュールの docstring に埋め込まれたテストを探" +"し、実行結果を検証します。\n" +"テストを作るには、典型的な呼び出し例とその結果を docstring に貼り付けるだけで" +"す。\n" +"これにより、利用者に使用例を示すと同時に、コードがドキュメントに書かれたとお" +"りに動き続けていることを確認できます。 ::" #: ../../tutorial/stdlib.rst:295 msgid "" @@ -570,15 +568,15 @@ msgstr "" "は、洗練され、安定した機能を持つ Python の膨大なパッケージ群に如実に表れてい" "ます。例えば:" -#: ../../tutorial/stdlib.rst:333 msgid "" "The :mod:`xmlrpc.client` and :mod:`xmlrpc.server` modules make implementing " "remote procedure calls into an almost trivial task. Despite the modules' " "names, no direct knowledge or handling of XML is needed." msgstr "" -":mod:`xmlrpc.client` および :mod:`xmlrpc.server` モジュールは、遠隔手続き呼" -"び出し (remote procedure call) を全く大したことのない作業に変えてしまいます。" -"モジュール名とは違い、XML を扱うための直接的な知識は必要ありません。" +":mod:`xmlrpc.client` と :mod:`xmlrpc.server` モジュールを使うと、遠隔手続き呼" +"び出しを簡単に実装できます。\n" +"名前に XML が含まれていますが、XML の知識や XML を直接扱う作業は必要ありませ" +"ん。" #: ../../tutorial/stdlib.rst:337 msgid "" @@ -613,14 +611,14 @@ msgstr "" "の処理をサポートしています。総合すると、これらのモジュールによって Python ア" "プリケーションと他のツールの間でとても簡単にデータを受け渡すことが出来ます。" -#: ../../tutorial/stdlib.rst:353 msgid "" "The :mod:`sqlite3` module is a wrapper for the SQLite database library, " "providing a persistent database that can be updated and accessed using " "slightly nonstandard SQL syntax." msgstr "" -":mod:`sqlite3` モジュールは SQLite データベースライブラリのラッパーです。若干" -"非標準の SQL シンタックスを用いて更新や接続出来る永続的なデータベースを提供し" +":mod:`sqlite3` モジュールは、SQLite データベースライブラリを Python から使う" +"ためのラッパーです。\n" +"データを永続的に保存でき、標準とは少し異なる SQL の構文で更新やアクセスができ" "ます。" #: ../../tutorial/stdlib.rst:357 diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index 5c5fe8848..c1c49ea59 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -482,15 +482,13 @@ msgstr "" msgid "Tools for working with lists" msgstr "" -#: ../../tutorial/stdlib2.rst:291 msgid "" "Many data structure needs can be met with the built-in list type. However, " "sometimes there is a need for alternative implementations with different " "performance trade-offs." msgstr "" -"多くのデータ構造は、組み込みリスト型を使った実装で事足ります。とはいえ、時に" -"は組み込みリストとは違うパフォーマンス上のトレードオフを持つような実装が必要" -"になこともあります。" +"データ構造が必要な場面の多くは、組み込みのリスト型で対応できます。\n" +"ただし、性能上のトレードオフが異なる別の実装が必要になる場合もあります。" #: ../../tutorial/stdlib2.rst:295 msgid "" diff --git a/tutorial/whatnow.po b/tutorial/whatnow.po index 8bb7d24a5..0518699e0 100644 --- a/tutorial/whatnow.po +++ b/tutorial/whatnow.po @@ -84,13 +84,13 @@ msgstr "" msgid "More Python resources:" msgstr "さらなる Python に関するリソース:" -#: ../../tutorial/whatnow.rst:34 msgid "" "https://www.python.org: The major Python website. It contains code, " "documentation, and pointers to Python-related pages around the web." msgstr "" -"https://www.python.org: 有名なPythonのWebサイト。コードやドキュメント、Python" -"に関するWebページへのポインターを含んでいます。" +"https://www.python.org: Python の主要なウェブサイトです。\n" +"コードやドキュメントのほか、Python 関連のウェブページへのリンクが掲載されてい" +"ます。" #: ../../tutorial/whatnow.rst:37 msgid "https://docs.python.org: Fast access to Python's documentation." @@ -121,13 +121,12 @@ msgstr "" "名の本Python Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3)に収録されて" "います。" -#: ../../tutorial/whatnow.rst:49 msgid "" "https://pyvideo.org collects links to Python-related videos from conferences " "and user-group meetings." msgstr "" -"https://pyvideo.org は学会やユーザグループの会合から Python 関連のビデオのリ" -"ンクを集めています。" +"https://pyvideo.org には、カンファレンスやユーザグループの会合で行われた " +"Python 関連の発表などの動画へのリンクが集められています。" #: ../../tutorial/whatnow.rst:52 msgid "" From 6d516d9c22ba03989df1a2f6374ba2d2ea994fee Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Oct 2026 05:29:47 +0000 Subject: [PATCH 11/21] Merge 3.15 into 3.14 --- builtins/functions.po | 12 +++----- builtins/stdtypes.po | 20 +++++-------- c-api/arg.po | 3 +- c-api/call.po | 10 ++----- c-api/contextvars.po | 3 +- c-api/file.po | 3 +- c-api/init_config.po | 3 +- c-api/interp-lifecycle.po | 3 +- c-api/sequence.po | 3 +- c-api/subinterpreters.po | 6 ++-- glossary.po | 9 ++---- howto/annotations.po | 3 +- howto/curses.po | 3 +- howto/descriptor.po | 5 ++-- howto/enum.po | 12 +++----- howto/regex.po | 3 +- installing/index.po | 3 +- library/argparse.po | 3 +- library/ast.po | 9 ++---- library/asyncio-dev.po | 6 ++-- library/asyncio-eventloop.po | 15 ++++------ library/asyncio-policy.po | 3 +- library/asyncio-protocol.po | 3 +- library/asyncio-task.po | 3 +- library/asyncio.po | 3 +- library/base64.po | 6 ++-- library/collections.po | 3 +- library/compileall.po | 13 ++++---- library/configparser.po | 3 +- library/ctypes.po | 25 +++++----------- library/curses.po | 12 ++++---- library/email.header.po | 3 +- library/email.headerregistry.po | 8 ++--- library/enum.po | 3 +- library/fcntl.po | 12 +++----- library/ftplib.po | 6 ++-- library/functions.po | 12 +++----- library/gc.po | 9 ++---- library/glob.po | 13 ++++---- library/imaplib.po | 6 ++-- library/inspect.po | 3 +- library/io.po | 6 ++-- library/json.po | 6 ++-- library/logging.po | 6 ++-- library/marshal.po | 9 ++---- library/math.po | 3 +- library/msvcrt.po | 3 +- library/multiprocessing.po | 6 ++-- library/os.po | 6 ++-- library/pathlib.po | 17 ++++------- library/pdb.po | 3 +- library/pickle.po | 6 ++-- library/pkgutil.po | 4 +-- library/pprint.po | 8 ++--- library/pty.po | 3 +- library/random.po | 3 +- library/re.po | 9 ++---- library/resource.po | 10 +++---- library/runpy.po | 8 ++--- library/shutil.po | 25 +++++----------- library/signal.po | 3 +- library/smtplib.po | 3 +- library/socket.po | 33 +++++++-------------- library/sqlite3.po | 12 +++----- library/statistics.po | 3 +- library/stdtypes.po | 20 +++++-------- library/subprocess.po | 3 +- library/sys.po | 21 +++++-------- library/syslog.po | 11 +++---- library/tempfile.po | 7 ++--- library/threading.po | 14 ++++----- library/token.po | 5 ++-- library/turtle.po | 3 +- library/types.po | 6 ++-- library/unittest.mock-examples.po | 30 ++++++++----------- library/unittest.po | 11 +++---- library/uuid.po | 3 +- library/winreg.po | 49 ++++++++++--------------------- library/xml.dom.minidom.po | 3 +- library/xml.etree.elementtree.po | 3 +- library/xmlrpc.client.po | 3 +- library/xmlrpc.server.po | 3 +- library/zipapp.po | 3 +- reference/datamodel.po | 3 +- reference/expressions.po | 3 +- reference/lexical_analysis.po | 3 +- tutorial/datastructures.po | 4 +-- using/cmdline.po | 12 +++----- using/ios.po | 3 +- whatsnew/2.1.po | 6 ++-- whatsnew/2.3.po | 3 +- whatsnew/2.4.po | 3 +- whatsnew/2.6.po | 3 +- whatsnew/2.7.po | 3 +- whatsnew/3.11.po | 3 +- whatsnew/3.13.po | 3 +- whatsnew/3.14.po | 3 +- whatsnew/3.4.po | 3 +- whatsnew/3.5.po | 6 ++-- whatsnew/3.6.po | 6 ++-- whatsnew/3.7.po | 3 +- whatsnew/3.8.po | 27 ++++++----------- whatsnew/3.9.po | 3 +- 103 files changed, 269 insertions(+), 513 deletions(-) diff --git a/builtins/functions.po b/builtins/functions.po index a7d5552e7..5d9420dcf 100644 --- a/builtins/functions.po +++ b/builtins/functions.po @@ -1061,7 +1061,6 @@ msgstr "" ">>> complex(-1.23, 4.5)\n" "(-1.23+4.5j)" -#: ../../builtins/functions.rst:426 msgid "" "If the argument is a string, it must contain either a real part (in the same " "format as for :func:`float`) or an imaginary part (in the same format but " @@ -1077,7 +1076,7 @@ msgid "" msgstr "" "引数が文字列の場合、実数部( :func:`float` と同じ形式)、虚数部(同様の形式" "で ``'j'`` または ``'J'`` 接尾辞)どちらか、あるいは両方(この場合、虚数部の" -"符号は必須)を含まなければなりません。文字列 は空白や括弧 ``'('`` と``')'`` " +"符号は必須)を含まなければなりません。文字列 は空白や括弧 ``'('`` と ``')'`` " "で囲むこともできますが、無視されます。文字列は、 ``'+'`` 、``'-'`` 、 " "``'j'`` または ``'J'`` 接尾辞 、そして10進数の間に空白を含んではなりません。" "たとえば ``complex('1+2j')`` はよいですが、 ``complex('1 + 2j')`` は :exc:" @@ -1657,14 +1656,13 @@ msgstr "" "値の浮動小数点数が返されます。 引数が Python の浮動小数点数の範囲外なら、 :" "exc:`OverflowError` が送出されます。" -#: ../../builtins/functions.rst:837 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " "back to :meth:`~object.__index__`." msgstr "" "一般の Python オブジェクト ``x`` に対して、``float(x)`` は ``x.__float__()`` " -"に委譲します。 :meth:`~object.__float__()` が定義されていない場合、:meth:" +"に委譲します。 :meth:`~object.__float__` が定義されていない場合、:meth:" "`~object.__index__` へフォールバックします。" #: ../../builtins/functions.rst:841 @@ -1923,13 +1921,12 @@ msgstr "" msgid "This is the address of the object in memory." msgstr "これはオブジェクトのメモリアドレスです。" -#: ../../builtins/functions.rst:1020 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引数 ``id`` を指定して :ref:`監査イベント ` ``builtins.id`` を送出" -"します。 " +"します。" #: ../../builtins/functions.rst:1026 msgid "" @@ -3580,7 +3577,6 @@ msgstr "" "でソートを行なうのに役立ちます(例えば部署でソートしてから給与の等級でソート" "する場合)。" -#: ../../builtins/functions.rst:1977 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3598,7 +3594,7 @@ msgstr "" "ソートツールを、同じデータに対して適用することによって起こりうるバグを避ける" "助けになります。6つの比較演算子を全て実装することは、リフレクションによって :" "meth:`~object.__gt__` メソッドを呼び出す可能性のある型混合の比較での混乱を避" -"けることにも役立ちます。 " +"けることにも役立ちます。" #: ../../builtins/functions.rst:1986 msgid "" diff --git a/builtins/stdtypes.po b/builtins/stdtypes.po index 5d9aecc31..6a37a2c5a 100644 --- a/builtins/stdtypes.po +++ b/builtins/stdtypes.po @@ -1149,14 +1149,13 @@ msgstr "" "浮動小数点数が返されます。 引数が Python の浮動小数点数の範囲外なら、 :exc:" "`OverflowError` が送出されます。" -#: ../../builtins/stdtypes.rst:653 msgid "" "For a general Python object ``x``, ``float.from_number(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " "back to :meth:`~object.__index__`." msgstr "" "一般の Python オブジェクト ``x`` に対して、``float.from_number(x)`` は ``x." -"__float__()`` に委譲します。 :meth:`~object.__float__()` が定義されていない場" +"__float__()`` に委譲します。 :meth:`~object.__float__` が定義されていない場" "合、:meth:`~object.__index__` へフォールバックします。" #: ../../builtins/stdtypes.rst:663 @@ -4186,7 +4185,6 @@ msgid "" "True" msgstr "" -#: ../../builtins/stdtypes.rst:2572 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " @@ -4194,7 +4192,7 @@ msgid "" msgstr "" "Unicode 文字データベース (:mod:`unicodedata` を参照) で一般カテゴリが ``Zs`` " "(\"Seperator, space\") であるか、 双方向クラスが ``WS``、``B``、 ``S`` のい" -"ずれかである場合、その文字は *空白文字(whitespace)* です。 " +"ずれかである場合、その文字は *空白文字(whitespace)* です。" #: ../../builtins/stdtypes.rst:2577 msgid "See also :meth:`isprintable`." @@ -8826,7 +8824,6 @@ msgstr "" "ビューの参照先の辞書をラップする :class:`types.MappingProxyType` オブジェク" "ト を返します。" -#: ../../builtins/stdtypes.rst:5962 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -8848,7 +8845,7 @@ msgstr "" "れた全ての演算が利用可能です (たとえば ``==``, ``<`` や ``^`` など)。 集合演" "算に対しては、集合はオペランドとして集合しか取ることができないのに対して、こ" "れら集合の特性を持つビューはオペランドとして任意のイテラブルを取ることができ" -"ます。 " +"ます。" #: ../../builtins/stdtypes.rst:5974 msgid "An example of dictionary view usage::" @@ -9371,15 +9368,14 @@ msgid "" "TypeError: dict[str] is not a generic class" msgstr "" -#: ../../builtins/stdtypes.rst:6273 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" "一方で、同様の式は :ref:`型変数 ` が使われた場合は有効です。添字の" -"数は``GenericAlias`` オブジェクトの :attr:`~genericalias.__args__` 属性におけ" -"る型変数の数と同じでなければなりません::" +"数は ``GenericAlias`` オブジェクトの :attr:`~genericalias.__args__` 属性にお" +"ける型変数の数と同じでなければなりません::" #: ../../builtins/stdtypes.rst:6277 msgid "" @@ -9827,13 +9823,12 @@ msgstr "Optional型は ``None`` とのUnion型で記述できます::" msgid "str | None == typing.Optional[str]" msgstr "" -#: ../../builtins/stdtypes.rst:6475 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" ":func:`isinstance` と :func:`issubclass` の呼び出しはどちらもUnionオブジェク" -"トをサポートしています。 " +"トをサポートしています。" #: ../../builtins/stdtypes.rst:6478 msgid "" @@ -10435,13 +10430,12 @@ msgstr "``str(integer)``" msgid "``repr(integer)``." msgstr "``repr(integer)``" -#: ../../builtins/stdtypes.rst:6875 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" "他の10進数での文字列変換。たとえば ``f\"{integer}\"``、``\"{}\"." -"format(integer)`` や ``b\"%d\" % integer``。 " +"format(integer)`` や ``b\"%d\" % integer``。" #: ../../builtins/stdtypes.rst:6878 msgid "The limitations do not apply to functions with a linear algorithm:" diff --git a/c-api/arg.po b/c-api/arg.po index bad97e1e7..1393f42f6 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -131,7 +131,6 @@ msgstr "" "バッファ. **必ず電話をかけてください** :c:func:`PyMem_Free` データ処理が完了" "した後(または早期終了の場合)。" -#: ../../c-api/arg.rst:63 msgid "" "Other formats take a :class:`str` or a read-only :term:`bytes-like object`, " "such as :class:`bytes`, and provide a ``const char *`` pointer to its " @@ -143,7 +142,7 @@ msgstr "" "`、例えば :class:`bytes`, および提供する ``const char " "*`` ポインタ その バッファ. この場合 バッファ「借用」されています:これは対応" "するPythonオブジェクトによって管理され、このオブジェクトのライフサイクルを共" -"有します。メモリを自分で解放する必要はありません。 " +"有します。メモリを自分で解放する必要はありません。" #: ../../c-api/arg.rst:70 msgid "" diff --git a/c-api/call.po b/c-api/call.po index 1986d213c..531fc3e4e 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -461,14 +461,13 @@ msgstr "" "す。\n" "*format* は *NULL* かもしれず、与える引数がないことを表します。" -#: ../../c-api/call.rst:276 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" ":c:expr:`PyObject *` args だけを引数に渡す場合は、 :c:func:" "`PyObject_CallFunctionObjArgs` がより速い方法であることを覚えておいてくださ" -"い。 " +"い。" #: ../../c-api/call.rst:279 msgid "The type of *format* was changed from ``char *``." @@ -485,9 +484,8 @@ msgstr "" "C 引数はタプルを生成する :c:func:`Py_BuildValue` 形式のフォーマット文字列で記" "述されています。" -#: ../../c-api/call.rst:289 msgid "The format can be *NULL*, indicating that no arguments are provided." -msgstr "*format* は *NULL* でもよく、引数が与えられないことを表します。 " +msgstr "*format* は *NULL* でもよく、引数が与えられないことを表します。" #: ../../c-api/call.rst:294 msgid "" @@ -495,14 +493,12 @@ msgid "" "arg2, ...)``." msgstr "これは次の Python の式と同等です: ``obj.name(arg1, arg2, ...)`` 。" -#: ../../c-api/call.rst:297 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" ":c:expr:`PyObject *` args だけを引数に渡す場合は、 :c:func:" -"`PyObject_CallMethodObjArgs` がより速い方法であることを覚えておいてくださ" -"い。 " +"`PyObject_CallMethodObjArgs` がより速い方法であることを覚えておいてください。" #: ../../c-api/call.rst:300 msgid "The types of *name* and *format* were changed from ``char *``." diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 2c711cc5f..b44546386 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -262,13 +262,12 @@ msgstr "``NULL``" msgid "Except for ``NULL``, the function returns a new reference." msgstr "``NULL`` を除けば、この関数は新しい参照を返します。" -#: ../../c-api/contextvars.rst:177 msgid "" "Set the value of *var* to *value* in the current context. Returns a new " "token object for this change, or ``NULL`` if an error has occurred." msgstr "" "現在のコンテキストにおいて *var* の値を *value* にセットします。この変更によ" -"る新しいトークンオブジェクトか、エラーが起こった場合は``NULL``を返します。" +"る新しいトークンオブジェクトか、エラーが起こった場合は ``NULL`` を返します。" #: ../../c-api/contextvars.rst:182 msgid "" diff --git a/c-api/file.po b/c-api/file.po index 71d9de901..edda983ca 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -170,12 +170,11 @@ msgstr "" msgid "This function is safe to call before :c:func:`Py_Initialize`." msgstr "この関数は :c:func:`Py_Initialize` より前に呼び出しても安全です。" -#: ../../c-api/file.rst:91 msgid "" "Raises an :ref:`auditing event ` ``setopencodehook`` with no " "arguments." msgstr "" -"引数無しで :ref:`監査イベント ` ``setopencodehook`` を送出します。 " +"引数無しで :ref:`監査イベント ` ``setopencodehook`` を送出します。" #: ../../c-api/file.rst:98 msgid "" diff --git a/c-api/init_config.po b/c-api/init_config.po index cd87ec208..d3800c5e4 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -24,9 +24,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../c-api/init_config.rst:7 msgid "Python Initialization Configuration" -msgstr "Python 初期化設定 " +msgstr "Python 初期化設定" #: ../../c-api/init_config.rst:13 msgid "PyInitConfig C API" diff --git a/c-api/interp-lifecycle.po b/c-api/interp-lifecycle.po index 25492984e..0c21d091f 100644 --- a/c-api/interp-lifecycle.po +++ b/c-api/interp-lifecycle.po @@ -735,13 +735,12 @@ msgid "" "stdout and stderr files." msgstr "" -#: ../../c-api/interp-lifecycle.rst:474 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``cpython._PySys_ClearAuditHooks`` " -"を送出します。 " +"を送出します。" #: ../../c-api/interp-lifecycle.rst:481 msgid "" diff --git a/c-api/sequence.po b/c-api/sequence.po index 5b1a285fa..07af6d26b 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -268,7 +268,6 @@ msgstr "" "ないことに注意してください。そのため、シーケンスの変更が発生しないコンテキス" "トでのみ背後にあるポインタを使ってください。" -#: ../../c-api/sequence.rst:181 msgid "" "Return the *i*\\ th element of *o* or ``NULL`` on failure. Faster form of :c:" "func:`PySequence_GetItem` but without checking that :c:func:" @@ -277,7 +276,7 @@ msgid "" msgstr "" "*o* の *i* 番目の要素を返し、失敗すると ``NULL`` を返します。 :c:func:" "`PySequence_GetItem` の高速版であり、:c:func:`PySequence_Check` で *o* が真を" -"返すかどうかの検証や、負の添え字の調整を行いません。 " +"返すかどうかの検証や、負の添え字の調整を行いません。" #: ../../c-api/sequence.rst:21 ../../c-api/sequence.rst:131 msgid "built-in function" diff --git a/c-api/subinterpreters.po b/c-api/subinterpreters.po index 0f9d1b788..f07b18491 100644 --- a/c-api/subinterpreters.po +++ b/c-api/subinterpreters.po @@ -561,13 +561,12 @@ msgid "" "to this function." msgstr "" -#: ../../c-api/subinterpreters.rst:440 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``cpython.PyInterpreterState_New`` " -"を送出します。 " +"を送出します。" #: ../../c-api/subinterpreters.rst:445 msgid "" @@ -575,13 +574,12 @@ msgid "" "term:`attached thread state` for the interpreter." msgstr "" -#: ../../c-api/subinterpreters.rst:448 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``cpython." -"PyInterpreterState_Clear`` を送出します。 " +"PyInterpreterState_Clear`` を送出します。" #: ../../c-api/subinterpreters.rst:453 msgid "" diff --git a/glossary.po b/glossary.po index fc99bbec5..7d145cf2d 100644 --- a/glossary.po +++ b/glossary.po @@ -987,7 +987,6 @@ msgstr "" msgid "dictionary view" msgstr "dictionary view" -#: ../../glossary.rst:464 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -1001,7 +1000,7 @@ msgstr "" "辞書の項目の動的なビューを提供します。\n" "すなわち、辞書が変更されるとビューはそれを反映します。\n" "辞書ビューを強制的に完全なリストにするには ``list(dictview)`` を使用してくだ" -"さい。 \n" +"さい。\n" ":ref:`dict-views` を参照してください。" #: ../../glossary.rst:470 @@ -1836,7 +1835,6 @@ msgid "" "that implements :term:`sequence` semantics." msgstr "" -#: ../../glossary.rst:864 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1859,7 +1857,7 @@ msgstr "" ":keyword:`for` 文ではこの操作を自動的に行い、一時的な無名の変数を作成してルー" "プを回している間イテレータを保持します。\n" ":term:`イテレータ ` 、 :term:`シーケンス ` 、 :term:`ジェ" -"ネレータ ` も参照してください。 " +"ネレータ ` も参照してください。" #: ../../glossary.rst:874 msgid "iterator" @@ -2542,7 +2540,6 @@ msgstr "" msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:1213 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2551,7 +2548,7 @@ msgid "" msgstr "" ":dfn:`位置専用`: 位置によってのみ与えられる引数を指定します。位置専用の引数は" "関数定義の引数のリストの中でそれらの後ろに ``/`` を含めることで定義できます。" -"例えば下記の *posonly1* と *posonly2* は位置専用引数になります:: " +"例えば下記の *posonly1* と *posonly2* は位置専用引数になります::" #: ../../glossary.rst:1218 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." diff --git a/howto/annotations.po b/howto/annotations.po index 847af7660..9bbf7a6b0 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -370,13 +370,12 @@ msgstr "" msgid "Best Practices For ``__annotations__`` In Any Python Version" msgstr "``__annotations__`` のベストプラクティス (全 Python バージョン共通)" -#: ../../howto/annotations.rst:184 msgid "" "You should avoid assigning to the ``__annotations__`` member of objects " "directly. Let Python manage setting ``__annotations__``." msgstr "" "オブジェクトの ``__annotations__`` 属性に直接代入することは避けるべきです。" -"Python に任せましょう。 " +"Python に任せましょう。" #: ../../howto/annotations.rst:187 msgid "" diff --git a/howto/curses.po b/howto/curses.po index 857700d1f..1707288b5 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -406,13 +406,12 @@ msgid "" "the screen gets updated. :meth:`!refresh` actually does two things:" msgstr "" -#: ../../howto/curses.rst:248 msgid "" "Calls the :meth:`~curses.window.noutrefresh` method of each window to update " "an underlying data structure representing the desired state of the screen." msgstr "" "それぞれのウィンドウの :meth:`~curses.window.noutrefresh` メソッドを呼び出し" -"て、配下にある、スクリーンの望ましい状態を表すデータ構造を更新します。 " +"て、配下にある、スクリーンの望ましい状態を表すデータ構造を更新します。" #: ../../howto/curses.rst:251 msgid "" diff --git a/howto/descriptor.po b/howto/descriptor.po index 972b12b00..e0155a342 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -960,13 +960,12 @@ msgstr "" "``a.x`` に対するデスクリプタが見つかった場合、 ``desc.__get__(None, A)`` とい" "う形式で呼び出されます。" -#: ../../howto/descriptor.rst:782 msgid "" "The full C implementation can be found in :c:func:`!type_getattro` and :c:" "func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." msgstr "" -"完全な C での実装は :source:`Objects/typeobject.c` の中の:c:func:`!" -"type_getattro` と :c:func:`!_PyType_Lookup` を参照してください。" +"完全な C での実装は :source:`Objects/typeobject.c` の中の :c:func:`!" +"type_getattro` と :c :func:`!_PyType_Lookup` を参照してください。" #: ../../howto/descriptor.rst:787 msgid "Invocation from super" diff --git a/howto/enum.po b/howto/enum.po index 16cc18bd8..c5946a243 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -402,7 +402,6 @@ msgid "" "TypeError: 'SQUARE' already defined as 2" msgstr "" -#: ../../howto/enum.rst:229 msgid "" "However, an enum member can have other names associated with it. Given two " "entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` " @@ -411,7 +410,7 @@ msgid "" "member ``A``. By-name lookup of ``B`` will also return the member ``A``::" msgstr "" "しかし、列挙型メンバー は、別の名前を持つことができます。 同じ値を持つ " -"``A`` と``B`` が与えられた場合(そして ``A`` が先に定義されている場合)、 " +"``A`` と ``B`` が与えられた場合(そして ``A`` が先に定義されている場合)、 " "``B`` はメンバー ``A`` に対するエイリアスとなります。 ``A`` の値での検索で" "は、メンバー ``A`` が返されます。 ``A`` の名前での検索ではメンバー ``A`` を" "返します。``B`` の名前での検索も、メンバー ``A`` を返します::" @@ -533,12 +532,11 @@ msgid "" "64>]" msgstr "" -#: ../../howto/enum.rst:319 msgid "" "Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " "aren't shown." msgstr "" -"エイリアスである ``Shape.ALIAS_FOR_SQUARE`` と``Weekday.WEEKEND`` が表示され" +"エイリアスである ``Shape.ALIAS_FOR_SQUARE`` と ``Weekday.WEEKEND`` が表示され" "ていないことに注意してください。" #: ../../howto/enum.rst:321 @@ -980,13 +978,12 @@ msgid "" "..." msgstr "" -#: ../../howto/enum.rst:593 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -"``0`` ではなく``1`` をデフォルトの開始番号とする理由は、``0`` が真偽値として" +"``0`` ではなく ``1`` をデフォルトの開始番号とする理由は、``0`` が真偽値として" "は ``False`` であり、デフォルトの列挙メンバーはすべて ``True`` 評価されるよう" "にするためである。" @@ -1653,13 +1650,12 @@ msgstr "" msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1001 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -" :class:`int` や:class:`str` などの他のデータ型と :class:`Enum` のサブクラス" +" :class:`int` や :class:`str` などの他のデータ型と :class:`Enum` のサブクラス" "では、 ``=`` 以降の値はすべて、そのデータ型のコンストラクタに渡される。 例え" "ば::" diff --git a/howto/regex.po b/howto/regex.po index a2be449a6..c389779c6 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -1268,7 +1268,6 @@ msgstr "" "``\\w``, ``\\W``, ``\\b``, ``\\B`` と小文字大文字の区別を無視したマッチング" "を、 Unicode データベースではなく現在のロケールに従って行います。" -#: ../../howto/regex.rst:584 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -1301,7 +1300,7 @@ msgstr "" "\"文化\" しか扱うことができず、また8ビットのロケールでしか正しく動作しないか" "らです。Python 3 ではユニコード (文字列の) パターンに対してユニコードのマッチ" "ングがデフォルトで有効化されており、これにより異なるロケールまたは言語を同時" -"に扱うことができます。 " +"に扱うことができます。" #: ../../howto/regex.rst:606 msgid "" diff --git a/installing/index.po b/installing/index.po index 5f64bddec..abc73ccd2 100644 --- a/installing/index.po +++ b/installing/index.po @@ -203,14 +203,13 @@ msgid "" "org>`__." msgstr "" -#: ../../installing/index.rst:100 msgid "" "Creation of virtual environments is done through the :mod:`venv` module. " "Installing packages into an active virtual environment uses the commands " "shown above." msgstr "" "仮想環境の作成は :mod:`venv` モジュールを通して行われます。\n" -"有効な仮想環境にインストールするには 上記のコマンドを使います。 " +"有効な仮想環境にインストールするには 上記のコマンドを使います。" #: ../../installing/index.rst:106 msgid "" diff --git a/library/argparse.po b/library/argparse.po index 20a06bad0..1c08816f8 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -1086,13 +1086,12 @@ msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "const_ - 一部の action_ と nargs_ の組み合わせで利用される定数。" -#: ../../library/argparse.rst:678 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" "default_ - コマンドラインに対応する引数が存在せず、さらに namespace オブジェ" -"クトにも存在しない場合に利用される値。 " +"クトにも存在しない場合に利用される値。" #: ../../library/argparse.rst:681 msgid "" diff --git a/library/ast.po b/library/ast.po index 0d7d49d38..f38566f95 100644 --- a/library/ast.po +++ b/library/ast.po @@ -890,7 +890,6 @@ msgid "" " Name(id='a', ctx=Del())])])" msgstr "" -#: ../../library/ast.rst:514 msgid "" "A ``*var`` variable reference. ``value`` holds the variable, typically a :" "class:`Name` node. This type must be used when building a :class:`Call` node " @@ -898,7 +897,7 @@ msgid "" msgstr "" "``*var`` 形式の変数の参照をあらわします。 ``value`` は変数、典型的には :" "class:`Name` ノード、を保持します。この型は ``*args`` を伴う関数呼び出しノー" -"ド :class:`Call` を構築する際に使用します。 " +"ド :class:`Call` を構築する際に使用します。" #: ../../library/ast.rst:518 msgid "" @@ -1059,9 +1058,8 @@ msgstr "" "関数呼び出しをあらわします。 ``func`` は関数で、多くの場合 :class:`Name` また" "は :class:`Attribute` のオブジェクトです。 関数呼び出しの引数:" -#: ../../library/ast.rst:678 msgid "``args`` holds a list of the arguments passed by position." -msgstr "``args`` は位置引数のリストを保持します。 " +msgstr "``args`` は位置引数のリストを保持します。" #: ../../library/ast.rst:679 msgid "" @@ -3474,7 +3472,6 @@ msgstr "" "外部ドキュメント `Green Tree Snakes `_ には Python AST についての詳細が書かれています。" -#: ../../library/ast.rst:2684 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -3483,7 +3480,7 @@ msgid "" msgstr "" "`ASTTokens `_ は " "Python AST を、生成元のソースコードのトークン位置やテキストで注解します。これ" -"はソースコード変換を行うツールで有用です。 " +"はソースコード変換を行うツールで有用です。" #: ../../library/ast.rst:2689 msgid "" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index a20eac946..0fdf92abc 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -161,7 +161,6 @@ msgstr "" msgid "loop.call_soon_threadsafe(callback, *args)" msgstr "" -#: ../../library/asyncio-dev.rst:77 msgid "" "Almost all asyncio objects are not thread safe, which is typically not a " "problem unless there is code that works with them from outside of a Task or " @@ -172,7 +171,7 @@ msgstr "" "バックの外側で非同期オブジェクトを使うコードが存在しない限り、それが問題には" "なることはほとんどありません。もしそのような目的で低レベルの asyncio API を呼" "び出すようなコードを書く必要がある場合、 :meth:`loop.call_soon_threadsafe` メ" -"ソッドを使ってください。例: " +"ソッドを使ってください。例:" #: ../../library/asyncio-dev.rst:83 msgid "loop.call_soon_threadsafe(fut.cancel)" @@ -241,7 +240,6 @@ msgstr "" msgid "Running Blocking Code" msgstr "ブロッキングコードの実行" -#: ../../library/asyncio-dev.rst:123 msgid "" "Blocking (CPU-bound) code should not be called directly. For example, if a " "function performs a CPU-intensive calculation for 1 second, all concurrent " @@ -249,7 +247,7 @@ msgid "" msgstr "" "ブロッキングコード (CPU バウンドなコード) を直接呼び出すべきではありません。" "たとえば、 CPU 負荷の高い関数を1秒実行したとすると、並行に処理されている全て" -"の非同期タスクと I/O 処理は1秒遅れる可能性があります。 " +"の非同期タスクと I/O 処理は1秒遅れる可能性があります。" #: ../../library/asyncio-dev.rst:128 msgid "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 2e35d176a..a6e15f70d 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -163,7 +163,6 @@ msgid "" msgstr "" "`イベントループのメソッド`_ 節は、イベントループ API のリファレンスです。" -#: ../../library/asyncio-eventloop.rst:92 msgid "" "The `Callback Handles`_ section documents the :class:`Handle` and :class:" "`TimerHandle` instances which are returned from scheduling methods such as :" @@ -171,7 +170,7 @@ msgid "" msgstr "" "`コールバックハンドル`_ 節は :meth:`loop.call_soon` や :meth:`loop." "call_later` などのスケジューリングメソッドが返す :class:`Handle` や :class:" -"`TimerHandle` インスタンスについて解説しています。 " +"`TimerHandle` インスタンスについて解説しています。" #: ../../library/asyncio-eventloop.rst:96 msgid "" @@ -597,7 +596,6 @@ msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" "イベントループに接続した :class:`asyncio.Future` オブジェクトを生成します。" -#: ../../library/asyncio-eventloop.rst:371 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " @@ -605,7 +603,7 @@ msgid "" msgstr "" "asyncio でフューチャーオブジェクトを作成するために推奨される方法です。このメ" "ソッドにより、サードパーティ製のイベントループがFutures クラスの(パフォーマン" -"スや計測方法が優れた) 代替実装を提供することを可能にします。 " +"スや計測方法が優れた) 代替実装を提供することを可能にします。" #: ../../library/asyncio-eventloop.rst:379 msgid "" @@ -2822,13 +2820,12 @@ msgstr "" "start_serving()`` または :meth:`Server.serve_forever` メソッドを使ってオブ" "ジェクトが接続の受け付けを開始するようにすることができます。" -#: ../../library/asyncio-eventloop.rst:1855 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" "接続の受け入れを開始し、コルーチンがキャンセルされるまで継続します。 " -"``serve_forever`` タスクのキャンセルによりサーバーもクローズされます。 " +"``serve_forever`` タスクのキャンセルによりサーバーもクローズされます。" #: ../../library/asyncio-eventloop.rst:1859 msgid "" @@ -2890,13 +2887,12 @@ msgstr "" msgid "Event loop implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1914 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" "asyncio は2つの異なるイベントループの実装、 :class:`SelectorEventLoop` と :" -"class:`ProactorEventLoop`、 を提供します: " +"class:`ProactorEventLoop`、 を提供します:" #: ../../library/asyncio-eventloop.rst:1917 msgid "By default asyncio is configured to use :class:`EventLoop`." @@ -3116,13 +3112,12 @@ msgid "" " loop.close()" msgstr "" -#: ../../library/asyncio-eventloop.rst:2094 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" "トランスポート、プロトコル、および :meth:`loop.create_connection` メソッドを" -"使用した同じような :ref:`例 `。 " +"使用した同じような :ref:`例 `。" #: ../../library/asyncio-eventloop.rst:2098 msgid "" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 453da4b4e..5a18d1e4c 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -154,13 +154,12 @@ msgstr "" "デフォルトの asyncio ポリシーです。Unix では :class:`SelectorEventLoop` 、" "Windows では :class:`ProactorEventLoop` を使います。" -#: ../../library/asyncio-policy.rst:113 msgid "" "There is no need to install the default policy manually. asyncio is " "configured to use the default policy automatically." msgstr "" "デフォルトのポリシーを手動でインストールする必要はありません。 asyncio はデ" -"フォルトポリシーを使うように自動的に構成されます。 " +"フォルトポリシーを使うように自動的に構成されます。" #: ../../library/asyncio-policy.rst:118 msgid "On Windows, :class:`ProactorEventLoop` is now used by default." diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index e7ed72d7c..cc2d7e092 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -847,7 +847,6 @@ msgstr "" msgid "Connection Callbacks" msgstr "通信のコールバック" -#: ../../library/asyncio-protocol.rst:492 msgid "" "Connection callbacks are called on all protocols, exactly once per a " "successful connection. All other protocol callbacks can only be called " @@ -855,7 +854,7 @@ msgid "" msgstr "" "コネクションコールバックは全てのプロトコルから、成功したコネクションそれぞれ" "につきただ一度だけ呼び出されます。その他の全てのプロトコルコールバックはこれ" -"ら2つのメソッドの間に呼び出すことができます。 " +"ら2つのメソッドの間に呼び出すことができます。" #: ../../library/asyncio-protocol.rst:498 msgid "Called when a connection is made." diff --git a/library/asyncio-task.po b/library/asyncio-task.po index fa56e475a..fab3e587a 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -42,7 +42,6 @@ msgstr "コルーチン" msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`" msgstr "" -#: ../../library/asyncio-task.rst:25 msgid "" ":term:`Coroutines ` declared with the async/await syntax is the " "preferred way of writing asyncio applications. For example, the following " @@ -50,7 +49,7 @@ msgid "" msgstr "" "async/await 構文で宣言された :term:`コルーチン ` は、 asyncio を" "使ったアプリケーションを書くのに推奨される方法です。例えば、次のコードスニ" -"ペットは \"hello\" を出力し、そこから 1 秒待って \"world\" を出力します:: " +"ペットは \"hello\" を出力し、そこから 1 秒待って \"world\" を出力します::" #: ../../library/asyncio-task.rst:30 msgid "" diff --git a/library/asyncio.po b/library/asyncio.po index bd8a112c9..977085040 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -221,13 +221,12 @@ msgid "" "the latest features." msgstr "" -#: ../../library/asyncio.rst:93 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " "arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``cpython.run_stdin`` を送出しま" -"す。 " +"す。" #: ../../library/asyncio.rst:95 msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." diff --git a/library/base64.po b/library/base64.po index ac13cc3f2..464bbaf28 100644 --- a/library/base64.po +++ b/library/base64.po @@ -472,13 +472,12 @@ msgid "" "Refer to the documentation of the individual functions for more information." msgstr "" -#: ../../library/base64.rst:316 msgid "" "Encode the :term:`bytes-like object` *b* using Ascii85 and return the " "encoded :class:`bytes`." msgstr "" "Ascii85 を使って :term:`bytes-like object` の *b* をエンコードし、エンコード" -"された :class:`bytes` を返します。 " +"された :class:`bytes` を返します。" #: ../../library/base64.rst:319 msgid "" @@ -503,13 +502,12 @@ msgid "" "they *must not* use a leading ``<~``." msgstr "" -#: ../../library/base64.rst:343 msgid "" "Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and " "return the decoded :class:`bytes`." msgstr "" "Ascii85 エンコードされた :term:`bytes-like object` または ASCII 文字列 *b* を" -"デコードし、デコードされた :class:`bytes` を返します。 " +"デコードし、デコードされた :class:`bytes` を返します。" #: ../../library/base64.rst:346 msgid "" diff --git a/library/collections.po b/library/collections.po index 16cef95e1..0f3b8f167 100644 --- a/library/collections.po +++ b/library/collections.po @@ -1858,7 +1858,6 @@ msgstr "" "OrderedDict の ``od.move_to_end(k, last=True)`` は ``d[k] = d.pop(k)`` で実現" "できます。" -#: ../../library/collections.rst:1147 msgid "" "A regular :class:`dict` does not have an efficient equivalent for " "OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " @@ -1866,7 +1865,7 @@ msgid "" msgstr "" "組み込みの :class:`dict` では、キーと値のペアを最も左側 (先頭) に移動する " "OrderedDict の ``od.move_to_end(k, last=False)`` を実現する効率の良い方法はあ" -"りません。 " +"りません。" #: ../../library/collections.rst:1151 msgid "" diff --git a/library/compileall.po b/library/compileall.po index 74444d3bf..16245d1cf 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -180,7 +180,6 @@ msgid "" "used, then the result of :func:`os.process_cpu_count` will be used." msgstr "" -#: ../../library/compileall.rst:105 msgid "" "Control how the generated byte-code files are invalidated at runtime. The " "``timestamp`` value, means that ``.pyc`` files with the source timestamp and " @@ -193,12 +192,12 @@ msgid "" "the ``SOURCE_DATE_EPOCH`` environment variable is set." msgstr "" "生成したバイトコードファイルを実行時に無効化する方法を制御します。" -"``timestamp`` を指定すると、生成した``.pyc`` ファイルにソースファイルのタイム" -"スタンプとサイズを埋め込みます。``checked-hash`` と ``unchecked-hash`` を指定" -"すると、ハッシュベースの pycファイルが生成されます。ハッシュベースのpycファイ" -"ルは、ソースファイルにタイムスタンプではなくハッシュ値を埋め込みます。Python " -"がバイトコードキャッシュファイルを実行時に検証する方法の詳細を知るには、:ref:" -"`pyc-invalidation` を参照してください。デフォルト値は、:envvar:" +"``timestamp`` を指定すると、生成した ``.pyc`` ファイルにソースファイルのタイ" +"ムスタンプとサイズを埋め込みます。``checked-hash`` と ``unchecked-hash`` を指" +"定すると、ハッシュベースの pycファイルが生成されます。ハッシュベースのpycファ" +"イルは、ソースファイルにタイムスタンプではなくハッシュ値を埋め込みます。" +"Python がバイトコードキャッシュファイルを実行時に検証する方法の詳細を知るに" +"は、:ref:`pyc-invalidation` を参照してください。デフォルト値は、:envvar:" "`SOURCE_DATE_EPOCH` 環境変数が設定されていなければ ``timestamp`` で、" "``SOURCE_DATE_EPOCH`` 環境変数が設定されていれば、``checked-hash`` になりま" "す。" diff --git a/library/configparser.po b/library/configparser.po index ecd34e128..3800ddff0 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -1573,7 +1573,6 @@ msgstr "" "ファイル名の iterable を読み込んでパースしようと試みます。正常にパースできた" "ファイル名のリストを返します。" -#: ../../library/configparser.rst:1098 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -1588,7 +1587,7 @@ msgstr "" "けないファイルがある場合、そのファイルは無視されます。この挙動は、設定ファイ" "ルが置かれる可能性のある場所(例えば、 カレントディレクトリ、ホームディレクト" "リ、システム全体の設定を行うディレクトリ)のイテラブルを指定して、イテラブルの" -"中で存在する全ての設定ファイルを読むことを想定して設計されています。 " +"中で存在する全ての設定ファイルを読むことを想定して設計されています。" #: ../../library/configparser.rst:1107 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index 5d8d09275..a46f4c047 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -3497,13 +3497,12 @@ msgstr "" "メモリバッファのアドレスを示す整数を返します。 *obj* は ctypes 型のインスタン" "スでなければなりません。" -#: ../../library/ctypes.rst:2171 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." msgstr "" "引数 ``obj`` を指定して :ref:`監査イベント ` ``ctypes.addressof`` " -"を送出します。 " +"を送出します。" #: ../../library/ctypes.rst:2176 msgid "" @@ -3628,13 +3627,12 @@ msgid "" "ValueError: byte string too long" msgstr "" -#: ../../library/ctypes.rst:2258 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." msgstr "" "引数 ``init``, ``size`` を指定して :ref:`監査イベント ` ``ctypes." -"create_string_buffer`` を送出します。 " +"create_string_buffer`` を送出します。" #: ../../library/ctypes.rst:2264 msgid "" @@ -3650,13 +3648,12 @@ msgid "" "except *init* must be a string and *size* counts :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:2270 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." msgstr "" "引数 ``init``, ``size`` を指定して :ref:`監査イベント ` ``ctypes." -"create_unicode_buffer`` を送出します。 " +"create_unicode_buffer`` を送出します。" #: ../../library/ctypes.rst:2275 msgid "" @@ -3708,13 +3705,11 @@ msgstr "" "システムの :data:`errno` 変数の、スレッドローカルなプライベートコピーを返しま" "す。" -#: ../../library/ctypes.rst:2328 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" -"引数無しで :ref:`監査イベント ` ``ctypes.get_errno`` を送出しま" -"す。 " +"引数無しで :ref:`監査イベント ` ``ctypes.get_errno`` を送出します。" #: ../../library/ctypes.rst:2332 msgid "" @@ -3722,13 +3717,12 @@ msgid "" "LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2337 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``ctypes.get_last_error`` を送出し" -"ます。 " +"ます。" #: ../../library/ctypes.rst:2342 msgid "" @@ -3800,13 +3794,12 @@ msgstr "" "システム変数 :data:`errno` の、呼び出し元スレッドでの ctypes のプライベートコ" "ピーの現在値を *value* に設定し、前の値を返します。" -#: ../../library/ctypes.rst:2393 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." msgstr "" "引数 ``errno`` を指定して :ref:`監査イベント ` ``ctypes." -"set_errno`` を送出します。 " +"set_errno`` を送出します。" #: ../../library/ctypes.rst:2398 msgid "" @@ -3815,13 +3808,12 @@ msgid "" "value." msgstr "" -#: ../../library/ctypes.rst:2404 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." msgstr "" "引数 ``error`` を指定して :ref:`監査イベント ` ``ctypes." -"set_last_error`` を送出します。 " +"set_last_error`` を送出します。" #: ../../library/ctypes.rst:2409 msgid "" @@ -3941,13 +3933,12 @@ msgstr "" "ファのオフセットをバイト単位で指定します。デフォルトではゼロです。もし " "*source* バッファが十分に大きくなければ、 :exc:`ValueError` が送出されます。" -#: ../../library/ctypes.rst:2494 ../../library/ctypes.rst:2504 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." msgstr "" "引数 ``pointer``, ``size``, ``offset`` を指定して :ref:`監査イベント " -"` ``ctypes.cdata/buffer`` を送出します。 " +"` ``ctypes.cdata/buffer`` を送出します。" #: ../../library/ctypes.rst:2498 msgid "" diff --git a/library/curses.po b/library/curses.po index 463d17984..2c5977e1a 100644 --- a/library/curses.po +++ b/library/curses.po @@ -242,7 +242,6 @@ msgid "" "function." msgstr "" -#: ../../library/curses.rst:150 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -250,10 +249,10 @@ msgid "" "exception. On many terminals, the \"visible\" mode is an underline cursor " "and the \"very visible\" mode is a block cursor." msgstr "" -"カーソルの状態を設定します。*visibility* は ``0`` 、 ``1``または ``2`` に設定" -"され、それぞれ不可視、通常、または非常に可視、を意味します。要求された可視属" -"性を端末がサポートしている場合、以前のカーソル状態が返されます; そうでなけれ" -"ば例外が送出されます。多くの端末では、\"可視 (通常)\" モードは下線カーソル" +"カーソルの状態を設定します。*visibility* は ``0`` 、 ``1`` または ``2`` に設" +"定され、それぞれ不可視、通常、または非常に可視、を意味します。要求された可視" +"属性を端末がサポートしている場合、以前のカーソル状態が返されます; そうでなけ" +"れば例外が送出されます。多くの端末では、\"可視 (通常)\" モードは下線カーソル" "で、\"非常に可視\" モードはブロックカーソルです。" #: ../../library/curses.rst:159 @@ -845,13 +844,12 @@ msgid "" "character to spaces as it adds the tab to a window." msgstr "" -#: ../../library/curses.rst:596 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" "仮想スクリーンのカーソルを *y*, *x* に設定します。*y* および *x* がどちらも " -"``-1`` の場合、 :meth:`leaveok` が に``True``に設定されます。" +"``-1`` の場合、 :meth:`leaveok` が に ``True`` に設定されます。" #: ../../library/curses.rst:602 msgid "" diff --git a/library/email.header.po b/library/email.header.po index fdd4db289..7d2f88a85 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -275,7 +275,6 @@ msgid "" msgstr "" "与えられた場合、*maxlinelen* はインスタンスの最大行長の値を上書きします。" -#: ../../library/email.header.rst:138 msgid "" "*linesep* specifies the characters used to separate the lines of the folded " "header. It defaults to the most useful value for Python application code " @@ -284,7 +283,7 @@ msgid "" msgstr "" "*linesep* は、折り返しヘッダの行を区切る文字を指定します。デフォルトでは" "Pythonアプリケーションコードに最も有用な値(``\\n``)になりますが、RFC準拠の行" -"区切り文字でヘッダを生成するために``\\r\\n``を指定することができます。" +"区切り文字でヘッダを生成するために ``\\r\\n`` を指定することができます。" #: ../../library/email.header.rst:143 msgid "Added the *linesep* argument." diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 21f291b82..00e2014f3 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -193,7 +193,6 @@ msgid "" "header values." msgstr "" -#: ../../library/email.headerregistry.rst:103 msgid "" "``BaseHeader``'s ``__new__`` then creates the header instance, and calls its " "``init`` method. The specialized class only needs to provide an ``init`` " @@ -203,7 +202,7 @@ msgstr "" "その後、 ``BaseHeader`` の ``__new__`` がヘッダのインスタンスを生成し、 " "``init`` メソッドを呼び出します。 特殊クラスは、 ``BaseHeader`` が提供しない" "属性を設定したい場合にのみ ``init`` メソッドを提供する必要があります。 このよ" -"うな``init`` メソッドは以下のようなものです:" +"うな ``init`` メソッドは以下のようなものです:" #: ../../library/email.headerregistry.rst:108 msgid "" @@ -212,15 +211,14 @@ msgid "" " super().init(*args, **kw)" msgstr "" -#: ../../library/email.headerregistry.rst:112 msgid "" "That is, anything extra that the specialized class puts in to the ``kwds`` " "dictionary should be removed and handled, and the remaining contents of " "``kw`` (and ``args``) passed to the ``BaseHeader`` ``init`` method." msgstr "" "つまり、特殊クラスが ``kwds`` の辞書に追加したものはすべて削除して処理し、 " -"``kw``の残りの内容 (と ``args``) は``BaseHeader`` の``init`` メソッドに渡す必" -"要があるのです。" +"``kw`` の残りの内容 (と ``args``) は ``BaseHeader`` の ``init`` メソッドに渡" +"す必要があるのです。" #: ../../library/email.headerregistry.rst:119 msgid "" diff --git a/library/enum.po b/library/enum.po index 618738bd0..e9bbe2f4e 100644 --- a/library/enum.po +++ b/library/enum.po @@ -519,9 +519,8 @@ msgid "" "" msgstr "" -#: ../../library/enum.rst:236 msgid "Returns each member in *cls* in definition order::" -msgstr " *cls* 内の各メンバー を定義順に返します::" +msgstr "*cls* 内の各メンバー を定義順に返します::" #: ../../library/enum.rst:238 msgid "" diff --git a/library/fcntl.po b/library/fcntl.po index 366e8c63e..7ad9c2025 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -171,13 +171,12 @@ msgid "" "segmentation violation or a more subtle data corruption." msgstr "" -#: ../../library/fcntl.rst:119 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." msgstr "" "引数 ``fd``, ``cmd``, ``arg`` を指定して :ref:`監査イベント ` " -"``fcntl.fcntl`` を送出します。 " +"``fcntl.fcntl`` を送出します。" #: ../../library/fcntl.rst:121 msgid "" @@ -253,13 +252,12 @@ msgid "" "array('h', [13341])" msgstr "" -#: ../../library/fcntl.rst:181 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." msgstr "" "引数 ``fd``, ``request``, ``arg`` を指定して :ref:`監査イベント ` " -"``fcntl.ioctl`` を送出します。 " +"``fcntl.ioctl`` を送出します。" #: ../../library/fcntl.rst:183 msgid "" @@ -290,13 +288,12 @@ msgid "" "If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:200 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." msgstr "" "引数 ``fd``, ``operation`` を指定して :ref:`監査イベント ` ``fcntl." -"flock`` を送出します。 " +"flock`` を送出します。" #: ../../library/fcntl.rst:205 msgid "" @@ -370,13 +367,12 @@ msgstr "" "の標準の値は 0 で、ファイルの終了までロックすることを表します。*whence* の標" "準の値も 0 です。" -#: ../../library/fcntl.rst:246 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." msgstr "" "引数 ``fd``, ``cmd``, ``len``, ``start``, ``whence`` を指定して :ref:`監査イ" -"ベント ` ``fcntl.lockf`` を送出します。 " +"ベント ` ``fcntl.lockf`` を送出します。" #: ../../library/fcntl.rst:248 msgid "Examples (all on a SVR4 compliant system)::" diff --git a/library/ftplib.po b/library/ftplib.po index dd413abde..3e16e1ff2 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -221,13 +221,12 @@ msgid "" "timeout setting)." msgstr "" -#: ../../library/ftplib.rst:187 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." msgstr "" "引数 ``self``, ``host``, ``port`` を指定して :ref:`監査イベント ` " -"``ftplib.connect`` を送出します。 " +"``ftplib.connect`` を送出します。" #: ../../library/ftplib.rst:195 msgid "" @@ -265,13 +264,12 @@ msgid "" "Send a simple command string to the server and return the response string." msgstr "シンプルなコマンド文字列をサーバに送信して、受信した文字列を返します。" -#: ../../library/ftplib.rst:229 ../../library/ftplib.rst:238 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." msgstr "" "引数 ``self``, ``cmd`` を指定して :ref:`監査イベント ` ``ftplib." -"sendcmd`` を送出します。 " +"sendcmd`` を送出します。" #: ../../library/ftplib.rst:234 msgid "" diff --git a/library/functions.po b/library/functions.po index 2e1a10c38..77d001833 100644 --- a/library/functions.po +++ b/library/functions.po @@ -1049,7 +1049,6 @@ msgstr "" ">>> complex(-1.23, 4.5)\n" "(-1.23+4.5j)" -#: ../../library/functions.rst:416 msgid "" "If the argument is a string, it must contain either a real part (in the same " "format as for :func:`float`) or an imaginary part (in the same format but " @@ -1065,7 +1064,7 @@ msgid "" msgstr "" "引数が文字列の場合、実数部( :func:`float` と同じ形式)、虚数部(同様の形式" "で ``'j'`` または ``'J'`` 接尾辞)どちらか、あるいは両方(この場合、虚数部の" -"符号は必須)を含まなければなりません。文字列 は空白や括弧 ``'('`` と``')'`` " +"符号は必須)を含まなければなりません。文字列 は空白や括弧 ``'('`` と ``')'`` " "で囲むこともできますが、無視されます。文字列は、 ``'+'`` 、``'-'`` 、 " "``'j'`` または ``'J'`` 接尾辞 、そして10進数の間に空白を含んではなりません。" "たとえば ``complex('1+2j')`` はよいですが、 ``complex('1 + 2j')`` は :exc:" @@ -1645,14 +1644,13 @@ msgstr "" "値の浮動小数点数が返されます。 引数が Python の浮動小数点数の範囲外なら、 :" "exc:`OverflowError` が送出されます。" -#: ../../library/functions.rst:827 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " "back to :meth:`~object.__index__`." msgstr "" "一般の Python オブジェクト ``x`` に対して、``float(x)`` は ``x.__float__()`` " -"に委譲します。 :meth:`~object.__float__()` が定義されていない場合、:meth:" +"に委譲します。 :meth:`~object.__float__` が定義されていない場合、:meth:" "`~object.__index__` へフォールバックします。" #: ../../library/functions.rst:831 @@ -1911,13 +1909,12 @@ msgstr "" msgid "This is the address of the object in memory." msgstr "これはオブジェクトのメモリアドレスです。" -#: ../../library/functions.rst:1010 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引数 ``id`` を指定して :ref:`監査イベント ` ``builtins.id`` を送出" -"します。 " +"します。" #: ../../library/functions.rst:1016 msgid "" @@ -3583,7 +3580,6 @@ msgstr "" "でソートを行なうのに役立ちます(例えば部署でソートしてから給与の等級でソート" "する場合)。" -#: ../../library/functions.rst:1960 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3601,7 +3597,7 @@ msgstr "" "ソートツールを、同じデータに対して適用することによって起こりうるバグを避ける" "助けになります。6つの比較演算子を全て実装することは、リフレクションによって :" "meth:`~object.__gt__` メソッドを呼び出す可能性のある型混合の比較での混乱を避" -"けることにも役立ちます。 " +"けることにも役立ちます。" #: ../../library/functions.rst:1969 msgid "" diff --git a/library/gc.po b/library/gc.po index 1cad1a327..88eaa1906 100644 --- a/library/gc.po +++ b/library/gc.po @@ -131,13 +131,12 @@ msgstr "" msgid "Generation 1 is reintroduced to maintain GC behavior from 3.13." msgstr "" -#: ../../library/gc.rst:87 msgid "" "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " "``generation``." msgstr "" "引数 ``generation`` で :ref:`監査イベント ` ``gc.get_objects`` を送" -"出します。 " +"出します。" #: ../../library/gc.rst:91 msgid "" @@ -273,13 +272,12 @@ msgstr "" "ある場合があるので、利用する際には注意が必要です。 :func:`get_referrers` をデ" "バッグ以外の目的で利用するのは避けてください。" -#: ../../library/gc.rst:175 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referrers`` with " "argument ``objs``." msgstr "" "引数 ``objs`` を指定して :ref:`監査イベント ` ``gc.get_referrers`` " -"を送出します。 " +"を送出します。" #: ../../library/gc.rst:180 msgid "" @@ -301,13 +299,12 @@ msgstr "" "のあるオブジェクトのみです。従って、例えば整数オブジェクトが直接到達可能で" "あっても、このオブジェクトは戻り値には含まれません。" -#: ../../library/gc.rst:188 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " "argument ``objs``." msgstr "" "引数 ``objs`` を指定して :ref:`監査イベント ` ``gc.get_referents`` " -"を送出します。 " +"を送出します。" #: ../../library/gc.rst:192 msgid "" diff --git a/library/glob.po b/library/glob.po index 78a39a0c0..9e7ba9b95 100644 --- a/library/glob.po +++ b/library/glob.po @@ -120,21 +120,19 @@ msgid "" "with a dot (``.``)." msgstr "" -#: ../../library/glob.rst:76 ../../library/glob.rst:108 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." msgstr "" "引数 ``pathname``, ``recursive`` を指定して :ref:`監査イベント ` " -"``glob.glob`` を送出します。 " +"``glob.glob`` を送出します。" -#: ../../library/glob.rst:77 ../../library/glob.rst:109 msgid "" "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " "``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." msgstr "" "引数 ``pathname``, ``recursive``, ``root_dir``, ``dir_fd`` を指定して :ref:`" -"監査イベント ` ``glob.glob/2`` を送出します。 " +"監査イベント ` ``glob.glob/2`` を送出します。" #: ../../library/glob.rst:80 msgid "" @@ -248,7 +246,6 @@ msgstr "" msgid "Examples" msgstr "使用例" -#: ../../library/glob.rst:183 msgid "" "Consider a directory containing the following files: :file:`1.gif`, :file:`2." "txt`, :file:`card.gif` and a subdirectory :file:`sub` which contains only " @@ -256,9 +253,9 @@ msgid "" "Notice how any leading components of the path are preserved. ::" msgstr "" "次のファイルを含むディレクトリを考えます: :file:`1.gif`, :file:`2.txt`, :" -"file:`card.gif` および:file:`3.txt` だけを含む :file:`sub` サブディレクトリ。" -"このとき、 :func:`glob` は以下の結果を返します。パスにおける先頭の要素がどの" -"ように保持されるかに注意してください::" +"file:`card.gif` および :file:`3.txt` だけを含む :file:`sub` サブディレクト" +"リ。このとき、 :func:`glob` は以下の結果を返します。パスにおける先頭の要素が" +"どのように保持されるかに注意してください::" #: ../../library/glob.rst:189 msgid "" diff --git a/library/imaplib.po b/library/imaplib.po index 7ce781af9..7fa9df410 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -631,13 +631,12 @@ msgid "" "You may override this method." msgstr "" -#: ../../library/imaplib.rst:471 msgid "" "Raises an :ref:`auditing event ` ``imaplib.open`` with arguments " "``self``, ``host``, ``port``." msgstr "" "引数 ``self``, ``host``, ``port`` を指定して :ref:`監査イベント ` " -"``imaplib.open`` を送出します。 " +"``imaplib.open`` を送出します。" #: ../../library/imaplib.rst:473 msgid "The *timeout* parameter was added." @@ -732,13 +731,12 @@ msgstr "" "遠隔のサーバに ``data`` を送信します。このメソッドはオーバライドすることがで" "きます。" -#: ../../library/imaplib.rst:544 msgid "" "Raises an :ref:`auditing event ` ``imaplib.send`` with arguments " "``self``, ``data``." msgstr "" "引数 ``self``, ``data`` を指定して :ref:`監査イベント ` ``imaplib." -"send`` を送出します。 " +"send`` を送出します。" #: ../../library/imaplib.rst:549 msgid "" diff --git a/library/inspect.po b/library/inspect.po index d2d6e80a5..0d4cfd2cb 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -1515,7 +1515,6 @@ msgstr "" "であることを示します。より詳しい情報は、 :ref:`位置専用引数に関する FAQ エン" "トリ ` を参照してください。" -#: ../../library/inspect.rst:879 msgid "" "The *follow_wrapped* parameter was added. Pass ``False`` to get a signature " "of *callable* specifically (``callable.__wrapped__`` will not be used to " @@ -1524,7 +1523,7 @@ msgstr "" "*follow_wrapped* パラメータが追加されました。parameter was added. 特に " "*callable* そのものについてのシグネチャを取得するためには ``False`` を指定し" "てください (そうすることで、デコレータで修飾された呼び出し可能オブジェクトに" -"対して``callable.__wrapped__`` が使われなくなります)。" +"対して ``callable.__wrapped__`` が使われなくなります)。" #: ../../library/inspect.rst:885 ../../library/inspect.rst:1021 msgid "The *globals*, *locals*, and *eval_str* parameters were added." diff --git a/library/io.po b/library/io.po index 0b4acd034..7cc02ebe4 100644 --- a/library/io.po +++ b/library/io.po @@ -368,13 +368,12 @@ msgid "" msgstr "" "互換性のための、組み込みの :exc:`BlockingIOError` 例外のエイリアスです。" -#: ../../library/io.rst:231 msgid "" "An exception inheriting :exc:`OSError` and :exc:`ValueError` that is raised " "when an unsupported operation is called on a stream." msgstr "" ":exc:`OSError` と :exc:`ValueError` を継承した例外です。ストリームがサポート" -"していない操作を行おうとした時に送出されます。 " +"していない操作を行おうとした時に送出されます。" #: ../../library/io.rst:237 msgid ":mod:`sys`" @@ -1684,7 +1683,6 @@ msgstr "" "``'\\n'``, ``'\\r'``, ``'\\r\\n'`` のいずれかです。これは以下のように動作しま" "す:" -#: ../../library/io.rst:1004 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1698,7 +1696,7 @@ msgstr "" "ストリームからの入力を読み込んでいるとき、もし *newline* が ``None`` ならば :" "term:`universal newlines` モードが有効になります。入力中の行は ``'\\n'``, " "``'\\r'``, または ``'\\r\\n'`` のいずれで終わってもよく、それらは呼び出し元に" -"返される前に``'\\n'`` に変換されます。 *newline* が ``''`` の場合、 " +"返される前に ``'\\n'`` に変換されます。 *newline* が ``''`` の場合、 " "universal newlines モードは有効になりますが、行末のコードは変換されずに呼び出" "し元に返されます。 *newline* がその他の有効な値の場合は、入力行は与えられた文" "字列のみで終端され、行末は変換されずに呼び出し元に返されます。" diff --git a/library/json.po b/library/json.po index e6720b52c..b60311b0b 100644 --- a/library/json.po +++ b/library/json.po @@ -422,12 +422,11 @@ msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." msgstr "" "*indent* が ``None`` でなければ ``(',', ': ')`` がデフォルトで使われます。" -#: ../../library/json.rst:253 ../../library/json.rst:352 msgid "" "All optional parameters are now :ref:`keyword-only `." msgstr "" "すべてのオプション引数は、 :ref:`キーワード専用 ` に" -"なりました。 " +"なりました。" #: ../../library/json.rst:262 msgid "" @@ -738,11 +737,10 @@ msgstr "" "脱直列化しようとしているデータが不正な JSON ドキュメントだった場合、 :exc:" "`JSONDecodeError` が送出されます。" -#: ../../library/json.rst:458 ../../library/json.rst:564 msgid "All parameters are now :ref:`keyword-only `." msgstr "" "すべての引数は、 :ref:`キーワード専用 ` になりまし" -"た。 " +"た。" #: ../../library/json.rst:463 msgid "" diff --git a/library/logging.po b/library/logging.po index 00a3cfe2c..8397c673b 100644 --- a/library/logging.po +++ b/library/logging.po @@ -1148,7 +1148,6 @@ msgstr "" "ロギングを構成するための API はモジュールレベルのロックを取得し、その後ハンド" "ラを構成する際に個々のハンドラに対してハンドラレベルのロックを取得します。" -#: ../../library/logging.rst:642 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -1163,7 +1162,7 @@ msgstr "" "がハンドラレベルのロックを取得する *前に* モジュールレベルのロックを取得しよ" "うとする一方で、 (このメソッドはハンドラレベルのロックが既に取得された状態で" "呼び出されているため) このメソッドを呼び出したスレッドはハンドラレベルのロッ" -"クを取得した *後で* モジュールレベルのロックを取得しようとするためです。 " +"クを取得した *後で* モジュールレベルのロックを取得しようとするためです。" #: ../../library/logging.rst:649 msgid "" @@ -2527,13 +2526,12 @@ msgid "" "compatibility." msgstr "" -#: ../../library/logging.rst:1330 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" "*name* に指定した名前のハンドラを返します。指定した名前のハンドラがない場合" -"は ``None`` を返します。 " +"は ``None`` を返します。" #: ../../library/logging.rst:1337 msgid "Returns an immutable set of all known handler names." diff --git a/library/marshal.po b/library/marshal.po index 0462c3614..2aeddf5ca 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -156,13 +156,12 @@ msgstr "" "*version* 引数は ``dump`` が使用するデータフォーマットを指定します (下記を参" "照してください)。" -#: ../../library/marshal.rst:96 ../../library/marshal.rst:136 msgid "" "Raises an :ref:`auditing event ` ``marshal.dumps`` with arguments " "``value``, ``version``." msgstr "" "引数 ``value``, ``version`` を指定して :ref:`監査イベント ` " -"``marshal.dumps`` を送出します。 " +"``marshal.dumps`` を送出します。" #: ../../library/marshal.rst:98 ../../library/marshal.rst:122 #: ../../library/marshal.rst:138 ../../library/marshal.rst:156 @@ -178,12 +177,11 @@ msgid "" "The file must be a readable :term:`binary file`." msgstr "" -#: ../../library/marshal.rst:110 msgid "" "Raises an :ref:`auditing event ` ``marshal.load`` with no " "arguments." msgstr "" -"引数無しで :ref:`監査イベント ` ``marshal.load`` を送出します。 " +"引数無しで :ref:`監査イベント ` ``marshal.load`` を送出します。" #: ../../library/marshal.rst:114 msgid "" @@ -224,13 +222,12 @@ msgid "" "Extra bytes in the input are ignored." msgstr "" -#: ../../library/marshal.rst:149 msgid "" "Raises an :ref:`auditing event ` ``marshal.loads`` with argument " "``bytes``." msgstr "" "引数 ``bytes`` を指定して :ref:`監査イベント ` ``marshal.loads`` を" -"送出します。 " +"送出します。" #: ../../library/marshal.rst:153 msgid "" diff --git a/library/math.po b/library/math.po index 5c5423e0c..a506a86a3 100644 --- a/library/math.po +++ b/library/math.po @@ -942,7 +942,6 @@ msgstr "*x* が負なら、``ulp(-x)`` を返します。" msgid "If *x* is a positive infinity, return *x*." msgstr "*x* が正の無限大なら、*x* を返します。" -#: ../../library/math.rst:384 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " "representable float (smaller than the minimum positive *normalized* float, :" @@ -950,7 +949,7 @@ msgid "" msgstr "" "*x* が 0 に等しければ、(最小の正の *正規化* 浮動小数点数 :data:`sys." "float_info.min ` よりも小さい) 最小の正の表現可能な *非正規化" -"* 浮動小数点数を返します。 " +"* 浮動小数点数を返します。" #: ../../library/math.rst:387 msgid "" diff --git a/library/msvcrt.po b/library/msvcrt.po index 4b9ae33b4..405b79d48 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -89,13 +89,12 @@ msgid "" "individually." msgstr "" -#: ../../library/msvcrt.rst:46 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.locking`` with arguments " "``fd``, ``mode``, ``nbytes``." msgstr "" "引数 ``fd``, ``mode``, ``nbytes`` を指定して :ref:`監査イベント ` " -"``msvcrt.locking`` を送出します。 " +"``msvcrt.locking`` を送出します。" #: ../../library/msvcrt.rst:52 msgid "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 17d92e8f6..6359ea886 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -375,7 +375,6 @@ msgid "" " p.join()" msgstr "" -#: ../../library/multiprocessing.rst:248 msgid "" "Note that objects related to one context may not be compatible with " "processes for a different context. In particular, locks created using the " @@ -385,7 +384,7 @@ msgstr "" "あるコンテキストに関連したオブジェクトは、異なるコンテキストのプロセスとは互" "換性がない場合があることに注意してください。特に、*fork* コンテキストを使用し" "て作成されたロックは、*spawn* あるいは *forkserver* を使用して開始されたプロ" -"セスに渡すことはできません。 " +"セスに渡すことはできません。" #: ../../library/multiprocessing.rst:253 msgid "" @@ -873,14 +872,13 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:571 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" "デフォルトでは、*target* に何の引数も与えられません。(実) 引数 *args* (デフォ" -"ルトは``()``)は、*target* に渡す引数のリストまたはタプルを指定するために使用" +"ルトは ``()``)は、*target* に渡す引数のリストまたはタプルを指定するために使用" "されます。" #: ../../library/multiprocessing.rst:575 diff --git a/library/os.po b/library/os.po index 450c81f37..a8cbe952c 100644 --- a/library/os.po +++ b/library/os.po @@ -7394,24 +7394,22 @@ msgstr "待機ステータスを終了コードに変換します。" msgid "On Unix:" msgstr "Unix の場合:" -#: ../../library/os.rst:5917 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -"子プロセスが正常終了した場合 (``WIFEXITED(status)``が真の場合)、子プロセスの" +"子プロセスが正常終了した場合 (``WIFEXITED(status)`` が真の場合)、子プロセスの" "終了ステータス (``WEXITSTATUS(status)``) を返します: 戻り値は0または正の整数" "です。" -#: ../../library/os.rst:5920 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " "caused the process to terminate (return ``-WTERMSIG(status)``): result less " "than 0." msgstr "" -"子プロセスがシグナルによって終了した場合 (``WIFSIGNALED(status)``が真の場" +"子プロセスがシグナルによって終了した場合 (``WIFSIGNALED(status)`` が真の場" "合)、子プロセスを終了したシグナルの番号に負符号をつけた ``-signum`` (``-" "WTERMSIG(status)``) を返します: 戻り値は負の整数です。" diff --git a/library/pathlib.po b/library/pathlib.po index e8f3cac89..35fdae61e 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -197,13 +197,12 @@ msgstr "" msgid "Exceptions" msgstr "例外" -#: ../../library/pathlib.rst:101 msgid "" "An exception inheriting :exc:`NotImplementedError` that is raised when an " "unsupported operation is called on a path object." msgstr "" ":exc:`NotImplementedError` を継承した例外です。パスオブジェクトがサポートして" -"いない操作を行おうとした時に送出されます。 " +"いない操作を行おうとした時に送出されます。" #: ../../library/pathlib.rst:110 msgid "Pure paths" @@ -1566,7 +1565,6 @@ msgstr "" msgid "Querying file type and status" msgstr "ファイルの種類とステータスを問い合わせる" -#: ../../library/pathlib.rst:999 msgid "" ":meth:`~Path.exists`, :meth:`~Path.is_dir`, :meth:`~Path.is_file`, :meth:" "`~Path.is_mount`, :meth:`~Path.is_symlink`, :meth:`~Path.is_block_device`, :" @@ -1578,7 +1576,7 @@ msgstr "" "`~Path.is_mount`, :meth:`~Path.is_symlink`, :meth:`~Path.is_block_device`, :" "meth:`~Path.is_char_device`, :meth:`~Path.is_fifo`, :meth:`~Path.is_socket` " "は、OSレベルで表現不能な文字を含むパスに対して、例外を送出する代わりに " -"``False`` を返すようになりました。 " +"``False`` を返すようになりました。" #: ../../library/pathlib.rst:1008 msgid "" @@ -2023,13 +2021,12 @@ msgid "" "without read permission." msgstr "" -#: ../../library/pathlib.rst:1362 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." msgstr "" "引数 ``self``, ``pattern`` を指定して :ref:`監査イベント ` " -"``pathlib.Path.glob`` を送出します。 " +"``pathlib.Path.glob`` を送出します。" #: ../../library/pathlib.rst:1367 ../../library/pathlib.rst:1401 msgid "The *recurse_symlinks* parameter was added." @@ -2054,13 +2051,12 @@ msgstr "" msgid ":ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation." msgstr ":ref:`pathlib-pattern-language` と :meth:`Path.glob` のドキュメント。" -#: ../../library/pathlib.rst:1396 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." msgstr "" "引数 ``self``, ``pattern`` を指定して :ref:`監査イベント ` " -"``pathlib.Path.rglob`` を送出します。 " +"``pathlib.Path.rglob`` を送出します。" #: ../../library/pathlib.rst:1410 msgid "" @@ -2555,7 +2551,6 @@ msgstr "" msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr ":func:`os.chmod` のようにファイルのモードとアクセス権限を変更します。" -#: ../../library/pathlib.rst:1765 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " @@ -2563,8 +2558,8 @@ msgid "" msgstr "" "このメソッドは通常シンボリックリンクをたどります。一部のUnixではシンボリック" "リンク自体のパーミッション変更をサポートしています。そのようなプラットフォー" -"ムでは引数に``follow_symlinks=False`` を追加するか、:meth:`~Path.lchmod` を使" -"用してください。" +"ムでは引数に ``follow_symlinks=False`` を追加するか、:meth:`~Path.lchmod` を" +"使用してください。" #: ../../library/pathlib.rst:1771 msgid "" diff --git a/library/pdb.po b/library/pdb.po index fe1f7f363..b8bb448f1 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -463,10 +463,9 @@ msgstr "*skip* を使ってトレースする呼び出しの例::" msgid "import pdb; pdb.Pdb(skip=['django.*']).set_trace()" msgstr "import pdb; pdb.Pdb(skip=['django.*']).set_trace()" -#: ../../library/pdb.rst:306 msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." -msgstr "引数無しで :ref:`監査イベント ` ``pdb.Pdb`` を送出します。 " +msgstr "引数無しで :ref:`監査イベント ` ``pdb.Pdb`` を送出します。" #: ../../library/pdb.rst:308 msgid "Added the *skip* parameter." diff --git a/library/pickle.po b/library/pickle.po index db80fe43b..c2c8d3c22 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -813,13 +813,12 @@ msgstr "" "キュリティリスクの減少) に関する制御を得るためにこれをオーバーライドすること" "ができます。詳細に関しては :ref:`pickle-restrict` を参照してください。" -#: ../../library/pickle.rst:468 msgid "" "Raises an :ref:`auditing event ` ``pickle.find_class`` with " "arguments ``module``, ``name``." msgstr "" "引数 ``modulet``, ``name`` を指定して :ref:`監査イベント ` " -"``pickle.find_class`` を送出します。 " +"``pickle.find_class`` を送出します。" #: ../../library/pickle.rst:472 msgid "" @@ -1641,7 +1640,6 @@ msgstr "" msgid "Custom Reduction for Types, Functions, and Other Objects" msgstr "型、関数、その他のオブジェクトに対するリダクションのカスタマイズ" -#: ../../library/pickle.rst:903 msgid "" "Sometimes, :attr:`~Pickler.dispatch_table` may not be flexible enough. In " "particular we may want to customize pickling based on another criterion than " @@ -1650,7 +1648,7 @@ msgid "" msgstr "" ":attr:`~Pickler.dispatch_table` は、ときにその柔軟性が十分でないがことありま" "す。特に、オブジェクトの型以外の別の条件で pickle 化をカスタマイズしたい場合" -"や、関数やクラスを使って pickle 化をカスタマイズしたい場合などです。 " +"や、関数やクラスを使って pickle 化をカスタマイズしたい場合などです。" #: ../../library/pickle.rst:908 msgid "" diff --git a/library/pkgutil.po b/library/pkgutil.po index 8938e06ca..61a96d318 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -120,14 +120,12 @@ msgstr "" "キャッシュ (やその一部) は、 :data:`sys.path_hooks` のリスキャンが必要になっ" "た場合は手動でクリアすることができます。" -#: ../../library/pkgutil.rst:63 ../../library/pkgutil.rst:81 -#: ../../library/pkgutil.rst:102 ../../library/pkgutil.rst:141 msgid "" "Updated to be based directly on :mod:`importlib` rather than relying on the " "package internal :pep:`302` import emulation." msgstr "" "パッケージ内部の :pep:`302` エミュレーションに依存するのではなく直接的に :" -"mod:`importlib` に基くように更新されました。 " +"mod:`importlib` に基くように更新されました。" #: ../../library/pkgutil.rst:70 msgid "Yield :term:`finder` objects for the given module name." diff --git a/library/pprint.po b/library/pprint.po index f193aa002..ff8d62a72 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -101,7 +101,6 @@ msgstr "" "出力の1行あたり最大文字数を指定します。構造が幅の制約の中で整形できない場合、" "最善の努力がなされます。" -#: ../../library/pprint.rst:59 msgid "" "The number of nesting levels which may be printed. If the data structure " "being printed is too deep, the next contained level is replaced by ``...``. " @@ -109,7 +108,7 @@ msgid "" "objects being formatted." msgstr "" "表示される入れ子レベルの数を制御します。表示されるデータ構造が深すぎる場合、" -"含まれる次のレベルは``...``で置き換えられます。``None`` (デフォルト)の場" +"含まれる次のレベルは ``...`` で置き換えられます。``None`` (デフォルト)の場" "合、フォーマットされるオブジェクトの深さに制約はありません。" #: ../../library/pprint.rst:67 @@ -135,13 +134,12 @@ msgstr "" "Trueの場合、辞書は辞書のキー順にソートされて整形されます。そうでなければ挿入" "順に表示されます(デフォルト)。" -#: ../../library/pprint.rst:86 msgid "" "If ``True``, integers will be formatted with the ``_`` character for a " "thousands separator, otherwise underscores are not displayed (the default)." msgstr "" -"Trueの場合、整数は``_``で3桁区切りされて表示されます。そうでなければアンダー" -"スコアは表示されません(デフォルト)。" +"Trueの場合、整数は ``_`` で3桁区切りされて表示されます。そうでなければアン" +"ダースコアは表示されません(デフォルト)。" #: ../../library/pprint.rst:109 msgid "" diff --git a/library/pty.po b/library/pty.po index 4d2cab498..51c999ffa 100644 --- a/library/pty.po +++ b/library/pty.po @@ -146,13 +146,12 @@ msgid "" "into an exit code." msgstr "" -#: ../../library/pty.rst:83 msgid "" "Raises an :ref:`auditing event ` ``pty.spawn`` with argument " "``argv``." msgstr "" "引数 ``argv`` を指定して :ref:`監査イベント ` ``pty.spawn`` を送出" -"します。 " +"します。" #: ../../library/pty.rst:85 msgid "" diff --git a/library/random.po b/library/random.po index 9f2eb16d5..7d360cf71 100644 --- a/library/random.po +++ b/library/random.po @@ -682,7 +682,6 @@ msgid "" "the :mod:`!random` module." msgstr "" -#: ../../library/random.rst:415 msgid "" "Formerly the *seed* could be any hashable object. Now it is limited to: " "``None``, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :" @@ -690,7 +689,7 @@ msgid "" msgstr "" "以前は *seed* は任意のハッシュ可能オブジェクトが設定可能でした。現在は " "``None``, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, :class:" -"`bytearray` に制限されています。 " +"`bytearray` に制限されています。" #: ../../library/random.rst:420 msgid "" diff --git a/library/re.po b/library/re.po index fc18e7450..2c0828b36 100644 --- a/library/re.po +++ b/library/re.po @@ -53,7 +53,6 @@ msgstr "" "り、その逆はできません。同様に、置換時の置換文字列はパターンおよび検索文字列" "の両方と同じ型でなくてはなりません。" -#: ../../library/re.rst:21 msgid "" "Regular expressions use the backslash character (``'\\'``) to indicate " "special forms or to allow special characters to be used without invoking " @@ -73,7 +72,7 @@ msgstr "" "す。例えば、リテラルのバックスラッシュにマッチさせるには、パターン文字列とし" "て ``'\\\\\\\\'`` と書かなければなりません。なぜなら、正規表現は ``\\\\`` で" "なければならないうえ、それぞれのバックスラッシュは標準の Python 文字列リテラ" -"ルで ``\\\\`` と表現せねばならないからです。 \n" +"ルで ``\\\\`` と表現せねばならないからです。\n" "Python の文字列リテラルにおいて、バックスラッシュの使用による不正なエスケープ" "文字がある場合は、:exc:`SyntaxWarning` が発生し、将来的には :exc:" "`SyntaxError` になることにも注意してください。この動作は、正規表現として有効" @@ -1216,7 +1215,6 @@ msgstr "" "(``\\b`` は単語の境界を表すのに使われ、文字クラス中でのみ \"後退 " "(backspace)\" 文字を意味することに注意してください。)" -#: ../../library/re.rst:697 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode (str) patterns. In bytes patterns they are errors. Unknown escapes " @@ -1224,7 +1222,7 @@ msgid "" msgstr "" "``'\\u'``、``'\\U'`` および ``'\\N'`` エスケープシーケンスは、Unicode (str)パ" "ターン内でのみ認識されます。バイト列ではエラーとなります。ASCII 文字のエス" -"ケープで未知のものは将来使うために予約されていて、エラーとして扱われます。 " +"ケープで未知のものは将来使うために予約されていて、エラーとして扱われます。" #: ../../library/re.rst:703 msgid "" @@ -2533,13 +2531,12 @@ msgstr "" msgid "Checking for a pair" msgstr "" -#: ../../library/re.rst:1640 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" "この例では、マッチオブジェクトをより美しく表示するために、この補助関数を使用" -"します:: " +"します::" #: ../../library/re.rst:1643 msgid "" diff --git a/library/resource.po b/library/resource.po index 7891a95cc..51665ef1e 100644 --- a/library/resource.po +++ b/library/resource.po @@ -160,13 +160,12 @@ msgstr "" msgid "VxWorks only supports setting :const:`RLIMIT_NOFILE`." msgstr "" -#: ../../library/resource.rst:93 msgid "" "Raises an :ref:`auditing event ` ``resource.setrlimit`` with " "arguments ``resource``, ``limits``." msgstr "" -"引数 ``src``, ``dst`, ``limits`` を指定して :ref:`監査イベント ` " -"``resource.setrlimit`` を送出します。 " +"引数 ``resource``, ``limits`` を指定して :ref:`監査イベント ` " +"``resource.setrlimit`` を送出します。" #: ../../library/resource.rst:98 msgid "" @@ -202,13 +201,12 @@ msgstr "" "*pid* が見付からないときは :exc:`ProcessLookupError` を、ユーザがプロセスの " "``CAP_SYS_RESOURCE`` を持ってないときは :exc:`PermissionError` を送出します。" -#: ../../library/resource.rst:112 msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." msgstr "" -"引数 ``pid``, ``dst`, ``limits`` を指定して :ref:`監査イベント ` " -"``resource.prlimit`` を送出します。 " +"引数 ``pid``, ``resource``, ``limits`` を指定して :ref:`監査イベント " +"` ``resource.prlimit`` を送出します。" #: ../../library/resource.rst:119 msgid "" diff --git a/library/runpy.po b/library/runpy.po index 99beffe4b..b4fbf5aef 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -95,15 +95,15 @@ msgid "" "detail.)" msgstr "" -#: ../../library/runpy.rst:56 msgid "" "``__name__`` is set to *run_name* if this optional argument is not :const:" "`None`, to ``mod_name + '.__main__'`` if the named module is a package and " "to the *mod_name* argument otherwise." msgstr "" -"``__name__`` は、 *run_name* が:const:`None` でない場合は *run_name* に設定さ" -"れます。 *run_name* が :const:`None` である場合、 *mod_name* がパッケージであ" -"れば``mod_name + '.__main__'`` に、それ以外では *mod_name* に設定されます。" +"``__name__`` は、 *run_name* が :const:`None` でない場合は *run_name* に設定" +"されます。 *run_name* が :const:`None` である場合、 *mod_name* がパッケージで" +"あれば ``mod_name + '.__main__'`` に、それ以外では *mod_name* に設定されま" +"す。" #: ../../library/runpy.rst:60 msgid "" diff --git a/library/shutil.po b/library/shutil.po index c8e6b9a87..c3a3f16d2 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -134,14 +134,12 @@ msgstr "" "*follow_symlinks* が偽で *src* がシンボリックリンクの場合、 *src* のリンク先" "をコピーする代わりに新しいシンボリックリンクを作成します。" -#: ../../library/shutil.rst:74 ../../library/shutil.rst:188 -#: ../../library/shutil.rst:219 msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." msgstr "" "引数 ``src``, ``dst`` を指定して :ref:`監査イベント ` ``shutil." -"copyfile`` を送出します。 " +"copyfile`` を送出します。" #: ../../library/shutil.rst:76 msgid "" @@ -204,13 +202,12 @@ msgstr "" "さい。シンボリックリンクの変更をしようとした時、 :func:`copymode` がローカル" "のプラットフォームでシンボリックリンクを変更できない場合は何もしません。" -#: ../../library/shutil.rst:117 ../../library/shutil.rst:190 msgid "" "Raises an :ref:`auditing event ` ``shutil.copymode`` with " "arguments ``src``, ``dst``." msgstr "" "引数 ``src``, ``dst`` を指定して :ref:`監査イベント ` ``shutil." -"copymode`` を送出します。 " +"copymode`` を送出します。" #: ../../library/shutil.rst:119 msgid "Added *follow_symlinks* argument." @@ -292,13 +289,12 @@ msgid "Please see :data:`os.supports_follow_symlinks` for more information." msgstr "" "より詳しい情報は :data:`os.supports_follow_symlinks` を参照して下さい。" -#: ../../library/shutil.rst:164 ../../library/shutil.rst:221 msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." msgstr "" "引数 ``src``, ``dst`` を指定して :ref:`監査イベント ` ``shutil." -"copystat`` を送出します。 " +"copystat`` を送出します。" #: ../../library/shutil.rst:166 msgid "" @@ -494,13 +490,12 @@ msgid "" "*src* tree." msgstr "" -#: ../../library/shutil.rst:286 msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." msgstr "" "引数 ``src``, ``dst`` を指定して :ref:`監査イベント ` ``shutil." -"copytree`` を送出します。 " +"copytree`` を送出します。" #: ../../library/shutil.rst:288 msgid "" @@ -584,13 +579,12 @@ msgid "" "directory tree that contains read-only files." msgstr "" -#: ../../library/shutil.rst:345 msgid "" "Raises an :ref:`auditing event ` ``shutil.rmtree`` with arguments " "``path``, ``dir_fd``." msgstr "" "引数 ``path``, ``dir_fd`` を指定して :ref:`監査イベント ` ``shutil." -"rmtree`` を送出します。 " +"rmtree`` を送出します。" #: ../../library/shutil.rst:347 msgid "" @@ -682,13 +676,12 @@ msgid "" "copy the metadata, at the expense of not copying any of the metadata." msgstr "" -#: ../../library/shutil.rst:405 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." msgstr "" "引数 ``src``, ``dst`` を指定して :ref:`監査イベント ` ``shutil." -"move`` を送出します。 " +"move`` を送出します。" #: ../../library/shutil.rst:407 msgid "" @@ -753,13 +746,12 @@ msgstr "" msgid "See also :func:`os.chown`, the underlying function." msgstr "内部で利用している :func:`os.chown` も参照してください。" -#: ../../library/shutil.rst:453 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." msgstr "" "引数 ``path``, ``user``, ``group`` を指定して :ref:`監査イベント ` " -"``shutil.chown`` を送出します。 " +"``shutil.chown`` を送出します。" #: ../../library/shutil.rst:459 msgid "Added *dir_fd* and *follow_symlinks* parameters." @@ -1256,13 +1248,12 @@ msgid "" "extraction-filter` for details.)" msgstr "" -#: ../../library/shutil.rst:750 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." msgstr "" "引数 ``filename``, ``extract_dir``, ``format`` を指定して :ref:`監査イベント " -"` ``shutil.unpack_archive`` を送出します。 " +"` ``shutil.unpack_archive`` を送出します。" #: ../../library/shutil.rst:754 msgid "" diff --git a/library/signal.po b/library/signal.po index e2b627951..379fc8153 100644 --- a/library/signal.po +++ b/library/signal.po @@ -583,13 +583,12 @@ msgid "" "performed; this can be used to check if the target thread is still running." msgstr "" -#: ../../library/signal.rst:470 msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." msgstr "" "引数 ``thread_id``, ``signalnum`` を指定して :ref:`監査イベント ` " -"``signal.pthread_kill`` を送出します。 " +"``signal.pthread_kill`` を送出します。" #: ../../library/signal.rst:474 msgid "See the man page :manpage:`pthread_kill(3)` for further information." diff --git a/library/smtplib.po b/library/smtplib.po index 499fe35d2..8e96c11e9 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -416,13 +416,12 @@ msgid "" "`default_port` attribute is used." msgstr "" -#: ../../library/smtplib.rst:278 msgid "" "Raises an :ref:`auditing event ` ``smtplib.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" "引数 ``self``, ``host``, ``port`` を指定して :ref:`監査イベント ` " -"``smtplib.connect`` を送出します。 " +"``smtplib.connect`` を送出します。" #: ../../library/smtplib.rst:283 msgid "" diff --git a/library/socket.po b/library/socket.po index 6ce2199e1..59c2d4e5c 100644 --- a/library/socket.po +++ b/library/socket.po @@ -1433,13 +1433,12 @@ msgstr "" "をサポートしていません。IPv4/ v6のデュアルスタックをサポートする場合は :func:" "`getaddrinfo` を使用します。" -#: ../../library/socket.rst:1089 ../../library/socket.rst:1105 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" "引数 ``hostname`` を指定して :ref:`監査イベント ` ``socket." -"gethostbyname`` を送出します。 " +"gethostbyname`` を送出します。" #: ../../library/socket.rst:1096 msgid "" @@ -1461,13 +1460,12 @@ msgstr "" "Pythonインタープリタを現在実行しているマシンのホスト名を含む文字列を返しま" "す。" -#: ../../library/socket.rst:1115 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``socket.gethostname`` を送出しま" -"す。 " +"す。" #: ../../library/socket.rst:1117 msgid "" @@ -1488,13 +1486,12 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1133 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" "引数 ``ip_address`` を指定して :ref:`監査イベント ` ``socket." -"gethostbyaddr`` を送出します。 " +"gethostbyaddr`` を送出します。" #: ../../library/socket.rst:1140 msgid "" @@ -1515,13 +1512,12 @@ msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1150 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" "引数 ``sockaddr`` を指定して :ref:`監査イベント ` ``socket." -"getnameinfo`` を送出します。 " +"getnameinfo`` を送出します。" #: ../../library/socket.rst:1157 msgid "" @@ -1542,13 +1538,12 @@ msgstr "" "す。省略可能なプロトコル名として、 ``'tcp'`` か ``'udp'`` のどちらかを指定す" "ることができます。指定がなければどちらのプロトコルにもマッチします。" -#: ../../library/socket.rst:1172 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." msgstr "" "引数 ``servicename``, ``protocolname`` を指定して :ref:`監査イベント " -"` ``socket.getservbyname`` を送出します。 " +"` ``socket.getservbyname`` を送出します。" #: ../../library/socket.rst:1179 msgid "" @@ -1560,13 +1555,12 @@ msgstr "" "なプロトコル名として、 ``'tcp'`` か ``'udp'`` のどちらかを指定することができ" "ます。指定がなければどちらのプロトコルにもマッチします。" -#: ../../library/socket.rst:1183 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." msgstr "" "引数 ``port``, ``protocolname`` を指定して :ref:`監査イベント ` " -"``socket.getservbyport`` を送出します。 " +"``socket.getservbyport`` を送出します。" #: ../../library/socket.rst:1190 msgid "" @@ -2057,13 +2051,12 @@ msgid "" "addresses`." msgstr "" -#: ../../library/socket.rst:1570 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." msgstr "" "引数 ``self``, ``address`` を指定して :ref:`監査イベント ` " -"``socket.bind`` を送出します。 " +"``socket.bind`` を送出します。" #: ../../library/socket.rst:1577 msgid "" @@ -2113,13 +2106,12 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1611 ../../library/socket.rst:1631 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." msgstr "" "引数 ``self``, ``address`` を指定して :ref:`監査イベント ` " -"``socket.connect`` を送出します。 " +"``socket.connect`` を送出します。" #: ../../library/socket.rst:1613 msgid "" @@ -2556,13 +2548,12 @@ msgid "" "family --- see :ref:`socket-addresses`." msgstr "" -#: ../../library/socket.rst:1985 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." msgstr "" "引数 ``self``, ``address`` を指定して :ref:`監査イベント ` " -"``socket.sendto`` を送出します。 " +"``socket.sendto`` を送出します。" #: ../../library/socket.rst:1995 msgid "" @@ -2615,13 +2606,12 @@ msgid "" "array(\"i\", fds))])" msgstr "" -#: ../../library/socket.rst:2028 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." msgstr "" "引数 ``self``, ``address`` を指定して :ref:`監査イベント ` " -"``socket.sendmsg`` を送出します。 " +"``socket.sendmsg`` を送出します。" #: ../../library/socket.rst:2039 msgid "" @@ -3186,12 +3176,11 @@ msgstr "" "のタイムアウト期限が自然に切れるのを待つことなく再利用することをカーネルに伝" "えます。" -#: ../../library/socket.rst:2451 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" "C 言語によるソケットプログラミングの基礎については、以下の資料を参照してくだ" -"さい。 " +"さい。" #: ../../library/socket.rst:2453 msgid "" diff --git a/library/sqlite3.po b/library/sqlite3.po index f6138fa95..eb3a76cc0 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -532,21 +532,19 @@ msgstr "" msgid "Return type" msgstr "戻り値型" -#: ../../library/sqlite3.rst:343 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" "引数 ``database`` を指定して :ref:`監査イベント ` ``sqlite3." -"connect`` を送出します。 " +"connect`` を送出します。" -#: ../../library/sqlite3.rst:344 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" "引数 ``connection_handle`` を指定して :ref:`監査イベント ` " -"``sqlite3.connect/handle`` を送出します。 " +"``sqlite3.connect/handle`` を送出します。" #: ../../library/sqlite3.rst:346 msgid "Added the *uri* parameter." @@ -1593,13 +1591,12 @@ msgstr "" "能のサポートを得るには、 :program:`configure` に :option:`--enable-loadable-" "sqlite-extensions` オプションを渡す必要があります。" -#: ../../library/sqlite3.rst:1034 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" "引数 ``connection``, ``enabled`` を指定して :ref:`監査イベント ` " -"``sqlite3.enable_load_extension`` を送出します。 " +"``sqlite3.enable_load_extension`` を送出します。" #: ../../library/sqlite3.rst:1038 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." @@ -1658,13 +1655,12 @@ msgstr "" "トリ・ポイント名を推測します。 詳細については、SQLite ドキュメント `Loading " "an Extension`_ を参照してください。" -#: ../../library/sqlite3.rst:1087 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" "引数 ``connection``, ``path`` を指定して :ref:`監査イベント ` " -"``sqlite3.load_extension`` を送出します。 " +"``sqlite3.load_extension`` を送出します。" #: ../../library/sqlite3.rst:1091 msgid "Added the ``sqlite3.load_extension`` auditing event." diff --git a/library/statistics.po b/library/statistics.po index 0635f0651..e3ce60e9c 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -458,7 +458,6 @@ msgid "" "assumed." msgstr "" -#: ../../library/statistics.rst:223 msgid "" "The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the " "reciprocals of the data. For example, the harmonic mean of three values *a*, " @@ -466,7 +465,7 @@ msgid "" "values is zero, the result will be zero." msgstr "" "調和平均(harmonic mean)は、データの逆数の算術平均 :func:`mean` の逆数です。" -"例えば、3つの値 *a*, *b*, *c* の調和平均は``3/(1/a + 1/b + 1/c)`` になりま" +"例えば、3つの値 *a*, *b*, *c* の調和平均は ``3/(1/a + 1/b + 1/c)`` になりま" "す。いずれかの値が0の場合、結果は0になります。" #: ../../library/statistics.rst:228 diff --git a/library/stdtypes.po b/library/stdtypes.po index 42299862f..ffae3304b 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -1149,14 +1149,13 @@ msgstr "" "浮動小数点数が返されます。 引数が Python の浮動小数点数の範囲外なら、 :exc:" "`OverflowError` が送出されます。" -#: ../../library/stdtypes.rst:653 msgid "" "For a general Python object ``x``, ``float.from_number(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " "back to :meth:`~object.__index__`." msgstr "" "一般の Python オブジェクト ``x`` に対して、``float.from_number(x)`` は ``x." -"__float__()`` に委譲します。 :meth:`~object.__float__()` が定義されていない場" +"__float__()`` に委譲します。 :meth:`~object.__float__` が定義されていない場" "合、:meth:`~object.__index__` へフォールバックします。" #: ../../library/stdtypes.rst:663 @@ -3861,7 +3860,6 @@ msgid "" "True" msgstr "" -#: ../../library/stdtypes.rst:2301 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " @@ -3869,7 +3867,7 @@ msgid "" msgstr "" "Unicode 文字データベース (:mod:`unicodedata` を参照) で一般カテゴリが ``Zs`` " "(\"Seperator, space\") であるか、 双方向クラスが ``WS``、``B``、 ``S`` のい" -"ずれかである場合、その文字は *空白文字(whitespace)* です。 " +"ずれかである場合、その文字は *空白文字(whitespace)* です。" #: ../../library/stdtypes.rst:2306 msgid "See also :meth:`isprintable`." @@ -8501,7 +8499,6 @@ msgstr "" "ビューの参照先の辞書をラップする :class:`types.MappingProxyType` オブジェク" "ト を返します。" -#: ../../library/stdtypes.rst:5691 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -8523,7 +8520,7 @@ msgstr "" "れた全ての演算が利用可能です (たとえば ``==``, ``<`` や ``^`` など)。 集合演" "算に対しては、集合はオペランドとして集合しか取ることができないのに対して、こ" "れら集合の特性を持つビューはオペランドとして任意のイテラブルを取ることができ" -"ます。 " +"ます。" #: ../../library/stdtypes.rst:5703 msgid "An example of dictionary view usage::" @@ -9046,15 +9043,14 @@ msgid "" "TypeError: dict[str] is not a generic class" msgstr "" -#: ../../library/stdtypes.rst:6002 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" "一方で、同様の式は :ref:`型変数 ` が使われた場合は有効です。添字の" -"数は``GenericAlias`` オブジェクトの :attr:`~genericalias.__args__` 属性におけ" -"る型変数の数と同じでなければなりません::" +"数は ``GenericAlias`` オブジェクトの :attr:`~genericalias.__args__` 属性にお" +"ける型変数の数と同じでなければなりません::" #: ../../library/stdtypes.rst:6006 msgid "" @@ -9502,13 +9498,12 @@ msgstr "Optional型は ``None`` とのUnion型で記述できます::" msgid "str | None == typing.Optional[str]" msgstr "" -#: ../../library/stdtypes.rst:6204 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" ":func:`isinstance` と :func:`issubclass` の呼び出しはどちらもUnionオブジェク" -"トをサポートしています。 " +"トをサポートしています。" #: ../../library/stdtypes.rst:6207 msgid "" @@ -10110,13 +10105,12 @@ msgstr "``str(integer)``" msgid "``repr(integer)``." msgstr "``repr(integer)``" -#: ../../library/stdtypes.rst:6604 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" "他の10進数での文字列変換。たとえば ``f\"{integer}\"``、``\"{}\"." -"format(integer)`` や ``b\"%d\" % integer``。 " +"format(integer)`` や ``b\"%d\" % integer``。" #: ../../library/stdtypes.rst:6607 msgid "The limitations do not apply to functions with a linear algorithm:" diff --git a/library/subprocess.po b/library/subprocess.po index 5c87c9b18..f41cfa353 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -339,7 +339,6 @@ msgstr "子プロセスの生成に使用されるコマンド本文。" msgid "Timeout in seconds." msgstr "タイムアウト秒数。" -#: ../../library/subprocess.rst:208 msgid "" "Output of the child process if it was captured by :func:`run` or :func:" "`check_output`. Otherwise, ``None``. This is always :class:`bytes` when " @@ -349,7 +348,7 @@ msgstr "" ":func:`run` にまたは :func:`check_output` によって捕捉された場合は、子プロセ" "スの出力となり、それ以外の場合は ``None`` となります。``text=True`` の設定に" "関係なく、出力が捕捉された場合は常に :class:`bytes` となります。出力がない場" -"合は ``b''`` の代わりに``None`` のままになることがあります。" +"合は ``b''`` の代わりに ``None`` のままになることがあります。" #: ../../library/subprocess.rst:216 ../../library/subprocess.rst:253 msgid "Alias for output, for symmetry with :attr:`stderr`." diff --git a/library/sys.po b/library/sys.po index daefb85a5..c16fa84e6 100644 --- a/library/sys.po +++ b/library/sys.po @@ -368,13 +368,12 @@ msgstr "" "については、そのフレームを調べるコードを呼んだ時にはそのスレッドの現在の実行" "状況とは関係ないところを指し示しているかもしれません。" -#: ../../library/sys.rst:269 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``sys._current_frames`` を送出しま" -"す。 " +"す。" #: ../../library/sys.rst:273 msgid "" @@ -388,13 +387,12 @@ msgstr "" msgid "This is most useful for statistical profiling." msgstr "" -#: ../../library/sys.rst:282 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``sys._current_exceptions`` を送出" -"します。 " +"します。" #: ../../library/sys.rst:284 msgid "" @@ -1427,13 +1425,12 @@ msgstr "" "す。 *depth* のデフォルト値は 0 で、この場合はコールスタックのトップのフレー" "ムを返します。" -#: ../../library/sys.rst:1006 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." msgstr "" "引数 ``frame`` で :ref:`監査イベント ` ``sys._getframe`` を送出しま" -"す。 " +"す。" #: ../../library/sys.rst:1010 ../../library/sys.rst:1026 msgid "" @@ -2658,12 +2655,11 @@ msgstr "``'c_exception'``" msgid "A C function has raised an exception. *arg* is the C function object." msgstr "C 関数が例外を発生させた。 *arg* は C の関数オブジェクト。" -#: ../../library/sys.rst:1880 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "" -"引数無しで :ref:`監査イベント ` ``sys.setprofile`` を送出します。 " +"引数無しで :ref:`監査イベント ` ``sys.setprofile`` を送出します。" #: ../../library/sys.rst:1885 msgid "" @@ -2850,12 +2846,11 @@ msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" "code と frame オブジェクトについては、 :ref:`types` を参照してください。" -#: ../../library/sys.rst:1998 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -"引数無しで :ref:`監査イベント ` ``sys.settrace`` を送出します。 " +"引数無しで :ref:`監査イベント ` ``sys.settrace`` を送出します。" #: ../../library/sys.rst:2002 msgid "" @@ -2883,21 +2878,19 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:2020 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``sys." -"set_asyncgen_hooks_firstiter`` を送出します。 " +"set_asyncgen_hooks_firstiter`` を送出します。" -#: ../../library/sys.rst:2022 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``sys." -"set_asyncgen_hooks_finalizer`` を送出します。 " +"set_asyncgen_hooks_finalizer`` を送出します。" #: ../../library/sys.rst:2024 msgid "" diff --git a/library/syslog.po b/library/syslog.po index ee4a896c8..1305da0e5 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -78,13 +78,12 @@ msgstr "" ":func:`syslog` が呼び出される前に :func:`openlog` が呼び出されなかった場" "合、 :func:`openlog` が引数なしで呼び出されます。" -#: ../../library/syslog.rst:35 msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." msgstr "" "引数 ``priority``, ``message`` を指定して :ref:`監査イベント ` " -"``syslog.syslog`` を送出します。 " +"``syslog.syslog`` を送出します。" #: ../../library/syslog.rst:37 msgid "" @@ -128,13 +127,12 @@ msgstr "" "ワード引数 (デフォルトは :const:`LOG_USER`) は明示的に facility が encode さ" "れていないメッセージに設定される facility です。" -#: ../../library/syslog.rst:63 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." msgstr "" -"引数 ``ident``, `logoptiona``, ``facility`` を指定して :ref:`監査イベント " -"` ``syslog.openlog`` を送出します。 " +"引数 ``ident``, ``logoption``, ``facility`` を指定して :ref:`監査イベント " +"` ``syslog.openlog`` を送出します。" #: ../../library/syslog.rst:65 msgid "" @@ -169,12 +167,11 @@ msgstr "" "したときに、 :func:`openlog` が呼び出され、 *ident* やその他の :func:" "`openlog` の引数はデフォルト値にリセットされます。" -#: ../../library/syslog.rst:86 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." msgstr "" -"引数無しで :ref:`監査イベント ` ``syslog.closelog`` を送出します。 " +"引数無しで :ref:`監査イベント ` ``syslog.closelog`` を送出します。" #: ../../library/syslog.rst:98 msgid "" diff --git a/library/tempfile.po b/library/tempfile.po index e3f7d7a26..c1d440b9d 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -155,14 +155,12 @@ msgstr "" "プラットフォームが Posix でも Cygwin でもない場合は、TemporaryFile は " "NamedTemporaryFile の別名です。" -#: ../../library/tempfile.rst:66 ../../library/tempfile.rst:135 -#: ../../library/tempfile.rst:273 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with " "argument ``fullpath``." msgstr "" "引数 ``fullpath`` を指定して :ref:`監査イベント ` ``tempfile." -"mkstemp`` を送出します。 " +"mkstemp`` を送出します。" #: ../../library/tempfile.rst:70 msgid "The :py:const:`os.O_TMPFILE` flag is now used if available." @@ -388,13 +386,12 @@ msgid "" "tree to be removed." msgstr "" -#: ../../library/tempfile.rst:217 ../../library/tempfile.rst:299 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." msgstr "" "引数 ``fullpath`` を指定して :ref:`監査イベント ` ``tempfile." -"mkdtemp`` を送出します。 " +"mkdtemp`` を送出します。" #: ../../library/tempfile.rst:221 msgid "Added *ignore_cleanup_errors* parameter." diff --git a/library/threading.po b/library/threading.po index 2f6b3783f..0b0267a83 100644 --- a/library/threading.po +++ b/library/threading.po @@ -195,9 +195,8 @@ msgstr "" "生存中の :class:`Thread` オブジェクトの数を返します。この数は :func:`." "enumerate` の返すリストの長さと同じです。" -#: ../../library/threading.rst:122 msgid "The function ``activeCount`` is a deprecated alias for this function." -msgstr "関数``activeCount``はこの関数の非推奨エイリアスです。" +msgstr "関数 ``activeCount`` はこの関数の非推奨エイリアスです。" #: ../../library/threading.rst:127 msgid "" @@ -207,9 +206,8 @@ msgid "" "functionality is returned." msgstr "" -#: ../../library/threading.rst:132 msgid "The function ``currentThread`` is a deprecated alias for this function." -msgstr "関数``currentThread``はこの関数の非推奨エイリアスです。" +msgstr "関数 ``currentThread`` はこの関数の非推奨エイリアスです。" #: ../../library/threading.rst:137 msgid "Handle uncaught exception raised by :func:`Thread.run`." @@ -805,7 +803,6 @@ msgstr "" "*target* は :meth:`run` メソッドによって起動される呼び出し可能オブジェクトで" "す。デフォルトでは何も呼び出さないことを示す ``None`` になっています。" -#: ../../library/threading.rst:524 msgid "" "*name* is the thread name. By default, a unique name is constructed of the " "form \"Thread-*N*\" where *N* is a small decimal number, or \"Thread-*N* " @@ -813,8 +810,8 @@ msgid "" "is specified." msgstr "" "*name*はスレッド名です。デフォルトでは、\"Thread-*N*\"(*N*は小さな10進数)、ま" -"たは*target*引数が指定された場合\"Thread-*N* (target)\"(\"target\"は``target." -"__name__``)という形式でユニークな名前が構成される。" +"たは*target*引数が指定された場合\"Thread-*N* (target)\"(\"target\"は " +"``target.__name__``)という形式でユニークな名前が構成される。" #: ../../library/threading.rst:529 msgid "" @@ -1780,9 +1777,8 @@ msgstr "" "す。呼び出し側のスレッドがロックを獲得していない場合、 :exc:`RuntimeError` が" "送出されます。" -#: ../../library/threading.rst:1100 msgid "The method ``notifyAll`` is a deprecated alias for this method." -msgstr "関数``notifyAll``はこの関数の非推奨エイリアスです。" +msgstr "関数 ``notifyAll`` はこの関数の非推奨エイリアスです。" #: ../../library/threading.rst:1106 msgid "Semaphore objects" diff --git a/library/token.po b/library/token.po index f3a3f3501..914e31d20 100644 --- a/library/token.po +++ b/library/token.po @@ -30,7 +30,6 @@ msgstr ":mod:`!token` --- Python 解析木で使われる定数" msgid "**Source code:** :source:`Lib/token.py`" msgstr "**ソースコード:** :source:`Lib/token.py`" -#: ../../library/token.rst:11 msgid "" "This module provides constants which represent the numeric values of leaf " "nodes of the parse tree (terminal tokens). Refer to the file :file:`Grammar/" @@ -40,8 +39,8 @@ msgid "" msgstr "" "このモジュールは解析木の葉ノード(終端記号)の数値を表す定数を提供します。言語" "の文法のコンテキストにおける名前の定義については、 Python ディストリビュー" -"ションのファイル file:`Grammar/Tokens` を参照してください。名前がマップする特" -"定の数値は Python のバージョン間で変わります。" +"ションのファイル :file:`Grammar/Tokens` を参照してください。名前がマップする" +"特定の数値は Python のバージョン間で変わります。" #: ../../library/token.rst:17 msgid "" diff --git a/library/turtle.po b/library/turtle.po index be40c18a1..7f770cbba 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -3426,13 +3426,12 @@ msgstr "" msgid "The :mod:`!turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2670 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" "ソースコードを眺めつつスクリプトを実行できるデモビュワー :file:`__main__." -"py` 。 " +"py` 。" #: ../../library/turtle.rst:2672 msgid "" diff --git a/library/types.po b/library/types.po index 4b2a6694a..772a23d20 100644 --- a/library/types.po +++ b/library/types.po @@ -253,13 +253,12 @@ msgid "" msgstr "" "ユーザ定義の関数と :keyword:`lambda` 式によって生成された関数の型です。" -#: ../../library/types.rst:159 msgid "" "Raises an :ref:`auditing event ` ``function.__new__`` with " "argument ``code``." msgstr "" "引数 ``code`` を指定して :ref:`監査イベント ` ``function.__new__`` " -"を送出します。 " +"を送出します。" #: ../../library/types.rst:161 msgid "" @@ -299,7 +298,6 @@ msgid "" "`compile`." msgstr "" -#: ../../library/types.rst:193 msgid "" "Raises an :ref:`auditing event ` ``code.__new__`` with arguments " "``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " @@ -307,7 +305,7 @@ msgid "" msgstr "" "引数 ``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " "``kwonlyargcount``, ``nlocals``, ``stacksize``, ``flags`` を指定して :ref:`監" -"査イベント ` ``code.__new__`` を送出します。 " +"査イベント ` ``code.__new__`` を送出します。" #: ../../library/types.rst:195 msgid "" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index 88fc042ee..3d008185e 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -889,7 +889,6 @@ msgstr "" "するには、``foo.iter()`` の呼び出しで返されるオブジェクトを設定する必要があ" "る。" -#: ../../library/unittest.mock-examples.rst:674 msgid "" "There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned " @@ -897,7 +896,7 @@ msgid "" "they are is: `Generator Tricks for Systems Programmers `_." msgstr "" -"ジェネレータ式やジェネレータのより`高度な使い方 `_ もありますが、ここではそれらについては触れません。" "ジェネレータとその強力さについての非常に良い紹介記事があります: `Generator " "Tricks for Systems Programmers `_。" @@ -942,15 +941,14 @@ msgid "" "'something'" msgstr "" -#: ../../library/unittest.mock-examples.rst:708 msgid "" "An alternative way of managing patches is to use the :ref:`start-and-stop`. " "These allow you to move the patching into your ``setUp`` and ``tearDown`` " "methods. ::" msgstr "" "パッチを管理する別の方法として、:ref:`start-and-stop`.を使用する方法がありま" -"す。これらを使うと、パッチを ``setUp`` と``tearDown``メソッドに移すことができ" -"ます。" +"す。これらを使うと、パッチを ``setUp`` と ``tearDown`` メソッドに移すことがで" +"きます。" #: ../../library/unittest.mock-examples.rst:712 msgid "" @@ -1063,7 +1061,6 @@ msgstr "" "呼び出しに対してアサートしたい場合には :attr:`~Mock.call_args_list` を使用す" "ることができます:" -#: ../../library/unittest.mock-examples.rst:814 msgid "" "The :data:`call` helper makes it easy to make assertions about these calls. " "You can build up a list of expected calls and compare it to " @@ -1071,14 +1068,13 @@ msgid "" "``call_args_list``:" msgstr "" ":data:`call` ヘルパーを使えば、これらの呼び出しについて簡単にアサートすること" -"ができます。予想される呼び出しのリストを作成し、それを``call_args_list``と比" -"較することができます。これは``call_args_list``のreprと驚くほど似ています:" +"ができます。予想される呼び出しのリストを作成し、それを ``call_args_list`` と" +"比較することができます。これは ``call_args_list`` のreprと驚くほど似ています:" #: ../../library/unittest.mock-examples.rst:824 msgid "Coping with mutable arguments" msgstr "ミュータブルな引数に対処する" -#: ../../library/unittest.mock-examples.rst:826 msgid "" "Another situation is rare, but can bite you, is when your mock is called " "with mutable arguments. ``call_args`` and ``call_args_list`` store " @@ -1087,9 +1083,9 @@ msgid "" "when the mock was called." msgstr "" "稀ではありますが、問題となることがあるのはミュータブルな引数でモックが呼び出" -"された場合です。``call_args`` や``call_args_list`` は引数への*参照*を保存しま" -"す。もしテスト対象のコードによって引数が変更されてしまうと、モックが呼び出さ" -"れた時の値をアサートすることはできなくなります。" +"された場合です。``call_args`` や ``call_args_list`` は引数への*参照*を保存し" +"ます。もしテスト対象のコードによって引数が変更されてしまうと、モックが呼び出" +"された時の値をアサートすることはできなくなります。" #: ../../library/unittest.mock-examples.rst:831 msgid "" @@ -1108,13 +1104,12 @@ msgid "" " val.clear()" msgstr "" -#: ../../library/unittest.mock-examples.rst:842 msgid "" "When we try to test that ``grob`` calls ``frob`` with the correct argument " "look what happens::" msgstr "" -"``grob`` が``frob``を正しい引数で呼び出していることをテストしようとすると何が" -"起こるか見てみましょう::" +"``grob`` が ``frob`` を正しい引数で呼び出していることをテストしようとすると何" +"が起こるか見てみましょう::" #: ../../library/unittest.mock-examples.rst:845 msgid "" @@ -1186,15 +1181,14 @@ msgstr "" "関数はアサーションで使用するための新しいモックを返します。``side_effect`` 関" "数は引数のコピーを作成し、そのコピーを使って ``new_mock`` を呼び出します。" -#: ../../library/unittest.mock-examples.rst:896 msgid "" "If your mock is only going to be used once there is an easier way of " "checking arguments at the point they are called. You can simply do the " "checking inside a ``side_effect`` function." msgstr "" "もしモックが一度しか使われないのであれば、呼び出された時点で引数をチェックす" -"る簡単な方法があります。単純に``side_effect``関数の中でチェックを行えばいいの" -"です。" +"る簡単な方法があります。単純に ``side_effect`` 関数の中でチェックを行えばいい" +"のです。" #: ../../library/unittest.mock-examples.rst:910 msgid "" diff --git a/library/unittest.po b/library/unittest.po index 8dc637c63..7ba87fe20 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -320,13 +320,12 @@ msgid "" "the documentation explores the full feature set from first principles." msgstr "" -#: ../../library/unittest.rst:149 msgid "" "The behavior of returning a value from a test method (other than the default " "``None`` value), is now deprecated." msgstr "" -"テストメソッドが(デフォルトの``None``以外の)戻り値を返す挙動は現在非推奨で" -"す。" +"テストメソッドが(デフォルトの ``None`` 以外の)戻り値を返す挙動は現在非推奨" +"です。" #: ../../library/unittest.rst:157 msgid "Command-Line Interface" @@ -1299,14 +1298,13 @@ msgstr "" "なりました。これにより対話的インタプリタから :class:`TestCase` を簡単に試せる" "ようになりました。" -#: ../../library/unittest.rst:734 msgid "" ":class:`TestCase` instances provide three groups of methods: one group used " "to run the test, another used by the test implementation to check conditions " "and report failures, and some inquiry methods allowing information about the " "test itself to be gathered." msgstr "" -":class:`TestCase` のインスタンスのメソッドは3種類のグループを提供します。 \n" +":class:`TestCase` のインスタンスのメソッドは3種類のグループを提供します。\n" "1つ目のグループはテストの実行で使用されます。\n" "2つ目のグループは条件のチェックおよび失敗のレポートを行うテストの実装で使用さ" "れます。\n" @@ -4294,13 +4292,12 @@ msgstr "" "``tearDownModule`` も実行されません。例外が :exc:`SkipTest` 例外であれば、そ" "のモジュールはエラーではなくスキップされたものとして報告されます。" -#: ../../library/unittest.rst:2570 msgid "" "To add cleanup code that must be run even in the case of an exception, use " "``addModuleCleanup``:" msgstr "" "例外が発生した場合でも実行しなければならないクリーンアップコードを追加するに" -"は``addModuleCleanup``を使用します:" +"は ``addModuleCleanup`` を使用します:" #: ../../library/unittest.rst:2576 msgid "" diff --git a/library/uuid.po b/library/uuid.po index 76e9171be..e7518efd4 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -120,13 +120,12 @@ msgstr "" "2つのUUIDオブジェクトの比較は、:attr:`UUID.int` 属性の比較によって行われま" "す。UUIDではないオブジェクトとの比較は、 :exc:`TypeError` を送出します。" -#: ../../library/uuid.rst:76 msgid "" "``str(uuid)`` returns a string in the form " "``12345678-1234-5678-1234-567812345678`` where the 32 hexadecimal digits " "represent the UUID." msgstr "" -"``str(uuid)`` は 32桁の16進でUUIDを表す" +"``str(uuid)`` は 32桁の16進でUUIDを表す " "``12345678-1234-5678-1234-567812345678`` 形式の文字列を返します。" #: ../../library/uuid.rst:80 diff --git a/library/winreg.po b/library/winreg.po index a28875678..e9903e6fd 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -108,13 +108,12 @@ msgstr "" "戻り値は開かれたキーのハンドルです。関数が失敗した場合、 :exc:`OSError` 例外" "が送出されます。" -#: ../../library/winreg.rst:57 msgid "" "Raises an :ref:`auditing event ` ``winreg.ConnectRegistry`` with " "arguments ``computer_name``, ``key``." msgstr "" "引数 ``computer_name``, ``key`` を指定して :ref:`監査イベント ` " -"``winreg.ConnectRegistry`` を送出します。 " +"``winreg.ConnectRegistry`` を送出します。" #: ../../library/winreg.rst:59 ../../library/winreg.rst:85 #: ../../library/winreg.rst:119 ../../library/winreg.rst:140 @@ -164,22 +163,19 @@ msgstr "" msgid "If the key already exists, this function opens the existing key." msgstr "キーがすでに存在する場合、この関数はその既存のキーを開きます。" -#: ../../library/winreg.rst:81 ../../library/winreg.rst:113 msgid "" "Raises an :ref:`auditing event ` ``winreg.CreateKey`` with " "arguments ``key``, ``sub_key``, ``access``." msgstr "" "引数 ``key``, ``sub_key``, ``access`` を指定して :ref:`監査イベント " -"` ``winreg.CreateKey`` を送出します。 " +"` ``winreg.CreateKey`` を送出します。" -#: ../../library/winreg.rst:83 ../../library/winreg.rst:115 -#: ../../library/winreg.rst:343 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey/result`` with " "argument ``key``." msgstr "" "引数 ``key`` を指定して :ref:`監査イベント ` ``winreg.OpenKey/" -"result`` を送出します。 " +"result`` を送出します。" #: ../../library/winreg.rst:99 ../../library/winreg.rst:155 msgid "" @@ -288,13 +284,12 @@ msgstr "レジストリキーから指定された名前つきの値を削除し msgid "*value* is a string that identifies the value to remove." msgstr "*value* は削除したい値を指定するための文字列です。" -#: ../../library/winreg.rst:204 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteValue`` with " "arguments ``key``, ``value``." msgstr "" "引数 ``key``, ``value`` を指定して :ref:`監査イベント ` ``winreg." -"DeleteValue`` を送出します。 " +"DeleteValue`` を送出します。" #: ../../library/winreg.rst:209 msgid "Enumerates subkeys of an open registry key, returning a string." @@ -314,13 +309,12 @@ msgstr "" "常、これ以上値がないことを示す :exc:`OSError` 例外が送出されるまで繰り返し呼" "び出されます。" -#: ../../library/winreg.rst:220 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumKey`` with arguments " "``key``, ``index``." msgstr "" "引数 ``key``, ``index`` を指定して :ref:`監査イベント ` ``winreg." -"EnumKey`` を送出します。 " +"EnumKey`` を送出します。" #: ../../library/winreg.rst:228 msgid "Enumerates values of an open registry key, returning a tuple." @@ -389,13 +383,12 @@ msgstr "" "値のデータ型を指定する整数です (:meth:`SetValueEx` のドキュメント内のテーブル" "を参照してください)" -#: ../../library/winreg.rst:255 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumValue`` with " "arguments ``key``, ``index``." msgstr "" "引数 ``key``, ``index`` を指定して :ref:`監査イベント ` ``winreg." -"EnumValue`` を送出します。 " +"EnumValue`` を送出します。" #: ../../library/winreg.rst:266 msgid "" @@ -411,13 +404,12 @@ msgid "" "'C:\\\\Windows'" msgstr "" -#: ../../library/winreg.rst:272 msgid "" "Raises an :ref:`auditing event ` ``winreg." "ExpandEnvironmentStrings`` with argument ``str``." msgstr "" "引数 ``str`` を指定して :ref:`監査イベント ` ``winreg." -"ExpandEnvironmentStrings`` を送出します。 " +"ExpandEnvironmentStrings`` を送出します。" #: ../../library/winreg.rst:277 msgid "Writes all the attributes of a key to the registry." @@ -496,13 +488,12 @@ msgstr "" "*file_name* に指定されたパスはリモートコンピュータに対する相対パス名になりま" "す。" -#: ../../library/winreg.rst:318 msgid "" "Raises an :ref:`auditing event ` ``winreg.LoadKey`` with arguments " "``key``, ``sub_key``, ``file_name``." msgstr "" "引数 ``key``, ``sub_key``, ``file_name`` を指定して :ref:`監査イベント " -"` ``winreg.LoadKey`` を送出します。 " +"` ``winreg.LoadKey`` を送出します。" #: ../../library/winreg.rst:324 msgid "" @@ -540,13 +531,12 @@ msgstr "指定されたキーへの新しいハンドルが返されます。" msgid "If the function fails, :exc:`OSError` is raised." msgstr "この関数が失敗すると、 :exc:`OSError` が送出されます。" -#: ../../library/winreg.rst:341 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey`` with arguments " "``key``, ``sub_key``, ``access``." msgstr "" "引数 ``key``, ``sub_key``, ``access`` を指定して :ref:`監査イベント " -"` ``winreg.OpenKey`` を送出します。 " +"` ``winreg.OpenKey`` を送出します。" #: ../../library/winreg.rst:345 msgid "Allow the use of named arguments." @@ -572,13 +562,12 @@ msgstr "" "最後のキーの変更が (あれば) いつだったかを表す整数で、1601 年 1 月 1 日から" "の 100 ナノ秒単位で数えたもの。" -#: ../../library/winreg.rst:375 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryInfoKey`` with " "argument ``key``." msgstr "" "引数 ``key`` を指定して :ref:`監査イベント ` ``winreg." -"QueryInfoKey`` を送出します。 " +"QueryInfoKey`` を送出します。" #: ../../library/winreg.rst:380 msgid "Retrieves the unnamed value for a key, as a string." @@ -607,13 +596,12 @@ msgstr "" "API 呼び出しは型情報を返しません。なので、可能ならいつでも :func:" "`QueryValueEx` を使うべきです。" -#: ../../library/winreg.rst:394 ../../library/winreg.rst:419 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryValue`` with " "arguments ``key``, ``sub_key``, ``value_name``." msgstr "" "引数 ``key``, ``sub_key``, ``value_name`` を指定して :ref:`監査イベント " -"` ``winreg.QueryValue`` を送出します。 " +"` ``winreg.QueryValue`` を送出します。" #: ../../library/winreg.rst:399 msgid "" @@ -672,13 +660,12 @@ msgstr "" msgid "This function passes ``NULL`` for *security_attributes* to the API." msgstr "この関数は *security_attributes* を ``NULL`` にして API に渡します。" -#: ../../library/winreg.rst:444 msgid "" "Raises an :ref:`auditing event ` ``winreg.SaveKey`` with arguments " "``key``, ``file_name``." msgstr "" "引数 ``key``, ``file_name`` を指定して :ref:`監査イベント ` " -"``winreg.SaveKey`` を送出します。 " +"``winreg.SaveKey`` を送出します。" #: ../../library/winreg.rst:449 msgid "Associates a value with a specified key." @@ -729,13 +716,12 @@ msgstr "" "*key* 引数に指定されたキーは :const:`KEY_SET_VALUE` アクセスで開かれていなけ" "ればなりません。" -#: ../../library/winreg.rst:472 ../../library/winreg.rst:502 msgid "" "Raises an :ref:`auditing event ` ``winreg.SetValue`` with " "arguments ``key``, ``sub_key``, ``type``, ``value``." msgstr "" "引数 ``key``, ``sub_key``, ``type``, ``value`` を指定して :ref:`監査イベント " -"` ``winreg.SetValue`` を送出します。 " +"` ``winreg.SetValue`` を送出します。" #: ../../library/winreg.rst:477 msgid "Stores data in the value field of an open registry key." @@ -800,13 +786,12 @@ msgstr "" "ん。あるキーのリフレクションを無効にしても、そのキーのサブキーのリフレクショ" "ンには全く影響しません。" -#: ../../library/winreg.rst:520 msgid "" "Raises an :ref:`auditing event ` ``winreg.DisableReflectionKey`` " "with argument ``key``." msgstr "" "引数 ``key`` を指定して :ref:`監査イベント ` ``winreg." -"DisableReflectionKey`` を送出します。 " +"DisableReflectionKey`` を送出します。" #: ../../library/winreg.rst:525 msgid "Restores registry reflection for the specified disabled key." @@ -820,13 +805,12 @@ msgid "" msgstr "" "あるキーのリフレクションを再開しても、その全てのサブキーには影響しません。" -#: ../../library/winreg.rst:535 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnableReflectionKey`` " "with argument ``key``." msgstr "" "引数 ``key`` を指定して :ref:`監査イベント ` ``winreg." -"EnableReflectionKey`` を送出します。 " +"EnableReflectionKey`` を送出します。" #: ../../library/winreg.rst:540 msgid "Determines the reflection state for the specified key." @@ -836,13 +820,12 @@ msgstr "指定されたキーのリフレクション状態を確認します。 msgid "Returns ``True`` if reflection is disabled." msgstr "リフレクションが無効になっている場合、``True`` を返します。" -#: ../../library/winreg.rst:550 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryReflectionKey`` " "with argument ``key``." msgstr "" "引数 ``key`` を指定して :ref:`監査イベント ` ``winreg." -"QueryReflectionKey`` を送出します。 " +"QueryReflectionKey`` を送出します。" #: ../../library/winreg.rst:556 msgid "Constants" diff --git a/library/xml.dom.minidom.po b/library/xml.dom.minidom.po index f77e2eeb7..4dadc6c2b 100644 --- a/library/xml.dom.minidom.po +++ b/library/xml.dom.minidom.po @@ -268,13 +268,12 @@ msgstr "" "され、それ以外の場合 ``\"no\"`` が設定されます。引数を指定しない場合は文書か" "ら宣言が省略されます。" -#: ../../library/xml.dom.minidom.rst:150 msgid "" "The :meth:`writexml` method now preserves the attribute order specified by " "the user." msgstr "" ":meth:`writexml` メソッドはユーザーが指定した属性の順序を保持するようになりま" -"した。 " +"した。" #: ../../library/xml.dom.minidom.rst:154 ../../library/xml.dom.minidom.rst:175 #: ../../library/xml.dom.minidom.rst:194 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index f492fd9f3..504c8d705 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -1899,13 +1899,12 @@ msgstr "" "` の場合、型が衝突する場合があります。文字列をバイト列ファイルへ" "書き込んだり、その逆を行わないよう注意してください。" -#: ../../library/xml.etree.elementtree.rst:1256 msgid "" "The :meth:`write` method now preserves the attribute order specified by the " "user." msgstr "" ":meth:`write` メソッドはユーザーが指定した属性の順序を保持するようになりまし" -"た。 " +"た。" #: ../../library/xml.etree.elementtree.rst:1261 msgid "This is the XML file that is going to be manipulated::" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index d4936945b..755eb13f1 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -69,7 +69,6 @@ msgstr "" "このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" "`wasm-availability` を見てください。" -#: ../../library/xmlrpc.client.rst:38 msgid "" "A :class:`ServerProxy` instance is an object that manages communication with " "a remote XML-RPC server. The required first argument is a URI (Uniform " @@ -87,7 +86,7 @@ msgstr "" "ジュール内部の :class:`SafeTransport` インスタンスを使用し、それ以外の場合に" "はモジュール内部の :class:`Transport` インスタンスを使用します。オプションの " "3 番目の引数はエンコード方法で、デフォルトでは UTF-8 です。オプションの 4 番" -"目の引数はデバッグフラグです。 " +"目の引数はデバッグフラグです。" #: ../../library/xmlrpc.client.rst:46 msgid "" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index 8cbac6b8c..b74a514d9 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -57,7 +57,6 @@ msgstr "" "このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" "`wasm-availability` を見てください。" -#: ../../library/xmlrpc.server.rst:29 msgid "" "Create a new server instance. This class provides methods for registration " "of functions that can be called by the XML-RPC protocol. The " @@ -91,7 +90,7 @@ msgstr "" "*bind_and_activate* 引数はコンストラクタが直ちに :meth:`server_bind` と :" "meth:`server_activate` を呼ぶかどうかを制御します。デフォルトでは真です。\n" "この引数に ``False`` を設定することで、アドレスを束縛する前に " -"*allow_reuse_address* クラス変数を操作することが出来ます。 \n" +"*allow_reuse_address* クラス変数を操作することが出来ます。\n" "*use_builtin_types* 引数は :func:`~xmlrpc.client.loads` 関数に渡されます。\n" "この引数は日付/時刻の値やバイナリデータを受け取ったときにどの型が処理されるか" "を制御します。デフォルトでは偽です。" diff --git a/library/zipapp.po b/library/zipapp.po index 451fb0804..d666ca282 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -234,13 +234,12 @@ msgstr "" "ファイル名、または :term:`path-like object` オブジェクトを指定した場合、アー" "カイブは指定したファイルへ書き込まれます。" -#: ../../library/zipapp.rst:131 msgid "" "If it is an open file object, the archive will be written to that file " "object, which must be open for writing in bytes mode." msgstr "" "開いているファイルオブジェクトを指定した場合、\n" -"アーカイブはそのファイルオブジェクトへ書込みを行ないます。 \n" +"アーカイブはそのファイルオブジェクトへ書込みを行ないます。\n" "ファイルオブジェクトは必ずバイトモードの書込みで開いてください。" #: ../../library/zipapp.rst:133 diff --git a/reference/datamodel.po b/reference/datamodel.po index 100978d42..7ab02fd24 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -1062,7 +1062,6 @@ msgstr "" msgid "Coroutine functions" msgstr "コルーチン関数 (coroutine function)" -#: ../../reference/datamodel.rst:818 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -1071,7 +1070,7 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" ":keyword:`async def` を使用して定義された関数やメソッドを :dfn:`コルーチン関" -"数 (coroutine function)` と呼びます。 \n" +"数 (coroutine function)` と呼びます。\n" "呼び出された時、そのような関数は :term:`coroutine` オブジェクトを返します。\n" "コルーチン関数は :keyword:`async with` や :keyword:`async for` 文だけでなく :" "keyword:`await` 式を持つことが出来ます。\n" diff --git a/reference/expressions.po b/reference/expressions.po index d0ea72759..443ac1938 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -1367,7 +1367,6 @@ msgid "" " yield 123" msgstr "" -#: ../../reference/expressions.rst:1097 msgid "" "Due to their side effects on the containing scope, ``yield`` expressions are " "not permitted as part of the implicitly defined scopes used to implement " @@ -1375,7 +1374,7 @@ msgid "" msgstr "" "含まれているスコープの副作用のため、 ``yield`` 式は暗黙的に定義されたスコープ" "の一部として内包表記やジェネレータ式を実装するのに使うことは許可されていませ" -"ん。 " +"ん。" #: ../../reference/expressions.rst:1101 msgid "" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 4cda45c15..101dd5928 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -785,7 +785,6 @@ msgstr "" msgid "``__*__``" msgstr "``__*__``" -#: ../../reference/lexical_analysis.rst:512 msgid "" "System-defined names, informally known as \"dunder\" names. These names are " "defined by the interpreter and its implementation (including the standard " @@ -800,7 +799,7 @@ msgstr "" "`specialnames` などで話題に挙げられています。 Python の将来のバージョンではよ" "り多くの名前が定義されることになります。このドキュメントで明記されている用法" "に従わない、 *あらゆる* ``__*__`` の名前は、いかなるコンテキストにおける利用" -"でも、警告無く損害を引き起こすことがあります。 " +"でも、警告無く損害を引き起こすことがあります。" #: ../../reference/lexical_analysis.rst:519 msgid "``__*``" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 056df0474..af45f8e00 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -943,7 +943,6 @@ msgstr "" msgid "Here is a brief demonstration::" msgstr "簡単なデモンストレーションを示します::" -#: ../../tutorial/datastructures.rst:502 msgid "" ">>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}\n" ">>> print(basket) # show that duplicates have been " @@ -989,8 +988,7 @@ msgstr "" "{'a', 'c', 'r', 'd', 'b', 'm', 'z', 'l'}\n" ">>> a & b # aとbの両方に存在する文字\n" "{'a', 'c'}\n" -">>> a ^ b # aまたはbにあるが、両方にはない文" -"字 \n" +">>> a ^ b # aまたはbにあるが、両方にはない文字\n" "{'r', 'd', 'b', 'm', 'z', 'l'}" #: ../../tutorial/datastructures.rst:525 diff --git a/using/cmdline.po b/using/cmdline.po index 9e40d5fd5..5b8e014b4 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -153,13 +153,12 @@ msgstr "" "ディレクトリにあるモジュールをトップレベルモジュールとして import 出来るよう" "になります)。" -#: ../../using/cmdline.rst:74 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_command`` with " "argument ``command``." msgstr "" "引数 ``command`` を指定して :ref:`監査イベント ` ``cpython." -"run_command`` を送出します。 " +"run_command`` を送出します。" #: ../../using/cmdline.rst:76 msgid "*command* is automatically dedented before execution." @@ -240,13 +239,12 @@ msgid "" "python -m timeit -h # for details" msgstr "" -#: ../../using/cmdline.rst:119 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_module`` with " "argument ``module-name``." msgstr "" "引数 ``module-name`` を指定して :ref:`監査イベント ` ``cpython." -"run_module`` を送出します。 " +"run_module`` を送出します。" #: ../../using/cmdline.rst:122 msgid ":func:`runpy.run_module`" @@ -285,13 +283,12 @@ msgstr "" "このオプションが指定された場合、 :data:`sys.argv` の最初の要素は ``\"-\"`` " "で、カレントディレクトリが :data:`sys.path` の先頭に追加されます。" -#: ../../using/cmdline.rst:144 ../../using/cmdline.rst:888 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " "arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``cpython.run_stdin`` を送出しま" -"す。 " +"す。" #: ../../using/cmdline.rst:150 msgid "" @@ -340,13 +337,12 @@ msgid "" "packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" -#: ../../using/cmdline.rst:171 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_file`` with " "argument ``filename``." msgstr "" "引数 ``filename`` を指定して :ref:`監査イベント ` ``cpython." -"run_file`` を送出します。 " +"run_file`` を送出します。" #: ../../using/cmdline.rst:174 msgid ":func:`runpy.run_path`" diff --git a/using/ios.po b/using/ios.po index 6ad2ee587..684010de1 100644 --- a/using/ios.po +++ b/using/ios.po @@ -276,7 +276,6 @@ msgstr "" msgid "Compiler stub binaries" msgstr "コンパイラスタブバイナリ" -#: ../../using/ios.rst:120 msgid "" "Xcode doesn't expose explicit compilers for iOS; instead, it uses an " "``xcrun`` script that resolves to a full compiler path (e.g., ``xcrun --sdk " @@ -286,7 +285,7 @@ msgstr "" "Xcode は、 iOS 用の明示的なコンパイラを提供していません。代わりに、完全なコン" "パイラのパスを解決する ``xcrun`` スクリプトを使用します (たとえば ``xcrun --" "sdk iphoneos clang`` は iPhone デバイス用の ``clang`` を取得します) 。しか" -"し、これは2つの問題を引き起こします: " +"し、これは2つの問題を引き起こします:" #: ../../using/ios.rst:125 msgid "" diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index 710c8b96b..05ec1a3aa 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -295,9 +295,8 @@ msgstr "" "を生成する方法に影響しますので、生成されるバイトコードとなるステートメントの" "前になくてはならないのです。" -#: ../../whatsnew/2.1.rst:153 msgid ":pep:`236` - Back to the :mod:`__future__`" -msgstr ":pep:`236` - バック・トゥ・ザ・ :mod:`__future__` " +msgstr ":pep:`236` - バック・トゥ・ザ・ :mod:`__future__`" #: ../../whatsnew/2.1.rst:154 msgid "Written by Tim Peters, and primarily implemented by Jeremy Hylton." @@ -986,7 +985,6 @@ msgstr "" msgid "PEP 241: Metadata in Python Packages" msgstr "PEP 241: Pythonソフトウェアパッケージのためのメタデータ" -#: ../../whatsnew/2.1.rst:544 msgid "" "A common complaint from Python users is that there's no single catalog of " "all the Python modules in existence. T. Middleton's Vaults of Parnassus at " @@ -998,7 +996,7 @@ msgid "" msgstr "" "Python ユーザーからのよくある苦情としては、存在するすべての Python モジュール" "の一覧がないということです。T. Middleton's の ``www.vex.net/parnassus/`` に" -"あった Vaults of Parnassus (2009年2月に停止、Internet Archive Wayback " +"あった Vaults of Parnassus (2009年2月に停止、`Internet Archive Wayback " "Machine `_ で閲覧可) が最大のものでしたが、ソフトウェアの登録は任意だった" "ため、多くの人は登録しませんでした。" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index a12b93c93..d15d5cd06 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -1512,9 +1512,8 @@ msgstr "" msgid ":pep:`307` - Extensions to the pickle protocol" msgstr ":pep:`307` - pickle プロトコルの拡張" -#: ../../whatsnew/2.3.rst:850 msgid "Written and implemented by Guido van Rossum and Tim Peters." -msgstr "著、実装: Guido van Rossum と Tim Peters " +msgstr "著、実装: Guido van Rossum と Tim Peters" #: ../../whatsnew/2.3.rst:858 msgid "Extended Slices" diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 71674bc01..23cde0933 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -34,13 +34,12 @@ msgstr "著者" msgid "A.M. Kuchling" msgstr "A.M. Kuchling" -#: ../../whatsnew/2.4.rst:14 msgid "" "This article explains the new features in Python 2.4.1, released on March " "30, 2005." msgstr "" "この文書は 2005 年 3 月 30 日にリリースされた Python 2.4.1 の新機能について解" -"説します。 " +"説します。" #: ../../whatsnew/2.4.rst:17 msgid "" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 595238eab..deb067443 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -269,10 +269,9 @@ msgstr "https://svn.python.org/view/tracker/importer/" msgid "Martin von Löwis's conversion scripts." msgstr "Martin von Löwis の変換スクリプト。" -#: ../../whatsnew/2.6.rst:195 msgid "New Documentation Format: reStructuredText Using Sphinx" msgstr "" -"新しいドキュメンテーションフォーマット: Sphinx を使っての reStructuredText " +"新しいドキュメンテーションフォーマット: Sphinx を使っての reStructuredText" #: ../../whatsnew/2.6.rst:197 msgid "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index aa5c7ff56..566adb9d3 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -4719,9 +4719,8 @@ msgid "" "pre.in` for details." msgstr "" -#: ../../whatsnew/2.7.rst:2773 ../../whatsnew/2.7.rst:2786 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "(Victor Stinner の貢献による :issue:`23404`) " +msgstr "(Victor Stinner の貢献による :issue:`23404`)" #: ../../whatsnew/2.7.rst:2779 msgid "Removal of ``make touch`` build target" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 9b2c0c182..8d5880159 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -4351,9 +4351,8 @@ msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2648 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" -msgstr "(Victor Stinner の貢献による :issue:`45412`) " +msgstr "(Victor Stinner の貢献による :issue:`45412`)" #: ../../whatsnew/3.11.rst:2650 msgid "" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 06b140d78..a4857b48d 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -315,13 +315,12 @@ msgstr "" msgid "New typing features:" msgstr "新しい型ヒントの機能:" -#: ../../whatsnew/3.13.rst:162 msgid "" ":pep:`696`: Type parameters (:data:`typing.TypeVar`, :data:`typing." "ParamSpec`, and :data:`typing.TypeVarTuple`) now support defaults." msgstr "" ":pep:`696`: 型引数(:data:`typing.TypeVar`、:data:`typing.ParamSpec`、:data:" -"`typing.TypeVarTuple`)をデフォルトでサポートします。 " +"`typing.TypeVarTuple`)をデフォルトでサポートします。" #: ../../whatsnew/3.13.rst:164 msgid "" diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index 68f30ebb8..6a60a1d23 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -261,9 +261,8 @@ msgstr "" msgid "New features" msgstr "新しい機能" -#: ../../whatsnew/3.14.rst:149 msgid ":pep:`649` & :pep:`749`: Deferred evaluation of annotations" -msgstr ":pep:`649` と :pep:`749`: アノテーションの遅延評価 " +msgstr ":pep:`649` と :pep:`749`: アノテーションの遅延評価" #: ../../whatsnew/3.14.rst:151 msgid "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 50b2e9ad0..0b4e6b01a 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -1887,7 +1887,6 @@ msgid "" "Brett Cannon in :issue:`18194`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1008 msgid "" "The :mod:`importlib` bootstrap :class:`.NamespaceLoader` now conforms to " "the :class:`.InspectLoader` ABC, which means that ``runpy`` and ``python -" @@ -1898,7 +1897,7 @@ msgstr "" "InspectLoader` ABC に従うようになりました。つまりこれにより ``runpy`` と " "``python -m`` が名前空間パッケージに対して使えるようになりました。" "(Contributed by Brett Cannon in :issue:`18058`.) (訳注: 3.3 以降の名前空間" -"パッケージについては What's New In Python 3.3 (:pep:`420`) 参照。) " +"パッケージについては What's New In Python 3.3 (:pep:`420`) 参照。)" #: ../../whatsnew/3.4.rst:1013 msgid "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 303a66f58..edb323170 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -1039,7 +1039,6 @@ msgstr "" msgid "PEP 485: A function for testing approximate equality" msgstr "PEP 485: 近似的に等しいことを調べる関数" -#: ../../whatsnew/3.5.rst:611 msgid "" ":pep:`485` adds the :func:`math.isclose` and :func:`cmath.isclose` functions " "which tell whether two values are approximately equal or \"close\" to each " @@ -1050,7 +1049,7 @@ msgid "" msgstr "" ":pep:`485` により、2値が互いに近似的に等しいか \"近い\" ことを調べる関数 :" "func:`math.isclose` 及び :func:`cmath.isclose` が追加されました。\n" -"2値が近いと判断されるかどうかは与えられた絶対及び相対許容差で決まります。 \n" +"2値が近いと判断されるかどうかは与えられた絶対及び相対許容差で決まります。\n" "相対許容差は ``isclose`` 引数間で許される、絶対値の大きい方に対する最大の差で" "す::" @@ -4293,9 +4292,8 @@ msgid "" "pre.in` for details." msgstr "" -#: ../../whatsnew/3.5.rst:2559 ../../whatsnew/3.5.rst:2572 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "(Victor Stinner の貢献による :issue:`23404`) " +msgstr "(Victor Stinner の貢献による :issue:`23404`)" #: ../../whatsnew/3.5.rst:2565 msgid "Removal of ``make touch`` build target" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index b096e6c97..d8a763e7f 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -3551,9 +3551,8 @@ msgid "" "pre.in` for details." msgstr "" -#: ../../whatsnew/3.6.rst:2414 ../../whatsnew/3.6.rst:2427 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "(Victor Stinner の貢献による :issue:`23404`) " +msgstr "(Victor Stinner の貢献による :issue:`23404`)" #: ../../whatsnew/3.6.rst:2420 msgid "Removal of ``make touch`` build target" @@ -3615,7 +3614,6 @@ msgstr "" msgid "Notable changes in Python 3.6.10" msgstr "" -#: ../../whatsnew/3.6.rst:2463 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -3626,7 +3624,7 @@ msgid "" msgstr "" "セキュリティ上の重大な懸念により、:meth:`asyncio.loop." "create_datagram_endpoint` での *reuse_address* 引数は無効になりました。これは" -"ソケットオプション `SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" +"ソケットオプション ``SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" "``loop.create_datagram_endpoint()`` のドキュメントを参照してください。(Kyle " "Stanley, Antoine Pitrou, Yury Selivanov による貢献 :issue:`37228`)" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 67427ef80..840b885ee 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -3774,7 +3774,6 @@ msgstr "" msgid "Notable changes in Python 3.7.6" msgstr "Python 3.7.6 での重要な変更点" -#: ../../whatsnew/3.7.rst:2575 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -3785,7 +3784,7 @@ msgid "" msgstr "" "セキュリティ上の重大な懸念により、:meth:`asyncio.loop." "create_datagram_endpoint` での *reuse_address* 引数は無効になりました。これは" -"ソケットオプション `SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" +"ソケットオプション ``SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" "``loop.create_datagram_endpoint()`` のドキュメントを参照してください。(Kyle " "Stanley, Antoine Pitrou, Yury Selivanov による貢献 :issue:`37228`)" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index a8e733550..579b42951 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -236,12 +236,11 @@ msgid "" " ..." msgstr "" -#: ../../whatsnew/3.8.rst:166 msgid "" "Since the parameters to the left of ``/`` are not exposed as possible " "keywords, the parameters names remain available for use in ``**kwargs``::" msgstr "" -" ``/`` の左に置かれた引数はキーワード引数には使用されませんが、それゆえに同じ" +"``/`` の左に置かれた引数はキーワード引数には使用されませんが、それゆえに同じ" "名前が ``**kwargs`` に出現することがあり得ます::" #: ../../whatsnew/3.8.rst:169 @@ -461,9 +460,8 @@ msgstr "" "テム管理者や埋め込みでの利用者は Python のビルドを常に監査が有効な状態で利用" "できます。" -#: ../../whatsnew/3.8.rst:293 msgid "See :pep:`578` for full details." -msgstr "詳細は :pep:`578` を参照してください。 " +msgstr "詳細は :pep:`578` を参照してください。" #: ../../whatsnew/3.8.rst:297 msgid "PEP 587: Python Initialization Configuration" @@ -625,9 +623,8 @@ msgid "" "documentation." msgstr ":ref:`Python 初期化設定 ` も参照してください。" -#: ../../whatsnew/3.8.rst:347 msgid "See :pep:`587` for a full description." -msgstr "詳細は :pep:`587` を参照してください。 " +msgstr "詳細は :pep:`587` を参照してください。" #: ../../whatsnew/3.8.rst:349 msgid "(Contributed by Victor Stinner in :issue:`36763`.)" @@ -651,9 +648,8 @@ msgid "" msgstr "" "これは現在、暫定版です。Python3.9 から公開で使われることを目ざしています。" -#: ../../whatsnew/3.8.rst:364 msgid "See :pep:`590` for a full description." -msgstr "詳細は :pep:`590` を参照してください。 " +msgstr "詳細は :pep:`590` を参照してください。" #: ../../whatsnew/3.8.rst:366 msgid "" @@ -686,9 +682,8 @@ msgstr "" "が、メインのpickle ストリームとは別の独立した通信レイヤで転送されるような、帯" "域外バッファを提供します。" -#: ../../whatsnew/3.8.rst:381 msgid "See :pep:`574` for a full description." -msgstr "詳細は :pep:`574` を参照してください。 " +msgstr "詳細は :pep:`574` を参照してください。" #: ../../whatsnew/3.8.rst:383 msgid "(Contributed by Antoine Pitrou in :issue:`36785`.)" @@ -799,9 +794,8 @@ msgid "" "('SIMPSONS', 'homer', 'marge', 'bart', 'lisa', 'maggie')" msgstr "" -#: ../../whatsnew/3.8.rst:438 msgid "(Contributed by David Cuthbert and Jordan Chapman in :issue:`32117`.)" -msgstr "(David Cuthbert, Jordan Chapman の貢献による :issue:`32117`) " +msgstr "(David Cuthbert, Jordan Chapman の貢献による :issue:`32117`)" #: ../../whatsnew/3.8.rst:440 msgid "" @@ -884,9 +878,8 @@ msgid "" "arguments: 'data'" msgstr "" -#: ../../whatsnew/3.8.rst:480 msgid "(Contributed by Victor Stinner in :issue:`37032`.)" -msgstr "(Victor Stinner の貢献による :issue:`37032`) " +msgstr "(Victor Stinner の貢献による :issue:`37032`)" #: ../../whatsnew/3.8.rst:482 msgid "" @@ -1099,9 +1092,8 @@ msgid "" "asyncio.run(main())" msgstr "" -#: ../../whatsnew/3.8.rst:613 msgid "This is *roughly* equivalent to::" -msgstr "これは、だいたい次と等価です :: " +msgstr "これは、だいたい次と等価です ::" #: ../../whatsnew/3.8.rst:615 msgid "" @@ -3583,7 +3575,6 @@ msgstr "" msgid "Notable changes in Python 3.8.1" msgstr "Python3.8.1 での重要な変更点" -#: ../../whatsnew/3.8.rst:2243 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -3594,7 +3585,7 @@ msgid "" msgstr "" "セキュリティ上の重大な懸念により、:meth:`asyncio.loop." "create_datagram_endpoint` での *reuse_address* 引数は無効になりました。これは" -"ソケットオプション `SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" +"ソケットオプション ``SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" "``loop.create_datagram_endpoint()`` のドキュメントを参照してください。(Kyle " "Stanley, Antoine Pitrou, Yury Selivanov による貢献 :issue:`37228`)" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 48b86a5b4..26a22584c 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -556,7 +556,6 @@ msgstr "" msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.9.rst:342 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -567,7 +566,7 @@ msgid "" msgstr "" "セキュリティ上の重大な懸念により、:meth:`asyncio.loop." "create_datagram_endpoint` での *reuse_address* 引数は無効になりました。これは" -"ソケットオプション `SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" +"ソケットオプション ``SO_REUSEADDR`` のUDP における挙動が原因です。詳しくは、" "``loop.create_datagram_endpoint()`` のドキュメントを参照してください。(Kyle " "Stanley, Antoine Pitrou, Yury Selivanov による貢献 :issue:`37228`)" From f87dbbce143685013760f4c5606c347a56970ca7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Oct 2026 12:30:54 +0000 Subject: [PATCH 12/21] Merge 3.15 into 3.14 --- about.po | 8 +- bugs.po | 9 +- builtins/constants.po | 17 +- builtins/exceptions.po | 142 ++-- builtins/functions.po | 217 +++-- builtins/stdtypes.po | 344 ++++---- c-api/buffer.po | 6 +- c-api/exceptions.po | 5 +- c-api/interp-lifecycle.po | 3 +- contents.po | 3 +- glossary.po | 1261 ++++++++++++++++++--------- improve-page-nojs.po | 24 +- improve-page.po | 33 +- library/_thread.po | 3 +- library/asyncio-eventloop.po | 7 +- library/asyncio-policy.po | 3 +- library/asyncio-stream.po | 3 +- library/asyncio.po | 3 +- library/codecs.po | 3 +- library/compileall.po | 3 +- library/concurrent.futures.po | 3 +- library/concurrent.interpreters.po | 3 +- library/constants.po | 17 +- library/ctypes.po | 11 +- library/curses.po | 3 +- library/dbm.po | 4 +- library/ensurepip.po | 3 +- library/errno.po | 3 +- library/exceptions.po | 142 ++-- library/fcntl.po | 3 +- library/ftplib.po | 3 +- library/functions.po | 217 +++-- library/getpass.po | 3 +- library/grp.po | 3 +- library/http.client.po | 3 +- library/http.server.po | 3 +- library/imaplib.po | 3 +- library/importlib.po | 3 +- library/mimetypes.po | 3 +- library/mmap.po | 3 +- library/msvcrt.po | 3 +- library/multiprocessing.po | 3 +- library/os.path.po | 3 +- library/os.po | 106 +-- library/poplib.po | 3 +- library/posix.po | 3 +- library/pty.po | 3 +- library/pwd.po | 3 +- library/readline.po | 3 +- library/resource.po | 10 +- library/runpy.po | 5 +- library/select.po | 6 +- library/selectors.po | 3 +- library/shutil.po | 3 +- library/signal.po | 19 +- library/smtplib.po | 3 +- library/socket.po | 34 +- library/socketserver.po | 3 +- library/ssl.po | 4 +- library/stat.po | 3 +- library/stdtypes.po | 344 ++++---- library/subprocess.po | 7 +- library/sys.po | 8 +- library/syslog.po | 3 +- library/termios.po | 3 +- library/threading.po | 4 +- library/time.po | 13 +- library/tty.po | 3 +- library/urllib.request.po | 3 +- library/venv.po | 3 +- library/webbrowser.po | 3 +- library/winreg.po | 3 +- library/winsound.po | 3 +- library/xmlrpc.client.po | 3 +- library/xmlrpc.server.po | 3 +- library/zoneinfo.po | 3 +- license.po | 1273 +++++++++++++++++++++++++--- reference/expressions.po | 3 +- reference/lexical_analysis.po | 21 +- sphinx.po | 114 ++- tutorial/classes.po | 129 +-- tutorial/controlflow.po | 60 +- tutorial/datastructures.po | 128 ++- tutorial/errors.po | 298 ++++++- tutorial/floatingpoint.po | 7 +- tutorial/inputoutput.po | 122 +-- tutorial/introduction.po | 5 +- tutorial/modules.po | 21 +- tutorial/stdlib.po | 170 +++- tutorial/stdlib2.po | 312 +++++-- tutorial/whatnow.po | 14 +- using/cmdline.po | 4 +- whatsnew/2.3.po | 4 +- 93 files changed, 3797 insertions(+), 2053 deletions(-) diff --git a/about.po b/about.po index 9e288807b..cc25fb828 100644 --- a/about.po +++ b/about.po @@ -27,15 +27,15 @@ msgstr "" msgid "About this documentation" msgstr "このドキュメントについて" -#: ../../about.rst:6 msgid "" "Python's documentation is generated from `reStructuredText`_ sources using " "`Sphinx`_, a documentation generator originally created for Python and now " "maintained as an independent project." msgstr "" -"Pythonのドキュメントは、`Sphinx`_ を使って、`reStructuredText`_ のソースから" -"生成されています。 Sphinx はもともとPythonのために作られ、現在は独立したプロ" -"ジェクトとして保守されています。" +"Python のドキュメントは、`Sphinx`_ を使って `reStructuredText`_ のソースから" +"生成されています。\n" +"Sphinx はもともと Python のために作られたドキュメント生成ツールで、現在は独立" +"したプロジェクトとして保守されています。" #: ../../about.rst:16 msgid "" diff --git a/bugs.po b/bugs.po index e303c52b8..c589f686b 100644 --- a/bugs.po +++ b/bugs.po @@ -192,13 +192,13 @@ msgid "The submission form has two fields, \"Title\" and \"Comment\"." msgstr "" "報告のフォームには、「Title」と「Comment」の2つのフィールドがあります。" -#: ../../bugs.rst:80 msgid "" "For the \"Title\" field, enter a *very* short description of the problem; " "fewer than ten words is good." msgstr "" "「Title」フィールドには、問題の *とても* 短い説明を(訳注: 英語で)入力してく" -"ださい。10語以内が望ましいです。" +"ださい。\n" +"10 語未満が望ましいです。" #: ../../bugs.rst:83 msgid "" @@ -237,13 +237,12 @@ msgstr "" "有益なバグ報告について詳しく説明した記事です。どんな情報が、なぜ有益なのかを" "説明しています。" -#: ../../bugs.rst:99 msgid "" "`Bug Writing Guidelines `_" msgstr "" -"`Bug Writing Guidelines `_" +"`Bug Writing Guidelines `_" #: ../../bugs.rst:100 msgid "" diff --git a/builtins/constants.po b/builtins/constants.po index c46fa2ed8..336db4adb 100644 --- a/builtins/constants.po +++ b/builtins/constants.po @@ -66,7 +66,6 @@ msgid "" "`types.NotImplementedType` type." msgstr "" -#: ../../builtins/constants.rst:40 msgid "" "When a binary (or in-place) method returns :data:`!NotImplemented` the " "interpreter will try the reflected operation on the other type (or some " @@ -76,13 +75,15 @@ msgid "" "error message or the :data:`!NotImplemented` value being returned to Python " "code." msgstr "" -"二項演算の (あるいはインプレースの) メソッドが :data:`!NotImplemented` を返し" -"た場合、インタープリタはもう一方の型で定義された対の演算で代用を試みます (あ" -"るいは演算によっては他の代替手段も試みます)。試行された演算全てが :data:`!" -"NotImplemented` を返した場合、インタープリタは適切な例外を送出します。 :data:" -"`!NotImplemented` を正しく返さないと、誤解を招きかねないエラーメッセージに" -"なったり、 :data:`!NotImplemented` が Python コードに返されるようなことになり" -"ます。" +"二項演算 (またはインプレース演算) のメソッドが :data:`!NotImplemented` を返し" +"た場合、\n" +"インタープリタはもう一方の型に定義された対の演算を試みます (演算子によっては" +"別の代替手段を試みます)。\n" +"すべての試行が :data:`!NotImplemented` を返した場合、インタープリタは適切な例" +"外を送出します。\n" +"誤って :data:`!NotImplemented` を返すと、誤解を招くエラーメッセージが表示され" +"たり、\n" +":data:`!NotImplemented` の値が Python コードに返されたりします。" #: ../../builtins/constants.rst:47 msgid "See :ref:`implementing-the-arithmetic-operations` for examples." diff --git a/builtins/exceptions.po b/builtins/exceptions.po index fabca3bdc..5ca9348f6 100644 --- a/builtins/exceptions.po +++ b/builtins/exceptions.po @@ -88,12 +88,11 @@ msgstr "" msgid "Exception context" msgstr "例外コンテキスト" -#: ../../builtins/exceptions.rst:46 msgid "" "Three attributes on exception objects provide information about the context " "in which the exception was raised:" msgstr "" -"例外オブジェクトの3つの属性は、例外が送出された常用に関する情報を提供します:" +"例外オブジェクトの3つの属性は、例外が送出された状況に関する情報を提供します:" #: ../../builtins/exceptions.rst:53 msgid "" @@ -114,7 +113,6 @@ msgstr "" msgid "raise new_exc from original_exc" msgstr "" -#: ../../builtins/exceptions.rst:65 msgid "" "The expression following :keyword:`from` must be an exception or " "``None``. It will be set as :attr:`!__cause__` on the raised exception. " @@ -125,13 +123,14 @@ msgid "" "while leaving the old exception available in :attr:`!__context__` for " "introspection when debugging." msgstr "" -":keyword:`from ` に続く式は例外か ``None`` でなくてはなりません。\n" -"式は送出される例外の :attr:`!__cause__` として設定されます。\n" -":attr:`!__cause__` を設定することは、 :attr:`!__suppress_context__` 属性を暗" -"黙的に ``True`` に設定することにもなるので、 ``raise new_exc from None`` を使" -"うことで効率的に古い例外を新しいもので置き換えて表示する (例えば、 :exc:" -"`KeyError` を :exc:`AttributeError` に置き換え)、古い例外はデバッグ時の調査で" -"使えるよう :attr:`!__context__` に残すことができます。" +":keyword:`from` に続く式は、例外か ``None`` でなければなりません。\n" +"送出される例外の :attr:`!__cause__` には、その値が設定されます。\n" +":attr:`!__cause__` を設定すると、:attr:`!__suppress_context__` 属性も暗黙的" +"に ``True`` に設定されます。\n" +"そのため、``raise new_exc from None`` を使うと、表示上は古い例外を新しい例外" +"で置き換えられます (例えば :exc:`KeyError` から :exc:`AttributeError` への変" +"換)。\n" +"古い例外はデバッグ時に調べられるよう :attr:`!__context__` に残ります。" #: ../../builtins/exceptions.rst:74 msgid "" @@ -356,7 +355,6 @@ msgstr "" "参照してください。この例外は厳密に言えばエラーではないので、 :exc:" "`Exception` ではなく :exc:`BaseException` を直接継承しています。" -#: ../../builtins/exceptions.rst:243 msgid "" "Raised when the :keyword:`import` statement has troubles trying to load a " "module. Also raised when the \"from list\" in ``from ... import`` has a " @@ -364,8 +362,8 @@ msgid "" msgstr "" ":keyword:`import` 文でモジュールをロードしようとして問題が発生すると送出され" "ます。\n" -"``from ... import`` の中の\"from list\" (訳注:``...`` の部分)の名前が見つか" -"らないときにも送出されます。" +"``from ... import`` の \"from list\" に、見つからない名前が含まれている場合に" +"も送出されます。" #: ../../builtins/exceptions.rst:247 msgid "" @@ -483,17 +481,17 @@ msgstr "" msgid "Added the :attr:`name` attribute." msgstr ":attr:`name` 属性が追加されました。" -#: ../../builtins/exceptions.rst:339 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " "derived classes to override the method, or while the class is being " "developed to indicate that the real implementation still needs to be added." msgstr "" -"この例外は :exc:`RuntimeError` から派生しています。ユーザ定義の基底クラスにお" -"いて、抽象メソッドが派生クラスでオーバライドされることを要求する場合にこの例" -"外を送出しなくてはなりません。またはクラスは実装中であり本来の実装を追加する" -"必要があることを示します。" +"この例外は :exc:`RuntimeError` から派生しています。\n" +"ユーザ定義の基底クラスでは、派生クラスにメソッドのオーバーライドを求める場合" +"に、抽象メソッドからこの例外を送出するべきです。\n" +"また、クラスの開発中に、実際の実装をまだ追加する必要があることを示すためにも" +"送出するべきです。" #: ../../builtins/exceptions.rst:346 msgid "" @@ -535,7 +533,6 @@ msgstr "" "れた場合、:attr:`~BaseException.args` 属性は最初の2つの要素のみからなるタプル" "を持ちます。" -#: ../../builtins/exceptions.rst:373 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -543,23 +540,24 @@ msgid "" "exc:`OSError` directly or via an alias, and is not inherited when " "subclassing." msgstr "" -"コンストラクタは実際には、 `OS exceptions`_ で述べられている :exc:`OSError` " -"のサブクラスを返すことがよくあります。特定のサブクラスは最終的な :attr:`." -"errno` 値によります。この挙動は :exc:`OSError` を直接またはエイリアスで構築" -"し、サブクラス化時に継承されなかった場合にのみ発生します。" +"コンストラクタは、下の `OS exceptions`_ で説明する :exc:`OSError` のサブクラ" +"スを実際に返すことがよくあります。\n" +"どのサブクラスを返すかは、最終的な :attr:`.errno` の値によって決まります。\n" +"この挙動は、:exc:`OSError` を直接またはエイリアスを通して構築した場合にのみ発" +"生し、サブクラスには継承されません。" #: ../../builtins/exceptions.rst:381 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "C 変数 :c:data:`errno` に由来する数値エラーコードです。" -#: ../../builtins/exceptions.rst:385 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" -"Windows において、ネイティブ Windows エラーコードを与えます。そして :attr:" -"`errno` 属性は POSIX でいうネイティブエラーコードへのおよその翻訳です。" +"Windows では、ネイティブの Windows エラーコードを表します。\n" +"この場合、:attr:`.errno` 属性は、そのネイティブエラーコードを POSIX のエラー" +"コードにおおよそ変換した値です。" #: ../../builtins/exceptions.rst:389 msgid "" @@ -600,17 +598,16 @@ msgid "" "exc:`OSError`, and the constructor may return a subclass." msgstr "" -#: ../../builtins/exceptions.rst:418 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" "`filesystem encoding and error handler`. Also, the *filename2* constructor " "argument and attribute was added." msgstr "" -":attr:`filename` 属性が :term:`filesystem encoding and error handler` のエン" -"コーディングでエンコードやデコードされた名前から、関数に渡された元々のファイ" -"ル名になりました。\n" -"また、*filename2* コンストラクタ引数が追加されました。" +":attr:`filename` 属性は、:term:`filesystem encoding and error handler` に従っ" +"てエンコードまたはデコードされた名前ではなく、関数に渡された元のファイル名に" +"なりました。\n" +"また、コンストラクタ引数と属性の *filename2* が追加されました。" #: ../../builtins/exceptions.rst:427 msgid "" @@ -769,13 +766,12 @@ msgstr "" ":pep:`479` が全てのコードでデフォルトで有効化されました: ジェネレータから送出" "された :exc:`StopIteration` は :exc:`RuntimeError` に変換されます。" -#: ../../builtins/exceptions.rst:524 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -"イテレーションを停止するために、 :term:`asynchronous iterator` オブジェクト" -"の :meth:`~object.__anext__` メソッドによって返される必要があります。" +"イテレーションを停止するために、:term:`asynchronous iterator` オブジェクト" +"の :meth:`~object.__anext__` メソッドから送出しなければなりません。" #: ../../builtins/exceptions.rst:531 msgid "" @@ -1031,23 +1027,22 @@ msgstr "" "Unicode 関連のエラーが変換中に発生した際に送出されます。 :exc:`UnicodeError` " "のサブクラスです。" -#: ../../builtins/exceptions.rst:709 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -"演算子や関数が、正しい型だが適切でない値を持つ引数を受け取ったときや、 :exc:" -"`IndexError` のようなより詳細な例外では記述できない状況で送出されます。" +"演算や関数が、型は正しいものの値が適切でない実引数を受け取り、\n" +"かつ、その状況を :exc:`IndexError` などのより具体的な例外で表せない場合に送出" +"されます。" -#: ../../builtins/exceptions.rst:716 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -"除算や剰余演算の第二引数が 0 であった場合に送出されます。関連値は文字列で、そ" -"の演算における被演算子と演算子の型を示します。" +"除算や剰余演算の第2引数がゼロの場合に送出されます。\n" +"関連値は、被演算子の型と演算の種類を示す文字列です。" #: ../../builtins/exceptions.rst:721 msgid "" @@ -1073,17 +1068,16 @@ msgstr "" "以下の例外は :exc:`OSError` のサブクラスで、システムエラーコードに依存して送" "出されます。" -#: ../../builtins/exceptions.rst:741 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." "EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` and :py:" "const:`~errno.EINPROGRESS`." msgstr "" -"ある操作が、ノンブロッキング操作に設定されたオブジェクト (例えばソケット) を" -"ブロックしそうになった場合に送出されます。:c:data:`errno` :py:const:`~errno." -"EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` および :" -"py:const:`~errno.EINPROGRESS` に対応します。" +"ノンブロッキング操作に設定されたオブジェクト (例えばソケット) に対する操作を" +"すぐに完了できず、待機が必要な場合に送出されます。\n" +":c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:py:" +"const:`~errno.EWOULDBLOCK`、:py:const:`~errno.EINPROGRESS` に対応します。" #: ../../builtins/exceptions.rst:746 msgid "" @@ -1120,17 +1114,18 @@ msgstr "" "サブクラスは :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError`, :exc:`ConnectionResetError` です。" -#: ../../builtins/exceptions.rst:769 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " "has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:" "`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" -":exc:`ConnectionError` のサブクラスで、もう一方の端が閉じられたパイプに書き込" -"こもうとするか、書き込みのためにシャットダウンされたソケットに書き込こもうと" -"した場合に発生します。 :c:data:`errno` :py:const:`~errno.EPIPE` と :py:" -"const:`~errno.ESHUTDOWN` に対応します。" +":exc:`ConnectionError` のサブクラスです。\n" +"もう一方の端が閉じられたパイプに書き込もうとした場合や、\n" +"書き込み側がシャットダウンされたソケットに書き込もうとした場合に送出されま" +"す。\n" +":c:data:`errno` :py:const:`~errno.EPIPE` と :py:const:`~errno.ESHUTDOWN` に対" +"応します。" #: ../../builtins/exceptions.rst:776 msgid "" @@ -1300,23 +1295,21 @@ msgstr "" msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../builtins/exceptions.rst:888 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -"古くなって将来的に廃止される予定だが、今のところは廃止されていない機能につい" -"ての警告の基底クラスです。" +"古くなっており、将来は非推奨になる見込みですが、現時点では非推奨ではない機能" +"についての警告の基底クラスです。" -#: ../../builtins/exceptions.rst:892 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -"近々起こる可能性のある機能廃止について警告を発することはまれなので、このクラ" -"スはめったに使われず、既に決まっている廃止については :exc:" -"`DeprecationWarning` が望ましいです。" +"将来、非推奨になる可能性を事前に警告することは一般的ではないため、このクラス" +"はめったに使われません。\n" +"すでに非推奨となっている機能には :exc:`DeprecationWarning` が推奨されます。" #: ../../builtins/exceptions.rst:896 ../../builtins/exceptions.rst:925 #: ../../builtins/exceptions.rst:952 @@ -1391,7 +1384,6 @@ msgstr "" "す。また、:keyword:`except*` によって判別でき、例外グループに含" "まれている例外の型に基づいてサブグループにマッチします。" -#: ../../builtins/exceptions.rst:972 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1401,15 +1393,15 @@ msgid "" "is so that ``except Exception`` catches an :exc:`ExceptionGroup` but not :" "exc:`BaseExceptionGroup`." msgstr "" -"この2つの例外型は一連の例外 ``excs`` を包含します。``msg`` 引数は文字列の必要" -"があります。2つのクラスの異なる点は、:exc:`BaseException` は :exc:" -"`BaseExceptionGroup` を拡張して任意の例外を含められますが、:exc:" -"`ExceptionGroup` は :exc:`Exception` を拡張して :exc:`Exception` のサブクラス" -"のみを含められます。この設計により ``except Exception`` は :exc:" -"`ExceptionGroup` をキャッチしますが、:exc:`BaseExceptionGroup` はキャッチしま" -"せん。" +"どちらの例外型も、シーケンス ``excs`` に含まれる例外をまとめて保持します。\n" +"``msg`` パラメータは文字列でなければなりません。\n" +"2つのクラスの違いは、:exc:`BaseExceptionGroup` が :exc:`BaseException` を拡張" +"して任意の例外を保持できるのに対し、\n" +":exc:`ExceptionGroup` は :exc:`Exception` を拡張し、:exc:`Exception` のサブク" +"ラスの例外のみを保持できることです。\n" +"この設計により、``except Exception`` は :exc:`ExceptionGroup` を捕捉します" +"が、:exc:`BaseExceptionGroup` は捕捉しません。" -#: ../../builtins/exceptions.rst:980 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1417,11 +1409,13 @@ msgid "" "The :exc:`ExceptionGroup` constructor, on the other hand, raises a :exc:" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -":exc:`BaseExceptionGroup` のコンストラクターは含まれる例外がすべて :exc:" -"`Exception` の場合は :exc:`BaseExceptionGroup` ではなく :exc:" -"`ExceptionGroup` を返すように自動的に選択されます。一方 :exc:" -"`ExceptionGroup` コンストラクタは、:exc:`Exception` サブクラス以外の例外を含" -"む場合は :exc:`TypeError` を送出します。" +":exc:`BaseExceptionGroup` のコンストラクタは、保持する例外がすべて :exc:" +"`Exception` のインスタンスである場合、\n" +":exc:`BaseExceptionGroup` ではなく :exc:`ExceptionGroup` を返すので、クラスの" +"選択を自動化するために利用できます。\n" +"一方、:exc:`ExceptionGroup` のコンストラクタは、:exc:`Exception` のサブクラス" +"のインスタンスでない例外が一つでも含まれていると :exc:`TypeError` を送出しま" +"す。" #: ../../builtins/exceptions.rst:987 msgid "" @@ -1448,13 +1442,13 @@ msgstr "" "コンストラクタに渡された一連の ``excs`` に含まれる例外のタプルです。この属性" "は読み込み専用です。" -#: ../../builtins/exceptions.rst:1007 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -"現在のグループで *条件* にマッチする礼儀のみを含む例外グループを返します。結" -"果が空の場合は ``None`` を返します。" +"現在のグループの例外のうち、*condition* にマッチするものだけを含む例外グルー" +"プを返します。\n" +"結果が空の場合は ``None`` を返します。" #: ../../builtins/exceptions.rst:1010 msgid "" diff --git a/builtins/functions.po b/builtins/functions.po index 5d9420dcf..60c46892b 100644 --- a/builtins/functions.po +++ b/builtins/functions.po @@ -469,7 +469,6 @@ msgid "" msgstr "" "これは組み込みの :func:`next` 関数の非同期版であり、同じように動作します。" -#: ../../builtins/functions.rst:97 msgid "" "This calls the :meth:`~object.__anext__` method of *async_iterator*, " "returning an :term:`awaitable`. Awaiting this returns the next value of the " @@ -477,10 +476,10 @@ msgid "" "exhausted, otherwise :exc:`StopAsyncIteration` is raised." msgstr "" "これは *async_iterator* の :meth:`~object.__anext__` メソッドを呼び出し、待ち" -"受け可能オブジェクト (:term:`awaitable`) を返します。待ち受けることによりイテ" -"レータの次の値を返します。 *default* が与えられた場合、イテレータが枯渇したと" -"きにその値が返されます。 *default* が与えられない場合は :exc:" -"`StopAsyncIteration` が送出されます。" +"受け可能オブジェクト (:term:`awaitable`) を返します。\n" +"これを待ち受けると、イテレータの次の値が返されます。\n" +"イテレータが枯渇した場合、*default* が指定されていればその値が返され、\n" +"指定されていなければ :exc:`StopAsyncIteration` が送出されます。" #: ../../builtins/functions.rst:106 msgid "" @@ -728,15 +727,15 @@ msgid "" msgstr "" "この関数は Python 3.0 で一度取り除かれましたが、Python 3.2 で復活しました。" -#: ../../builtins/functions.rst:251 msgid "" "Return the string representing a character with the specified Unicode code " "point. For example, ``chr(97)`` returns the string ``'a'``, while " "``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." msgstr "" -"指定されたUnicode コードポイントが文字を表す文字列を返します。例えば " -"``chr(97)`` は文字列 ``'a'`` を、 ``chr(8364)`` は文字列 ``'€'`` を返しま" -"す。 :func:`ord` の逆です。" +"指定された Unicode コードポイントを持つ文字を表す文字列を返します。\n" +"例えば、``chr(97)`` は文字列 ``'a'`` を、``chr(8364)`` は文字列 ``'€'`` を返" +"します。\n" +":func:`ord` の逆の操作です。" #: ../../builtins/functions.rst:255 msgid "" @@ -829,18 +828,18 @@ msgstr "" "クラスメソッドは :func:`property` など、他の :term:`デスクリプタ " "` をラップすることができなくなりました。" -#: ../../builtins/functions.rst:303 msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " "string, a byte string, or an AST object. Refer to the :mod:`ast` module " "documentation for information on how to work with AST objects." msgstr "" -"*source* をコードオブジェクト、もしくは、 AST オブジェクトにコンパイルしま" -"す。 コードオブジェクトは :func:`exec` 文で実行したり、 :func:`eval` 呼び出し" -"で評価できます。 *source* は通常の文字列、 バイト列、 AST オブジェクトのいず" -"れでもかまいません。 AST オブジェクトへの、また、 AST オブジェクトからのコン" -"パイルの方法は、 :mod:`ast` モジュールのドキュメントを参照してください。" +"*source* をコードオブジェクトまたは AST オブジェクトにコンパイルします。\n" +"コードオブジェクトは :func:`exec` や :func:`eval` で実行できます。\n" +"*source* には、通常の文字列、バイト列、AST オブジェクトのいずれかを指定できま" +"す。\n" +"AST オブジェクトの扱い方については、:mod:`ast` モジュールのドキュメントを参照" +"してください。" #: ../../builtins/functions.rst:308 msgid "" @@ -1220,14 +1219,13 @@ msgstr "" "だけ情報を集めようとします。結果のリストは必ずしも完全ではなく、カスタムの :" "func:`~object.__getattr__` を持つ場合は不正確かもしれません。" -#: ../../builtins/functions.rst:523 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " "complete, information:" msgstr "" -"デフォルトの :func:`dir` メカニズムは、完全というより最重要な情報を作成しよう" -"とするため、異なる型のオブジェクトでは異なって振る舞います:" +"デフォルトの :func:`dir` の仕組みは、網羅的な情報よりも関連性の高い情報を返そ" +"うとするため、オブジェクトの型によって異なる動作をします:" #: ../../builtins/functions.rst:527 msgid "" @@ -1237,13 +1235,12 @@ msgstr "" "オブジェクトがモジュールオブジェクトの場合、リストにはモジュールの属性の名前" "が含まれます。" -#: ../../builtins/functions.rst:530 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." msgstr "" -"オブジェクトが型オブジェクトやクラスオブジェクトの場合、リストにはその属性の" -"名前と、再帰的にたどったその基底クラスの属性が含まれます。" +"オブジェクトが型オブジェクトまたはクラスオブジェクトの場合、リストにはその属" +"性の名前と、基底クラスを再帰的にたどった属性の名前が含まれます。" #: ../../builtins/functions.rst:533 msgid "" @@ -1462,9 +1459,8 @@ msgstr "" "デフォルトの *locals* 名前空間のセマンティクスは、 組み込み :func:`locals` の" "説明のように調整された。" -#: ../../builtins/functions.rst:682 ../../builtins/functions.rst:764 msgid "*globals* can now be a :class:`frozendict`." -msgstr "*globals* は :class:`frozendict` になるようになった。" +msgstr "*globals* に :class:`frozendict` も指定できるようになりました。" #: ../../builtins/functions.rst:693 msgid "" @@ -1561,36 +1557,37 @@ msgstr "" msgid "Added the *closure* parameter." msgstr "*closure* パラメータが追加されました。" -#: ../../builtins/functions.rst:769 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " "iteration, or an iterator. If *function* is ``None``, the identity function " "is assumed, that is, all elements of *iterable* that are false are removed." msgstr "" -"*iterable* の要素のうち、 *function* が真であるものからイテレータを構築しま" -"す。 *iterable* にはシーケンスか、イテレーションをサポートするコンテナか、イ" -"テレータを渡せます。 *function* が ``None`` のときは恒等関数が指定されたもの" -"として扱われ、 *iterable* のうち偽であるものがすべて取り除かれます。" +"*iterable* の要素のうち、*function* を適用した結果が真になる要素からイテレー" +"タを構築します。\n" +"*iterable* には、シーケンス、イテレーションをサポートするコンテナ、イテレータ" +"のいずれかを指定できます。\n" +"*function* が ``None`` の場合は恒等関数が指定されたものとして扱われ、" +"*iterable* の要素のうち偽であるものがすべて取り除かれます。" -#: ../../builtins/functions.rst:775 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " "not ``None`` and ``(item for item in iterable if item)`` if function is " "``None``." msgstr "" -"なお、``filter(function, iterable)`` は、関数が ``None`` でなければジェネレー" -"タ式 ``(item for item in iterable if function(item))`` と同等で、関数が " -"``None`` なら ``(item for item in iterable if item)`` と同等です。" +"``filter(function, iterable)`` は、``function`` が ``None`` でなければジェネ" +"レータ式 ``(item for item in iterable if function(item))`` と等価です。\n" +"``function`` が ``None`` なら、``(item for item in iterable if item)`` と等価" +"です。" -#: ../../builtins/functions.rst:780 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." msgstr "" -"逆の働きをする関数については、 :func:`itertools.filterfalse` を参照してくださ" -"い。 *iterable* の要素のうち、 *function* が偽であるものを返します。" +"逆の働きをする関数については :func:`itertools.filterfalse` を参照してくださ" +"い。\n" +"*iterable* の要素のうち、*function* を適用した結果が偽になる要素を返します。" #: ../../builtins/functions.rst:791 msgid "Return a floating-point number constructed from a number or a string." @@ -1620,7 +1617,6 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -#: ../../builtins/functions.rst:808 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1630,12 +1626,13 @@ msgid "" "conform to the :token:`~float:floatvalue` production rule in the following " "grammar, after leading and trailing whitespace characters are removed:" msgstr "" -"引数が文字列の場合、10進数でなければなりません。先頭に符号または空白を含んで" -"もかまいません。符号は ``'+'`` か ``'-'`` のいずれかです。正符号 ``'+'`` は生" -"成される値に対して何の効果もありません。引数は NaN (not-a-number) や正または" -"負の無限大をあらわす文字列でもかまいません。より正確にいうと、入力は先頭と末" -"尾の空白文字を除き、以下に示す :token:`~float:floatvalue` の生成規則に従う必" -"要があります:" +"引数が文字列の場合、10進数を含み、必要に応じて先頭に符号を付けたり、前後に空" +"白文字を付けたりできます。\n" +"符号は ``'+'`` または ``'-'`` で、``'+'`` は生成される値に影響しません。\n" +"引数には、NaN (not-a-number)、正または負の無限大を表す文字列も指定できま" +"す。\n" +"より正確には、先頭と末尾の空白文字を取り除いた入力が、以下の文法の :token:" +"`~float:floatvalue` の生成規則に従う必要があります:" #: ../../builtins/functions.rst:829 msgid "" @@ -1706,7 +1703,6 @@ msgstr "" "デフォルトの *format_spec* は空の文字列です。それは通常 :func:`str(value) " "` の呼び出しと同じ結果になります。" -#: ../../builtins/functions.rst:871 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1715,12 +1711,14 @@ msgid "" "and the *format_spec* is non-empty, or if either the *format_spec* or the " "return value are not strings." msgstr "" -"``format(value, format_spec)`` の呼び出しは、 ``type(value)." -"__format__(value, format_spec)`` に翻訳され、これは value の :meth:`~object." -"__format__` メソッドの検索をするとき、インスタンス辞書を回避します。このメ" -"ソッドの探索が :mod:`object` に到達しても *format_spec* が空にならなかった" -"り、 *format_spec* や返り値が文字列でなかったりした場合、 :exc:`TypeError` が" -"送出されます。" +"``format(value, format_spec)`` の呼び出しは、``type(value).__format__(value, " +"format_spec)`` に置き換えられ、\n" +"``value`` の :meth:`~object.__format__` メソッドを探す際にインスタンスの辞書" +"を参照しません。\n" +"メソッドの探索が :mod:`object` に到達し、かつ *format_spec* が空でない場合" +"や、\n" +"*format_spec* または返り値が文字列でない場合は、:exc:`TypeError` が送出されま" +"す。" #: ../../builtins/functions.rst:878 msgid "" @@ -1786,15 +1784,14 @@ msgstr "" "名前を持つ属性) の値を :func:`getattr` で取り出すためには、属性名を手動でマン" "グリングする必要があります。" -#: ../../builtins/functions.rst:931 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " "same regardless of where the function is called." msgstr "" -"現在のモジュールの名前空間を実装した辞書を返します。関数内のコードに対して" -"は、関数が定義されるときに辞書が設定され、その関数がどこから呼ばれたかにかか" -"わらず同じ内容になります。" +"現在のモジュールの名前空間を実装する辞書を返します。\n" +"関数内のコードでは、この辞書は関数の定義時に決まり、関数がどこから呼び出され" +"ても同じ辞書が使われます。" #: ../../builtins/functions.rst:938 msgid "" @@ -1857,11 +1854,10 @@ msgstr "" "さい。より詳しい情報は、 :ref:`位置専用引数についての FAQ の項目 ` を参照してください。" -#: ../../builtins/functions.rst:972 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "" -"この関数は、 :mod:`site` モジュールから、組み込みの名前空間に移されました。" +"この関数は :mod:`site` モジュールによって組み込み名前空間に追加されます。" #: ../../builtins/functions.rst:974 msgid "" @@ -1928,16 +1924,17 @@ msgstr "" "引数 ``id`` を指定して :ref:`監査イベント ` ``builtins.id`` を送出" "します。" -#: ../../builtins/functions.rst:1026 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " "converts it to a string (stripping a trailing newline), and returns that. " "When EOF is read, :exc:`EOFError` is raised. Example::" msgstr "" -"引数 *prompt* が存在すれば、それが末尾の改行を除いて標準出力に書き出されま" -"す。次に、この関数は入力から 1 行を読み込み、文字列に変換して (末尾の改行を除" -"いて) 返します。 EOF が読み込まれたとき、 :exc:`EOFError` が送出されます。" +"実引数 *prompt* が指定されている場合、その値を末尾に改行を付けずに標準出力に" +"書き出します。\n" +"次に、入力から1行を読み取り、文字列に変換して末尾の改行を取り除き、その文字列" +"を返します。\n" +"EOF を読み取ると :exc:`EOFError` が送出されます。\n" "例::" #: ../../builtins/functions.rst:1031 @@ -2038,7 +2035,6 @@ msgstr "" "の先頭に任意の数のゼロを付けたり、前後に空白文字を付けたり、各桁を単一の下線" "で区切ったりしても有効です。" -#: ../../builtins/functions.rst:1084 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -2051,17 +2047,17 @@ msgid "" "prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not legal, " "while ``int('010')`` and ``int('010', 8)`` are." msgstr "" -"n-進数の整数文字列は、各桁が0から n-1 の数値で表されます。ユニコードの10進数" -"では、各桁は0から9のいずれかです。また10から35までの値は ``a`` から ``z`` (ま" -"たは ``A`` から ``Z``) で表されます。デフォルトの *base* は10です。基数に指定" -"可能な値は0および2から36までの整数です。2進数、8進数、16進数の文字列は、整数" -"リテラルと同様に、それぞれ ``0b``/``0B``, ``0o``/``0O``, または ``0x``/" -"``0X`` をプレフィックスとして追加することができます。基数を0に指定した場合、" -"文字列は :ref:`コードにおける整数リテラル ` と同じように解釈されま" -"す。すなわち、プレフィックスによって基数が2, 8, 10, または 16 のどれになるか" -"が決まります。基数を0にした場合先頭にゼロを追加することはできません: すなわ" -"ち ``int('010', 0)`` は基数を0に指定しているため不正ですが、 ``int('010')`` " -"や ``int('010', 8)`` は有効です。" +"n 進数の整数文字列は、各桁が 0 から n-1 の値を表す数字で構成されます。\n" +"0 から 9 の値は、任意の Unicode 10進数字で表せます。\n" +"10 から 35 の値は、``a`` から ``z`` (または ``A`` から ``Z``) で表せます。\n" +"*base* のデフォルト値は 10 で、指定できる基数は 0 および 2 から 36 です。\n" +"2 進、8 進、16 進の文字列には、コード中の整数リテラルと同様に、それぞれ " +"``0b``/``0B``、``0o``/``0O``、``0x``/``0X`` という接頭辞を付けられます。\n" +"基数が 0 の場合は、:ref:`コード中の整数リテラル ` と同じように、接" +"頭辞によって実際の基数が 2、8、10、16 のいずれかに決まります。\n" +"基数が 0 の場合は先頭に余分なゼロを付けることもできません。\n" +"``int('010', 0)`` は無効ですが、``int('010')`` と ``int('010', 8)`` は有効で" +"す。" #: ../../builtins/functions.rst:1095 msgid "The integer type is described in :ref:`typesnumeric`." @@ -2253,13 +2249,13 @@ msgid "" msgstr "" "クラス スコープでは、メタクラス コンストラクタに渡された名前空間を返します。" -#: ../../builtins/functions.rst:1217 msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " "arguments, it returns the local namespace passed in to the function call." msgstr "" -"``exec()`` や ``eval()`` が引数 local と global が分けて使われてる場合では、" -"関数の呼び出しで渡されたローカル名前空間を返します。" +"ローカル用とグローバル用に別々の実引数を渡して ``exec()`` や ``eval()`` を使" +"う場合、\n" +"その関数呼び出しに渡されたローカル名前空間を返します。" #: ../../builtins/functions.rst:1220 msgid "" @@ -2359,15 +2355,14 @@ msgid "" msgstr "" "iterable の中で最大の要素、または2つ以上の引数の中で最大のものを返します。" -#: ../../builtins/functions.rst:1279 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " "arguments are provided, the largest of the positional arguments is returned." msgstr "" -"位置引数が1つだけ与えられた場合、それは空でない :term:`iterable` でなくてはい" -"けません。その iterable の最大の要素が返されます。2 つ以上のキーワード無しの" -"位置引数が与えられた場合、その位置引数の中で最大のものが返されます。" +"位置引数が1つの場合は、:term:`iterable` を指定します。\n" +"そのイテラブルの最大の要素を返します。\n" +"位置引数が2つ以上の場合は、それらのうち最大のものを返します。" #: ../../builtins/functions.rst:1284 ../../builtins/functions.rst:1322 msgid "" @@ -2420,15 +2415,14 @@ msgid "" msgstr "" "iterable の中で最小の要素、または2つ以上の引数の中で最小のものを返します。" -#: ../../builtins/functions.rst:1317 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " "arguments are provided, the smallest of the positional arguments is returned." msgstr "" -"位置引数が1つだけ与えられた場合、それは空でない :term:`iterable` でなくてはい" -"けません。その iterable の最小の要素が返されます。2 つ以上のキーワード無しの" -"位置引数が与えられた場合、その位置引数の中で最小のものが返されます。" +"位置引数が1つの場合は、:term:`iterable` を指定します。\n" +"そのイテラブルの最小の要素を返します。\n" +"位置引数が2つ以上の場合は、それらのうち最小のものを返します。" #: ../../builtins/functions.rst:1328 msgid "" @@ -2592,15 +2586,15 @@ msgstr "``'+'``" msgid "open for updating (reading and writing)" msgstr "更新用に開く (読み込み・書き込み用)" -#: ../../builtins/functions.rst:1430 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " "``'r+b'`` open the file with no truncation." msgstr "" -"デフォルトのモードは ``'r'`` (テキストの読み込み用に開く、 ``'rt'`` と同義) " -"です。 ``'w+'`` と ``'w+b'`` はファイルを開いて上書きします。 ``'r+'`` と " -"``'r+b'`` はファイルを上書きせずに開きます。" +"デフォルトのモードは ``'r'`` です (テキストの読み込み用に開き、``'rt'`` と同" +"義です)。\n" +"モード ``'w+'`` と ``'w+b'`` はファイルを開いて内容を切り詰めます。\n" +"モード ``'r+'`` と ``'r+b'`` は、内容を切り詰めずにファイルを開きます。" #: ../../builtins/functions.rst:1434 msgid "" @@ -2891,13 +2885,12 @@ msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "" ":class:`os.PathLike` を実装したオブジェクトを受け入れるようになりました。" -#: ../../builtins/functions.rst:1583 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." msgstr "" -"Windowsでは、コンソールバッファのオープンは、:class:`io.FileIO` ではなく、:" -"class:`io.RawIOBase` のサブクラスを返すでしょう。" +"Windows では、コンソールバッファを開くと、:class:`io.FileIO` 以外の :class:" +"`io.RawIOBase` のサブクラスが返される場合があります。" #: ../../builtins/functions.rst:1586 msgid "The ``'U'`` mode has been removed." @@ -3235,7 +3228,6 @@ msgstr "" ":class:`range` は、実際には関数ではなくイミュータブルなシーケンス型で、 :ref:" "`typesseq-range` と :ref:`typesseq` にドキュメント化されています。" -#: ../../builtins/functions.rst:1776 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -3247,14 +3239,16 @@ msgid "" "method. If :func:`sys.displayhook` is not accessible, this function will " "raise :exc:`RuntimeError`." msgstr "" -"オブジェクトの印字可能な表現を含む文字列を返します。この関数は多くの型につい" -"て、 :func:`eval` に渡されたときと同じ値を持つようなオブジェクトを表す文字列" -"を生成しようとします。そうでない場合は、山括弧に囲まれたオブジェクトの型の名" -"前と追加の情報 (大抵の場合はオブジェクトの名前とアドレスを含みます) を返しま" -"す。クラスは、 :meth:`~object.__repr__` メソッドを定義することで、この関数に" -"よりそのクラスのインスタンスが返すものを制御することができます。:func:`sys." -"displayhook` にアクセスできない場合、この関数は :exc:`RuntimeError` を送出し" -"ます。" +"オブジェクトの印字可能な表現を含む文字列を返します。\n" +"多くの型では、:func:`eval` に渡すと元のオブジェクトと同じ値を持つオブジェクト" +"が得られるような文字列を返そうとします。\n" +"それ以外の場合、オブジェクトの型名と追加情報を含む、山括弧で囲まれた文字列を" +"返します。\n" +"追加情報には、オブジェクトの名前やアドレスが含まれることがよくあります。\n" +"クラスに :meth:`~object.__repr__` メソッドを定義すると、そのクラスのインスタ" +"ンスに対してこの関数が返すものを制御できます。\n" +":func:`sys.displayhook` にアクセスできない場合、この関数は :exc:" +"`RuntimeError` を送出します。" #: ../../builtins/functions.rst:1787 msgid "This class has a custom representation that can be evaluated::" @@ -3735,13 +3729,13 @@ msgstr "" "*start* パラメータをキーワード引数として指定することができるようになりまし" "た。" -#: ../../builtins/functions.rst:2064 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy and " "better commutativity on most builds." msgstr "" -"浮動小数点数の総和を計算するとき、ほとんどの環境でより高精度な結果とより良い" -"互換性が得られるアルゴリズムを使用するようになりました。" +"浮動小数点数の総和を計算するアルゴリズムが変更され、\n" +"ほとんどのビルドで精度が向上し、加算する順序を入れ替えたときも結果がより一致" +"しやすくなりました。" #: ../../builtins/functions.rst:2067 msgid "" @@ -4167,15 +4161,14 @@ msgid "" "is :term:`exhausted` before the others:" msgstr "" -#: ../../builtins/functions.rst:2299 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -"``strict=True`` 引数なしの場合、長さの異なるイテラブルを生じる原因となるいか" -"なるバグも、この時点では問題なく処理されます。そして代わりにプログラムの別の" -"場所で、原因を特定しにくいバグとして検出されることになるでしょう。" +"``strict=True`` を指定しないと、イテラブルの長さが異なる原因となるバグが表面" +"化せず、\n" +"プログラムの別の場所で発見しにくいバグとして現れる場合があります。" #: ../../builtins/functions.rst:2303 msgid "" @@ -4213,12 +4206,11 @@ msgstr "" "``n`` 回呼び出した結果となるよう、 *同じ* イテレータを ``n`` 回繰り返します。" "これは入力を長さ n のチャンクに分割する効果があります。" -#: ../../builtins/functions.rst:2318 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -":func:`zip` に続けて ``*`` 演算子を使うと、zip したリストを元に戻せます::" +":func:`zip` と ``*`` 演算子を組み合わせると、zip したリストを元に戻せます::" #: ../../builtins/functions.rst:2321 msgid "" @@ -4286,7 +4278,6 @@ msgstr "" "使われず、 *globals* は :keyword:`import` 文のパッケージコンテキストを決定す" "るためにのみ使われます。" -#: ../../builtins/functions.rst:2360 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -4294,10 +4285,12 @@ msgid "" "directory of the module calling :func:`__import__` (see :pep:`328` for the " "details)." msgstr "" -"*level* は絶対と相対どちらのインポートを使うかを指定します。 ``0`` (デフォル" -"ト) は絶対インポートのみ実行します。正の *level* の値は、 :func:`__import__` " -"を呼び出したディレクトリから検索対象となる親ディレクトリの数を示します (詳細" -"は :pep:`328` を参照してください)。" +"*level* は、絶対インポートと相対インポートのどちらを使うかを指定します。\n" +"``0`` (デフォルト) は、絶対インポートだけを行うことを意味します。\n" +"正の *level* は、:func:`__import__` を呼び出すモジュールのディレクトリを基準" +"に、\n" +"検索対象となる親ディレクトリの数を示します (詳細は :pep:`328` を参照してくだ" +"さい)。" #: ../../builtins/functions.rst:2366 msgid "" diff --git a/builtins/stdtypes.po b/builtins/stdtypes.po index 6a37a2c5a..354915e20 100644 --- a/builtins/stdtypes.po +++ b/builtins/stdtypes.po @@ -53,7 +53,6 @@ msgstr "" "インプレースに足し、引き、または並べ替えて、特定の要素を返さないメソッドは、" "コレクション自身ではなく ``None`` を返します。" -#: ../../builtins/stdtypes.rst:22 msgid "" "Some operations are supported by several object types; in particular, " "practically all objects can be compared for equality, tested for truth " @@ -61,10 +60,12 @@ msgid "" "slightly different :func:`str` function). The latter function is implicitly " "used when an object is written by the :func:`print` function." msgstr "" -"演算には、複数の型でサポートされているものがあります; 特に、ほぼ全てのオブ" -"ジェクトは、等価比較でき、真理値を判定でき、 (:func:`repr` 関数や、わずかに異" -"なる :func:`str` 関数によって) 文字列に変換できます。オブジェクトが :func:" -"`print` 関数で印字されるとき、文字列に変換する関数が暗黙に使われます。" +"いくつかの演算は、複数のオブジェクト型でサポートされています。\n" +"特に、ほぼすべてのオブジェクトでは、等価性の比較、真理値の判定、文字列への変" +"換ができます (文字列への変換には :func:`repr` 関数や、それとは少し異なる :" +"func:`str` 関数を使います)。\n" +":func:`print` 関数でオブジェクトを出力する際には、後者の関数が暗黙的に使われ" +"ます。" #: ../../builtins/stdtypes.rst:32 msgid "Truth Value Testing" @@ -455,13 +456,12 @@ msgid "" "mathematical formula, for example::" msgstr "" -#: ../../builtins/stdtypes.rst:282 msgid "" "x + complex(u, v) = complex(x + u, v)\n" "x * complex(u, v) = complex(x * u, x * v)" msgstr "" -"x + complex(u, v) = complex(x + u, v)x * complex(u, v) = complex(x * u, x * " -"v)" +"x + complex(u, v) = complex(x + u, v)\n" +"x * complex(u, v) = complex(x * u, x * v)" #: ../../builtins/stdtypes.rst:285 msgid "" @@ -779,15 +779,14 @@ msgstr "" msgid "Bitwise Operations on Integer Types" msgstr "整数型におけるビット単位演算" -#: ../../builtins/stdtypes.rst:421 msgid "" "Bitwise operations only make sense for integers. The result of bitwise " "operations is calculated as though carried out in two's complement with an " "infinite number of sign bits." msgstr "" -"ビット単位演算は整数についてのみ意味を持ちます。\n" -"ビット単位演算の結果は、あたかも両方の値の先頭を無限個の符号ビットで埋めたも" -"のに対して計算したかのような値になります。" +"ビット単位演算は、整数についてのみ意味を持ちます。\n" +"その結果は、符号ビットを無限個持つ2の補数表現で演算した場合と同じになるよう計" +"算されます。" #: ../../builtins/stdtypes.rst:425 msgid "" @@ -913,14 +912,18 @@ msgid "" msgstr "" "整数を、符号と先頭の 0 は除いて二進法で表すために必要なビットの数を返します::" -#: ../../builtins/stdtypes.rst:479 msgid "" ">>> n = -37\n" ">>> bin(n)\n" "'-0b100101'\n" ">>> n.bit_length()\n" "6" -msgstr ">>> n = -37>>> bin(n)'-0b100101'>>> n.bit_length()6" +msgstr "" +">>> n = -37\n" +">>> bin(n)\n" +"'-0b100101'\n" +">>> n.bit_length()\n" +"6" #: ../../builtins/stdtypes.rst:485 msgid "" @@ -956,7 +959,6 @@ msgstr "" "整数の絶対値の二進数表現における 1 の数を返します。これは population count と" "しても知られています。 例::" -#: ../../builtins/stdtypes.rst:506 msgid "" ">>> n = 19\n" ">>> bin(n)\n" @@ -965,7 +967,14 @@ msgid "" "3\n" ">>> (-n).bit_count()\n" "3" -msgstr ">>> n = 19>>> bin(n)'0b10011'>>> n.bit_count()3>>> (-n).bit_count()3" +msgstr "" +">>> n = 19\n" +">>> bin(n)\n" +"'0b10011'\n" +">>> n.bit_count()\n" +"3\n" +">>> (-n).bit_count()\n" +"3" #: ../../builtins/stdtypes.rst:516 msgid "" @@ -1176,15 +1185,17 @@ msgstr "" "浮動小数点数インスタンスが有限の整数値なら ``True`` を、そうでなければ " "``False`` を返します::" -#: ../../builtins/stdtypes.rst:673 msgid "" ">>> (-2.0).is_integer()\n" "True\n" ">>> (3.2).is_integer()\n" "False" -msgstr ">>> (-2.0).is_integer()True>>> (3.2).is_integer()False" +msgstr "" +">>> (-2.0).is_integer()\n" +"True\n" +">>> (3.2).is_integer()\n" +"False" -#: ../../builtins/stdtypes.rst:678 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -1193,11 +1204,11 @@ msgid "" "of floating-point numbers. This can be useful when debugging, and in " "numerical work." msgstr "" -"16 進表記の文字列へ、または、 16 進表記からの変換をサポートする二つのメソッド" -"があります。 Python の浮動小数点数は内部的には2進数で保持されるので、浮動小数" -"点数の *10進数* へまたは *10進数* からの変換には若干の丸め誤差があります。そ" -"れに対し、16 進表記では、浮動小数点数を正確に表現できます。これはデバッグのと" -"きや、数学的な用途 (numerical work) に便利でしょう。" +"16進文字列との相互変換をサポートするメソッドが二つあります。\n" +"Python の浮動小数点数は内部では2進数として格納されるため、浮動小数点数と *10" +"進文字列* との相互変換では通常、小さな丸め誤差が生じます。\n" +"一方、16進文字列では浮動小数点数を正確に表現したり指定したりできます。\n" +"これはデバッグや数値計算に役立つことがあります。" #: ../../builtins/stdtypes.rst:689 msgid "" @@ -1257,11 +1268,12 @@ msgstr "" "えます。例えば、16 進文字列 ``0x3.a7p10`` は浮動小数点数 ``(3 + 10./16 + " "7./16**2) * 2.0**10`` すなわち ``3740.0`` を表します::" -#: ../../builtins/stdtypes.rst:728 msgid "" ">>> float.fromhex('0x3.a7p10')\n" "3740.0" -msgstr ">>> float.fromhex('0x3.a7p10')3740.0" +msgstr "" +">>> float.fromhex('0x3.a7p10')\n" +"3740.0" #: ../../builtins/stdtypes.rst:732 msgid "" @@ -1271,11 +1283,12 @@ msgstr "" "逆変換を ``3740.0`` に適用すると、同じ数を表す異なる 16 進文字列表現を返しま" "す::" -#: ../../builtins/stdtypes.rst:735 msgid "" ">>> float.hex(3740.0)\n" "'0x1.d380000000000p+11'" -msgstr ">>> float.hex(3740.0)'0x1.d380000000000p+11'" +msgstr "" +">>> float.hex(3740.0)\n" +"'0x1.d380000000000p+11'" #: ../../builtins/stdtypes.rst:740 msgid "Additional Methods on Complex" @@ -1403,15 +1416,14 @@ msgstr "" "``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))`` に収ま" "ります。再び、結果が ``-1`` なら、 ``-2`` で置き換えられます。" -#: ../../builtins/stdtypes.rst:808 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " "the built-in hash, for computing the hash of a rational number, :class:" "`float`, or :class:`complex`::" msgstr "" -"上述の規則をわかりやすくするため、有理数 :class:`float` や、 :class:" -"`complex` のハッシュを計算する組み込みのハッシュと等価な Python コードの例を" -"挙げます::" +"上の規則を明確にするため、有理数、:class:`float`、:class:`complex` のハッシュ" +"を計算する Python コードの例を示します。\n" +"このコードは組み込みのハッシュ計算と等価です::" #: ../../builtins/stdtypes.rst:813 msgid "" @@ -2157,23 +2169,25 @@ msgstr "" "class:`str`, :class:`bytes`, :class:`bytearray` のような) 特殊なシーケンスで" "は部分シーケンス判定にも使われます::" -#: ../../builtins/stdtypes.rst:1341 msgid "" ">>> \"gg\" in \"eggs\"\n" "True" -msgstr ">>> \"gg\" in \"eggs\"True" +msgstr "" +">>> \"gg\" in \"eggs\"\n" +"True" -#: ../../builtins/stdtypes.rst:1345 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " "not copied; they are referenced multiple times. This often haunts new " "Python programmers; consider::" msgstr "" -"``0`` 未満の値 *n* は ``0`` として扱われます (これは *s* と同じ型の空のシーケ" -"ンスを表します)。シーケンス *s* の要素はコピーされないので注意してください; " -"コピーではなく要素に対する参照カウントが増えます。これは Python に慣れていな" -"いプログラマをよく悩ませます。例えば以下のコードを考えます:" +"``0`` 未満の *n* は ``0`` として扱われます (結果は *s* と同じ型の空のシーケン" +"スになります)。\n" +"シーケンス *s* の要素はコピーされず、同じ要素が複数回参照されることに注意して" +"ください。\n" +"これは Python に慣れていないプログラマをよく悩ませます。\n" +"次のコードを考えてみてください::" #: ../../builtins/stdtypes.rst:1350 msgid "" @@ -2501,18 +2515,16 @@ msgstr "" "*k* が ``1`` と等しくない場合、 *t* はそれが入れ替えるスライスと同じ長さでな" "ければなりません。" -#: ../../builtins/stdtypes.rst:1549 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " "the sequence are not copied; they are referenced multiple times, as " "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -"値 *n* は整数であるか、:meth:`~object.__index__` を実装したオブジェクトで" -"す。 *n* の値がゼロまたは負数の場合、シーケンスをクリアします。:ref:" -"`typesseq-common` で ``s * n`` について説明したとおり、シーケンスの要素はコ" -"ピーされないので注意してください; コピーではなく要素に対する参照カウントが増" -"えます。" +"*n* は整数または :meth:`~object.__index__` を実装したオブジェクトです。\n" +"*n* がゼロまたは負の値の場合、シーケンスを空にします。\n" +":ref:`typesseq-common` の ``s * n`` の説明と同様に、シーケンスの要素はコピー" +"されず、同じ要素が複数回参照されます。" #: ../../builtins/stdtypes.rst:1555 msgid "Mutable Sequence Methods" @@ -2727,17 +2739,17 @@ msgid "" msgstr "" "ソートの例と簡単なチュートリアルは :ref:`sortinghowto` を参照して下さい。" -#: ../../builtins/stdtypes.rst:1725 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " "list appear empty for the duration, and raises :exc:`ValueError` if it can " "detect that the list has been mutated during a sort." msgstr "" -"リストがソートされている間、または変更しようとする試みの影響中、あるいは検査" -"中でさえ、リストは未定義です。Python の C 実装では、それらが続いている間、リ" -"ストは空として出力され、リストがソート中に変更されていることを検知できたら :" -"exc:`ValueError` を送出します。" +"リストのソート中にそのリストを変更したり、内容を調べたりしようとした場合の動" +"作は未定義です。\n" +"Python の C 実装では、ソート中はリストが空に見えるようにし、\n" +"ソート中にリストが変更されたことを検出できた場合は :exc:`ValueError` を送出し" +"ます。" #: ../../builtins/stdtypes.rst:1732 msgid "" @@ -3492,14 +3504,13 @@ msgstr "" "指定を行うと長さ 1 の文字列を作成します。つまり、空でない文字列 *s* に対し、" "``s[0] == s[0:1]`` です。" -#: ../../builtins/stdtypes.rst:2047 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -"ミュータブルな文字列型もありませんが、ミュータブルな断片から効率よく文字列を" -"構成するのに :meth:`str.join` や :class:`io.StringIO` が使えます。" +"ミュータブルな文字列型もありませんが、複数の断片から効率よく文字列を構築する" +"には :meth:`str.join` や :class:`io.StringIO` を使えます。" #: ../../builtins/stdtypes.rst:2051 msgid "" @@ -3888,7 +3899,6 @@ msgstr "" "書式指定のオプションについては、書式指定文字列を規定する :ref:" "`formatstrings` を参照してください。" -#: ../../builtins/stdtypes.rst:2324 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -3898,21 +3908,22 @@ msgid "" "and the ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. " "This temporary change affects other threads." msgstr "" -"数値 (:class:`int`, :class:`float`, :class:`complex`, :class:`decimal." -"Decimal` とサブクラス) を ``n`` の整数表現型 (例: ``'{:n}'.format(1234)``) で" -"フォーマットするとき、``LC_CTYPE`` ロケールと ``LC_NUMERIC`` ロケールの一方ま" -"たは両方が 1 バイトより長い非 ASCII 文字であると同時に異なる値である場合、こ" -"の関数は :c:func:`localeconv` の ``decimal_point`` と ``thousands_sep`` " -"フィールドを読み取るため一時的に ``LC_CTYPE`` ロケールに ``LC_NUMERIC`` のロ" -"ケール値を設定します。この一時的な変更は他のスレッドの動作に影響します。" +"数値 (:class:`int`、:class:`float`、:class:`complex`、:class:`decimal." +"Decimal` とそのサブクラス) を ``n`` 型で書式化する場合 (例: ``'{:n}'." +"format(1234)``)、\n" +":c:func:`localeconv` の ``decimal_point`` または ``thousands_sep`` フィールド" +"が非 ASCII 文字を含むか1バイトより長く、\n" +"かつ ``LC_NUMERIC`` ロケールが ``LC_CTYPE`` ロケールと異なるときは、\n" +"それらのフィールドをデコードするために、一時的に ``LC_CTYPE`` ロケールを " +"``LC_NUMERIC`` ロケールに設定します。\n" +"この一時的な変更は他のスレッドにも影響します。" -#: ../../builtins/stdtypes.rst:2333 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -"数値を ``n`` の整数表現型でフォーマットするとき、この関数は一時的に " -"``LC_CTYPE`` ロケールに ``LC_NUMERIC`` のロケール値を設定する場合があります。" +"数値を ``n`` 型で書式化するとき、一時的に ``LC_CTYPE`` ロケールを " +"``LC_NUMERIC`` ロケールに設定する場合があります。" #: ../../builtins/stdtypes.rst:2341 msgid "" @@ -4708,9 +4719,8 @@ msgstr "復帰" msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../builtins/stdtypes.rst:2983 msgid "Carriage Return + Line Feed" -msgstr "改行 + 復帰" +msgstr "復帰 + 改行" #: ../../builtins/stdtypes.rst:2985 msgid "``\\v`` or ``\\x0b``" @@ -4800,14 +4810,14 @@ msgid "" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgstr "" -#: ../../builtins/stdtypes.rst:3013 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -":meth:`~str.split` とは違って、デリミタ文字列 *sep* が与えられたとき、このメ" -"ソッドは空文字列に空リストを返し、終末の改行は結果に行を追加しません::" +"区切り文字列 *sep* を指定した :meth:`~str.split` とは異なり、\n" +"このメソッドは空文字列に対して空のリストを返し、末尾に改行があっても余分な行" +"を追加しません::" #: ../../builtins/stdtypes.rst:3017 msgid "" @@ -5467,13 +5477,12 @@ msgstr "" msgid "``' '``" msgstr "``' '``" -#: ../../builtins/stdtypes.rst:3471 ../../builtins/stdtypes.rst:4773 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -"(スペース) 符号付きの変換で正の数の場合、前に一つスペースを空けます (そうでな" -"い場合は空文字になります) 。" +"(スペース) 符号付き変換で生成された正の数 (または空文字列) の前に、空白を一つ" +"置きます。" #: ../../builtins/stdtypes.rst:3474 ../../builtins/stdtypes.rst:4776 msgid "``'+'``" @@ -5581,25 +5590,25 @@ msgstr "``'F'``" msgid "``'g'``" msgstr "``'g'``" -#: ../../builtins/stdtypes.rst:3506 ../../builtins/stdtypes.rst:4808 msgid "" "Floating-point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -"浮動小数点数。指数部が -4 以上または精度以下の場合には小文字指数表記、それ以" -"外の場合には10進表記。" +"浮動小数点数の書式。\n" +"指数が -4 未満または指定精度以上の場合は小文字の指数表記を使い、それ以外は10" +"進表記を使います。" #: ../../builtins/stdtypes.rst:3510 ../../builtins/stdtypes.rst:4812 msgid "``'G'``" msgstr "``'G'``" -#: ../../builtins/stdtypes.rst:3510 ../../builtins/stdtypes.rst:4812 msgid "" "Floating-point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -"浮動小数点数。指数部が -4 以上または精度以下の場合には大文字指数表記、それ以" -"外の場合には10進表記。" +"浮動小数点数の書式。\n" +"指数が -4 未満または指定精度以上の場合は大文字の指数表記を使い、それ以外は10" +"進表記を使います。" #: ../../builtins/stdtypes.rst:3514 ../../builtins/stdtypes.rst:4816 msgid "``'c'``" @@ -5891,13 +5900,11 @@ msgstr "" "bytes オブジェクトをその 16 進表記に変換するための、反対向きの変換関数があり" "ます。" -#: ../../builtins/stdtypes.rst:3672 ../../builtins/stdtypes.rst:3763 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -"インスタンス内の 1 バイトにつき 2 つの 16 進数を含む、文字列オブジェクトを返" -"します。" +"インスタンス内の各バイトを2桁の16進数字で表した文字列オブジェクトを返します。" #: ../../builtins/stdtypes.rst:3678 msgid "" @@ -6137,7 +6144,6 @@ msgstr "" msgid "Bytes and Bytearray Operations" msgstr "bytes と bytearray の操作" -#: ../../builtins/stdtypes.rst:3856 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -6145,11 +6151,13 @@ msgid "" "can be freely mixed in operations without causing errors. However, the " "return type of the result may depend on the order of operands." msgstr "" -"bytes と bytearray は両方共 :ref:`一般のシーケンス操作 ` を" -"サポートしています。また、両方とも :term:`bytes-like object` をサポートしてい" -"る任意のオブジェクトを対象に操作することもできます。この柔軟性により bytes " -"と bytearray を自由に混ぜてもエラーを起こすことなく扱うことができます。ただ" -"し、操作の結果のオブジェクトはその操作の順序に依存することになります。" +"bytes オブジェクトと bytearray オブジェクトは、どちらも :ref:`共通のシーケン" +"ス演算 ` をサポートします。\n" +"同じ型のオペランドだけでなく、任意の :term:`bytes-like object` とも相互に演算" +"できます。\n" +"この柔軟性により、これらの型を演算で自由に混在させてもエラーにはなりませ" +"ん。\n" +"ただし、結果の型はオペランドの順序によって異なる場合があります。" #: ../../builtins/stdtypes.rst:3864 msgid "" @@ -6680,7 +6688,6 @@ msgstr "" "す)。 *maxsplit* が指定されていないか ``-1`` のとき、分割の回数に制限はありま" "せん (可能なだけ分割されます)。" -#: ../../builtins/stdtypes.rst:4287 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -6690,12 +6697,13 @@ msgid "" "the type of object being split. The *sep* argument may be any :term:`bytes-" "like object`." msgstr "" -"*sep* が与えられた場合、連続した区切り用バイト値はまとめられず、空の部分シー" -"ケンスを区切っていると判断されます(例えば ``b'1,,2'.split(b',')`` は " -"``[b'1', b'', b'2']`` を返します)。引数 *sep* は複数バイトのシーケンスを1つの" -"区切り文字にもできます。空のシーケンスを分割すると、分割するオブジェクトの型" -"によって ``[b'']`` または ``[bytearray(b'')]`` が返ります。引数 *sep* には、" -"あらゆる :term:`bytes-like object` を指定できます。" +"*sep* を指定した場合、連続する区切りは一つにまとめられず、空の部分シーケンス" +"を区切るものとみなされます (例えば ``b'1,,2'.split(b',')`` は ``[b'1', b'', " +"b'2']`` を返します)。\n" +"*sep* には、複数バイトのシーケンスを一つの区切りとして指定できます。\n" +"区切りを指定して空のシーケンスを分割すると、分割するオブジェクトの型に応じて " +"``[b'']`` または ``[bytearray(b'')]`` が返されます。\n" +"*sep* には、任意の :term:`bytes-like object` を指定できます。" #: ../../builtins/stdtypes.rst:4297 msgid "" @@ -6994,15 +7002,14 @@ msgid "" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgstr "" -#: ../../builtins/stdtypes.rst:4554 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -":meth:`~bytes.split` とは違って、空シーケンスに対して区切り *sep* を与えて呼" -"び出すと空のリストを返します。またシーケンス末尾に改行コードがある場合、(訳" -"註: その後ろに空行があるとは判断せず)余分な行を生成することはありません::" +"区切り文字列 *sep* を指定した :meth:`~bytes.split` とは異なり、\n" +"このメソッドは空のシーケンスに対して空のリストを返し、末尾に改行があっても余" +"分な行を追加しません::" #: ../../builtins/stdtypes.rst:4558 msgid "" @@ -7285,13 +7292,12 @@ msgid "" "equal to the number of elements in the view." msgstr "" -#: ../../builtins/stdtypes.rst:4910 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -"``view.ndim == 0`` で ``len(view)`` の場合、1の代わりに :exc:`TypeError` を返" -"すようになりました。" +"``view.ndim == 0`` の場合、``len(view)`` は 1 を返す代わりに :exc:" +"`TypeError` を送出するようになりました。" #: ../../builtins/stdtypes.rst:4913 msgid "" @@ -7555,11 +7561,11 @@ msgstr "" "連続なデータに対するビューの場合、データはまず C のデータ並びに変換されま" "す。 *order=None* は *order='C'* と同じです。" -#: ../../builtins/stdtypes.rst:5073 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" -msgstr "バッファ中の各バイトを 2 つの 16 進数で表した文字列を返します::" +msgstr "" +"バッファ内の各バイトを2桁の16進数字で表した文字列オブジェクトを返します。 ::" #: ../../builtins/stdtypes.rst:5076 msgid "" @@ -7675,7 +7681,6 @@ msgid "" "ValueError: operation forbidden on released memoryview object" msgstr "" -#: ../../builtins/stdtypes.rst:5159 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -7683,24 +7688,26 @@ msgid "" "is not copied. Supported casts are 1D -> C-:term:`contiguous` and C-" "contiguous -> 1D." msgstr "" -"memoryview を新しいフォーマットか shape にキャストします。 *shape* はデフォル" -"トで ``[byte_length//new_itemsize]`` で、 1次元配列になります。戻り値は " -"memoryview ですが、バッファー自体はコピーされません。サポートされている変換" -"は 1次元配列 -> C言語型の連続配列 と C言語型の連続配列 -> 1次元配列 です(参" -"考: :term:`contiguous`)。" +"memoryview を新しいフォーマットまたは形状にキャストします。\n" +"*shape* のデフォルト値は ``[byte_length//new_itemsize]`` で、結果のビューは1" +"次元になります。\n" +"返り値は新しい memoryview ですが、バッファ自体はコピーされません。\n" +"サポートされるキャストは、1次元から C-:term:`連続 ` への変換と、" +"C-連続から1次元への変換です。" -#: ../../builtins/stdtypes.rst:5165 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length. " "Note that all byte lengths may depend on the operating system." msgstr "" -"キャスト後のフォーマットは単一要素のネイティブフォーマットに限定され、 :mod:" -"`struct` の文法で指定します。利用可能なフォーマットのひとつはバイトフォーマッ" -"ト ('B', 'b' または 'c') です。キャスト後のバイト長は元の長さと同じでなけれ" -"ばなりません。全てのフォーマットのバイト長は、オペレーティングシステムに依存" -"することに注意してください。" +"変換先のフォーマットは、:mod:`struct` の構文による単一要素のネイティブフォー" +"マットに限定されます。\n" +"変換元と変換先のフォーマットの少なくとも一方は、バイトフォーマット " +"('B'、'b'、'c') でなければなりません。\n" +"結果のバイト長は元の長さと同じでなければなりません。\n" +"各フォーマットのバイト長はオペレーティングシステムによって異なる場合があるこ" +"とに注意してください。" #: ../../builtins/stdtypes.rst:5171 msgid "Cast 1D/long to 1D/unsigned bytes::" @@ -7988,17 +7995,18 @@ msgid "" "various set operations." msgstr "" -#: ../../builtins/stdtypes.rst:5404 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " "position or order of insertion. Accordingly, sets do not support indexing, " "slicing, or other sequence-like behavior." msgstr "" -"集合は、他のコレクションと同様、 ``x in set``, ``len(set)``, ``for x in " -"set`` をサポートします。コレクションには順序がないので、集合は挿入の順序や要" -"素の位置を記録しません。従って、集合はインデクシング、スライシング、その他の" -"シーケンス的な振舞いをサポートしません。" +"集合は他のコレクションと同様に、``x in set``、``len(set)``、``for x in set`` " +"をサポートします。\n" +"集合は順序を持たないコレクションなので、要素の位置や挿入順序を記録しませ" +"ん。\n" +"そのため、インデックス指定やスライスなど、シーケンスのような動作はサポートし" +"ません。" #: ../../builtins/stdtypes.rst:5409 msgid "" @@ -8305,7 +8313,6 @@ msgid "" "operations." msgstr "" -#: ../../builtins/stdtypes.rst:5630 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -8313,12 +8320,12 @@ msgid "" "may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, " "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -"辞書のキーには、 *ほぼ* どんな値も使うことができます。\n" -"キーとして使えないのは、 :term:`hashable` (ハッシュ可能) でない値、すなわちリ" -"ストや辞書のようなミュータブルな型 (内包する値ではなくオブジェクト自体が同一" -"であるかによって比較が行われるような型)です。\n" -"比較した際に等しいとみなされる値 (例えば ``1`` と ``1.0`` と ``True``) は、ど" -"れを使っても同じエントリーに関連付けられます。" +"辞書のキーには、*ほぼ* 任意の値を使えます。\n" +":term:`ハッシュ可能 ` でない値、すなわちリスト、辞書、その他の" +"ミュータブルな型 (オブジェクトの同一性ではなく値によって比較されるもの) を含" +"む値は、キーとして使えません。\n" +"比較すると等しい値 (例えば ``1``、``1.0``、``True``) は、どれを使っても同じ辞" +"書の項目にアクセスできます。" #: ../../builtins/stdtypes.rst:5641 msgid "" @@ -8599,13 +8606,12 @@ msgstr "" "*default* を返します。 *default* が与えられず、かつ *key* が辞書に存在しなけ" "れば :exc:`KeyError` を送出します。" -#: ../../builtins/stdtypes.rst:5817 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -"任意の ``(key, value)`` 対を辞書から消去して返します。\n" -"対は :abbr:`LIFO (後入れ、先出し)` の順序で返却されます。" +"辞書から ``(key, value)`` 対を削除し、その対を返します。\n" +"対は :abbr:`LIFO (後入れ、先出し)` の順序で返されます。" #: ../../builtins/stdtypes.rst:5820 msgid "" @@ -8683,14 +8689,14 @@ msgid "" "False" msgstr "" -#: ../../builtins/stdtypes.rst:5869 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" "*d* と *other* のキーと値を統合した新しい辞書を作成します。\n" -"*d* と *other* のキーに重複がある場合は、 *other* の方の値が優先されます。" +"*d* と *other* は両方とも辞書でなければなりません。\n" +"*d* と *other* でキーが重複する場合は、*other* の値が優先されます。" #: ../../builtins/stdtypes.rst:5877 msgid "" @@ -8804,13 +8810,12 @@ msgstr "" "*x* が元の辞書のキー、値、または項目 (項目の場合、 *x* は ``(key, value)`` タ" "プルです) にあるとき ``True`` を返します。" -#: ../../builtins/stdtypes.rst:5949 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -"辞書のキーもしくは値、項目の順序を逆にしたイテレーターを返します。\n" -"戻り値のビューは、挿入された順とは逆の順でイテレートします。" +"辞書のキー、値、または項目を逆順にたどるイテレータを返します。\n" +"ビューは挿入順序とは逆の順序で反復されます。" #: ../../builtins/stdtypes.rst:5952 msgid "Dictionary views are now reversible." @@ -9335,13 +9340,12 @@ msgid "" "This is true for :ref:`user-defined generics ` also." msgstr "" -#: ../../builtins/stdtypes.rst:6257 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -":func:`repr` や :func:`str` のジェネリック型に対する呼び出しは、パラメータ型" -"を表示します::" +"パラメータ付きジェネリック型に :func:`repr` や :func:`str` を呼び出すと、パラ" +"メータを含む型が表示されます::" #: ../../builtins/stdtypes.rst:6259 msgid "" @@ -9645,14 +9649,14 @@ msgid "" "" msgstr "" -#: ../../builtins/stdtypes.rst:6364 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" "この属性は、ジェネリッククラスの元の :meth:`~object.__class_getitem__` に渡さ" -"れた :class:`tuple` です (長さが1の場合もあります)::" +"れたジェネリック型を要素とする :class:`tuple` です (長さが1の場合もありま" +"す)::" #: ../../builtins/stdtypes.rst:6368 msgid "" @@ -10096,15 +10100,14 @@ msgstr "" "の :attr:`~function.__code__` 属性として取り出せます。 :mod:`code` モジュール" "も参照してください。" -#: ../../builtins/stdtypes.rst:6658 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " "``\"__code__\"``." msgstr "" -":attr:`~function.__code__` へのアクセスは ``object.__getattr__`` に ``obj`` " -"と ``\"__code__\"`` を渡して行いますが、 :ref:`監査イベント ` を送" -"出します。" +":attr:`~function.__code__` にアクセスすると、実引数 ``obj`` と " +"``\"__code__\"`` を伴う :ref:`監査イベント ` ``object." +"__getattr__`` が送出されます。" #: ../../builtins/stdtypes.rst:6665 msgid "" @@ -10313,7 +10316,6 @@ msgstr "" "に *のみ* 適用されます。16進数、8進数と2進数は制限がありません。上限値は設定" "できます。" -#: ../../builtins/stdtypes.rst:6811 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -10322,13 +10324,13 @@ msgid "" "algorithms for base 10 have sub-quadratic complexity. Converting a large " "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -"CPython の :class:`int` 型は、任意の長さの数をバイナリ形式で保存したものです " -"(一般に \"bignum\" または多倍長整数として知られています)。基数が2のべき乗でな" -"い限り、線形の時間で文字列をバイナリ整数に、あるいはバイナリ整数を文字列に変" -"換できるアルゴリズムは存在しません。10進数に対するアルゴリズムでは、最もよく" -"知られているものでさえ、2次に近い (sub-quadratic) 複雑さになります。高速な " -"CPU でも、 ``int('1' * 500_000)`` のような大きな数の変換は1秒以上かかる可能性" -"があります。" +"CPython の :class:`int` 型は、任意の長さの数を2進形式で格納します (一般に" +"「bignum」と呼ばれます)。\n" +"基数が2のべき乗でない限り、文字列と2進整数を線形時間で相互変換できるアルゴリ" +"ズムは存在しません。\n" +"10進数に対する既知の最良のアルゴリズムでも、計算量は二次未満です。\n" +"``int('1' * 500_000)`` のような大きな値の変換には、高速な CPU でも1秒を超える" +"時間が掛かる場合があります。" #: ../../builtins/stdtypes.rst:6818 msgid "" @@ -10550,7 +10552,6 @@ msgstr "" ":data:`sys.int_info.str_digits_check_threshold ` は上限値として" "指定できる最低の値です(0の場合は無効になります)。" -#: ../../builtins/stdtypes.rst:6922 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -10561,14 +10562,15 @@ msgid "" "exist for the code. A workaround for source that contains such large " "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -"小さな上限値を設定することで、問題が起きる *可能性があります* 。まれではあり" -"ますが、ソースコード内で閾値を超える定数が10進数の整数として存在するコードが" -"存在します。値に制限をつけることの帰結は、10進数の整数リテラルで制限を超える" -"長さを持つ定数を含むコードのパース時、すなわち通常は起動時、モジュールのイン" -"ポート時、またはインストール時など、そのコードのための ``.pyc`` ファイルが作" -"られるまでのどこかの時点でのエラーです。大きな定数を含むソースコードに対する" -"回避策は、その定数を、 ``0x`` を使って値の制限を持たない16進数の値に変換する" -"ことです。" +"小さな上限値を設定すると、問題が起きる *可能性があります* 。\n" +"まれですが、ソース内に最小の閾値を超える10進整数定数を含むコードが存在しま" +"す。\n" +"上限値を設定すると、その上限より長い10進整数リテラルを含む Python ソースコー" +"ドのパース時にエラーが発生します。\n" +"これは、通常は起動時やインポート時、場合によってはインストール時など、その" +"コードに対応する最新の ``.pyc`` がまだ存在しないときに起こります。\n" +"このような大きな定数を含むソースでは、制限のない ``0x`` 形式の16進数へ定数を" +"変換することで回避できます。" #: ../../builtins/stdtypes.rst:6931 msgid "" @@ -10641,11 +10643,10 @@ msgstr "" "この結果として、リスト ``[1, 2]`` は ``[1.0, 2.0]`` と等しいと見なされます。" "タプルの場合も同様です。" -#: ../../builtins/stdtypes.rst:6967 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -"パーザが演算対象の型を識別できるようにするために、このような優先順位でなけれ" -"ばならないのです。" +"パーザはオペランドの型を判別できないため、これらの演算子の優先順位は対応する" +"数値演算子と同じでなければなりません。" #: ../../builtins/stdtypes.rst:6969 msgid "" @@ -11238,25 +11239,20 @@ msgstr "" msgid "! f-string" msgstr "" -#: ../../builtins/stdtypes.rst:3202 msgid "f-strings" -msgstr "" +msgstr "f-strings" -#: ../../builtins/stdtypes.rst:3202 msgid "fstring" -msgstr "" +msgstr "fstring" -#: ../../builtins/stdtypes.rst:3202 msgid "interpolated string literal" -msgstr "" +msgstr "補間文字列リテラル" -#: ../../builtins/stdtypes.rst:3202 msgid "formatted literal" -msgstr "" +msgstr "フォーマット済みリテラル" -#: ../../builtins/stdtypes.rst:3202 msgid "interpolated literal" -msgstr "" +msgstr "補間リテラル" #: ../../builtins/stdtypes.rst:3202 msgid "{} (curly brackets)" diff --git a/c-api/buffer.po b/c-api/buffer.po index f0a419d66..92335d507 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -995,10 +995,8 @@ msgstr "" msgid "contiguous" msgstr "contiguous" -#: ../../c-api/buffer.rst:302 msgid "C-contiguous" -msgstr "" +msgstr "C-contiguous" -#: ../../c-api/buffer.rst:302 msgid "Fortran contiguous" -msgstr "" +msgstr "Fortran contiguous" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 486584d60..105c157e8 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -345,11 +345,8 @@ msgid "" "``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:249 ../../c-api/exceptions.rst:257 -#: ../../c-api/exceptions.rst:268 ../../c-api/exceptions.rst:278 -#: ../../c-api/exceptions.rst:286 ../../c-api/exceptions.rst:296 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../c-api/exceptions.rst:254 msgid "" diff --git a/c-api/interp-lifecycle.po b/c-api/interp-lifecycle.po index 0c21d091f..9fc864b78 100644 --- a/c-api/interp-lifecycle.po +++ b/c-api/interp-lifecycle.po @@ -433,9 +433,8 @@ msgstr "" msgid "See :pep:`529` for more details." msgstr "より詳しくは :pep:`529` を参照してください。" -#: ../../c-api/interp-lifecycle.rst:239 ../../c-api/interp-lifecycle.rst:258 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../c-api/interp-lifecycle.rst:246 msgid "" diff --git a/contents.po b/contents.po index b3ef37424..9180df324 100644 --- a/contents.po +++ b/contents.po @@ -22,6 +22,5 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../contents.rst:3 msgid "Python Documentation contents" -msgstr "Python Documentation contents" +msgstr "Python ドキュメントの目次" diff --git a/glossary.po b/glossary.po index 7d145cf2d..2af7db6e5 100644 --- a/glossary.po +++ b/glossary.po @@ -59,10 +59,11 @@ msgstr "" "コレーターの後に、コードを入力する際に表示されるデフォルトの Python プロンプ" "トです。" -#: ../../glossary.rst:26 msgid "" "The three dots form of the :ref:`Ellipsis ` object." msgstr "" +":ref:`Ellipsis ` オブジェクトの、3 つのドットを使った" +"表記。" #: ../../glossary.rst:27 msgid "abstract base class" @@ -93,11 +94,9 @@ msgstr "" "インダ及びローダーです。 :mod:`abc` モジュールを利用して独自の ABC を作成でき" "ます。" -#: ../../glossary.rst:40 msgid "annotate function" -msgstr "" +msgstr "annotate function" -#: ../../glossary.rst:42 msgid "" "A callable that can be called to retrieve the :term:`annotations " "` of an object. Annotate functions are usually :term:`functions " @@ -105,6 +104,11 @@ msgid "" "attribute of functions, classes, and modules. Annotate functions are a " "subset of :term:`evaluate functions `." msgstr "" +"(annotate 関数) オブジェクトの :term:`アノテーション ` を取得する" +"ために呼び出せる呼び出し可能オブジェクトです。\n" +"annotate 関数は通常、関数、クラス、モジュールの :attr:`~object.__annotate__` " +"属性として自動生成される :term:`関数 ` です。\n" +"annotate 関数は :term:`評価関数 ` の一種です。" #: ../../glossary.rst:47 msgid "annotation" @@ -119,13 +123,15 @@ msgstr "" "す。\n" "慣例により :term:`type hint` として使われています。" -#: ../../glossary.rst:53 msgid "" "Annotations of local variables cannot be accessed at runtime, but " "annotations of global variables, class attributes, and functions can be " "retrieved by calling :func:`annotationlib.get_annotations` on modules, " "classes, and functions, respectively." msgstr "" +"ローカル変数のアノテーションには実行時にアクセスできませんが、グローバル変" +"数、クラス属性、関数のアノテーションは、それぞれモジュール、クラス、関数に対" +"して :func:`annotationlib.get_annotations` を呼び出すことで取得できます。" #: ../../glossary.rst:58 msgid "" @@ -228,7 +234,6 @@ msgstr "" msgid "asynchronous generator" msgstr "asynchronous generator" -#: ../../glossary.rst:99 msgid "" "Informally used to mean either an :term:`asynchronous generator function` or " "an :term:`asynchronous generator iterator`, depending on context. The " @@ -236,18 +241,29 @@ msgid "" "generator iterator` are uncommon in practice; \"asynchronous generator\" " "alone is almost always sufficient." msgstr "" +"文脈に応じて、:term:`非同期ジェネレータ関数 ` または :term:`非同期ジェネレータイテレータ ` のどちらかを指すために非公式に使われる語です。\n" +"正式な用語である :term:`非同期ジェネレータ関数 ` と :term:`非同期ジェネレータイテレータ ` は、実際にはあまり使われません。\n" +"ほとんどの場合、「非同期ジェネレータ」だけで十分です。" -#: ../../glossary.rst:104 msgid "asynchronous generator function" -msgstr "" +msgstr "asynchronous generator function" -#: ../../glossary.rst:106 msgid "" "A function which returns an :term:`asynchronous generator iterator`. It " "looks like a coroutine function defined with :keyword:`async def` except " "that it contains :keyword:`yield` expressions for producing a series of " "values usable in an :keyword:`async for` loop. See :pep:`525`." msgstr "" +"(非同期ジェネレータ関数) :term:`非同期ジェネレータイテレータ ` を返す関数です。\n" +":keyword:`async def` で定義されたコルーチン関数に似ていますが、:keyword:" +"`async for` ループで使用できる一連の値を生成するための :keyword:`yield` 式を" +"含む点が異なります。\n" +":pep:`525` を参照してください。" #: ../../glossary.rst:111 msgid "" @@ -261,9 +277,10 @@ msgstr "" msgid "asynchronous generator iterator" msgstr "asynchronous generator iterator" -#: ../../glossary.rst:116 msgid "An object created by an :term:`asynchronous generator function`." msgstr "" +":term:`非同期ジェネレータ関数 ` が作成するオ" +"ブジェクトです。" #: ../../glossary.rst:118 msgid "" @@ -277,7 +294,6 @@ msgstr "" "ジェクトは、次の :keyword:`yield` 式まで非同期ジェネレータ関数の本体を実行し" "ます。" -#: ../../glossary.rst:123 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). " @@ -285,10 +301,11 @@ msgid "" "awaitable returned by :meth:`~object.__anext__`, it picks up where it left " "off. See :pep:`492` and :pep:`525`." msgstr "" -"各 :keyword:`yield` では一時的に処理を中断し、その実行状態 (ローカル変数や保" -"留中の try 文を含む) を記憶します。 *非同期ジェネレータイテレータ* が :meth:" -"`~object.__anext__` で返された他の awaitable で実際に再開する時には、その中断" -"箇所が選ばれます。 :pep:`492` および :pep:`525` を参照してください。" +"各 :keyword:`yield` は処理を一時的に中断し、実行状態(ローカル変数や保留中の " +"try 文を含む)を記憶します。\n" +":meth:`~object.__anext__` が返す別の awaitable によって *非同期ジェネレータイ" +"テレータ* の実行が実際に再開すると、中断した箇所から処理を続けます。\n" +":pep:`492` と :pep:`525` を参照してください。" #: ../../glossary.rst:128 msgid "asynchronous iterable" @@ -324,11 +341,9 @@ msgstr "" "例外を送出するまで、非同期イテレータの :meth:`~object.__anext__` メソッドが返" "す awaitable を解決します。 :pep:`492` で導入されました。" -#: ../../glossary.rst:140 msgid "atomic operation" -msgstr "" +msgstr "atomic operation" -#: ../../glossary.rst:142 msgid "" "An operation that appears to execute as a single, indivisible step: no other " "thread can observe it half-done, and its effects become visible all at " @@ -337,22 +352,32 @@ msgid "" "atomic). Atomicity is only guaranteed where explicitly documented. See " "also :term:`race condition` and :term:`data race`." msgstr "" +"(アトミック操作) 分割できない単一のステップとして実行されるように見える操作で" +"す。\n" +"ほかのスレッドから途中の状態は観測できず、その効果は一度に見えるようになりま" +"す。\n" +"Python は、高水準の文がアトミックであることを保証しません(たとえば、``x += " +"1`` は複数のバイトコード操作を実行し、アトミックではありません)。\n" +"アトミック性が保証されるのは、ドキュメントに明記されている場合だけです。\n" +":term:`競合状態 ` と :term:`データ競合 ` も参照し" +"てください。" -#: ../../glossary.rst:148 msgid "attached thread state" -msgstr "" +msgstr "attached thread state" -#: ../../glossary.rst:151 msgid "A :term:`thread state` that is active for the current OS thread." msgstr "" +"(アタッチされたスレッド状態) 現在の OS スレッドで有効な :term:`スレッド状態 " +"` です。" -#: ../../glossary.rst:153 msgid "" "When a :term:`thread state` is attached, the OS thread has access to the " "full Python C API and can safely invoke the bytecode interpreter." msgstr "" +":term:`スレッド状態 ` がアタッチされていると、OS スレッドは " +"Python C API の全機能にアクセスでき、バイトコードインタープリタを安全に呼び出" +"せます。" -#: ../../glossary.rst:157 msgid "" "Unless a function explicitly notes otherwise, attempting to call the C API " "without an attached thread state will result in a fatal error or undefined " @@ -360,8 +385,14 @@ msgid "" "user through the C API, or implicitly by the runtime, including during " "blocking C calls and by the bytecode interpreter in between calls." msgstr "" +"関数の説明に明示的な例外の記載がない限り、スレッド状態がアタッチされていない" +"状態で C API を呼び出そうとすると、致命的エラーまたは未定義の動作を引き起こし" +"ます。\n" +"スレッド状態は、利用者が C API を通じて明示的にアタッチしたりデタッチしたりで" +"きるほか、ランタイムが暗黙に行うこともあります。\n" +"後者には、ブロックする C 関数の呼び出し中に行う場合や、バイトコードインタープ" +"リタが呼び出しと呼び出しの間に行う場合が含まれます。" -#: ../../glossary.rst:164 msgid "" "On most builds of Python, having an attached thread state implies that the " "caller holds the :term:`GIL` for the current interpreter, so only one OS " @@ -370,6 +401,14 @@ msgid "" "hold an attached thread state, allowing for true parallelism of the bytecode " "interpreter." msgstr "" +"ほとんどの Python ビルドでは、スレッド状態がアタッチされていることは、呼び出" +"し元が現在のインタープリタの :term:`GIL ` を保持していることを意味しま" +"す。\n" +"そのため、ある時点でスレッド状態をアタッチできる OS スレッドは一つだけで" +"す。\n" +"Python の :term:`フリースレッドビルド ` では、複数のス" +"レッドがスレッド状態を同時にアタッチでき、バイトコードインタープリタの真の並" +"列実行が可能になります。" #: ../../glossary.rst:170 msgid "attribute" @@ -453,19 +492,21 @@ msgstr "" ":class:`str` オブジェクトの読み書きができるファイルオブジェクトについては、 :" "term:`text file` も参照してください。" -#: ../../glossary.rst:202 msgid "borrowed reference" -msgstr "" +msgstr "borrowed reference" -#: ../../glossary.rst:204 msgid "" "In Python's C API, a borrowed reference is a reference to an object, where " "the code using the object does not own the reference. It becomes a dangling " "pointer if the object is destroyed. For example, a garbage collection can " "remove the last :term:`strong reference` to the object and so destroy it." msgstr "" +"(借用参照) Python の C API で、オブジェクトを使うコードが所有していない、その" +"オブジェクトへの参照です。\n" +"オブジェクトが破棄されると、ダングリングポインタになります。\n" +"たとえば、ガベージコレクションによってオブジェクトへの最後の :term:`強参照 " +"` が取り除かれ、オブジェクトが破棄されることがあります。" -#: ../../glossary.rst:210 msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " @@ -473,6 +514,12 @@ msgid "" "func:`Py_NewRef` function can be used to create a new :term:`strong " "reference`." msgstr "" +":term:`借用参照 ` に対して :c:func:`Py_INCREF` を呼び出" +"し、その場で :term:`強参照 ` に変換することを推奨します。\n" +"ただし、借用参照の最後の使用までオブジェクトが破棄され得ない場合は除きま" +"す。\n" +":c:func:`Py_NewRef` 関数を使うと、新しい :term:`強参照 ` を" +"作成できます。" #: ../../glossary.rst:215 msgid "bytes-like object" @@ -495,7 +542,6 @@ msgstr "" "由した送信など、バイナリデータを要求するいろいろな操作に利用することができま" "す。" -#: ../../glossary.rst:224 msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " @@ -504,14 +550,15 @@ msgid "" "immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" -"幾つかの操作ではバイナリデータを変更する必要があります。\n" -"その操作のドキュメントではよく \"読み書き可能な bytes-like オブジェクト\" に" -"言及しています。\n" -"変更可能なバッファーオブジェクトには、 :class:`bytearray` と :class:" -"`bytearray` の :class:`memoryview` などが含まれます。\n" -"また、他の幾つかの操作では不変なオブジェクト内のバイナリデータ (\"読み出し専" -"用の bytes-like オブジェクト\") を必要します。それには :class:`bytes` と :" -"class:`bytes` の :class:`memoryview` オブジェクトが含まれます。" +"操作によっては、バイナリデータが変更可能である必要があります。\n" +"ドキュメントでは、そのようなデータを「読み書き可能な bytes-like オブジェク" +"ト」と呼ぶことがよくあります。\n" +"変更可能なバッファオブジェクトには、:class:`bytearray` や :class:`bytearray` " +"の :class:`memoryview` があります。\n" +"一方、別の操作では、バイナリデータが不変なオブジェクト(「読み出し専用の " +"bytes-like オブジェクト」)に格納されている必要があります。\n" +"そのようなオブジェクトには、:class:`bytes` や :class:`bytes` オブジェクトの :" +"class:`memoryview` があります。" #: ../../glossary.rst:232 msgid "bytecode" @@ -549,22 +596,27 @@ msgstr "" msgid "callable" msgstr "callable" -#: ../../glossary.rst:248 msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" msgstr "" +"呼び出し可能オブジェクトは、次の構文で呼び出すことができるオブジェクトで" +"す。\n" +"その際、実引数(:term:`実引数 ` を参照)を渡すこともできます。 ::" #: ../../glossary.rst:251 msgid "callable(argument1, argument2, argumentN)" msgstr "callable(argument1, argument2, argumentN)" -#: ../../glossary.rst:253 msgid "" "A :term:`function`, and by extension a :term:`method`, is a callable. An " "instance of a class that implements the :meth:`~object.__call__` method is " "also a callable." msgstr "" +":term:`関数 ` も :term:`メソッド ` も、呼び出し可能オブジェ" +"クトです。\n" +":meth:`~object.__call__` メソッドを実装したクラスのインスタンスも、呼び出し可" +"能オブジェクトです。" #: ../../glossary.rst:256 msgid "callback" @@ -592,19 +644,16 @@ msgstr "" msgid "class variable" msgstr "class variable" -#: ../../glossary.rst:267 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." msgstr "" -"(クラス変数) クラス上に定義され、クラスレベルで (つまり、クラスのインスタンス" -"上ではなしに) 変更されることを目的としている変数です。" +"(クラス変数) クラス内で定義され、クラスレベルでのみ(つまり、クラスのインスタ" +"ンスではなく)変更することを意図した変数です。" -#: ../../glossary.rst:269 msgid "closure variable" -msgstr "" +msgstr "closure variable" -#: ../../glossary.rst:271 msgid "" "A :term:`free variable` referenced from a :term:`nested scope` that is " "defined in an outer scope rather than being resolved at runtime from the " @@ -612,13 +661,20 @@ msgid "" "`nonlocal` keyword to allow write access, or implicitly defined if the " "variable is only being read." msgstr "" +"(クロージャ変数) :term:`ネストされたスコープ ` から参照される :" +"term:`自由変数 ` のうち、実行時にグローバル名前空間や組み込み" +"名前空間から解決されるのではなく、外側のスコープで定義されているものです。\n" +"書き込みを可能にするために :keyword:`nonlocal` キーワードで明示的に定義する場" +"合と、変数を読み取るだけで暗黙に定義される場合があります。" -#: ../../glossary.rst:276 msgid "" "For example, in the ``inner`` function in the following code, both ``x`` and " "``print`` are :term:`free variables `, but only ``x`` is a " "*closure variable*::" msgstr "" +"たとえば、次のコードの ``inner`` 関数では、``x`` と ``print`` はどちらも :" +"term:`自由変数 ` ですが、*クロージャ変数* は ``x`` だけで" +"す。 ::" #: ../../glossary.rst:279 msgid "" @@ -638,7 +694,6 @@ msgstr "" " print(x)\n" " return inner" -#: ../../glossary.rst:287 msgid "" "Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " "name, only includes the names of closure variables rather than listing all " @@ -646,6 +701,10 @@ msgid "" "sometimes used even when the intended meaning is to refer specifically to " "closure variables." msgstr "" +":attr:`codeobject.co_freevars` 属性には、その名前に反して、参照されるすべての" +"自由変数ではなくクロージャ変数の名前だけが含まれます。\n" +"このため、クロージャ変数だけを指す意図で、より一般的な用語である :term:`自由" +"変数 ` が使われることもあります。" #: ../../glossary.rst:291 msgid "complex number" @@ -671,11 +730,9 @@ msgstr "" "`cmath` を使います。複素数の使用はかなり高度な数学の機能です。必要性を感じな" "ければ、ほぼ間違いなく無視してしまってよいでしょう。" -#: ../../glossary.rst:303 msgid "concurrency" -msgstr "" +msgstr "concurrency" -#: ../../glossary.rst:305 msgid "" "The ability of a computer program to perform multiple tasks at the same " "time. Python provides libraries for writing programs that make use of " @@ -685,85 +742,108 @@ msgid "" "processes. Multi-core processors can execute threads and processes on " "different CPU cores at the same time (see :term:`parallelism`)." msgstr "" +"(並行性) コンピュータプログラムが複数のタスクを同時に実行する能力です。\n" +"Python は、さまざまな形の並行性を利用するプログラムを書くためのライブラリを提" +"供します。\n" +":mod:`asyncio` は非同期タスクやコルーチンを扱うためのライブラリです。\n" +":mod:`threading` はオペレーティングシステムのスレッドへのアクセスを、:mod:" +"`multiprocessing` はオペレーティングシステムのプロセスへのアクセスを提供しま" +"す。\n" +"マルチコアプロセッサは、異なる CPU コアでスレッドやプロセスを同時に実行できま" +"す(:term:`並列性 ` を参照)。" -#: ../../glossary.rst:313 msgid "concurrent modification" -msgstr "" +msgstr "concurrent modification" -#: ../../glossary.rst:315 msgid "" "When multiple threads modify shared data at the same time. Concurrent " "modification without proper synchronization can cause :term:`race conditions " "`, and might also trigger a :term:`data race `, " "data corruption, or both." msgstr "" +"(並行変更) 複数のスレッドが共有データを同時に変更することです。\n" +"適切な同期を行わずに並行変更すると、:term:`競合状態 ` を引き" +"起こすことがあり、さらに :term:`データ競合 `、データの破損、または" +"その両方を引き起こす可能性もあります。" -#: ../../glossary.rst:319 msgid "context" -msgstr "" +msgstr "context" -#: ../../glossary.rst:321 msgid "" "This term has different meanings depending on where and how it is used. Some " "common meanings:" msgstr "" +"(コンテキスト) この語は、使われる場所や使い方によって意味が異なります。\n" +"よく使われる意味には次のものがあります:" -#: ../../glossary.rst:324 msgid "" "The temporary state or environment established by a :term:`context manager` " "via a :keyword:`with` statement." msgstr "" +":term:`コンテキストマネージャ ` が :keyword:`with` 文を通じ" +"て設定する、一時的な状態または環境。" -#: ../../glossary.rst:326 msgid "" "The collection of key­value bindings associated with a particular :class:" "`contextvars.Context` object and accessed via :class:`~contextvars." "ContextVar` objects. Also see :term:`context variable`." msgstr "" +"特定の :class:`contextvars.Context` オブジェクトに関連付けられ、:class:" +"`~contextvars.ContextVar` オブジェクトを通じてアクセスされる、キーと値の束縛" +"の集まり。\n" +":term:`コンテキスト変数 ` も参照してください。" -#: ../../glossary.rst:330 msgid "" "A :class:`contextvars.Context` object. Also see :term:`current context`." msgstr "" +":class:`contextvars.Context` オブジェクト。\n" +":term:`現在のコンテキスト ` も参照してください。" #: ../../glossary.rst:332 msgid "context management protocol" msgstr "コンテキスト管理プロトコル" -#: ../../glossary.rst:334 msgid "" "The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " "the :keyword:`with` statement. See :pep:`343`." msgstr "" +":keyword:`with` 文から呼び出される :meth:`~object.__enter__` メソッドと :" +"meth:`~object.__exit__` メソッドです。\n" +":pep:`343` を参照してください。" #: ../../glossary.rst:336 msgid "context manager" msgstr "context manager" -#: ../../glossary.rst:338 msgid "" "An object which implements the :term:`context management protocol` and " "controls the environment seen in a :keyword:`with` statement. See :pep:" "`343`." msgstr "" +":term:`コンテキスト管理プロトコル ` を実装し、:" +"keyword:`with` 文内の環境を管理するオブジェクトです。\n" +":pep:`343` を参照してください。" #: ../../glossary.rst:341 msgid "context variable" msgstr "context variable" -#: ../../glossary.rst:343 msgid "" "A variable whose value depends on which context is the :term:`current " "context`. Values are accessed via :class:`contextvars.ContextVar` objects. " "Context variables are primarily used to isolate state between concurrent " "asynchronous tasks." msgstr "" +"どのコンテキストが :term:`現在のコンテキスト ` であるかに" +"よって値が変わる変数です。\n" +"値には :class:`contextvars.ContextVar` オブジェクトを通じてアクセスします。\n" +"コンテキスト変数は主に、並行する非同期タスク間で状態を分離するために使われま" +"す。" #: ../../glossary.rst:347 msgid "contiguous" msgstr "contiguous" -#: ../../glossary.rst:351 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -773,13 +853,14 @@ msgid "" "visiting items in order of memory address. However, in Fortran contiguous " "arrays, the first index varies the fastest." msgstr "" -"(隣接、連続) バッファが厳密に *C-連続* または *Fortran 連続* である場合に、そ" -"のバッファは連続しているとみなせます。\n" -"ゼロ次元バッファは C 連続であり Fortran 連続です。\n" -"一次元の配列では、その要素は必ずメモリ上で隣接するように配置され、添字がゼロ" -"から始まり増えていく順序で並びます。\n" -"多次元の C-連続な配列では、メモリアドレス順に要素を巡る際には最後の添え字が最" -"初に変わるのに対し、 Fortran 連続な配列では最初の添え字が最初に動きます。" +"(隣接、連続) バッファが *C-連続* または *Fortran 連続* のいずれかである場合、" +"かつその場合に限り、そのバッファは連続しているとみなされます。\n" +"ゼロ次元バッファは C 連続であり、Fortran 連続でもあります。\n" +"一次元配列では、要素はメモリ上で互いに隣接し、ゼロから始まる添字の昇順で並ん" +"でいなければなりません。\n" +"多次元の C-連続配列では、メモリアドレス順に要素をたどると、最後の添字が最も速" +"く変化します。\n" +"一方、Fortran 連続配列では、最初の添字が最も速く変化します。" #: ../../glossary.rst:359 msgid "coroutine" @@ -831,11 +912,9 @@ msgstr "" "グ言語の標準的な実装です。\"CPython\" という単語は、この実装を Jython や " "IronPython といった他の実装と区別する必要が有る場合に利用されます。" -#: ../../glossary.rst:379 msgid "current context" -msgstr "" +msgstr "current context" -#: ../../glossary.rst:381 msgid "" "The :term:`context` (:class:`contextvars.Context` object) that is currently " "used by :class:`~contextvars.ContextVar` objects to access (get or set) the " @@ -844,12 +923,19 @@ msgid "" "`asyncio`) associate each task with a context which becomes the current " "context whenever the task starts or resumes execution." msgstr "" +"(現在のコンテキスト) :class:`~contextvars.ContextVar` オブジェクトが :term:`" +"コンテキスト変数 ` の値にアクセス(取得や設定)するために現" +"在使っている :term:`コンテキスト `(:class:`contextvars.Context` オ" +"ブジェクト)です。\n" +"各スレッドには、それぞれ現在のコンテキストがあります。\n" +"非同期タスクを実行するフレームワーク(:mod:`asyncio` を参照)は、各タスクにコ" +"ンテキストを関連付けます。\n" +"このコンテキストは、タスクが実行を開始または再開するたびに、現在のコンテキス" +"トになります。" -#: ../../glossary.rst:387 msgid "cyclic isolate" -msgstr "" +msgstr "cyclic isolate" -#: ../../glossary.rst:389 msgid "" "A subgroup of one or more objects that reference each other in a reference " "cycle, but are not referenced by objects outside the group. The goal of " @@ -857,12 +943,14 @@ msgid "" "these groups and break the reference cycles so that the memory can be " "reclaimed." msgstr "" +"(孤立した循環参照群) 循環参照によって互いを参照している一つ以上のオブジェクト" +"からなる集まりで、外部のオブジェクトから参照されていないものです。\n" +":term:`循環ガベージコレクタ ` の目的は、こうした集まりを" +"特定し、循環参照を断ち切ってメモリを回収できるようにすることです。" -#: ../../glossary.rst:393 msgid "data race" -msgstr "" +msgstr "data race" -#: ../../glossary.rst:395 msgid "" "A situation where multiple threads access the same memory location " "concurrently, at least one of the accesses is a write, and the threads do " @@ -873,12 +961,22 @@ msgid "" "only happen in native code, but that :term:`native code` might be exposed in " "a Python API. See also :term:`race condition` and :term:`thread-safe`." msgstr "" +"(データ競合) 複数のスレッドが同じメモリ位置に並行してアクセスし、そのうち少な" +"くとも一つが書き込みであり、どのスレッドもアクセスを制御する同期を使っていな" +"い状況です。\n" +"データ競合は :term:`非決定的な ` 動作につながり、データの" +"破損を引き起こすことがあります。\n" +":term:`ロック ` やその他の :term:`同期プリミティブ ` を適切に使うと、データ競合を防げます。\n" +"データ競合が起こり得るのはネイティブコード内だけですが、その :term:`ネイティ" +"ブコード ` が Python API を通じて公開されている可能性があること" +"に注意してください。\n" +":term:`競合状態 ` と :term:`スレッドセーフ ` も" +"参照してください。" -#: ../../glossary.rst:404 msgid "deadlock" -msgstr "" +msgstr "deadlock" -#: ../../glossary.rst:406 msgid "" "A situation in which two or more tasks (threads, processes, or coroutines) " "wait indefinitely for each other to release resources or complete actions, " @@ -890,17 +988,31 @@ msgid "" "`locks ` in a consistent order. See also :term:`lock` and :term:" "`reentrant`." msgstr "" +"(デッドロック) 二つ以上のタスク(スレッド、プロセス、コルーチン)が、互いにリ" +"ソースを解放したり動作を完了したりするのを無期限に待ち、どのタスクも処理を進" +"められない状況です。\n" +"たとえば、スレッド A がロック 1 を保持したままロック 2 を待ち、スレッド B が" +"ロック 2 を保持したままロック 1 を待つと、両方のスレッドが無期限に待つことに" +"なります。\n" +"Python では、複数のロックを相反する順序で取得したり、join や await の依存関係" +"が循環したりすると、よくこの状況が発生します。\n" +"複数の :term:`ロック ` を常に一貫した順序で取得すると、デッドロックを回" +"避できます。\n" +":term:`ロック ` と :term:`再入可能 ` も参照してください。" #: ../../glossary.rst:415 msgid "decorator" msgstr "decorator" -#: ../../glossary.rst:417 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " "decorators are :deco:`classmethod` and :deco:`staticmethod`." msgstr "" +"(デコレータ) 別の関数を返す関数で、通常は ``@wrapper`` 構文を使って関数を変換" +"するために適用されます。\n" +"デコレータの代表的な例には、:deco:`classmethod` と :deco:`staticmethod` があ" +"ります。" #: ../../glossary.rst:421 msgid "" @@ -910,7 +1022,6 @@ msgstr "" "デコレータの文法はシンタックスシュガーです。次の2つの関数定義は意味的に同じも" "のです::" -#: ../../glossary.rst:424 msgid "" "def f(arg):\n" " ...\n" @@ -920,6 +1031,13 @@ msgid "" "def f(arg):\n" " ..." msgstr "" +"def f(arg):\n" +" ...\n" +"f = staticmethod(f)\n" +"\n" +"@staticmethod\n" +"def f(arg):\n" +" ..." #: ../../glossary.rst:432 msgid "" @@ -935,7 +1053,6 @@ msgstr "" msgid "descriptor" msgstr "descriptor" -#: ../../glossary.rst:437 msgid "" "Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." "__set__`, or :meth:`~object.__delete__`. When a class attribute is a " @@ -947,6 +1064,16 @@ msgid "" "basis for many features including functions, methods, properties, class " "methods, static methods, and reference to super classes." msgstr "" +"(デスクリプタ) :meth:`~object.__get__`、:meth:`~object.__set__`、:meth:" +"`~object.__delete__` のいずれかのメソッドを定義したオブジェクトです。\n" +"クラス属性がデスクリプタの場合、属性の検索時に、デスクリプタ特有の束縛動作が" +"起動します。\n" +"通常、*a.b* を使って属性を取得、設定、削除すると、*a* のクラス辞書から *b* と" +"いう名前のオブジェクトを検索しますが、*b* がデスクリプタなら、対応するデスク" +"リプタのメソッドが呼び出されます。\n" +"デスクリプタは、関数、メソッド、プロパティ、クラスメソッド、静的メソッド、" +"スーパークラスへの参照など、多くの機能の基盤となっているため、これを理解する" +"ことは Python を深く理解する鍵となります。" #: ../../glossary.rst:448 msgid "" @@ -960,12 +1087,15 @@ msgstr "" msgid "dictionary" msgstr "dictionary" -#: ../../glossary.rst:452 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " "methods. Called a hash in Perl." msgstr "" +"(辞書) 任意のキーが値に対応付けられる連想配列です。\n" +"キーには、:meth:`~object.__hash__` メソッドと :meth:`~object.__eq__` メソッド" +"を持つ任意のオブジェクトを使えます。\n" +"Perl ではハッシュと呼ばれます。" #: ../../glossary.rst:456 msgid "dictionary comprehension" @@ -1007,7 +1137,6 @@ msgstr "" msgid "docstring" msgstr "docstring" -#: ../../glossary.rst:472 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -1015,6 +1144,12 @@ msgid "" "enclosing class, function or module. Since it is available via " "introspection, it is the canonical place for documentation of the object." msgstr "" +"(ドキュメンテーション文字列) クラス、関数、モジュールの最初の式として現れる文" +"字列リテラルです。\n" +"スイートの実行時には無視されますが、コンパイラによって認識され、それを囲むク" +"ラス、関数、モジュールの :attr:`~definition.__doc__` 属性に格納されます。\n" +"イントロスペクションを通じて利用できるため、オブジェクトのドキュメントを書く" +"標準的な場所となっています。" #: ../../glossary.rst:478 msgid "duck-typing" @@ -1042,22 +1177,22 @@ msgstr "" "class>` で補完することもできます。) その代わり、典型的に :func:`hasattr` 判定" "や :term:`EAFP` プログラミングを利用します。" -#: ../../glossary.rst:489 msgid "dunder" -msgstr "" +msgstr "dunder" -#: ../../glossary.rst:491 msgid "" "An informal short-hand for \"double underscore\", used when talking about a :" "term:`special method`. For example, ``__init__`` is often pronounced " "\"dunder init\"." msgstr "" +"「double underscore(二重アンダースコア)」を表す非公式な略語で、:term:`特殊" +"メソッド ` について話すときに使います。\n" +"たとえば、``__init__`` はよく「dunder init」と発音されます。" #: ../../glossary.rst:494 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:496 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -1066,42 +1201,44 @@ msgid "" "statements. The technique contrasts with the :term:`LBYL` style common to " "many other languages such as C." msgstr "" -"「認可をとるより許しを請う方が容易 (easier to ask for forgiveness than " -"permission、マーフィーの法則)」の略です。この Python で広く使われているコー" -"ディングスタイルでは、通常は有効なキーや属性が存在するものと仮定し、その仮定" -"が誤っていた場合に例外を捕捉します。この簡潔で手早く書けるコーディングスタイ" -"ルには、 :keyword:`try` 文および :keyword:`except` 文がたくさんあるのが特徴で" -"す。このテクニックは、C のような言語でよく使われている :term:`LBYL` スタイル" -"と対照的なものです。" +"許可を求めるより、許しを請うほうが容易(Easier to ask for forgiveness than " +"permission)の略です。\n" +"Python で一般的なこのコーディングスタイルでは、有効なキーや属性が存在すると仮" +"定し、その仮定が誤っていた場合に例外を捕捉します。\n" +"この簡潔で高速なスタイルは、:keyword:`try` 文と :keyword:`except` 文を多用す" +"ることを特徴とします。\n" +"この手法は、C などの多くの言語で一般的な :term:`LBYL` スタイルと対照的です。" -#: ../../glossary.rst:502 msgid "evaluate function" -msgstr "" +msgstr "evaluate function" -#: ../../glossary.rst:504 msgid "" "A function that can be called to evaluate a lazily evaluated attribute of an " "object, such as the value of type aliases created with the :keyword:`type` " "statement." msgstr "" +"(評価関数) :keyword:`type` 文で作成された型エイリアスの値など、オブジェクトの" +"遅延評価される属性を評価するために呼び出せる関数です。" -#: ../../glossary.rst:507 msgid "exhausted" -msgstr "" +msgstr "exhausted" -#: ../../glossary.rst:509 msgid "" "An :term:`iterator` that has produced all of its values is said to be :dfn:" "`exhausted`. Further attempts to get the next value (for example, calls to :" "func:`next`) raise :exc:`StopIteration` (or :exc:`StopAsyncIteration` in the " "case of an :term:`asynchronous iterator`)." msgstr "" +"(枯渇した) すべての値を生成し終えた :term:`イテレータ ` を :dfn:`枯" +"渇した` といいます。\n" +"その後に次の値を取得しようとすると(たとえば :func:`next` を呼び出すと)、:" +"exc:`StopIteration`(:term:`非同期イテレータ ` の場合" +"は :exc:`StopAsyncIteration`)が送出されます。" #: ../../glossary.rst:515 msgid "expression" msgstr "expression" -#: ../../glossary.rst:517 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -1110,6 +1247,13 @@ msgid "" "`statement`\\s which cannot be used as expressions, such as :keyword:" "`while`. Assignments are also statements, not expressions." msgstr "" +"(式) 評価すると何らかの値になる構文の一部です。\n" +"つまり、式は、リテラル、名前、属性アクセス、演算子、関数呼び出しなど、いずれ" +"も値を返す式の要素を組み合わせたものです。\n" +"言語のすべての構成要素が式というわけではありません。\n" +":keyword:`while` のように、式として使えない :term:`文 ` もありま" +"す。\n" +"代入も式ではなく文です。" #: ../../glossary.rst:524 msgid "extension module" @@ -1127,22 +1271,23 @@ msgstr "" msgid "f-string" msgstr "f-string" -#: ../../glossary.rst:529 msgid "f-strings" -msgstr "" +msgstr "f-strings" -#: ../../glossary.rst:531 msgid "" "String literals prefixed with ``f`` or ``F`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " "See also :pep:`498`." msgstr "" +"``f`` または ``F`` を接頭辞に持つ文字列リテラルは、一般に「f-string」と呼ばれ" +"ます。\n" +"これは :ref:`フォーマット済み文字列リテラル ` の略です。\n" +":pep:`498` も参照してください。" #: ../../glossary.rst:534 msgid "file object" msgstr "file object" -#: ../../glossary.rst:536 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`!read` " "or :meth:`!write`) to an underlying resource. Depending on the way it was " @@ -1151,6 +1296,13 @@ msgid "" "output, in-memory buffers, sockets, pipes, etc.). File objects are also " "called :dfn:`file-like objects` or :dfn:`streams`." msgstr "" +"(ファイルオブジェクト) 基になるリソースに対して、ファイル向けの API(:meth:`!" +"read` や :meth:`!write` などのメソッド)を提供するオブジェクトです。\n" +"作成方法に応じて、ディスク上の実際のファイル、または別の種類の記憶装置や通信" +"装置(標準入出力、メモリ内バッファ、ソケット、パイプなど)へのアクセスを仲介" +"できます。\n" +"ファイルオブジェクトは、:dfn:`file-like オブジェクト` や :dfn:`ストリーム` と" +"も呼ばれます。" #: ../../glossary.rst:544 msgid "" @@ -1174,33 +1326,35 @@ msgstr "file-like object" msgid "A synonym for :term:`file object`." msgstr ":term:`file object` と同義です。" -#: ../../glossary.rst:552 msgid "filesystem encoding and error handler" -msgstr "" +msgstr "filesystem encoding and error handler" -#: ../../glossary.rst:554 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." msgstr "" +"(ファイルシステムのエンコーディングとエラーハンドラ) オペレーティングシステム" +"から受け取ったバイト列のデコードと、オペレーティングシステムに渡す Unicode の" +"エンコードに Python が使用する、エンコーディングとエラーハンドラです。" -#: ../../glossary.rst:557 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " "functions can raise :exc:`UnicodeError`." msgstr "" -"ファイルシステムのエンコーディングでは、すべてが 128 バイト以下に正常にデコー" -"ドされることが保証されなくてはなりません。ファイルシステムのエンコーディング" -"でこれが保証されなかった場合は、API 関数が :exc:`UnicodeError` を送出すること" -"があります。" +"ファイルシステムのエンコーディングは、128 未満のすべてのバイト値を正常にデ" +"コードできることを保証しなければなりません。\n" +"ファイルシステムのエンコーディングがこれを保証しない場合、API 関数が :exc:" +"`UnicodeError` を送出することがあります。" -#: ../../glossary.rst:561 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " "encoding and error handler." msgstr "" +":func:`sys.getfilesystemencoding` 関数と :func:`sys." +"getfilesystemencodeerrors` 関数を使うと、ファイルシステムのエンコーディングと" +"エラーハンドラを取得できます。" #: ../../glossary.rst:565 msgid "" @@ -1215,9 +1369,9 @@ msgstr "" "filesystem_encoding` と :c:member:`~PyConfig.filesystem_errors` を参照してく" "ださい。" -#: ../../glossary.rst:570 msgid "See also the :term:`locale encoding`." msgstr "" +":term:`ロケールエンコーディング ` も参照してください。" #: ../../glossary.rst:571 msgid "finder" @@ -1232,17 +1386,19 @@ msgstr "" "インポートされているモジュールの :term:`loader` の発見を試行するオブジェクト" "です。" -#: ../../glossary.rst:576 msgid "" "There are two types of finder: :term:`meta path finders ` " "for use with :data:`sys.meta_path`, and :term:`path entry finders ` for use with :data:`sys.path_hooks`." msgstr "" +"ファインダには、:data:`sys.meta_path` で使用する :term:`メタパスファインダ " +"` と、:data:`sys.path_hooks` で使用する :term:`パスエントリ" +"ファインダ ` の 2 種類があります。" -#: ../../glossary.rst:580 msgid "" "See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." msgstr "" +"詳しくは、:ref:`finders-and-loaders` と :mod:`importlib` を参照してください。" #: ../../glossary.rst:581 msgid "floor division" @@ -1264,37 +1420,38 @@ msgstr "" "を行う) ので ``-3`` になることに注意してください。\n" ":pep:`238` を参照してください。" -#: ../../glossary.rst:588 msgid "free threading" -msgstr "" +msgstr "free threading" -#: ../../glossary.rst:590 msgid "" "A threading model where multiple threads can run Python bytecode " "simultaneously within the same interpreter. This is in contrast to the :" "term:`global interpreter lock` which allows only one thread to execute " "Python bytecode at a time. See :pep:`703`." msgstr "" +"(フリースレッディング) 同じインタープリタ内で、複数のスレッドが Python バイト" +"コードを同時に実行できるスレッドモデルです。\n" +"一度に一つのスレッドだけが Python バイトコードを実行できる :term:`グローバル" +"インタープリタロック ` とは対照的です。\n" +":pep:`703` を参照してください。" -#: ../../glossary.rst:594 msgid "free-threaded build" -msgstr "" +msgstr "free-threaded build" -#: ../../glossary.rst:597 msgid "" "A build of :term:`CPython` that supports :term:`free threading`, configured " "using the :option:`--disable-gil` option before compilation." msgstr "" +"(フリースレッドビルド) コンパイル前に :option:`--disable-gil` オプションで構" +"成した、:term:`フリースレッディング ` に対応する :term:" +"`CPython` のビルドです。" -#: ../../glossary.rst:600 msgid "See :ref:`freethreading-python-howto`." -msgstr "" +msgstr ":ref:`freethreading-python-howto` を参照してください。" -#: ../../glossary.rst:601 msgid "free variable" -msgstr "" +msgstr "free variable" -#: ../../glossary.rst:603 msgid "" "Formally, as defined in the :ref:`language execution model `, a " "free variable is any variable used in a namespace which is not a local " @@ -1303,6 +1460,12 @@ msgid "" "attribute, the term is also sometimes used as a synonym for :term:`closure " "variable`." msgstr "" +"(自由変数) :ref:`言語の実行モデル ` における正式な定義では、ある" +"名前空間で使われる変数で、その名前空間のローカル変数ではないものを指しま" +"す。\n" +"例については :term:`クロージャ変数 ` を参照してください。\n" +"実際の用法では、:attr:`codeobject.co_freevars` 属性の名前に由来して、:term:`" +"クロージャ変数 ` の同義語として使われることもあります。" #: ../../glossary.rst:608 msgid "function" @@ -1329,21 +1492,21 @@ msgid "An :term:`annotation` of a function parameter or return value." msgstr "" "(関数アノテーション) 関数のパラメータや返り値の :term:`annotation` です。" -#: ../../glossary.rst:618 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " "and is also expected to have an :class:`int` return value::" msgstr "" -"関数アノテーションは、通常は :term:`型ヒント ` のために使われま" -"す: 例えば、この関数は 2 つの :class:`int` 型の引数を取ると期待され、また :" -"class:`int` 型の返り値を持つと期待されています。" +"関数アノテーションは通常、:term:`型ヒント ` に使用されます。\n" +"たとえば、次の関数は二つの :class:`int` 型の引数を受け取り、:class:`int` 型の" +"値を返すことを想定しています。 ::" -#: ../../glossary.rst:623 msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" msgstr "" +"def sum_two_numbers(a: int, b: int) -> int:\n" +" return a + b" #: ../../glossary.rst:626 msgid "Function annotation syntax is explained in section :ref:`function`." @@ -1380,12 +1543,14 @@ msgstr "" "し、その変数を評価することで、新機能が最初に言語に追加されたのはいつかや、い" "つデフォルトになるか (またはなったか) を見ることができます::" -#: ../../glossary.rst:642 msgid "" ">>> import __future__\n" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" msgstr "" +">>> import __future__\n" +">>> __future__.division\n" +"_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" #: ../../glossary.rst:645 msgid "garbage collection" @@ -1407,57 +1572,72 @@ msgstr "" msgid "generator" msgstr "ジェネレータ" -#: ../../glossary.rst:655 msgid "" "Informally used to mean either a :term:`generator function` or a :term:" "`generator iterator`, depending on context. The formal terms :term:" "`generator function` and :term:`generator iterator` are uncommon in " "practice; \"generator\" alone is almost always sufficient." msgstr "" +"文脈に応じて、:term:`ジェネレータ関数 ` または :term:`" +"ジェネレータイテレータ ` のどちらかを指すために非公式に使" +"われる語です。\n" +"正式な用語である :term:`ジェネレータ関数 ` と :term:`ジェ" +"ネレータイテレータ ` は、実際にはあまり使われません。\n" +"ほとんどの場合、「ジェネレータ」だけで十分です。" -#: ../../glossary.rst:660 ../../glossary.rst:661 msgid "generator function" -msgstr "" +msgstr "generator function" -#: ../../glossary.rst:663 msgid "" "A function which returns a :term:`generator` object. It looks like a normal " "function except that it contains :keyword:`yield` expressions for producing " "a series of values usable in a :keyword:`for`\\-loop or that can be " "retrieved one at a time with the :func:`next` function. See :ref:`yieldexpr`." msgstr "" +"(ジェネレータ関数) :term:`ジェネレータ ` オブジェクトを返す関数で" +"す。\n" +"通常の関数に似ていますが、:keyword:`for` ループで使用したり、:func:`next` 関" +"数で一つずつ取得したりできる一連の値を生成するための :keyword:`yield` 式を含" +"む点が異なります。\n" +":ref:`yieldexpr` を参照してください。" #: ../../glossary.rst:668 msgid "generator iterator" msgstr "generator iterator" -#: ../../glossary.rst:670 msgid "" "An object created by a :term:`generator function` or a :term:`generator " "expression`." msgstr "" +":term:`ジェネレータ関数 ` または :term:`ジェネレータ式 " +"` によって作成されるオブジェクトです。" -#: ../../glossary.rst:673 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). When " "the *generator iterator* resumes, it picks up where it left off (in contrast " "to functions which start fresh on every invocation)." msgstr "" +"各 :keyword:`yield` は処理を一時的に中断し、実行状態(ローカル変数や保留中の " +"try 文を含む)を記憶します。\n" +"*ジェネレータイテレータ* は、実行を再開すると、中断した箇所から処理を続けます" +"(呼び出しのたびに最初から実行する関数とは異なります)。" -#: ../../glossary.rst:678 msgid "" "Generator iterators also implement the :meth:`~generator.send` method to " "send a value into the suspended generator, and the :meth:`~generator.throw` " "method to raise an exception at the point where the generator was paused. " "See :ref:`generator-methods`." msgstr "" +"ジェネレータイテレータは、中断したジェネレータに値を送る :meth:`~generator." +"send` メソッドと、ジェネレータが中断した箇所で例外を送出する :meth:" +"`~generator.throw` メソッドも実装します。\n" +":ref:`generator-methods` を参照してください。" #: ../../glossary.rst:683 ../../glossary.rst:684 msgid "generator expression" msgstr "generator expression" -#: ../../glossary.rst:686 msgid "" "An :term:`expression` that returns an :term:`iterator`. It looks like a " "normal expression followed by a :keyword:`!for` clause defining a loop " @@ -1465,16 +1645,17 @@ msgid "" "expression generates values for an enclosing function::" msgstr "" "(ジェネレータ式) :term:`イテレータ ` を返す :term:`式 " -"` です。\n" -"普通の式に、ループ変数を定義する :keyword:`!for` 節、範囲、そして省略可能な :" -"keyword:`!if` 節がつづいているように見えます。\n" -"こうして構成された式は、外側の関数に向けて値を生成します::" +"` です。\n" +"通常の式の後に、ループ変数と範囲を定義する :keyword:`!for` 節、そして省略可能" +"な :keyword:`!if` 節が続く形をしています。\n" +"このように組み合わせた式は、外側の関数に渡す値を生成します。 ::" -#: ../../glossary.rst:691 msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" msgstr "" +">>> sum(i*i for i in range(10)) # 平方数 0, 1, 4, ... 81 の合計\n" +"285" #: ../../glossary.rst:693 msgid "generic function" @@ -1489,28 +1670,33 @@ msgstr "" "(ジェネリック関数) 異なる型に対し同じ操作をする関数群から構成される関数です。" "呼び出し時にどの実装を用いるかはディスパッチアルゴリズムにより決定されます。" -#: ../../glossary.rst:699 msgid "" "See also the :term:`single dispatch` glossary entry, the :deco:`functools." "singledispatch` decorator, and :pep:`443`." msgstr "" +"用語集の :term:`単一ディスパッチ ` の項目、:deco:`functools." +"singledispatch` デコレータ、および :pep:`443` も参照してください。" -#: ../../glossary.rst:701 msgid "generic type" -msgstr "" +msgstr "generic type" -#: ../../glossary.rst:703 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" "term:`type hints ` and :term:`annotations `." msgstr "" +"(ジェネリック型) パラメータ化できる :term:`型 ` で、通常は :class:" +"`list` や :class:`dict` のような :ref:`コンテナクラス ` で" +"す。\n" +":term:`型ヒント ` や :term:`アノテーション ` に使用さ" +"れます。" -#: ../../glossary.rst:708 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" +"詳しくは、:ref:`ジェネリックエイリアス型 `、:pep:`483`、:" +"pep:`484`、:pep:`585`、:mod:`typing` モジュールを参照してください。" #: ../../glossary.rst:710 msgid "GIL" @@ -1524,7 +1710,6 @@ msgstr ":term:`global interpreter lock` を参照してください。" msgid "global interpreter lock" msgstr "global interpreter lock" -#: ../../glossary.rst:715 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1534,13 +1719,14 @@ msgid "" "multi-threaded, at the expense of much of the parallelism afforded by multi-" "processor machines." msgstr "" -"(グローバルインタプリタロック) :term:`CPython` インタプリタが利用している、一" -"度に Python の :term:`バイトコード ` を実行するスレッドは一つだけで" -"あることを保証する仕組みです。これにより (:class:`dict` などの重要な組み込み" -"型を含む) オブジェクトモデルが同時アクセスに対して暗黙的に安全になるので、 " -"CPython の実装がシンプルになります。インタプリタ全体をロックすることで、マル" -"チプロセッサマシンが生じる並列化のコストと引き換えに、インタプリタを簡単にマ" -"ルチスレッド化できるようになります。" +"(グローバルインタプリタロック) :term:`CPython` インタプリタが、一度に一つのス" +"レッドだけが Python の :term:`バイトコード ` を実行することを保証す" +"るために使う仕組みです。\n" +"この仕組みは、:class:`dict` などの重要な組み込み型を含むオブジェクトモデル" +"を、並行アクセスに対して暗黙に安全にすることで、CPython の実装を単純にしま" +"す。\n" +"インタプリタ全体をロックすると、マルチプロセッサマシンが可能にする並列性の多" +"くを犠牲にする代わりに、インタプリタをマルチスレッド化しやすくなります。" #: ../../glossary.rst:724 msgid "" @@ -1553,7 +1739,6 @@ msgstr "" "の計算の重い処理をするときに GIL を解除するように設計されています。また、I/O " "処理をする場合 GIL は常に解除されます。" -#: ../../glossary.rst:729 msgid "" "As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " "build configuration. After building Python with this option, code must be " @@ -1562,19 +1747,28 @@ msgid "" "performance for multi-threaded applications and makes it easier to use multi-" "core CPUs efficiently. For more details, see :pep:`703`." msgstr "" +"Python 3.13 以降では、ビルド設定 :option:`--disable-gil` を使って GIL を無効" +"にできます。\n" +"このオプションで Python をビルドした後は、:option:`-X gil=0 <-X>` を指定する" +"か、環境変数 :envvar:`PYTHON_GIL=0 ` を設定してコードを実行する必" +"要があります。\n" +"この機能により、マルチスレッドアプリケーションの性能を改善でき、マルチコア " +"CPU を効率よく利用しやすくなります。\n" +"詳しくは :pep:`703` を参照してください。" -#: ../../glossary.rst:736 msgid "" "In prior versions of Python's C API, a function might declare that it " "requires the GIL to be held in order to use it. This refers to having an :" "term:`attached thread state`." msgstr "" +"以前の Python C API では、関数を使用するには GIL を保持する必要があると宣言さ" +"れていることがありました。\n" +"これは、:term:`スレッド状態がアタッチされている ` こと" +"を指します。" -#: ../../glossary.rst:739 msgid "global state" -msgstr "" +msgstr "global state" -#: ../../glossary.rst:741 msgid "" "Data that is accessible throughout a program, such as module-level " "variables, class variables, or C static variables in :term:`extension " @@ -1582,6 +1776,12 @@ msgid "" "shared between threads typically requires synchronization to avoid :term:" "`race conditions ` and :term:`data races `." msgstr "" +"(グローバル状態) モジュールレベルの変数、クラス変数、:term:`拡張モジュール " +"` 内の C の静的変数など、プログラム全体からアクセスできる" +"データです。\n" +"マルチスレッドプログラムでは、スレッド間で共有されるグローバル状態には通常、:" +"term:`競合状態 ` や :term:`データ競合 ` を避けるた" +"めの同期が必要です。" #: ../../glossary.rst:747 msgid "hash-based pyc" @@ -1601,13 +1801,18 @@ msgstr "" msgid "hashable" msgstr "hashable" -#: ../../glossary.rst:754 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`~object.__hash__` method), and can be " "compared to other objects (it needs an :meth:`~object.__eq__` method). " "Hashable objects which compare equal must have the same hash value." msgstr "" +"(ハッシュ可能) オブジェクトの生存期間を通して変わらないハッシュ値を持ち(:" +"meth:`~object.__hash__` メソッドが必要です)、ほかのオブジェクトと比較できる" +"(:meth:`~object.__eq__` メソッドが必要です)場合、そのオブジェクトは *ハッ" +"シュ可能* です。\n" +"比較で等しいと判定されるハッシュ可能オブジェクトは、同じハッシュ値を持たなけ" +"ればなりません。" #: ../../glossary.rst:760 msgid "" @@ -1653,30 +1858,34 @@ msgstr "" msgid "immortal" msgstr "永続オブジェクト (immortal)" -#: ../../glossary.rst:777 msgid "" "*Immortal objects* are a CPython implementation detail introduced in :pep:" "`683`." msgstr "" +"*永続オブジェクト* は、:pep:`683` で導入された CPython の実装の詳細です。" -#: ../../glossary.rst:780 msgid "" "If an object is immortal, its :term:`reference count` is never modified, and " "therefore it is never deallocated while the interpreter is running. For " "example, :const:`True` and :const:`None` are immortal in CPython." msgstr "" +"オブジェクトが永続である場合、その :term:`参照カウント ` は" +"決して変更されず、そのためインタープリタの実行中にメモリが解放されることはあ" +"りません。\n" +"たとえば、CPython では :const:`True` と :const:`None` が永続オブジェクトで" +"す。" -#: ../../glossary.rst:784 msgid "" "Immortal objects can be identified via :func:`sys._is_immortal`, or via :c:" "func:`PyUnstable_IsImmortal` in the C API." msgstr "" +"永続オブジェクトは :func:`sys._is_immortal`、または C API の :c:func:" +"`PyUnstable_IsImmortal` によって識別できます。" #: ../../glossary.rst:786 msgid "immutable" msgstr "immutable" -#: ../../glossary.rst:788 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1686,6 +1895,15 @@ msgid "" "their state cannot be modified after creation, eliminating concerns about " "improperly synchronized :term:`concurrent modification`." msgstr "" +"(不変) 値が固定されたオブジェクトです。\n" +"不変オブジェクトには、数値、文字列、タプルがあります。\n" +"このようなオブジェクトは変更できません。\n" +"異なる値を格納するには、新しいオブジェクトを作成する必要があります。\n" +"不変オブジェクトは、辞書のキーなど、ハッシュ値が一定である必要のある場面で重" +"要な役割を果たします。\n" +"作成後に状態を変更できないため、不変オブジェクトは本質的に :term:`スレッド" +"セーフ ` であり、不適切な同期による :term:`並行変更 ` を心配する必要がありません。" #: ../../glossary.rst:795 msgid "import path" @@ -1727,37 +1945,37 @@ msgstr "" "モジュールを探してロードするオブジェクト。 :term:`finder` と :term:`loader` " "のどちらでもあるオブジェクト。" -#: ../../glossary.rst:810 msgid "index" -msgstr "" +msgstr "index" -#: ../../glossary.rst:812 msgid "" "A numeric value that represents the position of an element in a :term:" "`sequence`." msgstr "" +"(インデックス) :term:`シーケンス ` 内の要素の位置を表す数値です。" -#: ../../glossary.rst:815 msgid "" "In Python, indexing starts at zero. For example, ``things[0]`` names the " "*first* element of ``things``; ``things[1]`` names the second one." msgstr "" +"Python のインデックスはゼロから始まります。\n" +"たとえば、``things[0]`` は ``things`` の *最初* の要素を、``things[1]`` は 2 " +"番目の要素を表します。" -#: ../../glossary.rst:819 msgid "" "In some contexts, Python allows negative indexes for counting from the end " "of a sequence, and indexing using :term:`slices `." msgstr "" +"文脈によっては、Python はシーケンスの末尾から数えるための負のインデックス" +"や、:term:`スライス ` を使ったインデックス指定を許可しています。" -#: ../../glossary.rst:822 msgid "See also :term:`subscript`." -msgstr "" +msgstr ":term:`添字 ` も参照してください。" #: ../../glossary.rst:823 msgid "interactive" msgstr "interactive" -#: ../../glossary.rst:825 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1766,6 +1984,13 @@ msgid "" "test out new ideas or inspect modules and packages (remember ``help(x)``). " "For more on interactive mode, see :ref:`tut-interac`." msgstr "" +"(対話型) Python には対話型インタープリタがあり、そのプロンプトで文や式を入力" +"して、すぐに実行し、結果を見ることができます。\n" +"``python`` を引数なしで起動するだけで利用できます(コンピュータのメインメ" +"ニューで選択して起動することもできます)。\n" +"新しいアイデアを試したり、モジュールやパッケージを調べたりするための、とても" +"強力な方法です(``help(x)`` を思い出してください)。\n" +"対話モードについて詳しくは、:ref:`tut-interac` を参照してください。" #: ../../glossary.rst:832 msgid "interpreted" @@ -1791,7 +2016,6 @@ msgstr "" msgid "interpreter shutdown" msgstr "interpreter shutdown" -#: ../../glossary.rst:843 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1802,16 +2026,15 @@ msgid "" "relies on may not function anymore (common examples are library modules or " "the warnings machinery)." msgstr "" -"Python インタープリターはシャットダウンを要請された時に、モジュールやすべての" -"クリティカルな内部構造をなどの、すべての確保したリソースを段階的に開放する、" -"特別なフェーズに入ります。\n" -"このフェーズは :term:`ガベージコレクタ ` を複数回呼び出し" -"ます。\n" -"これによりユーザー定義のデストラクターや weakref コールバックが呼び出されるこ" -"とがあります。\n" -"シャットダウンフェーズ中に実行されるコードは、それが依存するリソースがすでに" -"機能しない(よくある例はライブラリーモジュールや warning 機構です) ために様々" -"な例外に直面します。" +"Python インタープリタは、シャットダウンを要求されると、モジュールや各種の重要" +"な内部構造など、割り当てられたすべてのリソースを段階的に解放する特別な段階に" +"入ります。\n" +"また、:term:`ガベージコレクタ ` を複数回呼び出します。\n" +"これにより、ユーザー定義のデストラクタや weakref コールバックのコードが実行さ" +"れることがあります。\n" +"シャットダウン段階で実行されるコードでは、依存するリソースがすでに機能しなく" +"なっている場合があるため(よくある例はライブラリモジュールや warnings の仕組" +"みです)、さまざまな例外が発生することがあります。" #: ../../glossary.rst:852 msgid "" @@ -1825,7 +2048,6 @@ msgstr "" msgid "iterable" msgstr "iterable" -#: ../../glossary.rst:856 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1834,6 +2056,13 @@ msgid "" "meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method " "that implements :term:`sequence` semantics." msgstr "" +"(イテラブル) 要素を一つずつ返すことができるオブジェクトです。\n" +"例として、すべてのシーケンス型(:class:`list`、:class:`str`、:class:`tuple` " +"など)や、:class:`dict`、:term:`ファイルオブジェクト ` のような" +"一部のシーケンスでない型があります。\n" +"また、:meth:`~object.__iter__` メソッド、または :term:`シーケンス " +"` の意味論を実装する :meth:`~object.__getitem__` メソッドを定義した" +"任意のクラスのオブジェクトも該当します。" msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " @@ -1846,24 +2075,23 @@ msgid "" "temporary unnamed variable to hold the iterator for the duration of the " "loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." msgstr "" -"反復可能オブジェクトは :keyword:`for` ループ内やその他多くのシーケンス (訳" -"注: ここでのシーケンスとは、シーケンス型ではなくただの列という意味)が必要とな" -"る状況 (:func:`zip`, :func:`map`, ...) で利用できます。\n" -"反復可能オブジェクトを組み込み関数 :func:`iter` の引数として渡すと、 オブジェ" -"クトに対するイテレータを返します。\n" -"このイテレータは一連の値を引き渡す際に便利です。\n" -"通常は反復可能オブジェクトを使う際には、 :func:`iter` を呼んだりイテレータオ" -"ブジェクトを自分で操作する必要はありません。\n" -":keyword:`for` 文ではこの操作を自動的に行い、一時的な無名の変数を作成してルー" -"プを回している間イテレータを保持します。\n" -":term:`イテレータ ` 、 :term:`シーケンス ` 、 :term:`ジェ" -"ネレータ ` も参照してください。" +"イテラブルは :keyword:`for` ループや、シーケンスを必要とするほかの多くの場面" +"(:func:`zip`、:func:`map` など)で使えます(訳注: ここでのシーケンスは、シー" +"ケンス型ではなく、単なる列という意味です)。\n" +"組み込み関数 :func:`iter` にイテラブルオブジェクトを引数として渡すと、そのオ" +"ブジェクトのイテレータが返されます。\n" +"このイテレータで、一連の値を一度だけ走査できます。\n" +"イテラブルを使う際には通常、:func:`iter` を呼び出したり、イテレータオブジェク" +"トを自分で扱ったりする必要はありません。\n" +":keyword:`for` 文が自動的にこれを行い、一時的な無名の変数を作成して、ループの" +"実行中にイテレータを保持します。\n" +":term:`イテレータ `、:term:`シーケンス `、:term:`ジェネ" +"レータ ` も参照してください。" #: ../../glossary.rst:874 msgid "iterator" msgstr "iterator" -#: ../../glossary.rst:876 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1881,28 +2109,49 @@ msgid "" "iterator object used in the previous iteration pass, making it appear like " "an empty container." msgstr "" +"(イテレータ) データのストリームを表すオブジェクトです。\n" +"イテレータの :meth:`~iterator.__next__` メソッドを繰り返し呼び出すと(または" +"組み込み関数 :func:`next` に渡すと)、ストリーム内の要素が順に返されます。\n" +"それ以上データがない場合、代わりに :exc:`StopIteration` 例外が送出されま" +"す。\n" +"この時点でイテレータオブジェクトは :term:`枯渇した ` 状態となり、" +"その後 :meth:`!__next__` メソッドを呼び出しても、再び :exc:`StopIteration` が" +"送出されるだけです。\n" +"イテレータには、自身を返す :meth:`~iterator.__iter__` メソッドが必要です。\n" +"したがって、すべてのイテレータはイテラブルでもあり、ほかのイテラブルを受け付" +"けるほとんどの場面で使えます。\n" +"主な例外は、複数回の反復を試みるコードです。\n" +"コンテナオブジェクト(:class:`list` など)は、:func:`iter` 関数に渡したり、:" +"keyword:`for` ループで使ったりするたびに、新しいイテレータを生成します。\n" +"イテレータでこれを試みても、前の反復で使ったものと同じ枯渇したイテレータオブ" +"ジェクトが返されるだけなので、空のコンテナのように見えます。" #: ../../glossary.rst:891 msgid "More information can be found in :ref:`typeiter`." msgstr "詳細な情報は :ref:`typeiter` にあります。" -#: ../../glossary.rst:895 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`~iterator.__iter__`. And also please note that :term:`free-threaded " "` CPython does not guarantee :term:`thread-safe` behavior of " "iterator operations." msgstr "" +"CPython は、イテレータが :meth:`~iterator.__iter__` を定義するという要件を、" +"一貫して適用しているわけではありません。\n" +"また、:term:`フリースレッドの ` CPython は、イテレータ操作" +"の :term:`スレッドセーフな ` 動作を保証しない点にも注意してくだ" +"さい。" #: ../../glossary.rst:900 msgid "key" msgstr "キー" -#: ../../glossary.rst:902 msgid "" "A value that identifies an entry in a :term:`mapping`. See also :term:" "`subscript`." msgstr "" +":term:`マッピング ` 内の項目を識別する値です。\n" +":term:`添字 ` も参照してください。" #: ../../glossary.rst:904 msgid "key function" @@ -1931,7 +2180,6 @@ msgstr "" "merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, :func:`itertools." "groupby` 等があります。" -#: ../../glossary.rst:917 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.casefold` method can serve as a key function for case insensitive " @@ -1941,6 +2189,15 @@ msgid "" "are three key function constructors. See the :ref:`Sorting HOW TO " "` for examples of how to create and use key functions." msgstr "" +"キー関数を作成する方法はいくつかあります。\n" +"たとえば、:meth:`str.casefold` メソッドは、大文字と小文字を区別しないソートの" +"キー関数として使えます。\n" +"また、``lambda r: (r[0], r[2])`` のような :keyword:`lambda` 式からキー関数を" +"作成することもできます。\n" +"さらに、:func:`operator.attrgetter`、:func:`operator.itemgetter`、:func:" +"`operator.methodcaller` という三つのキー関数のコンストラクタがあります。\n" +"キー関数の作成と使用の例については、:ref:`ソート HOWTO ` を参照" +"してください。" #: ../../glossary.rst:924 msgid "keyword argument" @@ -1980,7 +2237,6 @@ msgstr "" "す。 :term:`EAFP` アプローチと対照的で、 :keyword:`if` 文がたくさん使われるの" "が特徴的です。" -#: ../../glossary.rst:939 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a :" "term:`race condition` between \"the looking\" and \"the leaping\". For " @@ -1989,25 +2245,36 @@ msgid "" "lookup. This issue can be solved with :term:`locks ` or by using the :" "term:`EAFP` approach. See also :term:`thread-safe`." msgstr "" +"マルチスレッド環境では、LBYL のアプローチは「確認」と「実行」の間に :term:`競" +"合状態 ` を生じさせる危険があります。\n" +"たとえば、``if key in mapping: return mapping[key]`` というコードでは、判定の" +"後、検索する前に、別のスレッドが *mapping* から *key* を削除すると、失敗する" +"ことがあります。\n" +"この問題は、:term:`ロック ` または :term:`EAFP` のアプローチを使うと解" +"決できます。\n" +":term:`スレッドセーフ ` も参照してください。" -#: ../../glossary.rst:945 msgid "lexical analyzer" -msgstr "" +msgstr "lexical analyzer" -#: ../../glossary.rst:948 msgid "Formal name for the *tokenizer*; see :term:`token`." msgstr "" +"(字句解析器) *トークナイザ* の正式な名称です。\n" +":term:`トークン ` を参照してください。" #: ../../glossary.rst:949 msgid "list" msgstr "list" -#: ../../glossary.rst:951 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " "*O*\\ (1). See :ref:`time-complexity`." msgstr "" +"Python の組み込み :term:`シーケンス ` です。\n" +"要素へのアクセスが *O*\\ (1) であるため、名前とは異なり、連結リストよりも、ほ" +"かの言語の配列に似ています。\n" +":ref:`time-complexity` を参照してください。" #: ../../glossary.rst:954 msgid "list comprehension" @@ -2027,11 +2294,9 @@ msgstr "" "記 (0x..) した文字列からなるリストを生成します。 :keyword:`if` 節はオプション" "です。 ``if`` 節がない場合、 ``range(256)`` の全ての要素が処理されます。" -#: ../../glossary.rst:962 msgid "lock" -msgstr "" +msgstr "lock" -#: ../../glossary.rst:964 msgid "" "A :term:`synchronization primitive` that allows only one thread at a time to " "access a shared resource. A thread must acquire a lock before accessing the " @@ -2045,12 +2310,25 @@ msgid "" "patterns, and thread-local state. See also :term:`deadlock`, and :term:" "`reentrant`." msgstr "" +"(ロック) 一度に一つのスレッドだけが共有リソースにアクセスできるようにする :" +"term:`同期プリミティブ ` です。\n" +"スレッドは、保護されたリソースにアクセスする前にロックを取得し、アクセス後に" +"解放しなければなりません。\n" +"ほかのスレッドがすでに保持しているロックを取得しようとすると、ロックが利用可" +"能になるまでブロックします。\n" +"Python の :mod:`threading` モジュールは、:class:`~threading.Lock`(基本的な" +"ロック)と :class:`~threading.RLock`(:term:`再入可能な ` ロック)" +"を提供します。\n" +"ロックは、:term:`競合状態 ` を防ぎ、共有データへの :term:`ス" +"レッドセーフな ` アクセスを保証するために使われます。\n" +"ロックの代わりに使える設計パターンとして、キュー、生産者と消費者のパターン、" +"スレッドローカルな状態などがあります。\n" +":term:`デッドロック ` と :term:`再入可能 ` も参照してく" +"ださい。" -#: ../../glossary.rst:975 msgid "lock-free" -msgstr "" +msgstr "lock-free" -#: ../../glossary.rst:977 msgid "" "An operation that does not acquire any :term:`lock` and uses atomic CPU " "instructions to ensure correctness. Lock-free operations can execute " @@ -2061,26 +2339,38 @@ msgid "" "multi-step modifications even when those modifications hold the :term:`per-" "object lock`." msgstr "" +"(ロックフリー) :term:`ロック ` を取得せず、CPU のアトミック命令を使って" +"正しさを保証する操作です。\n" +"ロックフリーな操作は、互いをブロックせずに並行して実行でき、ロックを保持する" +"操作によってブロックされることもありません。\n" +":term:`フリースレッドの ` Python では、:class:`dict` や :" +"class:`list` のような組み込み型がロックフリーな読み取り操作を提供します。\n" +"そのため、複数のステップからなる変更が :term:`オブジェクトごとのロック ` を保持していても、ほかのスレッドから途中の状態が観測されること" +"があります。" #: ../../glossary.rst:985 msgid "loader" msgstr "loader" -#: ../../glossary.rst:987 msgid "" "An object that loads a module. It must define the :meth:`!exec_module` and :" "meth:`!create_module` methods to implement the :class:`~importlib.abc." "Loader` interface. A loader is typically returned by a :term:`finder`. See " "also:" msgstr "" +"(ローダー) モジュールをロードするオブジェクトです。\n" +":class:`~importlib.abc.Loader` インターフェースを実装するには、:meth:`!" +"exec_module` メソッドと :meth:`!create_module` メソッドを定義しなければなりま" +"せん。\n" +"ローダーは通常、:term:`ファインダ ` から返されます。\n" +"次の項目も参照してください:" -#: ../../glossary.rst:993 msgid ":ref:`finders-and-loaders`" -msgstr "" +msgstr ":ref:`finders-and-loaders`" -#: ../../glossary.rst:994 msgid ":class:`importlib.abc.Loader`" -msgstr "" +msgstr ":class:`importlib.abc.Loader`" #: ../../glossary.rst:995 msgid ":pep:`302`" @@ -2090,28 +2380,31 @@ msgstr ":pep:`302`" msgid "locale encoding" msgstr "ロケールエンコーディング" -#: ../../glossary.rst:998 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." msgstr "" +"Unix では、LC_CTYPE ロケールのエンコーディングです。\n" +":func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` で設" +"定できます。" -#: ../../glossary.rst:1001 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." -msgstr "" +msgstr "Windows では、ANSI コードページ(例: ``\"cp1252\"``)です。" -#: ../../glossary.rst:1003 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "" +"Android と VxWorks では、Python はロケールエンコーディングとして " +"``\"utf-8\"`` を使用します。" -#: ../../glossary.rst:1005 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr "" +":func:`locale.getencoding` を使うと、ロケールエンコーディングを取得できます。" -#: ../../glossary.rst:1007 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "" +":term:`ファイルシステムのエンコーディングとエラーハンドラ ` も参照してください。" #: ../../glossary.rst:1008 msgid "magic method" @@ -2213,12 +2506,14 @@ msgstr "" msgid "method resolution order" msgstr "method resolution order" -#: ../../glossary.rst:1050 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " "algorithm used by the Python interpreter since the 2.3 release." msgstr "" +"(メソッド解決順序) メンバーの検索時に基底クラスを調べる順序です。\n" +"Python インタープリタがリリース 2.3 以降で使っているアルゴリズムの詳細につい" +"ては、:ref:`python_2.3_mro` を参照してください。" #: ../../glossary.rst:1053 msgid "module" @@ -2250,9 +2545,8 @@ msgstr "" "モジュールをロードするのに使われるインポート関連の情報を含む名前空間です。\n" ":class:`importlib.machinery.ModuleSpec` のインスタンスです。" -#: ../../glossary.rst:1065 msgid "See also :ref:`module-specs`." -msgstr "" +msgstr ":ref:`module-specs` も参照してください。" #: ../../glossary.rst:1066 msgid "MRO" @@ -2266,7 +2560,6 @@ msgstr ":term:`method resolution order` を参照してください。" msgid "mutable" msgstr "mutable" -#: ../../glossary.rst:1071 msgid "" "An :term:`object` with state that is allowed to change during the course of " "the program. In multi-threaded programs, mutable objects that are shared " @@ -2274,6 +2567,12 @@ msgid "" "conditions `. See also :term:`immutable`, :term:`thread-" "safe`, and :term:`concurrent modification`." msgstr "" +"(可変) プログラムの実行中に状態を変更できる :term:`オブジェクト ` で" +"す。\n" +"マルチスレッドプログラムでは、スレッド間で共有する可変オブジェクトには、:" +"term:`競合状態 ` を避けるための慎重な同期が必要です。\n" +":term:`不変 `、:term:`スレッドセーフ `、:term:`並行変" +"更 ` も参照してください。" #: ../../glossary.rst:1076 msgid "named tuple" @@ -2299,7 +2598,6 @@ msgstr "" "は名前付きタプルです。\n" "他の例は :data:`sys.float_info` です::" -#: ../../glossary.rst:1086 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2308,8 +2606,13 @@ msgid "" ">>> isinstance(sys.float_info, tuple) # kind of tuple\n" "True" msgstr "" +">>> sys.float_info[1] # インデックスによるアクセス\n" +"1024\n" +">>> sys.float_info.max_exp # 名前付きフィールドによるアクセス\n" +"1024\n" +">>> isinstance(sys.float_info, tuple) # タプルの一種\n" +"True" -#: ../../glossary.rst:1093 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -2319,6 +2622,14 @@ msgid "" "namedtuple`. The latter techniques also add some extra methods that may not " "be found in hand-written or built-in named tuples." msgstr "" +"名前付きタプルの一部は、上の例のような組み込み型です。\n" +"また、:class:`tuple` を継承して名前付きフィールドを定義する、通常のクラス定義" +"からも名前付きタプルを作成できます。\n" +"このようなクラスは手作業で書くことも、:class:`typing.NamedTuple` を継承した" +"り、ファクトリ関数 :func:`collections.namedtuple` を使ったりして作成すること" +"もできます。\n" +"後者の方法では、手書きの名前付きタプルや組み込みの名前付きタプルにはない場合" +"がある、いくつかの追加メソッドも用意されます。" #: ../../glossary.rst:1101 msgid "namespace" @@ -2350,34 +2661,40 @@ msgstr "" msgid "namespace package" msgstr "namespace package" -#: ../../glossary.rst:1115 msgid "" "A :term:`package` which serves only as a container for subpackages. " "Namespace packages may have no physical representation, and specifically are " "not like a :term:`regular package` because they have no ``__init__.py`` file." msgstr "" +"サブパッケージのコンテナとしてだけ機能する :term:`パッケージ ` で" +"す。\n" +"名前空間パッケージは物理的な実体を持たない場合があり、特に ``__init__.py`` " +"ファイルを持たない点で :term:`通常のパッケージ ` と異なりま" +"す。" -#: ../../glossary.rst:1120 msgid "" "Namespace packages allow several individually installable packages to have a " "common parent package. Otherwise, it is recommended to use a :term:`regular " "package`." msgstr "" +"名前空間パッケージを使うと、個別にインストール可能な複数のパッケージが、共通" +"の親パッケージを持てます。\n" +"それ以外の場合は、:term:`通常のパッケージ ` の使用を推奨しま" +"す。" -#: ../../glossary.rst:1123 msgid "" "For more information, see :pep:`420` and :ref:`reference-namespace-package`." msgstr "" +"詳しくは、:pep:`420` と :ref:`reference-namespace-package` を参照してくださ" +"い。" #: ../../glossary.rst:1125 msgid "See also :term:`module`." msgstr ":term:`module` を参照してください。" -#: ../../glossary.rst:1126 msgid "native code" -msgstr "" +msgstr "native code" -#: ../../glossary.rst:1128 msgid "" "Code that is compiled to machine instructions and runs directly on the " "processor, as opposed to code that is interpreted or runs in a virtual " @@ -2385,6 +2702,14 @@ msgid "" "Rust or Fortran code in :term:`extension modules ` that " "can be called from Python. See also :term:`extension module`." msgstr "" +"(ネイティブコード) 機械語命令にコンパイルされ、プロセッサ上で直接実行される" +"コードです。\n" +"インタープリタで解釈されたり、仮想マシン内で実行されたりするコードと対比され" +"ます。\n" +"Python の文脈では、ネイティブコードは通常、Python から呼び出せる :term:`拡張" +"モジュール ` 内の C、C++、Rust、Fortran のコードを指しま" +"す。\n" +":term:`拡張モジュール ` も参照してください。" #: ../../glossary.rst:1133 msgid "nested scope" @@ -2410,19 +2735,21 @@ msgstr "" msgid "new-style class" msgstr "new-style class" -#: ../../glossary.rst:1144 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " "versatile features like :attr:`~object.__slots__`, descriptors, properties, :" "meth:`~object.__getattribute__`, class methods, and static methods." msgstr "" +"(新スタイルクラス) 現在すべてのクラスオブジェクトに使われている種類のクラス" +"の、以前の名称です。\n" +"古いバージョンの Python では、:attr:`~object.__slots__`、デスクリプタ、プロパ" +"ティ、:meth:`~object.__getattribute__`、クラスメソッド、静的メソッドといっ" +"た、Python の新しく多様な機能を使えるのは新スタイルクラスだけでした。" -#: ../../glossary.rst:1149 msgid "non-deterministic" -msgstr "" +msgstr "non-deterministic" -#: ../../glossary.rst:1151 msgid "" "Behavior where the outcome of a program can vary between executions with the " "same inputs. In multi-threaded programs, non-deterministic behavior often " @@ -2431,6 +2758,12 @@ msgid "" "using :term:`locks ` and other :term:`synchronization primitives " "` helps ensure deterministic behavior." msgstr "" +"(非決定的) 同じ入力でも、実行ごとにプログラムの結果が変わり得る動作です。\n" +"マルチスレッドプログラムでは、スレッドの相対的なタイミングや実行の入り交じり" +"方が結果に影響する :term:`競合状態 ` が原因で、非決定的な動作" +"になることがよくあります。\n" +":term:`ロック ` やその他の :term:`同期プリミティブ ` による適切な同期は、決定的な動作の保証に役立ちます。" #: ../../glossary.rst:1158 msgid "object" @@ -2445,11 +2778,9 @@ msgstr "" "データ。もしくは、全ての :term:`新スタイルクラス ` の究極の" "基底クラスのこと。" -#: ../../glossary.rst:1163 msgid "optimized scope" -msgstr "" +msgstr "optimized scope" -#: ../../glossary.rst:1165 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2459,49 +2790,58 @@ msgid "" "relying on a known set of local and nonlocal variable names are restricted " "to optimized scopes." msgstr "" +"(最適化されたスコープ) コードのコンパイル時に、対象となるローカル変数名をコン" +"パイラが確実に把握できるスコープです。\n" +"これにより、その名前への読み書きを最適化できます。\n" +"関数、ジェネレータ、コルーチン、内包表記、ジェネレータ式のローカル名前空間" +"は、この方法で最適化されます。\n" +"注意: インタープリタの最適化の大部分は、すべてのスコープに適用されます。\n" +"最適化されたスコープだけに適用されるのは、ローカル変数名と非ローカル変数名の" +"集合が既知であることに依存する最適化だけです。" -#: ../../glossary.rst:1172 msgid "optional module" -msgstr "" +msgstr "optional module" -#: ../../glossary.rst:1174 msgid "" "An :term:`extension module` that is part of the :term:`standard library`, " "but may be absent in some builds of :term:`CPython`, usually due to missing " "third-party libraries or because the module is not available for a given " "platform." msgstr "" +"(オプションモジュール) :term:`標準ライブラリ ` の一部であ" +"る :term:`拡張モジュール ` のうち、一部の :term:`CPython` " +"ビルドでは含まれないことがあるものです。\n" +"通常は、サードパーティライブラリが不足しているか、そのプラットフォームでモ" +"ジュールを利用できないことが理由です。" -#: ../../glossary.rst:1179 msgid "" "See :ref:`optional-module-requirements` for a list of optional modules that " "require third-party libraries." msgstr "" +"サードパーティライブラリを必要とするオプションモジュールの一覧は、:ref:" +"`optional-module-requirements` を参照してください。" #: ../../glossary.rst:1181 msgid "package" msgstr "package" -#: ../../glossary.rst:1183 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " "attribute." msgstr "" -"(パッケージ) サブモジュールや再帰的にサブパッケージを含むことの出来る :term:" -"`module` のことです。専門的には、パッケージは ``__path__`` 属性を持つ Python " -"オブジェクトです。" +"(パッケージ) サブモジュールや、再帰的にサブパッケージを含むことができる " +"Python の :term:`モジュール ` です。\n" +"厳密には、パッケージは ``__path__`` 属性を持つ Python モジュールです。" #: ../../glossary.rst:1187 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" ":term:`regular package` と :term:`namespace package` を参照してください。" -#: ../../glossary.rst:1188 msgid "parallelism" -msgstr "" +msgstr "parallelism" -#: ../../glossary.rst:1190 msgid "" "Executing multiple operations at the same time (e.g. on multiple CPU " "cores). In Python builds with the :term:`global interpreter lock (GIL) " @@ -2511,6 +2851,14 @@ msgid "" "the GIL. In :term:`free-threaded ` Python, multiple Python " "threads can run Python code simultaneously on different cores." msgstr "" +"(並列性) 複数の操作を(たとえば複数の CPU コアで)同時に実行することです。\n" +":term:`グローバルインタープリタロック(GIL) ` があ" +"る Python ビルドでは、一度に一つのスレッドだけが Python バイトコードを実行し" +"ます。\n" +"そのため、複数の CPU コアを活用するには通常、複数のプロセス(:mod:" +"`multiprocessing` など)や、GIL を解放するネイティブ拡張を使います。\n" +":term:`フリースレッドの ` Python では、複数の Python スレッド" +"が異なるコアで Python コードを同時に実行できます。" #: ../../glossary.rst:1198 msgid "parameter" @@ -2567,9 +2915,8 @@ msgstr "" "ように、関数定義の仮引数リストに含めた可変長位置引数または裸の ``*`` の後で" "す::" -#: ../../glossary.rst:1228 msgid "def func(arg, *, kw_only1, kw_only2): ..." -msgstr "" +msgstr "def func(arg, *, kw_only1, kw_only2): ..." #: ../../glossary.rst:1230 msgid "" @@ -2583,9 +2930,8 @@ msgstr "" "個数の位置引数が与えられることを指定します。このような仮引数は、以下の " "*args* のように仮引数名の前に ``*`` をつけることで定義できます::" -#: ../../glossary.rst:1236 msgid "def func(*args, **kwargs): ..." -msgstr "" +msgstr "def func(*args, **kwargs): ..." #: ../../glossary.rst:1238 msgid "" @@ -2607,22 +2953,19 @@ msgstr "" "仮引数はオプションと必須の引数のどちらも指定でき、オプションの引数にはデフォ" "ルト値も指定できます。" -#: ../../glossary.rst:1247 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " "the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" "`362`." msgstr "" -":term:`仮引数 ` 、FAQ の :ref:`実引数と仮引数の違いは何ですか? " -"` 、:class:`inspect.Parameter` クラス、 :ref:" -"`function` セクション、:pep:`362` を参照してください。" +"用語集の :term:`実引数 ` の項目、FAQ の :ref:`実引数と仮引数の違い" +"は何ですか? `、:class:`inspect.Parameter` クラ" +"ス、:ref:`function` の節、および :pep:`362` も参照してください。" -#: ../../glossary.rst:1251 msgid "per-object lock" -msgstr "" +msgstr "per-object lock" -#: ../../glossary.rst:1253 msgid "" "A :term:`lock` associated with an individual object instance rather than a " "global lock shared across all objects. In :term:`free-threaded ` です。\n" +":term:`フリースレッドの ` Python では、:class:`dict` や :" +"class:`list` などの組み込み型はオブジェクトごとのロックを使い、同じオブジェク" +"トへの操作を直列化しながら、異なるオブジェクトへの操作を並行して実行できるよ" +"うにします。\n" +"オブジェクトごとのロックを保持する操作は、同じオブジェクトをロックするほかの" +"操作の進行を妨げますが、:term:`ロックフリーな ` 操作はブロックしま" +"せん。" #: ../../glossary.rst:1261 msgid "path entry" @@ -2671,24 +3024,25 @@ msgstr "" msgid "path entry hook" msgstr "path entry hook" -#: ../../glossary.rst:1275 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " "entry`." msgstr "" +":data:`sys.path_hooks` リスト内の呼び出し可能オブジェクトで、特定の :term:`パ" +"スエントリ ` 上でモジュールを見つける方法を知っている場合に、:" +"term:`パスエントリファインダ ` を返すものです。" #: ../../glossary.rst:1278 msgid "path based finder" msgstr "path based finder" -#: ../../glossary.rst:1280 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." msgstr "" -"デフォルトの :term:`meta path finder` の1つは、モジュールの :term:`import " -"path` を検索します。" +"モジュールを探すために :term:`インポートパス ` を検索する、デ" +"フォルトの :term:`メタパスファインダ ` の一つです。" #: ../../glossary.rst:1282 msgid "path-like object" @@ -2731,7 +3085,6 @@ msgstr "" "PEP は、機能についての簡潔な技術的仕様と提案する機能の論拠 (理論) を伝えるべ" "きです。" -#: ../../glossary.rst:1300 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2739,10 +3092,11 @@ msgid "" "responsible for building consensus within the community and documenting " "dissenting opinions." msgstr "" -"PEP は、新機能の提案にかかる、コミュニティによる問題提起の集積と Python にな" -"される設計決断の文書化のための最上位の機構となることを意図しています。PEP の" -"著者にはコミュニティ内の合意形成を行うこと、反対意見を文書化することの責務が" -"あります。" +"PEP は、主要な新機能を提案し、ある問題に対するコミュニティの意見を集め、" +"Python に採用された設計上の決定を文書化するための、主要な仕組みとなることを意" +"図しています。\n" +"PEP の著者には、コミュニティ内で合意を形成し、反対意見を文書化する責任があり" +"ます。" #: ../../glossary.rst:1306 msgid "See :pep:`1`." @@ -2785,14 +3139,14 @@ msgstr "" "ものではありません -- これは API を組み込む前には見落とされていた重大な欠陥が" "露呈したときにのみ行われます。" -#: ../../glossary.rst:1325 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " "backwards compatible resolution to any identified problems." msgstr "" -"暫定 API についても、後方互換性のない変更は「最終手段」とみなされています。問" -"題点が判明した場合でも後方互換な解決策を探すべきです。" +"暫定 API であっても、後方互換性のない変更は「最終手段」とみなされます。\n" +"特定された問題に対しては、引き続き、後方互換性のある解決策を見つけるためにあ" +"らゆる努力を行います。" #: ../../glossary.rst:1329 msgid "" @@ -2844,21 +3198,23 @@ msgstr "" "くの言語にはこの仕組みはないので、Python に慣れていない人は代わりに数値のカウ" "ンターを使うかもしれません::" -#: ../../glossary.rst:1349 msgid "" "for i in range(len(food)):\n" " print(food[i])" msgstr "" +"for i in range(len(food)):\n" +" print(food[i])" #: ../../glossary.rst:1352 msgid "As opposed to the cleaner, Pythonic method::" msgstr "これに対し、きれいな Pythonic な方法は::" -#: ../../glossary.rst:1354 msgid "" "for piece in food:\n" " print(piece)" msgstr "" +"for piece in food:\n" +" print(piece)" #: ../../glossary.rst:1356 msgid "qualified name" @@ -2876,7 +3232,6 @@ msgstr "" "されています。トップレベルの関数やクラスでは、修飾名はオブジェクトの名前と同" "じです::" -#: ../../glossary.rst:1363 msgid "" ">>> class C:\n" "... class D:\n" @@ -2890,6 +3245,17 @@ msgid "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" msgstr "" +">>> class C:\n" +"... class D:\n" +"... def meth(self):\n" +"... pass\n" +"...\n" +">>> C.__qualname__\n" +"'C'\n" +">>> C.D.__qualname__\n" +"'C.D'\n" +">>> C.D.meth.__qualname__\n" +"'C.D.meth'" #: ../../glossary.rst:1375 msgid "" @@ -2901,18 +3267,18 @@ msgstr "" "の親パッケージを含む全体のドット名表記、例えば ``email.mime.text`` を意味しま" "す::" -#: ../../glossary.rst:1379 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" "'email.mime.text'" msgstr "" +">>> import email.mime.text\n" +">>> email.mime.text.__name__\n" +"'email.mime.text'" -#: ../../glossary.rst:1382 msgid "race condition" -msgstr "" +msgstr "race condition" -#: ../../glossary.rst:1384 msgid "" "A condition of a program where the behavior depends on the relative timing " "or ordering of events, particularly in multi-threaded programs. Race " @@ -2923,6 +3289,16 @@ msgid "" "threaded code. Using :term:`locks ` and other :term:`synchronization " "primitives ` helps prevent race conditions." msgstr "" +"(競合状態) 特にマルチスレッドプログラムにおいて、イベントの相対的なタイミング" +"や順序によって動作が変わる、プログラムの状態です。\n" +"競合状態は、:term:`非決定的な ` 動作や、再現が難しいバグに" +"つながることがあります。\n" +":term:`データ競合 ` は、共有メモリへの同期されていないアクセスが関" +"わる、競合状態の一種です。\n" +":term:`LBYL` コーディングスタイルは、マルチスレッドコードで特に競合状態が起こ" +"りやすいものです。\n" +":term:`ロック ` やその他の :term:`同期プリミティブ ` を使うと、競合状態を防ぐのに役立ちます。" #: ../../glossary.rst:1394 msgid "reference count" @@ -2945,12 +3321,15 @@ msgstr "" "の重要な要素です。プログラマーは、 任意のオブジェクトの参照カウントを知るため" "に :func:`sys.getrefcount` 関数を呼び出すことが出来ます。" -#: ../../glossary.rst:1405 msgid "" "In :term:`CPython`, reference counts are not considered to be stable or well-" "defined values; the number of references to an object, and how that number " "is affected by Python code, may be different between versions." msgstr "" +":term:`CPython` では、参照カウントは安定した値や明確に定義された値とはみなさ" +"れません。\n" +"オブジェクトへの参照の数や、Python コードがその数に与える影響は、バージョンに" +"よって異なる場合があります。" #: ../../glossary.rst:1409 msgid "regular package" @@ -2968,18 +3347,18 @@ msgstr "" msgid "See also :term:`namespace package`." msgstr ":term:`namespace package` を参照してください。" -#: ../../glossary.rst:1415 msgid "reentrant" -msgstr "" +msgstr "reentrant" -#: ../../glossary.rst:1417 msgid "" "A property of a function or :term:`lock` that allows it to be called or " "acquired multiple times by the same thread without causing errors or a :term:" "`deadlock`." msgstr "" +"(再入可能) 同じスレッドが複数回呼び出したり取得したりしても、エラーや :term:`" +"デッドロック ` を引き起こさない、関数や :term:`ロック ` の性" +"質です。" -#: ../../glossary.rst:1421 msgid "" "For functions, reentrancy means the function can be safely called again " "before a previous invocation has completed, which is important when " @@ -2987,18 +3366,29 @@ msgid "" "functions may be :term:`non-deterministic` if they're called reentrantly in " "a multithreaded program." msgstr "" +"関数の再入可能性は、前の呼び出しが完了する前に、安全にもう一度呼び出せること" +"を意味します。\n" +"関数が再帰的に、またはシグナルハンドラから呼び出される可能性がある場合に重要" +"です。\n" +"スレッドセーフでない関数は、マルチスレッドプログラムで再入的に呼び出すと、:" +"term:`非決定的 ` になる場合があります。" -#: ../../glossary.rst:1427 msgid "" "For locks, Python's :class:`threading.RLock` (reentrant lock) is reentrant, " "meaning a thread that already holds the lock can acquire it again without " "blocking. In contrast, :class:`threading.Lock` is not reentrant - " "attempting to acquire it twice from the same thread will cause a deadlock." msgstr "" +"ロックでは、Python の :class:`threading.RLock`(再入可能なロック)が再入可能" +"です。\n" +"これは、すでにロックを保持しているスレッドが、ブロックせずにもう一度そのロッ" +"クを取得できることを意味します。\n" +"一方、:class:`threading.Lock` は再入可能ではなく、同じスレッドから二度取得し" +"ようとすると、デッドロックになります。" -#: ../../glossary.rst:1433 msgid "See also :term:`lock` and :term:`deadlock`." msgstr "" +":term:`ロック ` と :term:`デッドロック ` も参照してください。" #: ../../glossary.rst:1434 msgid "REPL" @@ -3034,7 +3424,6 @@ msgstr "" msgid "sequence" msgstr "sequence" -#: ../../glossary.rst:1447 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" @@ -3045,8 +3434,15 @@ msgid "" "sequence because the lookups use arbitrary :term:`hashable` keys rather than " "integers." msgstr "" +"(シーケンス) 整数インデックスを使った効率的な要素アクセスを :meth:`~object." +"__getitem__` 特殊メソッドでサポートし、シーケンスの長さを返す :meth:`~object." +"__len__` メソッドを定義する :term:`イテラブル ` です。\n" +"組み込みのシーケンス型には、:class:`list`、:class:`str`、:class:`tuple`、:" +"class:`bytes` などがあります。\n" +":class:`dict` も :meth:`~object.__getitem__` と :meth:`!__len__` をサポートし" +"ますが、検索には整数ではなく任意の :term:`ハッシュ可能な ` キーを使" +"うため、シーケンスではなくマッピングとみなされます。" -#: ../../glossary.rst:1456 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -3056,68 +3452,83 @@ msgid "" "`~abc.ABCMeta.register`. For more documentation on sequence methods " "generally, see :ref:`Common Sequence Operations `." msgstr "" +":class:`collections.abc.Sequence` 抽象基底クラスは、:meth:`~object." +"__getitem__` と :meth:`~object.__len__` に加え、:meth:`~sequence.count`、:" +"meth:`~sequence.index`、:meth:`~object.__contains__`、:meth:`~object." +"__reversed__` を含む、さらに豊富なインターフェースを定義します。\n" +"この拡張されたインターフェースを実装する型は、:func:`~abc.ABCMeta.register` " +"で明示的に登録できます。\n" +"シーケンスのメソッド全般について詳しくは、:ref:`共通のシーケンス演算 " +"` を参照してください。" -#: ../../glossary.rst:1466 msgid "set comprehension" -msgstr "" +msgstr "set comprehension" -#: ../../glossary.rst:1468 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " "not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" "`comprehensions`." msgstr "" -"(集合内包表記) iterable 内の全てあるいは一部の要素を処理して、その結果からな" -"る集合を返すコンパクトな書き方です。 ``results = {c for c in 'abracadabra' " -"if c not in 'abc'}`` とすると、``{'r', 'd'}`` という文字列の辞書を生成しま" -"す。 :ref:`comprehensions` を参照してください。" +"(集合内包表記) イテラブルのすべて、または一部の要素を処理し、その結果からなる" +"集合を返す簡潔な書き方です。\n" +"``results = {c for c in 'abracadabra' if c not in 'abc'}`` は、文字列の集合 " +"``{'r', 'd'}`` を生成します。\n" +":ref:`comprehensions` を参照してください。" #: ../../glossary.rst:1472 msgid "single dispatch" msgstr "single dispatch" -#: ../../glossary.rst:1474 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." msgstr "" -":term:`generic function` の一種で実装は一つの引数の型により選択されます。" +"(単一ディスパッチ) :term:`ジェネリック関数 ` のディスパッチ" +"の一形態で、一つの引数の型に基づいて実装を選びます。" #: ../../glossary.rst:1476 msgid "slice" msgstr "slice" -#: ../../glossary.rst:1478 msgid "" "An object of type :class:`slice`, used to describe a portion of a :term:" "`sequence`. A slice object is created when using the :ref:`slicing " "` form of :ref:`subscript notation `, with colons " "inside square brackets, such as in ``variable_name[1:3:5]``." msgstr "" +"(スライス) :term:`シーケンス ` の一部を表すために使う、:class:" +"`slice` 型のオブジェクトです。\n" +"``variable_name[1:3:5]`` のように、角括弧内にコロンを含む :ref:`添字表記 " +"` の :ref:`スライス形式 ` を使うと、スライスオブジェ" +"クトが作成されます。" -#: ../../glossary.rst:1483 msgid "soft deprecated" -msgstr "" +msgstr "soft deprecated" -#: ../../glossary.rst:1485 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " "will not be enhanced further." msgstr "" +"(ソフト非推奨) ソフト非推奨の API は、新しいコードでは使うべきではありません" +"が、既存のコードで使い続けても安全です。\n" +"その API のドキュメントの掲載とテストは続けられますが、それ以上の機能拡張は行" +"われません。" -#: ../../glossary.rst:1489 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "" +"通常の非推奨とは異なり、ソフト非推奨では API の削除は予定されておらず、警告も" +"出力されません。" -#: ../../glossary.rst:1492 msgid "" "See `PEP 387: Soft Deprecation `_." msgstr "" +"`PEP 387: Soft Deprecation `_ を参照してください。" #: ../../glossary.rst:1494 msgid "special method" @@ -3135,11 +3546,9 @@ msgstr "" "コア 2 つがついています。特殊メソッドについては :ref:`specialnames` で解説さ" "れています。" -#: ../../glossary.rst:1502 msgid "standard library" -msgstr "" +msgstr "standard library" -#: ../../glossary.rst:1504 msgid "" "The collection of :term:`packages `, :term:`modules ` and :" "term:`extension modules ` distributed as a part of the " @@ -3147,12 +3556,19 @@ msgid "" "may vary based on platform, available system libraries, or other criteria. " "Documentation can be found at :ref:`library-index`." msgstr "" +"(標準ライブラリ) 公式の Python インタープリタパッケージの一部として配布され" +"る、:term:`パッケージ `、:term:`モジュール `、:term:`拡張モ" +"ジュール ` の集まりです。\n" +"具体的に何が含まれるかは、プラットフォーム、利用可能なシステムライブラリ、そ" +"の他の条件によって変わる場合があります。\n" +"ドキュメントは :ref:`library-index` にあります。" -#: ../../glossary.rst:1510 msgid "" "See also :data:`sys.stdlib_module_names` for a list of all possible standard " "library module names." msgstr "" +"標準ライブラリのモジュール名として考えられるものすべての一覧については、:" +"data:`sys.stdlib_module_names` も参照してください。" #: ../../glossary.rst:1512 msgid "statement" @@ -3168,70 +3584,72 @@ msgstr "" "` かキーワードから構成されるもののどちらかです。後者には :" "keyword:`if`、:keyword:`while`、:keyword:`for` があります。" -#: ../../glossary.rst:1517 msgid "static type checker" -msgstr "" +msgstr "static type checker" -#: ../../glossary.rst:1519 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" "mod:`typing` module." msgstr "" +"(静的型チェッカー) Python コードを読み込んで解析し、型の誤りなどの問題を探す" +"外部ツールです。\n" +":term:`型ヒント ` と :mod:`typing` モジュールも参照してください。" -#: ../../glossary.rst:1522 msgid "stdlib" -msgstr "" +msgstr "stdlib" -#: ../../glossary.rst:1524 msgid "An abbreviation of :term:`standard library`." -msgstr "" +msgstr ":term:`標準ライブラリ ` の略です。" -#: ../../glossary.rst:1525 msgid "steal" -msgstr "" +msgstr "steal" -#: ../../glossary.rst:1527 msgid "" "In Python's C API, \"*stealing*\" an argument means that ownership of the " "argument is transferred to the called function. The caller must not use that " "reference after the call. Generally, functions that \"steal\" an argument do " "so even if they fail." msgstr "" +"(参照を盗む) Python の C API で実引数を「*盗む*」とは、実引数の所有権が呼び出" +"された関数に移ることを意味します。\n" +"呼び出し元は、呼び出し後にその参照を使ってはなりません。\n" +"一般に、実引数を「盗む」関数は、失敗した場合でも所有権を受け取ります。" -#: ../../glossary.rst:1532 msgid "See :ref:`api-refcountdetails` for a full explanation." -msgstr "" +msgstr "詳しい説明は、:ref:`api-refcountdetails` を参照してください。" -#: ../../glossary.rst:1533 msgid "strong reference" -msgstr "" +msgstr "strong reference" -#: ../../glossary.rst:1535 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " "calling :c:func:`Py_INCREF` when the reference is created and released with :" "c:func:`Py_DECREF` when the reference is deleted." msgstr "" +"(強参照) Python の C API で、オブジェクトへの参照のうち、それを保持するコード" +"が所有するものです。\n" +"強参照は、参照を作成するときに :c:func:`Py_INCREF` を呼び出すことで取得され、" +"参照を削除するときに :c:func:`Py_DECREF` で解放されます。" -#: ../../glossary.rst:1541 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " "strong reference before exiting the scope of the strong reference, to avoid " "leaking one reference." msgstr "" +":c:func:`Py_NewRef` 関数を使うと、オブジェクトへの強参照を作成できます。\n" +"通常は、参照が一つリークするのを避けるために、強参照のスコープを抜ける前に、" +"その強参照に対して :c:func:`Py_DECREF` 関数を呼び出さなければなりません。" -#: ../../glossary.rst:1546 msgid "See also :term:`borrowed reference`." -msgstr "" +msgstr ":term:`借用参照 ` も参照してください。" #: ../../glossary.rst:1547 msgid "subscript" msgstr "添字" -#: ../../glossary.rst:1549 msgid "" "The expression in square brackets of a :ref:`subscription expression " "`, for example, the ``3`` in ``items[3]``. Usually used to " @@ -3239,12 +3657,16 @@ msgid "" "subscripting a :term:`mapping`, or an :term:`index` when subscripting a :" "term:`sequence`." msgstr "" +":ref:`添字式 ` の角括弧内の式です。\n" +"たとえば、``items[3]`` の ``3`` が該当します。\n" +"通常、コンテナの要素を選ぶために使います。\n" +":term:`マッピング ` に添字を指定する場合は :term:`キー `、:" +"term:`シーケンス ` に添字を指定する場合は :term:`インデックス " +"` とも呼ばれます。" -#: ../../glossary.rst:1555 msgid "synchronization primitive" -msgstr "" +msgstr "synchronization primitive" -#: ../../glossary.rst:1557 msgid "" "A basic building block for coordinating (synchronizing) the execution of " "multiple threads to ensure :term:`thread-safe` access to shared resources. " @@ -3257,49 +3679,65 @@ msgid "" "conditions ` and coordinate thread execution. See also :" "term:`lock`." msgstr "" +"(同期プリミティブ) 複数のスレッドの実行を調整(同期)し、共有リソースへの :" +"term:`スレッドセーフな ` アクセスを保証するための基本的な構成要" +"素です。\n" +"Python の :mod:`threading` モジュールは、:class:`~threading.Lock`、:class:" +"`~threading.RLock`、:class:`~threading.Semaphore`、:class:`~threading." +"Condition`、:class:`~threading.Event`、:class:`~threading.Barrier` など、いく" +"つかの同期プリミティブを提供します。\n" +"さらに、:mod:`queue` モジュールは、複数の生産者と複数の消費者をサポートする" +"キューを提供し、マルチスレッドプログラムで特に役立ちます。\n" +"これらのプリミティブは、:term:`競合状態 ` を防いだり、スレッ" +"ドの実行を調整したりするのに役立ちます。\n" +":term:`ロック ` も参照してください。" -#: ../../glossary.rst:1567 msgid "t-string" -msgstr "" +msgstr "t-string" -#: ../../glossary.rst:1568 msgid "t-strings" -msgstr "" +msgstr "t-strings" -#: ../../glossary.rst:1570 msgid "" "String literals prefixed with ``t`` or ``T`` are commonly called \"t-" "strings\" which is short for :ref:`template string literals `." msgstr "" +"``t`` または ``T`` を接頭辞に持つ文字列リテラルは、一般に「t-string」と呼ばれ" +"ます。\n" +"これは :ref:`テンプレート文字列リテラル ` の略です。" #: ../../glossary.rst:1573 msgid "text encoding" msgstr "text encoding" -#: ../../glossary.rst:1575 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " "serialized as a sequence of bytes." msgstr "" +"Python の文字列は、Unicode コードポイントの列(``U+0000``--``U+10FFFF`` の範" +"囲)です。\n" +"文字列を保存または転送するには、バイト列としてシリアライズする必要がありま" +"す。" -#: ../../glossary.rst:1579 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." msgstr "" +"文字列をバイト列にシリアライズすることを「エンコード」、バイト列から文字列を" +"復元することを「デコード」といいます。" -#: ../../glossary.rst:1582 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." msgstr "" +"文字列をシリアライズするための :ref:`コーデック ` はさま" +"ざまあり、総称して「テキストエンコーディング」と呼ばれます。" #: ../../glossary.rst:1585 msgid "text file" msgstr "text file" -#: ../../glossary.rst:1587 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -3307,13 +3745,14 @@ msgid "" "text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " "instances of :class:`io.StringIO`." msgstr "" -"(テキストファイル) :class:`str` オブジェクトを読み書きできる :term:`file " -"object` です。\n" -"しばしば、テキストファイルは実際にバイト指向のデータストリームにアクセス" -"し、 :term:`テキストエンコーディング ` を自動的に行います。\n" -"テキストファイルの例は、 :data:`sys.stdin`, :data:`sys.stdout`, :class:`io." -"StringIO` インスタンスなどをテキストモード (``'r'`` or ``'w'``) で開いたファ" -"イルです。" +"(テキストファイル) :class:`str` オブジェクトを読み書きできる :term:`ファイル" +"オブジェクト ` です。\n" +"テキストファイルは、多くの場合、実際にはバイト指向のデータストリームにアクセ" +"スし、:term:`テキストエンコーディング ` を自動的に処理しま" +"す。\n" +"例として、テキストモード(``'r'`` または ``'w'``)で開いたファイル、:data:" +"`sys.stdin`、:data:`sys.stdout`、:class:`io.StringIO` のインスタンスがありま" +"す。" #: ../../glossary.rst:1594 msgid "" @@ -3324,32 +3763,40 @@ msgstr "" "オブジェクトについては、 :term:`バイナリファイル ` も参照してく" "ださい。" -#: ../../glossary.rst:1596 msgid "thread state" -msgstr "" +msgstr "thread state" -#: ../../glossary.rst:1599 msgid "" "The information used by the :term:`CPython` runtime to run in an OS thread. " "For example, this includes the current exception, if any, and the state of " "the bytecode interpreter." msgstr "" +"(スレッド状態) :term:`CPython` ランタイムが OS スレッド内で実行するために使う" +"情報です。\n" +"たとえば、現在の例外(あれば)や、バイトコードインタープリタの状態が含まれま" +"す。" -#: ../../glossary.rst:1603 msgid "" "Each thread state is bound to a single OS thread, but threads may have many " "thread states available. At most, one of them may be :term:`attached " "` at once." msgstr "" +"各スレッド状態は、一つの OS スレッドに結び付けられますが、スレッドには複数の" +"スレッド状態が用意されている場合があります。\n" +"一度に :term:`アタッチされる ` のは、そのうち最大一つ" +"です。" -#: ../../glossary.rst:1607 msgid "" "An :term:`attached thread state` is required to call most of Python's C API, " "unless a function explicitly documents otherwise. The bytecode interpreter " "only runs under an attached thread state." msgstr "" +"関数のドキュメントに明示的な例外の記載がない限り、Python の C API の大部分を" +"呼び出すには :term:`アタッチされたスレッド状態 ` が必" +"要です。\n" +"バイトコードインタープリタは、スレッド状態がアタッチされている場合だけ動作し" +"ます。" -#: ../../glossary.rst:1611 msgid "" "Each thread state belongs to a single interpreter, but each interpreter may " "have many thread states, including multiple for the same OS thread. Thread " @@ -3357,18 +3804,23 @@ msgid "" "one can be :term:`attached ` in that thread at any " "given moment." msgstr "" +"各スレッド状態は一つのインタープリタに属しますが、各インタープリタは、同じ " +"OS スレッドに対応する複数の状態も含めて、多数のスレッド状態を持つことができま" +"す。\n" +"複数のインタープリタのスレッド状態を同じスレッドに結び付けられますが、ある時" +"点でそのスレッドに :term:`アタッチできる ` のは一つだ" +"けです。" -#: ../../glossary.rst:1617 msgid "" "See :ref:`Thread State and the Global Interpreter Lock ` for more " "information." msgstr "" +"詳しくは、:ref:`スレッド状態とグローバルインタープリタロック ` を参" +"照してください。" -#: ../../glossary.rst:1619 msgid "thread-safe" -msgstr "" +msgstr "thread-safe" -#: ../../glossary.rst:1621 msgid "" "A module, function, or class that behaves correctly when used by multiple " "threads concurrently. Thread-safe code uses appropriate :term:" @@ -3381,29 +3833,43 @@ msgid "" "experience :term:`race conditions ` and :term:`data races " "` when used in multi-threaded programs." msgstr "" +"(スレッドセーフ) 複数のスレッドから並行して使っても正しく動作するモジュール、" +"関数、クラスです。\n" +"スレッドセーフなコードは、:term:`ロック ` のような適切な :term:`同期プ" +"リミティブ ` を使って共有される可変状態を保護する" +"か、共有される可変状態をまったく持たないように設計されています。\n" +":term:`フリースレッドの ` ビルドでは、:class:`dict`、:class:" +"`list`、:class:`set` のような組み込み型は、内部でロックを使って多くの操作をス" +"レッドセーフにしていますが、スレッドセーフであることが必ずしも保証されている" +"わけではありません。\n" +"スレッドセーフでないコードをマルチスレッドプログラムで使うと、:term:`競合状" +"態 ` や :term:`データ競合 ` が発生することがありま" +"す。" #: ../../glossary.rst:1632 msgid "token" msgstr "トークン" -#: ../../glossary.rst:1635 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " "operators, newlines and similar are represented by tokens." msgstr "" +":ref:`字句解析器 ` (*トークナイザ* とも呼ばれます)が生成する、ソー" +"スコードの小さな単位です。\n" +"名前、数値、文字列、演算子、改行などは、トークンで表されます。" -#: ../../glossary.rst:1640 msgid "" "The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" "`token` module contains information on the various types of tokens." msgstr "" +":mod:`tokenize` モジュールは、Python の字句解析器を公開します。\n" +":mod:`token` モジュールは、さまざまな種類のトークンについての情報を含みます。" #: ../../glossary.rst:1643 msgid "triple-quoted string" msgstr "triple-quoted string" -#: ../../glossary.rst:1645 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -3413,22 +3879,28 @@ msgid "" "continuation character, making them especially useful when writing " "docstrings." msgstr "" -"(三重クォート文字列) 3つの連続したクォート記号(\")かアポストロフィー(')で囲ま" -"れた文字列。通常の(一重)クォート文字列に比べて表現できる文字列に違いはありま" -"せんが、幾つかの理由で有用です。1つか2つの連続したクォート記号をエスケープ無" -"しに書くことができますし、行継続文字(\\\\)を使わなくても複数行にまたがること" -"ができるので、ドキュメンテーション文字列を書く時に特に便利です。" +"(三重クォート文字列) クォート記号(\")またはアポストロフィー(')を三つ並べ" +"て囲んだ文字列です。\n" +"一重クォート文字列にない機能を提供するわけではありませんが、いくつかの理由で" +"便利です。\n" +"文字列の中にシングルクォートやダブルクォートをエスケープせずに含めることがで" +"き、行継続文字を使わずに複数行にまたがることもできるため、ドキュメンテーショ" +"ン文字列を書く際に特に役立ちます。" #: ../../glossary.rst:1652 msgid "type" msgstr "type" -#: ../../glossary.rst:1654 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~object." "__class__` attribute or can be retrieved with ``type(obj)``." msgstr "" +"(型) Python オブジェクトの型は、それがどのような種類のオブジェクトかを決めま" +"す。\n" +"すべてのオブジェクトには型があります。\n" +"オブジェクトの型には :attr:`~object.__class__` 属性としてアクセスでき、" +"``type(obj)`` でも取得できます。" #: ../../glossary.rst:1658 msgid "type alias" @@ -3446,24 +3918,29 @@ msgstr "" "型エイリアスは :term:`型ヒント ` を単純化するのに有用です。例え" "ば::" -#: ../../glossary.rst:1665 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" msgstr "" +"def remove_gray_shades(\n" +" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" +" pass" #: ../../glossary.rst:1669 msgid "could be made more readable like this::" msgstr "これは次のようにより読みやすくできます::" -#: ../../glossary.rst:1671 msgid "" "Color = tuple[int, int, int]\n" "\n" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" msgstr "" +"Color = tuple[int, int, int]\n" +"\n" +"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" +" pass" #: ../../glossary.rst:1676 ../../glossary.rst:1690 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." @@ -3481,12 +3958,14 @@ msgstr "" "(型ヒント) 変数、クラス属性、関数のパラメータや返り値の期待される型を指定す" "る :term:`annotation` です。" -#: ../../glossary.rst:1682 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " "IDEs with code completion and refactoring." msgstr "" +"型ヒントは省略可能で、Python によって強制されませんが、:term:`静的型チェッ" +"カー ` に役立ちます。\n" +"IDE によるコード補完やリファクタリングにも役立ちます。" #: ../../glossary.rst:1686 msgid "" @@ -3526,11 +4005,12 @@ msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "変数あるいはクラス属性に注釈を付けたときは、代入部分は任意です::" -#: ../../glossary.rst:1704 msgid "" "class C:\n" " field: 'annotation'" msgstr "" +"class C:\n" +" field: 'annotation'" #: ../../glossary.rst:1707 msgid "" @@ -3540,9 +4020,8 @@ msgstr "" "変数アノテーションは通常は :term:`型ヒント` のために使われます: 例" "えば、この変数は :class:`int` の値を取ることを期待されています::" -#: ../../glossary.rst:1711 msgid "count: int = 0" -msgstr "" +msgstr "count: int = 0" #: ../../glossary.rst:1713 msgid "Variable annotation syntax is explained in section :ref:`annassign`." @@ -3591,16 +4070,17 @@ msgstr "" "シンは、バイトコードコンパイラが出力した :term:`バイトコード ` を実" "行します。" -#: ../../glossary.rst:1731 msgid "walrus operator" -msgstr "" +msgstr "walrus operator" -#: ../../glossary.rst:1733 msgid "" "A light-hearted way to refer to the :ref:`assignment expression ` operator ``:=`` because it looks a bit like a walrus if you " "turn your head." msgstr "" +"(セイウチ演算子) :ref:`代入式 ` の演算子 ``:=`` を指" +"すユーモラスな呼び方です。\n" +"頭を傾けると、少しセイウチに似て見えることに由来します。" #: ../../glossary.rst:1736 msgid "Zen of Python" @@ -3624,17 +4104,14 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsisリテラル" -#: ../../glossary.rst:349 msgid "C-contiguous" -msgstr "" +msgstr "C-contiguous" -#: ../../glossary.rst:349 msgid "Fortran contiguous" -msgstr "" +msgstr "Fortran contiguous" -#: ../../glossary.rst:1010 msgid "magic" -msgstr "" +msgstr "magic" #: ../../glossary.rst:1496 msgid "special" diff --git a/improve-page-nojs.po b/improve-page-nojs.po index 539547c11..2afdb2bc9 100644 --- a/improve-page-nojs.po +++ b/improve-page-nojs.po @@ -18,38 +18,44 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../improve-page-nojs.rst:5 msgid "Improve a documentation page" -msgstr "" +msgstr "ドキュメントのページを改善する" -#: ../../improve-page-nojs.rst:13 msgid "" "We are always interested to hear ideas about improvements to the " "documentation." -msgstr "" +msgstr "ドキュメントの改善に関するアイデアをいつでもお待ちしています。" -#: ../../improve-page-nojs.rst:17 msgid "" "If the bug or suggested improvement concerns the translation of this " "documentation, open an issue or edit the page in `translation's repository " "`_ instead." msgstr "" +"不備や改善の提案がこのドキュメントの翻訳に関する場合は、代わりに `翻訳用リポ" +"ジトリ `_ で issue を作成するか、ページを編集してくださ" +"い。" -#: ../../improve-page-nojs.rst:21 msgid "You have a few ways to ask questions or suggest changes:" -msgstr "" +msgstr "質問したり、変更を提案したりする方法はいくつかあります:" -#: ../../improve-page-nojs.rst:23 msgid "" "You can start a discussion about the page on the Python discussion forum. " "This link will start a topic in the Documentation category: `New " "Documentation topic `_." msgstr "" +"Python のディスカッションフォーラムで、このページについての議論を始められま" +"す。\n" +"次のリンクから Documentation カテゴリのトピックを作成できます: `新しい " +"Documentation トピック `_。" -#: ../../improve-page-nojs.rst:27 msgid "" "You can open an issue on the Python GitHub issue tracker. This link will " "create a new issue with the \"docs\" label: `New docs issue `_." msgstr "" +"Python の GitHub issue tracker で issue を作成できます。\n" +"次のリンクから「docs」ラベルの付いた新しい issue を作成できます: `新しい " +"docs issue `_。" diff --git a/improve-page.po b/improve-page.po index 1626f8a2f..8ba4b1926 100644 --- a/improve-page.po +++ b/improve-page.po @@ -18,35 +18,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../improve-page.rst:5 msgid "Improve a documentation page" -msgstr "" +msgstr "ドキュメントのページを改善する" -#: ../../improve-page.rst:43 msgid "" "We are always interested to hear ideas about improvements to the " "documentation." -msgstr "" +msgstr "ドキュメントの改善に関するアイデアをいつでもお待ちしています。" -#: ../../improve-page.rst:45 msgid "" "You were reading \"PAGETITLE\" at ``_. The source for that page is " "on `GitHub `_." msgstr "" +"閲覧していたのは ``_ にある「PAGETITLE」です。\n" +"このページのソースは `GitHub `_ にあります。" -#: ../../improve-page.rst:50 msgid "" "If the bug or suggested improvement concerns the translation of this " "documentation, open an issue or edit the page in `translation's repository " "`_ instead." msgstr "" +"不備や改善の提案がこのドキュメントの翻訳に関する場合は、代わりに `翻訳用リポ" +"ジトリ `_ で issue を作成するか、ページを編集してくださ" +"い。" -#: ../../improve-page.rst:54 msgid "You have a few ways to ask questions or suggest changes:" -msgstr "" +msgstr "質問したり、変更を提案したりする方法はいくつかあります:" -#: ../../improve-page.rst:56 msgid "" "You can start a discussion about the page on the Python discussion forum. " "This link will start a pre-populated topic: `Question about page " @@ -54,8 +54,13 @@ msgid "" "category=documentation&title=Question+about+page+" "%22PAGETITLE%22&body=About+the+page+at+PAGEURL%3A>`_." msgstr "" +"Python のディスカッションフォーラムで、このページについての議論を始められま" +"す。\n" +"次のリンクから、内容があらかじめ入力されたトピックを作成できます: `ページ" +"「PAGETITLE」についての質問 `_。" -#: ../../improve-page.rst:60 msgid "" "You can open an issue on the Python GitHub issue tracker. This link will " "create a new pre-populated issue: `Docs: problem with page \"PAGETITLE\" " @@ -63,10 +68,16 @@ msgid "" "yml&title=Docs%3A+problem+with+page+" "%22PAGETITLE%22&description=The+page+at+PAGEURL+has+a+problem%3A>`_." msgstr "" +"Python の GitHub issue tracker で issue を作成できます。\n" +"次のリンクから、内容があらかじめ入力された新しい issue を作成できます: " +"`Docs: ページ「PAGETITLE」の問題 `_。" -#: ../../improve-page.rst:64 msgid "" "You can `edit the page on GitHub `_ to open a pull request and begin the " "contribution process." msgstr "" +"`GitHub でページを編集 `_ して、プルリクエストを作成し、貢献を始められます。" diff --git a/library/_thread.po b/library/_thread.po index 584f5cd0b..bad37566e 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -165,9 +165,8 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/_thread.rst:118 ../../library/_thread.rst:146 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/_thread.rst:122 msgid "Added support for GNU/kFreeBSD." diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index a6e15f70d..9ebd842c3 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -1212,13 +1212,8 @@ msgstr "" "このメソッドの引数についての詳細は :meth:`loop.create_connection` メソッドの" "ドキュメントを参照してください。" -#: ../../library/asyncio-eventloop.rst:718 -#: ../../library/asyncio-eventloop.rst:874 -#: ../../library/asyncio-eventloop.rst:1380 -#: ../../library/asyncio-eventloop.rst:1939 -#: ../../library/asyncio-eventloop.rst:1946 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/asyncio-eventloop.rst:720 msgid "" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 5a18d1e4c..aed270386 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -187,9 +187,8 @@ msgstr "" ":class:`SelectorEventLoop` イベントループ実装を使った別のイベントループポリ" "シーです。" -#: ../../library/asyncio-policy.rst:134 ../../library/asyncio-policy.rst:146 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/asyncio-policy.rst:136 msgid "" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 1672efd94..01462083a 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -207,9 +207,8 @@ msgstr "" msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr ":meth:`loop.create_unix_connection` のドキュメントも参照してください。" -#: ../../library/asyncio-stream.rst:158 ../../library/asyncio-stream.rst:193 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/asyncio-stream.rst:160 msgid "" diff --git a/library/asyncio.po b/library/asyncio.po index 977085040..57dbfbf89 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -172,9 +172,8 @@ msgstr "" "コールバックを用いたライブラリと async/await 構文を使ったコードの :ref:`橋渡" "し `" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/codecs.po b/library/codecs.po index ab9027a18..1571371e1 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -3185,9 +3185,8 @@ msgid "" "object for it." msgstr "" -#: ../../library/codecs.rst:1615 ../../library/codecs.rst:1705 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/codecs.rst:1620 msgid "This module implements the following exception:" diff --git a/library/compileall.po b/library/compileall.po index 16245d1cf..fe5237ce1 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -44,9 +44,8 @@ msgstr "" "をライブラリのインストール時に生成することで、ライブラリディレクトリに書き込" "み権限をもたないユーザでも、これらを利用できるようになります。" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 0a4bf5fa5..3e6bf6544 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -59,9 +59,8 @@ msgid "" "detailed comparison of the two." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/concurrent.interpreters.po b/library/concurrent.interpreters.po index c111c0b58..e6e5e5625 100644 --- a/library/concurrent.interpreters.po +++ b/library/concurrent.interpreters.po @@ -83,9 +83,8 @@ msgstr ":pep:`734`" msgid ":pep:`684`" msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/constants.po b/library/constants.po index 229747c5b..5b4c276bb 100644 --- a/library/constants.po +++ b/library/constants.po @@ -66,7 +66,6 @@ msgid "" "`types.NotImplementedType` type." msgstr "" -#: ../../library/constants.rst:40 msgid "" "When a binary (or in-place) method returns :data:`!NotImplemented` the " "interpreter will try the reflected operation on the other type (or some " @@ -76,13 +75,15 @@ msgid "" "error message or the :data:`!NotImplemented` value being returned to Python " "code." msgstr "" -"二項演算の (あるいはインプレースの) メソッドが :data:`!NotImplemented` を返し" -"た場合、インタープリタはもう一方の型で定義された対の演算で代用を試みます (あ" -"るいは演算によっては他の代替手段も試みます)。試行された演算全てが :data:`!" -"NotImplemented` を返した場合、インタープリタは適切な例外を送出します。 :data:" -"`!NotImplemented` を正しく返さないと、誤解を招きかねないエラーメッセージに" -"なったり、 :data:`!NotImplemented` が Python コードに返されるようなことになり" -"ます。" +"二項演算 (またはインプレース演算) のメソッドが :data:`!NotImplemented` を返し" +"た場合、\n" +"インタープリタはもう一方の型に定義された対の演算を試みます (演算子によっては" +"別の代替手段を試みます)。\n" +"すべての試行が :data:`!NotImplemented` を返した場合、インタープリタは適切な例" +"外を送出します。\n" +"誤って :data:`!NotImplemented` を返すと、誤解を招くエラーメッセージが表示され" +"たり、\n" +":data:`!NotImplemented` の値が Python コードに返されたりします。" #: ../../library/constants.rst:47 msgid "See :ref:`implementing-the-arithmetic-operations` for examples." diff --git a/library/ctypes.po b/library/ctypes.po index a46f4c047..c1d4f5260 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -2704,17 +2704,8 @@ msgid "" "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1620 ../../library/ctypes.rst:1634 -#: ../../library/ctypes.rst:1697 ../../library/ctypes.rst:1704 -#: ../../library/ctypes.rst:1844 ../../library/ctypes.rst:2003 -#: ../../library/ctypes.rst:2055 ../../library/ctypes.rst:2207 -#: ../../library/ctypes.rst:2279 ../../library/ctypes.rst:2288 -#: ../../library/ctypes.rst:2302 ../../library/ctypes.rst:2311 -#: ../../library/ctypes.rst:2320 ../../library/ctypes.rst:2335 -#: ../../library/ctypes.rst:2402 ../../library/ctypes.rst:2429 -#: ../../library/ctypes.rst:2861 ../../library/ctypes.rst:3284 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/ctypes.rst:1622 msgid "" diff --git a/library/curses.po b/library/curses.po index 2c5977e1a..807daf6da 100644 --- a/library/curses.po +++ b/library/curses.po @@ -49,9 +49,8 @@ msgstr "" "の拡張モジュールは Linux および BSD 系の Unixで動作するオープンソースの " "curses ライブラリである ncurses の API に合致するように設計されています。" -#: ../../library/curses.rst:24 ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/dbm.po b/library/dbm.po index 3e50c5bfd..4f01d6eef 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -275,10 +275,8 @@ msgid "" "including the SQLite CLI." msgstr "" -#: ../../library/dbm.rst:243 ../../library/dbm.rst:375 -#: ../../includes/wasm-mobile-notavail.rst:3 ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/ensurepip.po b/library/ensurepip.po index 05da4226c..65ee01394 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -86,9 +86,8 @@ msgstr ":pep:`453`: Python インストールの際の明示的なpipのブー msgid "The original rationale and specification for this module." msgstr "このモジュールのもともとの論拠と仕様。" -#: ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/errno.po b/library/errno.po index 9dc9d5279..0ec9072a3 100644 --- a/library/errno.po +++ b/library/errno.po @@ -738,9 +738,8 @@ msgid "" "`PermissionError`." msgstr "" -#: ../../library/errno.rst:845 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/errno.rst:852 msgid "Operation canceled" diff --git a/library/exceptions.po b/library/exceptions.po index b4342807b..d4ef1adf6 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -88,12 +88,11 @@ msgstr "" msgid "Exception context" msgstr "例外コンテキスト" -#: ../../library/exceptions.rst:46 msgid "" "Three attributes on exception objects provide information about the context " "in which the exception was raised:" msgstr "" -"例外オブジェクトの3つの属性は、例外が送出された常用に関する情報を提供します:" +"例外オブジェクトの3つの属性は、例外が送出された状況に関する情報を提供します:" #: ../../library/exceptions.rst:53 msgid "" @@ -114,7 +113,6 @@ msgstr "" msgid "raise new_exc from original_exc" msgstr "" -#: ../../library/exceptions.rst:65 msgid "" "The expression following :keyword:`from` must be an exception or " "``None``. It will be set as :attr:`!__cause__` on the raised exception. " @@ -125,13 +123,14 @@ msgid "" "while leaving the old exception available in :attr:`!__context__` for " "introspection when debugging." msgstr "" -":keyword:`from ` に続く式は例外か ``None`` でなくてはなりません。\n" -"式は送出される例外の :attr:`!__cause__` として設定されます。\n" -":attr:`!__cause__` を設定することは、 :attr:`!__suppress_context__` 属性を暗" -"黙的に ``True`` に設定することにもなるので、 ``raise new_exc from None`` を使" -"うことで効率的に古い例外を新しいもので置き換えて表示する (例えば、 :exc:" -"`KeyError` を :exc:`AttributeError` に置き換え)、古い例外はデバッグ時の調査で" -"使えるよう :attr:`!__context__` に残すことができます。" +":keyword:`from` に続く式は、例外か ``None`` でなければなりません。\n" +"送出される例外の :attr:`!__cause__` には、その値が設定されます。\n" +":attr:`!__cause__` を設定すると、:attr:`!__suppress_context__` 属性も暗黙的" +"に ``True`` に設定されます。\n" +"そのため、``raise new_exc from None`` を使うと、表示上は古い例外を新しい例外" +"で置き換えられます (例えば :exc:`KeyError` から :exc:`AttributeError` への変" +"換)。\n" +"古い例外はデバッグ時に調べられるよう :attr:`!__context__` に残ります。" #: ../../library/exceptions.rst:74 msgid "" @@ -356,7 +355,6 @@ msgstr "" "参照してください。この例外は厳密に言えばエラーではないので、 :exc:" "`Exception` ではなく :exc:`BaseException` を直接継承しています。" -#: ../../library/exceptions.rst:243 msgid "" "Raised when the :keyword:`import` statement has troubles trying to load a " "module. Also raised when the \"from list\" in ``from ... import`` has a " @@ -364,8 +362,8 @@ msgid "" msgstr "" ":keyword:`import` 文でモジュールをロードしようとして問題が発生すると送出され" "ます。\n" -"``from ... import`` の中の\"from list\" (訳注:``...`` の部分)の名前が見つか" -"らないときにも送出されます。" +"``from ... import`` の \"from list\" に、見つからない名前が含まれている場合に" +"も送出されます。" #: ../../library/exceptions.rst:247 msgid "" @@ -483,17 +481,17 @@ msgstr "" msgid "Added the :attr:`name` attribute." msgstr ":attr:`name` 属性が追加されました。" -#: ../../library/exceptions.rst:339 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " "derived classes to override the method, or while the class is being " "developed to indicate that the real implementation still needs to be added." msgstr "" -"この例外は :exc:`RuntimeError` から派生しています。ユーザ定義の基底クラスにお" -"いて、抽象メソッドが派生クラスでオーバライドされることを要求する場合にこの例" -"外を送出しなくてはなりません。またはクラスは実装中であり本来の実装を追加する" -"必要があることを示します。" +"この例外は :exc:`RuntimeError` から派生しています。\n" +"ユーザ定義の基底クラスでは、派生クラスにメソッドのオーバーライドを求める場合" +"に、抽象メソッドからこの例外を送出するべきです。\n" +"また、クラスの開発中に、実際の実装をまだ追加する必要があることを示すためにも" +"送出するべきです。" #: ../../library/exceptions.rst:346 msgid "" @@ -535,7 +533,6 @@ msgstr "" "れた場合、:attr:`~BaseException.args` 属性は最初の2つの要素のみからなるタプル" "を持ちます。" -#: ../../library/exceptions.rst:373 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -543,23 +540,24 @@ msgid "" "exc:`OSError` directly or via an alias, and is not inherited when " "subclassing." msgstr "" -"コンストラクタは実際には、 `OS exceptions`_ で述べられている :exc:`OSError` " -"のサブクラスを返すことがよくあります。特定のサブクラスは最終的な :attr:`." -"errno` 値によります。この挙動は :exc:`OSError` を直接またはエイリアスで構築" -"し、サブクラス化時に継承されなかった場合にのみ発生します。" +"コンストラクタは、下の `OS exceptions`_ で説明する :exc:`OSError` のサブクラ" +"スを実際に返すことがよくあります。\n" +"どのサブクラスを返すかは、最終的な :attr:`.errno` の値によって決まります。\n" +"この挙動は、:exc:`OSError` を直接またはエイリアスを通して構築した場合にのみ発" +"生し、サブクラスには継承されません。" #: ../../library/exceptions.rst:381 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "C 変数 :c:data:`errno` に由来する数値エラーコードです。" -#: ../../library/exceptions.rst:385 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" -"Windows において、ネイティブ Windows エラーコードを与えます。そして :attr:" -"`errno` 属性は POSIX でいうネイティブエラーコードへのおよその翻訳です。" +"Windows では、ネイティブの Windows エラーコードを表します。\n" +"この場合、:attr:`.errno` 属性は、そのネイティブエラーコードを POSIX のエラー" +"コードにおおよそ変換した値です。" #: ../../library/exceptions.rst:389 msgid "" @@ -600,17 +598,16 @@ msgid "" "exc:`OSError`, and the constructor may return a subclass." msgstr "" -#: ../../library/exceptions.rst:418 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" "`filesystem encoding and error handler`. Also, the *filename2* constructor " "argument and attribute was added." msgstr "" -":attr:`filename` 属性が :term:`filesystem encoding and error handler` のエン" -"コーディングでエンコードやデコードされた名前から、関数に渡された元々のファイ" -"ル名になりました。\n" -"また、*filename2* コンストラクタ引数が追加されました。" +":attr:`filename` 属性は、:term:`filesystem encoding and error handler` に従っ" +"てエンコードまたはデコードされた名前ではなく、関数に渡された元のファイル名に" +"なりました。\n" +"また、コンストラクタ引数と属性の *filename2* が追加されました。" #: ../../library/exceptions.rst:427 msgid "" @@ -769,13 +766,12 @@ msgstr "" ":pep:`479` が全てのコードでデフォルトで有効化されました: ジェネレータから送出" "された :exc:`StopIteration` は :exc:`RuntimeError` に変換されます。" -#: ../../library/exceptions.rst:524 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -"イテレーションを停止するために、 :term:`asynchronous iterator` オブジェクト" -"の :meth:`~object.__anext__` メソッドによって返される必要があります。" +"イテレーションを停止するために、:term:`asynchronous iterator` オブジェクト" +"の :meth:`~object.__anext__` メソッドから送出しなければなりません。" #: ../../library/exceptions.rst:531 msgid "" @@ -1031,23 +1027,22 @@ msgstr "" "Unicode 関連のエラーが変換中に発生した際に送出されます。 :exc:`UnicodeError` " "のサブクラスです。" -#: ../../library/exceptions.rst:709 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -"演算子や関数が、正しい型だが適切でない値を持つ引数を受け取ったときや、 :exc:" -"`IndexError` のようなより詳細な例外では記述できない状況で送出されます。" +"演算や関数が、型は正しいものの値が適切でない実引数を受け取り、\n" +"かつ、その状況を :exc:`IndexError` などのより具体的な例外で表せない場合に送出" +"されます。" -#: ../../library/exceptions.rst:716 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -"除算や剰余演算の第二引数が 0 であった場合に送出されます。関連値は文字列で、そ" -"の演算における被演算子と演算子の型を示します。" +"除算や剰余演算の第2引数がゼロの場合に送出されます。\n" +"関連値は、被演算子の型と演算の種類を示す文字列です。" #: ../../library/exceptions.rst:721 msgid "" @@ -1073,17 +1068,16 @@ msgstr "" "以下の例外は :exc:`OSError` のサブクラスで、システムエラーコードに依存して送" "出されます。" -#: ../../library/exceptions.rst:741 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." "EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` and :py:" "const:`~errno.EINPROGRESS`." msgstr "" -"ある操作が、ノンブロッキング操作に設定されたオブジェクト (例えばソケット) を" -"ブロックしそうになった場合に送出されます。:c:data:`errno` :py:const:`~errno." -"EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` および :" -"py:const:`~errno.EINPROGRESS` に対応します。" +"ノンブロッキング操作に設定されたオブジェクト (例えばソケット) に対する操作を" +"すぐに完了できず、待機が必要な場合に送出されます。\n" +":c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:py:" +"const:`~errno.EWOULDBLOCK`、:py:const:`~errno.EINPROGRESS` に対応します。" #: ../../library/exceptions.rst:746 msgid "" @@ -1120,17 +1114,18 @@ msgstr "" "サブクラスは :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError`, :exc:`ConnectionResetError` です。" -#: ../../library/exceptions.rst:769 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " "has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:" "`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" -":exc:`ConnectionError` のサブクラスで、もう一方の端が閉じられたパイプに書き込" -"こもうとするか、書き込みのためにシャットダウンされたソケットに書き込こもうと" -"した場合に発生します。 :c:data:`errno` :py:const:`~errno.EPIPE` と :py:" -"const:`~errno.ESHUTDOWN` に対応します。" +":exc:`ConnectionError` のサブクラスです。\n" +"もう一方の端が閉じられたパイプに書き込もうとした場合や、\n" +"書き込み側がシャットダウンされたソケットに書き込もうとした場合に送出されま" +"す。\n" +":c:data:`errno` :py:const:`~errno.EPIPE` と :py:const:`~errno.ESHUTDOWN` に対" +"応します。" #: ../../library/exceptions.rst:776 msgid "" @@ -1300,23 +1295,21 @@ msgstr "" msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../library/exceptions.rst:888 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -"古くなって将来的に廃止される予定だが、今のところは廃止されていない機能につい" -"ての警告の基底クラスです。" +"古くなっており、将来は非推奨になる見込みですが、現時点では非推奨ではない機能" +"についての警告の基底クラスです。" -#: ../../library/exceptions.rst:892 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -"近々起こる可能性のある機能廃止について警告を発することはまれなので、このクラ" -"スはめったに使われず、既に決まっている廃止については :exc:" -"`DeprecationWarning` が望ましいです。" +"将来、非推奨になる可能性を事前に警告することは一般的ではないため、このクラス" +"はめったに使われません。\n" +"すでに非推奨となっている機能には :exc:`DeprecationWarning` が推奨されます。" #: ../../library/exceptions.rst:896 ../../library/exceptions.rst:925 #: ../../library/exceptions.rst:952 @@ -1391,7 +1384,6 @@ msgstr "" "す。また、:keyword:`except*` によって判別でき、例外グループに含" "まれている例外の型に基づいてサブグループにマッチします。" -#: ../../library/exceptions.rst:972 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1401,15 +1393,15 @@ msgid "" "is so that ``except Exception`` catches an :exc:`ExceptionGroup` but not :" "exc:`BaseExceptionGroup`." msgstr "" -"この2つの例外型は一連の例外 ``excs`` を包含します。``msg`` 引数は文字列の必要" -"があります。2つのクラスの異なる点は、:exc:`BaseException` は :exc:" -"`BaseExceptionGroup` を拡張して任意の例外を含められますが、:exc:" -"`ExceptionGroup` は :exc:`Exception` を拡張して :exc:`Exception` のサブクラス" -"のみを含められます。この設計により ``except Exception`` は :exc:" -"`ExceptionGroup` をキャッチしますが、:exc:`BaseExceptionGroup` はキャッチしま" -"せん。" +"どちらの例外型も、シーケンス ``excs`` に含まれる例外をまとめて保持します。\n" +"``msg`` パラメータは文字列でなければなりません。\n" +"2つのクラスの違いは、:exc:`BaseExceptionGroup` が :exc:`BaseException` を拡張" +"して任意の例外を保持できるのに対し、\n" +":exc:`ExceptionGroup` は :exc:`Exception` を拡張し、:exc:`Exception` のサブク" +"ラスの例外のみを保持できることです。\n" +"この設計により、``except Exception`` は :exc:`ExceptionGroup` を捕捉します" +"が、:exc:`BaseExceptionGroup` は捕捉しません。" -#: ../../library/exceptions.rst:980 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1417,11 +1409,13 @@ msgid "" "The :exc:`ExceptionGroup` constructor, on the other hand, raises a :exc:" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -":exc:`BaseExceptionGroup` のコンストラクターは含まれる例外がすべて :exc:" -"`Exception` の場合は :exc:`BaseExceptionGroup` ではなく :exc:" -"`ExceptionGroup` を返すように自動的に選択されます。一方 :exc:" -"`ExceptionGroup` コンストラクタは、:exc:`Exception` サブクラス以外の例外を含" -"む場合は :exc:`TypeError` を送出します。" +":exc:`BaseExceptionGroup` のコンストラクタは、保持する例外がすべて :exc:" +"`Exception` のインスタンスである場合、\n" +":exc:`BaseExceptionGroup` ではなく :exc:`ExceptionGroup` を返すので、クラスの" +"選択を自動化するために利用できます。\n" +"一方、:exc:`ExceptionGroup` のコンストラクタは、:exc:`Exception` のサブクラス" +"のインスタンスでない例外が一つでも含まれていると :exc:`TypeError` を送出しま" +"す。" #: ../../library/exceptions.rst:987 msgid "" @@ -1448,13 +1442,13 @@ msgstr "" "コンストラクタに渡された一連の ``excs`` に含まれる例外のタプルです。この属性" "は読み込み専用です。" -#: ../../library/exceptions.rst:1007 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -"現在のグループで *条件* にマッチする礼儀のみを含む例外グループを返します。結" -"果が空の場合は ``None`` を返します。" +"現在のグループの例外のうち、*condition* にマッチするものだけを含む例外グルー" +"プを返します。\n" +"結果が空の場合は ``None`` を返します。" #: ../../library/exceptions.rst:1010 msgid "" diff --git a/library/fcntl.po b/library/fcntl.po index 7ad9c2025..2692da483 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -34,9 +34,8 @@ msgid "" "details." msgstr "" -#: ../../library/fcntl.rst:18 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/fcntl.rst:20 msgid "" diff --git a/library/ftplib.po b/library/ftplib.po index 3e16e1ff2..19face4d8 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -51,9 +51,8 @@ msgstr "" msgid "The default encoding is UTF-8, following :rfc:`2640`." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/functions.po b/library/functions.po index 77d001833..cbd707d47 100644 --- a/library/functions.po +++ b/library/functions.po @@ -466,7 +466,6 @@ msgid "" msgstr "" "これは組み込みの :func:`next` 関数の非同期版であり、同じように動作します。" -#: ../../library/functions.rst:97 msgid "" "This calls the :meth:`~object.__anext__` method of *async_iterator*, " "returning an :term:`awaitable`. Awaiting this returns the next value of the " @@ -474,10 +473,10 @@ msgid "" "exhausted, otherwise :exc:`StopAsyncIteration` is raised." msgstr "" "これは *async_iterator* の :meth:`~object.__anext__` メソッドを呼び出し、待ち" -"受け可能オブジェクト (:term:`awaitable`) を返します。待ち受けることによりイテ" -"レータの次の値を返します。 *default* が与えられた場合、イテレータが枯渇したと" -"きにその値が返されます。 *default* が与えられない場合は :exc:" -"`StopAsyncIteration` が送出されます。" +"受け可能オブジェクト (:term:`awaitable`) を返します。\n" +"これを待ち受けると、イテレータの次の値が返されます。\n" +"イテレータが枯渇した場合、*default* が指定されていればその値が返され、\n" +"指定されていなければ :exc:`StopAsyncIteration` が送出されます。" #: ../../library/functions.rst:106 msgid "" @@ -725,15 +724,15 @@ msgid "" msgstr "" "この関数は Python 3.0 で一度取り除かれましたが、Python 3.2 で復活しました。" -#: ../../library/functions.rst:251 msgid "" "Return the string representing a character with the specified Unicode code " "point. For example, ``chr(97)`` returns the string ``'a'``, while " "``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." msgstr "" -"指定されたUnicode コードポイントが文字を表す文字列を返します。例えば " -"``chr(97)`` は文字列 ``'a'`` を、 ``chr(8364)`` は文字列 ``'€'`` を返しま" -"す。 :func:`ord` の逆です。" +"指定された Unicode コードポイントを持つ文字を表す文字列を返します。\n" +"例えば、``chr(97)`` は文字列 ``'a'`` を、``chr(8364)`` は文字列 ``'€'`` を返" +"します。\n" +":func:`ord` の逆の操作です。" #: ../../library/functions.rst:255 msgid "" @@ -826,18 +825,18 @@ msgstr "" "クラスメソッドは :func:`property` など、他の :term:`デスクリプタ " "` をラップすることができなくなりました。" -#: ../../library/functions.rst:303 msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " "string, a byte string, or an AST object. Refer to the :mod:`ast` module " "documentation for information on how to work with AST objects." msgstr "" -"*source* をコードオブジェクト、もしくは、 AST オブジェクトにコンパイルしま" -"す。 コードオブジェクトは :func:`exec` 文で実行したり、 :func:`eval` 呼び出し" -"で評価できます。 *source* は通常の文字列、 バイト列、 AST オブジェクトのいず" -"れでもかまいません。 AST オブジェクトへの、また、 AST オブジェクトからのコン" -"パイルの方法は、 :mod:`ast` モジュールのドキュメントを参照してください。" +"*source* をコードオブジェクトまたは AST オブジェクトにコンパイルします。\n" +"コードオブジェクトは :func:`exec` や :func:`eval` で実行できます。\n" +"*source* には、通常の文字列、バイト列、AST オブジェクトのいずれかを指定できま" +"す。\n" +"AST オブジェクトの扱い方については、:mod:`ast` モジュールのドキュメントを参照" +"してください。" #: ../../library/functions.rst:308 msgid "" @@ -1208,14 +1207,13 @@ msgstr "" "だけ情報を集めようとします。結果のリストは必ずしも完全ではなく、カスタムの :" "func:`~object.__getattr__` を持つ場合は不正確かもしれません。" -#: ../../library/functions.rst:513 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " "complete, information:" msgstr "" -"デフォルトの :func:`dir` メカニズムは、完全というより最重要な情報を作成しよう" -"とするため、異なる型のオブジェクトでは異なって振る舞います:" +"デフォルトの :func:`dir` の仕組みは、網羅的な情報よりも関連性の高い情報を返そ" +"うとするため、オブジェクトの型によって異なる動作をします:" #: ../../library/functions.rst:517 msgid "" @@ -1225,13 +1223,12 @@ msgstr "" "オブジェクトがモジュールオブジェクトの場合、リストにはモジュールの属性の名前" "が含まれます。" -#: ../../library/functions.rst:520 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." msgstr "" -"オブジェクトが型オブジェクトやクラスオブジェクトの場合、リストにはその属性の" -"名前と、再帰的にたどったその基底クラスの属性が含まれます。" +"オブジェクトが型オブジェクトまたはクラスオブジェクトの場合、リストにはその属" +"性の名前と、基底クラスを再帰的にたどった属性の名前が含まれます。" #: ../../library/functions.rst:523 msgid "" @@ -1450,9 +1447,8 @@ msgstr "" "デフォルトの *locals* 名前空間のセマンティクスは、 組み込み :func:`locals` の" "説明のように調整された。" -#: ../../library/functions.rst:672 ../../library/functions.rst:754 msgid "*globals* can now be a :class:`frozendict`." -msgstr "*globals* は :class:`frozendict` になるようになった。" +msgstr "*globals* に :class:`frozendict` も指定できるようになりました。" #: ../../library/functions.rst:683 msgid "" @@ -1549,36 +1545,37 @@ msgstr "" msgid "Added the *closure* parameter." msgstr "*closure* パラメータが追加されました。" -#: ../../library/functions.rst:759 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " "iteration, or an iterator. If *function* is ``None``, the identity function " "is assumed, that is, all elements of *iterable* that are false are removed." msgstr "" -"*iterable* の要素のうち、 *function* が真であるものからイテレータを構築しま" -"す。 *iterable* にはシーケンスか、イテレーションをサポートするコンテナか、イ" -"テレータを渡せます。 *function* が ``None`` のときは恒等関数が指定されたもの" -"として扱われ、 *iterable* のうち偽であるものがすべて取り除かれます。" +"*iterable* の要素のうち、*function* を適用した結果が真になる要素からイテレー" +"タを構築します。\n" +"*iterable* には、シーケンス、イテレーションをサポートするコンテナ、イテレータ" +"のいずれかを指定できます。\n" +"*function* が ``None`` の場合は恒等関数が指定されたものとして扱われ、" +"*iterable* の要素のうち偽であるものがすべて取り除かれます。" -#: ../../library/functions.rst:765 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " "not ``None`` and ``(item for item in iterable if item)`` if function is " "``None``." msgstr "" -"なお、``filter(function, iterable)`` は、関数が ``None`` でなければジェネレー" -"タ式 ``(item for item in iterable if function(item))`` と同等で、関数が " -"``None`` なら ``(item for item in iterable if item)`` と同等です。" +"``filter(function, iterable)`` は、``function`` が ``None`` でなければジェネ" +"レータ式 ``(item for item in iterable if function(item))`` と等価です。\n" +"``function`` が ``None`` なら、``(item for item in iterable if item)`` と等価" +"です。" -#: ../../library/functions.rst:770 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." msgstr "" -"逆の働きをする関数については、 :func:`itertools.filterfalse` を参照してくださ" -"い。 *iterable* の要素のうち、 *function* が偽であるものを返します。" +"逆の働きをする関数については :func:`itertools.filterfalse` を参照してくださ" +"い。\n" +"*iterable* の要素のうち、*function* を適用した結果が偽になる要素を返します。" #: ../../library/functions.rst:781 msgid "Return a floating-point number constructed from a number or a string." @@ -1608,7 +1605,6 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -#: ../../library/functions.rst:798 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1618,12 +1614,13 @@ msgid "" "conform to the :token:`~float:floatvalue` production rule in the following " "grammar, after leading and trailing whitespace characters are removed:" msgstr "" -"引数が文字列の場合、10進数でなければなりません。先頭に符号または空白を含んで" -"もかまいません。符号は ``'+'`` か ``'-'`` のいずれかです。正符号 ``'+'`` は生" -"成される値に対して何の効果もありません。引数は NaN (not-a-number) や正または" -"負の無限大をあらわす文字列でもかまいません。より正確にいうと、入力は先頭と末" -"尾の空白文字を除き、以下に示す :token:`~float:floatvalue` の生成規則に従う必" -"要があります:" +"引数が文字列の場合、10進数を含み、必要に応じて先頭に符号を付けたり、前後に空" +"白文字を付けたりできます。\n" +"符号は ``'+'`` または ``'-'`` で、``'+'`` は生成される値に影響しません。\n" +"引数には、NaN (not-a-number)、正または負の無限大を表す文字列も指定できま" +"す。\n" +"より正確には、先頭と末尾の空白文字を取り除いた入力が、以下の文法の :token:" +"`~float:floatvalue` の生成規則に従う必要があります:" #: ../../library/functions.rst:819 msgid "" @@ -1694,7 +1691,6 @@ msgstr "" "デフォルトの *format_spec* は空の文字列です。それは通常 :func:`str(value) " "` の呼び出しと同じ結果になります。" -#: ../../library/functions.rst:861 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1703,12 +1699,14 @@ msgid "" "and the *format_spec* is non-empty, or if either the *format_spec* or the " "return value are not strings." msgstr "" -"``format(value, format_spec)`` の呼び出しは、 ``type(value)." -"__format__(value, format_spec)`` に翻訳され、これは value の :meth:`~object." -"__format__` メソッドの検索をするとき、インスタンス辞書を回避します。このメ" -"ソッドの探索が :mod:`object` に到達しても *format_spec* が空にならなかった" -"り、 *format_spec* や返り値が文字列でなかったりした場合、 :exc:`TypeError` が" -"送出されます。" +"``format(value, format_spec)`` の呼び出しは、``type(value).__format__(value, " +"format_spec)`` に置き換えられ、\n" +"``value`` の :meth:`~object.__format__` メソッドを探す際にインスタンスの辞書" +"を参照しません。\n" +"メソッドの探索が :mod:`object` に到達し、かつ *format_spec* が空でない場合" +"や、\n" +"*format_spec* または返り値が文字列でない場合は、:exc:`TypeError` が送出されま" +"す。" #: ../../library/functions.rst:868 msgid "" @@ -1774,15 +1772,14 @@ msgstr "" "名前を持つ属性) の値を :func:`getattr` で取り出すためには、属性名を手動でマン" "グリングする必要があります。" -#: ../../library/functions.rst:921 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " "same regardless of where the function is called." msgstr "" -"現在のモジュールの名前空間を実装した辞書を返します。関数内のコードに対して" -"は、関数が定義されるときに辞書が設定され、その関数がどこから呼ばれたかにかか" -"わらず同じ内容になります。" +"現在のモジュールの名前空間を実装する辞書を返します。\n" +"関数内のコードでは、この辞書は関数の定義時に決まり、関数がどこから呼び出され" +"ても同じ辞書が使われます。" #: ../../library/functions.rst:928 msgid "" @@ -1845,11 +1842,10 @@ msgstr "" "さい。より詳しい情報は、 :ref:`位置専用引数についての FAQ の項目 ` を参照してください。" -#: ../../library/functions.rst:962 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "" -"この関数は、 :mod:`site` モジュールから、組み込みの名前空間に移されました。" +"この関数は :mod:`site` モジュールによって組み込み名前空間に追加されます。" #: ../../library/functions.rst:964 msgid "" @@ -1916,16 +1912,17 @@ msgstr "" "引数 ``id`` を指定して :ref:`監査イベント ` ``builtins.id`` を送出" "します。" -#: ../../library/functions.rst:1016 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " "converts it to a string (stripping a trailing newline), and returns that. " "When EOF is read, :exc:`EOFError` is raised. Example::" msgstr "" -"引数 *prompt* が存在すれば、それが末尾の改行を除いて標準出力に書き出されま" -"す。次に、この関数は入力から 1 行を読み込み、文字列に変換して (末尾の改行を除" -"いて) 返します。 EOF が読み込まれたとき、 :exc:`EOFError` が送出されます。" +"実引数 *prompt* が指定されている場合、その値を末尾に改行を付けずに標準出力に" +"書き出します。\n" +"次に、入力から1行を読み取り、文字列に変換して末尾の改行を取り除き、その文字列" +"を返します。\n" +"EOF を読み取ると :exc:`EOFError` が送出されます。\n" "例::" #: ../../library/functions.rst:1021 @@ -2026,7 +2023,6 @@ msgstr "" "の先頭に任意の数のゼロを付けたり、前後に空白文字を付けたり、各桁を単一の下線" "で区切ったりしても有効です。" -#: ../../library/functions.rst:1074 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -2039,17 +2035,17 @@ msgid "" "prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not legal, " "while ``int('010')`` and ``int('010', 8)`` are." msgstr "" -"n-進数の整数文字列は、各桁が0から n-1 の数値で表されます。ユニコードの10進数" -"では、各桁は0から9のいずれかです。また10から35までの値は ``a`` から ``z`` (ま" -"たは ``A`` から ``Z``) で表されます。デフォルトの *base* は10です。基数に指定" -"可能な値は0および2から36までの整数です。2進数、8進数、16進数の文字列は、整数" -"リテラルと同様に、それぞれ ``0b``/``0B``, ``0o``/``0O``, または ``0x``/" -"``0X`` をプレフィックスとして追加することができます。基数を0に指定した場合、" -"文字列は :ref:`コードにおける整数リテラル ` と同じように解釈されま" -"す。すなわち、プレフィックスによって基数が2, 8, 10, または 16 のどれになるか" -"が決まります。基数を0にした場合先頭にゼロを追加することはできません: すなわ" -"ち ``int('010', 0)`` は基数を0に指定しているため不正ですが、 ``int('010')`` " -"や ``int('010', 8)`` は有効です。" +"n 進数の整数文字列は、各桁が 0 から n-1 の値を表す数字で構成されます。\n" +"0 から 9 の値は、任意の Unicode 10進数字で表せます。\n" +"10 から 35 の値は、``a`` から ``z`` (または ``A`` から ``Z``) で表せます。\n" +"*base* のデフォルト値は 10 で、指定できる基数は 0 および 2 から 36 です。\n" +"2 進、8 進、16 進の文字列には、コード中の整数リテラルと同様に、それぞれ " +"``0b``/``0B``、``0o``/``0O``、``0x``/``0X`` という接頭辞を付けられます。\n" +"基数が 0 の場合は、:ref:`コード中の整数リテラル ` と同じように、接" +"頭辞によって実際の基数が 2、8、10、16 のいずれかに決まります。\n" +"基数が 0 の場合は先頭に余分なゼロを付けることもできません。\n" +"``int('010', 0)`` は無効ですが、``int('010')`` と ``int('010', 8)`` は有効で" +"す。" #: ../../library/functions.rst:1085 msgid "The integer type is described in :ref:`typesnumeric`." @@ -2241,13 +2237,13 @@ msgid "" msgstr "" "クラス スコープでは、メタクラス コンストラクタに渡された名前空間を返します。" -#: ../../library/functions.rst:1207 msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " "arguments, it returns the local namespace passed in to the function call." msgstr "" -"``exec()`` や ``eval()`` が引数 local と global が分けて使われてる場合では、" -"関数の呼び出しで渡されたローカル名前空間を返します。" +"ローカル用とグローバル用に別々の実引数を渡して ``exec()`` や ``eval()`` を使" +"う場合、\n" +"その関数呼び出しに渡されたローカル名前空間を返します。" #: ../../library/functions.rst:1210 msgid "" @@ -2347,15 +2343,14 @@ msgid "" msgstr "" "iterable の中で最大の要素、または2つ以上の引数の中で最大のものを返します。" -#: ../../library/functions.rst:1269 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " "arguments are provided, the largest of the positional arguments is returned." msgstr "" -"位置引数が1つだけ与えられた場合、それは空でない :term:`iterable` でなくてはい" -"けません。その iterable の最大の要素が返されます。2 つ以上のキーワード無しの" -"位置引数が与えられた場合、その位置引数の中で最大のものが返されます。" +"位置引数が1つの場合は、:term:`iterable` を指定します。\n" +"そのイテラブルの最大の要素を返します。\n" +"位置引数が2つ以上の場合は、それらのうち最大のものを返します。" #: ../../library/functions.rst:1274 ../../library/functions.rst:1312 msgid "" @@ -2408,15 +2403,14 @@ msgid "" msgstr "" "iterable の中で最小の要素、または2つ以上の引数の中で最小のものを返します。" -#: ../../library/functions.rst:1307 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " "arguments are provided, the smallest of the positional arguments is returned." msgstr "" -"位置引数が1つだけ与えられた場合、それは空でない :term:`iterable` でなくてはい" -"けません。その iterable の最小の要素が返されます。2 つ以上のキーワード無しの" -"位置引数が与えられた場合、その位置引数の中で最小のものが返されます。" +"位置引数が1つの場合は、:term:`iterable` を指定します。\n" +"そのイテラブルの最小の要素を返します。\n" +"位置引数が2つ以上の場合は、それらのうち最小のものを返します。" #: ../../library/functions.rst:1318 msgid "" @@ -2590,15 +2584,15 @@ msgstr "``'+'``" msgid "open for updating (reading and writing)" msgstr "更新用に開く (読み込み・書き込み用)" -#: ../../library/functions.rst:1419 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " "``'r+b'`` open the file with no truncation." msgstr "" -"デフォルトのモードは ``'r'`` (テキストの読み込み用に開く、 ``'rt'`` と同義) " -"です。 ``'w+'`` と ``'w+b'`` はファイルを開いて上書きします。 ``'r+'`` と " -"``'r+b'`` はファイルを上書きせずに開きます。" +"デフォルトのモードは ``'r'`` です (テキストの読み込み用に開き、``'rt'`` と同" +"義です)。\n" +"モード ``'w+'`` と ``'w+b'`` はファイルを開いて内容を切り詰めます。\n" +"モード ``'r+'`` と ``'r+b'`` は、内容を切り詰めずにファイルを開きます。" #: ../../library/functions.rst:1423 msgid "" @@ -2900,13 +2894,12 @@ msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "" ":class:`os.PathLike` を実装したオブジェクトを受け入れるようになりました。" -#: ../../library/functions.rst:1570 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." msgstr "" -"Windowsでは、コンソールバッファのオープンは、:class:`io.FileIO` ではなく、:" -"class:`io.RawIOBase` のサブクラスを返すでしょう。" +"Windows では、コンソールバッファを開くと、:class:`io.FileIO` 以外の :class:" +"`io.RawIOBase` のサブクラスが返される場合があります。" #: ../../library/functions.rst:1573 msgid "The ``'U'`` mode has been removed." @@ -3238,7 +3231,6 @@ msgstr "" ":class:`range` は、実際には関数ではなくイミュータブルなシーケンス型で、 :ref:" "`typesseq-range` と :ref:`typesseq` にドキュメント化されています。" -#: ../../library/functions.rst:1759 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -3250,14 +3242,16 @@ msgid "" "method. If :func:`sys.displayhook` is not accessible, this function will " "raise :exc:`RuntimeError`." msgstr "" -"オブジェクトの印字可能な表現を含む文字列を返します。この関数は多くの型につい" -"て、 :func:`eval` に渡されたときと同じ値を持つようなオブジェクトを表す文字列" -"を生成しようとします。そうでない場合は、山括弧に囲まれたオブジェクトの型の名" -"前と追加の情報 (大抵の場合はオブジェクトの名前とアドレスを含みます) を返しま" -"す。クラスは、 :meth:`~object.__repr__` メソッドを定義することで、この関数に" -"よりそのクラスのインスタンスが返すものを制御することができます。:func:`sys." -"displayhook` にアクセスできない場合、この関数は :exc:`RuntimeError` を送出し" -"ます。" +"オブジェクトの印字可能な表現を含む文字列を返します。\n" +"多くの型では、:func:`eval` に渡すと元のオブジェクトと同じ値を持つオブジェクト" +"が得られるような文字列を返そうとします。\n" +"それ以外の場合、オブジェクトの型名と追加情報を含む、山括弧で囲まれた文字列を" +"返します。\n" +"追加情報には、オブジェクトの名前やアドレスが含まれることがよくあります。\n" +"クラスに :meth:`~object.__repr__` メソッドを定義すると、そのクラスのインスタ" +"ンスに対してこの関数が返すものを制御できます。\n" +":func:`sys.displayhook` にアクセスできない場合、この関数は :exc:" +"`RuntimeError` を送出します。" #: ../../library/functions.rst:1770 msgid "This class has a custom representation that can be evaluated::" @@ -3738,13 +3732,13 @@ msgstr "" "*start* パラメータをキーワード引数として指定することができるようになりまし" "た。" -#: ../../library/functions.rst:2047 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy and " "better commutativity on most builds." msgstr "" -"浮動小数点数の総和を計算するとき、ほとんどの環境でより高精度な結果とより良い" -"互換性が得られるアルゴリズムを使用するようになりました。" +"浮動小数点数の総和を計算するアルゴリズムが変更され、\n" +"ほとんどのビルドで精度が向上し、加算する順序を入れ替えたときも結果がより一致" +"しやすくなりました。" #: ../../library/functions.rst:2050 msgid "" @@ -4170,15 +4164,14 @@ msgid "" "is :term:`exhausted` before the others:" msgstr "" -#: ../../library/functions.rst:2282 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -"``strict=True`` 引数なしの場合、長さの異なるイテラブルを生じる原因となるいか" -"なるバグも、この時点では問題なく処理されます。そして代わりにプログラムの別の" -"場所で、原因を特定しにくいバグとして検出されることになるでしょう。" +"``strict=True`` を指定しないと、イテラブルの長さが異なる原因となるバグが表面" +"化せず、\n" +"プログラムの別の場所で発見しにくいバグとして現れる場合があります。" #: ../../library/functions.rst:2286 msgid "" @@ -4216,12 +4209,11 @@ msgstr "" "``n`` 回呼び出した結果となるよう、 *同じ* イテレータを ``n`` 回繰り返します。" "これは入力を長さ n のチャンクに分割する効果があります。" -#: ../../library/functions.rst:2301 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -":func:`zip` に続けて ``*`` 演算子を使うと、zip したリストを元に戻せます::" +":func:`zip` と ``*`` 演算子を組み合わせると、zip したリストを元に戻せます::" #: ../../library/functions.rst:2304 msgid "" @@ -4289,7 +4281,6 @@ msgstr "" "使われず、 *globals* は :keyword:`import` 文のパッケージコンテキストを決定す" "るためにのみ使われます。" -#: ../../library/functions.rst:2343 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -4297,10 +4288,12 @@ msgid "" "directory of the module calling :func:`__import__` (see :pep:`328` for the " "details)." msgstr "" -"*level* は絶対と相対どちらのインポートを使うかを指定します。 ``0`` (デフォル" -"ト) は絶対インポートのみ実行します。正の *level* の値は、 :func:`__import__` " -"を呼び出したディレクトリから検索対象となる親ディレクトリの数を示します (詳細" -"は :pep:`328` を参照してください)。" +"*level* は、絶対インポートと相対インポートのどちらを使うかを指定します。\n" +"``0`` (デフォルト) は、絶対インポートだけを行うことを意味します。\n" +"正の *level* は、:func:`__import__` を呼び出すモジュールのディレクトリを基準" +"に、\n" +"検索対象となる親ディレクトリの数を示します (詳細は :pep:`328` を参照してくだ" +"さい)。" #: ../../library/functions.rst:2349 msgid "" diff --git a/library/getpass.po b/library/getpass.po index 092133470..a4496511b 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -30,9 +30,8 @@ msgstr ":mod:`!getpass` --- 可搬性のあるパスワード入力機構" msgid "**Source code:** :source:`Lib/getpass.py`" msgstr "**ソースコード:** :source:`Lib/getpass.py`" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/grp.po b/library/grp.po index b064e3db7..4e08c675e 100644 --- a/library/grp.po +++ b/library/grp.po @@ -34,9 +34,8 @@ msgstr "" "このモジュールでは Unix グループ (group) データベースへのアクセス機構を提供し" "ます。全ての Unix バージョンで利用可能です。" -#: ../../library/grp.rst:12 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/grp.rst:14 msgid "" diff --git a/library/http.client.po b/library/http.client.po index 889fb5eb0..da41dacc0 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -57,9 +57,8 @@ msgstr "" "HTTPS のサポートは、Python が SSL サポート付きでコンパイルされている場合にの" "み利用できます (:mod:`ssl` モジュールによって)。" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/http.server.po b/library/http.server.po index 03f67b737..017f46f56 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -40,9 +40,8 @@ msgid "" "ref:`basic security checks `." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/imaplib.po b/library/imaplib.po index 7fa9df410..144f65ae5 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -39,9 +39,8 @@ msgid "" "that the ``STATUS`` command is not supported in IMAP4." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/importlib.po b/library/importlib.po index f46ec2697..0c41eef8a 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -1622,9 +1622,8 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1147 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/importlib.rst:1155 msgid "Path to the ``.fwork`` file for the extension module." diff --git a/library/mimetypes.po b/library/mimetypes.po index a5129985f..ca66714db 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -419,9 +419,8 @@ msgstr "" msgid "Load MIME type information from the Windows registry." msgstr "MIME type 情報を Windows のレジストリから読み込みます。" -#: ../../library/mimetypes.rst:295 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/mimetypes.rst:305 msgid "" diff --git a/library/mmap.po b/library/mmap.po index 9145852a4..9fbfaa8c4 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -26,9 +26,8 @@ msgstr "" msgid ":mod:`!mmap` --- Memory-mapped file support" msgstr ":mod:`!mmap` --- メモリマップファイルのサポート" -#: ../../library/mmap.rst:347 ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/msvcrt.po b/library/msvcrt.po index 405b79d48..10c8f72c3 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -62,9 +62,8 @@ msgstr "" "ます。通常版の API は ASCII 文字列のためのもので、国際化アプリケーションでは" "利用が制限されます。可能な限りワイド文字列版APIを利用するべきです。" -#: ../../library/msvcrt.rst:24 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/msvcrt.rst:26 msgid "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 6359ea886..bcb058e74 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -31,9 +31,8 @@ msgstr ":mod:`!multiprocessing` --- プロセスベースの並列処理" msgid "**Source code:** :source:`Lib/multiprocessing/`" msgstr "**ソースコード:** :source:`Lib/multiprocessing/`" -#: ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/os.path.po b/library/os.path.po index 6318715c7..40cdebd19 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -467,9 +467,8 @@ msgid "" "available." msgstr "" -#: ../../library/os.path.rst:374 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/os.path.rst:381 msgid "" diff --git a/library/os.po b/library/os.po index a8cbe952c..af14a9eda 100644 --- a/library/os.po +++ b/library/os.po @@ -194,9 +194,9 @@ msgstr "" "ファイルシステムのエンコーディングでこれが保証されなかった場合は、API 関数" "が :exc:`UnicodeError` を送出します。" -#: ../../library/os.rst:100 msgid "See also the :term:`locale encoding`." msgstr "" +":term:`ロケールエンコーディング ` も参照してください。" #: ../../library/os.rst:106 msgid "Python UTF-8 Mode" @@ -323,110 +323,8 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "プロセスの制御端末に対応するファイル名を返します。" -#: ../../library/os.rst:178 ../../library/os.rst:354 ../../library/os.rst:369 -#: ../../library/os.rst:390 ../../library/os.rst:399 ../../library/os.rst:408 -#: ../../library/os.rst:421 ../../library/os.rst:430 ../../library/os.rst:458 -#: ../../library/os.rst:466 ../../library/os.rst:474 ../../library/os.rst:494 -#: ../../library/os.rst:512 ../../library/os.rst:523 ../../library/os.rst:535 -#: ../../library/os.rst:544 ../../library/os.rst:554 ../../library/os.rst:565 -#: ../../library/os.rst:577 ../../library/os.rst:613 ../../library/os.rst:620 -#: ../../library/os.rst:627 ../../library/os.rst:636 ../../library/os.rst:673 -#: ../../library/os.rst:686 ../../library/os.rst:695 ../../library/os.rst:712 -#: ../../library/os.rst:721 ../../library/os.rst:728 ../../library/os.rst:737 -#: ../../library/os.rst:746 ../../library/os.rst:753 ../../library/os.rst:760 -#: ../../library/os.rst:769 ../../library/os.rst:816 ../../library/os.rst:892 -#: ../../library/os.rst:1014 ../../library/os.rst:1040 -#: ../../library/os.rst:1053 ../../library/os.rst:1070 -#: ../../library/os.rst:1088 ../../library/os.rst:1099 -#: ../../library/os.rst:1119 ../../library/os.rst:1140 -#: ../../library/os.rst:1152 ../../library/os.rst:1163 -#: ../../library/os.rst:1176 ../../library/os.rst:1197 -#: ../../library/os.rst:1218 ../../library/os.rst:1230 -#: ../../library/os.rst:1241 ../../library/os.rst:1302 -#: ../../library/os.rst:1425 ../../library/os.rst:1437 -#: ../../library/os.rst:1451 ../../library/os.rst:1461 -#: ../../library/os.rst:1476 ../../library/os.rst:1491 -#: ../../library/os.rst:1504 ../../library/os.rst:1521 -#: ../../library/os.rst:1548 ../../library/os.rst:1565 -#: ../../library/os.rst:1579 ../../library/os.rst:1588 -#: ../../library/os.rst:1597 ../../library/os.rst:1612 -#: ../../library/os.rst:1624 ../../library/os.rst:1653 -#: ../../library/os.rst:1665 ../../library/os.rst:1675 -#: ../../library/os.rst:1689 ../../library/os.rst:1768 -#: ../../library/os.rst:1788 ../../library/os.rst:1797 -#: ../../library/os.rst:1809 ../../library/os.rst:1863 -#: ../../library/os.rst:1887 ../../library/os.rst:1897 -#: ../../library/os.rst:1905 ../../library/os.rst:1914 -#: ../../library/os.rst:1925 ../../library/os.rst:1962 -#: ../../library/os.rst:1989 ../../library/os.rst:2041 -#: ../../library/os.rst:2047 ../../library/os.rst:2218 -#: ../../library/os.rst:2295 ../../library/os.rst:2312 -#: ../../library/os.rst:2326 ../../library/os.rst:2352 -#: ../../library/os.rst:2370 ../../library/os.rst:2386 -#: ../../library/os.rst:2403 ../../library/os.rst:2470 -#: ../../library/os.rst:2494 ../../library/os.rst:2514 -#: ../../library/os.rst:2662 ../../library/os.rst:2684 -#: ../../library/os.rst:2735 ../../library/os.rst:2747 -#: ../../library/os.rst:2769 ../../library/os.rst:3489 -#: ../../library/os.rst:3521 ../../library/os.rst:3531 -#: ../../library/os.rst:3541 ../../library/os.rst:3551 -#: ../../library/os.rst:3625 ../../library/os.rst:3635 -#: ../../library/os.rst:3645 ../../library/os.rst:3674 -#: ../../library/os.rst:3734 ../../library/os.rst:3746 -#: ../../library/os.rst:3775 ../../library/os.rst:3785 -#: ../../library/os.rst:3794 ../../library/os.rst:3806 -#: ../../library/os.rst:3818 ../../library/os.rst:3832 -#: ../../library/os.rst:3918 ../../library/os.rst:3926 -#: ../../library/os.rst:3934 ../../library/os.rst:3942 -#: ../../library/os.rst:3950 ../../library/os.rst:3958 -#: ../../library/os.rst:3966 ../../library/os.rst:3974 -#: ../../library/os.rst:3982 ../../library/os.rst:3990 -#: ../../library/os.rst:4111 ../../library/os.rst:4134 -#: ../../library/os.rst:4148 ../../library/os.rst:4372 -#: ../../library/os.rst:4397 ../../library/os.rst:4422 -#: ../../library/os.rst:4476 ../../library/os.rst:4485 -#: ../../library/os.rst:4494 ../../library/os.rst:4502 -#: ../../library/os.rst:4511 ../../library/os.rst:4520 -#: ../../library/os.rst:4593 ../../library/os.rst:4655 -#: ../../library/os.rst:4665 ../../library/os.rst:4683 -#: ../../library/os.rst:4692 ../../library/os.rst:4702 -#: ../../library/os.rst:4712 ../../library/os.rst:4722 -#: ../../library/os.rst:4733 ../../library/os.rst:4882 -#: ../../library/os.rst:4951 ../../library/os.rst:4986 -#: ../../library/os.rst:4994 ../../library/os.rst:5001 -#: ../../library/os.rst:5008 ../../library/os.rst:5015 -#: ../../library/os.rst:5022 ../../library/os.rst:5029 -#: ../../library/os.rst:5036 ../../library/os.rst:5044 -#: ../../library/os.rst:5052 ../../library/os.rst:5059 -#: ../../library/os.rst:5066 ../../library/os.rst:5075 -#: ../../library/os.rst:5083 ../../library/os.rst:5091 -#: ../../library/os.rst:5098 ../../library/os.rst:5105 -#: ../../library/os.rst:5154 ../../library/os.rst:5186 -#: ../../library/os.rst:5209 ../../library/os.rst:5225 -#: ../../library/os.rst:5232 ../../library/os.rst:5243 -#: ../../library/os.rst:5253 ../../library/os.rst:5262 -#: ../../library/os.rst:5294 ../../library/os.rst:5405 -#: ../../library/os.rst:5421 ../../library/os.rst:5454 -#: ../../library/os.rst:5523 ../../library/os.rst:5545 -#: ../../library/os.rst:5556 ../../library/os.rst:5568 -#: ../../library/os.rst:5613 ../../library/os.rst:5650 -#: ../../library/os.rst:5673 ../../library/os.rst:5694 -#: ../../library/os.rst:5728 ../../library/os.rst:5769 -#: ../../library/os.rst:5789 ../../library/os.rst:5803 -#: ../../library/os.rst:5820 ../../library/os.rst:5835 -#: ../../library/os.rst:5846 ../../library/os.rst:5858 -#: ../../library/os.rst:5871 ../../library/os.rst:5880 -#: ../../library/os.rst:5890 ../../library/os.rst:5903 -#: ../../library/os.rst:5938 ../../library/os.rst:5954 -#: ../../library/os.rst:5965 ../../library/os.rst:5977 -#: ../../library/os.rst:5984 ../../library/os.rst:5993 -#: ../../library/os.rst:6002 ../../library/os.rst:6011 -#: ../../library/os.rst:6020 ../../library/os.rst:6184 -#: ../../library/os.rst:6193 ../../library/os.rst:6217 -#: ../../library/os.rst:6244 ../../library/os.rst:6253 -#: ../../library/os.rst:6376 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/os.rst:183 msgid "" diff --git a/library/poplib.po b/library/poplib.po index b789e7df2..1311225d6 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -70,9 +70,8 @@ msgstr "" "ら、 :class:`imaplib.IMAP4` クラスが使えます。 IMAPサーバーは、より良く実装さ" "れている傾向があります。" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/posix.po b/library/posix.po index 4bbec47f4..61d9ed2fe 100644 --- a/library/posix.po +++ b/library/posix.po @@ -36,9 +36,8 @@ msgstr "" "(Unix インターフェースをほんの少し隠蔽した) POSIX 標準で標準化されている機能" "に対するアクセス機構を提供します。" -#: ../../library/posix.rst:13 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/posix.rst:17 msgid "" diff --git a/library/pty.po b/library/pty.po index 51c999ffa..19eefbdd3 100644 --- a/library/pty.po +++ b/library/pty.po @@ -37,9 +37,8 @@ msgid "" "its controlling terminal programmatically." msgstr "" -#: ../../library/pty.rst:15 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/pty.rst:17 msgid "" diff --git a/library/pwd.po b/library/pwd.po index 47b7b390a..f29b1fdec 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -34,9 +34,8 @@ msgstr "" "このモジュールは Unix のユーザアカウントとパスワードのデータベースへのアクセ" "スを提供します。全ての Unix 系 OS で利用できます。" -#: ../../library/pwd.rst:12 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/pwd.rst:14 msgid "" diff --git a/library/readline.po b/library/readline.po index 2e54027ee..3bdf5f036 100644 --- a/library/readline.po +++ b/library/readline.po @@ -54,9 +54,8 @@ msgstr "" "chet/readline/rluserman.html#Readline-Init-File>`_ を参照して、そのファイルの" "形式や可能な構成、 Readline ライブラリ全体の機能を知ってください。" -#: ../../library/readline.rst:28 ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/resource.po b/library/resource.po index 51665ef1e..1f1c7ceb5 100644 --- a/library/resource.po +++ b/library/resource.po @@ -34,16 +34,8 @@ msgstr "" "このモジュールでは、プログラムによって使用されているシステムリソースを計測し" "たり制御するための基本的なメカニズムを提供します。" -#: ../../library/resource.rst:12 ../../library/resource.rst:114 -#: ../../library/resource.rst:191 ../../library/resource.rst:203 -#: ../../library/resource.rst:212 ../../library/resource.rst:221 -#: ../../library/resource.rst:231 ../../library/resource.rst:240 -#: ../../library/resource.rst:251 ../../library/resource.rst:265 -#: ../../library/resource.rst:274 ../../library/resource.rst:283 -#: ../../library/resource.rst:293 ../../library/resource.rst:303 -#: ../../library/resource.rst:312 ../../library/resource.rst:322 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/resource.rst:14 msgid "" diff --git a/library/runpy.po b/library/runpy.po index b4fbf5aef..0b51fde00 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -101,9 +101,8 @@ msgid "" "to the *mod_name* argument otherwise." msgstr "" "``__name__`` は、 *run_name* が :const:`None` でない場合は *run_name* に設定" -"されます。 *run_name* が :const:`None` である場合、 *mod_name* がパッケージで" -"あれば ``mod_name + '.__main__'`` に、それ以外では *mod_name* に設定されま" -"す。" +"されます。 *run_name* が ``None`` である場合、 *mod_name* がパッケージであれ" +"ば ``mod_name + '.__main__'`` に、それ以外では *mod_name* に設定されます。" #: ../../library/runpy.rst:60 msgid "" diff --git a/library/select.po b/library/select.po index 890f640bf..90d783bb6 100644 --- a/library/select.po +++ b/library/select.po @@ -53,12 +53,8 @@ msgid "" "precise control over the OS-level primitives used." msgstr "" -#: ../../library/select.rst:57 ../../library/select.rst:99 -#: ../../library/select.rst:109 ../../library/select.rst:122 -#: ../../library/select.rst:130 ../../library/select.rst:196 -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/selectors.po b/library/selectors.po index 7a5eeea0a..bc191178a 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -90,9 +90,8 @@ msgstr ":mod:`select`" msgid "Low-level I/O multiplexing module." msgstr "低水準の I/O 多重化モジュールです。" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/shutil.po b/library/shutil.po index c3a3f16d2..2161e5370 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -726,9 +726,8 @@ msgstr "" "Windowsにおいても *path* にディレクトリだけでなくファイルを指定できるようにな" "りました。" -#: ../../library/shutil.rst:441 ../../library/shutil.rst:455 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/shutil.rst:446 msgid "Change owner *user* and/or *group* of the given *path*." diff --git a/library/signal.po b/library/signal.po index 379fc8153..b73b1fee1 100644 --- a/library/signal.po +++ b/library/signal.po @@ -182,25 +182,8 @@ msgid "" "`SIG_UNBLOCK` and :const:`SIG_SETMASK`." msgstr "" -#: ../../library/signal.rst:108 ../../library/signal.rst:141 -#: ../../library/signal.rst:147 ../../library/signal.rst:153 -#: ../../library/signal.rst:159 ../../library/signal.rst:165 -#: ../../library/signal.rst:171 ../../library/signal.rst:185 -#: ../../library/signal.rst:203 ../../library/signal.rst:211 -#: ../../library/signal.rst:217 ../../library/signal.rst:223 -#: ../../library/signal.rst:233 ../../library/signal.rst:240 -#: ../../library/signal.rst:255 ../../library/signal.rst:261 -#: ../../library/signal.rst:267 ../../library/signal.rst:273 -#: ../../library/signal.rst:279 ../../library/signal.rst:297 -#: ../../library/signal.rst:307 ../../library/signal.rst:386 -#: ../../library/signal.rst:425 ../../library/signal.rst:449 -#: ../../library/signal.rst:472 ../../library/signal.rst:506 -#: ../../library/signal.rst:537 ../../library/signal.rst:548 -#: ../../library/signal.rst:603 ../../library/signal.rst:645 -#: ../../library/signal.rst:660 ../../library/signal.rst:685 -#: ../../library/signal.rst:705 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/signal.rst:110 ../../library/signal.rst:508 msgid "" diff --git a/library/smtplib.po b/library/smtplib.po index 8e96c11e9..946c9b591 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -38,9 +38,8 @@ msgid "" "Mail Transfer Protocol) and :rfc:`1869` (SMTP Service Extensions)." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/socket.po b/library/socket.po index 59c2d4e5c..62395bc90 100644 --- a/library/socket.po +++ b/library/socket.po @@ -48,40 +48,8 @@ msgstr "" "いくつかの挙動はプラットフォームに依存します。オペレーティングシステムのソ" "ケットAPIを呼び出しているためです。" -#: ../../library/socket.rst:198 ../../library/socket.rst:208 -#: ../../library/socket.rst:236 ../../library/socket.rst:243 -#: ../../library/socket.rst:260 ../../library/socket.rst:410 -#: ../../library/socket.rst:500 ../../library/socket.rst:517 -#: ../../library/socket.rst:532 ../../library/socket.rst:543 -#: ../../library/socket.rst:552 ../../library/socket.rst:561 -#: ../../library/socket.rst:572 ../../library/socket.rst:584 -#: ../../library/socket.rst:595 ../../library/socket.rst:608 -#: ../../library/socket.rst:636 ../../library/socket.rst:648 -#: ../../library/socket.rst:654 ../../library/socket.rst:686 -#: ../../library/socket.rst:739 ../../library/socket.rst:751 -#: ../../library/socket.rst:760 ../../library/socket.rst:775 -#: ../../library/socket.rst:784 ../../library/socket.rst:792 -#: ../../library/socket.rst:809 ../../library/socket.rst:824 -#: ../../library/socket.rst:834 ../../library/socket.rst:966 -#: ../../library/socket.rst:1091 ../../library/socket.rst:1107 -#: ../../library/socket.rst:1120 ../../library/socket.rst:1135 -#: ../../library/socket.rst:1152 ../../library/socket.rst:1163 -#: ../../library/socket.rst:1174 ../../library/socket.rst:1185 -#: ../../library/socket.rst:1274 ../../library/socket.rst:1294 -#: ../../library/socket.rst:1320 ../../library/socket.rst:1343 -#: ../../library/socket.rst:1375 ../../library/socket.rst:1386 -#: ../../library/socket.rst:1413 ../../library/socket.rst:1430 -#: ../../library/socket.rst:1447 ../../library/socket.rst:1461 -#: ../../library/socket.rst:1572 ../../library/socket.rst:1619 -#: ../../library/socket.rst:1633 ../../library/socket.rst:1653 -#: ../../library/socket.rst:1700 ../../library/socket.rst:1733 -#: ../../library/socket.rst:1746 ../../library/socket.rst:1872 -#: ../../library/socket.rst:1916 ../../library/socket.rst:2024 -#: ../../library/socket.rst:2042 ../../library/socket.rst:2126 -#: ../../library/socket.rst:2136 ../../library/socket.rst:2148 -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/socketserver.po b/library/socketserver.po index 2ca5746bb..2f9ea8b23 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -36,9 +36,8 @@ msgid "" "servers." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/ssl.po b/library/ssl.po index 5805e2419..f847d5186 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -64,10 +64,8 @@ msgstr "" "フォルト設定はアプリケーションに十分ではないので、読まない場合はセキュリティ" "に誤った意識を持ってしまうかもしれません。" -#: ../../library/ssl.rst:471 ../../library/ssl.rst:486 -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/stat.po b/library/stat.po index f76b42e9e..7765910ba 100644 --- a/library/stat.po +++ b/library/stat.po @@ -483,9 +483,8 @@ msgstr "" msgid "All super-user supported flags" msgstr "" -#: ../../library/stat.rst:407 ../../library/stat.rst:415 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/stat.rst:413 msgid "All super-user read-only synthetic flags" diff --git a/library/stdtypes.po b/library/stdtypes.po index ffae3304b..df445dee9 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -53,7 +53,6 @@ msgstr "" "インプレースに足し、引き、または並べ替えて、特定の要素を返さないメソッドは、" "コレクション自身ではなく ``None`` を返します。" -#: ../../library/stdtypes.rst:22 msgid "" "Some operations are supported by several object types; in particular, " "practically all objects can be compared for equality, tested for truth " @@ -61,10 +60,12 @@ msgid "" "slightly different :func:`str` function). The latter function is implicitly " "used when an object is written by the :func:`print` function." msgstr "" -"演算には、複数の型でサポートされているものがあります; 特に、ほぼ全てのオブ" -"ジェクトは、等価比較でき、真理値を判定でき、 (:func:`repr` 関数や、わずかに異" -"なる :func:`str` 関数によって) 文字列に変換できます。オブジェクトが :func:" -"`print` 関数で印字されるとき、文字列に変換する関数が暗黙に使われます。" +"いくつかの演算は、複数のオブジェクト型でサポートされています。\n" +"特に、ほぼすべてのオブジェクトでは、等価性の比較、真理値の判定、文字列への変" +"換ができます (文字列への変換には :func:`repr` 関数や、それとは少し異なる :" +"func:`str` 関数を使います)。\n" +":func:`print` 関数でオブジェクトを出力する際には、後者の関数が暗黙的に使われ" +"ます。" #: ../../library/stdtypes.rst:32 msgid "Truth Value Testing" @@ -455,13 +456,12 @@ msgid "" "mathematical formula, for example::" msgstr "" -#: ../../library/stdtypes.rst:282 msgid "" "x + complex(u, v) = complex(x + u, v)\n" "x * complex(u, v) = complex(x * u, x * v)" msgstr "" -"x + complex(u, v) = complex(x + u, v)x * complex(u, v) = complex(x * u, x * " -"v)" +"x + complex(u, v) = complex(x + u, v)\n" +"x * complex(u, v) = complex(x * u, x * v)" #: ../../library/stdtypes.rst:285 msgid "" @@ -779,15 +779,14 @@ msgstr "" msgid "Bitwise Operations on Integer Types" msgstr "整数型におけるビット単位演算" -#: ../../library/stdtypes.rst:421 msgid "" "Bitwise operations only make sense for integers. The result of bitwise " "operations is calculated as though carried out in two's complement with an " "infinite number of sign bits." msgstr "" -"ビット単位演算は整数についてのみ意味を持ちます。\n" -"ビット単位演算の結果は、あたかも両方の値の先頭を無限個の符号ビットで埋めたも" -"のに対して計算したかのような値になります。" +"ビット単位演算は、整数についてのみ意味を持ちます。\n" +"その結果は、符号ビットを無限個持つ2の補数表現で演算した場合と同じになるよう計" +"算されます。" #: ../../library/stdtypes.rst:425 msgid "" @@ -913,14 +912,18 @@ msgid "" msgstr "" "整数を、符号と先頭の 0 は除いて二進法で表すために必要なビットの数を返します::" -#: ../../library/stdtypes.rst:479 msgid "" ">>> n = -37\n" ">>> bin(n)\n" "'-0b100101'\n" ">>> n.bit_length()\n" "6" -msgstr ">>> n = -37>>> bin(n)'-0b100101'>>> n.bit_length()6" +msgstr "" +">>> n = -37\n" +">>> bin(n)\n" +"'-0b100101'\n" +">>> n.bit_length()\n" +"6" #: ../../library/stdtypes.rst:485 msgid "" @@ -956,7 +959,6 @@ msgstr "" "整数の絶対値の二進数表現における 1 の数を返します。これは population count と" "しても知られています。 例::" -#: ../../library/stdtypes.rst:506 msgid "" ">>> n = 19\n" ">>> bin(n)\n" @@ -965,7 +967,14 @@ msgid "" "3\n" ">>> (-n).bit_count()\n" "3" -msgstr ">>> n = 19>>> bin(n)'0b10011'>>> n.bit_count()3>>> (-n).bit_count()3" +msgstr "" +">>> n = 19\n" +">>> bin(n)\n" +"'0b10011'\n" +">>> n.bit_count()\n" +"3\n" +">>> (-n).bit_count()\n" +"3" #: ../../library/stdtypes.rst:516 msgid "" @@ -1176,15 +1185,17 @@ msgstr "" "浮動小数点数インスタンスが有限の整数値なら ``True`` を、そうでなければ " "``False`` を返します::" -#: ../../library/stdtypes.rst:673 msgid "" ">>> (-2.0).is_integer()\n" "True\n" ">>> (3.2).is_integer()\n" "False" -msgstr ">>> (-2.0).is_integer()True>>> (3.2).is_integer()False" +msgstr "" +">>> (-2.0).is_integer()\n" +"True\n" +">>> (3.2).is_integer()\n" +"False" -#: ../../library/stdtypes.rst:678 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -1193,11 +1204,11 @@ msgid "" "of floating-point numbers. This can be useful when debugging, and in " "numerical work." msgstr "" -"16 進表記の文字列へ、または、 16 進表記からの変換をサポートする二つのメソッド" -"があります。 Python の浮動小数点数は内部的には2進数で保持されるので、浮動小数" -"点数の *10進数* へまたは *10進数* からの変換には若干の丸め誤差があります。そ" -"れに対し、16 進表記では、浮動小数点数を正確に表現できます。これはデバッグのと" -"きや、数学的な用途 (numerical work) に便利でしょう。" +"16進文字列との相互変換をサポートするメソッドが二つあります。\n" +"Python の浮動小数点数は内部では2進数として格納されるため、浮動小数点数と *10" +"進文字列* との相互変換では通常、小さな丸め誤差が生じます。\n" +"一方、16進文字列では浮動小数点数を正確に表現したり指定したりできます。\n" +"これはデバッグや数値計算に役立つことがあります。" #: ../../library/stdtypes.rst:689 msgid "" @@ -1257,11 +1268,12 @@ msgstr "" "えます。例えば、16 進文字列 ``0x3.a7p10`` は浮動小数点数 ``(3 + 10./16 + " "7./16**2) * 2.0**10`` すなわち ``3740.0`` を表します::" -#: ../../library/stdtypes.rst:728 msgid "" ">>> float.fromhex('0x3.a7p10')\n" "3740.0" -msgstr ">>> float.fromhex('0x3.a7p10')3740.0" +msgstr "" +">>> float.fromhex('0x3.a7p10')\n" +"3740.0" #: ../../library/stdtypes.rst:732 msgid "" @@ -1271,11 +1283,12 @@ msgstr "" "逆変換を ``3740.0`` に適用すると、同じ数を表す異なる 16 進文字列表現を返しま" "す::" -#: ../../library/stdtypes.rst:735 msgid "" ">>> float.hex(3740.0)\n" "'0x1.d380000000000p+11'" -msgstr ">>> float.hex(3740.0)'0x1.d380000000000p+11'" +msgstr "" +">>> float.hex(3740.0)\n" +"'0x1.d380000000000p+11'" #: ../../library/stdtypes.rst:740 msgid "Additional Methods on Complex" @@ -1403,15 +1416,14 @@ msgstr "" "``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))`` に収ま" "ります。再び、結果が ``-1`` なら、 ``-2`` で置き換えられます。" -#: ../../library/stdtypes.rst:808 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " "the built-in hash, for computing the hash of a rational number, :class:" "`float`, or :class:`complex`::" msgstr "" -"上述の規則をわかりやすくするため、有理数 :class:`float` や、 :class:" -"`complex` のハッシュを計算する組み込みのハッシュと等価な Python コードの例を" -"挙げます::" +"上の規則を明確にするため、有理数、:class:`float`、:class:`complex` のハッシュ" +"を計算する Python コードの例を示します。\n" +"このコードは組み込みのハッシュ計算と等価です::" #: ../../library/stdtypes.rst:813 msgid "" @@ -1832,23 +1844,25 @@ msgstr "" "class:`str`, :class:`bytes`, :class:`bytearray` のような) 特殊なシーケンスで" "は部分シーケンス判定にも使われます::" -#: ../../library/stdtypes.rst:1070 msgid "" ">>> \"gg\" in \"eggs\"\n" "True" -msgstr ">>> \"gg\" in \"eggs\"True" +msgstr "" +">>> \"gg\" in \"eggs\"\n" +"True" -#: ../../library/stdtypes.rst:1074 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " "not copied; they are referenced multiple times. This often haunts new " "Python programmers; consider::" msgstr "" -"``0`` 未満の値 *n* は ``0`` として扱われます (これは *s* と同じ型の空のシーケ" -"ンスを表します)。シーケンス *s* の要素はコピーされないので注意してください; " -"コピーではなく要素に対する参照カウントが増えます。これは Python に慣れていな" -"いプログラマをよく悩ませます。例えば以下のコードを考えます:" +"``0`` 未満の *n* は ``0`` として扱われます (結果は *s* と同じ型の空のシーケン" +"スになります)。\n" +"シーケンス *s* の要素はコピーされず、同じ要素が複数回参照されることに注意して" +"ください。\n" +"これは Python に慣れていないプログラマをよく悩ませます。\n" +"次のコードを考えてみてください::" #: ../../library/stdtypes.rst:1079 msgid "" @@ -2176,18 +2190,16 @@ msgstr "" "*k* が ``1`` と等しくない場合、 *t* はそれが入れ替えるスライスと同じ長さでな" "ければなりません。" -#: ../../library/stdtypes.rst:1278 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " "the sequence are not copied; they are referenced multiple times, as " "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -"値 *n* は整数であるか、:meth:`~object.__index__` を実装したオブジェクトで" -"す。 *n* の値がゼロまたは負数の場合、シーケンスをクリアします。:ref:" -"`typesseq-common` で ``s * n`` について説明したとおり、シーケンスの要素はコ" -"ピーされないので注意してください; コピーではなく要素に対する参照カウントが増" -"えます。" +"*n* は整数または :meth:`~object.__index__` を実装したオブジェクトです。\n" +"*n* がゼロまたは負の値の場合、シーケンスを空にします。\n" +":ref:`typesseq-common` の ``s * n`` の説明と同様に、シーケンスの要素はコピー" +"されず、同じ要素が複数回参照されます。" #: ../../library/stdtypes.rst:1284 msgid "Mutable Sequence Methods" @@ -2402,17 +2414,17 @@ msgid "" msgstr "" "ソートの例と簡単なチュートリアルは :ref:`sortinghowto` を参照して下さい。" -#: ../../library/stdtypes.rst:1454 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " "list appear empty for the duration, and raises :exc:`ValueError` if it can " "detect that the list has been mutated during a sort." msgstr "" -"リストがソートされている間、または変更しようとする試みの影響中、あるいは検査" -"中でさえ、リストは未定義です。Python の C 実装では、それらが続いている間、リ" -"ストは空として出力され、リストがソート中に変更されていることを検知できたら :" -"exc:`ValueError` を送出します。" +"リストのソート中にそのリストを変更したり、内容を調べたりしようとした場合の動" +"作は未定義です。\n" +"Python の C 実装では、ソート中はリストが空に見えるようにし、\n" +"ソート中にリストが変更されたことを検出できた場合は :exc:`ValueError` を送出し" +"ます。" #: ../../library/stdtypes.rst:1461 msgid "" @@ -3167,14 +3179,13 @@ msgstr "" "指定を行うと長さ 1 の文字列を作成します。つまり、空でない文字列 *s* に対し、" "``s[0] == s[0:1]`` です。" -#: ../../library/stdtypes.rst:1776 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -"ミュータブルな文字列型もありませんが、ミュータブルな断片から効率よく文字列を" -"構成するのに :meth:`str.join` や :class:`io.StringIO` が使えます。" +"ミュータブルな文字列型もありませんが、複数の断片から効率よく文字列を構築する" +"には :meth:`str.join` や :class:`io.StringIO` を使えます。" #: ../../library/stdtypes.rst:1780 msgid "" @@ -3563,7 +3574,6 @@ msgstr "" "書式指定のオプションについては、書式指定文字列を規定する :ref:" "`formatstrings` を参照してください。" -#: ../../library/stdtypes.rst:2053 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -3573,21 +3583,22 @@ msgid "" "and the ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. " "This temporary change affects other threads." msgstr "" -"数値 (:class:`int`, :class:`float`, :class:`complex`, :class:`decimal." -"Decimal` とサブクラス) を ``n`` の整数表現型 (例: ``'{:n}'.format(1234)``) で" -"フォーマットするとき、``LC_CTYPE`` ロケールと ``LC_NUMERIC`` ロケールの一方ま" -"たは両方が 1 バイトより長い非 ASCII 文字であると同時に異なる値である場合、こ" -"の関数は :c:func:`localeconv` の ``decimal_point`` と ``thousands_sep`` " -"フィールドを読み取るため一時的に ``LC_CTYPE`` ロケールに ``LC_NUMERIC`` のロ" -"ケール値を設定します。この一時的な変更は他のスレッドの動作に影響します。" +"数値 (:class:`int`、:class:`float`、:class:`complex`、:class:`decimal." +"Decimal` とそのサブクラス) を ``n`` 型で書式化する場合 (例: ``'{:n}'." +"format(1234)``)、\n" +":c:func:`localeconv` の ``decimal_point`` または ``thousands_sep`` フィールド" +"が非 ASCII 文字を含むか1バイトより長く、\n" +"かつ ``LC_NUMERIC`` ロケールが ``LC_CTYPE`` ロケールと異なるときは、\n" +"それらのフィールドをデコードするために、一時的に ``LC_CTYPE`` ロケールを " +"``LC_NUMERIC`` ロケールに設定します。\n" +"この一時的な変更は他のスレッドにも影響します。" -#: ../../library/stdtypes.rst:2062 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -"数値を ``n`` の整数表現型でフォーマットするとき、この関数は一時的に " -"``LC_CTYPE`` ロケールに ``LC_NUMERIC`` のロケール値を設定する場合があります。" +"数値を ``n`` 型で書式化するとき、一時的に ``LC_CTYPE`` ロケールを " +"``LC_NUMERIC`` ロケールに設定する場合があります。" #: ../../library/stdtypes.rst:2070 msgid "" @@ -4383,9 +4394,8 @@ msgstr "復帰" msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2712 msgid "Carriage Return + Line Feed" -msgstr "改行 + 復帰" +msgstr "復帰 + 改行" #: ../../library/stdtypes.rst:2714 msgid "``\\v`` or ``\\x0b``" @@ -4475,14 +4485,14 @@ msgid "" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgstr "" -#: ../../library/stdtypes.rst:2742 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -":meth:`~str.split` とは違って、デリミタ文字列 *sep* が与えられたとき、このメ" -"ソッドは空文字列に空リストを返し、終末の改行は結果に行を追加しません::" +"区切り文字列 *sep* を指定した :meth:`~str.split` とは異なり、\n" +"このメソッドは空文字列に対して空のリストを返し、末尾に改行があっても余分な行" +"を追加しません::" #: ../../library/stdtypes.rst:2746 msgid "" @@ -5142,13 +5152,12 @@ msgstr "" msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4502 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -"(スペース) 符号付きの変換で正の数の場合、前に一つスペースを空けます (そうでな" -"い場合は空文字になります) 。" +"(スペース) 符号付き変換で生成された正の数 (または空文字列) の前に、空白を一つ" +"置きます。" #: ../../library/stdtypes.rst:3203 ../../library/stdtypes.rst:4505 msgid "``'+'``" @@ -5256,25 +5265,25 @@ msgstr "``'F'``" msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:3235 ../../library/stdtypes.rst:4537 msgid "" "Floating-point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -"浮動小数点数。指数部が -4 以上または精度以下の場合には小文字指数表記、それ以" -"外の場合には10進表記。" +"浮動小数点数の書式。\n" +"指数が -4 未満または指定精度以上の場合は小文字の指数表記を使い、それ以外は10" +"進表記を使います。" #: ../../library/stdtypes.rst:3239 ../../library/stdtypes.rst:4541 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:3239 ../../library/stdtypes.rst:4541 msgid "" "Floating-point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -"浮動小数点数。指数部が -4 以上または精度以下の場合には大文字指数表記、それ以" -"外の場合には10進表記。" +"浮動小数点数の書式。\n" +"指数が -4 未満または指定精度以上の場合は大文字の指数表記を使い、それ以外は10" +"進表記を使います。" #: ../../library/stdtypes.rst:3243 ../../library/stdtypes.rst:4545 msgid "``'c'``" @@ -5566,13 +5575,11 @@ msgstr "" "bytes オブジェクトをその 16 進表記に変換するための、反対向きの変換関数があり" "ます。" -#: ../../library/stdtypes.rst:3401 ../../library/stdtypes.rst:3492 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -"インスタンス内の 1 バイトにつき 2 つの 16 進数を含む、文字列オブジェクトを返" -"します。" +"インスタンス内の各バイトを2桁の16進数字で表した文字列オブジェクトを返します。" #: ../../library/stdtypes.rst:3407 msgid "" @@ -5812,7 +5819,6 @@ msgstr "" msgid "Bytes and Bytearray Operations" msgstr "bytes と bytearray の操作" -#: ../../library/stdtypes.rst:3585 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5820,11 +5826,13 @@ msgid "" "can be freely mixed in operations without causing errors. However, the " "return type of the result may depend on the order of operands." msgstr "" -"bytes と bytearray は両方共 :ref:`一般のシーケンス操作 ` を" -"サポートしています。また、両方とも :term:`bytes-like object` をサポートしてい" -"る任意のオブジェクトを対象に操作することもできます。この柔軟性により bytes " -"と bytearray を自由に混ぜてもエラーを起こすことなく扱うことができます。ただ" -"し、操作の結果のオブジェクトはその操作の順序に依存することになります。" +"bytes オブジェクトと bytearray オブジェクトは、どちらも :ref:`共通のシーケン" +"ス演算 ` をサポートします。\n" +"同じ型のオペランドだけでなく、任意の :term:`bytes-like object` とも相互に演算" +"できます。\n" +"この柔軟性により、これらの型を演算で自由に混在させてもエラーにはなりませ" +"ん。\n" +"ただし、結果の型はオペランドの順序によって異なる場合があります。" #: ../../library/stdtypes.rst:3593 msgid "" @@ -6355,7 +6363,6 @@ msgstr "" "す)。 *maxsplit* が指定されていないか ``-1`` のとき、分割の回数に制限はありま" "せん (可能なだけ分割されます)。" -#: ../../library/stdtypes.rst:4016 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -6365,12 +6372,13 @@ msgid "" "the type of object being split. The *sep* argument may be any :term:`bytes-" "like object`." msgstr "" -"*sep* が与えられた場合、連続した区切り用バイト値はまとめられず、空の部分シー" -"ケンスを区切っていると判断されます(例えば ``b'1,,2'.split(b',')`` は " -"``[b'1', b'', b'2']`` を返します)。引数 *sep* は複数バイトのシーケンスを1つの" -"区切り文字にもできます。空のシーケンスを分割すると、分割するオブジェクトの型" -"によって ``[b'']`` または ``[bytearray(b'')]`` が返ります。引数 *sep* には、" -"あらゆる :term:`bytes-like object` を指定できます。" +"*sep* を指定した場合、連続する区切りは一つにまとめられず、空の部分シーケンス" +"を区切るものとみなされます (例えば ``b'1,,2'.split(b',')`` は ``[b'1', b'', " +"b'2']`` を返します)。\n" +"*sep* には、複数バイトのシーケンスを一つの区切りとして指定できます。\n" +"区切りを指定して空のシーケンスを分割すると、分割するオブジェクトの型に応じて " +"``[b'']`` または ``[bytearray(b'')]`` が返されます。\n" +"*sep* には、任意の :term:`bytes-like object` を指定できます。" #: ../../library/stdtypes.rst:4026 msgid "" @@ -6669,15 +6677,14 @@ msgid "" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgstr "" -#: ../../library/stdtypes.rst:4283 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -":meth:`~bytes.split` とは違って、空シーケンスに対して区切り *sep* を与えて呼" -"び出すと空のリストを返します。またシーケンス末尾に改行コードがある場合、(訳" -"註: その後ろに空行があるとは判断せず)余分な行を生成することはありません::" +"区切り文字列 *sep* を指定した :meth:`~bytes.split` とは異なり、\n" +"このメソッドは空のシーケンスに対して空のリストを返し、末尾に改行があっても余" +"分な行を追加しません::" #: ../../library/stdtypes.rst:4287 msgid "" @@ -6960,13 +6967,12 @@ msgid "" "equal to the number of elements in the view." msgstr "" -#: ../../library/stdtypes.rst:4639 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -"``view.ndim == 0`` で ``len(view)`` の場合、1の代わりに :exc:`TypeError` を返" -"すようになりました。" +"``view.ndim == 0`` の場合、``len(view)`` は 1 を返す代わりに :exc:" +"`TypeError` を送出するようになりました。" #: ../../library/stdtypes.rst:4642 msgid "" @@ -7230,11 +7236,11 @@ msgstr "" "連続なデータに対するビューの場合、データはまず C のデータ並びに変換されま" "す。 *order=None* は *order='C'* と同じです。" -#: ../../library/stdtypes.rst:4802 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" -msgstr "バッファ中の各バイトを 2 つの 16 進数で表した文字列を返します::" +msgstr "" +"バッファ内の各バイトを2桁の16進数字で表した文字列オブジェクトを返します。 ::" #: ../../library/stdtypes.rst:4805 msgid "" @@ -7350,7 +7356,6 @@ msgid "" "ValueError: operation forbidden on released memoryview object" msgstr "" -#: ../../library/stdtypes.rst:4888 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -7358,24 +7363,26 @@ msgid "" "is not copied. Supported casts are 1D -> C-:term:`contiguous` and C-" "contiguous -> 1D." msgstr "" -"memoryview を新しいフォーマットか shape にキャストします。 *shape* はデフォル" -"トで ``[byte_length//new_itemsize]`` で、 1次元配列になります。戻り値は " -"memoryview ですが、バッファー自体はコピーされません。サポートされている変換" -"は 1次元配列 -> C言語型の連続配列 と C言語型の連続配列 -> 1次元配列 です(参" -"考: :term:`contiguous`)。" +"memoryview を新しいフォーマットまたは形状にキャストします。\n" +"*shape* のデフォルト値は ``[byte_length//new_itemsize]`` で、結果のビューは1" +"次元になります。\n" +"返り値は新しい memoryview ですが、バッファ自体はコピーされません。\n" +"サポートされるキャストは、1次元から C-:term:`連続 ` への変換と、" +"C-連続から1次元への変換です。" -#: ../../library/stdtypes.rst:4894 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length. " "Note that all byte lengths may depend on the operating system." msgstr "" -"キャスト後のフォーマットは単一要素のネイティブフォーマットに限定され、 :mod:" -"`struct` の文法で指定します。利用可能なフォーマットのひとつはバイトフォーマッ" -"ト ('B', 'b' または 'c') です。キャスト後のバイト長は元の長さと同じでなけれ" -"ばなりません。全てのフォーマットのバイト長は、オペレーティングシステムに依存" -"することに注意してください。" +"変換先のフォーマットは、:mod:`struct` の構文による単一要素のネイティブフォー" +"マットに限定されます。\n" +"変換元と変換先のフォーマットの少なくとも一方は、バイトフォーマット " +"('B'、'b'、'c') でなければなりません。\n" +"結果のバイト長は元の長さと同じでなければなりません。\n" +"各フォーマットのバイト長はオペレーティングシステムによって異なる場合があるこ" +"とに注意してください。" #: ../../library/stdtypes.rst:4900 msgid "Cast 1D/long to 1D/unsigned bytes::" @@ -7663,17 +7670,18 @@ msgid "" "various set operations." msgstr "" -#: ../../library/stdtypes.rst:5133 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " "position or order of insertion. Accordingly, sets do not support indexing, " "slicing, or other sequence-like behavior." msgstr "" -"集合は、他のコレクションと同様、 ``x in set``, ``len(set)``, ``for x in " -"set`` をサポートします。コレクションには順序がないので、集合は挿入の順序や要" -"素の位置を記録しません。従って、集合はインデクシング、スライシング、その他の" -"シーケンス的な振舞いをサポートしません。" +"集合は他のコレクションと同様に、``x in set``、``len(set)``、``for x in set`` " +"をサポートします。\n" +"集合は順序を持たないコレクションなので、要素の位置や挿入順序を記録しませ" +"ん。\n" +"そのため、インデックス指定やスライスなど、シーケンスのような動作はサポートし" +"ません。" #: ../../library/stdtypes.rst:5138 msgid "" @@ -7980,7 +7988,6 @@ msgid "" "operations." msgstr "" -#: ../../library/stdtypes.rst:5359 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7988,12 +7995,12 @@ msgid "" "may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, " "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -"辞書のキーには、 *ほぼ* どんな値も使うことができます。\n" -"キーとして使えないのは、 :term:`hashable` (ハッシュ可能) でない値、すなわちリ" -"ストや辞書のようなミュータブルな型 (内包する値ではなくオブジェクト自体が同一" -"であるかによって比較が行われるような型)です。\n" -"比較した際に等しいとみなされる値 (例えば ``1`` と ``1.0`` と ``True``) は、ど" -"れを使っても同じエントリーに関連付けられます。" +"辞書のキーには、*ほぼ* 任意の値を使えます。\n" +":term:`ハッシュ可能 ` でない値、すなわちリスト、辞書、その他の" +"ミュータブルな型 (オブジェクトの同一性ではなく値によって比較されるもの) を含" +"む値は、キーとして使えません。\n" +"比較すると等しい値 (例えば ``1``、``1.0``、``True``) は、どれを使っても同じ辞" +"書の項目にアクセスできます。" #: ../../library/stdtypes.rst:5370 msgid "" @@ -8274,13 +8281,12 @@ msgstr "" "*default* を返します。 *default* が与えられず、かつ *key* が辞書に存在しなけ" "れば :exc:`KeyError` を送出します。" -#: ../../library/stdtypes.rst:5546 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -"任意の ``(key, value)`` 対を辞書から消去して返します。\n" -"対は :abbr:`LIFO (後入れ、先出し)` の順序で返却されます。" +"辞書から ``(key, value)`` 対を削除し、その対を返します。\n" +"対は :abbr:`LIFO (後入れ、先出し)` の順序で返されます。" #: ../../library/stdtypes.rst:5549 msgid "" @@ -8358,14 +8364,14 @@ msgid "" "False" msgstr "" -#: ../../library/stdtypes.rst:5598 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" "*d* と *other* のキーと値を統合した新しい辞書を作成します。\n" -"*d* と *other* のキーに重複がある場合は、 *other* の方の値が優先されます。" +"*d* と *other* は両方とも辞書でなければなりません。\n" +"*d* と *other* でキーが重複する場合は、*other* の値が優先されます。" #: ../../library/stdtypes.rst:5606 msgid "" @@ -8479,13 +8485,12 @@ msgstr "" "*x* が元の辞書のキー、値、または項目 (項目の場合、 *x* は ``(key, value)`` タ" "プルです) にあるとき ``True`` を返します。" -#: ../../library/stdtypes.rst:5678 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -"辞書のキーもしくは値、項目の順序を逆にしたイテレーターを返します。\n" -"戻り値のビューは、挿入された順とは逆の順でイテレートします。" +"辞書のキー、値、または項目を逆順にたどるイテレータを返します。\n" +"ビューは挿入順序とは逆の順序で反復されます。" #: ../../library/stdtypes.rst:5681 msgid "Dictionary views are now reversible." @@ -9010,13 +9015,12 @@ msgid "" "This is true for :ref:`user-defined generics ` also." msgstr "" -#: ../../library/stdtypes.rst:5986 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -":func:`repr` や :func:`str` のジェネリック型に対する呼び出しは、パラメータ型" -"を表示します::" +"パラメータ付きジェネリック型に :func:`repr` や :func:`str` を呼び出すと、パラ" +"メータを含む型が表示されます::" #: ../../library/stdtypes.rst:5988 msgid "" @@ -9320,14 +9324,14 @@ msgid "" "" msgstr "" -#: ../../library/stdtypes.rst:6093 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" "この属性は、ジェネリッククラスの元の :meth:`~object.__class_getitem__` に渡さ" -"れた :class:`tuple` です (長さが1の場合もあります)::" +"れたジェネリック型を要素とする :class:`tuple` です (長さが1の場合もありま" +"す)::" #: ../../library/stdtypes.rst:6097 msgid "" @@ -9771,15 +9775,14 @@ msgstr "" "の :attr:`~function.__code__` 属性として取り出せます。 :mod:`code` モジュール" "も参照してください。" -#: ../../library/stdtypes.rst:6387 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " "``\"__code__\"``." msgstr "" -":attr:`~function.__code__` へのアクセスは ``object.__getattr__`` に ``obj`` " -"と ``\"__code__\"`` を渡して行いますが、 :ref:`監査イベント ` を送" -"出します。" +":attr:`~function.__code__` にアクセスすると、実引数 ``obj`` と " +"``\"__code__\"`` を伴う :ref:`監査イベント ` ``object." +"__getattr__`` が送出されます。" #: ../../library/stdtypes.rst:6394 msgid "" @@ -9988,7 +9991,6 @@ msgstr "" "に *のみ* 適用されます。16進数、8進数と2進数は制限がありません。上限値は設定" "できます。" -#: ../../library/stdtypes.rst:6540 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -9997,13 +9999,13 @@ msgid "" "algorithms for base 10 have sub-quadratic complexity. Converting a large " "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -"CPython の :class:`int` 型は、任意の長さの数をバイナリ形式で保存したものです " -"(一般に \"bignum\" または多倍長整数として知られています)。基数が2のべき乗でな" -"い限り、線形の時間で文字列をバイナリ整数に、あるいはバイナリ整数を文字列に変" -"換できるアルゴリズムは存在しません。10進数に対するアルゴリズムでは、最もよく" -"知られているものでさえ、2次に近い (sub-quadratic) 複雑さになります。高速な " -"CPU でも、 ``int('1' * 500_000)`` のような大きな数の変換は1秒以上かかる可能性" -"があります。" +"CPython の :class:`int` 型は、任意の長さの数を2進形式で格納します (一般に" +"「bignum」と呼ばれます)。\n" +"基数が2のべき乗でない限り、文字列と2進整数を線形時間で相互変換できるアルゴリ" +"ズムは存在しません。\n" +"10進数に対する既知の最良のアルゴリズムでも、計算量は二次未満です。\n" +"``int('1' * 500_000)`` のような大きな値の変換には、高速な CPU でも1秒を超える" +"時間が掛かる場合があります。" #: ../../library/stdtypes.rst:6547 msgid "" @@ -10225,7 +10227,6 @@ msgstr "" ":data:`sys.int_info.str_digits_check_threshold ` は上限値として" "指定できる最低の値です(0の場合は無効になります)。" -#: ../../library/stdtypes.rst:6651 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -10236,14 +10237,15 @@ msgid "" "exist for the code. A workaround for source that contains such large " "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -"小さな上限値を設定することで、問題が起きる *可能性があります* 。まれではあり" -"ますが、ソースコード内で閾値を超える定数が10進数の整数として存在するコードが" -"存在します。値に制限をつけることの帰結は、10進数の整数リテラルで制限を超える" -"長さを持つ定数を含むコードのパース時、すなわち通常は起動時、モジュールのイン" -"ポート時、またはインストール時など、そのコードのための ``.pyc`` ファイルが作" -"られるまでのどこかの時点でのエラーです。大きな定数を含むソースコードに対する" -"回避策は、その定数を、 ``0x`` を使って値の制限を持たない16進数の値に変換する" -"ことです。" +"小さな上限値を設定すると、問題が起きる *可能性があります* 。\n" +"まれですが、ソース内に最小の閾値を超える10進整数定数を含むコードが存在しま" +"す。\n" +"上限値を設定すると、その上限より長い10進整数リテラルを含む Python ソースコー" +"ドのパース時にエラーが発生します。\n" +"これは、通常は起動時やインポート時、場合によってはインストール時など、その" +"コードに対応する最新の ``.pyc`` がまだ存在しないときに起こります。\n" +"このような大きな定数を含むソースでは、制限のない ``0x`` 形式の16進数へ定数を" +"変換することで回避できます。" #: ../../library/stdtypes.rst:6660 msgid "" @@ -10316,11 +10318,10 @@ msgstr "" "この結果として、リスト ``[1, 2]`` は ``[1.0, 2.0]`` と等しいと見なされます。" "タプルの場合も同様です。" -#: ../../library/stdtypes.rst:6696 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -"パーザが演算対象の型を識別できるようにするために、このような優先順位でなけれ" -"ばならないのです。" +"パーザはオペランドの型を判別できないため、これらの演算子の優先順位は対応する" +"数値演算子と同じでなければなりません。" #: ../../library/stdtypes.rst:6698 msgid "" @@ -10887,25 +10888,20 @@ msgstr "" msgid "! f-string" msgstr "" -#: ../../library/stdtypes.rst:2931 msgid "f-strings" -msgstr "" +msgstr "f-strings" -#: ../../library/stdtypes.rst:2931 msgid "fstring" -msgstr "" +msgstr "fstring" -#: ../../library/stdtypes.rst:2931 msgid "interpolated string literal" -msgstr "" +msgstr "補間文字列リテラル" -#: ../../library/stdtypes.rst:2931 msgid "formatted literal" -msgstr "" +msgstr "フォーマット済みリテラル" -#: ../../library/stdtypes.rst:2931 msgid "interpolated literal" -msgstr "" +msgstr "補間リテラル" #: ../../library/stdtypes.rst:2931 msgid "{} (curly brackets)" diff --git a/library/subprocess.po b/library/subprocess.po index f41cfa353..3a610a741 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -56,13 +56,8 @@ msgstr "" msgid ":pep:`324` -- PEP proposing the subprocess module" msgstr ":pep:`324` -- subprocess モジュールを提案している PEP" -#: ../../library/subprocess.rst:595 ../../library/subprocess.rst:602 -#: ../../library/subprocess.rst:612 ../../library/subprocess.rst:621 -#: ../../library/subprocess.rst:636 ../../library/subprocess.rst:642 -#: ../../library/subprocess.rst:1524 ../../library/subprocess.rst:1546 -#: ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/sys.po b/library/sys.po index c16fa84e6..306ba95a6 100644 --- a/library/sys.po +++ b/library/sys.po @@ -94,14 +94,8 @@ msgstr "" "デフォルトのフラグは空文字列になりました。 (pymalloc のための ``m`` フラグが" "取り除かれました)" -#: ../../library/sys.rst:70 ../../library/sys.rst:343 ../../library/sys.rst:413 -#: ../../library/sys.rst:835 ../../library/sys.rst:853 -#: ../../library/sys.rst:1129 ../../library/sys.rst:1767 -#: ../../library/sys.rst:2065 ../../library/sys.rst:2080 -#: ../../library/sys.rst:2088 ../../library/sys.rst:2129 -#: ../../library/sys.rst:2146 ../../library/sys.rst:2399 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/sys.rst:75 msgid "" diff --git a/library/syslog.po b/library/syslog.po index 1305da0e5..c05bc26da 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -36,9 +36,8 @@ msgstr "" "提供します。``syslog`` の便宜レベルに関する詳細な記述は Unix マニュアルページ" "を参照してください。" -#: ../../library/syslog.rst:13 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/syslog.rst:15 msgid "" diff --git a/library/termios.po b/library/termios.po index 213772a59..b882dd6d5 100644 --- a/library/termios.po +++ b/library/termios.po @@ -39,9 +39,8 @@ msgstr "" "*termios* 形式の端末制御をサポートしていてインストール時に有効にした Unix の" "バージョンでのみ利用可能です。" -#: ../../library/termios.rst:18 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/termios.rst:20 msgid "" diff --git a/library/threading.po b/library/threading.po index 0b0267a83..0a1ab2efe 100644 --- a/library/threading.po +++ b/library/threading.po @@ -38,10 +38,8 @@ msgstr "" "このモジュールでは、高水準のスレッドインターフェースをより低水準 な :mod:" "`_thread` モジュールの上に構築しています。" -#: ../../library/threading.rst:194 ../../library/threading.rst:296 -#: ../../library/threading.rst:684 ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/time.po b/library/time.po index 27dcf3b3f..ddd30a8fa 100644 --- a/library/time.po +++ b/library/time.po @@ -269,19 +269,8 @@ msgid "" "such as segmentation fault." msgstr "" -#: ../../library/time.rst:154 ../../library/time.rst:166 -#: ../../library/time.rst:179 ../../library/time.rst:188 -#: ../../library/time.rst:201 ../../library/time.rst:213 -#: ../../library/time.rst:774 ../../library/time.rst:798 -#: ../../library/time.rst:894 ../../library/time.rst:905 -#: ../../library/time.rst:915 ../../library/time.rst:925 -#: ../../library/time.rst:934 ../../library/time.rst:943 -#: ../../library/time.rst:952 ../../library/time.rst:963 -#: ../../library/time.rst:971 ../../library/time.rst:982 -#: ../../library/time.rst:993 ../../library/time.rst:1002 -#: ../../library/time.rst:1015 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/time.rst:156 msgid "" diff --git a/library/tty.po b/library/tty.po index 9213332e5..ed52597fe 100644 --- a/library/tty.po +++ b/library/tty.po @@ -36,9 +36,8 @@ msgid "" "raw modes." msgstr "" -#: ../../library/tty.rst:14 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/tty.rst:16 msgid "" diff --git a/library/urllib.request.po b/library/urllib.request.po index 19e413c80..5409f407f 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -54,9 +54,8 @@ msgid "" "problem (e.g. ``os.environ[\"no_proxy\"] = \"*\"``)." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/venv.po b/library/venv.po index 0a41fb121..e7196c048 100644 --- a/library/venv.po +++ b/library/venv.po @@ -103,9 +103,8 @@ msgstr "" "`__" -#: ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/webbrowser.po b/library/webbrowser.po index 64c12c0b2..e8a6811b1 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -121,9 +121,8 @@ msgstr "" msgid "python -m webbrowser -t \"https://www.python.org\"" msgstr "" -#: ../../library/webbrowser.rst:74 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/webbrowser.rst:76 msgid "The following exception is defined:" diff --git a/library/winreg.po b/library/winreg.po index e9903e6fd..58eb75705 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -42,9 +42,8 @@ msgstr "" "ンドルがクローズされるようにするために、レジストリハンドルとして整数値ではな" "く :ref:`ハンドルオブジェクト ` が使われます。" -#: ../../library/winreg.rst:16 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/winreg.rst:20 msgid "" diff --git a/library/winsound.po b/library/winsound.po index d84e0c358..7f03b0950 100644 --- a/library/winsound.po +++ b/library/winsound.po @@ -37,9 +37,8 @@ msgid "" "constants." msgstr "" -#: ../../library/winsound.rst:14 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../library/winsound.rst:18 msgid "Functions" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 755eb13f1..3810f4483 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -57,9 +57,8 @@ msgid "" "certificate and hostname checks by default." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index b74a514d9..30d7e0968 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -45,9 +45,8 @@ msgid "" "see :ref:`xml-security`." msgstr "" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index aa13c433f..74a41cfaf 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -63,9 +63,8 @@ msgstr "" "CPythonコアデベロッパーによってメンテナンスされているファーストパーティーの" "パッケージ。タイムゾーンデータを供給し、PyPIで配布されている。" -#: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/license.po b/license.po index f4f506afd..e59d077be 100644 --- a/license.po +++ b/license.po @@ -30,22 +30,27 @@ msgstr "歴史とライセンス" msgid "History of the software" msgstr "Python の歴史" -#: ../../license.rst:13 msgid "" "Python was created in the early 1990s by Guido van Rossum at Stichting " "Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands as a " "successor of a language called ABC. Guido remains Python's principal " "author, although it includes many contributions from others." msgstr "" +"Python は 1990 年代初頭に、ABC という言語の後継として、オランダの Stichting " +"Mathematisch Centrum(CWI、https://www.cwi.nl 参照)で Guido van Rossum に" +"よって作られました。\n" +"Python にはほかの多くの人々からの貢献も含まれていますが、Guido は現在もその主" +"要な作者です。" -#: ../../license.rst:18 msgid "" "In 1995, Guido continued his work on Python at the Corporation for National " "Research Initiatives (CNRI, see https://www.cnri.reston.va.us) in Reston, " "Virginia where he released several versions of the software." msgstr "" +"1995 年、Guido はバージニア州レストンの Corporation for National Research " +"Initiatives(CNRI、https://www.cnri.reston.va.us 参照)で Python の開発を続" +"け、いくつかのバージョンをリリースしました。" -#: ../../license.rst:22 msgid "" "In May 2000, Guido and the Python core development team moved to BeOpen.com " "to form the BeOpen PythonLabs team. In October of the same year, the " @@ -55,13 +60,25 @@ msgid "" "Python-related Intellectual Property. Zope Corporation was a sponsoring " "member of the PSF." msgstr "" +"2000 年 5 月、Guido と Python のコア開発チームは BeOpen.com に移り、BeOpen " +"PythonLabs チームを結成しました。\n" +"同年 10 月、PythonLabs チームは Digital Creations に移り、同社はその後 Zope " +"Corporation となりました。\n" +"2001 年、Python に関する知的財産を保有することを目的とした非営利団体 Python " +"Software Foundation(PSF、https://www.python.org/psf/ 参照)が設立されまし" +"た。\n" +"Zope Corporation は PSF の賛助会員でした。" -#: ../../license.rst:30 msgid "" "All Python releases are Open Source (see https://opensource.org for the Open " "Source Definition). Historically, most, but not all, Python releases have " "also been GPL-compatible; the table below summarizes the various releases." msgstr "" +"Python のリリースはすべてオープンソースです(オープンソースの定義については " +"https://opensource.org を参照してください)。\n" +"歴代の Python のリリースの多くは GPL とも互換性がありますが、すべてではありま" +"せん。\n" +"さまざまなリリースを次の表にまとめます。" #: ../../license.rst:35 msgid "Release" @@ -79,9 +96,8 @@ msgstr "西暦年" msgid "Owner" msgstr "権利" -#: ../../license.rst:35 msgid "GPL-compatible? (1)" -msgstr "" +msgstr "GPL 互換? (1)" #: ../../license.rst:37 msgid "0.9.0 thru 1.2" @@ -154,9 +170,8 @@ msgstr "1.6.1" msgid "2001" msgstr "2001" -#: ../../license.rst:45 msgid "yes (2)" -msgstr "" +msgstr "yes (2)" #: ../../license.rst:47 msgid "2.1" @@ -203,7 +218,6 @@ msgstr "2.2 以降" msgid "2001-now" msgstr "2001-現在" -#: ../../license.rst:62 msgid "" "GPL-compatible doesn't mean that we're distributing Python under the GPL. " "All Python licenses, unlike the GPL, let you distribute a modified version " @@ -211,14 +225,22 @@ msgid "" "possible to combine Python with other software that is released under the " "GPL; the others don't." msgstr "" +"GPL 互換とは、Python を GPL のもとで配布しているという意味ではありません。\n" +"Python のライセンスはすべて、GPL とは異なり、変更内容をオープンソースにせずに" +"変更版を配布することを認めています。\n" +"GPL 互換のライセンスでは、GPL のもとでリリースされているほかのソフトウェアと " +"Python を組み合わせることができますが、それ以外のライセンスではできません。" -#: ../../license.rst:68 msgid "" "According to Richard Stallman, 1.6.1 is not GPL-compatible, because its " "license has a choice of law clause. According to CNRI, however, Stallman's " "lawyer has told CNRI's lawyer that 1.6.1 is \"not incompatible\" with the " "GPL." msgstr "" +"Richard Stallman によると、1.6.1 のライセンスには準拠法を選択する条項があるた" +"め、GPL 互換ではありません。\n" +"一方 CNRI によると、Stallman の弁護士は CNRI の弁護士に対し、1.6.1 は GPL と" +"「非互換ではない」と伝えたとのことです。" #: ../../license.rst:72 msgid "" @@ -228,35 +250,39 @@ msgstr "" "Guido の指示の下、これらのリリースを可能にしてくださった多くのボランティアの" "みなさんに感謝します。" -#: ../../license.rst:77 msgid "Terms and conditions for accessing or otherwise using Python" -msgstr "Terms and conditions for accessing or otherwise using Python" +msgstr "Python へのアクセスおよびその他の使用に関する条件" -#: ../../license.rst:79 msgid "" "Python software and documentation are licensed under the Python Software " "Foundation License Version 2." msgstr "" +"Python のソフトウェアとドキュメントは Python Software Foundation License " +"Version 2 のもとでライセンスされています。" -#: ../../license.rst:82 msgid "" "Starting with Python 3.8.6, examples, recipes, and other code in the " "documentation are dual licensed under the PSF License Version 2 and the :ref:" "`Zero-Clause BSD license `." msgstr "" +"Python 3.8.6 以降、ドキュメント内のサンプル、レシピ、その他のコードには、PSF " +"License Version 2 と :ref:`Zero-Clause BSD ライセンス ` のデュアルライ" +"センスが適用されます。" -#: ../../license.rst:86 msgid "" "Some software incorporated into Python is under different licenses. The " "licenses are listed with code falling under that license. See :ref:" "`OtherLicenses` for an incomplete list of these licenses." msgstr "" +"Python に組み込まれているソフトウェアの一部には、異なるライセンスが適用されま" +"す。\n" +"各ライセンスは、その適用対象となるコードとともに記載されています。\n" +"これらのライセンスの一覧は網羅的ではありませんが、:ref:`OtherLicenses` を参照" +"してください。" -#: ../../license.rst:94 msgid "PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2" -msgstr "" +msgstr "PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2" -#: ../../license.rst:98 msgid "" "1. This LICENSE AGREEMENT is between the Python Software Foundation " "(\"PSF\"), and\n" @@ -318,6 +344,59 @@ msgid "" "8. By copying, installing or otherwise using Python, Licensee agrees\n" " to be bound by the terms and conditions of this License Agreement." msgstr "" +"1. 本ライセンス契約は、Python Software Foundation(以下「PSF」)と、ソース形" +"式またはバイナリ形式の\n" +" 本ソフトウェア(以下「Python」)およびその関連ドキュメントにアクセスし、そ" +"の他の方法で使用する\n" +" 個人または組織(以下「ライセンシー」)との間で締結されるものです。\n" +"\n" +"2. 本ライセンス契約の条件に従い、PSF はライセンシーに対し、Python 単体または" +"その派生版の複製、\n" +" 解析、テスト、公の実演および/または展示、派生著作物の作成、配布、その他の" +"使用を行うための、\n" +" 非独占的で使用料不要の全世界におけるライセンスをここに付与します。\n" +" ただし、Python 単体またはライセンシーが作成した派生版には、PSF のライセン" +"ス契約と、\n" +" PSF の著作権表示、すなわち「Copyright © 2001 Python Software Foundation; " +"All Rights Reserved」を\n" +" 保持しなければなりません。\n" +"\n" +"3. ライセンシーが Python またはその一部に基づく、もしくはそれらを組み込んだ派" +"生著作物を作成し、\n" +" 本契約の定めに従ってその派生著作物を他者に提供しようとする場合、ライセン" +"シーは、\n" +" Python に加えた変更の簡単な要約をその著作物に含めることに同意するものとし" +"ます。\n" +"\n" +"4. PSF はライセンシーに対し、Python を「現状のまま」(\"AS IS\")提供しま" +"す。\n" +" PSF は、明示または黙示を問わず、いかなる表明も保証も行いません。\n" +" 例として、ただしこれらに限定されることなく、PSF は、商品性、特定の目的への" +"適合性、\n" +" または Python の使用が第三者の権利を侵害しないことについて、いかなる表明も" +"保証も行わず、\n" +" それらをすべて否認します。\n" +"\n" +"5. PSF は、Python またはその派生物の変更、配布、その他の使用に起因する付随的" +"損害、特別損害、\n" +" 結果的損害または損失について、その可能性を知らされていた場合であっても、\n" +" ライセンシーまたは Python のその他の利用者に対して責任を負わないものとしま" +"す。\n" +"\n" +"6. 本ライセンス契約の条件に重大な違反があった場合、本ライセンス契約は自動的に" +"終了します。\n" +"\n" +"7. 本ライセンス契約のいかなる規定も、PSF とライセンシーとの間に、代理、パート" +"ナーシップ、\n" +" または共同事業の関係を成立させるものとはみなされません。\n" +" 本ライセンス契約は、ライセンシーまたは第三者の製品やサービスを推奨または宣" +"伝するために、\n" +" PSF の商標または商号を商標として使用することを許可するものではありませ" +"ん。\n" +"\n" +"8. ライセンシーは、Python を複製、インストール、またはその他の方法で使用する" +"ことにより、\n" +" 本ライセンス契約の条件に拘束されることに同意するものとします。" #: ../../license.rst:141 msgid "BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0" @@ -327,7 +406,6 @@ msgstr "BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0" msgid "BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1" msgstr "BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1" -#: ../../license.rst:147 msgid "" "1. This LICENSE AGREEMENT is between BeOpen.com (\"BeOpen\"), having an " "office at\n" @@ -392,12 +470,63 @@ msgid "" "to be\n" " bound by the terms and conditions of this License Agreement." msgstr "" +"1. 本ライセンス契約は、160 Saratoga Avenue, Santa Clara, CA 95051 に事業所を" +"置く\n" +" BeOpen.com(以下「BeOpen」)と、ソース形式またはバイナリ形式の本ソフトウェ" +"アおよびその関連\n" +" ドキュメント(以下「本ソフトウェア」)にアクセスし、その他の方法で使用する" +"個人または組織\n" +" (以下「ライセンシー」)との間で締結されるものです。\n" +"\n" +"2. 本 BeOpen Python ライセンス契約の条件に従い、BeOpen はライセンシーに対し、" +"本ソフトウェア\n" +" 単体またはその派生版の複製、解析、テスト、公の実演および/または展示、派生" +"著作物の作成、\n" +" 配布、その他の使用を行うための、非独占的で使用料不要の全世界におけるライセ" +"ンスをここに付与します。\n" +" ただし、本ソフトウェア単体またはライセンシーが作成した派生版には、\n" +" BeOpen Python ライセンスを保持しなければなりません。\n" +"\n" +"3. BeOpen はライセンシーに対し、本ソフトウェアを「現状のまま」(\"AS IS\")提" +"供します。\n" +" BEOPEN は、明示または黙示を問わず、いかなる表明も保証も行いません。\n" +" 例として、ただしこれらに限定されることなく、BEOPEN は、商品性、特定の目的" +"への適合性、\n" +" または本ソフトウェアの使用が第三者の権利を侵害しないことについて、いかなる" +"表明も保証も行わず、\n" +" それらをすべて否認します。\n" +"\n" +"4. BEOPEN は、本ソフトウェアまたはその派生物の使用、変更、配布に起因する付随" +"的損害、特別損害、\n" +" 結果的損害または損失について、その可能性を知らされていた場合であっても、\n" +" ライセンシーまたは本ソフトウェアのその他の利用者に対して責任を負わないもの" +"とします。\n" +"\n" +"5. 本ライセンス契約の条件に重大な違反があった場合、本ライセンス契約は自動的に" +"終了します。\n" +"\n" +"6. 本ライセンス契約は、抵触法の規定を除くカリフォルニア州法に準拠し、すべての" +"点で同法に従って\n" +" 解釈されるものとします。\n" +" 本ライセンス契約のいかなる規定も、BeOpen とライセンシーとの間に、代理、" +"パートナーシップ、\n" +" または共同事業の関係を成立させるものとはみなされません。\n" +" 本ライセンス契約は、ライセンシーまたは第三者の製品やサービスを推奨または宣" +"伝するために、\n" +" BeOpen の商標または商号を商標として使用することを許可するものではありませ" +"ん。\n" +" 例外として、http://www.pythonlabs.com/logos.html で入手できる「BeOpen " +"Python」ロゴは、\n" +" 同ページで付与される許可に従って使用できます。\n" +"\n" +"7. ライセンシーは、本ソフトウェアを複製、インストール、またはその他の方法で使" +"用することにより、\n" +" 本ライセンス契約の条件に拘束されることに同意するものとします。" #: ../../license.rst:188 msgid "CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1" msgstr "CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1" -#: ../../license.rst:192 msgid "" "1. This LICENSE AGREEMENT is between the Corporation for National Research\n" " Initiatives, having an office at 1895 Preston White Drive, Reston, VA " @@ -496,12 +625,89 @@ msgid "" "and\n" " conditions of this License Agreement." msgstr "" +"1. 本ライセンス契約は、1895 Preston White Drive, Reston, VA 20191 に事業所を" +"置く\n" +" Corporation for National Research Initiatives(以下「CNRI」)と、ソース形" +"式またはバイナリ形式の\n" +" Python 1.6.1 ソフトウェアおよびその関連ドキュメントにアクセスし、その他の" +"方法で使用する\n" +" 個人または組織(以下「ライセンシー」)との間で締結されるものです。\n" +"\n" +"2. 本ライセンス契約の条件に従い、CNRI はライセンシーに対し、Python 1.6.1 単体" +"またはその派生版の\n" +" 複製、解析、テスト、公の実演および/または展示、派生著作物の作成、配布、そ" +"の他の使用を行うための、\n" +" 非独占的で使用料不要の全世界におけるライセンスをここに付与します。\n" +" ただし、Python 1.6.1 単体またはライセンシーが作成した派生版には、CNRI のラ" +"イセンス契約と、\n" +" CNRI の著作権表示、すなわち「Copyright © 1995-2001 Corporation for " +"National Research Initiatives;\n" +" All Rights Reserved」を保持しなければなりません。\n" +" または、ライセンシーは CNRI のライセンス契約の代わりに、次の文章(引用符を" +"除く)を使用できます:\n" +" \"Python 1.6.1 is made available subject to the terms and conditions in " +"CNRI's License\n" +" Agreement. This Agreement together with Python 1.6.1 may be located on " +"the\n" +" internet using the following unique, persistent identifier (known as a " +"handle):\n" +" 1895.22/1013. This Agreement may also be obtained from a proxy server on " +"the\n" +" internet using the following URL: http://hdl.handle.net/1895.22/1013\"。\n" +"\n" +"3. ライセンシーが Python 1.6.1 またはその一部に基づく、もしくはそれらを組み込" +"んだ派生著作物を作成し、\n" +" 本契約の定めに従ってその派生著作物を他者に提供しようとする場合、ライセン" +"シーは、\n" +" Python 1.6.1 に加えた変更の簡単な要約をその著作物に含めることに同意するも" +"のとします。\n" +"\n" +"4. CNRI はライセンシーに対し、Python 1.6.1 を「現状のまま」(\"AS IS\")提供" +"します。\n" +" CNRI は、明示または黙示を問わず、いかなる表明も保証も行いません。\n" +" 例として、ただしこれらに限定されることなく、CNRI は、商品性、特定の目的へ" +"の適合性、\n" +" または Python 1.6.1 の使用が第三者の権利を侵害しないことについて、いかなる" +"表明も保証も行わず、\n" +" それらをすべて否認します。\n" +"\n" +"5. CNRI は、Python 1.6.1 またはその派生物の変更、配布、その他の使用に起因する" +"付随的損害、特別損害、\n" +" 結果的損害または損失について、その可能性を知らされていた場合であっても、\n" +" ライセンシーまたは Python 1.6.1 のその他の利用者に対して責任を負わないもの" +"とします。\n" +"\n" +"6. 本ライセンス契約の条件に重大な違反があった場合、本ライセンス契約は自動的に" +"終了します。\n" +"\n" +"7. 本ライセンス契約は、米国連邦著作権法を含む(ただしこれに限定されない)米国" +"連邦知的財産法に準拠し、\n" +" 当該米国連邦法が適用されない範囲では、バージニア州の抵触法の規定を除くバー" +"ジニア州法に準拠します。\n" +" ただし、以前に GNU General Public License(GPL)のもとで配布された分離不能" +"な素材を組み込んだ、\n" +" Python 1.6.1 に基づく派生著作物については、本ライセンス契約の第 4 項、第 " +"5 項、および第 7 項に\n" +" 基づく、またはそれらに関する問題に限り、本ライセンス契約にバージニア州法が" +"適用されます。\n" +" 本ライセンス契約のいかなる規定も、CNRI とライセンシーとの間に、代理、パー" +"トナーシップ、\n" +" または共同事業の関係を成立させるものとはみなされません。\n" +" 本ライセンス契約は、ライセンシーまたは第三者の製品やサービスを推奨または宣" +"伝するために、\n" +" CNRI の商標または商号を商標として使用することを許可するものではありませ" +"ん。\n" +"\n" +"8. ライセンシーは、指定された箇所の「ACCEPT」ボタンをクリックするか、Python " +"1.6.1 を複製、\n" +" インストール、またはその他の方法で使用することにより、本ライセンス契約の条" +"件に拘束されることに\n" +" 同意するものとします。" #: ../../license.rst:253 msgid "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" msgstr "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" -#: ../../license.rst:257 msgid "" "Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The\n" "Netherlands. All rights reserved.\n" @@ -531,12 +737,32 @@ msgid "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n" "SOFTWARE." msgstr "" +"Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The\n" +"Netherlands. All rights reserved.\n" +"\n" +"本ソフトウェアおよびそのドキュメントを、目的を問わず使用、複製、変更、配布す" +"ることを、\n" +"ここに無償で許可します。\n" +"ただし、すべての複製物に上記の著作権表示を記載し、付属ドキュメントにその著作" +"権表示と本許諾表示の\n" +"両方を記載し、明確な事前の書面による許可なく、本ソフトウェアの配布に関する広" +"告または宣伝に\n" +"Stichting Mathematisch Centrum または CWI の名称を使用しないことを条件としま" +"す。\n" +"\n" +"STICHTING MATHEMATISCH CENTRUM は、商品性および適合性についてのすべての黙示の" +"保証を含め、\n" +"本ソフトウェアに関するすべての保証を否認します。\n" +"STICHTING MATHEMATISCH CENTRUM は、契約、過失、その他の不法行為のいずれに基づ" +"く訴えであるかを問わず、\n" +"本ソフトウェアの使用もしくは動作に起因または関連する、特別損害、間接損害、結" +"果的損害、または使用機会、\n" +"データもしくは利益の喪失によるその他のいかなる損害についても、一切責任を負わ" +"ないものとします。" -#: ../../license.rst:280 msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION" -msgstr "" +msgstr "Python ドキュメント内のコードに適用される ZERO-CLAUSE BSD LICENSE" -#: ../../license.rst:284 msgid "" "Permission to use, copy, modify, and/or distribute this software for any\n" "purpose with or without fee is hereby granted.\n" @@ -552,34 +778,47 @@ msgid "" "OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n" "PERFORMANCE OF THIS SOFTWARE." msgstr "" +"本ソフトウェアを、目的を問わず、有償または無償で使用、複製、変更、および/ま" +"たは配布することを\n" +"ここに許可します。\n" +"\n" +"本ソフトウェアは「現状のまま」(\"AS IS\")提供され、作者は、商品性および適合" +"性についてのすべての\n" +"黙示の保証を含め、本ソフトウェアに関するすべての保証を否認します。\n" +"作者は、契約、過失、その他の不法行為のいずれに基づく訴えであるかを問わず、本" +"ソフトウェアの使用\n" +"もしくは動作に起因または関連する、特別損害、直接損害、間接損害、結果的損害、" +"または使用機会、\n" +"データもしくは利益の喪失によるその他のいかなる損害についても、一切責任を負わ" +"ないものとします。" -#: ../../license.rst:299 msgid "Licenses and Acknowledgements for Incorporated Software" -msgstr "Licenses and Acknowledgements for Incorporated Software" +msgstr "組み込まれたソフトウェアのライセンスと謝辞" -#: ../../license.rst:301 msgid "" "This section is an incomplete, but growing list of licenses and " "acknowledgements for third-party software incorporated in the Python " "distribution." msgstr "" -"This section is an incomplete, but growing list of licenses and " -"acknowledgements for third-party software incorporated in the Python " -"distribution." +"この節は、Python の配布物に組み込まれたサードパーティソフトウェアのライセンス" +"と謝辞の一覧です。\n" +"網羅的ではありませんが、順次追加されています。" #: ../../license.rst:306 msgid "Mersenne Twister" msgstr "Mersenne Twister" -#: ../../license.rst:308 msgid "" "The :mod:`!_random` C extension underlying the :mod:`random` module includes " "code based on a download from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/" "MT/MT2002/emt19937ar.html. The following are the verbatim comments from the " "original code::" msgstr "" +":mod:`random` モジュールの基盤となる :mod:`!_random` C 拡張には、http://www." +"math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html からダウンロード" +"したものに基づくコードが含まれます。\n" +"以下は元のコードのコメントをそのまま掲載したものの日本語訳です。 ::" -#: ../../license.rst:313 msgid "" "A C-program for MT19937, with initialization improved 2002/1/26.\n" "Coded by Takuji Nishimura and Makoto Matsumoto.\n" @@ -623,19 +862,59 @@ msgid "" "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n" "email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)" msgstr "" +"初期化を 2002/1/26 に改良した MT19937 の C プログラム。\n" +"Takuji Nishimura と Makoto Matsumoto による実装。\n" +"\n" +"使用前に、init_genrand(seed) または init_by_array(init_key, key_length) を" +"使って状態を初期化してください。\n" +"\n" +"Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n" +"All rights reserved.\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"1. ソースコードを再配布する場合、上記の著作権表示、この条件一覧、および次の免" +"責事項を保持しなければなりません。\n" +"2. バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"3. 明確な事前の書面による許可なく、本ソフトウェアから派生した製品を推奨または" +"宣伝するために、貢献者の名称を使用してはなりません。\n" +"\n" +"本ソフトウェアは著作権者および貢献者によって「現状のまま」(\"AS IS\")提供さ" +"れ、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"著作権者または貢献者は、本ソフトウェアの使用に何らかの形で起因する、直接損" +"害、間接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。\n" +"\n" +"\n" +"ご意見を歓迎します。\n" +"http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n" +"email: m-mat @ math.sci.hiroshima-u.ac.jp(空白を除いてください)" #: ../../license.rst:356 msgid "Sockets" msgstr "ソケット" -#: ../../license.rst:358 msgid "" "The :mod:`socket` module uses the functions, :c:func:`!getaddrinfo`, and :c:" "func:`!getnameinfo`, which are coded in separate source files from the WIDE " "Project, https://www.wide.ad.jp/. ::" msgstr "" +":mod:`socket` モジュールは、WIDE Project(https://www.wide.ad.jp/)の別々の" +"ソースファイルに記述されている :c:func:`!getaddrinfo` 関数および :c:func:`!" +"getnameinfo` 関数を使用します。 ::" -#: ../../license.rst:362 msgid "" "Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.\n" "All rights reserved.\n" @@ -664,18 +943,46 @@ msgid "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." msgstr "" +"Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.\n" +"All rights reserved.\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"1. ソースコードを再配布する場合、上記の著作権表示、この条件一覧、および次の免" +"責事項を保持しなければなりません。\n" +"2. バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"3. 明確な事前の書面による許可なく、本ソフトウェアから派生した製品を推奨または" +"宣伝するために、本プロジェクトまたはその貢献者の名称を使用してはなりませ" +"ん。\n" +"\n" +"本ソフトウェアは本プロジェクトおよび貢献者によって「現状のまま」(\"AS IS\")" +"提供され、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"本プロジェクトまたは貢献者は、本ソフトウェアの使用に何らかの形で起因する、直" +"接損害、間接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" -#: ../../license.rst:391 msgid "Asynchronous socket services" -msgstr "Asynchronous socket services" +msgstr "非同期ソケットサービス" -#: ../../license.rst:393 msgid "" "The :mod:`!test.support.asynchat` and :mod:`!test.support.asyncore` modules " "contain the following notice::" msgstr "" +":mod:`!test.support.asynchat` モジュールと :mod:`!test.support.asyncore` モ" +"ジュールには次の告知が含まれています。 ::" -#: ../../license.rst:396 msgid "" "Copyright 1996 by Sam Rushing\n" "\n" @@ -698,16 +1005,34 @@ msgid "" "NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n" "CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE." msgstr "" +"Copyright 1996 by Sam Rushing\n" +"\n" +" All Rights Reserved\n" +"\n" +"本ソフトウェアおよびそのドキュメントを、目的を問わず使用、複製、変更、配布す" +"ることを、\n" +"ここに無償で許可します。\n" +"ただし、すべての複製物に上記の著作権表示を記載し、付属ドキュメントにその著作" +"権表示と本許諾表示の\n" +"両方を記載し、明確な事前の書面による許可なく、本ソフトウェアの配布に関する広" +"告または宣伝に\n" +"Sam Rushing の名称を使用しないことを条件とします。\n" +"\n" +"SAM RUSHING は、商品性および適合性についてのすべての黙示の保証を含め、\n" +"本ソフトウェアに関するすべての保証を否認します。\n" +"SAM RUSHING は、契約、過失、その他の不法行為のいずれに基づく訴えであるかを問" +"わず、\n" +"本ソフトウェアの使用もしくは動作に起因または関連する、特別損害、間接損害、結" +"果的損害、\n" +"または使用機会、データもしくは利益の喪失によるその他のいかなる損害について" +"も、一切責任を負わないものとします。" -#: ../../license.rst:419 msgid "Cookie management" -msgstr "Cookie management" +msgstr "Cookie の管理" -#: ../../license.rst:421 msgid "The :mod:`http.cookies` module contains the following notice::" -msgstr "The :mod:`http.cookies` module contains the following notice::" +msgstr ":mod:`http.cookies` モジュールには次の告知が含まれています。 ::" -#: ../../license.rst:423 msgid "" "Copyright 2000 by Timothy O'Malley \n" "\n" @@ -731,16 +1056,34 @@ msgid "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n" "PERFORMANCE OF THIS SOFTWARE." msgstr "" +"Copyright 2000 by Timothy O'Malley \n" +"\n" +" All Rights Reserved\n" +"\n" +"本ソフトウェアおよびそのドキュメントを、目的を問わず使用、複製、変更、配布す" +"ることを、\n" +"ここに無償で許可します。\n" +"ただし、すべての複製物に上記の著作権表示を記載し、付属ドキュメントにその著作" +"権表示と本許諾表示の\n" +"両方を記載し、明確な事前の書面による許可なく、本ソフトウェアの配布に関する広" +"告または宣伝に\n" +"Timothy O'Malley の名称を使用しないことを条件とします。\n" +"\n" +"Timothy O'Malley は、商品性および適合性についてのすべての黙示の保証を含め、\n" +"本ソフトウェアに関するすべての保証を否認します。\n" +"Timothy O'Malley は、契約、過失、その他の不法行為のいずれに基づく訴えであるか" +"を問わず、\n" +"本ソフトウェアの使用もしくは動作に起因または関連する、特別損害、間接損害、結" +"果的損害、\n" +"または使用機会、データもしくは利益の喪失によるその他のいかなる損害について" +"も、一切責任を負わないものとします。" -#: ../../license.rst:447 msgid "Execution tracing" -msgstr "Execution tracing" +msgstr "実行のトレース" -#: ../../license.rst:449 msgid "The :mod:`trace` module contains the following notice::" -msgstr "The :mod:`trace` module contains the following notice::" +msgstr ":mod:`trace` モジュールには次の告知が含まれています。 ::" -#: ../../license.rst:451 msgid "" "portions copyright 2001, Autonomous Zones Industries, Inc., all rights...\n" "err... reserved and offered to the public under the terms of the\n" @@ -769,16 +1112,42 @@ msgid "" "Bioreason or Mojam Media be used in advertising or publicity pertaining to\n" "distribution of the software without specific, written prior permission." msgstr "" +"一部の著作権は 2001 年 Autonomous Zones Industries, Inc. に帰属し、すべての権" +"利を……\n" +"ええと、留保します。\n" +"また、Python 2.2 ライセンスの条件に従って一般に提供します。\n" +"作者: Zooko O'Whielacronx\n" +"http://zooko.com/\n" +"mailto:zooko@zooko.com\n" +"\n" +"Copyright 2000, Mojam Media, Inc., all rights reserved.\n" +"作者: Skip Montanaro\n" +"\n" +"Copyright 1999, Bioreason, Inc., all rights reserved.\n" +"作者: Andrew Dalke\n" +"\n" +"Copyright 1995-1997, Automatrix, Inc., all rights reserved.\n" +"作者: Skip Montanaro\n" +"\n" +"Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved.\n" +"\n" +"\n" +"本 Python ソフトウェアおよびその関連ドキュメントを、目的を問わず使用、複製、" +"変更、配布することを、\n" +"ここに無償で許可します。\n" +"ただし、すべての複製物に上記の著作権表示を記載し、付属ドキュメントにその著作" +"権表示と本許諾表示の\n" +"両方を記載し、明確な事前の書面による許可なく、本ソフトウェアの配布に関する広" +"告または宣伝に\n" +"Automatrix、Bioreason、Mojam Media のいずれの名称も使用しないことを条件としま" +"す。" -#: ../../license.rst:480 msgid "UUencode and UUdecode functions" -msgstr "UUencode and UUdecode functions" +msgstr "UUencode 関数と UUdecode 関数" -#: ../../license.rst:482 msgid "The ``uu`` codec contains the following notice::" -msgstr "" +msgstr "``uu`` コーデックには次の告知が含まれています。 ::" -#: ../../license.rst:484 msgid "" "Copyright 1994 by Lance Ellinghouse\n" "Cathedral City, California Republic, United States of America.\n" @@ -804,16 +1173,39 @@ msgid "" " version is still 5 times faster, though.\n" "- Arguments more compliant with Python standard" msgstr "" +"Copyright 1994 by Lance Ellinghouse\n" +"Cathedral City, California Republic, United States of America.\n" +" All Rights Reserved\n" +"本ソフトウェアおよびそのドキュメントを、目的を問わず使用、複製、変更、配布す" +"ることを、\n" +"ここに無償で許可します。\n" +"ただし、すべての複製物に上記の著作権表示を記載し、付属ドキュメントにその著作" +"権表示と本許諾表示の\n" +"両方を記載し、明確な事前の書面による許可なく、本ソフトウェアの配布に関する広" +"告または宣伝に\n" +"Lance Ellinghouse の名称を使用しないことを条件とします。\n" +"LANCE ELLINGHOUSE は、商品性および適合性についてのすべての黙示の保証を含" +"め、\n" +"本ソフトウェアに関するすべての保証を否認します。\n" +"LANCE ELLINGHOUSE CENTRUM は、契約、過失、その他の不法行為のいずれに基づく訴" +"えであるかを問わず、\n" +"本ソフトウェアの使用もしくは動作に起因または関連する、特別損害、間接損害、結" +"果的損害、\n" +"または使用機会、データもしくは利益の喪失によるその他のいかなる損害について" +"も、一切責任を負わないものとします。\n" +"\n" +"Jack Jansen、CWI による 1995 年 7 月の変更:\n" +"- ascii とバイナリとの間の実際の行ごとの変換に binascii モジュールを使用。\n" +" これにより 1000 倍に高速化。\n" +" ただし、C 版はさらに 5 倍高速。\n" +"- 引数を Python の標準にさらに準拠させた" -#: ../../license.rst:510 msgid "XML Remote Procedure Calls" -msgstr "XML Remote Procedure Calls" +msgstr "XML リモート手続き呼び出し" -#: ../../license.rst:512 msgid "The :mod:`xmlrpc.client` module contains the following notice::" -msgstr "The :mod:`xmlrpc.client` module contains the following notice::" +msgstr ":mod:`xmlrpc.client` モジュールには次の告知が含まれています。 ::" -#: ../../license.rst:514 msgid "" " The XML-RPC client interface is\n" "\n" @@ -842,16 +1234,41 @@ msgid "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n" "OF THIS SOFTWARE." msgstr "" +" XML-RPC クライアントインターフェースの著作権は次のとおりです:\n" +"\n" +"Copyright (c) 1999-2002 by Secret Labs AB\n" +"Copyright (c) 1999-2002 by Fredrik Lundh\n" +"\n" +"本ソフトウェアおよび/またはその関連ドキュメントを取得、使用、および/または" +"複製することにより、\n" +"以下の条件を読み、理解し、遵守することに同意するものとします:\n" +"\n" +"本ソフトウェアおよびそのドキュメントを、目的を問わず使用、複製、変更、配布す" +"ることを、\n" +"ここに無償で許可します。\n" +"ただし、すべての複製物に上記の著作権表示を記載し、付属ドキュメントにその著作" +"権表示と本許諾表示の\n" +"両方を記載し、明確な事前の書面による許可なく、本ソフトウェアの配布に関する広" +"告または宣伝に\n" +"Secret Labs AB または作者の名称を使用しないことを条件とします。\n" +"\n" +"SECRET LABS AB および作者は、商品性および適合性についてのすべての黙示の保証を" +"含め、\n" +"本ソフトウェアに関するすべての保証を否認します。\n" +"SECRET LABS AB または作者は、契約、過失、その他の不法行為のいずれに基づく訴え" +"であるかを問わず、\n" +"本ソフトウェアの使用もしくは動作に起因または関連する、特別損害、間接損害、結" +"果的損害、\n" +"または使用機会、データもしくは利益の喪失によるその他のいかなる損害について" +"も、一切責任を負わないものとします。" #: ../../license.rst:543 msgid "test_epoll" msgstr "test_epoll" -#: ../../license.rst:545 msgid "The :mod:`!test.test_epoll` module contains the following notice::" -msgstr "" +msgstr ":mod:`!test.test_epoll` モジュールには次の告知が含まれています。 ::" -#: ../../license.rst:547 msgid "" "Copyright (c) 2001-2006 Twisted Matrix Laboratories.\n" "\n" @@ -874,6 +1291,28 @@ msgid "" "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." msgstr "" +"Copyright (c) 2001-2006 Twisted Matrix Laboratories.\n" +"\n" +"本ソフトウェアおよび関連ドキュメントファイル(以下「本ソフトウェア」)のコ" +"ピーを取得するすべての人に、\n" +"本ソフトウェアを制限なく扱うことを、ここに無償で許可します。\n" +"これには、本ソフトウェアのコピーを使用、複製、変更、結合、公開、配布、再許" +"諾、および/または販売する権利、\n" +"ならびに本ソフトウェアの提供先に同じ行為を許可する権利が含まれますが、これら" +"に限定されません。\n" +"ただし、次の条件に従うものとします:\n" +"\n" +"上記の著作権表示および本許諾表示を、本ソフトウェアのすべてのコピーまたは重要" +"な部分に含めなければなりません。\n" +"\n" +"本ソフトウェアは「現状のまま」(\"AS IS\")提供され、商品性、特定の目的への適" +"合性、および非侵害の保証を含む\n" +"(ただしこれらに限定されない)、明示または黙示のいかなる保証もありません。\n" +"作者または著作権者は、契約、不法行為、その他のいずれに基づくかを問わず、本ソ" +"フトウェア、\n" +"または本ソフトウェアの使用その他の取り扱いに起因もしくは関連して生じるいかな" +"る請求、損害、\n" +"その他の責任についても、一切責任を負わないものとします。" #: ../../license.rst:569 msgid "Select kqueue" @@ -887,7 +1326,6 @@ msgstr "" ":mod:`select` モジュールは kqueue インターフェースについての次の告知を含んで" "います::" -#: ../../license.rst:574 msgid "" "Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes\n" "All rights reserved.\n" @@ -913,18 +1351,45 @@ msgid "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." msgstr "" +"Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes\n" +"All rights reserved.\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"1. ソースコードを再配布する場合、上記の著作権表示、この条件一覧、および次の免" +"責事項を保持しなければなりません。\n" +"2. バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"\n" +"本ソフトウェアは作者および貢献者によって「現状のまま」(\"AS IS\")提供さ" +"れ、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"作者または貢献者は、本ソフトウェアの使用に何らかの形で起因する、直接損害、間" +"接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" #: ../../license.rst:600 msgid "SipHash24" msgstr "SipHash24" -#: ../../license.rst:602 msgid "" "The file :file:`Python/pyhash.c` contains Marek Majkowski' implementation of " "Dan Bernstein's SipHash24 algorithm. It contains the following note::" msgstr "" +":file:`Python/pyhash.c` ファイルには、Dan Bernstein の SipHash24 アルゴリズム" +"を Marek Majkowski が実装したものが含まれています。\n" +"このファイルには次の注記が含まれています。 ::" -#: ../../license.rst:605 msgid "" "\n" "Copyright (c) 2013 Marek Majkowski \n" @@ -951,12 +1416,34 @@ msgid "" " djb (supercop/crypto_auth/siphash24/little2)\n" " Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)" msgstr "" +"\n" +"Copyright (c) 2013 Marek Majkowski \n" +"\n" +"本ソフトウェアおよび関連ドキュメントファイル(以下「本ソフトウェア」)のコ" +"ピーを取得するすべての人に、\n" +"本ソフトウェアを制限なく扱うことを、ここに無償で許可します。\n" +"これには、本ソフトウェアのコピーを使用、複製、変更、結合、公開、配布、再許" +"諾、および/または販売する権利、\n" +"ならびに本ソフトウェアの提供先に同じ行為を許可する権利が含まれますが、これら" +"に限定されません。\n" +"ただし、次の条件に従うものとします:\n" +"\n" +"上記の著作権表示および本許諾表示を、本ソフトウェアのすべてのコピーまたは重要" +"な部分に含めなければなりません。\n" +"\n" +"\n" +"元の公開場所:\n" +" https://github.com/majek/csiphash/\n" +"\n" +"解決方法の着想を得たコード:\n" +" Samuel Neves (supercop/crypto_auth/siphash24/little)\n" +" djb (supercop/crypto_auth/siphash24/little2)\n" +" Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)" #: ../../license.rst:629 msgid "strtod and dtoa" msgstr "strtod と dtoa" -#: ../../license.rst:631 msgid "" "The file :file:`Python/dtoa.c`, which supplies C functions dtoa and strtod " "for conversion of C doubles to and from strings, is derived from the file of " @@ -965,8 +1452,13 @@ msgid "" "as retrieved on March 16, 2009, contains the following copyright and " "licensing notice::" msgstr "" +"C の double と文字列との相互変換を行う C 関数 dtoa と strtod を提供する :" +"file:`Python/dtoa.c` ファイルは、David M. Gay による同名のファイル(現在は " +"https://web.archive.org/web/20220517033456/http://www.netlib.org/fp/dtoa.c で" +"入手できます)に由来します。\n" +"2009 年 3 月 16 日に取得した元のファイルには、次の著作権表示とライセンスに関" +"する告知が含まれています。 ::" -#: ../../license.rst:638 msgid "" "/****************************************************************\n" " *\n" @@ -988,12 +1480,32 @@ msgid "" " *\n" " ***************************************************************/" msgstr "" +"/****************************************************************\n" +" *\n" +" * 本ソフトウェアの作者は David M. Gay です。\n" +" *\n" +" * Copyright (c) 1991, 2000, 2001 by Lucent Technologies.\n" +" *\n" +" * 本ソフトウェアを、目的を問わず使用、複製、変更、配布することを、ここに無償" +"で許可します。\n" +" * ただし、本ソフトウェアのコピーもしくは変更版である、またはそれらを含むソフ" +"トウェアの\n" +" * すべてのコピー、およびそのようなソフトウェアの付属ドキュメントのすべてのコ" +"ピーに、\n" +" * この告知全体を含めることを条件とします。\n" +" *\n" +" * 本ソフトウェアは「現状のまま」(\"AS IS\")提供され、明示または黙示のいか" +"なる保証もありません。\n" +" * 特に、作者も LUCENT も、本ソフトウェアの商品性または特定の目的への適合性に" +"ついて、\n" +" * いかなる種類の表明も保証も行いません。\n" +" *\n" +" ***************************************************************/" #: ../../license.rst:659 msgid "OpenSSL" msgstr "OpenSSL" -#: ../../license.rst:661 msgid "" "The modules :mod:`hashlib`, :mod:`posix` and :mod:`ssl` use the OpenSSL " "library for added performance if made available by the operating system. " @@ -1002,8 +1514,15 @@ msgid "" "For the OpenSSL 3.0 release, and later releases derived from that, the " "Apache License v2 applies::" msgstr "" +":mod:`hashlib`、:mod:`posix`、:mod:`ssl` の各モジュールは、オペレーティングシ" +"ステムが OpenSSL ライブラリを提供している場合、性能向上のためにそれを使用しま" +"す。\n" +"また、Windows 用および macOS 用の Python インストーラに OpenSSL ライブラリの" +"コピーが含まれる場合があるため、ここに OpenSSL のライセンスのコピーを掲載しま" +"す。\n" +"OpenSSL 3.0 およびそれから派生した後続のリリースには、Apache License v2 が適" +"用されます。 ::" -#: ../../license.rst:669 msgid "" " Apache License\n" " Version 2.0, January 2004\n" @@ -1182,19 +1701,219 @@ msgid "" "\n" "END OF TERMS AND CONDITIONS" msgstr "" +" Apache License\n" +" Version 2.0, January 2004\n" +" https://www.apache.org/licenses/\n" +"\n" +"使用、複製、および配布に関する条件\n" +"\n" +"1. 定義。\n" +"\n" +" 「本ライセンス」とは、本書の第 1 条から第 9 条で定める使用、複製、および配" +"布に関する条件をいいます。\n" +"\n" +" 「ライセンサー」とは、本ライセンスを付与する著作権者、または著作権者から権" +"限を与えられた主体をいいます。\n" +"\n" +" 「法人」とは、行為を行う主体と、その主体を支配する、その主体に支配される、" +"またはその主体と共通の\n" +" 支配下にあるその他すべての主体の集合をいいます。\n" +" この定義において、「支配」とは、(i) 契約その他の手段によって、直接または間" +"接にその主体の指揮または\n" +" 経営を行わせる権限、(ii) 発行済株式の 50% 以上の所有、または (iii) その主" +"体の実質的な所有を意味します。\n" +"\n" +" 「あなた」とは、本ライセンスによって付与される許可を行使する個人または法人" +"をいいます。\n" +"\n" +" 「ソース」形式とは、変更を加えるのに適した形式をいい、ソフトウェアのソース" +"コード、ドキュメントの\n" +" ソース、および設定ファイルを含みますが、これらに限定されません。\n" +"\n" +" 「オブジェクト」形式とは、ソース形式の機械的な変換または翻訳によって生じる" +"あらゆる形式をいい、\n" +" コンパイルされたオブジェクトコード、生成されたドキュメント、および他のメ" +"ディア形式への変換物を\n" +" 含みますが、これらに限定されません。\n" +"\n" +" 「本著作物」とは、その著作物に含まれる、または添付される著作権表示によって" +"示される、本ライセンスの\n" +" もとで提供される著作物をいい、ソース形式かオブジェクト形式かを問いません\n" +" (下記の付録に例を示します)。\n" +"\n" +" 「派生著作物」とは、本著作物に基づく(または本著作物から派生した)著作物" +"で、編集上の改訂、注釈、\n" +" 詳細化、またはその他の変更が全体として独創的な著作物を構成するものをいい、" +"ソース形式かオブジェクト\n" +" 形式かを問いません。\n" +" 本ライセンスにおいて、派生著作物には、本著作物およびその派生著作物から分離" +"可能なままの著作物、\n" +" またはそれらのインターフェースに単にリンクする(もしくは名前でバインドす" +"る)著作物は含まれません。\n" +"\n" +" 「貢献物」とは、本著作物に組み込むために、著作権者、または著作権者に代わっ" +"て提出する権限を与えられた\n" +" 個人もしくは法人によって、意図的にライセンサーに提出される著作物をいい、本" +"著作物の元のバージョン、\n" +" 本著作物もしくはその派生著作物に対する変更または追加を含みます。\n" +" この定義において、「提出」とは、ライセンサーまたはその代理人に送られる、電" +"子的、口頭、または書面による\n" +" あらゆる形式の通信を意味します。\n" +" これには、本著作物の議論と改善を目的としてライセンサーまたはその代理で管理" +"される電子メーリングリスト、\n" +" ソースコード管理システム、および課題管理システム上の通信を含みますが、これ" +"らに限定されません。\n" +" ただし、著作権者が「貢献物ではない」(\"Not a Contribution.\")と目立つよ" +"うに表示するか、\n" +" その他の方法で書面により指定した通信は除きます。\n" +"\n" +" 「貢献者」とは、ライセンサーと、その者に代わって提出された貢献物がライセン" +"サーによって受領され、\n" +" その後、本著作物に組み込まれた個人または法人をいいます。\n" +"\n" +"2. 著作権ライセンスの付与。\n" +" 本ライセンスの条件に従い、各貢献者はあなたに対し、本著作物およびその派生著" +"作物を、ソース形式または\n" +" オブジェクト形式で、複製、派生著作物の作成、公の展示、公の実演、再許諾、お" +"よび配布するための、\n" +" 永続的、全世界的、非独占的、無償、使用料不要、かつ取消不能の著作権ライセン" +"スをここに付与します。\n" +"\n" +"3. 特許ライセンスの付与。\n" +" 本ライセンスの条件に従い、各貢献者はあなたに対し、本著作物を製造、製造委" +"託、使用、販売の申出、販売、\n" +" 輸入、およびその他の方法で移転するための、永続的、全世界的、非独占的、無" +"償、使用料不要、かつ\n" +" 取消不能(本条に定める場合を除く)の特許ライセンスをここに付与します。\n" +" このライセンスは、当該貢献者がライセンスを付与できる特許の請求項のうち、そ" +"の貢献物単体によって、\n" +" またはその貢献物と、それが提出された本著作物との組み合わせによって、必然的" +"に侵害されるものだけに\n" +" 適用されます。\n" +" 本著作物または本著作物に組み込まれた貢献物が直接的または寄与的な特許侵害を" +"構成すると主張して、\n" +" あなたがいずれかの主体に対して特許訴訟(訴訟における交差請求または反訴を含" +"む)を起こした場合、\n" +" 本ライセンスに基づいて当該本著作物についてあなたに付与された特許ライセンス" +"はすべて、\n" +" その訴訟を提起した日に終了します。\n" +"\n" +"4. 再配布。\n" +" あなたは、以下の条件を満たすことを条件として、変更の有無を問わず、ソース形" +"式またはオブジェクト形式で、\n" +" 任意の媒体において、本著作物またはその派生著作物のコピーを複製および配布で" +"きます:\n" +"\n" +" (a) 本著作物または派生著作物の他の受領者に、本ライセンスのコピーを渡さなけ" +"ればなりません。\n" +" かつ、\n" +"\n" +" (b) 変更したファイルには、あなたがそのファイルを変更した旨を示す目立つ告知" +"を付けなければなりません。\n" +" かつ、\n" +"\n" +" (c) あなたが配布する派生著作物のソース形式には、本著作物のソース形式にある" +"すべての著作権、特許、商標、\n" +" および帰属の表示を保持しなければなりません。\n" +" ただし、その派生著作物のどの部分にも関係しない表示は除きます。\n" +" かつ、\n" +"\n" +" (d) 本著作物の配布物の一部に「NOTICE」テキストファイルが含まれる場合、あな" +"たが配布する派生著作物には、\n" +" その NOTICE ファイルに含まれる帰属表示の読み取り可能なコピーを、以下の" +"場所のうち少なくとも一つに\n" +" 含めなければなりません。\n" +" ただし、その派生著作物のどの部分にも関係しない表示は除きます:\n" +" 派生著作物の一部として配布される NOTICE テキストファイル内、派生著作物" +"に付属して提供される場合は\n" +" そのソース形式またはドキュメント内、または、派生著作物が生成する表示の" +"中で、第三者のそのような\n" +" 表示が通常現れる場合にはその場所。\n" +" NOTICE ファイルの内容は情報提供のみを目的としており、本ライセンスを変" +"更するものではありません。\n" +" あなたが配布する派生著作物には、本著作物の NOTICE の文章と並べるか、そ" +"の追記として、\n" +" あなた自身の帰属表示を追加できます。\n" +" ただし、その追加の帰属表示が本ライセンスを変更するものと解釈され得ない" +"ことを条件とします。\n" +"\n" +" あなたの変更に対してあなた自身の著作権表示を追加し、あなたの変更、または派" +"生著作物の全体について、\n" +" その使用、複製、配布に追加の、または異なるライセンス条件を設けることができ" +"ます。\n" +" ただし、それ以外の点では、あなたによる本著作物の使用、複製、および配布が、" +"本ライセンスに記載された\n" +" 条件に従っていることを条件とします。\n" +"\n" +"5. 貢献物の提出。\n" +" あなたが明示的に別段の定めをした場合を除き、あなたが本著作物に組み込むため" +"に意図的にライセンサーに\n" +" 提出した貢献物には、追加の条件なしに、本ライセンスの条件が適用されます。\n" +" 上記にかかわらず、本条のいかなる規定も、その貢献物についてあなたがライセン" +"サーと締結した別の\n" +" ライセンス契約の条件に優先し、またはそれを変更するものではありません。\n" +"\n" +"6. 商標。\n" +" 本ライセンスは、本著作物の出自の記述や NOTICE ファイルの内容の転載において" +"合理的かつ慣例的な使用に\n" +" 必要とされる場合を除き、ライセンサーの商号、商標、サービスマーク、製品名の" +"使用を許可しません。\n" +"\n" +"7. 保証の否認。\n" +" 適用法により要求される場合または書面で合意される場合を除き、ライセンサーは" +"本著作物を\n" +" (また各貢献者はその貢献物を)「現状のまま」(\"AS IS\")提供し、明示また" +"は黙示を問わず、\n" +" 権原、非侵害、商品性、または特定の目的への適合性に関する保証もしくは条件を" +"含む\n" +" (ただしこれらに限定されない)、いかなる種類の保証も条件もありません。\n" +" 本著作物の使用または再配布が適切かどうかの判断は、あなたのみの責任であ" +"り、\n" +" 本ライセンスに基づく許可の行使に伴うすべてのリスクをあなたが負うものとしま" +"す。\n" +"\n" +"8. 責任の制限。\n" +" 適用法により要求される場合(故意や重過失による行為など)または書面で合意さ" +"れる場合を除き、\n" +" いかなる貢献者も、本ライセンス、または本著作物の使用もしくは使用不能に起因" +"するあらゆる種類の\n" +" 直接損害、間接損害、特別損害、付随的損害、または結果的損害(信用の喪失、業" +"務の停止、コンピュータの\n" +" 故障もしくは誤動作、その他あらゆる商業上の損害もしくは損失を含みますが、こ" +"れらに限定されません)を\n" +" 含む損害について、不法行為(過失を含む)、契約、その他のいかなる法理論に基" +"づくかを問わず、\n" +" たとえその貢献者が当該損害の可能性を知らされていたとしても、あなたに対して" +"一切責任を負いません。\n" +"\n" +"9. 保証または追加の責任の引受け。\n" +" 本著作物またはその派生著作物を再配布する際、あなたは、本ライセンスに矛盾し" +"ない範囲で、サポート、保証、\n" +" 補償、その他の責任義務および/または権利の引受けを提供し、その対価を請求す" +"ることを選択できます。\n" +" ただし、そのような義務を引き受けるにあたっては、他の貢献者のためにではな" +"く、あなた自身のために、\n" +" あなたのみの責任で行うものとします。\n" +" また、そのような保証または追加の責任を引き受けたことを理由として、各貢献者" +"が負う責任や、各貢献者に対して\n" +" 主張される請求について、あなたが各貢献者を補償し、防御し、損害を被らせない" +"ことに同意する場合に限ります。\n" +"\n" +"条件の終わり" #: ../../license.rst:848 msgid "expat" msgstr "expat" -#: ../../license.rst:850 msgid "" "The :mod:`pyexpat ` extension is built using an included " "copy of the expat sources unless the build is configured :option:`--with-" "system-expat`:" msgstr "" +":option:`--with-system-expat` を指定してビルドを構成しない限り、:mod:" +"`pyexpat ` 拡張は同梱された expat ソースのコピーを使ってビ" +"ルドされます:" -#: ../../license.rst:853 msgid "" "Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark " "Cooper\n" @@ -1219,19 +1938,44 @@ msgid "" "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n" "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n" msgstr "" +"Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark " +"Cooper\n" +"Copyright (c) 2001-2025 Expat maintainers\n" +"\n" +"本ソフトウェアおよび関連ドキュメントファイル(以下「本ソフトウェア」)のコ" +"ピーを取得するすべての人に、\n" +"本ソフトウェアを制限なく扱うことを、ここに無償で許可します。\n" +"これには、本ソフトウェアのコピーを使用、複製、変更、結合、公開、配布、再許" +"諾、および/または販売する権利、\n" +"ならびに本ソフトウェアの提供先に同じ行為を許可する権利が含まれますが、これら" +"に限定されません。\n" +"ただし、次の条件に従うものとします:\n" +"\n" +"上記の著作権表示および本許諾表示を、本ソフトウェアのすべてのコピーまたは重要" +"な部分に含めなければなりません。\n" +"\n" +"本ソフトウェアは「現状のまま」(\"AS IS\")提供され、商品性、特定の目的への適" +"合性、および非侵害の保証を含む\n" +"(ただしこれらに限定されない)、明示または黙示のいかなる保証もありません。\n" +"作者または著作権者は、契約、不法行為、その他のいずれに基づくかを問わず、本ソ" +"フトウェア、\n" +"または本ソフトウェアの使用その他の取り扱いに起因もしくは関連して生じるいかな" +"る請求、損害、\n" +"その他の責任についても、一切責任を負わないものとします。\n" #: ../../license.rst:858 msgid "libffi" msgstr "libffi" -#: ../../license.rst:860 msgid "" "The :mod:`!_ctypes` C extension underlying the :mod:`ctypes` module is built " "using an included copy of the libffi sources unless the build is configured " "``--with-system-libffi``::" msgstr "" +"``--with-system-libffi`` を指定してビルドを構成しない限り、:mod:`ctypes` モ" +"ジュールの基盤となる :mod:`!_ctypes` C 拡張は、同梱された libffi ソースのコ" +"ピーを使ってビルドされます。 ::" -#: ../../license.rst:864 msgid "" "Copyright (c) 1996-2008 Red Hat, Inc and others.\n" "\n" @@ -1255,22 +1999,41 @@ msgid "" "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n" "DEALINGS IN THE SOFTWARE." msgstr "" +"Copyright (c) 1996-2008 Red Hat, Inc and others.\n" +"\n" +"本ソフトウェアおよび関連ドキュメントファイル(以下「本ソフトウェア」)のコ" +"ピーを取得するすべての人に、\n" +"本ソフトウェアを制限なく扱うことを、ここに無償で許可します。\n" +"これには、本ソフトウェアのコピーを使用、複製、変更、結合、公開、配布、再許" +"諾、および/または販売する権利、\n" +"ならびに本ソフトウェアの提供先に同じ行為を許可する権利が含まれますが、これら" +"に限定されません。\n" +"ただし、次の条件に従うものとします:\n" +"\n" +"上記の著作権表示および本許諾表示を、本ソフトウェアのすべてのコピーまたは重要" +"な部分に含めなければなりません。\n" +"\n" +"本ソフトウェアは「現状のまま」(\"AS IS\")提供され、商品性、特定の目的への適" +"合性、および非侵害の保証を含む\n" +"(ただしこれらに限定されない)、明示または黙示のいかなる保証もありません。\n" +"作者または著作権者は、契約、不法行為、その他のいずれに基づくかを問わず、本ソ" +"フトウェア、\n" +"または本ソフトウェアの使用その他の取り扱いに起因もしくは関連して生じるいかな" +"る請求、損害、\n" +"その他の責任についても、一切責任を負わないものとします。" #: ../../license.rst:888 msgid "zlib" msgstr "zlib" -#: ../../license.rst:890 msgid "" "The :mod:`zlib` extension is built using an included copy of the zlib " "sources if the zlib version found on the system is too old to be used for " "the build::" msgstr "" -"The :mod:`zlib` extension is built using an included copy of the zlib " -"sources if the zlib version found on the system is too old to be used for " -"the build::" +"システム上で見つかった zlib のバージョンが古すぎてビルドに使用できない場合、:" +"mod:`zlib` 拡張は同梱された zlib ソースのコピーを使ってビルドされます。 ::" -#: ../../license.rst:894 msgid "" "Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler\n" "\n" @@ -1295,20 +2058,43 @@ msgid "" "Jean-loup Gailly Mark Adler\n" "jloup@gzip.org madler@alumni.caltech.edu" msgstr "" +"Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler\n" +"\n" +"本ソフトウェアは「現状のまま」('as-is')提供され、明示または黙示のいかなる保" +"証もありません。\n" +"作者は、本ソフトウェアの使用に起因するいかなる損害についても、一切責任を負い" +"ません。\n" +"\n" +"商用アプリケーションを含むあらゆる目的で本ソフトウェアを使用し、変更し、自由" +"に再配布することを、\n" +"次の制限に従うことを条件として、すべての人に許可します:\n" +"\n" +"1. 本ソフトウェアの出自を偽ってはなりません。\n" +" 元のソフトウェアを自分が書いたと主張してはなりません。\n" +" 製品で本ソフトウェアを使用する場合、製品のドキュメントに謝辞を記載していた" +"だければ幸いですが、\n" +" 必須ではありません。\n" +"\n" +"2. 変更されたソース版には、その旨を明確に表示しなければならず、元のソフトウェ" +"アであると偽ってはなりません。\n" +"\n" +"3. いかなるソース配布物からも、この告知を削除したり変更したりしてはなりませ" +"ん。\n" +"\n" +"Jean-loup Gailly Mark Adler\n" +"jloup@gzip.org madler@alumni.caltech.edu" #: ../../license.rst:919 msgid "cfuhash" msgstr "cfuhash" -#: ../../license.rst:921 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" msgstr "" -"The implementation of the hash table used by the :mod:`tracemalloc` で使用し" -"ているハッシュテーブルの実装は、cfuhashプロジェクトのものに基づきます::" +":mod:`tracemalloc` で使用されるハッシュテーブルの実装は、cfuhash プロジェクト" +"に基づいています。 ::" -#: ../../license.rst:924 msgid "" "Copyright (c) 2005 Don Owens\n" "All rights reserved.\n" @@ -1344,19 +2130,50 @@ msgid "" "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n" "OF THE POSSIBILITY OF SUCH DAMAGE." msgstr "" +"Copyright (c) 2005 Don Owens\n" +"All rights reserved.\n" +"\n" +"このコードは BSD ライセンスのもとでリリースされています:\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"* ソースコードを再配布する場合、上記の著作権表示、この条件一覧、および次の免" +"責事項を保持しなければなりません。\n" +"* バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"* 明確な事前の書面による許可なく、本ソフトウェアから派生した製品を推奨または" +"宣伝するために、作者またはその貢献者の名称を使用してはなりません。\n" +"\n" +"本ソフトウェアは著作権者および貢献者によって「現状のまま」(\"AS IS\")提供さ" +"れ、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"著作権者または貢献者は、本ソフトウェアの使用に何らかの形で起因する、直接損" +"害、間接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" #: ../../license.rst:960 msgid "libmpdec" msgstr "libmpdec" -#: ../../license.rst:962 msgid "" "The :mod:`!_decimal` C extension underlying the :mod:`decimal` module is " "built using an included copy of the libmpdec library unless the build is " "configured ``--with-system-libmpdec``::" msgstr "" +"``--with-system-libmpdec`` を指定してビルドを構成しない限り、:mod:`decimal` " +"モジュールの基盤となる :mod:`!_decimal` C 拡張は、同梱された libmpdec ライブ" +"ラリのコピーを使ってビルドされます。 ::" -#: ../../license.rst:966 msgid "" "Copyright (c) 2008-2020 Stefan Krah. All rights reserved.\n" "\n" @@ -1383,19 +2200,45 @@ msgid "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." msgstr "" +"Copyright (c) 2008-2020 Stefan Krah. All rights reserved.\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"1. ソースコードを再配布する場合、上記の著作権表示、この条件一覧、および次の免" +"責事項を保持しなければなりません。\n" +"2. バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"\n" +"本ソフトウェアは作者および貢献者によって「現状のまま」(\"AS IS\")提供さ" +"れ、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"作者または貢献者は、本ソフトウェアの使用に何らかの形で起因する、直接損害、間" +"接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" -#: ../../license.rst:993 msgid "W3C C14N test suite" -msgstr "W3C C14N test suite" +msgstr "W3C C14N テストスイート" -#: ../../license.rst:995 msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" "c14n2-testcases/ and is distributed under the 3-clause BSD license::" msgstr "" +":mod:`test` パッケージ内の C14N 2.0 テストスイート(``Lib/test/xmltestdata/" +"c14n-20/``)は、W3C のウェブサイト https://www.w3.org/TR/xml-c14n2-" +"testcases/ から取得したもので、3 条項 BSD ライセンスのもとで配布されていま" +"す。 ::" -#: ../../license.rst:1000 msgid "" "Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang),\n" "All Rights Reserved.\n" @@ -1425,14 +2268,40 @@ msgid "" "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." msgstr "" +"Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang),\n" +"All Rights Reserved.\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"* 著作物を再配布する場合、元の著作権表示、この条件一覧、および次の免責事項を" +"保持しなければなりません。\n" +"* バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、元の著作権表示、この条件一覧、および次の免責事項を転載しなけれ" +"ばなりません。\n" +"* 明確な事前の書面による許可なく、本著作物から派生した製品を推奨または宣伝す" +"るために、W3C またはその貢献者の名称を使用してはなりません。\n" +"\n" +"本ソフトウェアは著作権者および貢献者によって「現状のまま」(\"AS IS\")提供さ" +"れ、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"著作権者または貢献者は、本ソフトウェアの使用に何らかの形で起因する、直接損" +"害、間接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" -#: ../../license.rst:1032 msgid "mimalloc" -msgstr "" +msgstr "mimalloc" -#: ../../license.rst:1034 msgid "MIT License::" -msgstr "" +msgstr "MIT License::" #: ../../license.rst:1036 msgid "" @@ -1468,14 +2337,15 @@ msgstr "" msgid "asyncio" msgstr "asyncio" -#: ../../license.rst:1060 msgid "" "Parts of the :mod:`asyncio` module are incorporated from `uvloop 0.16 " "`_, which is distributed " "under the MIT license::" msgstr "" +":mod:`asyncio` モジュールの一部は、MIT ライセンスのもとで配布されている " +"`uvloop 0.16 `_ から組み込" +"まれたものです。 ::" -#: ../../license.rst:1064 msgid "" "Copyright (c) 2015-2021 MagicStack Inc. http://magic.io\n" "\n" @@ -1498,20 +2368,43 @@ msgid "" "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." msgstr "" +"Copyright (c) 2015-2021 MagicStack Inc. http://magic.io\n" +"\n" +"本ソフトウェアおよび関連ドキュメントファイル(以下「本ソフトウェア」)のコ" +"ピーを取得するすべての人に、\n" +"本ソフトウェアを制限なく扱うことを、ここに無償で許可します。\n" +"これには、本ソフトウェアのコピーを使用、複製、変更、結合、公開、配布、再許" +"諾、および/または販売する権利、\n" +"ならびに本ソフトウェアの提供先に同じ行為を許可する権利が含まれますが、これら" +"に限定されません。\n" +"ただし、次の条件に従うものとします:\n" +"\n" +"上記の著作権表示および本許諾表示を、本ソフトウェアのすべてのコピーまたは重要" +"な部分に含めなければなりません。\n" +"\n" +"本ソフトウェアは「現状のまま」(\"AS IS\")提供され、商品性、特定の目的への適" +"合性、および非侵害の保証を含む\n" +"(ただしこれらに限定されない)、明示または黙示のいかなる保証もありません。\n" +"作者または著作権者は、契約、不法行為、その他のいずれに基づくかを問わず、本ソ" +"フトウェア、\n" +"または本ソフトウェアの使用その他の取り扱いに起因もしくは関連して生じるいかな" +"る請求、損害、\n" +"その他の責任についても、一切責任を負わないものとします。" -#: ../../license.rst:1087 msgid "Global Unbounded Sequences (GUS)" -msgstr "" +msgstr "Global Unbounded Sequences (GUS)" -#: ../../license.rst:1089 msgid "" "The file :file:`Python/qsbr.c` is adapted from FreeBSD's \"Global Unbounded " "Sequences\" safe memory reclamation scheme in `subr_smr.c `_. The file is " "distributed under the 2-Clause BSD License::" msgstr "" +":file:`Python/qsbr.c` ファイルは、`subr_smr.c `_ にある FreeBSD の「Global " +"Unbounded Sequences」という安全なメモリ回収方式をもとに改変したものです。\n" +"このファイルは 2 条項 BSD ライセンスのもとで配布されています。 ::" -#: ../../license.rst:1094 msgid "" "Copyright (c) 2019,2020 Jeffrey Roberson \n" "\n" @@ -1536,20 +2429,44 @@ msgid "" "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n" "THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." msgstr "" +"Copyright (c) 2019,2020 Jeffrey Roberson \n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"1. ソースコードを再配布する場合、上記の著作権表示を変更せずに、この条件一覧お" +"よび次の免責事項とともに保持しなければなりません。\n" +"2. バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"\n" +"本ソフトウェアは作者によって「現状のまま」(\"AS IS\")提供され、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"作者は、本ソフトウェアの使用に何らかの形で起因する、直接損害、間接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" -#: ../../license.rst:1119 msgid "Zstandard bindings" -msgstr "" +msgstr "Zstandard バインディング" -#: ../../license.rst:1121 msgid "" "Zstandard bindings in :file:`Modules/_zstd` and :file:`Lib/compression/zstd` " "are based on code from the `pyzstd library `_, copyright Ma Lin and contributors. The pyzstd code is " "distributed under the 3-Clause BSD License::" msgstr "" +":file:`Modules/_zstd` および :file:`Lib/compression/zstd` の Zstandard バイン" +"ディングは、Ma Lin および貢献者が著作権を持つ `pyzstd ライブラリ `_ のコードに基づいています。\n" +"pyzstd のコードは 3 条項 BSD ライセンスのもとで配布されています。 ::" -#: ../../license.rst:1126 msgid "" "Copyright (c) 2020-present, Ma Lin and contributors.\n" "All rights reserved.\n" @@ -1587,37 +2504,63 @@ msgid "" "USE\n" "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." msgstr "" +"Copyright (c) 2020-present, Ma Lin and contributors.\n" +"All rights reserved.\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"1. ソースコードを再配布する場合、上記の著作権表示、この条件一覧、および次の免" +"責事項を保持しなければなりません。\n" +"2. バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"3. 明確な事前の書面による許可なく、本ソフトウェアから派生した製品を推奨または" +"宣伝するために、著作権者またはその貢献者の名称を使用してはなりません。\n" +"\n" +"本ソフトウェアは著作権者および貢献者によって「現状のまま」(\"AS IS\")提供さ" +"れ、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"著作権者または貢献者は、本ソフトウェアの使用に何らかの形で起因する、直接損" +"害、間接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" -#: ../../license.rst:1156 msgid "Profiling module" -msgstr "" +msgstr "プロファイリングモジュール" -#: ../../license.rst:1158 msgid "" "The :mod:`!profiling` module includes vendored third-party libraries in :" "file:`Lib/profiling/sampling/_vendor/` with the following licenses:" msgstr "" +":mod:`!profiling` モジュールには、次のライセンスが適用されるサードパーティラ" +"イブラリが :file:`Lib/profiling/sampling/_vendor/` に同梱されています:" -#: ../../license.rst:1161 msgid "**d3-flamegraph**" -msgstr "" +msgstr "**d3-flamegraph**" -#: ../../license.rst:1163 msgid "" "The d3-flamegraph library is distributed under the Apache License, Version " "2.0. See the OpenSSL section above for the full text of the Apache License " "Version 2.0." msgstr "" +"d3-flamegraph ライブラリは Apache License, Version 2.0 のもとで配布されていま" +"す。\n" +"Apache License Version 2.0 の全文は、上の OpenSSL の節を参照してください。" -#: ../../license.rst:1166 msgid "**d3.js**" -msgstr "" +msgstr "**d3.js**" -#: ../../license.rst:1168 msgid "The d3.js library contains the following notice::" -msgstr "" +msgstr "d3.js ライブラリには次の告知が含まれています。 ::" -#: ../../license.rst:1170 msgid "" "Copyright 2010-2021 Mike Bostock\n" "\n" @@ -1640,19 +2583,34 @@ msgid "" "OF\n" "THIS SOFTWARE." msgstr "" +"Copyright 2010-2021 Mike Bostock\n" +"\n" +"本ソフトウェアを、目的を問わず、有償または無償で使用、複製、変更、および/ま" +"たは配布することを、\n" +"すべての複製物に上記の著作権表示および本許諾表示を記載することを条件として、" +"ここに許可します。\n" +"\n" +"本ソフトウェアは「現状のまま」(\"AS IS\")提供され、作者は、商品性および適合" +"性についてのすべての\n" +"黙示の保証を含め、本ソフトウェアに関するすべての保証を否認します。\n" +"作者は、契約、過失、その他の不法行為のいずれに基づく訴えであるかを問わず、本" +"ソフトウェアの使用\n" +"もしくは動作に起因または関連する、特別損害、直接損害、間接損害、結果的損害、" +"または使用機会、\n" +"データもしくは利益の喪失によるその他のいかなる損害についても、一切責任を負わ" +"ないものとします。" -#: ../../license.rst:1186 msgid "Pixi packages" -msgstr "" +msgstr "Pixi パッケージ" -#: ../../license.rst:1188 msgid "" "The Pixi package definitions found in :file:`Tools/pixi-packages` are " "derived from https://github.com/conda-forge/python-feedstock which contains " "the following license::" msgstr "" +":file:`Tools/pixi-packages` にある Pixi パッケージ定義は、次のライセンスを含" +"む https://github.com/conda-forge/python-feedstock に由来します。 ::" -#: ../../license.rst:1192 msgid "" "BSD-3-Clause license\n" "Copyright (c) 2015-2026, conda-forge contributors\n" @@ -1683,12 +2641,39 @@ msgid "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n" "DAMAGE." msgstr "" +"BSD-3-Clause license\n" +"Copyright (c) 2015-2026, conda-forge contributors\n" +"All rights reserved.\n" +"\n" +"変更の有無を問わず、ソース形式およびバイナリ形式での再配布と使用を、次の条件" +"を満たす場合に許可します:\n" +"1. ソースコードを再配布する場合、上記の著作権表示、この条件一覧、および次の免" +"責事項を保持しなければなりません。\n" +"2. バイナリ形式で再配布する場合、配布物に付属するドキュメントおよび/またはそ" +"の他の資料に、上記の著作権表示、この条件一覧、および次の免責事項を転載しなけ" +"ればなりません。\n" +"3. 明確な事前の書面による許可なく、本ソフトウェアから派生した製品を推奨または" +"宣伝するために、著作権者またはその貢献者の名称を使用してはなりません。\n" +"\n" +"本ソフトウェアは著作権者および貢献者によって「現状のまま」(\"AS IS\")提供さ" +"れ、\n" +"商品性および特定の目的への適合性についての黙示の保証を含む(ただしこれらに限" +"定されない)、\n" +"明示または黙示のすべての保証を否認します。\n" +"理事または貢献者は、本ソフトウェアの使用に何らかの形で起因する、直接損害、間" +"接損害、\n" +"付随的損害、特別損害、懲罰的損害、または結果的損害(代替の商品もしくはサービ" +"スの調達、使用機会、\n" +"データもしくは利益の喪失、または事業の中断を含みますが、これらに限定されませ" +"ん)について、\n" +"その原因や、契約、厳格責任、または不法行為(過失その他を含む)のいずれの責任" +"理論に基づくかを問わず、\n" +"たとえ当該損害の可能性を知らされていたとしても、一切責任を負わないものとしま" +"す。" -#: ../../license.rst:1222 msgid "Unicode Character Database" -msgstr "" +msgstr "Unicode 文字データベース" -#: ../../license.rst:1224 msgid "" "An extract of the `Unicode Character Database `__, converted to an internal format, is used by the :mod:`unicodedata` " @@ -1696,8 +2681,12 @@ msgid "" "Unicode data files are distributed under the `Unicode License `__::" msgstr "" +"内部形式に変換された `Unicode 文字データベース `__ の抜粋は、:mod:`unicodedata` モジュールと :class:`str` 型の Unicode サ" +"ポートで使われています。\n" +"元の Unicode データファイルは `Unicode License `__ のもとで配布されています。 ::" -#: ../../license.rst:1229 msgid "" "UNICODE LICENSE V3\n" "\n" @@ -1739,3 +2728,47 @@ msgid "" "dealings in these Data Files or Software without prior written\n" "authorization of the copyright holder." msgstr "" +"UNICODE LICENSE V3\n" +"\n" +"著作権表示および許諾表示\n" +"\n" +"Copyright © 1991-2026 Unicode, Inc.\n" +"\n" +"利用者への通知: 以下の法的契約をよくお読みください。\n" +"データファイルおよび/またはソフトウェアをダウンロード、インストール、複製、" +"その他の方法で使用することにより、\n" +"本契約のすべての条件を明確に受諾し、それらに拘束されることに同意するものとし" +"ます。\n" +"同意しない場合は、データファイルまたはソフトウェアのダウンロード、インストー" +"ル、複製、配布、使用をしないでください。\n" +"\n" +"データファイルとその関連ドキュメント(以下「データファイル」)、またはソフト" +"ウェアとその関連ドキュメント\n" +"(以下「ソフトウェア」)のコピーを取得するすべての人に、データファイルまたは" +"ソフトウェアを制限なく扱うことを、\n" +"ここに無償で許可します。\n" +"これには、データファイルまたはソフトウェアのコピーを使用、複製、変更、結合、" +"公開、配布、および/または販売する権利、\n" +"ならびにデータファイルまたはソフトウェアの提供先に同じ行為を許可する権利が含" +"まれますが、これらに限定されません。\n" +"ただし、(a) データファイルまたはソフトウェアのすべてのコピーに本著作権表示お" +"よび許諾表示を添付するか、\n" +"(b) 関連ドキュメントに本著作権表示および許諾表示を記載することを条件としま" +"す。\n" +"\n" +"データファイルおよびソフトウェアは「現状のまま」(\"AS IS\")提供され、商品" +"性、特定の目的への適合性、\n" +"および第三者の権利の非侵害の保証を含む(ただしこれらに限定されない)、明示ま" +"たは黙示のいかなる保証もありません。\n" +"\n" +"本告知に記載される著作権者は、契約、過失、その他の不法行為のいずれに基づく訴" +"えであるかを問わず、\n" +"データファイルまたはソフトウェアの使用もしくは動作に起因または関連する、いか" +"なる請求、特別間接損害、結果的損害、\n" +"または使用機会、データもしくは利益の喪失によるその他のいかなる損害について" +"も、一切責任を負わないものとします。\n" +"\n" +"本告知に記載されている場合を除き、著作権者による事前の書面の許可なく、データ" +"ファイルまたはソフトウェアの販売、\n" +"使用、その他の取り扱いを促進するために、広告その他で著作権者の名称を使用して" +"はなりません。" diff --git a/reference/expressions.po b/reference/expressions.po index 443ac1938..3d84aac8b 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -4276,9 +4276,8 @@ msgstr "" msgid "assignment expression" msgstr "" -#: ../../reference/expressions.rst:2358 msgid "walrus operator" -msgstr "" +msgstr "walrus operator" #: ../../reference/expressions.rst:2358 msgid "named expression" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 101dd5928..4827ba408 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -1588,9 +1588,8 @@ msgstr "" "きません* さらに、バックスラッシュの直後に改行がきても、行継続を意味する *の" "ではなく*、リテラルの一部であるそれら二つの文字として解釈されます。" -#: ../../reference/lexical_analysis.rst:1044 msgid "f-strings" -msgstr "" +msgstr "f-strings" #: ../../reference/lexical_analysis.rst:1047 msgid "" @@ -1838,9 +1837,8 @@ msgstr "" msgid ":meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:1202 msgid "t-strings" -msgstr "" +msgstr "t-strings" #: ../../reference/lexical_analysis.rst:1206 msgid "" @@ -2514,33 +2512,28 @@ msgstr "" msgid "r\"" msgstr "" -#: ../../reference/lexical_analysis.rst:1026 msgid "formatted string literal" -msgstr "" +msgstr "フォーマット済み文字列リテラル" -#: ../../reference/lexical_analysis.rst:1026 msgid "interpolated string literal" -msgstr "" +msgstr "補間文字列リテラル" #: ../../reference/lexical_analysis.rst:1026 msgid "string" msgstr "string" -#: ../../reference/lexical_analysis.rst:1026 msgid "formatted literal" -msgstr "" +msgstr "フォーマット済みリテラル" -#: ../../reference/lexical_analysis.rst:1026 msgid "interpolated literal" -msgstr "" +msgstr "補間リテラル" #: ../../reference/lexical_analysis.rst:1026 msgid "f-string" msgstr "f-string" -#: ../../reference/lexical_analysis.rst:1026 msgid "fstring" -msgstr "" +msgstr "fstring" #: ../../reference/lexical_analysis.rst:1026 msgid "f'" diff --git a/sphinx.po b/sphinx.po index 7b6f8180d..8942f04e7 100644 --- a/sphinx.po +++ b/sphinx.po @@ -31,44 +31,39 @@ msgstr "安定" msgid "In development" msgstr "開発中" -#: ../../tools/templates/customsourcelink.html:17 msgid "This page" -msgstr "" +msgstr "このページ" -#: ../../tools/templates/customsourcelink.html:19 msgid "Report a bug" -msgstr "" +msgstr "バグを報告する" -#: ../../tools/templates/customsourcelink.html:20 msgid "Improve this page" -msgstr "" +msgstr "このページを改善する" -#: ../../tools/templates/customsourcelink.html:23 msgid "Show source" -msgstr "" +msgstr "ソースを表示する" -#: ../../tools/templates/customsourcelink.html:29 msgid "Show translation source" -msgstr "" +msgstr "翻訳のソースを表示する" #: ../../tools/templates/download.html:2 #: ../../tools/templates/indexsidebar.html:1 msgid "Download" msgstr "ダウンロード" -#: ../../tools/templates/download.html:30 msgid "Download Python %(dl_version)s documentation" -msgstr "" +msgstr "Python %(dl_version)s のドキュメントをダウンロード" #: ../../tools/templates/download.html:32 msgid "Last updated on: %(last_updated)s." msgstr "最終更新日時 %(last_updated)s" -#: ../../tools/templates/download.html:34 msgid "" "Download an archive containing all the documentation for this version of " "Python:" msgstr "" +"このバージョンの Python の全ドキュメントを含むアーカイブをダウンロードできま" +"す:" #: ../../tools/templates/download.html:38 msgid "Format" @@ -86,54 +81,57 @@ msgstr ".tar.bz2 圧縮" msgid "HTML" msgstr "HTML" -#: ../../tools/templates/download.html:44 msgid "" "Download" msgstr "" +"ダウンロード" -#: ../../tools/templates/download.html:45 msgid "" "Download" msgstr "" +"ダウンロード" +"" #: ../../tools/templates/download.html:48 msgid "Plain text" msgstr "Plain text" -#: ../../tools/templates/download.html:49 msgid "" "Download" msgstr "" +"ダウンロード" -#: ../../tools/templates/download.html:50 msgid "" "Download" msgstr "" +"ダウンロード" +"" #: ../../tools/templates/download.html:53 msgid "Texinfo" msgstr "Texinfo" -#: ../../tools/templates/download.html:54 msgid "" "Download" msgstr "" +"ダウンロード" -#: ../../tools/templates/download.html:55 msgid "" "Download" msgstr "" +"ダウンロー" +"ド" #: ../../tools/templates/download.html:58 msgid "EPUB" msgstr "EPUB" -#: ../../tools/templates/download.html:59 msgid "Download" msgstr "" +"ダウンロード" -#: ../../tools/templates/download.html:64 msgid "" "\n" "We no longer provide pre-built PDFs of the documentation.\n" @@ -143,28 +141,36 @@ msgid "" "and run make dist-pdf in the Doc/ directory of a " "copy of the CPython repository.\n" msgstr "" +"\n" +"ドキュメントのビルド済み PDF は提供しなくなりました。\n" +"PDF アーカイブをビルドするには、開発者ガイドの手順に従い、CPython リポジトリのコピーの Doc/ ディレクトリ" +"で make dist-pdf を実行してください。\n" -#: ../../tools/templates/download.html:71 msgid "" "\n" "See the directory " "listing\n" "for file sizes." msgstr "" +"\n" +"ファイルサイズは" +"ディレクトリ一覧を参照してください。" #: ../../tools/templates/download.html:75 msgid "Problems" msgstr "問題" -#: ../../tools/templates/download.html:77 msgid "" "Open an issue\n" "if you have comments or suggestions for the Python documentation." msgstr "" +"Python のドキュメントへのコメントや提案がある場合は、issue を作成してください。" -#: ../../tools/templates/dummy.html:6 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../tools/templates/dummy.html:10 msgid "Part of the" @@ -230,9 +236,8 @@ msgstr "バージョン %s で非推奨、バージョン %s で削除予定" msgid "Deprecated since version %s, removed in version %s" msgstr "バージョン %s で非推奨、バージョン %s で削除" -#: ../../tools/templates/dummy.html:32 msgid ":term:`Soft deprecated` since version %s" -msgstr "" +msgstr "バージョン %s で :term:`ソフト非推奨 `" #: ../../tools/templates/dummy.html:36 msgid "in development" @@ -282,21 +287,18 @@ msgstr "チュートリアル" msgid "Start here: a tour of Python's syntax and features" msgstr "ここから始めましょう: Python構文と機能のツアー" -#: ../../tools/templates/indexcontent.html:59 msgid "Built-ins reference" -msgstr "" +msgstr "組み込み機能リファレンス" -#: ../../tools/templates/indexcontent.html:60 msgid "Built-in functions and classes" -msgstr "" +msgstr "組み込み関数とクラス" #: ../../tools/templates/indexcontent.html:61 msgid "Library reference" msgstr "ライブラリ リファレンス" -#: ../../tools/templates/indexcontent.html:62 msgid "Standard library modules" -msgstr "" +msgstr "標準ライブラリのモジュール" #: ../../tools/templates/indexcontent.html:63 msgid "Language reference" @@ -310,9 +312,8 @@ msgstr "構文と言語要素" msgid "Python setup and usage" msgstr "Pythonのセットアップと使い方" -#: ../../tools/templates/indexcontent.html:66 msgid "How to install, configure, and use Python" -msgstr "Pythonのインストール方法、configure方法、使い方" +msgstr "Python のインストール方法、設定方法、使い方" #: ../../tools/templates/indexcontent.html:69 msgid "Python HOWTOs" @@ -362,49 +363,38 @@ msgstr "非推奨" msgid "Deprecated functionality" msgstr "非推奨となった機能" -#: ../../tools/templates/indexcontent.html:84 msgid "Other resources:" -msgstr "" +msgstr "その他のリソース:" -#: ../../tools/templates/indexcontent.html:87 msgid "Python developer's guide" -msgstr "" +msgstr "Python 開発者ガイド" -#: ../../tools/templates/indexcontent.html:88 msgid "Information on contributing to Python" -msgstr "" +msgstr "Python への貢献に関する情報" -#: ../../tools/templates/indexcontent.html:89 msgid "Python Packaging User Guide" -msgstr "" +msgstr "Python Packaging User Guide" -#: ../../tools/templates/indexcontent.html:90 msgid "Resources relating to Python packaging" -msgstr "" +msgstr "Python のパッケージングに関するリソース" -#: ../../tools/templates/indexcontent.html:91 msgid "Audio/visual talks" -msgstr "" +msgstr "音声・映像による講演" -#: ../../tools/templates/indexcontent.html:92 msgid "Podcasts, talks, and video presentations from the community" -msgstr "" +msgstr "コミュニティによるポッドキャスト、講演、ビデオ発表" -#: ../../tools/templates/indexcontent.html:95 msgid "Python Enhancement Proposals" -msgstr "" +msgstr "Python 拡張提案" -#: ../../tools/templates/indexcontent.html:96 msgid "Index of proposed improvements to Python" -msgstr "" +msgstr "Python への改善提案の索引" -#: ../../tools/templates/indexcontent.html:97 msgid "Static Typing with Python" -msgstr "" +msgstr "Python の静的型付け" -#: ../../tools/templates/indexcontent.html:98 msgid "Information and guides about Python type safety" -msgstr "" +msgstr "Python の型安全性に関する情報とガイド" #: ../../tools/templates/indexcontent.html:102 msgid "Indices, glossary, and search:" @@ -446,9 +436,8 @@ msgstr "このドキュメントから検索する" msgid "Complete table of contents" msgstr "全体の目次" -#: ../../tools/templates/indexcontent.html:116 msgid "All sections and subsections" -msgstr "" +msgstr "すべての節と小節" #: ../../tools/templates/indexcontent.html:120 msgid "Project information:" @@ -499,15 +488,14 @@ msgstr "" msgid "Python documentation for the current stable release" msgstr "現在の安定リリース用の Python ドキュメント" -#: ../../tools/templates/layout.html:14 msgid "" "This is a deploy preview created from a pull request.\n" " For authoritative documentation, see" msgstr "" -"これは pull request により" -"作成されたデプロイプレビューです。\n" -" より信頼できるドキュメントはこちら:" +"これは pull request から作" +"成されたデプロイプレビューです。\n" +"正式なドキュメントはこちら:" #: ../../tools/templates/layout.html:16 msgid "the current stable release" diff --git a/tutorial/classes.po b/tutorial/classes.po index ccf90f9e7..b885d3863 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -147,7 +147,6 @@ msgstr "" msgid "Python Scopes and Namespaces" msgstr "Python のスコープと名前空間" -#: ../../tutorial/classes.rst:63 msgid "" "Before introducing classes, I first have to tell you something about " "Python's scope rules. Class definitions play some neat tricks with " @@ -155,11 +154,12 @@ msgid "" "understand what's going on. Incidentally, knowledge about this subject is " "useful for any advanced Python programmer." msgstr "" -"クラスを紹介する前に、Python のスコープのルールについてあることを話しておかな" -"ければなりません。クラス定義は巧みなトリックを名前空間に施すので、何が起こっ" -"ているのかを完全に理解するには、スコープと名前空間がどのように動作するかを理" -"解する必要があります。ちなみに、この問題に関する知識は全ての Python プログラ" -"マにとって有用です。" +"クラスを紹介する前に、Python のスコープの規則について説明する必要がありま" +"す。\n" +"クラス定義は名前空間を巧みに利用するので、その動作を十分に理解するには、ス" +"コープと名前空間の仕組みを知っておく必要があります。\n" +"なお、この知識は高度なプログラミングを行う Python プログラマーなら誰にとって" +"も役立ちます。" #: ../../tutorial/classes.rst:69 msgid "Let's begin with some definitions." @@ -302,7 +302,6 @@ msgid "" "names" msgstr "一番外側の(最後に検索される)スコープはビルトイン名を持っています。" -#: ../../tutorial/classes.rst:126 msgid "" "If a name is declared global, then all references and assignments go " "directly to the next-to-last scope containing the module's global names. To " @@ -312,12 +311,13 @@ msgid "" "*new* local variable in the innermost scope, leaving the identically named " "outer variable unchanged)." msgstr "" -"名前が global と宣言されている場合、その名前に対する参照や代入は全て、モ" -"ジュールのグローバルな名前の入った最後から2番目のスコープに対して直接行われま" -"す。最内スコープの外側にある変数に再束縛するには、 :keyword:`nonlocal` 文が使" -"えます。nonlocal と宣言されなかった変数は、全て読み出し専用となります (そのよ" -"うな変数に対する書き込みは、単に *新しい* ローカル変数をもっとも内側のスコー" -"プで作成し、外部のスコープの値は変化しません)。" +"名前を global と宣言すると、その名前への参照と代入はすべて、モジュールのグ" +"ローバル名を持つ最後から 2 番目のスコープで直接行われます。\n" +"最も内側のスコープより外側にある変数を再束縛するには、:keyword:`nonlocal` 文" +"を使えます。\n" +"こうした外側の変数は、nonlocal と宣言しない限り読み出し専用です。\n" +"代入しようとすると、最も内側のスコープに同名の *新しい* ローカル変数が作ら" +"れ、外側の変数は変わりません。" #: ../../tutorial/classes.rst:133 msgid "" @@ -467,13 +467,12 @@ msgstr "" "*spam* への束縛を変更し、 :keyword:`global` 代入はモジュールレベルの束縛を変" "更しました。" -#: ../../tutorial/classes.rst:205 msgid "" "You can also see that there was no previous binding for *spam* before the :" "keyword:`global` assignment." msgstr "" -"またここから、 :keyword:`global` 代入の前には *spam* に何も束縛されていなかっ" -"たことも分かります。" +"また、:keyword:`global` による代入の前には、グローバルスコープで *spam* がま" +"だ束縛されていなかったことも分かります。" #: ../../tutorial/classes.rst:212 msgid "A First Look at Classes" @@ -535,17 +534,17 @@ msgstr "" "ラス内の関数定義は通常、メソッドの呼び出し規約で決められた独特の形式の引数リ" "ストを持ちます --- これについても後で述べます。" -#: ../../tutorial/classes.rst:242 msgid "" "When a class definition is entered, a new namespace is created, and used as " "the local scope --- thus, all assignments to local variables go into this " "new namespace. In particular, function definitions bind the name of the new " "function here." msgstr "" -"クラス定義に入ると、新たな名前空間が作成され、ローカルな名前空間として使われ" -"ます --- 従って、ローカルな変数に対する全ての代入はこの新たな名前空間に入りま" -"す。特に、関数定義を行うと、新たな関数の名前はこの名前空間に結び付けられま" -"す。" +"クラス定義に入ると、新しい名前空間が作られ、ローカルスコープとして使われま" +"す。\n" +"したがって、ローカル変数への代入はすべてこの新しい名前空間に対して行われま" +"す。\n" +"特に、関数定義では新しい関数の名前がここに束縛されます。" #: ../../tutorial/classes.rst:247 msgid "" @@ -755,7 +754,6 @@ msgstr "" "もう一つのインスタンス属性の参照は、 *メソッド* です。メソッドとは、オブジェ" "クトに \"属する\" 関数のことです。" -#: ../../tutorial/classes.rst:345 msgid "" "Valid method names of an instance object depend on its class. By " "definition, all attributes of a class that are function objects define " @@ -764,13 +762,16 @@ msgid "" "not, since ``MyClass.i`` is not. But ``x.f`` is not the same thing as " "``MyClass.f`` --- it is a *method object*, not a function object." msgstr "" -"インスタンスオブジェクトで有効なメソッド名は、そのクラスによります。定義によ" -"り、クラスの全ての関数オブジェクトである属性がインスタンスオブジェクトの妥当" -"なメソッド名に決まります。従って、例では、``MyClass.f`` は関数なので、``x." -"f`` はメソッドの参照として有効です。しかし、``MyClass.i`` は関数ではないの" -"で、``x.i`` はメソッドの参照として有効ではありません。``x.f`` は ``MyClass." -"f`` と同じものではありません --- 関数オブジェクトではなく、*メソッドオブジェ" -"クト (method object)* です。" +"インスタンスオブジェクトで有効なメソッド名は、そのクラスによって決まりま" +"す。\n" +"定義上、クラス属性が関数オブジェクトであれば、そのクラスのインスタンスに対応" +"するメソッドが定義されます。\n" +"この例では ``MyClass.f`` が関数なので、``x.f`` は有効なメソッド参照です。\n" +"一方、``MyClass.i`` は関数ではないので、``x.i`` はメソッド参照ではありませ" +"ん。\n" +"ただし、``x.f`` は ``MyClass.f`` と同じものではありません。\n" +"``x.f`` は関数オブジェクトではなく、*メソッドオブジェクト (method object)* で" +"す。" #: ../../tutorial/classes.rst:356 msgid "Method Objects" @@ -1041,7 +1042,6 @@ msgstr "" ">>> print(w2.purpose, w2.region)\n" "storage east" -#: ../../tutorial/classes.rst:488 msgid "" "Data attributes may be referenced by methods as well as by ordinary users " "(\"clients\") of an object. In other words, classes are not usable to " @@ -1051,15 +1051,15 @@ msgid "" "implementation details and control access to an object if necessary; this " "can be used by extensions to Python written in C.)" msgstr "" -"データ属性は、メソッドから参照できると同時に、通常のオブジェクトのユーザ " -"(\"クライアント\") からも参照できます。言い換えると、クラスは純粋な抽象データ" -"型として使うことができません。実際、 Python では、データ隠蔽を補強するための" -"機構はなにもありません --- データの隠蔽はすべて規約に基づいています。 (逆に、" -"C 言語で書かれた Python の実装では実装の詳細を完全に隠蔽し、必要に応じてオブ" -"ジェクトへのアクセスを制御できます。この機構は C 言語で書かれた Python 拡張で" -"使うことができます。)" +"データ属性は、メソッドからも、オブジェクトの通常の利用者 (「クライアント」) " +"からも参照できます。\n" +"つまり、クラスを使って純粋な抽象データ型を実装することはできません。\n" +"実際、Python にはデータの隠蔽を強制する仕組みがなく、すべて規約に基づいていま" +"す。\n" +"(一方、C で書かれた Python の実装では、必要に応じて実装の詳細を完全に隠し、オ" +"ブジェクトへのアクセスを制御できます。\n" +"C で書く Python の拡張ではこの仕組みを使えます。)" -#: ../../tutorial/classes.rst:496 msgid "" "Clients should use data attributes with care --- clients may mess up " "invariants maintained by the methods by stamping on their data attributes. " @@ -1067,11 +1067,12 @@ msgid "" "without affecting the validity of the methods, as long as name conflicts are " "avoided --- again, a naming convention can save a lot of headaches here." msgstr "" -"クライアントはデータ属性を注意深く扱うべきです --- クライアントは、メソッドが" -"維持しているデータ属性の不変式を踏みにじり、台無しにするかもしれません。クラ" -"イアントは、名前の衝突が回避されている限り、メソッドの有効性に影響を及ぼすこ" -"となくインスタンスに独自の属性を追加することができる、ということに注意してく" -"ださい --- ここでも、名前付けの規約は頭痛の種を無くしてくれます。" +"クライアントはデータ属性を注意して使うべきです。\n" +"データ属性を書き換えると、メソッドが維持する不変条件を壊す可能性がありま" +"す。\n" +"ただし、名前の衝突を避ければ、クライアントはメソッドの正常な動作に影響を与え" +"ずに、インスタンスオブジェクトへ独自のデータ属性を追加できます。\n" +"ここでも、名前付けの規約を使うと多くの問題を避けられます。" #: ../../tutorial/classes.rst:502 msgid "" @@ -1085,7 +1086,6 @@ msgstr "" "ます。あるメソッドを眺めているときにローカルな変数とインスタンス変数をはっき" "り区別できるからです。" -#: ../../tutorial/classes.rst:507 msgid "" "Often, the first argument of a method is called ``self``. This is nothing " "more than a convention: the name ``self`` has absolutely no special meaning " @@ -1094,11 +1094,13 @@ msgid "" "that a *class browser* program might be written that relies upon such a " "convention." msgstr "" -"よく、メソッドの最初の引数を ``self`` と呼びます。この名前付けは単なる慣習で" -"しかありません。 ``self`` という名前は、 Python では何ら特殊な意味を持ちませ" -"ん。とはいえ、この慣行に従わないと、コードは他の Python プログラマにとってや" -"や読みにくいものとなります。また、 *クラスブラウザ (class browser)* プログラ" -"ムがこの慣行をあてにして書かれているかもしれません。" +"メソッドの最初の引数は ``self`` と呼ぶことが多いです。\n" +"これは単なる慣習であり、``self`` という名前自体は Python にとって特別な意味を" +"持ちません。\n" +"ただし、この慣習に従わないと、他の Python プログラマーにとってコードが読みに" +"くくなる可能性があります。\n" +"また、この慣習に依存する *クラスブラウザ (class browser)* プログラムが書かれ" +"ることも考えられます。" #: ../../tutorial/classes.rst:513 msgid "" @@ -1182,7 +1184,6 @@ msgstr "" " self.add(x)\n" " self.add(x)" -#: ../../tutorial/classes.rst:549 msgid "" "Methods may reference global names in the same way as ordinary functions. " "The global scope associated with a method is the module containing its " @@ -1194,15 +1195,16 @@ msgid "" "itself defined in this global scope, and in the next section we'll find some " "good reasons why a method would want to reference its own class." msgstr "" -"メソッドは、通常の関数と同じようにしてグローバルな名前を参照します。あるメ" -"ソッドに関するグローバルスコープは、その定義を含むモジュールです。(クラスはグ" -"ローバルなスコープとして用いられることはありません。) メソッドでグローバルな" -"データを使う良い理由はほとんどありませんが、グローバルなスコープを使うべき場" -"面は多々あります。一つ挙げると、メソッド内から、グローバルなスコープに " -"import された関数やモジュールや、そのモジュール中で定義された関数やクラスを使" -"うことができます。通常、メソッドの入っているクラス自体はグローバルなスコープ" -"内で定義されています。次の節では、メソッドが自分のクラスを参照する理由として" -"正当なものを見てみましょう。" +"メソッドは通常の関数と同様にグローバル名を参照できます。\n" +"メソッドのグローバルスコープは、その定義を含むモジュールです (クラスがグロー" +"バルスコープになることはありません)。\n" +"メソッドでグローバルデータを使う適切な理由はまれですが、グローバルスコープに" +"は妥当な用途が数多くあります。\n" +"例えば、グローバルスコープにインポートした関数やモジュール、そのスコープで定" +"義した関数やクラスは、メソッドからも使えます。\n" +"通常、そのメソッドを含むクラス自体もこのグローバルスコープで定義されていま" +"す。\n" +"次の節では、メソッドが自身のクラスを参照したくなる理由を見ていきます。" #: ../../tutorial/classes.rst:559 msgid "" @@ -1872,17 +1874,16 @@ msgstr "" "__iter__` メソッドと :meth:`~generator.__next__` メソッドが自動で作成されるか" "らです。" -#: ../../tutorial/classes.rst:891 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " "and much more clear than an approach using instance variables like ``self." "index`` and ``self.data``." msgstr "" -"ジェネレータのもう一つの重要な機能は、呼び出しごとにローカル変数と実行状態が" -"自動的に保存されるということです。これにより、 ``self.index`` や ``self." -"data`` といったインスタンス変数を使ったアプローチよりも簡単に関数を書くことが" -"できるようになります。" +"もう一つの重要な機能は、呼び出しと呼び出しの間にローカル変数と実行状態が自動" +"的に保存されることです。\n" +"このため、``self.index`` や ``self.data`` のようなインスタンス変数を使う方法" +"よりも、関数を簡単に書け、コードもずっと明確になります。" #: ../../tutorial/classes.rst:896 msgid "" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index cf08d6f32..3758251a1 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -809,14 +809,13 @@ msgstr "" "(名前の後ろの \"(...)\" によって判別される。上記の ``Point`` など)には値は" "代入されません。" -#: ../../tutorial/controlflow.rst:386 msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " "Points, with ``__match_args__`` added, we could match it like this::" msgstr "" -"パターンはいくらでも入れ子 (ネスト) にすることができます。例えば、 " -"``__match_args__`` を追加した Point クラスのリストに対して次のようにマッチを" -"行うことができます::" +"パターンは任意にネストできます。\n" +"例えば、``__match_args__`` を追加した ``Point`` クラスのインスタンスからなる" +"短いリストがある場合、次のようにマッチできます。 ::" #: ../../tutorial/controlflow.rst:389 msgid "" @@ -1054,7 +1053,6 @@ msgstr "" "うにするものがあります。自分が書くコードにドキュメンテーション文字列を入れる" "のはよい習慣です。書く癖をつけてください。" -#: ../../tutorial/controlflow.rst:502 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -1067,16 +1065,17 @@ msgid "" "for variables of enclosing functions, named in a :keyword:`nonlocal` " "statement), although they may be referenced." msgstr "" -"関数を *実行 (execution)* するとき、関数のローカル変数のために使われる新たな" -"シンボルテーブル (symbol table) が用意されます。\n" -"もっと正確にいうと、関数内で変数への代入を行うと、その値はすべてこのローカル" -"なシンボルテーブルに記憶されます。\n" -"一方、変数の参照を行うと、まずローカルなシンボルテーブルが検索され、次にさら" -"に外側の関数のローカルなシンボルテーブルを検索し、その後グローバルなシンボル" -"テーブルを調べ、最後に組み込みの名前テーブルを調べます。\n" -"従って、関数の中では (グローバル変数が :keyword:`global` 文で指定されていた" -"り、外側の関数の変数が :keyword:`nonlocal` 文で指定されていない限り) グローバ" -"ル変数や外側の関数の変数に直接値を代入できませんが、参照することはできます。" +"関数を *実行 (execution)* すると、その関数のローカル変数に使う新しいシンボル" +"テーブル (symbol table) が作られます。\n" +"より正確には、関数内で変数に値を代入すると、その値はローカルなシンボルテーブ" +"ルに格納されます。\n" +"変数を参照するときは、まずローカルなシンボルテーブル、次に外側の関数のローカ" +"ルなシンボルテーブル、その次にグローバルなシンボルテーブル、最後に組み込み名" +"のテーブルを検索します。\n" +"したがって、関数内からグローバル変数や外側の関数の変数を参照することはできま" +"すが、直接値を代入することはできません。\n" +"ただし、グローバル変数を :keyword:`global` 文で指定した場合や、外側の関数の変" +"数を :keyword:`nonlocal` 文で指定した場合は例外です。" #: ../../tutorial/controlflow.rst:513 msgid "" @@ -1095,17 +1094,18 @@ msgstr "" "きには、新たな呼び出しのためにローカルなシンボルテーブルが新たに作成されま" "す。" -#: ../../tutorial/controlflow.rst:520 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " "to by that name as a user-defined function. Other names can also point to " "that same function object and can also be used to access the function::" msgstr "" -"関数の定義を行うと、関数名は関数オブジェクトとともに現在のシンボルテーブル内" -"に取り入れられます。インタープリタはその名前が指すオブジェクトをユーザ定義関" -"数 (user-defined function) として認識します。他の名前も同じ関数オブジェクトを" -"指すことができ、またその関数にアクセスするために使用することができます::" +"関数定義は、現在のシンボルテーブルで関数名と関数オブジェクトを関連付けま" +"す。\n" +"インタープリタは、その名前が指すオブジェクトをユーザー定義関数 (user-defined " +"function) として認識します。\n" +"他の名前も同じ関数オブジェクトを指すことができ、その名前を使って関数にアクセ" +"スできます。 ::" #: ../../tutorial/controlflow.rst:525 msgid "" @@ -1633,17 +1633,16 @@ msgstr "" " | - キーワード専用\n" " -- 位置専用" -#: ../../tutorial/controlflow.rst:769 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" "only, positional-or-keyword, and keyword-only. Keyword parameters are also " "referred to as named parameters." msgstr "" -"ここで、``/`` と ``*`` はオプションです。使用された場合、これらの記号は、引数" -"が関数に渡される方法、すなわち、位置専用、位置またはキーワード、キーワード専" -"用、といった引数の種類を示します。キーワード引数は、名前付き引数とも呼ばれま" -"す。" +"ここで ``/`` と ``*`` は省略できます。\n" +"これらの記号を使うと、実引数を関数に渡せる方法に応じて、仮引数が位置専用、位" +"置またはキーワード、キーワード専用のどれであるかを示せます。\n" +"キーワードパラメータは、名前付きパラメータとも呼ばれます。" #: ../../tutorial/controlflow.rst:776 msgid "Positional-or-Keyword Arguments" @@ -2164,7 +2163,6 @@ msgstr "" "ドキュメンテーション文字列については、その内容と書式に関する慣習をいくつか挙" "げます。" -#: ../../tutorial/controlflow.rst:1031 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -2172,11 +2170,11 @@ msgid "" "to be a verb describing a function's operation). This line should begin " "with a capital letter and end with a period." msgstr "" -"最初の行は、常に対象物の目的を短く簡潔にまとめたものでなくてはなりません。簡" -"潔に書くために、対象物の名前や型を明示する必要はありません。名前や型は他の方" -"法でも得られるからです (名前がたまたま関数の演算内容を記述する動詞である場合" -"は例外です)。最初の行は大文字で始まり、ピリオドで終わっていなければなりませ" -"ん。" +"最初の行には、オブジェクトの目的を短く簡潔にまとめます。\n" +"簡潔にするため、オブジェクトの名前や型は明記しないようにします。\n" +"これらは他の方法で分かるためです (ただし、名前が関数の動作を表す動詞である場" +"合は例外です)。\n" +"この行は大文字で始め、ピリオドで終えます。" #: ../../tutorial/controlflow.rst:1037 msgid "" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index af45f8e00..749afa39e 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -522,11 +522,12 @@ msgstr "" "リスト内包表記中の最初の式は任意の式なので、そこに他のリスト内包表記を書くこ" "ともできます。" -#: ../../tutorial/datastructures.rst:286 msgid "" "Consider the following example of a 3x4 matrix implemented as a list of 3 " "lists of length 4::" -msgstr "次の、長さ4のリスト3つからなる、3x4 の matrix について考えます::" +msgstr "" +"長さ 4 のリスト 3 つからなるリストで実装した、次の 3x4 の行列について考えま" +"す。 ::" #: ../../tutorial/datastructures.rst:289 msgid "" @@ -629,11 +630,9 @@ msgstr "" "この行にあるアスタリスクの詳細については :ref:`tut-unpacking-arguments` を参" "照してください。" -#: ../../tutorial/datastructures.rst:333 msgid "Unpacking in Lists and List Comprehensions" -msgstr "" +msgstr "リストとリスト内包表記でのアンパック" -#: ../../tutorial/datastructures.rst:335 msgid "" "The section on :ref:`tut-unpacking-arguments` describes the use of ``*`` to " "\"unpack\" the elements of an iterable object, providing each one separately " @@ -642,22 +641,32 @@ msgid "" "prefixing an expression by a ``*`` will unpack the result of that " "expression, adding each of its elements to the list we're creating::" msgstr "" +":ref:`tut-unpacking-arguments` の節では、``*`` を使ってイテラブルオブジェクト" +"の要素を「アンパック」し、それぞれを関数の実引数として個別に渡す方法を説明し" +"ています。\n" +"アンパックは、リストの作成など他の場面でも使えます。\n" +"リストの要素を指定するときに式の先頭に ``*`` を付けると、その式の結果がアン" +"パックされ、各要素が作成中のリストに追加されます。 ::" -#: ../../tutorial/datastructures.rst:342 msgid "" ">>> x = [1, 2, 3]\n" ">>> [0, *x, 4, 5, 6]\n" "[0, 1, 2, 3, 4, 5, 6]" msgstr "" +">>> x = [1, 2, 3]\n" +">>> [0, *x, 4, 5, 6]\n" +"[0, 1, 2, 3, 4, 5, 6]" -#: ../../tutorial/datastructures.rst:346 msgid "" "This only works if the expression following the ``*`` evaluates to an " "iterable object; trying to unpack a non-iterable object will raise an " "exception::" msgstr "" +"この方法を使えるのは、``*`` に続く式の評価結果がイテラブルオブジェクトになる" +"場合だけです。\n" +"イテラブルでないオブジェクトをアンパックしようとすると、例外が送出されま" +"す。 ::" -#: ../../tutorial/datastructures.rst:349 msgid "" ">>> x = 1\n" ">>> [0, *x, 2, 3, 4]\n" @@ -666,38 +675,51 @@ msgid "" " [0, *x, 2, 3, 4]\n" "TypeError: Value after * must be an iterable, not int" msgstr "" +">>> x = 1\n" +">>> [0, *x, 2, 3, 4]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" [0, *x, 2, 3, 4]\n" +"TypeError: Value after * must be an iterable, not int" -#: ../../tutorial/datastructures.rst:356 msgid "" "Unpacking can also be used in list comprehensions, as a way to build a new " "list representing the concatenation of an arbitrary number of iterables::" msgstr "" +"リスト内包表記でもアンパックを使えます。\n" +"これにより、任意の数のイテラブルを連結した新しいリストを作成できます。 ::" -#: ../../tutorial/datastructures.rst:359 msgid "" ">>> x = [[1, 2, 3], [4, 5, 6], [], [7], [8, 9]]\n" ">>> [*element for element in x]\n" "[1, 2, 3, 4, 5, 6, 7, 8, 9]" msgstr "" +">>> x = [[1, 2, 3], [4, 5, 6], [], [7], [8, 9]]\n" +">>> [*element for element in x]\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9]" -#: ../../tutorial/datastructures.rst:363 msgid "" "Note that the effect is that each element from ``x`` is unpacked. This " "works for arbitrary iterable objects, not just lists::" msgstr "" +"``x`` の各要素がアンパックされる点に注意してください。\n" +"これはリストだけでなく、任意のイテラブルオブジェクトで使えます。 ::" -#: ../../tutorial/datastructures.rst:366 msgid "" ">>> x = [[1, 2, 3], 'cat', {'spam': 'eggs'}]\n" ">>> [*element for element in x]\n" "[1, 2, 3, 'c', 'a', 't', 'spam']" msgstr "" +">>> x = [[1, 2, 3], 'cat', {'spam': 'eggs'}]\n" +">>> [*element for element in x]\n" +"[1, 2, 3, 'c', 'a', 't', 'spam']" -#: ../../tutorial/datastructures.rst:370 msgid "" "But if the objects in ``x`` are not iterable, this expression would again " "raise an exception." msgstr "" +"ただし、``x`` の中のオブジェクトがイテラブルでなければ、この式でも例外が送出" +"されます。" #: ../../tutorial/datastructures.rst:376 msgid "The :keyword:`!del` statement" @@ -783,7 +805,6 @@ msgstr "" "タプルはコンマで区切られたいくつかの値からなります。例えば以下のように書きま" "す::" -#: ../../tutorial/datastructures.rst:416 msgid "" ">>> t = 12345, 54321, 'hello!'\n" ">>> t[0]\n" @@ -808,6 +829,28 @@ msgid "" ">>> 0, *x, 4\n" "(0, 1, 2, 3, 4)" msgstr "" +">>> t = 12345, 54321, 'hello!'\n" +">>> t[0]\n" +"12345\n" +">>> t\n" +"(12345, 54321, 'hello!')\n" +">>> # タプルはネストできる:\n" +">>> u = t, (1, 2, 3, 4, 5)\n" +">>> u\n" +"((12345, 54321, 'hello!'), (1, 2, 3, 4, 5))\n" +">>> # タプルは不変:\n" +">>> t[0] = 88888\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: 'tuple' object does not support item assignment\n" +">>> # ただし、可変オブジェクトを含めることはできる:\n" +">>> v = ([1, 2, 3], [3, 2, 1])\n" +">>> v\n" +"([1, 2, 3], [3, 2, 1])\n" +">>> # リストと同様にアンパックもサポートする:\n" +">>> x = [1, 2, 3]\n" +">>> 0, *x, 4\n" +"(0, 1, 2, 3, 4)" msgid "" "As you see, on output tuples are always enclosed in parentheses, so that " @@ -824,7 +867,6 @@ msgstr "" "タプルの各要素に代入することはできません。\n" "しかし、タプルにリストのような変更可能なオブジェクトを含めることはできます。" -#: ../../tutorial/datastructures.rst:446 msgid "" "Though tuples may seem similar to lists, they are often used in different " "situations and for different purposes. Tuples are :term:`immutable`, and " @@ -834,12 +876,13 @@ msgid "" "`mutable`, and their elements are usually homogeneous and are accessed by " "iterating over the list." msgstr "" -"タプルはリストと似ていますが、たいてい異なる場面と異なる目的で利用されます。" -"タプルは :term:`不変 ` で、複数の型の要素からなることもあり、要素" -"はアンパック(この節の後半に出てきます)操作やインデックス (あるいは :func:" -"`namedtuples ` の場合は属性)でアクセスすることが多い" -"です。一方、リストは :term:`可変 ` で、要素はたいてい同じ型のオブ" -"ジェクトであり、たいていイテレートによってアクセスします。" +"タプルはリストと似て見えますが、使う場面や目的は異なることが多いです。\n" +"タプルは :term:`不変 ` で、通常は異なる型の要素が並びます。\n" +"要素には、アンパック (この節の後半で説明します) やインデックスを使ってアクセ" +"スします (:func:`namedtuples ` では属性でもアクセスで" +"きます)。\n" +"リストは :term:`可変 ` で、要素は通常同じ型であり、リストを反復処理" +"してアクセスします。" #: ../../tutorial/datastructures.rst:454 msgid "" @@ -933,11 +976,12 @@ msgstr "" "`` ではなく)。後者は空の辞書を作成します。辞書は次のセクションで議論するデー" "タ構造です。" -#: ../../tutorial/datastructures.rst:497 msgid "" "Because sets are unordered, iterating over them or printing them can produce " "the elements in a different order than you expect." msgstr "" +"集合には順序がないため、反復処理したり表示したりすると、要素が予想とは異なる" +"順序で現れることがあります。" #: ../../tutorial/datastructures.rst:500 msgid "Here is a brief demonstration::" @@ -991,13 +1035,13 @@ msgstr "" ">>> a ^ b # aまたはbにあるが、両方にはない文字\n" "{'r', 'd', 'b', 'm', 'z', 'l'}" -#: ../../tutorial/datastructures.rst:525 msgid "" "Similarly to :ref:`list comprehensions `, set comprehensions " "are also supported, including comprehensions with unpacking::" msgstr "" +":ref:`リスト内包表記 ` と同様に、集合内包表記もサポートされて" +"おり、アンパックを使う内包表記も書けます。 ::" -#: ../../tutorial/datastructures.rst:528 msgid "" ">>> a = {x for x in 'abracadabra' if x not in 'abc'}\n" ">>> a\n" @@ -1007,6 +1051,13 @@ msgid "" ">>> {*fruit for fruit in fruits}\n" "{'blueberry', 'banana', 'avocado', 'apple', 'apricot'}" msgstr "" +">>> a = {x for x in 'abracadabra' if x not in 'abc'}\n" +">>> a\n" +"{'r', 'd'}\n" +"\n" +">>> fruits = [{'apple', 'avocado', 'apricot'}, {'banana', 'blueberry'}]\n" +">>> {*fruit for fruit in fruits}\n" +"{'blueberry', 'banana', 'avocado', 'apple', 'apricot'}" #: ../../tutorial/datastructures.rst:540 msgid "Dictionaries" @@ -1172,13 +1223,13 @@ msgstr "" ">>> {x: x**2 for x in (2, 4, 6)}\n" "{2: 4, 4: 16, 6: 36}" -#: ../../tutorial/datastructures.rst:613 msgid "" "And dictionary unpacking (via ``**``) can be used to merge multiple " "dictionaries::" msgstr "" +"また、辞書のアンパック (``**`` を使います) によって、複数の辞書を結合できま" +"す。 ::" -#: ../../tutorial/datastructures.rst:616 msgid "" ">>> odds = {i: i**2 for i in (1, 3, 5)}\n" ">>> evens = {i: i**2 for i in (2, 4, 6)}\n" @@ -1189,6 +1240,14 @@ msgid "" ">>> {**i for i in all_values}\n" "{1: 1, 3: 9, 5: 25, 2: 4, 4: 16, 6: 36, 0: 0}" msgstr "" +">>> odds = {i: i**2 for i in (1, 3, 5)}\n" +">>> evens = {i: i**2 for i in (2, 4, 6)}\n" +">>> {**odds, **evens}\n" +"{1: 1, 3: 9, 5: 25, 2: 4, 4: 16, 6: 36}\n" +"\n" +">>> all_values = [odds, evens, {0: 0}]\n" +">>> {**i for i in all_values}\n" +"{1: 1, 3: 9, 5: 25, 2: 4, 4: 16, 6: 36, 0: 0}" #: ../../tutorial/datastructures.rst:625 msgid "" @@ -1286,13 +1345,12 @@ msgstr "" "What is your quest? It is the holy grail.\n" "What is your favorite color? It is blue." -#: ../../tutorial/datastructures.rst:669 msgid "" "To loop over a sequence in reverse, first specify the sequence in a forward " "direction and then call the :func:`reversed` function. ::" msgstr "" -"シーケンスを逆方向に渡ってループするには、まずシーケンスの範囲を順方向に指定" -"し、次いで関数 :func:`reversed` を呼び出します。 ::" +"シーケンスを逆順にループするには、まずシーケンスを順方向で指定し、それから :" +"func:`reversed` 関数を呼び出します。 ::" #: ../../tutorial/datastructures.rst:672 msgid "" @@ -1556,7 +1614,6 @@ msgstr "" "(1, 2, 3) == (1.0, 2.0, 3.0)\n" "(1, 2, ('aa', 'ab')) < (1, 2, ('abc', 'a'), 4)" -#: ../../tutorial/datastructures.rst:793 msgid "" "Note that comparing objects of different types with ``<`` or ``>`` is legal " "provided that the objects have appropriate comparison methods. For example, " @@ -1564,11 +1621,12 @@ msgid "" "equals 0.0, etc. Otherwise, rather than providing an arbitrary ordering, " "the interpreter will raise a :exc:`TypeError` exception." msgstr "" -"違う型のオブジェクト同士を ``<`` や ``>`` で比較することも、それらのオブジェ" -"クトが適切な比較メソッドを提供しているのであれば許可されます。例えば、異なる" -"数値型同士の比較では、その数値によって比較が行われます。例えば、 0 と 0.0 は" -"等価です。一方、適切な比較順序がない場合は、インタープリターは :exc:" -"`TypeError` 例外を発生させます。" +"異なる型のオブジェクト同士も、適切な比較メソッドがあれば ``<`` や ``>`` で比" +"較できます。\n" +"例えば、異なる数値型は数値としての値に従って比較されるので、0 と 0.0 は等しい" +"とみなされます。\n" +"適切な比較メソッドがない場合、インタープリタは恣意的な順序を付ける代わりに :" +"exc:`TypeError` 例外を送出します。" #: ../../tutorial/datastructures.rst:801 msgid "Footnotes" diff --git a/tutorial/errors.po b/tutorial/errors.po index ac0ebbd79..a90e438d7 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -266,7 +266,6 @@ msgstr "" "どこにもなければ、 *処理されない例外 (unhandled exception)* となり、エラー" "メッセージを出して実行を停止します。" -#: ../../tutorial/errors.rst:120 msgid "" "A :keyword:`try` statement may have more than one *except clause*, to " "specify handlers for different exceptions. At most one handler will be " @@ -274,12 +273,19 @@ msgid "" "*try clause*, not in other handlers of the same :keyword:`!try` statement. " "An *except clause* may name multiple exceptions, for example::" msgstr "" +":keyword:`try` 文には、異なる例外に対するハンドラを指定するために、複数の " +"*except 節* を設けることができます。\n" +"実行されるハンドラは最大で 1 つです。\n" +"ハンドラが処理するのは対応する *try 節* で発生した例外だけであり、同じ :" +"keyword:`!try` 文の他のハンドラで発生した例外は処理しません。\n" +"*except 節* には、例えば次のように複数の例外を指定できます。 ::" -#: ../../tutorial/errors.rst:126 msgid "" "... except RuntimeError, TypeError, NameError:\n" "... pass" msgstr "" +"... except RuntimeError, TypeError, NameError:\n" +"... pass" #: ../../tutorial/errors.rst:129 msgid "" @@ -412,7 +418,6 @@ msgstr "" "例外の :meth:`~object.__str__` 出力は、処理されない例外のメッセージ末尾 ('詳" "細') として表示されます。" -#: ../../tutorial/errors.rst:186 msgid "" ":exc:`BaseException` is the common base class of all exceptions. One of its " "subclasses, :exc:`Exception`, is the base class of all the non-fatal " @@ -422,12 +427,14 @@ msgid "" "exit` and :exc:`KeyboardInterrupt` which is raised when a user wishes to " "interrupt the program." msgstr "" -":exc:`BaseException` はすべての例外に共通する基底クラスです。そのサブクラスの" -"一つである :exc:`Exception` は、致命的でない例外すべての基底クラスです。 :" -"exc:`Exception` のサブクラスではない例外は、一般的にプログラムが終了すること" -"を示すために使われているため処理されません。例えば、:meth:`sys.exit` によって" -"送出される :exc:`SystemExit` や、ユーザーがプログラムを中断させたいときに送出" -"される :exc:`KeyboardInterrupt` があります。" +":exc:`BaseException` は、すべての例外に共通する基底クラスです。\n" +"そのサブクラスの一つである :exc:`Exception` は、致命的でない例外すべての基底" +"クラスです。\n" +":exc:`Exception` のサブクラスではない例外は、プログラムを終了すべきことを示す" +"ために使われるので、通常は処理しません。\n" +"これには、:meth:`sys.exit` によって送出される :exc:`SystemExit` や、ユーザー" +"がプログラムを中断したいときに送出される :exc:`KeyboardInterrupt` が含まれま" +"す。" #: ../../tutorial/errors.rst:194 msgid "" @@ -649,7 +656,6 @@ msgstr "" "その例外には処理中だった例外が関連付けられ、エラーメッセージにも含まれま" "す。 ::" -#: ../../tutorial/errors.rst:299 msgid "" ">>> try:\n" "... open(\"database.sqlite\")\n" @@ -669,26 +675,42 @@ msgid "" " raise RuntimeError(\"unable to handle error\")\n" "RuntimeError: unable to handle error" msgstr "" +">>> try:\n" +"... open(\"database.sqlite\")\n" +"... except OSError:\n" +"... raise RuntimeError(\"unable to handle error\")\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +" open(\"database.sqlite\")\n" +" ~~~~^^^^^^^^^^^^^^^^^^^\n" +"FileNotFoundError: [Errno 2] No such file or directory: 'database.sqlite'\n" +"\n" +"During handling of the above exception, another exception occurred:\n" +"\n" +"Traceback (most recent call last):\n" +" File \"\", line 4, in \n" +" raise RuntimeError(\"unable to handle error\")\n" +"RuntimeError: unable to handle error" -#: ../../tutorial/errors.rst:317 msgid "" "To indicate that an exception is a direct consequence of another, the :" "keyword:`raise` statement allows an optional :keyword:`from` clause::" msgstr "" -"ある例外が他の例外から直接影響されていることを示すために、:keyword:`raise` 文" -"にオプションの :keyword:`from` 句を指定します::" +"ある例外が別の例外の直接の結果であることを示すために、:keyword:`raise` 文には" +"オプションの :keyword:`from` 節を指定できます。 ::" -#: ../../tutorial/errors.rst:320 msgid "" "# exc must be exception instance or None.\n" "raise RuntimeError from exc" msgstr "" +"# exc は例外インスタンスか None でなければならない。\n" +"raise RuntimeError from exc" #: ../../tutorial/errors.rst:323 msgid "This can be useful when you are transforming exceptions. For example::" msgstr "これは例外を変換するときに便利です。例えば::" -#: ../../tutorial/errors.rst:325 msgid "" ">>> def func():\n" "... raise ConnectionError\n" @@ -712,6 +734,27 @@ msgid "" " raise RuntimeError('Failed to open database') from exc\n" "RuntimeError: Failed to open database" msgstr "" +">>> def func():\n" +"... raise ConnectionError\n" +"...\n" +">>> try:\n" +"... func()\n" +"... except ConnectionError as exc:\n" +"... raise RuntimeError('Failed to open database') from exc\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +" func()\n" +" ~~~~^^\n" +" File \"\", line 2, in func\n" +"ConnectionError\n" +"\n" +"The above exception was the direct cause of the following exception:\n" +"\n" +"Traceback (most recent call last):\n" +" File \"\", line 4, in \n" +" raise RuntimeError('Failed to open database') from exc\n" +"RuntimeError: Failed to open database" msgid "" "It also allows disabling automatic exception chaining using the ``from " @@ -719,7 +762,6 @@ msgid "" msgstr "" "また、自動的な例外の連鎖を無効にするには ``from None`` を指定します。 ::" -#: ../../tutorial/errors.rst:350 msgid "" ">>> try:\n" "... open('database.sqlite')\n" @@ -731,6 +773,15 @@ msgid "" " raise RuntimeError from None\n" "RuntimeError" msgstr "" +">>> try:\n" +"... open('database.sqlite')\n" +"... except OSError:\n" +"... raise RuntimeError from None\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 4, in \n" +" raise RuntimeError from None\n" +"RuntimeError" #: ../../tutorial/errors.rst:360 msgid "" @@ -795,7 +846,6 @@ msgstr "" ":keyword:`try` 文にはもう一つオプションの節があります。この節はクリーンアップ" "動作を定義するためのもので、どんな状況でも必ず実行されます。例を示します::" -#: ../../tutorial/errors.rst:392 msgid "" ">>> try:\n" "... raise KeyboardInterrupt\n" @@ -808,6 +858,16 @@ msgid "" " raise KeyboardInterrupt\n" "KeyboardInterrupt" msgstr "" +">>> try:\n" +"... raise KeyboardInterrupt\n" +"... finally:\n" +"... print('Goodbye, world!')\n" +"...\n" +"Goodbye, world!\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +" raise KeyboardInterrupt\n" +"KeyboardInterrupt" #: ../../tutorial/errors.rst:403 msgid "" @@ -843,13 +903,17 @@ msgstr "" "あり得ます。その場合も、 :keyword:`!finally` 節が実行された後に例外が再送出さ" "れます。" -#: ../../tutorial/errors.rst:419 msgid "" "If the :keyword:`!finally` clause executes a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, exceptions are not re-raised. " "This can be confusing and is therefore discouraged. From version 3.14 the " "compiler emits a :exc:`SyntaxWarning` for it (see :pep:`765`)." msgstr "" +":keyword:`!finally` 節が :keyword:`break`、:keyword:`continue`、:keyword:" +"`return` 文を実行すると、例外は再送出されません。\n" +"これは混乱を招く可能性があるため、推奨されません。\n" +"バージョン 3.14 から、コンパイラはこのようなコードに対して :exc:" +"`SyntaxWarning` を出します (:pep:`765` を参照)。" #: ../../tutorial/errors.rst:425 msgid "" @@ -863,7 +927,6 @@ msgstr "" "keyword:`!continue` 文または :keyword:`!return` 文の実行の直前に :keyword:`!" "finally` 節が実行されます。" -#: ../../tutorial/errors.rst:431 msgid "" "If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the " "returned value will be the one from the :keyword:`!finally` clause's :" @@ -872,12 +935,17 @@ msgid "" "therefore discouraged. From version 3.14 the compiler emits a :exc:" "`SyntaxWarning` for it (see :pep:`765`)." msgstr "" +":keyword:`!finally` 節に :keyword:`!return` 文がある場合、:keyword:`!try` 節" +"の :keyword:`!return` 文の値ではなく、:keyword:`!finally` 節の :keyword:`!" +"return` 文の値が返されます。\n" +"これは混乱を招く可能性があるため、推奨されません。\n" +"バージョン 3.14 から、コンパイラはこのようなコードに対して :exc:" +"`SyntaxWarning` を出します (:pep:`765` を参照)。" #: ../../tutorial/errors.rst:439 msgid "For example::" msgstr "例えば::" -#: ../../tutorial/errors.rst:441 msgid "" ">>> def bool_return():\n" "... try:\n" @@ -888,12 +956,19 @@ msgid "" ">>> bool_return()\n" "False" msgstr "" +">>> def bool_return():\n" +"... try:\n" +"... return True\n" +"... finally:\n" +"... return False\n" +"...\n" +">>> bool_return()\n" +"False" #: ../../tutorial/errors.rst:450 msgid "A more complicated example::" msgstr "より複雑な例::" -#: ../../tutorial/errors.rst:452 msgid "" ">>> def divide(x, y):\n" "... try:\n" @@ -922,6 +997,32 @@ msgid "" " ~~^~~\n" "TypeError: unsupported operand type(s) for /: 'str' and 'str'" msgstr "" +">>> def divide(x, y):\n" +"... try:\n" +"... result = x / y\n" +"... except ZeroDivisionError:\n" +"... print(\"division by zero!\")\n" +"... else:\n" +"... print(\"result is\", result)\n" +"... finally:\n" +"... print(\"executing finally clause\")\n" +"...\n" +">>> divide(2, 1)\n" +"result is 2.0\n" +"executing finally clause\n" +">>> divide(2, 0)\n" +"division by zero!\n" +"executing finally clause\n" +">>> divide(\"2\", \"1\")\n" +"executing finally clause\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" divide(\"2\", \"1\")\n" +" ~~~~~~^^^^^^^^^^\n" +" File \"\", line 3, in divide\n" +" result = x / y\n" +" ~~^~~\n" +"TypeError: unsupported operand type(s) for /: 'str' and 'str'" #: ../../tutorial/errors.rst:479 msgid "" @@ -959,11 +1060,12 @@ msgstr "" "る標準的なクリーンアップ処理が定義されているものがあります。以下の、ファイル" "をオープンして内容を画面に表示する例をみてください。 ::" -#: ../../tutorial/errors.rst:499 msgid "" "for line in open(\"myfile.txt\"):\n" " print(line, end=\"\")" msgstr "" +"for line in open(\"myfile.txt\"):\n" +" print(line, end=\"\")" #: ../../tutorial/errors.rst:502 msgid "" @@ -979,12 +1081,14 @@ msgstr "" "ケーションでは問題になりえます。 :keyword:`with` 文はファイルのようなオブジェ" "クトが常に、即座に正しくクリーンアップされることを保証します。 ::" -#: ../../tutorial/errors.rst:508 msgid "" "with open(\"myfile.txt\") as f:\n" " for line in f:\n" " print(line, end=\"\")" msgstr "" +"with open(\"myfile.txt\") as f:\n" +" for line in f:\n" +" print(line, end=\"\")" #: ../../tutorial/errors.rst:512 msgid "" @@ -1001,7 +1105,6 @@ msgstr "" msgid "Raising and Handling Multiple Unrelated Exceptions" msgstr "複数の関連しない例外の送出と処理" -#: ../../tutorial/errors.rst:522 msgid "" "There are situations where it is necessary to report several exceptions that " "have occurred. This is often the case in concurrency frameworks, when " @@ -1009,10 +1112,11 @@ msgid "" "cases where it is desirable to continue execution and collect multiple " "errors rather than raise the first exception." msgstr "" -"いくつか発生した例外の報告が必要な状況があります。並列処理のフレームワークで" -"は、複数のタスクが平行して失敗することがたびたびあります。他にも最初の例外を" -"送出するよりも、処理を継続して複数の例外を集約した方が望ましいユースケースも" -"あります。" +"発生した複数の例外を報告する必要がある状況があります。\n" +"並行処理のフレームワークでは、複数のタスクが並行して失敗した場合によく必要に" +"なります。\n" +"また、最初の例外を送出するよりも、実行を続けて複数のエラーを集める方が望まし" +"い用途もあります。" #: ../../tutorial/errors.rst:528 msgid "" @@ -1024,7 +1128,6 @@ msgstr "" "出できるようにします。ExceptionGroupも例外なので、他の例外と同じように捕捉で" "きます。::" -#: ../../tutorial/errors.rst:532 msgid "" ">>> def f():\n" "... excs = [OSError('error 1'), SystemError('error 2')]\n" @@ -1051,6 +1154,30 @@ msgid "" "caught : there were problems (2 sub-exceptions)\n" ">>>" msgstr "" +">>> def f():\n" +"... excs = [OSError('error 1'), SystemError('error 2')]\n" +"... raise ExceptionGroup('there were problems', excs)\n" +"...\n" +">>> f()\n" +" + Exception Group Traceback (most recent call last):\n" +" | File \"\", line 1, in \n" +" | f()\n" +" | ~^^\n" +" | File \"\", line 3, in f\n" +" | raise ExceptionGroup('there were problems', excs)\n" +" | ExceptionGroup: there were problems (2 sub-exceptions)\n" +" +-+---------------- 1 ----------------\n" +" | OSError: error 1\n" +" +---------------- 2 ----------------\n" +" | SystemError: error 2\n" +" +------------------------------------\n" +">>> try:\n" +"... f()\n" +"... except Exception as e:\n" +"... print(f'caught {type(e)}: {e}')\n" +"...\n" +"caught : there were problems (2 sub-exceptions)\n" +">>>" #: ../../tutorial/errors.rst:557 msgid "" @@ -1065,7 +1192,6 @@ msgstr "" "に対して各 ``except*`` 節で特定の型の例外を取り出し、それ以外の例外は他の節に" "伝えられ、最終的に例外が送出されます。::" -#: ../../tutorial/errors.rst:564 msgid "" ">>> def f():\n" "... raise ExceptionGroup(\n" @@ -1108,6 +1234,46 @@ msgid "" " +------------------------------------\n" ">>>" msgstr "" +">>> def f():\n" +"... raise ExceptionGroup(\n" +"... \"group1\",\n" +"... [\n" +"... OSError(1),\n" +"... SystemError(2),\n" +"... ExceptionGroup(\n" +"... \"group2\",\n" +"... [\n" +"... OSError(3),\n" +"... RecursionError(4)\n" +"... ]\n" +"... )\n" +"... ]\n" +"... )\n" +"...\n" +">>> try:\n" +"... f()\n" +"... except* OSError as e:\n" +"... print(\"There were OSErrors\")\n" +"... except* SystemError as e:\n" +"... print(\"There were SystemErrors\")\n" +"...\n" +"There were OSErrors\n" +"There were SystemErrors\n" +" + Exception Group Traceback (most recent call last):\n" +" | File \"\", line 2, in \n" +" | f()\n" +" | ~^^\n" +" | File \"\", line 2, in f\n" +" | raise ExceptionGroup(\n" +" | ...<12 lines>...\n" +" | )\n" +" | ExceptionGroup: group1 (1 sub-exception)\n" +" +-+---------------- 1 ----------------\n" +" | ExceptionGroup: group2 (1 sub-exception)\n" +" +-+---------------- 1 ----------------\n" +" | RecursionError: 4\n" +" +------------------------------------\n" +">>>" msgid "" "Note that the exceptions nested in an exception group must be instances, not " @@ -1119,7 +1285,6 @@ msgstr "" "実際には、次のパターンのようにプログラムがすでに送出して捕捉した例外をまとめ" "ることが多いためです。 ::" -#: ../../tutorial/errors.rst:610 msgid "" ">>> excs = []\n" "... for test in tests:\n" @@ -1132,6 +1297,16 @@ msgid "" "... raise ExceptionGroup(\"Test Failures\", excs)\n" "..." msgstr "" +">>> excs = []\n" +"... for test in tests:\n" +"... try:\n" +"... test.run()\n" +"... except Exception as e:\n" +"... excs.append(e)\n" +"...\n" +">>> if excs:\n" +"... raise ExceptionGroup(\"Test Failures\", excs)\n" +"..." #: ../../tutorial/errors.rst:625 msgid "Enriching Exceptions with Notes" @@ -1153,7 +1328,6 @@ msgstr "" "字列を受け取り、例外のノートのリストに追加します。標準のトレースバックでは例" "外の後に、全てのノートが追加した順番に出力されます。::" -#: ../../tutorial/errors.rst:634 msgid "" ">>> try:\n" "... raise TypeError('bad type')\n" @@ -1170,6 +1344,20 @@ msgid "" "Add some more information\n" ">>>" msgstr "" +">>> try:\n" +"... raise TypeError('bad type')\n" +"... except Exception as e:\n" +"... e.add_note('Add some information')\n" +"... e.add_note('Add some more information')\n" +"... raise\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +" raise TypeError('bad type')\n" +"TypeError: bad type\n" +"Add some information\n" +"Add some more information\n" +">>>" #: ../../tutorial/errors.rst:649 msgid "" @@ -1181,7 +1369,6 @@ msgstr "" "ト情報を追加したい場合があります。以下のグループ内の各例外が持つノートは、エ" "ラーがいつ発生したかを示しています。::" -#: ../../tutorial/errors.rst:653 msgid "" ">>> def f():\n" "... raise OSError('operation failed')\n" @@ -1229,3 +1416,48 @@ msgid "" " +------------------------------------\n" ">>>" msgstr "" +">>> def f():\n" +"... raise OSError('operation failed')\n" +"...\n" +">>> excs = []\n" +">>> for i in range(3):\n" +"... try:\n" +"... f()\n" +"... except Exception as e:\n" +"... e.add_note(f'Happened in Iteration {i+1}')\n" +"... excs.append(e)\n" +"...\n" +">>> raise ExceptionGroup('We have some problems', excs)\n" +" + Exception Group Traceback (most recent call last):\n" +" | File \"\", line 1, in \n" +" | raise ExceptionGroup('We have some problems', excs)\n" +" | ExceptionGroup: We have some problems (3 sub-exceptions)\n" +" +-+---------------- 1 ----------------\n" +" | Traceback (most recent call last):\n" +" | File \"\", line 3, in \n" +" | f()\n" +" | ~^^\n" +" | File \"\", line 2, in f\n" +" | raise OSError('operation failed')\n" +" | OSError: operation failed\n" +" | Happened in Iteration 1\n" +" +---------------- 2 ----------------\n" +" | Traceback (most recent call last):\n" +" | File \"\", line 3, in \n" +" | f()\n" +" | ~^^\n" +" | File \"\", line 2, in f\n" +" | raise OSError('operation failed')\n" +" | OSError: operation failed\n" +" | Happened in Iteration 2\n" +" +---------------- 3 ----------------\n" +" | Traceback (most recent call last):\n" +" | File \"\", line 3, in \n" +" | f()\n" +" | ~^^\n" +" | File \"\", line 2, in f\n" +" | raise OSError('operation failed')\n" +" | OSError: operation failed\n" +" | Happened in Iteration 3\n" +" +------------------------------------\n" +">>>" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index 6ee8399e7..117703cf0 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -536,15 +536,14 @@ msgstr "" msgid "Representation Error" msgstr "表現誤差" -#: ../../tutorial/floatingpoint.rst:258 msgid "" "This section explains the \"0.1\" example in detail, and shows how you can " "perform an exact analysis of cases like this yourself. Basic familiarity " "with binary floating-point representation is assumed." msgstr "" -"この章では、\"0.1\" の例について詳細に説明し、このようなケースに対してどのよ" -"うにすれば正確な分析を自分で行えるかを示します。ここでは、 2 進法表現の浮動小" -"数点数についての基礎的な知識があるものとして話を進めます。" +"この節では「0.1」の例を詳しく説明し、このような場合に正確な分析を自分で行う方" +"法を示します。\n" +"2 進浮動小数点表現についての基本的な知識があることを前提としています。" #: ../../tutorial/floatingpoint.rst:262 msgid "" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index fdd7fd8b6..6681b4f98 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -25,9 +25,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../tutorial/inputoutput.rst:5 msgid "Input and output" -msgstr "" +msgstr "入力と出力" #: ../../tutorial/inputoutput.rst:7 msgid "" @@ -40,9 +39,8 @@ msgstr "" "ともあります。\n" "この章では、こうした幾つかの出力の方法について話します。" -#: ../../tutorial/inputoutput.rst:15 msgid "Fancier output formatting" -msgstr "" +msgstr "出力を見やすくフォーマットする" #: ../../tutorial/inputoutput.rst:17 msgid "" @@ -91,7 +89,6 @@ msgstr "" ">>> f'{year}年の{event}の結果'\n" "'2016年の国民投票の結果'" -#: ../../tutorial/inputoutput.rst:37 msgid "" "The :meth:`str.format` method of strings requires more manual effort. " "You'll still use ``{`` and ``}`` to mark where a variable will be " @@ -100,9 +97,9 @@ msgid "" "there are two examples of how to format variables:" msgstr "" "文字列の :meth:`str.format` メソッドは、もう少し手間がかかります。\n" -"ここでも ``{`` と ``}`` を使って変数に代入する場所の印を付けて、細かいフォー" -"マットの指示を出せますが、フォーマットされる対象の情報を与える必要がありま" -"す。次のコードには、変数をフォーマットする方法の例が二つあります:" +"ここでも ``{`` と ``}`` で変数の値を埋め込む位置を示し、細かなフォーマットの" +"指示を出せますが、フォーマットする対象の情報も渡す必要があります。\n" +"次のコードには、変数の値をフォーマットする例が 2 つあります:" #: ../../tutorial/inputoutput.rst:46 msgid "" @@ -218,7 +215,6 @@ msgstr "" ">>> repr((x, y, ('spam', 'eggs')))\n" "\"(32.5, 40000, ('spam', 'eggs'))\"" -#: ../../tutorial/inputoutput.rst:98 msgid "" "The :mod:`string` module contains support for a simple templating approach " "based upon regular expressions, via :class:`string.Template`. This offers " @@ -226,6 +222,11 @@ msgid "" "``$x`` and replacing them with values from a dictionary. This syntax is easy " "to use, although it offers much less control for formatting." msgstr "" +":mod:`string` モジュールは :class:`string.Template` を通じて、正規表現に基づ" +"く単純なテンプレート方式をサポートしています。\n" +"これも文字列に値を埋め込む方法の一つで、``$x`` のようなプレースホルダを使い、" +"辞書から取り出した値に置き換えます。\n" +"フォーマットの細かな制御はあまりできませんが、使いやすい構文です。" #: ../../tutorial/inputoutput.rst:115 msgid "Formatted string literals" @@ -331,9 +332,8 @@ msgstr "" "whatsnew>` を参照してください。 フォーマットについての仕様は :ref:" "`formatspec` のリファレンスガイドを参照してください。" -#: ../../tutorial/inputoutput.rst:167 msgid "The string format() method" -msgstr "" +msgstr "文字列の format() メソッド" #: ../../tutorial/inputoutput.rst:169 msgid "Basic usage of the :meth:`str.format` method looks like this::" @@ -445,13 +445,12 @@ msgstr "" "format(**table))\n" "Jack: 4098; Sjoerd: 4127; Dcab: 8637678" -#: ../../tutorial/inputoutput.rst:214 msgid "" "This is particularly useful in combination with the built-in function :func:" "`vars`, which returns a dictionary containing all local variables::" msgstr "" -"全てのローカルな変数が入った辞書を返す組み込み関数 :func:`vars` と組み合わせ" -"ると特に便利です。" +"すべてのローカル変数が入った辞書を返す組み込み関数 :func:`vars` と組み合わせ" +"ると、特に便利です。 ::" #: ../../tutorial/inputoutput.rst:217 msgid "" @@ -511,9 +510,8 @@ msgstr "" ":meth:`str.format` による文字列書式設定の完全な解説は、 :ref:`formatstrings` " "を参照してください。" -#: ../../tutorial/inputoutput.rst:244 msgid "Manual string formatting" -msgstr "" +msgstr "文字列の手作業でのフォーマット" #: ../../tutorial/inputoutput.rst:246 msgid "Here's the same table of squares and cubes, formatted manually::" @@ -561,7 +559,6 @@ msgstr "" "(各カラムの間のスペース一個分は :func:`print` の動作で追加されていることに注" "意してください。 ``print()`` は常に引数間に空白を追加します。)" -#: ../../tutorial/inputoutput.rst:267 msgid "" "The :meth:`str.rjust` method of string objects right-justifies a string in a " "field of a given width by padding it with spaces on the left. There are " @@ -572,15 +569,15 @@ msgid "" "would be lying about a value. (If you really want truncation you can always " "add a slice operation, as in ``x.ljust(n)[:n]``.)" msgstr "" -"文字列オブジェクトの :meth:`str.rjust` メソッドは、指定された幅のフィールド内" -"に文字列が右寄せで入るように左側に空白を追加します。\n" -"同様のメソッドとして、 :meth:`str.ljust` と :meth:`str.center` があります。\n" -"これらのメソッドは何か出力を行うわけではなく、ただ新しい文字列を返します。\n" -"入力文字列が長すぎる場合、文字列を切り詰めることはせず、値をそのまま返しま" -"す。この仕様のためにカラムのレイアウトが滅茶苦茶になるかもしれませんが、嘘の" -"値が代わりに書き出されるよりはましです。\n" -"(本当に切り詰めを行いたいのなら、全てのカラムに ``x.ljust(n)[:n]`` のようにス" -"ライス表記を加えることもできます。)" +"文字列オブジェクトの :meth:`str.rjust` メソッドは、左側に空白を追加して、指定" +"した幅のフィールド内で文字列を右寄せします。\n" +"同様のメソッドとして :meth:`str.ljust` と :meth:`str.center` があります。\n" +"これらのメソッドは何も出力せず、新しい文字列を返すだけです。\n" +"入力文字列が長すぎる場合は、切り詰めずにそのまま返します。\n" +"これでは列の配置が崩れますが、値を切り詰めて誤った値を示すよりは通常ましで" +"す。\n" +"(本当に切り詰めたい場合は、``x.ljust(n)[:n]`` のようにスライス操作を追加でき" +"ます。)" #: ../../tutorial/inputoutput.rst:276 msgid "" @@ -642,15 +639,16 @@ msgstr "より詳しい情報は :ref:`old-string-formatting` にあります。 msgid "Reading and writing files" msgstr "ファイルを読み書きする" -#: ../../tutorial/inputoutput.rst:313 msgid "" ":func:`open` returns a :term:`file object`, and is most commonly used with " "two positional arguments: ``open(filename, mode)``" msgstr "" +":func:`open` は :term:`ファイルオブジェクト ` を返します。\n" +"最もよく使われるのは、``open(filename, mode)`` のように 2 つの位置引数を渡す" +"呼び出し方です。" -#: ../../tutorial/inputoutput.rst:318 msgid ">>> f = open('workfile', 'w')" -msgstr "" +msgstr ">>> f = open('workfile', 'w')" #: ../../tutorial/inputoutput.rst:325 msgid "" @@ -671,7 +669,6 @@ msgstr "" "み書き両用に開きます。 *mode* 引数は省略可能で、省略された場合には ``'r'`` で" "あると仮定します。" -#: ../../tutorial/inputoutput.rst:334 msgid "" "Normally, files are opened in :dfn:`text mode`, that means, you read and " "write strings from and to the file, which are encoded in a specific " @@ -680,6 +677,16 @@ msgid "" "mode`. Binary mode data is read and written as :class:`bytes` objects. You " "can not specify *encoding* when opening file in binary mode." msgstr "" +"通常、ファイルは :dfn:`テキストモード (text mode)` で開きます。\n" +"このモードでは、特定の *encoding* でエンコードされた文字列をファイルから読み" +"取ったり、ファイルに書き込んだりします。\n" +"*encoding* を指定しない場合、デフォルトは UTF-8 です (:func:`open` を参" +"照)。\n" +"モードに ``'b'`` を追加すると、ファイルは :dfn:`バイナリモード (binary " +"mode)` で開きます。\n" +"バイナリモードでは、データを :class:`bytes` オブジェクトとして読み書きしま" +"す。\n" +"バイナリモードでファイルを開く場合は、*encoding* を指定できません。" #: ../../tutorial/inputoutput.rst:341 msgid "" @@ -715,7 +722,6 @@ msgstr "" ":keyword:`!with` を使うと、同じことを :keyword:`try`\\ -\\ :keyword:" "`finally` ブロックを使って書くよりずっと簡潔に書けます::" -#: ../../tutorial/inputoutput.rst:355 msgid "" ">>> with open('workfile') as f:\n" "... read_data = f.read()\n" @@ -724,6 +730,12 @@ msgid "" ">>> f.closed\n" "True" msgstr "" +">>> with open('workfile') as f:\n" +"... read_data = f.read()\n" +"\n" +">>> # ファイルが自動的に閉じられたことを確認できる。\n" +">>> f.closed\n" +"True" #: ../../tutorial/inputoutput.rst:362 msgid "" @@ -768,9 +780,8 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: I/O operation on closed file." -#: ../../tutorial/inputoutput.rst:389 msgid "Methods of file objects" -msgstr "" +msgstr "ファイルオブジェクトのメソッド" #: ../../tutorial/inputoutput.rst:391 msgid "" @@ -892,13 +903,12 @@ msgstr "" ">>> f.write('This is a test\\n')\n" "15" -#: ../../tutorial/inputoutput.rst:440 msgid "" "Other types of objects need to be converted -- either to a string (in text " "mode) or a bytes object (in binary mode) -- before writing them::" msgstr "" -"オブジェクトの他の型は、書き込む前に変換しなければなりません -- 文字列 (テキ" -"ストモード) と bytes オブジェクト (バイナリーモード) のいずれかです::" +"他の型のオブジェクトは、書き込む前に文字列 (テキストモード) または bytes オブ" +"ジェクト (バイナリモード) に変換する必要があります。 ::" #: ../../tutorial/inputoutput.rst:443 msgid "" @@ -912,15 +922,15 @@ msgstr "" ">>> f.write(s)\n" "18" -#: ../../tutorial/inputoutput.rst:448 msgid "" "``f.tell()`` returns an integer giving the file object's current position in " "the file represented as number of bytes from the beginning of the file when " "in binary mode and an opaque number when in text mode." msgstr "" -"``f.tell()`` は、ファイルオブジェクトのファイル中における現在の位置を示す整数" -"を返します。ファイル中の現在の位置は、バイナリモードではファイルの先頭からの" -"バイト数で、テキストモードでは不明瞭な値で表されます。" +"``f.tell()`` は、ファイル内でのファイルオブジェクトの現在位置を示す整数を返し" +"ます。\n" +"バイナリモードではファイルの先頭からのバイト数、テキストモードでは内部構造を" +"解釈できない数値で表されます。" #: ../../tutorial/inputoutput.rst:452 msgid "" @@ -1087,11 +1097,12 @@ msgstr "" msgid "x = json.load(f)" msgstr "x = json.load(f)" -#: ../../tutorial/inputoutput.rst:531 msgid "" "JSON files must be encoded in UTF-8, the default encoding for :term:`text " "files `." msgstr "" +"JSON ファイルは、:term:`テキストファイル ` のデフォルトのエンコー" +"ディングである UTF-8 でエンコードする必要があります。" #: ../../tutorial/inputoutput.rst:534 msgid "" @@ -1109,7 +1120,6 @@ msgstr "" msgid ":mod:`pickle` - the pickle module" msgstr ":mod:`pickle` - pickle モジュール" -#: ../../tutorial/inputoutput.rst:542 msgid "" "Contrary to :ref:`JSON `, *pickle* is a protocol which allows the " "serialization of arbitrarily complex Python objects. As such, it is " @@ -1118,40 +1128,36 @@ msgid "" "pickle data coming from an untrusted source can execute arbitrary code, if " "the data was crafted by a skilled attacker." msgstr "" -":ref:`JSON ` とは対照的に、 *pickle* は任意の複雑な Python オブジェ" -"クトをシリアライズ可能なプロトコルです。しかし、Python に特有のプロトコルで、" -"他の言語で記述されたアプリケーションと通信するのには使えません。さらに、デ" -"フォルトでは安全でなく、信頼できない送信元から送られてきた、スキルのある攻撃" -"者によって生成された pickle データをデシリアライズすると、攻撃者により任意の" -"コードが実行されてしまいます。" +":ref:`JSON ` とは対照的に、*pickle* は、複雑な構造の Python オブ" +"ジェクトもシリアライズできるプロトコルです。\n" +"そのため Python に固有であり、他の言語で書かれたアプリケーションとの通信には" +"使えません。\n" +"また、デフォルトでは安全ではありません。\n" +"信頼できない入手元の pickle データをデシリアライズすると、熟練した攻撃者が細" +"工したデータであれば、任意のコードが実行される可能性があります。" -#: ../../tutorial/inputoutput.rst:104 msgid "formatted string literal" -msgstr "" +msgstr "フォーマット済み文字列リテラル" -#: ../../tutorial/inputoutput.rst:104 msgid "interpolated string literal" -msgstr "" +msgstr "補間文字列リテラル" #: ../../tutorial/inputoutput.rst:104 msgid "string" msgstr "string" -#: ../../tutorial/inputoutput.rst:104 msgid "formatted literal" -msgstr "" +msgstr "フォーマット済みリテラル" -#: ../../tutorial/inputoutput.rst:104 msgid "interpolated literal" -msgstr "" +msgstr "補間リテラル" #: ../../tutorial/inputoutput.rst:104 msgid "f-string" msgstr "f-string" -#: ../../tutorial/inputoutput.rst:104 msgid "fstring" -msgstr "" +msgstr "fstring" #: ../../tutorial/inputoutput.rst:309 msgid "built-in function" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index cf8138cfc..d3b6d0238 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -515,12 +515,11 @@ msgstr "" ">>> text\n" "'複数の文字列を丸括弧で囲むと連結される。'" -#: ../../tutorial/introduction.rst:235 msgid "" "This only works with two literals though, not with variables or expressions::" msgstr "" -"ただし、このように連結できるのは2つのリテラルどうしだけです。変数や式には使え" -"ません::" +"ただし、この方法で連結できるのはリテラルどうしだけです。\n" +"変数や式には使えません。 ::" #: ../../tutorial/introduction.rst:237 msgid "" diff --git a/tutorial/modules.po b/tutorial/modules.po index df8edb63b..b47c14912 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -872,7 +872,6 @@ msgstr "" "Pillow のように複数モジュールからなるパッケージの著者が、互いのモジュール名に" "ついて心配しなくても済むようになります。" -#: ../../tutorial/modules.rst:401 msgid "" "Suppose you want to design a collection of modules (a \"package\") for the " "uniform handling of sound files and sound data. There are many different " @@ -886,15 +885,17 @@ msgid "" "operations. Here's a possible structure for your package (expressed in " "terms of a hierarchical filesystem):" msgstr "" -"音声ファイルや音声データを一様に扱うためのモジュールのコレクション (\"パッ" -"ケージ\") を設計したいと仮定しましょう。 音声ファイルには多くの異なった形式が" -"ある (通常は拡張子、 例えば :file:`.wav`, :file:`.aiff`, :file:`.au` などで認" -"識されます) ので、増え続ける様々なファイル形式を相互変換するモジュールを、 作" -"成したりメンテナンスしたりする必要があるかもしれません。 また、 音声データに" -"対して実行したい様々な独自の操作 (ミキシング、 エコーの追加、 イコライザ関数" -"の適用、 人工的なステレオ効果の作成など) があるかもしれません。 そうなると、 " -"こうした操作を実行するモジュールを果てしなく書くことになるでしょう。 以下に " -"(階層的なファイルシステムで表現した) パッケージの構造案を示します:" +"音声ファイルや音声データを統一的に扱うためのモジュールの集まり (「パッケー" +"ジ」) を設計したいとします。\n" +"音声ファイルには多くの形式があり、通常は :file:`.wav`、:file:`.aiff`、:file:" +"`.au` などの拡張子で見分けます。\n" +"そのため、形式を相互変換するモジュールを作成・保守し、その数を増やしていく必" +"要があるかもしれません。\n" +"また、ミキシング、エコーの追加、イコライザ機能の適用、人工的なステレオ効果の" +"作成など、音声データに行いたい操作もさまざまです。\n" +"こうした操作を実行するためのモジュールも、次々に書くことになるでしょう。\n" +"パッケージの構造は、例えば次のようにできます (階層的なファイルシステムで表し" +"ています):" #: ../../tutorial/modules.rst:412 msgid "" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index e59c3431e..0851be46b 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -23,13 +23,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../tutorial/stdlib.rst:5 msgid "Brief tour of the standard library" -msgstr "" +msgstr "標準ライブラリをひとめぐり" -#: ../../tutorial/stdlib.rst:11 msgid "Operating system interface" -msgstr "" +msgstr "オペレーティングシステムとのインターフェース" #: ../../tutorial/stdlib.rst:13 msgid "" @@ -39,7 +37,6 @@ msgstr "" ":mod:`os` モジュールは、オペレーティングシステムと対話するための多くの関数を" "提供しています::" -#: ../../tutorial/stdlib.rst:16 msgid "" ">>> import os\n" ">>> os.getcwd() # Return the current working directory\n" @@ -48,6 +45,12 @@ msgid "" ">>> os.system('mkdir today') # Run the command mkdir in the system shell\n" "0" msgstr "" +">>> import os\n" +">>> os.getcwd() # 現在の作業ディレクトリを返す\n" +"'C:\\\\Python315'\n" +">>> os.chdir('/server/accesslogs') # 現在の作業ディレクトリを変更する\n" +">>> os.system('mkdir today') # システムシェルで mkdir コマンドを実行する\n" +"0" #: ../../tutorial/stdlib.rst:23 msgid "" @@ -81,13 +84,13 @@ msgstr "" ">>> help(os)\n" "<モジュールの docstring から生成された詳細なマニュアルを返す>" -#: ../../tutorial/stdlib.rst:38 msgid "" "For daily file and directory management tasks, the :mod:`shutil` module " "provides a higher-level interface that is easier to use::" msgstr "" +":mod:`shutil` モジュールは、日常的なファイルやディレクトリの管理作業に使いや" +"すい高水準のインターフェースを提供しています。 ::" -#: ../../tutorial/stdlib.rst:41 msgid "" ">>> import shutil\n" ">>> shutil.copyfile('data.db', 'archive.db')\n" @@ -95,10 +98,14 @@ msgid "" ">>> shutil.move('/build/executables', 'installdir')\n" "'installdir'" msgstr "" +">>> import shutil\n" +">>> shutil.copyfile('data.db', 'archive.db')\n" +"'archive.db'\n" +">>> shutil.move('/build/executables', 'installdir')\n" +"'installdir'" -#: ../../tutorial/stdlib.rst:51 msgid "File wildcards" -msgstr "" +msgstr "ファイルのワイルドカード" #: ../../tutorial/stdlib.rst:53 msgid "" @@ -108,30 +115,37 @@ msgstr "" ":mod:`glob` モジュールでは、ディレクトリのワイルドカード検索からファイルのリ" "ストを生成するための関数を提供しています::" -#: ../../tutorial/stdlib.rst:56 msgid "" ">>> import glob\n" ">>> glob.glob('*.py')\n" "['primes.py', 'random.py', 'quote.py']" msgstr "" +">>> import glob\n" +">>> glob.glob('*.py')\n" +"['primes.py', 'random.py', 'quote.py']" -#: ../../tutorial/stdlib.rst:64 msgid "Command-line arguments" -msgstr "" +msgstr "コマンドライン引数" -#: ../../tutorial/stdlib.rst:66 msgid "" "Common utility scripts often need to process command-line arguments. These " "arguments are stored in the :mod:`sys` module's *argv* attribute as a list. " "For instance, let's take the following :file:`demo.py` file::" msgstr "" +"一般的なユーティリティスクリプトでは、コマンドライン引数を処理する必要がよく" +"あります。\n" +"これらの引数は :mod:`sys` モジュールの *argv* 属性にリストとして格納されま" +"す。\n" +"例として、次の :file:`demo.py` ファイルを見てみましょう。 ::" -#: ../../tutorial/stdlib.rst:70 msgid "" "# File demo.py\n" "import sys\n" "print(sys.argv)" msgstr "" +"# ファイル demo.py\n" +"import sys\n" +"print(sys.argv)" #: ../../tutorial/stdlib.rst:74 msgid "" @@ -141,18 +155,19 @@ msgstr "" "以下は、コマンドライン上で ``python demo.py one two three`` と実行した時の出" "力です::" -#: ../../tutorial/stdlib.rst:77 msgid "['demo.py', 'one', 'two', 'three']" -msgstr "" +msgstr "['demo.py', 'one', 'two', 'three']" -#: ../../tutorial/stdlib.rst:79 msgid "" "The :mod:`argparse` module provides a more sophisticated mechanism to " "process command-line arguments. The following script extracts one or more " "filenames and an optional number of lines to be displayed::" msgstr "" +":mod:`argparse` モジュールは、コマンドライン引数を処理するためのより高度な仕" +"組みを提供しています。\n" +"次のスクリプトでは、1 つ以上のファイル名と、必要に応じて指定する表示行数を取" +"り出します。 ::" -#: ../../tutorial/stdlib.rst:83 msgid "" "import argparse\n" "\n" @@ -164,6 +179,15 @@ msgid "" "args = parser.parse_args()\n" "print(args)" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(\n" +" prog='top',\n" +" description='Show top lines from each file')\n" +"parser.add_argument('filenames', nargs='+')\n" +"parser.add_argument('-l', '--lines', type=int, default=10)\n" +"args = parser.parse_args()\n" +"print(args)" #: ../../tutorial/stdlib.rst:93 msgid "" @@ -175,9 +199,8 @@ msgstr "" "と、上のスクリプトは ``args.lines`` を ``5`` 、 ``args.filenames`` を " "``['alpha.txt', 'beta.txt']`` に設定します。" -#: ../../tutorial/stdlib.rst:101 msgid "Error output redirection and program termination" -msgstr "" +msgstr "エラー出力のリダイレクトとプログラムの終了" #: ../../tutorial/stdlib.rst:103 msgid "" @@ -189,19 +212,19 @@ msgstr "" "す。 *stderr* は、警告やエラーメッセージを出力して、 *stdout* がリダイレクト" "された場合でも読めるようにするために便利です::" -#: ../../tutorial/stdlib.rst:107 msgid "" ">>> sys.stderr.write('Warning, log file not found starting a new one\\n')\n" "Warning, log file not found starting a new one" msgstr "" +">>> sys.stderr.write('Warning, log file not found starting a new one\\n')\n" +"Warning, log file not found starting a new one" #: ../../tutorial/stdlib.rst:110 msgid "The most direct way to terminate a script is to use ``sys.exit()``." msgstr "``sys.exit()`` は、スクリプトを終了させるもっとも直接的な方法です。" -#: ../../tutorial/stdlib.rst:116 msgid "String pattern matching" -msgstr "" +msgstr "文字列のパターンマッチ" #: ../../tutorial/stdlib.rst:118 msgid "" @@ -213,7 +236,6 @@ msgstr "" "す。正規表現は複雑な一致検索や操作に対して簡潔で最適化された解決策を提供しま" "す::" -#: ../../tutorial/stdlib.rst:122 msgid "" ">>> import re\n" ">>> re.findall(r'\\bf[a-z]*', 'which foot or hand fell fastest')\n" @@ -221,6 +243,11 @@ msgid "" ">>> re.sub(r'(\\b[a-z]+) \\1', r'\\1', 'cat in the the hat')\n" "'cat in the hat'" msgstr "" +">>> import re\n" +">>> re.findall(r'\\bf[a-z]*', 'which foot or hand fell fastest')\n" +"['foot', 'fell', 'fastest']\n" +">>> re.sub(r'(\\b[a-z]+) \\1', r'\\1', 'cat in the the hat')\n" +"'cat in the hat'" #: ../../tutorial/stdlib.rst:128 msgid "" @@ -230,11 +257,12 @@ msgstr "" "最小限の機能だけが必要なら、読みやすくデバッグしやすい文字列メソッドの方がお" "勧めです::" -#: ../../tutorial/stdlib.rst:131 msgid "" ">>> 'tea for too'.replace('too', 'two')\n" "'tea for two'" msgstr "" +">>> 'tea for too'.replace('too', 'two')\n" +"'tea for two'" #: ../../tutorial/stdlib.rst:138 msgid "Mathematics" @@ -248,7 +276,6 @@ msgstr "" ":mod:`math` モジュールは、浮動小数点演算のための C 言語ライブラリ関数にアクセ" "スする手段を提供しています::" -#: ../../tutorial/stdlib.rst:143 msgid "" ">>> import math\n" ">>> math.cos(math.pi / 4)\n" @@ -256,6 +283,11 @@ msgid "" ">>> math.log(1024, 2)\n" "10.0" msgstr "" +">>> import math\n" +">>> math.cos(math.pi / 4)\n" +"0.70710678118654757\n" +">>> math.log(1024, 2)\n" +"10.0" #: ../../tutorial/stdlib.rst:149 msgid "The :mod:`random` module provides tools for making random selections::" @@ -293,7 +325,6 @@ msgstr "" ":mod:`statistics` モジュールは数値データの基礎的な統計的特性(平均、中央値、" "分散等)を計算します::" -#: ../../tutorial/stdlib.rst:164 msgid "" ">>> import statistics\n" ">>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]\n" @@ -304,6 +335,14 @@ msgid "" ">>> statistics.variance(data)\n" "1.3720238095238095" msgstr "" +">>> import statistics\n" +">>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]\n" +">>> statistics.mean(data)\n" +"1.6071428571428572\n" +">>> statistics.median(data)\n" +"1.25\n" +">>> statistics.variance(data)\n" +"1.3720238095238095" #: ../../tutorial/stdlib.rst:173 msgid "" @@ -313,9 +352,8 @@ msgstr "" "SciPy プロジェクト は数値処理のための多くのモジュールを提" "供しています。" -#: ../../tutorial/stdlib.rst:179 msgid "Internet access" -msgstr "" +msgstr "インターネットへのアクセス" #: ../../tutorial/stdlib.rst:181 msgid "" @@ -328,7 +366,6 @@ msgstr "" "得するための :mod:`urllib.request` と、メールを送るための :mod:`smtplib` で" "す::" -#: ../../tutorial/stdlib.rst:185 msgid "" ">>> from urllib.request import urlopen\n" ">>> with urlopen('https://docs.python.org/3/') as response:\n" @@ -349,6 +386,24 @@ msgid "" "... \"\"\")\n" ">>> server.quit()" msgstr "" +">>> from urllib.request import urlopen\n" +">>> with urlopen('https://docs.python.org/3/') as response:\n" +"... for line in response:\n" +"... line = line.decode() # bytes を str に変換する\n" +"... if 'updated' in line:\n" +"... print(line.rstrip()) # 末尾の改行を除く\n" +"...\n" +" Last updated on Nov 11, 2025 (20:11 UTC).\n" +"\n" +">>> import smtplib\n" +">>> server = smtplib.SMTP('localhost')\n" +">>> server.sendmail('soothsayer@example.org', 'jcaesar@example.org',\n" +"... \"\"\"To: jcaesar@example.org\n" +"... From: soothsayer@example.org\n" +"...\n" +"... Beware the Ides of March.\n" +"... \"\"\")\n" +">>> server.quit()" #: ../../tutorial/stdlib.rst:204 msgid "(Note that the second example needs a mailserver running on localhost.)" @@ -356,9 +411,8 @@ msgstr "" "(2つ目の例は localhost でメールサーバーが動いている必要があることに注意してく" "ださい。)" -#: ../../tutorial/stdlib.rst:210 msgid "Dates and times" -msgstr "" +msgstr "日付と時刻" msgid "" "The :mod:`datetime` module supplies classes for manipulating dates and times " @@ -373,7 +427,6 @@ msgstr "" "な属性を効率よく取り出すことに重点を置いています。\n" "タイムゾーンを扱えるオブジェクトもサポートしています。 ::" -#: ../../tutorial/stdlib.rst:218 msgid "" ">>> # dates are easily constructed and formatted\n" ">>> import datetime as dt\n" @@ -389,10 +442,22 @@ msgid "" ">>> age.days\n" "14368" msgstr "" +">>> # 日付は簡単に作成してフォーマットできる\n" +">>> import datetime as dt\n" +">>> now = dt.date.today()\n" +">>> now\n" +"datetime.date(2003, 12, 2)\n" +">>> now.strftime(\"%m-%d-%y. %d %b %Y is a %A on the %d day of %B.\")\n" +"'12-02-03. 02 Dec 2003 is a Tuesday on the 02 day of December.'\n" +"\n" +">>> # 日付はカレンダーに基づく計算をサポートする\n" +">>> birthday = dt.date(1964, 7, 31)\n" +">>> age = now - birthday\n" +">>> age.days\n" +"14368" -#: ../../tutorial/stdlib.rst:236 msgid "Data compression" -msgstr "" +msgstr "データ圧縮" #: ../../tutorial/stdlib.rst:238 msgid "" @@ -404,7 +469,6 @@ msgstr "" "サポートされます: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, :mod:" "`zipfile`, :mod:`tarfile`。 ::" -#: ../../tutorial/stdlib.rst:242 msgid "" ">>> import zlib\n" ">>> s = b'witch which has which witches wrist watch'\n" @@ -418,10 +482,20 @@ msgid "" ">>> zlib.crc32(s)\n" "226805979" msgstr "" +">>> import zlib\n" +">>> s = b'witch which has which witches wrist watch'\n" +">>> len(s)\n" +"41\n" +">>> t = zlib.compress(s)\n" +">>> len(t)\n" +"37\n" +">>> zlib.decompress(t)\n" +"b'witch which has which witches wrist watch'\n" +">>> zlib.crc32(s)\n" +"226805979" -#: ../../tutorial/stdlib.rst:258 msgid "Performance measurement" -msgstr "" +msgstr "パフォーマンスの計測" #: ../../tutorial/stdlib.rst:260 msgid "" @@ -443,7 +517,6 @@ msgstr "" "クやアンパックを使ってみたいと思うかもしれません。 :mod:`timeit` モジュールを" "使えば、パフォーマンスがほんの少し良いことがすぐに分かります::" -#: ../../tutorial/stdlib.rst:268 msgid "" ">>> from timeit import Timer\n" ">>> Timer('t=a; a=b; b=t', 'a=1; b=2').timeit()\n" @@ -451,6 +524,11 @@ msgid "" ">>> Timer('a,b = b,a', 'a=1; b=2').timeit()\n" "0.54962537085770791" msgstr "" +">>> from timeit import Timer\n" +">>> Timer('t=a; a=b; b=t', 'a=1; b=2').timeit()\n" +"0.57535828626024577\n" +">>> Timer('a,b = b,a', 'a=1; b=2').timeit()\n" +"0.54962537085770791" #: ../../tutorial/stdlib.rst:274 msgid "" @@ -462,9 +540,8 @@ msgstr "" "`pstats` モジュールではより大きなコードブロックにおいて律速となる部分を判定す" "るためのツールを提供しています。" -#: ../../tutorial/stdlib.rst:282 msgid "Quality control" -msgstr "" +msgstr "品質管理" #: ../../tutorial/stdlib.rst:284 msgid "" @@ -554,19 +631,18 @@ msgstr "" "\n" "unittest.main() # コマンドラインからこれを呼び出すとテストがすべて実行される" -#: ../../tutorial/stdlib.rst:328 msgid "Batteries included" -msgstr "" +msgstr "バッテリー同梱" -#: ../../tutorial/stdlib.rst:330 msgid "" "Python has a \"batteries included\" philosophy. This is best seen through " "the sophisticated and robust capabilities of its larger packages. For " "example:" msgstr "" -"Python には \"バッテリー同梱 (batteries included)\" 哲学があります。この哲学" -"は、洗練され、安定した機能を持つ Python の膨大なパッケージ群に如実に表れてい" -"ます。例えば:" +"Python には「バッテリー同梱 (batteries included)」という哲学があります。\n" +"この哲学が特によく表れているのは、規模の大きなパッケージが備える洗練された堅" +"牢な機能です。\n" +"例えば:" msgid "" "The :mod:`xmlrpc.client` and :mod:`xmlrpc.server` modules make implementing " diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index c1c49ea59..5f0f10bdd 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../tutorial/stdlib2.rst:5 msgid "Brief tour of the standard library --- part II" -msgstr "" +msgstr "標準ライブラリをひとめぐり --- その II" #: ../../tutorial/stdlib2.rst:7 msgid "" @@ -35,9 +34,8 @@ msgstr "" "ジュールをカバーします。ここで挙げるモジュールは、小さなスクリプトの開発では" "ほとんど使いません。" -#: ../../tutorial/stdlib2.rst:14 msgid "Output formatting" -msgstr "" +msgstr "出力のフォーマット" #: ../../tutorial/stdlib2.rst:16 msgid "" @@ -47,26 +45,26 @@ msgstr "" ":mod:`reprlib` モジュールは、大きなコンテナや、深くネストしたコンテナを省略し" "て表示するバージョンの :func:`repr` を提供しています::" -#: ../../tutorial/stdlib2.rst:19 msgid "" ">>> import reprlib\n" ">>> reprlib.repr(set('supercalifragilisticexpialidocious'))\n" "\"{'a', 'c', 'd', 'e', 'f', 'g', ...}\"" msgstr "" +">>> import reprlib\n" +">>> reprlib.repr(set('supercalifragilisticexpialidocious'))\n" +"\"{'a', 'c', 'd', 'e', 'f', 'g', ...}\"" -#: ../../tutorial/stdlib2.rst:23 msgid "" "The :mod:`pprint` module offers more sophisticated control over printing " "both built-in and user defined objects in a way that is readable by the " "interpreter. When the result is longer than one line, the \"pretty printer\" " "adds line breaks and indentation to more clearly reveal data structure::" msgstr "" -":mod:`pprint` モジュールは、組み込み型やユーザ定義型をわかりやすく表示するた" -"めの洗練された制御手段を提供しています。表示結果が複数行にわたる場合は、 " -"\"pretty printer\" と呼ばれるものが改行やインデントを追加して、データ構造がよ" -"り明確になるように印字します::" +":mod:`pprint` モジュールは、組み込みオブジェクトやユーザー定義オブジェクトを" +"わかりやすく表示するための、より細かな制御手段を提供しています。\n" +"表示結果が複数行にわたる場合、「pretty printer」が改行やインデントを追加し、" +"データ構造をより明確に示します。 ::" -#: ../../tutorial/stdlib2.rst:28 msgid "" ">>> import pprint\n" ">>> t = [[[['black', 'cyan'], 'white', ['green', 'red']], [['magenta',\n" @@ -79,6 +77,16 @@ msgid "" " [['magenta', 'yellow'],\n" " 'blue']]]" msgstr "" +">>> import pprint\n" +">>> t = [[[['black', 'cyan'], 'white', ['green', 'red']], [['magenta',\n" +"... 'yellow'], 'blue']]]\n" +"...\n" +">>> pprint.pprint(t, width=30)\n" +"[[[['black', 'cyan'],\n" +" 'white',\n" +" ['green', 'red']],\n" +" [['magenta', 'yellow'],\n" +" 'blue']]]" #: ../../tutorial/stdlib2.rst:39 msgid "" @@ -88,7 +96,6 @@ msgstr "" ":mod:`textwrap` モジュールは、段落で構成された文章を、指定したスクリーン幅に" "ぴったり収まるように調整します::" -#: ../../tutorial/stdlib2.rst:42 msgid "" ">>> import textwrap\n" ">>> doc = \"\"\"The wrap() method is just like fill() except that it " @@ -102,18 +109,28 @@ msgid "" "instead of one big string with newlines\n" "to separate the wrapped lines." msgstr "" +">>> import textwrap\n" +">>> doc = \"\"\"The wrap() method is just like fill() except that it " +"returns\n" +"... a list of strings instead of one big string with newlines to separate\n" +"... the wrapped lines.\"\"\"\n" +"...\n" +">>> print(textwrap.fill(doc, width=40))\n" +"The wrap() method is just like fill()\n" +"except that it returns a list of strings\n" +"instead of one big string with newlines\n" +"to separate the wrapped lines." -#: ../../tutorial/stdlib2.rst:53 msgid "" "The :mod:`locale` module accesses a database of culture specific data " "formats. The grouping attribute of locale's format function provides a " "direct way of formatting numbers with group separators::" msgstr "" -":mod:`locale` モジュールは、文化により異なるデータ表現形式のデータベースにア" -"クセスします。 ``locale`` の ``format_string()`` 関数の grouping 属性を使え" -"ば、数値を適切な桁区切り文字によりグループ化された形式に変換できます::" +":mod:`locale` モジュールは、文化によって異なるデータ形式のデータベースにアク" +"セスします。\n" +"``locale`` の ``format_string()`` 関数で ``grouping`` 引数を使うと、桁区切り" +"文字を入れて数値をフォーマットできます。 ::" -#: ../../tutorial/stdlib2.rst:57 msgid "" ">>> import locale\n" ">>> locale.setlocale(locale.LC_ALL, 'English_United States.1252')\n" @@ -126,22 +143,31 @@ msgid "" "... conv['frac_digits'], x), grouping=True)\n" "'$1,234,567.80'" msgstr "" +">>> import locale\n" +">>> locale.setlocale(locale.LC_ALL, 'English_United States.1252')\n" +"'English_United States.1252'\n" +">>> conv = locale.localeconv() # 表記規則のマッピングを取得する\n" +">>> x = 1234567.8\n" +">>> locale.format_string(\"%d\", x, grouping=True)\n" +"'1,234,567'\n" +">>> locale.format_string(\"%s%.*f\", (conv['currency_symbol'],\n" +"... conv['frac_digits'], x), grouping=True)\n" +"'$1,234,567.80'" #: ../../tutorial/stdlib2.rst:72 msgid "Templating" msgstr "文字列テンプレート" -#: ../../tutorial/stdlib2.rst:74 msgid "" "The :mod:`string` module includes a versatile :class:`~string.Template` " "class with a simplified syntax suitable for editing by end-users. This " "allows users to customize their applications without having to alter the " "application." msgstr "" -":mod:`string` モジュールには、柔軟で、エンドユーザが簡単に編集できる簡単な構" -"文を備えた :class:`~string.Template` クラスが入っています。このクラスを使う" -"と、ユーザがアプリケーションを修正することなしにアプリケーションの出力をカス" -"タマイズできるようになります。" +":mod:`string` モジュールには、エンドユーザーが編集しやすい簡潔な構文を備え" +"た、汎用的な :class:`~string.Template` クラスが含まれています。\n" +"ユーザーはこれを使って、アプリケーション本体を変更せずにアプリケーションをカ" +"スタマイズできます。" #: ../../tutorial/stdlib2.rst:78 msgid "" @@ -156,13 +182,16 @@ msgstr "" "スホルダの後ろにスペースを挟まず、英数文字を続けることができます。``$$`` のよ" "うにすると、``$`` 自体をエスケープできます::" -#: ../../tutorial/stdlib2.rst:83 msgid "" ">>> from string import Template\n" ">>> t = Template('${village}folk send $$10 to $cause.')\n" ">>> t.substitute(village='Nottingham', cause='the ditch fund')\n" "'Nottinghamfolk send $10 to the ditch fund.'" msgstr "" +">>> from string import Template\n" +">>> t = Template('${village}folk send $$10 to $cause.')\n" +">>> t.substitute(village='Nottingham', cause='the ditch fund')\n" +"'Nottinghamfolk send $10 to the ditch fund.'" #: ../../tutorial/stdlib2.rst:88 msgid "" @@ -178,7 +207,6 @@ msgstr "" "ので、欠落したデータがあるとプレースホルダをそのままにして出力する :meth:" "`~string.Template.safe_substitute` メソッドを使う方が適切かもしれません::" -#: ../../tutorial/stdlib2.rst:94 msgid "" ">>> t = Template('Return the $item to $owner.')\n" ">>> d = dict(item='unladen swallow')\n" @@ -189,6 +217,14 @@ msgid "" ">>> t.safe_substitute(d)\n" "'Return the unladen swallow to $owner.'" msgstr "" +">>> t = Template('Return the $item to $owner.')\n" +">>> d = dict(item='unladen swallow')\n" +">>> t.substitute(d)\n" +"Traceback (most recent call last):\n" +" ...\n" +"KeyError: 'owner'\n" +">>> t.safe_substitute(d)\n" +"'Return the unladen swallow to $owner.'" #: ../../tutorial/stdlib2.rst:103 msgid "" @@ -202,7 +238,6 @@ msgstr "" "リティを作っていたとして、現在の日付や画像のシーケンス番号、ファイル形式と" "いったプレースホルダにパーセント記号を使うことにしたら、次のようになります::" -#: ../../tutorial/stdlib2.rst:107 msgid "" ">>> import time, os.path\n" ">>> photofiles = ['img_1074.jpg', 'img_1076.jpg', 'img_1077.jpg']\n" @@ -223,21 +258,37 @@ msgid "" "img_1076.jpg --> Ashley_1.jpg\n" "img_1077.jpg --> Ashley_2.jpg" msgstr "" +">>> import time, os.path\n" +">>> photofiles = ['img_1074.jpg', 'img_1076.jpg', 'img_1077.jpg']\n" +">>> class BatchRename(Template):\n" +"... delimiter = '%'\n" +"...\n" +">>> fmt = input('Enter rename style (%d-date %n-seqnum %f-format): ')\n" +"Enter rename style (%d-date %n-seqnum %f-format): Ashley_%n%f\n" +"\n" +">>> t = BatchRename(fmt)\n" +">>> date = time.strftime('%d%b%y')\n" +">>> for i, filename in enumerate(photofiles):\n" +"... base, ext = os.path.splitext(filename)\n" +"... newname = t.substitute(d=date, n=i, f=ext)\n" +"... print('{0} --> {1}'.format(filename, newname))\n" +"\n" +"img_1074.jpg --> Ashley_0.jpg\n" +"img_1076.jpg --> Ashley_1.jpg\n" +"img_1077.jpg --> Ashley_2.jpg" -#: ../../tutorial/stdlib2.rst:126 msgid "" "Another application for templating is separating program logic from the " "details of multiple output formats. This makes it possible to substitute " "custom templates for XML files, plain text reports, and HTML web reports." msgstr "" -"テンプレートのもう一つの用途は、複数ある出力フォーマットからのプログラムロ" -"ジックの分離です。これにより、XMLファイル用、プレーンテキストのレポート用、" -"HTMLのwebレポート用のテンプレートに、同じプログラムロジックから値を埋め込むこ" -"とができます。" +"テンプレートのもう一つの用途は、複数の出力形式の細かな違いからプログラムのロ" +"ジックを分離することです。\n" +"これにより、XML ファイル、プレーンテキストのレポート、HTML のウェブレポートに" +"合わせたテンプレートを差し替えて使えます。" -#: ../../tutorial/stdlib2.rst:134 msgid "Working with binary data record layouts" -msgstr "" +msgstr "バイナリデータレコードのレイアウトの操作" #: ../../tutorial/stdlib2.rst:136 msgid "" @@ -257,7 +308,6 @@ msgstr "" "ク符号が standard サイズであり、バイトオーダーがリトルエンディアンであること" "を示しています::" -#: ../../tutorial/stdlib2.rst:144 msgid "" "import struct\n" "\n" @@ -278,12 +328,30 @@ msgid "" "\n" " start += extra_size + comp_size # skip to the next header" msgstr "" +"import struct\n" +"\n" +"with open('myfile.zip', 'rb') as f:\n" +" data = f.read()\n" +"\n" +"start = 0\n" +"for i in range(3): # 最初の 3 つのファイルヘッダを表示す" +"る\n" +" start += 14\n" +" fields = struct.unpack('>> import weakref, gc\n" ">>> class A:\n" @@ -477,10 +570,31 @@ msgid "" " o = self.data[key]()\n" "KeyError: 'primary'" msgstr "" +">>> import weakref, gc\n" +">>> class A:\n" +"... def __init__(self, value):\n" +"... self.value = value\n" +"... def __repr__(self):\n" +"... return str(self.value)\n" +"...\n" +">>> a = A(10) # 参照を作成する\n" +">>> d = weakref.WeakValueDictionary()\n" +">>> d['primary'] = a # 参照を作成しない\n" +">>> d['primary'] # オブジェクトがまだ存在すれば取得する\n" +"10\n" +">>> del a # 唯一の参照を削除する\n" +">>> gc.collect() # 直ちにガベージコレクションを実行する\n" +"0\n" +">>> d['primary'] # 項目は自動的に削除された\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" d['primary'] # 項目は自動的に削除された\n" +" File \"C:/python315/lib/weakref.py\", line 46, in __getitem__\n" +" o = self.data[key]()\n" +"KeyError: 'primary'" -#: ../../tutorial/stdlib2.rst:289 msgid "Tools for working with lists" -msgstr "" +msgstr "リストを操作するツール" msgid "" "Many data structure needs can be met with the built-in list type. However, " @@ -504,7 +618,6 @@ msgstr "" "int オブジェクトのリストではなく、2 バイト使う符号無しバイナリ整数 (タイプ" "コード ``\"H\"``) の配列です::" -#: ../../tutorial/stdlib2.rst:301 msgid "" ">>> from array import array\n" ">>> a = array('H', [4000, 10, 700, 22222])\n" @@ -513,6 +626,12 @@ msgid "" ">>> a[1:3]\n" "array('H', [10, 700])" msgstr "" +">>> from array import array\n" +">>> a = array('H', [4000, 10, 700, 22222])\n" +">>> sum(a)\n" +"26932\n" +">>> a[1:3]\n" +"array('H', [10, 700])" #: ../../tutorial/stdlib2.rst:308 msgid "" @@ -526,7 +645,6 @@ msgstr "" "速く、その一方で中間にある値の参照は遅くなります。こうしたオブジェクトは" "キューや木構造の幅優先探索の実装に向いています::" -#: ../../tutorial/stdlib2.rst:313 msgid "" ">>> from collections import deque\n" ">>> d = deque([\"task1\", \"task2\", \"task3\"])\n" @@ -534,8 +652,12 @@ msgid "" ">>> print(\"Handling\", d.popleft())\n" "Handling task1" msgstr "" +">>> from collections import deque\n" +">>> d = deque([\"task1\", \"task2\", \"task3\"])\n" +">>> d.append(\"task4\")\n" +">>> print(\"Handling\", d.popleft())\n" +"Handling task1" -#: ../../tutorial/stdlib2.rst:321 msgid "" "unsearched = deque([starting_node])\n" "def breadth_first_search(unsearched):\n" @@ -545,6 +667,13 @@ msgid "" " return m\n" " unsearched.append(m)" msgstr "" +"unsearched = deque([starting_node])\n" +"def breadth_first_search(unsearched):\n" +" node = unsearched.popleft()\n" +" for m in gen_moves(node):\n" +" if is_goal(m):\n" +" return m\n" +" unsearched.append(m)" #: ../../tutorial/stdlib2.rst:329 msgid "" @@ -555,7 +684,6 @@ msgstr "" "リストの代わりの実装以外にも、標準ライブラリにはソート済みのリストを操作する" "ための関数を備えた :mod:`bisect` のようなツールも提供しています::" -#: ../../tutorial/stdlib2.rst:333 msgid "" ">>> import bisect\n" ">>> scores = [(100, 'perl'), (200, 'tcl'), (400, 'lua'), (500, 'python')]\n" @@ -563,6 +691,11 @@ msgid "" ">>> scores\n" "[(100, 'perl'), (200, 'tcl'), (300, 'ruby'), (400, 'lua'), (500, 'python')]" msgstr "" +">>> import bisect\n" +">>> scores = [(100, 'perl'), (200, 'tcl'), (400, 'lua'), (500, 'python')]\n" +">>> bisect.insort(scores, (300, 'ruby'))\n" +">>> scores\n" +"[(100, 'perl'), (200, 'tcl'), (300, 'ruby'), (400, 'lua'), (500, 'python')]" #: ../../tutorial/stdlib2.rst:339 msgid "" @@ -576,7 +709,6 @@ msgstr "" "す。ヒープは、毎回リストをソートすることなく、最小の値をもつ要素に繰り返しア" "クセスするようなアプリケーションで便利です::" -#: ../../tutorial/stdlib2.rst:344 msgid "" ">>> from heapq import heapify, heappop, heappush\n" ">>> data = [1, 3, 5, 7, 9, 2, 4, 6, 8, 0]\n" @@ -585,10 +717,15 @@ msgid "" ">>> [heappop(data) for i in range(3)] # fetch the three smallest entries\n" "[-5, 0, 1]" msgstr "" +">>> from heapq import heapify, heappop, heappush\n" +">>> data = [1, 3, 5, 7, 9, 2, 4, 6, 8, 0]\n" +">>> heapify(data) # リストをヒープの順序に並べ替える\n" +">>> heappush(data, -5) # 新しい項目を追加する\n" +">>> [heappop(data) for i in range(3)] # 小さい方から 3 つの項目を取り出す\n" +"[-5, 0, 1]" -#: ../../tutorial/stdlib2.rst:355 msgid "Decimal floating-point arithmetic" -msgstr "" +msgstr "10 進浮動小数点演算" #: ../../tutorial/stdlib2.rst:357 msgid "" @@ -624,17 +761,15 @@ msgid "" "by hand." msgstr "ユーザが手計算の結果と同じ演算結果を期待するようなアプリケーション。" -#: ../../tutorial/stdlib2.rst:369 msgid "" "For example, calculating a 5% tax on a 70 cent phone charge gives different " "results in decimal floating point and binary floating point. The difference " "becomes significant if the results are rounded to the nearest cent::" msgstr "" -"例えば、70 セントの電話代にかかる 5% の税金を計算しようとすると、10 進の浮動" -"小数点値と 2 進の浮動小数点値では違う結果になってしまいます。計算結果を四捨五" -"入してセント単位にしようとすると、以下のように違いがはっきり現れます::" +"例えば、70 セントの電話代に 5% の税金を加える計算では、10 進浮動小数点と 2 進" +"浮動小数点で結果が異なります。\n" +"結果を最も近いセント単位に丸めると、その違いがはっきり現れます。 ::" -#: ../../tutorial/stdlib2.rst:373 msgid "" ">>> from decimal import *\n" ">>> round(Decimal('0.70') * Decimal('1.05'), 2)\n" @@ -642,8 +777,12 @@ msgid "" ">>> round(.70 * 1.05, 2)\n" "0.73" msgstr "" +">>> from decimal import *\n" +">>> round(Decimal('0.70') * Decimal('1.05'), 2)\n" +"Decimal('0.74')\n" +">>> round(.70 * 1.05, 2)\n" +"0.73" -#: ../../tutorial/stdlib2.rst:379 msgid "" "The :class:`~decimal.Decimal` result keeps a trailing zero, automatically " "inferring four place significance from multiplicands with two place " @@ -651,10 +790,11 @@ msgid "" "issues that can arise when binary floating point cannot exactly represent " "decimal quantities." msgstr "" -"上の例で、:class:`~decimal.Decimal` を使った計算では、末尾桁のゼロが保存され" -"ており、有効数字2桁の被乗数から自動的に有効数字を 4 桁と判断しています。 " -"``Decimal`` は手計算と 同じ方法で計算を行い、2 進浮動小数が 10 進小数成分を正" -"確に表現できないことに よって起きる問題を回避しています。" +":class:`~decimal.Decimal` の計算結果は末尾のゼロを保持します。\n" +"掛け合わせる数がどちらも小数点以下 2 桁であることから、結果を小数点以下 4 桁" +"まで保持すると自動的に判断します。\n" +"``Decimal`` は手計算と同じ計算を再現し、2 進浮動小数点数では 10 進数の値を正" +"確に表せない場合に起こり得る問題を回避します。" #: ../../tutorial/stdlib2.rst:385 msgid "" @@ -665,7 +805,6 @@ msgstr "" ":class:`~decimal.Decimal` クラスは厳密な値を表現できるため、2 進浮動小数点数" "では 期待通りに計算できないような剰余の計算や等値テストも実現できます::" -#: ../../tutorial/stdlib2.rst:389 msgid "" ">>> Decimal('1.00') % Decimal('.10')\n" "Decimal('0.00')\n" @@ -677,6 +816,15 @@ msgid "" ">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n" "False" msgstr "" +">>> Decimal('1.00') % Decimal('.10')\n" +"Decimal('0.00')\n" +">>> 1.00 % 0.10\n" +"0.09999999999999995\n" +"\n" +">>> sum([Decimal('0.1')]*10) == Decimal('1.0')\n" +"True\n" +">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n" +"False" #: ../../tutorial/stdlib2.rst:399 msgid "" @@ -685,9 +833,11 @@ msgid "" msgstr "" ":mod:`decimal` モジュールを使うと、必要なだけの精度で算術演算を行えます::" -#: ../../tutorial/stdlib2.rst:401 msgid "" ">>> getcontext().prec = 36\n" ">>> Decimal(1) / Decimal(7)\n" "Decimal('0.142857142857142857142857142857142857')" msgstr "" +">>> getcontext().prec = 36\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857142857142857142857142857142857')" diff --git a/tutorial/whatnow.po b/tutorial/whatnow.po index 0518699e0..afc49b423 100644 --- a/tutorial/whatnow.po +++ b/tutorial/whatnow.po @@ -46,13 +46,13 @@ msgstr "" "このチュートリアルは Python のドキュメンテーションセットの一部です。セットの" "中の他のドキュメンテーションをいくつか紹介します:" -#: ../../tutorial/whatnow.rst:14 msgid "" ":ref:`builtins-index`: gives details about Python's built-in types and " "functions." msgstr "" +":ref:`builtins-index`: Python の組み込み型と組み込み関数を詳しく説明していま" +"す。" -#: ../../tutorial/whatnow.rst:17 msgid "" ":ref:`library-index`: gives complete (though terse) reference material about " "types, functions, and the modules in the standard library. The standard " @@ -62,6 +62,13 @@ msgid "" "Skimming through the Library Reference will give you an idea of what's " "available." msgstr "" +":ref:`library-index`: 標準ライブラリの型、関数、モジュールについて、簡潔なが" +"ら網羅的なリファレンスを提供しています。\n" +"Python の標準配布物には、追加のコードが *数多く* 含まれています。\n" +"Unix のメールボックスの読み込み、HTTP 経由でのドキュメントの取得、乱数の生" +"成、コマンドラインオプションの解析、データの圧縮など、さまざまな作業に使える" +"モジュールがあります。\n" +"ライブラリリファレンスをざっと眺めれば、何が利用できるかをつかめるでしょう。" #: ../../tutorial/whatnow.rst:25 msgid "" @@ -172,8 +179,9 @@ msgstr "" msgid "Footnotes" msgstr "脚注" -#: ../../tutorial/whatnow.rst:72 msgid "" "\"Cheese Shop\" is a Monty Python sketch: a customer enters a cheese shop, " "but whatever cheese he asks for, the clerk says it's missing." msgstr "" +"「Cheese Shop」はモンティ・パイソンの寸劇です。\n" +"チーズ店に入った客がどのチーズを注文しても、店員は品切れだと答えます。" diff --git a/using/cmdline.po b/using/cmdline.po index 5b8e014b4..7440c0cae 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -1658,10 +1658,8 @@ msgid "" "_enablelegacywindowsfsencoding`." msgstr "" -#: ../../using/cmdline.rst:1177 ../../using/cmdline.rst:1191 -#: ../../using/cmdline.rst:1242 msgid "Availability" -msgstr "" +msgstr "利用可能な環境" #: ../../using/cmdline.rst:1179 msgid "See :pep:`529` for more details." diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index d15d5cd06..5b80fb661 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -877,12 +877,14 @@ msgstr "" msgid "This produces the following output::" msgstr "これは以下のような出力をします::" -#: ../../whatsnew/2.3.rst:477 msgid "" "WARNING:root:Warning:config file server.conf not found\n" "ERROR:root:Error occurred\n" "CRITICAL:root:Critical error -- shutting down" msgstr "" +"WARNING:root:Warning:config file server.conf not found\n" +"ERROR:root:Error occurred\n" +"CRITICAL:root:Critical error -- shutting down" #: ../../whatsnew/2.3.rst:481 msgid "" From 03e8454d0aaa8e046f3d25cef7e3378d7cb40295 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Oct 2026 13:29:50 +0000 Subject: [PATCH 13/21] Merge 3.15 into 3.14 --- c-api/memory.po | 3 +- distutils/builtdist.po | 6 +- howto/free-threading-python.po | 3 +- library/ast.po | 3 +- library/asyncio.po | 7 +- using/android.po | 69 +- using/cmdline.po | 806 ++++++++++++----- using/configure.po | 1248 +++++++++++++++----------- using/editors.po | 15 +- using/ios.po | 129 ++- using/mac.po | 436 ++++++--- using/unix.po | 60 +- using/windows.po | 1531 +++++++++++++++++++++----------- 13 files changed, 2849 insertions(+), 1467 deletions(-) diff --git a/c-api/memory.po b/c-api/memory.po index 6c3163242..27974c300 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -652,9 +652,8 @@ msgstr "" msgid "Default memory allocators:" msgstr "" -#: ../../c-api/memory.rst:434 msgid "Configuration" -msgstr "Configuration" +msgstr "設定" #: ../../c-api/memory.rst:434 msgid "Name" diff --git a/distutils/builtdist.po b/distutils/builtdist.po index ca6e6b188..fb6b267d1 100644 --- a/distutils/builtdist.po +++ b/distutils/builtdist.po @@ -566,12 +566,8 @@ msgstr "Packager" msgid "``packager``" msgstr "``packager``" -#: ../../distutils/builtdist.rst:223 ../../distutils/builtdist.rst:225 -#: ../../distutils/builtdist.rst:227 ../../distutils/builtdist.rst:229 -#: ../../distutils/builtdist.rst:231 ../../distutils/builtdist.rst:233 -#: ../../distutils/builtdist.rst:235 ../../distutils/builtdist.rst:237 msgid "(none)" -msgstr "(none)" +msgstr "(なし)" #: ../../distutils/builtdist.rst:225 msgid "Provides" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index 25e2b035a..3d61f4f61 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -57,9 +57,8 @@ msgid "" "overall description of free-threaded Python." msgstr "" -#: ../../howto/free-threading-python.rst:29 msgid "Installation" -msgstr "" +msgstr "インストール" #: ../../howto/free-threading-python.rst:31 msgid "" diff --git a/library/ast.po b/library/ast.po index f38566f95..5851e437e 100644 --- a/library/ast.po +++ b/library/ast.po @@ -3351,9 +3351,8 @@ msgid "" "similar details. Attributes include line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2576 msgid "Compiler flags" -msgstr "" +msgstr "コンパイラのフラグ" #: ../../library/ast.rst:2578 msgid "" diff --git a/library/asyncio.po b/library/asyncio.po index 57dbfbf89..074495ae0 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -227,15 +227,18 @@ msgstr "" "引数無しで :ref:`監査イベント ` ``cpython.run_stdin`` を送出しま" "す。" -#: ../../library/asyncio.rst:95 msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." msgstr "" +"(3.11.10、3.10.15、3.9.20、3.8.20 も同様) 監査イベントを送出するようになりま" +"した。" -#: ../../library/asyncio.rst:98 msgid "" "Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also " "executed. Emits audit events." msgstr "" +"可能な場合は PyREPL を使用するようになり、その場合は :envvar:`PYTHONSTARTUP` " +"も実行されます。\n" +"監査イベントを送出するようになりました。" #: ../../library/asyncio.rst:106 msgid "Reference" diff --git a/using/android.po b/using/android.po index f8ea1fd9d..4b0fd82dd 100644 --- a/using/android.po +++ b/using/android.po @@ -52,7 +52,6 @@ msgstr "" "`python` 実行可能ファイルの実行したり、 Python の REPL を使用したりする、コン" "ソールも存在しません。" -#: ../../using/android.rst:17 msgid "" "As a result, the only way you can use Python on Android is in embedded mode " "– that is, by writing a native Android application, embedding a Python " @@ -61,12 +60,13 @@ msgid "" "standard library, and all your Python code is then packaged into your app " "for its own private use." msgstr "" -"このため、 Python を Android 上で使うただ一つの方法は、埋め込みモード、つま" -"り、ネイティブ Android アプリケーションを書き、 ``libpython`` を使用して " -"Python インタープリタを埋め込み、そして :ref:`Python 埋め込み API " -"` を使用して Python コードを呼び出すことです。 それにより、完全な " -"Python インタープリタ、標準ライブラリ、及び Python のコードが、アプリにパッ" -"ケージ化され、独自の私的用途に使用されます。" +"このため、Android で Python を使うには埋め込みモードを使用するしかありませ" +"ん。\n" +"つまり、ネイティブの Android アプリケーションを作成し、``libpython`` を使っ" +"て Python インタープリタを埋め込み、:ref:`Python 埋め込み API ` を" +"使って Python コードを呼び出します。\n" +"Python インタープリタ全体、標準ライブラリ、作成したすべての Python コードは、" +"そのアプリ専用としてアプリにまとめてパッケージ化されます。" #: ../../using/android.rst:23 msgid "" @@ -90,9 +90,8 @@ msgstr "" "ほとんどのアプリ開発者は、次のツールの一つを使用するべきです。これにより、は" "るかに簡単な体験が提供されます:" -#: ../../using/android.rst:33 msgid "`Briefcase `__, from the BeeWare project" -msgstr "" +msgstr "BeeWare プロジェクトの `Briefcase `__" #: ../../using/android.rst:34 msgid "`Buildozer `__, from the Kivy project" @@ -112,81 +111,85 @@ msgstr "" msgid "`Termux `__" msgstr "`Termux `__" -#: ../../using/android.rst:39 msgid "" "If you're sure you want to do all of this manually, read on. You can use " "the :source:`testbed app ` as a guide; each step " "below contains a link to the relevant file." msgstr "" +"これらの作業をすべて手動で行うと決めている場合は、続きを読んでください。\n" +":source:`テストベッドアプリ ` を参考にできます。\n" +"以下の各手順には、対応するファイルへのリンクがあります。" -#: ../../using/android.rst:43 msgid "First, acquire a build of Python for Android:" -msgstr "" +msgstr "まず、Android 用にビルドされた Python を入手します:" -#: ../../using/android.rst:45 msgid "" "The easiest way is to download an Android release from `python.org `__. The ``prefix`` directory mentioned " "below is at the top level of the package." msgstr "" +"最も簡単な方法は、`python.org `__ " +"から Android 向けリリースをダウンロードすることです。\n" +"以下で説明する ``prefix`` ディレクトリは、パッケージの最上位にあります。" -#: ../../using/android.rst:49 msgid "" "Or if you want to build it yourself, follow the instructions in :source:" "`Platforms/Android/README.md`. The ``prefix`` directory will be created " "under :samp:`cross-build/{HOST}`." msgstr "" +"自分でビルドする場合は、:source:`Platforms/Android/README.md` の手順に従って" +"ください。\n" +"``prefix`` ディレクトリは :samp:`cross-build/{HOST}` の下に作成されます。" -#: ../../using/android.rst:53 msgid "" "Add code to your :source:`build.gradle ` file to copy the following items into your project. All except " "your own Python code can be copied from ``prefix/lib``:" msgstr "" +":source:`build.gradle ` ファ" +"イルにコードを追加し、次の項目をプロジェクト内にコピーします。\n" +"自分で作成した Python コード以外は、すべて ``prefix/lib`` からコピーできます:" -#: ../../using/android.rst:57 msgid "In your JNI libraries:" -msgstr "" +msgstr "JNI ライブラリにコピーするもの:" -#: ../../using/android.rst:59 msgid "``libpython*.*.so``" -msgstr "" +msgstr "``libpython*.*.so``" -#: ../../using/android.rst:60 msgid "``lib*_python.so`` (external libraries such as OpenSSL)" -msgstr "" +msgstr "``lib*_python.so`` (OpenSSL などの外部ライブラリ)" -#: ../../using/android.rst:62 msgid "In your assets:" -msgstr "" +msgstr "アセットにコピーするもの:" -#: ../../using/android.rst:64 msgid "``python*.*`` (the Python standard library)" -msgstr "" +msgstr "``python*.*`` (Python 標準ライブラリ)" -#: ../../using/android.rst:65 msgid "``python*.*/site-packages`` (your own Python code)" -msgstr "" +msgstr "``python*.*/site-packages`` (自分で作成した Python コード)" -#: ../../using/android.rst:67 msgid "" "Add code to your app to :source:`extract the assets to the filesystem " "`." msgstr "" +"アプリにコードを追加し、:source:`アセットをファイルシステムに展開 ` しま" +"す。" -#: ../../using/android.rst:70 msgid "" "Add code to your app to :source:`start Python in embedded mode `. This will need to be C " "code called via JNI." msgstr "" +"アプリにコードを追加し、:source:`Python を埋め込みモードで起動 ` します。\n" +"このコードは JNI 経由で呼び出す C コードでなければなりません。" #: ../../using/android.rst:75 msgid "Building a Python package for Android" msgstr "Android 向けの Python パッケージをビルドする" -#: ../../using/android.rst:77 msgid "" "Python packages can be built for Android as wheels and released on PyPI. The " "recommended tool for doing this is `cibuildwheel `__ を使うことを推奨します。\n" +"クロスコンパイル環境の準備から wheel のビルド、エミュレータでのテストまで、細" +"かな作業をすべて自動化します。" diff --git a/using/cmdline.po b/using/cmdline.po index 7440c0cae..ce333c75b 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -34,13 +34,12 @@ msgstr "" "CPython インタプリタはコマンドラインと環境を読み取って様々な設定を行ないま" "す。" -#: ../../using/cmdline.rst:16 msgid "" "Other implementations' command line schemes may differ. See :ref:" "`implementations` for further resources." msgstr "" -"他の実装のコマンドラインスキームは CPython とは異なります。さらなる情報は :" -"ref:`implementations` を参照してください。" +"ほかの実装では、コマンドラインの形式が異なる場合があります。\n" +"関連情報は :ref:`implementations` を参照してください。" #: ../../using/cmdline.rst:23 msgid "Command line" @@ -50,11 +49,12 @@ msgstr "コマンドライン" msgid "When invoking Python, you may specify any of these options::" msgstr "Python を起動するとき、以下のうち任意のオプションを指定できます::" -#: ../../using/cmdline.rst:27 msgid "" "python [-bBdEhiIOPqRsSuvVWx?] [-c command | -m module-name | script | - ] " "[args]" msgstr "" +"python [-bBdEhiIOPqRsSuvVWx?] [-c command | -m module-name | script | - ] " +"[args]" #: ../../using/cmdline.rst:29 msgid "" @@ -62,9 +62,8 @@ msgid "" msgstr "" "もちろん、もっとも一般的な利用方法は、単純にスクリプトを起動することです::" -#: ../../using/cmdline.rst:31 msgid "python myscript.py" -msgstr "" +msgstr "python myscript.py" #: ../../using/cmdline.rst:37 msgid "Interface options" @@ -78,13 +77,17 @@ msgstr "" "インタプリタのインターフェイスは UNIX シェルのものに似ていますが、より多くの" "起動方法を提供しています:" -#: ../../using/cmdline.rst:42 msgid "" "When called with standard input connected to a tty device, it prompts for " "commands and executes them until an EOF (an end-of-file character, you can " "produce that with :kbd:`Ctrl-D` on UNIX or :kbd:`Ctrl-Z, Enter` on Windows) " "is read. For more on interactive mode, see :ref:`tut-interac`." msgstr "" +"標準入力が tty デバイスに接続された状態で起動すると、EOF (ファイル終端文字) " +"を読み込むまで、コマンドの入力を促して実行する処理を繰り返します。\n" +"EOF は UNIX では :kbd:`Ctrl-D`、Windows では :kbd:`Ctrl-Z, Enter` で入力でき" +"ます。\n" +"対話モードについて詳しくは、:ref:`tut-interac` を参照してください。" #: ../../using/cmdline.rst:46 msgid "" @@ -102,44 +105,47 @@ msgstr "" "ディレクトリ名を引数に受け取った場合、そのディレクトリから適切な名前のスクリ" "プトファイルを読み込んで実行します。" -#: ../../using/cmdline.rst:50 msgid "" "When called with ``-c command``, it executes the Python statement(s) given " "as *command*. Here *command* may contain multiple statements separated by " "newlines." msgstr "" +"``-c command`` を指定して起動すると、*command* に指定された Python の文を実行" +"します。\n" +"*command* には、改行で区切って複数の文を指定できます。" -#: ../../using/cmdline.rst:53 msgid "" "When called with ``-m module-name``, the given module is located using the " "standard import mechanism and executed as a script." msgstr "" +"``-m module-name`` を指定して起動すると、標準のインポート機構を使って指定され" +"たモジュールを探し、スクリプトとして実行します。" #: ../../using/cmdline.rst:56 msgid "" "In non-interactive mode, the entire input is parsed before it is executed." msgstr "非インタラクティブモードでは、入力の全体が実行前にパースされます。" -#: ../../using/cmdline.rst:58 msgid "" "An interface option terminates the list of options consumed by the " "interpreter, all consecutive arguments will end up in :data:`sys.argv` -- " "note that the first element, subscript zero (``sys.argv[0]``), is a string " "reflecting the program's source." msgstr "" -"インタプリタによって消費されるオプションリストが終了したあと、継続する全ての" -"引数は :data:`sys.argv` に渡ります。 -- ただし、添字 0 の先頭要素(``sys." -"argv[0]``) はプログラムのソース自体を示す文字列です。" +"インターフェイスオプションは、インタープリタが処理するオプションのリストを終" +"了させます。\n" +"それ以降の引数はすべて :data:`sys.argv` に格納されます。\n" +"ただし、添字がゼロの最初の要素 (``sys.argv[0]``) は、プログラムのソースを表す" +"文字列になります。" -#: ../../using/cmdline.rst:65 msgid "" "Execute the Python code in *command*. *command* can be one or more " "statements separated by newlines, with significant leading whitespace as in " "normal module code." msgstr "" -"*command* 内の Python コードを実行します。 *command* は改行によって区切られた" -"1行以上の文です。通常のモジュールのコードと同じく、行頭の空白文字は意味を持ち" -"ます。" +"*command* 内の Python コードを実行します。\n" +"*command* には、改行で区切って 1 つ以上の文を指定できます。\n" +"通常のモジュールのコードと同様に、行頭の空白文字は意味を持ちます。" #: ../../using/cmdline.rst:69 msgid "" @@ -160,15 +166,15 @@ msgstr "" "引数 ``command`` を指定して :ref:`監査イベント ` ``cpython." "run_command`` を送出します。" -#: ../../using/cmdline.rst:76 msgid "*command* is automatically dedented before execution." -msgstr "" +msgstr "*command* は実行前に自動で共通のインデントが取り除かれます。" -#: ../../using/cmdline.rst:81 msgid "" "Locate the module using the standard import mechanism and execute its " "contents as the :mod:`__main__` module." msgstr "" +"標準のインポート機構を使ってモジュールを探し、その内容を :mod:`__main__` モ" +"ジュールとして実行します。" #: ../../using/cmdline.rst:84 msgid "" @@ -218,12 +224,15 @@ msgstr "" "は ``\"-m\"`` に設定されます)。 :option:`-c` オプションと同様に、カレントディ" "レクトリが :data:`sys.path` の先頭に追加されます。" -#: ../../using/cmdline.rst:108 msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the current directory nor the user's site-" "packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" +":option:`-I` オプションを使うと、:data:`sys.path` にカレントディレクトリも" +"ユーザーの site-packages ディレクトリも含まれない隔離モードで、スクリプトを実" +"行できます。\n" +"すべての ``PYTHON*`` 環境変数も無視されます。" #: ../../using/cmdline.rst:113 msgid "" @@ -233,11 +242,12 @@ msgstr "" "多くの標準ライブラリモジュールにはスクリプトとして実行された時のためのコード" "があります。例えば、 :mod:`timeit` モジュールは次のように実行可能です::" -#: ../../using/cmdline.rst:116 msgid "" "python -m timeit -s \"setup here\" \"benchmarked code here\"\n" "python -m timeit -h # for details" msgstr "" +"python -m timeit -s \"setup here\" \"benchmarked code here\"\n" +"python -m timeit -h # 詳細を表示" msgid "" "Raises an :ref:`auditing event ` ``cpython.run_module`` with " @@ -258,9 +268,10 @@ msgstr "Python コードで直接使える等価な機能" msgid ":pep:`338` -- Executing modules as scripts" msgstr ":pep:`338` - モジュールをスクリプトとして実行する" -#: ../../using/cmdline.rst:127 msgid "Supply the package name to run a ``__main__`` submodule." -msgstr "``__main__`` サブモジュールを実行するパッケージ名が提供されました。" +msgstr "" +"パッケージ名を指定して ``__main__`` サブモジュールを実行できるようになりまし" +"た。" #: ../../using/cmdline.rst:130 msgid "namespace packages are also supported" @@ -320,22 +331,24 @@ msgstr "" "レクトリが :data:`sys.path` の先頭に追加され、そのファイルは :mod:`__main__` " "モジュールとして実行されます。" -#: ../../using/cmdline.rst:162 msgid "" "If the script name refers to a directory or zipfile, the script name is " "added to the start of :data:`sys.path` and the ``__main__.py`` file in that " "location is executed as the :mod:`__main__` module." msgstr "" -"スクリプト名がディレクトリか zip ファイルを指定していた場合、スクリプト名が :" -"data:`sys.path` に追加され、その中の ``__main__.py`` ファイルが :mod:" -"`__main__` モジュールとして実行されます。" +"スクリプト名がディレクトリまたは zip ファイルを指す場合、スクリプト名が :" +"data:`sys.path` の先頭に追加され、その場所にある ``__main__.py`` ファイルが :" +"mod:`__main__` モジュールとして実行されます。" -#: ../../using/cmdline.rst:166 msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the script's directory nor the user's site-" "packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" +":option:`-I` オプションを使うと、:data:`sys.path` にスクリプトのディレクトリ" +"もユーザーの site-packages ディレクトリも含まれない隔離モードで、スクリプトを" +"実行できます。\n" +"すべての ``PYTHON*`` 環境変数も無視されます。" msgid "" "Raises an :ref:`auditing event ` ``cpython.run_file`` with " @@ -373,43 +386,41 @@ msgstr "タブ補完と履歴の編集が自動的に有効化されます。" msgid "Generic options" msgstr "一般オプション" -#: ../../using/cmdline.rst:199 msgid "" "Print a short description of all command line options and corresponding " "environment variables and exit." msgstr "" +"すべてのコマンドラインオプションと、それぞれに対応する環境変数の短い説明を表" +"示して終了します。" -#: ../../using/cmdline.rst:204 msgid "" "Print a short description of Python-specific environment variables and exit." -msgstr "" +msgstr "Python 固有の環境変数の短い説明を表示して終了します。" -#: ../../using/cmdline.rst:211 msgid "" "Print a description of implementation-specific :option:`-X` options and exit." -msgstr "" +msgstr "実装固有の :option:`-X` オプションの説明を表示して終了します。" -#: ../../using/cmdline.rst:218 msgid "Print complete usage information and exit." -msgstr "" +msgstr "使用方法のすべての情報を表示して終了します。" #: ../../using/cmdline.rst:225 msgid "Print the Python version number and exit. Example output could be:" msgstr "Python のバージョン番号を表示して終了します。出力の例:" -#: ../../using/cmdline.rst:227 msgid "Python 3.8.0b2+" -msgstr "" +msgstr "Python 3.8.0b2+" #: ../../using/cmdline.rst:231 msgid "When given twice, print more information about the build, like:" msgstr "2つ指定すると、次のようにより多くのビルドの情報を表示します:" -#: ../../using/cmdline.rst:233 msgid "" "Python 3.8.0b2+ (3.8:0c076caaa8, Apr 20 2019, 21:55:00)\n" "[GCC 6.2.0 20161005]" msgstr "" +"Python 3.8.0b2+ (3.8:0c076caaa8, Apr 20 2019, 21:55:00)\n" +"[GCC 6.2.0 20161005]" #: ../../using/cmdline.rst:238 msgid "The ``-VV`` option." @@ -419,25 +430,32 @@ msgstr "``-VV`` オプション。" msgid "Miscellaneous options" msgstr "その他のオプション" -#: ../../using/cmdline.rst:249 msgid "" "Issue a warning when converting :class:`bytes` or :class:`bytearray` to :" "class:`str` without specifying encoding or comparing :class:`!bytes` or :" "class:`!bytearray` with :class:`!str` or :class:`!bytes` with :class:`int`. " "Issue an error when the option is given twice (:option:`!-bb`)." msgstr "" +"エンコーディングを指定せずに :class:`bytes` または :class:`bytearray` を :" +"class:`str` に変換した場合、:class:`!bytes` または :class:`!bytearray` を :" +"class:`!str` と比較した場合、あるいは :class:`!bytes` を :class:`int` と比較" +"した場合に、警告を出します。\n" +"オプションを 2 回指定した場合 (:option:`!-bb`) は、エラーを発生させます。" -#: ../../using/cmdline.rst:254 msgid "Affects also comparisons of :class:`bytes` with :class:`int`." -msgstr "" +msgstr ":class:`bytes` と :class:`int` の比較にも影響するようになりました。" -#: ../../using/cmdline.rst:259 msgid "" "Deprecate :option:`-b` and :option:`!-bb` command line options and schedule " "them to become no-op in Python 3.17. These were primarily helpers for the " "Python 2 -> 3 transition. Starting with Python 3.17, no :exc:`BytesWarning` " "will be raised for these cases; use a type checker instead." msgstr "" +":option:`-b` と :option:`!-bb` コマンドラインオプションは非推奨となり、" +"Python 3.17 では何も行わなくなる予定です。\n" +"これらは主に Python 2 から 3 への移行を補助するためのものでした。\n" +"Python 3.17 以降、これらの場合に :exc:`BytesWarning` は発生しなくなります。\n" +"代わりに型チェッカーを使ってください。" #: ../../using/cmdline.rst:268 msgid "" @@ -448,7 +466,6 @@ msgstr "" "作成を試みません。 :envvar:`PYTHONDONTWRITEBYTECODE` 環境変数も参照してくださ" "い。" -#: ../../using/cmdline.rst:274 msgid "" "Control the validation behavior of hash-based ``.pyc`` files. See :ref:`pyc-" "invalidation`. When set to ``default``, checked and unchecked hash-based " @@ -458,62 +475,72 @@ msgid "" "to ``never``, hash-based ``.pyc`` files are not validated against their " "corresponding source files." msgstr "" +"ハッシュベースの ``.pyc`` ファイルの検証方法を制御します。\n" +":ref:`pyc-invalidation` を参照してください。\n" +"``default`` に設定した場合、検証付きと検証なしのハッシュベースのバイトコード" +"キャッシュファイルは、それぞれのデフォルトの意味に従って検証されます。\n" +"``always`` に設定した場合、すべてのハッシュベースの ``.pyc`` ファイルが、検証" +"付きか検証なしかにかかわらず、対応するソースファイルと照合されます。\n" +"``never`` に設定した場合、ハッシュベースの ``.pyc`` ファイルは、対応するソー" +"スファイルと照合されません。" -#: ../../using/cmdline.rst:282 msgid "" "The semantics of timestamp-based ``.pyc`` files are unaffected by this " "option." msgstr "" +"タイムスタンプベースの ``.pyc`` ファイルの扱いは、このオプションの影響を受け" +"ません。" -#: ../../using/cmdline.rst:288 msgid "" "Turn on parser debugging output (for expert only). See also the :envvar:" "`PYTHONDEBUG` environment variable." msgstr "" +"パーサのデバッグ出力を有効にします (上級者向け)。\n" +":envvar:`PYTHONDEBUG` 環境変数も参照してください。" -#: ../../using/cmdline.rst:291 msgid "" "This option requires a :ref:`debug build of Python `, otherwise " "it's ignored." msgstr "" +"このオプションには :ref:`Python のデバッグビルド ` が必要で、そ" +"れ以外では無視されます。" -#: ../../using/cmdline.rst:297 msgid "" "Ignore all ``PYTHON*`` environment variables, e.g. :envvar:`PYTHONPATH` and :" "envvar:`PYTHONHOME`, that might be set." msgstr "" +":envvar:`PYTHONPATH` や :envvar:`PYTHONHOME` など、設定されているすべての " +"``PYTHON*`` 環境変数を無視します。" -#: ../../using/cmdline.rst:300 msgid "See also the :option:`-P` and :option:`-I` (isolated) options." msgstr "" +":option:`-P` および :option:`-I` (隔離モード) オプションも参照してください。" -#: ../../using/cmdline.rst:305 msgid "Enter interactive mode after execution." -msgstr "" +msgstr "実行後に対話モードに入ります。" -#: ../../using/cmdline.rst:307 msgid "" "Using the :option:`-i` option will enter interactive mode in any of the " "following circumstances\\:" msgstr "" +":option:`-i` オプションを使うと、次のいずれの場合にも対話モードに入ります\\:" -#: ../../using/cmdline.rst:309 msgid "When a script is passed as first argument" -msgstr "" +msgstr "最初の引数としてスクリプトが渡された場合" -#: ../../using/cmdline.rst:310 msgid "When the :option:`-c` option is used" -msgstr "" +msgstr ":option:`-c` オプションを使用した場合" -#: ../../using/cmdline.rst:311 msgid "When the :option:`-m` option is used" -msgstr "" +msgstr ":option:`-m` オプションを使用した場合" -#: ../../using/cmdline.rst:313 msgid "" "Interactive mode will start even when :data:`sys.stdin` does not appear to " "be a terminal. The :envvar:`PYTHONSTARTUP` file is not read." msgstr "" +":data:`sys.stdin` がターミナルでないと判断された場合でも、対話モードが開始し" +"ます。\n" +":envvar:`PYTHONSTARTUP` ファイルは読み込まれません。" #: ../../using/cmdline.rst:316 msgid "" @@ -532,60 +559,73 @@ msgstr "" "Python を隔離モードで実行します。:option:`-E`、:option:`-P`、および :option:" "`-s` オプションも暗黙的に指定されます。" -#: ../../using/cmdline.rst:325 msgid "" "In isolated mode :data:`sys.path` contains neither the script's directory " "nor the user's site-packages directory. All ``PYTHON*`` environment " "variables are ignored, too. Further restrictions may be imposed to prevent " "the user from injecting malicious code." msgstr "" +"隔離モードでは、:data:`sys.path` にスクリプトのディレクトリもユーザーの site-" +"packages ディレクトリも含まれません。\n" +"すべての ``PYTHON*`` 環境変数も無視されます。\n" +"ユーザーによる悪意のあるコードの注入を防ぐため、さらに制限が課される場合もあ" +"ります。" -#: ../../using/cmdline.rst:335 msgid "" "Remove assert statements and any code conditional on the value of :const:" "`__debug__`. Augment the filename for compiled (:term:`bytecode`) files by " "adding ``.opt-1`` before the ``.pyc`` extension (see :pep:`488`). See also :" "envvar:`PYTHONOPTIMIZE`." msgstr "" +"assert 文と、:const:`__debug__` の値を条件とするコードを取り除きます。\n" +"コンパイル済み (:term:`バイトコード `) ファイルの名前は、``.pyc`` " +"拡張子の前に ``.opt-1`` を追加したものになります (:pep:`488` を参照)。\n" +":envvar:`PYTHONOPTIMIZE` も参照してください。" #: ../../using/cmdline.rst:340 ../../using/cmdline.rst:350 msgid "Modify ``.pyc`` filenames according to :pep:`488`." msgstr ":pep:`488` に従って ``.pyc`` ファイル名を変更します。" -#: ../../using/cmdline.rst:346 msgid "" "Do :option:`-O` and also discard docstrings. Augment the filename for " "compiled (:term:`bytecode`) files by adding ``.opt-2`` before the ``.pyc`` " "extension (see :pep:`488`)." msgstr "" +":option:`-O` の処理に加えて、ドキュメンテーション文字列も取り除きます。\n" +"コンパイル済み (:term:`バイトコード `) ファイルの名前は、``.pyc`` " +"拡張子の前に ``.opt-2`` を追加したものになります (:pep:`488` を参照)。" -#: ../../using/cmdline.rst:356 msgid "Don't prepend a potentially unsafe path to :data:`sys.path`:" -msgstr "" +msgstr "安全でない可能性のあるパスを :data:`sys.path` の先頭に追加しません:" -#: ../../using/cmdline.rst:358 msgid "" "``python -m module`` command line: Don't prepend the current working " "directory." msgstr "" +"コマンドラインが ``python -m module`` の場合、カレント作業ディレクトリを先頭" +"に追加しません。" -#: ../../using/cmdline.rst:360 msgid "" "``python script.py`` command line: Don't prepend the script's directory. If " "it's a symbolic link, resolve symbolic links." msgstr "" +"コマンドラインが ``python script.py`` の場合、スクリプトのディレクトリを先頭" +"に追加しません。\n" +"スクリプトがシンボリックリンクの場合は、シンボリックリンクを解決します。" -#: ../../using/cmdline.rst:362 msgid "" "``python -c code`` and ``python`` (REPL) command lines: Don't prepend an " "empty string, which means the current working directory." msgstr "" +"コマンドラインが ``python -c code`` または ``python`` (REPL) の場合、カレント" +"作業ディレクトリを意味する空文字列を先頭に追加しません。" -#: ../../using/cmdline.rst:365 msgid "" "See also the :envvar:`PYTHONSAFEPATH` environment variable, and :option:`-E` " "and :option:`-I` (isolated) options." msgstr "" +":envvar:`PYTHONSAFEPATH` 環境変数と、:option:`-E` および :option:`-I` (隔離" +"モード) オプションも参照してください。" #: ../../using/cmdline.rst:373 msgid "" @@ -593,14 +633,16 @@ msgid "" msgstr "" "インタラクティブモードでも copyright とバージョンのメッセージを表示しません。" -#: ../../using/cmdline.rst:380 msgid "" "Turn on hash randomization. This option only has an effect if the :envvar:" "`PYTHONHASHSEED` environment variable is set to anything other than " "``random``, since hash randomization is enabled by default." msgstr "" +"ハッシュのランダム化を有効にします。\n" +"ハッシュのランダム化はデフォルトで有効なため、このオプションは :envvar:" +"`PYTHONHASHSEED` 環境変数が ``random`` 以外の値に設定されている場合にのみ効果" +"があります。" -#: ../../using/cmdline.rst:384 msgid "" "On previous versions of Python, this option turns on hash randomization, so " "that the :meth:`~object.__hash__` values of str and bytes objects are " @@ -608,22 +650,29 @@ msgid "" "constant within an individual Python process, they are not predictable " "between repeated invocations of Python." msgstr "" +"以前のバージョンの Python では、このオプションはハッシュのランダム化を有効に" +"し、str オブジェクトと bytes オブジェクトの :meth:`~object.__hash__` の値に、" +"予測不能なランダムな値による「ソルト」を加えます。\n" +"ハッシュ値は、個々の Python プロセス内では一定ですが、Python を起動し直した場" +"合の値を予測することはできません。" -#: ../../using/cmdline.rst:390 msgid "" "Hash randomization is intended to provide protection against a denial-of-" "service caused by carefully chosen inputs that exploit the worst case " "performance of a dict construction, *O*\\ (*n*\\ :sup:`2`) complexity. See " "https://ocert.org/advisories/ocert-2011-003.html for details." msgstr "" +"ハッシュのランダム化は、辞書の構築時の最悪の計算量 *O*\\ (*n*\\ :sup:`2`) を" +"悪用するように選ばれた入力によって、サービス拒否が発生するのを防ぐためのもの" +"です。\n" +"詳細は https://ocert.org/advisories/ocert-2011-003.html を参照してください。" -#: ../../using/cmdline.rst:395 msgid "" ":envvar:`PYTHONHASHSEED` allows you to set a fixed value for the hash seed " "secret." msgstr "" -":envvar:`PYTHONHASHSEED` によってハッシュシードの固定値を秘密にすることが出来" -"ます。" +":envvar:`PYTHONHASHSEED` を使うと、ハッシュのシードに使う秘密の値を固定値に設" +"定できます。" #: ../../using/cmdline.rst:400 msgid "The option is no longer ignored." @@ -637,9 +686,8 @@ msgstr "" ":data:`ユーザのサイトパッケージのディレクトリ ` を :data:" "`sys.path` に追加しません。" -#: ../../using/cmdline.rst:409 msgid "See also :envvar:`PYTHONNOUSERSITE`." -msgstr "" +msgstr ":envvar:`PYTHONNOUSERSITE` も参照してください。" #: ../../using/cmdline.rst:413 ../../using/cmdline.rst:986 #: ../../using/cmdline.rst:1001 @@ -658,19 +706,21 @@ msgstr "" "import しても、これらの操作は実行されません (実行したい場合は、 :func:`site." "main` を呼び出してください)。" -#: ../../using/cmdline.rst:426 msgid "" "Force the stdout and stderr streams to be unbuffered. This option has no " "effect on the stdin stream." msgstr "" +"stdout と stderr のストリームでバッファリングを行わないように強制します。\n" +"このオプションは stdin ストリームには影響しません。" #: ../../using/cmdline.rst:429 msgid "See also :envvar:`PYTHONUNBUFFERED`." msgstr ":envvar:`PYTHONUNBUFFERED` も参照してください。" -#: ../../using/cmdline.rst:431 msgid "The text layer of the stdout and stderr streams now is unbuffered." msgstr "" +"stdout と stderr のストリームのテキスト層で、バッファリングを行わなくなりまし" +"た。" #: ../../using/cmdline.rst:437 msgid "" @@ -685,11 +735,12 @@ msgstr "" "たファイルごとにメッセージを出力します。また、終了時のモジュールクリーンアッ" "プに関する情報も提供します。" -#: ../../using/cmdline.rst:442 msgid "" "The :mod:`site` module reports the site-specific paths and :file:`.pth` " "files being processed." msgstr "" +":mod:`site` モジュールが、処理中のサイト固有のパスと :file:`.pth` ファイルを" +"報告するようになりました。" #: ../../using/cmdline.rst:446 msgid "See also :envvar:`PYTHONVERBOSE`." @@ -703,14 +754,14 @@ msgstr "" "警告制御。 Python の警告機構はデフォルトでは警告メッセージを :data:`sys." "stderr` に表示します。" -#: ../../using/cmdline.rst:455 ../../using/cmdline.rst:1017 msgid "" "The simplest settings apply a particular action unconditionally to all " "warnings emitted by a process (even those that are otherwise ignored by " "default)::" msgstr "" +"最も単純な設定では、プロセスが出すすべての警告に、特定のアクションを無条件で" +"適用します (通常はデフォルトで無視される警告も対象です)。 ::" -#: ../../using/cmdline.rst:459 msgid "" "-Wdefault # Warn once per call location\n" "-Werror # Convert to exceptions\n" @@ -720,51 +771,69 @@ msgid "" "-Wonce # Warn once per Python process\n" "-Wignore # Never warn" msgstr "" +"-Wdefault # 呼び出し箇所ごとに一度警告\n" +"-Werror # 例外に変換\n" +"-Walways # 毎回警告\n" +"-Wall # -Walways と同じ\n" +"-Wmodule # 呼び出し元モジュールごとに一度警告\n" +"-Wonce # Python プロセスごとに一度警告\n" +"-Wignore # 警告しない" -#: ../../using/cmdline.rst:467 msgid "" "The action names can be abbreviated as desired and the interpreter will " "resolve them to the appropriate action name. For example, ``-Wi`` is the " "same as ``-Wignore``." msgstr "" +"アクション名は任意の長さに省略でき、インタープリタが適切なアクション名に解決" +"します。\n" +"例えば、``-Wi`` は ``-Wignore`` と同じです。" #: ../../using/cmdline.rst:471 msgid "The full form of argument is::" msgstr "引数の完全形は次のようになります::" -#: ../../using/cmdline.rst:473 msgid "action:message:category:module:lineno" -msgstr "" +msgstr "action:message:category:module:lineno" -#: ../../using/cmdline.rst:475 msgid "" "Empty fields match all values; trailing empty fields may be omitted. For " "example ``-W ignore::DeprecationWarning`` ignores all DeprecationWarning " "warnings." msgstr "" +"空のフィールドはすべての値にマッチします。\n" +"末尾の空のフィールドは省略できます。\n" +"例えば、``-W ignore::DeprecationWarning`` はすべての DeprecationWarning 警告" +"を無視します。" -#: ../../using/cmdline.rst:479 msgid "" "The *action* field is as explained above but only applies to warnings that " "match the remaining fields." msgstr "" +"*action* フィールドは前述のとおりですが、残りのフィールドにマッチする警告にだ" +"け適用されます。" -#: ../../using/cmdline.rst:482 msgid "" "The *message* field must match the start of the warning message; this match " "is case-insensitive. If it starts and ends with a forward slash (``/``), it " "specifies a regular expression, otherwise it specifies a literal string." msgstr "" +"*message* フィールドは、警告メッセージの先頭とマッチする必要があります。\n" +"このマッチでは大文字と小文字を区別しません。\n" +"スラッシュ (``/``) で始まり、スラッシュで終わる場合は正規表現を指定し、それ以" +"外の場合はリテラル文字列を指定します。" -#: ../../using/cmdline.rst:487 msgid "" "The *category* field matches the warning category (ex: " "``DeprecationWarning``). This must be a class name; the match test whether " "the actual warning category of the message is a subclass of the specified " "warning category." msgstr "" +"*category* フィールドは警告カテゴリ (例: ``DeprecationWarning``) とマッチしま" +"す。\n" +"このフィールドにはクラス名を指定する必要があります。\n" +"メッセージの実際の警告カテゴリが、指定した警告カテゴリのサブクラスかどうかが" +"調べられます。" -#: ../../using/cmdline.rst:492 msgid "" "The *module* field matches the (fully qualified) module name; this match is " "case-sensitive. If it starts and ends with a forward slash (``/``), it " @@ -772,32 +841,42 @@ msgid "" "name must match, otherwise it specifies a literal string that the fully " "qualified module name must be equal to." msgstr "" +"*module* フィールドは、完全修飾されたモジュール名とマッチします。\n" +"このマッチでは大文字と小文字を区別します。\n" +"スラッシュ (``/``) で始まり、スラッシュで終わる場合は、完全修飾されたモジュー" +"ル名の先頭がマッチする必要のある正規表現を指定します。\n" +"それ以外の場合は、完全修飾されたモジュール名と等しくなければならないリテラル" +"文字列を指定します。" -#: ../../using/cmdline.rst:499 msgid "" "The *lineno* field matches the line number, where zero matches all line " "numbers and is thus equivalent to an omitted line number." msgstr "" +"*lineno* フィールドは行番号とマッチします。\n" +"ゼロはすべての行番号にマッチするため、行番号を省略した場合と同じです。" -#: ../../using/cmdline.rst:502 msgid "" "Multiple :option:`-W` options can be given; when a warning matches more than " "one option, the action for the last matching option is performed. Invalid :" "option:`-W` options are ignored (though, a warning message is printed about " "invalid options when the first warning is issued)." msgstr "" -"複数の :option:`-W` オプションを指定することができます。警告が1つ以上のオプ" -"ションとマッチしたときは、最後にマッチしたオプションのアクションが有効になり" -"ます。不正な :option:`-W` オプションは無視されます (最初の警告が発生したとき" -"に、不正なオプションに対する警告メッセージが表示されます)。" +"複数の :option:`-W` オプションを指定できます。\n" +"警告が複数のオプションにマッチした場合は、最後にマッチしたオプションのアク" +"ションが実行されます。\n" +"不正な :option:`-W` オプションは無視されます (ただし、最初の警告が出される際" +"に、不正なオプションについての警告メッセージが表示されます)。" -#: ../../using/cmdline.rst:507 msgid "" "Warnings can also be controlled using the :envvar:`PYTHONWARNINGS` " "environment variable and from within a Python program using the :mod:" "`warnings` module. For example, the :func:`warnings.filterwarnings` function " "can be used to use a regular expression on the warning message." msgstr "" +"警告は :envvar:`PYTHONWARNINGS` 環境変数や、Python プログラム内から :mod:" +"`warnings` モジュールを使って制御することもできます。\n" +"例えば、:func:`warnings.filterwarnings` 関数を使うと、警告メッセージに対して" +"正規表現を使用できます。" #: ../../using/cmdline.rst:512 ../../using/cmdline.rst:1029 msgid "" @@ -807,41 +886,42 @@ msgstr "" "詳しくは :ref:`warning-filter` と :ref:`describing-warning-filters` を参照し" "てください。" -#: ../../using/cmdline.rst:515 ../../using/cmdline.rst:1032 msgid "Added regular expression support for *message* and *module*." -msgstr "" +msgstr "*message* と *module* で正規表現が使えるようになりました。" -#: ../../using/cmdline.rst:521 msgid "" "Skip the first line of the source, allowing use of non-Unix forms of ``#!" "cmd``." msgstr "" +"ソースの最初の行を読み飛ばし、Unix 以外の形式の ``#!cmd`` を使用できるように" +"します。" -#: ../../using/cmdline.rst:524 msgid "" "This can be used to turn a Python script into a Windows batch file. " "Similarly to adding a shebang line and setting the executable bit on Unix, " "the extension of the Python script can be changed to ``.bat`` and the " "following line can be added at the start of the script:" msgstr "" +"このオプションを使うと、Python スクリプトを Windows のバッチファイルにできま" +"す。\n" +"Unix で shebang 行を追加して実行可能ビットを設定するのと同じように、Python ス" +"クリプトの拡張子を ``.bat`` に変更し、スクリプトの先頭に次の行を追加できます:" -#: ../../using/cmdline.rst:529 msgid "@py -x \"%~f0\" %* & exit /b" -msgstr "" +msgstr "@py -x \"%~f0\" %* & exit /b" -#: ../../using/cmdline.rst:533 msgid "Or, to specify the path to the Python interpreter explicitly:" -msgstr "" +msgstr "Python インタープリタのパスを明示的に指定する場合は、次のようにします:" -#: ../../using/cmdline.rst:535 msgid "@\"C:\\Path\\to\\python.exe\" -x \"%~f0\" %* & exit /b" -msgstr "" +msgstr "@\"C:\\Path\\to\\python.exe\" -x \"%~f0\" %* & exit /b" -#: ../../using/cmdline.rst:539 msgid "" "Unlike a shebang line which is a Python comment, this line is not valid " "Python syntax, and the :option:`-x` option is needed to skip it." msgstr "" +"Python のコメントである shebang 行とは異なり、この行は Python の有効な構文で" +"はないため、読み飛ばすには :option:`-x` オプションが必要です。" #: ../../using/cmdline.rst:545 msgid "" @@ -851,21 +931,23 @@ msgstr "" "様々な実装固有のオプションのために予約されています。現在のところ CPython は以" "下の値を定義しています:" -#: ../../using/cmdline.rst:548 msgid "" "``-X faulthandler`` to enable :mod:`faulthandler`. See also :envvar:" "`PYTHONFAULTHANDLER`." msgstr "" +"``-X faulthandler`` は :mod:`faulthandler` を有効にします。\n" +":envvar:`PYTHONFAULTHANDLER` も参照してください。" -#: ../../using/cmdline.rst:553 msgid "" "``-X showrefcount`` to output the total reference count and number of used " "memory blocks when the program finishes or after each statement in the " "interactive interpreter. This only works on :ref:`debug builds `." msgstr "" +"``-X showrefcount`` は、プログラムの終了時、または対話的インタープリタでの各" +"文の実行後に、参照カウントの合計と使用中のメモリブロック数を出力します。\n" +":ref:`デバッグビルド ` でのみ動作します。" -#: ../../using/cmdline.rst:560 msgid "" "``-X tracemalloc`` to start tracing Python memory allocations using the :mod:" "`tracemalloc` module. By default, only the most recent frame is stored in a " @@ -873,68 +955,94 @@ msgid "" "traceback limit of *NFRAME* frames. See :func:`tracemalloc.start` and :" "envvar:`PYTHONTRACEMALLOC` for more information." msgstr "" +"``-X tracemalloc`` は、:mod:`tracemalloc` モジュールを使って Python のメモリ" +"割り当ての追跡を開始します。\n" +"デフォルトでは、追跡結果のトレースバックには最新のフレームのみが保存されま" +"す。\n" +"トレースバックを最大 *NFRAME* フレームに制限して追跡を開始するには、``-X " +"tracemalloc=NFRAME`` を使います。\n" +"詳細は :func:`tracemalloc.start` と :envvar:`PYTHONTRACEMALLOC` を参照してく" +"ださい。" -#: ../../using/cmdline.rst:569 msgid "" "``-X int_max_str_digits`` configures the :ref:`integer string conversion " "length limitation `. See also :envvar:" "`PYTHONINTMAXSTRDIGITS`." msgstr "" +"``-X int_max_str_digits`` は :ref:`整数と文字列の間の変換の長さ制限 " +"` を設定します。\n" +":envvar:`PYTHONINTMAXSTRDIGITS` も参照してください。" -#: ../../using/cmdline.rst:575 msgid "" "``-X importtime`` to show how long each import takes. It shows module name, " "cumulative time (including nested imports) and self time (excluding nested " "imports). Note that its output may be broken in multi-threaded " "application. Typical usage is ``python -X importtime -c 'import asyncio'``." msgstr "" +"``-X importtime`` は、各インポートにかかる時間を表示します。\n" +"モジュール名、累積時間 (ネストされたインポートを含む)、自身の処理時間 (ネスト" +"されたインポートを除く) を表示します。\n" +"マルチスレッドのアプリケーションでは、出力が崩れる場合があります。\n" +"典型的な使い方は ``python -X importtime -c 'import asyncio'`` です。" -#: ../../using/cmdline.rst:580 msgid "" "``-X importtime=2`` enables additional output that indicates when an " "imported module has already been loaded. In such cases, the string " "``cached`` will be printed in both time columns." msgstr "" +"``-X importtime=2`` は、インポートされたモジュールがすでに読み込まれている場" +"合に、そのことを示す追加の出力を有効にします。\n" +"この場合、両方の時間の列に文字列 ``cached`` が表示されます。" -#: ../../using/cmdline.rst:584 msgid "See also :envvar:`PYTHONPROFILEIMPORTTIME`." -msgstr "" +msgstr ":envvar:`PYTHONPROFILEIMPORTTIME` も参照してください。" -#: ../../using/cmdline.rst:590 msgid "" "Added ``-X importtime=2`` to also trace imports of loaded modules, and " "reserved values other than ``1`` and ``2`` for future use." msgstr "" +"読み込み済みのモジュールのインポートも追跡する ``-X importtime=2`` を追加し、" +"``1`` と ``2`` 以外の値を将来のために予約しました。" -#: ../../using/cmdline.rst:593 msgid "" "``-X dev``: enable :ref:`Python Development Mode `, introducing " "additional runtime checks that are too expensive to be enabled by default. " "See also :envvar:`PYTHONDEVMODE`." msgstr "" +"``-X dev`` は :ref:`Python 開発モード ` を有効にします。\n" +"このモードでは、負荷が大きいためデフォルトでは有効にできない追加の実行時" +"チェックを行います。\n" +":envvar:`PYTHONDEVMODE` も参照してください。" -#: ../../using/cmdline.rst:599 msgid "" "``-X utf8`` enables the :ref:`Python UTF-8 Mode `. ``-X utf8=0`` " "explicitly disables :ref:`Python UTF-8 Mode ` (even when it would " "otherwise activate automatically). See also :envvar:`PYTHONUTF8`." msgstr "" +"``-X utf8`` は :ref:`Python UTF-8 モード ` を有効にします。\n" +"``-X utf8=0`` は、通常なら自動で有効になる場合でも、:ref:`Python UTF-8 モー" +"ド ` を明示的に無効にします。\n" +":envvar:`PYTHONUTF8` も参照してください。" -#: ../../using/cmdline.rst:606 msgid "" "``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel tree " "rooted at the given directory instead of to the code tree. See also :envvar:" "`PYTHONPYCACHEPREFIX`." msgstr "" +"``-X pycache_prefix=PATH`` は、コードツリー内ではなく、指定したディレクトリを" +"ルートとする対応する別のツリー内に ``.pyc`` ファイルを書き込むようにしま" +"す。\n" +":envvar:`PYTHONPYCACHEPREFIX` も参照してください。" -#: ../../using/cmdline.rst:612 msgid "" "``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the " "locale-specific default encoding is used for opening files. See also :envvar:" "`PYTHONWARNDEFAULTENCODING`." msgstr "" +"``-X warn_default_encoding`` は、ファイルを開く際にロケール固有のデフォルトの" +"エンコーディングが使われると、:class:`EncodingWarning` を発生させます。\n" +":envvar:`PYTHONWARNDEFAULTENCODING` も参照してください。" -#: ../../using/cmdline.rst:618 msgid "" "``-X no_debug_ranges`` disables the inclusion of the tables mapping extra " "location information (end line, start column offset and end column offset) " @@ -943,6 +1051,13 @@ msgid "" "location indicators when the interpreter displays tracebacks. See also :" "envvar:`PYTHONNODEBUGRANGES`." msgstr "" +"``-X no_debug_ranges`` は、コードオブジェクトの各命令に追加の位置情報 (終了" +"行、開始列のオフセット、終了列のオフセット) を対応付けるテーブルを含めないよ" +"うにします。\n" +"これは、コードオブジェクトや pyc ファイルを小さくしたい場合や、インタープリタ" +"がトレースバックを表示する際に追加の位置を示す表示を抑制したい場合に役立ちま" +"す。\n" +":envvar:`PYTHONNODEBUGRANGES` も参照してください。" #: ../../using/cmdline.rst:627 msgid "" @@ -956,7 +1071,6 @@ msgid "" "`PYTHON_FROZEN_MODULES`." msgstr "" -#: ../../using/cmdline.rst:638 msgid "" "``-X perf`` enables support for the Linux ``perf`` profiler. When this " "option is provided, the ``perf`` profiler will be able to report Python " @@ -964,8 +1078,14 @@ msgid "" "if is not supported on the current system. The default value is \"off\". See " "also :envvar:`PYTHONPERFSUPPORT` and :ref:`perf_profiling`." msgstr "" +"``-X perf`` は、Linux の ``perf`` プロファイラのサポートを有効にします。\n" +"このオプションを指定すると、``perf`` プロファイラが Python の呼び出しを報告で" +"きるようになります。\n" +"このオプションは一部のプラットフォームでのみ利用でき、現在のシステムでサポー" +"トされていない場合は何も行いません。\n" +"デフォルトの値は \"off\" です。\n" +":envvar:`PYTHONPERFSUPPORT` と :ref:`perf_profiling` も参照してください。" -#: ../../using/cmdline.rst:646 msgid "" "``-X perf_jit`` enables support for the Linux ``perf`` profiler with DWARF " "support. When this option is provided, the ``perf`` profiler will be able to " @@ -974,23 +1094,36 @@ msgid "" "system. The default value is \"off\". See also :envvar:" "`PYTHON_PERF_JIT_SUPPORT` and :ref:`perf_profiling`." msgstr "" +"``-X perf_jit`` は、DWARF に対応した Linux の ``perf`` プロファイラのサポート" +"を有効にします。\n" +"このオプションを指定すると、``perf`` プロファイラが DWARF 情報を使って " +"Python の呼び出しを報告できるようになります。\n" +"このオプションは一部のプラットフォームでのみ利用でき、現在のシステムでサポー" +"トされていない場合は何も行いません。\n" +"デフォルトの値は \"off\" です。\n" +":envvar:`PYTHON_PERF_JIT_SUPPORT` と :ref:`perf_profiling` も参照してくださ" +"い。" -#: ../../using/cmdline.rst:655 msgid "" "``-X disable-remote-debug`` disables the remote debugging support as " "described in :pep:`768`. This includes both the functionality to schedule " "code for execution in another process and the functionality to receive code " "for execution in the current process." msgstr "" +"``-X disable-remote-debug`` は、:pep:`768` で説明されているリモートデバッグの" +"サポートを無効にします。\n" +"これには、別のプロセスでのコード実行を予約する機能と、現在のプロセスで実行す" +"るコードを受け取る機能の両方が含まれます。" -#: ../../using/cmdline.rst:660 msgid "" "This option is only available on some platforms and will do nothing if is " "not supported on the current system. See also :envvar:" "`PYTHON_DISABLE_REMOTE_DEBUG` and :pep:`768`." msgstr "" +"このオプションは一部のプラットフォームでのみ利用でき、現在のシステムでサポー" +"トされていない場合は何も行いません。\n" +":envvar:`PYTHON_DISABLE_REMOTE_DEBUG` と :pep:`768` も参照してください。" -#: ../../using/cmdline.rst:666 msgid "" ":samp:`-X cpu_count={n}` overrides :func:`os.cpu_count`, :func:`os." "process_cpu_count`, and :func:`multiprocessing.cpu_count`. *n* must be " @@ -998,8 +1131,14 @@ msgid "" "limit CPU resources of a container system. See also :envvar:" "`PYTHON_CPU_COUNT`. If *n* is ``default``, nothing is overridden." msgstr "" +":samp:`-X cpu_count={n}` は :func:`os.cpu_count`、:func:`os." +"process_cpu_count`、:func:`multiprocessing.cpu_count` を上書きします。\n" +"*n* は 1 以上でなければなりません。\n" +"このオプションは、コンテナシステムの CPU リソースを制限する必要がある場合に役" +"立つことがあります。\n" +":envvar:`PYTHON_CPU_COUNT` も参照してください。\n" +"*n* が ``default`` の場合、上書きは行われません。" -#: ../../using/cmdline.rst:675 msgid "" ":samp:`-X presite={module}` or :samp:`-X presite={module:func}` specifies an " "entry point that should be executed before the :mod:`site` module is " @@ -1009,20 +1148,31 @@ msgid "" "mode ` for this option to exist. See also :envvar:" "`PYTHON_PRESITE`." msgstr "" +":samp:`-X presite={module}` または :samp:`-X presite={module:func}` は、:mod:" +"`site` モジュールの実行前、かつ :mod:`__main__` モジュールが存在する前に実行" +"するエントリーポイントを指定します。\n" +"したがって、インポートされたモジュールは :mod:`__main__` ではありません。\n" +"これは、Python の初期化の早い段階でコードを実行するために使用できます。\n" +"このオプションを利用するには、Python が :ref:`デバッグモードでビルド ` されている必要があります。\n" +":envvar:`PYTHON_PRESITE` も参照してください。" -#: ../../using/cmdline.rst:683 ../../using/cmdline.rst:1481 msgid "Accept also ``module:func`` entry point format." msgstr "" +"エントリーポイントの形式として ``module:func`` も受け付けるようになりました。" -#: ../../using/cmdline.rst:688 msgid "" ":samp:`-X gil={0,1}` forces the GIL to be disabled or enabled, respectively. " "Setting to ``0`` is only available in builds configured with :option:`--" "disable-gil`. See also :envvar:`PYTHON_GIL` and :ref:`whatsnew313-free-" "threaded-cpython`." msgstr "" +":samp:`-X gil={0,1}` は、それぞれ GIL を強制的に無効または有効にします。\n" +"``0`` への設定は、:option:`--disable-gil` を指定して構成したビルドでのみ利用" +"できます。\n" +":envvar:`PYTHON_GIL` と :ref:`whatsnew313-free-threaded-cpython` も参照してく" +"ださい。" -#: ../../using/cmdline.rst:695 msgid "" ":samp:`-X thread_inherit_context={0,1}` causes :class:`~threading.Thread` " "to, by default, use a copy of context of the caller of ``Thread.start()`` " @@ -1030,8 +1180,14 @@ msgid "" "unset, the value of this option defaults to ``1`` on free-threaded builds " "and to ``0`` otherwise. See also :envvar:`PYTHON_THREAD_INHERIT_CONTEXT`." msgstr "" +":samp:`-X thread_inherit_context={0,1}` を ``1`` に設定すると、:class:" +"`~threading.Thread` はデフォルトで、``Thread.start()`` の呼び出し元のコンテキ" +"ストのコピーを使ってスレッドを開始します。\n" +"それ以外の場合、スレッドは空のコンテキストで開始します。\n" +"未設定の場合、このオプションのデフォルト値は、フリースレッドビルドでは " +"``1``、それ以外では ``0`` です。\n" +":envvar:`PYTHON_THREAD_INHERIT_CONTEXT` も参照してください。" -#: ../../using/cmdline.rst:704 msgid "" ":samp:`-X context_aware_warnings={0,1}` causes the :class:`warnings." "catch_warnings` context manager to use a :class:`~contextvars.ContextVar` to " @@ -1039,29 +1195,46 @@ msgid "" "``1`` on free-threaded builds and to ``0`` otherwise. See also :envvar:" "`PYTHON_CONTEXT_AWARE_WARNINGS`." msgstr "" +":samp:`-X context_aware_warnings={0,1}` を ``1`` に設定すると、:class:" +"`warnings.catch_warnings` コンテキストマネージャは、警告フィルタの状態の保存" +"に :class:`~contextvars.ContextVar` を使います。\n" +"未設定の場合、このオプションのデフォルト値は、フリースレッドビルドでは " +"``1``、それ以外では ``0`` です。\n" +":envvar:`PYTHON_CONTEXT_AWARE_WARNINGS` も参照してください。" -#: ../../using/cmdline.rst:712 msgid "" ":samp:`-X pathconfig_warnings={0,1}` if true (``1``) then :ref:`sys-path-" "init` is allowed to log warnings into stderr. If false (``0``) suppress " "these warnings. Set to true by default. See also :envvar:" "`PYTHON_PATHCONFIG_WARNINGS`." msgstr "" +":samp:`-X pathconfig_warnings={0,1}` が真 (``1``) の場合、:ref:`sys-path-" +"init` の際に stderr に警告を出力できます。\n" +"偽 (``0``) の場合は、これらの警告を抑制します。\n" +"デフォルトでは真に設定されます。\n" +":envvar:`PYTHON_PATHCONFIG_WARNINGS` も参照してください。" -#: ../../using/cmdline.rst:719 msgid "" ":samp:`-X tlbc={0,1}` enables (1, the default) or disables (0) thread-local " "bytecode in builds configured with :option:`--disable-gil`. When disabled, " "this also disables the specializing interpreter. See also :envvar:" "`PYTHON_TLBC`." msgstr "" +":samp:`-X tlbc={0,1}` は、:option:`--disable-gil` を指定して構成したビルド" +"で、スレッドローカルなバイトコードを有効 (1、デフォルト) または無効 (0) にし" +"ます。\n" +"無効にすると、特殊化インタープリタも無効になります。\n" +":envvar:`PYTHON_TLBC` も参照してください。" -#: ../../using/cmdline.rst:726 msgid "" ":samp:`-X lazy_imports={all,normal}` controls lazy import behavior. ``all`` " "makes all imports lazy by default, and ``normal`` (the default) respects the " "``lazy`` keyword in source code. See also :envvar:`PYTHON_LAZY_IMPORTS`." msgstr "" +":samp:`-X lazy_imports={all,normal}` は、遅延インポートの挙動を制御します。\n" +"``all`` ではすべてのインポートをデフォルトで遅延させ、``normal`` (デフォル" +"ト) はソースコード内の ``lazy`` キーワードに従います。\n" +":envvar:`PYTHON_LAZY_IMPORTS` も参照してください。" #: ../../using/cmdline.rst:733 msgid "" @@ -1070,19 +1243,18 @@ msgid "" msgstr "" "任意の値を渡し、 :data:`sys._xoptions` 辞書から取り出すことも出来ます。" -#: ../../using/cmdline.rst:738 msgid "Removed the ``-X showalloccount`` option." -msgstr "" +msgstr "``-X showalloccount`` オプションは削除されました。" -#: ../../using/cmdline.rst:741 msgid "Removed the ``-X oldparser`` option." -msgstr "" +msgstr "``-X oldparser`` オプションは削除されました。" -#: ../../using/cmdline.rst:746 msgid "" ":option:`!-J` is no longer reserved for use by Jython_, and now has no " "special meaning." msgstr "" +":option:`!-J` は Jython_ 用に予約されなくなり、特別な意味を持たなくなりまし" +"た。" #: ../../using/cmdline.rst:754 msgid "Controlling color" @@ -1218,17 +1390,19 @@ msgstr "" "ディレクトリが :envvar:`PYTHONPATH` の手前に追加されます。検索パスは Python " "プログラムから :data:`sys.path` 変数として操作することができます。" -#: ../../using/cmdline.rst:822 msgid "" "If this is set to a non-empty string, don't prepend a potentially unsafe " "path to :data:`sys.path`: see the :option:`-P` option for details." msgstr "" +"空でない文字列を設定すると、安全でない可能性のあるパスを :data:`sys.path` の" +"先頭に追加しなくなります。\n" +"詳細は :option:`-P` オプションを参照してください。" -#: ../../using/cmdline.rst:830 msgid "" "If this is set to a non-empty string, it overrides the :data:`sys." "platlibdir` value." msgstr "" +"空でない文字列を設定すると、:data:`sys.platlibdir` の値を上書きします。" #: ../../using/cmdline.rst:838 msgid "" @@ -1248,11 +1422,12 @@ msgstr "" "このファイルの中で、プロンプト :data:`sys.ps1` や :data:`sys.ps2`、ならびに" "フック :data:`sys.__interactivehook__` も変更できます。" -#: ../../using/cmdline.rst:845 ../../using/cmdline.rst:847 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with the " "filename as the argument when called on startup." msgstr "" +"起動時に呼び出されると、ファイル名を引数として :ref:`監査イベント " +"` ``cpython.run_startup`` を送出します。" #: ../../using/cmdline.rst:853 msgid "" @@ -1264,7 +1439,6 @@ msgstr "" "等価です。整数を設定した場合、 :option:`-O` を複数回指定したのと同じになりま" "す。" -#: ../../using/cmdline.rst:860 msgid "" "If this is set, it names a callable using dotted-path notation. The module " "containing the callable will be imported and then the callable will be run " @@ -1274,6 +1448,15 @@ msgid "" "the string \"0\" causes the default implementation of :func:`sys." "breakpointhook` to do nothing but return immediately." msgstr "" +"設定する場合は、ドット区切りのパス表記で呼び出し可能オブジェクトを指定しま" +"す。\n" +"そのオブジェクトを含むモジュールがインポートされ、続いて :func:`sys." +"breakpointhook` のデフォルト実装によってそのオブジェクトが呼び出されます。\n" +"このフック自体は、組み込みの :func:`breakpoint` から呼び出されます。\n" +"未設定の場合、または空文字列に設定した場合は、値 \"pdb.set_trace\" を指定した" +"場合と同じです。\n" +"文字列 \"0\" を設定すると、:func:`sys.breakpointhook` のデフォルト実装は何も" +"行わず、直ちに戻ります。" #: ../../using/cmdline.rst:872 msgid "" @@ -1285,11 +1468,12 @@ msgstr "" "等価です。整数を指定した場合、 :option:`-d` を複数回指定したのと同じになりま" "す。" -#: ../../using/cmdline.rst:876 msgid "" "This environment variable requires a :ref:`debug build of Python `, otherwise it's ignored." msgstr "" +"この環境変数には :ref:`Python のデバッグビルド ` が必要で、それ" +"以外では無視されます。" #: ../../using/cmdline.rst:882 msgid "" @@ -1307,15 +1491,18 @@ msgstr "" "この変数は Python コードから :data:`os.environ` を使って変更して、プログラム" "終了時のインスペクトモードを強制することができます。" -#: ../../using/cmdline.rst:890 msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." msgstr "" +"(3.11.10、3.10.15、3.9.20、3.8.20 も同様) 監査イベントを送出するようになりま" +"した。" -#: ../../using/cmdline.rst:893 msgid "" "Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also " "executed. Emits audit events." msgstr "" +"可能な場合は PyREPL を使用するようになり、その場合は :envvar:`PYTHONSTARTUP` " +"も実行されます。\n" +"監査イベントを送出するようになりました。" #: ../../using/cmdline.rst:900 msgid "" @@ -1353,13 +1540,16 @@ msgstr "" "ト時に ``.pyc`` ファイルを作成しようとはしなくなります。\n" ":option:`-B` オプションを指定するのと等価です。" -#: ../../using/cmdline.rst:926 msgid "" "If this is set, Python will write ``.pyc`` files in a mirror directory tree " "at this path, instead of in ``__pycache__`` directories within the source " "tree. This is equivalent to specifying the :option:`-X` " "``pycache_prefix=PATH`` option." msgstr "" +"設定すると、Python はソースツリー内の ``__pycache__`` ディレクトリではなく、" +"このパスを起点としてソースツリーに対応するディレクトリツリー内に ``.pyc`` " +"ファイルを書き込みます。\n" +":option:`-X` ``pycache_prefix=PATH`` オプションの指定と同じです。" #: ../../using/cmdline.rst:936 msgid "" @@ -1395,12 +1585,13 @@ msgstr "" "整数は [0,4294967295] の十進数でなければなりません。0 を指定するとハッシュラ" "ンダム化は無効化されます。" -#: ../../using/cmdline.rst:954 msgid "" "If this variable is set to an integer, it is used to configure the " "interpreter's global :ref:`integer string conversion length limitation " "`." msgstr "" +"整数を設定すると、インタープリタ全体の :ref:`整数と文字列の間の変換の長さ制" +"限 ` を設定するために使われます。" #: ../../using/cmdline.rst:962 msgid "" @@ -1426,34 +1617,44 @@ msgstr "" msgid "The ``encodingname`` part is now optional." msgstr "``encodingname`` の部分が任意になりました。" -#: ../../using/cmdline.rst:973 msgid "" "On Windows, the encoding specified by this variable is ignored for " "interactive console buffers unless :envvar:`PYTHONLEGACYWINDOWSSTDIO` is " "also specified. Files and pipes redirected through the standard streams are " "not affected." msgstr "" +"Windows では、:envvar:`PYTHONLEGACYWINDOWSSTDIO` も指定しない限り、この変数で" +"指定したエンコーディングは対話型コンソールのバッファに対しては無視されま" +"す。\n" +"標準ストリームでリダイレクトされたファイルやパイプは、この制限の影響を受けま" +"せん。" -#: ../../using/cmdline.rst:980 msgid "" "This is equivalent to the :option:`-s` option. If this is set, Python won't " "add the :data:`user site-packages directory ` to :data:`sys." "path`." msgstr "" +":option:`-s` オプションと同じです。\n" +"設定すると、Python は :data:`ユーザーの site-packages ディレクトリ ` を :data:`sys.path` に追加しなくなります。" -#: ../../using/cmdline.rst:991 msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` and :ref:`installation paths ` for " "``python -m pip install --user``." msgstr "" +":data:`ユーザーベースディレクトリ ` を定義します。\n" +"このディレクトリは、:data:`ユーザーの site-packages ディレクトリ ` のパスと、``python -m pip install --user`` の :ref:`インストール" +"先のパス ` を求めるために使われます。" -#: ../../using/cmdline.rst:996 msgid "" "To disable the user site-packages, see :envvar:`PYTHONNOUSERSITE` or the :" "option:`-s` option." msgstr "" +"ユーザーの site-packages を無効にするには、:envvar:`PYTHONNOUSERSITE` また" +"は :option:`-s` オプションを参照してください。" #: ../../using/cmdline.rst:1006 msgid "" @@ -1463,14 +1664,15 @@ msgstr "" "この環境変数が設定された場合、 ``sys.argv[0]`` に、C ランタイムから取得した値" "の代わりにこの環境変数の値が設定されます。macOS でのみ動作します。" -#: ../../using/cmdline.rst:1012 msgid "" "This is equivalent to the :option:`-W` option. If set to a comma separated " "string, it is equivalent to specifying :option:`-W` multiple times, with " "filters later in the list taking precedence over those earlier in the list." msgstr "" +":option:`-W` オプションと同じです。\n" +"コンマで区切った文字列を設定すると、:option:`-W` を複数回指定した場合と同じに" +"なり、リストの後ろにあるフィルタが前にあるフィルタより優先されます。" -#: ../../using/cmdline.rst:1021 msgid "" "PYTHONWARNINGS=default # Warn once per call location\n" "PYTHONWARNINGS=error # Convert to exceptions\n" @@ -1480,8 +1682,14 @@ msgid "" "PYTHONWARNINGS=once # Warn once per Python process\n" "PYTHONWARNINGS=ignore # Never warn" msgstr "" +"PYTHONWARNINGS=default # 呼び出し箇所ごとに一度警告\n" +"PYTHONWARNINGS=error # 例外に変換\n" +"PYTHONWARNINGS=always # 毎回警告\n" +"PYTHONWARNINGS=all # PYTHONWARNINGS=always と同じ\n" +"PYTHONWARNINGS=module # 呼び出し元モジュールごとに一度警告\n" +"PYTHONWARNINGS=once # Python プロセスごとに一度警告\n" +"PYTHONWARNINGS=ignore # 警告しない" -#: ../../using/cmdline.rst:1038 msgid "" "If this environment variable is set to a non-empty string, :func:" "`faulthandler.enable` is called at startup: install a handler for :const:" @@ -1489,8 +1697,12 @@ msgid "" "`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python " "traceback. This is equivalent to :option:`-X` ``faulthandler`` option." msgstr "" +"空でない文字列を設定すると、起動時に :func:`faulthandler.enable` を呼び出し、" +"Python のトレースバックをダンプするハンドラを :const:`~signal.SIGSEGV`、:" +"const:`~signal.SIGFPE`、:const:`~signal.SIGABRT`、:const:`~signal.SIGBUS`、:" +"const:`~signal.SIGILL` の各シグナルに設定します。\n" +":option:`-X` ``faulthandler`` オプションの指定と同じです。" -#: ../../using/cmdline.rst:1050 msgid "" "If this environment variable is set to a non-empty string, start tracing " "Python memory allocations using the :mod:`tracemalloc` module. The value of " @@ -1499,19 +1711,29 @@ msgid "" "frame. See the :func:`tracemalloc.start` function for more information. This " "is equivalent to setting the :option:`-X` ``tracemalloc`` option." msgstr "" +"空でない文字列を設定すると、:mod:`tracemalloc` モジュールを使って Python のメ" +"モリ割り当ての追跡を開始します。\n" +"この変数の値は、追跡結果のトレースバックに保存するフレーム数の上限です。\n" +"例えば、``PYTHONTRACEMALLOC=1`` は最新のフレームだけを保存します。\n" +"詳細は :func:`tracemalloc.start` 関数を参照してください。\n" +":option:`-X` ``tracemalloc`` オプションの設定と同じです。" -#: ../../using/cmdline.rst:1063 msgid "" "If this environment variable is set to ``1``, Python will show how long each " "import takes. If set to ``2``, Python will include output for imported " "modules that have already been loaded. This is equivalent to setting the :" "option:`-X` ``importtime`` option." msgstr "" +"``1`` を設定すると、Python は各インポートにかかる時間を表示します。\n" +"``2`` を設定すると、インポートしたモジュールがすでに読み込まれている場合の出" +"力も含まれます。\n" +":option:`-X` ``importtime`` オプションの設定と同じです。" -#: ../../using/cmdline.rst:1072 msgid "" "Added ``PYTHONPROFILEIMPORTTIME=2`` to also trace imports of loaded modules." msgstr "" +"読み込み済みのモジュールのインポートも追跡する ``PYTHONPROFILEIMPORTTIME=2`` " +"を追加しました。" #: ../../using/cmdline.rst:1077 msgid "" @@ -1521,120 +1743,147 @@ msgstr "" "この環境変数が空でない文字列に設定された場合、:mod:`asyncio` モジュールの :" "ref:`デバッグモード ` が有効化されます。" -#: ../../using/cmdline.rst:1085 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" +"Python のメモリアロケータの設定や、デバッグフックのインストールを行います。" -#: ../../using/cmdline.rst:1087 msgid "Set the family of memory allocators used by Python:" -msgstr "" +msgstr "Python が使うメモリアロケータの種類を設定します:" -#: ../../using/cmdline.rst:1089 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" +"``default``: :ref:`デフォルトのメモリアロケータ ` " +"を使います。" -#: ../../using/cmdline.rst:1091 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:macro:`PYMEM_DOMAIN_RAW`, :c:macro:`PYMEM_DOMAIN_MEM`, :c:macro:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" +"``malloc``: すべてのドメイン (:c:macro:`PYMEM_DOMAIN_RAW`、:c:macro:" +"`PYMEM_DOMAIN_MEM`、:c:macro:`PYMEM_DOMAIN_OBJ`) に C ライブラリの :c:func:" +"`malloc` 関数を使います。" -#: ../../using/cmdline.rst:1094 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:macro:" "`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" +"``pymalloc``: :c:macro:`PYMEM_DOMAIN_MEM` および :c:macro:`PYMEM_DOMAIN_OBJ` " +"ドメインには :ref:`pymalloc アロケータ ` を使い、:c:macro:" +"`PYMEM_DOMAIN_RAW` ドメインには :c:func:`malloc` 関数を使います。" -#: ../../using/cmdline.rst:1097 msgid "" "``mimalloc``: use the :ref:`mimalloc allocator ` for :c:macro:" "`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" +"``mimalloc``: :c:macro:`PYMEM_DOMAIN_MEM` および :c:macro:`PYMEM_DOMAIN_OBJ` " +"ドメインには :ref:`mimalloc アロケータ ` を使い、:c:macro:" +"`PYMEM_DOMAIN_RAW` ドメインには :c:func:`malloc` 関数を使います。" -#: ../../using/cmdline.rst:1101 msgid "Install :ref:`debug hooks `:" -msgstr "" +msgstr ":ref:`デバッグフック ` をインストールします:" -#: ../../using/cmdline.rst:1103 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" +"``debug``: :ref:`デフォルトのメモリアロケータ ` に" +"デバッグフックを追加します。" -#: ../../using/cmdline.rst:1105 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" +"``malloc_debug``: ``malloc`` と同じですが、デバッグフックもインストールしま" +"す。" -#: ../../using/cmdline.rst:1106 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" +"``pymalloc_debug``: ``pymalloc`` と同じですが、デバッグフックもインストールし" +"ます。" -#: ../../using/cmdline.rst:1107 msgid "``mimalloc_debug``: same as ``mimalloc`` but also install debug hooks." msgstr "" +"``mimalloc_debug``: ``mimalloc`` と同じですが、デバッグフックもインストールし" +"ます。" -#: ../../using/cmdline.rst:1111 msgid "" "In the :term:`free-threaded ` build, the ``malloc``, " "``malloc_debug``, ``pymalloc``, and ``pymalloc_debug`` values are not " "supported. Only ``default``, ``debug``, ``mimalloc``, and " "``mimalloc_debug`` are accepted." msgstr "" +":term:`フリースレッド ` ビルドでは、``malloc``、" +"``malloc_debug``、``pymalloc``、``pymalloc_debug`` の値はサポートされていませ" +"ん。\n" +"``default``、``debug``、``mimalloc``、``mimalloc_debug`` のみを受け付けます。" -#: ../../using/cmdline.rst:1118 msgid "Added the ``\"default\"`` allocator." -msgstr "" +msgstr "``\"default\"`` アロケータを追加しました。" -#: ../../using/cmdline.rst:1124 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` or the :ref:`mimalloc memory " "allocator ` (whichever is in use) every time a new object arena is " "created, and on shutdown." msgstr "" +"空でない文字列を設定すると、Python は新しいオブジェクトアリーナを作成するたび" +"に、また終了時に、使用中の :ref:`pymalloc メモリアロケータ ` また" +"は :ref:`mimalloc メモリアロケータ ` の統計情報を表示します。" -#: ../../using/cmdline.rst:1129 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without both ``pymalloc`` and ``mimalloc`` support." msgstr "" +":envvar:`PYTHONMALLOC` 環境変数を使って C ライブラリの :c:func:`malloc` アロ" +"ケータを強制的に使用している場合、または ``pymalloc`` と ``mimalloc`` の両方" +"のサポートを無効にして Python が構成されている場合は、この変数は無視されま" +"す。" -#: ../../using/cmdline.rst:1133 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" +"リリースモードでコンパイルされた Python でも、この変数を使用できるようになり" +"ました。\n" +"空文字列に設定した場合は、効果がなくなりました。" -#: ../../using/cmdline.rst:1140 msgid "" "If set to a non-zero integer, enable huge page support for :ref:`pymalloc " "` arenas. Set to ``0`` or unset to disable. Python must be " "compiled with :option:`--with-pymalloc-hugepages` for this variable to have " "any effect." msgstr "" +"ゼロ以外の整数を設定すると、:ref:`pymalloc ` アリーナのヒュージペー" +"ジのサポートを有効にします。\n" +"無効にするには、``0`` に設定するか、未設定にします。\n" +"この変数を有効にするには、:option:`--with-pymalloc-hugepages` を指定して " +"Python をコンパイルする必要があります。" -#: ../../using/cmdline.rst:1145 msgid "" "When enabled, arena allocation uses ``MAP_HUGETLB`` (Linux) or " "``MEM_LARGE_PAGES`` (Windows) with automatic fallback to regular pages if " "huge pages are not available." msgstr "" +"有効にすると、アリーナの割り当てに ``MAP_HUGETLB`` (Linux) または " +"``MEM_LARGE_PAGES`` (Windows) を使います。\n" +"ヒュージページが利用できない場合は、自動的に通常のページに切り替えます。" -#: ../../using/cmdline.rst:1151 msgid "" "On Linux, if the huge-page pool is exhausted, page faults — including copy-" "on-write faults triggered by :func:`os.fork` — deliver ``SIGBUS`` and kill " "the process. Only enable this in environments where the huge-page pool is " "properly sized and fork-safety is not a concern." msgstr "" +"Linux では、ヒュージページのプールが枯渇すると、:func:`os.fork` によって起き" +"るコピーオンライトのフォールトを含むページフォールトにより、``SIGBUS`` が送出" +"されてプロセスが終了します。\n" +"ヒュージページのプールのサイズが適切で、fork の安全性が問題にならない環境での" +"み有効にしてください。" -#: ../../using/cmdline.rst:1156 msgid "" "On Windows you need a special privilege. See the `Windows documentation for " "large pages `_ is not held by the user." msgstr "" +"Windows では、特別な権限が必要です。\n" +"詳細は `Windows のラージページのドキュメント `_ を参照してください。\n" +"必要な権限である `SeLockMemoryPrivilege `_ をユーザーが持っていない場" +"合、Python は起動に失敗します。" -#: ../../using/cmdline.rst:1169 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " "'replace', respectively. Otherwise, the new defaults 'utf-8' and " "'surrogatepass' are used." msgstr "" +"空でない文字列を設定すると、デフォルトの :term:`ファイルシステムのエンコー" +"ディングとエラーハンドラ ` のモード" +"が、3.6 より前の値である、それぞれ 'mbcs' と 'replace' に戻ります。\n" +"それ以外の場合は、新しいデフォルト値の 'utf-8' と 'surrogatepass' が使われま" +"す。" -#: ../../using/cmdline.rst:1174 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding`." msgstr "" +":func:`sys._enablelegacywindowsfsencoding` を使うと、実行時に有効にすることも" +"できます。" msgid "Availability" msgstr "利用可能な環境" @@ -1665,27 +1926,32 @@ msgstr "利用可能な環境" msgid "See :pep:`529` for more details." msgstr "より詳しくは :pep:`529` を参照してください。" -#: ../../using/cmdline.rst:1184 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" +"空でない文字列を設定すると、新しいコンソールの読み書き処理を使わなくなりま" +"す。\n" +"つまり、Unicode 文字は utf-8 ではなく、有効なコンソールコードページに従ってエ" +"ンコードされます。" -#: ../../using/cmdline.rst:1188 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" +"標準ストリームがコンソールバッファを参照せず、ファイルやパイプにリダイレクト" +"されている場合は、この変数は無視されます。" -#: ../../using/cmdline.rst:1198 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" +"値を ``0`` に設定すると、Python のメインのコマンドラインアプリケーションは、" +"従来の ASCII ベースの C および POSIX ロケールを、より機能の豊富な UTF-8 ベー" +"スのロケールに強制変換しなくなります。" -#: ../../using/cmdline.rst:1202 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1695,6 +1961,11 @@ msgid "" "``LC_CTYPE`` category in the order listed before loading the interpreter " "runtime:" msgstr "" +"この変数が *未設定* (または ``0`` 以外の値に設定されている) で、ロケールを上" +"書きする ``LC_ALL`` 環境変数も未設定であり、``LC_CTYPE`` カテゴリの現在のロ" +"ケールがデフォルトの ``C`` ロケールまたは明示的に ASCII ベースとされた " +"``POSIX`` ロケールの場合、Python CLI はインタープリタのランタイムを読み込む前" +"に、次のロケールを記載順に ``LC_CTYPE`` カテゴリに設定しようとします:" #: ../../using/cmdline.rst:1210 msgid "``C.UTF-8``" @@ -1708,7 +1979,6 @@ msgstr "``C.utf8``" msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:1214 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1720,8 +1990,16 @@ msgid "" "in operations that query the environment rather than the current C locale " "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" +"これらのロケールカテゴリのいずれかの設定に成功すると、Python ランタイムの初期" +"化前に、現在のプロセスの環境内の ``LC_CTYPE`` 環境変数にも同じ設定を適用しま" +"す。\n" +"これにより、更新された設定は、インタープリタ自体と、同じプロセス内で動作する" +"ロケールに対応したほかの構成要素 (GNU の ``readline`` ライブラリなど) の両方" +"に加えて、サブプロセスにも伝わります (そのプロセスが Python インタープリタを" +"実行しているかどうかは問いません)。\n" +"また、現在の C ロケールではなく環境を照会する操作 (Python 自体の :func:" +"`locale.getdefaultlocale` など) にも伝わります。" -#: ../../using/cmdline.rst:1224 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1730,16 +2008,25 @@ msgid "" "in any other locale). This stream handling behavior can be overridden using :" "envvar:`PYTHONIOENCODING` as usual." msgstr "" +"これらのロケールのいずれかを、明示的に、または上記の暗黙的なロケールの強制変" +"換によって設定すると、:data:`sys.stdin` と :data:`sys.stdout` に対して " +"``surrogateescape`` :ref:`エラーハンドラ ` が自動的に有効にな" +"ります (:data:`sys.stderr` は、ほかのロケールと同じく ``backslashreplace`` を" +"使い続けます)。\n" +"このストリームの処理方法は、通常と同様に :envvar:`PYTHONIOENCODING` で上書き" +"できます。" -#: ../../using/cmdline.rst:1231 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " "activates, or else if a locale that *would* have triggered coercion is still " "active when the Python runtime is initialized." msgstr "" +"デバッグのために ``PYTHONCOERCECLOCALE=warn`` を設定すると、ロケールの強制変" +"換が行われた場合、または強制変換の対象 *となるはずの* ロケールが Python ラン" +"タイムの初期化時にまだ有効だった場合に、Python は ``stderr`` に警告メッセージ" +"を出力します。" -#: ../../using/cmdline.rst:1236 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1747,44 +2034,53 @@ msgid "" "order to force the interpreter to use ``ASCII`` instead of ``UTF-8`` for " "system interfaces." msgstr "" +"ロケールの強制変換を無効にした場合や、適切な変換先のロケールが見つからなかっ" +"た場合でも、従来の ASCII ベースのロケールでは :envvar:`PYTHONUTF8` がデフォル" +"トで有効になる点にも注意してください。\n" +"システムインターフェースでインタープリタに ``UTF-8`` の代わりに ``ASCII`` を" +"使わせるには、両方の機能を無効にする必要があります。" #: ../../using/cmdline.rst:1244 msgid "See :pep:`538` for more details." msgstr "より詳しくは :pep:`538` を参照をしてください。" -#: ../../using/cmdline.rst:1250 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " "that are too expensive to be enabled by default. This is equivalent to " "setting the :option:`-X` ``dev`` option." msgstr "" +"空でない文字列を設定すると、:ref:`Python 開発モード ` が有効になり、" +"負荷が大きいためデフォルトでは有効にできない追加の実行時チェックを行いま" +"す。\n" +":option:`-X` ``dev`` オプションの設定と同じです。" -#: ../../using/cmdline.rst:1259 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "" +"``1`` を設定すると、:ref:`Python UTF-8 モード ` を有効にします。" -#: ../../using/cmdline.rst:1261 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "" +"``0`` を設定すると、:ref:`Python UTF-8 モード ` を無効にします。" -#: ../../using/cmdline.rst:1263 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" +"それ以外の空でない文字列を設定すると、インタープリタの初期化中にエラーが発生" +"します。" -#: ../../using/cmdline.rst:1270 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" +"空でない文字列を設定すると、ロケール固有のデフォルトのエンコーディングを使用" +"した場合に :class:`EncodingWarning` が発生します。" #: ../../using/cmdline.rst:1273 msgid "See :ref:`io-encoding-warning` for details." msgstr "詳細は :ref:`io-encoding-warning` を参照してください。" -#: ../../using/cmdline.rst:1279 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1792,57 +2088,71 @@ msgid "" "code objects and pyc files are desired as well as suppressing the extra " "visual location indicators when the interpreter displays tracebacks." msgstr "" +"設定すると、コードオブジェクトの各命令に追加の位置情報 (終了行、開始列のオフ" +"セット、終了列のオフセット) を対応付けるテーブルを含めないようにします。\n" +"これは、コードオブジェクトや pyc ファイルを小さくしたい場合や、インタープリタ" +"がトレースバックを表示する際に追加の位置を示す表示を抑制したい場合に役立ちま" +"す。" -#: ../../using/cmdline.rst:1289 msgid "" "If this variable is set to a nonzero value, it enables support for the Linux " "``perf`` profiler so Python calls can be detected by it." msgstr "" +"ゼロ以外の値を設定すると、Linux の ``perf`` プロファイラのサポートが有効にな" +"り、Python の呼び出しを検出できるようになります。" -#: ../../using/cmdline.rst:1292 ../../using/cmdline.rst:1305 msgid "If set to ``0``, disable Linux ``perf`` profiler support." msgstr "" +"``0`` を設定すると、Linux の ``perf`` プロファイラのサポートを無効にします。" -#: ../../using/cmdline.rst:1294 msgid "" "See also the :option:`-X perf <-X>` command-line option and :ref:" "`perf_profiling`." msgstr "" +":option:`-X perf <-X>` コマンドラインオプションと :ref:`perf_profiling` も参" +"照してください。" -#: ../../using/cmdline.rst:1301 msgid "" "If this variable is set to a nonzero value, it enables support for the Linux " "``perf`` profiler so Python calls can be detected by it using DWARF " "information." msgstr "" +"ゼロ以外の値を設定すると、Linux の ``perf`` プロファイラのサポートが有効にな" +"り、DWARF 情報を使って Python の呼び出しを検出できるようになります。" -#: ../../using/cmdline.rst:1307 msgid "" "See also the :option:`-X perf_jit <-X>` command-line option and :ref:" "`perf_profiling`." msgstr "" +":option:`-X perf_jit <-X>` コマンドラインオプションと :ref:`perf_profiling` " +"も参照してください。" -#: ../../using/cmdline.rst:1314 msgid "" "If this variable is set to a non-empty string, it disables the remote " "debugging feature described in :pep:`768`. This includes both the " "functionality to schedule code for execution in another process and the " "functionality to receive code for execution in the current process." msgstr "" +"空でない文字列を設定すると、:pep:`768` で説明されているリモートデバッグ機能を" +"無効にします。\n" +"これには、別のプロセスでのコード実行を予約する機能と、現在のプロセスで実行す" +"るコードを受け取る機能の両方が含まれます。" -#: ../../using/cmdline.rst:1319 msgid "See also the :option:`-X disable-remote-debug` command-line option." msgstr "" +":option:`-X disable-remote-debug` コマンドラインオプションも参照してくださ" +"い。" -#: ../../using/cmdline.rst:1325 msgid "" "If this variable is set to a positive integer, it overrides the return " "values of :func:`os.cpu_count` and :func:`os.process_cpu_count`." msgstr "" +"正の整数を設定すると、:func:`os.cpu_count` と :func:`os.process_cpu_count` の" +"戻り値を上書きします。" -#: ../../using/cmdline.rst:1328 msgid "See also the :option:`-X cpu_count <-X>` command-line option." msgstr "" +":option:`-X cpu_count <-X>` コマンドラインオプションも参照してください。" #: ../../using/cmdline.rst:1334 msgid "" @@ -1855,51 +2165,60 @@ msgid "" "flag is set to ``off``." msgstr "" -#: ../../using/cmdline.rst:1342 msgid "See also the :option:`-X frozen_modules <-X>` command-line option." msgstr "" +":option:`-X frozen_modules <-X>` コマンドラインオプションも参照してください。" -#: ../../using/cmdline.rst:1348 msgid "" "If this variable is set to ``1``, the interpreter will colorize various " "kinds of output. Setting it to ``0`` deactivates this behavior. See also :" "ref:`using-on-controlling-color`." msgstr "" +"``1`` を設定すると、インタープリタはさまざまな出力に色を付けます。\n" +"``0`` を設定すると、この動作を無効にします。\n" +":ref:`using-on-controlling-color` も参照してください。" -#: ../../using/cmdline.rst:1356 msgid "" "If this variable is set to any value, the interpreter will not attempt to " "load the Python-based :term:`REPL` that requires :mod:`readline`, and will " "instead use the traditional parser-based :term:`REPL`." msgstr "" +"何らかの値を設定すると、インタープリタは :mod:`readline` を必要とする Python " +"で実装された :term:`REPL` を読み込もうとせず、代わりに従来のパーサに基づく :" +"term:`REPL` を使用します。" -#: ../../using/cmdline.rst:1364 msgid "" "If this variable is set to any value, PyREPL will use :mod:`rlcompleter` to " "implement tab completion, instead of the default one which uses colors." msgstr "" +"何らかの値を設定すると、PyREPL は色を使うデフォルトのタブ補完の代わりに、:" +"mod:`rlcompleter` を使ってタブ補完を実装します。" -#: ../../using/cmdline.rst:1371 msgid "" "This environment variable can be used to set the location of a ``." "python_history`` file (by default, it is ``.python_history`` in the user's " "home directory)." msgstr "" +"この環境変数を使うと、``.python_history`` ファイルの場所を設定できます (デ" +"フォルトは、ユーザーのホームディレクトリ内の ``.python_history`` です)。" -#: ../../using/cmdline.rst:1379 msgid "" "If this variable is set to ``1``, the global interpreter lock (GIL) will be " "forced on. Setting it to ``0`` forces the GIL off (needs Python configured " "with the :option:`--disable-gil` build option)." msgstr "" +"``1`` を設定すると、グローバルインタープリタロック (GIL) を強制的に有効にしま" +"す。\n" +"``0`` を設定すると GIL を強制的に無効にします (:option:`--disable-gil` ビルド" +"オプションを指定して構成した Python が必要です)。" -#: ../../using/cmdline.rst:1383 msgid "" "See also the :option:`-X gil <-X>` command-line option, which takes " "precedence over this variable, and :ref:`whatsnew313-free-threaded-cpython`." msgstr "" +"この変数よりも優先される :option:`-X gil <-X>` コマンドラインオプションと、:" +"ref:`whatsnew313-free-threaded-cpython` も参照してください。" -#: ../../using/cmdline.rst:1390 msgid "" "If this variable is set to ``1`` then :class:`~threading.Thread` will, by " "default, use a copy of context of the caller of ``Thread.start()`` when " @@ -1907,50 +2226,71 @@ msgid "" "unset, this variable defaults to ``1`` on free-threaded builds and to ``0`` " "otherwise. See also :option:`-X thread_inherit_context<-X>`." msgstr "" +"``1`` を設定すると、:class:`~threading.Thread` はデフォルトで、``Thread." +"start()`` の呼び出し元のコンテキストのコピーを使ってスレッドを開始します。\n" +"それ以外の場合、新しいスレッドは空のコンテキストで開始します。\n" +"未設定の場合、この変数のデフォルト値は、フリースレッドビルドでは ``1``、それ" +"以外では ``0`` です。\n" +":option:`-X thread_inherit_context<-X>` も参照してください。" -#: ../../using/cmdline.rst:1400 msgid "" "If set to ``1`` then the :class:`warnings.catch_warnings` context manager " "will use a :class:`~contextvars.ContextVar` to store warnings filter state. " "If unset, this variable defaults to ``1`` on free-threaded builds and to " "``0`` otherwise. See :option:`-X context_aware_warnings<-X>`." msgstr "" +"``1`` を設定すると、:class:`warnings.catch_warnings` コンテキストマネージャ" +"は、警告フィルタの状態の保存に :class:`~contextvars.ContextVar` を使いま" +"す。\n" +"未設定の場合、この変数のデフォルト値は、フリースレッドビルドでは ``1``、それ" +"以外では ``0`` です。\n" +":option:`-X context_aware_warnings<-X>` を参照してください。" -#: ../../using/cmdline.rst:1410 msgid "" "If true (``1``) then :ref:`sys-path-init` is allowed to log warnings into " "stderr. If false (``0``) suppress these warnings. Set to true by default. " "See also :option:`-X pathconfig_warnings<-X>`." msgstr "" +"真 (``1``) の場合、:ref:`sys-path-init` の際に stderr に警告を出力できま" +"す。\n" +"偽 (``0``) の場合は、これらの警告を抑制します。\n" +"デフォルトでは真に設定されます。\n" +":option:`-X pathconfig_warnings<-X>` も参照してください。" -#: ../../using/cmdline.rst:1418 msgid "" "On builds where experimental just-in-time compilation is available, this " "variable can force the JIT to be disabled (``0``) or enabled (``1``) at " "interpreter startup." msgstr "" +"実験的な実行時コンパイルを利用できるビルドでは、この変数によってインタープリ" +"タの起動時に JIT を強制的に無効 (``0``) または有効 (``1``) にできます。" -#: ../../using/cmdline.rst:1426 msgid "" "If set to ``1`` enables thread-local bytecode. If set to ``0`` thread-local " "bytecode and the specializing interpreter are disabled. Only applies to " "builds configured with :option:`--disable-gil`." msgstr "" +"``1`` を設定すると、スレッドローカルなバイトコードを有効にします。\n" +"``0`` を設定すると、スレッドローカルなバイトコードと特殊化インタープリタを無" +"効にします。\n" +":option:`--disable-gil` を指定して構成したビルドでのみ適用されます。" -#: ../../using/cmdline.rst:1430 msgid "See also the :option:`-X tlbc <-X>` command-line option." -msgstr "" +msgstr ":option:`-X tlbc <-X>` コマンドラインオプションも参照してください。" -#: ../../using/cmdline.rst:1436 msgid "" "Controls lazy import behavior. Accepts two values: ``all`` makes all imports " "lazy by default, and ``normal`` (the default) respects the ``lazy`` keyword " "in source code." msgstr "" +"遅延インポートの挙動を制御します。\n" +"2 つの値を受け付けます。\n" +"``all`` ではすべてのインポートをデフォルトで遅延させ、``normal`` (デフォル" +"ト) ではソースコード内の ``lazy`` キーワードに従います。" -#: ../../using/cmdline.rst:1440 msgid "See also the :option:`-X lazy_imports <-X>` command-line option." msgstr "" +":option:`-X lazy_imports <-X>` コマンドラインオプションも参照してください。" #: ../../using/cmdline.rst:1445 msgid "Debug-mode variables" @@ -1964,42 +2304,50 @@ msgstr "" "設定された場合、 Python はインタプリタのシャットダウン後に残っているオブジェ" "クトと参照カウントをダンプします。" -#: ../../using/cmdline.rst:1452 ../../using/cmdline.rst:1460 msgid "" "Needs Python configured with the :option:`--with-trace-refs` build option." msgstr "" +":option:`--with-trace-refs` ビルドオプションを指定して構成した Python が必要" +"です。" -#: ../../using/cmdline.rst:1456 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file under the path given as the value " "to this environment variable." msgstr "" +"設定すると、Python はインタープリタのシャットダウン後にも残っているオブジェク" +"トと参照カウントを、この環境変数の値で指定したパスのファイルにダンプします。" -#: ../../using/cmdline.rst:1466 msgid "" "If this variable is set to a module, that module will be imported early in " "the interpreter lifecycle, before the :mod:`site` module is executed, and " "before the :mod:`__main__` module is created. Therefore, the imported module " "is not treated as :mod:`__main__`." msgstr "" +"モジュールを設定すると、インタープリタのライフサイクルの早い段階、つまり :" +"mod:`site` モジュールの実行前、かつ :mod:`__main__` モジュールの作成前に、そ" +"のモジュールをインポートします。\n" +"したがって、インポートされたモジュールは :mod:`__main__` として扱われません。" -#: ../../using/cmdline.rst:1471 msgid "This can be used to execute code early during Python initialization." msgstr "" +"これは、Python の初期化の早い段階でコードを実行するために使用できます。" -#: ../../using/cmdline.rst:1473 msgid "" "To import a submodule, use ``package.module`` as the value, like in an " "import statement." msgstr "" +"サブモジュールをインポートするには、import 文と同様に、値として ``package." +"module`` を指定します。" -#: ../../using/cmdline.rst:1476 msgid "" "See also the :option:`-X presite <-X>` command-line option, which takes " "precedence over this variable." msgstr "" +"この変数よりも優先される :option:`-X presite <-X>` コマンドラインオプションも" +"参照してください。" -#: ../../using/cmdline.rst:1479 msgid "Needs Python configured with the :option:`--with-pydebug` build option." msgstr "" +":option:`--with-pydebug` ビルドオプションを指定して構成した Python が必要で" +"す。" diff --git a/using/configure.po b/using/configure.po index ec117cda6..356f4bc7c 100644 --- a/using/configure.po +++ b/using/configure.po @@ -68,57 +68,67 @@ msgstr "スレッドのサポート。" msgid "On Windows, Visual Studio 2015 or later is now required." msgstr "Windows では、 Visual Studio 2015 以降が必要となりました。" -#: ../../using/configure.rst:31 msgid "" "Selected C99 features, like ```` and ``static inline`` functions, " "are now required." msgstr "" +"```` や ``static inline`` 関数など、C99 の一部の機能が必須となりま" +"した。" -#: ../../using/configure.rst:35 msgid "Thread support is now required." -msgstr "" +msgstr "スレッドのサポートが必須となりました。" -#: ../../using/configure.rst:38 msgid "" "C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " "Studio 2017 or later is required." msgstr "" +"C11 コンパイラ、IEEE 754 および NaN のサポートが必須となりました。\n" +"Windows では Visual Studio 2017 以降が必要です。" -#: ../../using/configure.rst:42 msgid "" "See also :pep:`7` \"Style Guide for C Code\" and :pep:`11` \"CPython " "platform support\"." msgstr "" +":pep:`7` 「Style Guide for C Code」と :pep:`11` 「CPython platform support」" +"も参照してください。" #: ../../using/configure.rst:49 msgid "Requirements for optional modules" msgstr "オプションのモジュールの要件" -#: ../../using/configure.rst:51 msgid "" "Some :term:`optional modules ` of the standard library " "require third-party libraries installed for development (for example, header " "files must be available)." msgstr "" +"標準ライブラリの一部の :term:`オプションモジュール ` には、" +"開発用にインストールされたサードパーティライブラリが必要です (例えば、ヘッ" +"ダーファイルが利用可能でなければなりません)。" -#: ../../using/configure.rst:55 msgid "" "Missing requirements are reported in the ``configure`` output. Modules that " "are missing due to missing dependencies are listed near the end of the " "``make`` output, sometimes using an internal name, for example, ``_ctypes`` " "for :mod:`ctypes` module." msgstr "" +"不足している要件は ``configure`` の出力に表示されます。\n" +"依存関係の不足により利用できないモジュールは、``make`` の出力の終わり近くに一" +"覧表示されます。\n" +"このとき、:mod:`ctypes` モジュールに対する ``_ctypes`` のように、内部名が使わ" +"れることがあります。" -#: ../../using/configure.rst:61 msgid "" "If you distribute a CPython interpreter without optional modules, it's best " "practice to advise users, who generally expect that standard library modules " "are available." msgstr "" +"オプションモジュールを含まない CPython インタープリタを配布する場合は、その旨" +"をユーザーに知らせることを推奨します。\n" +"通常、ユーザーは標準ライブラリのモジュールを利用できると期待しているためで" +"す。" -#: ../../using/configure.rst:65 msgid "Dependencies to build optional modules are:" -msgstr "" +msgstr "オプションモジュールのビルドに必要な依存関係は次のとおりです:" #: ../../using/configure.rst:71 msgid "Dependency" @@ -204,9 +214,8 @@ msgstr ":mod:`curses`" msgid "`OpenSSL `_" msgstr "`OpenSSL `_" -#: ../../using/configure.rst:97 msgid "[6]_" -msgstr "" +msgstr "[6]_" #: ../../using/configure.rst:98 msgid ":mod:`ssl`, :mod:`hashlib` [5]_" @@ -260,30 +269,37 @@ msgstr "1.4.5" msgid ":mod:`compression.zstd`" msgstr ":mod:`compression.zstd`" -#: ../../using/configure.rst:112 msgid "" "If *libmpdec* is not available, the :mod:`decimal` module will use a pure-" "Python implementation. See :option:`--with-system-libmpdec` for details." msgstr "" +"*libmpdec* が利用できない場合、:mod:`decimal` モジュールは純粋な Python によ" +"る実装を使用します。\n" +"詳しくは :option:`--with-system-libmpdec` を参照してください。" -#: ../../using/configure.rst:115 msgid "" "See :option:`--with-readline` for choosing the backend for the :mod:" "`readline` module." msgstr "" +":mod:`readline` モジュールのバックエンドの選択については、:option:`--with-" +"readline` を参照してください。" -#: ../../using/configure.rst:117 msgid "" "The :mod:`uuid` module uses ``_uuid`` to generate \"safe\" UUIDs. See the " "module documentation for details." msgstr "" +":mod:`uuid` モジュールは「安全な」UUID の生成に ``_uuid`` を使用します。\n" +"詳しくはモジュールのドキュメントを参照してください。" -#: ../../using/configure.rst:119 msgid "" "The :mod:`curses` module requires the ``libncurses`` or ``libncursesw`` " "library. The :mod:`curses.panel` module additionally requires the " "``libpanel`` or ``libpanelw`` library." msgstr "" +":mod:`curses` モジュールには ``libncurses`` または ``libncursesw`` ライブラリ" +"が必要です。\n" +":mod:`curses.panel` モジュールには、さらに ``libpanel`` または ``libpanelw`` " +"ライブラリが必要です。" #: ../../using/configure.rst:123 msgid "" @@ -292,7 +308,6 @@ msgid "" "hashlib-hashes` for *forcing* usage of OpenSSL." msgstr "" -#: ../../using/configure.rst:126 msgid "" "OpenSSL 1.1.1 is the minimum possible version to build against, but the " "series is end-of-life and no longer receives public security fixes. Use the " @@ -302,38 +317,48 @@ msgid "" "that offer an API compatible with OpenSSL 1.1.1 or later may work, but are " "not officially supported." msgstr "" +"ビルドに使用できる OpenSSL の最小バージョンは 1.1.1 ですが、この系列はサポー" +"トが終了しており、セキュリティ修正は公開されなくなっています。\n" +"現在サポートされている LTS リリース系列の最新のパッチリリース (`OpenSSL ロー" +"ドマップ `__ を参照)、または" +"利用可能であれば OS が提供するパッケージを使用してください。\n" +"OpenSSL 1.1.1 以降と互換性のある API を提供するほかのライブラリも動作する可能" +"性がありますが、正式にはサポートされていません。" -#: ../../using/configure.rst:135 msgid "" "Note that the table does not include all optional modules; in particular, " "platform-specific modules like :mod:`winreg` are not listed here." msgstr "" +"この表には、すべてのオプションモジュールが含まれているわけではありません。\n" +"特に、:mod:`winreg` のようなプラットフォーム固有のモジュールは記載していませ" +"ん。" -#: ../../using/configure.rst:140 msgid "" "The `devguide `_ includes a full list of dependencies required to " "build all modules and instructions on how to install them on common " "platforms." msgstr "" +"`開発者ガイド `_ には、すべてのモジュールのビルドに必要な依存関係の一" +"覧と、一般的なプラットフォームでのインストール手順が記載されています。" -#: ../../using/configure.rst:143 msgid "" ":option:`--with-system-expat` allows building with an external `libexpat " "`_ library." msgstr "" +":option:`--with-system-expat` を指定すると、外部の `libexpat `_ ライブラリを使用してビルドできます。" -#: ../../using/configure.rst:145 msgid ":ref:`configure-options-for-dependencies`" -msgstr "" +msgstr ":ref:`configure-options-for-dependencies`" #: ../../using/configure.rst:147 msgid "Tcl/Tk version 8.3.1 is now required for :mod:`tkinter`." msgstr ":mod:`tkinter` には Tcl/Tk バージョン 8.3.1 が必要となりました。" -#: ../../using/configure.rst:150 msgid "Tcl/Tk version 8.4 is now required for :mod:`tkinter`." -msgstr ":mod:`tkinter` には Tck/Tk バージョン 8.4 が必要となりました。" +msgstr ":mod:`tkinter` には Tcl/Tk バージョン 8.4 が必要となりました。" #: ../../using/configure.rst:153 msgid "OpenSSL 1.0.2 is now required for :mod:`hashlib` and :mod:`ssl`." @@ -359,11 +384,13 @@ msgstr ":mod:`sqlite3` にはSQLite 3.15.2 が必要となりました。" msgid "Generated files" msgstr "生成されるファイル" -#: ../../using/configure.rst:170 msgid "" "To reduce build dependencies, Python source code contains multiple generated " "files. Commands to regenerate all generated files::" msgstr "" +"ビルドの依存関係を減らすため、Python のソースコードには生成済みのファイルが複" +"数含まれています。\n" +"生成済みファイルをすべて再生成するコマンドは次のとおりです。 ::" #: ../../using/configure.rst:173 msgid "" @@ -377,33 +404,39 @@ msgstr "" "make regen-limited-abi\n" "make regen-configure" -#: ../../using/configure.rst:178 msgid "" "The ``Makefile.pre.in`` file documents generated files, their inputs, and " "tools used to regenerate them. Search for ``regen-*`` make targets." msgstr "" +"``Makefile.pre.in`` ファイルには、生成されるファイル、その入力、および再生成" +"に使用するツールが記載されています。\n" +"``regen-*`` という make ターゲットを検索してください。" #: ../../using/configure.rst:182 msgid "configure script" msgstr "構成スクリプト" -#: ../../using/configure.rst:184 msgid "" "The ``make regen-configure`` command regenerates the ``aclocal.m4`` file and " "the ``configure`` script using the ``Tools/build/regen-configure.sh`` shell " "script which uses an Ubuntu container to get the same tools versions and " "have a reproducible output." msgstr "" +"``make regen-configure`` コマンドは、``Tools/build/regen-configure.sh`` シェ" +"ルスクリプトを使って ``aclocal.m4`` ファイルと ``configure`` スクリプトを再生" +"成します。\n" +"このシェルスクリプトは、ツールのバージョンを揃えて再現可能な出力を得るために " +"Ubuntu コンテナを使用します。" -#: ../../using/configure.rst:189 msgid "The container is optional, the following command can be run locally::" msgstr "" +"コンテナの使用は必須ではなく、次のコマンドをローカルで実行することもできま" +"す。 ::" #: ../../using/configure.rst:191 msgid "autoreconf -ivf -Werror" msgstr "autoreconf -ivf -Werror" -#: ../../using/configure.rst:193 msgid "" "The generated files can change depending on the exact versions of the tools " "used. The container that CPython uses has `Autoconf `_ 1.16.5, and `pkg-config `_ 1.8.1." msgstr "" +"生成されるファイルは、使用するツールの細かなバージョンの違いによって変わるこ" +"とがあります。\n" +"CPython が使用するコンテナには、`Autoconf `_ 2.72、`Automake `_ 1.16.5 " +"に含まれる ``aclocal``、および `pkg-config `_ 1.8.1 がインストールされています。" -#: ../../using/configure.rst:200 msgid "" "Autoconf 2.71 and aclocal 1.16.5 and are now used to regenerate :file:" "`configure`." msgstr "" +":file:`configure` の再生成に Autoconf 2.71 と aclocal 1.16.5 を使用するように" +"なりました。" -#: ../../using/configure.rst:204 msgid "Autoconf 2.72 is now used to regenerate :file:`configure`." msgstr "" +":file:`configure` の再生成に Autoconf 2.72 を使用するようになりました。" #: ../../using/configure.rst:211 msgid "Configure Options" @@ -447,11 +487,12 @@ msgstr "" msgid "General Options" msgstr "一般的なオプション" -#: ../../using/configure.rst:224 msgid "" "Support loadable extensions in the :mod:`!_sqlite` extension module (default " "is no) of the :mod:`sqlite3` module." msgstr "" +":mod:`sqlite3` モジュールの :mod:`!_sqlite` 拡張モジュールで、ロード可能な拡" +"張機能をサポートします (デフォルトでは無効)。" #: ../../using/configure.rst:227 msgid "" @@ -504,22 +545,20 @@ msgstr "" "html`` 、 WASI では ``.wasm`` 、その他のプラットフォームでは空文字列になりま" "す ( ``python`` 実行ファイル)。" -#: ../../using/configure.rst:256 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "" -"WASM プラットフォームのデフォルトの接頭辞は、 ``.js`` 、 ``.html`` 、 ``." -"wasm`` のうちの1つです。" +"WASM プラットフォームのデフォルトの接尾辞は、``.js``、``.html``、``.wasm`` の" +"いずれかです。" -#: ../../using/configure.rst:262 msgid "" "Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" -"デフォルトのタイムゾーン検索パスを :const:`zoneinfo.TZPATH` に設定します。:" -"mod:`zoneinfo` モジュールの :ref:`Compile-time configuration " +":const:`zoneinfo.TZPATH` のデフォルトのタイムゾーン検索パスを選択します。\n" +":mod:`zoneinfo` モジュールの :ref:`コンパイル時の構成 " "` を参照してください。" #: ../../using/configure.rst:266 @@ -577,9 +616,8 @@ msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" "UTF-8 ベースのロケールへの C ロケールの強制を無効にします(デフォルトで有効)。" -#: ../../using/configure.rst:295 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." -msgstr "``PY_COERCE_C_LOCALE`` マクロは定義しないでください。" +msgstr "``PY_COERCE_C_LOCALE`` マクロを定義しません。" #: ../../using/configure.rst:297 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." @@ -605,17 +643,17 @@ msgstr "" ":mod:`ensurepip` モジュールが使用する wheel パッケージのディレクトリです(デ" "フォルトはなし)。" -#: ../../using/configure.rst:314 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" "share/python-wheels/`` directory and don't install the :mod:`!ensurepip." "_bundled` package." msgstr "" -"Linux ディストリビューションのパッケージングポリシーの中には、依存関係をバン" -"ドルすることを推奨しているものがあります。例えば、 Fedora は wheel パッケージ" -"を ``/usr/share/python-wheels/`` ディレクトリにインストールし、 :mod:`!" -"ensurepip._bundled` パッケージはインストールしません。" +"Linux ディストリビューションのパッケージングポリシーの中には、依存関係を同梱" +"しないことを推奨するものがあります。\n" +"例えば、Fedora は wheel パッケージを ``/usr/share/python-wheels/`` ディレクト" +"リにインストールし、:mod:`!ensurepip._bundled` パッケージはインストールしませ" +"ん。" #: ../../using/configure.rst:323 msgid "" @@ -638,29 +676,36 @@ msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "" "``no`` : :program:`pkg-config` が存在しても、 configure は使用しません。" -#: ../../using/configure.rst:334 msgid "" "Path to a `JSON `_ configuration file " "containing custom error messages for missing :term:`standard library` " "modules." msgstr "" +"不足している :term:`標準ライブラリ ` モジュールに対するカス" +"タムエラーメッセージを含む `JSON `_ 構成" +"ファイルへのパス。" -#: ../../using/configure.rst:337 msgid "" "This option is intended for Python distributors who wish to provide " "distribution-specific guidance when users encounter standard library modules " "that are missing or packaged separately." msgstr "" +"このオプションは、標準ライブラリのモジュールが欠けている場合や別途パッケージ" +"化されている場合に、ディストリビューション固有の案内をユーザーに示したい " +"Python 配布者を対象としています。" -#: ../../using/configure.rst:341 msgid "" "The JSON file should map missing module names to custom error message " "strings. For example, if your distribution packages :mod:`tkinter` and :mod:" "`_tkinter` separately and excludes :mod:`!_gdbm` for legal reasons, the " "configuration could contain:" msgstr "" +"JSON ファイルでは、不足しているモジュール名をカスタムエラーメッセージの文字列" +"に対応付けます。\n" +"例えば、ディストリビューションで :mod:`tkinter` と :mod:`_tkinter` を別々に" +"パッケージ化し、法的な理由で :mod:`!_gdbm` を除外している場合、次のように構成" +"できます:" -#: ../../using/configure.rst:346 msgid "" "{\n" " \"_gdbm\": \"The '_gdbm' module is not available in this " @@ -669,67 +714,68 @@ msgid "" " \"_tkinter\": \"Install the python-tk package to use tkinter\",\n" "}" msgstr "" +"{\n" +" \"_gdbm\": \"The '_gdbm' module is not available in this " +"distribution\",\n" +" \"tkinter\": \"Install the python-tk package to use tkinter\",\n" +" \"_tkinter\": \"Install the python-tk package to use tkinter\",\n" +"}" -#: ../../using/configure.rst:358 msgid "Turn on internal Python performance statistics gathering." -msgstr "" +msgstr "Python 内部のパフォーマンス統計の収集を有効にします。" -#: ../../using/configure.rst:360 msgid "" "By default, statistics gathering is off. Use ``python3 -X pystats`` command " "or set ``PYTHONSTATS=1`` environment variable to turn on statistics " "gathering at Python startup." msgstr "" +"デフォルトでは統計の収集は無効です。\n" +"Python 起動時に統計の収集を有効にするには、``python3 -X pystats`` コマンドを" +"使用するか、環境変数 ``PYTHONSTATS=1`` を設定してください。" -#: ../../using/configure.rst:364 msgid "" "At Python exit, dump statistics if statistics gathering was on and not " "cleared." msgstr "" +"統計の収集が有効で、統計がクリアされていなければ、Python の終了時に統計を出力" +"します。" -#: ../../using/configure.rst:367 ../../using/configure.rst:962 msgid "Effects:" -msgstr "" +msgstr "効果:" -#: ../../using/configure.rst:369 msgid "Add :option:`-X pystats <-X>` command line option." -msgstr "" +msgstr ":option:`-X pystats <-X>` コマンドラインオプションを追加します。" -#: ../../using/configure.rst:370 msgid "Add :envvar:`!PYTHONSTATS` environment variable." -msgstr "" +msgstr ":envvar:`!PYTHONSTATS` 環境変数を追加します。" -#: ../../using/configure.rst:371 msgid "Define the ``Py_STATS`` macro." -msgstr "" +msgstr "``Py_STATS`` マクロを定義します。" -#: ../../using/configure.rst:372 msgid "Add functions to the :mod:`sys` module:" -msgstr "" +msgstr ":mod:`sys` モジュールに関数を追加します:" -#: ../../using/configure.rst:374 msgid ":func:`!sys._stats_on`: Turns on statistics gathering." -msgstr "" +msgstr ":func:`!sys._stats_on`: 統計の収集を有効にします。" -#: ../../using/configure.rst:375 msgid ":func:`!sys._stats_off`: Turns off statistics gathering." -msgstr "" +msgstr ":func:`!sys._stats_off`: 統計の収集を無効にします。" -#: ../../using/configure.rst:376 msgid ":func:`!sys._stats_clear`: Clears the statistics." -msgstr "" +msgstr ":func:`!sys._stats_clear`: 統計をクリアします。" -#: ../../using/configure.rst:377 msgid "" ":func:`!sys._stats_dump`: Dump statistics to file, and clears the statistics." -msgstr "" +msgstr ":func:`!sys._stats_dump`: 統計をファイルに出力し、統計をクリアします。" -#: ../../using/configure.rst:379 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" "tmp/py_stats/`` (Unix) or ``C:\\temp\\py_stats\\`` (Windows). If that " "directory does not exist, results will be printed on stderr." msgstr "" +"統計は、``/tmp/py_stats/`` (Unix) または ``C:\\temp\\py_stats\\`` (Windows) " +"の任意の (おそらく一意な) ファイルに出力されます。\n" +"このディレクトリが存在しない場合、結果は標準エラー出力に出力されます。" #: ../../using/configure.rst:383 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." @@ -740,176 +786,164 @@ msgstr "" msgid "Statistics:" msgstr "統計:" -#: ../../using/configure.rst:387 msgid "Opcode:" -msgstr "" +msgstr "命令コード:" -#: ../../using/configure.rst:389 msgid "Specialization: success, failure, hit, deferred, miss, deopt, failures;" -msgstr "" +msgstr "特殊化: 成功、失敗、ヒット、延期、ミス、特殊化解除、失敗の内訳;" -#: ../../using/configure.rst:390 msgid "Execution count;" -msgstr "" +msgstr "実行回数;" -#: ../../using/configure.rst:391 msgid "Pair count." -msgstr "" +msgstr "命令コードのペアの実行回数。" -#: ../../using/configure.rst:393 msgid "Call:" -msgstr "" +msgstr "呼び出し:" -#: ../../using/configure.rst:395 msgid "Inlined Python calls;" -msgstr "" +msgstr "インライン化された Python 呼び出し;" -#: ../../using/configure.rst:396 msgid "PyEval calls;" -msgstr "" +msgstr "PyEval 呼び出し;" -#: ../../using/configure.rst:397 msgid "Frames pushed;" -msgstr "" +msgstr "プッシュされたフレーム;" -#: ../../using/configure.rst:398 msgid "Frame object created;" -msgstr "" +msgstr "作成されたフレームオブジェクト;" -#: ../../using/configure.rst:399 msgid "" "Eval calls: vector, generator, legacy, function VECTORCALL, build class, " "slot, function \"ex\", API, method." msgstr "" +"評価呼び出し: vector、generator、legacy、function VECTORCALL、build class、" +"slot、function \"ex\"、API、method。" -#: ../../using/configure.rst:402 msgid "Object:" -msgstr "" +msgstr "オブジェクト:" -#: ../../using/configure.rst:404 msgid "incref and decref;" -msgstr "" +msgstr "incref と decref;" -#: ../../using/configure.rst:405 msgid "interpreter incref and decref;" -msgstr "" +msgstr "インタープリタによる incref と decref;" -#: ../../using/configure.rst:406 msgid "allocations: all, 512 bytes, 4 kiB, big;" -msgstr "" +msgstr "割り当て: すべて、512 バイト、4 kiB、大容量;" -#: ../../using/configure.rst:407 msgid "free;" -msgstr "" +msgstr "解放;" -#: ../../using/configure.rst:408 msgid "to/from free lists;" -msgstr "" +msgstr "フリーリストへの追加とフリーリストからの取得;" -#: ../../using/configure.rst:409 msgid "dictionary materialized/dematerialized;" -msgstr "" +msgstr "辞書の実体化と実体化の解除;" -#: ../../using/configure.rst:410 msgid "type cache;" -msgstr "" +msgstr "型キャッシュ;" -#: ../../using/configure.rst:411 msgid "optimization attempts;" -msgstr "" +msgstr "最適化の試行;" -#: ../../using/configure.rst:412 msgid "optimization traces created/executed;" -msgstr "" +msgstr "作成された最適化トレースと実行された最適化トレース;" -#: ../../using/configure.rst:413 msgid "uops executed." -msgstr "" +msgstr "実行された uop。" -#: ../../using/configure.rst:415 msgid "Garbage collector:" -msgstr "" +msgstr "ガベージコレクタ:" -#: ../../using/configure.rst:417 msgid "Garbage collections;" -msgstr "" +msgstr "ガベージコレクション;" -#: ../../using/configure.rst:418 msgid "Objects visited;" -msgstr "" +msgstr "走査したオブジェクト;" -#: ../../using/configure.rst:419 msgid "Objects collected." -msgstr "" +msgstr "回収したオブジェクト。" -#: ../../using/configure.rst:430 msgid "" "Enables support for running Python without the :term:`global interpreter " "lock` (GIL): :term:`free-threaded build`." msgstr "" +":term:`グローバルインタープリタロック ` (GIL) を使用" +"せずに Python を実行できるようにします (:term:`フリースレッドビルド `)。" -#: ../../using/configure.rst:433 msgid "" "Defines the ``Py_GIL_DISABLED`` macro and adds ``\"t\"`` to :data:`sys." "abiflags`." msgstr "" +"``Py_GIL_DISABLED`` マクロを定義し、:data:`sys.abiflags` に ``\"t\"`` を追加" +"します。" -#: ../../using/configure.rst:436 msgid "See :ref:`whatsnew313-free-threaded-cpython` for more detail." -msgstr "" +msgstr "詳しくは :ref:`whatsnew313-free-threaded-cpython` を参照してください。" -#: ../../using/configure.rst:442 msgid "" "Indicate how to integrate the :ref:`experimental just-in-time compiler " "`." msgstr "" +":ref:`実験的なジャストインタイムコンパイラ ` の組み" +"込み方法を指定します。" -#: ../../using/configure.rst:444 msgid "``no``: Don't build the JIT." -msgstr "" +msgstr "``no``: JIT をビルドしません。" -#: ../../using/configure.rst:445 msgid "" "``yes``: Enable the JIT. To disable it at runtime, set the environment " "variable :envvar:`PYTHON_JIT=0 `." msgstr "" +"``yes``: JIT を有効にします。\n" +"実行時に無効にするには、環境変数 :envvar:`PYTHON_JIT=0 ` を設定し" +"てください。" -#: ../../using/configure.rst:447 msgid "" "``yes-off``: Build the JIT, but disable it by default. To enable it at " "runtime, set the environment variable :envvar:`PYTHON_JIT=1 `." msgstr "" +"``yes-off``: JIT をビルドしますが、デフォルトでは無効にします。\n" +"実行時に有効にするには、環境変数 :envvar:`PYTHON_JIT=1 ` を設定し" +"てください。" -#: ../../using/configure.rst:449 msgid "" "``interpreter``: Enable the \"JIT interpreter\" (only useful for those " "debugging the JIT itself). To disable it at runtime, set the environment " "variable :envvar:`PYTHON_JIT=0 `." msgstr "" +"``interpreter``: 「JIT インタープリタ」を有効にします (JIT 自体をデバッグする" +"場合にのみ有用です)。\n" +"実行時に無効にするには、環境変数 :envvar:`PYTHON_JIT=0 ` を設定し" +"てください。" -#: ../../using/configure.rst:453 msgid "" "``--enable-experimental-jit=no`` is the default behavior if the option is " "not provided, and ``--enable-experimental-jit`` is shorthand for ``--enable-" "experimental-jit=yes``. See :file:`Tools/jit/README.md` for more " "information, including how to install the necessary build-time dependencies." msgstr "" +"オプションを指定しない場合のデフォルトの動作は ``--enable-experimental-" +"jit=no`` で、``--enable-experimental-jit`` は ``--enable-experimental-" +"jit=yes`` の省略形です。\n" +"ビルド時に必要な依存関係のインストール方法など、詳しくは :file:`Tools/jit/" +"README.md` を参照してください。" -#: ../../using/configure.rst:460 msgid "" "When building CPython with JIT enabled, ensure that your system has Python " "3.11 or later installed." msgstr "" +"JIT を有効にして CPython をビルドする場合は、システムに Python 3.11 以降がイ" +"ンストールされていることを確認してください。" -#: ../../using/configure.rst:466 msgid "Path to ``pkg-config`` utility." -msgstr "" +msgstr "``pkg-config`` ユーティリティへのパス。" -#: ../../using/configure.rst:471 msgid "``pkg-config`` options." -msgstr "" +msgstr "``pkg-config`` のオプション。" -#: ../../using/configure.rst:475 msgid "" "Build without ``epoll``, meaning that :py:func:`select.epoll` will not be " "present even if the system provides an :manpage:`epoll_create " @@ -917,6 +951,12 @@ msgid "" "epoll_create` or :manpage:`epoll_create1 ` is available " "but incompatible with Linux semantics." msgstr "" +"``epoll`` を使用せずにビルドします。\n" +"システムが :manpage:`epoll_create ` 関数を提供していても、:" +"py:func:`select.epoll` は利用できなくなります。\n" +"この設定は、:manpage:`!epoll_create` または :manpage:`epoll_create1 " +"` が利用できるものの、Linux の動作とは互換性がないシステム" +"で使用できます。" #: ../../using/configure.rst:486 msgid "C compiler options" @@ -958,95 +998,121 @@ msgstr "マシン依存のライブラリファイルの名前。" msgid "Options for third-party dependencies" msgstr "サードパーティ依存関係のオプション" -#: ../../using/configure.rst:531 msgid "" "C compiler and linker flags to link Python to ``libbz2``, used by :mod:`bz2` " "module, overriding ``pkg-config``." msgstr "" +":mod:`bz2` モジュールで使用する ``libbz2`` に Python をリンクするための C コ" +"ンパイラとリンカのフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:537 msgid "" "C compiler and linker flags for ``libncurses`` or ``libncursesw``, used by :" "mod:`curses` module, overriding ``pkg-config``." msgstr "" +":mod:`curses` モジュールで使用する ``libncurses`` または ``libncursesw`` 用" +"の C コンパイラとリンカのフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:543 msgid "C compiler and linker flags for ``gdbm``." -msgstr "" +msgstr "``gdbm`` 用の C コンパイラとリンカのフラグ。" -#: ../../using/configure.rst:548 msgid "" "C compiler and linker flags for ``libedit``, used by :mod:`readline` module, " "overriding ``pkg-config``." msgstr "" +":mod:`readline` モジュールで使用する ``libedit`` 用の C コンパイラとリンカの" +"フラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:554 msgid "" "C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module, " "overriding ``pkg-config``." msgstr "" +":mod:`ctypes` モジュールで使用する ``libffi`` 用の C コンパイラとリンカのフラ" +"グ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:560 msgid "" "C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module, " "overriding ``pkg-config``." msgstr "" +":mod:`decimal` モジュールで使用する ``libmpdec`` 用の C コンパイラとリンカの" +"フラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:565 msgid "" "These environment variables have no effect unless :option:`--with-system-" "libmpdec` is specified." msgstr "" +":option:`--with-system-libmpdec` を指定しない限り、これらの環境変数は効果があ" +"りません。" -#: ../../using/configure.rst:571 msgid "" "C compiler and linker flags for ``liblzma``, used by :mod:`lzma` module, " "overriding ``pkg-config``." msgstr "" +":mod:`lzma` モジュールで使用する ``liblzma`` 用の C コンパイラとリンカのフラ" +"グ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:577 msgid "" "C compiler and linker flags for ``libreadline``, used by :mod:`readline` " "module, overriding ``pkg-config``." msgstr "" +":mod:`readline` モジュールで使用する ``libreadline`` 用の C コンパイラとリン" +"カのフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:583 msgid "" "C compiler and linker flags for ``libsqlite3``, used by :mod:`sqlite3` " "module, overriding ``pkg-config``." msgstr "" +":mod:`sqlite3` モジュールで使用する ``libsqlite3`` 用の C コンパイラとリンカ" +"のフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:589 msgid "" "C compiler and linker flags for ``libuuid``, used by :mod:`uuid` module, " "overriding ``pkg-config``." msgstr "" +":mod:`uuid` モジュールで使用する ``libuuid`` 用の C コンパイラとリンカのフラ" +"グ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:595 msgid "" "C compiler and linker flags for ``libzstd``, used by :mod:`compression.zstd` " "module, overriding ``pkg-config``." msgstr "" +":mod:`compression.zstd` モジュールで使用する ``libzstd`` 用の C コンパイラと" +"リンカのフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:603 msgid "C compiler and linker flags for PANEL, overriding ``pkg-config``." msgstr "" +"PANEL 用の C コンパイラとリンカのフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:605 msgid "" "C compiler and linker flags for ``libpanel`` or ``libpanelw``, used by :mod:" "`curses.panel` module, overriding ``pkg-config``." msgstr "" +":mod:`curses.panel` モジュールで使用する ``libpanel`` または ``libpanelw`` 用" +"の C コンパイラとリンカのフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:611 msgid "C compiler and linker flags for TCLTK, overriding ``pkg-config``." msgstr "" +"TCLTK 用の C コンパイラとリンカのフラグ。\n" +"``pkg-config`` の設定をオーバーライドします。" -#: ../../using/configure.rst:616 msgid "" "C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module, " "overriding ``pkg-config``." msgstr "" +":mod:`gzip` モジュールで使用する ``libzlib`` 用の C コンパイラとリンカのフラ" +"グ。\n" +"``pkg-config`` の設定をオーバーライドします。" #: ../../using/configure.rst:621 msgid "WebAssembly Options" @@ -1056,13 +1122,13 @@ msgstr "WebAssembly オプション" msgid "Turn on dynamic linking support for WASM." msgstr "WASM のダイナミックリンクサポートをオンにします。" -#: ../../using/configure.rst:627 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -"ダイナミックリンクにより ``dlopen`` が可能になります。デッドコードの排除や機" -"能追加に制限があるため、実行ファイルのファイルサイズが大きくなります。" +"ダイナミックリンクにより ``dlopen`` が使用可能になります。\n" +"デッドコードの除去が制限されることと、機能が追加されることにより、実行ファイ" +"ルのサイズが大きくなります。" #: ../../using/configure.rst:634 msgid "Turn on pthreads support for WASM." @@ -1084,13 +1150,12 @@ msgstr "" msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "この値は、実行時に :data:`sys.prefix` を使って取得することができます。" -#: ../../using/configure.rst:649 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -"例として、 ``--prefix=\"$HOME/.local/\"`` を使用すると、 Python をそのホーム" -"ディレクトリにインストールすることができます。" +"例えば、``--prefix=\"$HOME/.local/\"`` を使用すると、自分のホームディレクトリ" +"に Python をインストールできます。" #: ../../using/configure.rst:654 msgid "" @@ -1140,12 +1205,14 @@ msgstr "``no``: ensurepip を実行しない;" msgid "Performance options" msgstr "パフォーマンスに関するオプション" -#: ../../using/configure.rst:680 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" +"最良のパフォーマンスを得るには、``--enable-optimizations --with-lto`` (PGO + " +"LTO) を指定して Python を構成することを推奨します。\n" +"実験的な ``--enable-bolt`` フラグも、パフォーマンスの向上に使用できます。" #: ../../using/configure.rst:686 msgid "" @@ -1164,14 +1231,15 @@ msgstr "" "す。macOS では、 GCC もこれを必要とします: GCC は macOS の Clang のエイリアス" "にすぎません。" -#: ../../using/configure.rst:692 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" +"``--enable-shared`` と GCC を使用する場合は、libpython のセマンティックイン" +"ターポジションも無効にします。\n" +"コンパイラとリンカのフラグに ``-fno-semantic-interposition`` を追加します。" -#: ../../using/configure.rst:698 msgid "" "During the build, you may encounter compiler warnings about profile data not " "being available for some source files. These warnings are harmless, as only " @@ -1179,59 +1247,70 @@ msgid "" "disable these warnings on Clang, manually suppress them by adding ``-Wno-" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" +"ビルド中に、一部のソースファイルのプロファイルデータが利用できないというコン" +"パイラの警告が表示されることがあります。\n" +"プロファイルデータの取得時にはコードの一部だけが実行されるため、この警告に問" +"題はありません。\n" +"Clang でこの警告を無効にするには、:envvar:`CFLAGS` に ``-Wno-profile-instr-" +"unprofiled`` を追加して明示的に抑制してください。" #: ../../using/configure.rst:707 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "GCC で ``-fno-semantic-interposition`` を使用する。" -#: ../../using/configure.rst:712 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" +"Makefile で使用する環境変数。\n" +"PGO 生成タスクに使用する Python のコマンドライン引数。" #: ../../using/configure.rst:715 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "デフォルト: ``-m test --pgo --timeout=$(TESTTIMEOUT)``" -#: ../../using/configure.rst:719 msgid "Task failure is no longer ignored silently." -msgstr "" +msgstr "タスクの失敗が通知されずに無視されることはなくなりました。" -#: ../../using/configure.rst:724 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" +"どのビルドでもリンク時最適化 (LTO) を有効にします (デフォルトでは無効)。" -#: ../../using/configure.rst:726 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" +"C コンパイラの Clang で LTO を使用するには、``llvm-ar`` (macOS では ``ar``) " +"と、LTO に対応したリンカ (``ld.gold`` または ``lld``) が必要です。" -#: ../../using/configure.rst:731 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" +"ThinLTO 機能を使用するには、Clang で ``--with-lto=thin`` を指定してください。" -#: ../../using/configure.rst:734 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" +"コンパイラがフラグを受け付ける場合、Clang では ThinLTO をデフォルトの最適化方" +"針として使用します。" -#: ../../using/configure.rst:739 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" +"`リンク後のバイナリを最適化する BOLT `_ の使用を有効にします (デフォルトでは無効)。" -#: ../../using/configure.rst:743 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" +"BOLT は LLVM プロジェクトの一部ですが、LLVM のバイナリ配布に必ず含まれている" +"とは限りません。\n" +"このフラグを使用するには、``llvm-bolt`` と ``merge-fdata`` が利用可能である必" +"要があります。" -#: ../../using/configure.rst:747 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -1241,32 +1320,43 @@ msgid "" "some scenarios. Use of LLVM 16 or newer for BOLT optimization is strongly " "encouraged." msgstr "" +"BOLT はまだ比較的新しいプロジェクトであるため、現時点ではこのフラグを実験的な" +"ものと考えてください。\n" +"このツールは機械語を処理するため、処理が成功するかどうかは、ビルド環境、ほか" +"の最適化用 configure 引数、CPU アーキテクチャの組み合わせに依存し、すべての組" +"み合わせがサポートされているわけではありません。\n" +"LLVM 16 より前の BOLT は、状況によってクラッシュすることが知られています。\n" +"BOLT による最適化には LLVM 16 以降の使用を強く推奨します。" -#: ../../using/configure.rst:755 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " "arguments for :program:`llvm-bolt` to instrument and apply BOLT data to " "binaries, respectively." msgstr "" +":program:`configure` 変数 :envvar:`!BOLT_INSTRUMENT_FLAGS` と :envvar:`!" +"BOLT_APPLY_FLAGS` を定義すると、:program:`llvm-bolt` に渡すデフォルトの引数を" +"オーバーライドできます。\n" +"前者はバイナリへの計測処理の挿入、後者はバイナリへの BOLT データの適用に使用" +"します。" -#: ../../using/configure.rst:764 msgid "" "Arguments to ``llvm-bolt`` when creating a `BOLT optimized binary `_." msgstr "" +"`BOLT で最適化したバイナリ `_ を作成" +"するときに ``llvm-bolt`` に渡す引数。" -#: ../../using/configure.rst:771 msgid "Arguments to ``llvm-bolt`` when instrumenting binaries." -msgstr "" +msgstr "バイナリに計測処理を挿入するときに ``llvm-bolt`` に渡す引数。" -#: ../../using/configure.rst:777 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" +"評価ループで計算型 goto を有効にします (対応するコンパイラではデフォルトで有" +"効)。" -#: ../../using/configure.rst:782 msgid "" "Enable interpreters using tail calls in CPython. If enabled, enabling PGO (:" "option:`--enable-optimizations`) is highly recommended. This option " @@ -1275,40 +1365,52 @@ msgid "" "none>`_ calling convention. For example, Clang 19 and newer supports this " "feature." msgstr "" +"CPython で末尾呼び出しを使用するインタープリタを有効にします。\n" +"有効にする場合は、PGO (:option:`--enable-optimizations`) も有効にすることを強" +"く推奨します。\n" +"このオプションには、適切な末尾呼び出しのサポートと `preserve_none `_ 呼び出し規約を備" +"えた C コンパイラが必要です。\n" +"例えば、Clang 19 以降はこの機能をサポートしています。" -#: ../../using/configure.rst:792 msgid "Disable frame pointers, which are enabled by default (see :pep:`831`)." msgstr "" +"フレームポインタを無効にします。\n" +"デフォルトでは有効です (:pep:`831` を参照)。" -#: ../../using/configure.rst:794 msgid "" "By default, the build appends flags to generate frame or backchain pointers " "to ``BASECFLAGS``:" msgstr "" +"デフォルトでは、ビルド時にフレームポインタまたはバックチェーンポインタを生成" +"するフラグを ``BASECFLAGS`` に追加します:" -#: ../../using/configure.rst:797 msgid "" "``-fno-omit-frame-pointer`` and/or ``-mno-omit-leaf-frame-pointer`` are " "added when the compiler supports them." msgstr "" +"コンパイラが対応している場合、``-fno-omit-frame-pointer`` と ``-mno-omit-" +"leaf-frame-pointer`` の一方または両方を追加します。" -#: ../../using/configure.rst:799 msgid "``-marm`` and/or ``-mno-thumb`` is added on 32-bit ARM when supported," msgstr "" +"32 ビット ARM では、対応している場合に ``-marm`` と ``-mno-thumb`` の一方また" +"は両方を追加します。" -#: ../../using/configure.rst:800 msgid "" "on s390x platforms, when supported, ``-mbackchain`` is added *instead*. of " "the above frame pointer flags." msgstr "" +"s390x プラットフォームでは、対応している場合、上記のフレームポインタ用フラグ" +"の *代わりに* ``-mbackchain`` を追加します。" -#: ../../using/configure.rst:802 msgid "" "on ppc64le platforms, no compiler flags is needed since the power ABI " "requires that compilers maintain a back chain by default." msgstr "" +"ppc64le プラットフォームでは、Power ABI がコンパイラに対してデフォルトでバッ" +"クチェーンを維持することを要求しているため、コンパイラフラグは不要です。" -#: ../../using/configure.rst:805 msgid "" "Frame pointers enable profilers, debuggers, and system tracing tools " "(``perf``, ``eBPF``, ``dtrace``, ``gdb``) to walk the C call stack without " @@ -1316,58 +1418,80 @@ msgid "" "`sysconfig`. On compilers that do not understand them, the build silently " "skips them." msgstr "" +"フレームポインタがあると、プロファイラ、デバッガ、システムのトレースツール " +"(``perf``、``eBPF``、``dtrace``、``gdb``) は、DWARF メタデータなしで C の呼び" +"出しスタックをたどれます。\n" +"これらのフラグは :mod:`sysconfig` を通じてサードパーティの C 拡張にも伝わりま" +"す。\n" +"コンパイラがこれらのフラグを認識しない場合、ビルド時に通知せずにスキップしま" +"す。" -#: ../../using/configure.rst:811 msgid "" "Downstream packagers and authors of native libraries built with custom build " "systems should set the same flags so the unwind chain stays unbroken across " "all native frames." msgstr "" +"配布先でパッケージ化する人や、独自のビルドシステムでネイティブライブラリをビ" +"ルドする作者は、同じフラグを設定して、すべてのネイティブフレームにわたってス" +"タックを巻き戻すための連鎖が途切れないようにしてください。" -#: ../../using/configure.rst:819 msgid "" "Disable the fast :ref:`mimalloc ` allocator (enabled by default)." msgstr "" +"高速な :ref:`mimalloc ` アロケータを無効にします (デフォルトでは有" +"効)。" -#: ../../using/configure.rst:822 msgid "" "This option cannot be used together with :option:`--disable-gil` because " "the :term:`free-threaded ` build requires mimalloc." msgstr "" +":term:`フリースレッド ` ビルドには mimalloc が必要なため、こ" +"のオプションを :option:`--disable-gil` と併用することはできません。" -#: ../../using/configure.rst:825 ../../using/configure.rst:832 msgid "See also :envvar:`PYTHONMALLOC` environment variable." -msgstr "" +msgstr ":envvar:`PYTHONMALLOC` 環境変数も参照してください。" -#: ../../using/configure.rst:829 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" +"Python 専用のメモリアロケータ :ref:`pymalloc ` を無効にします (デ" +"フォルトでは有効)。" -#: ../../using/configure.rst:836 msgid "" "Enable huge page support for :ref:`pymalloc ` arenas (disabled by " "default). When enabled, the arena size on 64-bit platforms is increased to 2 " "MiB and arena allocation uses ``MAP_HUGETLB`` (Linux) or ``MEM_LARGE_PAGES`` " "(Windows) with automatic fallback to regular pages." msgstr "" +":ref:`pymalloc ` のアリーナでヒュージページのサポートを有効にしま" +"す (デフォルトでは無効)。\n" +"有効にすると、64 ビットプラットフォームでのアリーナサイズが 2 MiB に増加し、" +"アリーナの割り当てには ``MAP_HUGETLB`` (Linux) または ``MEM_LARGE_PAGES`` " +"(Windows) を使用します。\n" +"通常のページへのフォールバックは自動で行います。" -#: ../../using/configure.rst:841 msgid "" "Even when compiled with this option, huge pages are **not** used at runtime " "unless the :envvar:`PYTHON_PYMALLOC_HUGEPAGES` environment variable is set " "to ``1``. This opt-in is required because huge pages" msgstr "" +"このオプションを指定してコンパイルした場合でも、環境変数 :envvar:" +"`PYTHON_PYMALLOC_HUGEPAGES` を ``1`` に設定しない限り、実行時にヒュージページ" +"は使用 **されません**。\n" +"このように明示的な有効化が必要なのは、ヒュージページに次のような特性があるた" +"めです:" -#: ../../using/configure.rst:845 msgid "" "carry risks on Linux: if the huge-page pool is exhausted, page faults " "(including copy-on-write faults after :func:`os.fork`) deliver ``SIGBUS`` " "and kill the process." msgstr "" +"Linux ではリスクがあります。\n" +"ヒュージページのプールを使い切ると、ページフォールト (:func:`os.fork` 後のコ" +"ピーオンライトによるフォールトを含む) により ``SIGBUS`` が送られ、プロセスが" +"強制終了します。" -#: ../../using/configure.rst:849 msgid "" "need a special privilege on Windows. See the `Windows documentation for " "large pages `_ is not held by the user." msgstr "" +"Windows では特別な権限が必要です。\n" +"詳しくは `Windows のラージページのドキュメント `_ を参照してください。\n" +"ユーザーが必要な権限 `SeLockMemoryPrivilege `_ を持っていない場合、Python " +"は起動に失敗します。" -#: ../../using/configure.rst:856 msgid "" "The configure script checks that the platform supports ``MAP_HUGETLB`` and " "emits a warning if it is not available." msgstr "" +"configure スクリプトはプラットフォームが ``MAP_HUGETLB`` をサポートしているか" +"確認し、利用できない場合は警告を出力します。" -#: ../../using/configure.rst:859 msgid "" "On Windows, use the ``--pymalloc-hugepages`` flag with ``build.bat`` or set " "the ``UsePymallocHugepages`` MSBuild property." msgstr "" +"Windows では、``build.bat`` に ``--pymalloc-hugepages`` フラグを指定するか、" +"MSBuild の ``UsePymallocHugepages`` プロパティを設定してください。" -#: ../../using/configure.rst:866 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" +"メモリ使用量を減らすため、静的なドキュメンテーション文字列を無効にします (デ" +"フォルトでは有効)。\n" +"Python で定義されたドキュメンテーション文字列には影響しません。" #: ../../using/configure.rst:869 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "" -#: ../../using/configure.rst:871 msgid "See the ``PyDoc_STRVAR()`` macro." -msgstr "" +msgstr "``PyDoc_STRVAR()`` マクロを参照してください。" -#: ../../using/configure.rst:875 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" +"``gprof`` による C レベルのコードのプロファイリングを有効にします (デフォルト" +"では無効)。" -#: ../../using/configure.rst:879 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" +"C コンパイラのフラグに ``-fstrict-overflow`` を追加します (デフォルトでは代わ" +"りに ``-fno-strict-overflow`` を追加します)。" -#: ../../using/configure.rst:884 msgid "" "Deactivate remote debugging support described in :pep:`768` (enabled by " "default). When this flag is provided the code that allows the interpreter to " @@ -1422,18 +1557,27 @@ msgid "" "schedule code to be executed and the functionality to receive code to be " "executed." msgstr "" +":pep:`768` で説明されているリモートデバッグのサポートを無効にします (デフォル" +"トでは有効)。\n" +"このフラグを指定すると、:pep:`768` にあるように、インタープリタが別のプロセス" +"で Python ファイルの実行をスケジュールできるようにするコードをコンパイルしま" +"せん。\n" +"これには、実行するコードをスケジュールする機能と、実行するコードを受信する機" +"能の両方が含まれます。" -#: ../../using/configure.rst:892 msgid "" "This macro is defined by default, unless Python is configured with :option:" "`--without-remote-debug`." msgstr "" +"Python の構成時に :option:`--without-remote-debug` を指定しない限り、このマク" +"ロはデフォルトで定義されます。" -#: ../../using/configure.rst:895 msgid "" "Note that even if the macro is defined, remote debugging may not be " "available (for example, on an incompatible platform)." msgstr "" +"マクロが定義されていても、リモートデバッグが利用できない場合があることに注意" +"してください (例えば、互換性のないプラットフォームの場合)。" #: ../../using/configure.rst:904 msgid "Python Debug Build" @@ -1451,93 +1595,101 @@ msgstr "" msgid "Effects of a debug build:" msgstr "デバッグビルドの影響:" -#: ../../using/configure.rst:911 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" +"デフォルトですべての警告を表示します。\n" +":mod:`warnings` モジュールのデフォルトの警告フィルタのリストが空になります。" -#: ../../using/configure.rst:913 msgid "Add ``d`` to :data:`sys.abiflags`." -msgstr "" +msgstr ":data:`sys.abiflags` に ``d`` を追加します。" -#: ../../using/configure.rst:914 msgid "Add :func:`!sys.gettotalrefcount` function." -msgstr "" +msgstr ":func:`!sys.gettotalrefcount` 関数を追加します。" -#: ../../using/configure.rst:915 msgid "Add :option:`-X showrefcount <-X>` command line option." -msgstr "" +msgstr ":option:`-X showrefcount <-X>` コマンドラインオプションを追加します。" -#: ../../using/configure.rst:916 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" +"パーサをデバッグするための :option:`-d` コマンドラインオプションと :envvar:" +"`PYTHONDEBUG` 環境変数を追加します。" -#: ../../using/configure.rst:918 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" +"``__lltrace__`` 変数のサポートを追加します。\n" +"この変数が定義されている場合、バイトコード評価ループの低レベルのトレースを有" +"効にします。" -#: ../../using/configure.rst:920 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" +"バッファオーバーフローやその他のメモリエラーを検出するために、:ref:`メモリア" +"ロケータにデバッグフック ` を設定します。" -#: ../../using/configure.rst:922 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." -msgstr "" +msgstr "``Py_DEBUG`` と ``Py_REF_DEBUG`` マクロを定義します。" -#: ../../using/configure.rst:923 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " "the ``NDEBUG`` macro (see also the :option:`--with-assertions` configure " "option). Main runtime checks:" msgstr "" +"実行時のチェックを追加します。\n" +"これは ``#ifdef Py_DEBUG`` と ``#endif`` で囲まれたコードです。\n" +"``assert(...)`` と ``_PyObject_ASSERT(...)`` によるアサーションを有効にし、" +"``NDEBUG`` マクロを設定しません (:option:`--with-assertions` configure オプ" +"ションも参照してください)。\n" +"実行時の主なチェックは次のとおりです:" -#: ../../using/configure.rst:928 msgid "Add sanity checks on the function arguments." -msgstr "" +msgstr "関数の引数が妥当かどうかのチェックを追加します。" -#: ../../using/configure.rst:929 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" +"未初期化のオブジェクトの使用を検出するため、Unicode オブジェクトと int オブ" +"ジェクトの作成時に、そのメモリを特定のパターンで埋めます。" -#: ../../using/configure.rst:931 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" +"現在の例外をクリアまたは置換する可能性のある関数が、例外が発生している状態で" +"呼び出されていないことを確認します。" -#: ../../using/configure.rst:933 msgid "Check that deallocator functions don't change the current exception." -msgstr "" +msgstr "メモリ解放関数が現在の例外を変更しないことをチェックします。" -#: ../../using/configure.rst:934 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" +"ガベージコレクタ (:func:`gc.collect` 関数) は、オブジェクトの整合性に関する基" +"本的なチェックをいくつか実行します。" -#: ../../using/configure.rst:936 msgid "" "The :c:macro:`!Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" +":c:macro:`!Py_SAFE_DOWNCAST()` マクロは、幅の広い型から狭い型へダウンキャスト" +"するときに、整数のアンダーフローとオーバーフローをチェックします。" -#: ../../using/configure.rst:939 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" +":ref:`Python 開発モード ` と :option:`--with-trace-refs` configure " +"オプションも参照してください。" -#: ../../using/configure.rst:942 msgid "" "Release builds are now ABI compatible with debug builds: defining the " "``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" @@ -1545,131 +1697,152 @@ msgid "" "symbols than release builds and code built against a debug build is not " "necessarily compatible with a release build." msgstr "" +"リリースビルドがデバッグビルドと ABI 互換になりました。\n" +"``Py_DEBUG`` マクロを定義しても、``Py_TRACE_REFS`` マクロが暗黙に定義されるこ" +"とはなくなりました (:option:`--with-trace-refs` オプションを参照)。\n" +"ただし、デバッグビルドが公開するシンボルはリリースビルドよりも多く、デバッグ" +"ビルドに対してビルドしたコードがリリースビルドと互換性を持つとは限りません。" -#: ../../using/configure.rst:951 msgid "Debug options" -msgstr "" +msgstr "デバッグオプション" -#: ../../using/configure.rst:955 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" +":ref:`Python をデバッグモードでビルド ` します。\n" +"``Py_DEBUG`` マクロを定義します (デフォルトでは無効)。" -#: ../../using/configure.rst:960 msgid "Enable tracing references for debugging purpose (disabled by default)." -msgstr "" +msgstr "デバッグのために参照の追跡を有効にします (デフォルトでは無効)。" -#: ../../using/configure.rst:964 msgid "Define the ``Py_TRACE_REFS`` macro." -msgstr "" +msgstr "``Py_TRACE_REFS`` マクロを定義します。" -#: ../../using/configure.rst:965 msgid "Add :func:`sys.getobjects` function." -msgstr "" +msgstr ":func:`sys.getobjects` 関数を追加します。" -#: ../../using/configure.rst:966 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." -msgstr "" +msgstr ":envvar:`PYTHONDUMPREFS` 環境変数を追加します。" -#: ../../using/configure.rst:968 msgid "" "The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump " "objects and reference counts still alive at Python exit." msgstr "" +":envvar:`PYTHONDUMPREFS` 環境変数を使うと、Python の終了時にまだ生存している" +"オブジェクトとその参照カウントを出力できます。" -#: ../../using/configure.rst:971 msgid ":ref:`Statically allocated objects ` are not traced." msgstr "" +":ref:`静的に割り当てられたオブジェクト ` は追跡しません。" -#: ../../using/configure.rst:975 msgid "" "This build is now ABI compatible with release build and :ref:`debug build " "`." msgstr "" +"このビルドがリリースビルドおよび :ref:`デバッグビルド ` と ABI " +"互換になりました。" -#: ../../using/configure.rst:981 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" +"C のアサーション ``assert(...);`` と ``_PyObject_ASSERT(...);`` を有効にして" +"ビルドします (デフォルトでは無効)。" -#: ../../using/configure.rst:984 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" +"設定した場合、:envvar:`OPT` コンパイラ変数に ``NDEBUG`` マクロを定義しませ" +"ん。" -#: ../../using/configure.rst:987 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" +"アサーションも有効にする :option:`--with-pydebug` オプション (:ref:`デバッグ" +"ビルド `) も参照してください。" -#: ../../using/configure.rst:994 msgid "Enable Valgrind support (default is no)." -msgstr "" +msgstr "Valgrind のサポートを有効にします (デフォルトでは無効)。" -#: ../../using/configure.rst:998 msgid "Enable DTrace support (default is no)." -msgstr "" +msgstr "DTrace のサポートを有効にします (デフォルトでは無効)。" -#: ../../using/configure.rst:1000 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" +":ref:`DTrace と SystemTap による CPython の計測 ` を参照して" +"ください。" -#: ../../using/configure.rst:1007 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no). To " "improve ASan detection capabilities you may also want to combine this with :" "option:`--without-pymalloc` to disable the specialized small-object " "allocator whose allocations are not tracked by ASan." msgstr "" +"メモリエラー検出ツール AddressSanitizer (``asan``) を有効にします (デフォルト" +"では無効)。\n" +"ASan の検出能力を高めるには、:option:`--without-pymalloc` と併用することも検" +"討してください。\n" +"このオプションは、ASan が割り当てを追跡しない、小さなオブジェクト専用のアロ" +"ケータを無効にします。" -#: ../../using/configure.rst:1016 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" +"メモリ割り当てエラー検出ツール MemorySanitizer (``msan``) を有効にします (デ" +"フォルトでは無効)。" -#: ../../using/configure.rst:1018 msgid "" "MSan reports false positives for memory initialized by libraries that are " "not built with MSan, so either build all dependencies with MSan or disable " "the extension modules that use them in :file:`Modules/Setup.local`." msgstr "" +"MSan を使わずにビルドしたライブラリが初期化したメモリに対し、MSan は誤検出を" +"報告します。\n" +"そのため、すべての依存関係を MSan でビルドするか、それらを使用する拡張モ" +"ジュールを :file:`Modules/Setup.local` で無効にしてください。" -#: ../../using/configure.rst:1026 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" +"未定義動作検出ツール UndefinedBehaviorSanitizer (``ubsan``) を有効にします " +"(デフォルトでは無効)。" -#: ../../using/configure.rst:1033 msgid "Enable ThreadSanitizer data race detector, ``tsan`` (default is no)." msgstr "" +"データ競合検出ツール ThreadSanitizer (``tsan``) を有効にします (デフォルトで" +"は無効)。" -#: ../../using/configure.rst:1044 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" +"Python の共有ライブラリ ``libpython`` のビルドを有効にします (デフォルトでは" +"無効)。" -#: ../../using/configure.rst:1048 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" +"``libpythonMAJOR.MINOR.a`` をビルドせず、``python.o`` をインストールしません " +"(デフォルトではビルドされ、有効です)。" -#: ../../using/configure.rst:1055 msgid "" "Do not link the Python interpreter binary (``python3``) against the shared " "Python library; instead, statically link the interpreter against " "``libpython`` as if ``--enable-shared`` had not been used, but continue to " "build the shared ``libpython`` (for use by other programs)." msgstr "" +"Python インタープリタのバイナリ (``python3``) を Python の共有ライブラリにリ" +"ンクしません。\n" +"代わりに、``--enable-shared`` を使用しなかった場合と同様に、インタープリタを " +"``libpython`` に静的にリンクしますが、(ほかのプログラムが使用するための) " +"``libpython`` 共有ライブラリのビルドは引き続き行います。" -#: ../../using/configure.rst:1061 msgid "This option does nothing if ``--enable-shared`` is not used." -msgstr "" +msgstr "``--enable-shared`` を使用しない場合、このオプションは何もしません。" #: ../../using/configure.rst:1063 msgid "" @@ -1677,125 +1850,117 @@ msgid "" "interpreter against the built shared library." msgstr "" -#: ../../using/configure.rst:1070 msgid "Libraries options" -msgstr "" +msgstr "ライブラリのオプション" -#: ../../using/configure.rst:1074 msgid "Link against additional libraries (default is no)." -msgstr "" +msgstr "追加のライブラリにリンクします (デフォルトでは無効)。" -#: ../../using/configure.rst:1078 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" +"インストール済みの ``expat`` ライブラリを使用して :mod:`!pyexpat` モジュール" +"をビルドします (デフォルトでは無効)。" -#: ../../using/configure.rst:1083 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdecimal`` " "library, see the :mod:`decimal` module (default is yes)." msgstr "" +"インストール済みの ``mpdecimal`` ライブラリを使用して ``_decimal`` 拡張モ" +"ジュールをビルドします (デフォルトでは有効)。\n" +":mod:`decimal` モジュールを参照してください。" -#: ../../using/configure.rst:1088 msgid "Default to using the installed ``mpdecimal`` library." msgstr "" +"デフォルトでインストール済みの ``mpdecimal`` ライブラリを使用するようになりま" +"した。" -#: ../../using/configure.rst:1093 msgid "" "A bundled copy of the library will no longer be selected implicitly if an " "installed ``mpdecimal`` library is not found. In Python 3.15 only, it can " "still be selected explicitly using ``--with-system-libmpdec=no`` or ``--" "without-system-libmpdec``." msgstr "" +"インストール済みの ``mpdecimal`` ライブラリが見つからない場合に、同梱のライブ" +"ラリが暗黙に選択されることはなくなりました。\n" +"Python 3.15 に限り、``--with-system-libmpdec=no`` または ``--without-system-" +"libmpdec`` を使用して明示的に選択することは引き続き可能です。" -#: ../../using/configure.rst:1098 msgid "" "A copy of the ``mpdecimal`` library sources will no longer be distributed " "with Python 3.16." msgstr "" +"Python 3.16 では、``mpdecimal`` ライブラリのソースコードのコピーが同梱されな" +"くなります。" -#: ../../using/configure.rst:1102 msgid ":option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`." -msgstr "" +msgstr ":option:`LIBMPDEC_CFLAGS` と :option:`LIBMPDEC_LIBS`。" -#: ../../using/configure.rst:1106 msgid "Designate a backend library for the :mod:`readline` module." -msgstr "" +msgstr ":mod:`readline` モジュールのバックエンドライブラリを指定します。" -#: ../../using/configure.rst:1108 msgid "readline: Use readline as the backend." -msgstr "" +msgstr "readline: バックエンドに readline を使用します。" -#: ../../using/configure.rst:1109 msgid "editline: Use editline as the backend." -msgstr "" +msgstr "editline: バックエンドに editline を使用します。" -#: ../../using/configure.rst:1115 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" +":mod:`readline` モジュールをビルドしません (デフォルトではビルドします)。" -#: ../../using/configure.rst:1117 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." -msgstr "" +msgstr "``HAVE_LIBREADLINE`` マクロを定義しません。" -#: ../../using/configure.rst:1123 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" +"数学ライブラリ ``libm`` を *STRING* に変更します (デフォルトはシステムに依" +"存)。" -#: ../../using/configure.rst:1127 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" +"C ライブラリ ``libc`` を *STRING* に変更します (デフォルトはシステムに依存)。" -#: ../../using/configure.rst:1131 msgid "Root of the OpenSSL directory." -msgstr "" +msgstr "OpenSSL ディレクトリのルート。" -#: ../../using/configure.rst:1137 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" -msgstr "" +msgstr "OpenSSL ライブラリの実行時ライブラリディレクトリ (rpath) を設定します:" -#: ../../using/configure.rst:1139 msgid "``no`` (default): don't set rpath;" -msgstr "" +msgstr "``no`` (デフォルト): rpath を設定しません;" -#: ../../using/configure.rst:1140 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" +"``auto``: :option:`--with-openssl` と ``pkg-config`` から rpath を自動検出し" +"ます;" -#: ../../using/configure.rst:1142 msgid "*DIR*: set an explicit rpath." -msgstr "" +msgstr "*DIR*: rpath を明示的に設定します。" -#: ../../using/configure.rst:1148 msgid "Security Options" -msgstr "" +msgstr "セキュリティのオプション" -#: ../../using/configure.rst:1152 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" -msgstr "" +msgstr "``Python/pyhash.c`` で使用するハッシュアルゴリズムを選択します:" -#: ../../using/configure.rst:1154 msgid "``siphash13`` (default);" -msgstr "" +msgstr "``siphash13`` (デフォルト);" -#: ../../using/configure.rst:1155 msgid "``siphash24``;" -msgstr "" +msgstr "``siphash24``;" -#: ../../using/configure.rst:1156 msgid "``fnv``." -msgstr "" +msgstr "``fnv``。" -#: ../../using/configure.rst:1160 msgid "``siphash13`` is added and it is the new default." -msgstr "" +msgstr "``siphash13`` が追加され、新たなデフォルトになりました。" -#: ../../using/configure.rst:1165 msgid "Built-in hash modules:" -msgstr "" +msgstr "組み込みのハッシュモジュール:" #: ../../using/configure.rst:1167 msgid "``md5``;" @@ -1813,41 +1978,35 @@ msgstr "``sha256``;" msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:1171 msgid "``sha3`` (with shake);" -msgstr "" +msgstr "``sha3`` (shake を含む);" #: ../../using/configure.rst:1172 msgid "``blake2``." msgstr "``blake2``." -#: ../../using/configure.rst:1178 msgid "Override the OpenSSL default cipher suites string:" -msgstr "" +msgstr "OpenSSL のデフォルトの暗号スイート文字列をオーバーライドします:" -#: ../../using/configure.rst:1180 msgid "``python`` (default): use Python's preferred selection;" -msgstr "" +msgstr "``python`` (デフォルト): Python が推奨する選択を使用します;" -#: ../../using/configure.rst:1181 msgid "``openssl``: leave OpenSSL's defaults untouched;" -msgstr "" +msgstr "``openssl``: OpenSSL のデフォルトをそのまま使用します;" -#: ../../using/configure.rst:1182 msgid "*STRING*: use a custom string" -msgstr "" +msgstr "*STRING*: カスタムの文字列を使用します" -#: ../../using/configure.rst:1184 msgid "See the :mod:`ssl` module." -msgstr "" +msgstr ":mod:`ssl` モジュールを参照してください。" -#: ../../using/configure.rst:1190 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" +"``python`` と *STRING* の設定では、プロトコルの最小バージョンも TLS 1.2 に設" +"定します。" -#: ../../using/configure.rst:1195 msgid "" "Disable compiler options that are `recommended by OpenSSF`_ for security " "reasons with no performance overhead. If this option is not enabled, CPython " @@ -1855,25 +2014,33 @@ msgid "" "option is enabled, CPython will not be built with the compiler options " "listed below." msgstr "" +"セキュリティ上の理由で `OpenSSF が推奨する `_、パ" +"フォーマンスのオーバーヘッドを伴わないコンパイラオプションを無効にします。\n" +"このオプションを有効にしなければ、CPython は速度の低下を伴わない安全性のため" +"のコンパイラオプションを使用してビルドされます。\n" +"このオプションを有効にすると、以下のコンパイラオプションを使用せずに CPython " +"をビルドします。" -#: ../../using/configure.rst:1199 msgid "" "The following compiler options are disabled with :option:`!--disable-safety`:" msgstr "" +":option:`!--disable-safety` を指定すると、次のコンパイラオプションを無効にし" +"ます:" -#: ../../using/configure.rst:1201 msgid "" "`-fstack-protector-strong`_: Enable run-time checks for stack-based buffer " "overflows." msgstr "" +"`-fstack-protector-strong`_: スタック上のバッファオーバーフローに対する実行時" +"のチェックを有効にします。" -#: ../../using/configure.rst:1202 msgid "" "`-Wtrampolines`_: Enable warnings about trampolines that require executable " "stacks." msgstr "" +"`-Wtrampolines`_: 実行可能スタックを必要とするトランポリンに関する警告を有効" +"にします。" -#: ../../using/configure.rst:1212 msgid "" "Enable compiler options that are `recommended by OpenSSF`_ for security " "reasons which require overhead. If this option is not enabled, CPython will " @@ -1881,18 +2048,26 @@ msgid "" "this option is enabled, CPython will be built with the compiler options " "listed below." msgstr "" +"セキュリティ上の理由で `OpenSSF が推奨する `_、オー" +"バーヘッドを伴うコンパイラオプションを有効にします。\n" +"このオプションを有効にしなければ、CPython はパフォーマンスに影響する安全性の" +"ためのコンパイラオプションを使用せずにビルドされます。\n" +"このオプションを有効にすると、以下のコンパイラオプションを使用して CPython を" +"ビルドします。" -#: ../../using/configure.rst:1216 msgid "" "The following compiler options are enabled with :option:`!--enable-slower-" "safety`:" msgstr "" +":option:`!--enable-slower-safety` を指定すると、次のコンパイラオプションを有" +"効にします:" -#: ../../using/configure.rst:1218 msgid "" "`-D_FORTIFY_SOURCE=3`_: Fortify sources with compile- and run-time checks " "for unsafe libc usage and buffer overflows." msgstr "" +"`-D_FORTIFY_SOURCE=3`_: libc の安全でない使用とバッファオーバーフローに対し" +"て、コンパイル時および実行時のチェックを行い、ソースコードを強化します。" #: ../../using/configure.rst:1226 msgid "macOS Options" @@ -1902,22 +2077,20 @@ msgstr "macOS のオプション" msgid "See :source:`Mac/README.rst`." msgstr ":source:`Mac/README.rst` を参照。" -#: ../../using/configure.rst:1233 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -"ユニバーサルバイナリビルドを作成します。 *SDKDIR* はビルドの実行にどの macOS " -"SDK が使用されるべきかを指定します (デフォルトでは指定しません) 。" +"ユニバーサルバイナリのビルドを作成します (デフォルトでは無効)。\n" +"*SDKDIR* は、ビルドに使用する macOS SDK を指定します。" -#: ../../using/configure.rst:1239 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -"従来の Unix インストールではなく、 Python.framework を作成します。オプション" -"の *INSTALLDIR* はインストール先のパスを指定します (デフォルトでは指定しませ" -"ん) 。" +"従来の Unix 形式でのインストールに代えて、Python.framework を作成します (デ" +"フォルトでは無効)。\n" +"オプションの *INSTALLDIR* はインストール先のパスを指定します。" #: ../../using/configure.rst:1244 msgid "" @@ -1931,39 +2104,30 @@ msgstr "" msgid "Options:" msgstr "オプション:" -#: ../../using/configure.rst:1249 msgid "``universal2`` (x86-64 and arm64);" -msgstr "" +msgstr "``universal2`` (x86-64 と arm64);" -#: ../../using/configure.rst:1250 msgid "``32-bit`` (PPC and i386);" -msgstr "" +msgstr "``32-bit`` (PPC と i386);" -#: ../../using/configure.rst:1251 msgid "``64-bit`` (PPC64 and x86-64);" -msgstr "" +msgstr "``64-bit`` (PPC64 と x86-64);" -#: ../../using/configure.rst:1252 msgid "``3-way`` (i386, PPC and x86-64);" -msgstr "" +msgstr "``3-way`` (i386、PPC、x86-64);" -#: ../../using/configure.rst:1253 msgid "``intel`` (i386 and x86-64);" -msgstr "" +msgstr "``intel`` (i386 と x86-64);" -#: ../../using/configure.rst:1254 msgid "``intel-32`` (i386);" -msgstr "" +msgstr "``intel-32`` (i386);" -#: ../../using/configure.rst:1255 msgid "``intel-64`` (x86-64);" -msgstr "" +msgstr "``intel-64`` (x86-64);" -#: ../../using/configure.rst:1256 msgid "``all`` (PPC, i386, PPC64 and x86-64)." -msgstr "" +msgstr "``all`` (PPC、i386、PPC64、x86-64)。" -#: ../../using/configure.rst:1258 msgid "" "Note that values for this configuration item are *not* the same as the " "identifiers used for universal binary wheels on macOS. See the Python " @@ -1971,6 +2135,11 @@ msgid "" "tags used on macOS `_" msgstr "" +"この構成項目の値は、macOS のユニバーサルバイナリ wheel で使用する識別子と同じ" +"では *ない* ことに注意してください。\n" +"詳しくは、Python Packaging User Guide の `macOS で使用するパッケージングのプ" +"ラットフォーム互換性タグ `_ を参照してください。" #: ../../using/configure.rst:1266 msgid "" @@ -1998,9 +2167,8 @@ msgstr "" msgid "iOS Options" msgstr "iOS のオプション" -#: ../../using/configure.rst:1283 msgid "See :source:`Platforms/Apple/iOS/README.md`." -msgstr "" +msgstr ":source:`Platforms/Apple/iOS/README.md` を参照してください。" #: ../../using/configure.rst:1287 msgid "" @@ -2018,18 +2186,18 @@ msgstr "フレームワークの名前を指定します (デフォルト: ``Pyt msgid "Cross Compiling Options" msgstr "クロスコンパイルのオプション" -#: ../../using/configure.rst:1298 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " "interpreter for the build platform. The version of the build Python must " "match the version of the cross compiled host Python." msgstr "" -"クロスコンパイル、またはクロスビルドは、異なる CPU アーキテクチャやプラット" -"フォーム用に Python をビルドするために使用できます。クロスコンパイルには、ビ" -"ルドプラットフォーム用の Python インタープリターが必要です。ビルドする " -"Python のバージョンは、クロスコンパイルされたホスト Python のバージョンと一致" -"する必要があります。" +"クロスコンパイル (クロスビルドとも呼ばれます) を使用すると、異なる CPU アーキ" +"テクチャやプラットフォーム向けの Python をビルドできます。\n" +"クロスコンパイルには、ビルドプラットフォーム用の Python インタープリタが必要" +"です。\n" +"ビルドに使用する Python のバージョンは、クロスコンパイルするホスト用 Python " +"のバージョンと一致していなければなりません。" #: ../../using/configure.rst:1305 msgid "" @@ -2044,9 +2212,8 @@ msgstr "" "HOST (ターゲットプラットフォーム) で動作するプログラムをビルドするためのクロ" "スコンパイル。" -#: ../../using/configure.rst:1313 msgid "path to build ``python`` binary for cross compiling" -msgstr "クロスコンパイル用のビルド ``python`` バイナリへのパス。" +msgstr "クロスコンパイルのビルド時に使用する ``python`` バイナリへのパス。" #: ../../using/configure.rst:1319 msgid "An environment variable that points to a file with configure overrides." @@ -2056,13 +2223,16 @@ msgstr "構成をオーバーライドするファイルを指す環境変数。 msgid "Example *config.site* file:" msgstr "*config.site* ファイルの例:" -#: ../../using/configure.rst:1323 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" msgstr "" +"# config.site-aarch64\n" +"ac_cv_buggy_getaddrinfo=no\n" +"ac_cv_file__dev_ptmx=yes\n" +"ac_cv_file__dev_ptc=no" #: ../../using/configure.rst:1332 msgid "Program to run CPython for the host platform for cross-compilation." @@ -2073,13 +2243,16 @@ msgstr "" msgid "Cross compiling example::" msgstr "クロスコンパイルの例::" -#: ../../using/configure.rst:1339 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" msgstr "" +"CONFIG_SITE=config.site-aarch64 ../configure \\\n" +" --build=x86_64-pc-linux-gnu \\\n" +" --host=aarch64-unknown-linux-gnu \\\n" +" --with-build-python=../x86_64/python" #: ../../using/configure.rst:1346 msgid "Python Build System" @@ -2116,33 +2289,31 @@ msgstr "" msgid "Main build steps" msgstr "主要なビルドステップ" -#: ../../using/configure.rst:1360 msgid "C files (``.c``) are built as object files (``.o``)." -msgstr "" +msgstr "C ファイル (``.c``) をオブジェクトファイル (``.o``) にビルドします。" -#: ../../using/configure.rst:1361 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" +"オブジェクトファイルから静的な ``libpython`` ライブラリ (``.a``) を作成しま" +"す。" -#: ../../using/configure.rst:1362 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" +"``python.o`` と静的な ``libpython`` ライブラリをリンクして、最終的な " +"``python`` プログラムを作成します。" -#: ../../using/configure.rst:1364 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" +"Makefile によって C 拡張をビルドします (:file:`Modules/Setup` を参照)。" -#: ../../using/configure.rst:1367 msgid "Main Makefile targets" -msgstr "" +msgstr "主な Makefile ターゲット" -#: ../../using/configure.rst:1370 msgid "make" -msgstr "" +msgstr "make" -#: ../../using/configure.rst:1372 msgid "" "For the most part, when rebuilding after editing some code or refreshing " "your checkout from upstream, all you need to do is execute ``make``, which " @@ -2152,23 +2323,30 @@ msgid "" "variable, ``@DEF_MAKE_ALL_RULE@`` to describe precisely which targets ``make " "all`` will build. The three choices are:" msgstr "" +"コードの一部を編集した後や、上流の変更を取り込んでチェックアウトを更新した後" +"に再ビルドする場合、たいていは ``make`` を実行するだけで済みます。\n" +"Make の動作に従い、Makefile で最初に定義されたターゲットであるデフォルトの" +"ターゲットがビルドされます。\n" +"慣例として (CPython プロジェクトでも)、通常は ``all`` がそのターゲットで" +"す。\n" +"``configure`` スクリプトは ``autoconf`` 変数 ``@DEF_MAKE_ALL_RULE@`` を展開し" +"て、``make all`` がビルドするターゲットを正確に指定します。\n" +"選択肢は次の三つです:" -#: ../../using/configure.rst:1381 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" -msgstr "" +msgstr "``profile-opt`` (``--enable-optimizations`` で構成した場合)" -#: ../../using/configure.rst:1382 msgid "" "``build_wasm`` (chosen if the host platform matches ``wasm32-wasi*`` or " "``wasm32-emscripten``)" msgstr "" +"``build_wasm`` (ホストプラットフォームが ``wasm32-wasi*`` または ``wasm32-" +"emscripten`` に一致する場合に選択)" -#: ../../using/configure.rst:1384 msgid "" "``build_all`` (configured without explicitly using either of the others)" -msgstr "" +msgstr "``build_all`` (ほかの二つを明示的に使用せずに構成した場合)" -#: ../../using/configure.rst:1386 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -2180,123 +2358,136 @@ msgid "" "otherwise explain, ``make clean && make`` should work around most dependency " "problems, at the expense of longer build times." msgstr "" +"Make は、直近のソースファイルの変更に応じて、古くなったと判断したターゲット " +"(オブジェクトファイルと実行ファイル) を再ビルドし、必要であれば " +"``configure`` も再実行します。\n" +"ただし、ソースとターゲットの依存関係は多く、手作業で管理されているため、Make " +"が再ビルドの必要なターゲットをすべて正しく検出するための情報を持っていないこ" +"とがあります。\n" +"再ビルドされなかったターゲットによっては、さまざまな問題が発生する可能性があ" +"ります。\n" +"ほかに原因の説明がつかないビルドやテストの問題がある場合は、``make clean && " +"make`` を実行すると、ビルド時間は長くなりますが、依存関係の問題の大半を回避で" +"きるはずです。" -#: ../../using/configure.rst:1399 msgid "make platform" -msgstr "" +msgstr "make platform" -#: ../../using/configure.rst:1401 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " "line describing the details of the build platform, e.g., ``macosx-14.3-" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" +"``python`` プログラムをビルドしますが、標準ライブラリの拡張モジュールはビルド" +"しません。\n" +"ビルドプラットフォームの詳細を表す 1 行 (例えば ``macosx-14.3-arm64-3.12`` " +"や ``linux-x86_64-3.13``) を含む、``platform`` という名前のファイルを生成しま" +"す。" -#: ../../using/configure.rst:1408 msgid "make profile-opt" -msgstr "" +msgstr "make profile-opt" -#: ../../using/configure.rst:1410 msgid "" "Build Python using profile-guided optimization (PGO). You can use the " "configure :option:`--enable-optimizations` option to make this the default " "target of the ``make`` command (``make all`` or just ``make``)." msgstr "" +"プロファイルに基づく最適化 (PGO) を使用して Python をビルドします。\n" +"configure の :option:`--enable-optimizations` オプションを使用すると、この" +"ターゲットを ``make`` コマンド (``make all`` または単に ``make``) のデフォル" +"トにできます。" -#: ../../using/configure.rst:1418 msgid "make clean" -msgstr "" +msgstr "make clean" -#: ../../using/configure.rst:1420 msgid "Remove built files." -msgstr "" +msgstr "ビルドしたファイルを削除します。" -#: ../../using/configure.rst:1424 msgid "make distclean" -msgstr "" +msgstr "make distclean" -#: ../../using/configure.rst:1426 msgid "" "In addition to the work done by ``make clean``, remove files created by the " "configure script. ``configure`` will have to be run before building again. " "[#]_" msgstr "" +"``make clean`` の処理に加え、configure スクリプトが作成したファイルを削除しま" +"す。\n" +"再びビルドする前に、``configure`` を実行する必要があります。 [#]_" -#: ../../using/configure.rst:1432 msgid "make install" -msgstr "" +msgstr "make install" -#: ../../using/configure.rst:1434 msgid "Build the ``all`` target and install Python." -msgstr "" +msgstr "``all`` ターゲットをビルドし、Python をインストールします。" -#: ../../using/configure.rst:1438 msgid "make test" -msgstr "" +msgstr "make test" -#: ../../using/configure.rst:1440 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option without GUI tests. Variables:" msgstr "" +"``all`` ターゲットをビルドし、``--fast-ci`` オプションを指定して、GUI テスト" +"を除いた Python のテストスイートを実行します。\n" +"変数:" -#: ../../using/configure.rst:1443 msgid "``TESTOPTS``: additional regrtest command-line options." -msgstr "" +msgstr "``TESTOPTS``: regrtest の追加のコマンドラインオプション。" -#: ../../using/configure.rst:1444 msgid "``TESTPYTHONOPTS``: additional Python command-line options." -msgstr "" +msgstr "``TESTPYTHONOPTS``: Python の追加のコマンドラインオプション。" -#: ../../using/configure.rst:1445 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." -msgstr "" +msgstr "``TESTTIMEOUT``: タイムアウトの秒数 (デフォルト: 10 分)。" -#: ../../using/configure.rst:1449 msgid "make ci" -msgstr "" +msgstr "make ci" -#: ../../using/configure.rst:1451 msgid "" "This is similar to ``make test``, but uses the ``-ugui`` to also run GUI " "tests." msgstr "" +"``make test`` と似ていますが、``-ugui`` を指定して GUI テストも実行します。" -#: ../../using/configure.rst:1457 msgid "make buildbottest" -msgstr "" +msgstr "make buildbottest" -#: ../../using/configure.rst:1459 msgid "" "This is similar to ``make test``, but uses the ``--slow-ci`` option and " "default timeout of 20 minutes, instead of ``--fast-ci`` option." msgstr "" +"``make test`` と似ていますが、``--fast-ci`` オプションの代わりに ``--slow-" +"ci`` オプションを使用し、デフォルトのタイムアウトを 20 分にします。" -#: ../../using/configure.rst:1464 msgid "make regen-all" -msgstr "" +msgstr "make regen-all" -#: ../../using/configure.rst:1466 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" "names`` and ``autoconf`` must be run separately for the remaining `generated " "files <#generated-files>`_." msgstr "" +"生成済みファイルの (ほぼ) すべてを再生成します。\n" +"これには、バイトコードのケースやパーサ生成用ファイルなどが含まれます。\n" +"残りの `生成済みファイル <#generated-files>`_ については、``make regen-" +"stdlib-module-names`` と ``autoconf`` を別途実行する必要があります。" -#: ../../using/configure.rst:1473 msgid "C extensions" -msgstr "" +msgstr "C 拡張" -#: ../../using/configure.rst:1475 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute:" msgstr "" +"``sys`` モジュールのように、組み込みモジュールとしてビルドする C 拡張がありま" +"す。\n" +"これらは ``Py_BUILD_CORE_BUILTIN`` マクロを定義してビルドします。\n" +"組み込みモジュールには ``__file__`` 属性がありません:" -#: ../../using/configure.rst:1479 msgid "" ">>> import sys\n" ">>> sys\n" @@ -2306,15 +2497,24 @@ msgid "" " File \"\", line 1, in \n" "AttributeError: module 'sys' has no attribute '__file__'" msgstr "" +">>> import sys\n" +">>> sys\n" +"\n" +">>> sys.__file__\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"AttributeError: module 'sys' has no attribute '__file__'" -#: ../../using/configure.rst:1489 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64:" msgstr "" +"``_asyncio`` モジュールのように、動的ライブラリとしてビルドする C 拡張もあり" +"ます。\n" +"これらは ``Py_BUILD_CORE_MODULE`` マクロを定義してビルドします。\n" +"Linux x86-64 での例:" -#: ../../using/configure.rst:1493 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" @@ -2323,14 +2523,23 @@ msgid "" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" msgstr "" +">>> import _asyncio\n" +">>> _asyncio\n" +"\n" +">>> _asyncio.__file__\n" +"'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1501 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" "in modules. Extensions defined after the ``*shared*`` marker are built as " "dynamic libraries." msgstr "" +":file:`Modules/Setup` は、C 拡張をビルドする Makefile ターゲットの生成に使用" +"します。\n" +"ファイルの先頭では、C 拡張を組み込みモジュールとしてビルドします。\n" +"``*shared*`` マーカーの後で定義した拡張は、動的ライブラリとしてビルドします。" #: ../../using/configure.rst:1505 msgid "" @@ -2347,37 +2556,39 @@ msgstr "" msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "" -#: ../../using/configure.rst:1512 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" +"共有ライブラリとしてビルドする C 拡張に誤って ``Py_BUILD_CORE_BUILTIN`` マク" +"ロを使用すると、:samp:`PyInit_{xxx}()` 関数がエクスポートされず、インポート時" +"に :exc:`ImportError` が発生します。" -#: ../../using/configure.rst:1518 msgid "Compiler and linker flags" -msgstr "" +msgstr "コンパイラとリンカのフラグ" -#: ../../using/configure.rst:1520 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" +"``./configure`` スクリプトと環境変数によって設定され、``Makefile`` で使用され" +"るオプション。" -#: ../../using/configure.rst:1524 msgid "Preprocessor flags" -msgstr "" +msgstr "プリプロセッサのフラグ" -#: ../../using/configure.rst:1528 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." -msgstr "" +msgstr "``./configure`` スクリプトに渡された :envvar:`CPPFLAGS` 変数の値。" -#: ../../using/configure.rst:1534 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" +"(Objective) C/C++ プリプロセッサのフラグ。\n" +"例えば、標準以外のディレクトリ *include_dir* にヘッダーファイルがある場合の :" +"samp:`-I{include_dir}`。" #: ../../using/configure.rst:1537 ../../using/configure.rst:1733 msgid "" @@ -2386,50 +2597,52 @@ msgid "" "in the environment variables." msgstr "" -#: ../../using/configure.rst:1547 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" +"インタープリタのオブジェクトファイルをビルドするために追加するプリプロセッサ" +"のフラグ。" -#: ../../using/configure.rst:1549 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" +"デフォルト: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " +"$(CPPFLAGS)``。" -#: ../../using/configure.rst:1554 msgid "Compiler flags" -msgstr "" +msgstr "コンパイラのフラグ" -#: ../../using/configure.rst:1560 msgid "Example: ``gcc -pthread``." -msgstr "" +msgstr "例: ``gcc -pthread``。" -#: ../../using/configure.rst:1564 msgid "C++ compiler command." -msgstr "" +msgstr "C++ コンパイラのコマンド。" -#: ../../using/configure.rst:1566 msgid "Example: ``g++ -pthread``." -msgstr "" +msgstr "例: ``g++ -pthread``。" -#: ../../using/configure.rst:1574 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" +":envvar:`CFLAGS_NODIST` は、インタープリタと標準ライブラリの C 拡張のビルドに" +"使用します。\n" +"Python のインストール後に :envvar:`CFLAGS` に *含めるべきでない* コンパイラフ" +"ラグには、この変数を使用してください (:gh:`65320`)。" -#: ../../using/configure.rst:1578 msgid "In particular, :envvar:`CFLAGS` should not contain:" -msgstr "" +msgstr "特に、:envvar:`CFLAGS` には次のものを含めないようにしてください:" -#: ../../using/configure.rst:1580 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" +"コンパイラフラグ ``-I`` (インクルードファイルの検索パスの設定用)。\n" +"``-I`` フラグは左から右へ処理されるため、:envvar:`CFLAGS` にあるフラグは、" +"ユーザーやパッケージが指定する ``-I`` フラグよりも優先されてしまいます。" #: ../../using/configure.rst:1585 msgid "" @@ -2437,229 +2650,224 @@ msgid "" "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1593 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" +"``make install`` で PYC ファイルをビルドするときに、:mod:`compileall` のコマ" +"ンドラインに渡すオプション。\n" +"デフォルト: ``-j0``。" -#: ../../using/configure.rst:1600 msgid "Extra C compiler flags." -msgstr "" +msgstr "追加の C コンパイラのフラグ。" -#: ../../using/configure.rst:1604 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." -msgstr "" +msgstr "``./configure`` スクリプトに渡された :envvar:`CFLAGS` 変数の値。" -#: ../../using/configure.rst:1611 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" +"``./configure`` スクリプトに渡された :envvar:`CFLAGS_NODIST` 変数の値。" -#: ../../using/configure.rst:1618 msgid "Base compiler flags." -msgstr "" +msgstr "基本のコンパイラフラグ。" -#: ../../using/configure.rst:1622 msgid "Optimization flags." -msgstr "" +msgstr "最適化フラグ。" -#: ../../using/configure.rst:1626 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" +"``Python/dtoa.c`` のコンパイルに使用する、厳密なエイリアシングまたは非厳密な" +"エイリアシングのフラグ。" -#: ../../using/configure.rst:1632 msgid "Flags used to compile ``Python/ceval.c``." -msgstr "" +msgstr "``Python/ceval.c`` のコンパイルに使用するフラグ。" -#: ../../using/configure.rst:1638 msgid "Compiler flags used to build a shared library." -msgstr "" +msgstr "共有ライブラリのビルドに使用するコンパイラフラグ。" -#: ../../using/configure.rst:1640 msgid "For example, ``-fPIC`` is used on Linux and on BSD." -msgstr "" +msgstr "例えば、Linux と BSD では ``-fPIC`` を使用します。" -#: ../../using/configure.rst:1644 msgid "Extra C flags added for building the interpreter object files." msgstr "" +"インタープリタのオブジェクトファイルをビルドするために追加する C フラグ。" -#: ../../using/configure.rst:1646 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" +"デフォルト: :option:`--enable-shared` を使用する場合は ``$(CCSHARED)``、それ" +"以外の場合は空文字列。" -#: ../../using/configure.rst:1651 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" +"デフォルト: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " +"$(EXTRA_CFLAGS)``。" -#: ../../using/configure.rst:1655 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" +"デフォルト: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/" +"Include/internal``。" -#: ../../using/configure.rst:1661 msgid "C flags used for building the interpreter object files." -msgstr "" +msgstr "インタープリタのオブジェクトファイルのビルドに使用する C フラグ。" -#: ../../using/configure.rst:1663 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" +"デフォルト: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " +"$(CFLAGSFORSHARED)``。" -#: ../../using/configure.rst:1669 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." -msgstr "" +msgstr "デフォルト: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``。" -#: ../../using/configure.rst:1675 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" +":mod:`posix` モジュールのように、標準ライブラリの拡張モジュールを組み込みモ" +"ジュールとしてビルドするためのコンパイラフラグ。" -#: ../../using/configure.rst:1678 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." -msgstr "" +msgstr "デフォルト: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``。" -#: ../../using/configure.rst:1684 msgid "Purify command. Purify is a memory debugger program." msgstr "" +"Purify のコマンド。\n" +"Purify はメモリデバッガプログラムです。" -#: ../../using/configure.rst:1686 msgid "Default: empty string (not used)." -msgstr "" +msgstr "デフォルト: 空文字列 (使用しません)。" -#: ../../using/configure.rst:1690 msgid "Linker flags" -msgstr "" +msgstr "リンカのフラグ" -#: ../../using/configure.rst:1694 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" +"``python`` や ``_testembed`` のようなプログラムをビルドするためのリンカコマン" +"ド。" -#: ../../using/configure.rst:1696 msgid "Default: ``$(PURIFY) $(CC)``." -msgstr "" +msgstr "デフォルト: ``$(PURIFY) $(CC)``。" -#: ../../using/configure.rst:1700 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." -msgstr "" +msgstr "``./configure`` スクリプトに渡された :envvar:`LDFLAGS` 変数の値。" -#: ../../using/configure.rst:1702 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" +":envvar:`CFLAGS` や :envvar:`LDFLAGS` などへの代入は避けてください。\n" +"そうすることで、ユーザーはあらかじめ設定された値を上書きせずに、コマンドライ" +"ンでこれらの変数の値に追加できます。" -#: ../../using/configure.rst:1710 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" +":envvar:`LDFLAGS_NODIST` は :envvar:`CFLAGS_NODIST` と同じように使用しま" +"す。\n" +"Python のインストール後に :envvar:`LDFLAGS` に *含めるべきでない* リンカフラ" +"グには、この変数を使用してください (:gh:`65320`)。" -#: ../../using/configure.rst:1714 msgid "In particular, :envvar:`LDFLAGS` should not contain:" -msgstr "" +msgstr "特に、:envvar:`LDFLAGS` には次のものを含めないようにしてください:" -#: ../../using/configure.rst:1716 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" +"コンパイラフラグ ``-L`` (ライブラリの検索パスの設定用)。\n" +"``-L`` フラグは左から右へ処理されるため、:envvar:`LDFLAGS` にあるフラグは、" +"ユーザーやパッケージが指定する ``-L`` フラグよりも優先されてしまいます。" -#: ../../using/configure.rst:1723 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" +"``./configure`` スクリプトに渡された :envvar:`LDFLAGS_NODIST` 変数の値。" -#: ../../using/configure.rst:1730 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" +"リンカのフラグ。\n" +"例えば、標準以外のディレクトリ *lib_dir* にライブラリがある場合の :samp:`-" +"L{lib_dir}`。" -#: ../../using/configure.rst:1737 msgid "" "Please consider using ``EXE_LDFLAGS`` if the supplied linker flags are " "executable specific, e.g. GCC's ``-pie`` flag." msgstr "" +"指定するリンカフラグが GCC の ``-pie`` フラグのように実行ファイル専用のもので" +"あれば、``EXE_LDFLAGS`` の使用を検討してください。" -#: ../../using/configure.rst:1742 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" +"Python 実行ファイルのリンク時に、ライブラリをリンカに渡すためのリンカフラグ。" -#: ../../using/configure.rst:1745 msgid "Example: ``-lrt``." -msgstr "" +msgstr "例: ``-lrt``。" -#: ../../using/configure.rst:1749 msgid "Command to build a shared library." -msgstr "" +msgstr "共有ライブラリをビルドするコマンド。" -#: ../../using/configure.rst:1751 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." -msgstr "" +msgstr "デフォルト: ``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1755 msgid "Command to build ``libpython`` shared library." -msgstr "" +msgstr "``libpython`` 共有ライブラリをビルドするコマンド。" -#: ../../using/configure.rst:1757 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." -msgstr "" +msgstr "デフォルト: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1761 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." -msgstr "" +msgstr "デフォルト: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1765 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." -msgstr "" +msgstr "デフォルト: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1771 msgid "Linker flags used for building the interpreter object files." -msgstr "" +msgstr "インタープリタのオブジェクトファイルのビルドに使用するリンカフラグ。" -#: ../../using/configure.rst:1777 msgid "" "Linker flags used for building executable targets such as the interpreter. " "If supplied, :envvar:`PY_CORE_EXE_LDFLAGS` will be used in replacement of :" "envvar:`PY_CORE_LDFLAGS`." msgstr "" +"インタープリタなどの実行ファイルターゲットのビルドに使用するリンカフラグ。\n" +":envvar:`PY_CORE_EXE_LDFLAGS` を指定すると、:envvar:`PY_CORE_LDFLAGS` の代わ" +"りに使用します。" -#: ../../using/configure.rst:1785 msgid "" "Value of :envvar:`EXE_LDFLAGS` variable passed to the ``./configure`` script." -msgstr "" +msgstr "``./configure`` スクリプトに渡された :envvar:`EXE_LDFLAGS` 変数の値。" -#: ../../using/configure.rst:1792 msgid "Linker flags used for building the interpreter and executable targets." -msgstr "" +msgstr "インタープリタと実行ファイルターゲットのビルドに使用するリンカフラグ。" -#: ../../using/configure.rst:1795 msgid "Default: ``$(PY_CORE_LDFLAGS)``" -msgstr "" +msgstr "デフォルト: ``$(PY_CORE_LDFLAGS)``" #: ../../using/configure.rst:1801 msgid "Footnotes" msgstr "脚注" -#: ../../using/configure.rst:1802 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git " @@ -2668,3 +2876,11 @@ msgid "" "clean build. **Use with care**, as it will delete all files not checked into " "Git, including your new, uncommitted work." msgstr "" +"チェックアウトを「クリーン」にするさらに徹底した方法は、``git clean -fdx`` で" +"す。\n" +"このコマンドは Git が認識していないファイルをすべて削除します。\n" +"``git bisect`` でバグを調査するときは、完全にクリーンなビルドを保証するため、" +"`各調査の間での実行が推奨されています `_。\n" +"新しく作成した未コミットの作業を含め、Git にチェックインされていないすべての" +"ファイルを削除するため、**注意して使用してください**。" diff --git a/using/editors.po b/using/editors.po index 9f432bcab..bdb8a7248 100644 --- a/using/editors.po +++ b/using/editors.po @@ -41,7 +41,6 @@ msgstr "" msgid "IDLE --- Python editor and shell" msgstr "IDLE --- Python のエディタとシェル" -#: ../../using/editors.rst:16 msgid "" "IDLE is Python’s Integrated Development and Learning Environment and is " "generally bundled with Python installs. If you are on Linux and do not have " @@ -49,12 +48,15 @@ msgid "" "`. For more information see the :ref:`IDLE docs " "`." msgstr "" +"IDLE は Python の統合開発学習環境で、通常は Python のインストールに含まれてい" +"ます。\n" +"Linux を使用していて IDLE がインストールされていない場合は、:ref:`Linux への " +"IDLE のインストール ` を参照してください。\n" +"詳しくは :ref:`IDLE のドキュメント ` を参照してください。" -#: ../../using/editors.rst:22 msgid "Other Editors and IDEs" -msgstr "" +msgstr "その他のエディタと IDE" -#: ../../using/editors.rst:24 msgid "" "Python's community wiki has information submitted by the community on " "Editors and IDEs. Please go to `Python Editors `_ for a comprehensive " "list." msgstr "" +"Python のコミュニティ wiki には、エディタや IDE についてコミュニティから寄せ" +"られた情報があります。\n" +"網羅的な一覧については、`Python Editors `_ と `Integrated Development Environments `_ を参照してください。" diff --git a/using/ios.po b/using/ios.po index 684010de1..c9d23a8f2 100644 --- a/using/ios.po +++ b/using/ios.po @@ -212,7 +212,6 @@ msgstr "" "うに後処理を行うかの詳細は、 :ref:`プロジェクトに Python を追加する ` のガイドを参照してください。" -#: ../../using/ios.rst:90 msgid "" "To help Python discover binaries in their new location, the original ``.so`` " "file on ``sys.path`` is replaced with a ``.fwork`` file. This file is a text " @@ -221,12 +220,14 @@ msgid "" "framework must contain a ``.origin`` file that contains the location of the " "``.fwork`` file, relative to the app bundle." msgstr "" -"Python が新しい場所にあるバイナリを見つけることを助けるために、 ``sys.path`` " -"にある元の ``.so`` ファイルは ``.fwork`` ファイルに置き換えられます。 この" -"ファイルは、アプリバンドルからのレームワークバイナリの相対パスを含むテキスト" -"ファイルです。フレームワークが元の場所に解決できるようにするためには、フレー" -"ムワークは、アプリバンドルからの ``.fwork`` ファイルの相対パスが含まれた、 " -"``.origin`` ファイルを含む必要があります。" +"Python が移動先のバイナリを見つけられるように、``sys.path`` 上の元の ``.so`` " +"ファイルは ``.fwork`` ファイルに置き換えられます。\n" +"このテキストファイルには、アプリバンドルからの相対パスでフレームワークのバイ" +"ナリの場所が記載されています。\n" +"フレームワークから元の場所を逆に解決できるようにするため、フレームワークには " +"``.origin`` ファイルを含める必要があります。\n" +"このファイルには、アプリバンドルからの相対パスで ``.fwork`` ファイルの場所を" +"記載します。" #: ../../using/ios.rst:97 msgid "" @@ -256,7 +257,6 @@ msgstr "" "む ``Frameworks/foo.bar._whiz.framework/foo.bar._whiz.origin`` も含まなければ" "なりません。" -#: ../../using/ios.rst:110 msgid "" "When running on iOS, the Python interpreter will install an :class:" "`~importlib.machinery.AppleFrameworkLoader` that is able to read and import " @@ -265,12 +265,13 @@ msgid "" "class:`~importlib.machinery.ModuleSpec` for the loaded module will report " "the ``origin`` as the location of the binary in the framework folder." msgstr "" -"iOS 上で実行している場合、 Python インタープリタは ``.fwork`` ファイルを読み" -"込んでインポートすることができる :class:`~importlib.machinery." -"AppleFrameworkLoader` をインストールします。インポートされると、バイナリモ" -"ジュールの ``__file__`` 属性は ``.fwork`` ファイルの場所を返します。一方、読" -"み込まれたモジュールの :class:`~importlib.machinery.ModuleSpec` はフレーム" -"ワークフォルダのバイナリの場所として ``origin`` を返します。" +"iOS 上では、Python インタープリタは ``.fwork`` ファイルを読み込んでインポート" +"できる :class:`~importlib.machinery.AppleFrameworkLoader` をインストールしま" +"す。\n" +"インポート後、バイナリモジュールの ``__file__`` 属性は ``.fwork`` ファイルの" +"場所を示します。\n" +"一方、読み込まれたモジュールの :class:`~importlib.machinery.ModuleSpec` の " +"``origin`` は、フレームワークフォルダ内のバイナリの場所を示します。" #: ../../using/ios.rst:118 msgid "Compiler stub binaries" @@ -295,17 +296,16 @@ msgstr "" "``xcrun`` の出力はマシン固有のパスを含み、ユーザー間で共有できない sysconfig " "モジュールにつながり、" -#: ../../using/ios.rst:128 msgid "" "It results in ``CC``/``CPP``/``LD``/``AR`` definitions that include spaces. " "There is a lot of C ecosystem tooling that assumes that you can split a " "command line at the first space to get the path to the compiler executable; " "this isn't the case when using ``xcrun``." msgstr "" -"これにより、 ``CC``/``CPP``/``LD``/``AR`` 定義にスペースが含まれることになり" -"ます。多くの C エコシステムツールが、最初のスペースでコマンドラインを分割し、" -"コンパイラ実行ファイルを取得できることを前提としています。しかし、 ``xcrun`` " -"を使用する場合はそうではありません。" +"``CC``/``CPP``/``LD``/``AR`` の定義にスペースが含まれることになります。\n" +"C のエコシステムには、コマンドラインを最初のスペースで区切るとコンパイラの実" +"行可能ファイルのパスが得られると仮定するツールが多くあります。\n" +"``xcrun`` を使う場合は、この仮定が成り立ちません。" #: ../../using/ios.rst:133 msgid "" @@ -384,7 +384,6 @@ msgstr "" msgid "To add Python to an iOS Xcode project:" msgstr "Python を iOS Xcode プロジェクトに追加するには:" -#: ../../using/ios.rst:172 msgid "" "Build or obtain a Python ``XCFramework``. See the instructions in :source:" "`Platforms/Apple/iOS/README.md` (in the CPython source distribution) for " @@ -392,6 +391,11 @@ msgid "" "need a build that supports ``arm64-apple-ios``, plus one of either ``arm64-" "apple-ios-simulator`` or ``x86_64-apple-ios-simulator``." msgstr "" +"Python の ``XCFramework`` をビルドするか、入手します。\n" +"Python の ``XCFramework`` をビルドする方法については、CPython のソース配布物" +"にある :source:`Platforms/Apple/iOS/README.md` の手順を参照してください。\n" +"少なくとも、``arm64-apple-ios`` と、``arm64-apple-ios-simulator`` または " +"``x86_64-apple-ios-simulator`` のいずれかをサポートするビルドが必要です。" #: ../../using/ios.rst:178 msgid "" @@ -418,13 +422,12 @@ msgstr "" "で、他の場所を使用することも出来ます。フォルダがアプリのターゲットに関連付け" "られていることを確認してください。" -#: ../../using/ios.rst:189 msgid "" "Select the app target by selecting the root node of your Xcode project, then " "the target name in the sidebar that appears." msgstr "" -"Xcode プロジェクトのルートノードを選択することで、アプリのターゲットを選択し" -"てください。すると、ターゲット名がサイドバーに現れるはずです。" +"Xcode プロジェクトのルートノードを選択し、表示されたサイドバーでターゲット名" +"を選択して、アプリのターゲットを選択します。" #: ../../using/ios.rst:192 msgid "" @@ -472,7 +475,6 @@ msgstr "Apple Clang - Warnings - All languages" msgid "Quoted Include In Framework Header: No" msgstr "Quoted Include In Framework Header: No" -#: ../../using/ios.rst:211 msgid "" "Add a build step that processes the Python standard library, and your own " "Python binary dependencies. In the \"Build Phases\" tab, add a new \"Run " @@ -481,11 +483,14 @@ msgid "" "disable the \"Based on dependency analysis\" checkbox, and set the script " "content to:" msgstr "" -"Python の標準ライブラリおよび独自の Python バイナリ依存関係を処理するビルドス" -"テップを追加します。 \"Build Phases\" タブで、新しい \"Run Script\" ビルドス" -"テップを \"Embed Frameworks\" ステップの前に追加してください。ステップの名前" -"は \"Process Python libraries\" にして、 \"Based on dependency analysis\" の" -"チェックボックスを外し、スクリプトの内容を次のように設定してください:" +"Python 標準ライブラリと、アプリが依存する Python バイナリを処理するビルドス" +"テップを追加します。\n" +"\"Build Phases\" タブで、\"Embed Frameworks\" ステップの *前*、かつ \"Copy " +"Bundle Resources\" ステップの *後* に、新しい \"Run Script\" ビルドステップを" +"追加します。\n" +"ステップに \"Process Python libraries\" という名前を付け、\"Based on " +"dependency analysis\" チェックボックスをオフにし、スクリプトの内容を次のよう" +"に設定します:" #: ../../using/ios.rst:218 msgid "" @@ -628,21 +633,29 @@ msgstr "" msgid "Testing a Python package" msgstr "Python パッケージのテスト" -#: ../../using/ios.rst:269 msgid "" "The CPython source tree contains :source:`a testbed project ` that is used to run the CPython test suite on the iOS simulator. " "This testbed can also be used as a testbed project for running your Python " "library's test suite on iOS." msgstr "" +"CPython ソースツリーには、iOS シミュレータ上で CPython のテストスイートを実行" +"するための :source:`テストベッドプロジェクト ` が含" +"まれています。\n" +"このテストベッドは、自分の Python ライブラリのテストスイートを iOS 上で実行す" +"るためのテストベッドプロジェクトとしても使用できます。" -#: ../../using/ios.rst:273 msgid "" "After building or obtaining an iOS XCFramework (see :source:`Platforms/Apple/" "iOS/README.md` for details), create a clone of the Python iOS testbed " "project. If you used the ``Platforms/Apple`` build script to build the " "XCframework, you can run:" msgstr "" +"iOS 用の XCFramework をビルドするか入手したら (:source:`Platforms/Apple/iOS/" +"README.md` を参照)、Python の iOS テストベッドプロジェクトのクローンを作成し" +"ます。\n" +"``Platforms/Apple`` ビルドスクリプトを使って XCframework をビルドした場合は、" +"次のコマンドを実行できます:" #: ../../using/ios.rst:277 msgid "" @@ -658,12 +671,14 @@ msgstr "" "もしくは、独自の XCFramework を調達した場合は、次のコマンドを実行して行えま" "す:" -#: ../../using/ios.rst:283 msgid "" "$ python Platforms/Apple/testbed clone --platform iOS --framework --app --app app-" "testbed" msgstr "" +"$ python Platforms/Apple/testbed clone --platform iOS --framework --app --app app-" +"testbed" #: ../../using/ios.rst:287 msgid "" @@ -682,37 +697,42 @@ msgstr "" "れらは ``app-testbed/Testbed/app_packages`` フォルダの中にインストールできま" "す。" -#: ../../using/ios.rst:294 msgid "" "You can then use the ``app-testbed`` folder to run the test suite for your " "app, For example, if ``module1.tests`` was the entry point to your test " "suite, you could run:" msgstr "" +"これで、``app-testbed`` フォルダを使ってアプリのテストスイートを実行できま" +"す。\n" +"例えば、テストスイートのエントリーポイントが ``module1.tests`` であれば、次の" +"コマンドを実行できます:" #: ../../using/ios.rst:298 msgid "$ python app-testbed run -- module1.tests" msgstr "$ python app-testbed run -- module1.tests" -#: ../../using/ios.rst:302 msgid "" "This is the equivalent of running ``python -m module1.tests`` on a desktop " "Python build. Any arguments after the ``--`` will be passed to the testbed " "as if they were arguments to ``python -m`` on a desktop machine." msgstr "" +"これは、デスクトップ用の Python ビルドで ``python -m module1.tests`` を実行す" +"ることに相当します。\n" +"``--`` の後にある引数は、デスクトップマシンで ``python -m`` に渡す引数と同じ" +"ようにテストベッドに渡されます。" -#: ../../using/ios.rst:306 msgid "You can also open the testbed project in Xcode by running:" msgstr "" +"次のコマンドを実行して、テストベッドプロジェクトを Xcode で開くこともできま" +"す:" #: ../../using/ios.rst:308 msgid "$ open app-testbed/iOSTestbed.xcodeproj" msgstr "$ open app-testbed/iOSTestbed.xcodeproj" -#: ../../using/ios.rst:312 msgid "This will allow you to use the full Xcode suite of tools for debugging." -msgstr "" +msgstr "これにより、デバッグに Xcode のすべてのツールを使用できます。" -#: ../../using/ios.rst:314 msgid "" "The arguments used to run the test suite are defined as part of the test " "plan. To modify the test plan, select the test plan node of the project tree " @@ -720,20 +740,28 @@ msgid "" "\"Configurations\" tab. Modify the \"Arguments Passed On Launch\" value to " "change the testing arguments." msgstr "" +"テストスイートを実行するための引数は、テストプランの一部として定義されていま" +"す。\n" +"テストプランを変更するには、プロジェクトツリーのテストプランノード (ルート" +"ノードの最初の子ノードのはずです) を選択し、\"Configurations\" タブを選択しま" +"す。\n" +"\"Arguments Passed On Launch\" の値を変更すると、テストの引数を変更できます。" -#: ../../using/ios.rst:320 msgid "" "The test plan also disables parallel testing, and specifies the use of the " "``Testbed.lldbinit`` file for providing configuration of the debugger. The " "default debugger configuration disables automatic breakpoints on the " "``SIGINT``, ``SIGUSR1``, ``SIGUSR2``, and ``SIGXFSZ`` signals." msgstr "" +"テストプランでは並列テストも無効にし、デバッガの設定に ``Testbed.lldbinit`` " +"ファイルを使うように指定しています。\n" +"デフォルトのデバッガ設定では、``SIGINT``、``SIGUSR1``、``SIGUSR2``、" +"``SIGXFSZ`` シグナルによる自動ブレークポイントを無効にしています。" #: ../../using/ios.rst:326 msgid "App Store Compliance" msgstr "App Store コンプライアンス" -#: ../../using/ios.rst:328 msgid "" "The only mechanism for distributing apps to third-party iOS devices is to " "submit the app to the iOS App Store; apps submitted for distribution must " @@ -742,6 +770,13 @@ msgid "" "problematic code. There are some steps that must be taken to ensure that " "your app will be able to pass these validation steps." msgstr "" +"第三者の iOS デバイスにアプリを配布するには、iOS App Store にアプリを提出する" +"しかありません。\n" +"配布のために提出したアプリは、Apple のアプリ審査に合格する必要があります。\n" +"この審査には、提出されたアプリケーションバンドル内に問題のあるコードがないか" +"を調べる、一連の自動検証ルールが含まれています。\n" +"アプリがこの検証に合格できるようにするには、いくつかの手順を実施する必要があ" +"ります。" #: ../../using/ios.rst:336 msgid "Incompatible code in the standard library" @@ -775,7 +810,6 @@ msgstr "" msgid "Privacy manifests" msgstr "プライバシーマニフェスト" -#: ../../using/ios.rst:351 msgid "" "In April 2025, Apple introduced a requirement for `certain third-party " "libraries to provide a Privacy Manifest `__。\n" +"そのため、対象となるライブラリを使うバイナリモジュールがある場合は、そのライ" +"ブラリ用の ``.xcprivacy`` ファイルを提供する必要があります。\n" +"OpenSSL はこの要件の対象となるライブラリの一つですが、ほかにも対象のライブラ" +"リがあります。" -#: ../../using/ios.rst:358 msgid "" "If you produce a binary module named ``mymodule.so``, and use you the Xcode " "build script described in step 7 above, you can place a ``mymodule." @@ -793,3 +833,8 @@ msgid "" "installed into the required location when the binary module is converted " "into a framework." msgstr "" +"``mymodule.so`` という名前のバイナリモジュールを作成し、上記の手順 7 で説明し" +"た Xcode ビルドスクリプトを使用する場合は、``mymodule.so`` と同じ場所に " +"``mymodule.xcprivacy`` ファイルを配置できます。\n" +"バイナリモジュールをフレームワークに変換する際に、プライバシーマニフェストが" +"必要な場所にインストールされます。" diff --git a/using/mac.po b/using/mac.po index e8d81ef3f..f664bba0c 100644 --- a/using/mac.po +++ b/using/mac.po @@ -27,15 +27,18 @@ msgstr "" msgid "Using Python on macOS" msgstr "macOS で Python を使う" -#: ../../using/mac.rst:9 msgid "" "This document aims to give an overview of macOS-specific behavior you should " "know about to get started with Python on Mac computers. Python on a Mac " "running macOS is very similar to Python on other Unix-derived platforms, but " "there are some differences in installation and some features." msgstr "" +"このドキュメントでは、Mac コンピュータで Python を使い始める際に知っておくべ" +"き、macOS 固有の挙動を概説します。\n" +"macOS を実行する Mac 上の Python は、ほかの Unix 派生プラットフォーム上の " +"Python と非常によく似ていますが、インストール方法や一部の機能には違いがありま" +"す。" -#: ../../using/mac.rst:14 msgid "" "There are various ways to obtain and install Python for macOS. Pre-built " "versions of the most recent versions of Python are available from a number " @@ -44,16 +47,21 @@ msgid "" "`_. See :ref:`alternative_bundles` for " "some other options." msgstr "" +"macOS 用の Python を入手してインストールする方法はいくつかあります。\n" +"最近の Python のバージョンは、複数の配布元からビルド済みのものを入手できま" +"す。\n" +"このドキュメントの大部分では、CPython リリースチームが `python.org のウェブサ" +"イト `_ でダウンロード用に提供している " +"Python の使い方を説明します。\n" +"ほかの選択肢については :ref:`alternative_bundles` を参照してください。" -#: ../../using/mac.rst:25 msgid "Using Python for macOS from ``python.org``" -msgstr "" +msgstr "``python.org`` の macOS 用 Python を使う" #: ../../using/mac.rst:28 msgid "Installation steps" msgstr "インストール手順" -#: ../../using/mac.rst:30 msgid "" "For `current Python versions `_ (other " "than those in ``security`` status), the release team produces a **Python for " @@ -66,8 +74,18 @@ msgid "" "wide range of macOS versions, currently typically from at least **macOS " "10.15 Catalina** on." msgstr "" +"リリースチームは、`現在の Python バージョン `_ (``security`` 状態のものを除く) のリリースごとに、**Python for " +"macOS** インストーラパッケージを作成します。\n" +"利用できるインストーラの一覧は `macOS のダウンロードページ `__ にあります。\n" +"可能な限り、サポートされている最新の Python バージョンの使用を推奨します。\n" +"現在のインストーラは、幅広い macOS バージョンに対応するすべての Mac (Apple " +"Silicon と Intel) 上でネイティブに動作する、Python の `universal2 バイナリ " +"`_ ビルドを提供します。\n" +"対応する macOS は、現在では通常、少なくとも **macOS 10.15 Catalina** 以降で" +"す。" -#: ../../using/mac.rst:42 msgid "" "The downloaded file is a standard macOS installer package file (``.pkg``). " "File integrity information (such as checksum, size, and Sigstore signature) " @@ -76,15 +94,24 @@ msgid "" "Foundation`` Apple Developer ID certificates to meet `macOS Gatekeeper " "requirements `_." msgstr "" +"ダウンロードされるファイルは、標準の macOS インストーラパッケージファイル " +"(``.pkg``) です。\n" +"各ファイルの整合性情報 (チェックサム、サイズ、Sigstore 署名など) は、リリース" +"のダウンロードページに掲載されています。\n" +"インストーラパッケージとその内容は、`macOS Gatekeeper の要件 `_ を満たすように、``Python Software " +"Foundation`` の Apple Developer ID 証明書を使って署名と公証が行われています。" -#: ../../using/mac.rst:48 msgid "" "For a default installation, double-click on the downloaded installer package " "file. This should launch the standard macOS Installer app and display the " "first of several installer steps." msgstr "" +"デフォルトのインストールを行うには、ダウンロードしたインストーラパッケージ" +"ファイルをダブルクリックします。\n" +"標準の macOS Installer アプリが起動し、いくつかあるインストール手順の最初の画" +"面が表示されるはずです。" -#: ../../using/mac.rst:54 msgid "" "Clicking on the **Continue** button brings up the **Read Me** for this " "installer. Besides other important information, the **Read Me** documents " @@ -93,23 +120,33 @@ msgid "" "default, this **Read Me** will also be installed in |" "applications_python_version_literal| and available to read anytime." msgstr "" +"**Continue** ボタンをクリックすると、このインストーラの **Read Me** が表示さ" +"れます。\n" +"**Read Me** には、インストールする Python のバージョンと、そのバージョンがサ" +"ポートする macOS のバージョンなど、重要な情報が記載されています。\n" +"ファイル全体を読むには、スクロールが必要な場合があります。\n" +"デフォルトでは、この **Read Me** も |applications_python_version_literal| に" +"インストールされ、いつでも読めるようになります。" -#: ../../using/mac.rst:62 msgid "" "Clicking on **Continue** proceeds to display the license for Python and for " "other included software. You will then need to **Agree** to the license " "terms before proceeding to the next step. This license file will also be " "installed and available to be read later." msgstr "" +"**Continue** をクリックすると、Python および同梱されるほかのソフトウェアのラ" +"イセンスが表示されます。\n" +"次の手順に進むには、ライセンス条項に **Agree** で同意する必要があります。\n" +"このライセンスファイルもインストールされ、後で読むことができます。" -#: ../../using/mac.rst:69 msgid "" "After the license terms are accepted, the next step is the **Installation " "Type** display. For most uses, the standard set of installation operations " "is appropriate." msgstr "" +"ライセンス条項に同意すると、次に **Installation Type** 画面が表示されます。\n" +"ほとんどの用途では、標準のインストール内容が適切です。" -#: ../../using/mac.rst:74 msgid "" "By pressing the **Customize** button, you can choose to omit or select " "certain package components of the installer. Click on each package name to " @@ -117,44 +154,55 @@ msgid "" "threaded feature, which is installed by default, see :ref:`install-" "freethreaded-macos`." msgstr "" +"**Customize** ボタンを押すと、インストーラの特定のパッケージ構成要素を選択し" +"たり、選択を解除したりできます。\n" +"パッケージ名をクリックすると、そのパッケージがインストールするものの説明が表" +"示されます。\n" +"デフォルトでインストールされるオプションのフリースレッド機能については、:ref:" +"`install-freethreaded-macos` を参照してください。" -#: ../../using/mac.rst:82 msgid "" "In either case, clicking **Install** will begin the install process by " "asking permission to install new software. A macOS user name with " "``Administrator`` privilege is needed as the installed Python will be " "available to all users of the Mac." msgstr "" +"どちらの場合も、**Install** をクリックすると、新しいソフトウェアをインストー" +"ルするための許可を求めてインストール処理が始まります。\n" +"インストールした Python はその Mac のすべてのユーザーが利用できるため、" +"``Administrator`` 権限のある macOS ユーザー名が必要です。" -#: ../../using/mac.rst:86 msgid "When the installation is complete, the **Summary** window will appear." -msgstr "" +msgstr "インストールが完了すると、**Summary** ウィンドウが表示されます。" -#: ../../using/mac.rst:90 msgid "" "Double-click on the :command:`Install Certificates.command` icon or file in " "the |applications_python_version_literal| window to complete the " "installation." msgstr "" +"|applications_python_version_literal| ウィンドウで :command:`Install " +"Certificates.command` のアイコンまたはファイルをダブルクリックして、インス" +"トールを完了します。" -#: ../../using/mac.rst:96 msgid "" "This will open a temporary :program:`Terminal` shell window that will use " "the new Python to download and install SSL root certificates for its use." msgstr "" +"一時的な :program:`Terminal` シェルウィンドウが開き、新しい Python を使って、" +"その Python 用の SSL ルート証明書をダウンロードしてインストールします。" -#: ../../using/mac.rst:102 msgid "" "If ``Successfully installed certifi`` and ``update complete`` appear in the " "terminal window, the installation is complete. Close this terminal window " "and the installer window." msgstr "" +"ターミナルウィンドウに ``Successfully installed certifi`` と ``update " +"complete`` が表示されれば、インストールは完了です。\n" +"このターミナルウィンドウとインストーラウィンドウを閉じてください。" -#: ../../using/mac.rst:106 msgid "A default install will include:" -msgstr "" +msgstr "デフォルトのインストールには、次のものが含まれます:" -#: ../../using/mac.rst:108 msgid "" "A |python_version_literal| folder in your :file:`Applications` folder. In " "here you find :program:`IDLE`, the development environment that is a " @@ -162,6 +210,11 @@ msgid "" "Launcher`, which handles double-clicking Python scripts from the macOS " "`Finder `_." msgstr "" +":file:`Applications` フォルダ内の |python_version_literal| フォルダ。\n" +"このフォルダには、公式の Python 配布物に標準で含まれる開発環境 :program:" +"`IDLE` と、macOS の `Finder `_ で " +"Python スクリプトをダブルクリックしたときの処理を担う :program:`Python " +"Launcher` があります。" #: ../../using/mac.rst:113 msgid "" @@ -171,7 +224,6 @@ msgid "" "to the Python executable are placed in :file:`/usr/local/bin/`." msgstr "" -#: ../../using/mac.rst:120 msgid "" "Recent versions of macOS include a :command:`python3` command in :file:`/usr/" "bin/python3` that links to a usually older and incomplete version of Python " @@ -184,12 +236,23 @@ msgid "" "default installer options should ensure that its :command:`python3` will be " "used instead of the system :command:`python3`." msgstr "" +"最近の macOS には、:file:`/usr/bin/python3` に :command:`python3` コマンドが" +"含まれています。\n" +"これは、Apple の開発ツールである :program:`Xcode` または :program:`Command " +"Line Tools for Xcode` によって、それらのツールで使用するために提供される " +"Python にリンクしており、通常は古く、不完全なバージョンです。\n" +"この Python は Apple が管理し、Apple 製やサードパーティのソフトウェアが使用す" +"るため、決して変更したり、削除しようとしたりしないでください。\n" +"``python.org`` から新しいバージョンの Python をインストールすると、コンピュー" +"タには異なる 2 つの Python 環境が存在することになりますが、両方とも動作し、共" +"存できます。\n" +"インストーラのデフォルトのオプションでは、システムの :command:`python3` に代" +"わって、インストールした :command:`python3` が使用されるはずです。" #: ../../using/mac.rst:131 msgid "How to run a Python script" msgstr "Python スクリプトの実行方法" -#: ../../using/mac.rst:133 msgid "" "There are two ways to invoke the Python interpreter. If you are familiar " "with using a Unix shell in a terminal window, you can invoke |" @@ -198,8 +261,14 @@ msgid "" "tutorial also has a useful section on :ref:`using Python interactively from " "a shell `." msgstr "" +"Python インタープリタを起動するには 2 つの方法があります。\n" +"ターミナルウィンドウで Unix シェルを使い慣れている場合は、|" +"python_x_dot_y_literal| または ``python3`` を実行できます。\n" +"必要に応じて、1 つ以上のコマンドラインオプション (:ref:`using-on-general` で" +"説明) をその後に指定できます。\n" +"Python チュートリアルの :ref:`シェルから Python を対話的に使用する ` 節も参考になります。" -#: ../../using/mac.rst:140 msgid "" "You can also invoke the interpreter through an integrated development " "environment. :ref:`idle` is a basic editor and interpreter environment which " @@ -208,32 +277,36 @@ msgid "" "are completely new to Python, you can read the tutorial introduction in that " "document." msgstr "" +"統合開発環境からインタープリタを起動することもできます。\n" +":ref:`idle` は、Python の標準配布物に含まれる基本的なエディタとインタープリタ" +"の環境です。\n" +":program:`IDLE` の Help メニューから Python のドキュメントを参照できます。\n" +"Python を初めて使う場合は、そのドキュメントにあるチュートリアルの導入部分を読" +"むとよいでしょう。" -#: ../../using/mac.rst:148 msgid "" "There are many other editors and IDEs available, see :ref:`editors` for more " "information." msgstr "" +"ほかにも多くのエディタや IDE を利用できます。\n" +"詳細は :ref:`editors` を参照してください。" -#: ../../using/mac.rst:151 msgid "" "To run a Python script file from the terminal window, you can invoke the " "interpreter with the name of the script file:" msgstr "" +"ターミナルウィンドウから Python スクリプトファイルを実行するには、スクリプト" +"ファイル名を指定してインタープリタを起動します:" -#: ../../using/mac.rst:154 msgid "|python_x_dot_y_literal| ``myscript.py``" -msgstr "" +msgstr "|python_x_dot_y_literal| ``myscript.py``" -#: ../../using/mac.rst:156 msgid "To run your script from the Finder, you can either:" -msgstr "" +msgstr "Finder からスクリプトを実行するには、次のいずれかの方法を使います:" -#: ../../using/mac.rst:158 msgid "Drag it to :program:`Python Launcher`." -msgstr "" +msgstr "スクリプトを :program:`Python Launcher` にドラッグします。" -#: ../../using/mac.rst:160 msgid "" "Select :program:`Python Launcher` as the default application to open your " "script (or any ``.py`` script) through the Finder Info window and double-" @@ -241,8 +314,15 @@ msgid "" "your script is launched. Option-dragging allows you to change these for one " "invocation, or use its ``Preferences`` menu to change things globally." msgstr "" +"Finder の情報ウィンドウで、スクリプト (または任意の ``.py`` スクリプト) を開" +"くデフォルトのアプリケーションとして :program:`Python Launcher` を選択し、ス" +"クリプトをダブルクリックします。\n" +":program:`Python Launcher` には、スクリプトの起動方法を制御するさまざまな環境" +"設定があります。\n" +"Option キーを押しながらドラッグすると、今回の起動に限って設定を変更できま" +"す。\n" +"全体の設定を変更するには、``Preferences`` メニューを使います。" -#: ../../using/mac.rst:166 msgid "" "Be aware that running the script directly from the macOS Finder might " "produce different results than when running from a terminal window as the " @@ -250,74 +330,82 @@ msgid "" "of environment variables in shell profiles. And, as with any other script or " "program, be certain of what you are about to run." msgstr "" +"macOS の Finder から直接スクリプトを実行すると、ターミナルウィンドウから実行" +"した場合と結果が異なることがあります。\n" +"シェルのプロファイルでの環境変数の設定など、通常のシェル環境でスクリプトが実" +"行されるわけではないためです。\n" +"また、ほかのスクリプトやプログラムを実行するときと同様に、何を実行しようとし" +"ているかを確認してください。" -#: ../../using/mac.rst:176 msgid "Alternative distributions" -msgstr "" +msgstr "ほかの配布物" -#: ../../using/mac.rst:178 msgid "" "Besides the standard ``python.org`` for macOS installer, there are third-" "party distributions for macOS that may include additional functionality. " "Some popular distributions and their key features:" msgstr "" +"macOS 用の標準の ``python.org`` インストーラに加えて、追加の機能を含む場合が" +"あるサードパーティの macOS 用配布物もあります。\n" +"よく使われる配布物とその主な特徴を紹介します:" #: ../../using/mac.rst:182 msgid "`ActivePython `_" msgstr "`ActivePython `_" -#: ../../using/mac.rst:183 msgid "Installer with multi-platform compatibility, documentation" -msgstr "" +msgstr "複数のプラットフォームに対応するインストーラ、ドキュメント" #: ../../using/mac.rst:185 msgid "`Anaconda `_" msgstr "`Anaconda `_" -#: ../../using/mac.rst:186 msgid "" "Popular scientific modules (such as numpy, scipy, and pandas) and the " "``conda`` package manager." msgstr "" +"よく使われる科学計算モジュール (numpy、scipy、pandas など) と ``conda`` パッ" +"ケージマネージャ。" -#: ../../using/mac.rst:189 msgid "`Homebrew `_" -msgstr "" +msgstr "`Homebrew `_" -#: ../../using/mac.rst:190 msgid "" "Package manager for macOS including multiple versions of Python and many " "third-party Python-based packages (including numpy, scipy, and pandas)." msgstr "" +"複数バージョンの Python と、Python に基づく多くのサードパーティパッケージ " +"(numpy、scipy、pandas など) を含む macOS 用パッケージマネージャ。" -#: ../../using/mac.rst:193 msgid "`MacPorts `_" -msgstr "" +msgstr "`MacPorts `_" -#: ../../using/mac.rst:194 msgid "" "Another package manager for macOS including multiple versions of Python and " "many third-party Python-based packages. May include pre-built versions of " "Python and many packages for older versions of macOS." msgstr "" +"複数バージョンの Python と、Python に基づく多くのサードパーティパッケージを含" +"む、もう一つの macOS 用パッケージマネージャ。\n" +"古い macOS バージョン用にビルドされた Python や多くのパッケージを含む場合があ" +"ります。" -#: ../../using/mac.rst:198 msgid "" "Note that distributions might not include the latest versions of Python or " "other libraries, and are not maintained or supported by the core Python team." msgstr "" +"これらの配布物には最新バージョンの Python やほかのライブラリが含まれていない" +"ことがあり、Python のコアチームによる保守やサポートも行われていない点に注意し" +"てください。" -#: ../../using/mac.rst:204 msgid "Installing additional Python packages" -msgstr "" +msgstr "追加の Python パッケージのインストール" -#: ../../using/mac.rst:206 msgid "Refer to the `Python Packaging User Guide`_ for more information." -msgstr "" +msgstr "詳細は `Python Packaging User Guide`_ を参照してください。" -#: ../../using/mac.rst:216 msgid "GUI programming" -msgstr "" +msgstr "GUI プログラミング" #: ../../using/mac.rst:218 msgid "" @@ -326,66 +414,73 @@ msgid "" msgstr "" "Python で Mac 上の GUI アプリケーションをビルドする方法がいくつかあります。" -#: ../../using/mac.rst:220 msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). A macOS-native version of Tk is " "included with the installer." msgstr "" +"Python の標準 GUI ツールキットは、複数のプラットフォームに対応する Tk ツール" +"キット (https://www.tcl.tk) を基にした :mod:`tkinter` です。\n" +"インストーラには、macOS でネイティブに動作するバージョンの Tk が含まれていま" +"す。" -#: ../../using/mac.rst:224 msgid "" "*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework. " "Information on PyObjC is available from :pypi:`pyobjc`." msgstr "" +"*PyObjC* は、Apple の Objective-C/Cocoa フレームワークの Python バインディン" +"グです。\n" +"PyObjC についての情報は :pypi:`pyobjc` を参照してください。" -#: ../../using/mac.rst:227 msgid "A number of alternative macOS GUI toolkits are available including:" -msgstr "" +msgstr "macOS 用の GUI ツールキットには、次のようなほかの選択肢もあります:" -#: ../../using/mac.rst:229 msgid "" "`PySide `_: Official Python bindings to the " "`Qt GUI toolkit `_." msgstr "" +"`PySide `_: `Qt GUI ツールキット `_ の公式 Python バインディング。" -#: ../../using/mac.rst:232 msgid "" "`PyQt `_: Alternative Python " "bindings to Qt." msgstr "" +"`PyQt `_: Qt 用の別の Python " +"バインディング。" -#: ../../using/mac.rst:235 msgid "" "`Kivy `_: A cross-platform GUI toolkit that supports " "desktop and mobile platforms." msgstr "" +"`Kivy `_: デスクトップとモバイルのプラットフォームに対応す" +"る GUI ツールキット。" -#: ../../using/mac.rst:238 msgid "" "`Toga `_: Part of the `BeeWare Project `_; supports desktop, mobile, web and console apps." msgstr "" +"`Toga `_: `BeeWare Project `_ の一部で、デスクトップ、モバイル、ウェブ、コンソールのアプリに対応しま" +"す。" -#: ../../using/mac.rst:241 msgid "" "`wxPython `_: A cross-platform toolkit that supports " "desktop operating systems." msgstr "" +"`wxPython `_: 複数のデスクトップ OS に対応するツール" +"キット。" -#: ../../using/mac.rst:246 msgid "Advanced topics" -msgstr "" +msgstr "高度な話題" -#: ../../using/mac.rst:251 msgid "Installing free-threaded binaries" -msgstr "" +msgstr "フリースレッドバイナリのインストール" -#: ../../using/mac.rst:255 msgid "Free-threading support is now installed by default." msgstr "" +"フリースレッドのサポートがデフォルトでインストールされるようになりました。" -#: ../../using/mac.rst:258 msgid "" "The ``python.org`` :ref:`Python for macOS ` installer package installs, by default, an additional build of " @@ -393,8 +488,13 @@ msgid "" "term:`global interpreter lock` disabled). Check the release page on ``python." "org`` for possible updated information." msgstr "" +"``python.org`` の :ref:`Python for macOS ` " +"インストーラパッケージは、デフォルトで :term:`フリースレッド ` (:term:`グローバルインタープリタロック ` を無効にした実行) をサポートする Python |version| の追加ビルドをインス" +"トールします。\n" +"更新情報があるかどうか、``python.org`` のリリースページを確認してください。" -#: ../../using/mac.rst:264 msgid "" "The free-threaded mode is working and continues to be improved, but there is " "some additional overhead in single-threaded workloads compared to the " @@ -405,8 +505,17 @@ msgid "" "option, which can be deselected by clicking the **Customize** button on the " "**Installation Type** step of the installer as described above." msgstr "" +"フリースレッドモードは動作し、改良も続けられていますが、単一スレッドでの処理" +"には通常のビルドと比べていくらか追加のオーバーヘッドがあります。\n" +"また、サードパーティパッケージ、特に :term:`拡張モジュール ` を含むものは、フリースレッドビルドでの使用に対応しておらず、:term:" +"`GIL` を再び有効にする場合があります。\n" +"Python 3.15 以降、フリースレッドのサポートはデフォルトでインストールされま" +"す。\n" +"これは個別のインストールオプションとして提供されており、前述のように、インス" +"トーラの **Installation Type** 手順で **Customize** ボタンをクリックすると選" +"択を解除できます。" -#: ../../using/mac.rst:276 msgid "" "If the box next to the **Free-threaded Python** package name is checked (as " "it is by default), a separate :file:`PythonT.framework` will also be " @@ -416,12 +525,18 @@ msgid "" "version| build with minimal risk while installing or testing. This " "installation layout may change in future releases." msgstr "" +"**Free-threaded Python** パッケージ名の横にあるボックスにチェックが入っている" +"場合 (デフォルトでは入っています)、:file:`/Library/Frameworks` 内で通常の :" +"file:`Python.framework` と並んで、別の :file:`PythonT.framework` もインストー" +"ルされます。\n" +"この構成により、システム上でフリースレッドの Python |version| ビルドと従来の " +"(GIL を使う方式のみの) Python |version| ビルドを共存させ、インストールやテス" +"トの際のリスクを最小限に抑えられます。\n" +"このインストールの配置は、将来のリリースで変更される可能性があります。" -#: ../../using/mac.rst:285 msgid "Known cautions and limitations:" -msgstr "" +msgstr "既知の注意点と制限:" -#: ../../using/mac.rst:287 msgid "" "The **UNIX command-line tools** package, which is selected by default, will " "install links in :file:`/usr/local/bin` for |python_x_dot_y_t_literal|, the " @@ -431,15 +546,23 @@ msgid "" "no changes to your ``PATH`` environment variable should be needed to use |" "python_x_dot_y_t_literal|." msgstr "" +"デフォルトで選択されている **UNIX command-line tools** パッケージは、フリース" +"レッドインタープリタである |python_x_dot_y_t_literal| と、パッケージのビルド" +"時に役立つ場合がある設定用ユーティリティ |python_x_dot_y_t_literal_config| の" +"リンクを :file:`/usr/local/bin` にインストールします。\n" +"通常、:file:`/usr/local/bin` はシェルの ``PATH`` に含まれるため、ほとんどの場" +"合、|python_x_dot_y_t_literal| を使うために ``PATH`` 環境変数を変更する必要は" +"ないはずです。" -#: ../../using/mac.rst:295 msgid "" "For this release, the **Shell profile updater** package and the :file:" "`Update Shell Profile.command` in |applications_python_version_literal| do " "not support the free-threaded package." msgstr "" +"このリリースでは、**Shell profile updater** パッケージと、|" +"applications_python_version_literal| にある :file:`Update Shell Profile." +"command` は、フリースレッドパッケージに対応していません。" -#: ../../using/mac.rst:299 msgid "" "The free-threaded build and the traditional build have separate search paths " "and separate :file:`site-packages` directories so, by default, if you need a " @@ -447,40 +570,44 @@ msgid "" "free-threaded package will install a separate instance of :program:`pip` for " "use with |python_x_dot_y_t_literal|." msgstr "" +"フリースレッドビルドと従来のビルドでは、検索パスと :file:`site-packages` ディ" +"レクトリがそれぞれ別になっています。\n" +"そのため、デフォルトでは、両方のビルドでパッケージを使いたい場合は、両方にイ" +"ンストールする必要があるかもしれません。\n" +"フリースレッドパッケージは、|python_x_dot_y_t_literal| 用に別の :program:" +"`pip` をインストールします。" -#: ../../using/mac.rst:305 msgid "To install a package using :command:`pip` without a :command:`venv`:" msgstr "" +":command:`venv` を使わずに :command:`pip` でパッケージをインストールするに" +"は、次のようにします:" -#: ../../using/mac.rst:309 msgid "python\\ |version|\\ t -m pip install " -msgstr "" +msgstr "python\\ |version|\\ t -m pip install " -#: ../../using/mac.rst:311 msgid "" "When working with multiple Python environments, it is usually safest and " "easiest to :ref:`create and use virtual environments `. This can " "avoid possible command name conflicts and confusion about which Python is in " "use:" msgstr "" +"複数の Python 環境を使用する場合は、通常、:ref:`仮想環境を作成して使用する " +"` のが最も安全で簡単です。\n" +"これにより、コマンド名が衝突したり、どの Python を使用しているか分からなく" +"なったりするのを避けられます:" -#: ../../using/mac.rst:317 msgid "python\\ |version|\\ t -m venv " -msgstr "" +msgstr "python\\ |version|\\ t -m venv " -#: ../../using/mac.rst:320 msgid "then :command:`activate`." -msgstr "" +msgstr "続いて :command:`activate` を実行します。" -#: ../../using/mac.rst:322 msgid "To run a free-threaded version of IDLE:" -msgstr "" +msgstr "フリースレッド版の IDLE を実行するには、次のようにします:" -#: ../../using/mac.rst:326 msgid "python\\ |version|\\ t -m idlelib" -msgstr "" +msgstr "python\\ |version|\\ t -m idlelib" -#: ../../using/mac.rst:329 msgid "" "The interpreters in both builds respond to the same :ref:`PYTHON environment " "variables ` which may have unexpected results, for " @@ -488,8 +615,12 @@ msgid "" "there are :ref:`command line options ` like ``-" "E`` to ignore these environment variables." msgstr "" +"どちらのビルドのインタープリタも同じ :ref:`PYTHON 環境変数 ` を参照するため、例えばシェルのプロファイルで ``PYTHONPATH`` を設定" +"していると、予期しない結果になる場合があります。\n" +"必要に応じて、``-E`` のような :ref:`コマンドラインオプション ` を使い、これらの環境変数を無視できます。" -#: ../../using/mac.rst:336 msgid "" "The free-threaded build links to the third-party shared libraries, such as " "``OpenSSL`` and ``Tk``, installed in the traditional framework. This means " @@ -497,8 +628,12 @@ msgid "" "the :command:`Install Certificates.command` script, thus it only needs to be " "run once." msgstr "" +"フリースレッドビルドは、従来のフレームワークにインストールされた ``OpenSSL`` " +"や ``Tk`` などのサードパーティの共有ライブラリにリンクします。\n" +"そのため、両方のビルドは :command:`Install Certificates.command` スクリプトで" +"インストールした信頼証明書も共有するので、このスクリプトは一度実行するだけで" +"済みます。" -#: ../../using/mac.rst:342 msgid "" "If you cannot depend on the link in ``/usr/local/bin`` pointing to the " "``python.org`` free-threaded |python_x_dot_y_t_literal| (for example, if you " @@ -506,14 +641,19 @@ msgid "" "can explicitly set your shell ``PATH`` environment variable to include the " "``PythonT`` framework ``bin`` directory:" msgstr "" +"``/usr/local/bin`` 内のリンクが ``python.org`` のフリースレッド版 |" +"python_x_dot_y_t_literal| を指すとは限らない場合 (例えば、その場所に自分の" +"バージョンをインストールしたい場合や、ほかの配布物がインストールする場合)、" +"シェルの ``PATH`` 環境変数に ``PythonT`` フレームワークの ``bin`` ディレクト" +"リを明示的に追加できます:" -#: ../../using/mac.rst:350 msgid "" "export PATH=\"/Library/Frameworks/PythonT.framework/Versions/\\ |version|\\ /" "bin\":\"$PATH\"" msgstr "" +"export PATH=\"/Library/Frameworks/PythonT.framework/Versions/\\ |version|\\ /" +"bin\":\"$PATH\"" -#: ../../using/mac.rst:352 msgid "" "The traditional framework installation by default does something similar, " "except for :file:`Python.framework`. Be aware that having both framework " @@ -524,20 +664,32 @@ msgid "" "virtual environments can help avoid such ambiguities. Another option might " "be to create a shell :command:`alias` to the desired interpreter, like:" msgstr "" +"従来のフレームワークのインストールでも、対象が :file:`Python.framework` であ" +"る以外は、デフォルトで同様の処理を行います。\n" +"両方のフレームワークの ``bin`` ディレクトリを ``PATH`` に含めると、両方に |" +"python_x_dot_y_literal| のような同名のコマンドがある場合に混乱を招くことがあ" +"ります。\n" +"実際にどちらが使われるかは、``PATH`` 内での順序によって決まります。\n" +"``which python3.x`` または ``which python3.xt`` コマンドで、どのパスが使われ" +"るか確認できます。\n" +"仮想環境を使うと、このような曖昧さを避けるのに役立ちます。\n" +"目的のインタープリタに対して、次のようにシェルの :command:`alias` を作成する" +"方法も考えられます:" -#: ../../using/mac.rst:363 msgid "" "alias py\\ |version|\\ =\"/Library/Frameworks/Python.framework/Versions/\\ |" "version|\\ /bin/python\\ |version|\\ \"\n" "alias py\\ |version|\\ t=\"/Library/Frameworks/PythonT.framework/Versions/\\ " "|version|\\ /bin/python\\ |version|\\ t\"" msgstr "" +"alias py\\ |version|\\ =\"/Library/Frameworks/Python.framework/Versions/\\ |" +"version|\\ /bin/python\\ |version|\\ \"\n" +"alias py\\ |version|\\ t=\"/Library/Frameworks/PythonT.framework/Versions/\\ " +"|version|\\ /bin/python\\ |version|\\ t\"" -#: ../../using/mac.rst:367 msgid "Installing using the command line" -msgstr "" +msgstr "コマンドラインからのインストール" -#: ../../using/mac.rst:369 msgid "" "If you want to use automation to install the ``python.org`` installer " "package (rather than by using the familiar macOS :program:`Installer` GUI " @@ -548,8 +700,15 @@ msgid "" "it, using the |x_dot_y_b2_literal| release and deselecting the free-threaded " "interpreter option:" msgstr "" +"``python.org`` のインストーラパッケージを、使い慣れた macOS の :program:" +"`Installer` GUI アプリではなく、自動化によってインストールしたい場合、macOS " +"のコマンドラインの :command:`installer` ユーティリティでも、デフォルト以外の" +"オプションを選択できます。\n" +":command:`installer` に慣れていないと、やや分かりにくいかもしれません (詳細" +"は :command:`man installer` を参照)。\n" +"例として、次のシェルスクリプトの断片は、|x_dot_y_b2_literal| リリースを使い、" +"フリースレッドインタープリタのオプションを選択解除する方法を示します:" -#: ../../using/mac.rst:380 msgid "" "RELEASE=\"python-\\ |version|\\ 0b2-macos11.pkg\"\n" "\n" @@ -581,12 +740,42 @@ msgid "" "sudo installer -pkg ./${RELEASE} -applyChoiceChangesXML ./choicechanges." "plist -target /" msgstr "" +"RELEASE=\"python-\\ |version|\\ 0b2-macos11.pkg\"\n" +"\n" +"# インストーラパッケージをダウンロード\n" +"curl -O \\https://www.python.org/ftp/python/\\ |version|\\ .0/${RELEASE}\n" +"\n" +"# インストールをカスタマイズするために installer の choicechanges を作成:\n" +"# PythonTFramework-\\ |version|\\ パッケージを無効化し、\n" +"# その他のデフォルトを受け入れる (ほかのパッケージはすべてインストール)\n" +"cat > ./choicechanges.plist <\n" +"\n" +"\n" +"\n" +" \n" +" attributeSetting\n" +" 0\n" +" choiceAttribute\n" +" selected\n" +" choiceIdentifier\n" +" org.python.Python.PythonTFramework-\\ |version|\\ \n" +" \n" +"\n" +"\n" +"EOF\n" +"\n" +"sudo installer -pkg ./${RELEASE} -applyChoiceChangesXML ./choicechanges." +"plist -target /" -#: ../../using/mac.rst:408 msgid "" "After a default install, you can test that both builds are available with " "something like:" msgstr "" +"デフォルトのインストール後、例えば次のようにして、両方のビルドが利用できるこ" +"とを確認できます:" #: ../../using/mac.rst:412 msgid "" @@ -611,17 +800,20 @@ msgid "" "12:50:24) [Clang 15.0.0 (clang-1500.3.9.4)]" msgstr "" -#: ../../using/mac.rst:426 msgid "" "Current ``python.org`` installers only install to fixed locations like :file:" "`/Library/Frameworks/`, :file:`/Applications`, and :file:`/usr/local/bin`. " "You cannot use the :command:`installer` ``-domain`` option to install to " "other locations." msgstr "" +"現在の ``python.org`` インストーラは、:file:`/Library/Frameworks/`、:file:`/" +"Applications`、:file:`/usr/local/bin` などの決められた場所にのみインストール" +"します。\n" +":command:`installer` の ``-domain`` オプションを使って、ほかの場所にインス" +"トールすることはできません。" -#: ../../using/mac.rst:434 msgid "Distributing Python applications" -msgstr "" +msgstr "Python アプリケーションの配布" #: ../../using/mac.rst:436 msgid "" @@ -631,47 +823,59 @@ msgstr "" "Python コードをスタンドアローンな配布アプリケーションに変換するツールには様々" "なものがあります:" -#: ../../using/mac.rst:439 msgid "" ":pypi:`py2app`: Supports creating macOS ``.app`` bundles from a Python " "project." msgstr "" +":pypi:`py2app`: Python プロジェクトから macOS の ``.app`` バンドルを作成でき" +"ます。" -#: ../../using/mac.rst:442 msgid "" "`Briefcase `_: Part of the `BeeWare " "Project `_; a cross-platform packaging tool that " "supports creation of ``.app`` bundles on macOS, as well as managing signing " "and notarization." msgstr "" +"`Briefcase `_: `BeeWare Project `_ の一部で、複数のプラットフォームに対応するパッケージングツール" +"です。\n" +"macOS 上での ``.app`` バンドルの作成や、署名と公証の管理に対応します。" -#: ../../using/mac.rst:447 msgid "" "`PyInstaller `_: A cross-platform packaging tool " "that creates a single file or folder as a distributable artifact." msgstr "" +"`PyInstaller `_: 複数のプラットフォームに対応する" +"パッケージングツールで、配布物として単一のファイルまたはフォルダを作成しま" +"す。" -#: ../../using/mac.rst:451 msgid "App Store compliance" -msgstr "" +msgstr "App Store の要件への適合" -#: ../../using/mac.rst:453 msgid "" "Apps submitted for distribution through the macOS App Store must pass " "Apple's app review process. This process includes a set of automated " "validation rules that inspect the submitted application bundle for " "problematic code." msgstr "" +"macOS App Store を通じて配布するために提出するアプリは、Apple のアプリ審査に" +"合格する必要があります。\n" +"この審査には、提出されたアプリケーションバンドル内に問題のあるコードがないか" +"を調べる、一連の自動検証ルールが含まれています。" -#: ../../using/mac.rst:457 msgid "" "The Python standard library contains some code that is known to violate " "these automated rules. While these violations appear to be false positives, " "Apple's review rules cannot be challenged. Therefore, it is necessary to " "modify the Python standard library for an app to pass App Store review." msgstr "" +"Python 標準ライブラリには、これらの自動ルールに違反することが分かっているコー" +"ドが含まれています。\n" +"これらの違反は誤検出と思われますが、Apple の審査ルールに異議を唱えることはで" +"きません。\n" +"そのため、アプリが App Store の審査に合格するには、Python 標準ライブラリを変" +"更する必要があります。" -#: ../../using/mac.rst:462 msgid "" "The Python source tree contains :source:`a patch file ` that will remove all code that is known to cause " @@ -679,23 +883,35 @@ msgid "" "automatically when CPython is configured with the :option:`--with-app-store-" "compliance` option." msgstr "" +"Python ソースツリーには、App Store の審査で問題を引き起こすことが分かっている" +"コードをすべて削除する :source:`パッチファイル ` が含まれています。\n" +"このパッチは、CPython の configure に :option:`--with-app-store-compliance` " +"オプションを指定した場合に自動で適用されます。" -#: ../../using/mac.rst:468 msgid "" "This patch is not normally required to use CPython on a Mac; nor is it " "required if you are distributing an app *outside* the macOS App Store. It is " "*only* required if you are using the macOS App Store as a distribution " "channel." msgstr "" +"Mac 上で CPython を使用するために、通常このパッチは必要ありません。\n" +"macOS App Store の *外* でアプリを配布する場合にも必要ありません。\n" +"このパッチが必要になるのは、macOS App Store を配布経路として使用する場合 *だ" +"け* です。" #: ../../using/mac.rst:473 msgid "Other resources" msgstr "その他のリソース" -#: ../../using/mac.rst:475 msgid "" "The `python.org Help page `_ has links " "to many useful resources. The `Pythonmac-SIG mailing list `_ is another support " "resource specifically for Python users and developers on the Mac." msgstr "" +"`python.org のヘルプページ `_ には、多く" +"の役立つリソースへのリンクがあります。\n" +"`Pythonmac-SIG メーリングリスト `_ も、Mac 上で Python を使うユーザーや開発者に特化し" +"たサポートリソースです。" diff --git a/using/unix.po b/using/unix.po index 1a4d9a716..7d0390f8f 100644 --- a/using/unix.po +++ b/using/unix.po @@ -35,20 +35,27 @@ msgstr "最新バージョンの Python の取得とインストール" msgid "On Linux" msgstr "Linux" -#: ../../using/unix.rst:15 msgid "" "Python comes preinstalled on most Linux distributions, and is available as a " "package on all others. However there are certain features you might want to " "use that are not available on your distro's package. You can compile the " "latest version of Python from source." msgstr "" +"ほとんどの Linux ディストリビューションには Python があらかじめインストールさ" +"れており、それ以外のディストリビューションでもパッケージとして利用できま" +"す。\n" +"ただし、使いたい機能がディストリビューションのパッケージでは利用できないこと" +"もあります。\n" +"最新バージョンの Python はソースからコンパイルできます。" -#: ../../using/unix.rst:20 msgid "" "In the event that the latest version of Python doesn't come preinstalled and " "isn't in the repositories as well, you can make packages for your own " "distro. Have a look at the following links:" msgstr "" +"最新バージョンの Python があらかじめインストールされておらず、リポジトリにも" +"ない場合は、自分のディストリビューション向けにパッケージを作成できます。\n" +"次のリンクを参照してください:" #: ../../using/unix.rst:26 msgid "https://www.debian.org/doc/manuals/maint-guide/first.en.html" @@ -178,14 +185,15 @@ msgstr "" msgid "Building Python" msgstr "Python のビルド" -#: ../../using/unix.rst:86 msgid "" "If you want to contribute to CPython, refer to the `devguide `_, which includes build " "instructions and other tips on setting up environment." msgstr "" +"CPython に貢献したい場合は、ビルド手順や環境設定のヒントを掲載した `開発者ガ" +"イド `_ を参照し" +"てください。" -#: ../../using/unix.rst:90 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -193,6 +201,12 @@ msgid "" "python.org/setup/#get-the-source-code>`_. You will also need to install the :" "ref:`build requirements `." msgstr "" +"CPython を自分でコンパイルする場合は、まず `ソース `_ を入手してください。\n" +"最新リリースのソースをダウンロードするか、最新の `クローン `_ を取得できます。\n" +":ref:`ビルドに必要なもの ` もインストールする必要がありま" +"す。" #: ../../using/unix.rst:96 msgid "The build process consists of the usual commands::" @@ -218,32 +232,30 @@ msgstr "" "フォームにおける注意点は Python ソースツリーのルートにある :source:`README." "rst` に細かく記載されています。" -#: ../../using/unix.rst:108 msgid "" "``make install`` can overwrite or masquerade the :file:`python3` binary. " "``make altinstall`` is therefore recommended instead of ``make install`` " "since it only installs :file:`{exec_prefix}/bin/python{version}`." msgstr "" -"``make install`` は :file:`python3` バイナリを上書きまたはリンクを破壊してし" -"まうかもしれません。そのため、``make install`` の代わりに :file:" -"`{exec_prefix}/bin/python{version}` のみインストールする ``make altinstall`` " -"が推奨されています。" +"``make install`` は :file:`python3` バイナリを上書きしたり、既存のバイナリに" +"代わって使われるようにしたりする可能性があります。\n" +"そのため、``make install`` の代わりに、:file:`{exec_prefix}/bin/" +"python{version}` のみをインストールする ``make altinstall`` を推奨します。" #: ../../using/unix.rst:114 msgid "Python-related paths and files" msgstr "Python に関係するパスとファイル" -#: ../../using/unix.rst:116 msgid "" "These are subject to difference depending on local installation " "conventions; :option:`prefix <--prefix>` and :option:`exec_prefix <--exec-" "prefix>` are installation-dependent and should be interpreted as for GNU " "software; they may be the same." msgstr "" -"これらはローカルインストールの慣例に応じて変化します; :option:`prefix <--" -"prefix>` と :option:`exec_prefix <--exec-prefix>` はインストール状況に依存し" -"ていて、GNU ソフトウェアによって解釈されます; この二つは同じである場合があり" -"ます。" +"これらは、インストール先での慣例に応じて異なります。\n" +":option:`prefix <--prefix>` と :option:`exec_prefix <--exec-prefix>` はインス" +"トール方法に依存し、GNU ソフトウェアの場合と同じ意味で解釈してください。\n" +"両者が同じ値になることもあります。" #: ../../using/unix.rst:121 msgid "" @@ -345,7 +357,6 @@ msgstr "" msgid "Custom OpenSSL" msgstr "カスタムの OpenSSL" -#: ../../using/unix.rst:164 msgid "" "To use your vendor's OpenSSL configuration and system trust store, locate " "the directory with ``openssl.cnf`` file or symlink in ``/etc``. On most " @@ -353,6 +364,13 @@ msgid "" "directory should also contain a ``cert.pem`` file and/or a ``certs`` " "directory." msgstr "" +"ベンダーの OpenSSL 設定とシステムの信頼ストアを使用するには、``/etc`` 内で " +"``openssl.cnf`` ファイルまたはそのシンボリックリンクを含むディレクトリを探し" +"てください。\n" +"ほとんどのディストリビューションでは、ファイルは ``/etc/ssl`` または ``/etc/" +"pki/tls`` にあります。\n" +"そのディレクトリには ``cert.pem`` ファイル、``certs`` ディレクトリ、またはそ" +"の両方もあるはずです。" #: ../../using/unix.rst:170 msgid "" @@ -362,11 +380,13 @@ msgstr "" "$ find /etc/ -name openssl.cnf -printf \"%h\\n\"\n" "/etc/ssl" -#: ../../using/unix.rst:175 msgid "" "Download, build, and install OpenSSL. Make sure you use ``install_sw`` and " "not ``install``. The ``install_sw`` target does not override ``openssl.cnf``." msgstr "" +"OpenSSL をダウンロードし、ビルドしてインストールします。\n" +"``install`` ではなく、必ず ``install_sw`` を使用してください。\n" +"``install_sw`` ターゲットは ``openssl.cnf`` を上書きしません。" #: ../../using/unix.rst:179 msgid "" @@ -394,11 +414,12 @@ msgstr "" "$ make install_sw\n" "$ popd" -#: ../../using/unix.rst:193 msgid "" "Build Python with custom OpenSSL (see the configure ``--with-openssl`` and " "``--with-openssl-rpath`` options)" msgstr "" +"カスタムの OpenSSL を使って Python をビルドします (configure の ``--with-" +"openssl`` および ``--with-openssl-rpath`` オプションを参照してください)" #: ../../using/unix.rst:196 msgid "" @@ -418,9 +439,12 @@ msgstr "" "$ make -j8\n" "$ make altinstall" -#: ../../using/unix.rst:208 msgid "" "Patch releases of OpenSSL have a backwards compatible ABI. You don't need to " "recompile Python to update OpenSSL. It's sufficient to replace the custom " "OpenSSL installation with a newer version." msgstr "" +"OpenSSL のパッチリリースでは、ABI の後方互換性が保たれます。\n" +"OpenSSL を更新するために Python を再コンパイルする必要はありません。\n" +"インストール済みのカスタム OpenSSL を新しいバージョンで置き換えるだけで十分で" +"す。" diff --git a/using/windows.po b/using/windows.po index 8309b20c3..a64ada853 100644 --- a/using/windows.po +++ b/using/windows.po @@ -34,7 +34,6 @@ msgstr "" "このドキュメントは、 Python を Microsoft Windows で使うときに知っておくべ" "き、 Windows 固有の動作についての概要を伝えることを目的としています。" -#: ../../using/windows.rst:18 msgid "" "Unlike most Unix systems and services, Windows does not include a system " "supported installation of Python. Instead, Python can be obtained from a " @@ -44,6 +43,14 @@ msgid "" "benefit. Before committing to the process described here, we recommend " "investigating your existing tools to see if they can provide Python directly." msgstr "" +"多くの Unix システムやサービスと異なり、Windows にはシステムでサポートされる " +"Python のインストールが含まれていません。\n" +"その代わり、Python は CPython チームを含むさまざまな配布元から入手できま" +"す。\n" +"Python の各ディストリビューションにはそれぞれ長所と短所がありますが、一般に、" +"使用しているほかのツールと一貫して使えることは大きな利点です。\n" +"ここで説明する手順に進む前に、既存のツールから Python を直接入手できるか調べ" +"ることをお勧めします。" #: ../../using/windows.rst:26 msgid "" @@ -62,7 +69,6 @@ msgid "" "versions, and the ``py list`` command will show which is current." msgstr "" -#: ../../using/windows.rst:37 msgid "" "In general, we recommend that you create a :ref:`virtual environment ` for each project and run ``\\Scripts\\Activate`` in your " @@ -71,6 +77,11 @@ msgid "" "available in your session. Create a virtual environment using ``python -m " "venv ``." msgstr "" +"一般に、プロジェクトごとに :ref:`仮想環境 ` を作成し、ターミナルで " +"``\\Scripts\\Activate`` を実行して使うことをお勧めします。\n" +"これにより、プロジェクト同士を分離し、時間が経っても一貫した環境を保ち、パッ" +"ケージが追加したコマンドもセッション内で使えるようにできます。\n" +"仮想環境は ``python -m venv `` で作成してください。" #: ../../using/windows.rst:43 msgid "" @@ -79,28 +90,33 @@ msgid "" "sometimes additional manual steps required to configure your PC." msgstr "" -#: ../../using/windows.rst:47 msgid "" "Apart from using the Python install manager, Python can also be obtained as " "NuGet packages. See :ref:`windows-nuget` below for more information on these " "packages." msgstr "" +"Python インストールマネージャを使う以外に、Python を NuGet パッケージとして入" +"手することもできます。\n" +"これらのパッケージの詳細については、後述の :ref:`windows-nuget` を参照してく" +"ださい。" -#: ../../using/windows.rst:51 msgid "" "The embeddable distros are minimal packages of Python suitable for embedding " "into larger applications. They can be installed using the Python install " "manager. See :ref:`windows-embeddable` below for more information on these " "packages." msgstr "" +"埋め込み用ディストリビューションは、より大きなアプリケーションに埋め込むのに" +"適した、Python の最小限のパッケージです。\n" +"Python インストールマネージャを使ってインストールできます。\n" +"これらのパッケージの詳細については、後述の :ref:`windows-embeddable` を参照し" +"てください。" -#: ../../using/windows.rst:64 msgid "Python install manager" -msgstr "" +msgstr "Python インストールマネージャ" -#: ../../using/windows.rst:67 msgid "Installation" -msgstr "" +msgstr "インストール" #: ../../using/windows.rst:69 msgid "" @@ -109,11 +125,12 @@ msgid "" "are identical." msgstr "" -#: ../../using/windows.rst:73 msgid "" "To install through the Store, simply click \"Install\". After it has " "completed, open a terminal and type ``python`` to get started." msgstr "" +"Store からインストールするには、\"Install\" をクリックするだけです。\n" +"完了したら、ターミナルを開いて ``python`` と入力すると使い始められます。" #: ../../using/windows.rst:76 msgid "" @@ -122,7 +139,6 @@ msgid "" "Powershell." msgstr "" -#: ../../using/windows.rst:79 msgid "" "After installation, the ``python``, ``py``, and ``pymanager`` commands " "should be available. If you have existing installations of Python, or you " @@ -130,6 +146,12 @@ msgid "" "undo the modifications. See :ref:`pymanager-troubleshoot` for more help with " "fixing non-working commands." msgstr "" +"インストール後は、``python``、``py``、``pymanager`` コマンドが使えるはずで" +"す。\n" +"既に Python がインストールされていたり、:envvar:`PATH` 変数を変更していたりす" +"る場合は、それらを削除するか、変更を元に戻す必要があるかもしれません。\n" +"動作しないコマンドへの対処については、:ref:`pymanager-troubleshoot` を参照し" +"てください。" #: ../../using/windows.rst:85 msgid "" @@ -142,18 +164,24 @@ msgid "" "for your account\" for the system settings page to add the path." msgstr "" -#: ../../using/windows.rst:93 msgid "" "Each Python runtime you install will have its own directory for scripts. " "These also need to be added to :envvar:`PATH` if you want to use them." msgstr "" +"インストールした Python ランタイムには、それぞれ専用のスクリプト用ディレクト" +"リがあります。\n" +"スクリプトを使いたい場合は、これらも :envvar:`PATH` に追加する必要がありま" +"す。" -#: ../../using/windows.rst:96 msgid "" "The Python install manager will be automatically updated to new releases. " "This does not affect any installs of Python runtimes. Uninstalling the " "Python install manager does not uninstall any Python runtimes." msgstr "" +"Python インストールマネージャは新しいリリースに自動的に更新されます。\n" +"これは、インストール済みの Python ランタイムには影響しません。\n" +"Python インストールマネージャをアンインストールしても、Python ランタイムはア" +"ンインストールされません。" #: ../../using/windows.rst:100 msgid "" @@ -167,7 +195,6 @@ msgstr "" msgid "Basic use" msgstr "基本的な使い方" -#: ../../using/windows.rst:109 msgid "" "The recommended command for launching Python is ``python``, which will " "either launch the version requested by the script being launched, an active " @@ -176,8 +203,13 @@ msgid "" "specifically requested and no runtimes are installed at all, the current " "latest release will be installed automatically." msgstr "" +"Python の起動には ``python`` コマンドを推奨します。\n" +"このコマンドは、起動するスクリプトが要求するバージョン、アクティブな仮想環" +"境、またはインストール済みのデフォルトのバージョンを起動します。\n" +"別途設定しない限り、デフォルトは最新の安定版です。\n" +"バージョンが明示的に要求されておらず、ランタイムがまったくインストールされて" +"いない場合は、現在の最新リリースが自動的にインストールされます。" -#: ../../using/windows.rst:116 msgid "" "For all scenarios involving multiple runtime versions, the recommended " "command is ``py``. This may be used anywhere in place of ``python`` or the " @@ -186,8 +218,14 @@ msgid "" "version as well as subcommands to manage installations. These are detailed " "below." msgstr "" +"複数のランタイムバージョンを扱う場合は、どの場面でも ``py`` コマンドを推奨し" +"ます。\n" +"``python`` や従来の ``py.exe`` ランチャの代わりに、どこでも使えます。\n" +"デフォルトでは ``py`` は ``python`` と同じように動作しますが、コマンドライン" +"オプションで特定のバージョンを選択したり、サブコマンドでインストールを管理し" +"たりすることもできます。\n" +"これらについては後述します。" -#: ../../using/windows.rst:122 msgid "" "Because the ``py`` command may already be taken by the previous version, " "there is also an unambiguous ``pymanager`` command. Scripted installs that " @@ -198,8 +236,15 @@ msgid "" "while ``pymanager`` will display help (``pymanager exec ...`` provides " "equivalent behaviour to ``py ...``)." msgstr "" +"``py`` コマンドは以前のバージョンで既に使われている可能性があるため、曖昧さの" +"ない ``pymanager`` コマンドも用意されています。\n" +"Python インストールマネージャを使うことを意図したインストールスクリプトでは、" +"既存のインストールと衝突する可能性が低い ``pymanager`` の使用を検討してくださ" +"い。\n" +"両コマンドの違いは、引数を渡さずに実行したときだけです。\n" +"``py`` はデフォルトのインタープリタを起動し、``pymanager`` はヘルプを表示しま" +"す (``pymanager exec ...`` は ``py ...`` と同じ動作をします)。" -#: ../../using/windows.rst:130 msgid "" "Each of these commands also has a windowed version that avoids creating a " "console window. These are ``pyw``, ``pythonw`` and ``pywmanager``. A " @@ -207,15 +252,22 @@ msgid "" "is intended to catch accidental uses of the typical POSIX command on " "Windows, but is not meant to be widely used or recommended." msgstr "" +"これらのコマンドには、コンソールウィンドウを作成しないウィンドウ版もそれぞれ" +"あります。\n" +"``pyw``、``pythonw``、``pywmanager`` です。\n" +"``python`` コマンドと同様に動作する ``python3`` コマンドも含まれています。\n" +"これは、一般的な POSIX のコマンドを Windows 上で誤って使ってしまう場合に対応" +"するためのもので、広く使ったり推奨したりすることは意図していません。" -#: ../../using/windows.rst:136 msgid "" "To launch your default runtime, run ``python`` or ``py`` with the arguments " "you want to be passed to the runtime (such as script files or the module to " "launch):" msgstr "" +"デフォルトのランタイムを起動するには、ランタイムに渡したい引数 (スクリプト" +"ファイルや起動するモジュールなど) を付けて ``python`` または ``py`` を実行し" +"てください:" -#: ../../using/windows.rst:139 msgid "" "$> py\n" "...\n" @@ -224,15 +276,22 @@ msgid "" "$> py -m this\n" "..." msgstr "" +"$> py\n" +"...\n" +"$> python my-script.py\n" +"...\n" +"$> py -m this\n" +"..." -#: ../../using/windows.rst:148 msgid "" "The default runtime can be overridden with the :envvar:" "`PYTHON_MANAGER_DEFAULT` environment variable, or a configuration file. See :" "ref:`pymanager-config` for information about configuration settings." msgstr "" +"デフォルトのランタイムは、環境変数 :envvar:`PYTHON_MANAGER_DEFAULT` または設" +"定ファイルで上書きできます。\n" +"設定の詳細については、:ref:`pymanager-config` を参照してください。" -#: ../../using/windows.rst:152 msgid "" "To launch a specific runtime, the ``py`` command accepts a ``-V:`` " "option. This option must be specified before any others. The tag is part or " @@ -241,6 +300,15 @@ msgid "" "the ``V:`` may be omitted in cases where the tag refers to an official " "release and starts with ``3``." msgstr "" +"特定のランタイムを起動するため、``py`` コマンドは ``-V:`` オプションを受" +"け付けます。\n" +"このオプションは、ほかのすべてのオプションより先に指定しなければなりませ" +"ん。\n" +"タグはランタイムの識別子の一部または全体です。\n" +"CPython チームが提供するランタイムではバージョンのような形で、プラットフォー" +"ムが付くこともあります。\n" +"互換性のため、タグが公式リリースを指していて ``3`` で始まる場合は、``V:`` を" +"省略できます。" #: ../../using/windows.rst:159 msgid "" @@ -248,7 +316,6 @@ msgid "" "$> py -V:3-arm64 ..." msgstr "" -#: ../../using/windows.rst:164 msgid "" "Runtimes from other distributors may require the *company* to be included as " "well. It should be separated from the tag by a slash (either ``/`` or " @@ -257,14 +324,20 @@ msgid "" "optional (but not the slash) when you want the latest release from a " "specific company." msgstr "" +"ほかの配布元のランタイムでは、*company* も含める必要があるかもしれません。\n" +"タグとの間はスラッシュ (``/`` または ``\\``) で区切り、完全な値の任意の接頭辞" +"まで短縮できます。\n" +"company が ``PythonCore`` の場合は指定を省略でき、特定の company の最新リリー" +"スを使いたい場合はタグの指定を省略できます (ただしスラッシュは省略できませ" +"ん)。" -#: ../../using/windows.rst:172 msgid "" "$> py -V:Distributor\\1.0 ...\n" "$> py -V:distrib/ ..." msgstr "" +"$> py -V:Distributor\\1.0 ...\n" +"$> py -V:distrib/ ..." -#: ../../using/windows.rst:177 msgid "" "If no version is specified, but a script file is passed, the script will be " "inspected for a *shebang line*. This is a special format for the first line " @@ -272,8 +345,13 @@ msgid "" "for more information. When there is no shebang line, or it cannot be " "resolved, the script will be launched with the default runtime." msgstr "" +"バージョンが指定されておらず、スクリプトファイルが渡された場合、スクリプトに " +"*シェバン行* があるか調べます。\n" +"これはファイルの先頭行に記述する特別な形式で、コマンドを上書きできます。\n" +"詳しくは :ref:`pymanager-shebang` を参照してください。\n" +"シェバン行がない場合や解決できない場合は、デフォルトのランタイムでスクリプト" +"を起動します。" -#: ../../using/windows.rst:183 msgid "" "If you are running in an active virtual environment, have not requested a " "particular version, and there is no shebang line, the default runtime will " @@ -281,8 +359,12 @@ msgid "" "likely already overridden and none of these checks occurred. However, this " "behaviour ensures that the ``py`` command can be used interchangeably." msgstr "" +"アクティブな仮想環境で実行していて、特定のバージョンを要求しておらず、シェバ" +"ン行もない場合、デフォルトのランタイムはその仮想環境になります。\n" +"この場合、``python`` コマンドは既に上書きされていて、これらの確認は行われない" +"ことが多いでしょう。\n" +"ただし、この動作によって ``py`` コマンドも同じように使えます。" -#: ../../using/windows.rst:189 msgid "" "When no runtimes are installed, any launch command will try to install the " "requested version and launch it. However, after any version is installed, " @@ -290,26 +372,36 @@ msgid "" "the requested version is absent. Other forms of commands will display an " "error and direct you to use ``py install`` first." msgstr "" +"ランタイムがまったくインストールされていない場合、どの起動コマンドも要求され" +"たバージョンをインストールして起動しようとします。\n" +"ただし、いずれかのバージョンがインストールされた後は、要求されたバージョンが" +"ないときにインストールを行うのは ``py exec ...`` と ``pymanager exec ...`` コ" +"マンドだけです。\n" +"それ以外の形式のコマンドはエラーを表示し、先に ``py install`` を使うよう案内" +"します。" -#: ../../using/windows.rst:197 msgid "Command help" -msgstr "" +msgstr "コマンドのヘルプ" -#: ../../using/windows.rst:199 msgid "" "The ``py help`` command will display the full list of supported commands, " "along with their options. Any command may be passed the ``-?`` option to " "display its help, or its name passed to ``py help``." msgstr "" +"``py help`` コマンドは、サポートされているすべてのコマンドとそのオプションを" +"表示します。\n" +"どのコマンドでも、``-?`` オプションを渡すか、``py help`` にそのコマンド名を渡" +"すとヘルプを表示できます。" -#: ../../using/windows.rst:203 msgid "" "$> py help\n" "$> py help install\n" "$> py install /?" msgstr "" +"$> py help\n" +"$> py help install\n" +"$> py install /?" -#: ../../using/windows.rst:210 msgid "" "All commands support some common options, which will be shown by ``py " "help``. These options must be specified after any subcommand. Specifying ``-" @@ -317,31 +409,42 @@ msgid "" "will increase it further for debugging purposes. Passing ``-q`` or ``--" "quiet`` will reduce output, and ``-qq`` will reduce it further." msgstr "" +"すべてのコマンドで、``py help`` に表示される共通のオプションを使えます。\n" +"これらのオプションはサブコマンドの後に指定しなければなりません。\n" +"``-v`` または ``--verbose`` を指定すると出力が増え、``-vv`` を指定するとデ" +"バッグ用にさらに増えます。\n" +"``-q`` または ``--quiet`` を渡すと出力が減り、``-qq`` を渡すとさらに減りま" +"す。" -#: ../../using/windows.rst:216 msgid "" "The ``--config=`` option allows specifying a configuration file to " "override multiple settings at once. See :ref:`pymanager-config` below for " "more information about these files." msgstr "" +"``--config=`` オプションでは、複数の設定をまとめて上書きする設定ファイ" +"ルを指定できます。\n" +"これらのファイルの詳細については、後述の :ref:`pymanager-config` を参照してく" +"ださい。" -#: ../../using/windows.rst:222 msgid "Listing runtimes" -msgstr "" +msgstr "ランタイムの一覧表示" -#: ../../using/windows.rst:224 msgid "" "$> py list [-f=|--format=] [-1|--one] [--online|-s=|--source=] " "[...]" msgstr "" +"$> py list [-f=|--format=] [-1|--one] [--online|-s=|--source=] " +"[...]" -#: ../../using/windows.rst:228 msgid "" "The list of installed runtimes can be seen using ``py list``. A filter may " "be added in the form of one or more tags (with or without company " "specifier), and each may include a ``<``, ``<=``, ``>=`` or ``>`` prefix to " "restrict to a range." msgstr "" +"``py list`` を使うと、インストール済みのランタイムの一覧を表示できます。\n" +"1 つ以上のタグ (company の指定は任意) をフィルタとして追加でき、それぞれに接" +"頭辞 ``<``、``<=``、``>=``、``>`` を付けて範囲を制限できます。" #: ../../using/windows.rst:232 msgid "" @@ -352,7 +455,6 @@ msgid "" "executable path), ``prefix`` (just the prefix path)." msgstr "" -#: ../../using/windows.rst:238 msgid "" "The ``--one`` or ``-1`` option only displays a single result. If the default " "runtime is included, it will be the one. Otherwise, the \"best\" result is " @@ -360,15 +462,23 @@ msgid "" "most recent version). The result shown by ``py list --one `` will match " "the runtime that would be launched by ``py -V:``." msgstr "" +"``--one`` または ``-1`` オプションは、結果を 1 つだけ表示します。\n" +"デフォルトのランタイムが含まれている場合は、それを表示します。\n" +"そうでなければ、\"最良\" の結果を表示します (\"最良\" の定義は意図的に曖昧に" +"していますが、通常は最新のバージョンです)。\n" +"``py list --one `` が表示する結果は、``py -V:`` が起動するランタイ" +"ムと一致します。" -#: ../../using/windows.rst:244 msgid "" "The ``--only-managed`` option excludes results that were not installed by " "the Python install manager. This is useful when determining which runtimes " "may be updated or uninstalled through the ``py`` command." msgstr "" +"``--only-managed`` オプションは、Python インストールマネージャでインストール" +"されていないランタイムを結果から除外します。\n" +"これは、``py`` コマンドで更新やアンインストールができるランタイムを調べるとき" +"に役立ちます。" -#: ../../using/windows.rst:248 msgid "" "The ``--online`` option is short for passing ``--source=`` with the " "default source. Passing either of these options will search the online index " @@ -376,6 +486,12 @@ msgid "" "one `` will match the runtime that would be installed by ``py install " "``." msgstr "" +"``--online`` オプションは、デフォルトの取得元を指定して ``--source=`` を" +"渡すための短縮形です。\n" +"どちらかのオプションを渡すと、オンラインインデックスでインストール可能なラン" +"タイムを検索します。\n" +"``py list --online --one `` が表示する結果は、``py install `` がイ" +"ンストールするランタイムと一致します。" #: ../../using/windows.rst:253 msgid "$> py list --online 3.14" @@ -388,35 +504,41 @@ msgid "" "allow additional options, and will produce legacy formatted output." msgstr "" -#: ../../using/windows.rst:263 msgid "Installing runtimes" -msgstr "" +msgstr "ランタイムのインストール" -#: ../../using/windows.rst:265 msgid "" "$> py install [-s=|--source=] [-f|--force] [-u|--update] [--dry-run] " "[...]" msgstr "" +"$> py install [-s=|--source=] [-f|--force] [-u|--update] [--dry-run] " +"[...]" -#: ../../using/windows.rst:269 msgid "" "New runtime versions may be added using ``py install``. One or more tags may " "be specified, and the special tag ``default`` may be used to select the " "default. Ranges are not supported for installation." msgstr "" +"``py install`` を使うと、新しいバージョンのランタイムを追加できます。\n" +"1 つ以上のタグを指定でき、特別なタグ ``default`` でデフォルトを選択できま" +"す。\n" +"インストールでは範囲指定をサポートしていません。" -#: ../../using/windows.rst:273 msgid "" "The ``--source=`` option allows overriding the online index that is " "used to obtain runtimes. This may be used with an offline index, as shown " "in :ref:`pymanager-offline`." msgstr "" +"``--source=`` オプションでは、ランタイムの取得に使うオンラインインデック" +"スを上書きできます。\n" +":ref:`pymanager-offline` に示すように、オフラインインデックスにも使えます。" -#: ../../using/windows.rst:277 msgid "" "Passing ``--force`` will ignore any cached files and remove any existing " "install to replace it with the specified one." msgstr "" +"``--force`` を渡すと、キャッシュされたファイルをすべて無視し、既存のインス" +"トールを削除して、指定されたものに置き換えます。" #: ../../using/windows.rst:280 msgid "" @@ -429,11 +551,12 @@ msgid "" "unaffected." msgstr "" -#: ../../using/windows.rst:287 msgid "" "Passing ``--dry-run`` will generate output and logs, but will not modify any " "installs." msgstr "" +"``--dry-run`` を渡すと、出力とログを生成しますが、インストールは一切変更しま" +"せん。" #: ../../using/windows.rst:290 msgid "" @@ -444,7 +567,6 @@ msgid "" "manually refreshed after installing packages." msgstr "" -#: ../../using/windows.rst:296 msgid "" "In addition to the above options, the ``--target`` option will extract the " "runtime to the specified directory instead of doing a normal install. This " @@ -454,12 +576,17 @@ msgid "" "execute the main executable (typically ``python.exe``) in the target " "directory." msgstr "" +"上記のオプションに加えて、``--target`` オプションを使うと、通常のインストール" +"を行う代わりに、指定したディレクトリにランタイムを展開します。\n" +"これは、より大きなアプリケーションにランタイムを埋め込むときに役立ちます。\n" +"通常のインストールとは異なり、``py`` は展開されたランタイムを認識せず、スター" +"トメニューなどのショートカットも作成されません。\n" +"ランタイムを起動するには、展開先ディレクトリにあるメインの実行ファイル (通常" +"は ``python.exe``) を直接実行してください。" -#: ../../using/windows.rst:304 msgid "$> py install ... [-t=|--target=] " -msgstr "" +msgstr "$> py install ... [-t=|--target=] " -#: ../../using/windows.rst:308 msgid "" "The ``py exec`` command will install the requested runtime if it is not " "already present. This is controlled by the ``automatic_install`` " @@ -469,40 +596,50 @@ msgid "" "a good experience for new users, but should not generally be relied on " "rather than using the ``py exec`` command or explicit install commands." msgstr "" +"``py exec`` コマンドは、要求されたランタイムがまだなければインストールしま" +"す。\n" +"この動作は ``automatic_install`` 設定 (:envvar:" +"`PYTHON_MANAGER_AUTOMATIC_INSTALL`) で制御し、デフォルトでは有効です。\n" +"利用可能なランタイムがまったくない場合は、設定で許可されていれば、どの起動コ" +"マンドも自動インストールを行います。\n" +"これは新しいユーザが使い始めやすくするためのものですが、通常はこれに頼らず、" +"``py exec`` コマンドや明示的なインストールコマンドを使ってください。" -#: ../../using/windows.rst:320 msgid "Offline installs" -msgstr "" +msgstr "オフラインでのインストール" -#: ../../using/windows.rst:322 msgid "" "To perform offline installs of Python, you will need to first create an " "offline index on a machine that has network access." msgstr "" +"Python をオフラインでインストールするには、まずネットワークにアクセスできるマ" +"シン上でオフラインインデックスを作成する必要があります。" -#: ../../using/windows.rst:325 msgid "$> py install --download= ... ..." -msgstr "" +msgstr "$> py install --download= ... ..." -#: ../../using/windows.rst:329 msgid "" "The ``--download=`` option will download the packages for the listed " "tags and create a directory containing them and an ``index.json`` file " "suitable for later installation. This entire directory can be moved to the " "offline machine and used to install one or more of the bundled runtimes:" msgstr "" +"``--download=`` オプションは、列挙したタグのパッケージをダウンロード" +"し、それらのパッケージと後のインストールに使える ``index.json`` ファイルを含" +"むディレクトリを作成します。\n" +"このディレクトリ全体をオフラインのマシンに移し、同梱したランタイムを 1 つ以上" +"インストールできます:" -#: ../../using/windows.rst:334 msgid "$> py install --source=\"\\index.json\" ..." -msgstr "" +msgstr "$> py install --source=\"\\index.json\" ..." -#: ../../using/windows.rst:338 msgid "" "The Python install manager can be installed by downloading its installer and " "moving it to another machine before installing." msgstr "" +"Python インストールマネージャは、インストーラをダウンロードして別のマシンに移" +"してからインストールできます。" -#: ../../using/windows.rst:341 msgid "" "Alternatively, the ZIP files in an offline index directory can simply be " "transferred to another machine and extracted. This will not register the " @@ -511,33 +648,39 @@ msgid "" "approach in cases where installing the Python install manager is not " "possible or convenient." msgstr "" +"あるいは、オフラインインデックスのディレクトリ内にある ZIP ファイルを別のマシ" +"ンに転送して展開するだけでも構いません。\n" +"この方法ではインストールは一切登録されないため、展開したディレクトリ内の実行" +"ファイルを直接指定して起動する必要がありますが、Python インストールマネージャ" +"をインストールできない場合や不便な場合には、こちらの方が適していることもあり" +"ます。" -#: ../../using/windows.rst:347 msgid "" "In this way, Python runtimes can be installed and managed on a machine " "without access to the internet." msgstr "" +"このようにして、インターネットにアクセスできないマシンでも Python ランタイム" +"をインストールし、管理できます。" -#: ../../using/windows.rst:352 msgid "Uninstalling runtimes" -msgstr "" +msgstr "ランタイムのアンインストール" -#: ../../using/windows.rst:354 msgid "$> py uninstall [-y|--yes] ..." -msgstr "" +msgstr "$> py uninstall [-y|--yes] ..." -#: ../../using/windows.rst:358 msgid "" "Runtimes may be removed using the ``py uninstall`` command. One or more tags " "must be specified. Ranges are not supported here." msgstr "" +"``py uninstall`` コマンドを使うと、ランタイムを削除できます。\n" +"1 つ以上のタグを指定しなければなりません。\n" +"ここでは範囲指定をサポートしていません。" -#: ../../using/windows.rst:361 msgid "" "The ``--yes`` option bypasses the confirmation prompt before uninstalling." msgstr "" +"``--yes`` オプションは、アンインストール前の確認プロンプトを省略します。" -#: ../../using/windows.rst:363 msgid "" "Instead of passing tags individually, the ``--purge`` option may be " "specified. This will remove all runtimes managed by the Python install " @@ -545,12 +688,16 @@ msgid "" "caches. Runtimes that were not installed by the Python install manager will " "not be impacted, and neither will manually created configuration files." msgstr "" +"タグを個別に渡す代わりに、``--purge`` オプションを指定できます。\n" +"これは、スタートメニュー、レジストリ、ダウンロードキャッシュのクリーンアップ" +"を含め、Python インストールマネージャで管理しているすべてのランタイムを削除し" +"ます。\n" +"Python インストールマネージャでインストールされていないランタイムや、手動で作" +"成した設定ファイルには影響しません。" -#: ../../using/windows.rst:369 msgid "$> py uninstall [-y|--yes] --purge" -msgstr "" +msgstr "$> py uninstall [-y|--yes] --purge" -#: ../../using/windows.rst:373 msgid "" "The Python install manager can be uninstalled through the Windows " "\"Installed apps\" settings page. This does not remove any runtimes, and " @@ -559,12 +706,18 @@ msgid "" "manage these runtimes again. To completely clean up all Python runtimes, run " "with ``--purge`` before uninstalling the Python install manager." msgstr "" +"Python インストールマネージャは、Windows の \"Installed apps\" 設定ページから" +"アンインストールできます。\n" +"グローバルな ``python`` と ``py`` コマンドは削除されますが、ランタイムは一切" +"削除されず、引き続き使えます。\n" +"Python インストールマネージャを再インストールすると、これらのランタイムを再び" +"管理できるようになります。\n" +"すべての Python ランタイムを完全に削除するには、Python インストールマネージャ" +"をアンインストールする前に ``--purge`` を付けて実行してください。" -#: ../../using/windows.rst:383 msgid "Configuration" -msgstr "Configuration" +msgstr "設定" -#: ../../using/windows.rst:385 msgid "" "Python install manager is configured with a hierarchy of configuration " "files, environment variables, command-line options, and registry settings. " @@ -573,14 +726,21 @@ msgid "" "are administrator-only and will override configuration files. Command-line " "options override all other settings, but not every option is available." msgstr "" +"Python インストールマネージャは、設定ファイル、環境変数、コマンドラインオプ" +"ション、レジストリ設定の階層によって設定します。\n" +"一般に、設定ファイルでは、ほかの設定ファイルの場所を含めてすべてを設定できま" +"す。\n" +"レジストリ設定は管理者だけが使用でき、設定ファイルを上書きします。\n" +"コマンドラインオプションはほかのすべての設定を上書きしますが、すべての設定項" +"目に対応するオプションがあるわけではありません。" -#: ../../using/windows.rst:392 msgid "" "This section will describe the defaults, but be aware that modified or " "overridden installs may resolve settings differently." msgstr "" +"この節ではデフォルトの設定を説明しますが、インストールが変更されたり設定が上" +"書きされたりしている場合は、設定の決定方法が異なることがあります。" -#: ../../using/windows.rst:395 msgid "" "A global configuration file may be configured by an :ref:`administrator " "` and would be read first. The user configuration " @@ -591,25 +751,31 @@ msgid "" "or the ``--config`` command line option (but not both). These locations may " "be modified by administrative customization options listed later." msgstr "" +"グローバルな設定ファイルは :ref:`管理者 ` が指定で" +"き、最初に読み込まれます。\n" +"ユーザ設定ファイルは :file:`%AppData%\\\\Python\\\\pymanager.json` に格納さ" +"れ (この場所は ``Local`` ではなく ``Roaming`` の下です)、次に読み込まれて、そ" +"れ以前のファイルの設定を上書きします。\n" +"追加の設定ファイルは、環境変数 ``PYTHON_MANAGER_CONFIG`` またはコマンドライン" +"オプション ``--config`` のいずれかで指定できます (両方は使えません)。\n" +"これらの場所は、後述する管理者向けのカスタマイズオプションで変更できます。" -#: ../../using/windows.rst:406 msgid "" "The following settings are those that are considered likely to be modified " "in normal use. Later sections list those that are intended for " "administrative customization." msgstr "" +"以下の設定は、通常の使用で変更する可能性が高いと考えられるものです。\n" +"管理者によるカスタマイズを目的とした設定は、後の節に記載します。" -#: ../../using/windows.rst:414 msgid "Standard configuration options" -msgstr "" +msgstr "標準の設定オプション" -#: ../../using/windows.rst:418 ../../using/windows.rst:755 msgid "Config Key" -msgstr "" +msgstr "設定キー" -#: ../../using/windows.rst:419 msgid "Environment Variable" -msgstr "" +msgstr "環境変数" #: ../../using/windows.rst:420 ../../using/windows.rst:756 #: ../../using/windows.rst:1629 ../../using/windows.rst:1649 @@ -617,23 +783,22 @@ msgstr "" msgid "Description" msgstr "説明" -#: ../../using/windows.rst:422 msgid "``default_tag``" -msgstr "" +msgstr "``default_tag``" -#: ../../using/windows.rst:424 msgid "" "The preferred default version to launch or install. By default, this is " "interpreted as the most recent non-prerelease version from the CPython team." msgstr "" +"起動またはインストールする際の、優先するデフォルトのバージョンです。\n" +"デフォルトでは、CPython チームが提供するプレリリース版以外の最新バージョンと" +"解釈します。" -#: ../../using/windows.rst:428 msgid "``default_platform``" -msgstr "" +msgstr "``default_platform``" -#: ../../using/windows.rst:429 msgid "``PYTHON_MANAGER_DEFAULT_PLATFORM``" -msgstr "" +msgstr "``PYTHON_MANAGER_DEFAULT_PLATFORM``" #: ../../using/windows.rst:430 msgid "" @@ -643,156 +808,161 @@ msgid "" "but will use ``3.14`` if no tagged install exists." msgstr "" -#: ../../using/windows.rst:436 msgid "``logs_dir``" -msgstr "" +msgstr "``logs_dir``" -#: ../../using/windows.rst:437 msgid "``PYTHON_MANAGER_LOGS``" -msgstr "" +msgstr "``PYTHON_MANAGER_LOGS``" -#: ../../using/windows.rst:438 msgid "The location where log files are written. By default, :file:`%TEMP%`." msgstr "" +"ログファイルを書き込む場所です。\n" +"デフォルトは :file:`%TEMP%` です。" -#: ../../using/windows.rst:441 msgid "``automatic_install``" -msgstr "" +msgstr "``automatic_install``" -#: ../../using/windows.rst:443 msgid "" "True to allow automatic installs when using ``py exec`` to launch (or ``py`` " "when no runtimes are installed yet). Other commands will not automatically " "install, regardless of this setting. By default, true." msgstr "" +"true にすると、``py exec`` で起動する場合 (または、ランタイムがまだインストー" +"ルされていないときに ``py`` で起動する場合) に自動インストールを許可しま" +"す。\n" +"ほかのコマンドは、この設定に関係なく自動インストールを行いません。\n" +"デフォルトは true です。" -#: ../../using/windows.rst:449 msgid "``include_unmanaged``" -msgstr "" +msgstr "``include_unmanaged``" -#: ../../using/windows.rst:450 msgid "``PYTHON_MANAGER_INCLUDE_UNMANAGED``" -msgstr "" +msgstr "``PYTHON_MANAGER_INCLUDE_UNMANAGED``" -#: ../../using/windows.rst:451 msgid "" "True to allow listing and launching runtimes that were not installed by the " "Python install manager, or false to exclude them. By default, true." msgstr "" +"true にすると、Python インストールマネージャでインストールされていないランタ" +"イムの一覧表示や起動を許可し、false にするとそれらを除外します。\n" +"デフォルトは true です。" -#: ../../using/windows.rst:455 msgid "``shebang_can_run_anything``" -msgstr "" +msgstr "``shebang_can_run_anything``" -#: ../../using/windows.rst:456 msgid "``PYTHON_MANAGER_SHEBANG_CAN_RUN_ANYTHING``" -msgstr "" +msgstr "``PYTHON_MANAGER_SHEBANG_CAN_RUN_ANYTHING``" -#: ../../using/windows.rst:457 msgid "" "True to allow shebangs in ``.py`` files to launch applications other than " "Python runtimes, or false to prevent it. By default, true." msgstr "" +"true にすると、``.py`` ファイルのシェバンによる Python ランタイム以外のアプリ" +"ケーションの起動を許可し、false にすると禁止します。\n" +"デフォルトは true です。" -#: ../../using/windows.rst:461 msgid "``shebang_templates``" -msgstr "" +msgstr "``shebang_templates``" -#: ../../using/windows.rst:462 ../../using/windows.rst:486 -#: ../../using/windows.rst:499 ../../using/windows.rst:505 -#: ../../using/windows.rst:512 msgid "(none)" -msgstr "(none)" +msgstr "(なし)" -#: ../../using/windows.rst:463 msgid "" "Mapping from shebang line template to alternative command, such as ``py -V:" "`` or a substitute string. See :ref:`pymanager-shebang` for more " "details." msgstr "" +"シェバン行のテンプレートから、``py -V:`` などの代替コマンドや置換文字列" +"へのマッピングです。\n" +"詳しくは :ref:`pymanager-shebang` を参照してください。" -#: ../../using/windows.rst:467 msgid "``log_level``" -msgstr "" +msgstr "``log_level``" -#: ../../using/windows.rst:468 msgid "``PYMANAGER_VERBOSE``, ``PYMANAGER_DEBUG``" -msgstr "" +msgstr "``PYMANAGER_VERBOSE``, ``PYMANAGER_DEBUG``" -#: ../../using/windows.rst:469 msgid "" "Set the default level of output (0-50). By default, 20. Lower values produce " "more output. The environment variables are boolean, and may produce " "additional output during startup that is later suppressed by other " "configuration." msgstr "" +"出力のデフォルトレベル (0–50) を設定します。\n" +"デフォルトは 20 です。\n" +"値が小さいほど出力が多くなります。\n" +"環境変数は真偽値で、起動中に追加の出力を生成することがあり、この出力は後にほ" +"かの設定で抑制されます。" -#: ../../using/windows.rst:475 msgid "``confirm``" -msgstr "" +msgstr "``confirm``" -#: ../../using/windows.rst:476 msgid "``PYTHON_MANAGER_CONFIRM``" -msgstr "" +msgstr "``PYTHON_MANAGER_CONFIRM``" -#: ../../using/windows.rst:477 msgid "" "True to confirm certain actions before taking them (such as uninstall), or " "false to skip the confirmation. By default, true." msgstr "" +"true にすると、アンインストールなどの特定の操作を実行する前に確認し、false に" +"すると確認を省略します。\n" +"デフォルトは true です。" -#: ../../using/windows.rst:481 msgid "``install.source``" -msgstr "" +msgstr "``install.source``" -#: ../../using/windows.rst:482 msgid "``PYTHON_MANAGER_SOURCE_URL``" -msgstr "" +msgstr "``PYTHON_MANAGER_SOURCE_URL``" -#: ../../using/windows.rst:483 msgid "Override the index feed to obtain new installs from." msgstr "" +"新たにインストールするランタイムの取得元となるインデックスフィードを上書きし" +"ます。" -#: ../../using/windows.rst:485 msgid "``install.enable_entrypoints``" -msgstr "" +msgstr "``install.enable_entrypoints``" -#: ../../using/windows.rst:487 msgid "" "True to generate global commands for installed packages (such as ``pip." "exe``). These are defined by the packages themselves. If set to false, only " "the Python interpreter has global commands created. By default, true. You " "should run ``py install --refresh`` after changing this setting." msgstr "" +"true にすると、インストール済みパッケージ用のグローバルなコマンド (``pip." +"exe`` など) を生成します。\n" +"これらのコマンドはパッケージ自身が定義します。\n" +"false にすると、Python インタープリタのグローバルなコマンドだけを作成しま" +"す。\n" +"デフォルトは true です。\n" +"この設定を変更した後は、``py install --refresh`` を実行してください。" -#: ../../using/windows.rst:493 msgid "``list.format``" -msgstr "" +msgstr "``list.format``" -#: ../../using/windows.rst:494 msgid "``PYTHON_MANAGER_LIST_FORMAT``" -msgstr "" +msgstr "``PYTHON_MANAGER_LIST_FORMAT``" -#: ../../using/windows.rst:495 msgid "" "Specify the default format used by the ``py list`` command. By default, " "``table``." msgstr "" +"``py list`` コマンドで使うデフォルトの形式を指定します。\n" +"デフォルトは ``table`` です。" -#: ../../using/windows.rst:498 msgid "``install_dir``" -msgstr "" +msgstr "``install_dir``" -#: ../../using/windows.rst:500 msgid "" "Specify the root directory that runtimes will be installed into. If you " "change this setting, previously installed runtimes will not be usable unless " "you move them to the new location." msgstr "" +"ランタイムのインストール先となるルートディレクトリを指定します。\n" +"この設定を変更すると、以前にインストールしたランタイムは、新しい場所に移動し" +"ない限り使えなくなります。" -#: ../../using/windows.rst:504 msgid "``global_dir``" -msgstr "" +msgstr "``global_dir``" #: ../../using/windows.rst:506 msgid "" @@ -801,25 +971,26 @@ msgid "" "`PATH` to make the commands available from your terminal." msgstr "" -#: ../../using/windows.rst:511 msgid "``download_dir``" -msgstr "" +msgstr "``download_dir``" -#: ../../using/windows.rst:513 msgid "" "Specify the directory where downloaded files are stored. This directory is a " "temporary cache, and can be cleaned up from time to time." msgstr "" +"ダウンロードしたファイルを格納するディレクトリを指定します。\n" +"このディレクトリは一時的なキャッシュで、ときどきクリーンアップできます。" -#: ../../using/windows.rst:518 msgid "" "Dotted names should be nested inside JSON objects, for example, ``list." "format`` would be specified as ``{\"list\": {\"format\": \"table\"}}``." msgstr "" +"ドット区切りの名前は JSON オブジェクト内で入れ子にしてください。\n" +"たとえば ``list.format`` は ``{\"list\": {\"format\": \"table\"}}`` と指定し" +"ます。" -#: ../../using/windows.rst:524 ../../using/windows.rst:1995 msgid "Shebang lines" -msgstr "" +msgstr "シェバン行" #: ../../using/windows.rst:526 msgid "" @@ -830,40 +1001,37 @@ msgid "" "allow the same facilities to be used with Python scripts on Windows." msgstr "" -#: ../../using/windows.rst:532 msgid "" "To allow shebang lines in Python scripts to be portable between Unix and " "Windows, a number of 'virtual' commands are supported to specify which " "interpreter to use. The supported virtual commands are:" msgstr "" +"Python スクリプトのシェバン行を Unix と Windows の間で移植できるように、使用" +"するインタープリタを指定するためのいくつかの「仮想」コマンドをサポートしてい" +"ます。\n" +"サポートする仮想コマンドは次のとおりです:" -#: ../../using/windows.rst:536 msgid "``/usr/bin/env ``" -msgstr "" +msgstr "``/usr/bin/env ``" -#: ../../using/windows.rst:537 msgid "``/usr/bin/env -S ``" -msgstr "" +msgstr "``/usr/bin/env -S ``" -#: ../../using/windows.rst:538 msgid "``/usr/bin/``" -msgstr "" +msgstr "``/usr/bin/``" -#: ../../using/windows.rst:539 msgid "``/usr/local/bin/``" -msgstr "" +msgstr "``/usr/local/bin/``" -#: ../../using/windows.rst:540 msgid "````" -msgstr "" +msgstr "````" #: ../../using/windows.rst:542 ../../using/windows.rst:2013 msgid "For example, if the first line of your script starts with" msgstr "具体的に、もしスクリプトの1行目が" -#: ../../using/windows.rst:544 ../../using/windows.rst:2015 msgid "#! /usr/bin/python" -msgstr "" +msgstr "#! /usr/bin/python" #: ../../using/windows.rst:548 ../../using/windows.rst:2019 msgid "" @@ -881,7 +1049,6 @@ msgstr "" "Unix 上でも有用であってほしいと思うなら、シェバン行のうち ``/usr`` で始まるも" "のを使用すべきです。" -#: ../../using/windows.rst:554 msgid "" "Any of the above virtual commands can have ```` replaced by an alias " "from an installed runtime. That is, any command generated in the global " @@ -890,15 +1057,23 @@ msgid "" "envvar:`PATH`. This allows the use of shebangs like ``/usr/bin/python3.12`` " "to select a particular runtime." msgstr "" +"上記のどの仮想コマンドでも、```` をインストール済みランタイムのエイリ" +"アスに置き換えられます。\n" +"つまり、グローバルなエイリアス用ディレクトリ (:envvar:`PATH` 環境変数に追加し" +"ているかもしれません) に生成されるコマンドは、:envvar:`PATH` 上になくてもすべ" +"てシェバンで使えます。\n" +"これにより、``/usr/bin/python3.12`` のようなシェバンを使って特定のランタイム" +"を選択できます。" -#: ../../using/windows.rst:560 msgid "" "If no runtimes are installed, or if automatic installation is enabled, the " "requested runtime will be installed if necessary. See :ref:`pymanager-" "config` for information about configuration settings." msgstr "" +"ランタイムがまったくインストールされていない場合や、自動インストールが有効な" +"場合は、必要に応じて要求されたランタイムをインストールします。\n" +"設定の詳細については、:ref:`pymanager-config` を参照してください。" -#: ../../using/windows.rst:564 msgid "" "The ``/usr/bin/env`` form of shebang line will also search the :envvar:" "`PATH` environment variable for unrecognized commands. This corresponds to " @@ -907,6 +1082,12 @@ msgid "" "searching for arbitrary executables, and this search may be disabled by the " "``shebang_can_run_anything`` configuration option." msgstr "" +"``/usr/bin/env`` 形式のシェバン行では、認識されないコマンドについて :envvar:" +"`PATH` 環境変数も検索します。\n" +"これは同じ検索を行う Unix の ``env`` プログラムの動作に対応していますが、既知" +"の Python コマンドの起動を優先します。\n" +"任意の実行ファイルを検索する際には警告が表示されることがあり、この検索は " +"``shebang_can_run_anything`` 設定オプションで無効にできます。" #: ../../using/windows.rst:571 msgid "" @@ -920,7 +1101,6 @@ msgid "" "``shebang_can_run_anything`` configuration option." msgstr "" -#: ../../using/windows.rst:580 msgid "" "Since version 26.3 of the Python install manager, custom shebang templates " "may be added to your configuration file. Add the ``shebang_templates`` " @@ -930,8 +1110,16 @@ msgid "" "`` form is also allowed, as is a plain ``py`` to launch the " "default. No other arguments are supported." msgstr "" +"Python インストールマネージャのバージョン 26.3 以降では、カスタムのシェバンテ" +"ンプレートを設定ファイルに追加できます。\n" +"``shebang_templates`` オブジェクトを追加し、各テンプレート (照合する文字列) " +"と、一致した場合に使うコマンドをメンバーとして指定してください。\n" +"ほとんどの場合、インストール済みランタイムのいずれかを起動する ``py -V:" +"`` (または ``pyw``) をコマンドにします。\n" +"``py -3.`` 形式や、デフォルトを起動するための単なる ``py`` も使えま" +"す。\n" +"ほかの引数はサポートしていません。" -#: ../../using/windows.rst:588 msgid "" "{\n" " \"shebang_templates\": {\n" @@ -940,8 +1128,13 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"shebang_templates\": {\n" +" \"/usr/bin/python\": \"py\",\n" +" \"/usr/bin/my_custom_python\": \"py -V:MyCustomPython/3\"\n" +" }\n" +"}" -#: ../../using/windows.rst:597 msgid "" "If the substitute command is not ``py`` or ``pyw``, it will be written back " "into the shebang and regular handling continues. If launching arbitrary " @@ -950,8 +1143,13 @@ msgid "" "entire line (ignoring leading and trailing whitespace), or up to the first " "space in the shebang line." msgstr "" +"置換後のコマンドが ``py`` や ``pyw`` でなければ、シェバンに書き戻して通常の処" +"理を続けます。\n" +"任意の実行ファイルの起動が許可されている場合は、フルパスを指定することで、" +"Python の代わりに任意の実行ファイルを起動できます。\n" +"テンプレートは、行全体 (先頭と末尾の空白は無視します)、またはシェバン行の最初" +"のスペースまでに一致する必要があります。" -#: ../../using/windows.rst:606 msgid "" "The behaviour of shebangs in the Python install manager is subtly different " "from the previous ``py.exe`` launcher, and the old configuration options no " @@ -960,12 +1158,17 @@ msgid "" "launcher's ``py`` command will override PyManager's one by default, and you " "will need to use ``pymanager`` commands for installing and uninstalling." msgstr "" +"Python インストールマネージャのシェバンの動作は、従来の ``py.exe`` ランチャと" +"は微妙に異なり、以前の設定オプションは適用されません。\n" +"以前の動作や設定に明確に依存している場合は、`legacy launcher`_ のインストール" +"をお勧めします。\n" +"旧ランチャの ``py`` コマンドは、デフォルトで PyManager のものを上書きするた" +"め、インストールやアンインストールには ``pymanager`` コマンドを使う必要があり" +"ます。" -#: ../../using/windows.rst:624 msgid "Advanced installation" -msgstr "" +msgstr "高度なインストール" -#: ../../using/windows.rst:626 msgid "" "For situations where an MSIX cannot be installed, such as some older " "administrative distribution platforms, there is an MSI available from the " @@ -975,22 +1178,33 @@ msgid "" "include this install location, but be sure to validate this on your " "configuration." msgstr "" +"古い管理者向け配布プラットフォームなど、MSIX をインストールできない場合のため" +"に、python.org のダウンロードページでは MSI を提供しています。\n" +"この MSI にはユーザインターフェースがなく、Program Files 内のデフォルトの場所" +"へのマシン単位のインストールだけを行えます。\n" +"システムの :envvar:`PATH` 環境変数にこのインストール先を含めるよう変更を試み" +"ますが、使用する構成で必ず検証してください。" -#: ../../using/windows.rst:635 msgid "" "Windows Server 2019 is the only version of Windows that CPython supports " "that does not support MSIX. For Windows Server 2019, you should use the MSI." msgstr "" +"CPython がサポートしている Windows のうち、MSIX をサポートしていないのは " +"Windows Server 2019 だけです。\n" +"Windows Server 2019 では MSI を使ってください。" -#: ../../using/windows.rst:638 msgid "" "Be aware that the MSI package does not bundle any runtimes, and so is not " "suitable for installs into offline environments without also creating an " "offline install index. See :ref:`pymanager-offline` and :ref:`pymanager-" "admin-config` for information on handling these scenarios." msgstr "" +"MSI パッケージにはランタイムが同梱されていないため、オフラインインストール用" +"のインデックスも作成しなければ、オフライン環境へのインストールには適しませ" +"ん。\n" +"このような場合への対処については、:ref:`pymanager-offline` と :ref:" +"`pymanager-admin-config` を参照してください。" -#: ../../using/windows.rst:643 msgid "" "Runtimes installed by the MSI are shared with those installed by the MSIX, " "and are all per-user only. The Python install manager does not support " @@ -999,8 +1213,14 @@ msgid "" "own system-wide modifications to :envvar:`PATH`, the registry, or the Start " "menu." msgstr "" +"MSI によってインストールしたランタイムは MSIX によってインストールしたものと" +"共有され、すべてユーザ単位に限られます。\n" +"Python インストールマネージャは、マシン単位のランタイムのインストールをサポー" +"トしていません。\n" +"マシン単位のインストールを模倣するには、管理者として ``py install --" +"target=`` を実行し、:envvar:`PATH`、レジストリ、スタートメ" +"ニューにシステム全体への変更を自分で追加できます。" -#: ../../using/windows.rst:649 msgid "" "When the MSIX is installed, but commands are not available in the :envvar:" "`PATH` environment variable, they can be found under :file:`%LocalAppData%\\" @@ -1011,14 +1231,22 @@ msgid "" "Store. Attempting to run the executable directly from Program Files is not " "recommended." msgstr "" +"MSIX がインストールされていても :envvar:`PATH` 環境変数からコマンドを使えない" +"場合は、python.org と Windows Store のどちらからインストールしたかに応じて、:" +"file:`%LocalAppData%\\\\Microsoft\\\\WindowsApps\\\\PythonSoftwareFoundation." +"PythonManager_3847v3x7pw1km` または :file:`%LocalAppData%\\\\Microsoft\\" +"\\WindowsApps\\\\PythonSoftwareFoundation.PythonManager_qbz5n2kfra8p0` にあり" +"ます。\n" +"Program Files から実行ファイルを直接実行しようとすることは推奨しません。" -#: ../../using/windows.rst:658 msgid "" "To programmatically install the Python install manager, it is easiest to use " "WinGet, which is included with all supported versions of Windows:" msgstr "" +"Python インストールマネージャをプログラムからインストールする最も簡単な方法" +"は、サポート対象のすべての Windows バージョンに含まれている WinGet を使うこと" +"です:" -#: ../../using/windows.rst:661 msgid "" "$> winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-" "interactivity\n" @@ -1026,8 +1254,12 @@ msgid "" "# Optionally run the configuration checker and accept all changes\n" "$> py install --configure -y" msgstr "" +"$> winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-" +"interactivity\n" +"\n" +"# 必要なら設定チェッカーを実行し、すべての変更を受け入れる\n" +"$> py install --configure -y" -#: ../../using/windows.rst:668 msgid "" "To download the Python install manager and install on another machine, the " "following WinGet command will download the required files from the Store to " @@ -1036,43 +1268,60 @@ msgid "" "as the downloaded MSIX can be installed by launching or using the commands " "below." msgstr "" +"Python インストールマネージャをダウンロードして別のマシンにインストールするに" +"は、次の WinGet コマンドで、必要なファイルを Store からダウンロードディレクト" +"リにダウンロードします (出力先を変更するには ``-d `` を追加してくだ" +"さい)。\n" +"このコマンドは YAML ファイルも生成しますが、ダウンロードした MSIX は起動する" +"か、以下のコマンドを使ってインストールできるため、このファイルは不要のようで" +"す。" -#: ../../using/windows.rst:674 msgid "" "$> winget download 9NQ7512CXL7T -e --skip-license --accept-package-" "agreements --accept-source-agreements" msgstr "" +"$> winget download 9NQ7512CXL7T -e --skip-license --accept-package-" +"agreements --accept-source-agreements" -#: ../../using/windows.rst:678 msgid "" "To programmatically install or uninstall an MSIX using only PowerShell, the " "`Add-AppxPackage`_ and `Remove-AppxPackage`_ PowerShell cmdlets are " "recommended:" msgstr "" +"PowerShell だけを使ってプログラムから MSIX をインストールまたはアンインストー" +"ルするには、PowerShell コマンドレットの `Add-AppxPackage`_ と `Remove-" +"AppxPackage`_ を推奨します:" -#: ../../using/windows.rst:681 msgid "" "$> Add-AppxPackage C:\\Downloads\\python-manager-25.0.msix\n" "...\n" "$> Get-AppxPackage PythonSoftwareFoundation.PythonManager | Remove-" "AppxPackage" msgstr "" +"$> Add-AppxPackage C:\\Downloads\\python-manager-25.0.msix\n" +"...\n" +"$> Get-AppxPackage PythonSoftwareFoundation.PythonManager | Remove-" +"AppxPackage" -#: ../../using/windows.rst:687 msgid "" "The latest release can be downloaded and installed by Windows by passing the " "AppInstaller file to the Add-AppxPackage command. This installs using the " "MSIX on python.org, and is only recommended for cases where installing via " "the Store (interactively or using WinGet) is not possible." msgstr "" +"AppInstaller ファイルを Add-AppxPackage コマンドに渡すと、Windows が最新リ" +"リースをダウンロードしてインストールできます。\n" +"これは python.org 上の MSIX を使ってインストールする方法で、Store からのイン" +"ストール (対話的な操作や WinGet によるもの) ができない場合に限って推奨しま" +"す。" -#: ../../using/windows.rst:692 msgid "" "$> Add-AppxPackage -AppInstallerFile https://www.python.org/ftp/python/" "pymanager/pymanager.appinstaller" msgstr "" +"$> Add-AppxPackage -AppInstallerFile https://www.python.org/ftp/python/" +"pymanager/pymanager.appinstaller" -#: ../../using/windows.rst:696 msgid "" "Other tools and APIs may also be used to provision an MSIX package for all " "users on a machine, but Python does not consider this a supported scenario. " @@ -1080,6 +1329,12 @@ msgid "" "the native Windows `PackageManager`_ class, or the documentation and support " "for your deployment tool." msgstr "" +"ほかのツールや API を使って、マシン上のすべてのユーザ向けに MSIX パッケージを" +"プロビジョニングすることもできますが、Python はこの利用方法をサポート対象とし" +"ていません。\n" +"PowerShell の `Add-AppxProvisionedPackage`_ コマンドレット、Windows ネイティ" +"ブの `PackageManager`_ クラス、または使用している展開ツールのドキュメントやサ" +"ポートを調べることをお勧めします。" #: ../../using/windows.rst:702 msgid "" @@ -1099,11 +1354,9 @@ msgid "" "prevent using the Store package in this way." msgstr "" -#: ../../using/windows.rst:718 msgid "Administrative configuration" -msgstr "" +msgstr "管理者向けの設定" -#: ../../using/windows.rst:720 msgid "" "There are a number of options that may be useful for administrators to " "override configuration of the Python install manager. These can be used to " @@ -1111,8 +1364,12 @@ msgid "" "content. All of the above configuration options may be set, as well as those " "below." msgstr "" +"Python インストールマネージャの設定を管理者が上書きする際に役立つオプションが" +"いくつかあります。\n" +"これらを使うと、ローカルキャッシュの提供、特定の種類のショートカットの無効" +"化、同梱コンテンツの上書きができます。\n" +"上記の設定オプションはすべて設定でき、以下の設定も使えます。" -#: ../../using/windows.rst:725 msgid "" "Configuration options may be overridden in the registry by setting values " "under :file:`HKEY_LOCAL_MACHINE\\\\Software\\\\Policies\\\\Python\\" @@ -1124,8 +1381,16 @@ msgid "" "Registry key overrides will replace any other configured setting, while " "``base_config`` allows users to further modify settings they may need." msgstr "" +"レジストリの :file:`HKEY_LOCAL_MACHINE\\\\Software\\\\Policies\\\\Python\\" +"\\PyManager` の下に、設定キーと一致する値名、``REG_SZ`` 型の値を設定すると、" +"設定オプションを上書きできます。\n" +"このキー自体もカスタマイズできますが、Python インストールマネージャに付属する" +"コア設定ファイルを変更する方法に限られます。\n" +"ただし、レジストリの値は、上書きする設定一式を含む JSON ファイルを " +"``base_config`` に指定するためだけに使うことをお勧めします。\n" +"レジストリキーによる上書きは、ほかの方法で指定した設定をすべて置き換えます" +"が、``base_config`` を使えば、ユーザが必要な設定をさらに変更できます。" -#: ../../using/windows.rst:735 msgid "" "Note that most settings with environment variables support those variables " "because their default setting specifies the variable. If you override them, " @@ -1136,73 +1401,75 @@ msgid "" "longer be used. If you override the value to ``%CONFIRM%``, then that " "environment variable will be used instead." msgstr "" +"環境変数を使える設定のほとんどは、デフォルト値にその変数を指定することで対応" +"している点に注意してください。\n" +"これらの設定を上書きすると、別の環境変数で上書きしない限り、環境変数は使われ" +"なくなります。\n" +"たとえば、``confirm`` のデフォルト値は文字どおり " +"``%PYTHON_MANAGER_CONFIRM%`` で、読み込み時にこの変数を解決します。\n" +"値を ``yes`` に上書きすると、その環境変数は使われなくなります。\n" +"値を ``%CONFIRM%`` に上書きすると、代わりにそちらの環境変数を使います。" -#: ../../using/windows.rst:744 msgid "" "Configuration settings that are paths are interpreted as relative to the " "directory containing the configuration file that specified them." msgstr "" +"パスを指定する設定は、そのパスを指定した設定ファイルがあるディレクトリからの" +"相対パスとして解釈します。" -#: ../../using/windows.rst:751 msgid "Administrative configuration options" -msgstr "" +msgstr "管理者向けの設定オプション" -#: ../../using/windows.rst:758 msgid "``base_config``" -msgstr "" +msgstr "``base_config``" -#: ../../using/windows.rst:759 msgid "" "The highest priority configuration file to read. Note that only the built-in " "configuration file and the registry can modify this setting." msgstr "" +"最優先で読み込む設定ファイルです。\n" +"この設定は、組み込みの設定ファイルとレジストリだけが変更できます。" -#: ../../using/windows.rst:763 msgid "``user_config``" -msgstr "" +msgstr "``user_config``" -#: ../../using/windows.rst:764 msgid "The second configuration file to read." -msgstr "" +msgstr "2 番目に読み込む設定ファイルです。" -#: ../../using/windows.rst:766 msgid "``additional_config``" -msgstr "" +msgstr "``additional_config``" -#: ../../using/windows.rst:767 msgid "The third configuration file to read." -msgstr "" +msgstr "3 番目に読み込む設定ファイルです。" -#: ../../using/windows.rst:769 msgid "``registry_override_key``" -msgstr "" +msgstr "``registry_override_key``" -#: ../../using/windows.rst:770 msgid "" "Registry location to check for overrides. Note that only the built-in " "configuration file can modify this setting." msgstr "" +"設定の上書きを確認するレジストリ内の場所です。\n" +"この設定は、組み込みの設定ファイルだけが変更できます。" -#: ../../using/windows.rst:773 msgid "``bundled_dir``" -msgstr "" +msgstr "``bundled_dir``" -#: ../../using/windows.rst:774 msgid "Read-only directory containing locally cached files." msgstr "" +"ローカルにキャッシュしたファイルを含む、読み出し専用のディレクトリです。" -#: ../../using/windows.rst:776 msgid "``install.fallback_source``" -msgstr "" +msgstr "``install.fallback_source``" -#: ../../using/windows.rst:777 msgid "" "Path or URL to an index to consult when the main index cannot be accessed." msgstr "" +"メインのインデックスにアクセスできない場合に参照する、インデックスのパスまた" +"は URL です。" -#: ../../using/windows.rst:779 msgid "``install.enable_shortcut_kinds``" -msgstr "" +msgstr "``install.enable_shortcut_kinds``" #: ../../using/windows.rst:780 msgid "" @@ -1210,9 +1477,8 @@ msgid "" "Enabled shortcuts may still be disabled by ``disable_shortcut_kinds``." msgstr "" -#: ../../using/windows.rst:783 msgid "``install.disable_shortcut_kinds``" -msgstr "" +msgstr "``install.disable_shortcut_kinds``" #: ../../using/windows.rst:784 msgid "" @@ -1221,11 +1487,9 @@ msgid "" "``enable_shortcut_kinds``." msgstr "" -#: ../../using/windows.rst:788 msgid "``install.hard_link_entrypoints``" -msgstr "" +msgstr "``install.hard_link_entrypoints``" -#: ../../using/windows.rst:789 msgid "" "True to use hard links for global shortcuts to save disk space. If false, " "each shortcut executable is copied instead. After changing this setting, you " @@ -1233,68 +1497,81 @@ msgid "" "default, true. Disabling this may be necessary for troubleshooting or " "systems that have issues with file links." msgstr "" +"true にすると、ディスク領域を節約するために、グローバルなショートカットにハー" +"ドリンクを使います。\n" +"false にすると、代わりに各ショートカットの実行ファイルをコピーします。\n" +"この設定を変更した後は、既存のコマンドを更新するために ``py install --" +"refresh --force`` を実行しなければなりません。\n" +"デフォルトは true です。\n" +"トラブルシューティングや、ファイルのリンクに問題があるシステムでは、この設定" +"を無効にする必要があるかもしれません。" -#: ../../using/windows.rst:796 msgid "``pep514_root``" -msgstr "" +msgstr "``pep514_root``" -#: ../../using/windows.rst:797 msgid "" "Registry location to read and write PEP 514 entries into. By default, :file:" "`HKEY_CURRENT_USER\\\\Software\\\\Python`." msgstr "" +"PEP 514 のエントリを読み書きする、レジストリ内の場所です。\n" +"デフォルトは :file:`HKEY_CURRENT_USER\\\\Software\\\\Python` です。" -#: ../../using/windows.rst:800 msgid "``start_folder``" -msgstr "" +msgstr "``start_folder``" -#: ../../using/windows.rst:801 msgid "" "Start menu folder to write shortcuts into. By default, ``Python``. This path " "is relative to the user's Programs folder." msgstr "" +"ショートカットを書き込むスタートメニューのフォルダです。\n" +"デフォルトは ``Python`` です。\n" +"このパスは、ユーザの Programs フォルダからの相対パスです。" -#: ../../using/windows.rst:805 msgid "``virtual_env``" -msgstr "" +msgstr "``virtual_env``" -#: ../../using/windows.rst:806 msgid "" "Path to the active virtual environment. By default, this is " "``%VIRTUAL_ENV%``, but may be set empty to disable venv detection." msgstr "" +"アクティブな仮想環境へのパスです。\n" +"デフォルトは ``%VIRTUAL_ENV%`` ですが、空にすると venv の検出を無効にできま" +"す。" -#: ../../using/windows.rst:810 msgid "``shebang_can_run_anything_silently``" -msgstr "" +msgstr "``shebang_can_run_anything_silently``" -#: ../../using/windows.rst:811 msgid "" "True to suppress visible warnings when a shebang launches an application " "other than a Python runtime." msgstr "" +"true にすると、シェバンが Python ランタイム以外のアプリケーションを起動すると" +"きに表示する警告を抑制します。" -#: ../../using/windows.rst:814 msgid "``source_settings``" -msgstr "" +msgstr "``source_settings``" -#: ../../using/windows.rst:815 msgid "" "A mapping from source URL to settings specific to that index. When multiple " "configuration files include this section, URL settings are added or " "overwritten, but individual settings are not merged. These settings are " "currently only for :ref:`index signatures `." msgstr "" +"取得元の URL から、そのインデックスに固有の設定へのマッピングです。\n" +"複数の設定ファイルがこの節を含む場合、URL ごとの設定は追加または上書きします" +"が、個々の設定をマージすることはありません。\n" +"これらの設定は、現在のところ :ref:`インデックスの署名 ` 専用です。" -#: ../../using/windows.rst:825 ../../using/windows.rst:1808 msgid "Installing free-threaded binaries" -msgstr "" +msgstr "フリースレッドバイナリのインストール" -#: ../../using/windows.rst:829 msgid "" "Pre-built distributions of the free-threaded build are available by " "installing tags with the ``t`` suffix." msgstr "" +"``t`` 接尾辞の付いたタグをインストールすると、フリースレッドビルドのビルド済" +"みディストリビューションを入手できます。" #: ../../using/windows.rst:832 msgid "" @@ -1312,11 +1589,9 @@ msgid "" "commands." msgstr "" -#: ../../using/windows.rst:847 msgid "Index signatures" -msgstr "" +msgstr "インデックスの署名" -#: ../../using/windows.rst:851 msgid "" "Index files may be signed to detect tampering. A signature is a catalog file " "at the same URL as the index with ``.cat`` added to the filename. The " @@ -1326,8 +1601,15 @@ msgid "" "long as the client operating system already trusts its certification " "authority (root CA)." msgstr "" +"インデックスファイルには、改ざんを検出するための署名を付けられます。\n" +"署名は、インデックスと同じ URL で、ファイル名に ``.cat`` を付けたカタログファ" +"イルです。\n" +"カタログファイルには、対応するインデックスファイルのハッシュを含め、有効な " +"Authenticode 署名で署名する必要があります。\n" +"このため、(Windows 上の) 標準的なツールで署名を生成でき、クライアントのオペ" +"レーティングシステムがその認証局 (ルート CA) を既に信頼している限り、どの証明" +"書でも使えます。" -#: ../../using/windows.rst:858 msgid "" "Index signatures are only downloaded and checked when the local " "configuration's ``source_settings`` section includes the index URL and " @@ -1335,6 +1617,12 @@ msgid "" "``requires_signature`` set to true. When the setting exists in local " "configuration, even when false, settings in the index are ignored." msgstr "" +"インデックスの署名をダウンロードして検証するのは、ローカル設定の " +"``source_settings`` 節にインデックスの URL が含まれ、``requires_signature`` " +"が true の場合、またはインデックスの JSON で ``requires_signature`` が true " +"に設定されている場合だけです。\n" +"ローカル設定にこの設定があれば、値が false の場合でも、インデックス内の設定は" +"無視します。" #: ../../using/windows.rst:864 msgid "" @@ -1347,7 +1635,6 @@ msgid "" "publisher's country." msgstr "" -#: ../../using/windows.rst:872 msgid "" "Finally, the ``required_publisher_eku`` setting allows requiring that a " "specific Enhanced Key Usage (EKU) has been assigned to the publisher " @@ -1356,8 +1643,13 @@ msgid "" "authentication). In combination with a specific root CA, this provides " "another mechanism to verify a legitimate signature." msgstr "" +"最後に、``required_publisher_eku`` 設定では、発行元の証明書に特定の拡張キー使" +"用法 (Enhanced Key Usage、EKU) が割り当てられていることを要求できます。\n" +"たとえば EKU ``1.3.6.1.5.5.7.3.3`` は、証明書が (サーバやクライアントの認証で" +"はなく) コード署名を目的としていることを示します。\n" +"特定のルート CA と組み合わせることで、正当な署名であることを検証するもう 1 つ" +"の仕組みになります。" -#: ../../using/windows.rst:879 msgid "" "This is an example ``source_settings`` section from a configuration file. In " "this case, the publisher of the feed is uniquely identified by the " @@ -1365,8 +1657,12 @@ msgid "" "by that root. The signature for this case would be found at ``https://www." "python.org/ftp/python/index-windows.json.cat``." msgstr "" +"以下は、設定ファイルの ``source_settings`` 節の例です。\n" +"この場合、Microsoft Identity Verification のルートと、そのルートが割り当てた " +"EKU の組み合わせによって、フィードの発行元を一意に識別します。\n" +"この場合の署名は ``https://www.python.org/ftp/python/index-windows.json." +"cat`` にあります。" -#: ../../using/windows.rst:885 msgid "" "{\n" " \"source_settings\": {\n" @@ -1381,16 +1677,29 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"source_settings\": {\n" +" \"https://www.python.org/ftp/python/index-windows.json\": {\n" +" \"requires_signature\": true,\n" +" \"required_root_subject\": \"CN=Microsoft Identity Verification Root " +"Certificate Authority 2020\",\n" +" \"required_publisher_subject\": \"CN=Python Software Foundation\",\n" +" \"required_publisher_eku\": " +"\"1.3.6.1.4.1.311.97.608394634.79987812.305991749.578777327\"\n" +" }\n" +" }\n" +"}" -#: ../../using/windows.rst:898 msgid "" "The same settings could be specified in the ``index.json`` file instead. In " "this case, the root and EKU are omitted, meaning that the signature must be " "valid and have a specific common name in the publisher's certificate, but no " "other checks are used." msgstr "" +"代わりに ``index.json`` ファイル内で同じ設定を指定することもできます。\n" +"この場合はルートと EKU を省略しており、署名が有効で、発行元の証明書に特定の共" +"通名がある必要がありますが、ほかの検証は行いません。" -#: ../../using/windows.rst:903 msgid "" "{\n" " \"requires_signature\": true,\n" @@ -1400,8 +1709,14 @@ msgid "" " ]\n" "}" msgstr "" +"{\n" +" \"requires_signature\": true,\n" +" \"required_publisher_subject\": \"CN=Python Software Foundation\",\n" +" \"versions\": [\n" +" // ...\n" +" ]\n" +"}" -#: ../../using/windows.rst:913 msgid "" "When settings from inside a feed are used, the user is notified and the " "settings are shown in the log file or verbose output. It is recommended to " @@ -1409,16 +1724,23 @@ msgid "" "used frequently, so that unauthorised modifications to the feed cannot " "disable verification." msgstr "" +"フィード内の設定を使う場合は、ユーザに通知し、設定をログファイルや詳細出力に" +"表示します。\n" +"頻繁に使うフィードでは、これらの設定をローカルの設定ファイルにコピーすること" +"を推奨します。\n" +"これにより、フィードが不正に変更されても検証を無効にできなくなります。" -#: ../../using/windows.rst:918 msgid "" "It is not possible to override the location of the signature file in the " "feed or through a configuration file. Administrators can provide their own " "``source_settings`` in a mandatory configuration file (see :ref:`pymanager-" "admin-config`)." msgstr "" +"署名ファイルの場所を、フィード内や設定ファイルで上書きすることはできませ" +"ん。\n" +"管理者は、強制適用する設定ファイルで独自の ``source_settings`` を指定できま" +"す (:ref:`pymanager-admin-config` を参照)。" -#: ../../using/windows.rst:923 msgid "" "If signature validation fails, you will be notified and prompted to " "continue. When interactive confirmation is not allowed (for example, because " @@ -1426,8 +1748,12 @@ msgid "" "configuration in this scenario, you must provide a configuration file that " "disables signature checking for that feed." msgstr "" +"署名の検証に失敗すると、通知が表示され、続行するか確認を求められます。\n" +"対話的な確認が許可されていない場合 (たとえば ``--yes`` が指定された場合) は、" +"常に中断します。\n" +"この状況で無効な設定を持つフィードを使うには、そのフィードの署名検証を無効に" +"する設定ファイルを用意しなければなりません。" -#: ../../using/windows.rst:929 msgid "" "\"source_settings\": {\n" " \"https://www.example.com/feed-with-invalid-signature.json\": {\n" @@ -1435,19 +1761,25 @@ msgid "" " }\n" "}" msgstr "" +"\"source_settings\": {\n" +" \"https://www.example.com/feed-with-invalid-signature.json\": {\n" +" \"requires_signature\": false\n" +" }\n" +"}" -#: ../../using/windows.rst:939 msgid "Proxy settings" -msgstr "" +msgstr "プロキシの設定" -#: ../../using/windows.rst:943 msgid "" "By default, the Python install manager will use your system-wide proxy " "settings, including automatic authentication. For most users, this behaves " "the same as your browser and other applications." msgstr "" +"デフォルトでは、Python インストールマネージャは自動認証を含め、システム全体の" +"プロキシ設定を使います。\n" +"ほとんどのユーザにとって、この動作はブラウザやほかのアプリケーションと同じで" +"す。" -#: ../../using/windows.rst:947 msgid "" "To override the settings, use the ``NO_PROXY``, ``HTTP_PROXY`` and " "``HTTPS_PROXY`` environment variables. These should be set in the terminal " @@ -1455,40 +1787,56 @@ msgid "" "use the variables, so use caution before setting them globally for your " "entire machine." msgstr "" +"設定を上書きするには、環境変数 ``NO_PROXY``、``HTTP_PROXY``、``HTTPS_PROXY`` " +"を使ってください。\n" +"これらは、Python インストールマネージャを使う前にターミナルセッション内で設定" +"してください。\n" +"ほかのアプリケーションもこれらの変数を使う可能性があるため、マシン全体のグ" +"ローバルな設定にする際は注意してください。" -#: ../../using/windows.rst:953 msgid "" "Setting ``NO_PROXY`` to any non-empty value will disable the use of any " "proxy. Use this to bypass your system's default proxy setting and attempt to " "access the index server directly." msgstr "" +"``NO_PROXY`` に空でない値を設定すると、あらゆるプロキシの使用を無効にしま" +"す。\n" +"システムのデフォルトのプロキシ設定を迂回し、インデックスサーバに直接アクセス" +"を試みる場合に使ってください。" -#: ../../using/windows.rst:957 msgid "" "Setting ``HTTPS_PROXY`` to a string like ``example.com:8080`` will connect " "to that proxy server for all HTTPS connections. For the default index, all " "connections will be using HTTPS, and so this is the usual setting to " "override." msgstr "" +"``HTTPS_PROXY`` に ``example.com:8080`` のような文字列を設定すると、すべての " +"HTTPS 接続でそのプロキシサーバに接続します。\n" +"デフォルトのインデックスではすべての接続が HTTPS を使うため、通常はこの設定を" +"上書きします。" -#: ../../using/windows.rst:961 msgid "" "The ``HTTP_PROXY`` variable may be needed if you are using a private index " "server that does not use encrypted connections, but does require the default " "proxy server to be overridden. It follows the same format as ``HTTPS_PROXY``." msgstr "" +"暗号化した接続を使わないプライベートなインデックスサーバを使い、デフォルトの" +"プロキシサーバを上書きする必要がある場合は、``HTTP_PROXY`` 変数が必要になるか" +"もしれません。\n" +"形式は ``HTTPS_PROXY`` と同じです。" -#: ../../using/windows.rst:965 msgid "" "Credentials may be embedded in either setting, however, when ``HTTPS_PROXY`` " "has credentials embedded they will be used in preference to other " "credentials. Only one set of credentials will be used for both types of " "proxy." msgstr "" +"認証情報はどちらの設定にも埋め込めますが、``HTTPS_PROXY`` に認証情報が埋め込" +"まれていれば、ほかの認証情報よりも優先して使います。\n" +"両方の種類のプロキシで、1 組の認証情報だけを使います。" -#: ../../using/windows.rst:972 ../../using/windows.rst:984 msgid "Troubleshooting" -msgstr "" +msgstr "トラブルシューティング" #: ../../using/windows.rst:974 msgid "" @@ -1499,127 +1847,150 @@ msgid "" "by default)." msgstr "" -#: ../../using/windows.rst:988 msgid "Symptom" -msgstr "" +msgstr "症状" -#: ../../using/windows.rst:989 msgid "Things to try" -msgstr "" +msgstr "試すこと" -#: ../../using/windows.rst:991 msgid "" "``python`` gives me a \"command not found\" error or opens the Store app " "when I type it in my terminal." msgstr "" +"ターミナルに ``python`` と入力すると、\"command not found\" エラーが出るか、" +"Store アプリが開く。" -#: ../../using/windows.rst:993 ../../using/windows.rst:1012 msgid "Did you :ref:`install the Python install manager `?" msgstr "" +":ref:`Python インストールマネージャをインストールしましたか `?" -#: ../../using/windows.rst:996 ../../using/windows.rst:1015 msgid "" "Click Start, open \"Manage app execution aliases\", and check that the " "aliases for \"Python (default)\" are enabled. If they already are, try " "disabling and re-enabling to refresh the command. The \"Python (default " "windowed)\" and \"Python install manager\" commands may also need refreshing." msgstr "" +"スタートをクリックして \"Manage app execution aliases\" を開き、\"Python " +"(default)\" のエイリアスが有効であることを確認してください。\n" +"既に有効であれば、無効にしてから再度有効にし、コマンドを更新してみてくださ" +"い。\n" +"\"Python (default windowed)\" と \"Python install manager\" のコマンドも更新" +"が必要かもしれません。" -#: ../../using/windows.rst:1003 msgid "Check that the ``py`` and ``pymanager`` commands work." -msgstr "" +msgstr "``py`` と ``pymanager`` コマンドが動作することを確認してください。" -#: ../../using/windows.rst:1006 ../../using/windows.rst:1022 msgid "" "Ensure your :envvar:`PATH` variable contains the entry for ``%UserProfile%" "\\AppData\\Local\\Microsoft\\WindowsApps``. The operating system includes " "this entry once by default, after other user paths. If removed, shortcuts " "will not be found." msgstr "" +":envvar:`PATH` 変数に ``%UserProfile%" +"\\AppData\\Local\\Microsoft\\WindowsApps`` のエントリが含まれていることを確認" +"してください。\n" +"オペレーティングシステムは、デフォルトでほかのユーザパスの後にこのエントリを " +"1 つ含めています。\n" +"削除すると、ショートカットが見つからなくなります。" -#: ../../using/windows.rst:1011 msgid "" "``py`` gives me a \"command not found\" error when I type it in my terminal." -msgstr "" +msgstr "ターミナルに ``py`` と入力すると、\"command not found\" エラーが出る。" -#: ../../using/windows.rst:1027 msgid "" "``py`` gives me a \"can't open file\" error when I type commands in my " "terminal." msgstr "" +"ターミナルに ``py`` コマンドを入力すると、\"can't open file\" エラーが出る。" -#: ../../using/windows.rst:1029 msgid "" "This usually means you have the legacy launcher installed and it has " "priority over the Python install manager. To remove, click Start, open " "\"Installed apps\", search for \"Python launcher\" and uninstall it." msgstr "" +"通常これは、旧ランチャがインストールされていて、Python インストールマネージャ" +"よりも優先されていることを意味します。\n" +"削除するには、スタートをクリックして \"Installed apps\" を開き、\"Python " +"launcher\" を検索してアンインストールしてください。" -#: ../../using/windows.rst:1034 msgid "``python`` doesn't launch the same runtime as ``py``" -msgstr "" +msgstr "``python`` と ``py`` が異なるランタイムを起動する" -#: ../../using/windows.rst:1035 msgid "" "Click Start, open \"Installed apps\", look for any existing Python runtimes, " "and either remove them or Modify and disable the :envvar:`PATH` options." msgstr "" +"スタートをクリックして \"Installed apps\" を開き、既存の Python ランタイムを" +"探して、削除するか、Modify を選んで :envvar:`PATH` のオプションを無効にしてく" +"ださい。" -#: ../../using/windows.rst:1039 msgid "" "Click Start, open \"Manage app execution aliases\", and check that your " "``python.exe`` alias is set to \"Python (default)\"" msgstr "" +"スタートをクリックして \"Manage app execution aliases\" を開き、``python." +"exe`` エイリアスが \"Python (default)\" に設定されていることを確認してくださ" +"い" -#: ../../using/windows.rst:1042 msgid "``python`` and ``py`` don't launch the runtime I expect" -msgstr "" +msgstr "``python`` と ``py`` が期待したランタイムを起動しない" -#: ../../using/windows.rst:1043 msgid "" "Check your :envvar:`PYTHON_MANAGER_DEFAULT` environment variable or " "``default_tag`` configuration. The ``py list`` command will show your " "default based on these settings." msgstr "" +"環境変数 :envvar:`PYTHON_MANAGER_DEFAULT` または ``default_tag`` 設定を確認し" +"てください。\n" +"``py list`` コマンドは、これらの設定に基づいたデフォルトを表示します。" -#: ../../using/windows.rst:1048 msgid "" "Installs that are managed by the Python install manager will be chosen ahead " "of unmanaged installs. Use ``py install`` to install the runtime you expect, " "or configure your default tag." msgstr "" +"Python インストールマネージャで管理しているインストールは、管理していないイン" +"ストールよりも優先して選択されます。\n" +"``py install`` で目的のランタイムをインストールするか、デフォルトのタグを設定" +"してください。" -#: ../../using/windows.rst:1054 msgid "" "Prerelease and experimental installs that are not managed by the Python " "install manager may be chosen ahead of stable releases. Configure your " "default tag or uninstall the prerelease runtime and reinstall it using ``py " "install``." msgstr "" +"Python インストールマネージャで管理していないプレリリース版や実験的なインス" +"トールは、安定版よりも優先して選択されることがあります。\n" +"デフォルトのタグを設定するか、プレリリース版のランタイムをアンインストールし" +"て、``py install`` で再インストールしてください。" -#: ../../using/windows.rst:1059 msgid "" "``pythonw`` or ``pyw`` don't launch the same runtime as ``python`` or ``py``" msgstr "" +"``pythonw`` や ``pyw`` が、``python`` や ``py`` と異なるランタイムを起動する" -#: ../../using/windows.rst:1060 msgid "" "Click Start, open \"Manage app execution aliases\", and check that your " "``pythonw.exe`` and ``pyw.exe`` aliases are consistent with your others." msgstr "" +"スタートをクリックして \"Manage app execution aliases\" を開き、``pythonw." +"exe`` と ``pyw.exe`` のエイリアスがほかのエイリアスと整合していることを確認し" +"てください。" -#: ../../using/windows.rst:1063 msgid "" "``pip`` gives me a \"command not found\" error when I type it in my terminal." msgstr "" +"ターミナルに ``pip`` と入力すると、\"command not found\" エラーが出る。" -#: ../../using/windows.rst:1064 ../../using/windows.rst:1076 msgid "" "Have you activated a virtual environment? Run the ``." "venv\\Scripts\\activate`` script in your terminal to activate." msgstr "" +"仮想環境をアクティブにしていますか?\n" +"ターミナルで ``.venv\\Scripts\\activate`` スクリプトを実行してアクティブにし" +"てください。" -#: ../../using/windows.rst:1068 msgid "" "The package may be available but missing the generated executable. We " "recommend using the ``python -m pip`` command instead. Running ``py install " @@ -1627,45 +1998,57 @@ msgid "" "`PATH` (it will be shown in the command output if it is not) should make " "commands such as ``pip`` (and other installed packages) available." msgstr "" +"パッケージは使える状態でも、生成される実行ファイルがない可能性があります。\n" +"代わりに ``python -m pip`` コマンドを使うことを推奨します。\n" +"``py install --refresh`` を実行し、グローバルなショートカット用ディレクトリ" +"が :envvar:`PATH` 上にあることを確認すると (なければコマンドの出力に表示され" +"ます)、``pip`` (やほかのインストール済みパッケージ) などのコマンドが使えるよ" +"うになるはずです。" -#: ../../using/windows.rst:1075 msgid "I installed a package with ``pip`` but its command is not found." -msgstr "" +msgstr "``pip`` でパッケージをインストールしたが、そのコマンドが見つからない。" -#: ../../using/windows.rst:1080 msgid "" "New packages do not automatically have global shortcuts created by the " "Python install manager. Similarly, uninstalled packages do not have their " "shortcuts removed. Run ``py install --refresh`` to update the global " "shortcuts for newly installed packages." msgstr "" +"新しいパッケージをインストールしても、Python インストールマネージャはグローバ" +"ルなショートカットを自動的には作成しません。\n" +"同様に、パッケージをアンインストールしても、そのショートカットは削除しませ" +"ん。\n" +"``py install --refresh`` を実行して、新たにインストールしたパッケージのグロー" +"バルなショートカットを更新してください。" -#: ../../using/windows.rst:1086 msgid "Typing ``script-name.py`` in the terminal opens in a new window." -msgstr "" +msgstr "ターミナルに ``script-name.py`` と入力すると、新しいウィンドウが開く。" -#: ../../using/windows.rst:1087 msgid "" "This is a known limitation of the operating system. Either specify ``py`` " "before the script name, create a batch file containing ``@py \"%~dpn0.py\" " "%*`` with the same name as the script, or install the `legacy launcher`_ and " "select it as the association for scripts." msgstr "" +"これは、オペレーティングシステムの既知の制限です。\n" +"スクリプト名の前に ``py`` を指定するか、スクリプトと同じ名前で ``@py " +"\"%~dpn0.py\" %*`` を含むバッチファイルを作成するか、`legacy launcher`_ をイ" +"ンストールしてスクリプトの関連付けとして選択してください。" -#: ../../using/windows.rst:1092 msgid "Drag-dropping files onto a script doesn't work" -msgstr "" +msgstr "スクリプトへのファイルのドラッグアンドドロップが動作しない" -#: ../../using/windows.rst:1093 msgid "" "This is a known limitation of the operating system. It is supported with the " "`legacy launcher`_, or with the Python install manager when installed from " "the MSI." msgstr "" +"これは、オペレーティングシステムの既知の制限です。\n" +"`legacy launcher`_ を使う場合、または MSI からインストールした Python インス" +"トールマネージャを使う場合にはサポートしています。" -#: ../../using/windows.rst:1097 msgid "I have installed the Python install manager multiple times." -msgstr "" +msgstr "Python インストールマネージャを複数回インストールしてしまった。" #: ../../using/windows.rst:1098 msgid "" @@ -1674,23 +2057,26 @@ msgid "" "will share configuration and runtimes." msgstr "" -#: ../../using/windows.rst:1103 msgid "" "See the earlier :ref:`pymanager-advancedinstall` section for ways to " "uninstall the install manager other than the typical Installed Apps (Add and " "Remove Programs) settings page." msgstr "" +"通常の Installed Apps (プログラムの追加と削除) 設定ページを使わずにインストー" +"ルマネージャをアンインストールする方法については、前述の :ref:`pymanager-" +"advancedinstall` の節を参照してください。" -#: ../../using/windows.rst:1107 msgid "My old ``py.ini`` settings no longer work." -msgstr "" +msgstr "以前の ``py.ini`` 設定が使えなくなった。" -#: ../../using/windows.rst:1108 msgid "" "The new Python install manager no longer supports this configuration file or " "its settings, and so it will be ignored. See :ref:`pymanager-config` for " "information about configuration settings." msgstr "" +"新しい Python インストールマネージャは、この設定ファイルとその設定をサポート" +"しなくなったため、これらを無視します。\n" +"設定の詳細については、:ref:`pymanager-config` を参照してください。" #: ../../using/windows.rst:1115 msgid "The embeddable package" @@ -1706,11 +2092,12 @@ msgstr "" "ZIP ファイルです。これは、エンドユーザから直接的にアクセスされるのではなく何" "かアプリケーションの一部として動作することを意図したものです。" -#: ../../using/windows.rst:1123 msgid "" "To install an embedded distribution, we recommend using ``py install`` with " "the ``--target`` option:" msgstr "" +"埋め込み用の配布をインストールするには、``py install`` に ``--target`` オプ" +"ションを付けて使うことをお勧めします:" #: ../../using/windows.rst:1126 msgid "$> py install 3.14-embed --target=" @@ -1727,12 +2114,14 @@ msgid "" "documentation are not included." msgstr "" -#: ../../using/windows.rst:1137 msgid "" "A default ``._pth`` file is included, which further restricts the default " "search paths (as described below in :ref:`windows_finding_modules`). This " "file is intended for embedders to modify as necessary." msgstr "" +"デフォルトの ``._pth`` ファイルが含まれており、デフォルトの検索パスをさらに制" +"限します (後述の :ref:`windows_finding_modules` で説明します)。\n" +"このファイルは、埋め込む側が必要に応じて変更することを意図しています。" #: ../../using/windows.rst:1141 msgid "" @@ -1757,11 +2146,9 @@ msgid "" "The two recommended use cases for this distribution are described below." msgstr "この配布の 2 つのお勧めできるユースケースを、以下で説明します。" -#: ../../using/windows.rst:1152 msgid "Python application" -msgstr "" +msgstr "Python アプリケーション" -#: ../../using/windows.rst:1154 msgid "" "An application written in Python does not necessarily require users to be " "aware of that fact. The embedded distribution may be used in this case to " @@ -1769,13 +2156,14 @@ msgid "" "transparent it should be (or conversely, how professional it should appear), " "there are two options." msgstr "" -"Python で記述された、必ずしもユーザにその事実を意識させる必要のないアプリケー" -"ションです。埋め込み用配布はこのケースで、インストールパッケージ内に Python " -"のプライベートバージョンを含めるのに使えるでしょう。その事実がどのように透過" -"的であるべきかに依存して (あるいは逆に、どのようにプロフェッショナルにみえる" -"べきか)、2 つの選択肢があります。" +"Python で書かれたアプリケーションでも、必ずしもユーザにその事実を意識させる必" +"要はありません。\n" +"この場合は、埋め込み用の配布を使って、インストールパッケージに専用の Python " +"を含めることができます。\n" +"ユーザに Python の存在をどの程度意識させずに使ってもらいたいか (あるいは逆" +"に、どの程度本格的なアプリケーションに見せたいか) に応じて、2 つの選択肢があ" +"ります。" -#: ../../using/windows.rst:1160 msgid "" "Using a specialized executable as a launcher requires some coding, but " "provides the most transparent experience for users. With a customized " @@ -1785,13 +2173,14 @@ msgid "" "launcher should simply be able to call ``Py_Main`` with a hard-coded command " "line." msgstr "" -"ランチャとなる特別な実行ファイルを使うことはちょっとしたコーディングを必要と" -"しますが、ユーザにとっては最も透過的なユーザ体験となります。カスタマイズされ" -"たランチャでは、何もしなければ Python で実行されるプログラムの明白な目印はあ" -"りません; アイコンはカスタマイズし、会社名やバージョン情報を指定し、ファイル" -"の関連付けがそれに相応しく振舞うようにできます。ほとんどのケースではカスタム" -"ランチャは、ハードコードされたコマンドライン文字列で単純に ``Py_Main`` を呼び" -"出すので済むはずです。" +"専用の実行ファイルをランチャとして使うには多少のコーディングが必要ですが、" +"ユーザが Python の存在を最も意識せずに使える方法です。\n" +"カスタマイズしたランチャでは、プログラムが Python 上で動いていることを示す明" +"白な目印はありません。\n" +"アイコンをカスタマイズでき、会社名やバージョン情報を指定でき、ファイルの関連" +"付けも適切に動作します。\n" +"ほとんどの場合、カスタムランチャは、ハードコードしたコマンドラインで " +"``Py_Main`` を呼び出すだけで済むはずです。" #: ../../using/windows.rst:1167 msgid "" @@ -1824,7 +2213,6 @@ msgstr "" msgid "Embedding Python" msgstr "Python の埋め込み" -#: ../../using/windows.rst:1181 msgid "" "Applications written in native code often require some form of scripting " "language, and the embedded Python distribution can be used for this purpose. " @@ -1834,12 +2222,12 @@ msgid "" "application installation is sufficient to provide a loadable Python " "interpreter." msgstr "" -"ネイティブコードで書かれ、時々スクリプト言語のようなものを必要とするようなア" -"プリケーションです。Python 埋め込み用の配布はこの目的に使えます。一般的に、ア" -"プリケーションの大半がネイティブコード内にあり、一部が ``python.exe`` を呼び" -"出すか、直接的に ``python3.dll`` を使います。どちらのケースでも、ロード可能" -"な Python インタプリタを提供するのには、埋め込み用の配布を展開してアプリケー" -"ションのインストレーションのサブディレクトリに置くことで十分です。" +"ネイティブコードで書かれたアプリケーションでは、何らかのスクリプト言語が必要" +"になることがよくあり、Python の埋め込み用の配布をこの目的に使えます。\n" +"一般に、アプリケーションの大半はネイティブコードで書かれ、一部が ``python." +"exe`` を呼び出すか、``python3.dll`` を直接使います。\n" +"どちらの場合も、埋め込み用の配布をアプリケーションのインストール先のサブディ" +"レクトリに展開すれば、読み込み可能な Python インタープリタを提供できます。" #: ../../using/windows.rst:1188 msgid "" @@ -1879,21 +2267,25 @@ msgstr "" "org/>`_ に行ってください。\n" "ここから先は Python 開発者にとって十分な要約です。" -#: ../../using/windows.rst:1210 msgid "" "The ``nuget.exe`` command line tool may be downloaded directly from " "``https://dist.nuget.org/win-x86-commandline/latest/nuget.exe``, for " "example, using curl or PowerShell. With the tool, the latest version of " "Python for 64-bit or 32-bit machines is installed using::" msgstr "" +"コマンドラインツール ``nuget.exe`` は、たとえば curl や PowerShell を使って " +"``https://dist.nuget.org/win-x86-commandline/latest/nuget.exe`` から直接ダウ" +"ンロードできます。\n" +"このツールでは、次のようにして 64 ビットまたは 32 ビットのマシン向けの最新" +"バージョンの Python をインストールします。 ::" -#: ../../using/windows.rst:1215 msgid "" "nuget.exe install python -ExcludeVersion -OutputDirectory .\n" "nuget.exe install pythonx86 -ExcludeVersion -OutputDirectory ." msgstr "" +"nuget.exe install python -ExcludeVersion -OutputDirectory .\n" +"nuget.exe install pythonx86 -ExcludeVersion -OutputDirectory ." -#: ../../using/windows.rst:1218 msgid "" "To select a particular version, add a ``-Version 3.x.y``. The output " "directory may be changed from ``.``, and the package will be installed into " @@ -1902,16 +2294,15 @@ msgid "" "the specific version installed. Inside the subdirectory is a ``tools`` " "directory that contains the Python installation:" msgstr "" -"特定のバージョンを選択するには、 ``-Version 3.x.y`` を追加してください。\n" -"出力ディレクトリは ``.`` から変更されることがあり、パッケージはサブディレクト" -"リにインストールされます。\n" -"デフォルトではサブディレクトリはパッケージと同じ名前になり、 ``-" -"ExcludeVersion`` オプションを付けないとこの名前はインストールされたバージョン" -"を含みます。\n" -"サブディレクトリの中にはインストールされた Python を含んでいる ``tools`` ディ" -"レクトリがあります:" +"特定のバージョンを選択するには、``-Version 3.x.y`` を追加してください。\n" +"出力ディレクトリは ``.`` から変更でき、パッケージはそのサブディレクトリにイン" +"ストールされます。\n" +"デフォルトではサブディレクトリはパッケージと同じ名前になり、``-" +"ExcludeVersion`` オプションを付けないと、インストールしたバージョンも名前に含" +"まれます。\n" +"そのサブディレクトリの中に、Python のインストールを含む ``tools`` ディレクト" +"リがあります:" -#: ../../using/windows.rst:1225 msgid "" "# Without -ExcludeVersion\n" "> .\\python.3.5.2\\tools\\python.exe -V\n" @@ -1921,20 +2312,26 @@ msgid "" "> .\\python\\tools\\python.exe -V\n" "Python 3.5.2" msgstr "" +"# -ExcludeVersion を付けない場合\n" +"> .\\python.3.5.2\\tools\\python.exe -V\n" +"Python 3.5.2\n" +"\n" +"# -ExcludeVersion を付けた場合\n" +"> .\\python\\tools\\python.exe -V\n" +"Python 3.5.2" -#: ../../using/windows.rst:1235 msgid "" "In general, nuget packages are not upgradeable, and newer versions should be " "installed side-by-side and referenced using the full path. Alternatively, " "delete the package directory manually and install it again. Many CI systems " "will do this automatically if they do not preserve files between builds." msgstr "" -"一般的には、 nuget パッケージはアップグレードできず、より新しいバージョンは横" -"並びにインストールされ、フルパスで参照されます。\n" -"そうする代わりに、手動で直接パッケージを削除し、再度インストールすることもで" -"きます。\n" -"多くの CI システムは、ビルド間でファイルを保存しておかない場合、この作業を自" -"動的に行います。" +"一般に、nuget パッケージはアップグレードできないため、新しいバージョンは既存" +"のものと並べてインストールし、フルパスで参照してください。\n" +"あるいは、パッケージのディレクトリを手動で削除して、再度インストールしてくだ" +"さい。\n" +"多くの CI システムでは、ビルド間でファイルを保持しない場合、この作業を自動的" +"に行います。" #: ../../using/windows.rst:1240 msgid "" @@ -2014,10 +2411,10 @@ msgstr "" "人気のある (numpy, scipy や pandas のような) 科学系モジュールと、パッケージマ" "ネージャ ``conda`` 。" -#: ../../using/windows.rst:1281 msgid "" "`Enthought Deployment Manager `_" msgstr "" +"`Enthought Deployment Manager `_" #: ../../using/windows.rst:1282 msgid "\"The Next Generation Python Environment and Package Manager\"." @@ -2058,9 +2455,8 @@ msgstr "" "ませんし、コア Python チームはこれらを保守もしませんしサポートもしませんので" "ご理解ください。" -#: ../../using/windows.rst:1296 msgid "Supported Windows versions" -msgstr "" +msgstr "サポートする Windows のバージョン" #: ../../using/windows.rst:1298 msgid "" @@ -2071,9 +2467,8 @@ msgid "" "please install Python 3.12." msgstr "" -#: ../../using/windows.rst:1308 ../../using/windows.rst:1595 msgid "Removing the MAX_PATH limitation" -msgstr "" +msgstr "MAX_PATH の制限の解除" #: ../../using/windows.rst:1310 ../../using/windows.rst:1597 msgid "" @@ -2083,7 +2478,6 @@ msgstr "" "Windows は歴史的にパスの長さが 260 文字に制限されています。\n" "つまり、これより長いパスは解決できず結果としてエラーになるということです。" -#: ../../using/windows.rst:1313 msgid "" "In the latest versions of Windows, this limitation can be expanded to over " "32,000 characters. Your administrator will need to activate the \"Enable " @@ -2091,6 +2485,12 @@ msgid "" "registry key " "``HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem``." msgstr "" +"最新バージョンの Windows では、この制限を 32,000 文字を超える長さに拡張できま" +"す。\n" +"管理者が \"Enable Win32 long paths\" グループポリシーを有効にするか、レジスト" +"リキー " +"``HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem`` の " +"``LongPathsEnabled`` を ``1`` に設定する必要があります。" #: ../../using/windows.rst:1318 ../../using/windows.rst:1606 msgid "" @@ -2100,51 +2500,62 @@ msgstr "" "これにより、 :func:`open` 関数や :mod:`os` モジュール、他のほとんどのパスの機" "能が 260 文字より長いパスを受け入れ、返すことができるようになります。" -#: ../../using/windows.rst:1321 msgid "" "After changing the above option and rebooting, no further configuration is " "required." msgstr "" +"上記のオプションを変更して再起動すると、それ以上の設定は必要ありません。" #: ../../using/windows.rst:1328 msgid "UTF-8 mode" msgstr "UTF-8 モード" -#: ../../using/windows.rst:1333 msgid "Python UTF-8 mode is now enabled by default (:pep:`686`)." -msgstr "" +msgstr "Python UTF-8 モードは、デフォルトで有効になりました (:pep:`686`)。" -#: ../../using/windows.rst:1335 msgid "" "Windows still uses legacy encodings for the system encoding (the ANSI Code " "Page). When the :ref:`Python UTF-8 Mode ` is disabled, Python " "uses the ANSI Code Page as the default encoding of text files, as returned " "by :func:`locale.getencoding`." msgstr "" +"Windows は、システムのエンコーディング (ANSI コードページ) として、今でも従来" +"のエンコーディングを使っています。\n" +":ref:`Python UTF-8 モード ` が無効な場合、Python は :func:`locale." +"getencoding` が返す ANSI コードページを、テキストファイルのデフォルトのエン" +"コーディングとして使います。" -#: ../../using/windows.rst:1340 msgid "" "This may cause issues because UTF-8 is widely used on the internet and most " "Unix systems, including WSL (Windows Subsystem for Linux)." msgstr "" +"インターネットや、WSL (Windows Subsystem for Linux) を含むほとんどの Unix シ" +"ステムでは UTF-8 が広く使われているため、これが問題を引き起こすことがありま" +"す。" -#: ../../using/windows.rst:1343 msgid "" "The :ref:`Python UTF-8 Mode `, enabled by default, ignores the " "system encoding and uses UTF-8 as the default text encoding. When the :ref:" "`UTF-8 mode ` is enabled, you can still use the system encoding " "(the ANSI Code Page) via the \"mbcs\" codec." msgstr "" +"デフォルトで有効な :ref:`Python UTF-8 モード ` は、システムのエン" +"コーディングを無視し、デフォルトのテキストエンコーディングとして UTF-8 を使い" +"ます。\n" +":ref:`UTF-8 モード ` が有効な場合でも、\"mbcs\" コーデックを通じて" +"システムのエンコーディング (ANSI コードページ) を使えます。" -#: ../../using/windows.rst:1348 msgid "" "You can disable the :ref:`Python UTF-8 Mode ` via the ``-X " "utf8=0`` command line option, or the ``PYTHONUTF8=0`` environment variable. " "See :envvar:`PYTHONUTF8` for disabling UTF-8 mode, and :ref:`setting-" "envvars` for how to modify environment variables." msgstr "" +"コマンドラインオプション ``-X utf8=0`` または環境変数 ``PYTHONUTF8=0`` によっ" +"て、:ref:`Python UTF-8 モード ` を無効にできます。\n" +"UTF-8 モードの無効化については :envvar:`PYTHONUTF8` を、環境変数の変更方法に" +"ついては :ref:`setting-envvars` を参照してください。" -#: ../../using/windows.rst:1354 msgid "" "Adding ``PYTHONUTF8={0,1}`` to the default environment variables will affect " "all Python 3.7+ applications on your system. If you have any Python 3.7+ " @@ -2152,32 +2563,39 @@ msgid "" "set the environment variable temporarily or use the ``-X utf8`` command line " "option." msgstr "" +"デフォルトの環境変数に ``PYTHONUTF8={0,1}`` を追加すると、システム上のすべて" +"の Python 3.7 以降のアプリケーションに影響します。\n" +"従来のシステムエンコーディングに依存する Python 3.7 以降のアプリケーションが" +"ある場合は、環境変数を一時的に設定するか、コマンドラインオプション ``-X " +"utf8`` を使うことを推奨します。" -#: ../../using/windows.rst:1361 msgid "" "Even when UTF-8 mode is disabled, Python uses UTF-8 by default on Windows " "for:" msgstr "" +"UTF-8 モードが無効でも、Windows 上では Python は次の用途にデフォルトで UTF-8 " +"を使います:" -#: ../../using/windows.rst:1364 msgid "Console I/O including standard I/O (see :pep:`528` for details)." -msgstr "" +msgstr "標準入出力を含むコンソール入出力 (詳細は :pep:`528` を参照)。" -#: ../../using/windows.rst:1365 msgid "" "The :term:`filesystem encoding ` " "(see :pep:`529` for details)." msgstr "" +":term:`ファイルシステムのエンコーディング ` (詳細は :pep:`529` を参照)。" #: ../../using/windows.rst:1372 msgid "Finding modules" msgstr "モジュールの検索" -#: ../../using/windows.rst:1374 msgid "" "These notes supplement the description at :ref:`sys-path-init` with detailed " "Windows notes." msgstr "" +"以下では、:ref:`sys-path-init` の説明を補足する、Windows 固有の詳細を説明しま" +"す。" #: ../../using/windows.rst:1377 msgid "" @@ -2206,7 +2624,6 @@ msgstr "" "(``C:\\`` など)と区別するために、この環境変数に含まれるパスの区切り文字はセミ" "コロンでなければならない事に注意してください。" -#: ../../using/windows.rst:1388 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -2215,12 +2632,12 @@ msgid "" "cause each path to be added to :data:`sys.path`. (Note that all known " "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -"追加で \"アプリケーションのパス\" を ``HKEY_CURRENT_USER`` か " -"``HKEY_LOCAL_MACHINE`` の中の :samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\" -"\\{version}\\\\PythonPath` のサブキーとして登録することができます。サブキーは" -"デフォルト値としてセミコロンで区切られたパス文字列を持つことができ、書くパス" -"が :data:`sys.path` に追加されます。 (既存のインストーラーはすべて HKLM しか" -"利用しないので、 HKCU は通常空です)" +"追加の「アプリケーションパス」は、レジストリの ``HKEY_CURRENT_USER`` と " +"``HKEY_LOCAL_MACHINE`` の両ハイブの下にある :samp:`\\\\SOFTWARE\\\\Python\\" +"\\PythonCore\\\\{version}\\\\PythonPath` のサブキーとして追加できます。\n" +"デフォルト値がセミコロン区切りのパス文字列であるサブキーがあると、各パスを :" +"data:`sys.path` に追加します。\n" +"(既知のインストーラはすべて HKLM だけを使うため、HKCU は通常空です。)" #: ../../using/windows.rst:1395 msgid "" @@ -2273,17 +2690,16 @@ msgstr "" msgid "The end result of all this is:" msgstr "結果としてこうなります:" -#: ../../using/windows.rst:1416 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " "directory), the core path is deduced, and the core paths in the registry are " "ignored. Other \"application paths\" in the registry are always read." msgstr "" -":file:`python.exe` かそれ以外の Python ディレクトリにある .exe ファイルを実行" -"したとき (インストールされている場合でも PCbuild から直接実行されている場合で" -"も) core path が利用され、レジストリ内の core path は無視されます。それ以外の" -"レジストリの \"application paths\" は常に読み込まれます。" +":file:`python.exe` または Python のメインディレクトリにあるほかの .exe を実行" +"する場合 (インストール済みのバージョンでも、PCbuild ディレクトリから直接実行" +"する場合でも)、コアパスを推定し、レジストリ内のコアパスは無視します。\n" +"レジストリ内のほかの「アプリケーションパス」は常に読み込みます。" #: ../../using/windows.rst:1421 msgid "" @@ -2316,13 +2732,16 @@ msgstr "" "(のいずれかまたは組合せ) によりほかのインストレーションとの衝突を避けることが" "できます:" -#: ../../using/windows.rst:1432 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " "environment variables, and also ignore :mod:`site` unless ``import site`` is " "listed." msgstr "" +"実行ファイルと同じ場所に、含めたいディレクトリを列挙した ``._pth`` ファイルを" +"置いてください。\n" +"これにより、レジストリや環境変数に記載されたパスを無視し、``import site`` を" +"列挙していない限り :mod:`site` も無視します。" #: ../../using/windows.rst:1437 msgid "" @@ -2340,7 +2759,6 @@ msgstr "" "`PYTHONPATH` をクリアしたり上書きし、 :envvar:`PYTHONHOME` をセットしてくださ" "い。" -#: ../../using/windows.rst:1444 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -2348,6 +2766,11 @@ msgid "" "directory. (Note that it will not be detected inside a ZIP file, but a " "correctly named ZIP file will be detected instead.)" msgstr "" +"上記の方法を使えない場合 (たとえば、:file:`python.exe` の直接実行を利用者に許" +"可するディストリビューションの場合)、インストールディレクトリ内に目印となる" +"ファイル (:file:`Lib\\\\os.py`) があることを確認してください。\n" +"(ZIP ファイル内にあるものは検出されませんが、代わりに、正しい名前の ZIP ファ" +"イルが検出されます。)" #: ../../using/windows.rst:1450 msgid "" @@ -2370,19 +2793,24 @@ msgid "" "cfg``." msgstr "" -#: ../../using/windows.rst:1463 msgid "" "Add :file:`python{XX}.zip` as a potential landmark when directly adjacent to " "the executable." msgstr "" +"実行ファイルと同じディレクトリにある :file:`python{XX}.zip` を、目印となる" +"ファイルの候補として追加しました。" -#: ../../using/windows.rst:1468 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " "finder is enabled on Windows in 3.6.0 and earlier, but may need to be " "explicitly added to :data:`sys.meta_path` in the future." msgstr "" +"レジストリの ``Modules`` (``PythonPath`` ではありません) に指定されたモジュー" +"ルは、:class:`importlib.machinery.WindowsRegistryFinder` がインポートすること" +"があります。\n" +"このファインダーは、Windows 上の 3.6.0 以前では有効ですが、将来は :data:`sys." +"meta_path` への明示的な追加が必要になるかもしれません。" #: ../../using/windows.rst:1474 msgid "Additional modules" @@ -2410,17 +2838,20 @@ msgstr "" msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1486 msgid "" "The :pypi:`PyWin32` module by Mark Hammond is a collection of modules for " "advanced Windows-specific support. This includes utilities for:" msgstr "" +"Mark Hammond による :pypi:`PyWin32` モジュールは、Windows 固有の高度なサポー" +"トを提供するモジュール群です。\n" +"次のものに対応するユーティリティを含んでいます:" -#: ../../using/windows.rst:1490 msgid "" "`Component Object Model `_ (COM)" msgstr "" +"`Component Object Model `_ (COM)" #: ../../using/windows.rst:1493 msgid "Win32 API calls" @@ -2434,11 +2865,12 @@ msgstr "レジストリ" msgid "Event log" msgstr "イベントログ" -#: ../../using/windows.rst:1496 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" +"`Microsoft Foundation Classes `_ (MFC) のユーザインターフェース" #: ../../using/windows.rst:1500 msgid "" @@ -2450,10 +2882,10 @@ msgstr "" "org/windows/pythonwin/>`_ は PyWin32 に付属している、サンプルのMFCアプリケー" "ションです。これはビルトインのデバッガを含む、組み込み可能なIDEです。" -#: ../../using/windows.rst:1506 msgid "" "`Win32 How Do I...? `_" msgstr "" +"`Win32 How Do I...? `_" #: ../../using/windows.rst:1507 msgid "by Tim Golden" @@ -2471,13 +2903,17 @@ msgstr "by David and Paul Boddie" msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1516 msgid "" "`cx_Freeze `_ wraps Python " "scripts into executable Windows programs (:file:`{*}.exe` files). When you " "have done this, you can distribute your application without requiring your " "users to install Python." msgstr "" +"`cx_Freeze `_ は、Python スクリ" +"プトを Windows の実行可能なプログラム (:file:`{*}.exe` ファイル) にまとめま" +"す。\n" +"これを使うと、ユーザに Python のインストールを求めずにアプリケーションを配布" +"できます。" #: ../../using/windows.rst:1523 msgid "Compiling Python on Windows" @@ -2518,15 +2954,15 @@ msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" "拡張モジュールについては、 :ref:`building-on-windows` を参照してください。" -#: ../../using/windows.rst:1543 msgid "The full installer (deprecated)" -msgstr "" +msgstr "完全版インストーラ (非推奨)" -#: ../../using/windows.rst:1547 msgid "" "This installer is deprecated since 3.14 and will not be produced for Python " "3.16 or later. See :ref:`pymanager` for the modern installer." msgstr "" +"このインストーラは 3.14 から非推奨で、Python 3.16 以降では作成されません。\n" +"現在のインストーラについては :ref:`pymanager` を参照してください。" #: ../../using/windows.rst:1552 msgid "Installation steps" @@ -2595,17 +3031,16 @@ msgstr "" msgid "Shortcuts will only be visible for the current user" msgstr "ショートカットはカレントユーザだけに可視になります。" -#: ../../using/windows.rst:1578 msgid "" "Selecting \"Customize installation\" will allow you to select the features " "to install, the installation location and other options or post-install " "actions. To install debugging symbols or binaries, you will need to use this " "option." msgstr "" -"\"Customize installation\" を選択すると、インストール場所、その他オプションや" -"インストール後のアクションの変更などのインストールの有りようを選べます。デ" -"バッグシンボルやデバッグバイナリをインストールするならこちらを選択する必要が" -"あるでしょう。" +"\"Customize installation\" を選択すると、インストールする機能やインストール" +"先、ほかのオプション、インストール後の操作を選べます。\n" +"デバッグシンボルやデバッグバイナリをインストールするには、このオプションを使" +"う必要があります。" #: ../../using/windows.rst:1582 msgid "" @@ -2668,9 +3103,8 @@ msgstr "これらのオプションを変更したら、それ以上の設定は msgid "Support for long paths was enabled in Python." msgstr "Python で長いパスのサポートが可能になりました。" -#: ../../using/windows.rst:1618 msgid "Installing without UI" -msgstr "" +msgstr "UI を使わないインストール" #: ../../using/windows.rst:1620 msgid "" @@ -2876,13 +3310,12 @@ msgstr "" msgid "AppendPath" msgstr "AppendPath" -#: ../../using/windows.rst:1684 msgid "" "Append install and Scripts directories to :envvar:`PATH` and add ``.PY`` " "to :envvar:`PATHEXT`" msgstr "" -":envvar:`PATH` にインストールディレクトリと Scripts ディレクトリを追加し、 :" -"envvar:`PATHEXT` に ``.PY`` を追加する。" +":envvar:`PATH` の末尾にインストールディレクトリと Scripts ディレクトリを追加" +"し、:envvar:`PATHEXT` に ``.PY`` を追加する。" #: ../../using/windows.rst:1688 msgid "Shortcuts" @@ -3020,9 +3453,8 @@ msgstr "" msgid "SimpleInstall" msgstr "SimpleInstall" -#: ../../using/windows.rst:1726 msgid "Disable most install UI" -msgstr "最大限のインストーラ GUI を無効にする。" +msgstr "インストール UI の大部分を無効にする。" #: ../../using/windows.rst:1728 msgid "SimpleInstallDescription" @@ -3032,17 +3464,15 @@ msgstr "SimpleInstallDescription" msgid "A custom message to display when the simplified install UI is used." msgstr "単純化されたインストーラ GUI を使う際に表示するカスタムメッセージ。" -#: ../../using/windows.rst:1732 msgid "" "For example, to silently install a default, system-wide Python installation, " "you could use the following command (from an elevated command prompt)::" msgstr "" -"例えばデフォルトでシステムワイドな Python インストレーションを静かに行うに" -"は、以下コマンドを使えます (コマンドプロンプトより)::" +"たとえば、デフォルトのシステム全体向けの Python をユーザの操作なしでインス" +"トールするには、管理者権限のコマンドプロンプトから次のコマンドを使えます。 ::" -#: ../../using/windows.rst:1735 msgid "python-3.9.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0" -msgstr "" +msgstr "python-3.9.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0" #: ../../using/windows.rst:1737 msgid "" @@ -3055,11 +3485,12 @@ msgstr "" "トーラの最初のページを単純化して表示し、また、カスタマイズできないようにしま" "す::" -#: ../../using/windows.rst:1741 msgid "" "python-3.9.0.exe InstallAllUsers=0 Include_launcher=0 Include_test=0\n" " SimpleInstall=1 SimpleInstallDescription=\"Just for me, no test suite.\"" msgstr "" +"python-3.9.0.exe InstallAllUsers=0 Include_launcher=0 Include_test=0\n" +" SimpleInstall=1 SimpleInstallDescription=\"Just for me, no test suite.\"" #: ../../using/windows.rst:1744 msgid "" @@ -3085,7 +3516,6 @@ msgstr "" "数値に変換されます。エレメントテキストで与える場合は常に文字列のままです。以" "下は、先の例と同じオプションをセットするファイルの実例です::" -#: ../../using/windows.rst:1754 msgid "" "\n" " " msgstr "" +"\n" +" " -#: ../../using/windows.rst:1767 msgid "Installing without downloading" -msgstr "" +msgstr "ダウンロードせずにインストールする" -#: ../../using/windows.rst:1769 msgid "" "As some features of Python are not included in the initial installer " "download, selecting those features may require an internet connection. To " @@ -3111,32 +3547,28 @@ msgid "" "be bigger than required, but where a large number of installations are going " "to be performed it is very useful to have a locally cached copy." msgstr "" -"Python のいくつかの機能は最初にダウンロードしたインストーラには含まれていない" -"ため、それらの機能をインストールしようと選択するとインターネット接続が必要に" -"なります。\n" -"インターネット接続が必要にならないように、全てのコンポーネントをすぐにできる" -"限りダウンロードして、完全な *配置構成 (layout)* を作成し、どんな機能が選択さ" -"れたかに関わらず、それ以上インターネット接続を必要がないようにします。\n" -"この方法のダウンロードサイズは必要以上に大きくなるかもしれませんが、たくさん" -"の回数インストールしようとする場合には、ローカルにキャッシュされたコピーを持" -"つことはとても有用です。" +"Python の一部の機能は最初にダウンロードするインストーラに含まれていないため、" +"それらを選択するとインターネット接続が必要になることがあります。\n" +"この接続を不要にするには、必要に応じて利用可能なすべてのコンポーネントをダウ" +"ンロードし、完全な *配置構成 (layout)* を作成できます。\n" +"これにより、選択した機能に関係なく、以後のインターネット接続が不要になりま" +"す。\n" +"このダウンロードは必要以上に大きくなるかもしれませんが、大量のインストールを" +"行う場合には、ローカルにキャッシュしたコピーがあると非常に便利です。" -#: ../../using/windows.rst:1777 msgid "" "Execute the following command from Command Prompt to download all possible " "required files. Remember to substitute ``python-3.9.0.exe`` for the actual " "name of your installer, and to create layouts in their own directories to " "avoid collisions between files with the same name." msgstr "" -"コマンドプロンプトから以下のコマンドを実行して、必要なファイルをできる限り全" -"てダウンロードします。\n" -"``python-3.9.0.exe`` 部分は実際のインストーラの名前に置き換え、同名のファイル" -"どうしの衝突が起こらないように、個別のディレクトリ内に配置構成を作るのを忘れ" -"ないようにしてください。" +"必要になる可能性のあるファイルをすべてダウンロードするには、コマンドプロンプ" +"トから次のコマンドを実行してください。\n" +"``python-3.9.0.exe`` は実際のインストーラの名前に置き換え、同名ファイルの衝突" +"を避けるため、配置構成はそれぞれ専用のディレクトリに作成してください。" -#: ../../using/windows.rst:1784 msgid "python-3.9.0.exe /layout [optional target directory]" -msgstr "" +msgstr "python-3.9.0.exe /layout [optional target directory]" #: ../../using/windows.rst:1786 msgid "" @@ -3179,22 +3611,23 @@ msgstr "" "\"Repair\" では、現在の設定で本来インストールされるべきすべてのファイルを検証" "し、削除されていたり更新されていたりするファイルを修正します。" -#: ../../using/windows.rst:1803 msgid "" "\"Uninstall\" will remove Python entirely, with the exception of the :ref:" "`launcher`, which has its own entry in Programs and Features." msgstr "" -"\"Uninstall\" は Python を完全に削除します。「プログラムと機能」内の自身のエ" -"ントリを持つ :ref:`launcher` の例外が起こります。" +"\"Uninstall\" は、:ref:`launcher` を除いて Python を完全に削除します。\n" +"ランチャには、「プログラムと機能」に独立したエントリがあります。" -#: ../../using/windows.rst:1812 msgid "" "To install pre-built binaries with free-threading enabled (see :pep:`703`), " "you should select \"Customize installation\". The second page of options " "includes the \"Download free-threaded binaries\" checkbox." msgstr "" +"フリースレッドが有効なビルド済みバイナリ (:pep:`703` を参照) をインストールす" +"るには、\"Customize installation\" を選択してください。\n" +"オプションの 2 ページ目に \"Download free-threaded binaries\" チェックボック" +"スがあります。" -#: ../../using/windows.rst:1818 msgid "" "Selecting this option will download and install additional binaries to the " "same location as the main Python install. The main executable is called " @@ -3202,8 +3635,13 @@ msgid "" "full ABI suffix. Python source files and bundled third-party dependencies " "are shared with the main install." msgstr "" +"このオプションを選択すると、メインの Python のインストールと同じ場所に追加の" +"バイナリをダウンロードしてインストールします。\n" +"メインの実行ファイルは ``python3.13t.exe`` という名前で、ほかのバイナリには " +"``t`` 接尾辞または完全な ABI 接尾辞が付きます。\n" +"Python のソースファイルや同梱のサードパーティの依存ライブラリは、メインのイン" +"ストールと共有します。" -#: ../../using/windows.rst:1824 msgid "" "The free-threaded version is registered as a regular Python install with the " "tag ``3.13t`` (with a ``-32`` or ``-arm64`` suffix as normal for those " @@ -3214,8 +3652,17 @@ msgid "" "-3.13`` will not. If you use the short style of option, you may prefer to " "not install the free-threaded binaries at this time." msgstr "" +"フリースレッド版は、タグ ``3.13t`` を持つ通常の Python インストールとして登録" +"されます (32 ビットや ARM64 のプラットフォームでは、通常どおり ``-32`` また" +"は ``-arm64`` 接尾辞が付きます)。\n" +"これにより、ツールがこのインストールを検出でき、:ref:`launcher` が ``py.exe " +"-3.13t`` をサポートできます。\n" +"ランチャは ``py.exe -3`` (または ``python3`` のシェバン) を「最新の 3.x のイ" +"ンストール」と解釈するため、通常のバイナリよりもフリースレッドバイナリを優先" +"しますが、``py.exe -3.13`` ではそうならない点に注意してください。\n" +"短い形式のオプションを使う場合は、現時点ではフリースレッドバイナリをインス" +"トールしない方がよいかもしれません。" -#: ../../using/windows.rst:1833 msgid "" "To specify the install option at the command line, use " "``Include_freethreaded=1``. See :ref:`install-layout-option` for " @@ -3223,23 +3670,30 @@ msgid "" "offline install. The options to include debug symbols and binaries also " "apply to the free-threaded builds." msgstr "" +"コマンドラインでインストールオプションを指定するには、" +"``Include_freethreaded=1`` を使ってください。\n" +"オフラインインストールに備えて追加のバイナリを事前にダウンロードする手順につ" +"いては、:ref:`install-layout-option` を参照してください。\n" +"デバッグシンボルやデバッグバイナリを含めるオプションは、フリースレッドビルド" +"にも適用されます。" -#: ../../using/windows.rst:1839 msgid "" "Free-threaded binaries are also available :ref:`on nuget.org `." msgstr "" +"フリースレッドバイナリは :ref:`nuget.org でも入手できます `。" -#: ../../using/windows.rst:1843 msgid "Python launcher for Windows (deprecated)" -msgstr "" +msgstr "Windows 用 Python ランチャ (非推奨)" -#: ../../using/windows.rst:1847 msgid "" "The launcher and this documentation have been superseded by the Python " "Install Manager described above. This is preserved temporarily for " "historical interest." msgstr "" +"このランチャとそのドキュメントは、前述の Python インストールマネージャに置き" +"換えられました。\n" +"歴史的な資料として、一時的に残しています。" #: ../../using/windows.rst:1853 msgid "" @@ -3289,9 +3743,8 @@ msgstr "" "いるのかは重要ではありません。ランチャーが使えるかを確認するには以下のコマン" "ドをコマンドプロンプトで実行してください::" -#: ../../using/windows.rst:1878 msgid "py" -msgstr "" +msgstr "py" #: ../../using/windows.rst:1880 msgid "" @@ -3313,9 +3766,8 @@ msgstr "" "る場合は、Python |version| が起動することになります。Python 3.7 を起動したい" "なら、次のコマンドを実行してみてください::" -#: ../../using/windows.rst:1888 msgid "py -3.7" -msgstr "" +msgstr "py -3.7" #: ../../using/windows.rst:1890 msgid "" @@ -3325,9 +3777,8 @@ msgstr "" "インストールしてある Python 2 の最新バージョンを起動したい場合は、次のコマン" "ドを実行してみてください::" -#: ../../using/windows.rst:1893 msgid "py -2" -msgstr "" +msgstr "py -2" #: ../../using/windows.rst:1895 msgid "" @@ -3335,25 +3786,24 @@ msgid "" msgstr "" "以下のようなエラーが出るようであれば、ランチャはインストールされていません::" -#: ../../using/windows.rst:1897 msgid "" "'py' is not recognized as an internal or external command,\n" "operable program or batch file." msgstr "" +"'py' is not recognized as an internal or external command,\n" +"operable program or batch file." #: ../../using/windows.rst:1900 msgid "The command::" msgstr "このコマンド::" -#: ../../using/windows.rst:1902 msgid "py --list" -msgstr "" +msgstr "py --list" #: ../../using/windows.rst:1904 msgid "displays the currently installed version(s) of Python." msgstr "これは、現在インストールされている Python のバージョンを表示します。" -#: ../../using/windows.rst:1906 msgid "" "The ``-x.y`` argument is the short form of the ``-V:Company/Tag`` argument, " "which allows selecting a specific Python runtime, including those that may " @@ -3361,15 +3811,22 @@ msgid "" "following :pep:`514` will be discoverable. The ``--list`` command lists all " "available runtimes using the ``-V:`` format." msgstr "" +"``-x.y`` 引数は ``-V:Company/Tag`` 引数の短縮形です。\n" +"後者の引数では、python.org 以外から入手したものも含め、特定の Python ランタイ" +"ムを選択できます。\n" +":pep:`514` に従って登録されたランタイムはすべて検出できます。\n" +"``--list`` コマンドは、利用可能なすべてのランタイムを ``-V:`` 形式で一覧表示" +"します。" -#: ../../using/windows.rst:1912 msgid "" "When using the ``-V:`` argument, specifying the Company will limit selection " "to runtimes from that provider, while specifying only the Tag will select " "from all providers. Note that omitting the slash implies a tag::" msgstr "" +"``-V:`` 引数を使う場合、Company を指定すると、その提供元のランタイムだけが選" +"択対象になり、Tag だけを指定するとすべての提供元から選択します。\n" +"スラッシュを省略するとタグとして解釈される点に注意してください。 ::" -#: ../../using/windows.rst:1916 msgid "" "# Select any '3.*' tagged runtime\n" "py -V:3\n" @@ -3380,15 +3837,24 @@ msgid "" "# Select PythonCore's latest Python 3 runtime\n" "py -V:PythonCore/3" msgstr "" +"# タグが '3.*' の任意のランタイムを選択\n" +"py -V:3\n" +"\n" +"# 'PythonCore' がリリースした任意のランタイムを選択\n" +"py -V:PythonCore/\n" +"\n" +"# PythonCore の最新の Python 3 ランタイムを選択\n" +"py -V:PythonCore/3" -#: ../../using/windows.rst:1925 msgid "" "The short form of the argument (``-3``) only ever selects from core Python " "releases, and not other distributions. However, the longer form (``-V:3``) " "will select from any." msgstr "" +"引数の短縮形 (``-3``) は、常にコア Python のリリースだけを選択対象とし、ほか" +"のディストリビューションからは選択しません。\n" +"一方、長い形式 (``-V:3``) はすべてを選択対象とします。" -#: ../../using/windows.rst:1929 msgid "" "The Company is matched on the full string, case-insensitive. The Tag is " "matched on either the full string, or a prefix, provided the next character " @@ -3396,12 +3862,18 @@ msgid "" "``3.10``. Tags are sorted using numerical ordering (``3.10`` is newer than " "``3.1``), but are compared using text (``-V:3.01`` does not match ``3.1``)." msgstr "" +"Company は、大文字・小文字を区別せずに文字列全体を照合します。\n" +"Tag は、文字列全体、またはその次の文字がドットかハイフンである接頭辞と照合し" +"ます。\n" +"これにより ``-V:3.1`` は ``3.1-32`` に一致しますが、``3.10`` には一致しませ" +"ん。\n" +"タグの並べ替えは数値順 (``3.10`` は ``3.1`` より新しい) で行いますが、比較は" +"文字列として行います (``-V:3.01`` は ``3.1`` に一致しません)。" #: ../../using/windows.rst:1937 msgid "Virtual environments" msgstr "仮想環境 (Virtual environments)" -#: ../../using/windows.rst:1941 msgid "" "If the launcher is run with no explicit Python version specification, and a " "virtual environment (created with the standard library :mod:`venv` module or " @@ -3410,12 +3882,12 @@ msgid "" "interpreter, either deactivate the virtual environment, or explicitly " "specify the global Python version." msgstr "" -"(標準ライブラリの :mod:`venv` モジュールか外部ツール ``virtualenv`` で作っ" -"た) 仮想環境がアクティブな状態で Python の明示的なバージョンを指定せずにラン" -"チャを起動すると、ランチャはグローバルなインタプリタではなくその仮想環境のも" -"のを実行します。グローバルなほうのインタプリタを実行するには、仮想環境の動作" -"を停止するか、または明示的にグローバルな Python バージョンを指定してくださ" -"い。" +"Python のバージョンを明示的に指定せずにランチャを実行し、仮想環境 (標準ライブ" +"ラリの :mod:`venv` モジュールや外部ツール ``virtualenv`` で作成したもの) がア" +"クティブな場合は、グローバルなインタープリタではなく、その仮想環境のインター" +"プリタを実行します。\n" +"グローバルなインタープリタを実行するには、仮想環境を非アクティブにするか、グ" +"ローバルな Python のバージョンを明示的に指定してください。" #: ../../using/windows.rst:1949 msgid "From a script" @@ -3429,20 +3901,21 @@ msgstr "" "テスト用の Python スクリプトを作成しましょう。``hello.py`` という名前で以下の" "内容のファイルを作成してください" -#: ../../using/windows.rst:1954 msgid "" "#! python\n" "import sys\n" "sys.stdout.write(\"hello from Python %s\\n\" % (sys.version,))" msgstr "" +"#! python\n" +"import sys\n" +"sys.stdout.write(\"hello from Python %s\\n\" % (sys.version,))" #: ../../using/windows.rst:1960 msgid "From the directory in which hello.py lives, execute the command::" msgstr "hello.py が存在するディレクトリで、下記コマンドを実行してください::" -#: ../../using/windows.rst:1962 msgid "py hello.py" -msgstr "" +msgstr "py hello.py" #: ../../using/windows.rst:1964 msgid "" @@ -3452,9 +3925,8 @@ msgstr "" "インストールされている最新の Python 2.x のバージョン番号が表示されるはずで" "す。では、1行目を以下のように変更してみてください:" -#: ../../using/windows.rst:1967 msgid "#! python3" -msgstr "" +msgstr "#! python3" #: ../../using/windows.rst:1971 msgid "" @@ -3524,15 +3996,15 @@ msgstr "" "Windows の Python ランチャは、Windows 上の Python スクリプトが同じ機能を使用" "できるようにし、上の例ではそれらの機能の使用法を示しています。" -#: ../../using/windows.rst:2004 msgid "" "To allow shebang lines in Python scripts to be portable between Unix and " "Windows, this launcher supports a number of 'virtual' commands to specify " "which interpreter to use. The supported virtual commands are:" msgstr "" -"Python スクリプトのシェバン行を Unix-Windows 間で移植可能にするため、このラン" -"チャは、どのインタプリタが使われるかを指定するための大量の '仮想' コマンドを" -"サポートしています。サポートされる仮想コマンドには以下のものがあります:" +"Python スクリプトのシェバン行を Unix と Windows の間で移植できるように、この" +"ランチャは、使用するインタープリタを指定するためのいくつかの「仮想」コマンド" +"をサポートしています。\n" +"サポートする仮想コマンドは次のとおりです:" #: ../../using/windows.rst:2008 msgid "``/usr/bin/env``" @@ -3578,22 +4050,27 @@ msgstr "" "さらに、マイナーバージョン無しのメジャーバージョンとアーキテクチャだけ (例え" "ば、 ``/usr/bin/python3-64``) で指定できます。" -#: ../../using/windows.rst:2040 msgid "" "The \"-64\" suffix is deprecated, and now implies \"any architecture that is " "not provably i386/32-bit\". To request a specific environment, use the new :" "samp:`-V:{TAG}` argument with the complete tag." msgstr "" +"\"-64\" 接尾辞は非推奨で、現在は「i386/32 ビットであると確認できない任意の" +"アーキテクチャ」を意味します。\n" +"特定の環境を要求するには、新しい :samp:`-V:{TAG}` 引数に完全なタグを指定して" +"ください。" -#: ../../using/windows.rst:2046 msgid "" "Virtual commands referencing ``python`` now prefer an active virtual " "environment rather than searching :envvar:`PATH`. This handles cases where " "the shebang specifies ``/usr/bin/env python3`` but :file:`python3.exe` is " "not present in the active environment." msgstr "" +"``python`` を参照する仮想コマンドは、:envvar:`PATH` を検索するよりも、アク" +"ティブな仮想環境を優先するようになりました。\n" +"これは、シェバンで ``/usr/bin/env python3`` を指定しているのに、アクティブな" +"環境に :file:`python3.exe` がない場合に対応するためです。" -#: ../../using/windows.rst:2051 msgid "" "The ``/usr/bin/env`` form of shebang line has one further special property. " "Before looking for installed Python interpreters, this form will search the " @@ -3606,8 +4083,18 @@ msgid "" "PYLAUNCHER_NO_SEARCH_PATH` may be set (to any value) to skip this search of :" "envvar:`PATH`." msgstr "" +"``/usr/bin/env`` 形式のシェバン行には、もう 1 つ特別な性質があります。\n" +"この形式では、インストール済みの Python インタープリタを探す前に、実行ファイ" +"ルの :envvar:`PATH` を検索し、最初の引数で指定した名前に一致する Python 実行" +"ファイルを探します。\n" +"これは、:envvar:`PATH` の検索を行う Unix の ``env`` プログラムの動作に対応し" +"ます。\n" +"``env`` コマンドの後にある最初の引数に一致する実行ファイルが見つからず、その" +"引数が ``python`` で始まる場合は、ほかの仮想コマンドについて説明した方法で処" +"理します。\n" +"環境変数 :envvar:`!PYLAUNCHER_NO_SEARCH_PATH` に任意の値を設定すると、この :" +"envvar:`PATH` の検索を省略できます。" -#: ../../using/windows.rst:2062 msgid "" "Shebang lines that do not match any of these patterns are looked up in the " "``[commands]`` section of the launcher's :ref:`.INI file `. " @@ -3617,14 +4104,20 @@ msgid "" "executable (additional arguments specified in the .INI will be quoted as " "part of the filename)." msgstr "" +"これらのどのパターンにも一致しないシェバン行は、ランチャの :ref:`.INI ファイ" +"ル ` の ``[commands]`` 節で検索します。\n" +"これを使うと、特定のコマンドをシステムに適した方法で処理できます。\n" +"コマンド名は 1 つの引数でなければならず (シェバン内の実行ファイル名にスペース" +"は使えません)、置換する値は実行ファイルのフルパスです (.INI 内に追加の引数を" +"指定すると、ファイル名の一部として引用符で囲まれます)。" -#: ../../using/windows.rst:2070 msgid "" "[commands]\n" "/bin/xpython=C:\\Program Files\\XPython\\python.exe" msgstr "" +"[commands]\n" +"/bin/xpython=C:\\Program Files\\XPython\\python.exe" -#: ../../using/windows.rst:2075 msgid "" "Any commands not found in the .INI file are treated as **Windows** " "executable paths that are absolute or relative to the directory containing " @@ -3634,6 +4127,13 @@ msgid "" "arguments, after which the path to the script and any additional arguments " "will be appended." msgstr "" +".INI ファイルに見つからないコマンドは、絶対パス、またはスクリプトファイルがあ" +"るディレクトリからの相対パスで表した **Windows** 実行ファイルのパスとして扱い" +"ます。\n" +"この動作は Unix 形式のシェルとは互換性がないため、インストーラが生成するスク" +"リプトなど、Windows 専用のスクリプトのための便宜的な機能です。\n" +"これらのパスは引用符で囲むことができ、複数の引数を含めることもできます。\n" +"その後ろにスクリプトのパスと追加の引数を付け加えます。" #: ../../using/windows.rst:2084 msgid "Arguments in shebang lines" @@ -3647,9 +4147,8 @@ msgstr "" "シェバン行では Python インタプリタに渡される追加の引数を指定することもできま" "す。たとえば、シェバン行に以下のように書かれているとしましょう:" -#: ../../using/windows.rst:2089 msgid "#! /usr/bin/python -v" -msgstr "" +msgstr "#! /usr/bin/python -v" #: ../../using/windows.rst:2093 msgid "Then Python will be started with the ``-v`` option" @@ -3717,7 +4216,6 @@ msgstr "" "たとえば、``#!python`` というシェバン行はバージョン修飾子を含みませんが、``#!" "python3`` はメジャーバージョンを指定するバージョン修飾子を含みます。" -#: ../../using/windows.rst:2125 msgid "" "If no version qualifiers are found in a command, the environment variable :" "envvar:`!PY_PYTHON` can be set to specify the default version qualifier. If " @@ -3726,6 +4224,12 @@ msgid "" "\"3.7-64\". (Note that the \"-64\" option is only available with the " "launcher included with Python 3.7 or newer.)" msgstr "" +"コマンドにバージョン修飾子がない場合は、環境変数 :envvar:`!PY_PYTHON` でデ" +"フォルトのバージョン修飾子を指定できます。\n" +"設定されていなければ、デフォルトは \"3\" です。\n" +"この変数には、\"3\"、\"3.7\"、\"3.7-32\"、\"3.7-64\" など、コマンドラインで渡" +"せる任意の値を指定できます。\n" +"(\"-64\" オプションを使えるのは、Python 3.7 以降に含まれるランチャだけです。)" #: ../../using/windows.rst:2132 msgid "" @@ -3842,11 +4346,12 @@ msgstr "" "``PY_PYTHON=3.7`` と設定することは、INI ファイルに下記が含まれることと等価で" "す:" -#: ../../using/windows.rst:2182 msgid "" "[defaults]\n" "python=3.7" msgstr "" +"[defaults]\n" +"python=3.7" #: ../../using/windows.rst:2187 msgid "" @@ -3856,18 +4361,19 @@ msgstr "" "``PY_PYTHON=3`` と ``PY_PYTHON3=3.7`` を設定することは、INI ファイルに下記が" "含まれることと等価です:" -#: ../../using/windows.rst:2190 msgid "" "[defaults]\n" "python=3\n" "python3=3.7" msgstr "" +"[defaults]\n" +"python=3\n" +"python3=3.7" #: ../../using/windows.rst:2197 msgid "Diagnostics" msgstr "診断" -#: ../../using/windows.rst:2199 msgid "" "If an environment variable :envvar:`!PYLAUNCHER_DEBUG` is set (to any " "value), the launcher will print diagnostic information to stderr (i.e. to " @@ -3877,12 +4383,16 @@ msgid "" "to execute the target Python. It is primarily intended for testing and " "debugging." msgstr "" +"環境変数 :envvar:`!PYLAUNCHER_DEBUG` に任意の値を設定すると、ランチャは標準エ" +"ラー出力 (つまりコンソール) に診断情報を表示します。\n" +"この情報には冗長でありながら簡潔すぎる面もありますが、検出された Python の" +"バージョン、特定のバージョンを選択した理由、対象の Python の実行に使った正確" +"なコマンドラインを確認できるはずです。\n" +"主にテストとデバッグを目的としています。" -#: ../../using/windows.rst:2207 msgid "Dry run" -msgstr "" +msgstr "ドライラン" -#: ../../using/windows.rst:2209 msgid "" "If an environment variable :envvar:`!PYLAUNCHER_DRYRUN` is set (to any " "value), the launcher will output the command it would have run, but will not " @@ -3891,12 +4401,16 @@ msgid "" "written to standard output is always encoded using UTF-8, and may not render " "correctly in the console." msgstr "" +"環境変数 :envvar:`!PYLAUNCHER_DRYRUN` に任意の値を設定すると、ランチャは実行" +"するはずのコマンドを出力しますが、実際には Python を起動しません。\n" +"これは、ランチャで Python を検出してから直接起動したいツールに役立つことがあ" +"ります。\n" +"標準出力に書き込むコマンドは常に UTF-8 でエンコードされるため、コンソールでは" +"正しく表示されない可能性がある点に注意してください。" -#: ../../using/windows.rst:2217 msgid "Install on demand" -msgstr "" +msgstr "必要に応じたインストール" -#: ../../using/windows.rst:2219 msgid "" "If an environment variable :envvar:`!PYLAUNCHER_ALLOW_INSTALL` is set (to " "any value), and the requested Python version is not installed but is " @@ -3904,32 +4418,43 @@ msgid "" "This may require user interaction to complete, and you may need to run the " "command again." msgstr "" +"環境変数 :envvar:`!PYLAUNCHER_ALLOW_INSTALL` に任意の値が設定されていて、要求" +"された Python のバージョンがインストールされておらず、Microsoft Store で入手" +"可能な場合、ランチャはそのインストールを試みます。\n" +"完了するにはユーザの操作が必要になることがあり、コマンドを再実行する必要があ" +"るかもしれません。" -#: ../../using/windows.rst:2224 msgid "" "An additional :envvar:`!PYLAUNCHER_ALWAYS_INSTALL` variable causes the " "launcher to always try to install Python, even if it is detected. This is " "mainly intended for testing (and should be used with :envvar:`!" "PYLAUNCHER_DRYRUN`)." msgstr "" +"追加の変数 :envvar:`!PYLAUNCHER_ALWAYS_INSTALL` を使うと、Python が検出された" +"場合でも、ランチャは常に Python のインストールを試みます。\n" +"これは主にテストを目的としています (:envvar:`!PYLAUNCHER_DRYRUN` と組み合わせ" +"て使ってください)。" -#: ../../using/windows.rst:2229 msgid "Return codes" -msgstr "" +msgstr "戻りコード" -#: ../../using/windows.rst:2231 msgid "" "The following exit codes may be returned by the Python launcher. " "Unfortunately, there is no way to distinguish these from the exit code of " "Python itself." msgstr "" +"Python ランチャは、次の終了コードを返すことがあります。\n" +"残念ながら、これらを Python 自体の終了コードと区別する方法はありません。" -#: ../../using/windows.rst:2234 msgid "" "The names of codes are as used in the sources, and are only for reference. " "There is no way to access or resolve them apart from reading this page. " "Entries are listed in alphabetical order of names." msgstr "" +"コードの名前はソース内で使われているもので、参考として記載しています。\n" +"このページを読む以外に、これらの名前にアクセスしたり、対応する値を取得したり" +"する方法はありません。\n" +"エントリは名前のアルファベット順に記載しています。" #: ../../using/windows.rst:2239 msgid "Value" @@ -3943,9 +4468,8 @@ msgstr "RC_BAD_VENV_CFG" msgid "107" msgstr "107" -#: ../../using/windows.rst:2241 msgid "A :file:`pyvenv.cfg` was found but is corrupt." -msgstr "" +msgstr ":file:`pyvenv.cfg` が見つかりましたが、壊れています。" #: ../../using/windows.rst:2243 msgid "RC_CREATE_PROCESS" @@ -3955,9 +4479,8 @@ msgstr "RC_CREATE_PROCESS" msgid "101" msgstr "101" -#: ../../using/windows.rst:2243 msgid "Failed to launch Python." -msgstr "" +msgstr "Python の起動に失敗しました。" #: ../../using/windows.rst:2245 msgid "RC_INSTALLING" @@ -3967,11 +4490,11 @@ msgstr "RC_INSTALLING" msgid "111" msgstr "111" -#: ../../using/windows.rst:2245 msgid "" "An install was started, but the command will need to be re-run after it " "completes." msgstr "" +"インストールが開始されましたが、完了後にコマンドを再実行する必要があります。" #: ../../using/windows.rst:2248 msgid "RC_INTERNAL_ERROR" @@ -3981,9 +4504,10 @@ msgstr "RC_INTERNAL_ERROR" msgid "109" msgstr "109" -#: ../../using/windows.rst:2248 msgid "Unexpected error. Please report a bug." msgstr "" +"予期しないエラーです。\n" +"バグを報告してください。" #: ../../using/windows.rst:2250 msgid "RC_NO_COMMANDLINE" @@ -3993,9 +4517,8 @@ msgstr "RC_NO_COMMANDLINE" msgid "108" msgstr "108" -#: ../../using/windows.rst:2250 msgid "Unable to obtain command line from the operating system." -msgstr "" +msgstr "オペレーティングシステムからコマンドラインを取得できません。" #: ../../using/windows.rst:2253 msgid "RC_NO_PYTHON" @@ -4005,9 +4528,8 @@ msgstr "RC_NO_PYTHON" msgid "103" msgstr "103" -#: ../../using/windows.rst:2253 msgid "Unable to locate the requested version." -msgstr "" +msgstr "要求されたバージョンが見つかりません。" #: ../../using/windows.rst:2255 msgid "RC_NO_VENV_CFG" @@ -4017,6 +4539,5 @@ msgstr "RC_NO_VENV_CFG" msgid "106" msgstr "106" -#: ../../using/windows.rst:2255 msgid "A :file:`pyvenv.cfg` was required but not found." -msgstr "" +msgstr ":file:`pyvenv.cfg` が必要ですが、見つかりませんでした。" From 05ad9a38a85eb8a769e18f88e92edfa10cde5a18 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Oct 2026 16:07:38 +0000 Subject: [PATCH 14/21] Merge 3.15 into 3.14 --- builtins/constants.po | 43 +- builtins/exceptions.po | 281 ++-- builtins/functions.po | 393 ++++-- builtins/index.po | 21 +- builtins/stdtypes.po | 2404 ++++++++++++++++++++++++--------- builtins/threadsafety.po | 450 ++++-- builtins/time-complexity.po | 438 +++--- library/constants.po | 43 +- library/exceptions.po | 281 ++-- library/functions.po | 338 +++-- library/stdtypes.po | 2167 +++++++++++++++++++++-------- library/threadsafety.po | 441 ++++-- library/time-complexity.po | 416 +++--- reference/compound_stmts.po | 3 +- reference/datamodel.po | 9 +- reference/lexical_analysis.po | 21 +- whatsnew/3.10.po | 3 +- 17 files changed, 5384 insertions(+), 2368 deletions(-) diff --git a/builtins/constants.po b/builtins/constants.po index 336db4adb..8e7402ec4 100644 --- a/builtins/constants.po +++ b/builtins/constants.po @@ -46,15 +46,17 @@ msgstr "" ":class:`bool` 型の真値です。``True`` への代入は不正で、:exc:`SyntaxError` を" "送出します。" -#: ../../builtins/constants.rst:22 msgid "" "An object frequently used to represent the absence of a value, as when " "default arguments are not passed to a function. Assignments to ``None`` are " "illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of " "the :class:`~types.NoneType` type." msgstr "" +"関数にデフォルト引数が渡されなかった場合など、値が存在しないことを表すために" +"よく使われるオブジェクトです。\n" +"``None`` への代入は不正で、:exc:`SyntaxError` を送出します。\n" +"``None`` は :class:`~types.NoneType` 型の唯一のインスタンスです。" -#: ../../builtins/constants.rst:30 msgid "" "A special value which should be returned by the binary special methods (e." "g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" @@ -65,6 +67,15 @@ msgid "" "boolean context. :data:`!NotImplemented` is the sole instance of the :class:" "`types.NotImplementedType` type." msgstr "" +"二項演算の特殊メソッド (例えば :meth:`~object.__eq__`、:meth:`~object." +"__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` など) が、\n" +"もう一方の型に対する演算を実装していないことを示すために返すべき特殊な値で" +"す。\n" +"インプレースの二項演算の特殊メソッド (例えば :meth:`~object.__imul__`、:meth:" +"`~object.__iand__` など) も、同じ目的でこの値を返せます。\n" +"真偽値として評価してはいけません。\n" +":data:`!NotImplemented` は :class:`types.NotImplementedType` 型の唯一のインス" +"タンスです。" msgid "" "When a binary (or in-place) method returns :data:`!NotImplemented` the " @@ -90,31 +101,41 @@ msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "" "例として :ref:`implementing-the-arithmetic-operations` を参照してください。" -#: ../../builtins/constants.rst:51 msgid "" ":data:`!NotImplemented` and :exc:`!NotImplementedError` are not " "interchangeable. This constant should only be used as described above; see :" "exc:`NotImplementedError` for details on correct usage of the exception." msgstr "" +":data:`!NotImplemented` と :exc:`!NotImplementedError` は互いに置き換えられま" +"せん。\n" +"この定数は、上で説明した用途にのみ使ってください。\n" +"例外の正しい使い方については :exc:`NotImplementedError` を参照してください。" -#: ../../builtins/constants.rst:56 msgid "Evaluating :data:`!NotImplemented` in a boolean context was deprecated." msgstr "" +":data:`!NotImplemented` を真偽値として評価することは非推奨となりました。" -#: ../../builtins/constants.rst:59 msgid "" "Evaluating :data:`!NotImplemented` in a boolean context now raises a :exc:" "`TypeError`. It previously evaluated to :const:`True` and emitted a :exc:" "`DeprecationWarning` since Python 3.9." msgstr "" +":data:`!NotImplemented` を真偽値として評価すると、:exc:`TypeError` が送出され" +"るようになりました。\n" +"以前は :const:`True` と評価され、Python 3.9 以降では :exc:" +"`DeprecationWarning` も発生していました。" -#: ../../builtins/constants.rst:68 msgid "" "The same as the ellipsis literal \"``...``\", an object frequently used to " "indicate that something is omitted. Assignment to ``Ellipsis`` is possible, " "but assignment to ``...`` raises a :exc:`SyntaxError`. ``Ellipsis`` is the " "sole instance of the :class:`types.EllipsisType` type." msgstr "" +"省略を示すリテラル \"``...``\" と同じオブジェクトで、何かが省略されていること" +"を示すためによく使われます。\n" +"``Ellipsis`` には代入できますが、``...`` に代入すると :exc:`SyntaxError` が送" +"出されます。\n" +"``Ellipsis`` は :class:`types.EllipsisType` 型の唯一のインスタンスです。" #: ../../builtins/constants.rst:76 msgid "" @@ -151,20 +172,26 @@ msgstr "" "かの定数を追加します。それらは対話的インタープリタシェルで有用ですが、プログ" "ラム中では使うべきではありません。" -#: ../../builtins/constants.rst:100 msgid "" "Objects that when printed, print a message like \"Use quit() or Ctrl-D (i.e. " "EOF) to exit\", and when accessed directly in the interactive interpreter or " "called as functions, raise :exc:`SystemExit` with the specified exit code." msgstr "" +"表示すると \"Use quit() or Ctrl-D (i.e. EOF) to exit\" のようなメッセージを表" +"示するオブジェクトです。\n" +"対話型インタープリタで直接入力するか、関数として呼び出すと、指定した終了コー" +"ドで :exc:`SystemExit` を送出します。" -#: ../../builtins/constants.rst:108 msgid "" "Object that when printed, prints the message \"Type help() for interactive " "help, or help(object) for help about object.\", and when accessed directly " "in the interactive interpreter, invokes the built-in help system (see :func:" "`help`)." msgstr "" +"表示すると \"Type help() for interactive help, or help(object) for help " +"about object.\" というメッセージを表示するオブジェクトです。\n" +"対話型インタープリタで直接入力すると、組み込みヘルプシステムを起動します (:" +"func:`help` を参照してください)。" #: ../../builtins/constants.rst:116 msgid "" diff --git a/builtins/exceptions.po b/builtins/exceptions.po index 5ca9348f6..3d91da35e 100644 --- a/builtins/exceptions.po +++ b/builtins/exceptions.po @@ -94,7 +94,6 @@ msgid "" msgstr "" "例外オブジェクトの3つの属性は、例外が送出された状況に関する情報を提供します:" -#: ../../builtins/exceptions.rst:53 msgid "" "When raising a new exception while another exception is already being " "handled, the new exception's :attr:`!__context__` attribute is automatically " @@ -102,16 +101,20 @@ msgid "" "`except` or :keyword:`finally` clause, or a :keyword:`with` statement, is " "used." msgstr "" +"別の例外の処理中に新しい例外を送出すると、新しい例外の :attr:`!__context__` " +"属性には、処理中の例外が自動的に設定されます。\n" +"例外の処理は、:keyword:`except` 節、:keyword:`finally` 節、:keyword:`with` 文" +"を使うときに行われることがあります。" -#: ../../builtins/exceptions.rst:59 msgid "" "This implicit exception context can be supplemented with an explicit cause " "by using :keyword:`!from` with :keyword:`raise`::" msgstr "" +":keyword:`raise` とともに :keyword:`!from` を使うと、この暗黙の例外コンテキス" +"トに明示的な原因を付け加えられます。 ::" -#: ../../builtins/exceptions.rst:63 msgid "raise new_exc from original_exc" -msgstr "" +msgstr "raise new_exc from original_exc" msgid "" "The expression following :keyword:`from` must be an exception or " @@ -159,15 +162,17 @@ msgstr "" msgid "Inheriting from built-in exceptions" msgstr "組み込み例外から継承する" -#: ../../builtins/exceptions.rst:88 msgid "" "User code can create subclasses that inherit from an exception type. It's " "recommended to only subclass one exception type at a time to avoid any " "possible conflicts between how the bases handle the ``args`` attribute, as " "well as due to possible memory layout incompatibilities." msgstr "" +"ユーザコードでは、例外型を継承したサブクラスを作成できます。\n" +"基底クラス間で ``args`` 属性の扱いが衝突したり、メモリレイアウトの互換性に問" +"題が生じたりする可能性があるため、\n" +"一度に継承する例外型は一つだけにすることを推奨します。" -#: ../../builtins/exceptions.rst:95 msgid "" "Most built-in exceptions are implemented in C for efficiency, see: :source:" "`Objects/exceptions.c`. Some have custom memory layouts which makes it " @@ -176,6 +181,13 @@ msgid "" "between Python versions, leading to new conflicts in the future. Therefore, " "it's recommended to avoid subclassing multiple exception types altogether." msgstr "" +"ほとんどの組み込み例外は効率のために C で実装されています (:source:`Objects/" +"exceptions.c` を参照してください)。\n" +"一部の例外は独自のメモリレイアウトを持つため、そうした例外型の組み合わせでは" +"多重継承できません。\n" +"型のメモリレイアウトは実装の詳細であり、Python のバージョンによって変わり、将" +"来新たな衝突が生じる可能性があります。\n" +"そのため、複数の例外型からの継承は避けることを推奨します。" #: ../../builtins/exceptions.rst:105 msgid "Base classes" @@ -212,7 +224,6 @@ msgstr "" "`OSError` など) いくつかの引数を必要とし、このタプルの要素に特別な意味を込め" "るものもあります。" -#: ../../builtins/exceptions.rst:126 msgid "" "This method sets *tb* as the new traceback for the exception and returns the " "exception object. It was more commonly used before the exception chaining " @@ -223,8 +234,17 @@ msgid "" "happened to the traceback of the original ``SomeException`` had we allowed " "it to propagate to the caller. ::" msgstr "" +"このメソッドは、例外の新しいトレースバックに *tb* を設定し、その例外オブジェ" +"クトを返します。\n" +":pep:`3134` の例外連鎖機能が使えるようになる前は、より広く使われていまし" +"た。\n" +"次の例は、トレースバックを保持しながら ``SomeException`` のインスタンスを " +"``OtherException`` のインスタンスに変換する方法を示します。\n" +"``OtherException`` を送出すると、そのトレースバックに現在のフレームが追加され" +"ます。\n" +"元の ``SomeException`` を呼び出し元に伝播させた場合にも、そのトレースバックに" +"同じようにフレームが追加されます。 ::" -#: ../../builtins/exceptions.rst:135 msgid "" "try:\n" " ...\n" @@ -232,12 +252,19 @@ msgid "" " tb = sys.exception().__traceback__\n" " raise OtherException(...).with_traceback(tb)" msgstr "" +"try:\n" +" ...\n" +"except SomeException:\n" +" tb = sys.exception().__traceback__\n" +" raise OtherException(...).with_traceback(tb)" -#: ../../builtins/exceptions.rst:143 msgid "" "A writable field that holds the :ref:`traceback object ` " "associated with this exception. See also: :ref:`raise`." msgstr "" +"この例外に関連付けられた :ref:`トレースバックオブジェクト ` を保持する、書き込み可能なフィールドです。\n" +":ref:`raise` も参照してください。" #: ../../builtins/exceptions.rst:149 msgid "" @@ -314,30 +341,32 @@ msgstr "" "ます (オブジェクトが属性の参照や属性の代入をまったくサポートしていない場合に" "は :exc:`TypeError` が送出されます)。" -#: ../../builtins/exceptions.rst:207 msgid "" "The optional *name* and *obj* keyword-only arguments set the corresponding " "attributes:" msgstr "" +"オプションのキーワード専用引数 *name* と *obj* は、対応する属性に値を設定しま" +"す:" -#: ../../builtins/exceptions.rst:212 msgid "The name of the attribute that was attempted to be accessed." -msgstr "" +msgstr "アクセスしようとした属性の名前。" -#: ../../builtins/exceptions.rst:216 msgid "The object that was accessed for the named attribute." -msgstr "" +msgstr "指定した名前の属性にアクセスしようとした対象のオブジェクト。" #: ../../builtins/exceptions.rst:218 msgid "Added the :attr:`name` and :attr:`obj` attributes." msgstr ":attr:`name` および :attr:`obj` 属性が追加されました。" -#: ../../builtins/exceptions.rst:223 msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " "without reading any data. (Note: the :meth:`io.TextIOBase.read` and :meth:" "`io.IOBase.readline` methods return an empty string when they hit EOF.)" msgstr "" +":func:`input` 関数がデータを何も読み込まずにファイル終端 (EOF) に達した場合に" +"送出されます。\n" +"(注: :meth:`io.TextIOBase.read` メソッドと :meth:`io.IOBase.readline` メソッ" +"ドは、EOF に達すると空文字列を返します。)" #: ../../builtins/exceptions.rst:230 msgid "Not currently used." @@ -395,11 +424,12 @@ msgstr "" "ない場合に送出されます。また、 :data:`sys.modules` に ``None`` が含まれる場合" "にも送出されます。" -#: ../../builtins/exceptions.rst:271 msgid "" "A subclass of :exc:`ImportError` which is raised when a lazy import fails " "because it (directly or indirectly) tries to import itself." msgstr "" +":exc:`ImportError` のサブクラスで、遅延インポートが自身を直接または間接的にイ" +"ンポートしようとして失敗した場合に送出されます。" #: ../../builtins/exceptions.rst:278 msgid "" @@ -432,7 +462,6 @@ msgstr "" "を捕捉するコードに誤って捕捉されてインタプリタの終了が阻害されないように、こ" "の例外は :exc:`BaseException` を継承しています。" -#: ../../builtins/exceptions.rst:302 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -440,6 +469,13 @@ msgid "" "allow :exc:`KeyboardInterrupt` to end the program as quickly as possible or " "avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" msgstr "" +":exc:`KeyboardInterrupt` の捕捉には特別な配慮が必要です。\n" +"この例外は予測できない箇所で送出される可能性があるため、状況によっては、実行" +"中のプログラムが不整合な状態になることがあります。\n" +"一般には、:exc:`KeyboardInterrupt` によってできるだけ速やかにプログラムを終了" +"させるか、\n" +"この例外の送出自体を避けるのが最善です (:ref:`handlers-and-exceptions` を参照" +"してください)。" #: ../../builtins/exceptions.rst:312 msgid "" @@ -469,13 +505,11 @@ msgstr "" "修飾の (訳注: ``spam.egg`` ではなく単に ``egg`` のような) 名前のみに適用され" "ます。関連値は見つからなかった名前を含むエラーメッセージです。" -#: ../../builtins/exceptions.rst:327 msgid "The optional *name* keyword-only argument sets the attribute:" -msgstr "" +msgstr "オプションのキーワード専用引数 *name* は、次の属性に値を設定します:" -#: ../../builtins/exceptions.rst:331 msgid "The name of the variable that was attempted to be accessed." -msgstr "" +msgstr "アクセスしようとした変数の名前。" #: ../../builtins/exceptions.rst:333 msgid "Added the :attr:`name` attribute." @@ -493,22 +527,26 @@ msgstr "" "また、クラスの開発中に、実際の実装をまだ追加する必要があることを示すためにも" "送出するべきです。" -#: ../../builtins/exceptions.rst:346 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -"演算子やメソッドがサポートされていないことを示す目的でこの例外を使用するべき" -"ではありません。そのようなケースではオペレータやメソッドを未定義のままとする" -"か、サブクラスの場合は :data:`None` を設定してください。" +"演算子やメソッドをそもそもサポートする意図がないことを示すために、この例外を" +"使うべきではありません。\n" +"その場合は演算子やメソッドを未定義のままにするか、サブクラスであれば :data:" +"`None` を設定してください。" -#: ../../builtins/exceptions.rst:352 msgid "" ":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " "interchangeable. This exception should only be used as described above; see :" "data:`NotImplemented` for details on correct usage of the built-in constant." msgstr "" +":exc:`!NotImplementedError` と :data:`!NotImplemented` は互いに置き換えられま" +"せん。\n" +"この例外は、上で説明した用途にのみ使ってください。\n" +"組み込み定数の正しい使い方については :data:`NotImplemented` を参照してくださ" +"い。" #: ../../builtins/exceptions.rst:363 msgid "" @@ -591,12 +629,15 @@ msgstr "" "ファイルシステムパスが2つ関与する関数 (例えば :func:`os.rename`) の場合、:" "attr:`filename2` は関数に渡された2つ目のファイル名です。" -#: ../../builtins/exceptions.rst:412 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :" "exc:`OSError`, and the constructor may return a subclass." msgstr "" +":exc:`EnvironmentError`、:exc:`IOError`、:exc:`WindowsError`、:exc:`socket." +"error`、:exc:`select.error`、:exc:`!mmap.error` は :exc:`OSError` に統合さ" +"れ、\n" +"コンストラクタはサブクラスを返すことがあります。" msgid "" "The :attr:`filename` attribute is now the original file name passed to the " @@ -624,36 +665,37 @@ msgstr "" "出されることがあります。C の浮動小数点演算の例外処理は標準化されていないの" "で、ほとんどの浮動小数点演算もチェックされません。" -#: ../../builtins/exceptions.rst:437 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when an " "operation is blocked during interpreter shutdown also known as :term:`Python " "finalization `." msgstr "" +"この例外は :exc:`RuntimeError` から派生しています。\n" +":term:`Python の終了処理 ` とも呼ばれるインタープリタの" +"シャットダウン中に、操作が阻止された場合に送出されます。" -#: ../../builtins/exceptions.rst:441 msgid "" "Examples of operations which can be blocked with a :exc:" "`PythonFinalizationError` during the Python finalization:" msgstr "" +"Python の終了処理中に :exc:`PythonFinalizationError` によって阻止されることが" +"ある操作の例:" -#: ../../builtins/exceptions.rst:444 msgid "Creating a new Python thread." -msgstr "" +msgstr "新しい Python スレッドの作成。" -#: ../../builtins/exceptions.rst:445 msgid ":meth:`Joining ` a running daemon thread." -msgstr "" +msgstr "実行中のデーモンスレッドの :meth:`終了待機 `。" -#: ../../builtins/exceptions.rst:446 msgid ":func:`os.fork`," -msgstr "" +msgstr ":func:`os.fork` の呼び出し。" -#: ../../builtins/exceptions.rst:447 msgid "" "acquiring a lock such as :class:`threading.Lock`, when it is known that the " "operation would otherwise deadlock." msgstr "" +"そのまま操作を進めるとデッドロックすると分かっている場合の、:class:" +"`threading.Lock` などのロックの獲得。" #: ../../builtins/exceptions.rst:450 msgid "See also the :func:`sys.is_finalizing` function." @@ -663,9 +705,10 @@ msgstr ":func:`sys.is_finalizing` 関数も参照してください。" msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "以前は :exc:`RuntimeError` をそのまま送出していました。" -#: ../../builtins/exceptions.rst:457 msgid ":meth:`threading.Thread.join` can now raise this exception." msgstr "" +":meth:`threading.Thread.join` がこの例外を送出することがあるようになりまし" +"た。" #: ../../builtins/exceptions.rst:461 msgid "" @@ -773,16 +816,17 @@ msgstr "" "イテレーションを停止するために、:term:`asynchronous iterator` オブジェクト" "の :meth:`~object.__anext__` メソッドから送出しなければなりません。" -#: ../../builtins/exceptions.rst:531 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" "`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script " "or standard input (also interactively)." msgstr "" -"パーザが構文エラーに遭遇した場合に送出されます。この例外は :keyword:`import` " -"文、組み込み関数 :func:`compile`、:func:`exec` や :func:`eval` 、初期化スクリ" -"プトの読み込みや標準入力で (対話的な実行時にも) 起こる可能性があります。" +"パーザが構文エラーに遭遇した場合に送出されます。\n" +"この例外は、:keyword:`import` 文、組み込み関数 :func:`compile`、:func:" +"`exec`、:func:`eval` の呼び出し、\n" +"最初に実行するスクリプトや標準入力の読み込み時 (対話的な実行時も含みます) に" +"起こる可能性があります。" #: ../../builtins/exceptions.rst:537 msgid "" @@ -860,7 +904,6 @@ msgstr "" "タブとスペースを一貫しない方法でインデントに使っているときに送出されます。こ" "れは :exc:`IndentationError` のサブクラスです。" -#: ../../builtins/exceptions.rst:590 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " @@ -868,8 +911,12 @@ msgid "" "`CPython`, this could be raised by incorrectly using Python's C API, such as " "returning a ``NULL`` value without an exception set." msgstr "" +"インタープリタが内部エラーを検出したものの、実行の継続を断念するほど深刻な状" +"況ではない場合に送出されます。\n" +"関連値は、何が問題だったのかを低水準の用語で示す文字列です。\n" +":term:`CPython` では、例外を設定せずに ``NULL`` 値を返すなど、Python の C " +"API を誤って使うと送出されることがあります。" -#: ../../builtins/exceptions.rst:596 msgid "" "If you're confident that this exception wasn't your fault, or the fault of a " "package you're using, you should report this to the author or maintainer of " @@ -879,8 +926,14 @@ msgid "" "associated value) and if possible the source of the program that triggered " "the error." msgstr "" +"この例外の原因が自分のコードにも使用中のパッケージにもないと確信できる場合" +"は、\n" +"使用している Python インタープリタの作者やメンテナに報告してください。\n" +"Python インタープリタのバージョン (``sys.version`` の値で、対話型 Python セッ" +"ションの開始時にも表示されます)、\n" +"正確なエラーメッセージ (例外の関連値)、可能であればエラーを引き起こしたプログ" +"ラムのソースを必ず報告してください。" -#: ../../builtins/exceptions.rst:607 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -893,6 +946,18 @@ msgid "" "is zero; if it has another type (such as a string), the object's value is " "printed and the exit status is one." msgstr "" +"この例外は :func:`sys.exit` 関数によって送出されます。\n" +":exc:`Exception` を捕捉するコードに誤って捕捉されないように、:exc:" +"`Exception` ではなく :exc:`BaseException` を継承しています。\n" +"これにより、例外が適切に伝播し、インタープリタを終了できます。\n" +"この例外が処理されない場合、Python インタープリタは終了し、スタックトレース" +"バックは表示されません。\n" +"コンストラクタには、:func:`sys.exit` と同じオプションの引数を渡せます。\n" +"値が整数の場合は、システムの終了ステータスを指定します (C の :c:func:`!exit` " +"関数に渡されます)。\n" +"``None`` の場合、終了ステータスはゼロです。\n" +"それ以外の型 (文字列など) の場合、オブジェクトの値が表示され、終了ステータス" +"は1になります。" #: ../../builtins/exceptions.rst:618 msgid "" @@ -917,26 +982,25 @@ msgstr "" "コンストラクタに渡された終了ステータス又はエラーメッセージ。(デフォルトは " "``None``)" -#: ../../builtins/exceptions.rst:633 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -"組み込み演算または関数が適切でない型のオブジェクトに対して適用された際に送出" -"されます。関連値は型の不整合に関して詳細を述べた文字列です。" +"演算や関数を適切でない型のオブジェクトに適用した場合に送出されます。\n" +"関連値は、型の不整合の詳細を示す文字列です。" -#: ../../builtins/exceptions.rst:636 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " "object is meant to support a given operation but has not yet provided an " "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -"この例外は、そのオブジェクトで実行しようとした操作がサポートされておらず、そ" -"の予定もない場合にユーザーコードから送出されるかもしれません。オブジェクトで" -"その操作をサポートするつもりだが、まだ実装を提供していないのであれば、送出す" -"る適切な例外は :exc:`NotImplementedError` です。" +"そのオブジェクトで実行しようとした操作がサポートされておらず、サポートする意" +"図もないことを示すために、\n" +"ユーザコードからこの例外を送出することもできます。\n" +"操作をサポートする意図はあるものの、まだ実装していない場合には、:exc:" +"`NotImplementedError` を送出するのが適切です。" #: ../../builtins/exceptions.rst:641 msgid "" @@ -993,11 +1057,12 @@ msgstr "コーデックがエンコードまたはデコードしようとした msgid "The first index of invalid data in :attr:`object`." msgstr ":attr:`object` の最初の無効なデータのインデクスです。" -#: ../../builtins/exceptions.rst:678 ../../builtins/exceptions.rst:685 msgid "" "This value should not be negative as it is interpreted as an absolute offset " "but this constraint is not enforced at runtime." msgstr "" +"この値は絶対オフセットとして解釈されるため、負の値にすべきではありませんが、" +"この制約は実行時には強制されません。" #: ../../builtins/exceptions.rst:683 msgid "The index after the last invalid data in :attr:`object`." @@ -1087,12 +1152,14 @@ msgstr "" ":exc:`BlockingIOError` は、 :exc:`OSError` の属性に加えて一つの属性を持ちま" "す:" -#: ../../builtins/exceptions.rst:751 msgid "" "An integer containing the number of **bytes** written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" +"ブロックするまでにストリームへ書き込まれた **バイト数** を表す整数です。\n" +"この属性は、:mod:`io` モジュールのバッファ付き I/O クラスを使う場合に利用でき" +"ます。" #: ../../builtins/exceptions.rst:757 msgid "" @@ -1171,13 +1238,12 @@ msgstr "" "要求されたファイルやディレクトリが存在しない場合に送出されます。:c:data:" "`errno` :py:const:`~errno.ENOENT` に対応します。" -#: ../../builtins/exceptions.rst:804 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" -"システムコールが入力信号によって中断された場合に送出されます。:c:data:" -"`errno` :py:const:`~errno.EINTR` に対応します。" +"システムコールが受信したシグナルによって中断された場合に送出されます。\n" +":c:data:`errno` :py:const:`~errno.EINTR` に対応します。" #: ../../builtins/exceptions.rst:807 msgid "" @@ -1197,7 +1263,6 @@ msgstr "" "ディレクトリに (:func:`os.remove` などの) ファイル操作が要求された場合に送出" "されます。:c:data:`errno` :py:const:`~errno.EISDIR` に対応します。" -#: ../../builtins/exceptions.rst:820 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -1205,10 +1270,12 @@ msgid "" "as if it were a directory. Corresponds to :c:data:`errno` :py:const:`~errno." "ENOTDIR`." msgstr "" -"ディレクトリへの操作(たとえば :func:`os.listdir`)をディレクトリ以外に対して要" -"求された場合に送出されます。多くのPOSIXプラットフォームではディレクトリではな" -"いファイルをディレクトリとして開いたり移動するときにも発生する場合がありま" -"す。:c:data:`errno` :py:const:`~errno.ENOTDIR` に対応します。" +"ディレクトリに対する操作 (例えば :func:`os.listdir`) がディレクトリ以外の対象" +"に要求された場合に送出されます。\n" +"ほとんどの POSIX プラットフォームでは、ディレクトリでないファイルをディレクト" +"リとして開いたり、\n" +"パスをたどろうとしたりした場合にも送出されることがあります。\n" +":c:data:`errno` :py:const:`~errno.ENOTDIR` に対応します。" #: ../../builtins/exceptions.rst:828 msgid "" @@ -1273,13 +1340,11 @@ msgstr "警告カテゴリの基底クラスです。" msgid "Base class for warnings generated by user code." msgstr "ユーザコードによって生成される警告の基底クラスです。" -#: ../../builtins/exceptions.rst:876 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -"他の Python 開発者へ向けて警告を発するときの、廃止予定の機能についての警告の" -"基底クラスです。" +"非推奨の機能について、他の Python 開発者に向けて発する警告の基底クラスです。" #: ../../builtins/exceptions.rst:879 msgid "" @@ -1291,9 +1356,8 @@ msgstr "" "化されています。:ref:`Python Development Mode ` を有効にするとこの警" "告が表示されます。" -#: ../../builtins/exceptions.rst:883 ../../builtins/exceptions.rst:899 msgid "The deprecation policy is described in :pep:`387`." -msgstr "" +msgstr "非推奨化の方針は :pep:`387` で説明されています。" msgid "" "Base class for warnings about features which are obsolete and expected to be " @@ -1320,15 +1384,15 @@ msgstr "" "デフォルトの警告フィルターで無効化されています。:ref:`Python Development " "Mode ` を有効にするとこの警告が表示されます。" -#: ../../builtins/exceptions.rst:904 msgid "Base class for warnings about dubious syntax." -msgstr "曖昧な構文に対する警告の基底クラスです。" +msgstr "疑わしい構文についての警告の基底クラスです。" -#: ../../builtins/exceptions.rst:906 msgid "" "This warning is typically emitted when compiling Python source code, and " "usually won't be reported when running already compiled code." msgstr "" +"この警告は通常、Python ソースコードのコンパイル時に発生し、コンパイル済みの" +"コードの実行時には通常は報告されません。" #: ../../builtins/exceptions.rst:912 msgid "Base class for warnings about dubious runtime behavior." @@ -1417,18 +1481,21 @@ msgstr "" "のインスタンスでない例外が一つでも含まれていると :exc:`TypeError` を送出しま" "す。" -#: ../../builtins/exceptions.rst:987 msgid "" "Exception groups are :ref:`generic ` over the type of their " "contained exceptions." msgstr "" +"例外グループは、保持する例外の型をパラメータとする :ref:`ジェネリック型 " +"` です。" -#: ../../builtins/exceptions.rst:992 msgid "" "The ``excs`` parameter may be any sequence, but lists and tuples are " "specifically processed more efficiently here. For optimal performance, pass " "a tuple as ``excs``." msgstr "" +"``excs`` パラメータには任意のシーケンスを指定できますが、リストとタプルは特に" +"効率よく処理されます。\n" +"最適なパフォーマンスを得るには、``excs`` にタプルを渡してください。" #: ../../builtins/exceptions.rst:998 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." @@ -1450,7 +1517,6 @@ msgstr "" "プを返します。\n" "結果が空の場合は ``None`` を返します。" -#: ../../builtins/exceptions.rst:1010 msgid "" "The condition can be an exception type or tuple of exception types, in which " "case each exception is checked for a match using the same check that is used " @@ -1458,8 +1524,11 @@ msgid "" "type object) that accepts an exception as its single argument and returns " "true for the exceptions that should be in the subgroup." msgstr "" +"条件には例外型または例外型のタプルを指定でき、\n" +"その場合は ``except`` 節と同じ判定方法で各例外がマッチするかを調べます。\n" +"また、例外を唯一の引数として受け取り、サブグループに含めるべき例外に対して真" +"を返す呼び出し可能オブジェクト (型オブジェクトを除く) も指定できます。" -#: ../../builtins/exceptions.rst:1016 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`~BaseException." @@ -1467,17 +1536,25 @@ msgid "" "__context__` and :attr:`~BaseException.__notes__` fields. Empty nested " "groups are omitted from the result." msgstr "" +"結果には、現在の例外の入れ子構造と、:attr:`message`、:attr:`~BaseException." +"__traceback__`、:attr:`~BaseException.__cause__`、:attr:`~BaseException." +"__context__`、:attr:`~BaseException.__notes__` の各フィールドの値が保持されま" +"す。\n" +"入れ子になった空のグループは結果から除かれます。" -#: ../../builtins/exceptions.rst:1023 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " "true for such an exception group, it is included in the result in full." msgstr "" +"条件は、最上位の例外グループと入れ子になったすべての例外グループも含め、\n" +"入れ子の例外グループ内のすべての例外に対して調べられます。\n" +"例外グループに対して条件が真となる場合、そのグループ全体が結果に含まれます。" -#: ../../builtins/exceptions.rst:1027 msgid "``condition`` can be any callable which is not a type object." msgstr "" +"``condition`` に、型オブジェクト以外の任意の呼び出し可能オブジェクトを指定で" +"きるようになりました。" #: ../../builtins/exceptions.rst:1032 msgid "" @@ -1496,13 +1573,17 @@ msgstr "" "同じ :attr:`message` の例外グループを返しますが、``excs`` の例外を含んでいま" "す。" -#: ../../builtins/exceptions.rst:1041 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " "override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" +"このメソッドは、さまざまな状況で例外グループを分割するために使われる :meth:" +"`subgroup` と :meth:`split` から呼び出されます。\n" +"サブクラスで :meth:`subgroup` と :meth:`split` が :exc:`ExceptionGroup` では" +"なくそのサブクラスのインスタンスを返すようにするには、\n" +"このメソッドをオーバーライドする必要があります。" #: ../../builtins/exceptions.rst:1047 msgid "" @@ -1518,7 +1599,6 @@ msgstr "" "返す例外グループにコピーするため、:meth:`derive` ではこれらのフィールドを更新" "する必要がありません。" -#: ../../builtins/exceptions.rst:1054 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1546,8 +1626,32 @@ msgid "" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" msgstr "" +">>> class MyGroup(ExceptionGroup):\n" +"... def derive(self, excs):\n" +"... return MyGroup(self.message, excs)\n" +"...\n" +">>> e = MyGroup(\"eg\", [ValueError(1), TypeError(2)])\n" +">>> e.add_note(\"a note\")\n" +">>> e.__context__ = Exception(\"context\")\n" +">>> e.__cause__ = Exception(\"cause\")\n" +">>> try:\n" +"... raise e\n" +"... except Exception as e:\n" +"... exc = e\n" +"...\n" +">>> match, rest = exc.split(ValueError)\n" +">>> exc, exc.__context__, exc.__cause__, exc.__notes__\n" +"(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), " +"Exception('cause'), ['a note'])\n" +">>> match, match.__context__, match.__cause__, match.__notes__\n" +"(MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> rest, rest.__context__, rest.__cause__, rest.__notes__\n" +"(MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" +"True" -#: ../../builtins/exceptions.rst:1080 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1555,8 +1659,12 @@ msgid "" "exception group subclass which accepts an exit_code and constructs the " "group's message from it. ::" msgstr "" +":exc:`BaseExceptionGroup` は :meth:`~object.__new__` を定義しているため、\n" +"異なるコンストラクタシグネチャが必要なサブクラスでは、:meth:`~object." +"__init__` ではなく ``__new__()`` をオーバーライドする必要があります。\n" +"例えば、次のコードでは ``exit_code`` を受け取り、そこからグループのメッセージ" +"を作成する例外グループのサブクラスを定義しています。 ::" -#: ../../builtins/exceptions.rst:1086 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1567,13 +1675,24 @@ msgid "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" msgstr "" +"class Errors(ExceptionGroup):\n" +" def __new__(cls, errors, exit_code):\n" +" self = super().__new__(Errors, f\"exit code: {exit_code}\", errors)\n" +" self.exit_code = exit_code\n" +" return self\n" +"\n" +" def derive(self, excs):\n" +" return Errors(excs, self.exit_code)" -#: ../../builtins/exceptions.rst:1095 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" +":exc:`ExceptionGroup` と同様に、:exc:`BaseExceptionGroup` のサブクラスであ" +"り、\n" +"かつ :exc:`Exception` のサブクラスでもあるクラスは、:exc:`Exception` のインス" +"タンスのみを保持できます。" #: ../../builtins/exceptions.rst:1103 msgid "Exception hierarchy" diff --git a/builtins/functions.po b/builtins/functions.po index 60c46892b..5de112075 100644 --- a/builtins/functions.po +++ b/builtins/functions.po @@ -457,11 +457,14 @@ msgstr "" " return False\n" " return True" -#: ../../builtins/functions.rst:91 msgid "" "When awaited, return the next item from the given :term:`asynchronous " "iterator`, or *default* if given and the iterator is :term:`exhausted`." msgstr "" +"待ち受けると、指定した :term:`非同期イテレータ ` の次" +"の要素を返します。\n" +"イテレータが :term:`枯渇して ` おり、*default* が指定されている場" +"合は、その値を返します。" #: ../../builtins/functions.rst:94 msgid "" @@ -503,17 +506,16 @@ msgstr "" " return True\n" " return False" -#: ../../builtins/functions.rst:118 msgid "" "As :func:`repr`, return a string containing a printable representation of an " "object, but escape the non-ASCII characters in the string returned by :func:" "`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string " "similar to that returned by :func:`repr` in Python 2." msgstr "" -":func:`repr` と同様、オブジェクトの印字可能な表現を含む文字列を返しますが、:" -"func:`repr` によって返された文字列中の非 ASCII 文字は ``\\x`` 、 ``\\u`` 、 " -"``\\U`` エスケープを使ってエスケープされます。これは Python 2 の :func:" -"`repr` によって返されるのと同じ文字列を作ります。" +":func:`repr` と同様に、オブジェクトの印字可能な表現を含む文字列を返します。\n" +"ただし、:func:`repr` が返す文字列中の非 ASCII 文字は、``\\x``、``\\u``、" +"``\\U`` エスケープを使ってエスケープされます。\n" +"これにより、Python 2 の :func:`repr` が返すものと似た文字列が生成されます。" #: ../../builtins/functions.rst:126 msgid "" @@ -616,17 +618,19 @@ msgstr "" "引数 ``breakpointhook`` 付きで :ref:`監査イベント ` ``builtins." "breakpoint`` を送出します。" -#: ../../builtins/functions.rst:193 msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " "methods of mutable sequences, described in :ref:`typesseq-mutable`, as well " "as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." msgstr "" -"新しいバイト配列を返します。:class:`bytearray` クラスは0 <= x < 256の範囲の整" -"数からなる変更可能な配列です。:ref:`typesseq-mutable` に記述されている変更可" -"能な配列に対する普通のメソッドの大半を備えています。また、:class:`bytes` 型が" -"持つメソッドの大半も備えています(see :ref:`bytes-methods`)。" +"新しいバイト配列を返します。\n" +":class:`bytearray` クラスは、0 <= x < 256 の範囲の整数からなる可変シーケンス" +"です。\n" +":ref:`typesseq-mutable` で説明されている可変シーケンスの通常のメソッドの大半" +"に加え、\n" +":class:`bytes` 型のメソッドの大半も備えています (:ref:`bytes-methods` を参照" +"してください)。" #: ../../builtins/functions.rst:198 msgid "" @@ -705,7 +709,6 @@ msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "" ":ref:`binaryseq`, :ref:`typebytes`, :ref:`bytes-methods` も参照してください。" -#: ../../builtins/functions.rst:238 msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " @@ -713,12 +716,13 @@ msgid "" "that classes are callable (calling a class returns a new instance); " "instances are callable if their class has a :meth:`~object.__call__` method." msgstr "" -"*object* 引数が呼び出し可能オブジェクトであれば :const:`True` を、そうでなけ" -"れば :const:`False` を返します。この関数が ``True`` を返しても、呼び出しは失" -"敗する可能性がありますが、``False`` であれば、 *object* の呼び出しは決して成" -"功しません。なお、クラスは呼び出し可能 (クラスを呼び出すと新しいインスタンス" -"を返します) です。また、インスタンスはクラスが :meth:`~object.__call__` メ" -"ソッドを持つなら呼び出し可能です。" +"*object* 引数が呼び出せそうなオブジェクトであれば :const:`True` を、そうでな" +"ければ :const:`False` を返します。\n" +"この関数が ``True`` を返しても呼び出しが失敗する可能性はありますが、\n" +"``False`` であれば *object* の呼び出しは決して成功しません。\n" +"クラスは呼び出し可能です (クラスを呼び出すと新しいインスタンスを返します)。\n" +"インスタンスは、そのクラスが :meth:`~object.__call__` メソッドを持つ場合に呼" +"び出し可能です。" #: ../../builtins/functions.rst:244 msgid "" @@ -841,15 +845,15 @@ msgstr "" "AST オブジェクトの扱い方については、:mod:`ast` モジュールのドキュメントを参照" "してください。" -#: ../../builtins/functions.rst:308 msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " "is commonly used)." msgstr "" -"*filename* 引数には、コードの読み出し元のファイルを与えなければなりません; " -"ファイルから読み出されるのでなければ、認識可能な値を渡して下さい " -"(``''`` が一般的に使われます)。" +"*filename* 引数には、コードの読み出し元のファイルを示す値を指定してくださ" +"い。\n" +"ファイルから読み出していない場合は、識別できる値を渡してください " +"(``''`` がよく使われます)。" #: ../../builtins/functions.rst:312 msgid "" @@ -926,7 +930,6 @@ msgstr "" "オプションの実引数 *module* には、モジュール名を指定します。 これはモジュール" "名で構文警告を明確に :ref:`filter ` するために必要です。" -#: ../../builtins/functions.rst:347 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "including a *source* containing a null character or that cannot be decoded; :" @@ -936,6 +939,15 @@ msgid "" "with many thousands of nested operators; and :exc:`OverflowError` if " "*source* is too large." msgstr "" +"コンパイルするソースが不正な場合は :exc:`SyntaxError` を送出します。\n" +"これには、*source* にヌル文字が含まれている場合や、*source* をデコードできな" +"い場合も含まれます。\n" +"*mode* または *flags* が不正な場合や、文字列の *source* にサロゲート文字が含" +"まれている場合は :exc:`ValueError` を送出します。\n" +"数千もの演算子が入れ子になった式など、*source* が複雑すぎて解析やコンパイルが" +"できない場合は、:exc:`MemoryError` または :exc:`RecursionError` を送出しま" +"す。\n" +"*source* が大きすぎる場合は :exc:`OverflowError` を送出します。" #: ../../builtins/functions.rst:356 msgid "" @@ -1001,11 +1013,12 @@ msgstr "" "``async for``, および ``async with`` のサポートを有効化することができるように" "なりました。" -#: ../../builtins/functions.rst:390 msgid "" ":exc:`SyntaxError` is raised instead of :exc:`ValueError` when null bytes " "are encountered in *source*." msgstr "" +"*source* にヌルバイトが含まれている場合、:exc:`ValueError` ではなく :exc:" +"`SyntaxError` が送出されるようになりました。" #: ../../builtins/functions.rst:394 msgid "Added the *module* parameter." @@ -1130,10 +1143,8 @@ msgstr "引数がすべて省略された場合は、 ``0j`` を返します。" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複素数型については :ref:`typesnumeric` に説明があります。" -#: ../../builtins/functions.rst:470 ../../builtins/functions.rst:847 -#: ../../builtins/functions.rst:1104 msgid "Grouping digits with underscores as in code literals is allowed." -msgstr "コードリテラル中で桁をグループ化するのにアンダースコアを利用できます。" +msgstr "コードリテラルと同様に、アンダースコアで桁を区切れるようになりました。" #: ../../builtins/functions.rst:473 msgid "" @@ -1516,7 +1527,6 @@ msgstr "" "を意味します(「トップレベル」変数はクラス定義にてクラス変数として扱われるた" "め)。" -#: ../../builtins/functions.rst:720 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1524,6 +1534,11 @@ msgid "" "used to restrict or change the available names, but this is **not** a " "security mechanism: the executed code can still access all builtins." msgstr "" +"*globals* 辞書にキー ``__builtins__`` の値が含まれていない場合、\n" +"そのキーに組み込みモジュール :mod:`builtins` の辞書への参照が挿入されます。\n" +"``__builtins__`` を上書きすると、利用できる名前を制限したり変更したりできます" +"が、これはセキュリティ機構では **ありません**。\n" +"実行されるコードは、依然としてすべての組み込み機能にアクセスできます。" #: ../../builtins/functions.rst:727 msgid "" @@ -1728,24 +1743,31 @@ msgstr "" "*format_spec* が空の文字列でない場合 ``object().__format__(format_spec)`` " "は :exc:`TypeError` を送出します。" -#: ../../builtins/functions.rst:889 msgid "" "Create a new frozen dictionary. The :class:`frozendict` object is a built-" "in class. See also :ref:`typesmapping` for documentation about this class." msgstr "" +"新しい凍結辞書を作成します。\n" +":class:`frozendict` オブジェクトは組み込みクラスです。\n" +"このクラスのドキュメントについては :ref:`typesmapping` も参照してください。" -#: ../../builtins/functions.rst:892 msgid "" "For other containers see the built-in :class:`dict`, :class:`list`, :class:" "`set`, and :class:`tuple` classes, as well as the :mod:`collections` module." msgstr "" +"他のコンテナについては、組み込みの :class:`dict`、:class:`list`、:class:" +"`set`、:class:`tuple` クラスや、:mod:`collections` モジュールを参照してくださ" +"い。" -#: ../../builtins/functions.rst:902 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. :class:`frozenset` is a built-in class. See also :ref:`types-" "set` for documentation about this class." msgstr "" +"新しい :class:`frozenset` オブジェクトを返します。\n" +"必要に応じて *iterable* から要素を取り込むこともできます。\n" +":class:`frozenset` は組み込みクラスです。\n" +"このクラスのドキュメントについては :ref:`types-set` も参照してください。" #: ../../builtins/functions.rst:906 msgid "" @@ -2103,10 +2125,11 @@ msgstr "" "`ValueError` が送出されます。詳しくは :ref:`整数文字列の変換における長さ制限 " "` を参照してください。" -#: ../../builtins/functions.rst:1121 msgid "" ":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." msgstr "" +":func:`int` は :meth:`~object.__trunc__` メソッドに処理を委譲しなくなりまし" +"た。" #: ../../builtins/functions.rst:1126 msgid "" @@ -2135,7 +2158,6 @@ msgstr "" msgid "*classinfo* can be a :ref:`types-union`." msgstr "*classinfo* に :ref:`types-union` を指定できるようになりました。" -#: ../../builtins/functions.rst:1143 msgid "" "Return ``True`` if *cls* is a subclass (direct, indirect, or :term:`virtual " "`) of *classinfo*. A class is considered a subclass of " @@ -2144,6 +2166,14 @@ msgid "" "is a subclass of any entry in *classinfo*. In any other case, a :exc:" "`TypeError` exception is raised." msgstr "" +"*cls* が *classinfo* のサブクラス (直接、間接、または :term:`仮想 ` のサブクラス) である場合、``True`` を返します。\n" +"クラスは、それ自体のサブクラスと見なされます。\n" +"*classinfo* には、クラスオブジェクトのタプル (または再帰的にそのようなタプル" +"を含むタプル) や :ref:`types-union` も指定できます。\n" +"その場合、*cls* が *classinfo* 内のいずれかのサブクラスであれば ``True`` を返" +"します。\n" +"*classinfo* がこれらのいずれでもない場合は、:exc:`TypeError` が送出されます。" #: ../../builtins/functions.rst:1158 msgid "" @@ -2242,12 +2272,11 @@ msgstr "" "モジュール スコープでは、単一の名前空間で :func:`exec` や :func:`eval` を使う" "場合と同じく、この関数は :func:`globals` と同じ名前空間を返します。" -#: ../../builtins/functions.rst:1214 msgid "" "At class scope, it returns the namespace that will be passed to the " "metaclass constructor." msgstr "" -"クラス スコープでは、メタクラス コンストラクタに渡された名前空間を返します。" +"クラススコープでは、メタクラスのコンストラクタに渡される名前空間を返します。" msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " @@ -2332,7 +2361,6 @@ msgstr "" "の振る舞いは上記のようになりました。定義されただけで、その他のスコープの振る" "舞いは以前のバージョンのままです。" -#: ../../builtins/functions.rst:1259 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2343,6 +2371,17 @@ msgid "" "raised. For cases where the function inputs are already arranged into " "argument tuples, see :func:`itertools.starmap`." msgstr "" +"*iterable* の各要素に *function* を適用し、その結果を生成するイテレータを返し" +"ます。\n" +"追加の *iterables* 引数が渡された場合、*function* はイテラブルの数だけ引数を" +"受け取れる必要があります。\n" +"この関数は、すべてのイテラブルから並行して取り出した要素に適用されます。\n" +"複数のイテラブルがある場合、最も短いイテラブルが :term:`枯渇する " +"` とイテレータは停止します。\n" +"*strict* が ``True`` で、いずれかのイテラブルが他より先に枯渇した場合は、:" +"exc:`ValueError` が送出されます。\n" +"関数への入力がすでに引数のタプルにまとめられている場合は、:func:`itertools." +"starmap` を参照してください。" #: ../../builtins/functions.rst:1268 msgid "Added the *strict* parameter." @@ -2435,12 +2474,16 @@ msgstr "" "は、``sorted(iterable, key=keyfunc)[0]`` や ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` のような、他のソート安定性を維持するツールと両立します。" -#: ../../builtins/functions.rst:1343 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " "iterator is :term:`exhausted`, otherwise :exc:`StopIteration` is raised." msgstr "" +":term:`イテレータ ` の :meth:`~iterator.__next__` メソッドを呼び出" +"して、次の要素を取得します。\n" +"イテレータが :term:`枯渇した ` 場合、*default* が指定されていれば" +"その値を返し、\n" +"指定されていなければ :exc:`StopIteration` を送出します。" #: ../../builtins/functions.rst:1350 msgid "" @@ -2494,7 +2537,6 @@ msgstr "" "す。ファイルを開くことができなければ、:exc:`OSError` が送出されます。\n" "この関数の利用例について、 :ref:`tut-files` を参照してください。" -#: ../../builtins/functions.rst:1395 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -2502,13 +2544,13 @@ msgid "" "given, it is closed when the returned I/O object is closed unless *closefd* " "is set to ``False``.)" msgstr "" -"*file* は :term:`path-like object` で、開くファイルのパス名 (絶対パスまたは現" -"在の作業ディレクトリからの相対パス) あるいはラップするファイルの整数のファイ" -"ルデスクリプタを与えます。 (ファイルデスクリプタが与えられた場合、 *closefd* " -"が ``False`` に設定されていないかぎり、この関数が返す I/O オブジェクトがク" -"ローズされるときにファイルデスクリプタもクローズされます。)" +"*file* には、開くファイルのパス名 (絶対パスまたは現在の作業ディレクトリからの" +"相対パス) を示す :term:`path-like object` か、\n" +"ラップするファイルの整数のファイル記述子を指定します。\n" +"(ファイル記述子を指定した場合、*closefd* が ``False`` に設定されていなけれ" +"ば、\n" +"返された I/O オブジェクトを閉じるときにそのファイル記述子も閉じられます。)" -#: ../../builtins/functions.rst:1401 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -2521,6 +2563,21 @@ msgid "" "the current locale encoding. (For reading and writing raw bytes use binary " "mode and leave *encoding* unspecified.) The available modes are:" msgstr "" +"*mode* は、ファイルを開くモードを指定するオプションの文字列です。\n" +"デフォルト値は、テキストモードの読み込み用に開くことを意味する ``'r'`` で" +"す。\n" +"他によく使われる値には、書き込み用の ``'w'`` (ファイルがすでに存在する場合は" +"内容を切り詰めます)、\n" +"排他的な作成用の ``'x'``、追記用の ``'a'`` があります\n" +"(*一部の* Unix システムでは、追記用モードでは現在のシーク位置にかかわらず *す" +"べての* 書き込みがファイルの末尾に追加されます)。\n" +"テキストモードで *encoding* を指定しない場合、デフォルトで UTF-8 が使われま" +"す。\n" +":ref:`Python UTF-8 モード ` が無効の場合は、:func:`locale." +"getencoding` を呼び出して現在のロケールエンコーディングを取得します。\n" +"(生のバイト列を読み書きするには、バイナリモードを使い、*encoding* は指定しな" +"いでください。)\n" +"利用できるモードは次のとおりです:" #: ../../builtins/functions.rst:1419 msgid "Character" @@ -2596,7 +2653,6 @@ msgstr "" "モード ``'w+'`` と ``'w+b'`` はファイルを開いて内容を切り詰めます。\n" "モード ``'r+'`` と ``'r+b'`` は、内容を切り詰めずにファイルを開きます。" -#: ../../builtins/functions.rst:1434 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2606,6 +2662,15 @@ msgid "" "having been first decoded using the default encoding or using the specified " "*encoding* if given." msgstr "" +":ref:`io-overview` で説明したように、Python はバイナリ I/O とテキスト I/O を" +"区別します。\n" +"バイナリモード (*mode* 引数に ``'b'`` を含めます) で開いたファイルは、デコー" +"ドせずに内容を :class:`bytes` オブジェクトとして返します。\n" +"テキストモード (デフォルト、または *mode* 引数に ``'t'`` を含めた場合) で" +"は、\n" +"デフォルトのエンコーディング、または *encoding* に指定されたエンコーディング" +"でバイト列をデコードしてから、\n" +"ファイルの内容を :class:`str` として返します。" #: ../../builtins/functions.rst:1444 msgid "" @@ -2664,7 +2729,6 @@ msgstr "" "ファイル) は行バッファリングを使用します。 その他のテキストファイルは、上で説" "明したバイナリファイル用の方針を使用します。" -#: ../../builtins/functions.rst:1467 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is UTF-8; if :" @@ -2674,8 +2738,19 @@ msgid "" "specifies the current locale encoding explicitly. See the :mod:`codecs` " "module for the list of supported encodings." msgstr "" +"*encoding* は、ファイルのデコードやエンコードに使うエンコーディングの名前で" +"す。\n" +"テキストモードでのみ使ってください。\n" +"デフォルトのエンコーディングは UTF-8 です。\n" +":ref:`Python UTF-8 モード ` が無効の場合、デフォルト値はプラット" +"フォームに依存します (:func:`locale.getencoding` が返す値になります)。\n" +"Python がサポートする任意の :term:`テキストエンコーディング ` " +"を使うことができ、\n" +"``encoding=\"locale\"`` を指定すると現在のロケールエンコーディングを明示的に" +"選べます。\n" +"サポートするエンコーディングの一覧は :mod:`codecs` モジュールを参照してくださ" +"い。" -#: ../../builtins/functions.rst:1475 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2683,6 +2758,12 @@ msgid "" "has been registered with :func:`codecs.register_error` is also valid. The " "standard names can be found in :ref:`error-handlers`." msgstr "" +"*errors* は、エンコードやデコードのエラーをどう処理するかを指定するオプション" +"の文字列です。\n" +"バイナリモードでは使えません。\n" +"さまざまな標準のエラーハンドラが利用できるほか、:func:`codecs." +"register_error` で登録された任意のエラー処理名も指定できます。\n" +"標準の名前は :ref:`error-handlers` に記載されています。" #: ../../builtins/functions.rst:1487 msgid "" @@ -2896,11 +2977,12 @@ msgstr "" msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` モードは削除されました。" -#: ../../builtins/functions.rst:1589 msgid "" "UTF-8 is now the default encoding, instead of the platform-dependent locale " "encoding (:pep:`686`)." msgstr "" +"プラットフォームに依存するロケールエンコーディングに代わり、UTF-8 がデフォル" +"トのエンコーディングになりました (:pep:`686`)。" #: ../../builtins/functions.rst:1595 msgid "Return the ordinal value of a character." @@ -2926,16 +3008,16 @@ msgstr "" "引数が 長さ1の :class:`bytes` または :class:`bytearray` である場合は、そのバ" "イト値を返します。例えば、 ``ord(b'a')`` は ``97`` になります。" -#: ../../builtins/functions.rst:1609 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " "mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the " "power operator: ``base**exp``." msgstr "" -"*base* の *exp* 乗を返します; *mod* があれば、*base* の *exp* 乗に対する " -"*mod* の剰余を返します (``pow(base, exp) % mod`` より効率よく計算されます)。" -"二引数の形式 ``pow(base, exp)`` は、冪乗演算子を使った ``base**exp`` と等価で" +"*base* の *exp* 乗を返します。\n" +"*mod* を指定した場合は、*base* の *exp* 乗を *mod* で割った余りを返します " +"(``pow(base, exp) % mod`` より効率よく計算されます)。\n" +"2引数形式の ``pow(base, exp)`` は、冪乗演算子を使う ``base**exp`` と等価で" "す。" #: ../../builtins/functions.rst:1614 @@ -3063,9 +3145,8 @@ msgstr "" "です。*fdel* は属性値を削除するための関数です。*doc* は属性の docstring を作" "成します。" -#: ../../builtins/functions.rst:1682 msgid "A typical use is to define a managed attribute ``x``::" -msgstr "典型的な使用法は、属性 ``x`` の処理の定義です::" +msgstr "典型的な用途は、アクセスを管理する属性 ``x`` を定義することです。 ::" #: ../../builtins/functions.rst:1684 msgid "" @@ -3107,13 +3188,18 @@ msgstr "" "*c* が *C* のインスタンスならば、``c.x`` は getter を呼び出し、``c.x = " "value`` は setter を、``del c.x`` は deleter を呼び出します。" -#: ../../builtins/functions.rst:1702 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " "possible to create read-only properties easily using :deco:`property` as a :" "term:`decorator`::" msgstr "" +"*doc* が指定されていれば、その値がプロパティ属性のドキュメンテーション文字列" +"になります。\n" +"指定されていなければ、*fget* にドキュメンテーション文字列がある場合に、プロパ" +"ティがその文字列をコピーします。\n" +"これにより、:deco:`property` を :term:`デコレータ ` として使うこと" +"で、読み出し専用のプロパティを簡単に作成できます。 ::" #: ../../builtins/functions.rst:1706 msgid "" @@ -3210,9 +3296,10 @@ msgstr "" "返される property オブジェクトも、コンストラクタの引数に対応した ``fget``, " "``fset``, および ``fdel`` 属性を持ちます。" -#: ../../builtins/functions.rst:1754 msgid "The docstrings of property objects are now writeable." -msgstr "属性オブジェクトのドックストリングが書き込み可能になりました。" +msgstr "" +"プロパティオブジェクトのドキュメンテーション文字列が書き込み可能になりまし" +"た。" #: ../../builtins/functions.rst:1759 msgid "" @@ -3254,7 +3341,6 @@ msgstr "" msgid "This class has a custom representation that can be evaluated::" msgstr "このクラスは、eval 評価可能な独自の representation を持ちます::" -#: ../../builtins/functions.rst:1789 msgid "" "class Person:\n" " def __init__(self, name, age):\n" @@ -3264,6 +3350,13 @@ msgid "" " def __repr__(self):\n" " return f\"Person({self.name!r}, {self.age!r})\"" msgstr "" +"class Person:\n" +" def __init__(self, name, age):\n" +" self.name = name\n" +" self.age = age\n" +"\n" +" def __repr__(self):\n" +" return f\"Person({self.name!r}, {self.age!r})\"" #: ../../builtins/functions.rst:1800 msgid "" @@ -3305,13 +3398,12 @@ msgstr "" "返り値は *ndigits* が指定されていないか ``None`` の場合は整数、そうでなければ" "返り値は *number* と同じ型です。" -#: ../../builtins/functions.rst:1821 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -"一般的な Python オブジェクト ``number`` に対して、``round`` は処理を `number." -"__round__` に移譲します。" +"一般的な Python オブジェクト ``number`` に対して、``round`` は処理を " +"``number.__round__`` に委譲します。" #: ../../builtins/functions.rst:1826 msgid "" @@ -3326,12 +3418,15 @@ msgstr "" "これはバグではありません: これはほとんどの小数が浮動小数点数で正確に表せない" "ことの結果です。詳しくは :ref:`tut-fp-issues` を参照してください。" -#: ../../builtins/functions.rst:1837 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. :class:`set` is a built-in class. See also :ref:`types-set` " "for documentation about this class." msgstr "" +"新しい :class:`set` オブジェクトを返します。\n" +"必要に応じて *iterable* から要素を取り込むこともできます。\n" +":class:`set` は組み込みクラスです。\n" +"このクラスのドキュメントについては :ref:`types-set` も参照してください。" #: ../../builtins/functions.rst:1841 msgid "" @@ -3381,65 +3476,77 @@ msgstr "" "名前を持つ属性) の値を :func:`setattr` でセットするためには、属性名を手動でマ" "ングリングする必要があります。" -#: ../../builtins/functions.rst:1870 msgid "" "Return a new unique sentinel object. *name* must be a :class:`str`, and is " "used by default as the returned object's representation::" msgstr "" +"一意な新しいセンチネルオブジェクトを返します。\n" +"*name* は :class:`str` でなければならず、デフォルトでは返されるオブジェクトの" +"文字列表現として使われます。 ::" -#: ../../builtins/functions.rst:1873 msgid "" ">>> MISSING = sentinel(\"MISSING\")\n" ">>> MISSING\n" "MISSING" msgstr "" +">>> MISSING = sentinel(\"MISSING\")\n" +">>> MISSING\n" +"MISSING" -#: ../../builtins/functions.rst:1877 msgid "" "The optional *repr* argument can be used to specify a different " "representation::" -msgstr "" +msgstr "オプションの *repr* 引数を使うと、別の文字列表現を指定できます。 ::" -#: ../../builtins/functions.rst:1879 msgid "" ">>> MISSING = sentinel(\"MISSING\", repr=\"\")\n" ">>> MISSING\n" "" msgstr "" +">>> MISSING = sentinel(\"MISSING\", repr=\"\")\n" +">>> MISSING\n" +"" -#: ../../builtins/functions.rst:1883 msgid "" "Sentinel objects are truthy and compare equal only to themselves. They are " "intended to be compared with the :keyword:`is` operator." msgstr "" +"センチネルオブジェクトは真と評価され、自分自身との比較でのみ等しいと判定され" +"ます。\n" +"比較には :keyword:`is` 演算子を使うことを想定しています。" -#: ../../builtins/functions.rst:1886 msgid "``sentinel`` does not support subclassing." -msgstr "" +msgstr "``sentinel`` はサブクラス化をサポートしません。" -#: ../../builtins/functions.rst:1888 msgid "Shallow and deep copies of a sentinel object return the object itself." msgstr "" +"センチネルオブジェクトの浅いコピーと深いコピーは、そのオブジェクト自身を返し" +"ます。" -#: ../../builtins/functions.rst:1890 msgid "" "Sentinels are conventionally assigned to a variable with a matching name. " "Sentinels defined in this way can be used in :term:`type hints `::" msgstr "" +"慣例として、センチネルはその名前と一致する変数に代入します。\n" +"このように定義したセンチネルは :term:`型ヒント ` に使えます。 ::" -#: ../../builtins/functions.rst:1893 msgid "" "MISSING = sentinel(\"MISSING\")\n" "\n" "def next_value(default: int | MISSING = MISSING):\n" " ..." msgstr "" +"MISSING = sentinel(\"MISSING\")\n" +"\n" +"def next_value(default: int | MISSING = MISSING):\n" +" ..." -#: ../../builtins/functions.rst:1898 msgid "" "Sentinel objects support the :ref:`| ` operator for use in type " "expressions." msgstr "" +"センチネルオブジェクトは、型の式で使うための :ref:`| ` 演算子をサ" +"ポートします。" #: ../../builtins/functions.rst:1900 msgid "" @@ -3451,7 +3558,6 @@ msgid "" "preserved after pickling::" msgstr "" -#: ../../builtins/functions.rst:1907 msgid "" "import pickle\n" "\n" @@ -3464,20 +3570,29 @@ msgid "" "\n" "assert pickle.loads(pickle.dumps(Cls.PICKLABLE)) is Cls.PICKLABLE" msgstr "" +"import pickle\n" +"\n" +"PICKLABLE = sentinel(\"PICKLABLE\")\n" +"\n" +"assert pickle.loads(pickle.dumps(PICKLABLE)) is PICKLABLE\n" +"\n" +"class Cls:\n" +" PICKLABLE = sentinel(\"Cls.PICKLABLE\")\n" +"\n" +"assert pickle.loads(pickle.dumps(Cls.PICKLABLE)) is Cls.PICKLABLE" -#: ../../builtins/functions.rst:1918 msgid "Sentinel objects have the following attributes:" -msgstr "" +msgstr "センチネルオブジェクトには、次の属性があります:" -#: ../../builtins/functions.rst:1922 msgid "The sentinel's name." -msgstr "" +msgstr "センチネルの名前。" -#: ../../builtins/functions.rst:1926 msgid "" "The name of the module where the sentinel was created. This attribute is " "writable." msgstr "" +"センチネルが作成されたモジュールの名前。\n" +"この属性は書き込み可能です。" #: ../../builtins/functions.rst:1934 msgid "" @@ -3533,14 +3648,13 @@ msgstr "" "2 つのオプション引数があり、これらはキーワード引数として指定されなければなり" "ません。" -#: ../../builtins/functions.rst:1962 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -"*key* には 1 引数関数を指定します。これは *iterable* の各要素から比較キーを展" -"開するのに使われます (例えば、 ``key=str.lower`` のように指定します)。\n" +"*key* には、*iterable* の各要素から比較キーを取り出すための1引数関数を指定し" +"ます (例えば ``key=str.lower``)。\n" "デフォルト値は ``None`` です (要素を直接比較します)。" #: ../../builtins/functions.rst:1966 @@ -3581,14 +3695,14 @@ msgid "" "mixed type comparisons which can call the reflected :meth:`~object.__gt__` " "method." msgstr "" -"ソートアルゴリズムは、要素間の比較に ``<`` 演算子だけを使います。したがって" -"ソートのためには :meth:`~object.__lt__` メソッドを定義すれば十分なはずです" -"が、 :PEP:`8` は6つの :ref:`比較演算子 ` を全て実装することを推" -"奨しています。これにより、異なるメソッドを必要とする :func:`max` のような他の" -"ソートツールを、同じデータに対して適用することによって起こりうるバグを避ける" -"助けになります。6つの比較演算子を全て実装することは、リフレクションによって :" -"meth:`~object.__gt__` メソッドを呼び出す可能性のある型混合の比較での混乱を避" -"けることにも役立ちます。" +"ソートアルゴリズムは、要素間の比較に ``<`` だけを使います。\n" +"ソートには :meth:`~object.__lt__` メソッドを定義すれば十分ですが、:PEP:`8` は" +"6つの :ref:`拡張比較 ` をすべて実装することを推奨しています。\n" +"これにより、異なるメソッドに依存する :func:`max` などの順序付けを行うツールで" +"同じデータを使うときに、バグを避けやすくなります。\n" +"6つの比較をすべて実装すると、異なる型の比較で、被演算子を入れ替えた比較に対応" +"する :meth:`~object.__gt__` メソッドが呼び出される場合の混乱も避けやすくなり" +"ます。" #: ../../builtins/functions.rst:1986 msgid "" @@ -3638,12 +3752,14 @@ msgstr "" "ソッド :term:`descriptor` は呼び出し可能でもあるため、(``f()`` のように) クラ" "ス定義の中でも使用できます。" -#: ../../builtins/functions.rst:2007 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :deco:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" +"Python の静的メソッドは、Java や C++ の静的メソッドに似ています。\n" +"別のコンストラクタをクラスに用意する際に便利な :deco:`classmethod` も参照して" +"ください。" #: ../../builtins/functions.rst:2011 msgid "" @@ -3677,13 +3793,17 @@ msgstr "" msgid "For more information on static methods, see :ref:`types`." msgstr "静的メソッドについて詳しい情報は :ref:`types` を参照してください。" -#: ../../builtins/functions.rst:2025 msgid "" "Static methods now inherit the method attributes (:attr:`~function." "__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" "attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new " "``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" +"静的メソッドは、メソッドの属性 (:attr:`~function.__module__`、:attr:" +"`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function." +"__doc__`、:attr:`~function.__annotations__`) を継承し、\n" +"新しい ``__wrapped__`` 属性を持つようになりました。\n" +"また、通常の関数として呼び出せるようになりました。" #: ../../builtins/functions.rst:2043 msgid "" @@ -3700,14 +3820,13 @@ msgstr "" "``str`` は組み込みの文字列 :term:`クラス` です。文字列に関する一般的な" "情報は、:ref:`textseq` を参照してください。" -#: ../../builtins/functions.rst:2051 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -"*start* と *iterable* の要素を左から右へ合計し、総和を返します。 *iterable* " -"の要素は通常は数値で、start の値は文字列であってはなりません。" +"*start* と *iterable* の要素を左から右へ加算し、総和を返します。\n" +"*iterable* の要素は通常は数値で、``start`` の値には文字列を指定できません。" #: ../../builtins/functions.rst:2055 msgid "" @@ -3737,11 +3856,12 @@ msgstr "" "ほとんどのビルドで精度が向上し、加算する順序を入れ替えたときも結果がより一致" "しやすくなりました。" -#: ../../builtins/functions.rst:2067 msgid "" "Added specialization for summation of complexes, using same algorithm as for " "summation of floats." msgstr "" +"浮動小数点数の総和と同じアルゴリズムを使う、複素数の総和に特化した処理が追加" +"されました。" #: ../../builtins/functions.rst:2075 msgid "" @@ -3771,13 +3891,15 @@ msgstr "" "> object`` であり、 *type* の値が ``B`` だとすると、 :func:`super` は ``C -> " "A -> object`` の順番でメソッドを検索します。" -#: ../../builtins/functions.rst:2087 msgid "" "The :attr:`~type.__mro__` attribute of the class corresponding to " "*object_or_type* lists the method resolution search order used by both :func:" "`getattr` and :func:`super`. The attribute is dynamic and can change " "whenever the inheritance hierarchy is updated." msgstr "" +"*object_or_type* に対応するクラスの :attr:`~type.__mro__` 属性には、:func:" +"`getattr` と :func:`super` の両方が使うメソッド解決順序が記載されています。\n" +"この属性は動的であり、継承階層が更新されると変わることがあります。" #: ../../builtins/functions.rst:2092 msgid "" @@ -3818,7 +3940,6 @@ msgstr "" "メンテナンスしやすくなります。この用途は他のプログラミング言語で見られる " "*super* の用途によく似ています。" -#: ../../builtins/functions.rst:2109 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -3830,14 +3951,15 @@ msgid "" "changes in the class hierarchy, and because that order can include sibling " "classes that are unknown prior to runtime)." msgstr "" -"2つ目の用途は動的な実行環境において協調的 (cooperative) な多重継承をサポート" -"することです。これは Python に特有の用途で、静的にコンパイルされる言語や、単" -"継承のみをサポートする言語には見られないものです。この機能により、同じ名前の" -"メソッドを実装する複数の基底クラスを使った \"ダイヤモンド型* の継承構造を実装" -"することができます。良い設計は、そのような実装において、どのような場合でも同" -"じ呼び出しシグネチャを持つように強制します。 (理由は呼び出しの順序が実行時に" -"決定されること、呼び出し順序はクラス階層構造の変化に順応すること、そして呼び" -"出し順序が実行時まで未知の兄弟クラスが含まれる場合があることです)。" +"2つ目の用途は、動的な実行環境で協調的な多重継承をサポートすることです。\n" +"これは Python 特有の用途であり、静的にコンパイルされる言語や単継承だけをサ" +"ポートする言語には見られません。\n" +"これにより、複数の基底クラスが同じメソッドを実装する「ダイヤモンド型」の継承" +"構造を実現できます。\n" +"適切に設計するには、これらの実装の呼び出しシグネチャをすべて同じにする必要が" +"あります\n" +"(呼び出しの順序が実行時に決まり、その順序はクラス階層の変化に応じて変わり、\n" +"実行時まで分からない兄弟クラスもその順序に含まれる可能性があるためです)。" #: ../../builtins/functions.rst:2119 msgid "For both use cases, a typical superclass call looks like this::" @@ -3882,7 +4004,6 @@ msgstr "" "文や ``super()[name]`` のような演算子を使った暗黙の探索向けには定義されていま" "せん。" -#: ../../builtins/functions.rst:2138 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -3891,11 +4012,12 @@ msgid "" "necessary details to correctly retrieve the class being defined, as well as " "accessing the current instance for ordinary methods." msgstr "" -"また、 :func:`super` の使用は引数無しの形式を除きメソッド内部に限定されないこ" -"とにも注目して下さい。2引数の形式は、必要な要素を正確に指定するので、適当な参" -"照を作ることができます。クラス定義中における引数無しの形式は、定義されている" -"クラスを取り出すのに必要な詳細を、通常の方法で現在のインスタンスにアクセスす" -"るようにコンパイラが埋めるのではたらきます。" +"引数なしの形式を除き、:func:`super` はメソッドの外でも使えます。\n" +"2引数形式では、引数を明示的に指定し、適切な参照を作成します。\n" +"引数なしの形式がクラス定義内でのみ機能するのは、\n" +"定義中のクラスを正しく取得し、通常のメソッドでは現在のインスタンスにもアクセ" +"スできるように、\n" +"コンパイラが必要な情報を補うためです。" #: ../../builtins/functions.rst:2145 msgid "" @@ -3965,13 +4087,11 @@ msgstr "" msgid "See also:" msgstr "下記を参照してください。" -#: ../../builtins/functions.rst:2191 msgid "" ":ref:`Documentation on attributes and methods on classes `." msgstr "" -":ref:`Documentation on attributes and methods on classes `." +":ref:`クラスの属性とメソッドに関するドキュメント `。" #: ../../builtins/functions.rst:2192 msgid ":ref:`bltin-type-objects`" @@ -3988,12 +4108,15 @@ msgstr "" "定義におけるキーワード引数と同様に、適切なメタクラスの機構 (通常は :meth:" "`~object.__init_subclass__`) に渡されます。" -#: ../../builtins/functions.rst:2199 msgid "" "Unlike a :keyword:`class` statement, the three argument form does not call " "the metaclass ``__prepare__`` method (see :ref:`prepare`). Use :func:`types." "new_class` to dynamically create a class using the appropriate metaclass." msgstr "" +":keyword:`class` 文とは異なり、3引数形式ではメタクラスの ``__prepare__`` メ" +"ソッドを呼び出しません (:ref:`prepare` を参照してください)。\n" +"適切なメタクラスを使って動的にクラスを作成するには、:func:`types.new_class` " +"を使ってください。" #: ../../builtins/functions.rst:2204 msgid "See also :ref:`class-customization`." @@ -4007,9 +4130,8 @@ msgstr "" "``type.__new__`` をオーバーライドしていない :class:`!type` のサブクラスは、オ" "ブジェクトの型を得るのに1引数形式を利用することができません。" -#: ../../builtins/functions.rst:2212 msgid "*dict* can now be a :class:`frozendict`." -msgstr "" +msgstr "``dict`` に :class:`frozendict` を指定できるようになりました。" #: ../../builtins/functions.rst:2217 msgid "" @@ -4122,12 +4244,15 @@ msgstr "" "備するコードにおけるバグのこともあるでしょう。 Python はこの問題に対して3つの" "異なるアプローチを提供します:" -#: ../../builtins/functions.rst:2267 msgid "" "By default, :func:`zip` stops when the shortest iterable is :term:" "`exhausted`. It will ignore the remaining items in the longer iterables, " "cutting off the result to the length of the shortest iterable::" msgstr "" +"デフォルトでは、最も短いイテラブルが :term:`枯渇する ` と :func:" +"`zip` は停止します。\n" +"より長いイテラブルに残った要素は無視し、結果を最も短いイテラブルの長さに切り" +"詰めます。 ::" #: ../../builtins/functions.rst:2271 msgid "" @@ -4155,11 +4280,12 @@ msgstr "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" -#: ../../builtins/functions.rst:2281 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is :term:`exhausted` before the others:" msgstr "" +"デフォルトの動作とは異なり、いずれかのイテラブルが他より先に :term:`枯渇した " +"` 場合は、:exc:`ValueError` を送出します:" msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " @@ -4262,7 +4388,6 @@ msgstr "" "`__import__` を直接使用することも推奨されず、 :func:`importlib." "import_module` の方が好まれます。" -#: ../../builtins/functions.rst:2353 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -4271,12 +4396,13 @@ msgid "" "does not use its *locals* argument at all and uses its *globals* only to " "determine the package context of the :keyword:`import` statement." msgstr "" -"この関数は、モジュール *name* をインポートし、 *globals* と *locals* が与えら" -"れれば、パッケージのコンテキストで名前をどう解釈するか決定するのに使います。 " -"*fromlist* は *name* で与えられるモジュールからインポートされるべきオブジェク" -"トまたはサブモジュールの名前を与ます。標準の実装では *locals* 引数はまったく" -"使われず、 *globals* は :keyword:`import` 文のパッケージコンテキストを決定す" -"るためにのみ使われます。" +"この関数はモジュール *name* をインポートします。\n" +"その際、指定された *globals* と *locals* を使って、パッケージのコンテキストで" +"名前をどう解釈するかを決めることがあります。\n" +"*fromlist* には、*name* が指定するモジュールからインポートするオブジェクトや" +"サブモジュールの名前を指定します。\n" +"標準の実装では *locals* 引数をまったく使わず、:keyword:`import` 文のパッケー" +"ジコンテキストを決めるためにのみ *globals* を使います。" msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " @@ -4323,14 +4449,12 @@ msgstr "文 ``import spam.ham`` は、この呼び出しになります::" msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -#: ../../builtins/functions.rst:2380 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -"ここで :func:`__import__` がどのように最上位モジュールを返しているかに注意し" -"て下さい。 :keyword:`import` 文により名前が束縛されたオブジェクトになっていま" -"す。" +"ここで :func:`__import__` が最上位のモジュールを返すのは、:keyword:`import` " +"文がそのオブジェクトに名前を束縛するためです。" #: ../../builtins/functions.rst:2383 msgid "" @@ -4376,13 +4500,12 @@ msgstr "" "負の *level* の値はサポートされなくなりました (デフォルト値の 0 に変更されま" "す)。" -#: ../../builtins/functions.rst:2401 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -"コマンドラインオプション :option:`-E` or :option:`-I` が指定された場合、環境" -"変数 :envvar:`PYTHONCASEOK` は無視されるようになりました。" +"コマンドラインオプション :option:`-E` または :option:`-I` が使われている場" +"合、環境変数 :envvar:`PYTHONCASEOK` は無視されるようになりました。" #: ../../builtins/functions.rst:2406 msgid "Footnotes" diff --git a/builtins/index.po b/builtins/index.po index df4fa45e9..91e14c511 100644 --- a/builtins/index.po +++ b/builtins/index.po @@ -18,32 +18,39 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../builtins/index.rst:5 msgid "Python built-ins reference" -msgstr "" +msgstr "Python 組み込み機能リファレンス" -#: ../../builtins/index.rst:7 msgid "Python comes with a number of built-in functions and classes." -msgstr "" +msgstr "Python には、数多くの組み込み関数と組み込みクラスが用意されています。" -#: ../../builtins/index.rst:9 msgid "" "The built-in classes include data types that would normally be considered " "part of the \"core\" of a language, such as numbers and lists. For these " "types, the Python language core defines the form of literals and places some " "constraints on their semantics, but does not fully define the semantics." msgstr "" +"組み込みクラスには、数値やリストなど、通常は言語の「中核」の一部と見なされる" +"データ型が含まれます。\n" +"Python 言語の中核部分は、これらの型のリテラルの形式を定義し、意味にもいくつか" +"の制約を設けていますが、意味のすべてを定義しているわけではありません。" -#: ../../builtins/index.rst:14 msgid "" "The built-ins also include functions and exceptions --- objects that can be " "used by all Python code without the need of an :keyword:`import` statement. " "Some of these are defined by the core language, but many are not essential " "for the core semantics and are only described here." msgstr "" +"組み込み機能には、関数や例外も含まれます。\n" +"これらは :keyword:`import` 文を使わずに、あらゆる Python コードから利用できる" +"オブジェクトです。\n" +"その一部は言語の中核部分で定義されていますが、多くは中核部分の意味に不可欠な" +"ものではなく、このリファレンスでのみ説明しています。" -#: ../../builtins/index.rst:21 msgid "" "In addition to the built-ins, Python provides an extensive importable " "standard library, see :ref:`library-index`." msgstr "" +"Python は組み込み機能に加えて、インポートして使える豊富な標準ライブラリを提供" +"しています。\n" +":ref:`library-index` を参照してください。" diff --git a/builtins/stdtypes.po b/builtins/stdtypes.po index 354915e20..804ab3c33 100644 --- a/builtins/stdtypes.po +++ b/builtins/stdtypes.po @@ -79,7 +79,6 @@ msgstr "" "どのようなオブジェクトでも真理値として判定でき、 :keyword:`if` や :keyword:" "`while` の条件あるいは以下のブール演算の被演算子として使えます。" -#: ../../builtins/stdtypes.rst:46 msgid "" "By default, an object is considered true unless its class defines either a :" "meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object." @@ -88,6 +87,13 @@ msgid "" "and the object does not have a truth value (for example, :data:" "`NotImplemented`). Here are most of the built-in objects considered false:" msgstr "" +"通常、オブジェクトは真とみなされます。\n" +"ただし、そのオブジェクトを渡して呼び出したときに ``False`` を返す :meth:" +"`~object.__bool__` メソッドか、ゼロを返す :meth:`~object.__len__` メソッドが" +"クラスに定義されている場合は偽とみなされます。[1]_\n" +"いずれかのメソッドの呼び出しで例外が送出されると、その例外が伝播し、オブジェ" +"クトは真理値を持ちません (例えば :data:`NotImplemented`)。\n" +"偽とみなされる主な組み込みオブジェクトは次のとおりです:" #: ../../builtins/stdtypes.rst:58 msgid "constants defined to be false: ``None`` and ``False``" @@ -428,33 +434,36 @@ msgstr "" "コンストラクタ :func:`int` 、 :func:`float` 、 :func:`complex` で、特定の型の" "数を生成できます。" -#: ../../builtins/stdtypes.rst:270 msgid "" "Python fully supports mixed arithmetic: when a binary arithmetic operator " "has operands of different built-in numeric types, the operand with the " "\"narrower\" type is widened to that of the other:" msgstr "" +"Python は異なる型を混在させた算術演算を完全にサポートしています。\n" +"二項算術演算子のオペランドが異なる組み込み数値型の場合、「狭い」型のオペラン" +"ドがもう一方の型に拡張されます:" -#: ../../builtins/stdtypes.rst:274 msgid "If both arguments are complex numbers, no conversion is performed;" -msgstr "" +msgstr "両方の引数が複素数の場合、変換は行われません。" -#: ../../builtins/stdtypes.rst:275 msgid "" "if either argument is a complex or a floating-point number, the other is " "converted to a floating-point number;" msgstr "" +"それ以外で、一方の引数が複素数または浮動小数点数の場合、もう一方は浮動小数点" +"数に変換されます。" #: ../../builtins/stdtypes.rst:277 msgid "otherwise, both must be integers and no conversion is necessary." msgstr "" "それ以外場合は、両方の引数は整数でなければならず、変換の必要はありません。" -#: ../../builtins/stdtypes.rst:279 msgid "" "Arithmetic with complex and real operands is defined by the usual " "mathematical formula, for example::" msgstr "" +"複素数と実数をオペランドとする演算は、通常の数学の式で定義されます。\n" +"例えば、次のようになります。 ::" msgid "" "x + complex(u, v) = complex(x + u, v)\n" @@ -463,11 +472,12 @@ msgstr "" "x + complex(u, v) = complex(x + u, v)\n" "x * complex(u, v) = complex(x * u, x * v)" -#: ../../builtins/stdtypes.rst:285 msgid "" "A comparison between numbers of different types behaves as though the exact " "values of those numbers were being compared. [2]_" msgstr "" +"異なる型の数値を比較すると、それぞれの数値の正確な値を比較した場合と同じ結果" +"になります。[2]_" #: ../../builtins/stdtypes.rst:288 msgid "" @@ -881,17 +891,16 @@ msgid "" "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." msgstr "*n* ビットの右シフトは、 ``pow(2, n)`` による切り捨て除算と等価です。" -#: ../../builtins/stdtypes.rst:462 msgid "" "Performing these calculations with at least one extra sign extension bit in " "a finite two's complement representation (a working bit-width of ``1 + max(x." "bit_length(), y.bit_length())`` or more) is sufficient to get the same " "result as if there were an infinite number of sign bits." msgstr "" -"桁の長い方の値に少なくとも 1 つ余計に符号ビットを付け加えた幅 (計算するビット" -"幅は ``1 + max(x.bit_length(), y.bit_length())`` かそれ以上) でこれらの計算を" -"行えば、無限個の符号ビットがあるかのように計算したのと同じ結果を得るのに十分" -"です。" +"有限ビット幅の2の補数表現に、少なくとも1ビットの符号拡張ビットを追加してこれ" +"らの計算を行えば、符号ビットを無限個使う場合と同じ結果が得られます。\n" +"計算に使うビット幅は ``1 + max(x.bit_length(), y.bit_length())`` 以上で十分で" +"す。" #: ../../builtins/stdtypes.rst:469 msgid "Additional Methods on Integer Types" @@ -943,13 +952,16 @@ msgstr "" msgid "Equivalent to::" msgstr "次と等価です::" -#: ../../builtins/stdtypes.rst:493 msgid "" "def bit_length(self):\n" " s = bin(self) # binary representation: bin(-37) --> '-0b100101'\n" " s = s.lstrip('-0b') # remove leading zeros and minus sign\n" " return len(s) # len('100101') --> 6" msgstr "" +"def bit_length(self):\n" +" s = bin(self) # 2進表現: bin(-37) --> '-0b100101'\n" +" s = s.lstrip('-0b') # 先頭のゼロと負符号を除去する\n" +" return len(s) # len('100101') --> 6" #: ../../builtins/stdtypes.rst:502 msgid "" @@ -976,11 +988,12 @@ msgstr "" ">>> (-n).bit_count()\n" "3" -#: ../../builtins/stdtypes.rst:516 msgid "" "def bit_count(self):\n" " return bin(self).count(\"1\")" msgstr "" +"def bit_count(self):\n" +" return bin(self).count(\"1\")" #: ../../builtins/stdtypes.rst:523 msgid "Return an array of bytes representing an integer." @@ -1026,11 +1039,12 @@ msgstr "" "上記のデフォルト値は整数を 1 バイトのオブジェクトに適切に変換するのに使うこと" "ができます::" -#: ../../builtins/stdtypes.rst:553 msgid "" ">>> (65).to_bytes()\n" "b'A'" msgstr "" +">>> (65).to_bytes()\n" +"b'A'" #: ../../builtins/stdtypes.rst:556 msgid "" @@ -1061,13 +1075,12 @@ msgstr "``length`` と ``byteorder`` 引数にデフォルト値を追加しま msgid "Return the integer represented by the given array of bytes." msgstr "与えられたバイト列の整数表現を返します。" -#: ../../builtins/stdtypes.rst:590 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" -"引数 *bytes* は :term:`bytes-like object` か、または bytes を生成する " -"iterable でなければなりません。" +"引数 ``bytes`` は :term:`bytes-like object` か、バイト値を生成するイテラブル" +"でなければなりません。" #: ../../builtins/stdtypes.rst:593 msgid "" @@ -1243,7 +1256,6 @@ msgstr "16 進文字列表現は以下の書式となります::" msgid "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" msgstr "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" -#: ../../builtins/stdtypes.rst:709 msgid "" "where the optional ``sign`` may be either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -1256,6 +1268,17 @@ msgid "" "by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted " "by :meth:`float.fromhex`." msgstr "" +"ここで、省略可能な ``sign`` は ``+`` または ``-``、``integer`` と " +"``fraction`` は16進数字の文字列、``exponent`` は先頭に符号を付けてもよい10進" +"整数です。\n" +"大文字と小文字は区別されず、整数部か小数部のいずれかに少なくとも1桁の16進数字" +"が必要です。\n" +"この構文は、C99 規格の6.4.4.2節で指定されている構文や、Java 1.5 以降で使われ" +"ている構文に似ています。\n" +"特に、:meth:`float.hex` の出力は C や Java のコードで16進浮動小数点リテラルと" +"して使えます。\n" +"また、C の ``%a`` 書式文字や Java の ``Double.toHexString`` で生成された16進" +"文字列は :meth:`float.fromhex` で受け付けられます。" #: ../../builtins/stdtypes.rst:722 msgid "" @@ -1425,7 +1448,6 @@ msgstr "" "を計算する Python コードの例を示します。\n" "このコードは組み込みのハッシュ計算と等価です::" -#: ../../builtins/stdtypes.rst:813 msgid "" "import sys, math\n" "\n" @@ -1476,6 +1498,53 @@ msgid "" " hash_value = -2\n" " return hash_value" msgstr "" +"import sys, math\n" +"\n" +"def hash_fraction(m, n):\n" +" \"\"\"有理数 m / n のハッシュを計算する。\n" +"\n" +" m と n は整数で、n は正と仮定する。\n" +" hash(fractions.Fraction(m, n)) と等価。\n" +"\n" +" \"\"\"\n" +" P = sys.hash_info.modulus\n" +" # P の共通因子を除く (m と n がすでに互いに素なら不要)。\n" +" while m % P == n % P == 0:\n" +" m, n = m // P, n // P\n" +"\n" +" if n % P == 0:\n" +" hash_value = sys.hash_info.inf\n" +" else:\n" +" # フェルマーの小定理により pow(n, P-1, P) は1なので、\n" +" # pow(n, P-2, P) は P を法とする n の逆数を与える。\n" +" hash_value = (abs(m) % P) * pow(n, P - 2, P) % P\n" +" if m < 0:\n" +" hash_value = -hash_value\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value\n" +"\n" +"def hash_float(x):\n" +" \"\"\"浮動小数点数 x のハッシュを計算する。\"\"\"\n" +"\n" +" if math.isnan(x):\n" +" return object.__hash__(x)\n" +" elif math.isinf(x):\n" +" return sys.hash_info.inf if x > 0 else -sys.hash_info.inf\n" +" else:\n" +" return hash_fraction(*x.as_integer_ratio())\n" +"\n" +"def hash_complex(z):\n" +" \"\"\"複素数 z のハッシュを計算する。\"\"\"\n" +"\n" +" hash_value = hash_float(z.real) + sys.hash_info.imag * hash_float(z." +"imag)\n" +" # 2**sys.hash_info.width を法として、符号付きの剰余に還元する\n" +" M = 2**(sys.hash_info.width - 1)\n" +" hash_value = (hash_value & (M - 1)) - (hash_value & M)\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value" #: ../../builtins/stdtypes.rst:864 msgid "Boolean Type - :class:`bool`" @@ -1511,11 +1580,12 @@ msgstr "" "ブール値を返します。しかしながら、論理演算子 ``and``, ``or`` および ``!=`` を" "使うほうが ``&``, ``|`` や ``^`` を使うよりも好ましいです。" -#: ../../builtins/stdtypes.rst:886 msgid "" "The use of the bitwise inversion operator ``~`` is deprecated and will raise " "an error in Python 3.16." msgstr "" +"ビット反転演算子 ``~`` の使用は非推奨となり、Python 3.16 ではエラーが送出され" +"るようになります。" #: ../../builtins/stdtypes.rst:889 msgid "" @@ -1530,9 +1600,8 @@ msgstr "" "信頼することは推奨されません; :func:`int` を使って明示的に整数値に変換してく" "ださい。" -#: ../../builtins/stdtypes.rst:899 msgid "Iteration-related types" -msgstr "" +msgstr "反復に関連する型" #: ../../builtins/stdtypes.rst:907 msgid "" @@ -1546,9 +1615,8 @@ msgstr "" "クラスで反復を行えるようにできます。後に詳しく述べるシーケンスは、必ず反復処" "理メソッドをサポートしています。" -#: ../../builtins/stdtypes.rst:913 msgid "Iterables" -msgstr "" +msgstr "イテラブル" #: ../../builtins/stdtypes.rst:915 msgid "" @@ -1635,25 +1703,27 @@ msgstr "" "を送出したなら、以降の呼び出しでも例外を送出し続けなければなりません。この特" "性に従わない実装は壊れているとみなされます。" -#: ../../builtins/stdtypes.rst:968 msgid "Generator types" -msgstr "" +msgstr "ジェネレータ型" -#: ../../builtins/stdtypes.rst:970 msgid "" "Python's :term:`generators ` -- or more precisely, :term:" "`generator functions ` and :term:`generator iterators " "` -- provide a convenient way to implement the iterator " "protocol." msgstr "" +"Python の :term:`ジェネレータ `、より正確には :term:`ジェネレータ" +"関数 ` と :term:`ジェネレータイテレータ ` を使うと、イテレータプロトコルを簡単に実装できます。" -#: ../../builtins/stdtypes.rst:975 msgid "" "A function that contains one or more :ref:`yield expressions ` is " "a :term:`generator function`. For example::" msgstr "" +":ref:`yield 式 ` を一つ以上含む関数は :term:`ジェネレータ関数 " +"` です。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:979 msgid "" ">>> def count_to_three():\n" "... yield 0\n" @@ -1661,28 +1731,37 @@ msgid "" "... yield 2\n" "... yield 3" msgstr "" +">>> def count_to_three():\n" +"... yield 0\n" +"... yield 1\n" +"... yield 2\n" +"... yield 3" -#: ../../builtins/stdtypes.rst:985 msgid "" "Generator functions behave as regular :ref:`user-defined functions ` (for example, they have the same attributes), except that " "calling a generator function returns a :ref:`generator iterator `::" msgstr "" +"ジェネレータ関数は通常の :ref:`ユーザ定義関数 ` と同様に" +"振る舞います (例えば、同じ属性を持ちます)。\n" +"ただし、呼び出すと :ref:`ジェネレータイテレータ ` を返しま" +"す。 ::" -#: ../../builtins/stdtypes.rst:990 msgid "" ">>> count_to_three()\n" "" msgstr "" +">>> count_to_three()\n" +"" -#: ../../builtins/stdtypes.rst:993 msgid "" "Iterating a generator iterator executes code of the underlying generator " "function, producing each :keyword:`yield`\\ed value in turn::" msgstr "" +"ジェネレータイテレータを反復すると、元のジェネレータ関数のコードが実行され、:" +"keyword:`yield` された値が順番に生成されます。 ::" -#: ../../builtins/stdtypes.rst:996 msgid "" ">>> for number in count_to_three():\n" "... print(number)\n" @@ -1694,14 +1773,24 @@ msgid "" ">>> list(count_to_three())\n" "[0, 1, 2, 3]" msgstr "" +">>> for number in count_to_three():\n" +"... print(number)\n" +"0\n" +"1\n" +"2\n" +"3\n" +"\n" +">>> list(count_to_three())\n" +"[0, 1, 2, 3]" -#: ../../builtins/stdtypes.rst:1006 msgid "" "One common use for generator functions is implementing the :meth:`~object." "__iter__` method of custom iterable objects. For example::" msgstr "" +"ジェネレータ関数は、独自のイテラブルオブジェクトの :meth:`~object.__iter__` " +"メソッドを実装する際によく使われます。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:1010 msgid "" ">>> class CardDeck:\n" "... def __iter__(self):\n" @@ -1711,19 +1800,26 @@ msgid "" ">>> list(CardDeck())\n" "['three of clubs', 'ace of hearts']" msgstr "" +">>> class CardDeck:\n" +"... def __iter__(self):\n" +"... yield 'three of clubs'\n" +"... yield 'ace of hearts'\n" +"\n" +">>> list(CardDeck())\n" +"['three of clubs', 'ace of hearts']" -#: ../../builtins/stdtypes.rst:1023 msgid "Generator iterators" -msgstr "" +msgstr "ジェネレータイテレータ" -#: ../../builtins/stdtypes.rst:1025 msgid "" "Generator iterators implement the :ref:`iterator protocol `. Iterating them drives execution of the underlying generator " "function." msgstr "" +"ジェネレータイテレータは :ref:`イテレータプロトコル ` を" +"実装しています。\n" +"反復すると、元のジェネレータ関数の実行が進みます。" -#: ../../builtins/stdtypes.rst:1033 msgid "" "Starts the execution of a generator function or resumes it at the :ref:" "`yield expression ` where the function is currently suspended. " @@ -1736,45 +1832,60 @@ msgid "" "raises a :exc:`StopIteration` exception, signalling that iteration has " "completed." msgstr "" +"ジェネレータ関数の実行を開始するか、現在中断している :ref:`yield 式 " +"` から実行を再開します。\n" +":meth:`~generator.__next__` メソッドでジェネレータ関数を再開すると、現在の " +"yield 式は常に :const:`None` と評価されます。\n" +"その後、次の yield 式まで実行が進み、そこでジェネレータは再び中断します。\n" +":keyword:`yield` キーワードの後の式の値が :meth:`~generator.__next__` の呼び" +"出し元に返されます。\n" +"別の値を yield することなくジェネレータが終了すると、:meth:`~generator." +"__next__` は :exc:`StopIteration` 例外を送出し、反復の完了を知らせます。" -#: ../../builtins/stdtypes.rst:1045 msgid "" "This method is normally called implicitly, for example by a :keyword:`for` " "loop, or by the built-in :func:`next` function." msgstr "" +"通常、このメソッドは :keyword:`for` ループや組み込みの :func:`next` 関数など" +"によって暗黙的に呼び出されます。" -#: ../../builtins/stdtypes.rst:1048 msgid "" "Generator iterators have a few more methods than generic iterators, which " "can be used to control the execution of the underlying generator function:" msgstr "" +"ジェネレータイテレータは一般的なイテレータに加えていくつかのメソッドを持ち、" +"元のジェネレータ関数の実行を制御できます:" -#: ../../builtins/stdtypes.rst:1053 msgid "" "\"Sends\" a value into the generator function: the *value* argument becomes " "the result of the current yield expression." msgstr "" +"ジェネレータ関数に値を「送信」します。\n" +"``value`` 引数が現在の yield 式の結果になります。" -#: ../../builtins/stdtypes.rst:1056 msgid "" "Otherwise, this method behaves like :meth:`~generator.__next__`: it resumes " "the underlying function and either returns the next yielded value or raises :" "exc:`StopIteration`." msgstr "" +"それ以外の点では、このメソッドは :meth:`~generator.__next__` と同様に動作しま" +"す。\n" +"元の関数の実行を再開し、次に yield された値を返すか、:exc:`StopIteration` を" +"送出します。" -#: ../../builtins/stdtypes.rst:1060 msgid "" "When :meth:`send` is called to start the generator, it must be called with :" "const:`None` as the argument, because there is no current yield expression " "that could receive the value." msgstr "" +"ジェネレータを開始するために :meth:`send` を呼び出す場合は、引数として :" +"const:`None` を渡さなければなりません。\n" +"まだ値を受け取れる yield 式がないためです。" -#: ../../builtins/stdtypes.rst:1068 msgid "" "Raises an exception at the point where the generator is currently suspended." -msgstr "" +msgstr "ジェネレータが現在中断している箇所で例外を送出します。" -#: ../../builtins/stdtypes.rst:1070 msgid "" "Otherwise, this method behaves like :meth:`~generator.__next__`: it resumes " "the underlying function and either returns the next yielded value or raises :" @@ -1782,22 +1893,31 @@ msgid "" "exception, or raises a different exception, then that exception propagates " "to the caller." msgstr "" +"それ以外の点では、このメソッドは :meth:`~generator.__next__` と同様に動作しま" +"す。\n" +"元の関数の実行を再開し、次に yield された値を返すか、:exc:`StopIteration` を" +"送出します。\n" +"ジェネレータ関数が渡された例外を捕捉しないか、別の例外を送出した場合、その例" +"外は呼び出し元に伝播します。" -#: ../../builtins/stdtypes.rst:1076 msgid "" "When :meth:`throw` is called to start the generator, the generator " "immediately exits (that is, subsequent calls to :meth:`~generator.__next__` " "will raise :exc:`StopIteration`) and the thrown exception is propagated to :" "meth:`throw`'s caller." msgstr "" +"ジェネレータを開始するために :meth:`throw` を呼び出すと、ジェネレータは直ちに" +"終了し (以降の :meth:`~generator.__next__` の呼び出しでは :exc:" +"`StopIteration` が送出されます)、送出された例外は :meth:`throw` の呼び出し元" +"に伝播します。" -#: ../../builtins/stdtypes.rst:1081 ../../builtins/stdtypes.rst:1202 msgid "" "In typical use, this is called with a single argument, an exception " "instance, similar to the way the :keyword:`raise` keyword is used." msgstr "" +"通常は :keyword:`raise` キーワードと同様に、例外インスタンスを一つの引数とし" +"て渡して呼び出します。" -#: ../../builtins/stdtypes.rst:1084 msgid "" "For backwards compatibility, however, the second signature is supported, " "following a convention from older versions of Python. The *type* argument " @@ -1807,21 +1927,31 @@ msgid "" "any existing :attr:`~BaseException.__traceback__` attribute stored in " "*value* may be cleared." msgstr "" +"ただし、後方互換性のため、以前のバージョンの Python の慣例に従った2番目のシグ" +"ネチャもサポートされています。\n" +"``type`` 引数には例外クラスを、``value`` には例外インスタンスを指定してくださ" +"い。\n" +"``value`` を指定しない場合は、``type`` のコンストラクタを呼び出してインスタン" +"スを取得します。\n" +"``traceback`` を指定した場合は例外に設定されます。\n" +"指定しない場合は、``value`` に格納されている既存の :attr:`~BaseException." +"__traceback__` 属性がクリアされることがあります。" -#: ../../builtins/stdtypes.rst:1095 ../../builtins/stdtypes.rst:1212 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" +"2番目のシグネチャ \\(type\\[, value\\[, traceback\\]\\]\\) は非推奨となり、将" +"来のバージョンの Python で削除される可能性があります。" -#: ../../builtins/stdtypes.rst:1102 msgid "" "Raises a :exc:`GeneratorExit` exception at the point where the generator " "function is currently suspended (equivalent to calling " "``throw(GeneratorExit)``)." msgstr "" +"ジェネレータ関数が現在中断している箇所で :exc:`GeneratorExit` 例外を送出しま" +"す (``throw(GeneratorExit)`` の呼び出しと等価です)。" -#: ../../builtins/stdtypes.rst:1105 msgid "" "If the generator function has already exited (due to an exception or normal " "return), or raises :exc:`GeneratorExit` (by not catching the exception), :" @@ -1830,39 +1960,52 @@ msgid "" "propagated to the caller. If a generator returns a value upon being closed, " "that value is returned by :meth:`close`." msgstr "" +"ジェネレータ関数がすでに終了している場合 (例外による終了と正常な return のど" +"ちらも含みます)、または例外を捕捉せず :exc:`GeneratorExit` を送出した場合、:" +"meth:`close` は :const:`None` を返します。\n" +"ジェネレータが値を yield すると、:exc:`RuntimeError` が送出されます。\n" +"ジェネレータがそれ以外の例外を送出した場合、その例外は呼び出し元に伝播しま" +"す。\n" +"クローズ時にジェネレータが値を return した場合、:meth:`close` はその値を返し" +"ます。" -#: ../../builtins/stdtypes.rst:1113 msgid "" "When a generator iterator is garbage collected before it has exited, :meth:" "`~generator.close` is called automatically." msgstr "" +"ジェネレータイテレータが終了する前にガベージコレクションで回収されると、:" +"meth:`~generator.close` が自動的に呼び出されます。" -#: ../../builtins/stdtypes.rst:1118 msgid "" "If a generator returns a value upon being closed, the value is returned by :" "meth:`close`. Previously, it returned ``None``." msgstr "" +"クローズ時にジェネレータが値を return した場合、:meth:`close` はその値を返す" +"ようになりました。\n" +"以前は ``None`` を返していました。" -#: ../../builtins/stdtypes.rst:1123 msgid "" "Calling any of the generator methods (:meth:`~generator.__next__`, :meth:" "`~generator.send`, :meth:`~generator.throw`, :meth:`~generator.close`) while " "one of these methods is already executing raises a :exc:`ValueError` " "exception." msgstr "" +"ジェネレータのメソッド (:meth:`~generator.__next__`、:meth:`~generator." +"send`、:meth:`~generator.throw`、:meth:`~generator.close`) のいずれかを実行中" +"に、これらのメソッドのいずれかを呼び出すと :exc:`ValueError` 例外が送出されま" +"す。" -#: ../../builtins/stdtypes.rst:1133 msgid "Asynchronous generator iterators" -msgstr "" +msgstr "非同期ジェネレータイテレータ" -#: ../../builtins/stdtypes.rst:1135 msgid "" "This subsection describes the methods of an asynchronous generator iterator, " "which are used to control the execution of an asynchronous generator " "function." msgstr "" +"この節では、非同期ジェネレータ関数の実行を制御する、非同期ジェネレータイテ" +"レータのメソッドを説明します。" -#: ../../builtins/stdtypes.rst:1144 msgid "" "Returns an :term:`awaitable` which when run starts to execute the " "asynchronous generator function or resumes it at the :ref:`yield expression " @@ -1876,49 +2019,71 @@ msgid "" "awaitable instead raises a :exc:`StopAsyncIteration` exception, signalling " "that the asynchronous iteration has completed." msgstr "" +"実行すると非同期ジェネレータ関数の実行を開始するか、現在中断している :ref:" +"`yield 式 ` から実行を再開する :term:`待ち受け可能オブジェクト " +"` を返します。\n" +":meth:`~agen.__anext__` メソッドで非同期ジェネレータ関数を再開すると、返され" +"た待ち受け可能オブジェクト内で現在の yield 式は常に :const:`None` と評価され" +"ます。\n" +"この待ち受け可能オブジェクトを実行すると、次の yield 式まで実行が進みます。\n" +":keyword:`yield` キーワードの後の式の値は、完了するコルーチンが送出する :exc:" +"`StopIteration` 例外の値になります。\n" +"別の値を yield することなく非同期ジェネレータが終了すると、待ち受け可能オブ" +"ジェクトは代わりに :exc:`StopAsyncIteration` 例外を送出し、非同期反復の完了を" +"知らせます。" -#: ../../builtins/stdtypes.rst:1157 msgid "" "This method is normally called implicitly by an :keyword:`async for` loop, " "or by the built-in :func:`anext` function." msgstr "" +"通常、このメソッドは :keyword:`async for` ループや組み込みの :func:`anext` 関" +"数によって暗黙的に呼び出されます。" -#: ../../builtins/stdtypes.rst:1161 msgid "" "Asynchronous generator-iterators have a few more methods than generic " "asynchronous iterators, which can be used to control the execution of the " "underlying generator function:" msgstr "" +"非同期ジェネレータイテレータは一般的な非同期イテレータに加えていくつかのメ" +"ソッドを持ち、元のジェネレータ関数の実行を制御できます:" -#: ../../builtins/stdtypes.rst:1168 msgid "" "Returns an awaitable which, when run, \"sends\" a value into the underlying " "asynchronous generator function: the *value* argument becomes the result of " "the current yield expression." msgstr "" +"実行すると元の非同期ジェネレータ関数に値を「送信」する待ち受け可能オブジェク" +"トを返します。\n" +"``value`` 引数が現在の yield 式の結果になります。" -#: ../../builtins/stdtypes.rst:1172 msgid "" "Otherwise, this method behaves like :meth:`~agen.__anext__`: when the " "returned awaitable runs, it resumes the underlying function and either " "returns the next yielded value as the value of the raised :exc:" "`StopIteration`, or raises :exc:`StopAsyncIteration`." msgstr "" +"それ以外の点では、このメソッドは :meth:`~agen.__anext__` と同様に動作しま" +"す。\n" +"返された待ち受け可能オブジェクトを実行すると、元の関数の実行が再開され、次に " +"yield された値を :exc:`StopIteration` 例外の値として返すか、:exc:" +"`StopAsyncIteration` を送出します。" -#: ../../builtins/stdtypes.rst:1177 msgid "" "When :meth:`asend` is called to start the asynchronous generator, it must be " "called with :const:`None` as the argument, because there is no yield " "expression that could receive the value." msgstr "" +"非同期ジェネレータを開始するために :meth:`asend` を呼び出す場合は、引数とし" +"て :const:`None` を渡さなければなりません。\n" +"まだ値を受け取れる yield 式がないためです。" -#: ../../builtins/stdtypes.rst:1186 msgid "" "Returns an awaitable that, when run, raises an exception at the point where " "the underlying asynchronous generator function is currently suspended." msgstr "" +"実行すると元の非同期ジェネレータ関数が現在中断している箇所で例外を送出する待" +"ち受け可能オブジェクトを返します。" -#: ../../builtins/stdtypes.rst:1189 msgid "" "Otherwise, this method behaves like :meth:`~agen.__anext__`: when the " "returned awaitable runs, it resumes the underlying function (with an " @@ -1928,28 +2093,43 @@ msgid "" "different exception, then when the awaitable is run, that exception " "propagates to the caller of the awaitable." msgstr "" +"それ以外の点では、このメソッドは :meth:`~agen.__anext__` と同様に動作しま" +"す。\n" +"返された待ち受け可能オブジェクトを実行すると、元の関数の実行が例外を送出した" +"状態で再開され、次に yield された値を :exc:`StopIteration` 例外の値として返す" +"か、:exc:`StopAsyncIteration` を送出します。\n" +"元の関数が渡された例外を捕捉しないか、別の例外を送出した場合、待ち受け可能オ" +"ブジェクトの実行時に、その例外は待ち受け可能オブジェクトの呼び出し元に伝播し" +"ます。" -#: ../../builtins/stdtypes.rst:1197 msgid "" "When :meth:`~agen.athrow` is called to start the generator, the generator " "exits when the awaitable runs (that is, subsequent results from :meth:`~agen." "__anext__` will raise :exc:`StopAsyncIteration` when run) and the thrown " "exception is propagated to the awaitable's caller." msgstr "" +"ジェネレータを開始するために :meth:`~agen.athrow` を呼び出すと、待ち受け可能" +"オブジェクトの実行時にジェネレータは終了し (以降の :meth:`~agen.__anext__` の" +"結果を実行すると :exc:`StopAsyncIteration` が送出されます)、送出された例外は" +"待ち受け可能オブジェクトの呼び出し元に伝播します。" -#: ../../builtins/stdtypes.rst:1205 msgid "" "For backwards compatibility, however, the second signature is supported. An " "exception instance is created from three arguments in the same way as in :" "meth:`generator.throw`." msgstr "" +"ただし、後方互換性のため、2番目のシグネチャもサポートされています。\n" +":meth:`generator.throw` と同様に、三つの引数から例外インスタンスを作成しま" +"す。" -#: ../../builtins/stdtypes.rst:1221 msgid "" "Returns an awaitable that when run will throw a :exc:`GeneratorExit` into " "the underlying asynchronous generator function at the point where it is " "currently suspended (equivalent to calling ``athrow(GeneratorExit)``)." msgstr "" +"実行すると元の非同期ジェネレータ関数が現在中断している箇所で :exc:" +"`GeneratorExit` を送出する待ち受け可能オブジェクトを返します " +"(``athrow(GeneratorExit)`` の呼び出しと等価です)。" #: ../../builtins/stdtypes.rst:1225 msgid "" @@ -1960,19 +2140,24 @@ msgid "" "generator will raise a :exc:`StopAsyncIteration` exception." msgstr "" -#: ../../builtins/stdtypes.rst:1231 msgid "" "If the asynchronous generator yields a value, a :exc:`RuntimeError` is " "raised by the awaitable. If the asynchronous generator raises any other " "exception, that exception is propagated to the caller of the awaitable." msgstr "" +"非同期ジェネレータが値を yield すると、待ち受け可能オブジェクトは :exc:" +"`RuntimeError` を送出します。\n" +"非同期ジェネレータがそれ以外の例外を送出した場合、その例外は待ち受け可能オブ" +"ジェクトの呼び出し元に伝播します。" -#: ../../builtins/stdtypes.rst:1236 msgid "" "If the asynchronous generator has already exited due to an exception or " "normal exit, then further calls to :meth:`aclose` will return an awaitable " "that does nothing." msgstr "" +"非同期ジェネレータが例外または正常終了によってすでに終了している場合、以降" +"の :meth:`aclose` の呼び出しは、何もしない待ち受け可能オブジェクトを返しま" +"す。" #: ../../builtins/stdtypes.rst:1244 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" @@ -1993,17 +2178,16 @@ msgstr "" msgid "Common Sequence Operations" msgstr "共通のシーケンス演算" -#: ../../builtins/stdtypes.rst:1259 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " "provided to make it easier to correctly implement these operations on custom " "sequence types." msgstr "" -"以下の表にある演算は、ほとんどのミュータブル、イミュータブル両方のシーケンス" -"でサポートされています。カスタムのシーケンス型にこれらの演算を完全に実装する" -"のが簡単になるように、 :class:`collections.abc.Sequence` ABC が提供されていま" -"す。" +"以下の表にある演算は、ミュータブルとイミュータブルの両方を含む、ほとんどの" +"シーケンス型でサポートされています。\n" +"独自のシーケンス型でこれらの演算を正しく実装しやすくするために、:class:" +"`collections.abc.Sequence` ABC が提供されています。" #: ../../builtins/stdtypes.rst:1264 msgid "" @@ -2026,10 +2210,11 @@ msgstr "" "``in`` および ``not in`` 演算の優先順位は比較演算と同じです。``+`` (結合) お" "よび ``*`` (繰り返し)の優先順位は対応する数値演算と同じです。 [3]_" -#: ../../builtins/stdtypes.rst:1273 msgid "" "See :ref:`time-complexity` for the costs of the various sequence operations." msgstr "" +"各種シーケンス演算の計算量については、:ref:`time-complexity` を参照してくださ" +"い。" #: ../../builtins/stdtypes.rst:1291 msgid "``x in s``" @@ -2189,7 +2374,6 @@ msgstr "" "これは Python に慣れていないプログラマをよく悩ませます。\n" "次のコードを考えてみてください::" -#: ../../builtins/stdtypes.rst:1350 msgid "" ">>> lists = [[]] * 3\n" ">>> lists\n" @@ -2198,6 +2382,12 @@ msgid "" ">>> lists\n" "[[3], [3], [3]]" msgstr "" +">>> lists = [[]] * 3\n" +">>> lists\n" +"[[], [], []]\n" +">>> lists[0].append(3)\n" +">>> lists\n" +"[[3], [3], [3]]" #: ../../builtins/stdtypes.rst:1357 msgid "" @@ -2211,7 +2401,6 @@ msgstr "" "と、その一つのリストが変更されます。別々のリストのリストを作るにはこうしま" "す::" -#: ../../builtins/stdtypes.rst:1362 msgid "" ">>> lists = [[] for i in range(3)]\n" ">>> lists[0].append(3)\n" @@ -2220,6 +2409,12 @@ msgid "" ">>> lists\n" "[[3], [5], [7]]" msgstr "" +">>> lists = [[] for i in range(3)]\n" +">>> lists[0].append(3)\n" +">>> lists[1].append(5)\n" +">>> lists[2].append(7)\n" +">>> lists\n" +"[[3], [5], [7]]" #: ../../builtins/stdtypes.rst:1369 msgid "" @@ -2238,31 +2433,27 @@ msgstr "" "す。\n" "ただし ``-0`` はやはり ``0`` であることに注意してください。" -#: ../../builtins/stdtypes.rst:1378 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " "index *k* such that ``i <= k < j``." msgstr "" +"*s* の *i* から *j* までのスライスは、``i <= k < j`` を満たすインデックス " +"*k* の要素からなるシーケンスとして定義されます。" -#: ../../builtins/stdtypes.rst:1381 msgid "If *i* is omitted or ``None``, use ``0``." -msgstr "" +msgstr "*i* が省略された場合や ``None`` の場合は ``0`` を使います。" -#: ../../builtins/stdtypes.rst:1382 msgid "If *j* is omitted or ``None``, use ``len(s)``." -msgstr "" +msgstr "*j* が省略された場合や ``None`` の場合は ``len(s)`` を使います。" -#: ../../builtins/stdtypes.rst:1383 msgid "If *i* or *j* is less than ``-len(s)``, use ``0``." -msgstr "" +msgstr "*i* または *j* が ``-len(s)`` 未満の場合は ``0`` を使います。" -#: ../../builtins/stdtypes.rst:1384 msgid "If *i* or *j* is greater than ``len(s)``, use ``len(s)``." -msgstr "" +msgstr "*i* または *j* が ``len(s)`` より大きい場合は ``len(s)`` を使います。" -#: ../../builtins/stdtypes.rst:1385 msgid "If *i* is greater than or equal to *j*, the slice is empty." -msgstr "" +msgstr "*i* が *j* 以上の場合、スライスは空になります。" #: ../../builtins/stdtypes.rst:1388 msgid "" @@ -2342,9 +2533,8 @@ msgstr "" "ンスのみをサポートするものがあり、それらはシーケンスの結合や繰り返しをサポー" "トしません。" -#: ../../builtins/stdtypes.rst:1426 msgid "An :exc:`IndexError` is raised if *i* is outside the sequence range." -msgstr "" +msgstr "*i* がシーケンスの範囲外の場合、:exc:`IndexError` が送出されます。" #: ../../builtins/stdtypes.rst:1429 msgid "Sequence Methods" @@ -2367,18 +2557,22 @@ msgid "Raises :exc:`ValueError` if *value* is not found in *sequence*." msgstr "" "*sequence* に *value* が見つからなければ :exc:`ValueError` を送出します。" -#: ../../builtins/stdtypes.rst:1454 msgid "" "The *start* or *stop* arguments allow for efficient searching of subsections " "of the sequence, beginning at *start* and ending at *stop*. This is roughly " "equivalent to ``start + sequence[start:stop].index(value)``, only without " "copying any data." msgstr "" +"``start`` または ``stop`` 引数を使うと、シーケンスの ``start`` から ``stop`` " +"までの部分を効率よく検索できます。\n" +"これはおおむね ``start + sequence[start:stop].index(value)`` と等価ですが、" +"データをコピーしません。" -#: ../../builtins/stdtypes.rst:1460 msgid "" "Not all sequence types support passing the *start* and *stop* arguments." msgstr "" +"``start`` および ``stop`` 引数の指定をサポートしていないシーケンス型もありま" +"す。" #: ../../builtins/stdtypes.rst:1466 msgid "Immutable Sequence Types" @@ -2415,15 +2609,14 @@ msgstr "" msgid "Mutable Sequence Types" msgstr "ミュータブルなシーケンス型" -#: ../../builtins/stdtypes.rst:1495 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " "easier to correctly implement these operations on custom sequence types." msgstr "" -"以下のテーブルにある演算は、ほとんどのミュータブルなシーケンスでサポートされ" -"ています。カスタムのシーケンス型にこれらの演算を完全に実装するのが簡単になる" -"ように、 :class:`collections.abc.MutableSequence` ABC が提供されています。" +"以下の表にある演算は、ミュータブルなシーケンス型で定義されています。\n" +"独自のシーケンス型でこれらの演算を正しく実装しやすくするために、:class:" +"`collections.abc.MutableSequence` ABC が提供されています。" #: ../../builtins/stdtypes.rst:1499 msgid "" @@ -2534,59 +2727,71 @@ msgstr "ミュータブルなシーケンスのメソッド" msgid "Mutable sequence types also support the following methods:" msgstr "ミュータブルなシーケンス型は以下のようなメソッドをサポートしています:" -#: ../../builtins/stdtypes.rst:1565 msgid "" "Append *value* to the end of the sequence. This is equivalent to writing " "``seq[len(seq):len(seq)] = [value]``." msgstr "" +"シーケンスの末尾に ``value`` を追加します。\n" +"これは ``seq[len(seq):len(seq)] = [value]`` と書くことと等価です。" -#: ../../builtins/stdtypes.rst:1577 msgid "" "Remove all items from *sequence*. This is equivalent to writing ``del " "sequence[:]``." msgstr "" +"*sequence* からすべての要素を削除します。\n" +"これは ``del sequence[:]`` と書くことと等価です。" -#: ../../builtins/stdtypes.rst:1589 msgid "" "Create a shallow copy of *sequence*. This is equivalent to writing " "``sequence[:]``." msgstr "" +"*sequence* の浅いコピーを作成します。\n" +"これは ``sequence[:]`` と書くことと等価です。" -#: ../../builtins/stdtypes.rst:1592 msgid "" "The :meth:`!copy` method is not part of the :class:`~collections.abc." "MutableSequence` :class:`~abc.ABC`, but most concrete mutable sequence types " "provide it." msgstr "" +":meth:`!copy` メソッドは :class:`~collections.abc.MutableSequence` :class:" +"`~abc.ABC` には含まれませんが、ほとんどの具体的なミュータブルシーケンス型で提" +"供されています。" -#: ../../builtins/stdtypes.rst:1603 msgid "" "Extend *sequence* with the contents of *iterable*. For the most part, this " "is the same as writing ``seq[len(seq):len(seq)] = iterable``." msgstr "" +"*sequence* を ``iterable`` の内容で拡張します。\n" +"これはほとんどの場合、``seq[len(seq):len(seq)] = iterable`` と書くことと同じ" +"です。" -#: ../../builtins/stdtypes.rst:1614 msgid "" "Insert *value* into *sequence* at the given *index*. This is equivalent to " "writing ``sequence[index:index] = [value]``." msgstr "" +"*sequence* の指定された ``index`` に ``value`` を挿入します。\n" +"これは ``sequence[index:index] = [value]`` と書くことと等価です。" -#: ../../builtins/stdtypes.rst:1624 msgid "" "Retrieve the item at *index* and also remove it from *sequence*. By default, " "the last item in *sequence* is removed and returned." msgstr "" +"``index`` の要素を取得し、*sequence* から削除します。\n" +"デフォルトでは、*sequence* の最後の要素を削除して返します。" -#: ../../builtins/stdtypes.rst:1634 msgid "Remove the first item from *sequence* where ``sequence[i] == value``." msgstr "" +"``sequence[i] == value`` を満たす最初の要素を *sequence* から削除します。" -#: ../../builtins/stdtypes.rst:1645 msgid "" "Reverse the items of *sequence* in place. This method maintains economy of " "space when reversing a large sequence. To remind users that it operates by " "side-effect, it returns ``None``." msgstr "" +"*sequence* の要素をインプレースで逆順に並べ替えます。\n" +"このメソッドは、大きなシーケンスを逆順にするときにもメモリ使用量を抑えま" +"す。\n" +"副作用によって動作することを利用者に意識させるため、``None`` を返します。" #: ../../builtins/stdtypes.rst:1653 msgid "Lists" @@ -2647,9 +2852,8 @@ msgid "" msgstr "" "リストを作る方法は、他にも組み込み関数 :func:`sorted` などいろいろあります。" -#: ../../builtins/stdtypes.rst:1682 msgid "Lists are :ref:`generic ` over the types of their items." -msgstr "" +msgstr "リストは要素の型について :ref:`ジェネリック ` です。" #: ../../builtins/stdtypes.rst:1684 msgid "" @@ -2751,11 +2955,12 @@ msgstr "" "ソート中にリストが変更されたことを検出できた場合は :exc:`ValueError` を送出し" "ます。" -#: ../../builtins/stdtypes.rst:1732 msgid "" "For detailed information on thread-safety guarantees for :class:`list` " "objects, see :ref:`thread-safety-list`." msgstr "" +":class:`list` オブジェクトのスレッドセーフ性の保証については、:ref:`thread-" +"safety-list` を参照してください。" #: ../../builtins/stdtypes.rst:1739 msgid "Tuples" @@ -2833,12 +3038,14 @@ msgid "" msgstr "" "タプルは :ref:`共通の ` シーケンス演算をすべて実装します。" -#: ../../builtins/stdtypes.rst:1775 msgid "" "Tuples are :ref:`generic ` over the types of their contents. For " "more information, refer to :ref:`the typing documentation on annotating " "tuples `." msgstr "" +"タプルは内容の型について :ref:`ジェネリック ` です。\n" +"詳しくは、:ref:`タプルのアノテーションに関する typing ドキュメント " +"` を参照してください。" #: ../../builtins/stdtypes.rst:1779 msgid "" @@ -2916,7 +3123,6 @@ msgstr "" msgid "Range examples::" msgstr "range の例::" -#: ../../builtins/stdtypes.rst:1823 msgid "" ">>> list(range(10))\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" @@ -2933,6 +3139,20 @@ msgid "" ">>> list(range(1, 0))\n" "[]" msgstr "" +">>> list(range(10))\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" +">>> list(range(1, 11))\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n" +">>> list(range(0, 30, 5))\n" +"[0, 5, 10, 15, 20, 25]\n" +">>> list(range(0, 10, 3))\n" +"[0, 3, 6, 9]\n" +">>> list(range(0, -10, -1))\n" +"[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n" +">>> list(range(0))\n" +"[]\n" +">>> list(range(1, 0))\n" +"[]" #: ../../builtins/stdtypes.rst:1838 msgid "" @@ -3036,15 +3256,15 @@ msgstr "" "numbers-linspace/>`_ は浮動小数点数向けの遅延評価版 range を実装する方法を紹" "介しています。" -#: ../../builtins/stdtypes.rst:1918 msgid "Text and Binary Sequence Type Methods Summary" -msgstr "" +msgstr "テキストおよびバイナリシーケンス型のメソッド一覧" -#: ../../builtins/stdtypes.rst:1919 msgid "" "The following table summarizes the text and binary sequence types methods by " "category." msgstr "" +"次の表は、テキストおよびバイナリシーケンス型のメソッドを分類ごとにまとめたも" +"のです。" #: ../../builtins/stdtypes.rst:1924 msgid "Category" @@ -3058,9 +3278,8 @@ msgstr ":class:`str` メソッド" msgid ":class:`bytes` and :class:`bytearray` methods" msgstr ":class:`bytes` または :class:`bytearray` メソッド" -#: ../../builtins/stdtypes.rst:1926 msgid "Formatting" -msgstr "" +msgstr "書式化" #: ../../builtins/stdtypes.rst:1926 msgid ":meth:`str.format`" @@ -3082,9 +3301,8 @@ msgstr ":ref:`old-string-formatting`" msgid ":ref:`bytes-formatting`" msgstr ":ref:`bytes-formatting`" -#: ../../builtins/stdtypes.rst:1934 msgid "Searching and Replacing" -msgstr "" +msgstr "検索と置換" #: ../../builtins/stdtypes.rst:1934 msgid ":meth:`str.find`" @@ -3150,9 +3368,8 @@ msgstr ":meth:`str.replace`" msgid ":meth:`bytes.replace`" msgstr ":meth:`bytes.replace`" -#: ../../builtins/stdtypes.rst:1946 msgid "Splitting and Joining" -msgstr "" +msgstr "分割と結合" #: ../../builtins/stdtypes.rst:1946 msgid ":meth:`str.split`" @@ -3202,9 +3419,8 @@ msgstr ":meth:`str.join`" msgid ":meth:`bytes.join`" msgstr ":meth:`bytes.join`" -#: ../../builtins/stdtypes.rst:1956 msgid "String Classification" -msgstr "" +msgstr "文字列の分類" #: ../../builtins/stdtypes.rst:1956 msgid ":meth:`str.isalpha`" @@ -3278,9 +3494,8 @@ msgstr ":meth:`bytes.isspace`" msgid ":meth:`str.isprintable`" msgstr ":meth:`str.isprintable`" -#: ../../builtins/stdtypes.rst:1978 msgid "Case Manipulation" -msgstr "" +msgstr "大文字と小文字の操作" #: ../../builtins/stdtypes.rst:1978 msgid ":meth:`str.lower`" @@ -3326,9 +3541,8 @@ msgstr ":meth:`str.swapcase`" msgid ":meth:`bytes.swapcase`" msgstr ":meth:`bytes.swapcase`" -#: ../../builtins/stdtypes.rst:1990 msgid "Padding and Stripping" -msgstr "" +msgstr "パディングと除去" #: ../../builtins/stdtypes.rst:1990 msgid ":meth:`str.ljust`" @@ -3386,25 +3600,20 @@ msgstr ":meth:`bytes.lstrip`" msgid ":meth:`bytes.rstrip`" msgstr ":meth:`bytes.rstrip`" -#: ../../builtins/stdtypes.rst:2000 msgid ":meth:`str.removeprefix`" -msgstr "" +msgstr ":meth:`str.removeprefix`" -#: ../../builtins/stdtypes.rst:2000 msgid ":meth:`bytes.removeprefix`" -msgstr "" +msgstr ":meth:`bytes.removeprefix`" -#: ../../builtins/stdtypes.rst:2002 msgid ":meth:`str.removesuffix`" -msgstr "" +msgstr ":meth:`str.removesuffix`" -#: ../../builtins/stdtypes.rst:2002 msgid ":meth:`bytes.removesuffix`" -msgstr "" +msgstr ":meth:`bytes.removesuffix`" -#: ../../builtins/stdtypes.rst:2004 msgid "Translation and Encoding" -msgstr "" +msgstr "変換とエンコーディング" #: ../../builtins/stdtypes.rst:2004 msgid ":meth:`str.translate`" @@ -3579,23 +3788,24 @@ msgstr "" "`str` に渡すと、略式の文字列表現を返す 1 つ目の場合に該当します。(Python のコ" "マンドラインオプション :option:`-b` も参照してください) 例えば::" -#: ../../builtins/stdtypes.rst:2095 msgid "" ">>> str(b'Zoot!')\n" "\"b'Zoot!'\"" msgstr "" +">>> str(b'Zoot!')\n" +"\"b'Zoot!'\"" -#: ../../builtins/stdtypes.rst:2098 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " "strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In " "addition, see the :ref:`stringservices` section." msgstr "" -"``str`` クラスとそのメソッドについて詳しくは、 :ref:`テキストシーケンス型 — " -"str ` や :ref:`string-methods` の節を参照してください。フォーマット" -"された文字列を出力するには、 :ref:`f-strings` と :ref:`string-formatting` の" -"節を参照してください。加えて、 :ref:`stringservices` の節も参照してください。" +"``str`` クラスとそのメソッドについて詳しくは、:ref:`textseq` と後述の :ref:" +"`string-methods` 節を参照してください。\n" +"書式化した文字列の出力については、:ref:`f-strings` と :ref:`formatstrings` の" +"節を参照してください。\n" +"また、:ref:`stringservices` 節も参照してください。" #: ../../builtins/stdtypes.rst:2110 msgid "String Methods" @@ -3658,7 +3868,6 @@ msgstr "" "文字列の casefold されたコピーを返します。casefold された文字列は、大文字小文" "字に関係ないマッチに使えます。" -#: ../../builtins/stdtypes.rst:2144 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -3666,30 +3875,44 @@ msgid "" "already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:" "`casefold` converts it to ``\"ss\"``. For example:" msgstr "" +"casefold は小文字化に似ていますが、文字列内の大文字と小文字の区別をすべて取り" +"除くことを目的とするため、より徹底した変換を行います。\n" +"例えば、ドイツ語の小文字 ``'ß'`` は ``\"ss\"`` と等価です。\n" +"``'ß'`` はすでに小文字なので :meth:`lower` では変わりませんが、:meth:" +"`casefold` では ``\"ss\"`` に変換されます。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2151 msgid "" ">>> 'straße'.lower()\n" "'straße'\n" ">>> 'straße'.casefold()\n" "'strasse'" msgstr "" +">>> 'straße'.lower()\n" +"'straße'\n" +">>> 'straße'.casefold()\n" +"'strasse'" -#: ../../builtins/stdtypes.rst:2158 msgid "" "The casefolding algorithm is `described in section 3.13.3 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" +"casefold のアルゴリズムは `Unicode 標準の3.13.3節「Default Case Folding」 " +"`__ に記載されています。" -#: ../../builtins/stdtypes.rst:2167 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``. For example::" msgstr "" +"長さ ``width`` の文字列の中央に配置して返します。\n" +"パディングには指定された ``fillchar`` (デフォルトは ASCII スペース) を使いま" +"す。\n" +"``width`` が ``len(s)`` 以下の場合は元の文字列を返します。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:2171 msgid "" ">>> 'Python'.center(10)\n" "' Python '\n" @@ -3698,6 +3921,12 @@ msgid "" ">>> 'Python'.center(4)\n" "'Python'" msgstr "" +">>> 'Python'.center(10)\n" +"' Python '\n" +">>> 'Python'.center(10, '-')\n" +"'--Python--'\n" +">>> 'Python'.center(4)\n" +"'Python'" #: ../../builtins/stdtypes.rst:2181 msgid "" @@ -3715,7 +3944,6 @@ msgid "" "which is the length of the string plus one. For example::" msgstr "" -#: ../../builtins/stdtypes.rst:2188 msgid "" ">>> 'spam, spam, spam'.count('spam')\n" "3\n" @@ -3728,6 +3956,16 @@ msgid "" ">>> 'spam, spam, spam'.count('')\n" "17" msgstr "" +">>> 'spam, spam, spam'.count('spam')\n" +"3\n" +">>> 'spam, spam, spam'.count('spam', 5)\n" +"2\n" +">>> 'spam, spam, spam'.count('spam', 5, 10)\n" +"1\n" +">>> 'spam, spam, spam'.count('eggs')\n" +"0\n" +">>> 'spam, spam, spam'.count('')\n" +"17" #: ../../builtins/stdtypes.rst:2201 msgid "Return the string encoded to :class:`bytes`." @@ -3755,14 +3993,16 @@ msgstr "" "``'backslashreplace'`` と、そして :func:`codecs.register_error` で登録された" "名前です。詳しくは :ref:`error-handlers` を参照してください。" -#: ../../builtins/stdtypes.rst:2213 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used. For example::" msgstr "" +"パフォーマンス上の理由から、実際にエンコーディングエラーが発生した場合、:ref:" +"`devmode` が有効な場合、または :ref:`デバッグビルド ` を使ってい" +"る場合にのみ、``errors`` の値の妥当性を検査します。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:2219 msgid "" ">>> encoded_str_to_bytes = 'Python'.encode()\n" ">>> type(encoded_str_to_bytes)\n" @@ -3770,6 +4010,11 @@ msgid "" ">>> encoded_str_to_bytes\n" "b'Python'" msgstr "" +">>> encoded_str_to_bytes = 'Python'.encode()\n" +">>> type(encoded_str_to_bytes)\n" +"\n" +">>> encoded_str_to_bytes\n" +"b'Python'" #: ../../builtins/stdtypes.rst:2226 ../../builtins/stdtypes.rst:3972 msgid "Added support for keyword arguments." @@ -3792,7 +4037,6 @@ msgid "" "equivalent to ``str[start:end].endswith(suffix)``. For example::" msgstr "" -#: ../../builtins/stdtypes.rst:2242 msgid "" ">>> 'Python'.endswith('on')\n" "True\n" @@ -3803,12 +4047,18 @@ msgid "" ">>> 'Python is amazing'.endswith('is', 0, 9)\n" "True" msgstr "" +">>> 'Python'.endswith('on')\n" +"True\n" +">>> 'a tuple of suffixes'.endswith(('at', 'in'))\n" +"False\n" +">>> 'a tuple of suffixes'.endswith(('at', 'es'))\n" +"True\n" +">>> 'Python is amazing'.endswith('is', 0, 9)\n" +"True" -#: ../../builtins/stdtypes.rst:2251 msgid "See also :meth:`startswith` and :meth:`removesuffix`." -msgstr "" +msgstr ":meth:`startswith` と :meth:`removesuffix` も参照してください。" -#: ../../builtins/stdtypes.rst:2256 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -3823,8 +4073,19 @@ msgid "" "incremented by one regardless of how the character is represented when " "printed. For example::" msgstr "" +"すべてのタブ文字を、現在の列と指定されたタブサイズに応じて一つ以上のスペース" +"に置き換えた文字列のコピーを返します。\n" +"タブ位置は ``tabsize`` 文字ごとにあります (デフォルトは8で、列0、8、16などが" +"タブ位置になります)。\n" +"文字列を展開する際には、現在の列をゼロに設定し、文字列を1文字ずつ調べます。\n" +"文字がタブ (``\\t``) の場合、現在の列が次のタブ位置に達するまで、結果に一つ以" +"上のスペース文字を挿入します (タブ文字自体はコピーしません)。\n" +"文字が改行 (``\\n``) または復帰 (``\\r``) の場合、その文字をコピーして現在の" +"列をゼロに戻します。\n" +"それ以外の文字はそのままコピーし、表示したときの表現に関係なく現在の列を一つ" +"進めます。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:2269 msgid "" ">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" "'01 012 0123 01234'\n" @@ -3834,26 +4095,39 @@ msgid "" "01 012\n" "0123 01234" msgstr "" +">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" +"'01 012 0123 01234'\n" +">>> '01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"'01 012 0123 01234'\n" +">>> print('01\\t012\\n0123\\t01234'.expandtabs(4))\n" +"01 012\n" +"0123 01234" -#: ../../builtins/stdtypes.rst:2280 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found. For " "example::" msgstr "" +"スライス ``s[start:end]`` 内で部分文字列 ``sub`` が見つかる、文字列内の最小の" +"インデックスを返します。\n" +"省略可能な ``start`` と ``end`` 引数はスライス表記と同様に解釈されます。\n" +"``sub`` が見つからない場合は ``-1`` を返します。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:2285 msgid "" ">>> 'spam, spam, spam'.find('sp')\n" "0\n" ">>> 'spam, spam, spam'.find('sp', 5)\n" "6" msgstr "" +">>> 'spam, spam, spam'.find('sp')\n" +"0\n" +">>> 'spam, spam, spam'.find('sp', 5)\n" +"6" -#: ../../builtins/stdtypes.rst:2290 msgid "See also :meth:`rfind` and :meth:`index`." -msgstr "" +msgstr ":meth:`rfind` と :meth:`index` も参照してください。" #: ../../builtins/stdtypes.rst:2294 msgid "" @@ -3865,11 +4139,12 @@ msgstr "" "す。 *sub* が部分文字列であるかどうかのみを調べるには、 :keyword:`in` 演算子" "を使ってください::" -#: ../../builtins/stdtypes.rst:2298 msgid "" ">>> 'Py' in 'Python'\n" "True" msgstr "" +">>> 'Py' in 'Python'\n" +"True" #: ../../builtins/stdtypes.rst:2304 msgid "" @@ -3881,7 +4156,6 @@ msgid "" "the corresponding argument. For example:" msgstr "" -#: ../../builtins/stdtypes.rst:2311 msgid "" ">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" "'The sum of 1 + 2 is 3'\n" @@ -3890,6 +4164,12 @@ msgid "" ">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" "'Nobody expects the Spanish Inquisition!'" msgstr "" +">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"The sum of {a} + {b} is {answer}\".format(answer=1+2, a=1, b=2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" +"'Nobody expects the Spanish Inquisition!'" #: ../../builtins/stdtypes.rst:2320 msgid "" @@ -3935,13 +4215,14 @@ msgstr "" "ピーされず、直接使われます。これは例えば ``mapping`` が dict のサブクラスであ" "るときに便利です:" -#: ../../builtins/stdtypes.rst:2357 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found. For example:" msgstr "" +":meth:`~str.find` と同様ですが、部分文字列が見つからない場合は :exc:" +"`ValueError` を送出します。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2360 msgid "" ">>> 'spam, spam, spam'.index('spam')\n" "0\n" @@ -3952,20 +4233,31 @@ msgid "" " ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" msgstr "" +">>> 'spam, spam, spam'.index('spam')\n" +"0\n" +">>> 'spam, spam, spam'.index('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.index('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" -#: ../../builtins/stdtypes.rst:2371 msgid "See also :meth:`rindex`." -msgstr "" +msgstr ":meth:`rindex` も参照してください。" -#: ../../builtins/stdtypes.rst:2376 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " "alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c." "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``. For example:" msgstr "" +"文字列内のすべての文字が字母または数字で、かつ1文字以上ある場合は ``True`` " +"を、それ以外の場合は ``False`` を返します。\n" +"文字 ``c`` は、``c.isalpha()``、``c.isdecimal()``、``c.isdigit()``、``c." +"isnumeric()`` のいずれかが ``True`` を返す場合に字母または数字とみなされま" +"す。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2381 msgid "" ">>> 'abc123'.isalnum()\n" "True\n" @@ -3976,8 +4268,15 @@ msgid "" ">>> ' '.isalnum()\n" "False" msgstr "" +">>> 'abc123'.isalnum()\n" +"True\n" +">>> 'abc123!@#'.isalnum()\n" +"False\n" +">>> ''.isalnum()\n" +"False\n" +">>> ' '.isalnum()\n" +"False" -#: ../../builtins/stdtypes.rst:2395 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -3988,8 +4287,17 @@ msgid "" "the Unicode Standard `__. For example:" msgstr "" +"文字列内のすべての文字が字母で、かつ1文字以上ある場合は ``True`` を、それ以外" +"の場合は ``False`` を返します。\n" +"字母とは、Unicode 文字データベースで「Letter」と定義されている文字、すなわち" +"一般カテゴリのプロパティが \"Lm\"、\"Lt\"、\"Lu\"、\"Ll\"、\"Lo\" のいずれか" +"である文字です。\n" +"これは `Unicode 標準の4.10節「Letters, Alphabetic, and Ideographic」で定義さ" +"れている Alphabetic プロパティ `__ とは異なることに注意してくださ" +"い。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2404 msgid "" ">>> 'Letters and spaces'.isalpha()\n" "False\n" @@ -3999,27 +4307,37 @@ msgid "" "too\n" "True" msgstr "" +">>> 'Letters and spaces'.isalpha()\n" +"False\n" +">>> 'LettersOnly'.isalpha()\n" +"True\n" +">>> 'µ'.isalpha() # 非 ASCII 文字も字母とみなされる場合がある\n" +"True" -#: ../../builtins/stdtypes.rst:2413 msgid "See :ref:`unicode-properties`." -msgstr "" +msgstr ":ref:`unicode-properties` を参照してください。" -#: ../../builtins/stdtypes.rst:2418 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F. For example:" msgstr "" +"文字列が空であるか、文字列内のすべての文字が ASCII 文字である場合は ``True`` " +"を、それ以外の場合は ``False`` を返します。\n" +"ASCII 文字のコードポイントは U+0000-U+007F の範囲です。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2422 msgid "" ">>> 'ASCII characters'.isascii()\n" "True\n" ">>> 'µ'.isascii()\n" "False" msgstr "" +">>> 'ASCII characters'.isascii()\n" +"True\n" +">>> 'µ'.isascii()\n" +"False" -#: ../../builtins/stdtypes.rst:2434 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -4027,8 +4345,13 @@ msgid "" "INDIC DIGIT ZERO. Formally a decimal character is a character in the " "Unicode General Category \"Nd\". For example:" msgstr "" +"文字列内のすべての文字が10進数字で、かつ1文字以上ある場合は ``True`` を、それ" +"以外の場合は ``False`` を返します。\n" +"10進数字とは、U+0660 (ARABIC-INDIC DIGIT ZERO) のように10進数を構成するために" +"使える文字です。\n" +"厳密には、Unicode の一般カテゴリが \"Nd\" である文字を指します。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2441 msgid "" ">>> '0123456789'.isdecimal()\n" "True\n" @@ -4037,8 +4360,13 @@ msgid "" ">>> 'alphabetic'.isdecimal()\n" "False" msgstr "" +">>> '0123456789'.isdecimal()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # アラビア・インド数字の0から9\n" +"True\n" +">>> 'alphabetic'.isdecimal()\n" +"False" -#: ../../builtins/stdtypes.rst:2453 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -4048,6 +4376,14 @@ msgid "" "Kharosthi#Numerals>`__. Formally, a digit is a character that has the " "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" +"文字列内のすべての文字が数字で、かつ1文字以上ある場合は ``True`` を、それ以外" +"の場合は ``False`` を返します。\n" +"数字には10進数字と、互換文字である上付き数字のように特別な扱いが必要な数字が" +"含まれます。\n" +"これには、`カローシュティー数字 `__ のように10進数の構成には使えない数字も含まれます。\n" +"厳密には、プロパティ値 Numeric_Type=Digit または Numeric_Type=Decimal を持つ" +"文字を指します。" #: ../../builtins/stdtypes.rst:2461 ../../builtins/stdtypes.rst:2542 #: ../../builtins/stdtypes.rst:2559 ../../builtins/stdtypes.rst:2586 @@ -4060,7 +4396,6 @@ msgstr "" msgid "For example:" msgstr "例えば:" -#: ../../builtins/stdtypes.rst:2463 msgid "" ">>> '0123456789'.isdigit()\n" "True\n" @@ -4071,10 +4406,17 @@ msgid "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" msgstr "" +">>> '0123456789'.isdigit()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # アラビア・インド数字の0から9\n" +"True\n" +">>> '⅕'.isdigit() # 分数の5分の1\n" +"False\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" -#: ../../builtins/stdtypes.rst:2474 msgid "See also :meth:`isdecimal` and :meth:`isnumeric`." -msgstr "" +msgstr ":meth:`isdecimal` と :meth:`isnumeric` も参照してください。" #: ../../builtins/stdtypes.rst:2479 msgid "" @@ -4096,7 +4438,6 @@ msgstr "" msgid "Example: ::" msgstr "例: ::" -#: ../../builtins/stdtypes.rst:2488 msgid "" ">>> from keyword import iskeyword\n" "\n" @@ -4105,6 +4446,12 @@ msgid "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" msgstr "" +">>> from keyword import iskeyword\n" +"\n" +">>> 'hello'.isidentifier(), iskeyword('hello')\n" +"(True, False)\n" +">>> 'def'.isidentifier(), iskeyword('def')\n" +"(True, True)" #: ../../builtins/stdtypes.rst:2498 msgid "" @@ -4115,7 +4462,6 @@ msgstr "" "ある文字が 1 文字以上あるなら ``True`` を、そうでなければ ``False`` を返しま" "す。" -#: ../../builtins/stdtypes.rst:2504 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -4124,8 +4470,14 @@ msgid "" "characters are those with the property value Numeric_Type=Digit, " "Numeric_Type=Decimal or Numeric_Type=Numeric. For example:" msgstr "" +"文字列内のすべての文字が数を表す文字で、かつ1文字以上ある場合は ``True`` を、" +"それ以外の場合は ``False`` を返します。\n" +"数を表す文字には、数字や、U+2155 (VULGAR FRACTION ONE FIFTH) のように " +"Unicode の数値プロパティを持つすべての文字が含まれます。\n" +"厳密には、プロパティ値 Numeric_Type=Digit、Numeric_Type=Decimal、" +"Numeric_Type=Numeric のいずれかを持つ文字を指します。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2512 msgid "" ">>> '0123456789'.isnumeric()\n" "True\n" @@ -4136,26 +4488,38 @@ msgid "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" msgstr "" +">>> '0123456789'.isnumeric()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # アラビア・インド数字の0から9\n" +"True\n" +">>> '⅕'.isnumeric() # 分数の5分の1\n" +"True\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" -#: ../../builtins/stdtypes.rst:2523 msgid "See also :meth:`isdecimal` and :meth:`isdigit`." -msgstr "" +msgstr ":meth:`isdecimal` と :meth:`isdigit` も参照してください。" -#: ../../builtins/stdtypes.rst:2528 msgid "" "Return ``True`` if all characters in the string are printable, ``False`` if " "it contains at least one non-printable character." msgstr "" +"文字列内のすべての文字が表示可能な場合は ``True`` を、表示できない文字が一つ" +"でも含まれる場合は ``False`` を返します。" -#: ../../builtins/stdtypes.rst:2531 msgid "" "Here \"printable\" means the character is suitable for :func:`repr` to use " "in its output; \"non-printable\" means that :func:`repr` on built-in types " "will hex-escape the character. It has no bearing on the handling of strings " "written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" +"ここで「表示可能」とは、その文字を :func:`repr` の出力にそのまま使えることを" +"意味します。\n" +"「表示できない」とは、組み込み型に対する :func:`repr` がその文字を16進エス" +"ケープで表すことを意味します。\n" +":data:`sys.stdout` や :data:`sys.stderr` に書き出す文字列の扱いには関係ありま" +"せん。" -#: ../../builtins/stdtypes.rst:2536 msgid "" "The printable characters are those which in the Unicode character database " "(see :mod:`unicodedata`) have a general category in group Letter, Mark, " @@ -4163,18 +4527,25 @@ msgid "" "0x20. Nonprintable characters are those in group Separator or Other (Z or " "C), except the ASCII space." msgstr "" +"表示可能な文字は、Unicode 文字データベース (:mod:`unicodedata` を参照) で一般" +"カテゴリが Letter、Mark、Number、Punctuation、Symbol のグループ (L、M、N、P、" +"S) に属する文字と、ASCII スペース 0x20 です。\n" +"表示できない文字は、ASCII スペースを除く、Separator または Other のグループ " +"(Z、C) に属する文字です。" -#: ../../builtins/stdtypes.rst:2544 msgid "" ">>> ''.isprintable(), ' '.isprintable()\n" "(True, True)\n" ">>> '\\t'.isprintable(), '\\n'.isprintable()\n" "(False, False)" msgstr "" - -#: ../../builtins/stdtypes.rst:2551 +">>> ''.isprintable(), ' '.isprintable()\n" +"(True, True)\n" +">>> '\\t'.isprintable(), '\\n'.isprintable()\n" +"(False, False)" + msgid "See also :meth:`isspace`." -msgstr "" +msgstr ":meth:`isspace` も参照してください。" #: ../../builtins/stdtypes.rst:2556 msgid "" @@ -4184,7 +4555,6 @@ msgstr "" "文字列が空白文字だけからなり、かつ 1 文字以上ある場合には ``True`` を返し、そ" "うでない場合は ``False`` を返します。" -#: ../../builtins/stdtypes.rst:2561 msgid "" ">>> ''.isspace()\n" "False\n" @@ -4195,6 +4565,14 @@ msgid "" ">>> '\\u3000'.isspace() # IDEOGRAPHIC SPACE\n" "True" msgstr "" +">>> ''.isspace()\n" +"False\n" +">>> ' '.isspace()\n" +"True\n" +">>> '\\t\\n'.isspace() # タブと改行\n" +"True\n" +">>> '\\u3000'.isspace() # 全角スペース\n" +"True" msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" @@ -4205,9 +4583,8 @@ msgstr "" "(\"Seperator, space\") であるか、 双方向クラスが ``WS``、``B``、 ``S`` のい" "ずれかである場合、その文字は *空白文字(whitespace)* です。" -#: ../../builtins/stdtypes.rst:2577 msgid "See also :meth:`isprintable`." -msgstr "" +msgstr ":meth:`isprintable` も参照してください。" #: ../../builtins/stdtypes.rst:2582 msgid "" @@ -4221,7 +4598,6 @@ msgstr "" "にのみ続く場合には ``True`` を返します。そうでない場合は ``False`` を返しま" "す。" -#: ../../builtins/stdtypes.rst:2588 msgid "" ">>> 'Spam, Spam, Spam'.istitle()\n" "True\n" @@ -4230,10 +4606,15 @@ msgid "" ">>> 'SPAM, SPAM, SPAM'.istitle()\n" "False" msgstr "" +">>> 'Spam, Spam, Spam'.istitle()\n" +"True\n" +">>> 'spam, spam, spam'.istitle()\n" +"False\n" +">>> 'SPAM, SPAM, SPAM'.istitle()\n" +"False" -#: ../../builtins/stdtypes.rst:2597 msgid "See also :meth:`title`." -msgstr "" +msgstr ":meth:`title` も参照してください。" #: ../../builtins/stdtypes.rst:2602 msgid "" @@ -4244,25 +4625,31 @@ msgstr "" "ある文字が 1 文字以上あるなら ``True`` を、そうでなければ ``False`` を返しま" "す。" -#: ../../builtins/stdtypes.rst:2620 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " "*iterable*, including :class:`bytes` objects. The separator between " "elements is the string providing this method. For example:" msgstr "" +"``iterable`` 内の文字列を結合した文字列を返します。\n" +"``iterable`` に :class:`bytes` オブジェクトを含む文字列以外の値が一つでもある" +"場合は、:exc:`TypeError` が送出されます。\n" +"要素間の区切りには、このメソッドを呼び出す文字列を使います。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2625 msgid "" ">>> ', '.join(['spam', 'spam', 'spam'])\n" "'spam, spam, spam'\n" ">>> '-'.join('Python')\n" "'P-y-t-h-o-n'" msgstr "" +">>> ', '.join(['spam', 'spam', 'spam'])\n" +"'spam, spam, spam'\n" +">>> '-'.join('Python')\n" +"'P-y-t-h-o-n'" -#: ../../builtins/stdtypes.rst:2632 msgid "See also :meth:`split`." -msgstr "" +msgstr ":meth:`split` も参照してください。" #: ../../builtins/stdtypes.rst:2637 msgid "" @@ -4274,7 +4661,6 @@ msgstr "" "(デフォルトでは ASCII スペース) を使って行われます。 *width* が ``len(s)`` 以" "下ならば、元の文字列が返されます。" -#: ../../builtins/stdtypes.rst:2643 msgid "" ">>> 'Python'.ljust(10)\n" "'Python '\n" @@ -4283,29 +4669,39 @@ msgid "" ">>> 'Monty Python'.ljust(10, '.')\n" "'Monty Python'" msgstr "" +">>> 'Python'.ljust(10)\n" +"'Python '\n" +">>> 'Python'.ljust(10, '.')\n" +"'Python....'\n" +">>> 'Monty Python'.ljust(10, '.')\n" +"'Monty Python'" -#: ../../builtins/stdtypes.rst:2652 ../../builtins/stdtypes.rst:3199 msgid "See also :meth:`rjust`." -msgstr "" +msgstr ":meth:`rjust` も参照してください。" -#: ../../builtins/stdtypes.rst:2657 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase. For example:" msgstr "" +"大小文字の区別のある文字 [4]_ をすべて小文字に変換した文字列のコピーを返しま" +"す。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2660 msgid "" ">>> 'Lower Method Example'.lower()\n" "'lower method example'" msgstr "" +">>> 'Lower Method Example'.lower()\n" +"'lower method example'" -#: ../../builtins/stdtypes.rst:2665 msgid "" "The lowercasing algorithm used is `described in section 3.13.2 'Default Case " "Conversion' of the Unicode Standard `__." msgstr "" +"小文字化のアルゴリズムは `Unicode 標準の3.13.2節「Default Case Conversion」 " +"`__ に記載されています。" #: ../../builtins/stdtypes.rst:2672 msgid "" @@ -4320,13 +4716,16 @@ msgstr "" "除去されます。 *chars* 文字列は接頭辞ではなく、その値に含まれる文字の組み合わ" "せ全てがはぎ取られます::" -#: ../../builtins/stdtypes.rst:2677 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" msgstr "" +">>> ' spacious '.lstrip()\n" +"'spacious '\n" +">>> 'www.example.com'.lstrip('cmowz.')\n" +"'example.com'" #: ../../builtins/stdtypes.rst:2682 msgid "" @@ -4336,13 +4735,16 @@ msgstr "" "文字の集合全てではなく、指定した文字列そのものを接頭辞として削除するメソッド" "については、 :meth:`str.removeprefix` を参照してください。使用例::" -#: ../../builtins/stdtypes.rst:2685 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" msgstr "" +">>> 'Arthur: three!'.lstrip('Arthur: ')\n" +"'ee!'\n" +">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" +"'three!'" #: ../../builtins/stdtypes.rst:2694 msgid "" @@ -4362,17 +4764,20 @@ msgstr "" "文字列) を、Unicode 序数、(任意長の) 文字列、または ``None`` に対応づける辞書" "でなければなりません。このとき、文字で指定したキーは序数に変換されます。" -#: ../../builtins/stdtypes.rst:2701 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in *from* will be mapped to the " "character at the same position in *to*. If there is a third argument, it " "must be a string, whose characters will be mapped to ``None`` in the result." msgstr "" +"引数が二つの場合、どちらも同じ長さの文字列でなければなりません。\n" +"結果の辞書では、``from`` の各文字が ``to`` の同じ位置の文字にマップされま" +"す。\n" +"3番目の引数を指定する場合、その引数は文字列でなければならず、その各文字は結果" +"で ``None`` にマップされます。" -#: ../../builtins/stdtypes.rst:2708 msgid "*dict* can now be a :class:`frozendict`." -msgstr "" +msgstr "``dict`` に :class:`frozendict` を指定できるようになりました。" #: ../../builtins/stdtypes.rst:2713 msgid "" @@ -4386,7 +4791,6 @@ msgstr "" "す。もし区切れなければ、タプルには元の文字列そのものとその後ろに二つの空文字" "列が入ります。" -#: ../../builtins/stdtypes.rst:2720 msgid "" ">>> 'Monty Python'.partition(' ')\n" "('Monty', ' ', 'Python')\n" @@ -4395,95 +4799,123 @@ msgid "" ">>> 'Monty Python'.partition('-')\n" "('Monty Python', '', '')" msgstr "" +">>> 'Monty Python'.partition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".partition(' ')\n" +"('Monty', ' ', \"Python's Flying Circus\")\n" +">>> 'Monty Python'.partition('-')\n" +"('Monty Python', '', '')" -#: ../../builtins/stdtypes.rst:2729 msgid "See also :meth:`rpartition`." -msgstr "" +msgstr ":meth:`rpartition` も参照してください。" -#: ../../builtins/stdtypes.rst:2734 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string:" msgstr "" +"文字列が ``prefix`` で始まる場合は ``string[len(prefix):]`` を返します。\n" +"それ以外の場合は、元の文字列のコピーを返します:" -#: ../../builtins/stdtypes.rst:2738 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" msgstr "" +">>> 'TestHook'.removeprefix('Test')\n" +"'Hook'\n" +">>> 'BaseTestCase'.removeprefix('Test')\n" +"'BaseTestCase'" -#: ../../builtins/stdtypes.rst:2747 msgid "See also :meth:`removesuffix` and :meth:`startswith`." -msgstr "" +msgstr ":meth:`removesuffix` と :meth:`startswith` も参照してください。" -#: ../../builtins/stdtypes.rst:2752 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string:" msgstr "" +"文字列が ``suffix`` で終わり、かつ ``suffix`` が空でない場合は ``string[:-" +"len(suffix)]`` を返します。\n" +"それ以外の場合は、元の文字列のコピーを返します:" -#: ../../builtins/stdtypes.rst:2756 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" msgstr "" +">>> 'MiscTests'.removesuffix('Tests')\n" +"'Misc'\n" +">>> 'TmpDirMixin'.removesuffix('Tests')\n" +"'TmpDirMixin'" -#: ../../builtins/stdtypes.rst:2765 msgid "See also :meth:`removeprefix` and :meth:`endswith`." -msgstr "" +msgstr ":meth:`removeprefix` と :meth:`endswith` も参照してください。" -#: ../../builtins/stdtypes.rst:2770 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If *count* is given, only the first *count* occurrences are " "replaced. If *count* is not specified or ``-1``, then all occurrences are " "replaced. For example:" msgstr "" +"部分文字列 ``old`` のすべての出現箇所を ``new`` に置き換えた文字列のコピーを" +"返します。\n" +"``count`` を指定した場合は、先頭から ``count`` 個の出現箇所だけを置き換えま" +"す。\n" +"``count`` を指定しない場合や ``-1`` を指定した場合は、すべての出現箇所を置き" +"換えます。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2775 msgid "" ">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" "'eggs, eggs, eggs'\n" ">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" "'eggs, spam, spam'" msgstr "" +">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" +"'eggs, eggs, eggs'\n" +">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" +"'eggs, spam, spam'" #: ../../builtins/stdtypes.rst:2782 ../../builtins/stdtypes.rst:4079 msgid "*count* is now supported as a keyword argument." msgstr "*count* はキーワード引数として指定可能になりました。" -#: ../../builtins/stdtypes.rst:2788 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure. " "For example:" msgstr "" +"部分文字列 ``sub`` が ``s[start:end]`` に収まる位置で見つかる、文字列内の最大" +"のインデックスを返します。\n" +"省略可能な ``start`` と ``end`` 引数はスライス表記と同様に解釈されます。\n" +"見つからない場合は ``-1`` を返します。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2793 msgid "" ">>> 'spam, spam, spam'.rfind('sp')\n" "12\n" ">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" "6" msgstr "" +">>> 'spam, spam, spam'.rfind('sp')\n" +"12\n" +">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" +"6" -#: ../../builtins/stdtypes.rst:2800 msgid "See also :meth:`find` and :meth:`rindex`." -msgstr "" +msgstr ":meth:`find` と :meth:`rindex` も参照してください。" -#: ../../builtins/stdtypes.rst:2805 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found. For example:" msgstr "" +":meth:`rfind` と同様ですが、部分文字列 ``sub`` が見つからない場合は :exc:" +"`ValueError` を送出します。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2809 msgid "" ">>> 'spam, spam, spam'.rindex('spam')\n" "12\n" @@ -4494,10 +4926,17 @@ msgid "" " ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" msgstr "" +">>> 'spam, spam, spam'.rindex('spam')\n" +"12\n" +">>> 'spam, spam, spam'.rindex('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.rindex('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" -#: ../../builtins/stdtypes.rst:2820 msgid "See also :meth:`index` and :meth:`find`." -msgstr "" +msgstr ":meth:`index` と :meth:`find` も参照してください。" #: ../../builtins/stdtypes.rst:2825 msgid "" @@ -4509,7 +4948,6 @@ msgstr "" "指定された文字(デフォルトでは ASCII スペース)が使われます。 *width* が " "``len(s)`` 以下の場合、元の文字列が返されます。" -#: ../../builtins/stdtypes.rst:2831 msgid "" ">>> 'Python'.rjust(10)\n" "' Python'\n" @@ -4518,10 +4956,15 @@ msgid "" ">>> 'Monty Python'.rjust(10, '.')\n" "'Monty Python'" msgstr "" +">>> 'Python'.rjust(10)\n" +"' Python'\n" +">>> 'Python'.rjust(10, '.')\n" +"'....Python'\n" +">>> 'Monty Python'.rjust(10, '.')\n" +"'Monty Python'" -#: ../../builtins/stdtypes.rst:2840 msgid "See also :meth:`ljust` and :meth:`zfill`." -msgstr "" +msgstr ":meth:`ljust` と :meth:`zfill` も参照してください。" #: ../../builtins/stdtypes.rst:2845 msgid "" @@ -4535,7 +4978,6 @@ msgstr "" "す。もし区切れなければ、タプルには二つの空文字列とその後ろに元の文字列そのも" "のが入ります。" -#: ../../builtins/stdtypes.rst:2852 msgid "" ">>> 'Monty Python'.rpartition(' ')\n" "('Monty', ' ', 'Python')\n" @@ -4544,12 +4986,16 @@ msgid "" ">>> 'Monty Python'.rpartition('-')\n" "('', '', 'Monty Python')" msgstr "" +">>> 'Monty Python'.rpartition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".rpartition(' ')\n" +"(\"Monty Python's Flying\", ' ', 'Circus')\n" +">>> 'Monty Python'.rpartition('-')\n" +"('', '', 'Monty Python')" -#: ../../builtins/stdtypes.rst:2861 msgid "See also :meth:`partition`." -msgstr "" +msgstr ":meth:`partition` も参照してください。" -#: ../../builtins/stdtypes.rst:2866 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -4558,8 +5004,13 @@ msgid "" "the right, :meth:`rsplit` behaves like :meth:`split` which is described in " "detail below." msgstr "" +"区切り文字列として ``sep`` を使い、文字列内の単語のリストを返します。\n" +"``maxsplit`` を指定した場合は、*右端から* 最大 ``maxsplit`` 回分割します。\n" +"``sep`` を指定しない場合や ``None`` を指定した場合は、任意の :meth:`空白文字 " +"` の文字列を区切りとします。\n" +"右から分割する点を除いて、:meth:`rsplit` は後で詳しく説明する :meth:`split` " +"と同様に動作します。" -#: ../../builtins/stdtypes.rst:2876 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -4567,32 +5018,46 @@ msgid "" "The *chars* argument is not a suffix; rather, all combinations of its values " "are stripped. For example:" msgstr "" +"末尾の文字を除去した文字列のコピーを返します。\n" +"``chars`` 引数は、除去する文字の集合を指定する文字列です。\n" +"``chars`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで空白文" +"字を除去します。\n" +"``chars`` 引数を接尾辞として扱うのではなく、その値を構成する文字を組み合わせ" +"に関係なく除去します。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:2882 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" msgstr "" +">>> ' spacious '.rstrip()\n" +"' spacious'\n" +">>> 'mississippi'.rstrip('ipz')\n" +"'mississ'" -#: ../../builtins/stdtypes.rst:2889 msgid "" "See :meth:`removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" +"文字の集合に含まれる文字をすべて除去するのではなく、一つの接尾辞文字列を除去" +"するメソッドについては、:meth:`removesuffix` を参照してください。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:2892 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" msgstr "" +">>> 'Monty Python'.rstrip(' Python')\n" +"'M'\n" +">>> 'Monty Python'.removesuffix(' Python')\n" +"'Monty'" -#: ../../builtins/stdtypes.rst:2897 msgid "See also :meth:`strip`." -msgstr "" +msgstr ":meth:`strip` も参照してください。" #: ../../builtins/stdtypes.rst:2902 msgid "" @@ -4622,7 +5087,6 @@ msgstr "" "字で分割するには :func:`re.split` を使用します)。区切り文字を指定して空の文字" "列を分割すると、 ``['']`` を返します。" -#: ../../builtins/stdtypes.rst:2917 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -4633,8 +5097,15 @@ msgid "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" msgstr "" +">>> '1,2,3'.split(',')\n" +"['1', '2', '3']\n" +">>> '1,2,3'.split(',', maxsplit=1)\n" +"['1', '2,3']\n" +">>> '1,2,,3,'.split(',')\n" +"['1', '2', '', '3', '']\n" +">>> '1<>2<>3<4'.split('<>')\n" +"['1', '2', '3<4']" -#: ../../builtins/stdtypes.rst:2928 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive :meth:`whitespace ` are regarded " @@ -4643,8 +5114,15 @@ msgid "" "Consequently, splitting an empty string or a string consisting of just " "whitespace with a ``None`` separator returns ``[]``." msgstr "" +"``sep`` を指定しない場合や ``None`` を指定した場合は、別の分割アルゴリズムを" +"適用します。\n" +"連続する :meth:`空白文字 ` のまとまりを一つの区切りとみなしま" +"す。\n" +"文字列の先頭や末尾に空白文字があっても、結果の先頭や末尾に空文字列は含まれま" +"せん。\n" +"そのため、区切りとして ``None`` を使って空文字列や空白文字のみの文字列を分割" +"すると、``[]`` が返されます。" -#: ../../builtins/stdtypes.rst:2938 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -4653,14 +5131,20 @@ msgid "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" msgstr "" +">>> '1 2 3'.split()\n" +"['1', '2', '3']\n" +">>> '1 2 3'.split(maxsplit=1)\n" +"['1', '2 3']\n" +">>> ' 1 2 3 '.split()\n" +"['1', '2', '3']" -#: ../../builtins/stdtypes.rst:2947 msgid "" "If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only " "leading runs of consecutive whitespace are considered." msgstr "" +"``sep`` を指定しないか ``None`` を指定し、かつ ``maxsplit`` が ``0`` の場合" +"は、先頭の連続する空白文字だけを扱います。" -#: ../../builtins/stdtypes.rst:2952 msgid "" ">>> \"\".split(None, 0)\n" "[]\n" @@ -4669,10 +5153,15 @@ msgid "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" msgstr "" +">>> \"\".split(None, 0)\n" +"[]\n" +">>> \" \".split(None, 0)\n" +"[]\n" +">>> \" foo \".split(maxsplit=0)\n" +"['foo ']" -#: ../../builtins/stdtypes.rst:2961 msgid "See also :meth:`join` and :meth:`rsplit`." -msgstr "" +msgstr ":meth:`join` と :meth:`rsplit` も参照してください。" #: ../../builtins/stdtypes.rst:2969 msgid "" @@ -4802,13 +5291,16 @@ msgstr "``\\v`` と ``\\f`` が行境界のリストに追加されました。" msgid "For example::" msgstr "例えば::" -#: ../../builtins/stdtypes.rst:3008 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgstr "" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"['ab c', '', 'de fg', 'kl']\n" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " @@ -4819,25 +5311,31 @@ msgstr "" "このメソッドは空文字列に対して空のリストを返し、末尾に改行があっても余分な行" "を追加しません::" -#: ../../builtins/stdtypes.rst:3017 msgid "" ">>> \"\".splitlines()\n" "[]\n" ">>> \"One line\\n\".splitlines()\n" "['One line']" msgstr "" +">>> \"\".splitlines()\n" +"[]\n" +">>> \"One line\\n\".splitlines()\n" +"['One line']" #: ../../builtins/stdtypes.rst:3022 msgid "For comparison, ``split('\\n')`` gives::" msgstr "比較のために ``split('\\n')`` は以下のようになります::" -#: ../../builtins/stdtypes.rst:3024 msgid "" ">>> ''.split('\\n')\n" "['']\n" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" msgstr "" +">>> ''.split('\\n')\n" +"['']\n" +">>> 'Two lines\\n'.split('\\n')\n" +"['Two lines', '']" #: ../../builtins/stdtypes.rst:3032 msgid "" @@ -4851,7 +5349,6 @@ msgstr "" "ん。オプションの *start* があれば、その位置から判定を始めます。オプションの " "*end* があれば、その位置で比較を止めます。" -#: ../../builtins/stdtypes.rst:3039 msgid "" ">>> 'Python'.startswith('Py')\n" "True\n" @@ -4860,12 +5357,16 @@ msgid "" ">>> 'Python is amazing'.startswith('is', 7)\n" "True" msgstr "" +">>> 'Python'.startswith('Py')\n" +"True\n" +">>> 'a tuple of prefixes'.startswith(('at', 'a'))\n" +"True\n" +">>> 'Python is amazing'.startswith('is', 7)\n" +"True" -#: ../../builtins/stdtypes.rst:3048 msgid "See also :meth:`endswith` and :meth:`removeprefix`." -msgstr "" +msgstr ":meth:`endswith` と :meth:`removeprefix` も参照してください。" -#: ../../builtins/stdtypes.rst:3053 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -4873,65 +5374,82 @@ msgid "" "removing whitespace. The *chars* argument is not a prefix or suffix; rather, " "all combinations of its values are stripped." msgstr "" +"先頭と末尾の文字を除去した文字列のコピーを返します。\n" +"``chars`` 引数は、除去する文字の集合を指定する文字列です。\n" +"``chars`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで空白文" +"字を除去します。\n" +"``chars`` 引数を接頭辞や接尾辞として扱うのではなく、その値を構成する文字を組" +"み合わせに関係なく除去します。" -#: ../../builtins/stdtypes.rst:3059 msgid "Whitespace characters are defined by :meth:`str.isspace`." -msgstr "" +msgstr "空白文字は :meth:`str.isspace` で定義されています。" -#: ../../builtins/stdtypes.rst:3063 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" msgstr "" +">>> ' spacious '.strip()\n" +"'spacious'\n" +">>> 'www.example.com'.strip('cmowz.')\n" +"'example'" -#: ../../builtins/stdtypes.rst:3070 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " "string character that is not contained in the set of characters in *chars*. " "A similar action takes place on the trailing end." msgstr "" +"文字列の先頭と末尾の最も外側から、``chars`` 引数に含まれる文字を除去しま" +"す。\n" +"先頭では、``chars`` の文字の集合に含まれない文字に達するまで文字を除去しま" +"す。\n" +"末尾でも同様に処理します。" -#: ../../builtins/stdtypes.rst:3077 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" msgstr "" +">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" +">>> comment_string.strip('.#! ')\n" +"'Section 3.2.1 Issue #32'" -#: ../../builtins/stdtypes.rst:3083 msgid "See also :meth:`rstrip`." -msgstr "" +msgstr ":meth:`rstrip` も参照してください。" -#: ../../builtins/stdtypes.rst:3088 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. For example:" msgstr "" +"大文字を小文字に、小文字を大文字に変換した文字列のコピーを返します。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:3091 msgid "" ">>> 'Hello World'.swapcase()\n" "'hELLO wORLD'" msgstr "" +">>> 'Hello World'.swapcase()\n" +"'hELLO wORLD'" -#: ../../builtins/stdtypes.rst:3096 msgid "" "Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. " "For example:" msgstr "" +"``s.swapcase().swapcase() == s`` が常に成り立つとは限らないことに注意してくだ" +"さい。\n" +"例えば、次のようになります:" -#: ../../builtins/stdtypes.rst:3099 msgid "" ">>> 'straße'.swapcase().swapcase()\n" "'strasse'" msgstr "" +">>> 'straße'.swapcase().swapcase()\n" +"'strasse'" -#: ../../builtins/stdtypes.rst:3104 msgid "See also :meth:`str.lower` and :meth:`str.upper`." -msgstr "" +msgstr ":meth:`str.lower` と :meth:`str.upper` も参照してください。" #: ../../builtins/stdtypes.rst:3109 msgid "" @@ -4941,11 +5459,12 @@ msgstr "" "文字列を、単語ごとに大文字から始まり、残りの文字のうち大小文字の区別があるも" "のは全て小文字にする、タイトルケースにして返します。" -#: ../../builtins/stdtypes.rst:3114 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" msgstr "" +">>> 'Hello world'.title()\n" +"'Hello World'" #: ../../builtins/stdtypes.rst:3117 ../../builtins/stdtypes.rst:4607 msgid "" @@ -4959,11 +5478,12 @@ msgstr "" "アポストロフィが単語の境界になってしまい、望みの結果を得られない場合がありま" "す::" -#: ../../builtins/stdtypes.rst:3122 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> \"they're bill's friends from the UK\".title()\n" +"\"They'Re Bill'S Friends From The Uk\"" #: ../../builtins/stdtypes.rst:3125 msgid "" @@ -4979,7 +5499,6 @@ msgid "" "expressions::" msgstr "または、正規表現を使うことでアポストロフィに対応できます::" -#: ../../builtins/stdtypes.rst:3131 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4990,10 +5509,17 @@ msgid "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(r\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0).capitalize(),\n" +"... s)\n" +"...\n" +">>> titlecase(\"they're bill's friends.\")\n" +"\"They're Bill's Friends.\"" -#: ../../builtins/stdtypes.rst:3140 msgid "See also :meth:`istitle`." -msgstr "" +msgstr ":meth:`istitle` も参照してください。" #: ../../builtins/stdtypes.rst:3145 msgid "" @@ -5024,17 +5550,19 @@ msgstr "" "文字から文字への異なる形式のマッピングから変換マップを作成するために、 :meth:" "`str.maketrans` が使えます。" -#: ../../builtins/stdtypes.rst:3157 msgid "" "The following example uses a mapping to replace ``'a'`` with ``'X'``, " "``'b'`` with ``'Y'``, and delete ``'c'``:" msgstr "" +"次の例では、マッピングを使って ``'a'`` を ``'X'`` に、``'b'`` を ``'Y'`` に置" +"き換え、``'c'`` を削除します:" -#: ../../builtins/stdtypes.rst:3160 msgid "" ">>> 'abc123'.translate({ord('a'): 'X', ord('b'): 'Y', ord('c'): None})\n" "'XY123'" msgstr "" +">>> 'abc123'.translate({ord('a'): 'X', ord('b'): 'Y', ord('c'): None})\n" +"'XY123'" #: ../../builtins/stdtypes.rst:3165 msgid "" @@ -5057,54 +5585,58 @@ msgstr "" "含まなかったり、結果の文字の Unicode カテゴリが \"Lu\" ではなく例えば " "\"Lt\" (Letter, titlecase) などであったら、 ``False`` になりえます。" -#: ../../builtins/stdtypes.rst:3177 msgid "" "The uppercasing algorithm used is `described in section 3.13.2 'Default Case " "Conversion' of the Unicode Standard `__." msgstr "" +"大文字化のアルゴリズムは `Unicode 標準の3.13.2節「Default Case Conversion」 " +"`__ に記載されています。" -#: ../../builtins/stdtypes.rst:3184 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " "by inserting the padding *after* the sign character rather than before. The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -"長さが *width* になるよう ASCII ``'0'`` で左詰めした文字列のコピーを返しま" -"す。先頭が符号接頭辞 (``'+'``/``'-'``) だった場合、 ``'0'`` は符号の前ではな" -"く *後* に挿入されます。*width* が ``len(s)`` 以下の場合元の文字列を返しま" -"す。" +"長さが ``width`` になるよう、左側を ASCII ``'0'`` で埋めた文字列のコピーを返" +"します。\n" +"先頭に符号接頭辞 (``'+'``/``'-'``) がある場合は、符号文字の前ではなく *後* に" +"パディングを挿入します。\n" +"``width`` が ``len(s)`` 以下の場合は元の文字列を返します。" -#: ../../builtins/stdtypes.rst:3192 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" ">>> \"-42\".zfill(5)\n" "'-0042'" msgstr "" +">>> \"42\".zfill(5)\n" +"'00042'\n" +">>> \"-42\".zfill(5)\n" +"'-0042'" -#: ../../builtins/stdtypes.rst:3219 msgid "Formatted String Literals (f-strings)" -msgstr "" +msgstr "フォーマット済み文字列リテラル (f-string)" -#: ../../builtins/stdtypes.rst:3222 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" +"f-string 内の式で :keyword:`await` と :keyword:`async for` を使えるようになり" +"ました。" -#: ../../builtins/stdtypes.rst:3225 msgid "Added the debug specifier (``=``)" -msgstr "" +msgstr "デバッグ指定子 (``=``) を追加しました" -#: ../../builtins/stdtypes.rst:3227 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" +"f-string 内の式に対する多くの制限が取り除かれました。\n" +"特に、文字列の入れ子、コメント、バックスラッシュが使えるようになりました。" -#: ../../builtins/stdtypes.rst:3231 msgid "" "An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " "literal that is prefixed with ``f`` or ``F``. This type of string literal " @@ -5112,59 +5644,68 @@ msgid "" "*replacement fields*, which are delimited by curly brackets (``{}``). Each " "replacement field must contain an expression, optionally followed by:" msgstr "" +"接頭辞 ``f`` または ``F`` を付けた文字列リテラルを :dfn:`f-string` (正式に" +"は :dfn:`フォーマット済み文字列リテラル`) と呼びます。\n" +"この文字列リテラルでは、波括弧 (``{}``) で区切った *置換フィールド* に、任意" +"の Python 式の結果を埋め込めます。\n" +"各置換フィールドには式が必要で、その後に必要に応じて次のものを指定できます:" -#: ../../builtins/stdtypes.rst:3238 msgid "a *debug specifier* -- an equal sign (``=``);" -msgstr "" +msgstr "*デバッグ指定子* である等号 (``=``)。" -#: ../../builtins/stdtypes.rst:3239 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" +"*変換指定子* である ``!s``、``!r``、``!a`` のいずれか。\n" +"これと次の書式指定子は、どちらか一方または両方を指定できます。" -#: ../../builtins/stdtypes.rst:3240 msgid "a *format specifier* prefixed with a colon (``:``)." -msgstr "" +msgstr "コロン (``:``) を先頭に付けた *書式指定子*。" -#: ../../builtins/stdtypes.rst:3242 msgid "" "See the :ref:`Lexical Analysis section on f-strings ` for details " "on the syntax of these fields." msgstr "" +"これらのフィールドの構文について詳しくは、:ref:`字句解析の f-string に関する" +"節 ` を参照してください。" -#: ../../builtins/stdtypes.rst:3246 msgid "Debug specifier" -msgstr "" +msgstr "デバッグ指定子" -#: ../../builtins/stdtypes.rst:3250 msgid "" "If a debug specifier -- an equal sign (``=``) -- appears after the " "replacement field expression, the resulting f-string will contain the " "expression's source, the equal sign, and the value of the expression. This " "is often useful for debugging::" msgstr "" +"置換フィールドの式の後にデバッグ指定子である等号 (``=``) を付けると、結果の " +"f-string には式のソース、等号、式の値が含まれます。\n" +"これはデバッグに役立つことがよくあります。 ::" -#: ../../builtins/stdtypes.rst:3255 msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" "'number=14.3'" msgstr "" +">>> number = 14.3\n" +">>> f'{number=}'\n" +"'number=14.3'" -#: ../../builtins/stdtypes.rst:3259 msgid "" "Whitespace before, inside and after the expression, as well as whitespace " "after the equal sign, is significant --- it is retained in the result::" msgstr "" +"式の前後や内部の空白、および等号の後の空白には意味があり、そのまま結果に残り" +"ます。 ::" -#: ../../builtins/stdtypes.rst:3262 msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" msgstr "" +">>> f'{ number - 4 = }'\n" +"' number - 4 = 10.3'" -#: ../../builtins/stdtypes.rst:3267 msgid "Conversion specifier" -msgstr "" +msgstr "変換指定子" #: ../../builtins/stdtypes.rst:3269 msgid "" @@ -5172,44 +5713,44 @@ msgid "" "string using :func:`str`::" msgstr "" -#: ../../builtins/stdtypes.rst:3272 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" ">>> f'{one_third}'\n" "'1/3'" msgstr "" +">>> from fractions import Fraction\n" +">>> one_third = Fraction(1, 3)\n" +">>> f'{one_third}'\n" +"'1/3'" -#: ../../builtins/stdtypes.rst:3277 msgid "" "When a debug specifier but no format specifier is used, the default " "conversion instead uses :func:`repr`::" msgstr "" +"デバッグ指定子があり書式指定子がない場合、デフォルトの変換には代わりに :func:" +"`repr` を使います。 ::" -#: ../../builtins/stdtypes.rst:3280 msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" msgstr "" +">>> f'{one_third = }'\n" +"'one_third = Fraction(1, 3)'" -#: ../../builtins/stdtypes.rst:3283 msgid "" "The conversion can be specified explicitly using one of these specifiers:" -msgstr "" +msgstr "次のいずれかの指定子を使って、変換を明示的に指定できます:" -#: ../../builtins/stdtypes.rst:3285 msgid "``!s`` for :func:`str`" -msgstr "" +msgstr ":func:`str` に対しては ``!s``" -#: ../../builtins/stdtypes.rst:3286 msgid "``!r`` for :func:`repr`" -msgstr "" +msgstr ":func:`repr` に対しては ``!r``" -#: ../../builtins/stdtypes.rst:3287 msgid "``!a`` for :func:`ascii`" -msgstr "" +msgstr ":func:`ascii` に対しては ``!a``" -#: ../../builtins/stdtypes.rst:3291 msgid "" ">>> str(one_third)\n" "'1/3'\n" @@ -5226,12 +5767,24 @@ msgid "" ">>> f'{string = !a}'\n" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" msgstr "" +">>> str(one_third)\n" +"'1/3'\n" +">>> repr(one_third)\n" +"'Fraction(1, 3)'\n" +"\n" +">>> f'{one_third!s} is {one_third!r}'\n" +"'1/3 is Fraction(1, 3)'\n" +"\n" +">>> string = \"¡kočka 😸!\"\n" +">>> ascii(string)\n" +"\"'\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"\n" +"\n" +">>> f'{string = !a}'\n" +"\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" -#: ../../builtins/stdtypes.rst:3308 msgid "Format specifier" -msgstr "" +msgstr "書式指定子" -#: ../../builtins/stdtypes.rst:3310 msgid "" "After the expression has been evaluated, and possibly converted using an " "explicit conversion specifier, it is formatted using the :func:`format` " @@ -5240,8 +5793,13 @@ msgid "" "argument. The result of :func:`!format` is then used as the final value for " "the replacement field. For example::" msgstr "" +"式を評価し、明示的な変換指定子がある場合は変換を行った後、:func:`format` 関数" +"で書式化します。\n" +"置換フィールドにコロン (``:``) に続く *書式指定子* が含まれている場合、その指" +"定子を :func:`!format` の第2引数として渡します。\n" +":func:`!format` の結果を置換フィールドの最終的な値として使います。\n" +"例えば、次のようになります。 ::" -#: ../../builtins/stdtypes.rst:3317 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -5254,30 +5812,41 @@ msgid "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" msgstr "" +">>> from fractions import Fraction\n" +">>> one_third = Fraction(1, 3)\n" +">>> f'{one_third:.6f}'\n" +"'0.333333'\n" +">>> f'{one_third:_^+10}'\n" +"'___+1/3___'\n" +">>> f'{one_third!r:_^20}'\n" +"'___Fraction(1, 3)___'\n" +">>> f'{one_third = :~>10}~'\n" +"'one_third = ~~~~~~~1/3~'" -#: ../../builtins/stdtypes.rst:3331 msgid "Template String Literals (t-strings)" -msgstr "" +msgstr "テンプレート文字列リテラル (t-string)" -#: ../../builtins/stdtypes.rst:3333 msgid "" "A :dfn:`t-string` (formally a :dfn:`template string literal`) is a string " "literal that is prefixed with ``t`` or ``T``." msgstr "" +"接頭辞 ``t`` または ``T`` を付けた文字列リテラルを :dfn:`t-string` (正式に" +"は :dfn:`テンプレート文字列リテラル`) と呼びます。" -#: ../../builtins/stdtypes.rst:3336 msgid "" "These strings follow the same syntax and evaluation rules as :ref:`formatted " "string literals `, with the following differences:" msgstr "" +"これらの文字列は、次の点を除いて :ref:`フォーマット済み文字列リテラル " +"` と同じ構文と評価規則に従います:" -#: ../../builtins/stdtypes.rst:3340 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" +"テンプレート文字列リテラルを評価すると、``str`` オブジェクトの代わりに :" +"class:`string.templatelib.Template` オブジェクトが得られます。" -#: ../../builtins/stdtypes.rst:3343 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -5285,8 +5854,13 @@ msgid "" "up to code that processes the resulting :class:`~string.templatelib." "Template` object to decide how to handle format specifiers and conversions." msgstr "" +":func:`format` プロトコルは使われません。\n" +"代わりに、評価した式ごとに新しい :class:`~string.templatelib.Interpolation` " +"オブジェクトが作成され、書式指定子や変換の指定があれば、そのオブジェクトに渡" +"されます。\n" +"書式指定子と変換をどのように扱うかは、結果の :class:`~string.templatelib." +"Template` オブジェクトを処理するコードが決めます。" -#: ../../builtins/stdtypes.rst:3350 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -5295,8 +5869,12 @@ msgid "" "determine the value of the ``format_spec`` attribute. If ``precision`` were " "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" +"入れ子になった置換フィールドを含む書式指定子は、:class:`~string.templatelib." +"Interpolation` オブジェクトに渡される前に即座に評価されます。\n" +"例えば、``{amount:.{precision}f}`` 形式の補間では、内部の式 ``{precision}`` " +"を評価して ``format_spec`` 属性の値を決めます。\n" +"``precision`` が ``2`` なら、結果の書式指定子は ``'.2f'`` になります。" -#: ../../builtins/stdtypes.rst:3358 msgid "" "When the equals sign ``'='`` is provided in an interpolation expression, the " "text of the expression is appended to the literal string that precedes the " @@ -5307,25 +5885,38 @@ msgid "" "conversion or format specifier is provided, this will override the default " "behaviour." msgstr "" +"補間式に等号 ``'='`` を指定すると、その式のテキストが、対応する補間の直前のリ" +"テラル文字列に追加されます。\n" +"これには等号とその周囲の空白も含まれます。\n" +"その式に対する :class:`!Interpolation` インスタンスは通常どおり作成されます" +"が、:attr:`~string.templatelib.Interpolation.conversion` はデフォルトで " +"'``r``' (:func:`repr`) に設定されます。\n" +"変換や書式指定子を明示的に指定した場合は、このデフォルトの動作が上書きされま" +"す。" #: ../../builtins/stdtypes.rst:3372 msgid "``printf``-style String Formatting" msgstr "``printf`` 形式の文字列書式化" -#: ../../builtins/stdtypes.rst:3385 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " "dictionaries correctly)." msgstr "" +"ここで説明する書式化演算にはさまざまな癖があり、タプルや辞書を正しく表示でき" +"ないなど、よくある誤りの原因となります。" -#: ../../builtins/stdtypes.rst:3389 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " "these alternatives provides their own trade-offs and benefits of simplicity, " "flexibility, and/or extensibility." msgstr "" +"これらの誤りは、:ref:`フォーマット済み文字列リテラル `、:meth:" +"`str.format` インターフェース、:class:`string.Template` を使うことで避けられ" +"る場合があります。\n" +"それぞれの方法には、簡潔さ、柔軟さ、拡張性の点で利点やトレードオフがありま" +"す。" #: ../../builtins/stdtypes.rst:3394 msgid "" @@ -5342,11 +5933,12 @@ msgstr "" "の ``%`` による変換の指定は0こ以上の *values* の要素で置き換えられます。この" "動作は C 言語における :c:func:`sprintf` 関数の利用方法に似ています。使用例:" -#: ../../builtins/stdtypes.rst:3401 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." msgstr "" +">>> print('%s has %d quote types.' % ('Python', 2))\n" +"Python has 2 quote types." #: ../../builtins/stdtypes.rst:3406 msgid "" @@ -5496,13 +6088,13 @@ msgstr "" "変換の先頭に符号文字 (``'+'`` または ``'-'``) を付けます(\"スペース\" フラグ" "を上書きします) 。" -#: ../../builtins/stdtypes.rst:3478 ../../builtins/stdtypes.rst:4780 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -"精度長変換子(``h``, ``l``,または ``L``) を使うことができますが、 Python では" -"必要ないため無視されます。 -- つまり、例えば ``%ld`` は ``%d`` と等価です。" +"長さ修飾子 (``h``、``l``、``L``) を指定しても構いませんが、Python では必要な" +"いため無視されます。\n" +"例えば、``%ld`` は ``%d`` と同じです。" #: ../../builtins/stdtypes.rst:3481 ../../builtins/stdtypes.rst:4783 msgid "The conversion types are:" @@ -5857,16 +6449,15 @@ msgstr "既存のバイナリデータからバッファプロトコルでコピ msgid "Also see the :ref:`bytes ` built-in." msgstr ":ref:`bytes ` ビルトイン関数も参照してください。" -#: ../../builtins/stdtypes.rst:3645 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " "Accordingly, the bytes type has an additional class method to read data in " "that format:" msgstr "" -"16 進数で 2 桁の数は正確に 1 バイトに相当するため、16 進整はバイナリデータを" -"表現する形式として広く使われています。 従って、 bytes 型にはその形式でデータ" -"を読み取るための追加のクラスメソッドがあります。" +"16進数字2桁がちょうど1バイトに対応するため、16進数はバイナリデータを表す形式" +"としてよく使われます。\n" +"そのため、bytes 型にはその形式のデータを読み取るクラスメソッドもあります:" #: ../../builtins/stdtypes.rst:3651 msgid "" @@ -5886,11 +6477,12 @@ msgstr "" ":meth:`bytes.fromhex` は文字列にある空白だけでなく、 ASCII の空白文字全てをス" "キップするようになりました。" -#: ../../builtins/stdtypes.rst:3662 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" +":meth:`bytes.fromhex` が入力として ASCII の :class:`bytes` および :term:" +"`bytes-like オブジェクト ` を受け付けるようになりました。" #: ../../builtins/stdtypes.rst:3666 msgid "" @@ -6003,23 +6595,25 @@ msgstr "" msgid "Also see the :ref:`bytearray ` built-in." msgstr ":ref:`bytearray ` ビルトイン関数も参照してください。" -#: ../../builtins/stdtypes.rst:3736 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " "Accordingly, the bytearray type has an additional class method to read data " "in that format:" msgstr "" -"16 進数で 2 桁の数は正確に 1 バイトに相当するため、16 進整はバイナリデータを" -"表現する形式として広く使われています。 従って、 bytearray 型にはその形式で" -"データを読み取るための追加のクラスメソッドがあります。" +"16進数字2桁がちょうど1バイトに対応するため、16進数はバイナリデータを表す形式" +"としてよく使われます。\n" +"そのため、bytearray 型にはその形式のデータを読み取るクラスメソッドもあります:" -#: ../../builtins/stdtypes.rst:3742 msgid "" "This :class:`bytearray` class method returns a bytearray object, decoding " "the given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" +"この :class:`bytearray` クラスメソッドは、指定された文字列オブジェクトをデ" +"コードした bytearray オブジェクトを返します。\n" +"文字列には1バイトにつき2桁の16進数字を含める必要があり、ASCII 空白文字は無視" +"されます。" #: ../../builtins/stdtypes.rst:3749 msgid "" @@ -6029,11 +6623,12 @@ msgstr "" ":meth:`bytearray.fromhex` は文字列にある空白だけでなく、 ASCII の空白文字全て" "をスキップするようになりました。" -#: ../../builtins/stdtypes.rst:3753 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" +":meth:`bytearray.fromhex` が入力として ASCII の :class:`bytes` および :term:" +"`bytes-like オブジェクト ` を受け付けるようになりました。" #: ../../builtins/stdtypes.rst:3757 msgid "" @@ -6053,16 +6648,18 @@ msgstr "" "分割するセパレータを挿入するためのオプションパラメータ *sep* と " "*bytes_per_sep* をサポートするようになりました。" -#: ../../builtins/stdtypes.rst:3778 msgid "" "Resize the :class:`bytearray` to contain *size* bytes. *size* must be " "greater than or equal to 0." msgstr "" +":class:`bytearray` のサイズを ``size`` バイトに変更します。\n" +"``size`` は0以上でなければなりません。" -#: ../../builtins/stdtypes.rst:3781 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" +":class:`bytearray` を縮小する場合は、``size`` を超える部分のバイトを切り捨て" +"ます。" #: ../../builtins/stdtypes.rst:3783 msgid "" @@ -6070,45 +6667,54 @@ msgid "" "will be set to null bytes." msgstr "" -#: ../../builtins/stdtypes.rst:3787 msgid "This is equivalent to:" -msgstr "" +msgstr "これは次と等価です:" #: ../../builtins/stdtypes.rst:3795 msgid "Examples:" msgstr "例:" -#: ../../builtins/stdtypes.rst:3810 msgid "" "Remove the first *n* bytes from the bytearray and return them as an " "immutable :class:`bytes`. By default (if *n* is ``None``), return all bytes " "and clear the bytearray." msgstr "" +"bytearray の先頭から ``n`` バイトを削除し、イミュータブルな :class:`bytes` と" +"して返します。\n" +"デフォルトでは (``n`` が ``None`` の場合)、すべてのバイトを返し、bytearray を" +"空にします。" -#: ../../builtins/stdtypes.rst:3814 msgid "" "If *n* is negative, index from the end and take the first :func:`len` plus " "*n* bytes. If *n* is out of bounds, raise :exc:`IndexError`." msgstr "" +"``n`` が負の場合は末尾から数え、先頭から :func:`len` と ``n`` の和のバイト数" +"を取り出します。\n" +"``n`` が範囲外の場合は :exc:`IndexError` を送出します。" -#: ../../builtins/stdtypes.rst:3817 msgid "" "Taking less than the full length will leave remaining bytes in the :class:" "`bytearray`, which requires a copy. If the remaining bytes should be " "discarded, use :func:`~bytearray.resize` or :keyword:`del` to truncate then :" "func:`~bytearray.take_bytes` without a size." msgstr "" +"全体の長さより少ないバイト数を取り出す場合は、:class:`bytearray` にバイトが残" +"るため、コピーが必要です。\n" +"残りのバイトを破棄する場合は、:func:`~bytearray.resize` または :keyword:" +"`del` で切り詰めてから、サイズを指定せず :func:`~bytearray.take_bytes` を使っ" +"てください。" -#: ../../builtins/stdtypes.rst:3824 msgid "Taking all bytes is a zero-copy operation." -msgstr "" +msgstr "すべてのバイトを取り出す操作ではコピーが行われません。" -#: ../../builtins/stdtypes.rst:3828 msgid "" "See the :ref:`What's New ` entry for " "common code patterns which can be optimized with :meth:`bytearray." "take_bytes`." msgstr "" +":meth:`bytearray.take_bytes` によって最適化できる一般的なコードパターンについ" +"ては、:ref:`新機能の紹介 ` を参照してくださ" +"い。" #: ../../builtins/stdtypes.rst:3832 msgid "" @@ -6134,11 +6740,12 @@ msgstr "" "ためです。\n" "bytearray オブジェクトはいつでも ``list(b)`` で整数のリストに変換できます。" -#: ../../builtins/stdtypes.rst:3844 msgid "" "For detailed information on thread-safety guarantees for :class:`bytearray` " "objects, see :ref:`thread-safety-bytearray`." msgstr "" +":class:`bytearray` オブジェクトのスレッドセーフ性の保証については、:ref:" +"`thread-safety-bytearray` を参照してください。" #: ../../builtins/stdtypes.rst:3851 msgid "Bytes and Bytearray Operations" @@ -6169,31 +6776,32 @@ msgstr "" "と bytearray オブジェクトのメソッドは引数として文字列を受け付けません。例え" "ば、以下のように書かなければなりません::" -#: ../../builtins/stdtypes.rst:3868 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" msgstr "" +"a = \"abc\"\n" +"b = a.replace(\"a\", \"f\")" #: ../../builtins/stdtypes.rst:3871 msgid "and::" msgstr "および::" -#: ../../builtins/stdtypes.rst:3873 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" msgstr "" +"a = b\"abc\"\n" +"b = a.replace(b\"a\", b\"f\")" -#: ../../builtins/stdtypes.rst:3876 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -"いくつかの bytes と bytearray の操作は ASCII と互換性のあるバイナリフォーマッ" -"トが使われていると仮定していますので、フォーマットの不明なバイナリデータに対" -"して使うことは避けるべきです。こうした制約については以下で説明します。" +"bytes と bytearray の一部の操作は、ASCII 互換のバイナリ形式を前提としているた" +"め、任意のバイナリデータを扱う際には避けるべきです。\n" +"これらの制約については後述します。" #: ../../builtins/stdtypes.rst:3881 msgid "" @@ -6255,13 +6863,16 @@ msgstr "" "バリナリーデータが文字列 *prefix* で始まる場合、 ``bytes[len(prefix):]`` を" "返します。それ以外の場合、元のバイナリーデータのコピーを返します::" -#: ../../builtins/stdtypes.rst:3911 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" msgstr "" +">>> b'TestHook'.removeprefix(b'Test')\n" +"b'Hook'\n" +">>> b'BaseTestCase'.removeprefix(b'Test')\n" +"b'BaseTestCase'" #: ../../builtins/stdtypes.rst:3916 msgid "The *prefix* may be any :term:`bytes-like object`." @@ -6293,13 +6904,16 @@ msgstr "" "``bytes[:-len(suffix)]`` を返します。それ以外の場合、元のバイナリーデータのコ" "ピーを返します::" -#: ../../builtins/stdtypes.rst:3933 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" msgstr "" +">>> b'MiscTests'.removesuffix(b'Tests')\n" +"b'Misc'\n" +">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" +"b'TmpDirMixin'" #: ../../builtins/stdtypes.rst:3938 msgid "The *suffix* may be any :term:`bytes-like object`." @@ -6381,11 +6995,12 @@ msgstr "" "す。 *sub* が部分文字列 (訳注: おそらく原文の誤り、正しくは部分シーケンス) で" "あるかどうかのみを調べるには、 :keyword:`in` 演算子を使ってください::" -#: ../../builtins/stdtypes.rst:4008 msgid "" ">>> b'Py' in b'Python'\n" "True" msgstr "" +">>> b'Py' in b'Python'\n" +"True" #: ../../builtins/stdtypes.rst:4018 msgid "" @@ -6410,17 +7025,17 @@ msgstr "" "が送出されます。なお要素間のセパレータは、このメソッドを提供する bytes また" "は bytearray オブジェクトとなります。" -#: ../../builtins/stdtypes.rst:4042 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " "same position in *to*; *from* and *to* must both be :term:`bytes-like " "objects ` and have the same length." msgstr "" -"この静的メソッドは、 :func:`bytes.translate` に渡すのに適した変換テーブルを返" -"します。このテーブルは、 *from* 中の各バイトを *to* の同じ位置にあるバイトに" -"マッピングします。 *from* と *to* は両方とも同じ長さの :term:`bytes-like " -"objects ` でなければなりません。" +"この静的メソッドは、:meth:`bytes.translate` に使える変換テーブルを返しま" +"す。\n" +"このテーブルは ``from`` の各文字を ``to`` の同じ位置の文字にマップします。\n" +"``from`` と ``to`` は両方とも :term:`bytes-like オブジェクト ` で、同じ長さでなければなりません。" #: ../../builtins/stdtypes.rst:4053 msgid "" @@ -6441,13 +7056,18 @@ msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" "検索する区切りとしては、任意の :term:`bytes-like object` を指定できます。" -#: ../../builtins/stdtypes.rst:4066 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If *count* is given, only the first *count* occurrences " "are replaced. If *count* is not specified or ``-1``, then all occurrences " "are replaced." msgstr "" +"部分シーケンス ``old`` のすべての出現箇所を ``new`` に置き換えたシーケンスの" +"コピーを返します。\n" +"``count`` を指定した場合は、先頭から ``count`` 個の出現箇所だけを置き換えま" +"す。\n" +"``count`` を指定しない場合や ``-1`` を指定した場合は、すべての出現箇所を置き" +"換えます。" #: ../../builtins/stdtypes.rst:4071 msgid "" @@ -6532,11 +7152,12 @@ msgid "" msgstr "" "文字を削除するだけの変換には、 *table* 引数を ``None`` に設定してください::" -#: ../../builtins/stdtypes.rst:4149 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" msgstr "" +">>> b'read this short text'.translate(None, b'aeiou')\n" +"b'rd ths shrt txt'" #: ../../builtins/stdtypes.rst:4152 msgid "*delete* is now supported as a keyword argument." @@ -6580,7 +7201,6 @@ msgstr "" "class:`bytes` オブジェクトの場合、 *width* が ``len(s)`` 以下なら元のシーケン" "スが返されます。" -#: ../../builtins/stdtypes.rst:4193 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -6588,14 +7208,23 @@ msgid "" "removing :meth:`ASCII whitespace `. The *bytes* argument is " "not a prefix; rather, all combinations of its values are stripped::" msgstr "" +"先頭から指定されたバイトを除去したシーケンスのコピーを返します。\n" +"``bytes`` 引数は、除去するバイト値の集合を指定するバイナリシーケンスです。\n" +"``bytes`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで :meth:" +"`ASCII 空白文字 ` を除去します。\n" +"``bytes`` 引数を接頭辞として扱うのではなく、その値を構成するバイトを組み合わ" +"せに関係なく除去します。 ::" -#: ../../builtins/stdtypes.rst:4200 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" msgstr "" +">>> b' spacious '.lstrip()\n" +"b'spacious '\n" +">>> b'www.example.com'.lstrip(b'cmowz.')\n" +"b'example.com'" #: ../../builtins/stdtypes.rst:4205 msgid "" @@ -6608,13 +7237,16 @@ msgstr "" "した文字列そのものを接頭辞として削除するメソッドについては、 :meth:`~bytes." "removeprefix` を参照してください。使用例::" -#: ../../builtins/stdtypes.rst:4210 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" msgstr "" +">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" +"b'ee!'\n" +">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" +"b'three!'" #: ../../builtins/stdtypes.rst:4224 msgid "" @@ -6628,7 +7260,6 @@ msgstr "" "class:`bytes` オブジェクトの場合、 *width* が ``len(s)`` 以下なら元のシーケン" "スが返されます。" -#: ../../builtins/stdtypes.rst:4238 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -6637,8 +7268,14 @@ msgid "" "a separator. Except for splitting from the right, :meth:`rsplit` behaves " "like :meth:`split` which is described in detail below." msgstr "" +"区切り文字列として ``sep`` を使い、バイナリシーケンスを同じ型の部分シーケンス" +"に分割します。\n" +"``maxsplit`` を指定した場合は、*右端から* 最大 ``maxsplit`` 回分割します。\n" +"``sep`` を指定しない場合や ``None`` を指定した場合は、:meth:`ASCII 空白文字 " +"` のみで構成される任意の部分シーケンスを区切りとします。\n" +"右から分割する点を除いて、:meth:`rsplit` は後で詳しく説明する :meth:`split` " +"と同様に動作します。" -#: ../../builtins/stdtypes.rst:4250 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -6646,14 +7283,23 @@ msgid "" "removing :meth:`ASCII whitespace `. The *bytes* argument is " "not a suffix; rather, all combinations of its values are stripped::" msgstr "" +"末尾から指定されたバイトを除去したシーケンスのコピーを返します。\n" +"``bytes`` 引数は、除去するバイト値の集合を指定するバイナリシーケンスです。\n" +"``bytes`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで :meth:" +"`ASCII 空白文字 ` を除去します。\n" +"``bytes`` 引数を接尾辞として扱うのではなく、その値を構成するバイトを組み合わ" +"せに関係なく除去します。 ::" -#: ../../builtins/stdtypes.rst:4257 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" msgstr "" +">>> b' spacious '.rstrip()\n" +"b' spacious'\n" +">>> b'mississippi'.rstrip(b'ipz')\n" +"b'mississ'" #: ../../builtins/stdtypes.rst:4262 msgid "" @@ -6666,13 +7312,16 @@ msgstr "" "した文字列そのものを接尾辞として削除するメソッドについては、 :meth:`~bytes." "removesuffix` を参照してください。使用例::" -#: ../../builtins/stdtypes.rst:4267 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" msgstr "" +">>> b'Monty Python'.rstrip(b' Python')\n" +"b'M'\n" +">>> b'Monty Python'.removesuffix(b' Python')\n" +"b'Monty'" #: ../../builtins/stdtypes.rst:4281 msgid "" @@ -6705,7 +7354,6 @@ msgstr "" "``[b'']`` または ``[bytearray(b'')]`` が返されます。\n" "*sep* には、任意の :term:`bytes-like object` を指定できます。" -#: ../../builtins/stdtypes.rst:4297 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -6716,8 +7364,15 @@ msgid "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" msgstr "" +">>> b'1,2,3'.split(b',')\n" +"[b'1', b'2', b'3']\n" +">>> b'1,2,3'.split(b',', maxsplit=1)\n" +"[b'1', b'2,3']\n" +">>> b'1,2,,3,'.split(b',')\n" +"[b'1', b'2', b'', b'3', b'']\n" +">>> b'1<>2<>3<4'.split(b'<>')\n" +"[b'1', b'2', b'3<4']" -#: ../../builtins/stdtypes.rst:4306 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive :meth:`ASCII whitespace ` are " @@ -6726,8 +7381,15 @@ msgid "" "Consequently, splitting an empty sequence or a sequence consisting solely of " "ASCII whitespace without a specified separator returns ``[]``." msgstr "" +"``sep`` を指定しない場合や ``None`` を指定した場合は、別の分割アルゴリズムを" +"適用します。\n" +"連続する :meth:`ASCII 空白文字 ` のまとまりを一つの区切りとみ" +"なします。\n" +"シーケンスの先頭や末尾に空白文字があっても、結果の先頭や末尾に空文字列は含ま" +"れません。\n" +"そのため、区切りを指定せずに空のシーケンスや ASCII 空白文字のみのシーケンスを" +"分割すると、``[]`` が返されます。" -#: ../../builtins/stdtypes.rst:4317 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -6736,8 +7398,13 @@ msgid "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" msgstr "" +">>> b'1 2 3'.split()\n" +"[b'1', b'2', b'3']\n" +">>> b'1 2 3'.split(maxsplit=1)\n" +"[b'1', b'2 3']\n" +">>> b' 1 2 3 '.split()\n" +"[b'1', b'2', b'3']" -#: ../../builtins/stdtypes.rst:4328 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *bytes* argument is a binary sequence specifying the set of " @@ -6746,14 +7413,23 @@ msgid "" "argument is not a prefix or suffix; rather, all combinations of its values " "are stripped::" msgstr "" +"先頭と末尾から指定されたバイトを除去したシーケンスのコピーを返します。\n" +"``bytes`` 引数は、除去するバイト値の集合を指定するバイナリシーケンスです。\n" +"``bytes`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで :meth:" +"`ASCII 空白文字 ` を除去します。\n" +"``bytes`` 引数を接頭辞や接尾辞として扱うのではなく、その値を構成するバイトを" +"組み合わせに関係なく除去します。 ::" -#: ../../builtins/stdtypes.rst:4336 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" msgstr "" +">>> b' spacious '.strip()\n" +"b'spacious'\n" +">>> b'www.example.com'.strip(b'cmowz.')\n" +"b'example'" #: ../../builtins/stdtypes.rst:4341 msgid "" @@ -6813,13 +7489,16 @@ msgstr "" "ト値の表示のされ方(訳注: 全角、半角など)に関わらず現桁位置を 1 つ増加させま" "す::" -#: ../../builtins/stdtypes.rst:4385 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" msgstr "" +">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" +"b'01 012 0123 01234'\n" +">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"b'01 012 0123 01234'" #: ../../builtins/stdtypes.rst:4399 msgid "" @@ -6835,13 +7514,16 @@ msgstr "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` に含まれるバイト" "値です。 ASCII 文字の数字とは ``b'0123456789'`` に含まれるバイト値です。" -#: ../../builtins/stdtypes.rst:4407 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" ">>> b'ABC abc1'.isalnum()\n" "False" msgstr "" +">>> b'ABCabc1'.isalnum()\n" +"True\n" +">>> b'ABC abc1'.isalnum()\n" +"False" #: ../../builtins/stdtypes.rst:4416 msgid "" @@ -6856,13 +7538,16 @@ msgstr "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` に含まれるバイト" "値です。" -#: ../../builtins/stdtypes.rst:4423 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" ">>> b'ABCabc1'.isalpha()\n" "False" msgstr "" +">>> b'ABCabc'.isalpha()\n" +"True\n" +">>> b'ABCabc1'.isalpha()\n" +"False" #: ../../builtins/stdtypes.rst:4432 msgid "" @@ -6883,13 +7568,16 @@ msgstr "" "``True`` を、そうでなければ ``False`` を返します。ここでの ASCII 文字の数字と" "は ``b'0123456789'`` に含まれるバイト値です。" -#: ../../builtins/stdtypes.rst:4448 msgid "" ">>> b'1234'.isdigit()\n" "True\n" ">>> b'1.23'.isdigit()\n" "False" msgstr "" +">>> b'1234'.isdigit()\n" +"True\n" +">>> b'1.23'.isdigit()\n" +"False" #: ../../builtins/stdtypes.rst:4457 msgid "" @@ -6900,13 +7588,16 @@ msgstr "" "ファベットの ASCII 文字が一つも無い場合に ``True`` を返します。そうでなけれ" "ば ``False`` を返します。" -#: ../../builtins/stdtypes.rst:4462 msgid "" ">>> b'hello world'.islower()\n" "True\n" ">>> b'Hello world'.islower()\n" "False" msgstr "" +">>> b'hello world'.islower()\n" +"True\n" +">>> b'Hello world'.islower()\n" +"False" #: ../../builtins/stdtypes.rst:4467 ../../builtins/stdtypes.rst:4509 #: ../../builtins/stdtypes.rst:4525 ../../builtins/stdtypes.rst:4575 @@ -6942,13 +7633,16 @@ msgstr "" "``True`` を、そうでなければ ``False`` を返します。「タイトルケース文字列」の" "定義については :meth:`bytes.title` を参照してください。" -#: ../../builtins/stdtypes.rst:4490 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" ">>> b'Hello world'.istitle()\n" "False" msgstr "" +">>> b'Hello World'.istitle()\n" +"True\n" +">>> b'Hello world'.istitle()\n" +"False" #: ../../builtins/stdtypes.rst:4499 msgid "" @@ -6960,13 +7654,16 @@ msgstr "" "ファベットの ASCII 文字が一つも無い場合に ``True`` を返します。そうでなけれ" "ば ``False`` を返します。" -#: ../../builtins/stdtypes.rst:4504 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" ">>> b'Hello world'.isupper()\n" "False" msgstr "" +">>> b'HELLO WORLD'.isupper()\n" +"True\n" +">>> b'Hello world'.isupper()\n" +"False" #: ../../builtins/stdtypes.rst:4517 msgid "" @@ -6976,11 +7673,12 @@ msgstr "" "シーケンスに含まれる大文字アルファベットの ASCII 文字を全て小文字アルファベッ" "トに変換したシーケンスのコピーを返します。" -#: ../../builtins/stdtypes.rst:4522 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" msgstr "" +">>> b'Hello World'.lower()\n" +"b'hello world'" #: ../../builtins/stdtypes.rst:4542 msgid "" @@ -6994,13 +7692,16 @@ msgstr "" "*keepends* 引数に真を与えた場合を除き、改行コードは結果のリストに含まれませ" "ん。" -#: ../../builtins/stdtypes.rst:4549 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgstr "" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"[b'ab c', b'', b'de fg', b'kl']\n" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " @@ -7011,36 +7712,41 @@ msgstr "" "このメソッドは空のシーケンスに対して空のリストを返し、末尾に改行があっても余" "分な行を追加しません::" -#: ../../builtins/stdtypes.rst:4558 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" msgstr "" +">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" +"([b''], [b'Two lines', b''])\n" +">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" +"([], [b'One line'])" -#: ../../builtins/stdtypes.rst:4567 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -"シーケンスに含まれる小文字アルファベットの ASCII 文字を全て大文字アルファベッ" -"トに変換し、さらに大文字アルファベットを同様に小文字アルファベットに変換した" -"シーケンスのコピーを返します。" +"シーケンス内の小文字の ASCII 文字を対応する大文字に、大文字の ASCII 文字を対" +"応する小文字に変換したコピーを返します。" -#: ../../builtins/stdtypes.rst:4572 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" msgstr "" +">>> b'Hello World'.swapcase()\n" +"b'hELLO wORLD'" -#: ../../builtins/stdtypes.rst:4579 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " "symmetrical in ASCII, even though that is not generally true for arbitrary " "Unicode code points." msgstr "" +":func:`str.swapcase` とは異なり、バイナリ版では ``bin.swapcase().swapcase() " +"== bin`` が常に成り立ちます。\n" +"任意の Unicode コードポイントについては一般に成り立ちませんが、ASCII では大文" +"字と小文字の変換が対称だからです。" #: ../../builtins/stdtypes.rst:4593 msgid "" @@ -7053,11 +7759,12 @@ msgstr "" "なっているシーケンスが返ります。大文字小文字の区別が無いバイト値については変" "更されずそのままになります。" -#: ../../builtins/stdtypes.rst:4599 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" msgstr "" +">>> b'Hello world'.title()\n" +"b'Hello World'" #: ../../builtins/stdtypes.rst:4602 msgid "" @@ -7071,18 +7778,18 @@ msgstr "" "に含まれるバイト値です。その他のバイト値については、大文字小文字の区別はあり" "ません。" -#: ../../builtins/stdtypes.rst:4612 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> b\"they're bill's friends from the UK\".title()\n" +"b\"They'Re Bill'S Friends From The Uk\"" #: ../../builtins/stdtypes.rst:4615 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "正規表現を使うことでアポストロフィに対応できます::" -#: ../../builtins/stdtypes.rst:4617 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -7094,6 +7801,15 @@ msgid "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(rb\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0)[0:1].upper() +\n" +"... mo.group(0)[1:].lower(),\n" +"... s)\n" +"...\n" +">>> titlecase(b\"they're bill's friends.\")\n" +"b\"They're Bill's Friends.\"" #: ../../builtins/stdtypes.rst:4636 msgid "" @@ -7103,13 +7819,13 @@ msgstr "" "シーケンスに含まれる小文字アルファベットの ASCII 文字を全て大文字アルファベッ" "トに変換したシーケンスのコピーを返します。" -#: ../../builtins/stdtypes.rst:4641 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" msgstr "" +">>> b'Hello World'.upper()\n" +"b'HELLO WORLD'" -#: ../../builtins/stdtypes.rst:4657 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -7117,18 +7833,23 @@ msgid "" "before. For :class:`bytes` objects, the original sequence is returned if " "*width* is less than or equal to ``len(seq)``." msgstr "" -"長さが *width* になるよう ASCII ``b'0'`` で左詰めしたシーケンスのコピーを返し" -"ます。先頭が符号接頭辞 (``b'+'``/``b'-'``) だった場合、 ``b'0'`` は符号の前で" -"はなく *後* に挿入されます。 :class:`bytes` オブジェクトの場合、 *width* が " -"``len(seq)`` 以下であれば元のシーケンスが返ります。" +"長さが ``width`` になるよう、左側を ASCII ``b'0'`` で埋めたシーケンスのコピー" +"を返します。\n" +"先頭に符号接頭辞 (``b'+'``/ ``b'-'``) がある場合は、符号文字の前ではなく *後" +"* にパディングを挿入します。\n" +":class:`bytes` オブジェクトの場合、``width`` が ``len(seq)`` 以下なら元のシー" +"ケンスを返します。" -#: ../../builtins/stdtypes.rst:4665 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" ">>> b\"-42\".zfill(5)\n" "b'-0042'" msgstr "" +">>> b\"42\".zfill(5)\n" +"b'00042'\n" +">>> b\"-42\".zfill(5)\n" +"b'-0042'" #: ../../builtins/stdtypes.rst:4679 msgid "``printf``-style Bytes Formatting" @@ -7145,7 +7866,6 @@ msgstr "" "ルや辞書を正しく表示できないなど)。もし表示する値がタプルや辞書かもしれない場" "合、それをタプルに包むようにしてください。" -#: ../../builtins/stdtypes.rst:4701 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -7154,6 +7874,12 @@ msgid "" "zero or more elements of *values*. The effect is similar to using the :c:" "func:`sprintf` function in the C language." msgstr "" +"bytes オブジェクト (``bytes``/``bytearray``) に固有の組み込み演算として、" +"``%`` 演算子 (剰余) があります。\n" +"これは、bytes の *書式化* 演算子または *補間* 演算子とも呼ばれます。\n" +"``format % values`` (ここで *format* は bytes オブジェクト) では、*format* 内" +"の ``%`` 変換指定が *values* の0個以上の要素に置き換えられます。\n" +"その効果は C 言語の :c:func:`sprintf` 関数の使用に似ています。" #: ../../builtins/stdtypes.rst:4708 msgid "" @@ -7279,18 +8005,21 @@ msgstr "" "`bytearray` では、要素は単バイトになりますが、他の :class:`array.array` 等の" "型では、要素はより大きくなりえます。" -#: ../../builtins/stdtypes.rst:4903 msgid "" ":class:`!memoryview`\\s are :ref:`generic ` over the type of their " "underlying data." msgstr "" +":class:`!memoryview` は元のデータの型について :ref:`ジェネリック ` " +"です。" -#: ../../builtins/stdtypes.rst:4906 msgid "" "``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which is " "the nested list representation of the view. If ``view.ndim == 1``, this is " "equal to the number of elements in the view." msgstr "" +"``len(view)`` は、ビューを入れ子のリストで表す :meth:`~memoryview.tolist` の" +"結果の長さと等しくなります。\n" +"``view.ndim == 1`` の場合、これはビュー内の要素数と等しくなります。" msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " @@ -7313,7 +8042,6 @@ msgstr "" ":class:`memoryview` はスライスおよびインデックス指定で内容を取得できます。一" "次元のスライスは部分ビューになります::" -#: ../../builtins/stdtypes.rst:4919 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -7325,6 +8053,15 @@ msgid "" ">>> bytes(v[1:4])\n" "b'bce'" msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> v[1]\n" +"98\n" +">>> v[-1]\n" +"103\n" +">>> v[1:4]\n" +"\n" +">>> bytes(v[1:4])\n" +"b'bce'" #: ../../builtins/stdtypes.rst:4929 msgid "" @@ -7348,7 +8085,6 @@ msgstr "" msgid "Here is an example with a non-byte format::" msgstr "``format`` が単バイト単位ではない例を示します::" -#: ../../builtins/stdtypes.rst:4940 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -7360,6 +8096,15 @@ msgid "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" msgstr "" +">>> import array\n" +">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" +">>> m = memoryview(a)\n" +">>> m[0]\n" +"-11111111\n" +">>> m[-1]\n" +"44444444\n" +">>> m[::2].tolist()\n" +"[-11111111, -33333333]" #: ../../builtins/stdtypes.rst:4950 msgid "" @@ -7369,7 +8114,6 @@ msgstr "" "メモリビューの参照しているオブジェクトが書き込み可能であれば、一次元スライス" "での代入が可能です。ただしサイズの変更はできません::" -#: ../../builtins/stdtypes.rst:4953 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -7390,6 +8134,24 @@ msgid "" ">>> data\n" "bytearray(b'z1spam')" msgstr "" +">>> data = bytearray(b'abcefg')\n" +">>> v = memoryview(data)\n" +">>> v.readonly\n" +"False\n" +">>> v[0] = ord(b'z')\n" +">>> data\n" +"bytearray(b'zbcefg')\n" +">>> v[1:4] = b'123'\n" +">>> data\n" +"bytearray(b'z123fg')\n" +">>> v[2:3] = b'spam'\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: memoryview assignment: lvalue and rvalue have different " +"structures\n" +">>> v[2:6] = b'spam'\n" +">>> data\n" +"bytearray(b'z1spam')" #: ../../builtins/stdtypes.rst:4971 msgid "" @@ -7401,7 +8163,6 @@ msgstr "" "み出し専用の) 型の1次元メモリビューもまた、ハッシュ可能です。ハッシュは " "``hash(m) == hash(m.tobytes())`` として定義されています::" -#: ../../builtins/stdtypes.rst:4975 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -7411,6 +8172,13 @@ msgid "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> hash(v) == hash(b'abcefg')\n" +"True\n" +">>> hash(v[2:4]) == hash(b'ce')\n" +"True\n" +">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" +"True" #: ../../builtins/stdtypes.rst:4983 msgid "" @@ -7429,13 +8197,11 @@ msgstr "" "memoryview は自動的に :class:`collections.abc.Sequence` へ登録されるようにな" "りました。" -#: ../../builtins/stdtypes.rst:4991 msgid "memoryviews can now be indexed with a tuple of integers." -msgstr "" +msgstr "整数のタプルで memoryview のインデックスを指定できるようになりました。" -#: ../../builtins/stdtypes.rst:4994 msgid "memoryview is now a :term:`generic type`." -msgstr "" +msgstr "memoryview が :term:`ジェネリック型 ` になりました。" #: ../../builtins/stdtypes.rst:4997 msgid ":class:`memoryview` has several methods:" @@ -7458,7 +8224,6 @@ msgstr "" ":meth:`tolist` がサポートしている :mod:`struct` フォーマットの一部では、 ``v." "tolist() == w.tolist()`` が成り立つときに ``v`` == ``w`` になります::" -#: ../../builtins/stdtypes.rst:5008 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -7476,6 +8241,21 @@ msgid "" ">>> z.tolist() == c.tolist()\n" "True" msgstr "" +">>> import array\n" +">>> a = array.array('I', [1, 2, 3, 4, 5])\n" +">>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])\n" +">>> c = array.array('b', [5, 3, 1])\n" +">>> x = memoryview(a)\n" +">>> y = memoryview(b)\n" +">>> x == a == y == b\n" +"True\n" +">>> x.tolist() == a.tolist() == y.tolist() == b.tolist()\n" +"True\n" +">>> z = y[::-2]\n" +">>> z == c\n" +"True\n" +">>> z.tolist() == c.tolist()\n" +"True" #: ../../builtins/stdtypes.rst:5024 msgid "" @@ -7487,7 +8267,6 @@ msgstr "" "(書式文字列とバッファの内容が同一でも) オブジェクトは常に等しくないものとして" "比較されます::" -#: ../../builtins/stdtypes.rst:5028 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -7501,6 +8280,17 @@ msgid "" ">>> a == b\n" "False" msgstr "" +">>> from ctypes import BigEndianStructure, c_long\n" +">>> class BEPoint(BigEndianStructure):\n" +"... _fields_ = [(\"x\", c_long), (\"y\", c_long)]\n" +"...\n" +">>> point = BEPoint(100, 200)\n" +">>> a = memoryview(point)\n" +">>> b = memoryview(point)\n" +">>> a == point\n" +"False\n" +">>> a == b\n" +"False" #: ../../builtins/stdtypes.rst:5040 msgid "" @@ -7526,7 +8316,6 @@ msgstr "" "バッファ中のデータをバイト文字列として返します。これはメモリビューに対して :" "class:`bytes` コンストラクタを呼び出すのと同等です。 ::" -#: ../../builtins/stdtypes.rst:5052 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -7534,6 +8323,11 @@ msgid "" ">>> bytes(m)\n" "b'abc'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.tobytes()\n" +"b'abc'\n" +">>> bytes(m)\n" +"b'abc'" #: ../../builtins/stdtypes.rst:5058 msgid "" @@ -7567,12 +8361,14 @@ msgid "" msgstr "" "バッファ内の各バイトを2桁の16進数字で表した文字列オブジェクトを返します。 ::" -#: ../../builtins/stdtypes.rst:5076 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" "'616263'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.hex()\n" +"'616263'" #: ../../builtins/stdtypes.rst:5082 msgid "" @@ -7588,7 +8384,6 @@ msgstr "" msgid "Return the data in the buffer as a list of elements. ::" msgstr "バッファ中のデータを要素のリストとして返します。 ::" -#: ../../builtins/stdtypes.rst:5091 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -7598,6 +8393,13 @@ msgid "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> memoryview(b'abc').tolist()\n" +"[97, 98, 99]\n" +">>> import array\n" +">>> a = array.array('d', [1.1, 2.2, 3.3])\n" +">>> m = memoryview(a)\n" +">>> m.tolist()\n" +"[1.1, 2.2, 3.3]" #: ../../builtins/stdtypes.rst:5099 msgid "" @@ -7615,7 +8417,6 @@ msgstr "" "読み込み専用のメモリビューオブジェクトを返します。元のメモリビューオブジェク" "トは変更されません。 ::" -#: ../../builtins/stdtypes.rst:5109 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -7629,6 +8430,17 @@ msgid "" ">>> mm.tolist()\n" "[43, 98, 99]" msgstr "" +">>> m = memoryview(bytearray(b'abc'))\n" +">>> mm = m.toreadonly()\n" +">>> mm.tolist()\n" +"[97, 98, 99]\n" +">>> mm[0] = 42\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot modify read-only memory\n" +">>> m[0] = 43\n" +">>> mm.tolist()\n" +"[43, 98, 99]" #: ../../builtins/stdtypes.rst:5125 msgid "" @@ -7651,7 +8463,6 @@ msgid "" "multiple times)::" msgstr "" -#: ../../builtins/stdtypes.rst:5135 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -7660,6 +8471,12 @@ msgid "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> m = memoryview(b'abc')\n" +">>> m.release()\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" #: ../../builtins/stdtypes.rst:5142 msgid "" @@ -7669,7 +8486,6 @@ msgstr "" "コンテキストマネージャプロトコルは、 ``with`` 文を使って同様の効果を得るのに" "使えます::" -#: ../../builtins/stdtypes.rst:5145 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -7680,6 +8496,14 @@ msgid "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> with memoryview(b'abc') as m:\n" +"... m[0]\n" +"...\n" +"97\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " @@ -7713,7 +8537,6 @@ msgstr "" msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "1次元 long から 1次元 unsigned byte へのキャスト::" -#: ../../builtins/stdtypes.rst:5173 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -7736,12 +8559,31 @@ msgid "" ">>> y.nbytes\n" "24" msgstr "" +">>> import array\n" +">>> a = array.array('l', [1,2,3])\n" +">>> x = memoryview(a)\n" +">>> x.format\n" +"'l'\n" +">>> x.itemsize\n" +"8\n" +">>> len(x)\n" +"3\n" +">>> x.nbytes\n" +"24\n" +">>> y = x.cast('B')\n" +">>> y.format\n" +"'B'\n" +">>> y.itemsize\n" +"1\n" +">>> len(y)\n" +"24\n" +">>> y.nbytes\n" +"24" #: ../../builtins/stdtypes.rst:5194 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "1次元 unsigned byte から 1次元 char へのキャスト::" -#: ../../builtins/stdtypes.rst:5196 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -7754,12 +8596,21 @@ msgid "" ">>> b\n" "bytearray(b'ayz')" msgstr "" +">>> b = bytearray(b'zyz')\n" +">>> x = memoryview(b)\n" +">>> x[0] = b'a'\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: memoryview: invalid type for format 'B'\n" +">>> y = x.cast('c')\n" +">>> y[0] = b'a'\n" +">>> b\n" +"bytearray(b'ayz')" #: ../../builtins/stdtypes.rst:5207 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "1次元 byte から 3次元 int へ、そして 1次元 signed char へのキャスト::" -#: ../../builtins/stdtypes.rst:5209 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -7785,12 +8636,34 @@ msgid "" ">>> z.nbytes\n" "48" msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('i', shape=[2,2,3])\n" +">>> y.tolist()\n" +"[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]\n" +">>> y.format\n" +"'i'\n" +">>> y.itemsize\n" +"4\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> z = y.cast('b')\n" +">>> z.format\n" +"'b'\n" +">>> z.itemsize\n" +"1\n" +">>> len(z)\n" +"48\n" +">>> z.nbytes\n" +"48" #: ../../builtins/stdtypes.rst:5233 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "1次元 unsigned long から 2次元 unsigned long へのキャスト::" -#: ../../builtins/stdtypes.rst:5235 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -7802,6 +8675,15 @@ msgid "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" msgstr "" +">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('L', shape=[2,3])\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> y.tolist()\n" +"[[0, 1, 2], [3, 4, 5]]" #: ../../builtins/stdtypes.rst:5247 msgid "The source format is no longer restricted when casting to a byte view." @@ -7809,19 +8691,18 @@ msgstr "" "単バイトのビューへキャストする場合、キャスト元のフォーマットについて制約は無" "くなりました。" -#: ../../builtins/stdtypes.rst:5252 msgid "Count the number of occurrences of *value*." -msgstr "" +msgstr "``value`` の出現回数を数えます。" -#: ../../builtins/stdtypes.rst:5258 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" +"``value`` が最初に出現する位置のインデックスを返します (インデックス " +"``start`` 以上、``stop`` 未満の範囲で検索します)。" -#: ../../builtins/stdtypes.rst:5261 msgid "Raises a :exc:`ValueError` if *value* cannot be found." -msgstr "" +msgstr "``value`` が見つからない場合は :exc:`ValueError` を送出します。" #: ../../builtins/stdtypes.rst:5265 msgid "There are also several readonly attributes available:" @@ -7831,24 +8712,26 @@ msgstr "読み出し専用の属性もいくつか使えます:" msgid "The underlying object of the memoryview::" msgstr "memoryview が参照しているオブジェクト::" -#: ../../builtins/stdtypes.rst:5271 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" ">>> m.obj is b\n" "True" msgstr "" +">>> b = bytearray(b'xyz')\n" +">>> m = memoryview(b)\n" +">>> m.obj is b\n" +"True" -#: ../../builtins/stdtypes.rst:5280 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -"``nbytes == product(shape) * itemsize == len(m.tobytes())``. その配列が連続表" -"現において利用するスペースです。これは ``len(m)`` と一致するとは限りません::" +"``nbytes == product(shape) * itemsize == len(m.tobytes())`` です。\n" +"これは、配列を連続した表現にした場合に使う領域のバイト数です。\n" +"``len(m)`` と等しいとは限りません。 ::" -#: ../../builtins/stdtypes.rst:5284 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -7865,13 +8748,37 @@ msgid "" ">>> len(y.tobytes())\n" "12" msgstr "" - -#: ../../builtins/stdtypes.rst:5299 -msgid "Multi-dimensional arrays::" -msgstr "多次元配列::" - -#: ../../builtins/stdtypes.rst:5301 -msgid "" +">>> import array\n" +">>> a = array.array('i', [1,2,3,4,5])\n" +">>> m = memoryview(a)\n" +">>> len(m)\n" +"5\n" +">>> m.nbytes\n" +"20\n" +">>> y = m[::2]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"12\n" +">>> len(y.tobytes())\n" +"12" + +#: ../../builtins/stdtypes.rst:5299 +msgid "Multi-dimensional arrays::" +msgstr "多次元配列::" + +msgid "" +">>> import struct\n" +">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('d', shape=[3,4])\n" +">>> y.tolist()\n" +"[[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"96" +msgstr "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" ">>> x = memoryview(buf)\n" @@ -7882,7 +8789,6 @@ msgid "" "3\n" ">>> y.nbytes\n" "96" -msgstr "" #: ../../builtins/stdtypes.rst:5316 msgid "A bool indicating whether the memory is read only." @@ -7912,7 +8818,6 @@ msgstr "" msgid "The size in bytes of each element of the memoryview::" msgstr "memoryview の各要素のバイト単位の大きさ::" -#: ../../builtins/stdtypes.rst:5333 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -7923,6 +8828,14 @@ msgid "" ">>> struct.calcsize('H') == m.itemsize\n" "True" msgstr "" +">>> import array, struct\n" +">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" +">>> m.itemsize\n" +"2\n" +">>> m[0]\n" +"32000\n" +">>> struct.calcsize('H') == m.itemsize\n" +"True" #: ../../builtins/stdtypes.rst:5344 msgid "" @@ -7974,17 +8887,18 @@ msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" "メモリーが連続しているかどうかを示す真偽値(参考: :term:`contiguous` )。" -#: ../../builtins/stdtypes.rst:5385 msgid "" "For information on the thread safety of :class:`memoryview` objects in the :" "term:`free-threaded build`, see :ref:`thread-safety-memoryview`." msgstr "" +":term:`フリースレッドビルド ` における :class:" +"`memoryview` オブジェクトのスレッドセーフ性については、:ref:`thread-safety-" +"memoryview` を参照してください。" #: ../../builtins/stdtypes.rst:5392 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "set(集合)型 --- :class:`set`, :class:`frozenset`" -#: ../../builtins/stdtypes.rst:5396 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -7994,6 +8908,13 @@ msgid "" "`collections` module.) See :ref:`time-complexity` for the costs of the " "various set operations." msgstr "" +":dfn:`集合 (set)` オブジェクトは、互いに異なる :term:`ハッシュ可能 " +"` なオブジェクトからなる順序を持たないコレクションです。\n" +"主な用途には、帰属判定、シーケンスからの重複の除去、積集合・和集合・差集合・" +"対称差といった数学的演算の計算があります。\n" +"(その他のコンテナについては、組み込みの :class:`dict`、:class:`list`、:class:" +"`tuple` クラス、および :mod:`collections` モジュールを参照してください。)\n" +"各種集合演算の計算量については、:ref:`time-complexity` を参照してください。" msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " @@ -8008,7 +8929,6 @@ msgstr "" "そのため、インデックス指定やスライスなど、シーケンスのような動作はサポートし" "ません。" -#: ../../builtins/stdtypes.rst:5409 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -8019,6 +8939,15 @@ msgid "" "it is created; it can therefore be used as a dictionary key or as an element " "of another set." msgstr "" +"現在、組み込みの集合型には :class:`set` と :class:`frozenset` の二つがありま" +"す。\n" +":class:`set` 型はミュータブルで、:meth:`~set.add` や :meth:`~set.remove` など" +"のメソッドで内容を変更できます。\n" +"ミュータブルなのでハッシュ値を持たず、辞書のキーにも別の集合の要素にも使えま" +"せん。\n" +":class:`frozenset` 型はイミュータブルで :term:`ハッシュ可能 ` で" +"す。\n" +"作成後に内容を変更できないため、辞書のキーや別の集合の要素として使えます。" #: ../../builtins/stdtypes.rst:5418 msgid "" @@ -8145,7 +9074,6 @@ msgstr "" msgid "Return a shallow copy of the set." msgstr "集合の浅いコピーを返します。" -#: ../../builtins/stdtypes.rst:5512 msgid "" "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:" "`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset." @@ -8155,6 +9083,14 @@ msgid "" "precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of " "the more readable ``set('abc').intersection('cbs')``." msgstr "" +"演算子を使わない :meth:`~frozenset.union`、:meth:`~frozenset.intersection`、:" +"meth:`~frozenset.difference`、:meth:`~frozenset.symmetric_difference`、:meth:" +"`~frozenset.issubset`、:meth:`~frozenset.issuperset` メソッドは、任意のイテラ" +"ブルを引数として受け付けます。\n" +"一方、対応する演算子を使う場合、引数は集合でなければなりません。\n" +"これにより、間違いを起こしやすい ``set('abc') & 'cbs'`` のような書き方ができ" +"なくなり、より読みやすい ``set('abc').intersection('cbs')`` を使うようになり" +"ます。" #: ../../builtins/stdtypes.rst:5519 msgid "" @@ -8209,15 +9145,15 @@ msgstr "" "集合の要素は、辞書のキーのように、 :term:`ハッシュ可能 ` でなければ" "なりません。" -#: ../../builtins/stdtypes.rst:5540 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -":class:`set` インスタンスと :class:`frozenset` インスタンスを取り混ぜての二項" -"演算は、第一被演算子の型を返します。例えば: ``frozenset('ab') | set('bc')`` " -"は :class:`frozenset` インスタンスを返します。" +":class:`set` と :class:`frozenset` のインスタンスを混在させた二項演算は、最初" +"のオペランドと同じ型のオブジェクトを返します。\n" +"例えば、``frozenset('ab') | set('bc')`` は :class:`frozenset` のインスタンス" +"を返します。" #: ../../builtins/stdtypes.rst:5544 msgid "" @@ -8272,12 +9208,14 @@ msgstr "" msgid "Remove all elements from the set." msgstr "set の全ての要素を取り除きます。" -#: ../../builtins/stdtypes.rst:5590 msgid "" "Note, the non-operator versions of the :meth:`~set.update`, :meth:`~set." "intersection_update`, :meth:`~set.difference_update`, and :meth:`~set." "symmetric_difference_update` methods will accept any iterable as an argument." msgstr "" +"演算子を使わない :meth:`~set.update`、:meth:`~set.intersection_update`、:" +"meth:`~set.difference_update`、:meth:`~set.symmetric_difference_update` メ" +"ソッドは、任意のイテラブルを引数として受け付けます。" #: ../../builtins/stdtypes.rst:5595 msgid "" @@ -8287,23 +9225,22 @@ msgid "" "*elem*." msgstr "" -#: ../../builtins/stdtypes.rst:5600 msgid "" "Sets and frozensets are :ref:`generic ` over the type of their " "elements." msgstr "" +"set と frozenset は要素の型について :ref:`ジェネリック ` です。" -#: ../../builtins/stdtypes.rst:5604 msgid "" "For detailed information on thread-safety guarantees for :class:`set` " "objects, see :ref:`thread-safety-set`." msgstr "" +":class:`set` オブジェクトのスレッドセーフ性の保証については、:ref:`thread-" +"safety-set` を参照してください。" -#: ../../builtins/stdtypes.rst:5611 msgid "Mapping types --- :class:`!dict`, :class:`!frozendict`" -msgstr "" +msgstr "マッピング型 --- :class:`!dict`、:class:`!frozendict`" -#: ../../builtins/stdtypes.rst:5621 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "There are currently two standard mapping types, the :dfn:`dictionary` and :" @@ -8312,6 +9249,13 @@ msgid "" "See :ref:`time-complexity` for the costs of the various dictionary " "operations." msgstr "" +":term:`マッピング ` オブジェクトは、:term:`ハッシュ可能 ` " +"な値を任意のオブジェクトに対応付けます。\n" +"現在、標準のマッピング型には :dfn:`辞書 (dictionary)` と :class:`frozendict` " +"の二つがあります。\n" +"(その他のコンテナについては、組み込みの :class:`list`、:class:`set`、:class:" +"`tuple` クラス、および :mod:`collections` モジュールを参照してください。)\n" +"各種辞書演算の計算量については、:ref:`time-complexity` を参照してください。" msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" @@ -8359,7 +9303,6 @@ msgstr "" "型コンストラクタを使う: ``dict()``, ``dict([('foo', 100), ('bar', 200)])``, " "``dict(foo=100, bar=200)``" -#: ../../builtins/stdtypes.rst:5652 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -8371,6 +9314,18 @@ msgid "" "corresponding value. If a key occurs more than once, the last value for " "that key becomes the corresponding value in the new dictionary." msgstr "" +"位置引数を指定しない場合は、空の辞書を作成します。\n" +"位置引数を指定し、そのオブジェクトに ``keys()`` メソッドが定義されている場合" +"は、そのメソッドが返す各キーを使って位置引数の :meth:`~object.__getitem__` を" +"呼び出し、辞書を作成します。\n" +"それ以外の場合、位置引数は :term:`イテラブル ` オブジェクトでなけれ" +"ばなりません。\n" +"そのイテラブル内の各要素も、それぞれちょうど二つの要素を持つイテラブルでなけ" +"ればなりません。\n" +"各要素の1番目の値が新しい辞書のキーとなり、2番目の値が対応する値となりま" +"す。\n" +"同じキーが複数回出現した場合は、そのキーの最後の値が新しい辞書での対応する値" +"となります。" #: ../../builtins/stdtypes.rst:5662 msgid "" @@ -8383,7 +9338,6 @@ msgstr "" "辞書に追加されます。既に存在しているキーが追加された場合、キーワード引数の値" "は位置引数の値を置き換えます。" -#: ../../builtins/stdtypes.rst:5667 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -8391,8 +9345,12 @@ msgid "" "equality, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" +"辞書同士は、順序に関係なく同じ ``(key, value)`` 対を持つ場合に限り等しいとみ" +"なされます。\n" +"順序比較 ('<'、'<='、'>='、'>') は :exc:`TypeError` を送出します。\n" +"辞書の作成と等価性を示す次の例は、すべて ``{\"one\": 1, \"two\": 2, " +"\"three\": 3}`` と等しい辞書を返します。 ::" -#: ../../builtins/stdtypes.rst:5673 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -8403,6 +9361,14 @@ msgid "" ">>> a == b == c == d == e == f\n" "True" msgstr "" +">>> a = dict(one=1, two=2, three=3)\n" +">>> b = {'one': 1, 'two': 2, 'three': 3}\n" +">>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n" +">>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n" +">>> e = dict({'three': 3, 'one': 1, 'two': 2})\n" +">>> f = dict({'one': 1, 'three': 3}, two=2)\n" +">>> a == b == c == d == e == f\n" +"True" #: ../../builtins/stdtypes.rst:5682 msgid "" @@ -8422,7 +9388,6 @@ msgstr "" "キーの更新は順序には影響が無いことに注意してください。\n" "いったん削除されてから再度追加されたキーは末尾に挿入されます。::" -#: ../../builtins/stdtypes.rst:5688 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -8439,6 +9404,20 @@ msgid "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(d)\n" +"['one', 'two', 'three', 'four']\n" +">>> list(d.values())\n" +"[1, 2, 3, 4]\n" +">>> d[\"one\"] = 42\n" +">>> d\n" +"{'one': 42, 'two': 2, 'three': 3, 'four': 4}\n" +">>> del d[\"two\"]\n" +">>> d[\"two\"] = None\n" +">>> d\n" +"{'one': 42, 'three': 3, 'four': 4, 'two': None}" #: ../../builtins/stdtypes.rst:5703 msgid "" @@ -8448,11 +9427,12 @@ msgstr "" "辞書の順序が挿入順序であることが保証されるようになりました。この振る舞いは " "CPython 3.6 の実装詳細でした。" -#: ../../builtins/stdtypes.rst:5707 msgid "" "Dictionaries are :ref:`generic ` over two types, signifying " "(respectively) the types of the dictionary's keys and values." msgstr "" +"辞書は、キーと値の型をそれぞれ表す二つの型について :ref:`ジェネリック " +"` です。" #: ../../builtins/stdtypes.rst:5710 msgid "" @@ -8478,7 +9458,6 @@ msgstr "" "*d* のキー *key* の項目を返します。マップに *key* が存在しなければ、 :exc:" "`KeyError` を送出します。" -#: ../../builtins/stdtypes.rst:5728 msgid "" "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " "is not present, the ``d[key]`` operation calls that method with the key " @@ -8488,8 +9467,17 @@ msgid "" "__missing__` is not defined, :exc:`KeyError` is raised. :meth:`~object." "__missing__` must be a method; it cannot be an instance variable::" msgstr "" +"dict のサブクラスに :meth:`~object.__missing__` メソッドが定義されていて " +"*key* が存在しない場合、``d[key]`` 演算はキー *key* を引数としてそのメソッド" +"を呼び出します。\n" +"``d[key]`` 演算は、``__missing__(key)`` の呼び出しが返す値をそのまま返し、送" +"出する例外をそのまま送出します。\n" +"それ以外の演算やメソッドは :meth:`~object.__missing__` を呼び出しません。\n" +":meth:`~object.__missing__` が定義されていない場合は :exc:`KeyError` が送出さ" +"れます。\n" +":meth:`~object.__missing__` はメソッドでなければならず、インスタンス変数には" +"できません。 ::" -#: ../../builtins/stdtypes.rst:5736 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -8502,13 +9490,25 @@ msgid "" ">>> c['red']\n" "1" msgstr "" +">>> class Counter(dict):\n" +"... def __missing__(self, key):\n" +"... return 0\n" +"...\n" +">>> c = Counter()\n" +">>> c['red']\n" +"0\n" +">>> c['red'] += 1\n" +">>> c['red']\n" +"1" -#: ../../builtins/stdtypes.rst:5747 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different :meth:`!__missing__` method is used by :class:" "`collections.defaultdict`." msgstr "" +"上の例は :class:`collections.Counter` の実装の一部を示しています。\n" +":class:`collections.defaultdict` では、異なる :meth:`!__missing__` メソッドを" +"使っています。" #: ../../builtins/stdtypes.rst:5754 msgid "Set ``d[key]`` to *value*." @@ -8649,13 +9649,14 @@ msgstr "" "*default* として *key* を挿入し、 *default* を返します。 *default* のデフォル" "トは ``None`` です。" -#: ../../builtins/stdtypes.rst:5845 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" +"``mapping`` または ``iterable`` と ``kwargs`` のキーと値の対で辞書を更新し、" +"既存のキーを上書きします。\n" +"``None`` を返します。" -#: ../../builtins/stdtypes.rst:5848 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -8663,6 +9664,13 @@ msgid "" "iterables of length two). If keyword arguments are specified, the dictionary " "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" +":meth:`update` は、``keys()`` メソッドを持つ別のオブジェクトか、キーと値の対" +"のイテラブル (各対はタプル、または長さ2のその他のイテラブル) を受け付けま" +"す。\n" +"前者の場合、そのメソッドが返す各キーを使って :meth:`~object.__getitem__` を呼" +"び出します。\n" +"キーワード引数を指定した場合は、続いてそれらのキーと値の対で辞書を更新しま" +"す: ``d.update(red=1, blue=2)``。" #: ../../builtins/stdtypes.rst:5856 msgid "" @@ -8682,12 +9690,14 @@ msgstr "" "が返ります。\n" "``dict.values()`` どうしを比較したときも同様です::" -#: ../../builtins/stdtypes.rst:5863 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" "False" msgstr "" +">>> d = {'a': 1}\n" +">>> d.values() == d.values()\n" +"False" msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " @@ -8713,7 +9723,6 @@ msgstr "" msgid "Dictionaries and dictionary views are reversible. ::" msgstr "辞書と辞書のビューは ``reversed()`` で順序を逆にすることができます::" -#: ../../builtins/stdtypes.rst:5885 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -8725,6 +9734,15 @@ msgid "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(reversed(d))\n" +"['four', 'three', 'two', 'one']\n" +">>> list(reversed(d.values()))\n" +"[4, 3, 2, 1]\n" +">>> list(reversed(d.items()))\n" +"[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" #: ../../builtins/stdtypes.rst:5895 msgid "Dictionaries are now reversible." @@ -8736,11 +9754,12 @@ msgid "" "create a read-only view of a :class:`dict`." msgstr "" -#: ../../builtins/stdtypes.rst:5905 msgid "" "For detailed information on thread-safety guarantees for :class:`dict` " "objects, see :ref:`thread-safety-dict`." msgstr "" +":class:`dict` オブジェクトのスレッドセーフ性の保証については、:ref:`thread-" +"safety-dict` を参照してください。" #: ../../builtins/stdtypes.rst:5912 msgid "Dictionary view objects" @@ -8856,7 +9875,6 @@ msgstr "" msgid "An example of dictionary view usage::" msgstr "辞書ビューの使用法の例::" -#: ../../builtins/stdtypes.rst:5976 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -8896,78 +9914,112 @@ msgid "" ">>> values.mapping['spam']\n" "500" msgstr "" +">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" +">>> keys = dishes.keys()\n" +">>> values = dishes.values()\n" +"\n" +">>> # 反復\n" +">>> n = 0\n" +">>> for val in values:\n" +"... n += val\n" +"...\n" +">>> print(n)\n" +"504\n" +"\n" +">>> # キーと値は同じ順序 (挿入順序) で反復される\n" +">>> list(keys)\n" +"['eggs', 'sausage', 'bacon', 'spam']\n" +">>> list(values)\n" +"[2, 1, 1, 500]\n" +"\n" +">>> # ビューオブジェクトは動的で、辞書の変更を反映する\n" +">>> del dishes['eggs']\n" +">>> del dishes['sausage']\n" +">>> list(keys)\n" +"['bacon', 'spam']\n" +"\n" +">>> # 集合演算\n" +">>> keys & {'eggs', 'bacon', 'salad'}\n" +"{'bacon'}\n" +">>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'}\n" +"True\n" +">>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'}\n" +"True\n" +"\n" +">>> # 元の辞書の読み出し専用プロキシを取得する\n" +">>> values.mapping\n" +"mappingproxy({'bacon': 1, 'spam': 500})\n" +">>> values.mapping['spam']\n" +"500" -#: ../../builtins/stdtypes.rst:6016 msgid "Frozen dictionaries" -msgstr "" +msgstr "凍結辞書" -#: ../../builtins/stdtypes.rst:6022 msgid "" "Return a new frozen dictionary initialized from an optional positional " "argument and a possibly empty set of keyword arguments." msgstr "" +"省略可能な位置引数と、空でもよいキーワード引数の集まりから初期化した、新しい" +"凍結辞書を返します。" -#: ../../builtins/stdtypes.rst:6025 msgid "" "A :class:`!frozendict` has a similar API to the :class:`dict` API, with the " "following differences:" msgstr "" +":class:`!frozendict` の API は :class:`dict` の API と似ていますが、次の点が" +"異なります:" -#: ../../builtins/stdtypes.rst:6028 msgid ":class:`!dict` has more methods than :class:`!frozendict`:" -msgstr "" +msgstr ":class:`!dict` は :class:`!frozendict` より多くのメソッドを持ちます:" -#: ../../builtins/stdtypes.rst:6030 msgid ":meth:`!__delitem__`" -msgstr "" +msgstr ":meth:`!__delitem__`" -#: ../../builtins/stdtypes.rst:6031 msgid ":meth:`!__setitem__`" -msgstr "" +msgstr ":meth:`!__setitem__`" -#: ../../builtins/stdtypes.rst:6032 msgid ":meth:`~dict.clear`" -msgstr "" +msgstr ":meth:`~dict.clear`" -#: ../../builtins/stdtypes.rst:6033 msgid ":meth:`~dict.pop`" -msgstr "" +msgstr ":meth:`~dict.pop`" -#: ../../builtins/stdtypes.rst:6034 msgid ":meth:`~dict.popitem`" -msgstr "" +msgstr ":meth:`~dict.popitem`" -#: ../../builtins/stdtypes.rst:6035 msgid ":meth:`~dict.setdefault`" -msgstr "" +msgstr ":meth:`~dict.setdefault`" -#: ../../builtins/stdtypes.rst:6036 msgid ":meth:`~dict.update`" -msgstr "" +msgstr ":meth:`~dict.update`" -#: ../../builtins/stdtypes.rst:6038 msgid "" "A :class:`!frozendict` can be hashed with ``hash(frozendict)`` if all keys " "and values can be hashed." msgstr "" +":class:`!frozendict` のすべてのキーと値がハッシュ可能であれば、" +"``hash(frozendict)`` でハッシュ値を計算できます。" -#: ../../builtins/stdtypes.rst:6041 msgid "" "``frozendict |= other`` does not modify the :class:`!frozendict` in-place " "but creates a new frozen dictionary." msgstr "" +"``frozendict |= other`` は :class:`!frozendict` をインプレースで変更せず、新" +"しい凍結辞書を作成します。" -#: ../../builtins/stdtypes.rst:6044 msgid "" ":class:`!frozendict` is not a :class:`!dict` subclass but inherits directly " "from ``object``." msgstr "" +":class:`!frozendict` は :class:`!dict` のサブクラスではなく、``object`` を直" +"接継承します。" -#: ../../builtins/stdtypes.rst:6047 msgid "" "Like dictionaries, frozendicts are :ref:`generic ` over two types, " "signifying (respectively) the types of the frozendict's keys and values." msgstr "" +"辞書と同様に、frozendict はキーと値の型をそれぞれ表す二つの型について :ref:`" +"ジェネリック ` です。" #: ../../builtins/stdtypes.rst:6052 msgid "" @@ -8992,16 +10044,16 @@ msgstr "" "文の終わりで脱出する実行時コンテキストを、ユーザ定義クラスが定義できるように" "する一対のメソッドで実装されます:" -#: ../../builtins/stdtypes.rst:6078 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " "to the identifier in the :keyword:`!as` clause of :keyword:`with` statements " "using this context manager." msgstr "" -"実行時コンテキストに入り、このオブジェクトまたは他の実行時コンテキストに関連" -"したオブジェクトを返します。このメソッドが返す値はこのコンテキストマネージャ" -"を使う :keyword:`with` 文の :keyword:`!as` 節の識別子に束縛されます。" +"実行時コンテキストに入り、このオブジェクト自体か、実行時コンテキストに関連す" +"る別のオブジェクトを返します。\n" +"このメソッドの返り値は、このコンテキストマネージャを使う :keyword:`with` 文" +"の :keyword:`!as` 節の識別子に束縛されます。" #: ../../builtins/stdtypes.rst:6083 msgid "" @@ -9042,20 +10094,24 @@ msgstr "" "合、引数にはその例外の型と値とトレースバック情報を渡します。そうでない場合、" "引数は全て ``None`` となります。" -#: ../../builtins/stdtypes.rst:6102 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " "statement immediately following the :keyword:`!with` statement. Otherwise " "the exception continues propagating after this method has finished executing." msgstr "" +"このメソッドが真の値を返すと、:keyword:`with` 文は例外を抑制し、:keyword:`!" +"with` 文の直後の文から実行を続けます。\n" +"それ以外の場合は、このメソッドの実行が終わった後も例外が伝播し続けます。" -#: ../../builtins/stdtypes.rst:6107 msgid "" "If this method raises an exception while handling an earlier exception from " "the :keyword:`with` block, the new exception is raised, and the original " "exception is stored in its :attr:`~BaseException.__context__` attribute." msgstr "" +"このメソッドが :keyword:`with` ブロックで発生した例外を処理している間に別の例" +"外を送出すると、新しい例外が送出され、元の例外はその :attr:`~BaseException." +"__context__` 属性に格納されます。" #: ../../builtins/stdtypes.rst:6111 msgid "" @@ -9222,7 +10278,6 @@ msgstr "" "アノテーションでは、このような :ref:`re.Match ` オブジェクト" "は ``re.Match[bytes]`` と表現することになるでしょう。" -#: ../../builtins/stdtypes.rst:6196 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -9230,6 +10285,13 @@ msgid "" "classes>` may not be instances of :class:`types.GenericAlias`, but they " "provide similar functionality." msgstr "" +"``GenericAlias`` オブジェクトは :class:`types.GenericAlias` クラスのインスタ" +"ンスです。\n" +"このクラスを使って ``GenericAlias`` オブジェクトを直接作成することもできま" +"す。\n" +"ユーザ定義の :ref:`ジェネリッククラス ` を特殊化したものは :" +"class:`types.GenericAlias` のインスタンスとは限りませんが、同様の機能を提供し" +"ます。" #: ../../builtins/stdtypes.rst:6203 msgid "" @@ -9242,11 +10304,12 @@ msgstr "" "す。たとえば、 :class:`float` 型の要素を含む :class:`list` を引数にとる関数の" "型アノテーションは次のようになります::" -#: ../../builtins/stdtypes.rst:6208 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" msgstr "" +"def average(values: list[float]) -> float:\n" +" return sum(values) / len(values)" #: ../../builtins/stdtypes.rst:6211 msgid "" @@ -9260,11 +10323,12 @@ msgstr "" "ています。この例では、関数はキーが :class:`str` 型、値が :class:`int` 型であ" "るような ``dict`` を引数にとります::" -#: ../../builtins/stdtypes.rst:6216 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." msgstr "" +"def send_post_request(url: str, body: dict[str, int]) -> None:\n" +" ..." #: ../../builtins/stdtypes.rst:6219 msgid "" @@ -9274,13 +10338,16 @@ msgstr "" "組み込み関数 :func:`isinstance` と :func:`issubclass` は第二引数として " "``GenericAlias`` 型を指定することはできません::" -#: ../../builtins/stdtypes.rst:6222 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> isinstance([1, 2], list[str])\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" #: ../../builtins/stdtypes.rst:6227 msgid "" @@ -9296,12 +10363,14 @@ msgstr "" "せん。たとえば、以下のコードは推奨されませんが、エラーになることなく実行でき" "ます::" -#: ../../builtins/stdtypes.rst:6233 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" "[1, 2, 3]" msgstr "" +">>> t = list[str]\n" +">>> t([1, 2, 3])\n" +"[1, 2, 3]" #: ../../builtins/stdtypes.rst:6237 msgid "" @@ -9311,7 +10380,6 @@ msgstr "" "しかも、パラメータ付きジェネリック型は、オブジェクト生成時にパラメータの型情" "報を削除します::" -#: ../../builtins/stdtypes.rst:6240 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -9321,24 +10389,35 @@ msgid "" ">>> type(l)\n" "" msgstr "" +">>> t = list[str]\n" +">>> type(t)\n" +"\n" +"\n" +">>> l = t()\n" +">>> type(l)\n" +"" -#: ../../builtins/stdtypes.rst:6249 msgid "" "Instances of ``GenericAlias`` are not classes at runtime, even though they " "behave like classes (they can be instantiated and subclassed)::" msgstr "" +"``GenericAlias`` のインスタンスは、インスタンス化やサブクラス化ができるなどク" +"ラスのように振る舞いますが、実行時にはクラスではありません。 ::" -#: ../../builtins/stdtypes.rst:6251 msgid "" ">>> import inspect\n" ">>> inspect.isclass(list[int])\n" "False" msgstr "" +">>> import inspect\n" +">>> inspect.isclass(list[int])\n" +"False" -#: ../../builtins/stdtypes.rst:6255 msgid "" "This is true for :ref:`user-defined generics ` also." msgstr "" +"これは :ref:`ユーザ定義のジェネリック型 ` にも当てはま" +"ります。" msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " @@ -9347,7 +10426,6 @@ msgstr "" "パラメータ付きジェネリック型に :func:`repr` や :func:`str` を呼び出すと、パラ" "メータを含む型が表示されます::" -#: ../../builtins/stdtypes.rst:6259 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -9355,6 +10433,11 @@ msgid "" ">>> str(list[int])\n" "'list[int]'" msgstr "" +">>> repr(list[int])\n" +"'list[int]'\n" +"\n" +">>> str(list[int])\n" +"'list[int]'" #: ../../builtins/stdtypes.rst:6265 msgid "" @@ -9364,13 +10447,16 @@ msgstr "" "ジェネリックコンテナ型の :meth:`~object.__getitem__` メソッドは、 ``dict[str]" "[str]`` のようなミスを許さないように、例外を送出します::" -#: ../../builtins/stdtypes.rst:6268 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" " ...\n" "TypeError: dict[str] is not a generic class" msgstr "" +">>> dict[str][str]\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: dict[str] is not a generic class" msgid "" "However, such expressions are valid when :ref:`type variables ` " @@ -9381,25 +10467,28 @@ msgstr "" "数は ``GenericAlias`` オブジェクトの :attr:`~genericalias.__args__` 属性にお" "ける型変数の数と同じでなければなりません::" -#: ../../builtins/stdtypes.rst:6277 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" ">>> dict[str, Y][int]\n" "dict[str, int]" msgstr "" +">>> from typing import TypeVar\n" +">>> Y = TypeVar('Y')\n" +">>> dict[str, Y][int]\n" +"dict[str, int]" #: ../../builtins/stdtypes.rst:6284 msgid "Standard Generic Classes" msgstr "標準ジェネリッククラス" -#: ../../builtins/stdtypes.rst:6286 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -"以下の標準ライブラリクラスは、パラメータ付きジェネリック型をサポートします。" -"このリストは完全に網羅されていない可能性があります。" +"以下の標準ライブラリのクラスは、パラメータ付きジェネリック型をサポートしてい" +"ます。\n" +"このリストはすべてを網羅しているわけではありません。" #: ../../builtins/stdtypes.rst:6289 msgid ":class:`tuple`" @@ -9417,9 +10506,8 @@ msgstr ":class:`dict`" msgid ":class:`set`" msgstr ":class:`set`" -#: ../../builtins/stdtypes.rst:6293 msgid ":class:`frozendict`" -msgstr "" +msgstr ":class:`frozendict`" #: ../../builtins/stdtypes.rst:6294 msgid ":class:`frozenset`" @@ -9429,13 +10517,11 @@ msgstr ":class:`frozenset`" msgid ":class:`type`" msgstr ":class:`type`" -#: ../../builtins/stdtypes.rst:6296 msgid ":class:`asyncio.Future`" -msgstr "" +msgstr ":class:`asyncio.Future`" -#: ../../builtins/stdtypes.rst:6297 msgid ":class:`asyncio.Task`" -msgstr "" +msgstr ":class:`asyncio.Task`" #: ../../builtins/stdtypes.rst:6298 msgid ":class:`collections.deque`" @@ -9457,9 +10543,8 @@ msgstr ":class:`collections.Counter`" msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../builtins/stdtypes.rst:6303 msgid ":class:`collections.abc.Awaitable`" -msgstr "’’:class:`collections.abc.Awaitable`" +msgstr ":class:`collections.abc.Awaitable`" #: ../../builtins/stdtypes.rst:6304 msgid ":class:`collections.abc.Coroutine`" @@ -9643,11 +10728,12 @@ msgstr "" msgid "This attribute points at the non-parameterized generic class::" msgstr "この属性は、対応するパラメータ付きでないジェネリッククラスを指します::" -#: ../../builtins/stdtypes.rst:6358 msgid "" ">>> list[int].__origin__\n" "" msgstr "" +">>> list[int].__origin__\n" +"" msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " @@ -9658,21 +10744,20 @@ msgstr "" "れたジェネリック型を要素とする :class:`tuple` です (長さが1の場合もありま" "す)::" -#: ../../builtins/stdtypes.rst:6368 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" msgstr "" +">>> dict[str, list[int]].__args__\n" +"(, list[int])" -#: ../../builtins/stdtypes.rst:6374 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -"この属性は、 ``__args__`` にある固有の型変数のタプルで、必要に応じて遅延計算" -"されます (空の可能性もあります)::" +"この属性は、``__args__`` に含まれる型変数を重複なく集めた、遅延計算されるタプ" +"ルです (空の場合もあります)。 ::" -#: ../../builtins/stdtypes.rst:6377 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -9680,16 +10765,21 @@ msgid "" ">>> list[T].__parameters__\n" "(~T,)" msgstr "" +">>> from typing import TypeVar\n" +"\n" +">>> T = TypeVar('T')\n" +">>> list[T].__parameters__\n" +"(~T,)" -#: ../../builtins/stdtypes.rst:6385 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -":class:`typing.ParamSpec` パラメータを含む ``GenericAlias`` オブジェクトは、" -"代入後に正しい ``__parameters__`` を持たない可能性があります。これは :class:" -"`typing.ParamSpec` が主に静的な型チェックを目的としているためです。" +":class:`typing.ParamSpec` パラメータを持つ ``GenericAlias`` オブジェクトは、" +"置換後の ``__parameters__`` が正しくない場合があります。\n" +"これは :class:`typing.ParamSpec` が主に静的な型チェックを目的としているためで" +"す。" #: ../../builtins/stdtypes.rst:6392 msgid "" @@ -9742,7 +10832,6 @@ msgstr "" msgid "Union Type" msgstr "Union 型" -#: ../../builtins/stdtypes.rst:6424 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -9750,26 +10839,31 @@ msgid "" "expression enables cleaner type hinting syntax compared to subscripting :" "class:`typing.Union`." msgstr "" +"ユニオンオブジェクトは、複数の :ref:`型オブジェクト ` に" +"対する ``|`` (ビット単位の論理和) 演算の値を保持します。\n" +"これらの型は主に :term:`型アノテーション ` で使うことを想定してい" +"ます。\n" +"ユニオン型の式を使うと、:class:`typing.Union` の添字表記よりも簡潔な型ヒント" +"の構文で書けます。" -#: ../../builtins/stdtypes.rst:6431 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " "example, the following function expects an argument of type :class:`int` or :" "class:`float`::" msgstr "" -"*X* と *Y* などの型を保持するUnionオブジェクトを定義すします。``X | Y`` はXと" -"Yのいずれかを意味します。これは ``typing.Union[X, Y]`` と等価です。たとえば、" -"以下の関数は引数として :class:`int` 型または :class:`float` 型を想定していま" -"す。::" +"*X*、*Y* などの型を保持するユニオンオブジェクトを定義します。\n" +"``X | Y`` は X または Y を意味し、``typing.Union[X, Y]`` と等価です。\n" +"例えば、次の関数は :class:`int` 型または :class:`float` 型の引数を想定してい" +"ます。 ::" -#: ../../builtins/stdtypes.rst:6436 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" msgstr "" +"def square(number: int | float) -> int | float:\n" +" return number ** 2" -#: ../../builtins/stdtypes.rst:6441 msgid "" "The ``|`` operator cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -9777,6 +10871,12 @@ msgid "" "For unions which include forward references, present the whole expression as " "a string, e.g. ``\"int | Foo\"``." msgstr "" +"一つ以上のメンバーが前方参照であるユニオンを実行時に定義するために、``|`` 演" +"算子を使うことはできません。\n" +"例えば、まだ定義されていないクラスを ``\"Foo\"`` で参照する ``int | " +"\"Foo\"`` は、実行時に失敗します。\n" +"前方参照を含むユニオンは、``\"int | Foo\"`` のように式全体を文字列として記述" +"してください。" #: ../../builtins/stdtypes.rst:6449 msgid "" @@ -9785,60 +10885,56 @@ msgstr "" "Unionオブジェクトは他のUnionオブジェクトとの等価性をテストできます。以下は詳" "細です:" -#: ../../builtins/stdtypes.rst:6451 msgid "Unions of unions are flattened::" -msgstr "ユニオン型のユニオン型は平滑化されます::" +msgstr "ユニオンのユニオンは平坦化されます。 ::" -#: ../../builtins/stdtypes.rst:6453 msgid "(int | str) | float == int | str | float" -msgstr "" +msgstr "(int | str) | float == int | str | float" #: ../../builtins/stdtypes.rst:6455 msgid "Redundant types are removed::" msgstr "余分な型は削除されます::" -#: ../../builtins/stdtypes.rst:6457 msgid "int | str | int == int | str" -msgstr "" +msgstr "int | str | int == int | str" #: ../../builtins/stdtypes.rst:6459 msgid "When comparing unions, the order is ignored::" msgstr "ユニオン型を比較すると順序は無視されます::" -#: ../../builtins/stdtypes.rst:6461 msgid "int | str == str | int" -msgstr "" +msgstr "int | str == str | int" -#: ../../builtins/stdtypes.rst:6463 msgid "It creates instances of :class:`typing.Union`::" -msgstr "" +msgstr ":class:`typing.Union` のインスタンスを作成します。 ::" -#: ../../builtins/stdtypes.rst:6465 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" msgstr "" +"int | str == typing.Union[int, str]\n" +"type(int | str) is typing.Union" #: ../../builtins/stdtypes.rst:6468 msgid "Optional types can be spelled as a union with ``None``::" msgstr "Optional型は ``None`` とのUnion型で記述できます::" -#: ../../builtins/stdtypes.rst:6470 msgid "str | None == typing.Optional[str]" -msgstr "" +msgstr "str | None == typing.Optional[str]" msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -":func:`isinstance` と :func:`issubclass` の呼び出しはどちらもUnionオブジェク" -"トをサポートしています。" +"ユニオンオブジェクトを使った :func:`isinstance` と :func:`issubclass` の呼び" +"出しもサポートされています。 ::" -#: ../../builtins/stdtypes.rst:6478 msgid "" ">>> isinstance(\"\", int | str)\n" "True" msgstr "" +">>> isinstance(\"\", int | str)\n" +"True" #: ../../builtins/stdtypes.rst:6481 msgid "" @@ -9848,7 +10944,6 @@ msgstr "" "しかし、Unionオブジェクトの中の :ref:`parameterized generics ` はチェックできません::" -#: ../../builtins/stdtypes.rst:6484 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -9857,14 +10952,21 @@ msgid "" " ...\n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> isinstance(1, int | list[int]) # 短絡評価\n" +"True\n" +">>> isinstance([1], int | list[int])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../builtins/stdtypes.rst:6491 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" msgstr "" +"利用者がユニオンオブジェクトの型にアクセスするには :class:`typing.Union` を使" +"います。\n" +":func:`isinstance` による検査にも使えます。 ::" -#: ../../builtins/stdtypes.rst:6494 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -9874,6 +10976,13 @@ msgid "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" msgstr "" +">>> import typing\n" +">>> isinstance(int | str, typing.Union)\n" +"True\n" +">>> typing.Union()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot create 'typing.Union' instances" #: ../../builtins/stdtypes.rst:6503 msgid "" @@ -9885,7 +10994,6 @@ msgstr "" "が追加されました。メタクラスで :meth:`!__or__` を実装するとUnionをオーバーラ" "イドする場合があります::" -#: ../../builtins/stdtypes.rst:6507 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -9899,17 +11007,30 @@ msgid "" ">>> int | C\n" "int | C" msgstr "" +">>> class M(type):\n" +"... def __or__(self, other):\n" +"... return \"Hello\"\n" +"...\n" +">>> class C(metaclass=M):\n" +"... pass\n" +"...\n" +">>> C | int\n" +"'Hello'\n" +">>> int | C\n" +"int | C" #: ../../builtins/stdtypes.rst:6523 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- ``X | Y`` 構文とUnion型を提案しているPEP" -#: ../../builtins/stdtypes.rst:6529 msgid "" "Union objects are now instances of :class:`typing.Union`. Previously, they " "were instances of :class:`types.UnionType`, which remains an alias for :" "class:`typing.Union`." msgstr "" +"ユニオンオブジェクトは :class:`typing.Union` のインスタンスになりました。\n" +"以前は :class:`types.UnionType` のインスタンスでしたが、この型名は :class:" +"`typing.Union` のエイリアスとして残っています。" #: ../../builtins/stdtypes.rst:6536 msgid "Other Built-in Types" @@ -10012,13 +11133,17 @@ msgstr "詳細は、 :ref:`function` を参照してください。" msgid "Methods" msgstr "メソッド" -#: ../../builtins/stdtypes.rst:6597 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" "`~list.append` on lists) and :ref:`class instance methods `. Built-in methods are described with the types that support them." msgstr "" +"メソッドは属性表記を使って呼び出す関数です。\n" +":ref:`組み込みメソッド ` (リストの :meth:`~list.append` な" +"ど) と :ref:`クラスのインスタンスメソッド ` の2種類がありま" +"す。\n" +"組み込みメソッドは、それをサポートする型の説明で扱います。" #: ../../builtins/stdtypes.rst:6603 msgid "" @@ -10060,7 +11185,6 @@ msgstr "" "ためには、次のようにその下層の関数オブジェクトに明示的に設定する必要がありま" "す::" -#: ../../builtins/stdtypes.rst:6622 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -10075,6 +11199,19 @@ msgid "" ">>> c.method.whoami\n" "'my name is method'" msgstr "" +">>> class C:\n" +"... def method(self):\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> c.method.whoami = 'my name is method' # メソッドに設定することはできな" +"い\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"AttributeError: 'method' object has no attribute 'whoami'\n" +">>> c.method.__func__.whoami = 'my name is method'\n" +">>> c.method.whoami\n" +"'my name is method'" #: ../../builtins/stdtypes.rst:6637 msgid "See :ref:`instance-methods` for more information." @@ -10163,65 +11300,77 @@ msgstr "``None`` と書き表されます。" msgid "The Ellipsis Object" msgstr "Ellipsis オブジェクト" -#: ../../builtins/stdtypes.rst:6706 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " "named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces " "the :const:`Ellipsis` singleton." msgstr "" +"このオブジェクトは、何かが省略されていることを表すためによく使われます。\n" +"特別な演算はサポートしていません。\n" +"省略記号オブジェクトはちょうど一つだけ存在し、組み込み名 :const:`Ellipsis` が" +"付いています。\n" +"``type(Ellipsis)()`` は :const:`Ellipsis` シングルトンを生成します。" #: ../../builtins/stdtypes.rst:6711 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "``Ellipsis`` または ``...`` と書き表されます。" -#: ../../builtins/stdtypes.rst:6713 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" +"通常、``Ellipsis`` オブジェクトとしての ``...`` は、例えば次のような箇所で使" +"われます:" -#: ../../builtins/stdtypes.rst:6716 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" +":ref:`呼び出し可能オブジェクトの引数 ` や :ref:`タプル" +"の要素 ` などの型アノテーション。" -#: ../../builtins/stdtypes.rst:6719 msgid "" "As the body of a function instead of a :ref:`pass statement `." -msgstr "" +msgstr ":ref:`pass 文 ` の代わりとなる関数本体。" -#: ../../builtins/stdtypes.rst:6721 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" +"`NumPy のスライスとストライド `_ などのサードパーティライブラリ。" -#: ../../builtins/stdtypes.rst:6724 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" +"Python では、``Ellipsis`` オブジェクト以外の意味でも3個のドットを使います。\n" +"例えば、次のような場合です:" -#: ../../builtins/stdtypes.rst:6726 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" +"省略された内容にマッチするパターンとしての、doctest の :const:`ELLIPSIS " +"`。" -#: ../../builtins/stdtypes.rst:6728 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" +"入力がまだ完了していないときの、:term:`対話型 ` シェルの Python " +"のデフォルトプロンプト。" -#: ../../builtins/stdtypes.rst:6730 msgid "" "Lastly, the Python documentation often uses three dots in conventional " "English usage to mean omitted content, even in code examples that also use " "them as the ``Ellipsis``." msgstr "" +"最後に、Python ドキュメントでは内容の省略を意味する通常の英語の用法でも3個の" +"ドットをよく使います。\n" +"これは、``Ellipsis`` としても3個のドットを使っているコード例にも当てはまりま" +"す。" #: ../../builtins/stdtypes.rst:6738 msgid "The NotImplemented Object" @@ -10284,21 +11433,23 @@ msgstr "" "クラス、関数、メソッド、デスクリプタ、ジェネレータインスタンスの :term:`修飾" "名 ` です。" -#: ../../builtins/stdtypes.rst:6784 msgid "The name of the module in which a class or function was defined." -msgstr "" +msgstr "クラスまたは関数が定義されたモジュールの名前。" -#: ../../builtins/stdtypes.rst:6789 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" +"クラスまたは関数のドキュメンテーション文字列。\n" +"未定義の場合は ``None``。" -#: ../../builtins/stdtypes.rst:6794 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" +"ジェネリッククラスや関数、および :ref:`型エイリアス ` の :ref:`" +"型パラメータ `。\n" +"ジェネリックでないクラスや関数では空のタプルになります。" #: ../../builtins/stdtypes.rst:6804 msgid "Integer string conversion length limitation" @@ -10353,7 +11504,6 @@ msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "演算の結果が制限を超えると、:exc:`ValueError` が送出されます:" -#: ../../builtins/stdtypes.rst:6826 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -10376,6 +11526,26 @@ msgid "" "7144\n" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" +">>> import sys\n" +">>> sys.set_int_max_str_digits(4300) # 例示用。これはデフォルト値。\n" +">>> _ = int('2' * 5432)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion: " +"value has 5432 digits; use sys.set_int_max_str_digits() to increase the " +"limit\n" +">>> i = int('2' * 4300)\n" +">>> len(str(i))\n" +"4300\n" +">>> i_squared = i*i\n" +">>> len(str(i_squared))\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion; " +"use sys.set_int_max_str_digits() to increase the limit\n" +">>> len(hex(i_squared))\n" +"7144\n" +">>> assert int(hex(i_squared), base=16) == i*i # 16進数は制限されない。" #: ../../builtins/stdtypes.rst:6846 msgid "" @@ -10393,7 +11563,6 @@ msgstr "" msgid "Verification:" msgstr "確認:" -#: ../../builtins/stdtypes.rst:6853 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -10403,6 +11572,13 @@ msgid "" "... '571186405732').to_bytes(53, 'big')\n" "..." msgstr "" +">>> import sys\n" +">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" +">>> assert sys.int_info.str_digits_check_threshold == 640, sys.int_info\n" +">>> msg = int('578966293710682886880994035146873798396722250538762761564'\n" +"... '9252925514383915483333812743580549779436104706260696366600'\n" +"... '571186405732').to_bytes(53, 'big')\n" +"..." #: ../../builtins/stdtypes.rst:6866 msgid "Affected APIs" @@ -10606,7 +11782,6 @@ msgstr "" msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../builtins/stdtypes.rst:6946 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -10618,6 +11793,15 @@ msgid "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" +">>> import sys\n" +">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" +"... upper_bound = 68000\n" +"... lower_bound = 4004\n" +"... current_limit = sys.get_int_max_str_digits()\n" +"... if current_limit == 0 or current_limit > upper_bound:\n" +"... sys.set_int_max_str_digits(upper_bound)\n" +"... elif current_limit < lower_bound:\n" +"... sys.set_int_max_str_digits(lower_bound)" #: ../../builtins/stdtypes.rst:6956 msgid "If you need to disable it entirely, set it to ``0``." @@ -11078,13 +12262,11 @@ msgstr "StopIteration" msgid "GeneratorExit" msgstr "GeneratorExit" -#: ../../builtins/stdtypes.rst:1129 msgid "asynchronous-generator" -msgstr "" +msgstr "非同期ジェネレータ" -#: ../../builtins/stdtypes.rst:1139 msgid "StopAsyncIteration" -msgstr "" +msgstr "StopAsyncIteration" #: ../../builtins/stdtypes.rst:1276 ../../builtins/stdtypes.rst:5613 msgid "len" @@ -11227,17 +12409,14 @@ msgstr "universal newlines" msgid "str.splitlines method" msgstr "str.splitlines メソッド" -#: ../../builtins/stdtypes.rst:3202 msgid "! formatted string literal" -msgstr "" +msgstr "! フォーマット済み文字列リテラル" -#: ../../builtins/stdtypes.rst:3202 msgid "formatted string literals" -msgstr "" +msgstr "フォーマット済み文字列リテラル" -#: ../../builtins/stdtypes.rst:3202 msgid "! f-string" -msgstr "" +msgstr "! f-string" msgid "f-strings" msgstr "f-strings" @@ -11258,13 +12437,11 @@ msgstr "補間リテラル" msgid "{} (curly brackets)" msgstr "{} (波括弧)" -#: ../../builtins/stdtypes.rst:3202 msgid "in formatted string literal" -msgstr "" +msgstr "フォーマット済み文字列リテラル内" -#: ../../builtins/stdtypes.rst:3202 msgid "! (exclamation mark)" -msgstr "" +msgstr "! (感嘆符)" #: ../../builtins/stdtypes.rst:3202 msgid ": (colon)" @@ -11274,9 +12451,8 @@ msgstr ": (コロン)" msgid "= (equals)" msgstr "= (等号)" -#: ../../builtins/stdtypes.rst:3202 msgid "for help in debugging using string literals" -msgstr "" +msgstr "文字列リテラルを使ったデバッグの補助" #: ../../builtins/stdtypes.rst:3374 msgid "formatting, string (%)" diff --git a/builtins/threadsafety.po b/builtins/threadsafety.po index 3c04dde18..c9a8dd632 100644 --- a/builtins/threadsafety.po +++ b/builtins/threadsafety.po @@ -18,59 +18,65 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../builtins/threadsafety.rst:5 msgid "Thread Safety Guarantees" -msgstr "" +msgstr "スレッドセーフ性の保証" -#: ../../builtins/threadsafety.rst:7 msgid "" "This page documents thread-safety guarantees for built-in types in Python's " "free-threaded build. The guarantees described here apply when using Python " "with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled, " "most operations are implicitly serialized." msgstr "" +"このページでは、Python のフリースレッドビルドにおける組み込み型のスレッドセー" +"フ性の保証を説明します。\n" +"ここで説明する保証は、:term:`GIL` を無効にして Python を使う場合 (フリース" +"レッドモード) に適用されます。\n" +"GIL が有効な場合、ほとんどの操作は暗黙に直列化されます。" -#: ../../builtins/threadsafety.rst:12 msgid "" "For general guidance on writing thread-safe code in free-threaded Python, " "see :ref:`freethreading-python-howto`." msgstr "" +"フリースレッドの Python でスレッドセーフなコードを書くための一般的な指針は、:" +"ref:`freethreading-python-howto` を参照してください。" -#: ../../builtins/threadsafety.rst:19 msgid "Thread safety levels" -msgstr "" +msgstr "スレッドセーフ性のレベル" -#: ../../builtins/threadsafety.rst:21 msgid "" "The C API documentation uses the following levels to describe the thread " "safety guarantees of each function. The levels are listed from least to most " "safe." msgstr "" +"C API のドキュメントでは、各関数のスレッドセーフ性の保証を次のレベルで表しま" +"す。\n" +"安全性の低いものから高いものの順に示します。" -#: ../../builtins/threadsafety.rst:28 msgid "Incompatible" -msgstr "" +msgstr "並行使用不可 (Incompatible)" -#: ../../builtins/threadsafety.rst:30 msgid "" "A function or operation that cannot be made safe for concurrent use even " "with external synchronization. Incompatible code typically accesses global " "state in an unsynchronized way and must only be called from a single thread " "throughout the program's lifetime." msgstr "" +"外部で同期しても、安全に並行使用できない関数や操作です。\n" +"このレベルのコードは通常、同期せずにグローバル状態へアクセスするため、プログ" +"ラムの存続期間を通して、単一のスレッドからだけ呼び出さなければなりません。" -#: ../../builtins/threadsafety.rst:35 msgid "" "Example: a function that modifies process-wide state such as signal handlers " "or environment variables, where concurrent calls from any threads, even with " "external locking, can conflict with the runtime or other libraries." msgstr "" +"例: シグナルハンドラや環境変数など、プロセス全体の状態を変更する関数です。\n" +"外部でロックを取得していても、複数のスレッドからの並行呼び出しが、ランタイム" +"やほかのライブラリと競合する可能性があります。" -#: ../../builtins/threadsafety.rst:42 msgid "Compatible" -msgstr "" +msgstr "外部同期により並行使用可能 (Compatible)" -#: ../../builtins/threadsafety.rst:44 msgid "" "A function or operation that is safe to call from multiple threads " "*provided* the caller supplies appropriate external synchronization, for " @@ -78,19 +84,25 @@ msgid "" "such synchronization, concurrent calls may produce :term:`race conditions " "` or :term:`data races `." msgstr "" +"呼び出し側が外部で適切に同期する *ことを条件に*、複数のスレッドから安全に呼び" +"出せる関数や操作です。\n" +"たとえば、呼び出しのたびに、呼び出しが続く間 :term:`ロック ` を保持して" +"同期します。\n" +"こうした同期がないと、並行呼び出しによって :term:`競合状態 ` " +"や :term:`データ競合 ` が発生する可能性があります。" -#: ../../builtins/threadsafety.rst:50 msgid "" "Example: a function that reads from or writes to an object whose internal " "state is not protected by a lock. Callers must ensure that no two threads " "access the same object at the same time." msgstr "" +"例: 内部状態がロックで保護されていないオブジェクトを読み書きする関数です。\n" +"呼び出し側は、二つのスレッドが同じオブジェクトに同時にアクセスしないことを保" +"証しなければなりません。" -#: ../../builtins/threadsafety.rst:57 msgid "Safe on distinct objects" -msgstr "" +msgstr "異なるオブジェクトなら安全" -#: ../../builtins/threadsafety.rst:59 msgid "" "A function or operation that is safe to call from multiple threads without " "external synchronization, as long as each thread operates on a **different** " @@ -98,20 +110,26 @@ msgid "" "not pass the same object (or objects that share underlying state) as " "arguments." msgstr "" +"各スレッドが **異なる** オブジェクトを操作する限り、外部で同期せずに複数のス" +"レッドから安全に呼び出せる関数や操作です。\n" +"二つのスレッドが同時にこの関数を呼び出してもかまいませんが、同じオブジェクト " +"(または内部の状態を共有するオブジェクト) を引数に渡してはなりません。" -#: ../../builtins/threadsafety.rst:65 msgid "" "Example: a function that modifies fields of a struct using non-atomic " "writes. Two threads can each call the function on their own struct instance " "safely, but concurrent calls on the *same* instance require external " "synchronization." msgstr "" +"例: アトミックでない書き込みを使って、構造体のフィールドを変更する関数で" +"す。\n" +"二つのスレッドがそれぞれ自分の構造体インスタンスに対してこの関数を呼び出すの" +"は安全ですが、*同じ* インスタンスに対する並行呼び出しには、外部での同期が必要" +"です。" -#: ../../builtins/threadsafety.rst:73 msgid "Safe on shared objects" -msgstr "" +msgstr "共有オブジェクトでも安全" -#: ../../builtins/threadsafety.rst:75 msgid "" "A function or operation that is safe for concurrent use on the **same** " "object. The implementation uses internal synchronization (such as :term:`per-" @@ -119,6 +137,11 @@ msgid "" "section-api>`) to protect shared mutable state, so callers do not need to " "supply their own locking." msgstr "" +"**同じ** オブジェクトに対して安全に並行使用できる関数や操作です。\n" +"実装が内部で同期 (:term:`オブジェクトごとのロック ` や :ref:" +"`クリティカルセクション ` など) を行って共有され" +"た可変の状態を保護するため、呼び出し側で独自にロックを用意する必要はありませ" +"ん。" #: ../../builtins/threadsafety.rst:81 msgid "" @@ -127,50 +150,56 @@ msgid "" "serialize access." msgstr "" -#: ../../builtins/threadsafety.rst:88 msgid "Atomic" -msgstr "" +msgstr "アトミック" -#: ../../builtins/threadsafety.rst:90 msgid "" "A function or operation that appears :term:`atomic ` with " "respect to other threads - it executes instantaneously from the perspective " "of other threads. This is the strongest form of thread safety." msgstr "" +"ほかのスレッドから見ると :term:`アトミック ` に実行される関" +"数や操作です。\n" +"つまり、ほかのスレッドの視点では、一瞬で実行されるように見えます。\n" +"これはスレッドセーフ性の最も強い保証です。" -#: ../../builtins/threadsafety.rst:94 msgid "" "Example: :c:func:`PyMutex_IsLocked` performs an atomic read of the mutex " "state and can be called from any thread at any time." msgstr "" +"例: :c:func:`PyMutex_IsLocked` はミューテックスの状態をアトミックに読み取り、" +"どのスレッドからでも、いつでも呼び出せます。" -#: ../../builtins/threadsafety.rst:101 msgid "Thread safety for list objects" -msgstr "" +msgstr "``list`` オブジェクトのスレッドセーフ性" -#: ../../builtins/threadsafety.rst:103 msgid "" "Reading a single element from a :class:`list` is :term:`atomic `:" msgstr "" +":class:`list` からの単一要素の読み取りは :term:`アトミック ` です。" -#: ../../builtins/threadsafety.rst:106 msgid "lst[i] # list.__getitem__" -msgstr "" +msgstr "lst[i] # list.__getitem__" -#: ../../builtins/threadsafety.rst:111 msgid "" "The following methods traverse the list and use :term:`atomic ` reads of each item to perform their function. That means that " "they may return results affected by concurrent modifications:" msgstr "" +"次のメソッドはリストを走査し、各要素を :term:`アトミック ` " +"に読み取って処理を行います。\n" +"そのため、並行して行われる変更の影響を受けた結果を返すことがあります。" -#: ../../builtins/threadsafety.rst:115 msgid "" "item in lst\n" "lst.index(item)\n" "lst.count(item)" msgstr "" +"item in lst\n" +"lst.index(item)\n" +"lst.count(item)" #: ../../builtins/threadsafety.rst:122 msgid "" @@ -179,76 +208,92 @@ msgid "" "that hold a lock will not block these from observing intermediate states." msgstr "" -#: ../../builtins/threadsafety.rst:127 msgid "" "All other operations from here on block using the :term:`per-object lock`." msgstr "" +"これ以降のほかの操作はすべて、:term:`オブジェクトごとのロック ` を使ってブロックします。" -#: ../../builtins/threadsafety.rst:129 msgid "" "Writing a single item via ``lst[i] = x`` is safe to call from multiple " "threads and will not corrupt the list." msgstr "" +"``lst[i] = x`` による単一要素の書き込みは、複数のスレッドから安全に実行でき、" +"リストを破損させません。" -#: ../../builtins/threadsafety.rst:132 msgid "" "The following operations return new objects and appear :term:`atomic ` to other threads:" msgstr "" +"次の操作は新しいオブジェクトを返し、ほかのスレッドから見ると :term:`アトミッ" +"ク ` に実行されます。" -#: ../../builtins/threadsafety.rst:135 msgid "" "lst1 + lst2 # concatenates two lists into a new list\n" "x * lst # repeats lst x times into a new list\n" "lst.copy() # returns a shallow copy of the list" msgstr "" +"lst1 + lst2 # 二つのリストを結合して新しいリストを作成する\n" +"x * lst # lst を x 回繰り返して新しいリストを作成する\n" +"lst.copy() # リストの浅いコピーを返す" -#: ../../builtins/threadsafety.rst:142 msgid "" "The following methods that only operate on a single element with no shifting " "required are :term:`atomic `:" msgstr "" +"次のメソッドは、要素をずらす必要がなく、単一の要素だけを操作するため、:term:`" +"アトミック ` です。" -#: ../../builtins/threadsafety.rst:145 msgid "" "lst.append(x) # append to the end of the list, no shifting required\n" "lst.pop() # pop element from the end of the list, no shifting required" msgstr "" +"lst.append(x) # リストの末尾に追加するため、要素をずらす必要はない\n" +"lst.pop() # リストの末尾の要素を取り出して削除するため、要素をずらす必要" +"はない" -#: ../../builtins/threadsafety.rst:151 msgid "" "The :meth:`~list.clear` method is also :term:`atomic `. " "Other threads cannot observe elements being removed." msgstr "" +":meth:`~list.clear` メソッドも :term:`アトミック ` です。\n" +"ほかのスレッドから、要素が削除されていく途中の状態は観測できません。" -#: ../../builtins/threadsafety.rst:154 msgid "" "The :meth:`~list.sort` method is not :term:`atomic `. " "Other threads cannot observe intermediate states during sorting, but the " "list appears empty for the duration of the sort." msgstr "" +":meth:`~list.sort` メソッドは :term:`アトミック ` ではあり" +"ません。\n" +"ほかのスレッドからソート途中の状態は観測できませんが、ソート中のリストは空に" +"見えます。" -#: ../../builtins/threadsafety.rst:158 msgid "" "The following operations may allow :term:`lock-free` operations to observe " "intermediate states since they modify multiple elements in place:" msgstr "" +"次の操作は複数の要素をその場で変更するため、:term:`ロックフリーな ` 操作から途中の状態が観測されることがあります。" -#: ../../builtins/threadsafety.rst:161 msgid "" "lst.insert(idx, item) # shifts elements\n" "lst.pop(idx) # idx not at the end of the list, shifts elements\n" "lst *= x # copies elements in place" msgstr "" +"lst.insert(idx, item) # 要素をずらす\n" +"lst.pop(idx) # idx がリストの末尾でなければ、要素をずらす\n" +"lst *= x # 要素をその場でコピーする" -#: ../../builtins/threadsafety.rst:168 msgid "" "The :meth:`~list.remove` method may allow concurrent modifications since " "element comparison may execute arbitrary Python code (via :meth:`~object." "__eq__`)." msgstr "" +"要素の比較で (:meth:`~object.__eq__` を通じて) 任意の Python コードを実行する" +"可能性があるため、:meth:`~list.remove` メソッドの実行中に並行して変更が行われ" +"ることがあります。" -#: ../../builtins/threadsafety.rst:172 msgid "" ":meth:`~list.extend` is safe to call from multiple threads. However, its " "guarantees depend on the iterable passed to it. If it is a :class:`list`, a :" @@ -259,21 +304,33 @@ msgid "" "another thread. The same applies to inplace concatenation of a list with " "other iterables when using ``lst += iterable``." msgstr "" +":meth:`~list.extend` は複数のスレッドから安全に呼び出せます。\n" +"ただし、その保証は渡されたイテラブルによって異なります。\n" +"渡されたイテラブルが :class:`list`、:class:`tuple`、:class:`set`、:class:" +"`frozenset`、:class:`dict`、:ref:`辞書ビューオブジェクト ` のいず" +"れか (サブクラスは除く) である場合、``extend`` 操作はそのイテラブルに対する並" +"行変更から保護されます。\n" +"それ以外の場合は、ほかのスレッドによって並行して変更される可能性があるイテ" +"レータが作成されます。\n" +"``lst += iterable`` を使ってリストとほかのイテラブルをインプレースに結合する" +"場合も、同じことが当てはまります。" -#: ../../builtins/threadsafety.rst:181 msgid "" "Similarly, assigning to a list slice with ``lst[i:j] = iterable`` is safe to " "call from multiple threads, but ``iterable`` is only locked when it is also " "a :class:`list` (but not its subclasses)." msgstr "" +"同様に、``lst[i:j] = iterable`` によるリストのスライスへの代入も、複数のス" +"レッドから安全に実行できますが、``iterable`` がロックされるのは、" +"``iterable`` も :class:`list` (サブクラスは除く) である場合だけです。" -#: ../../builtins/threadsafety.rst:185 msgid "" "Operations that involve multiple accesses, as well as iteration, are never " "atomic. For example:" msgstr "" +"複数回のアクセスを伴う操作やイテレーションは、アトミックではありません。\n" +"たとえば、次のような操作です。" -#: ../../builtins/threadsafety.rst:188 msgid "" "# NOT atomic: read-modify-write\n" "lst[i] = lst[i] + 1\n" @@ -286,16 +343,26 @@ msgid "" "for item in lst:\n" " process(item) # another thread may modify lst" msgstr "" +"# アトミックではない: 読み取り、変更、書き込み\n" +"lst[i] = lst[i] + 1\n" +"\n" +"# アトミックではない: 確認してから実行\n" +"if lst:\n" +" item = lst.pop()\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for item in lst:\n" +" process(item) # ほかのスレッドが lst を変更する可能性がある" -#: ../../builtins/threadsafety.rst:202 msgid "" "Consider external synchronization when sharing :class:`list` instances " "across threads." msgstr "" +"スレッド間で :class:`list` インスタンスを共有する場合は、外部での同期を検討し" +"てください。" -#: ../../builtins/threadsafety.rst:209 msgid "Thread safety for dict objects" -msgstr "" +msgstr "``dict`` オブジェクトのスレッドセーフ性" #: ../../builtins/threadsafety.rst:211 msgid "" @@ -311,25 +378,28 @@ msgid "" "`atomic `." msgstr "" -#: ../../builtins/threadsafety.rst:220 msgid "" "d[key] # dict.__getitem__\n" "d.get(key) # dict.get\n" "key in d # dict.__contains__\n" "len(d) # dict.__len__" msgstr "" +"d[key] # dict.__getitem__\n" +"d.get(key) # dict.get\n" +"key in d # dict.__contains__\n" +"len(d) # dict.__len__" #: ../../builtins/threadsafety.rst:228 msgid "All other operations from here on hold the :term:`per-object lock`." msgstr "" -#: ../../builtins/threadsafety.rst:230 msgid "" "Writing or removing a single item is safe to call from multiple threads and " "will not corrupt the dictionary:" msgstr "" +"単一の要素の書き込みや削除は、複数のスレッドから安全に実行でき、辞書を破損さ" +"せません。" -#: ../../builtins/threadsafety.rst:233 msgid "" "d[key] = value # write\n" "del d[key] # delete\n" @@ -337,8 +407,12 @@ msgid "" "d.popitem() # remove and return last item\n" "d.setdefault(key, v) # insert if missing" msgstr "" +"d[key] = value # 書き込む\n" +"del d[key] # 削除する\n" +"d.pop(key) # 削除して返す\n" +"d.popitem() # 最後の要素を削除して返す\n" +"d.setdefault(key, v) # 存在しなければ挿入する" -#: ../../builtins/threadsafety.rst:242 msgid "" "These operations may compare keys using :meth:`~object.__eq__`, which can " "execute arbitrary Python code. During such comparisons, the dictionary may " @@ -346,6 +420,12 @@ msgid "" "`int`, and :class:`float`, that implement :meth:`~object.__eq__` in C, the " "underlying lock is not released during comparisons and this is not a concern." msgstr "" +"これらの操作は :meth:`~object.__eq__` を使ってキーを比較することがあり、その" +"際に任意の Python コードを実行する可能性があります。\n" +"このような比較中に、ほかのスレッドが辞書を変更する可能性があります。\n" +":meth:`~object.__eq__` を C で実装している :class:`str`、:class:`int`、:" +"class:`float` などの組み込み型では、比較中に内部のロックを解放しないため、こ" +"の心配はありません。" #: ../../builtins/threadsafety.rst:249 msgid "" @@ -353,7 +433,6 @@ msgid "" "lock` for the duration of the operation:" msgstr "" -#: ../../builtins/threadsafety.rst:252 msgid "" "d.copy() # returns a shallow copy of the dictionary\n" "d | other # merges two dicts into a new dict\n" @@ -361,14 +440,19 @@ msgid "" "d.values() # returns a new dict_values view object\n" "d.items() # returns a new dict_items view object" msgstr "" +"d.copy() # 辞書の浅いコピーを返す\n" +"d | other # 二つの辞書をマージして新しい辞書を作成する\n" +"d.keys() # 新しい dict_keys ビューオブジェクトを返す\n" +"d.values() # 新しい dict_values ビューオブジェクトを返す\n" +"d.items() # 新しい dict_items ビューオブジェクトを返す" -#: ../../builtins/threadsafety.rst:261 msgid "" "The :meth:`~dict.clear` method holds the lock for its duration. Other " "threads cannot observe elements being removed." msgstr "" +":meth:`~dict.clear` メソッドは、処理中ずっとロックを保持します。\n" +"ほかのスレッドから、要素が削除されていく途中の状態は観測できません。" -#: ../../builtins/threadsafety.rst:264 msgid "" "The following operations lock both dictionaries. For :meth:`~dict.update` " "and ``|=``, this applies only when the other operand is a :class:`dict` that " @@ -376,56 +460,70 @@ msgid "" "iteration). For equality comparison, this applies to :class:`dict` and its " "subclasses:" msgstr "" +"次の操作は両方の辞書をロックします。\n" +":meth:`~dict.update` と ``|=`` では、もう一方のオペランドが標準の辞書イテレー" +"タを使う :class:`dict` である場合だけ、この保証が適用されます (イテレーション" +"をオーバーライドするサブクラスは除きます)。\n" +"等値比較では、:class:`dict` とそのサブクラスにこの保証が適用されます。" -#: ../../builtins/threadsafety.rst:270 msgid "" "d.update(other_dict) # both locked when other_dict is a dict\n" "d |= other_dict # both locked when other_dict is a dict\n" "d == other_dict # both locked for dict and subclasses" msgstr "" +"d.update(other_dict) # other_dict が dict の場合は両方をロックする\n" +"d |= other_dict # other_dict が dict の場合は両方をロックする\n" +"d == other_dict # dict とそのサブクラスの場合は両方をロックする" -#: ../../builtins/threadsafety.rst:277 msgid "" "All comparison operations also compare values using :meth:`~object.__eq__`, " "so for non-built-in types the lock may be released during comparison." msgstr "" +"比較操作はすべて、値の比較にも :meth:`~object.__eq__` を使うため、組み込み型" +"でない場合は比較中にロックを解放することがあります。" -#: ../../builtins/threadsafety.rst:280 msgid "" ":meth:`~dict.fromkeys` locks both the new dictionary and the iterable when " "the iterable is exactly a :class:`dict`, :class:`set`, or :class:`frozenset` " "(not subclasses):" msgstr "" +"イテラブルが :class:`dict`、:class:`set`、:class:`frozenset` そのもの (サブク" +"ラスは除く) である場合、:meth:`~dict.fromkeys` は新しい辞書とそのイテラブルの" +"両方をロックします。" -#: ../../builtins/threadsafety.rst:284 msgid "" "dict.fromkeys(a_dict) # locks both\n" "dict.fromkeys(a_set) # locks both\n" "dict.fromkeys(a_frozenset) # locks both" msgstr "" +"dict.fromkeys(a_dict) # 両方をロックする\n" +"dict.fromkeys(a_set) # 両方をロックする\n" +"dict.fromkeys(a_frozenset) # 両方をロックする" -#: ../../builtins/threadsafety.rst:291 msgid "" "When updating from a non-dict iterable, only the target dictionary is " "locked. The iterable may be concurrently modified by another thread:" msgstr "" +"辞書ではないイテラブルから更新する場合、更新先の辞書だけをロックします。\n" +"イテラブルは、ほかのスレッドによって並行して変更される可能性があります。" -#: ../../builtins/threadsafety.rst:294 msgid "" "d.update(iterable) # iterable is not a dict: only d locked\n" "d |= iterable # iterable is not a dict: only d locked\n" "dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only " "result locked" msgstr "" +"d.update(iterable) # iterable が dict ではない: d だけをロックする\n" +"d |= iterable # iterable が dict ではない: d だけをロックする\n" +"dict.fromkeys(iterable) # iterable が dict/set/frozenset ではない: 結果だけ" +"をロックする" -#: ../../builtins/threadsafety.rst:301 ../../builtins/threadsafety.rst:434 -#: ../../builtins/threadsafety.rst:525 msgid "" "Operations that involve multiple accesses, as well as iteration, are never " "atomic:" msgstr "" +"複数回のアクセスを伴う操作やイテレーションは、アトミックではありません。" -#: ../../builtins/threadsafety.rst:304 msgid "" "# NOT atomic: read-modify-write\n" "d[key] = d[key] + 1\n" @@ -438,14 +536,24 @@ msgid "" "for key, value in d.items():\n" " process(key) # another thread may modify d" msgstr "" +"# アトミックではない: 読み取り、変更、書き込み\n" +"d[key] = d[key] + 1\n" +"\n" +"# アトミックではない: 確認してから実行 (TOCTOU)\n" +"if key in d:\n" +" del d[key]\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for key, value in d.items():\n" +" process(key) # ほかのスレッドが d を変更する可能性がある" -#: ../../builtins/threadsafety.rst:318 msgid "" "To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic operations " "or handle exceptions:" msgstr "" +"確認から使用までの間に状態が変わる問題 (TOCTOU: time-of-check to time-of-" +"use) を避けるには、アトミックな操作を使うか、例外を処理してください。" -#: ../../builtins/threadsafety.rst:321 msgid "" "# Use pop() with default instead of check-then-delete\n" "d.pop(key, None)\n" @@ -456,34 +564,46 @@ msgid "" "except KeyError:\n" " pass" msgstr "" +"# 確認してから削除する代わりに、デフォルト値付きの pop() を使う\n" +"d.pop(key, None)\n" +"\n" +"# または例外を処理する\n" +"try:\n" +" del d[key]\n" +"except KeyError:\n" +" pass" -#: ../../builtins/threadsafety.rst:333 msgid "" "To safely iterate over a dictionary that may be modified by another thread, " "iterate over a copy:" msgstr "" +"ほかのスレッドによって変更される可能性のある辞書を安全にイテレートするには、" +"コピーをイテレートしてください。" -#: ../../builtins/threadsafety.rst:336 msgid "" "# Make a copy to iterate safely\n" "for key, value in d.copy().items():\n" " process(key)" msgstr "" +"# 安全にイテレートするためにコピーを作成する\n" +"for key, value in d.copy().items():\n" +" process(key)" -#: ../../builtins/threadsafety.rst:343 msgid "" "Consider external synchronization when sharing :class:`dict` instances " "across threads." msgstr "" +"スレッド間で :class:`dict` インスタンスを共有する場合は、外部での同期を検討し" +"てください。" -#: ../../builtins/threadsafety.rst:350 msgid "Thread safety for set objects" -msgstr "" +msgstr "``set`` オブジェクトのスレッドセーフ性" -#: ../../builtins/threadsafety.rst:352 ../../builtins/threadsafety.rst:457 msgid "" "The :func:`len` function is lock-free and :term:`atomic `." msgstr "" +":func:`len` 関数はロックフリーで、:term:`アトミック ` で" +"す。" #: ../../builtins/threadsafety.rst:354 msgid "" @@ -492,9 +612,8 @@ msgid "" "the per-object lock:" msgstr "" -#: ../../builtins/threadsafety.rst:358 msgid "elem in s # set.__contains__" -msgstr "" +msgstr "elem in s # set.__contains__" #: ../../builtins/threadsafety.rst:363 msgid "" @@ -505,41 +624,47 @@ msgid "" "lock during comparisons and this is not a concern." msgstr "" -#: ../../builtins/threadsafety.rst:369 ../../builtins/threadsafety.rst:470 msgid "All other operations from here on hold the per-object lock." -msgstr "" +msgstr "これ以降のほかの操作はすべて、オブジェクトごとのロックを保持します。" -#: ../../builtins/threadsafety.rst:371 msgid "" "Adding or removing a single element is safe to call from multiple threads " "and will not corrupt the set:" msgstr "" +"単一の要素の追加や削除は、複数のスレッドから安全に実行でき、集合を破損させま" +"せん。" -#: ../../builtins/threadsafety.rst:374 msgid "" "s.add(elem) # add element\n" "s.remove(elem) # remove element, raise if missing\n" "s.discard(elem) # remove element if present\n" "s.pop() # remove and return arbitrary element" msgstr "" +"s.add(elem) # 要素を追加する\n" +"s.remove(elem) # 要素を削除し、存在しなければ例外を送出する\n" +"s.discard(elem) # 要素が存在すれば削除する\n" +"s.pop() # 任意の要素を削除して返す" -#: ../../builtins/threadsafety.rst:382 msgid "" "These operations also compare elements, so the same :meth:`~object.__eq__` " "considerations as above apply." msgstr "" +"これらの操作も要素を比較するため、:meth:`~object.__eq__` についての上記と同じ" +"注意事項が当てはまります。" -#: ../../builtins/threadsafety.rst:385 msgid "" "The :meth:`~set.copy` method returns a new object and holds the per-object " "lock for the duration so that it is always atomic." msgstr "" +":meth:`~set.copy` メソッドは新しいオブジェクトを返し、処理中ずっとオブジェク" +"トごとのロックを保持するため、常にアトミックです。" -#: ../../builtins/threadsafety.rst:388 msgid "" "The :meth:`~set.clear` method holds the lock for its duration. Other threads " "cannot observe elements being removed." msgstr "" +":meth:`~set.clear` メソッドは、処理中ずっとロックを保持します。\n" +"ほかのスレッドから、要素が削除されていく途中の状態は観測できません。" #: ../../builtins/threadsafety.rst:391 msgid "" @@ -547,7 +672,6 @@ msgid "" "operands and always lock both objects:" msgstr "" -#: ../../builtins/threadsafety.rst:394 msgid "" "s |= other # other must be set/frozenset\n" "s &= other # other must be set/frozenset\n" @@ -558,13 +682,24 @@ msgid "" "s - other # other must be set/frozenset\n" "s ^ other # other must be set/frozenset" msgstr "" +"s |= other # other は set/frozenset でなければならない\n" +"s &= other # other は set/frozenset でなければならない\n" +"s -= other # other は set/frozenset でなければならない\n" +"s ^= other # other は set/frozenset でなければならない\n" +"s & other # other は set/frozenset でなければならない\n" +"s | other # other は set/frozenset でなければならない\n" +"s - other # other は set/frozenset でなければならない\n" +"s ^ other # other は set/frozenset でなければならない" -#: ../../builtins/threadsafety.rst:406 msgid "" ":meth:`set.update`, :meth:`set.union`, :meth:`set.intersection` and :meth:" "`set.difference` can take multiple iterables as arguments. They all iterate " "through all the passed iterables and do the following:" msgstr "" +":meth:`set.update`、:meth:`set.union`、:meth:`set.intersection`、:meth:`set." +"difference` は、引数として複数のイテラブルを受け取れます。\n" +"これらはいずれも、渡されたすべてのイテラブルをイテレートし、次の処理を行いま" +"す。" #: ../../builtins/threadsafety.rst:410 msgid "" @@ -572,46 +707,48 @@ msgid "" "other operand is a :class:`set`, :class:`frozenset`, or :class:`dict`." msgstr "" -#: ../../builtins/threadsafety.rst:412 msgid "" ":meth:`set.intersection` and :meth:`set.difference` always try to lock all " "objects." msgstr "" +":meth:`set.intersection` と :meth:`set.difference` は、常にすべてのオブジェク" +"トのロックを試みます。" -#: ../../builtins/threadsafety.rst:415 msgid ":meth:`set.symmetric_difference` tries to lock both objects." msgstr "" +":meth:`set.symmetric_difference` は両方のオブジェクトのロックを試みます。" -#: ../../builtins/threadsafety.rst:417 msgid "" "The update variants of the above methods also have some differences between " "them:" -msgstr "" +msgstr "上記のメソッドに対応する更新用メソッドにも、次のような違いがあります。" -#: ../../builtins/threadsafety.rst:420 msgid "" ":meth:`set.difference_update` and :meth:`set.intersection_update` try to " "lock all objects one-by-one." msgstr "" +":meth:`set.difference_update` と :meth:`set.intersection_update` は、すべての" +"オブジェクトを一つずつロックしようとします。" -#: ../../builtins/threadsafety.rst:422 msgid "" ":meth:`set.symmetric_difference_update` only locks the arguments if it is of " "type :class:`set`, :class:`frozenset`, or :class:`dict`." msgstr "" +":meth:`set.symmetric_difference_update` は、引数の型が :class:`set`、:class:" +"`frozenset`、:class:`dict` のいずれかである場合だけ、その引数をロックします。" -#: ../../builtins/threadsafety.rst:425 msgid "The following methods always try to lock both objects:" -msgstr "" +msgstr "次のメソッドは、常に両方のオブジェクトのロックを試みます。" -#: ../../builtins/threadsafety.rst:427 msgid "" "s.isdisjoint(other) # both locked\n" "s.issubset(other) # both locked\n" "s.issuperset(other) # both locked" msgstr "" +"s.isdisjoint(other) # 両方をロックする\n" +"s.issubset(other) # 両方をロックする\n" +"s.issuperset(other) # 両方をロックする" -#: ../../builtins/threadsafety.rst:437 msgid "" "# NOT atomic: check-then-act\n" "if elem in s:\n" @@ -621,49 +758,62 @@ msgid "" "for elem in s:\n" " process(elem) # another thread may modify s" msgstr "" +"# アトミックではない: 確認してから実行\n" +"if elem in s:\n" +" s.remove(elem)\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for elem in s:\n" +" process(elem) # ほかのスレッドが s を変更する可能性がある" -#: ../../builtins/threadsafety.rst:448 msgid "" "Consider external synchronization when sharing :class:`set` instances across " "threads. See :ref:`freethreading-python-howto` for more information." msgstr "" +"スレッド間で :class:`set` インスタンスを共有する場合は、外部での同期を検討し" +"てください。\n" +"詳細については、:ref:`freethreading-python-howto` を参照してください。" -#: ../../builtins/threadsafety.rst:455 msgid "Thread safety for bytearray objects" -msgstr "" +msgstr "``bytearray`` オブジェクトのスレッドセーフ性" -#: ../../builtins/threadsafety.rst:459 msgid "" "Concatenation and comparisons use the buffer protocol, which prevents " "resizing but does not hold the per-object lock. These operations may observe " "intermediate states from concurrent modifications:" msgstr "" +"結合と比較はバッファプロトコルを使います。\n" +"バッファプロトコルはサイズの変更を防ぎますが、オブジェクトごとのロックは保持" +"しません。\n" +"これらの操作は、並行して行われる変更の途中の状態を観測することがあります。" -#: ../../builtins/threadsafety.rst:463 msgid "" "ba + other # may observe concurrent writes\n" "ba == other # may observe concurrent writes\n" "ba < other # may observe concurrent writes" msgstr "" +"ba + other # 並行して行われる書き込みを観測する可能性がある\n" +"ba == other # 並行して行われる書き込みを観測する可能性がある\n" +"ba < other # 並行して行われる書き込みを観測する可能性がある" -#: ../../builtins/threadsafety.rst:472 msgid "" "Reading a single element or slice is safe to call from multiple threads:" msgstr "" +"単一の要素やスライスの読み取りは、複数のスレッドから安全に実行できます。" -#: ../../builtins/threadsafety.rst:474 msgid "" "ba[i] # bytearray.__getitem__\n" "ba[i:j] # slice" msgstr "" +"ba[i] # bytearray.__getitem__\n" +"ba[i:j] # スライス" -#: ../../builtins/threadsafety.rst:480 msgid "" "The following operations are safe to call from multiple threads and will not " "corrupt the bytearray:" msgstr "" +"次の操作は複数のスレッドから安全に実行でき、バイト配列を破損させません。" -#: ../../builtins/threadsafety.rst:483 msgid "" "ba[i] = x # write single byte\n" "ba[i:j] = values # write slice\n" @@ -676,35 +826,45 @@ msgid "" "ba.reverse() # reverse in place\n" "ba.clear() # remove all bytes" msgstr "" +"ba[i] = x # 単一のバイトを書き込む\n" +"ba[i:j] = values # スライスに書き込む\n" +"ba.append(x) # 単一のバイトを末尾に追加する\n" +"ba.extend(other) # イテラブルを使って拡張する\n" +"ba.insert(i, x) # 単一のバイトを挿入する\n" +"ba.pop() # 最後のバイトを削除して返す\n" +"ba.pop(i) # 指定のインデックスのバイトを削除して返す\n" +"ba.remove(x) # 最初に現れた値を削除する\n" +"ba.reverse() # その場で順序を反転する\n" +"ba.clear() # すべてのバイトを削除する" -#: ../../builtins/threadsafety.rst:497 msgid "" "Slice assignment locks both objects when *values* is a :class:`bytearray`:" msgstr "" +"``values`` が :class:`bytearray` の場合、スライスへの代入は両方のオブジェクト" +"をロックします。" -#: ../../builtins/threadsafety.rst:499 msgid "ba[i:j] = other_bytearray # both locked" -msgstr "" +msgstr "ba[i:j] = other_bytearray # 両方をロックする" -#: ../../builtins/threadsafety.rst:504 msgid "" "The following operations return new objects and hold the per-object lock for " "the duration:" msgstr "" +"次の操作は新しいオブジェクトを返し、処理中ずっとオブジェクトごとのロックを保" +"持します。" -#: ../../builtins/threadsafety.rst:507 msgid "" "ba.copy() # returns a shallow copy\n" "ba * n # repeat into new bytearray" msgstr "" +"ba.copy() # 浅いコピーを返す\n" +"ba * n # 繰り返して新しいバイト配列を作成する" -#: ../../builtins/threadsafety.rst:513 msgid "The membership test holds the lock for its duration:" -msgstr "" +msgstr "要素が含まれるかどうかの判定では、処理中ずっとロックを保持します。" -#: ../../builtins/threadsafety.rst:515 msgid "x in ba # bytearray.__contains__" -msgstr "" +msgstr "x in ba # bytearray.__contains__" #: ../../builtins/threadsafety.rst:520 msgid "" @@ -713,7 +873,6 @@ msgid "" "etc.) hold the per-object lock for their duration." msgstr "" -#: ../../builtins/threadsafety.rst:528 msgid "" "# NOT atomic: check-then-act\n" "if x in ba:\n" @@ -723,36 +882,50 @@ msgid "" "for byte in ba:\n" " process(byte) # another thread may modify ba" msgstr "" +"# アトミックではない: 確認してから実行\n" +"if x in ba:\n" +" ba.remove(x)\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for byte in ba:\n" +" process(byte) # ほかのスレッドが ba を変更する可能性がある" -#: ../../builtins/threadsafety.rst:539 msgid "" "To safely iterate over a bytearray that may be modified by another thread, " "iterate over a copy:" msgstr "" +"ほかのスレッドによって変更される可能性のあるバイト配列を安全にイテレートする" +"には、コピーをイテレートしてください。" -#: ../../builtins/threadsafety.rst:542 msgid "" "# Make a copy to iterate safely\n" "for byte in ba.copy():\n" " process(byte)" msgstr "" +"# 安全にイテレートするためにコピーを作成する\n" +"for byte in ba.copy():\n" +" process(byte)" -#: ../../builtins/threadsafety.rst:549 msgid "" "Consider external synchronization when sharing :class:`bytearray` instances " "across threads. See :ref:`freethreading-python-howto` for more information." msgstr "" +"スレッド間で :class:`bytearray` インスタンスを共有する場合は、外部での同期を" +"検討してください。\n" +"詳細については、:ref:`freethreading-python-howto` を参照してください。" -#: ../../builtins/threadsafety.rst:556 msgid "Thread safety for memoryview objects" -msgstr "" +msgstr "``memoryview`` オブジェクトのスレッドセーフ性" -#: ../../builtins/threadsafety.rst:558 msgid "" ":class:`memoryview` objects provide access to the internal data of an " "underlying object without copying. Thread safety depends on both the " "memoryview itself and the underlying buffer exporter." msgstr "" +":class:`memoryview` オブジェクトは、参照先のオブジェクトの内部データに、コ" +"ピーせずにアクセスする手段を提供します。\n" +"スレッドセーフ性は、メモリービュー自体と、参照先のバッファを提供するオブジェ" +"クトの両方によって決まります。" #: ../../builtins/threadsafety.rst:562 msgid "" @@ -764,20 +937,23 @@ msgid "" "memoryview has not been released." msgstr "" -#: ../../builtins/threadsafety.rst:569 msgid "" "However, the actual data accessed through the memoryview is owned by the " "underlying object. Concurrent access to this data is only safe if the " "underlying object supports it:" msgstr "" +"ただし、メモリービューを通じてアクセスする実際のデータは、参照先のオブジェク" +"トが所有しています。\n" +"このデータへの並行アクセスが安全なのは、参照先のオブジェクトがそれをサポート" +"している場合だけです。" -#: ../../builtins/threadsafety.rst:573 msgid "" "For immutable objects like :class:`bytes`, concurrent reads through multiple " "memoryviews are safe." msgstr "" +":class:`bytes` のような不変のオブジェクトでは、複数のメモリービューを通じて並" +"行して読み取っても安全です。" -#: ../../builtins/threadsafety.rst:576 msgid "" "For mutable objects like :class:`bytearray`, reading and writing the same " "memory region from multiple threads without external synchronization is not " @@ -785,8 +961,13 @@ msgid "" "of mutable objects do not prevent data races if the underlying object is " "modified from another thread." msgstr "" +":class:`bytearray` のような可変のオブジェクトでは、外部で同期せずに、複数のス" +"レッドから同じメモリー領域を読み書きするのは安全ではなく、データの破損を引き" +"起こす可能性があります。\n" +"可変のオブジェクトに対する読み取り専用のメモリービューであっても、ほかのス" +"レッドから参照先のオブジェクトが変更されると、データ競合を防げないことに注意" +"してください。" -#: ../../builtins/threadsafety.rst:583 msgid "" "# NOT safe: concurrent writes to the same buffer\n" "data = bytearray(1000)\n" @@ -794,8 +975,12 @@ msgid "" "# Thread 1: view[0:500] = b'x' * 500\n" "# Thread 2: view[0:500] = b'y' * 500" msgstr "" +"# 安全ではない: 同じバッファへの並行書き込み\n" +"data = bytearray(1000)\n" +"view = memoryview(data)\n" +"# スレッド 1: view[0:500] = b'x' * 500\n" +"# スレッド 2: view[0:500] = b'y' * 500" -#: ../../builtins/threadsafety.rst:592 msgid "" "# Safe: use a lock for concurrent access\n" "import threading\n" @@ -806,10 +991,21 @@ msgid "" "with lock:\n" " view[0:500] = b'x' * 500" msgstr "" +"# 安全: 並行アクセスにはロックを使う\n" +"import threading\n" +"lock = threading.Lock()\n" +"data = bytearray(1000)\n" +"view = memoryview(data)\n" +"\n" +"with lock:\n" +" view[0:500] = b'x' * 500" -#: ../../builtins/threadsafety.rst:604 msgid "" "Resizing or reallocating the underlying object (such as calling :meth:" "`bytearray.resize`) while a memoryview is exported raises :exc:" "`BufferError`. This is enforced regardless of threading." msgstr "" +"メモリービューによってバッファが公開されている間に、参照先のオブジェクトのサ" +"イズを変更したり、メモリーを再割り当てしたりすると (:meth:`bytearray.resize` " +"の呼び出しなど)、:exc:`BufferError` が送出されます。\n" +"これは、スレッドの使用に関係なく適用されます。" diff --git a/builtins/time-complexity.po b/builtins/time-complexity.po index 185d0ef79..40837b98e 100644 --- a/builtins/time-complexity.po +++ b/builtins/time-complexity.po @@ -22,29 +22,34 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../builtins/time-complexity.rst:5 msgid "Time complexity of operations on built-in types" -msgstr "" +msgstr "組み込み型の操作の時間計算量" -#: ../../builtins/time-complexity.rst:7 msgid "" "This page documents the time complexity of various operations on built-in " "types in CPython. Other Python implementations may have different " "performance characteristics. Additionally, the listed costs assume exact " "built-in types, as instances of subclasses may have different costs." msgstr "" +"このページでは、CPython の組み込み型に対するさまざまな操作の時間計算量を説明" +"します。\n" +"ほかの Python 実装では、性能の特性が異なる場合があります。\n" +"また、サブクラスのインスタンスではコストが異なる場合があるため、ここに示すコ" +"ストは組み込み型そのものを前提としています。" -#: ../../builtins/time-complexity.rst:12 msgid "" "We use |big O notation|_ to describe how the running time of an operation " "grows with the size of its inputs. Unless stated otherwise, *n* denotes the " "number of elements currently in the container, and *k* is the value of a " "numeric parameter, such as an index or a repeat count." msgstr "" +"|big O notation|_ を使って、入力のサイズに応じて操作の実行時間がどのように増" +"加するかを説明します。\n" +"特に断りのない限り、*n* は現在コンテナに含まれる要素の数を表し、*k* はイン" +"デックスや繰り返し回数などの数値引数の値を表します。" -#: ../../builtins/time-complexity.rst:22 msgid ":class:`!list`" -msgstr "" +msgstr ":class:`!list`" #: ../../builtins/time-complexity.rst:24 msgid "" @@ -65,92 +70,38 @@ msgstr "" msgid "Operation" msgstr "演算" -#: ../../builtins/time-complexity.rst:35 ../../builtins/time-complexity.rst:86 -#: ../../builtins/time-complexity.rst:125 -#: ../../builtins/time-complexity.rst:160 -#: ../../builtins/time-complexity.rst:203 -#: ../../builtins/time-complexity.rst:236 -#: ../../builtins/time-complexity.rst:263 msgid "Complexity" -msgstr "" +msgstr "計算量" -#: ../../builtins/time-complexity.rst:36 msgid "Copy (``l.copy()``)" -msgstr "" +msgstr "コピー (``l.copy()``)" -#: ../../builtins/time-complexity.rst:37 ../../builtins/time-complexity.rst:51 -#: ../../builtins/time-complexity.rst:68 ../../builtins/time-complexity.rst:70 -#: ../../builtins/time-complexity.rst:98 ../../builtins/time-complexity.rst:100 -#: ../../builtins/time-complexity.rst:102 -#: ../../builtins/time-complexity.rst:129 -#: ../../builtins/time-complexity.rst:139 -#: ../../builtins/time-complexity.rst:164 -#: ../../builtins/time-complexity.rst:213 -#: ../../builtins/time-complexity.rst:217 -#: ../../builtins/time-complexity.rst:219 -#: ../../builtins/time-complexity.rst:244 -#: ../../builtins/time-complexity.rst:246 -#: ../../builtins/time-complexity.rst:248 -#: ../../builtins/time-complexity.rst:273 -#: ../../builtins/time-complexity.rst:275 msgid "*O*\\ (*n*)" -msgstr "" +msgstr "*O*\\ (*n*)" -#: ../../builtins/time-complexity.rst:38 msgid "Append (``l.append(x)``) [1]_" -msgstr "" +msgstr "末尾への追加 (``l.append(x)``) [1]_" -#: ../../builtins/time-complexity.rst:39 ../../builtins/time-complexity.rst:45 -#: ../../builtins/time-complexity.rst:47 ../../builtins/time-complexity.rst:72 -#: ../../builtins/time-complexity.rst:88 ../../builtins/time-complexity.rst:90 -#: ../../builtins/time-complexity.rst:104 -#: ../../builtins/time-complexity.rst:127 -#: ../../builtins/time-complexity.rst:131 -#: ../../builtins/time-complexity.rst:133 -#: ../../builtins/time-complexity.rst:135 -#: ../../builtins/time-complexity.rst:141 -#: ../../builtins/time-complexity.rst:162 -#: ../../builtins/time-complexity.rst:166 -#: ../../builtins/time-complexity.rst:168 -#: ../../builtins/time-complexity.rst:186 -#: ../../builtins/time-complexity.rst:205 -#: ../../builtins/time-complexity.rst:221 -#: ../../builtins/time-complexity.rst:238 -#: ../../builtins/time-complexity.rst:240 -#: ../../builtins/time-complexity.rst:242 -#: ../../builtins/time-complexity.rst:250 -#: ../../builtins/time-complexity.rst:265 -#: ../../builtins/time-complexity.rst:267 -#: ../../builtins/time-complexity.rst:269 -#: ../../builtins/time-complexity.rst:271 -#: ../../builtins/time-complexity.rst:277 msgid "*O*\\ (1)" -msgstr "" +msgstr "*O*\\ (1)" -#: ../../builtins/time-complexity.rst:40 msgid "Pop (``l.pop(k)``) [1]_ [2]_" -msgstr "" +msgstr "取り出して削除 (``l.pop(k)``) [1]_ [2]_" -#: ../../builtins/time-complexity.rst:41 ../../builtins/time-complexity.rst:43 -#: ../../builtins/time-complexity.rst:49 msgid "*O*\\ (*n* - *k*)" -msgstr "" +msgstr "*O*\\ (*n* - *k*)" -#: ../../builtins/time-complexity.rst:42 msgid "Insert (``l.insert(k, x)``) [1]_ [2]_" -msgstr "" +msgstr "挿入 (``l.insert(k, x)``) [1]_ [2]_" -#: ../../builtins/time-complexity.rst:44 msgid "Get item (``l[k]``)" -msgstr "" +msgstr "要素の取得 (``l[k]``)" -#: ../../builtins/time-complexity.rst:46 msgid "Set item (``l[k] = x``)" -msgstr "" +msgstr "要素の設定 (``l[k] = x``)" -#: ../../builtins/time-complexity.rst:48 msgid "Delete item (``del l[k]``) [2]_" -msgstr "" +msgstr "要素の削除 (``del l[k]``) [2]_" #: ../../builtins/time-complexity.rst:50 ../../builtins/time-complexity.rst:97 #: ../../builtins/time-complexity.rst:218 @@ -158,130 +109,104 @@ msgstr "" msgid "Iteration" msgstr "イテレーション" -#: ../../builtins/time-complexity.rst:52 msgid "Get slice (``l[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``l[i:j]``)" -#: ../../builtins/time-complexity.rst:53 ../../builtins/time-complexity.rst:92 -#: ../../builtins/time-complexity.rst:207 msgid "*O*\\ (*j* - *i*)" -msgstr "" +msgstr "*O*\\ (*j* - *i*)" -#: ../../builtins/time-complexity.rst:54 msgid "Set slice (``l[i:j] = t``) [1]_" -msgstr "" +msgstr "スライスへの代入 (``l[i:j] = t``) [1]_" -#: ../../builtins/time-complexity.rst:55 msgid "" "*O*\\ (*j* - *i*) if len(*t*) == *j* - *i*, otherwise *O*\\ (*n* - *i* + " "len(*t*))" msgstr "" +"len(*t*) == *j* - *i* の場合は *O*\\ (*j* - *i*)、それ以外の場合は *O*\\ " +"(*n* - *i* + len(*t*))" -#: ../../builtins/time-complexity.rst:57 msgid "Delete slice (``del l[i:j]``)" -msgstr "" +msgstr "スライスの削除 (``del l[i:j]``)" -#: ../../builtins/time-complexity.rst:58 msgid "*O*\\ (*n* - *i*)" -msgstr "" +msgstr "*O*\\ (*n* - *i*)" -#: ../../builtins/time-complexity.rst:59 msgid "Extend (``l.extend(t)``) [1]_ [3]_" -msgstr "" +msgstr "拡張 (``l.extend(t)``) [1]_ [3]_" -#: ../../builtins/time-complexity.rst:60 ../../builtins/time-complexity.rst:137 msgid "*O*\\ (len(*t*))" -msgstr "" +msgstr "*O*\\ (len(*t*))" -#: ../../builtins/time-complexity.rst:61 msgid "Sort (``l.sort()``) [4]_" -msgstr "" +msgstr "ソート (``l.sort()``) [4]_" -#: ../../builtins/time-complexity.rst:62 msgid "*O*\\ (*n* log *n*)" -msgstr "" +msgstr "*O*\\ (*n* log *n*)" -#: ../../builtins/time-complexity.rst:63 msgid "Concatenate (``l1 + l2``)" -msgstr "" +msgstr "結合 (``l1 + l2``)" -#: ../../builtins/time-complexity.rst:64 msgid "*O*\\ (len(*l1*) + len(*l2*))" -msgstr "" +msgstr "*O*\\ (len(*l1*) + len(*l2*))" -#: ../../builtins/time-complexity.rst:65 msgid "Multiply (``l * k``)" -msgstr "" +msgstr "繰り返し (``l * k``)" -#: ../../builtins/time-complexity.rst:66 ../../builtins/time-complexity.rst:96 -#: ../../builtins/time-complexity.rst:211 msgid "*O*\\ (*nk*)" -msgstr "" +msgstr "*O*\\ (*nk*)" -#: ../../builtins/time-complexity.rst:67 msgid "``x in l``" -msgstr "" +msgstr "``x in l``" -#: ../../builtins/time-complexity.rst:69 msgid "``min(l)``, ``max(l)``" -msgstr "" +msgstr "``min(l)``, ``max(l)``" -#: ../../builtins/time-complexity.rst:71 msgid "Get length (``len(l)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(l)``) [5]_" -#: ../../builtins/time-complexity.rst:76 msgid ":class:`!tuple`" -msgstr "" +msgstr ":class:`!tuple`" -#: ../../builtins/time-complexity.rst:78 msgid "" "A :class:`tuple` is an :term:`immutable` sequence. Because a tuple can never " "change, there are no insertion or deletion costs, and making a copy simply " "returns the same object, so is constant time (*O*\\ (1))." msgstr "" +":class:`tuple` は :term:`不変の ` シーケンスです。\n" +"タプルは変更できないため、挿入や削除のコストはありません。\n" +"また、コピーの作成では同じオブジェクトを返すだけなので、定数時間 (*O*\\ (1)) " +"で済みます。" -#: ../../builtins/time-complexity.rst:87 msgid "Copy (``tuple(t)``)" -msgstr "" +msgstr "コピー (``tuple(t)``)" -#: ../../builtins/time-complexity.rst:89 msgid "Get item (``t[k]``)" -msgstr "" +msgstr "要素の取得 (``t[k]``)" -#: ../../builtins/time-complexity.rst:91 msgid "Get slice (``t[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``t[i:j]``)" -#: ../../builtins/time-complexity.rst:93 msgid "Concatenate (``t1 + t2``)" -msgstr "" +msgstr "結合 (``t1 + t2``)" -#: ../../builtins/time-complexity.rst:94 msgid "*O*\\ (len(*t1*) + len(*t2*))" -msgstr "" +msgstr "*O*\\ (len(*t1*) + len(*t2*))" -#: ../../builtins/time-complexity.rst:95 msgid "Multiply (``t * k``)" -msgstr "" +msgstr "繰り返し (``t * k``)" -#: ../../builtins/time-complexity.rst:99 msgid "``x in t``" -msgstr "" +msgstr "``x in t``" -#: ../../builtins/time-complexity.rst:101 msgid "``min(t)``, ``max(t)``" -msgstr "" +msgstr "``min(t)``, ``max(t)``" -#: ../../builtins/time-complexity.rst:103 msgid "Get length (``len(t)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(t)``) [5]_" -#: ../../builtins/time-complexity.rst:108 msgid ":class:`!dict`, :class:`!frozendict`" -msgstr "" +msgstr ":class:`!dict`, :class:`!frozendict`" -#: ../../builtins/time-complexity.rst:110 msgid "" "The times listed for dict objects are average-case times, as they assume the " "hash function for the objects is sufficiently robust to make collisions " @@ -291,149 +216,140 @@ msgid "" "also assume that hashing and comparing a key is *O*\\ (1). For more detail " "on the implementation, see :ref:`how-are-dictionaries-implemented`." msgstr "" +"``dict`` オブジェクトについて示す時間は、平均的な場合の時間です。\n" +"オブジェクトのハッシュ関数が十分に堅牢で、衝突がめったに起こらないことを前提" +"としているためです。\n" +"また、取り得るキーの集合の中で、キーが偏りなく分布していることも前提としてい" +"ます。\n" +"すべてのキーが同じハッシュ値を持つ最悪の場合には、以下で *O*\\ (1) と示す各操" +"作に *O*\\ (*n*) の時間がかかります。\n" +"さらに、キーのハッシュ値の計算と比較が *O*\\ (1) であることも前提としていま" +"す。\n" +"実装の詳細については、:ref:`how-are-dictionaries-implemented` を参照してくだ" +"さい。" -#: ../../builtins/time-complexity.rst:118 msgid "" "A :class:`frozendict` is immutable, so it does not support setting, " "deleting, or updating items. The other operations below apply to it at the " "same costs." msgstr "" +":class:`frozendict` は不変なので、要素の設定、削除、更新をサポートしませ" +"ん。\n" +"以下のほかの操作は、同じコストで適用できます。" -#: ../../builtins/time-complexity.rst:126 msgid "``key in d``" -msgstr "" +msgstr "``key in d``" -#: ../../builtins/time-complexity.rst:128 msgid "Copy (``d.copy()``) [6]_ [7]_" -msgstr "" +msgstr "コピー (``d.copy()``) [6]_ [7]_" -#: ../../builtins/time-complexity.rst:130 msgid "Get item (``d[key]``, ``d.get(key)``)" -msgstr "" +msgstr "要素の取得 (``d[key]``, ``d.get(key)``)" -#: ../../builtins/time-complexity.rst:132 msgid "Set item (``d[key] = value``) [1]_" -msgstr "" +msgstr "要素の設定 (``d[key] = value``) [1]_" -#: ../../builtins/time-complexity.rst:134 msgid "Delete item (``del d[key]``, ``d.pop(key)``)" -msgstr "" +msgstr "要素の削除 (``del d[key]``, ``d.pop(key)``)" -#: ../../builtins/time-complexity.rst:136 msgid "Update (``d.update(t)``, ``d |= t``) [1]_ [3]_ [7]_" -msgstr "" +msgstr "更新 (``d.update(t)``, ``d |= t``) [1]_ [3]_ [7]_" -#: ../../builtins/time-complexity.rst:138 msgid "Iteration [7]_" -msgstr "" +msgstr "イテレーション [7]_" -#: ../../builtins/time-complexity.rst:140 msgid "Get length (``len(d)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(d)``) [5]_" -#: ../../builtins/time-complexity.rst:145 msgid ":class:`!set`, :class:`!frozenset`" -msgstr "" +msgstr ":class:`!set`, :class:`!frozenset`" -#: ../../builtins/time-complexity.rst:147 msgid "" "See :class:`dict` as the :class:`set` and :class:`frozenset` implementations " "are similar, and the same caveats apply. In the worst case, *O*\\ (1) " "operations instead take *O*\\ (*n*) time, and operations that look up every " "element degrade accordingly." msgstr "" +":class:`set` と :class:`frozenset` の実装は辞書と似ていて、同じ注意事項が当て" +"はまるため、:class:`dict` の説明を参照してください。\n" +"最悪の場合、*O*\\ (1) の操作に *O*\\ (*n*) の時間がかかり、すべての要素を検索" +"する操作の性能もそれに応じて低下します。" -#: ../../builtins/time-complexity.rst:152 msgid "" "A :class:`frozenset` is :term:`immutable`, so it does not support adding, " "discarding, or the in-place update operations. The others below apply to it " "at the same costs." msgstr "" +":class:`frozenset` は :term:`不変 ` なので、要素の追加や除去、イン" +"プレースの更新操作をサポートしません。\n" +"以下のほかの操作は、同じコストで適用できます。" #: ../../builtins/time-complexity.rst:161 msgid "``x in s``" msgstr "``x in s``" -#: ../../builtins/time-complexity.rst:163 msgid "Copy (``s.copy()``) [6]_ [7]_" -msgstr "" +msgstr "コピー (``s.copy()``) [6]_ [7]_" -#: ../../builtins/time-complexity.rst:165 msgid "Add (``s.add(x)``) [1]_" -msgstr "" +msgstr "追加 (``s.add(x)``) [1]_" -#: ../../builtins/time-complexity.rst:167 msgid "Discard (``s.discard(x)``, ``s.remove(x)``)" -msgstr "" +msgstr "除去 (``s.discard(x)``, ``s.remove(x)``)" -#: ../../builtins/time-complexity.rst:169 msgid "Union (``s1 | s2``, ``s1.union(s2)``) [7]_" -msgstr "" +msgstr "和集合 (``s1 | s2``, ``s1.union(s2)``) [7]_" -#: ../../builtins/time-complexity.rst:170 -#: ../../builtins/time-complexity.rst:182 msgid "*O*\\ (len(*s1*) + len(*s2*))" -msgstr "" +msgstr "*O*\\ (len(*s1*) + len(*s2*))" -#: ../../builtins/time-complexity.rst:171 msgid "Update (``s1 |= s2``, ``s1.update(s2)``) [1]_ [7]_" -msgstr "" +msgstr "更新 (``s1 |= s2``, ``s1.update(s2)``) [1]_ [7]_" -#: ../../builtins/time-complexity.rst:172 -#: ../../builtins/time-complexity.rst:184 msgid "*O*\\ (len(*s2*))" -msgstr "" +msgstr "*O*\\ (len(*s2*))" -#: ../../builtins/time-complexity.rst:173 msgid "Intersection (``s1 & s2``, ``s1.intersection(s2)``) [7]_ [8]_" -msgstr "" +msgstr "共通集合 (``s1 & s2``, ``s1.intersection(s2)``) [7]_ [8]_" -#: ../../builtins/time-complexity.rst:174 -#: ../../builtins/time-complexity.rst:176 -#: ../../builtins/time-complexity.rst:180 msgid "*O*\\ (min(len(*s1*), len(*s2*)))" -msgstr "" +msgstr "*O*\\ (min(len(*s1*), len(*s2*)))" -#: ../../builtins/time-complexity.rst:175 msgid "" "Intersection update (``s1 &= s2``, ``s1.intersection_update(s2)``) [1]_ [7]_ " "[8]_" msgstr "" +"共通集合による更新 (``s1 &= s2``, ``s1.intersection_update(s2)``) [1]_ [7]_ " +"[8]_" -#: ../../builtins/time-complexity.rst:177 msgid "Difference (``s1 - s2``, ``s1.difference(s2)``) [7]_ [9]_" -msgstr "" +msgstr "差集合 (``s1 - s2``, ``s1.difference(s2)``) [7]_ [9]_" -#: ../../builtins/time-complexity.rst:178 msgid "*O*\\ (len(*s1*))" -msgstr "" +msgstr "*O*\\ (len(*s1*))" -#: ../../builtins/time-complexity.rst:179 msgid "" "Difference update (``s1 -= s2``, ``s1.difference_update(s2)``) [1]_ [7]_ [8]_" msgstr "" +"差集合による更新 (``s1 -= s2``, ``s1.difference_update(s2)``) [1]_ [7]_ [8]_" -#: ../../builtins/time-complexity.rst:181 msgid "" "Symmetric difference (``s1 ^ s2``, ``s1.symmetric_difference(s2)``) [7]_" -msgstr "" +msgstr "対称差 (``s1 ^ s2``, ``s1.symmetric_difference(s2)``) [7]_" -#: ../../builtins/time-complexity.rst:183 msgid "" "Symmetric difference update (``s1 ^= s2``, ``s1." "symmetric_difference_update(s2)``) [1]_ [7]_" msgstr "" +"対称差による更新 (``s1 ^= s2``, ``s1.symmetric_difference_update(s2)``) [1]_ " +"[7]_" -#: ../../builtins/time-complexity.rst:185 -#: ../../builtins/time-complexity.rst:220 msgid "Get length (``len(s)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(s)``) [5]_" -#: ../../builtins/time-complexity.rst:190 msgid ":class:`!str`, :class:`!bytes`, :class:`!bytearray`" -msgstr "" +msgstr ":class:`!str`, :class:`!bytes`, :class:`!bytearray`" -#: ../../builtins/time-complexity.rst:192 msgid "" ":class:`str` and :class:`bytes` objects are immutable sequences of " "characters and bytes, respectively. As with tuples, copying one returns the " @@ -443,130 +359,121 @@ msgid "" "k]``) only advances the start of the buffer instead of moving the remaining " "bytes, and is amortized *O*\\ (1)." msgstr "" +":class:`str` と :class:`bytes` のオブジェクトは、それぞれ文字とバイトからなる" +"不変のシーケンスです。\n" +"タプルと同様に、コピーすると元のオブジェクトが返されます。\n" +":class:`bytearray` は可変で、:class:`list` の変更操作 (:meth:`!sort` を除く) " +"も同じコストでサポートします。\n" +"ただし、``del`` で先頭の要素を削除する場合 (``del b[0]``、``del b[:k]``) は、" +"残りのバイトを移動せず、バッファの開始位置を進めるだけなので、償却計算量は " +"*O*\\ (1) です。" -#: ../../builtins/time-complexity.rst:204 msgid "Get item (``s[k]``)" -msgstr "" +msgstr "要素の取得 (``s[k]``)" -#: ../../builtins/time-complexity.rst:206 msgid "Get slice (``s[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``s[i:j]``)" -#: ../../builtins/time-complexity.rst:208 msgid "Concatenate (``s + t``) [10]_" -msgstr "" +msgstr "結合 (``s + t``) [10]_" -#: ../../builtins/time-complexity.rst:209 msgid "*O*\\ (len(*s*) + len(*t*))" -msgstr "" +msgstr "*O*\\ (len(*s*) + len(*t*))" -#: ../../builtins/time-complexity.rst:210 msgid "Multiply (``s * k``)" -msgstr "" +msgstr "繰り返し (``s * k``)" -#: ../../builtins/time-complexity.rst:212 msgid "Substring search (``x in s``, ``s.find(x)``, ``s.index(x)``) [11]_" -msgstr "" +msgstr "部分文字列の検索 (``x in s``, ``s.find(x)``, ``s.index(x)``) [11]_" -#: ../../builtins/time-complexity.rst:214 msgid "Reverse substring search (``s.rfind(x)``, ``s.rindex(x)``) [11]_ [12]_" -msgstr "" +msgstr "逆方向の部分文字列の検索 (``s.rfind(x)``, ``s.rindex(x)``) [11]_ [12]_" -#: ../../builtins/time-complexity.rst:215 msgid "*O*\\ (*n* × len(*x*))" -msgstr "" +msgstr "*O*\\ (*n* × len(*x*))" -#: ../../builtins/time-complexity.rst:216 msgid "Encode or decode [13]_" -msgstr "" +msgstr "エンコードまたはデコード [13]_" -#: ../../builtins/time-complexity.rst:225 msgid ":class:`!memoryview`" -msgstr "" +msgstr ":class:`!memoryview`" -#: ../../builtins/time-complexity.rst:227 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying. In particular, slicing a memory view returns a new view onto the " "same buffer." msgstr "" +":class:`memoryview` オブジェクトを使うと、Python コードから :ref:`バッファプ" +"ロトコル ` をサポートするオブジェクトの内部データに、コピーせ" +"ずにアクセスできます。\n" +"特に、メモリービューのスライスは、同じバッファを参照する新しいビューを返しま" +"す。" -#: ../../builtins/time-complexity.rst:237 msgid "Create (``memoryview(obj)``)" -msgstr "" +msgstr "作成 (``memoryview(obj)``)" -#: ../../builtins/time-complexity.rst:239 msgid "Get item (``v[k]``)" -msgstr "" +msgstr "要素の取得 (``v[k]``)" -#: ../../builtins/time-complexity.rst:241 msgid "Get slice (``v[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``v[i:j]``)" -#: ../../builtins/time-complexity.rst:243 msgid "Index (``v.index(x)``) [11]_ [14]_" -msgstr "" +msgstr "インデックスの検索 (``v.index(x)``) [11]_ [14]_" -#: ../../builtins/time-complexity.rst:245 msgid "Count (``v.count(x)``) [14]_" -msgstr "" +msgstr "出現回数の取得 (``v.count(x)``) [14]_" -#: ../../builtins/time-complexity.rst:247 msgid "Convert to bytes (``v.tobytes()``, ``bytes(v)``)" -msgstr "" +msgstr "バイト列への変換 (``v.tobytes()``, ``bytes(v)``)" -#: ../../builtins/time-complexity.rst:249 msgid "Get length (``len(v)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(v)``) [5]_" -#: ../../builtins/time-complexity.rst:254 msgid ":class:`!range`" -msgstr "" +msgstr ":class:`!range`" -#: ../../builtins/time-complexity.rst:256 msgid "" "A :class:`range` object computes its items on demand from its *start*, " "*stop* and *step* values, so most operations do not depend on the length of " "the range." msgstr "" +":class:`range` オブジェクトは、``start``、``stop``、``step`` の値から必要に応" +"じて要素を計算するため、ほとんどの操作は範囲の長さに依存しません。" -#: ../../builtins/time-complexity.rst:264 msgid "Get item (``r[k]``)" -msgstr "" +msgstr "要素の取得 (``r[k]``)" -#: ../../builtins/time-complexity.rst:266 msgid "Get slice (``r[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``r[i:j]``)" -#: ../../builtins/time-complexity.rst:268 msgid "``x in r`` [15]_" -msgstr "" +msgstr "``x in r`` [15]_" -#: ../../builtins/time-complexity.rst:270 msgid "Index and count (``r.index(x)``, ``r.count(x)``) [15]_" -msgstr "" +msgstr "インデックスと出現回数の取得 (``r.index(x)``, ``r.count(x)``) [15]_" -#: ../../builtins/time-complexity.rst:274 msgid "``min(r)``, ``max(r)``" -msgstr "" +msgstr "``min(r)``, ``max(r)``" -#: ../../builtins/time-complexity.rst:276 msgid "Get length (``len(r)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(r)``) [5]_" #: ../../builtins/time-complexity.rst:281 msgid "Notes" msgstr "注釈" -#: ../../builtins/time-complexity.rst:283 msgid "" "Amortized. An individual operation may occasionally be *O*\\ (*n*) when the " "underlying storage is resized, but this cost is spread over many operations, " "depending on the history of the container." msgstr "" +"償却計算量です。\n" +"内部の記憶領域のサイズを変更するときに、個々の操作が *O*\\ (*n*) になることが" +"ありますが、コンテナに対してそれまでに行った操作に応じて、このコストは多数の" +"操作に分散されます。" -#: ../../builtins/time-complexity.rst:287 msgid "" "Popping or deleting the element at index *k* of a list of size *n* shifts " "all elements after *k* one slot to the left, moving *n* - *k* - 1 elements; " @@ -576,31 +483,47 @@ msgid "" "of the list, takes *O*\\ (*n*/2) = *O*\\ (*n*) operations; and operating at " "the end of the list moves nothing and is *O*\\ (1)." msgstr "" +"要素数 *n* のリストで、インデックス *k* の要素を取り出して削除するか、単に削" +"除すると、*k* より後のすべての要素が 1 要素分ずつ左にずれ、*n* - *k* - 1 個の" +"要素が移動します。\n" +"インデックス *k* に挿入すると、*k* 以降の要素が 1 要素分ずつ右にずれ、*n* - " +"*k* 個の要素が移動します。\n" +"最悪の場合はインデックスが 0 のときで、リストの残りの要素すべてを移動しなけれ" +"ばなりません。\n" +"平均的な場合はリストの中央のインデックスで、*O*\\ (*n*/2) = *O*\\ (*n*) の操" +"作が必要です。\n" +"リストの末尾で操作する場合は何も移動せず、*O*\\ (1) です。" -#: ../../builtins/time-complexity.rst:296 msgid "" "Plus the cost of iterating over *t*, which may be expensive for an arbitrary " "iterable." msgstr "" +"これに加えて、*t* をイテレートするコストがかかります。\n" +"任意のイテラブルでは、このコストが高くなる場合があります。" -#: ../../builtins/time-complexity.rst:299 msgid "" "This is the worst case scenario. Sorting is adaptive and input that is " "already sorted or reverse-sorted takes only *O*\\ (*n*) comparisons. See :" "source:`Objects/listsort.txt` for more information." msgstr "" +"これは最悪の場合です。\n" +"ソートは入力の状態に適応するため、すでにソート済み、または逆順にソート済みの" +"入力では、比較は *O*\\ (*n*) 回で済みます。\n" +"詳細については、:source:`Objects/listsort.txt` を参照してください。" -#: ../../builtins/time-complexity.rst:303 msgid "" "The number of elements is stored in the object, so ``len()`` does not need " "to count them." msgstr "" +"要素数はオブジェクトに格納されているため、``len()`` が要素を数える必要はあり" +"ません。" -#: ../../builtins/time-complexity.rst:306 msgid "" "Copying a :class:`frozendict` or a :class:`frozenset` is *O*\\ (1) as it " "returns the original object." msgstr "" +":class:`frozendict` または :class:`frozenset` のコピーは元のオブジェクトを返" +"すため、*O*\\ (1) です。" #: ../../builtins/time-complexity.rst:309 msgid "" @@ -610,21 +533,23 @@ msgid "" "insertion triggers a resize." msgstr "" -#: ../../builtins/time-complexity.rst:314 msgid "*O*\\ (len(*t*)) if *t* is not a set." -msgstr "" +msgstr "*t* が集合型のオブジェクトでない場合は *O*\\ (len(*t*)) です。" -#: ../../builtins/time-complexity.rst:316 msgid "*O*\\ (len(*s*) + len(*t*)) if *t* is not a set." msgstr "" +"*t* が集合型のオブジェクトでない場合は *O*\\ (len(*s*) + len(*t*)) です。" -#: ../../builtins/time-complexity.rst:318 msgid "" "Each concatenation builds a new object, so building a string by " "concatenating many pieces in a loop is quadratic in the total length. See " "the :ref:`note on concatenating immutable sequences ` for alternatives." msgstr "" +"結合のたびに新しいオブジェクトが作成されるため、ループ内で多数の断片を結合し" +"て文字列を構築すると、実行時間は全体の長さの二乗に比例します。\n" +"ほかの方法については、:ref:`不変のシーケンスの結合に関する注記 ` を参照してください。" #: ../../builtins/time-complexity.rst:323 msgid "" @@ -632,26 +557,33 @@ msgid "" "rather than of *s*, and unlike slicing nothing is copied." msgstr "" -#: ../../builtins/time-complexity.rst:326 msgid "" "This is the worst case. Reverse searches are *O*\\ (*n*) on typical input. " "Forward searches instead use a more elaborate algorithm with a linear worst " "case, described in :source:`Objects/stringlib/stringlib_find_two_way_notes." "txt`." msgstr "" +"これは最悪の場合です。\n" +"通常の入力では、逆方向の検索は *O*\\ (*n*) です。\n" +"一方、順方向の検索は、最悪の場合でも線形時間となる、より精巧なアルゴリズムを" +"使います。\n" +"このアルゴリズムは :source:`Objects/stringlib/stringlib_find_two_way_notes." +"txt` で説明しています。" -#: ../../builtins/time-complexity.rst:331 msgid "This assumes a codec that does a constant amount of work per character." -msgstr "" +msgstr "1 文字ごとに一定量の処理を行うコーデックを前提としています。" -#: ../../builtins/time-complexity.rst:333 msgid "" "These unpack and compare each element individually, so they are much slower " "than the equivalent :class:`bytes` methods." msgstr "" +"これらの操作は各要素を個別にアンパックして比較するため、対応する :class:" +"`bytes` のメソッドよりはるかに遅くなります。" -#: ../../builtins/time-complexity.rst:336 msgid "" "Assuming :class:`int` or :class:`bool` arguments. For other types, the range " "is searched like any other sequence in *O*\\ (*n*) time." msgstr "" +"引数が :class:`int` または :class:`bool` であることを前提としています。\n" +"ほかの型の場合は、ほかのシーケンスと同様に、``range`` オブジェクト内を *O*\\ " +"(*n*) の時間で検索します。" diff --git a/library/constants.po b/library/constants.po index 5b4c276bb..ca82ea468 100644 --- a/library/constants.po +++ b/library/constants.po @@ -46,15 +46,17 @@ msgstr "" ":class:`bool` 型の真値です。``True`` への代入は不正で、:exc:`SyntaxError` を" "送出します。" -#: ../../library/constants.rst:22 msgid "" "An object frequently used to represent the absence of a value, as when " "default arguments are not passed to a function. Assignments to ``None`` are " "illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of " "the :class:`~types.NoneType` type." msgstr "" +"関数にデフォルト引数が渡されなかった場合など、値が存在しないことを表すために" +"よく使われるオブジェクトです。\n" +"``None`` への代入は不正で、:exc:`SyntaxError` を送出します。\n" +"``None`` は :class:`~types.NoneType` 型の唯一のインスタンスです。" -#: ../../library/constants.rst:30 msgid "" "A special value which should be returned by the binary special methods (e." "g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" @@ -65,6 +67,15 @@ msgid "" "boolean context. :data:`!NotImplemented` is the sole instance of the :class:" "`types.NotImplementedType` type." msgstr "" +"二項演算の特殊メソッド (例えば :meth:`~object.__eq__`、:meth:`~object." +"__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` など) が、\n" +"もう一方の型に対する演算を実装していないことを示すために返すべき特殊な値で" +"す。\n" +"インプレースの二項演算の特殊メソッド (例えば :meth:`~object.__imul__`、:meth:" +"`~object.__iand__` など) も、同じ目的でこの値を返せます。\n" +"真偽値として評価してはいけません。\n" +":data:`!NotImplemented` は :class:`types.NotImplementedType` 型の唯一のインス" +"タンスです。" msgid "" "When a binary (or in-place) method returns :data:`!NotImplemented` the " @@ -90,31 +101,41 @@ msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "" "例として :ref:`implementing-the-arithmetic-operations` を参照してください。" -#: ../../library/constants.rst:51 msgid "" ":data:`!NotImplemented` and :exc:`!NotImplementedError` are not " "interchangeable. This constant should only be used as described above; see :" "exc:`NotImplementedError` for details on correct usage of the exception." msgstr "" +":data:`!NotImplemented` と :exc:`!NotImplementedError` は互いに置き換えられま" +"せん。\n" +"この定数は、上で説明した用途にのみ使ってください。\n" +"例外の正しい使い方については :exc:`NotImplementedError` を参照してください。" -#: ../../library/constants.rst:56 msgid "Evaluating :data:`!NotImplemented` in a boolean context was deprecated." msgstr "" +":data:`!NotImplemented` を真偽値として評価することは非推奨となりました。" -#: ../../library/constants.rst:59 msgid "" "Evaluating :data:`!NotImplemented` in a boolean context now raises a :exc:" "`TypeError`. It previously evaluated to :const:`True` and emitted a :exc:" "`DeprecationWarning` since Python 3.9." msgstr "" +":data:`!NotImplemented` を真偽値として評価すると、:exc:`TypeError` が送出され" +"るようになりました。\n" +"以前は :const:`True` と評価され、Python 3.9 以降では :exc:" +"`DeprecationWarning` も発生していました。" -#: ../../library/constants.rst:68 msgid "" "The same as the ellipsis literal \"``...``\", an object frequently used to " "indicate that something is omitted. Assignment to ``Ellipsis`` is possible, " "but assignment to ``...`` raises a :exc:`SyntaxError`. ``Ellipsis`` is the " "sole instance of the :class:`types.EllipsisType` type." msgstr "" +"省略を示すリテラル \"``...``\" と同じオブジェクトで、何かが省略されていること" +"を示すためによく使われます。\n" +"``Ellipsis`` には代入できますが、``...`` に代入すると :exc:`SyntaxError` が送" +"出されます。\n" +"``Ellipsis`` は :class:`types.EllipsisType` 型の唯一のインスタンスです。" #: ../../library/constants.rst:76 msgid "" @@ -151,20 +172,26 @@ msgstr "" "かの定数を追加します。それらは対話的インタープリタシェルで有用ですが、プログ" "ラム中では使うべきではありません。" -#: ../../library/constants.rst:100 msgid "" "Objects that when printed, print a message like \"Use quit() or Ctrl-D (i.e. " "EOF) to exit\", and when accessed directly in the interactive interpreter or " "called as functions, raise :exc:`SystemExit` with the specified exit code." msgstr "" +"表示すると \"Use quit() or Ctrl-D (i.e. EOF) to exit\" のようなメッセージを表" +"示するオブジェクトです。\n" +"対話型インタープリタで直接入力するか、関数として呼び出すと、指定した終了コー" +"ドで :exc:`SystemExit` を送出します。" -#: ../../library/constants.rst:108 msgid "" "Object that when printed, prints the message \"Type help() for interactive " "help, or help(object) for help about object.\", and when accessed directly " "in the interactive interpreter, invokes the built-in help system (see :func:" "`help`)." msgstr "" +"表示すると \"Type help() for interactive help, or help(object) for help " +"about object.\" というメッセージを表示するオブジェクトです。\n" +"対話型インタープリタで直接入力すると、組み込みヘルプシステムを起動します (:" +"func:`help` を参照してください)。" #: ../../library/constants.rst:116 msgid "" diff --git a/library/exceptions.po b/library/exceptions.po index d4ef1adf6..96c8026e4 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -94,7 +94,6 @@ msgid "" msgstr "" "例外オブジェクトの3つの属性は、例外が送出された状況に関する情報を提供します:" -#: ../../library/exceptions.rst:53 msgid "" "When raising a new exception while another exception is already being " "handled, the new exception's :attr:`!__context__` attribute is automatically " @@ -102,16 +101,20 @@ msgid "" "`except` or :keyword:`finally` clause, or a :keyword:`with` statement, is " "used." msgstr "" +"別の例外の処理中に新しい例外を送出すると、新しい例外の :attr:`!__context__` " +"属性には、処理中の例外が自動的に設定されます。\n" +"例外の処理は、:keyword:`except` 節、:keyword:`finally` 節、:keyword:`with` 文" +"を使うときに行われることがあります。" -#: ../../library/exceptions.rst:59 msgid "" "This implicit exception context can be supplemented with an explicit cause " "by using :keyword:`!from` with :keyword:`raise`::" msgstr "" +":keyword:`raise` とともに :keyword:`!from` を使うと、この暗黙の例外コンテキス" +"トに明示的な原因を付け加えられます。 ::" -#: ../../library/exceptions.rst:63 msgid "raise new_exc from original_exc" -msgstr "" +msgstr "raise new_exc from original_exc" msgid "" "The expression following :keyword:`from` must be an exception or " @@ -159,15 +162,17 @@ msgstr "" msgid "Inheriting from built-in exceptions" msgstr "組み込み例外から継承する" -#: ../../library/exceptions.rst:88 msgid "" "User code can create subclasses that inherit from an exception type. It's " "recommended to only subclass one exception type at a time to avoid any " "possible conflicts between how the bases handle the ``args`` attribute, as " "well as due to possible memory layout incompatibilities." msgstr "" +"ユーザコードでは、例外型を継承したサブクラスを作成できます。\n" +"基底クラス間で ``args`` 属性の扱いが衝突したり、メモリレイアウトの互換性に問" +"題が生じたりする可能性があるため、\n" +"一度に継承する例外型は一つだけにすることを推奨します。" -#: ../../library/exceptions.rst:95 msgid "" "Most built-in exceptions are implemented in C for efficiency, see: :source:" "`Objects/exceptions.c`. Some have custom memory layouts which makes it " @@ -176,6 +181,13 @@ msgid "" "between Python versions, leading to new conflicts in the future. Therefore, " "it's recommended to avoid subclassing multiple exception types altogether." msgstr "" +"ほとんどの組み込み例外は効率のために C で実装されています (:source:`Objects/" +"exceptions.c` を参照してください)。\n" +"一部の例外は独自のメモリレイアウトを持つため、そうした例外型の組み合わせでは" +"多重継承できません。\n" +"型のメモリレイアウトは実装の詳細であり、Python のバージョンによって変わり、将" +"来新たな衝突が生じる可能性があります。\n" +"そのため、複数の例外型からの継承は避けることを推奨します。" #: ../../library/exceptions.rst:105 msgid "Base classes" @@ -212,7 +224,6 @@ msgstr "" "`OSError` など) いくつかの引数を必要とし、このタプルの要素に特別な意味を込め" "るものもあります。" -#: ../../library/exceptions.rst:126 msgid "" "This method sets *tb* as the new traceback for the exception and returns the " "exception object. It was more commonly used before the exception chaining " @@ -223,8 +234,17 @@ msgid "" "happened to the traceback of the original ``SomeException`` had we allowed " "it to propagate to the caller. ::" msgstr "" +"このメソッドは、例外の新しいトレースバックに *tb* を設定し、その例外オブジェ" +"クトを返します。\n" +":pep:`3134` の例外連鎖機能が使えるようになる前は、より広く使われていまし" +"た。\n" +"次の例は、トレースバックを保持しながら ``SomeException`` のインスタンスを " +"``OtherException`` のインスタンスに変換する方法を示します。\n" +"``OtherException`` を送出すると、そのトレースバックに現在のフレームが追加され" +"ます。\n" +"元の ``SomeException`` を呼び出し元に伝播させた場合にも、そのトレースバックに" +"同じようにフレームが追加されます。 ::" -#: ../../library/exceptions.rst:135 msgid "" "try:\n" " ...\n" @@ -232,12 +252,19 @@ msgid "" " tb = sys.exception().__traceback__\n" " raise OtherException(...).with_traceback(tb)" msgstr "" +"try:\n" +" ...\n" +"except SomeException:\n" +" tb = sys.exception().__traceback__\n" +" raise OtherException(...).with_traceback(tb)" -#: ../../library/exceptions.rst:143 msgid "" "A writable field that holds the :ref:`traceback object ` " "associated with this exception. See also: :ref:`raise`." msgstr "" +"この例外に関連付けられた :ref:`トレースバックオブジェクト ` を保持する、書き込み可能なフィールドです。\n" +":ref:`raise` も参照してください。" #: ../../library/exceptions.rst:149 msgid "" @@ -314,30 +341,32 @@ msgstr "" "ます (オブジェクトが属性の参照や属性の代入をまったくサポートしていない場合に" "は :exc:`TypeError` が送出されます)。" -#: ../../library/exceptions.rst:207 msgid "" "The optional *name* and *obj* keyword-only arguments set the corresponding " "attributes:" msgstr "" +"オプションのキーワード専用引数 *name* と *obj* は、対応する属性に値を設定しま" +"す:" -#: ../../library/exceptions.rst:212 msgid "The name of the attribute that was attempted to be accessed." -msgstr "" +msgstr "アクセスしようとした属性の名前。" -#: ../../library/exceptions.rst:216 msgid "The object that was accessed for the named attribute." -msgstr "" +msgstr "指定した名前の属性にアクセスしようとした対象のオブジェクト。" #: ../../library/exceptions.rst:218 msgid "Added the :attr:`name` and :attr:`obj` attributes." msgstr ":attr:`name` および :attr:`obj` 属性が追加されました。" -#: ../../library/exceptions.rst:223 msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " "without reading any data. (Note: the :meth:`io.TextIOBase.read` and :meth:" "`io.IOBase.readline` methods return an empty string when they hit EOF.)" msgstr "" +":func:`input` 関数がデータを何も読み込まずにファイル終端 (EOF) に達した場合に" +"送出されます。\n" +"(注: :meth:`io.TextIOBase.read` メソッドと :meth:`io.IOBase.readline` メソッ" +"ドは、EOF に達すると空文字列を返します。)" #: ../../library/exceptions.rst:230 msgid "Not currently used." @@ -395,11 +424,12 @@ msgstr "" "ない場合に送出されます。また、 :data:`sys.modules` に ``None`` が含まれる場合" "にも送出されます。" -#: ../../library/exceptions.rst:271 msgid "" "A subclass of :exc:`ImportError` which is raised when a lazy import fails " "because it (directly or indirectly) tries to import itself." msgstr "" +":exc:`ImportError` のサブクラスで、遅延インポートが自身を直接または間接的にイ" +"ンポートしようとして失敗した場合に送出されます。" #: ../../library/exceptions.rst:278 msgid "" @@ -432,7 +462,6 @@ msgstr "" "を捕捉するコードに誤って捕捉されてインタプリタの終了が阻害されないように、こ" "の例外は :exc:`BaseException` を継承しています。" -#: ../../library/exceptions.rst:302 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -440,6 +469,13 @@ msgid "" "allow :exc:`KeyboardInterrupt` to end the program as quickly as possible or " "avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" msgstr "" +":exc:`KeyboardInterrupt` の捕捉には特別な配慮が必要です。\n" +"この例外は予測できない箇所で送出される可能性があるため、状況によっては、実行" +"中のプログラムが不整合な状態になることがあります。\n" +"一般には、:exc:`KeyboardInterrupt` によってできるだけ速やかにプログラムを終了" +"させるか、\n" +"この例外の送出自体を避けるのが最善です (:ref:`handlers-and-exceptions` を参照" +"してください)。" #: ../../library/exceptions.rst:312 msgid "" @@ -469,13 +505,11 @@ msgstr "" "修飾の (訳注: ``spam.egg`` ではなく単に ``egg`` のような) 名前のみに適用され" "ます。関連値は見つからなかった名前を含むエラーメッセージです。" -#: ../../library/exceptions.rst:327 msgid "The optional *name* keyword-only argument sets the attribute:" -msgstr "" +msgstr "オプションのキーワード専用引数 *name* は、次の属性に値を設定します:" -#: ../../library/exceptions.rst:331 msgid "The name of the variable that was attempted to be accessed." -msgstr "" +msgstr "アクセスしようとした変数の名前。" #: ../../library/exceptions.rst:333 msgid "Added the :attr:`name` attribute." @@ -493,22 +527,26 @@ msgstr "" "また、クラスの開発中に、実際の実装をまだ追加する必要があることを示すためにも" "送出するべきです。" -#: ../../library/exceptions.rst:346 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -"演算子やメソッドがサポートされていないことを示す目的でこの例外を使用するべき" -"ではありません。そのようなケースではオペレータやメソッドを未定義のままとする" -"か、サブクラスの場合は :data:`None` を設定してください。" +"演算子やメソッドをそもそもサポートする意図がないことを示すために、この例外を" +"使うべきではありません。\n" +"その場合は演算子やメソッドを未定義のままにするか、サブクラスであれば :data:" +"`None` を設定してください。" -#: ../../library/exceptions.rst:352 msgid "" ":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " "interchangeable. This exception should only be used as described above; see :" "data:`NotImplemented` for details on correct usage of the built-in constant." msgstr "" +":exc:`!NotImplementedError` と :data:`!NotImplemented` は互いに置き換えられま" +"せん。\n" +"この例外は、上で説明した用途にのみ使ってください。\n" +"組み込み定数の正しい使い方については :data:`NotImplemented` を参照してくださ" +"い。" #: ../../library/exceptions.rst:363 msgid "" @@ -591,12 +629,15 @@ msgstr "" "ファイルシステムパスが2つ関与する関数 (例えば :func:`os.rename`) の場合、:" "attr:`filename2` は関数に渡された2つ目のファイル名です。" -#: ../../library/exceptions.rst:412 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :" "exc:`OSError`, and the constructor may return a subclass." msgstr "" +":exc:`EnvironmentError`、:exc:`IOError`、:exc:`WindowsError`、:exc:`socket." +"error`、:exc:`select.error`、:exc:`!mmap.error` は :exc:`OSError` に統合さ" +"れ、\n" +"コンストラクタはサブクラスを返すことがあります。" msgid "" "The :attr:`filename` attribute is now the original file name passed to the " @@ -624,36 +665,37 @@ msgstr "" "出されることがあります。C の浮動小数点演算の例外処理は標準化されていないの" "で、ほとんどの浮動小数点演算もチェックされません。" -#: ../../library/exceptions.rst:437 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when an " "operation is blocked during interpreter shutdown also known as :term:`Python " "finalization `." msgstr "" +"この例外は :exc:`RuntimeError` から派生しています。\n" +":term:`Python の終了処理 ` とも呼ばれるインタープリタの" +"シャットダウン中に、操作が阻止された場合に送出されます。" -#: ../../library/exceptions.rst:441 msgid "" "Examples of operations which can be blocked with a :exc:" "`PythonFinalizationError` during the Python finalization:" msgstr "" +"Python の終了処理中に :exc:`PythonFinalizationError` によって阻止されることが" +"ある操作の例:" -#: ../../library/exceptions.rst:444 msgid "Creating a new Python thread." -msgstr "" +msgstr "新しい Python スレッドの作成。" -#: ../../library/exceptions.rst:445 msgid ":meth:`Joining ` a running daemon thread." -msgstr "" +msgstr "実行中のデーモンスレッドの :meth:`終了待機 `。" -#: ../../library/exceptions.rst:446 msgid ":func:`os.fork`," -msgstr "" +msgstr ":func:`os.fork` の呼び出し。" -#: ../../library/exceptions.rst:447 msgid "" "acquiring a lock such as :class:`threading.Lock`, when it is known that the " "operation would otherwise deadlock." msgstr "" +"そのまま操作を進めるとデッドロックすると分かっている場合の、:class:" +"`threading.Lock` などのロックの獲得。" #: ../../library/exceptions.rst:450 msgid "See also the :func:`sys.is_finalizing` function." @@ -663,9 +705,10 @@ msgstr ":func:`sys.is_finalizing` 関数も参照してください。" msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "以前は :exc:`RuntimeError` をそのまま送出していました。" -#: ../../library/exceptions.rst:457 msgid ":meth:`threading.Thread.join` can now raise this exception." msgstr "" +":meth:`threading.Thread.join` がこの例外を送出することがあるようになりまし" +"た。" #: ../../library/exceptions.rst:461 msgid "" @@ -773,16 +816,17 @@ msgstr "" "イテレーションを停止するために、:term:`asynchronous iterator` オブジェクト" "の :meth:`~object.__anext__` メソッドから送出しなければなりません。" -#: ../../library/exceptions.rst:531 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" "`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script " "or standard input (also interactively)." msgstr "" -"パーザが構文エラーに遭遇した場合に送出されます。この例外は :keyword:`import` " -"文、組み込み関数 :func:`compile`、:func:`exec` や :func:`eval` 、初期化スクリ" -"プトの読み込みや標準入力で (対話的な実行時にも) 起こる可能性があります。" +"パーザが構文エラーに遭遇した場合に送出されます。\n" +"この例外は、:keyword:`import` 文、組み込み関数 :func:`compile`、:func:" +"`exec`、:func:`eval` の呼び出し、\n" +"最初に実行するスクリプトや標準入力の読み込み時 (対話的な実行時も含みます) に" +"起こる可能性があります。" #: ../../library/exceptions.rst:537 msgid "" @@ -860,7 +904,6 @@ msgstr "" "タブとスペースを一貫しない方法でインデントに使っているときに送出されます。こ" "れは :exc:`IndentationError` のサブクラスです。" -#: ../../library/exceptions.rst:590 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " @@ -868,8 +911,12 @@ msgid "" "`CPython`, this could be raised by incorrectly using Python's C API, such as " "returning a ``NULL`` value without an exception set." msgstr "" +"インタープリタが内部エラーを検出したものの、実行の継続を断念するほど深刻な状" +"況ではない場合に送出されます。\n" +"関連値は、何が問題だったのかを低水準の用語で示す文字列です。\n" +":term:`CPython` では、例外を設定せずに ``NULL`` 値を返すなど、Python の C " +"API を誤って使うと送出されることがあります。" -#: ../../library/exceptions.rst:596 msgid "" "If you're confident that this exception wasn't your fault, or the fault of a " "package you're using, you should report this to the author or maintainer of " @@ -879,8 +926,14 @@ msgid "" "associated value) and if possible the source of the program that triggered " "the error." msgstr "" +"この例外の原因が自分のコードにも使用中のパッケージにもないと確信できる場合" +"は、\n" +"使用している Python インタープリタの作者やメンテナに報告してください。\n" +"Python インタープリタのバージョン (``sys.version`` の値で、対話型 Python セッ" +"ションの開始時にも表示されます)、\n" +"正確なエラーメッセージ (例外の関連値)、可能であればエラーを引き起こしたプログ" +"ラムのソースを必ず報告してください。" -#: ../../library/exceptions.rst:607 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -893,6 +946,18 @@ msgid "" "is zero; if it has another type (such as a string), the object's value is " "printed and the exit status is one." msgstr "" +"この例外は :func:`sys.exit` 関数によって送出されます。\n" +":exc:`Exception` を捕捉するコードに誤って捕捉されないように、:exc:" +"`Exception` ではなく :exc:`BaseException` を継承しています。\n" +"これにより、例外が適切に伝播し、インタープリタを終了できます。\n" +"この例外が処理されない場合、Python インタープリタは終了し、スタックトレース" +"バックは表示されません。\n" +"コンストラクタには、:func:`sys.exit` と同じオプションの引数を渡せます。\n" +"値が整数の場合は、システムの終了ステータスを指定します (C の :c:func:`!exit` " +"関数に渡されます)。\n" +"``None`` の場合、終了ステータスはゼロです。\n" +"それ以外の型 (文字列など) の場合、オブジェクトの値が表示され、終了ステータス" +"は1になります。" #: ../../library/exceptions.rst:618 msgid "" @@ -917,26 +982,25 @@ msgstr "" "コンストラクタに渡された終了ステータス又はエラーメッセージ。(デフォルトは " "``None``)" -#: ../../library/exceptions.rst:633 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -"組み込み演算または関数が適切でない型のオブジェクトに対して適用された際に送出" -"されます。関連値は型の不整合に関して詳細を述べた文字列です。" +"演算や関数を適切でない型のオブジェクトに適用した場合に送出されます。\n" +"関連値は、型の不整合の詳細を示す文字列です。" -#: ../../library/exceptions.rst:636 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " "object is meant to support a given operation but has not yet provided an " "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -"この例外は、そのオブジェクトで実行しようとした操作がサポートされておらず、そ" -"の予定もない場合にユーザーコードから送出されるかもしれません。オブジェクトで" -"その操作をサポートするつもりだが、まだ実装を提供していないのであれば、送出す" -"る適切な例外は :exc:`NotImplementedError` です。" +"そのオブジェクトで実行しようとした操作がサポートされておらず、サポートする意" +"図もないことを示すために、\n" +"ユーザコードからこの例外を送出することもできます。\n" +"操作をサポートする意図はあるものの、まだ実装していない場合には、:exc:" +"`NotImplementedError` を送出するのが適切です。" #: ../../library/exceptions.rst:641 msgid "" @@ -993,11 +1057,12 @@ msgstr "コーデックがエンコードまたはデコードしようとした msgid "The first index of invalid data in :attr:`object`." msgstr ":attr:`object` の最初の無効なデータのインデクスです。" -#: ../../library/exceptions.rst:678 ../../library/exceptions.rst:685 msgid "" "This value should not be negative as it is interpreted as an absolute offset " "but this constraint is not enforced at runtime." msgstr "" +"この値は絶対オフセットとして解釈されるため、負の値にすべきではありませんが、" +"この制約は実行時には強制されません。" #: ../../library/exceptions.rst:683 msgid "The index after the last invalid data in :attr:`object`." @@ -1087,12 +1152,14 @@ msgstr "" ":exc:`BlockingIOError` は、 :exc:`OSError` の属性に加えて一つの属性を持ちま" "す:" -#: ../../library/exceptions.rst:751 msgid "" "An integer containing the number of **bytes** written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" +"ブロックするまでにストリームへ書き込まれた **バイト数** を表す整数です。\n" +"この属性は、:mod:`io` モジュールのバッファ付き I/O クラスを使う場合に利用でき" +"ます。" #: ../../library/exceptions.rst:757 msgid "" @@ -1171,13 +1238,12 @@ msgstr "" "要求されたファイルやディレクトリが存在しない場合に送出されます。:c:data:" "`errno` :py:const:`~errno.ENOENT` に対応します。" -#: ../../library/exceptions.rst:804 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" -"システムコールが入力信号によって中断された場合に送出されます。:c:data:" -"`errno` :py:const:`~errno.EINTR` に対応します。" +"システムコールが受信したシグナルによって中断された場合に送出されます。\n" +":c:data:`errno` :py:const:`~errno.EINTR` に対応します。" #: ../../library/exceptions.rst:807 msgid "" @@ -1197,7 +1263,6 @@ msgstr "" "ディレクトリに (:func:`os.remove` などの) ファイル操作が要求された場合に送出" "されます。:c:data:`errno` :py:const:`~errno.EISDIR` に対応します。" -#: ../../library/exceptions.rst:820 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -1205,10 +1270,12 @@ msgid "" "as if it were a directory. Corresponds to :c:data:`errno` :py:const:`~errno." "ENOTDIR`." msgstr "" -"ディレクトリへの操作(たとえば :func:`os.listdir`)をディレクトリ以外に対して要" -"求された場合に送出されます。多くのPOSIXプラットフォームではディレクトリではな" -"いファイルをディレクトリとして開いたり移動するときにも発生する場合がありま" -"す。:c:data:`errno` :py:const:`~errno.ENOTDIR` に対応します。" +"ディレクトリに対する操作 (例えば :func:`os.listdir`) がディレクトリ以外の対象" +"に要求された場合に送出されます。\n" +"ほとんどの POSIX プラットフォームでは、ディレクトリでないファイルをディレクト" +"リとして開いたり、\n" +"パスをたどろうとしたりした場合にも送出されることがあります。\n" +":c:data:`errno` :py:const:`~errno.ENOTDIR` に対応します。" #: ../../library/exceptions.rst:828 msgid "" @@ -1273,13 +1340,11 @@ msgstr "警告カテゴリの基底クラスです。" msgid "Base class for warnings generated by user code." msgstr "ユーザコードによって生成される警告の基底クラスです。" -#: ../../library/exceptions.rst:876 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -"他の Python 開発者へ向けて警告を発するときの、廃止予定の機能についての警告の" -"基底クラスです。" +"非推奨の機能について、他の Python 開発者に向けて発する警告の基底クラスです。" #: ../../library/exceptions.rst:879 msgid "" @@ -1291,9 +1356,8 @@ msgstr "" "化されています。:ref:`Python Development Mode ` を有効にするとこの警" "告が表示されます。" -#: ../../library/exceptions.rst:883 ../../library/exceptions.rst:899 msgid "The deprecation policy is described in :pep:`387`." -msgstr "" +msgstr "非推奨化の方針は :pep:`387` で説明されています。" msgid "" "Base class for warnings about features which are obsolete and expected to be " @@ -1320,15 +1384,15 @@ msgstr "" "デフォルトの警告フィルターで無効化されています。:ref:`Python Development " "Mode ` を有効にするとこの警告が表示されます。" -#: ../../library/exceptions.rst:904 msgid "Base class for warnings about dubious syntax." -msgstr "曖昧な構文に対する警告の基底クラスです。" +msgstr "疑わしい構文についての警告の基底クラスです。" -#: ../../library/exceptions.rst:906 msgid "" "This warning is typically emitted when compiling Python source code, and " "usually won't be reported when running already compiled code." msgstr "" +"この警告は通常、Python ソースコードのコンパイル時に発生し、コンパイル済みの" +"コードの実行時には通常は報告されません。" #: ../../library/exceptions.rst:912 msgid "Base class for warnings about dubious runtime behavior." @@ -1417,18 +1481,21 @@ msgstr "" "のインスタンスでない例外が一つでも含まれていると :exc:`TypeError` を送出しま" "す。" -#: ../../library/exceptions.rst:987 msgid "" "Exception groups are :ref:`generic ` over the type of their " "contained exceptions." msgstr "" +"例外グループは、保持する例外の型をパラメータとする :ref:`ジェネリック型 " +"` です。" -#: ../../library/exceptions.rst:992 msgid "" "The ``excs`` parameter may be any sequence, but lists and tuples are " "specifically processed more efficiently here. For optimal performance, pass " "a tuple as ``excs``." msgstr "" +"``excs`` パラメータには任意のシーケンスを指定できますが、リストとタプルは特に" +"効率よく処理されます。\n" +"最適なパフォーマンスを得るには、``excs`` にタプルを渡してください。" #: ../../library/exceptions.rst:998 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." @@ -1450,7 +1517,6 @@ msgstr "" "プを返します。\n" "結果が空の場合は ``None`` を返します。" -#: ../../library/exceptions.rst:1010 msgid "" "The condition can be an exception type or tuple of exception types, in which " "case each exception is checked for a match using the same check that is used " @@ -1458,8 +1524,11 @@ msgid "" "type object) that accepts an exception as its single argument and returns " "true for the exceptions that should be in the subgroup." msgstr "" +"条件には例外型または例外型のタプルを指定でき、\n" +"その場合は ``except`` 節と同じ判定方法で各例外がマッチするかを調べます。\n" +"また、例外を唯一の引数として受け取り、サブグループに含めるべき例外に対して真" +"を返す呼び出し可能オブジェクト (型オブジェクトを除く) も指定できます。" -#: ../../library/exceptions.rst:1016 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`~BaseException." @@ -1467,17 +1536,25 @@ msgid "" "__context__` and :attr:`~BaseException.__notes__` fields. Empty nested " "groups are omitted from the result." msgstr "" +"結果には、現在の例外の入れ子構造と、:attr:`message`、:attr:`~BaseException." +"__traceback__`、:attr:`~BaseException.__cause__`、:attr:`~BaseException." +"__context__`、:attr:`~BaseException.__notes__` の各フィールドの値が保持されま" +"す。\n" +"入れ子になった空のグループは結果から除かれます。" -#: ../../library/exceptions.rst:1023 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " "true for such an exception group, it is included in the result in full." msgstr "" +"条件は、最上位の例外グループと入れ子になったすべての例外グループも含め、\n" +"入れ子の例外グループ内のすべての例外に対して調べられます。\n" +"例外グループに対して条件が真となる場合、そのグループ全体が結果に含まれます。" -#: ../../library/exceptions.rst:1027 msgid "``condition`` can be any callable which is not a type object." msgstr "" +"``condition`` に、型オブジェクト以外の任意の呼び出し可能オブジェクトを指定で" +"きるようになりました。" #: ../../library/exceptions.rst:1032 msgid "" @@ -1496,13 +1573,17 @@ msgstr "" "同じ :attr:`message` の例外グループを返しますが、``excs`` の例外を含んでいま" "す。" -#: ../../library/exceptions.rst:1041 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " "override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" +"このメソッドは、さまざまな状況で例外グループを分割するために使われる :meth:" +"`subgroup` と :meth:`split` から呼び出されます。\n" +"サブクラスで :meth:`subgroup` と :meth:`split` が :exc:`ExceptionGroup` では" +"なくそのサブクラスのインスタンスを返すようにするには、\n" +"このメソッドをオーバーライドする必要があります。" #: ../../library/exceptions.rst:1047 msgid "" @@ -1518,7 +1599,6 @@ msgstr "" "返す例外グループにコピーするため、:meth:`derive` ではこれらのフィールドを更新" "する必要がありません。" -#: ../../library/exceptions.rst:1054 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1546,8 +1626,32 @@ msgid "" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" msgstr "" +">>> class MyGroup(ExceptionGroup):\n" +"... def derive(self, excs):\n" +"... return MyGroup(self.message, excs)\n" +"...\n" +">>> e = MyGroup(\"eg\", [ValueError(1), TypeError(2)])\n" +">>> e.add_note(\"a note\")\n" +">>> e.__context__ = Exception(\"context\")\n" +">>> e.__cause__ = Exception(\"cause\")\n" +">>> try:\n" +"... raise e\n" +"... except Exception as e:\n" +"... exc = e\n" +"...\n" +">>> match, rest = exc.split(ValueError)\n" +">>> exc, exc.__context__, exc.__cause__, exc.__notes__\n" +"(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), " +"Exception('cause'), ['a note'])\n" +">>> match, match.__context__, match.__cause__, match.__notes__\n" +"(MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> rest, rest.__context__, rest.__cause__, rest.__notes__\n" +"(MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" +"True" -#: ../../library/exceptions.rst:1080 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1555,8 +1659,12 @@ msgid "" "exception group subclass which accepts an exit_code and constructs the " "group's message from it. ::" msgstr "" +":exc:`BaseExceptionGroup` は :meth:`~object.__new__` を定義しているため、\n" +"異なるコンストラクタシグネチャが必要なサブクラスでは、:meth:`~object." +"__init__` ではなく ``__new__()`` をオーバーライドする必要があります。\n" +"例えば、次のコードでは ``exit_code`` を受け取り、そこからグループのメッセージ" +"を作成する例外グループのサブクラスを定義しています。 ::" -#: ../../library/exceptions.rst:1086 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1567,13 +1675,24 @@ msgid "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" msgstr "" +"class Errors(ExceptionGroup):\n" +" def __new__(cls, errors, exit_code):\n" +" self = super().__new__(Errors, f\"exit code: {exit_code}\", errors)\n" +" self.exit_code = exit_code\n" +" return self\n" +"\n" +" def derive(self, excs):\n" +" return Errors(excs, self.exit_code)" -#: ../../library/exceptions.rst:1095 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" +":exc:`ExceptionGroup` と同様に、:exc:`BaseExceptionGroup` のサブクラスであ" +"り、\n" +"かつ :exc:`Exception` のサブクラスでもあるクラスは、:exc:`Exception` のインス" +"タンスのみを保持できます。" #: ../../library/exceptions.rst:1103 msgid "Exception hierarchy" diff --git a/library/functions.po b/library/functions.po index cbd707d47..02d523404 100644 --- a/library/functions.po +++ b/library/functions.po @@ -454,11 +454,14 @@ msgstr "" " return False\n" " return True" -#: ../../library/functions.rst:91 msgid "" "When awaited, return the next item from the given :term:`asynchronous " "iterator`, or *default* if given and the iterator is :term:`exhausted`." msgstr "" +"待ち受けると、指定した :term:`非同期イテレータ ` の次" +"の要素を返します。\n" +"イテレータが :term:`枯渇して ` おり、*default* が指定されている場" +"合は、その値を返します。" #: ../../library/functions.rst:94 msgid "" @@ -500,17 +503,16 @@ msgstr "" " return True\n" " return False" -#: ../../library/functions.rst:118 msgid "" "As :func:`repr`, return a string containing a printable representation of an " "object, but escape the non-ASCII characters in the string returned by :func:" "`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string " "similar to that returned by :func:`repr` in Python 2." msgstr "" -":func:`repr` と同様、オブジェクトの印字可能な表現を含む文字列を返しますが、:" -"func:`repr` によって返された文字列中の非 ASCII 文字は ``\\x`` 、 ``\\u`` 、 " -"``\\U`` エスケープを使ってエスケープされます。これは Python 2 の :func:" -"`repr` によって返されるのと同じ文字列を作ります。" +":func:`repr` と同様に、オブジェクトの印字可能な表現を含む文字列を返します。\n" +"ただし、:func:`repr` が返す文字列中の非 ASCII 文字は、``\\x``、``\\u``、" +"``\\U`` エスケープを使ってエスケープされます。\n" +"これにより、Python 2 の :func:`repr` が返すものと似た文字列が生成されます。" #: ../../library/functions.rst:126 msgid "" @@ -613,17 +615,19 @@ msgstr "" "引数 ``breakpointhook`` 付きで :ref:`監査イベント ` ``builtins." "breakpoint`` を送出します。" -#: ../../library/functions.rst:193 msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " "methods of mutable sequences, described in :ref:`typesseq-mutable`, as well " "as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." msgstr "" -"新しいバイト配列を返します。:class:`bytearray` クラスは0 <= x < 256の範囲の整" -"数からなる変更可能な配列です。:ref:`typesseq-mutable` に記述されている変更可" -"能な配列に対する普通のメソッドの大半を備えています。また、:class:`bytes` 型が" -"持つメソッドの大半も備えています(see :ref:`bytes-methods`)。" +"新しいバイト配列を返します。\n" +":class:`bytearray` クラスは、0 <= x < 256 の範囲の整数からなる可変シーケンス" +"です。\n" +":ref:`typesseq-mutable` で説明されている可変シーケンスの通常のメソッドの大半" +"に加え、\n" +":class:`bytes` 型のメソッドの大半も備えています (:ref:`bytes-methods` を参照" +"してください)。" #: ../../library/functions.rst:198 msgid "" @@ -702,7 +706,6 @@ msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "" ":ref:`binaryseq`, :ref:`typebytes`, :ref:`bytes-methods` も参照してください。" -#: ../../library/functions.rst:238 msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " @@ -710,12 +713,13 @@ msgid "" "that classes are callable (calling a class returns a new instance); " "instances are callable if their class has a :meth:`~object.__call__` method." msgstr "" -"*object* 引数が呼び出し可能オブジェクトであれば :const:`True` を、そうでなけ" -"れば :const:`False` を返します。この関数が ``True`` を返しても、呼び出しは失" -"敗する可能性がありますが、``False`` であれば、 *object* の呼び出しは決して成" -"功しません。なお、クラスは呼び出し可能 (クラスを呼び出すと新しいインスタンス" -"を返します) です。また、インスタンスはクラスが :meth:`~object.__call__` メ" -"ソッドを持つなら呼び出し可能です。" +"*object* 引数が呼び出せそうなオブジェクトであれば :const:`True` を、そうでな" +"ければ :const:`False` を返します。\n" +"この関数が ``True`` を返しても呼び出しが失敗する可能性はありますが、\n" +"``False`` であれば *object* の呼び出しは決して成功しません。\n" +"クラスは呼び出し可能です (クラスを呼び出すと新しいインスタンスを返します)。\n" +"インスタンスは、そのクラスが :meth:`~object.__call__` メソッドを持つ場合に呼" +"び出し可能です。" #: ../../library/functions.rst:244 msgid "" @@ -838,15 +842,15 @@ msgstr "" "AST オブジェクトの扱い方については、:mod:`ast` モジュールのドキュメントを参照" "してください。" -#: ../../library/functions.rst:308 msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " "is commonly used)." msgstr "" -"*filename* 引数には、コードの読み出し元のファイルを与えなければなりません; " -"ファイルから読み出されるのでなければ、認識可能な値を渡して下さい " -"(``''`` が一般的に使われます)。" +"*filename* 引数には、コードの読み出し元のファイルを示す値を指定してくださ" +"い。\n" +"ファイルから読み出していない場合は、識別できる値を渡してください " +"(``''`` がよく使われます)。" #: ../../library/functions.rst:312 msgid "" @@ -1118,10 +1122,8 @@ msgstr "引数がすべて省略された場合は、 ``0j`` を返します。" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複素数型については :ref:`typesnumeric` に説明があります。" -#: ../../library/functions.rst:460 ../../library/functions.rst:837 -#: ../../library/functions.rst:1094 msgid "Grouping digits with underscores as in code literals is allowed." -msgstr "コードリテラル中で桁をグループ化するのにアンダースコアを利用できます。" +msgstr "コードリテラルと同様に、アンダースコアで桁を区切れるようになりました。" #: ../../library/functions.rst:463 msgid "" @@ -1504,7 +1506,6 @@ msgstr "" "を意味します(「トップレベル」変数はクラス定義にてクラス変数として扱われるた" "め)。" -#: ../../library/functions.rst:710 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1512,6 +1513,11 @@ msgid "" "used to restrict or change the available names, but this is **not** a " "security mechanism: the executed code can still access all builtins." msgstr "" +"*globals* 辞書にキー ``__builtins__`` の値が含まれていない場合、\n" +"そのキーに組み込みモジュール :mod:`builtins` の辞書への参照が挿入されます。\n" +"``__builtins__`` を上書きすると、利用できる名前を制限したり変更したりできます" +"が、これはセキュリティ機構では **ありません**。\n" +"実行されるコードは、依然としてすべての組み込み機能にアクセスできます。" #: ../../library/functions.rst:717 msgid "" @@ -1716,24 +1722,31 @@ msgstr "" "*format_spec* が空の文字列でない場合 ``object().__format__(format_spec)`` " "は :exc:`TypeError` を送出します。" -#: ../../library/functions.rst:879 msgid "" "Create a new frozen dictionary. The :class:`frozendict` object is a built-" "in class. See also :ref:`typesmapping` for documentation about this class." msgstr "" +"新しい凍結辞書を作成します。\n" +":class:`frozendict` オブジェクトは組み込みクラスです。\n" +"このクラスのドキュメントについては :ref:`typesmapping` も参照してください。" -#: ../../library/functions.rst:882 msgid "" "For other containers see the built-in :class:`dict`, :class:`list`, :class:" "`set`, and :class:`tuple` classes, as well as the :mod:`collections` module." msgstr "" +"他のコンテナについては、組み込みの :class:`dict`、:class:`list`、:class:" +"`set`、:class:`tuple` クラスや、:mod:`collections` モジュールを参照してくださ" +"い。" -#: ../../library/functions.rst:892 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. :class:`frozenset` is a built-in class. See also :ref:`types-" "set` for documentation about this class." msgstr "" +"新しい :class:`frozenset` オブジェクトを返します。\n" +"必要に応じて *iterable* から要素を取り込むこともできます。\n" +":class:`frozenset` は組み込みクラスです。\n" +"このクラスのドキュメントについては :ref:`types-set` も参照してください。" #: ../../library/functions.rst:896 msgid "" @@ -2091,10 +2104,11 @@ msgstr "" "`ValueError` が送出されます。詳しくは :ref:`整数文字列の変換における長さ制限 " "` を参照してください。" -#: ../../library/functions.rst:1111 msgid "" ":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." msgstr "" +":func:`int` は :meth:`~object.__trunc__` メソッドに処理を委譲しなくなりまし" +"た。" #: ../../library/functions.rst:1116 msgid "" @@ -2123,7 +2137,6 @@ msgstr "" msgid "*classinfo* can be a :ref:`types-union`." msgstr "*classinfo* に :ref:`types-union` を指定できるようになりました。" -#: ../../library/functions.rst:1133 msgid "" "Return ``True`` if *cls* is a subclass (direct, indirect, or :term:`virtual " "`) of *classinfo*. A class is considered a subclass of " @@ -2132,6 +2145,14 @@ msgid "" "is a subclass of any entry in *classinfo*. In any other case, a :exc:" "`TypeError` exception is raised." msgstr "" +"*cls* が *classinfo* のサブクラス (直接、間接、または :term:`仮想 ` のサブクラス) である場合、``True`` を返します。\n" +"クラスは、それ自体のサブクラスと見なされます。\n" +"*classinfo* には、クラスオブジェクトのタプル (または再帰的にそのようなタプル" +"を含むタプル) や :ref:`types-union` も指定できます。\n" +"その場合、*cls* が *classinfo* 内のいずれかのサブクラスであれば ``True`` を返" +"します。\n" +"*classinfo* がこれらのいずれでもない場合は、:exc:`TypeError` が送出されます。" #: ../../library/functions.rst:1148 msgid "" @@ -2230,12 +2251,11 @@ msgstr "" "モジュール スコープでは、単一の名前空間で :func:`exec` や :func:`eval` を使う" "場合と同じく、この関数は :func:`globals` と同じ名前空間を返します。" -#: ../../library/functions.rst:1204 msgid "" "At class scope, it returns the namespace that will be passed to the " "metaclass constructor." msgstr "" -"クラス スコープでは、メタクラス コンストラクタに渡された名前空間を返します。" +"クラススコープでは、メタクラスのコンストラクタに渡される名前空間を返します。" msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " @@ -2320,7 +2340,6 @@ msgstr "" "の振る舞いは上記のようになりました。定義されただけで、その他のスコープの振る" "舞いは以前のバージョンのままです。" -#: ../../library/functions.rst:1249 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2331,6 +2350,17 @@ msgid "" "raised. For cases where the function inputs are already arranged into " "argument tuples, see :func:`itertools.starmap`." msgstr "" +"*iterable* の各要素に *function* を適用し、その結果を生成するイテレータを返し" +"ます。\n" +"追加の *iterables* 引数が渡された場合、*function* はイテラブルの数だけ引数を" +"受け取れる必要があります。\n" +"この関数は、すべてのイテラブルから並行して取り出した要素に適用されます。\n" +"複数のイテラブルがある場合、最も短いイテラブルが :term:`枯渇する " +"` とイテレータは停止します。\n" +"*strict* が ``True`` で、いずれかのイテラブルが他より先に枯渇した場合は、:" +"exc:`ValueError` が送出されます。\n" +"関数への入力がすでに引数のタプルにまとめられている場合は、:func:`itertools." +"starmap` を参照してください。" #: ../../library/functions.rst:1258 msgid "Added the *strict* parameter." @@ -2423,12 +2453,16 @@ msgstr "" "は、``sorted(iterable, key=keyfunc)[0]`` や ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` のような、他のソート安定性を維持するツールと両立します。" -#: ../../library/functions.rst:1333 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " "iterator is :term:`exhausted`, otherwise :exc:`StopIteration` is raised." msgstr "" +":term:`イテレータ ` の :meth:`~iterator.__next__` メソッドを呼び出" +"して、次の要素を取得します。\n" +"イテレータが :term:`枯渇した ` 場合、*default* が指定されていれば" +"その値を返し、\n" +"指定されていなければ :exc:`StopIteration` を送出します。" #: ../../library/functions.rst:1340 msgid "" @@ -2482,7 +2516,6 @@ msgstr "" "す。ファイルを開くことができなければ、:exc:`OSError` が送出されます。\n" "この関数の利用例について、 :ref:`tut-files` を参照してください。" -#: ../../library/functions.rst:1385 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -2490,11 +2523,12 @@ msgid "" "given, it is closed when the returned I/O object is closed unless *closefd* " "is set to ``False``.)" msgstr "" -"*file* は :term:`path-like object` で、開くファイルのパス名 (絶対パスまたは現" -"在の作業ディレクトリからの相対パス) あるいはラップするファイルの整数のファイ" -"ルデスクリプタを与えます。 (ファイルデスクリプタが与えられた場合、 *closefd* " -"が ``False`` に設定されていないかぎり、この関数が返す I/O オブジェクトがク" -"ローズされるときにファイルデスクリプタもクローズされます。)" +"*file* には、開くファイルのパス名 (絶対パスまたは現在の作業ディレクトリからの" +"相対パス) を示す :term:`path-like object` か、\n" +"ラップするファイルの整数のファイル記述子を指定します。\n" +"(ファイル記述子を指定した場合、*closefd* が ``False`` に設定されていなけれ" +"ば、\n" +"返された I/O オブジェクトを閉じるときにそのファイル記述子も閉じられます。)" #: ../../library/functions.rst:1391 msgid "" @@ -2684,7 +2718,6 @@ msgstr "" "しくは :mod:`codecs` モジュール内のサポートしているエンコーディングのリストを" "参照してください。" -#: ../../library/functions.rst:1462 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2692,6 +2725,12 @@ msgid "" "has been registered with :func:`codecs.register_error` is also valid. The " "standard names can be found in :ref:`error-handlers`." msgstr "" +"*errors* は、エンコードやデコードのエラーをどう処理するかを指定するオプション" +"の文字列です。\n" +"バイナリモードでは使えません。\n" +"さまざまな標準のエラーハンドラが利用できるほか、:func:`codecs." +"register_error` で登録された任意のエラー処理名も指定できます。\n" +"標準の名前は :ref:`error-handlers` に記載されています。" #: ../../library/functions.rst:1474 msgid "" @@ -2929,16 +2968,16 @@ msgstr "" "引数が 長さ1の :class:`bytes` または :class:`bytearray` である場合は、そのバ" "イト値を返します。例えば、 ``ord(b'a')`` は ``97`` になります。" -#: ../../library/functions.rst:1592 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " "mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the " "power operator: ``base**exp``." msgstr "" -"*base* の *exp* 乗を返します; *mod* があれば、*base* の *exp* 乗に対する " -"*mod* の剰余を返します (``pow(base, exp) % mod`` より効率よく計算されます)。" -"二引数の形式 ``pow(base, exp)`` は、冪乗演算子を使った ``base**exp`` と等価で" +"*base* の *exp* 乗を返します。\n" +"*mod* を指定した場合は、*base* の *exp* 乗を *mod* で割った余りを返します " +"(``pow(base, exp) % mod`` より効率よく計算されます)。\n" +"2引数形式の ``pow(base, exp)`` は、冪乗演算子を使う ``base**exp`` と等価で" "す。" #: ../../library/functions.rst:1597 @@ -3066,9 +3105,8 @@ msgstr "" "です。*fdel* は属性値を削除するための関数です。*doc* は属性の docstring を作" "成します。" -#: ../../library/functions.rst:1665 msgid "A typical use is to define a managed attribute ``x``::" -msgstr "典型的な使用法は、属性 ``x`` の処理の定義です::" +msgstr "典型的な用途は、アクセスを管理する属性 ``x`` を定義することです。 ::" #: ../../library/functions.rst:1667 msgid "" @@ -3110,13 +3148,18 @@ msgstr "" "*c* が *C* のインスタンスならば、``c.x`` は getter を呼び出し、``c.x = " "value`` は setter を、``del c.x`` は deleter を呼び出します。" -#: ../../library/functions.rst:1685 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " "possible to create read-only properties easily using :deco:`property` as a :" "term:`decorator`::" msgstr "" +"*doc* が指定されていれば、その値がプロパティ属性のドキュメンテーション文字列" +"になります。\n" +"指定されていなければ、*fget* にドキュメンテーション文字列がある場合に、プロパ" +"ティがその文字列をコピーします。\n" +"これにより、:deco:`property` を :term:`デコレータ ` として使うこと" +"で、読み出し専用のプロパティを簡単に作成できます。 ::" #: ../../library/functions.rst:1689 msgid "" @@ -3213,9 +3256,10 @@ msgstr "" "返される property オブジェクトも、コンストラクタの引数に対応した ``fget``, " "``fset``, および ``fdel`` 属性を持ちます。" -#: ../../library/functions.rst:1737 msgid "The docstrings of property objects are now writeable." -msgstr "属性オブジェクトのドックストリングが書き込み可能になりました。" +msgstr "" +"プロパティオブジェクトのドキュメンテーション文字列が書き込み可能になりまし" +"た。" #: ../../library/functions.rst:1742 msgid "" @@ -3257,7 +3301,6 @@ msgstr "" msgid "This class has a custom representation that can be evaluated::" msgstr "このクラスは、eval 評価可能な独自の representation を持ちます::" -#: ../../library/functions.rst:1772 msgid "" "class Person:\n" " def __init__(self, name, age):\n" @@ -3267,6 +3310,13 @@ msgid "" " def __repr__(self):\n" " return f\"Person({self.name!r}, {self.age!r})\"" msgstr "" +"class Person:\n" +" def __init__(self, name, age):\n" +" self.name = name\n" +" self.age = age\n" +"\n" +" def __repr__(self):\n" +" return f\"Person({self.name!r}, {self.age!r})\"" #: ../../library/functions.rst:1783 msgid "" @@ -3308,13 +3358,12 @@ msgstr "" "返り値は *ndigits* が指定されていないか ``None`` の場合は整数、そうでなければ" "返り値は *number* と同じ型です。" -#: ../../library/functions.rst:1804 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -"一般的な Python オブジェクト ``number`` に対して、``round`` は処理を `number." -"__round__` に移譲します。" +"一般的な Python オブジェクト ``number`` に対して、``round`` は処理を " +"``number.__round__`` に委譲します。" #: ../../library/functions.rst:1809 msgid "" @@ -3329,12 +3378,15 @@ msgstr "" "これはバグではありません: これはほとんどの小数が浮動小数点数で正確に表せない" "ことの結果です。詳しくは :ref:`tut-fp-issues` を参照してください。" -#: ../../library/functions.rst:1820 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. :class:`set` is a built-in class. See also :ref:`types-set` " "for documentation about this class." msgstr "" +"新しい :class:`set` オブジェクトを返します。\n" +"必要に応じて *iterable* から要素を取り込むこともできます。\n" +":class:`set` は組み込みクラスです。\n" +"このクラスのドキュメントについては :ref:`types-set` も参照してください。" #: ../../library/functions.rst:1824 msgid "" @@ -3384,65 +3436,77 @@ msgstr "" "名前を持つ属性) の値を :func:`setattr` でセットするためには、属性名を手動でマ" "ングリングする必要があります。" -#: ../../library/functions.rst:1853 msgid "" "Return a new unique sentinel object. *name* must be a :class:`str`, and is " "used by default as the returned object's representation::" msgstr "" +"一意な新しいセンチネルオブジェクトを返します。\n" +"*name* は :class:`str` でなければならず、デフォルトでは返されるオブジェクトの" +"文字列表現として使われます。 ::" -#: ../../library/functions.rst:1856 msgid "" ">>> MISSING = sentinel(\"MISSING\")\n" ">>> MISSING\n" "MISSING" msgstr "" +">>> MISSING = sentinel(\"MISSING\")\n" +">>> MISSING\n" +"MISSING" -#: ../../library/functions.rst:1860 msgid "" "The optional *repr* argument can be used to specify a different " "representation::" -msgstr "" +msgstr "オプションの *repr* 引数を使うと、別の文字列表現を指定できます。 ::" -#: ../../library/functions.rst:1862 msgid "" ">>> MISSING = sentinel(\"MISSING\", repr=\"\")\n" ">>> MISSING\n" "" msgstr "" +">>> MISSING = sentinel(\"MISSING\", repr=\"\")\n" +">>> MISSING\n" +"" -#: ../../library/functions.rst:1866 msgid "" "Sentinel objects are truthy and compare equal only to themselves. They are " "intended to be compared with the :keyword:`is` operator." msgstr "" +"センチネルオブジェクトは真と評価され、自分自身との比較でのみ等しいと判定され" +"ます。\n" +"比較には :keyword:`is` 演算子を使うことを想定しています。" -#: ../../library/functions.rst:1869 msgid "``sentinel`` does not support subclassing." -msgstr "" +msgstr "``sentinel`` はサブクラス化をサポートしません。" -#: ../../library/functions.rst:1871 msgid "Shallow and deep copies of a sentinel object return the object itself." msgstr "" +"センチネルオブジェクトの浅いコピーと深いコピーは、そのオブジェクト自身を返し" +"ます。" -#: ../../library/functions.rst:1873 msgid "" "Sentinels are conventionally assigned to a variable with a matching name. " "Sentinels defined in this way can be used in :term:`type hints `::" msgstr "" +"慣例として、センチネルはその名前と一致する変数に代入します。\n" +"このように定義したセンチネルは :term:`型ヒント ` に使えます。 ::" -#: ../../library/functions.rst:1876 msgid "" "MISSING = sentinel(\"MISSING\")\n" "\n" "def next_value(default: int | MISSING = MISSING):\n" " ..." msgstr "" +"MISSING = sentinel(\"MISSING\")\n" +"\n" +"def next_value(default: int | MISSING = MISSING):\n" +" ..." -#: ../../library/functions.rst:1881 msgid "" "Sentinel objects support the :ref:`| ` operator for use in type " "expressions." msgstr "" +"センチネルオブジェクトは、型の式で使うための :ref:`| ` 演算子をサ" +"ポートします。" #: ../../library/functions.rst:1883 msgid "" @@ -3454,7 +3518,6 @@ msgid "" "preserved after pickling::" msgstr "" -#: ../../library/functions.rst:1890 msgid "" "import pickle\n" "\n" @@ -3467,20 +3530,29 @@ msgid "" "\n" "assert pickle.loads(pickle.dumps(Cls.PICKLABLE)) is Cls.PICKLABLE" msgstr "" +"import pickle\n" +"\n" +"PICKLABLE = sentinel(\"PICKLABLE\")\n" +"\n" +"assert pickle.loads(pickle.dumps(PICKLABLE)) is PICKLABLE\n" +"\n" +"class Cls:\n" +" PICKLABLE = sentinel(\"Cls.PICKLABLE\")\n" +"\n" +"assert pickle.loads(pickle.dumps(Cls.PICKLABLE)) is Cls.PICKLABLE" -#: ../../library/functions.rst:1901 msgid "Sentinel objects have the following attributes:" -msgstr "" +msgstr "センチネルオブジェクトには、次の属性があります:" -#: ../../library/functions.rst:1905 msgid "The sentinel's name." -msgstr "" +msgstr "センチネルの名前。" -#: ../../library/functions.rst:1909 msgid "" "The name of the module where the sentinel was created. This attribute is " "writable." msgstr "" +"センチネルが作成されたモジュールの名前。\n" +"この属性は書き込み可能です。" #: ../../library/functions.rst:1917 msgid "" @@ -3536,14 +3608,13 @@ msgstr "" "2 つのオプション引数があり、これらはキーワード引数として指定されなければなり" "ません。" -#: ../../library/functions.rst:1945 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -"*key* には 1 引数関数を指定します。これは *iterable* の各要素から比較キーを展" -"開するのに使われます (例えば、 ``key=str.lower`` のように指定します)。\n" +"*key* には、*iterable* の各要素から比較キーを取り出すための1引数関数を指定し" +"ます (例えば ``key=str.lower``)。\n" "デフォルト値は ``None`` です (要素を直接比較します)。" #: ../../library/functions.rst:1949 @@ -3584,14 +3655,14 @@ msgid "" "mixed type comparisons which can call the reflected :meth:`~object.__gt__` " "method." msgstr "" -"ソートアルゴリズムは、要素間の比較に ``<`` 演算子だけを使います。したがって" -"ソートのためには :meth:`~object.__lt__` メソッドを定義すれば十分なはずです" -"が、 :PEP:`8` は6つの :ref:`比較演算子 ` を全て実装することを推" -"奨しています。これにより、異なるメソッドを必要とする :func:`max` のような他の" -"ソートツールを、同じデータに対して適用することによって起こりうるバグを避ける" -"助けになります。6つの比較演算子を全て実装することは、リフレクションによって :" -"meth:`~object.__gt__` メソッドを呼び出す可能性のある型混合の比較での混乱を避" -"けることにも役立ちます。" +"ソートアルゴリズムは、要素間の比較に ``<`` だけを使います。\n" +"ソートには :meth:`~object.__lt__` メソッドを定義すれば十分ですが、:PEP:`8` は" +"6つの :ref:`拡張比較 ` をすべて実装することを推奨しています。\n" +"これにより、異なるメソッドに依存する :func:`max` などの順序付けを行うツールで" +"同じデータを使うときに、バグを避けやすくなります。\n" +"6つの比較をすべて実装すると、異なる型の比較で、被演算子を入れ替えた比較に対応" +"する :meth:`~object.__gt__` メソッドが呼び出される場合の混乱も避けやすくなり" +"ます。" #: ../../library/functions.rst:1969 msgid "" @@ -3641,12 +3712,14 @@ msgstr "" "ソッド :term:`descriptor` は呼び出し可能でもあるため、(``f()`` のように) クラ" "ス定義の中でも使用できます。" -#: ../../library/functions.rst:1990 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :deco:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" +"Python の静的メソッドは、Java や C++ の静的メソッドに似ています。\n" +"別のコンストラクタをクラスに用意する際に便利な :deco:`classmethod` も参照して" +"ください。" #: ../../library/functions.rst:1994 msgid "" @@ -3680,13 +3753,17 @@ msgstr "" msgid "For more information on static methods, see :ref:`types`." msgstr "静的メソッドについて詳しい情報は :ref:`types` を参照してください。" -#: ../../library/functions.rst:2008 msgid "" "Static methods now inherit the method attributes (:attr:`~function." "__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" "attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new " "``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" +"静的メソッドは、メソッドの属性 (:attr:`~function.__module__`、:attr:" +"`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function." +"__doc__`、:attr:`~function.__annotations__`) を継承し、\n" +"新しい ``__wrapped__`` 属性を持つようになりました。\n" +"また、通常の関数として呼び出せるようになりました。" #: ../../library/functions.rst:2026 msgid "" @@ -3703,14 +3780,13 @@ msgstr "" "``str`` は組み込みの文字列 :term:`クラス` です。文字列に関する一般的な" "情報は、:ref:`textseq` を参照してください。" -#: ../../library/functions.rst:2034 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -"*start* と *iterable* の要素を左から右へ合計し、総和を返します。 *iterable* " -"の要素は通常は数値で、start の値は文字列であってはなりません。" +"*start* と *iterable* の要素を左から右へ加算し、総和を返します。\n" +"*iterable* の要素は通常は数値で、``start`` の値には文字列を指定できません。" #: ../../library/functions.rst:2038 msgid "" @@ -3740,11 +3816,12 @@ msgstr "" "ほとんどのビルドで精度が向上し、加算する順序を入れ替えたときも結果がより一致" "しやすくなりました。" -#: ../../library/functions.rst:2050 msgid "" "Added specialization for summation of complexes, using same algorithm as for " "summation of floats." msgstr "" +"浮動小数点数の総和と同じアルゴリズムを使う、複素数の総和に特化した処理が追加" +"されました。" #: ../../library/functions.rst:2058 msgid "" @@ -3774,13 +3851,15 @@ msgstr "" "> object`` であり、 *type* の値が ``B`` だとすると、 :func:`super` は ``C -> " "A -> object`` の順番でメソッドを検索します。" -#: ../../library/functions.rst:2070 msgid "" "The :attr:`~type.__mro__` attribute of the class corresponding to " "*object_or_type* lists the method resolution search order used by both :func:" "`getattr` and :func:`super`. The attribute is dynamic and can change " "whenever the inheritance hierarchy is updated." msgstr "" +"*object_or_type* に対応するクラスの :attr:`~type.__mro__` 属性には、:func:" +"`getattr` と :func:`super` の両方が使うメソッド解決順序が記載されています。\n" +"この属性は動的であり、継承階層が更新されると変わることがあります。" #: ../../library/functions.rst:2075 msgid "" @@ -3821,7 +3900,6 @@ msgstr "" "メンテナンスしやすくなります。この用途は他のプログラミング言語で見られる " "*super* の用途によく似ています。" -#: ../../library/functions.rst:2092 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -3833,14 +3911,15 @@ msgid "" "changes in the class hierarchy, and because that order can include sibling " "classes that are unknown prior to runtime)." msgstr "" -"2つ目の用途は動的な実行環境において協調的 (cooperative) な多重継承をサポート" -"することです。これは Python に特有の用途で、静的にコンパイルされる言語や、単" -"継承のみをサポートする言語には見られないものです。この機能により、同じ名前の" -"メソッドを実装する複数の基底クラスを使った \"ダイヤモンド型* の継承構造を実装" -"することができます。良い設計は、そのような実装において、どのような場合でも同" -"じ呼び出しシグネチャを持つように強制します。 (理由は呼び出しの順序が実行時に" -"決定されること、呼び出し順序はクラス階層構造の変化に順応すること、そして呼び" -"出し順序が実行時まで未知の兄弟クラスが含まれる場合があることです)。" +"2つ目の用途は、動的な実行環境で協調的な多重継承をサポートすることです。\n" +"これは Python 特有の用途であり、静的にコンパイルされる言語や単継承だけをサ" +"ポートする言語には見られません。\n" +"これにより、複数の基底クラスが同じメソッドを実装する「ダイヤモンド型」の継承" +"構造を実現できます。\n" +"適切に設計するには、これらの実装の呼び出しシグネチャをすべて同じにする必要が" +"あります\n" +"(呼び出しの順序が実行時に決まり、その順序はクラス階層の変化に応じて変わり、\n" +"実行時まで分からない兄弟クラスもその順序に含まれる可能性があるためです)。" #: ../../library/functions.rst:2102 msgid "For both use cases, a typical superclass call looks like this::" @@ -3885,7 +3964,6 @@ msgstr "" "文や ``super()[name]`` のような演算子を使った暗黙の探索向けには定義されていま" "せん。" -#: ../../library/functions.rst:2121 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -3894,11 +3972,12 @@ msgid "" "necessary details to correctly retrieve the class being defined, as well as " "accessing the current instance for ordinary methods." msgstr "" -"また、 :func:`super` の使用は引数無しの形式を除きメソッド内部に限定されないこ" -"とにも注目して下さい。2引数の形式は、必要な要素を正確に指定するので、適当な参" -"照を作ることができます。クラス定義中における引数無しの形式は、定義されている" -"クラスを取り出すのに必要な詳細を、通常の方法で現在のインスタンスにアクセスす" -"るようにコンパイラが埋めるのではたらきます。" +"引数なしの形式を除き、:func:`super` はメソッドの外でも使えます。\n" +"2引数形式では、引数を明示的に指定し、適切な参照を作成します。\n" +"引数なしの形式がクラス定義内でのみ機能するのは、\n" +"定義中のクラスを正しく取得し、通常のメソッドでは現在のインスタンスにもアクセ" +"スできるように、\n" +"コンパイラが必要な情報を補うためです。" #: ../../library/functions.rst:2128 msgid "" @@ -3968,13 +4047,11 @@ msgstr "" msgid "See also:" msgstr "下記を参照してください。" -#: ../../library/functions.rst:2174 msgid "" ":ref:`Documentation on attributes and methods on classes `." msgstr "" -":ref:`Documentation on attributes and methods on classes `." +":ref:`クラスの属性とメソッドに関するドキュメント `。" #: ../../library/functions.rst:2175 msgid ":ref:`bltin-type-objects`" @@ -3991,12 +4068,15 @@ msgstr "" "定義におけるキーワード引数と同様に、適切なメタクラスの機構 (通常は :meth:" "`~object.__init_subclass__`) に渡されます。" -#: ../../library/functions.rst:2182 msgid "" "Unlike a :keyword:`class` statement, the three argument form does not call " "the metaclass ``__prepare__`` method (see :ref:`prepare`). Use :func:`types." "new_class` to dynamically create a class using the appropriate metaclass." msgstr "" +":keyword:`class` 文とは異なり、3引数形式ではメタクラスの ``__prepare__`` メ" +"ソッドを呼び出しません (:ref:`prepare` を参照してください)。\n" +"適切なメタクラスを使って動的にクラスを作成するには、:func:`types.new_class` " +"を使ってください。" #: ../../library/functions.rst:2187 msgid "See also :ref:`class-customization`." @@ -4010,9 +4090,8 @@ msgstr "" "``type.__new__`` をオーバーライドしていない :class:`!type` のサブクラスは、オ" "ブジェクトの型を得るのに1引数形式を利用することができません。" -#: ../../library/functions.rst:2195 msgid "*dict* can now be a :class:`frozendict`." -msgstr "" +msgstr "``dict`` に :class:`frozendict` を指定できるようになりました。" #: ../../library/functions.rst:2200 msgid "" @@ -4125,12 +4204,15 @@ msgstr "" "備するコードにおけるバグのこともあるでしょう。 Python はこの問題に対して3つの" "異なるアプローチを提供します:" -#: ../../library/functions.rst:2250 msgid "" "By default, :func:`zip` stops when the shortest iterable is :term:" "`exhausted`. It will ignore the remaining items in the longer iterables, " "cutting off the result to the length of the shortest iterable::" msgstr "" +"デフォルトでは、最も短いイテラブルが :term:`枯渇する ` と :func:" +"`zip` は停止します。\n" +"より長いイテラブルに残った要素は無視し、結果を最も短いイテラブルの長さに切り" +"詰めます。 ::" #: ../../library/functions.rst:2254 msgid "" @@ -4158,11 +4240,12 @@ msgstr "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" -#: ../../library/functions.rst:2264 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is :term:`exhausted` before the others:" msgstr "" +"デフォルトの動作とは異なり、いずれかのイテラブルが他より先に :term:`枯渇した " +"` 場合は、:exc:`ValueError` を送出します:" msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " @@ -4265,7 +4348,6 @@ msgstr "" "`__import__` を直接使用することも推奨されず、 :func:`importlib." "import_module` の方が好まれます。" -#: ../../library/functions.rst:2336 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -4274,12 +4356,13 @@ msgid "" "does not use its *locals* argument at all and uses its *globals* only to " "determine the package context of the :keyword:`import` statement." msgstr "" -"この関数は、モジュール *name* をインポートし、 *globals* と *locals* が与えら" -"れれば、パッケージのコンテキストで名前をどう解釈するか決定するのに使います。 " -"*fromlist* は *name* で与えられるモジュールからインポートされるべきオブジェク" -"トまたはサブモジュールの名前を与ます。標準の実装では *locals* 引数はまったく" -"使われず、 *globals* は :keyword:`import` 文のパッケージコンテキストを決定す" -"るためにのみ使われます。" +"この関数はモジュール *name* をインポートします。\n" +"その際、指定された *globals* と *locals* を使って、パッケージのコンテキストで" +"名前をどう解釈するかを決めることがあります。\n" +"*fromlist* には、*name* が指定するモジュールからインポートするオブジェクトや" +"サブモジュールの名前を指定します。\n" +"標準の実装では *locals* 引数をまったく使わず、:keyword:`import` 文のパッケー" +"ジコンテキストを決めるためにのみ *globals* を使います。" msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " @@ -4326,14 +4409,12 @@ msgstr "文 ``import spam.ham`` は、この呼び出しになります::" msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2363 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -"ここで :func:`__import__` がどのように最上位モジュールを返しているかに注意し" -"て下さい。 :keyword:`import` 文により名前が束縛されたオブジェクトになっていま" -"す。" +"ここで :func:`__import__` が最上位のモジュールを返すのは、:keyword:`import` " +"文がそのオブジェクトに名前を束縛するためです。" #: ../../library/functions.rst:2366 msgid "" @@ -4379,13 +4460,12 @@ msgstr "" "負の *level* の値はサポートされなくなりました (デフォルト値の 0 に変更されま" "す)。" -#: ../../library/functions.rst:2384 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -"コマンドラインオプション :option:`-E` or :option:`-I` が指定された場合、環境" -"変数 :envvar:`PYTHONCASEOK` は無視されるようになりました。" +"コマンドラインオプション :option:`-E` または :option:`-I` が使われている場" +"合、環境変数 :envvar:`PYTHONCASEOK` は無視されるようになりました。" #: ../../library/functions.rst:2389 msgid "Footnotes" diff --git a/library/stdtypes.po b/library/stdtypes.po index df445dee9..6fefaa27c 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -79,7 +79,6 @@ msgstr "" "どのようなオブジェクトでも真理値として判定でき、 :keyword:`if` や :keyword:" "`while` の条件あるいは以下のブール演算の被演算子として使えます。" -#: ../../library/stdtypes.rst:46 msgid "" "By default, an object is considered true unless its class defines either a :" "meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object." @@ -88,6 +87,13 @@ msgid "" "and the object does not have a truth value (for example, :data:" "`NotImplemented`). Here are most of the built-in objects considered false:" msgstr "" +"通常、オブジェクトは真とみなされます。\n" +"ただし、そのオブジェクトを渡して呼び出したときに ``False`` を返す :meth:" +"`~object.__bool__` メソッドか、ゼロを返す :meth:`~object.__len__` メソッドが" +"クラスに定義されている場合は偽とみなされます。[1]_\n" +"いずれかのメソッドの呼び出しで例外が送出されると、その例外が伝播し、オブジェ" +"クトは真理値を持ちません (例えば :data:`NotImplemented`)。\n" +"偽とみなされる主な組み込みオブジェクトは次のとおりです:" #: ../../library/stdtypes.rst:58 msgid "constants defined to be false: ``None`` and ``False``" @@ -428,33 +434,36 @@ msgstr "" "コンストラクタ :func:`int` 、 :func:`float` 、 :func:`complex` で、特定の型の" "数を生成できます。" -#: ../../library/stdtypes.rst:270 msgid "" "Python fully supports mixed arithmetic: when a binary arithmetic operator " "has operands of different built-in numeric types, the operand with the " "\"narrower\" type is widened to that of the other:" msgstr "" +"Python は異なる型を混在させた算術演算を完全にサポートしています。\n" +"二項算術演算子のオペランドが異なる組み込み数値型の場合、「狭い」型のオペラン" +"ドがもう一方の型に拡張されます:" -#: ../../library/stdtypes.rst:274 msgid "If both arguments are complex numbers, no conversion is performed;" -msgstr "" +msgstr "両方の引数が複素数の場合、変換は行われません。" -#: ../../library/stdtypes.rst:275 msgid "" "if either argument is a complex or a floating-point number, the other is " "converted to a floating-point number;" msgstr "" +"それ以外で、一方の引数が複素数または浮動小数点数の場合、もう一方は浮動小数点" +"数に変換されます。" #: ../../library/stdtypes.rst:277 msgid "otherwise, both must be integers and no conversion is necessary." msgstr "" "それ以外場合は、両方の引数は整数でなければならず、変換の必要はありません。" -#: ../../library/stdtypes.rst:279 msgid "" "Arithmetic with complex and real operands is defined by the usual " "mathematical formula, for example::" msgstr "" +"複素数と実数をオペランドとする演算は、通常の数学の式で定義されます。\n" +"例えば、次のようになります。 ::" msgid "" "x + complex(u, v) = complex(x + u, v)\n" @@ -463,11 +472,12 @@ msgstr "" "x + complex(u, v) = complex(x + u, v)\n" "x * complex(u, v) = complex(x * u, x * v)" -#: ../../library/stdtypes.rst:285 msgid "" "A comparison between numbers of different types behaves as though the exact " "values of those numbers were being compared. [2]_" msgstr "" +"異なる型の数値を比較すると、それぞれの数値の正確な値を比較した場合と同じ結果" +"になります。[2]_" #: ../../library/stdtypes.rst:288 msgid "" @@ -881,17 +891,16 @@ msgid "" "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." msgstr "*n* ビットの右シフトは、 ``pow(2, n)`` による切り捨て除算と等価です。" -#: ../../library/stdtypes.rst:462 msgid "" "Performing these calculations with at least one extra sign extension bit in " "a finite two's complement representation (a working bit-width of ``1 + max(x." "bit_length(), y.bit_length())`` or more) is sufficient to get the same " "result as if there were an infinite number of sign bits." msgstr "" -"桁の長い方の値に少なくとも 1 つ余計に符号ビットを付け加えた幅 (計算するビット" -"幅は ``1 + max(x.bit_length(), y.bit_length())`` かそれ以上) でこれらの計算を" -"行えば、無限個の符号ビットがあるかのように計算したのと同じ結果を得るのに十分" -"です。" +"有限ビット幅の2の補数表現に、少なくとも1ビットの符号拡張ビットを追加してこれ" +"らの計算を行えば、符号ビットを無限個使う場合と同じ結果が得られます。\n" +"計算に使うビット幅は ``1 + max(x.bit_length(), y.bit_length())`` 以上で十分で" +"す。" #: ../../library/stdtypes.rst:469 msgid "Additional Methods on Integer Types" @@ -943,13 +952,16 @@ msgstr "" msgid "Equivalent to::" msgstr "次と等価です::" -#: ../../library/stdtypes.rst:493 msgid "" "def bit_length(self):\n" " s = bin(self) # binary representation: bin(-37) --> '-0b100101'\n" " s = s.lstrip('-0b') # remove leading zeros and minus sign\n" " return len(s) # len('100101') --> 6" msgstr "" +"def bit_length(self):\n" +" s = bin(self) # 2進表現: bin(-37) --> '-0b100101'\n" +" s = s.lstrip('-0b') # 先頭のゼロと負符号を除去する\n" +" return len(s) # len('100101') --> 6" #: ../../library/stdtypes.rst:502 msgid "" @@ -976,11 +988,12 @@ msgstr "" ">>> (-n).bit_count()\n" "3" -#: ../../library/stdtypes.rst:516 msgid "" "def bit_count(self):\n" " return bin(self).count(\"1\")" msgstr "" +"def bit_count(self):\n" +" return bin(self).count(\"1\")" #: ../../library/stdtypes.rst:523 msgid "Return an array of bytes representing an integer." @@ -1026,11 +1039,12 @@ msgstr "" "上記のデフォルト値は整数を 1 バイトのオブジェクトに適切に変換するのに使うこと" "ができます::" -#: ../../library/stdtypes.rst:553 msgid "" ">>> (65).to_bytes()\n" "b'A'" msgstr "" +">>> (65).to_bytes()\n" +"b'A'" #: ../../library/stdtypes.rst:556 msgid "" @@ -1061,13 +1075,12 @@ msgstr "``length`` と ``byteorder`` 引数にデフォルト値を追加しま msgid "Return the integer represented by the given array of bytes." msgstr "与えられたバイト列の整数表現を返します。" -#: ../../library/stdtypes.rst:590 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" -"引数 *bytes* は :term:`bytes-like object` か、または bytes を生成する " -"iterable でなければなりません。" +"引数 ``bytes`` は :term:`bytes-like object` か、バイト値を生成するイテラブル" +"でなければなりません。" #: ../../library/stdtypes.rst:593 msgid "" @@ -1243,7 +1256,6 @@ msgstr "16 進文字列表現は以下の書式となります::" msgid "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" msgstr "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" -#: ../../library/stdtypes.rst:709 msgid "" "where the optional ``sign`` may be either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -1256,6 +1268,17 @@ msgid "" "by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted " "by :meth:`float.fromhex`." msgstr "" +"ここで、省略可能な ``sign`` は ``+`` または ``-``、``integer`` と " +"``fraction`` は16進数字の文字列、``exponent`` は先頭に符号を付けてもよい10進" +"整数です。\n" +"大文字と小文字は区別されず、整数部か小数部のいずれかに少なくとも1桁の16進数字" +"が必要です。\n" +"この構文は、C99 規格の6.4.4.2節で指定されている構文や、Java 1.5 以降で使われ" +"ている構文に似ています。\n" +"特に、:meth:`float.hex` の出力は C や Java のコードで16進浮動小数点リテラルと" +"して使えます。\n" +"また、C の ``%a`` 書式文字や Java の ``Double.toHexString`` で生成された16進" +"文字列は :meth:`float.fromhex` で受け付けられます。" #: ../../library/stdtypes.rst:722 msgid "" @@ -1425,7 +1448,6 @@ msgstr "" "を計算する Python コードの例を示します。\n" "このコードは組み込みのハッシュ計算と等価です::" -#: ../../library/stdtypes.rst:813 msgid "" "import sys, math\n" "\n" @@ -1476,6 +1498,53 @@ msgid "" " hash_value = -2\n" " return hash_value" msgstr "" +"import sys, math\n" +"\n" +"def hash_fraction(m, n):\n" +" \"\"\"有理数 m / n のハッシュを計算する。\n" +"\n" +" m と n は整数で、n は正と仮定する。\n" +" hash(fractions.Fraction(m, n)) と等価。\n" +"\n" +" \"\"\"\n" +" P = sys.hash_info.modulus\n" +" # P の共通因子を除く (m と n がすでに互いに素なら不要)。\n" +" while m % P == n % P == 0:\n" +" m, n = m // P, n // P\n" +"\n" +" if n % P == 0:\n" +" hash_value = sys.hash_info.inf\n" +" else:\n" +" # フェルマーの小定理により pow(n, P-1, P) は1なので、\n" +" # pow(n, P-2, P) は P を法とする n の逆数を与える。\n" +" hash_value = (abs(m) % P) * pow(n, P - 2, P) % P\n" +" if m < 0:\n" +" hash_value = -hash_value\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value\n" +"\n" +"def hash_float(x):\n" +" \"\"\"浮動小数点数 x のハッシュを計算する。\"\"\"\n" +"\n" +" if math.isnan(x):\n" +" return object.__hash__(x)\n" +" elif math.isinf(x):\n" +" return sys.hash_info.inf if x > 0 else -sys.hash_info.inf\n" +" else:\n" +" return hash_fraction(*x.as_integer_ratio())\n" +"\n" +"def hash_complex(z):\n" +" \"\"\"複素数 z のハッシュを計算する。\"\"\"\n" +"\n" +" hash_value = hash_float(z.real) + sys.hash_info.imag * hash_float(z." +"imag)\n" +" # 2**sys.hash_info.width を法として、符号付きの剰余に還元する\n" +" M = 2**(sys.hash_info.width - 1)\n" +" hash_value = (hash_value & (M - 1)) - (hash_value & M)\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value" #: ../../library/stdtypes.rst:864 msgid "Boolean Type - :class:`bool`" @@ -1511,11 +1580,12 @@ msgstr "" "ブール値を返します。しかしながら、論理演算子 ``and``, ``or`` および ``!=`` を" "使うほうが ``&``, ``|`` や ``^`` を使うよりも好ましいです。" -#: ../../library/stdtypes.rst:886 msgid "" "The use of the bitwise inversion operator ``~`` is deprecated and will raise " "an error in Python 3.16." msgstr "" +"ビット反転演算子 ``~`` の使用は非推奨となり、Python 3.16 ではエラーが送出され" +"るようになります。" #: ../../library/stdtypes.rst:889 msgid "" @@ -1668,17 +1738,16 @@ msgstr "" msgid "Common Sequence Operations" msgstr "共通のシーケンス演算" -#: ../../library/stdtypes.rst:988 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " "provided to make it easier to correctly implement these operations on custom " "sequence types." msgstr "" -"以下の表にある演算は、ほとんどのミュータブル、イミュータブル両方のシーケンス" -"でサポートされています。カスタムのシーケンス型にこれらの演算を完全に実装する" -"のが簡単になるように、 :class:`collections.abc.Sequence` ABC が提供されていま" -"す。" +"以下の表にある演算は、ミュータブルとイミュータブルの両方を含む、ほとんどの" +"シーケンス型でサポートされています。\n" +"独自のシーケンス型でこれらの演算を正しく実装しやすくするために、:class:" +"`collections.abc.Sequence` ABC が提供されています。" #: ../../library/stdtypes.rst:993 msgid "" @@ -1701,10 +1770,11 @@ msgstr "" "``in`` および ``not in`` 演算の優先順位は比較演算と同じです。``+`` (結合) お" "よび ``*`` (繰り返し)の優先順位は対応する数値演算と同じです。 [3]_" -#: ../../library/stdtypes.rst:1002 msgid "" "See :ref:`time-complexity` for the costs of the various sequence operations." msgstr "" +"各種シーケンス演算の計算量については、:ref:`time-complexity` を参照してくださ" +"い。" #: ../../library/stdtypes.rst:1020 msgid "``x in s``" @@ -1864,7 +1934,6 @@ msgstr "" "これは Python に慣れていないプログラマをよく悩ませます。\n" "次のコードを考えてみてください::" -#: ../../library/stdtypes.rst:1079 msgid "" ">>> lists = [[]] * 3\n" ">>> lists\n" @@ -1873,6 +1942,12 @@ msgid "" ">>> lists\n" "[[3], [3], [3]]" msgstr "" +">>> lists = [[]] * 3\n" +">>> lists\n" +"[[], [], []]\n" +">>> lists[0].append(3)\n" +">>> lists\n" +"[[3], [3], [3]]" #: ../../library/stdtypes.rst:1086 msgid "" @@ -1886,7 +1961,6 @@ msgstr "" "と、その一つのリストが変更されます。別々のリストのリストを作るにはこうしま" "す::" -#: ../../library/stdtypes.rst:1091 msgid "" ">>> lists = [[] for i in range(3)]\n" ">>> lists[0].append(3)\n" @@ -1895,6 +1969,12 @@ msgid "" ">>> lists\n" "[[3], [5], [7]]" msgstr "" +">>> lists = [[] for i in range(3)]\n" +">>> lists[0].append(3)\n" +">>> lists[1].append(5)\n" +">>> lists[2].append(7)\n" +">>> lists\n" +"[[3], [5], [7]]" #: ../../library/stdtypes.rst:1098 msgid "" @@ -1913,31 +1993,27 @@ msgstr "" "す。\n" "ただし ``-0`` はやはり ``0`` であることに注意してください。" -#: ../../library/stdtypes.rst:1107 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " "index *k* such that ``i <= k < j``." msgstr "" +"*s* の *i* から *j* までのスライスは、``i <= k < j`` を満たすインデックス " +"*k* の要素からなるシーケンスとして定義されます。" -#: ../../library/stdtypes.rst:1110 msgid "If *i* is omitted or ``None``, use ``0``." -msgstr "" +msgstr "*i* が省略された場合や ``None`` の場合は ``0`` を使います。" -#: ../../library/stdtypes.rst:1111 msgid "If *j* is omitted or ``None``, use ``len(s)``." -msgstr "" +msgstr "*j* が省略された場合や ``None`` の場合は ``len(s)`` を使います。" -#: ../../library/stdtypes.rst:1112 msgid "If *i* or *j* is less than ``-len(s)``, use ``0``." -msgstr "" +msgstr "*i* または *j* が ``-len(s)`` 未満の場合は ``0`` を使います。" -#: ../../library/stdtypes.rst:1113 msgid "If *i* or *j* is greater than ``len(s)``, use ``len(s)``." -msgstr "" +msgstr "*i* または *j* が ``len(s)`` より大きい場合は ``len(s)`` を使います。" -#: ../../library/stdtypes.rst:1114 msgid "If *i* is greater than or equal to *j*, the slice is empty." -msgstr "" +msgstr "*i* が *j* 以上の場合、スライスは空になります。" #: ../../library/stdtypes.rst:1117 msgid "" @@ -2017,9 +2093,8 @@ msgstr "" "ンスのみをサポートするものがあり、それらはシーケンスの結合や繰り返しをサポー" "トしません。" -#: ../../library/stdtypes.rst:1155 msgid "An :exc:`IndexError` is raised if *i* is outside the sequence range." -msgstr "" +msgstr "*i* がシーケンスの範囲外の場合、:exc:`IndexError` が送出されます。" #: ../../library/stdtypes.rst:1158 msgid "Sequence Methods" @@ -2042,18 +2117,22 @@ msgid "Raises :exc:`ValueError` if *value* is not found in *sequence*." msgstr "" "*sequence* に *value* が見つからなければ :exc:`ValueError` を送出します。" -#: ../../library/stdtypes.rst:1183 msgid "" "The *start* or *stop* arguments allow for efficient searching of subsections " "of the sequence, beginning at *start* and ending at *stop*. This is roughly " "equivalent to ``start + sequence[start:stop].index(value)``, only without " "copying any data." msgstr "" +"``start`` または ``stop`` 引数を使うと、シーケンスの ``start`` から ``stop`` " +"までの部分を効率よく検索できます。\n" +"これはおおむね ``start + sequence[start:stop].index(value)`` と等価ですが、" +"データをコピーしません。" -#: ../../library/stdtypes.rst:1189 msgid "" "Not all sequence types support passing the *start* and *stop* arguments." msgstr "" +"``start`` および ``stop`` 引数の指定をサポートしていないシーケンス型もありま" +"す。" #: ../../library/stdtypes.rst:1195 msgid "Immutable Sequence Types" @@ -2090,15 +2169,14 @@ msgstr "" msgid "Mutable Sequence Types" msgstr "ミュータブルなシーケンス型" -#: ../../library/stdtypes.rst:1224 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " "easier to correctly implement these operations on custom sequence types." msgstr "" -"以下のテーブルにある演算は、ほとんどのミュータブルなシーケンスでサポートされ" -"ています。カスタムのシーケンス型にこれらの演算を完全に実装するのが簡単になる" -"ように、 :class:`collections.abc.MutableSequence` ABC が提供されています。" +"以下の表にある演算は、ミュータブルなシーケンス型で定義されています。\n" +"独自のシーケンス型でこれらの演算を正しく実装しやすくするために、:class:" +"`collections.abc.MutableSequence` ABC が提供されています。" #: ../../library/stdtypes.rst:1228 msgid "" @@ -2209,59 +2287,71 @@ msgstr "ミュータブルなシーケンスのメソッド" msgid "Mutable sequence types also support the following methods:" msgstr "ミュータブルなシーケンス型は以下のようなメソッドをサポートしています:" -#: ../../library/stdtypes.rst:1294 msgid "" "Append *value* to the end of the sequence. This is equivalent to writing " "``seq[len(seq):len(seq)] = [value]``." msgstr "" +"シーケンスの末尾に ``value`` を追加します。\n" +"これは ``seq[len(seq):len(seq)] = [value]`` と書くことと等価です。" -#: ../../library/stdtypes.rst:1306 msgid "" "Remove all items from *sequence*. This is equivalent to writing ``del " "sequence[:]``." msgstr "" +"*sequence* からすべての要素を削除します。\n" +"これは ``del sequence[:]`` と書くことと等価です。" -#: ../../library/stdtypes.rst:1318 msgid "" "Create a shallow copy of *sequence*. This is equivalent to writing " "``sequence[:]``." msgstr "" +"*sequence* の浅いコピーを作成します。\n" +"これは ``sequence[:]`` と書くことと等価です。" -#: ../../library/stdtypes.rst:1321 msgid "" "The :meth:`!copy` method is not part of the :class:`~collections.abc." "MutableSequence` :class:`~abc.ABC`, but most concrete mutable sequence types " "provide it." msgstr "" +":meth:`!copy` メソッドは :class:`~collections.abc.MutableSequence` :class:" +"`~abc.ABC` には含まれませんが、ほとんどの具体的なミュータブルシーケンス型で提" +"供されています。" -#: ../../library/stdtypes.rst:1332 msgid "" "Extend *sequence* with the contents of *iterable*. For the most part, this " "is the same as writing ``seq[len(seq):len(seq)] = iterable``." msgstr "" +"*sequence* を ``iterable`` の内容で拡張します。\n" +"これはほとんどの場合、``seq[len(seq):len(seq)] = iterable`` と書くことと同じ" +"です。" -#: ../../library/stdtypes.rst:1343 msgid "" "Insert *value* into *sequence* at the given *index*. This is equivalent to " "writing ``sequence[index:index] = [value]``." msgstr "" +"*sequence* の指定された ``index`` に ``value`` を挿入します。\n" +"これは ``sequence[index:index] = [value]`` と書くことと等価です。" -#: ../../library/stdtypes.rst:1353 msgid "" "Retrieve the item at *index* and also remove it from *sequence*. By default, " "the last item in *sequence* is removed and returned." msgstr "" +"``index`` の要素を取得し、*sequence* から削除します。\n" +"デフォルトでは、*sequence* の最後の要素を削除して返します。" -#: ../../library/stdtypes.rst:1363 msgid "Remove the first item from *sequence* where ``sequence[i] == value``." msgstr "" +"``sequence[i] == value`` を満たす最初の要素を *sequence* から削除します。" -#: ../../library/stdtypes.rst:1374 msgid "" "Reverse the items of *sequence* in place. This method maintains economy of " "space when reversing a large sequence. To remind users that it operates by " "side-effect, it returns ``None``." msgstr "" +"*sequence* の要素をインプレースで逆順に並べ替えます。\n" +"このメソッドは、大きなシーケンスを逆順にするときにもメモリ使用量を抑えま" +"す。\n" +"副作用によって動作することを利用者に意識させるため、``None`` を返します。" #: ../../library/stdtypes.rst:1382 msgid "Lists" @@ -2322,9 +2412,8 @@ msgid "" msgstr "" "リストを作る方法は、他にも組み込み関数 :func:`sorted` などいろいろあります。" -#: ../../library/stdtypes.rst:1411 msgid "Lists are :ref:`generic ` over the types of their items." -msgstr "" +msgstr "リストは要素の型について :ref:`ジェネリック ` です。" #: ../../library/stdtypes.rst:1413 msgid "" @@ -2426,11 +2515,12 @@ msgstr "" "ソート中にリストが変更されたことを検出できた場合は :exc:`ValueError` を送出し" "ます。" -#: ../../library/stdtypes.rst:1461 msgid "" "For detailed information on thread-safety guarantees for :class:`list` " "objects, see :ref:`thread-safety-list`." msgstr "" +":class:`list` オブジェクトのスレッドセーフ性の保証については、:ref:`thread-" +"safety-list` を参照してください。" #: ../../library/stdtypes.rst:1468 msgid "Tuples" @@ -2508,12 +2598,14 @@ msgid "" msgstr "" "タプルは :ref:`共通の ` シーケンス演算をすべて実装します。" -#: ../../library/stdtypes.rst:1504 msgid "" "Tuples are :ref:`generic ` over the types of their contents. For " "more information, refer to :ref:`the typing documentation on annotating " "tuples `." msgstr "" +"タプルは内容の型について :ref:`ジェネリック ` です。\n" +"詳しくは、:ref:`タプルのアノテーションに関する typing ドキュメント " +"` を参照してください。" #: ../../library/stdtypes.rst:1508 msgid "" @@ -2591,7 +2683,6 @@ msgstr "" msgid "Range examples::" msgstr "range の例::" -#: ../../library/stdtypes.rst:1552 msgid "" ">>> list(range(10))\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" @@ -2608,6 +2699,20 @@ msgid "" ">>> list(range(1, 0))\n" "[]" msgstr "" +">>> list(range(10))\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" +">>> list(range(1, 11))\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n" +">>> list(range(0, 30, 5))\n" +"[0, 5, 10, 15, 20, 25]\n" +">>> list(range(0, 10, 3))\n" +"[0, 3, 6, 9]\n" +">>> list(range(0, -10, -1))\n" +"[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n" +">>> list(range(0))\n" +"[]\n" +">>> list(range(1, 0))\n" +"[]" #: ../../library/stdtypes.rst:1567 msgid "" @@ -2711,15 +2816,15 @@ msgstr "" "numbers-linspace/>`_ は浮動小数点数向けの遅延評価版 range を実装する方法を紹" "介しています。" -#: ../../library/stdtypes.rst:1647 msgid "Text and Binary Sequence Type Methods Summary" -msgstr "" +msgstr "テキストおよびバイナリシーケンス型のメソッド一覧" -#: ../../library/stdtypes.rst:1648 msgid "" "The following table summarizes the text and binary sequence types methods by " "category." msgstr "" +"次の表は、テキストおよびバイナリシーケンス型のメソッドを分類ごとにまとめたも" +"のです。" #: ../../library/stdtypes.rst:1653 msgid "Category" @@ -2733,9 +2838,8 @@ msgstr ":class:`str` メソッド" msgid ":class:`bytes` and :class:`bytearray` methods" msgstr ":class:`bytes` または :class:`bytearray` メソッド" -#: ../../library/stdtypes.rst:1655 msgid "Formatting" -msgstr "" +msgstr "書式化" #: ../../library/stdtypes.rst:1655 msgid ":meth:`str.format`" @@ -2757,9 +2861,8 @@ msgstr ":ref:`old-string-formatting`" msgid ":ref:`bytes-formatting`" msgstr ":ref:`bytes-formatting`" -#: ../../library/stdtypes.rst:1663 msgid "Searching and Replacing" -msgstr "" +msgstr "検索と置換" #: ../../library/stdtypes.rst:1663 msgid ":meth:`str.find`" @@ -2825,9 +2928,8 @@ msgstr ":meth:`str.replace`" msgid ":meth:`bytes.replace`" msgstr ":meth:`bytes.replace`" -#: ../../library/stdtypes.rst:1675 msgid "Splitting and Joining" -msgstr "" +msgstr "分割と結合" #: ../../library/stdtypes.rst:1675 msgid ":meth:`str.split`" @@ -2877,9 +2979,8 @@ msgstr ":meth:`str.join`" msgid ":meth:`bytes.join`" msgstr ":meth:`bytes.join`" -#: ../../library/stdtypes.rst:1685 msgid "String Classification" -msgstr "" +msgstr "文字列の分類" #: ../../library/stdtypes.rst:1685 msgid ":meth:`str.isalpha`" @@ -2953,9 +3054,8 @@ msgstr ":meth:`bytes.isspace`" msgid ":meth:`str.isprintable`" msgstr ":meth:`str.isprintable`" -#: ../../library/stdtypes.rst:1707 msgid "Case Manipulation" -msgstr "" +msgstr "大文字と小文字の操作" #: ../../library/stdtypes.rst:1707 msgid ":meth:`str.lower`" @@ -3001,9 +3101,8 @@ msgstr ":meth:`str.swapcase`" msgid ":meth:`bytes.swapcase`" msgstr ":meth:`bytes.swapcase`" -#: ../../library/stdtypes.rst:1719 msgid "Padding and Stripping" -msgstr "" +msgstr "パディングと除去" #: ../../library/stdtypes.rst:1719 msgid ":meth:`str.ljust`" @@ -3061,25 +3160,20 @@ msgstr ":meth:`bytes.lstrip`" msgid ":meth:`bytes.rstrip`" msgstr ":meth:`bytes.rstrip`" -#: ../../library/stdtypes.rst:1729 msgid ":meth:`str.removeprefix`" -msgstr "" +msgstr ":meth:`str.removeprefix`" -#: ../../library/stdtypes.rst:1729 msgid ":meth:`bytes.removeprefix`" -msgstr "" +msgstr ":meth:`bytes.removeprefix`" -#: ../../library/stdtypes.rst:1731 msgid ":meth:`str.removesuffix`" -msgstr "" +msgstr ":meth:`str.removesuffix`" -#: ../../library/stdtypes.rst:1731 msgid ":meth:`bytes.removesuffix`" -msgstr "" +msgstr ":meth:`bytes.removesuffix`" -#: ../../library/stdtypes.rst:1733 msgid "Translation and Encoding" -msgstr "" +msgstr "変換とエンコーディング" #: ../../library/stdtypes.rst:1733 msgid ":meth:`str.translate`" @@ -3254,23 +3348,24 @@ msgstr "" "`str` に渡すと、略式の文字列表現を返す 1 つ目の場合に該当します。(Python のコ" "マンドラインオプション :option:`-b` も参照してください) 例えば::" -#: ../../library/stdtypes.rst:1824 msgid "" ">>> str(b'Zoot!')\n" "\"b'Zoot!'\"" msgstr "" +">>> str(b'Zoot!')\n" +"\"b'Zoot!'\"" -#: ../../library/stdtypes.rst:1827 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " "strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In " "addition, see the :ref:`stringservices` section." msgstr "" -"``str`` クラスとそのメソッドについて詳しくは、 :ref:`テキストシーケンス型 — " -"str ` や :ref:`string-methods` の節を参照してください。フォーマット" -"された文字列を出力するには、 :ref:`f-strings` と :ref:`string-formatting` の" -"節を参照してください。加えて、 :ref:`stringservices` の節も参照してください。" +"``str`` クラスとそのメソッドについて詳しくは、:ref:`textseq` と後述の :ref:" +"`string-methods` 節を参照してください。\n" +"書式化した文字列の出力については、:ref:`f-strings` と :ref:`formatstrings` の" +"節を参照してください。\n" +"また、:ref:`stringservices` 節も参照してください。" #: ../../library/stdtypes.rst:1839 msgid "String Methods" @@ -3333,7 +3428,6 @@ msgstr "" "文字列の casefold されたコピーを返します。casefold された文字列は、大文字小文" "字に関係ないマッチに使えます。" -#: ../../library/stdtypes.rst:1873 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -3341,30 +3435,44 @@ msgid "" "already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:" "`casefold` converts it to ``\"ss\"``. For example:" msgstr "" +"casefold は小文字化に似ていますが、文字列内の大文字と小文字の区別をすべて取り" +"除くことを目的とするため、より徹底した変換を行います。\n" +"例えば、ドイツ語の小文字 ``'ß'`` は ``\"ss\"`` と等価です。\n" +"``'ß'`` はすでに小文字なので :meth:`lower` では変わりませんが、:meth:" +"`casefold` では ``\"ss\"`` に変換されます。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:1880 msgid "" ">>> 'straße'.lower()\n" "'straße'\n" ">>> 'straße'.casefold()\n" "'strasse'" msgstr "" +">>> 'straße'.lower()\n" +"'straße'\n" +">>> 'straße'.casefold()\n" +"'strasse'" -#: ../../library/stdtypes.rst:1887 msgid "" "The casefolding algorithm is `described in section 3.13.3 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" +"casefold のアルゴリズムは `Unicode 標準の3.13.3節「Default Case Folding」 " +"`__ に記載されています。" -#: ../../library/stdtypes.rst:1896 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``. For example::" msgstr "" +"長さ ``width`` の文字列の中央に配置して返します。\n" +"パディングには指定された ``fillchar`` (デフォルトは ASCII スペース) を使いま" +"す。\n" +"``width`` が ``len(s)`` 以下の場合は元の文字列を返します。\n" +"例えば、次のようになります。 ::" -#: ../../library/stdtypes.rst:1900 msgid "" ">>> 'Python'.center(10)\n" "' Python '\n" @@ -3373,6 +3481,12 @@ msgid "" ">>> 'Python'.center(4)\n" "'Python'" msgstr "" +">>> 'Python'.center(10)\n" +"' Python '\n" +">>> 'Python'.center(10, '-')\n" +"'--Python--'\n" +">>> 'Python'.center(4)\n" +"'Python'" #: ../../library/stdtypes.rst:1910 msgid "" @@ -3390,7 +3504,6 @@ msgid "" "which is the length of the string plus one. For example::" msgstr "" -#: ../../library/stdtypes.rst:1917 msgid "" ">>> 'spam, spam, spam'.count('spam')\n" "3\n" @@ -3403,6 +3516,16 @@ msgid "" ">>> 'spam, spam, spam'.count('')\n" "17" msgstr "" +">>> 'spam, spam, spam'.count('spam')\n" +"3\n" +">>> 'spam, spam, spam'.count('spam', 5)\n" +"2\n" +">>> 'spam, spam, spam'.count('spam', 5, 10)\n" +"1\n" +">>> 'spam, spam, spam'.count('eggs')\n" +"0\n" +">>> 'spam, spam, spam'.count('')\n" +"17" #: ../../library/stdtypes.rst:1930 msgid "Return the string encoded to :class:`bytes`." @@ -3430,14 +3553,16 @@ msgstr "" "``'backslashreplace'`` と、そして :func:`codecs.register_error` で登録された" "名前です。詳しくは :ref:`error-handlers` を参照してください。" -#: ../../library/stdtypes.rst:1942 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used. For example::" msgstr "" +"パフォーマンス上の理由から、実際にエンコーディングエラーが発生した場合、:ref:" +"`devmode` が有効な場合、または :ref:`デバッグビルド ` を使ってい" +"る場合にのみ、``errors`` の値の妥当性を検査します。\n" +"例えば、次のようになります。 ::" -#: ../../library/stdtypes.rst:1948 msgid "" ">>> encoded_str_to_bytes = 'Python'.encode()\n" ">>> type(encoded_str_to_bytes)\n" @@ -3445,6 +3570,11 @@ msgid "" ">>> encoded_str_to_bytes\n" "b'Python'" msgstr "" +">>> encoded_str_to_bytes = 'Python'.encode()\n" +">>> type(encoded_str_to_bytes)\n" +"\n" +">>> encoded_str_to_bytes\n" +"b'Python'" #: ../../library/stdtypes.rst:1955 ../../library/stdtypes.rst:3701 msgid "Added support for keyword arguments." @@ -3467,7 +3597,6 @@ msgid "" "equivalent to ``str[start:end].endswith(suffix)``. For example::" msgstr "" -#: ../../library/stdtypes.rst:1971 msgid "" ">>> 'Python'.endswith('on')\n" "True\n" @@ -3478,12 +3607,18 @@ msgid "" ">>> 'Python is amazing'.endswith('is', 0, 9)\n" "True" msgstr "" +">>> 'Python'.endswith('on')\n" +"True\n" +">>> 'a tuple of suffixes'.endswith(('at', 'in'))\n" +"False\n" +">>> 'a tuple of suffixes'.endswith(('at', 'es'))\n" +"True\n" +">>> 'Python is amazing'.endswith('is', 0, 9)\n" +"True" -#: ../../library/stdtypes.rst:1980 msgid "See also :meth:`startswith` and :meth:`removesuffix`." -msgstr "" +msgstr ":meth:`startswith` と :meth:`removesuffix` も参照してください。" -#: ../../library/stdtypes.rst:1985 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -3498,8 +3633,19 @@ msgid "" "incremented by one regardless of how the character is represented when " "printed. For example::" msgstr "" +"すべてのタブ文字を、現在の列と指定されたタブサイズに応じて一つ以上のスペース" +"に置き換えた文字列のコピーを返します。\n" +"タブ位置は ``tabsize`` 文字ごとにあります (デフォルトは8で、列0、8、16などが" +"タブ位置になります)。\n" +"文字列を展開する際には、現在の列をゼロに設定し、文字列を1文字ずつ調べます。\n" +"文字がタブ (``\\t``) の場合、現在の列が次のタブ位置に達するまで、結果に一つ以" +"上のスペース文字を挿入します (タブ文字自体はコピーしません)。\n" +"文字が改行 (``\\n``) または復帰 (``\\r``) の場合、その文字をコピーして現在の" +"列をゼロに戻します。\n" +"それ以外の文字はそのままコピーし、表示したときの表現に関係なく現在の列を一つ" +"進めます。\n" +"例えば、次のようになります。 ::" -#: ../../library/stdtypes.rst:1998 msgid "" ">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" "'01 012 0123 01234'\n" @@ -3509,26 +3655,39 @@ msgid "" "01 012\n" "0123 01234" msgstr "" +">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" +"'01 012 0123 01234'\n" +">>> '01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"'01 012 0123 01234'\n" +">>> print('01\\t012\\n0123\\t01234'.expandtabs(4))\n" +"01 012\n" +"0123 01234" -#: ../../library/stdtypes.rst:2009 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found. For " "example::" msgstr "" +"スライス ``s[start:end]`` 内で部分文字列 ``sub`` が見つかる、文字列内の最小の" +"インデックスを返します。\n" +"省略可能な ``start`` と ``end`` 引数はスライス表記と同様に解釈されます。\n" +"``sub`` が見つからない場合は ``-1`` を返します。\n" +"例えば、次のようになります。 ::" -#: ../../library/stdtypes.rst:2014 msgid "" ">>> 'spam, spam, spam'.find('sp')\n" "0\n" ">>> 'spam, spam, spam'.find('sp', 5)\n" "6" msgstr "" +">>> 'spam, spam, spam'.find('sp')\n" +"0\n" +">>> 'spam, spam, spam'.find('sp', 5)\n" +"6" -#: ../../library/stdtypes.rst:2019 msgid "See also :meth:`rfind` and :meth:`index`." -msgstr "" +msgstr ":meth:`rfind` と :meth:`index` も参照してください。" #: ../../library/stdtypes.rst:2023 msgid "" @@ -3540,11 +3699,12 @@ msgstr "" "す。 *sub* が部分文字列であるかどうかのみを調べるには、 :keyword:`in` 演算子" "を使ってください::" -#: ../../library/stdtypes.rst:2027 msgid "" ">>> 'Py' in 'Python'\n" "True" msgstr "" +">>> 'Py' in 'Python'\n" +"True" #: ../../library/stdtypes.rst:2033 msgid "" @@ -3556,7 +3716,6 @@ msgid "" "the corresponding argument. For example:" msgstr "" -#: ../../library/stdtypes.rst:2040 msgid "" ">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" "'The sum of 1 + 2 is 3'\n" @@ -3565,6 +3724,12 @@ msgid "" ">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" "'Nobody expects the Spanish Inquisition!'" msgstr "" +">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"The sum of {a} + {b} is {answer}\".format(answer=1+2, a=1, b=2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" +"'Nobody expects the Spanish Inquisition!'" #: ../../library/stdtypes.rst:2049 msgid "" @@ -3610,13 +3775,14 @@ msgstr "" "ピーされず、直接使われます。これは例えば ``mapping`` が dict のサブクラスであ" "るときに便利です:" -#: ../../library/stdtypes.rst:2086 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found. For example:" msgstr "" +":meth:`~str.find` と同様ですが、部分文字列が見つからない場合は :exc:" +"`ValueError` を送出します。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2089 msgid "" ">>> 'spam, spam, spam'.index('spam')\n" "0\n" @@ -3627,20 +3793,31 @@ msgid "" " ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" msgstr "" +">>> 'spam, spam, spam'.index('spam')\n" +"0\n" +">>> 'spam, spam, spam'.index('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.index('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" -#: ../../library/stdtypes.rst:2100 msgid "See also :meth:`rindex`." -msgstr "" +msgstr ":meth:`rindex` も参照してください。" -#: ../../library/stdtypes.rst:2105 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " "alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c." "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``. For example:" msgstr "" +"文字列内のすべての文字が字母または数字で、かつ1文字以上ある場合は ``True`` " +"を、それ以外の場合は ``False`` を返します。\n" +"文字 ``c`` は、``c.isalpha()``、``c.isdecimal()``、``c.isdigit()``、``c." +"isnumeric()`` のいずれかが ``True`` を返す場合に字母または数字とみなされま" +"す。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2110 msgid "" ">>> 'abc123'.isalnum()\n" "True\n" @@ -3651,8 +3828,15 @@ msgid "" ">>> ' '.isalnum()\n" "False" msgstr "" +">>> 'abc123'.isalnum()\n" +"True\n" +">>> 'abc123!@#'.isalnum()\n" +"False\n" +">>> ''.isalnum()\n" +"False\n" +">>> ' '.isalnum()\n" +"False" -#: ../../library/stdtypes.rst:2124 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -3663,8 +3847,17 @@ msgid "" "the Unicode Standard `__. For example:" msgstr "" +"文字列内のすべての文字が字母で、かつ1文字以上ある場合は ``True`` を、それ以外" +"の場合は ``False`` を返します。\n" +"字母とは、Unicode 文字データベースで「Letter」と定義されている文字、すなわち" +"一般カテゴリのプロパティが \"Lm\"、\"Lt\"、\"Lu\"、\"Ll\"、\"Lo\" のいずれか" +"である文字です。\n" +"これは `Unicode 標準の4.10節「Letters, Alphabetic, and Ideographic」で定義さ" +"れている Alphabetic プロパティ `__ とは異なることに注意してくださ" +"い。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2133 msgid "" ">>> 'Letters and spaces'.isalpha()\n" "False\n" @@ -3674,27 +3867,37 @@ msgid "" "too\n" "True" msgstr "" +">>> 'Letters and spaces'.isalpha()\n" +"False\n" +">>> 'LettersOnly'.isalpha()\n" +"True\n" +">>> 'µ'.isalpha() # 非 ASCII 文字も字母とみなされる場合がある\n" +"True" -#: ../../library/stdtypes.rst:2142 msgid "See :ref:`unicode-properties`." -msgstr "" +msgstr ":ref:`unicode-properties` を参照してください。" -#: ../../library/stdtypes.rst:2147 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F. For example:" msgstr "" +"文字列が空であるか、文字列内のすべての文字が ASCII 文字である場合は ``True`` " +"を、それ以外の場合は ``False`` を返します。\n" +"ASCII 文字のコードポイントは U+0000-U+007F の範囲です。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2151 msgid "" ">>> 'ASCII characters'.isascii()\n" "True\n" ">>> 'µ'.isascii()\n" "False" msgstr "" +">>> 'ASCII characters'.isascii()\n" +"True\n" +">>> 'µ'.isascii()\n" +"False" -#: ../../library/stdtypes.rst:2163 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -3702,8 +3905,13 @@ msgid "" "INDIC DIGIT ZERO. Formally a decimal character is a character in the " "Unicode General Category \"Nd\". For example:" msgstr "" +"文字列内のすべての文字が10進数字で、かつ1文字以上ある場合は ``True`` を、それ" +"以外の場合は ``False`` を返します。\n" +"10進数字とは、U+0660 (ARABIC-INDIC DIGIT ZERO) のように10進数を構成するために" +"使える文字です。\n" +"厳密には、Unicode の一般カテゴリが \"Nd\" である文字を指します。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2170 msgid "" ">>> '0123456789'.isdecimal()\n" "True\n" @@ -3712,8 +3920,13 @@ msgid "" ">>> 'alphabetic'.isdecimal()\n" "False" msgstr "" +">>> '0123456789'.isdecimal()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # アラビア・インド数字の0から9\n" +"True\n" +">>> 'alphabetic'.isdecimal()\n" +"False" -#: ../../library/stdtypes.rst:2182 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -3723,6 +3936,14 @@ msgid "" "Kharosthi#Numerals>`__. Formally, a digit is a character that has the " "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" +"文字列内のすべての文字が数字で、かつ1文字以上ある場合は ``True`` を、それ以外" +"の場合は ``False`` を返します。\n" +"数字には10進数字と、互換文字である上付き数字のように特別な扱いが必要な数字が" +"含まれます。\n" +"これには、`カローシュティー数字 `__ のように10進数の構成には使えない数字も含まれます。\n" +"厳密には、プロパティ値 Numeric_Type=Digit または Numeric_Type=Decimal を持つ" +"文字を指します。" #: ../../library/stdtypes.rst:2190 ../../library/stdtypes.rst:2271 #: ../../library/stdtypes.rst:2288 ../../library/stdtypes.rst:2315 @@ -3735,7 +3956,6 @@ msgstr "" msgid "For example:" msgstr "例えば:" -#: ../../library/stdtypes.rst:2192 msgid "" ">>> '0123456789'.isdigit()\n" "True\n" @@ -3746,10 +3966,17 @@ msgid "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" msgstr "" +">>> '0123456789'.isdigit()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # アラビア・インド数字の0から9\n" +"True\n" +">>> '⅕'.isdigit() # 分数の5分の1\n" +"False\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" -#: ../../library/stdtypes.rst:2203 msgid "See also :meth:`isdecimal` and :meth:`isnumeric`." -msgstr "" +msgstr ":meth:`isdecimal` と :meth:`isnumeric` も参照してください。" #: ../../library/stdtypes.rst:2208 msgid "" @@ -3771,7 +3998,6 @@ msgstr "" msgid "Example: ::" msgstr "例: ::" -#: ../../library/stdtypes.rst:2217 msgid "" ">>> from keyword import iskeyword\n" "\n" @@ -3780,6 +4006,12 @@ msgid "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" msgstr "" +">>> from keyword import iskeyword\n" +"\n" +">>> 'hello'.isidentifier(), iskeyword('hello')\n" +"(True, False)\n" +">>> 'def'.isidentifier(), iskeyword('def')\n" +"(True, True)" #: ../../library/stdtypes.rst:2227 msgid "" @@ -3790,7 +4022,6 @@ msgstr "" "ある文字が 1 文字以上あるなら ``True`` を、そうでなければ ``False`` を返しま" "す。" -#: ../../library/stdtypes.rst:2233 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -3799,8 +4030,14 @@ msgid "" "characters are those with the property value Numeric_Type=Digit, " "Numeric_Type=Decimal or Numeric_Type=Numeric. For example:" msgstr "" +"文字列内のすべての文字が数を表す文字で、かつ1文字以上ある場合は ``True`` を、" +"それ以外の場合は ``False`` を返します。\n" +"数を表す文字には、数字や、U+2155 (VULGAR FRACTION ONE FIFTH) のように " +"Unicode の数値プロパティを持つすべての文字が含まれます。\n" +"厳密には、プロパティ値 Numeric_Type=Digit、Numeric_Type=Decimal、" +"Numeric_Type=Numeric のいずれかを持つ文字を指します。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2241 msgid "" ">>> '0123456789'.isnumeric()\n" "True\n" @@ -3811,26 +4048,38 @@ msgid "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" msgstr "" +">>> '0123456789'.isnumeric()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # アラビア・インド数字の0から9\n" +"True\n" +">>> '⅕'.isnumeric() # 分数の5分の1\n" +"True\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" -#: ../../library/stdtypes.rst:2252 msgid "See also :meth:`isdecimal` and :meth:`isdigit`." -msgstr "" +msgstr ":meth:`isdecimal` と :meth:`isdigit` も参照してください。" -#: ../../library/stdtypes.rst:2257 msgid "" "Return ``True`` if all characters in the string are printable, ``False`` if " "it contains at least one non-printable character." msgstr "" +"文字列内のすべての文字が表示可能な場合は ``True`` を、表示できない文字が一つ" +"でも含まれる場合は ``False`` を返します。" -#: ../../library/stdtypes.rst:2260 msgid "" "Here \"printable\" means the character is suitable for :func:`repr` to use " "in its output; \"non-printable\" means that :func:`repr` on built-in types " "will hex-escape the character. It has no bearing on the handling of strings " "written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" +"ここで「表示可能」とは、その文字を :func:`repr` の出力にそのまま使えることを" +"意味します。\n" +"「表示できない」とは、組み込み型に対する :func:`repr` がその文字を16進エス" +"ケープで表すことを意味します。\n" +":data:`sys.stdout` や :data:`sys.stderr` に書き出す文字列の扱いには関係ありま" +"せん。" -#: ../../library/stdtypes.rst:2265 msgid "" "The printable characters are those which in the Unicode character database " "(see :mod:`unicodedata`) have a general category in group Letter, Mark, " @@ -3838,18 +4087,25 @@ msgid "" "0x20. Nonprintable characters are those in group Separator or Other (Z or " "C), except the ASCII space." msgstr "" +"表示可能な文字は、Unicode 文字データベース (:mod:`unicodedata` を参照) で一般" +"カテゴリが Letter、Mark、Number、Punctuation、Symbol のグループ (L、M、N、P、" +"S) に属する文字と、ASCII スペース 0x20 です。\n" +"表示できない文字は、ASCII スペースを除く、Separator または Other のグループ " +"(Z、C) に属する文字です。" -#: ../../library/stdtypes.rst:2273 msgid "" ">>> ''.isprintable(), ' '.isprintable()\n" "(True, True)\n" ">>> '\\t'.isprintable(), '\\n'.isprintable()\n" "(False, False)" msgstr "" +">>> ''.isprintable(), ' '.isprintable()\n" +"(True, True)\n" +">>> '\\t'.isprintable(), '\\n'.isprintable()\n" +"(False, False)" -#: ../../library/stdtypes.rst:2280 msgid "See also :meth:`isspace`." -msgstr "" +msgstr ":meth:`isspace` も参照してください。" #: ../../library/stdtypes.rst:2285 msgid "" @@ -3859,7 +4115,6 @@ msgstr "" "文字列が空白文字だけからなり、かつ 1 文字以上ある場合には ``True`` を返し、そ" "うでない場合は ``False`` を返します。" -#: ../../library/stdtypes.rst:2290 msgid "" ">>> ''.isspace()\n" "False\n" @@ -3870,6 +4125,14 @@ msgid "" ">>> '\\u3000'.isspace() # IDEOGRAPHIC SPACE\n" "True" msgstr "" +">>> ''.isspace()\n" +"False\n" +">>> ' '.isspace()\n" +"True\n" +">>> '\\t\\n'.isspace() # タブと改行\n" +"True\n" +">>> '\\u3000'.isspace() # 全角スペース\n" +"True" msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" @@ -3880,9 +4143,8 @@ msgstr "" "(\"Seperator, space\") であるか、 双方向クラスが ``WS``、``B``、 ``S`` のい" "ずれかである場合、その文字は *空白文字(whitespace)* です。" -#: ../../library/stdtypes.rst:2306 msgid "See also :meth:`isprintable`." -msgstr "" +msgstr ":meth:`isprintable` も参照してください。" #: ../../library/stdtypes.rst:2311 msgid "" @@ -3896,7 +4158,6 @@ msgstr "" "にのみ続く場合には ``True`` を返します。そうでない場合は ``False`` を返しま" "す。" -#: ../../library/stdtypes.rst:2317 msgid "" ">>> 'Spam, Spam, Spam'.istitle()\n" "True\n" @@ -3905,10 +4166,15 @@ msgid "" ">>> 'SPAM, SPAM, SPAM'.istitle()\n" "False" msgstr "" +">>> 'Spam, Spam, Spam'.istitle()\n" +"True\n" +">>> 'spam, spam, spam'.istitle()\n" +"False\n" +">>> 'SPAM, SPAM, SPAM'.istitle()\n" +"False" -#: ../../library/stdtypes.rst:2326 msgid "See also :meth:`title`." -msgstr "" +msgstr ":meth:`title` も参照してください。" #: ../../library/stdtypes.rst:2331 msgid "" @@ -3919,25 +4185,31 @@ msgstr "" "ある文字が 1 文字以上あるなら ``True`` を、そうでなければ ``False`` を返しま" "す。" -#: ../../library/stdtypes.rst:2349 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " "*iterable*, including :class:`bytes` objects. The separator between " "elements is the string providing this method. For example:" msgstr "" +"``iterable`` 内の文字列を結合した文字列を返します。\n" +"``iterable`` に :class:`bytes` オブジェクトを含む文字列以外の値が一つでもある" +"場合は、:exc:`TypeError` が送出されます。\n" +"要素間の区切りには、このメソッドを呼び出す文字列を使います。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2354 msgid "" ">>> ', '.join(['spam', 'spam', 'spam'])\n" "'spam, spam, spam'\n" ">>> '-'.join('Python')\n" "'P-y-t-h-o-n'" msgstr "" +">>> ', '.join(['spam', 'spam', 'spam'])\n" +"'spam, spam, spam'\n" +">>> '-'.join('Python')\n" +"'P-y-t-h-o-n'" -#: ../../library/stdtypes.rst:2361 msgid "See also :meth:`split`." -msgstr "" +msgstr ":meth:`split` も参照してください。" #: ../../library/stdtypes.rst:2366 msgid "" @@ -3949,7 +4221,6 @@ msgstr "" "(デフォルトでは ASCII スペース) を使って行われます。 *width* が ``len(s)`` 以" "下ならば、元の文字列が返されます。" -#: ../../library/stdtypes.rst:2372 msgid "" ">>> 'Python'.ljust(10)\n" "'Python '\n" @@ -3958,29 +4229,39 @@ msgid "" ">>> 'Monty Python'.ljust(10, '.')\n" "'Monty Python'" msgstr "" +">>> 'Python'.ljust(10)\n" +"'Python '\n" +">>> 'Python'.ljust(10, '.')\n" +"'Python....'\n" +">>> 'Monty Python'.ljust(10, '.')\n" +"'Monty Python'" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:2928 msgid "See also :meth:`rjust`." -msgstr "" +msgstr ":meth:`rjust` も参照してください。" -#: ../../library/stdtypes.rst:2386 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase. For example:" msgstr "" +"大小文字の区別のある文字 [4]_ をすべて小文字に変換した文字列のコピーを返しま" +"す。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2389 msgid "" ">>> 'Lower Method Example'.lower()\n" "'lower method example'" msgstr "" +">>> 'Lower Method Example'.lower()\n" +"'lower method example'" -#: ../../library/stdtypes.rst:2394 msgid "" "The lowercasing algorithm used is `described in section 3.13.2 'Default Case " "Conversion' of the Unicode Standard `__." msgstr "" +"小文字化のアルゴリズムは `Unicode 標準の3.13.2節「Default Case Conversion」 " +"`__ に記載されています。" #: ../../library/stdtypes.rst:2401 msgid "" @@ -3995,13 +4276,16 @@ msgstr "" "除去されます。 *chars* 文字列は接頭辞ではなく、その値に含まれる文字の組み合わ" "せ全てがはぎ取られます::" -#: ../../library/stdtypes.rst:2406 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" msgstr "" +">>> ' spacious '.lstrip()\n" +"'spacious '\n" +">>> 'www.example.com'.lstrip('cmowz.')\n" +"'example.com'" #: ../../library/stdtypes.rst:2411 msgid "" @@ -4011,15 +4295,18 @@ msgstr "" "文字の集合全てではなく、指定した文字列そのものを接頭辞として削除するメソッド" "については、 :meth:`str.removeprefix` を参照してください。使用例::" -#: ../../library/stdtypes.rst:2414 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" msgstr "" - -#: ../../library/stdtypes.rst:2423 +">>> 'Arthur: three!'.lstrip('Arthur: ')\n" +"'ee!'\n" +">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" +"'three!'" + +#: ../../library/stdtypes.rst:2423 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." @@ -4037,17 +4324,20 @@ msgstr "" "文字列) を、Unicode 序数、(任意長の) 文字列、または ``None`` に対応づける辞書" "でなければなりません。このとき、文字で指定したキーは序数に変換されます。" -#: ../../library/stdtypes.rst:2430 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in *from* will be mapped to the " "character at the same position in *to*. If there is a third argument, it " "must be a string, whose characters will be mapped to ``None`` in the result." msgstr "" +"引数が二つの場合、どちらも同じ長さの文字列でなければなりません。\n" +"結果の辞書では、``from`` の各文字が ``to`` の同じ位置の文字にマップされま" +"す。\n" +"3番目の引数を指定する場合、その引数は文字列でなければならず、その各文字は結果" +"で ``None`` にマップされます。" -#: ../../library/stdtypes.rst:2437 msgid "*dict* can now be a :class:`frozendict`." -msgstr "" +msgstr "``dict`` に :class:`frozendict` を指定できるようになりました。" #: ../../library/stdtypes.rst:2442 msgid "" @@ -4061,7 +4351,6 @@ msgstr "" "す。もし区切れなければ、タプルには元の文字列そのものとその後ろに二つの空文字" "列が入ります。" -#: ../../library/stdtypes.rst:2449 msgid "" ">>> 'Monty Python'.partition(' ')\n" "('Monty', ' ', 'Python')\n" @@ -4070,95 +4359,123 @@ msgid "" ">>> 'Monty Python'.partition('-')\n" "('Monty Python', '', '')" msgstr "" +">>> 'Monty Python'.partition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".partition(' ')\n" +"('Monty', ' ', \"Python's Flying Circus\")\n" +">>> 'Monty Python'.partition('-')\n" +"('Monty Python', '', '')" -#: ../../library/stdtypes.rst:2458 msgid "See also :meth:`rpartition`." -msgstr "" +msgstr ":meth:`rpartition` も参照してください。" -#: ../../library/stdtypes.rst:2463 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string:" msgstr "" +"文字列が ``prefix`` で始まる場合は ``string[len(prefix):]`` を返します。\n" +"それ以外の場合は、元の文字列のコピーを返します:" -#: ../../library/stdtypes.rst:2467 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" msgstr "" +">>> 'TestHook'.removeprefix('Test')\n" +"'Hook'\n" +">>> 'BaseTestCase'.removeprefix('Test')\n" +"'BaseTestCase'" -#: ../../library/stdtypes.rst:2476 msgid "See also :meth:`removesuffix` and :meth:`startswith`." -msgstr "" +msgstr ":meth:`removesuffix` と :meth:`startswith` も参照してください。" -#: ../../library/stdtypes.rst:2481 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string:" msgstr "" +"文字列が ``suffix`` で終わり、かつ ``suffix`` が空でない場合は ``string[:-" +"len(suffix)]`` を返します。\n" +"それ以外の場合は、元の文字列のコピーを返します:" -#: ../../library/stdtypes.rst:2485 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" msgstr "" +">>> 'MiscTests'.removesuffix('Tests')\n" +"'Misc'\n" +">>> 'TmpDirMixin'.removesuffix('Tests')\n" +"'TmpDirMixin'" -#: ../../library/stdtypes.rst:2494 msgid "See also :meth:`removeprefix` and :meth:`endswith`." -msgstr "" +msgstr ":meth:`removeprefix` と :meth:`endswith` も参照してください。" -#: ../../library/stdtypes.rst:2499 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If *count* is given, only the first *count* occurrences are " "replaced. If *count* is not specified or ``-1``, then all occurrences are " "replaced. For example:" msgstr "" +"部分文字列 ``old`` のすべての出現箇所を ``new`` に置き換えた文字列のコピーを" +"返します。\n" +"``count`` を指定した場合は、先頭から ``count`` 個の出現箇所だけを置き換えま" +"す。\n" +"``count`` を指定しない場合や ``-1`` を指定した場合は、すべての出現箇所を置き" +"換えます。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2504 msgid "" ">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" "'eggs, eggs, eggs'\n" ">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" "'eggs, spam, spam'" msgstr "" +">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" +"'eggs, eggs, eggs'\n" +">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" +"'eggs, spam, spam'" #: ../../library/stdtypes.rst:2511 ../../library/stdtypes.rst:3808 msgid "*count* is now supported as a keyword argument." msgstr "*count* はキーワード引数として指定可能になりました。" -#: ../../library/stdtypes.rst:2517 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure. " "For example:" msgstr "" +"部分文字列 ``sub`` が ``s[start:end]`` に収まる位置で見つかる、文字列内の最大" +"のインデックスを返します。\n" +"省略可能な ``start`` と ``end`` 引数はスライス表記と同様に解釈されます。\n" +"見つからない場合は ``-1`` を返します。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2522 msgid "" ">>> 'spam, spam, spam'.rfind('sp')\n" "12\n" ">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" "6" msgstr "" +">>> 'spam, spam, spam'.rfind('sp')\n" +"12\n" +">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" +"6" -#: ../../library/stdtypes.rst:2529 msgid "See also :meth:`find` and :meth:`rindex`." -msgstr "" +msgstr ":meth:`find` と :meth:`rindex` も参照してください。" -#: ../../library/stdtypes.rst:2534 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found. For example:" msgstr "" +":meth:`rfind` と同様ですが、部分文字列 ``sub`` が見つからない場合は :exc:" +"`ValueError` を送出します。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2538 msgid "" ">>> 'spam, spam, spam'.rindex('spam')\n" "12\n" @@ -4169,10 +4486,17 @@ msgid "" " ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" msgstr "" +">>> 'spam, spam, spam'.rindex('spam')\n" +"12\n" +">>> 'spam, spam, spam'.rindex('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.rindex('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" -#: ../../library/stdtypes.rst:2549 msgid "See also :meth:`index` and :meth:`find`." -msgstr "" +msgstr ":meth:`index` と :meth:`find` も参照してください。" #: ../../library/stdtypes.rst:2554 msgid "" @@ -4184,7 +4508,6 @@ msgstr "" "指定された文字(デフォルトでは ASCII スペース)が使われます。 *width* が " "``len(s)`` 以下の場合、元の文字列が返されます。" -#: ../../library/stdtypes.rst:2560 msgid "" ">>> 'Python'.rjust(10)\n" "' Python'\n" @@ -4193,10 +4516,15 @@ msgid "" ">>> 'Monty Python'.rjust(10, '.')\n" "'Monty Python'" msgstr "" +">>> 'Python'.rjust(10)\n" +"' Python'\n" +">>> 'Python'.rjust(10, '.')\n" +"'....Python'\n" +">>> 'Monty Python'.rjust(10, '.')\n" +"'Monty Python'" -#: ../../library/stdtypes.rst:2569 msgid "See also :meth:`ljust` and :meth:`zfill`." -msgstr "" +msgstr ":meth:`ljust` と :meth:`zfill` も参照してください。" #: ../../library/stdtypes.rst:2574 msgid "" @@ -4210,7 +4538,6 @@ msgstr "" "す。もし区切れなければ、タプルには二つの空文字列とその後ろに元の文字列そのも" "のが入ります。" -#: ../../library/stdtypes.rst:2581 msgid "" ">>> 'Monty Python'.rpartition(' ')\n" "('Monty', ' ', 'Python')\n" @@ -4219,12 +4546,16 @@ msgid "" ">>> 'Monty Python'.rpartition('-')\n" "('', '', 'Monty Python')" msgstr "" +">>> 'Monty Python'.rpartition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".rpartition(' ')\n" +"(\"Monty Python's Flying\", ' ', 'Circus')\n" +">>> 'Monty Python'.rpartition('-')\n" +"('', '', 'Monty Python')" -#: ../../library/stdtypes.rst:2590 msgid "See also :meth:`partition`." -msgstr "" +msgstr ":meth:`partition` も参照してください。" -#: ../../library/stdtypes.rst:2595 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -4233,8 +4564,13 @@ msgid "" "the right, :meth:`rsplit` behaves like :meth:`split` which is described in " "detail below." msgstr "" +"区切り文字列として ``sep`` を使い、文字列内の単語のリストを返します。\n" +"``maxsplit`` を指定した場合は、*右端から* 最大 ``maxsplit`` 回分割します。\n" +"``sep`` を指定しない場合や ``None`` を指定した場合は、任意の :meth:`空白文字 " +"` の文字列を区切りとします。\n" +"右から分割する点を除いて、:meth:`rsplit` は後で詳しく説明する :meth:`split` " +"と同様に動作します。" -#: ../../library/stdtypes.rst:2605 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -4242,32 +4578,46 @@ msgid "" "The *chars* argument is not a suffix; rather, all combinations of its values " "are stripped. For example:" msgstr "" +"末尾の文字を除去した文字列のコピーを返します。\n" +"``chars`` 引数は、除去する文字の集合を指定する文字列です。\n" +"``chars`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで空白文" +"字を除去します。\n" +"``chars`` 引数を接尾辞として扱うのではなく、その値を構成する文字を組み合わせ" +"に関係なく除去します。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2611 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" msgstr "" +">>> ' spacious '.rstrip()\n" +"' spacious'\n" +">>> 'mississippi'.rstrip('ipz')\n" +"'mississ'" -#: ../../library/stdtypes.rst:2618 msgid "" "See :meth:`removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" +"文字の集合に含まれる文字をすべて除去するのではなく、一つの接尾辞文字列を除去" +"するメソッドについては、:meth:`removesuffix` を参照してください。\n" +"例えば、次のようになります。 ::" -#: ../../library/stdtypes.rst:2621 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" msgstr "" +">>> 'Monty Python'.rstrip(' Python')\n" +"'M'\n" +">>> 'Monty Python'.removesuffix(' Python')\n" +"'Monty'" -#: ../../library/stdtypes.rst:2626 msgid "See also :meth:`strip`." -msgstr "" +msgstr ":meth:`strip` も参照してください。" #: ../../library/stdtypes.rst:2631 msgid "" @@ -4297,7 +4647,6 @@ msgstr "" "字で分割するには :func:`re.split` を使用します)。区切り文字を指定して空の文字" "列を分割すると、 ``['']`` を返します。" -#: ../../library/stdtypes.rst:2646 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -4308,8 +4657,15 @@ msgid "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" msgstr "" +">>> '1,2,3'.split(',')\n" +"['1', '2', '3']\n" +">>> '1,2,3'.split(',', maxsplit=1)\n" +"['1', '2,3']\n" +">>> '1,2,,3,'.split(',')\n" +"['1', '2', '', '3', '']\n" +">>> '1<>2<>3<4'.split('<>')\n" +"['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2657 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive :meth:`whitespace ` are regarded " @@ -4318,8 +4674,15 @@ msgid "" "Consequently, splitting an empty string or a string consisting of just " "whitespace with a ``None`` separator returns ``[]``." msgstr "" +"``sep`` を指定しない場合や ``None`` を指定した場合は、別の分割アルゴリズムを" +"適用します。\n" +"連続する :meth:`空白文字 ` のまとまりを一つの区切りとみなしま" +"す。\n" +"文字列の先頭や末尾に空白文字があっても、結果の先頭や末尾に空文字列は含まれま" +"せん。\n" +"そのため、区切りとして ``None`` を使って空文字列や空白文字のみの文字列を分割" +"すると、``[]`` が返されます。" -#: ../../library/stdtypes.rst:2667 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -4328,14 +4691,20 @@ msgid "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" msgstr "" +">>> '1 2 3'.split()\n" +"['1', '2', '3']\n" +">>> '1 2 3'.split(maxsplit=1)\n" +"['1', '2 3']\n" +">>> ' 1 2 3 '.split()\n" +"['1', '2', '3']" -#: ../../library/stdtypes.rst:2676 msgid "" "If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only " "leading runs of consecutive whitespace are considered." msgstr "" +"``sep`` を指定しないか ``None`` を指定し、かつ ``maxsplit`` が ``0`` の場合" +"は、先頭の連続する空白文字だけを扱います。" -#: ../../library/stdtypes.rst:2681 msgid "" ">>> \"\".split(None, 0)\n" "[]\n" @@ -4344,10 +4713,15 @@ msgid "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" msgstr "" +">>> \"\".split(None, 0)\n" +"[]\n" +">>> \" \".split(None, 0)\n" +"[]\n" +">>> \" foo \".split(maxsplit=0)\n" +"['foo ']" -#: ../../library/stdtypes.rst:2690 msgid "See also :meth:`join` and :meth:`rsplit`." -msgstr "" +msgstr ":meth:`join` と :meth:`rsplit` も参照してください。" #: ../../library/stdtypes.rst:2698 msgid "" @@ -4477,13 +4851,16 @@ msgstr "``\\v`` と ``\\f`` が行境界のリストに追加されました。" msgid "For example::" msgstr "例えば::" -#: ../../library/stdtypes.rst:2737 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgstr "" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"['ab c', '', 'de fg', 'kl']\n" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " @@ -4494,25 +4871,31 @@ msgstr "" "このメソッドは空文字列に対して空のリストを返し、末尾に改行があっても余分な行" "を追加しません::" -#: ../../library/stdtypes.rst:2746 msgid "" ">>> \"\".splitlines()\n" "[]\n" ">>> \"One line\\n\".splitlines()\n" "['One line']" msgstr "" +">>> \"\".splitlines()\n" +"[]\n" +">>> \"One line\\n\".splitlines()\n" +"['One line']" #: ../../library/stdtypes.rst:2751 msgid "For comparison, ``split('\\n')`` gives::" msgstr "比較のために ``split('\\n')`` は以下のようになります::" -#: ../../library/stdtypes.rst:2753 msgid "" ">>> ''.split('\\n')\n" "['']\n" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" msgstr "" +">>> ''.split('\\n')\n" +"['']\n" +">>> 'Two lines\\n'.split('\\n')\n" +"['Two lines', '']" #: ../../library/stdtypes.rst:2761 msgid "" @@ -4526,7 +4909,6 @@ msgstr "" "ん。オプションの *start* があれば、その位置から判定を始めます。オプションの " "*end* があれば、その位置で比較を止めます。" -#: ../../library/stdtypes.rst:2768 msgid "" ">>> 'Python'.startswith('Py')\n" "True\n" @@ -4535,12 +4917,16 @@ msgid "" ">>> 'Python is amazing'.startswith('is', 7)\n" "True" msgstr "" +">>> 'Python'.startswith('Py')\n" +"True\n" +">>> 'a tuple of prefixes'.startswith(('at', 'a'))\n" +"True\n" +">>> 'Python is amazing'.startswith('is', 7)\n" +"True" -#: ../../library/stdtypes.rst:2777 msgid "See also :meth:`endswith` and :meth:`removeprefix`." -msgstr "" +msgstr ":meth:`endswith` と :meth:`removeprefix` も参照してください。" -#: ../../library/stdtypes.rst:2782 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -4548,65 +4934,82 @@ msgid "" "removing whitespace. The *chars* argument is not a prefix or suffix; rather, " "all combinations of its values are stripped." msgstr "" +"先頭と末尾の文字を除去した文字列のコピーを返します。\n" +"``chars`` 引数は、除去する文字の集合を指定する文字列です。\n" +"``chars`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで空白文" +"字を除去します。\n" +"``chars`` 引数を接頭辞や接尾辞として扱うのではなく、その値を構成する文字を組" +"み合わせに関係なく除去します。" -#: ../../library/stdtypes.rst:2788 msgid "Whitespace characters are defined by :meth:`str.isspace`." -msgstr "" +msgstr "空白文字は :meth:`str.isspace` で定義されています。" -#: ../../library/stdtypes.rst:2792 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" msgstr "" +">>> ' spacious '.strip()\n" +"'spacious'\n" +">>> 'www.example.com'.strip('cmowz.')\n" +"'example'" -#: ../../library/stdtypes.rst:2799 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " "string character that is not contained in the set of characters in *chars*. " "A similar action takes place on the trailing end." msgstr "" +"文字列の先頭と末尾の最も外側から、``chars`` 引数に含まれる文字を除去しま" +"す。\n" +"先頭では、``chars`` の文字の集合に含まれない文字に達するまで文字を除去しま" +"す。\n" +"末尾でも同様に処理します。" -#: ../../library/stdtypes.rst:2806 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" msgstr "" +">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" +">>> comment_string.strip('.#! ')\n" +"'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2812 msgid "See also :meth:`rstrip`." -msgstr "" +msgstr ":meth:`rstrip` も参照してください。" -#: ../../library/stdtypes.rst:2817 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. For example:" msgstr "" +"大文字を小文字に、小文字を大文字に変換した文字列のコピーを返します。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2820 msgid "" ">>> 'Hello World'.swapcase()\n" "'hELLO wORLD'" msgstr "" +">>> 'Hello World'.swapcase()\n" +"'hELLO wORLD'" -#: ../../library/stdtypes.rst:2825 msgid "" "Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. " "For example:" msgstr "" +"``s.swapcase().swapcase() == s`` が常に成り立つとは限らないことに注意してくだ" +"さい。\n" +"例えば、次のようになります:" -#: ../../library/stdtypes.rst:2828 msgid "" ">>> 'straße'.swapcase().swapcase()\n" "'strasse'" msgstr "" +">>> 'straße'.swapcase().swapcase()\n" +"'strasse'" -#: ../../library/stdtypes.rst:2833 msgid "See also :meth:`str.lower` and :meth:`str.upper`." -msgstr "" +msgstr ":meth:`str.lower` と :meth:`str.upper` も参照してください。" #: ../../library/stdtypes.rst:2838 msgid "" @@ -4616,11 +5019,12 @@ msgstr "" "文字列を、単語ごとに大文字から始まり、残りの文字のうち大小文字の区別があるも" "のは全て小文字にする、タイトルケースにして返します。" -#: ../../library/stdtypes.rst:2843 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" msgstr "" +">>> 'Hello world'.title()\n" +"'Hello World'" #: ../../library/stdtypes.rst:2846 ../../library/stdtypes.rst:4336 msgid "" @@ -4634,11 +5038,12 @@ msgstr "" "アポストロフィが単語の境界になってしまい、望みの結果を得られない場合がありま" "す::" -#: ../../library/stdtypes.rst:2851 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> \"they're bill's friends from the UK\".title()\n" +"\"They'Re Bill'S Friends From The Uk\"" #: ../../library/stdtypes.rst:2854 msgid "" @@ -4654,7 +5059,6 @@ msgid "" "expressions::" msgstr "または、正規表現を使うことでアポストロフィに対応できます::" -#: ../../library/stdtypes.rst:2860 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4665,10 +5069,17 @@ msgid "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(r\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0).capitalize(),\n" +"... s)\n" +"...\n" +">>> titlecase(\"they're bill's friends.\")\n" +"\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2869 msgid "See also :meth:`istitle`." -msgstr "" +msgstr ":meth:`istitle` も参照してください。" #: ../../library/stdtypes.rst:2874 msgid "" @@ -4699,17 +5110,19 @@ msgstr "" "文字から文字への異なる形式のマッピングから変換マップを作成するために、 :meth:" "`str.maketrans` が使えます。" -#: ../../library/stdtypes.rst:2886 msgid "" "The following example uses a mapping to replace ``'a'`` with ``'X'``, " "``'b'`` with ``'Y'``, and delete ``'c'``:" msgstr "" +"次の例では、マッピングを使って ``'a'`` を ``'X'`` に、``'b'`` を ``'Y'`` に置" +"き換え、``'c'`` を削除します:" -#: ../../library/stdtypes.rst:2889 msgid "" ">>> 'abc123'.translate({ord('a'): 'X', ord('b'): 'Y', ord('c'): None})\n" "'XY123'" msgstr "" +">>> 'abc123'.translate({ord('a'): 'X', ord('b'): 'Y', ord('c'): None})\n" +"'XY123'" #: ../../library/stdtypes.rst:2894 msgid "" @@ -4732,54 +5145,58 @@ msgstr "" "含まなかったり、結果の文字の Unicode カテゴリが \"Lu\" ではなく例えば " "\"Lt\" (Letter, titlecase) などであったら、 ``False`` になりえます。" -#: ../../library/stdtypes.rst:2906 msgid "" "The uppercasing algorithm used is `described in section 3.13.2 'Default Case " "Conversion' of the Unicode Standard `__." msgstr "" +"大文字化のアルゴリズムは `Unicode 標準の3.13.2節「Default Case Conversion」 " +"`__ に記載されています。" -#: ../../library/stdtypes.rst:2913 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " "by inserting the padding *after* the sign character rather than before. The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -"長さが *width* になるよう ASCII ``'0'`` で左詰めした文字列のコピーを返しま" -"す。先頭が符号接頭辞 (``'+'``/``'-'``) だった場合、 ``'0'`` は符号の前ではな" -"く *後* に挿入されます。*width* が ``len(s)`` 以下の場合元の文字列を返しま" -"す。" +"長さが ``width`` になるよう、左側を ASCII ``'0'`` で埋めた文字列のコピーを返" +"します。\n" +"先頭に符号接頭辞 (``'+'``/``'-'``) がある場合は、符号文字の前ではなく *後* に" +"パディングを挿入します。\n" +"``width`` が ``len(s)`` 以下の場合は元の文字列を返します。" -#: ../../library/stdtypes.rst:2921 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" ">>> \"-42\".zfill(5)\n" "'-0042'" msgstr "" +">>> \"42\".zfill(5)\n" +"'00042'\n" +">>> \"-42\".zfill(5)\n" +"'-0042'" -#: ../../library/stdtypes.rst:2948 msgid "Formatted String Literals (f-strings)" -msgstr "" +msgstr "フォーマット済み文字列リテラル (f-string)" -#: ../../library/stdtypes.rst:2951 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" +"f-string 内の式で :keyword:`await` と :keyword:`async for` を使えるようになり" +"ました。" -#: ../../library/stdtypes.rst:2954 msgid "Added the debug specifier (``=``)" -msgstr "" +msgstr "デバッグ指定子 (``=``) を追加しました" -#: ../../library/stdtypes.rst:2956 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" +"f-string 内の式に対する多くの制限が取り除かれました。\n" +"特に、文字列の入れ子、コメント、バックスラッシュが使えるようになりました。" -#: ../../library/stdtypes.rst:2960 msgid "" "An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " "literal that is prefixed with ``f`` or ``F``. This type of string literal " @@ -4787,59 +5204,68 @@ msgid "" "*replacement fields*, which are delimited by curly brackets (``{}``). Each " "replacement field must contain an expression, optionally followed by:" msgstr "" +"接頭辞 ``f`` または ``F`` を付けた文字列リテラルを :dfn:`f-string` (正式に" +"は :dfn:`フォーマット済み文字列リテラル`) と呼びます。\n" +"この文字列リテラルでは、波括弧 (``{}``) で区切った *置換フィールド* に、任意" +"の Python 式の結果を埋め込めます。\n" +"各置換フィールドには式が必要で、その後に必要に応じて次のものを指定できます:" -#: ../../library/stdtypes.rst:2967 msgid "a *debug specifier* -- an equal sign (``=``);" -msgstr "" +msgstr "*デバッグ指定子* である等号 (``=``)。" -#: ../../library/stdtypes.rst:2968 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" +"*変換指定子* である ``!s``、``!r``、``!a`` のいずれか。\n" +"これと次の書式指定子は、どちらか一方または両方を指定できます。" -#: ../../library/stdtypes.rst:2969 msgid "a *format specifier* prefixed with a colon (``:``)." -msgstr "" +msgstr "コロン (``:``) を先頭に付けた *書式指定子*。" -#: ../../library/stdtypes.rst:2971 msgid "" "See the :ref:`Lexical Analysis section on f-strings ` for details " "on the syntax of these fields." msgstr "" +"これらのフィールドの構文について詳しくは、:ref:`字句解析の f-string に関する" +"節 ` を参照してください。" -#: ../../library/stdtypes.rst:2975 msgid "Debug specifier" -msgstr "" +msgstr "デバッグ指定子" -#: ../../library/stdtypes.rst:2979 msgid "" "If a debug specifier -- an equal sign (``=``) -- appears after the " "replacement field expression, the resulting f-string will contain the " "expression's source, the equal sign, and the value of the expression. This " "is often useful for debugging::" msgstr "" +"置換フィールドの式の後にデバッグ指定子である等号 (``=``) を付けると、結果の " +"f-string には式のソース、等号、式の値が含まれます。\n" +"これはデバッグに役立つことがよくあります。 ::" -#: ../../library/stdtypes.rst:2984 msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" "'number=14.3'" msgstr "" +">>> number = 14.3\n" +">>> f'{number=}'\n" +"'number=14.3'" -#: ../../library/stdtypes.rst:2988 msgid "" "Whitespace before, inside and after the expression, as well as whitespace " "after the equal sign, is significant --- it is retained in the result::" msgstr "" +"式の前後や内部の空白、および等号の後の空白には意味があり、そのまま結果に残り" +"ます。 ::" -#: ../../library/stdtypes.rst:2991 msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" msgstr "" +">>> f'{ number - 4 = }'\n" +"' number - 4 = 10.3'" -#: ../../library/stdtypes.rst:2996 msgid "Conversion specifier" -msgstr "" +msgstr "変換指定子" #: ../../library/stdtypes.rst:2998 msgid "" @@ -4847,44 +5273,44 @@ msgid "" "string using :func:`str`::" msgstr "" -#: ../../library/stdtypes.rst:3001 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" ">>> f'{one_third}'\n" "'1/3'" msgstr "" +">>> from fractions import Fraction\n" +">>> one_third = Fraction(1, 3)\n" +">>> f'{one_third}'\n" +"'1/3'" -#: ../../library/stdtypes.rst:3006 msgid "" "When a debug specifier but no format specifier is used, the default " "conversion instead uses :func:`repr`::" msgstr "" +"デバッグ指定子があり書式指定子がない場合、デフォルトの変換には代わりに :func:" +"`repr` を使います。 ::" -#: ../../library/stdtypes.rst:3009 msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" msgstr "" +">>> f'{one_third = }'\n" +"'one_third = Fraction(1, 3)'" -#: ../../library/stdtypes.rst:3012 msgid "" "The conversion can be specified explicitly using one of these specifiers:" -msgstr "" +msgstr "次のいずれかの指定子を使って、変換を明示的に指定できます:" -#: ../../library/stdtypes.rst:3014 msgid "``!s`` for :func:`str`" -msgstr "" +msgstr ":func:`str` に対しては ``!s``" -#: ../../library/stdtypes.rst:3015 msgid "``!r`` for :func:`repr`" -msgstr "" +msgstr ":func:`repr` に対しては ``!r``" -#: ../../library/stdtypes.rst:3016 msgid "``!a`` for :func:`ascii`" -msgstr "" +msgstr ":func:`ascii` に対しては ``!a``" -#: ../../library/stdtypes.rst:3020 msgid "" ">>> str(one_third)\n" "'1/3'\n" @@ -4901,12 +5327,24 @@ msgid "" ">>> f'{string = !a}'\n" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" msgstr "" +">>> str(one_third)\n" +"'1/3'\n" +">>> repr(one_third)\n" +"'Fraction(1, 3)'\n" +"\n" +">>> f'{one_third!s} is {one_third!r}'\n" +"'1/3 is Fraction(1, 3)'\n" +"\n" +">>> string = \"¡kočka 😸!\"\n" +">>> ascii(string)\n" +"\"'\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"\n" +"\n" +">>> f'{string = !a}'\n" +"\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" -#: ../../library/stdtypes.rst:3037 msgid "Format specifier" -msgstr "" +msgstr "書式指定子" -#: ../../library/stdtypes.rst:3039 msgid "" "After the expression has been evaluated, and possibly converted using an " "explicit conversion specifier, it is formatted using the :func:`format` " @@ -4915,8 +5353,13 @@ msgid "" "argument. The result of :func:`!format` is then used as the final value for " "the replacement field. For example::" msgstr "" +"式を評価し、明示的な変換指定子がある場合は変換を行った後、:func:`format` 関数" +"で書式化します。\n" +"置換フィールドにコロン (``:``) に続く *書式指定子* が含まれている場合、その指" +"定子を :func:`!format` の第2引数として渡します。\n" +":func:`!format` の結果を置換フィールドの最終的な値として使います。\n" +"例えば、次のようになります。 ::" -#: ../../library/stdtypes.rst:3046 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4929,30 +5372,41 @@ msgid "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" msgstr "" +">>> from fractions import Fraction\n" +">>> one_third = Fraction(1, 3)\n" +">>> f'{one_third:.6f}'\n" +"'0.333333'\n" +">>> f'{one_third:_^+10}'\n" +"'___+1/3___'\n" +">>> f'{one_third!r:_^20}'\n" +"'___Fraction(1, 3)___'\n" +">>> f'{one_third = :~>10}~'\n" +"'one_third = ~~~~~~~1/3~'" -#: ../../library/stdtypes.rst:3060 msgid "Template String Literals (t-strings)" -msgstr "" +msgstr "テンプレート文字列リテラル (t-string)" -#: ../../library/stdtypes.rst:3062 msgid "" "A :dfn:`t-string` (formally a :dfn:`template string literal`) is a string " "literal that is prefixed with ``t`` or ``T``." msgstr "" +"接頭辞 ``t`` または ``T`` を付けた文字列リテラルを :dfn:`t-string` (正式に" +"は :dfn:`テンプレート文字列リテラル`) と呼びます。" -#: ../../library/stdtypes.rst:3065 msgid "" "These strings follow the same syntax and evaluation rules as :ref:`formatted " "string literals `, with the following differences:" msgstr "" +"これらの文字列は、次の点を除いて :ref:`フォーマット済み文字列リテラル " +"` と同じ構文と評価規則に従います:" -#: ../../library/stdtypes.rst:3069 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" +"テンプレート文字列リテラルを評価すると、``str`` オブジェクトの代わりに :" +"class:`string.templatelib.Template` オブジェクトが得られます。" -#: ../../library/stdtypes.rst:3072 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -4960,8 +5414,13 @@ msgid "" "up to code that processes the resulting :class:`~string.templatelib." "Template` object to decide how to handle format specifiers and conversions." msgstr "" +":func:`format` プロトコルは使われません。\n" +"代わりに、評価した式ごとに新しい :class:`~string.templatelib.Interpolation` " +"オブジェクトが作成され、書式指定子や変換の指定があれば、そのオブジェクトに渡" +"されます。\n" +"書式指定子と変換をどのように扱うかは、結果の :class:`~string.templatelib." +"Template` オブジェクトを処理するコードが決めます。" -#: ../../library/stdtypes.rst:3079 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -4970,8 +5429,12 @@ msgid "" "determine the value of the ``format_spec`` attribute. If ``precision`` were " "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" +"入れ子になった置換フィールドを含む書式指定子は、:class:`~string.templatelib." +"Interpolation` オブジェクトに渡される前に即座に評価されます。\n" +"例えば、``{amount:.{precision}f}`` 形式の補間では、内部の式 ``{precision}`` " +"を評価して ``format_spec`` 属性の値を決めます。\n" +"``precision`` が ``2`` なら、結果の書式指定子は ``'.2f'`` になります。" -#: ../../library/stdtypes.rst:3087 msgid "" "When the equals sign ``'='`` is provided in an interpolation expression, the " "text of the expression is appended to the literal string that precedes the " @@ -4982,25 +5445,38 @@ msgid "" "conversion or format specifier is provided, this will override the default " "behaviour." msgstr "" +"補間式に等号 ``'='`` を指定すると、その式のテキストが、対応する補間の直前のリ" +"テラル文字列に追加されます。\n" +"これには等号とその周囲の空白も含まれます。\n" +"その式に対する :class:`!Interpolation` インスタンスは通常どおり作成されます" +"が、:attr:`~string.templatelib.Interpolation.conversion` はデフォルトで " +"'``r``' (:func:`repr`) に設定されます。\n" +"変換や書式指定子を明示的に指定した場合は、このデフォルトの動作が上書きされま" +"す。" #: ../../library/stdtypes.rst:3101 msgid "``printf``-style String Formatting" msgstr "``printf`` 形式の文字列書式化" -#: ../../library/stdtypes.rst:3114 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " "dictionaries correctly)." msgstr "" +"ここで説明する書式化演算にはさまざまな癖があり、タプルや辞書を正しく表示でき" +"ないなど、よくある誤りの原因となります。" -#: ../../library/stdtypes.rst:3118 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " "these alternatives provides their own trade-offs and benefits of simplicity, " "flexibility, and/or extensibility." msgstr "" +"これらの誤りは、:ref:`フォーマット済み文字列リテラル `、:meth:" +"`str.format` インターフェース、:class:`string.Template` を使うことで避けられ" +"る場合があります。\n" +"それぞれの方法には、簡潔さ、柔軟さ、拡張性の点で利点やトレードオフがありま" +"す。" #: ../../library/stdtypes.rst:3123 msgid "" @@ -5017,11 +5493,12 @@ msgstr "" "の ``%`` による変換の指定は0こ以上の *values* の要素で置き換えられます。この" "動作は C 言語における :c:func:`sprintf` 関数の利用方法に似ています。使用例:" -#: ../../library/stdtypes.rst:3130 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." msgstr "" +">>> print('%s has %d quote types.' % ('Python', 2))\n" +"Python has 2 quote types." #: ../../library/stdtypes.rst:3135 msgid "" @@ -5171,13 +5648,13 @@ msgstr "" "変換の先頭に符号文字 (``'+'`` または ``'-'``) を付けます(\"スペース\" フラグ" "を上書きします) 。" -#: ../../library/stdtypes.rst:3207 ../../library/stdtypes.rst:4509 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -"精度長変換子(``h``, ``l``,または ``L``) を使うことができますが、 Python では" -"必要ないため無視されます。 -- つまり、例えば ``%ld`` は ``%d`` と等価です。" +"長さ修飾子 (``h``、``l``、``L``) を指定しても構いませんが、Python では必要な" +"いため無視されます。\n" +"例えば、``%ld`` は ``%d`` と同じです。" #: ../../library/stdtypes.rst:3210 ../../library/stdtypes.rst:4512 msgid "The conversion types are:" @@ -5532,16 +6009,15 @@ msgstr "既存のバイナリデータからバッファプロトコルでコピ msgid "Also see the :ref:`bytes ` built-in." msgstr ":ref:`bytes ` ビルトイン関数も参照してください。" -#: ../../library/stdtypes.rst:3374 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " "Accordingly, the bytes type has an additional class method to read data in " "that format:" msgstr "" -"16 進数で 2 桁の数は正確に 1 バイトに相当するため、16 進整はバイナリデータを" -"表現する形式として広く使われています。 従って、 bytes 型にはその形式でデータ" -"を読み取るための追加のクラスメソッドがあります。" +"16進数字2桁がちょうど1バイトに対応するため、16進数はバイナリデータを表す形式" +"としてよく使われます。\n" +"そのため、bytes 型にはその形式のデータを読み取るクラスメソッドもあります:" #: ../../library/stdtypes.rst:3380 msgid "" @@ -5561,11 +6037,12 @@ msgstr "" ":meth:`bytes.fromhex` は文字列にある空白だけでなく、 ASCII の空白文字全てをス" "キップするようになりました。" -#: ../../library/stdtypes.rst:3391 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" +":meth:`bytes.fromhex` が入力として ASCII の :class:`bytes` および :term:" +"`bytes-like オブジェクト ` を受け付けるようになりました。" #: ../../library/stdtypes.rst:3395 msgid "" @@ -5678,23 +6155,25 @@ msgstr "" msgid "Also see the :ref:`bytearray ` built-in." msgstr ":ref:`bytearray ` ビルトイン関数も参照してください。" -#: ../../library/stdtypes.rst:3465 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " "Accordingly, the bytearray type has an additional class method to read data " "in that format:" msgstr "" -"16 進数で 2 桁の数は正確に 1 バイトに相当するため、16 進整はバイナリデータを" -"表現する形式として広く使われています。 従って、 bytearray 型にはその形式で" -"データを読み取るための追加のクラスメソッドがあります。" +"16進数字2桁がちょうど1バイトに対応するため、16進数はバイナリデータを表す形式" +"としてよく使われます。\n" +"そのため、bytearray 型にはその形式のデータを読み取るクラスメソッドもあります:" -#: ../../library/stdtypes.rst:3471 msgid "" "This :class:`bytearray` class method returns a bytearray object, decoding " "the given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" +"この :class:`bytearray` クラスメソッドは、指定された文字列オブジェクトをデ" +"コードした bytearray オブジェクトを返します。\n" +"文字列には1バイトにつき2桁の16進数字を含める必要があり、ASCII 空白文字は無視" +"されます。" #: ../../library/stdtypes.rst:3478 msgid "" @@ -5704,11 +6183,12 @@ msgstr "" ":meth:`bytearray.fromhex` は文字列にある空白だけでなく、 ASCII の空白文字全て" "をスキップするようになりました。" -#: ../../library/stdtypes.rst:3482 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" +":meth:`bytearray.fromhex` が入力として ASCII の :class:`bytes` および :term:" +"`bytes-like オブジェクト ` を受け付けるようになりました。" #: ../../library/stdtypes.rst:3486 msgid "" @@ -5728,16 +6208,18 @@ msgstr "" "分割するセパレータを挿入するためのオプションパラメータ *sep* と " "*bytes_per_sep* をサポートするようになりました。" -#: ../../library/stdtypes.rst:3507 msgid "" "Resize the :class:`bytearray` to contain *size* bytes. *size* must be " "greater than or equal to 0." msgstr "" +":class:`bytearray` のサイズを ``size`` バイトに変更します。\n" +"``size`` は0以上でなければなりません。" -#: ../../library/stdtypes.rst:3510 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" +":class:`bytearray` を縮小する場合は、``size`` を超える部分のバイトを切り捨て" +"ます。" #: ../../library/stdtypes.rst:3512 msgid "" @@ -5745,45 +6227,54 @@ msgid "" "will be set to null bytes." msgstr "" -#: ../../library/stdtypes.rst:3516 msgid "This is equivalent to:" -msgstr "" +msgstr "これは次と等価です:" #: ../../library/stdtypes.rst:3524 msgid "Examples:" msgstr "例:" -#: ../../library/stdtypes.rst:3539 msgid "" "Remove the first *n* bytes from the bytearray and return them as an " "immutable :class:`bytes`. By default (if *n* is ``None``), return all bytes " "and clear the bytearray." msgstr "" +"bytearray の先頭から ``n`` バイトを削除し、イミュータブルな :class:`bytes` と" +"して返します。\n" +"デフォルトでは (``n`` が ``None`` の場合)、すべてのバイトを返し、bytearray を" +"空にします。" -#: ../../library/stdtypes.rst:3543 msgid "" "If *n* is negative, index from the end and take the first :func:`len` plus " "*n* bytes. If *n* is out of bounds, raise :exc:`IndexError`." msgstr "" +"``n`` が負の場合は末尾から数え、先頭から :func:`len` と ``n`` の和のバイト数" +"を取り出します。\n" +"``n`` が範囲外の場合は :exc:`IndexError` を送出します。" -#: ../../library/stdtypes.rst:3546 msgid "" "Taking less than the full length will leave remaining bytes in the :class:" "`bytearray`, which requires a copy. If the remaining bytes should be " "discarded, use :func:`~bytearray.resize` or :keyword:`del` to truncate then :" "func:`~bytearray.take_bytes` without a size." msgstr "" +"全体の長さより少ないバイト数を取り出す場合は、:class:`bytearray` にバイトが残" +"るため、コピーが必要です。\n" +"残りのバイトを破棄する場合は、:func:`~bytearray.resize` または :keyword:" +"`del` で切り詰めてから、サイズを指定せず :func:`~bytearray.take_bytes` を使っ" +"てください。" -#: ../../library/stdtypes.rst:3553 msgid "Taking all bytes is a zero-copy operation." -msgstr "" +msgstr "すべてのバイトを取り出す操作ではコピーが行われません。" -#: ../../library/stdtypes.rst:3557 msgid "" "See the :ref:`What's New ` entry for " "common code patterns which can be optimized with :meth:`bytearray." "take_bytes`." msgstr "" +":meth:`bytearray.take_bytes` によって最適化できる一般的なコードパターンについ" +"ては、:ref:`新機能の紹介 ` を参照してくださ" +"い。" #: ../../library/stdtypes.rst:3561 msgid "" @@ -5809,11 +6300,12 @@ msgstr "" "ためです。\n" "bytearray オブジェクトはいつでも ``list(b)`` で整数のリストに変換できます。" -#: ../../library/stdtypes.rst:3573 msgid "" "For detailed information on thread-safety guarantees for :class:`bytearray` " "objects, see :ref:`thread-safety-bytearray`." msgstr "" +":class:`bytearray` オブジェクトのスレッドセーフ性の保証については、:ref:" +"`thread-safety-bytearray` を参照してください。" #: ../../library/stdtypes.rst:3580 msgid "Bytes and Bytearray Operations" @@ -5844,31 +6336,32 @@ msgstr "" "と bytearray オブジェクトのメソッドは引数として文字列を受け付けません。例え" "ば、以下のように書かなければなりません::" -#: ../../library/stdtypes.rst:3597 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" msgstr "" +"a = \"abc\"\n" +"b = a.replace(\"a\", \"f\")" #: ../../library/stdtypes.rst:3600 msgid "and::" msgstr "および::" -#: ../../library/stdtypes.rst:3602 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" msgstr "" +"a = b\"abc\"\n" +"b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:3605 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -"いくつかの bytes と bytearray の操作は ASCII と互換性のあるバイナリフォーマッ" -"トが使われていると仮定していますので、フォーマットの不明なバイナリデータに対" -"して使うことは避けるべきです。こうした制約については以下で説明します。" +"bytes と bytearray の一部の操作は、ASCII 互換のバイナリ形式を前提としているた" +"め、任意のバイナリデータを扱う際には避けるべきです。\n" +"これらの制約については後述します。" #: ../../library/stdtypes.rst:3610 msgid "" @@ -5930,13 +6423,16 @@ msgstr "" "バリナリーデータが文字列 *prefix* で始まる場合、 ``bytes[len(prefix):]`` を" "返します。それ以外の場合、元のバイナリーデータのコピーを返します::" -#: ../../library/stdtypes.rst:3640 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" msgstr "" +">>> b'TestHook'.removeprefix(b'Test')\n" +"b'Hook'\n" +">>> b'BaseTestCase'.removeprefix(b'Test')\n" +"b'BaseTestCase'" #: ../../library/stdtypes.rst:3645 msgid "The *prefix* may be any :term:`bytes-like object`." @@ -5968,13 +6464,16 @@ msgstr "" "``bytes[:-len(suffix)]`` を返します。それ以外の場合、元のバイナリーデータのコ" "ピーを返します::" -#: ../../library/stdtypes.rst:3662 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" msgstr "" +">>> b'MiscTests'.removesuffix(b'Tests')\n" +"b'Misc'\n" +">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" +"b'TmpDirMixin'" #: ../../library/stdtypes.rst:3667 msgid "The *suffix* may be any :term:`bytes-like object`." @@ -6056,11 +6555,12 @@ msgstr "" "す。 *sub* が部分文字列 (訳注: おそらく原文の誤り、正しくは部分シーケンス) で" "あるかどうかのみを調べるには、 :keyword:`in` 演算子を使ってください::" -#: ../../library/stdtypes.rst:3737 msgid "" ">>> b'Py' in b'Python'\n" "True" msgstr "" +">>> b'Py' in b'Python'\n" +"True" #: ../../library/stdtypes.rst:3747 msgid "" @@ -6085,17 +6585,17 @@ msgstr "" "が送出されます。なお要素間のセパレータは、このメソッドを提供する bytes また" "は bytearray オブジェクトとなります。" -#: ../../library/stdtypes.rst:3771 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " "same position in *to*; *from* and *to* must both be :term:`bytes-like " "objects ` and have the same length." msgstr "" -"この静的メソッドは、 :func:`bytes.translate` に渡すのに適した変換テーブルを返" -"します。このテーブルは、 *from* 中の各バイトを *to* の同じ位置にあるバイトに" -"マッピングします。 *from* と *to* は両方とも同じ長さの :term:`bytes-like " -"objects ` でなければなりません。" +"この静的メソッドは、:meth:`bytes.translate` に使える変換テーブルを返しま" +"す。\n" +"このテーブルは ``from`` の各文字を ``to`` の同じ位置の文字にマップします。\n" +"``from`` と ``to`` は両方とも :term:`bytes-like オブジェクト ` で、同じ長さでなければなりません。" #: ../../library/stdtypes.rst:3782 msgid "" @@ -6116,13 +6616,18 @@ msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" "検索する区切りとしては、任意の :term:`bytes-like object` を指定できます。" -#: ../../library/stdtypes.rst:3795 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If *count* is given, only the first *count* occurrences " "are replaced. If *count* is not specified or ``-1``, then all occurrences " "are replaced." msgstr "" +"部分シーケンス ``old`` のすべての出現箇所を ``new`` に置き換えたシーケンスの" +"コピーを返します。\n" +"``count`` を指定した場合は、先頭から ``count`` 個の出現箇所だけを置き換えま" +"す。\n" +"``count`` を指定しない場合や ``-1`` を指定した場合は、すべての出現箇所を置き" +"換えます。" #: ../../library/stdtypes.rst:3800 msgid "" @@ -6207,11 +6712,12 @@ msgid "" msgstr "" "文字を削除するだけの変換には、 *table* 引数を ``None`` に設定してください::" -#: ../../library/stdtypes.rst:3878 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" msgstr "" +">>> b'read this short text'.translate(None, b'aeiou')\n" +"b'rd ths shrt txt'" #: ../../library/stdtypes.rst:3881 msgid "*delete* is now supported as a keyword argument." @@ -6255,7 +6761,6 @@ msgstr "" "class:`bytes` オブジェクトの場合、 *width* が ``len(s)`` 以下なら元のシーケン" "スが返されます。" -#: ../../library/stdtypes.rst:3922 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -6263,14 +6768,23 @@ msgid "" "removing :meth:`ASCII whitespace `. The *bytes* argument is " "not a prefix; rather, all combinations of its values are stripped::" msgstr "" +"先頭から指定されたバイトを除去したシーケンスのコピーを返します。\n" +"``bytes`` 引数は、除去するバイト値の集合を指定するバイナリシーケンスです。\n" +"``bytes`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで :meth:" +"`ASCII 空白文字 ` を除去します。\n" +"``bytes`` 引数を接頭辞として扱うのではなく、その値を構成するバイトを組み合わ" +"せに関係なく除去します。 ::" -#: ../../library/stdtypes.rst:3929 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" msgstr "" +">>> b' spacious '.lstrip()\n" +"b'spacious '\n" +">>> b'www.example.com'.lstrip(b'cmowz.')\n" +"b'example.com'" #: ../../library/stdtypes.rst:3934 msgid "" @@ -6283,13 +6797,16 @@ msgstr "" "した文字列そのものを接頭辞として削除するメソッドについては、 :meth:`~bytes." "removeprefix` を参照してください。使用例::" -#: ../../library/stdtypes.rst:3939 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" msgstr "" +">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" +"b'ee!'\n" +">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" +"b'three!'" #: ../../library/stdtypes.rst:3953 msgid "" @@ -6303,7 +6820,6 @@ msgstr "" "class:`bytes` オブジェクトの場合、 *width* が ``len(s)`` 以下なら元のシーケン" "スが返されます。" -#: ../../library/stdtypes.rst:3967 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -6312,8 +6828,14 @@ msgid "" "a separator. Except for splitting from the right, :meth:`rsplit` behaves " "like :meth:`split` which is described in detail below." msgstr "" +"区切り文字列として ``sep`` を使い、バイナリシーケンスを同じ型の部分シーケンス" +"に分割します。\n" +"``maxsplit`` を指定した場合は、*右端から* 最大 ``maxsplit`` 回分割します。\n" +"``sep`` を指定しない場合や ``None`` を指定した場合は、:meth:`ASCII 空白文字 " +"` のみで構成される任意の部分シーケンスを区切りとします。\n" +"右から分割する点を除いて、:meth:`rsplit` は後で詳しく説明する :meth:`split` " +"と同様に動作します。" -#: ../../library/stdtypes.rst:3979 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -6321,14 +6843,23 @@ msgid "" "removing :meth:`ASCII whitespace `. The *bytes* argument is " "not a suffix; rather, all combinations of its values are stripped::" msgstr "" +"末尾から指定されたバイトを除去したシーケンスのコピーを返します。\n" +"``bytes`` 引数は、除去するバイト値の集合を指定するバイナリシーケンスです。\n" +"``bytes`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで :meth:" +"`ASCII 空白文字 ` を除去します。\n" +"``bytes`` 引数を接尾辞として扱うのではなく、その値を構成するバイトを組み合わ" +"せに関係なく除去します。 ::" -#: ../../library/stdtypes.rst:3986 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" msgstr "" +">>> b' spacious '.rstrip()\n" +"b' spacious'\n" +">>> b'mississippi'.rstrip(b'ipz')\n" +"b'mississ'" #: ../../library/stdtypes.rst:3991 msgid "" @@ -6341,13 +6872,16 @@ msgstr "" "した文字列そのものを接尾辞として削除するメソッドについては、 :meth:`~bytes." "removesuffix` を参照してください。使用例::" -#: ../../library/stdtypes.rst:3996 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" msgstr "" +">>> b'Monty Python'.rstrip(b' Python')\n" +"b'M'\n" +">>> b'Monty Python'.removesuffix(b' Python')\n" +"b'Monty'" #: ../../library/stdtypes.rst:4010 msgid "" @@ -6380,7 +6914,6 @@ msgstr "" "``[b'']`` または ``[bytearray(b'')]`` が返されます。\n" "*sep* には、任意の :term:`bytes-like object` を指定できます。" -#: ../../library/stdtypes.rst:4026 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -6391,8 +6924,15 @@ msgid "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" msgstr "" +">>> b'1,2,3'.split(b',')\n" +"[b'1', b'2', b'3']\n" +">>> b'1,2,3'.split(b',', maxsplit=1)\n" +"[b'1', b'2,3']\n" +">>> b'1,2,,3,'.split(b',')\n" +"[b'1', b'2', b'', b'3', b'']\n" +">>> b'1<>2<>3<4'.split(b'<>')\n" +"[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:4035 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive :meth:`ASCII whitespace ` are " @@ -6401,8 +6941,15 @@ msgid "" "Consequently, splitting an empty sequence or a sequence consisting solely of " "ASCII whitespace without a specified separator returns ``[]``." msgstr "" +"``sep`` を指定しない場合や ``None`` を指定した場合は、別の分割アルゴリズムを" +"適用します。\n" +"連続する :meth:`ASCII 空白文字 ` のまとまりを一つの区切りとみ" +"なします。\n" +"シーケンスの先頭や末尾に空白文字があっても、結果の先頭や末尾に空文字列は含ま" +"れません。\n" +"そのため、区切りを指定せずに空のシーケンスや ASCII 空白文字のみのシーケンスを" +"分割すると、``[]`` が返されます。" -#: ../../library/stdtypes.rst:4046 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -6411,8 +6958,13 @@ msgid "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" msgstr "" +">>> b'1 2 3'.split()\n" +"[b'1', b'2', b'3']\n" +">>> b'1 2 3'.split(maxsplit=1)\n" +"[b'1', b'2 3']\n" +">>> b' 1 2 3 '.split()\n" +"[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:4057 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *bytes* argument is a binary sequence specifying the set of " @@ -6421,14 +6973,23 @@ msgid "" "argument is not a prefix or suffix; rather, all combinations of its values " "are stripped::" msgstr "" +"先頭と末尾から指定されたバイトを除去したシーケンスのコピーを返します。\n" +"``bytes`` 引数は、除去するバイト値の集合を指定するバイナリシーケンスです。\n" +"``bytes`` 引数を省略した場合や ``None`` を指定した場合は、デフォルトで :meth:" +"`ASCII 空白文字 ` を除去します。\n" +"``bytes`` 引数を接頭辞や接尾辞として扱うのではなく、その値を構成するバイトを" +"組み合わせに関係なく除去します。 ::" -#: ../../library/stdtypes.rst:4065 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" msgstr "" +">>> b' spacious '.strip()\n" +"b'spacious'\n" +">>> b'www.example.com'.strip(b'cmowz.')\n" +"b'example'" #: ../../library/stdtypes.rst:4070 msgid "" @@ -6488,13 +7049,16 @@ msgstr "" "ト値の表示のされ方(訳注: 全角、半角など)に関わらず現桁位置を 1 つ増加させま" "す::" -#: ../../library/stdtypes.rst:4114 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" msgstr "" +">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" +"b'01 012 0123 01234'\n" +">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"b'01 012 0123 01234'" #: ../../library/stdtypes.rst:4128 msgid "" @@ -6510,13 +7074,16 @@ msgstr "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` に含まれるバイト" "値です。 ASCII 文字の数字とは ``b'0123456789'`` に含まれるバイト値です。" -#: ../../library/stdtypes.rst:4136 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" ">>> b'ABC abc1'.isalnum()\n" "False" msgstr "" +">>> b'ABCabc1'.isalnum()\n" +"True\n" +">>> b'ABC abc1'.isalnum()\n" +"False" #: ../../library/stdtypes.rst:4145 msgid "" @@ -6531,13 +7098,16 @@ msgstr "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` に含まれるバイト" "値です。" -#: ../../library/stdtypes.rst:4152 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" ">>> b'ABCabc1'.isalpha()\n" "False" msgstr "" +">>> b'ABCabc'.isalpha()\n" +"True\n" +">>> b'ABCabc1'.isalpha()\n" +"False" #: ../../library/stdtypes.rst:4161 msgid "" @@ -6558,13 +7128,16 @@ msgstr "" "``True`` を、そうでなければ ``False`` を返します。ここでの ASCII 文字の数字と" "は ``b'0123456789'`` に含まれるバイト値です。" -#: ../../library/stdtypes.rst:4177 msgid "" ">>> b'1234'.isdigit()\n" "True\n" ">>> b'1.23'.isdigit()\n" "False" msgstr "" +">>> b'1234'.isdigit()\n" +"True\n" +">>> b'1.23'.isdigit()\n" +"False" #: ../../library/stdtypes.rst:4186 msgid "" @@ -6575,13 +7148,16 @@ msgstr "" "ファベットの ASCII 文字が一つも無い場合に ``True`` を返します。そうでなけれ" "ば ``False`` を返します。" -#: ../../library/stdtypes.rst:4191 msgid "" ">>> b'hello world'.islower()\n" "True\n" ">>> b'Hello world'.islower()\n" "False" msgstr "" +">>> b'hello world'.islower()\n" +"True\n" +">>> b'Hello world'.islower()\n" +"False" #: ../../library/stdtypes.rst:4196 ../../library/stdtypes.rst:4238 #: ../../library/stdtypes.rst:4254 ../../library/stdtypes.rst:4304 @@ -6617,13 +7193,16 @@ msgstr "" "``True`` を、そうでなければ ``False`` を返します。「タイトルケース文字列」の" "定義については :meth:`bytes.title` を参照してください。" -#: ../../library/stdtypes.rst:4219 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" ">>> b'Hello world'.istitle()\n" "False" msgstr "" +">>> b'Hello World'.istitle()\n" +"True\n" +">>> b'Hello world'.istitle()\n" +"False" #: ../../library/stdtypes.rst:4228 msgid "" @@ -6635,13 +7214,16 @@ msgstr "" "ファベットの ASCII 文字が一つも無い場合に ``True`` を返します。そうでなけれ" "ば ``False`` を返します。" -#: ../../library/stdtypes.rst:4233 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" ">>> b'Hello world'.isupper()\n" "False" msgstr "" +">>> b'HELLO WORLD'.isupper()\n" +"True\n" +">>> b'Hello world'.isupper()\n" +"False" #: ../../library/stdtypes.rst:4246 msgid "" @@ -6651,11 +7233,12 @@ msgstr "" "シーケンスに含まれる大文字アルファベットの ASCII 文字を全て小文字アルファベッ" "トに変換したシーケンスのコピーを返します。" -#: ../../library/stdtypes.rst:4251 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" msgstr "" +">>> b'Hello World'.lower()\n" +"b'hello world'" #: ../../library/stdtypes.rst:4271 msgid "" @@ -6669,13 +7252,16 @@ msgstr "" "*keepends* 引数に真を与えた場合を除き、改行コードは結果のリストに含まれませ" "ん。" -#: ../../library/stdtypes.rst:4278 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgstr "" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"[b'ab c', b'', b'de fg', b'kl']\n" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " @@ -6686,36 +7272,41 @@ msgstr "" "このメソッドは空のシーケンスに対して空のリストを返し、末尾に改行があっても余" "分な行を追加しません::" -#: ../../library/stdtypes.rst:4287 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" msgstr "" +">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" +"([b''], [b'Two lines', b''])\n" +">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" +"([], [b'One line'])" -#: ../../library/stdtypes.rst:4296 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -"シーケンスに含まれる小文字アルファベットの ASCII 文字を全て大文字アルファベッ" -"トに変換し、さらに大文字アルファベットを同様に小文字アルファベットに変換した" -"シーケンスのコピーを返します。" +"シーケンス内の小文字の ASCII 文字を対応する大文字に、大文字の ASCII 文字を対" +"応する小文字に変換したコピーを返します。" -#: ../../library/stdtypes.rst:4301 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" msgstr "" +">>> b'Hello World'.swapcase()\n" +"b'hELLO wORLD'" -#: ../../library/stdtypes.rst:4308 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " "symmetrical in ASCII, even though that is not generally true for arbitrary " "Unicode code points." msgstr "" +":func:`str.swapcase` とは異なり、バイナリ版では ``bin.swapcase().swapcase() " +"== bin`` が常に成り立ちます。\n" +"任意の Unicode コードポイントについては一般に成り立ちませんが、ASCII では大文" +"字と小文字の変換が対称だからです。" #: ../../library/stdtypes.rst:4322 msgid "" @@ -6728,11 +7319,12 @@ msgstr "" "なっているシーケンスが返ります。大文字小文字の区別が無いバイト値については変" "更されずそのままになります。" -#: ../../library/stdtypes.rst:4328 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" msgstr "" +">>> b'Hello world'.title()\n" +"b'Hello World'" #: ../../library/stdtypes.rst:4331 msgid "" @@ -6746,18 +7338,18 @@ msgstr "" "に含まれるバイト値です。その他のバイト値については、大文字小文字の区別はあり" "ません。" -#: ../../library/stdtypes.rst:4341 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> b\"they're bill's friends from the UK\".title()\n" +"b\"They'Re Bill'S Friends From The Uk\"" #: ../../library/stdtypes.rst:4344 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "正規表現を使うことでアポストロフィに対応できます::" -#: ../../library/stdtypes.rst:4346 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -6769,6 +7361,15 @@ msgid "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(rb\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0)[0:1].upper() +\n" +"... mo.group(0)[1:].lower(),\n" +"... s)\n" +"...\n" +">>> titlecase(b\"they're bill's friends.\")\n" +"b\"They're Bill's Friends.\"" #: ../../library/stdtypes.rst:4365 msgid "" @@ -6778,13 +7379,13 @@ msgstr "" "シーケンスに含まれる小文字アルファベットの ASCII 文字を全て大文字アルファベッ" "トに変換したシーケンスのコピーを返します。" -#: ../../library/stdtypes.rst:4370 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" msgstr "" +">>> b'Hello World'.upper()\n" +"b'HELLO WORLD'" -#: ../../library/stdtypes.rst:4386 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -6792,18 +7393,23 @@ msgid "" "before. For :class:`bytes` objects, the original sequence is returned if " "*width* is less than or equal to ``len(seq)``." msgstr "" -"長さが *width* になるよう ASCII ``b'0'`` で左詰めしたシーケンスのコピーを返し" -"ます。先頭が符号接頭辞 (``b'+'``/``b'-'``) だった場合、 ``b'0'`` は符号の前で" -"はなく *後* に挿入されます。 :class:`bytes` オブジェクトの場合、 *width* が " -"``len(seq)`` 以下であれば元のシーケンスが返ります。" +"長さが ``width`` になるよう、左側を ASCII ``b'0'`` で埋めたシーケンスのコピー" +"を返します。\n" +"先頭に符号接頭辞 (``b'+'``/ ``b'-'``) がある場合は、符号文字の前ではなく *後" +"* にパディングを挿入します。\n" +":class:`bytes` オブジェクトの場合、``width`` が ``len(seq)`` 以下なら元のシー" +"ケンスを返します。" -#: ../../library/stdtypes.rst:4394 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" ">>> b\"-42\".zfill(5)\n" "b'-0042'" msgstr "" +">>> b\"42\".zfill(5)\n" +"b'00042'\n" +">>> b\"-42\".zfill(5)\n" +"b'-0042'" #: ../../library/stdtypes.rst:4408 msgid "``printf``-style Bytes Formatting" @@ -6820,7 +7426,6 @@ msgstr "" "ルや辞書を正しく表示できないなど)。もし表示する値がタプルや辞書かもしれない場" "合、それをタプルに包むようにしてください。" -#: ../../library/stdtypes.rst:4430 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -6829,6 +7434,12 @@ msgid "" "zero or more elements of *values*. The effect is similar to using the :c:" "func:`sprintf` function in the C language." msgstr "" +"bytes オブジェクト (``bytes``/``bytearray``) に固有の組み込み演算として、" +"``%`` 演算子 (剰余) があります。\n" +"これは、bytes の *書式化* 演算子または *補間* 演算子とも呼ばれます。\n" +"``format % values`` (ここで *format* は bytes オブジェクト) では、*format* 内" +"の ``%`` 変換指定が *values* の0個以上の要素に置き換えられます。\n" +"その効果は C 言語の :c:func:`sprintf` 関数の使用に似ています。" #: ../../library/stdtypes.rst:4437 msgid "" @@ -6954,18 +7565,21 @@ msgstr "" "`bytearray` では、要素は単バイトになりますが、他の :class:`array.array` 等の" "型では、要素はより大きくなりえます。" -#: ../../library/stdtypes.rst:4632 msgid "" ":class:`!memoryview`\\s are :ref:`generic ` over the type of their " "underlying data." msgstr "" +":class:`!memoryview` は元のデータの型について :ref:`ジェネリック ` " +"です。" -#: ../../library/stdtypes.rst:4635 msgid "" "``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which is " "the nested list representation of the view. If ``view.ndim == 1``, this is " "equal to the number of elements in the view." msgstr "" +"``len(view)`` は、ビューを入れ子のリストで表す :meth:`~memoryview.tolist` の" +"結果の長さと等しくなります。\n" +"``view.ndim == 1`` の場合、これはビュー内の要素数と等しくなります。" msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " @@ -6988,7 +7602,6 @@ msgstr "" ":class:`memoryview` はスライスおよびインデックス指定で内容を取得できます。一" "次元のスライスは部分ビューになります::" -#: ../../library/stdtypes.rst:4648 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -7000,6 +7613,15 @@ msgid "" ">>> bytes(v[1:4])\n" "b'bce'" msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> v[1]\n" +"98\n" +">>> v[-1]\n" +"103\n" +">>> v[1:4]\n" +"\n" +">>> bytes(v[1:4])\n" +"b'bce'" #: ../../library/stdtypes.rst:4658 msgid "" @@ -7023,7 +7645,6 @@ msgstr "" msgid "Here is an example with a non-byte format::" msgstr "``format`` が単バイト単位ではない例を示します::" -#: ../../library/stdtypes.rst:4669 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -7035,6 +7656,15 @@ msgid "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" msgstr "" +">>> import array\n" +">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" +">>> m = memoryview(a)\n" +">>> m[0]\n" +"-11111111\n" +">>> m[-1]\n" +"44444444\n" +">>> m[::2].tolist()\n" +"[-11111111, -33333333]" #: ../../library/stdtypes.rst:4679 msgid "" @@ -7044,7 +7674,6 @@ msgstr "" "メモリビューの参照しているオブジェクトが書き込み可能であれば、一次元スライス" "での代入が可能です。ただしサイズの変更はできません::" -#: ../../library/stdtypes.rst:4682 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -7065,6 +7694,24 @@ msgid "" ">>> data\n" "bytearray(b'z1spam')" msgstr "" +">>> data = bytearray(b'abcefg')\n" +">>> v = memoryview(data)\n" +">>> v.readonly\n" +"False\n" +">>> v[0] = ord(b'z')\n" +">>> data\n" +"bytearray(b'zbcefg')\n" +">>> v[1:4] = b'123'\n" +">>> data\n" +"bytearray(b'z123fg')\n" +">>> v[2:3] = b'spam'\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: memoryview assignment: lvalue and rvalue have different " +"structures\n" +">>> v[2:6] = b'spam'\n" +">>> data\n" +"bytearray(b'z1spam')" #: ../../library/stdtypes.rst:4700 msgid "" @@ -7076,7 +7723,6 @@ msgstr "" "み出し専用の) 型の1次元メモリビューもまた、ハッシュ可能です。ハッシュは " "``hash(m) == hash(m.tobytes())`` として定義されています::" -#: ../../library/stdtypes.rst:4704 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -7086,6 +7732,13 @@ msgid "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> hash(v) == hash(b'abcefg')\n" +"True\n" +">>> hash(v[2:4]) == hash(b'ce')\n" +"True\n" +">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" +"True" #: ../../library/stdtypes.rst:4712 msgid "" @@ -7104,13 +7757,11 @@ msgstr "" "memoryview は自動的に :class:`collections.abc.Sequence` へ登録されるようにな" "りました。" -#: ../../library/stdtypes.rst:4720 msgid "memoryviews can now be indexed with a tuple of integers." -msgstr "" +msgstr "整数のタプルで memoryview のインデックスを指定できるようになりました。" -#: ../../library/stdtypes.rst:4723 msgid "memoryview is now a :term:`generic type`." -msgstr "" +msgstr "memoryview が :term:`ジェネリック型 ` になりました。" #: ../../library/stdtypes.rst:4726 msgid ":class:`memoryview` has several methods:" @@ -7133,7 +7784,6 @@ msgstr "" ":meth:`tolist` がサポートしている :mod:`struct` フォーマットの一部では、 ``v." "tolist() == w.tolist()`` が成り立つときに ``v`` == ``w`` になります::" -#: ../../library/stdtypes.rst:4737 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -7151,6 +7801,21 @@ msgid "" ">>> z.tolist() == c.tolist()\n" "True" msgstr "" +">>> import array\n" +">>> a = array.array('I', [1, 2, 3, 4, 5])\n" +">>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])\n" +">>> c = array.array('b', [5, 3, 1])\n" +">>> x = memoryview(a)\n" +">>> y = memoryview(b)\n" +">>> x == a == y == b\n" +"True\n" +">>> x.tolist() == a.tolist() == y.tolist() == b.tolist()\n" +"True\n" +">>> z = y[::-2]\n" +">>> z == c\n" +"True\n" +">>> z.tolist() == c.tolist()\n" +"True" #: ../../library/stdtypes.rst:4753 msgid "" @@ -7162,7 +7827,6 @@ msgstr "" "(書式文字列とバッファの内容が同一でも) オブジェクトは常に等しくないものとして" "比較されます::" -#: ../../library/stdtypes.rst:4757 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -7176,6 +7840,17 @@ msgid "" ">>> a == b\n" "False" msgstr "" +">>> from ctypes import BigEndianStructure, c_long\n" +">>> class BEPoint(BigEndianStructure):\n" +"... _fields_ = [(\"x\", c_long), (\"y\", c_long)]\n" +"...\n" +">>> point = BEPoint(100, 200)\n" +">>> a = memoryview(point)\n" +">>> b = memoryview(point)\n" +">>> a == point\n" +"False\n" +">>> a == b\n" +"False" #: ../../library/stdtypes.rst:4769 msgid "" @@ -7201,7 +7876,6 @@ msgstr "" "バッファ中のデータをバイト文字列として返します。これはメモリビューに対して :" "class:`bytes` コンストラクタを呼び出すのと同等です。 ::" -#: ../../library/stdtypes.rst:4781 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -7209,6 +7883,11 @@ msgid "" ">>> bytes(m)\n" "b'abc'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.tobytes()\n" +"b'abc'\n" +">>> bytes(m)\n" +"b'abc'" #: ../../library/stdtypes.rst:4787 msgid "" @@ -7242,12 +7921,14 @@ msgid "" msgstr "" "バッファ内の各バイトを2桁の16進数字で表した文字列オブジェクトを返します。 ::" -#: ../../library/stdtypes.rst:4805 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" "'616263'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.hex()\n" +"'616263'" #: ../../library/stdtypes.rst:4811 msgid "" @@ -7263,7 +7944,6 @@ msgstr "" msgid "Return the data in the buffer as a list of elements. ::" msgstr "バッファ中のデータを要素のリストとして返します。 ::" -#: ../../library/stdtypes.rst:4820 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -7273,6 +7953,13 @@ msgid "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> memoryview(b'abc').tolist()\n" +"[97, 98, 99]\n" +">>> import array\n" +">>> a = array.array('d', [1.1, 2.2, 3.3])\n" +">>> m = memoryview(a)\n" +">>> m.tolist()\n" +"[1.1, 2.2, 3.3]" #: ../../library/stdtypes.rst:4828 msgid "" @@ -7290,7 +7977,6 @@ msgstr "" "読み込み専用のメモリビューオブジェクトを返します。元のメモリビューオブジェク" "トは変更されません。 ::" -#: ../../library/stdtypes.rst:4838 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -7304,6 +7990,17 @@ msgid "" ">>> mm.tolist()\n" "[43, 98, 99]" msgstr "" +">>> m = memoryview(bytearray(b'abc'))\n" +">>> mm = m.toreadonly()\n" +">>> mm.tolist()\n" +"[97, 98, 99]\n" +">>> mm[0] = 42\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot modify read-only memory\n" +">>> m[0] = 43\n" +">>> mm.tolist()\n" +"[43, 98, 99]" #: ../../library/stdtypes.rst:4854 msgid "" @@ -7326,7 +8023,6 @@ msgid "" "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:4864 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -7335,6 +8031,12 @@ msgid "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> m = memoryview(b'abc')\n" +">>> m.release()\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" #: ../../library/stdtypes.rst:4871 msgid "" @@ -7344,7 +8046,6 @@ msgstr "" "コンテキストマネージャプロトコルは、 ``with`` 文を使って同様の効果を得るのに" "使えます::" -#: ../../library/stdtypes.rst:4874 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -7355,6 +8056,14 @@ msgid "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> with memoryview(b'abc') as m:\n" +"... m[0]\n" +"...\n" +"97\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " @@ -7388,7 +8097,6 @@ msgstr "" msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "1次元 long から 1次元 unsigned byte へのキャスト::" -#: ../../library/stdtypes.rst:4902 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -7411,12 +8119,31 @@ msgid "" ">>> y.nbytes\n" "24" msgstr "" +">>> import array\n" +">>> a = array.array('l', [1,2,3])\n" +">>> x = memoryview(a)\n" +">>> x.format\n" +"'l'\n" +">>> x.itemsize\n" +"8\n" +">>> len(x)\n" +"3\n" +">>> x.nbytes\n" +"24\n" +">>> y = x.cast('B')\n" +">>> y.format\n" +"'B'\n" +">>> y.itemsize\n" +"1\n" +">>> len(y)\n" +"24\n" +">>> y.nbytes\n" +"24" #: ../../library/stdtypes.rst:4923 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "1次元 unsigned byte から 1次元 char へのキャスト::" -#: ../../library/stdtypes.rst:4925 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -7429,12 +8156,21 @@ msgid "" ">>> b\n" "bytearray(b'ayz')" msgstr "" +">>> b = bytearray(b'zyz')\n" +">>> x = memoryview(b)\n" +">>> x[0] = b'a'\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: memoryview: invalid type for format 'B'\n" +">>> y = x.cast('c')\n" +">>> y[0] = b'a'\n" +">>> b\n" +"bytearray(b'ayz')" #: ../../library/stdtypes.rst:4936 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "1次元 byte から 3次元 int へ、そして 1次元 signed char へのキャスト::" -#: ../../library/stdtypes.rst:4938 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -7460,12 +8196,34 @@ msgid "" ">>> z.nbytes\n" "48" msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('i', shape=[2,2,3])\n" +">>> y.tolist()\n" +"[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]\n" +">>> y.format\n" +"'i'\n" +">>> y.itemsize\n" +"4\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> z = y.cast('b')\n" +">>> z.format\n" +"'b'\n" +">>> z.itemsize\n" +"1\n" +">>> len(z)\n" +"48\n" +">>> z.nbytes\n" +"48" #: ../../library/stdtypes.rst:4962 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "1次元 unsigned long から 2次元 unsigned long へのキャスト::" -#: ../../library/stdtypes.rst:4964 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -7477,6 +8235,15 @@ msgid "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" msgstr "" +">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('L', shape=[2,3])\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> y.tolist()\n" +"[[0, 1, 2], [3, 4, 5]]" #: ../../library/stdtypes.rst:4976 msgid "The source format is no longer restricted when casting to a byte view." @@ -7484,19 +8251,18 @@ msgstr "" "単バイトのビューへキャストする場合、キャスト元のフォーマットについて制約は無" "くなりました。" -#: ../../library/stdtypes.rst:4981 msgid "Count the number of occurrences of *value*." -msgstr "" +msgstr "``value`` の出現回数を数えます。" -#: ../../library/stdtypes.rst:4987 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" +"``value`` が最初に出現する位置のインデックスを返します (インデックス " +"``start`` 以上、``stop`` 未満の範囲で検索します)。" -#: ../../library/stdtypes.rst:4990 msgid "Raises a :exc:`ValueError` if *value* cannot be found." -msgstr "" +msgstr "``value`` が見つからない場合は :exc:`ValueError` を送出します。" #: ../../library/stdtypes.rst:4994 msgid "There are also several readonly attributes available:" @@ -7506,24 +8272,26 @@ msgstr "読み出し専用の属性もいくつか使えます:" msgid "The underlying object of the memoryview::" msgstr "memoryview が参照しているオブジェクト::" -#: ../../library/stdtypes.rst:5000 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" ">>> m.obj is b\n" "True" msgstr "" +">>> b = bytearray(b'xyz')\n" +">>> m = memoryview(b)\n" +">>> m.obj is b\n" +"True" -#: ../../library/stdtypes.rst:5009 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -"``nbytes == product(shape) * itemsize == len(m.tobytes())``. その配列が連続表" -"現において利用するスペースです。これは ``len(m)`` と一致するとは限りません::" +"``nbytes == product(shape) * itemsize == len(m.tobytes())`` です。\n" +"これは、配列を連続した表現にした場合に使う領域のバイト数です。\n" +"``len(m)`` と等しいとは限りません。 ::" -#: ../../library/stdtypes.rst:5013 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -7540,12 +8308,25 @@ msgid "" ">>> len(y.tobytes())\n" "12" msgstr "" +">>> import array\n" +">>> a = array.array('i', [1,2,3,4,5])\n" +">>> m = memoryview(a)\n" +">>> len(m)\n" +"5\n" +">>> m.nbytes\n" +"20\n" +">>> y = m[::2]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"12\n" +">>> len(y.tobytes())\n" +"12" #: ../../library/stdtypes.rst:5028 msgid "Multi-dimensional arrays::" msgstr "多次元配列::" -#: ../../library/stdtypes.rst:5030 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -7558,6 +8339,16 @@ msgid "" ">>> y.nbytes\n" "96" msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('d', shape=[3,4])\n" +">>> y.tolist()\n" +"[[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"96" #: ../../library/stdtypes.rst:5045 msgid "A bool indicating whether the memory is read only." @@ -7587,7 +8378,6 @@ msgstr "" msgid "The size in bytes of each element of the memoryview::" msgstr "memoryview の各要素のバイト単位の大きさ::" -#: ../../library/stdtypes.rst:5062 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -7598,6 +8388,14 @@ msgid "" ">>> struct.calcsize('H') == m.itemsize\n" "True" msgstr "" +">>> import array, struct\n" +">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" +">>> m.itemsize\n" +"2\n" +">>> m[0]\n" +"32000\n" +">>> struct.calcsize('H') == m.itemsize\n" +"True" #: ../../library/stdtypes.rst:5073 msgid "" @@ -7649,17 +8447,18 @@ msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" "メモリーが連続しているかどうかを示す真偽値(参考: :term:`contiguous` )。" -#: ../../library/stdtypes.rst:5114 msgid "" "For information on the thread safety of :class:`memoryview` objects in the :" "term:`free-threaded build`, see :ref:`thread-safety-memoryview`." msgstr "" +":term:`フリースレッドビルド ` における :class:" +"`memoryview` オブジェクトのスレッドセーフ性については、:ref:`thread-safety-" +"memoryview` を参照してください。" #: ../../library/stdtypes.rst:5121 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "set(集合)型 --- :class:`set`, :class:`frozenset`" -#: ../../library/stdtypes.rst:5125 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -7669,6 +8468,13 @@ msgid "" "`collections` module.) See :ref:`time-complexity` for the costs of the " "various set operations." msgstr "" +":dfn:`集合 (set)` オブジェクトは、互いに異なる :term:`ハッシュ可能 " +"` なオブジェクトからなる順序を持たないコレクションです。\n" +"主な用途には、帰属判定、シーケンスからの重複の除去、積集合・和集合・差集合・" +"対称差といった数学的演算の計算があります。\n" +"(その他のコンテナについては、組み込みの :class:`dict`、:class:`list`、:class:" +"`tuple` クラス、および :mod:`collections` モジュールを参照してください。)\n" +"各種集合演算の計算量については、:ref:`time-complexity` を参照してください。" msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " @@ -7683,7 +8489,6 @@ msgstr "" "そのため、インデックス指定やスライスなど、シーケンスのような動作はサポートし" "ません。" -#: ../../library/stdtypes.rst:5138 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -7694,6 +8499,15 @@ msgid "" "it is created; it can therefore be used as a dictionary key or as an element " "of another set." msgstr "" +"現在、組み込みの集合型には :class:`set` と :class:`frozenset` の二つがありま" +"す。\n" +":class:`set` 型はミュータブルで、:meth:`~set.add` や :meth:`~set.remove` など" +"のメソッドで内容を変更できます。\n" +"ミュータブルなのでハッシュ値を持たず、辞書のキーにも別の集合の要素にも使えま" +"せん。\n" +":class:`frozenset` 型はイミュータブルで :term:`ハッシュ可能 ` で" +"す。\n" +"作成後に内容を変更できないため、辞書のキーや別の集合の要素として使えます。" #: ../../library/stdtypes.rst:5147 msgid "" @@ -7820,7 +8634,6 @@ msgstr "" msgid "Return a shallow copy of the set." msgstr "集合の浅いコピーを返します。" -#: ../../library/stdtypes.rst:5241 msgid "" "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:" "`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset." @@ -7830,6 +8643,14 @@ msgid "" "precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of " "the more readable ``set('abc').intersection('cbs')``." msgstr "" +"演算子を使わない :meth:`~frozenset.union`、:meth:`~frozenset.intersection`、:" +"meth:`~frozenset.difference`、:meth:`~frozenset.symmetric_difference`、:meth:" +"`~frozenset.issubset`、:meth:`~frozenset.issuperset` メソッドは、任意のイテラ" +"ブルを引数として受け付けます。\n" +"一方、対応する演算子を使う場合、引数は集合でなければなりません。\n" +"これにより、間違いを起こしやすい ``set('abc') & 'cbs'`` のような書き方ができ" +"なくなり、より読みやすい ``set('abc').intersection('cbs')`` を使うようになり" +"ます。" #: ../../library/stdtypes.rst:5248 msgid "" @@ -7884,15 +8705,15 @@ msgstr "" "集合の要素は、辞書のキーのように、 :term:`ハッシュ可能 ` でなければ" "なりません。" -#: ../../library/stdtypes.rst:5269 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -":class:`set` インスタンスと :class:`frozenset` インスタンスを取り混ぜての二項" -"演算は、第一被演算子の型を返します。例えば: ``frozenset('ab') | set('bc')`` " -"は :class:`frozenset` インスタンスを返します。" +":class:`set` と :class:`frozenset` のインスタンスを混在させた二項演算は、最初" +"のオペランドと同じ型のオブジェクトを返します。\n" +"例えば、``frozenset('ab') | set('bc')`` は :class:`frozenset` のインスタンス" +"を返します。" #: ../../library/stdtypes.rst:5273 msgid "" @@ -7947,12 +8768,14 @@ msgstr "" msgid "Remove all elements from the set." msgstr "set の全ての要素を取り除きます。" -#: ../../library/stdtypes.rst:5319 msgid "" "Note, the non-operator versions of the :meth:`~set.update`, :meth:`~set." "intersection_update`, :meth:`~set.difference_update`, and :meth:`~set." "symmetric_difference_update` methods will accept any iterable as an argument." msgstr "" +"演算子を使わない :meth:`~set.update`、:meth:`~set.intersection_update`、:" +"meth:`~set.difference_update`、:meth:`~set.symmetric_difference_update` メ" +"ソッドは、任意のイテラブルを引数として受け付けます。" #: ../../library/stdtypes.rst:5324 msgid "" @@ -7962,23 +8785,22 @@ msgid "" "*elem*." msgstr "" -#: ../../library/stdtypes.rst:5329 msgid "" "Sets and frozensets are :ref:`generic ` over the type of their " "elements." msgstr "" +"set と frozenset は要素の型について :ref:`ジェネリック ` です。" -#: ../../library/stdtypes.rst:5333 msgid "" "For detailed information on thread-safety guarantees for :class:`set` " "objects, see :ref:`thread-safety-set`." msgstr "" +":class:`set` オブジェクトのスレッドセーフ性の保証については、:ref:`thread-" +"safety-set` を参照してください。" -#: ../../library/stdtypes.rst:5340 msgid "Mapping types --- :class:`!dict`, :class:`!frozendict`" -msgstr "" +msgstr "マッピング型 --- :class:`!dict`、:class:`!frozendict`" -#: ../../library/stdtypes.rst:5350 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "There are currently two standard mapping types, the :dfn:`dictionary` and :" @@ -7987,6 +8809,13 @@ msgid "" "See :ref:`time-complexity` for the costs of the various dictionary " "operations." msgstr "" +":term:`マッピング ` オブジェクトは、:term:`ハッシュ可能 ` " +"な値を任意のオブジェクトに対応付けます。\n" +"現在、標準のマッピング型には :dfn:`辞書 (dictionary)` と :class:`frozendict` " +"の二つがあります。\n" +"(その他のコンテナについては、組み込みの :class:`list`、:class:`set`、:class:" +"`tuple` クラス、および :mod:`collections` モジュールを参照してください。)\n" +"各種辞書演算の計算量については、:ref:`time-complexity` を参照してください。" msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" @@ -8034,7 +8863,6 @@ msgstr "" "型コンストラクタを使う: ``dict()``, ``dict([('foo', 100), ('bar', 200)])``, " "``dict(foo=100, bar=200)``" -#: ../../library/stdtypes.rst:5381 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -8046,6 +8874,18 @@ msgid "" "corresponding value. If a key occurs more than once, the last value for " "that key becomes the corresponding value in the new dictionary." msgstr "" +"位置引数を指定しない場合は、空の辞書を作成します。\n" +"位置引数を指定し、そのオブジェクトに ``keys()`` メソッドが定義されている場合" +"は、そのメソッドが返す各キーを使って位置引数の :meth:`~object.__getitem__` を" +"呼び出し、辞書を作成します。\n" +"それ以外の場合、位置引数は :term:`イテラブル ` オブジェクトでなけれ" +"ばなりません。\n" +"そのイテラブル内の各要素も、それぞれちょうど二つの要素を持つイテラブルでなけ" +"ればなりません。\n" +"各要素の1番目の値が新しい辞書のキーとなり、2番目の値が対応する値となりま" +"す。\n" +"同じキーが複数回出現した場合は、そのキーの最後の値が新しい辞書での対応する値" +"となります。" #: ../../library/stdtypes.rst:5391 msgid "" @@ -8058,7 +8898,6 @@ msgstr "" "辞書に追加されます。既に存在しているキーが追加された場合、キーワード引数の値" "は位置引数の値を置き換えます。" -#: ../../library/stdtypes.rst:5396 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -8066,8 +8905,12 @@ msgid "" "equality, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" +"辞書同士は、順序に関係なく同じ ``(key, value)`` 対を持つ場合に限り等しいとみ" +"なされます。\n" +"順序比較 ('<'、'<='、'>='、'>') は :exc:`TypeError` を送出します。\n" +"辞書の作成と等価性を示す次の例は、すべて ``{\"one\": 1, \"two\": 2, " +"\"three\": 3}`` と等しい辞書を返します。 ::" -#: ../../library/stdtypes.rst:5402 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -8078,6 +8921,14 @@ msgid "" ">>> a == b == c == d == e == f\n" "True" msgstr "" +">>> a = dict(one=1, two=2, three=3)\n" +">>> b = {'one': 1, 'two': 2, 'three': 3}\n" +">>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n" +">>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n" +">>> e = dict({'three': 3, 'one': 1, 'two': 2})\n" +">>> f = dict({'one': 1, 'three': 3}, two=2)\n" +">>> a == b == c == d == e == f\n" +"True" #: ../../library/stdtypes.rst:5411 msgid "" @@ -8097,7 +8948,6 @@ msgstr "" "キーの更新は順序には影響が無いことに注意してください。\n" "いったん削除されてから再度追加されたキーは末尾に挿入されます。::" -#: ../../library/stdtypes.rst:5417 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -8114,6 +8964,20 @@ msgid "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(d)\n" +"['one', 'two', 'three', 'four']\n" +">>> list(d.values())\n" +"[1, 2, 3, 4]\n" +">>> d[\"one\"] = 42\n" +">>> d\n" +"{'one': 42, 'two': 2, 'three': 3, 'four': 4}\n" +">>> del d[\"two\"]\n" +">>> d[\"two\"] = None\n" +">>> d\n" +"{'one': 42, 'three': 3, 'four': 4, 'two': None}" #: ../../library/stdtypes.rst:5432 msgid "" @@ -8123,11 +8987,12 @@ msgstr "" "辞書の順序が挿入順序であることが保証されるようになりました。この振る舞いは " "CPython 3.6 の実装詳細でした。" -#: ../../library/stdtypes.rst:5436 msgid "" "Dictionaries are :ref:`generic ` over two types, signifying " "(respectively) the types of the dictionary's keys and values." msgstr "" +"辞書は、キーと値の型をそれぞれ表す二つの型について :ref:`ジェネリック " +"` です。" #: ../../library/stdtypes.rst:5439 msgid "" @@ -8153,7 +9018,6 @@ msgstr "" "*d* のキー *key* の項目を返します。マップに *key* が存在しなければ、 :exc:" "`KeyError` を送出します。" -#: ../../library/stdtypes.rst:5457 msgid "" "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " "is not present, the ``d[key]`` operation calls that method with the key " @@ -8163,8 +9027,17 @@ msgid "" "__missing__` is not defined, :exc:`KeyError` is raised. :meth:`~object." "__missing__` must be a method; it cannot be an instance variable::" msgstr "" +"dict のサブクラスに :meth:`~object.__missing__` メソッドが定義されていて " +"*key* が存在しない場合、``d[key]`` 演算はキー *key* を引数としてそのメソッド" +"を呼び出します。\n" +"``d[key]`` 演算は、``__missing__(key)`` の呼び出しが返す値をそのまま返し、送" +"出する例外をそのまま送出します。\n" +"それ以外の演算やメソッドは :meth:`~object.__missing__` を呼び出しません。\n" +":meth:`~object.__missing__` が定義されていない場合は :exc:`KeyError` が送出さ" +"れます。\n" +":meth:`~object.__missing__` はメソッドでなければならず、インスタンス変数には" +"できません。 ::" -#: ../../library/stdtypes.rst:5465 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -8177,13 +9050,25 @@ msgid "" ">>> c['red']\n" "1" msgstr "" +">>> class Counter(dict):\n" +"... def __missing__(self, key):\n" +"... return 0\n" +"...\n" +">>> c = Counter()\n" +">>> c['red']\n" +"0\n" +">>> c['red'] += 1\n" +">>> c['red']\n" +"1" -#: ../../library/stdtypes.rst:5476 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different :meth:`!__missing__` method is used by :class:" "`collections.defaultdict`." msgstr "" +"上の例は :class:`collections.Counter` の実装の一部を示しています。\n" +":class:`collections.defaultdict` では、異なる :meth:`!__missing__` メソッドを" +"使っています。" #: ../../library/stdtypes.rst:5483 msgid "Set ``d[key]`` to *value*." @@ -8324,13 +9209,14 @@ msgstr "" "*default* として *key* を挿入し、 *default* を返します。 *default* のデフォル" "トは ``None`` です。" -#: ../../library/stdtypes.rst:5574 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" +"``mapping`` または ``iterable`` と ``kwargs`` のキーと値の対で辞書を更新し、" +"既存のキーを上書きします。\n" +"``None`` を返します。" -#: ../../library/stdtypes.rst:5577 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -8338,6 +9224,13 @@ msgid "" "iterables of length two). If keyword arguments are specified, the dictionary " "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" +":meth:`update` は、``keys()`` メソッドを持つ別のオブジェクトか、キーと値の対" +"のイテラブル (各対はタプル、または長さ2のその他のイテラブル) を受け付けま" +"す。\n" +"前者の場合、そのメソッドが返す各キーを使って :meth:`~object.__getitem__` を呼" +"び出します。\n" +"キーワード引数を指定した場合は、続いてそれらのキーと値の対で辞書を更新しま" +"す: ``d.update(red=1, blue=2)``。" #: ../../library/stdtypes.rst:5585 msgid "" @@ -8357,12 +9250,14 @@ msgstr "" "が返ります。\n" "``dict.values()`` どうしを比較したときも同様です::" -#: ../../library/stdtypes.rst:5592 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" "False" msgstr "" +">>> d = {'a': 1}\n" +">>> d.values() == d.values()\n" +"False" msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " @@ -8388,7 +9283,6 @@ msgstr "" msgid "Dictionaries and dictionary views are reversible. ::" msgstr "辞書と辞書のビューは ``reversed()`` で順序を逆にすることができます::" -#: ../../library/stdtypes.rst:5614 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -8400,6 +9294,15 @@ msgid "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(reversed(d))\n" +"['four', 'three', 'two', 'one']\n" +">>> list(reversed(d.values()))\n" +"[4, 3, 2, 1]\n" +">>> list(reversed(d.items()))\n" +"[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" #: ../../library/stdtypes.rst:5624 msgid "Dictionaries are now reversible." @@ -8411,11 +9314,12 @@ msgid "" "create a read-only view of a :class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5634 msgid "" "For detailed information on thread-safety guarantees for :class:`dict` " "objects, see :ref:`thread-safety-dict`." msgstr "" +":class:`dict` オブジェクトのスレッドセーフ性の保証については、:ref:`thread-" +"safety-dict` を参照してください。" #: ../../library/stdtypes.rst:5641 msgid "Dictionary view objects" @@ -8531,7 +9435,6 @@ msgstr "" msgid "An example of dictionary view usage::" msgstr "辞書ビューの使用法の例::" -#: ../../library/stdtypes.rst:5705 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -8571,78 +9474,112 @@ msgid "" ">>> values.mapping['spam']\n" "500" msgstr "" +">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" +">>> keys = dishes.keys()\n" +">>> values = dishes.values()\n" +"\n" +">>> # 反復\n" +">>> n = 0\n" +">>> for val in values:\n" +"... n += val\n" +"...\n" +">>> print(n)\n" +"504\n" +"\n" +">>> # キーと値は同じ順序 (挿入順序) で反復される\n" +">>> list(keys)\n" +"['eggs', 'sausage', 'bacon', 'spam']\n" +">>> list(values)\n" +"[2, 1, 1, 500]\n" +"\n" +">>> # ビューオブジェクトは動的で、辞書の変更を反映する\n" +">>> del dishes['eggs']\n" +">>> del dishes['sausage']\n" +">>> list(keys)\n" +"['bacon', 'spam']\n" +"\n" +">>> # 集合演算\n" +">>> keys & {'eggs', 'bacon', 'salad'}\n" +"{'bacon'}\n" +">>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'}\n" +"True\n" +">>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'}\n" +"True\n" +"\n" +">>> # 元の辞書の読み出し専用プロキシを取得する\n" +">>> values.mapping\n" +"mappingproxy({'bacon': 1, 'spam': 500})\n" +">>> values.mapping['spam']\n" +"500" -#: ../../library/stdtypes.rst:5745 msgid "Frozen dictionaries" -msgstr "" +msgstr "凍結辞書" -#: ../../library/stdtypes.rst:5751 msgid "" "Return a new frozen dictionary initialized from an optional positional " "argument and a possibly empty set of keyword arguments." msgstr "" +"省略可能な位置引数と、空でもよいキーワード引数の集まりから初期化した、新しい" +"凍結辞書を返します。" -#: ../../library/stdtypes.rst:5754 msgid "" "A :class:`!frozendict` has a similar API to the :class:`dict` API, with the " "following differences:" msgstr "" +":class:`!frozendict` の API は :class:`dict` の API と似ていますが、次の点が" +"異なります:" -#: ../../library/stdtypes.rst:5757 msgid ":class:`!dict` has more methods than :class:`!frozendict`:" -msgstr "" +msgstr ":class:`!dict` は :class:`!frozendict` より多くのメソッドを持ちます:" -#: ../../library/stdtypes.rst:5759 msgid ":meth:`!__delitem__`" -msgstr "" +msgstr ":meth:`!__delitem__`" -#: ../../library/stdtypes.rst:5760 msgid ":meth:`!__setitem__`" -msgstr "" +msgstr ":meth:`!__setitem__`" -#: ../../library/stdtypes.rst:5761 msgid ":meth:`~dict.clear`" -msgstr "" +msgstr ":meth:`~dict.clear`" -#: ../../library/stdtypes.rst:5762 msgid ":meth:`~dict.pop`" -msgstr "" +msgstr ":meth:`~dict.pop`" -#: ../../library/stdtypes.rst:5763 msgid ":meth:`~dict.popitem`" -msgstr "" +msgstr ":meth:`~dict.popitem`" -#: ../../library/stdtypes.rst:5764 msgid ":meth:`~dict.setdefault`" -msgstr "" +msgstr ":meth:`~dict.setdefault`" -#: ../../library/stdtypes.rst:5765 msgid ":meth:`~dict.update`" -msgstr "" +msgstr ":meth:`~dict.update`" -#: ../../library/stdtypes.rst:5767 msgid "" "A :class:`!frozendict` can be hashed with ``hash(frozendict)`` if all keys " "and values can be hashed." msgstr "" +":class:`!frozendict` のすべてのキーと値がハッシュ可能であれば、" +"``hash(frozendict)`` でハッシュ値を計算できます。" -#: ../../library/stdtypes.rst:5770 msgid "" "``frozendict |= other`` does not modify the :class:`!frozendict` in-place " "but creates a new frozen dictionary." msgstr "" +"``frozendict |= other`` は :class:`!frozendict` をインプレースで変更せず、新" +"しい凍結辞書を作成します。" -#: ../../library/stdtypes.rst:5773 msgid "" ":class:`!frozendict` is not a :class:`!dict` subclass but inherits directly " "from ``object``." msgstr "" +":class:`!frozendict` は :class:`!dict` のサブクラスではなく、``object`` を直" +"接継承します。" -#: ../../library/stdtypes.rst:5776 msgid "" "Like dictionaries, frozendicts are :ref:`generic ` over two types, " "signifying (respectively) the types of the frozendict's keys and values." msgstr "" +"辞書と同様に、frozendict はキーと値の型をそれぞれ表す二つの型について :ref:`" +"ジェネリック ` です。" #: ../../library/stdtypes.rst:5781 msgid "" @@ -8667,16 +9604,16 @@ msgstr "" "文の終わりで脱出する実行時コンテキストを、ユーザ定義クラスが定義できるように" "する一対のメソッドで実装されます:" -#: ../../library/stdtypes.rst:5807 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " "to the identifier in the :keyword:`!as` clause of :keyword:`with` statements " "using this context manager." msgstr "" -"実行時コンテキストに入り、このオブジェクトまたは他の実行時コンテキストに関連" -"したオブジェクトを返します。このメソッドが返す値はこのコンテキストマネージャ" -"を使う :keyword:`with` 文の :keyword:`!as` 節の識別子に束縛されます。" +"実行時コンテキストに入り、このオブジェクト自体か、実行時コンテキストに関連す" +"る別のオブジェクトを返します。\n" +"このメソッドの返り値は、このコンテキストマネージャを使う :keyword:`with` 文" +"の :keyword:`!as` 節の識別子に束縛されます。" #: ../../library/stdtypes.rst:5812 msgid "" @@ -8717,20 +9654,24 @@ msgstr "" "合、引数にはその例外の型と値とトレースバック情報を渡します。そうでない場合、" "引数は全て ``None`` となります。" -#: ../../library/stdtypes.rst:5831 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " "statement immediately following the :keyword:`!with` statement. Otherwise " "the exception continues propagating after this method has finished executing." msgstr "" +"このメソッドが真の値を返すと、:keyword:`with` 文は例外を抑制し、:keyword:`!" +"with` 文の直後の文から実行を続けます。\n" +"それ以外の場合は、このメソッドの実行が終わった後も例外が伝播し続けます。" -#: ../../library/stdtypes.rst:5836 msgid "" "If this method raises an exception while handling an earlier exception from " "the :keyword:`with` block, the new exception is raised, and the original " "exception is stored in its :attr:`~BaseException.__context__` attribute." msgstr "" +"このメソッドが :keyword:`with` ブロックで発生した例外を処理している間に別の例" +"外を送出すると、新しい例外が送出され、元の例外はその :attr:`~BaseException." +"__context__` 属性に格納されます。" #: ../../library/stdtypes.rst:5840 msgid "" @@ -8897,7 +9838,6 @@ msgstr "" "アノテーションでは、このような :ref:`re.Match ` オブジェクト" "は ``re.Match[bytes]`` と表現することになるでしょう。" -#: ../../library/stdtypes.rst:5925 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -8905,6 +9845,13 @@ msgid "" "classes>` may not be instances of :class:`types.GenericAlias`, but they " "provide similar functionality." msgstr "" +"``GenericAlias`` オブジェクトは :class:`types.GenericAlias` クラスのインスタ" +"ンスです。\n" +"このクラスを使って ``GenericAlias`` オブジェクトを直接作成することもできま" +"す。\n" +"ユーザ定義の :ref:`ジェネリッククラス ` を特殊化したものは :" +"class:`types.GenericAlias` のインスタンスとは限りませんが、同様の機能を提供し" +"ます。" #: ../../library/stdtypes.rst:5932 msgid "" @@ -8917,11 +9864,12 @@ msgstr "" "す。たとえば、 :class:`float` 型の要素を含む :class:`list` を引数にとる関数の" "型アノテーションは次のようになります::" -#: ../../library/stdtypes.rst:5937 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" msgstr "" +"def average(values: list[float]) -> float:\n" +" return sum(values) / len(values)" #: ../../library/stdtypes.rst:5940 msgid "" @@ -8935,11 +9883,12 @@ msgstr "" "ています。この例では、関数はキーが :class:`str` 型、値が :class:`int` 型であ" "るような ``dict`` を引数にとります::" -#: ../../library/stdtypes.rst:5945 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." msgstr "" +"def send_post_request(url: str, body: dict[str, int]) -> None:\n" +" ..." #: ../../library/stdtypes.rst:5948 msgid "" @@ -8949,13 +9898,16 @@ msgstr "" "組み込み関数 :func:`isinstance` と :func:`issubclass` は第二引数として " "``GenericAlias`` 型を指定することはできません::" -#: ../../library/stdtypes.rst:5951 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> isinstance([1, 2], list[str])\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" #: ../../library/stdtypes.rst:5956 msgid "" @@ -8971,12 +9923,14 @@ msgstr "" "せん。たとえば、以下のコードは推奨されませんが、エラーになることなく実行でき" "ます::" -#: ../../library/stdtypes.rst:5962 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" "[1, 2, 3]" msgstr "" +">>> t = list[str]\n" +">>> t([1, 2, 3])\n" +"[1, 2, 3]" #: ../../library/stdtypes.rst:5966 msgid "" @@ -8986,7 +9940,6 @@ msgstr "" "しかも、パラメータ付きジェネリック型は、オブジェクト生成時にパラメータの型情" "報を削除します::" -#: ../../library/stdtypes.rst:5969 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -8996,24 +9949,35 @@ msgid "" ">>> type(l)\n" "" msgstr "" +">>> t = list[str]\n" +">>> type(t)\n" +"\n" +"\n" +">>> l = t()\n" +">>> type(l)\n" +"" -#: ../../library/stdtypes.rst:5978 msgid "" "Instances of ``GenericAlias`` are not classes at runtime, even though they " "behave like classes (they can be instantiated and subclassed)::" msgstr "" +"``GenericAlias`` のインスタンスは、インスタンス化やサブクラス化ができるなどク" +"ラスのように振る舞いますが、実行時にはクラスではありません。 ::" -#: ../../library/stdtypes.rst:5980 msgid "" ">>> import inspect\n" ">>> inspect.isclass(list[int])\n" "False" msgstr "" +">>> import inspect\n" +">>> inspect.isclass(list[int])\n" +"False" -#: ../../library/stdtypes.rst:5984 msgid "" "This is true for :ref:`user-defined generics ` also." msgstr "" +"これは :ref:`ユーザ定義のジェネリック型 ` にも当てはま" +"ります。" msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " @@ -9022,7 +9986,6 @@ msgstr "" "パラメータ付きジェネリック型に :func:`repr` や :func:`str` を呼び出すと、パラ" "メータを含む型が表示されます::" -#: ../../library/stdtypes.rst:5988 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -9030,6 +9993,11 @@ msgid "" ">>> str(list[int])\n" "'list[int]'" msgstr "" +">>> repr(list[int])\n" +"'list[int]'\n" +"\n" +">>> str(list[int])\n" +"'list[int]'" #: ../../library/stdtypes.rst:5994 msgid "" @@ -9039,13 +10007,16 @@ msgstr "" "ジェネリックコンテナ型の :meth:`~object.__getitem__` メソッドは、 ``dict[str]" "[str]`` のようなミスを許さないように、例外を送出します::" -#: ../../library/stdtypes.rst:5997 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" " ...\n" "TypeError: dict[str] is not a generic class" msgstr "" +">>> dict[str][str]\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: dict[str] is not a generic class" msgid "" "However, such expressions are valid when :ref:`type variables ` " @@ -9056,25 +10027,28 @@ msgstr "" "数は ``GenericAlias`` オブジェクトの :attr:`~genericalias.__args__` 属性にお" "ける型変数の数と同じでなければなりません::" -#: ../../library/stdtypes.rst:6006 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" ">>> dict[str, Y][int]\n" "dict[str, int]" msgstr "" +">>> from typing import TypeVar\n" +">>> Y = TypeVar('Y')\n" +">>> dict[str, Y][int]\n" +"dict[str, int]" #: ../../library/stdtypes.rst:6013 msgid "Standard Generic Classes" msgstr "標準ジェネリッククラス" -#: ../../library/stdtypes.rst:6015 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -"以下の標準ライブラリクラスは、パラメータ付きジェネリック型をサポートします。" -"このリストは完全に網羅されていない可能性があります。" +"以下の標準ライブラリのクラスは、パラメータ付きジェネリック型をサポートしてい" +"ます。\n" +"このリストはすべてを網羅しているわけではありません。" #: ../../library/stdtypes.rst:6018 msgid ":class:`tuple`" @@ -9092,9 +10066,8 @@ msgstr ":class:`dict`" msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:6022 msgid ":class:`frozendict`" -msgstr "" +msgstr ":class:`frozendict`" #: ../../library/stdtypes.rst:6023 msgid ":class:`frozenset`" @@ -9104,13 +10077,11 @@ msgstr ":class:`frozenset`" msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:6025 msgid ":class:`asyncio.Future`" -msgstr "" +msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:6026 msgid ":class:`asyncio.Task`" -msgstr "" +msgstr ":class:`asyncio.Task`" #: ../../library/stdtypes.rst:6027 msgid ":class:`collections.deque`" @@ -9132,9 +10103,8 @@ msgstr ":class:`collections.Counter`" msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:6032 msgid ":class:`collections.abc.Awaitable`" -msgstr "’’:class:`collections.abc.Awaitable`" +msgstr ":class:`collections.abc.Awaitable`" #: ../../library/stdtypes.rst:6033 msgid ":class:`collections.abc.Coroutine`" @@ -9318,11 +10288,12 @@ msgstr "" msgid "This attribute points at the non-parameterized generic class::" msgstr "この属性は、対応するパラメータ付きでないジェネリッククラスを指します::" -#: ../../library/stdtypes.rst:6087 msgid "" ">>> list[int].__origin__\n" "" msgstr "" +">>> list[int].__origin__\n" +"" msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " @@ -9333,21 +10304,20 @@ msgstr "" "れたジェネリック型を要素とする :class:`tuple` です (長さが1の場合もありま" "す)::" -#: ../../library/stdtypes.rst:6097 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" msgstr "" +">>> dict[str, list[int]].__args__\n" +"(, list[int])" -#: ../../library/stdtypes.rst:6103 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -"この属性は、 ``__args__`` にある固有の型変数のタプルで、必要に応じて遅延計算" -"されます (空の可能性もあります)::" +"この属性は、``__args__`` に含まれる型変数を重複なく集めた、遅延計算されるタプ" +"ルです (空の場合もあります)。 ::" -#: ../../library/stdtypes.rst:6106 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -9355,16 +10325,21 @@ msgid "" ">>> list[T].__parameters__\n" "(~T,)" msgstr "" +">>> from typing import TypeVar\n" +"\n" +">>> T = TypeVar('T')\n" +">>> list[T].__parameters__\n" +"(~T,)" -#: ../../library/stdtypes.rst:6114 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -":class:`typing.ParamSpec` パラメータを含む ``GenericAlias`` オブジェクトは、" -"代入後に正しい ``__parameters__`` を持たない可能性があります。これは :class:" -"`typing.ParamSpec` が主に静的な型チェックを目的としているためです。" +":class:`typing.ParamSpec` パラメータを持つ ``GenericAlias`` オブジェクトは、" +"置換後の ``__parameters__`` が正しくない場合があります。\n" +"これは :class:`typing.ParamSpec` が主に静的な型チェックを目的としているためで" +"す。" #: ../../library/stdtypes.rst:6121 msgid "" @@ -9417,7 +10392,6 @@ msgstr "" msgid "Union Type" msgstr "Union 型" -#: ../../library/stdtypes.rst:6153 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -9425,26 +10399,31 @@ msgid "" "expression enables cleaner type hinting syntax compared to subscripting :" "class:`typing.Union`." msgstr "" +"ユニオンオブジェクトは、複数の :ref:`型オブジェクト ` に" +"対する ``|`` (ビット単位の論理和) 演算の値を保持します。\n" +"これらの型は主に :term:`型アノテーション ` で使うことを想定してい" +"ます。\n" +"ユニオン型の式を使うと、:class:`typing.Union` の添字表記よりも簡潔な型ヒント" +"の構文で書けます。" -#: ../../library/stdtypes.rst:6160 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " "example, the following function expects an argument of type :class:`int` or :" "class:`float`::" msgstr "" -"*X* と *Y* などの型を保持するUnionオブジェクトを定義すします。``X | Y`` はXと" -"Yのいずれかを意味します。これは ``typing.Union[X, Y]`` と等価です。たとえば、" -"以下の関数は引数として :class:`int` 型または :class:`float` 型を想定していま" -"す。::" +"*X*、*Y* などの型を保持するユニオンオブジェクトを定義します。\n" +"``X | Y`` は X または Y を意味し、``typing.Union[X, Y]`` と等価です。\n" +"例えば、次の関数は :class:`int` 型または :class:`float` 型の引数を想定してい" +"ます。 ::" -#: ../../library/stdtypes.rst:6165 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" msgstr "" +"def square(number: int | float) -> int | float:\n" +" return number ** 2" -#: ../../library/stdtypes.rst:6170 msgid "" "The ``|`` operator cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -9452,6 +10431,12 @@ msgid "" "For unions which include forward references, present the whole expression as " "a string, e.g. ``\"int | Foo\"``." msgstr "" +"一つ以上のメンバーが前方参照であるユニオンを実行時に定義するために、``|`` 演" +"算子を使うことはできません。\n" +"例えば、まだ定義されていないクラスを ``\"Foo\"`` で参照する ``int | " +"\"Foo\"`` は、実行時に失敗します。\n" +"前方参照を含むユニオンは、``\"int | Foo\"`` のように式全体を文字列として記述" +"してください。" #: ../../library/stdtypes.rst:6178 msgid "" @@ -9460,60 +10445,56 @@ msgstr "" "Unionオブジェクトは他のUnionオブジェクトとの等価性をテストできます。以下は詳" "細です:" -#: ../../library/stdtypes.rst:6180 msgid "Unions of unions are flattened::" -msgstr "ユニオン型のユニオン型は平滑化されます::" +msgstr "ユニオンのユニオンは平坦化されます。 ::" -#: ../../library/stdtypes.rst:6182 msgid "(int | str) | float == int | str | float" -msgstr "" +msgstr "(int | str) | float == int | str | float" #: ../../library/stdtypes.rst:6184 msgid "Redundant types are removed::" msgstr "余分な型は削除されます::" -#: ../../library/stdtypes.rst:6186 msgid "int | str | int == int | str" -msgstr "" +msgstr "int | str | int == int | str" #: ../../library/stdtypes.rst:6188 msgid "When comparing unions, the order is ignored::" msgstr "ユニオン型を比較すると順序は無視されます::" -#: ../../library/stdtypes.rst:6190 msgid "int | str == str | int" -msgstr "" +msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:6192 msgid "It creates instances of :class:`typing.Union`::" -msgstr "" +msgstr ":class:`typing.Union` のインスタンスを作成します。 ::" -#: ../../library/stdtypes.rst:6194 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" msgstr "" +"int | str == typing.Union[int, str]\n" +"type(int | str) is typing.Union" #: ../../library/stdtypes.rst:6197 msgid "Optional types can be spelled as a union with ``None``::" msgstr "Optional型は ``None`` とのUnion型で記述できます::" -#: ../../library/stdtypes.rst:6199 msgid "str | None == typing.Optional[str]" -msgstr "" +msgstr "str | None == typing.Optional[str]" msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -":func:`isinstance` と :func:`issubclass` の呼び出しはどちらもUnionオブジェク" -"トをサポートしています。" +"ユニオンオブジェクトを使った :func:`isinstance` と :func:`issubclass` の呼び" +"出しもサポートされています。 ::" -#: ../../library/stdtypes.rst:6207 msgid "" ">>> isinstance(\"\", int | str)\n" "True" msgstr "" +">>> isinstance(\"\", int | str)\n" +"True" #: ../../library/stdtypes.rst:6210 msgid "" @@ -9523,7 +10504,6 @@ msgstr "" "しかし、Unionオブジェクトの中の :ref:`parameterized generics ` はチェックできません::" -#: ../../library/stdtypes.rst:6213 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -9532,14 +10512,21 @@ msgid "" " ...\n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> isinstance(1, int | list[int]) # 短絡評価\n" +"True\n" +">>> isinstance([1], int | list[int])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:6220 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" msgstr "" +"利用者がユニオンオブジェクトの型にアクセスするには :class:`typing.Union` を使" +"います。\n" +":func:`isinstance` による検査にも使えます。 ::" -#: ../../library/stdtypes.rst:6223 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -9549,6 +10536,13 @@ msgid "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" msgstr "" +">>> import typing\n" +">>> isinstance(int | str, typing.Union)\n" +"True\n" +">>> typing.Union()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot create 'typing.Union' instances" #: ../../library/stdtypes.rst:6232 msgid "" @@ -9560,7 +10554,6 @@ msgstr "" "が追加されました。メタクラスで :meth:`!__or__` を実装するとUnionをオーバーラ" "イドする場合があります::" -#: ../../library/stdtypes.rst:6236 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -9574,17 +10567,30 @@ msgid "" ">>> int | C\n" "int | C" msgstr "" +">>> class M(type):\n" +"... def __or__(self, other):\n" +"... return \"Hello\"\n" +"...\n" +">>> class C(metaclass=M):\n" +"... pass\n" +"...\n" +">>> C | int\n" +"'Hello'\n" +">>> int | C\n" +"int | C" #: ../../library/stdtypes.rst:6252 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- ``X | Y`` 構文とUnion型を提案しているPEP" -#: ../../library/stdtypes.rst:6258 msgid "" "Union objects are now instances of :class:`typing.Union`. Previously, they " "were instances of :class:`types.UnionType`, which remains an alias for :" "class:`typing.Union`." msgstr "" +"ユニオンオブジェクトは :class:`typing.Union` のインスタンスになりました。\n" +"以前は :class:`types.UnionType` のインスタンスでしたが、この型名は :class:" +"`typing.Union` のエイリアスとして残っています。" #: ../../library/stdtypes.rst:6265 msgid "Other Built-in Types" @@ -9687,13 +10693,17 @@ msgstr "詳細は、 :ref:`function` を参照してください。" msgid "Methods" msgstr "メソッド" -#: ../../library/stdtypes.rst:6326 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" "`~list.append` on lists) and :ref:`class instance methods `. Built-in methods are described with the types that support them." msgstr "" +"メソッドは属性表記を使って呼び出す関数です。\n" +":ref:`組み込みメソッド ` (リストの :meth:`~list.append` な" +"ど) と :ref:`クラスのインスタンスメソッド ` の2種類がありま" +"す。\n" +"組み込みメソッドは、それをサポートする型の説明で扱います。" #: ../../library/stdtypes.rst:6332 msgid "" @@ -9735,7 +10745,6 @@ msgstr "" "ためには、次のようにその下層の関数オブジェクトに明示的に設定する必要がありま" "す::" -#: ../../library/stdtypes.rst:6351 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -9750,6 +10759,19 @@ msgid "" ">>> c.method.whoami\n" "'my name is method'" msgstr "" +">>> class C:\n" +"... def method(self):\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> c.method.whoami = 'my name is method' # メソッドに設定することはできな" +"い\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"AttributeError: 'method' object has no attribute 'whoami'\n" +">>> c.method.__func__.whoami = 'my name is method'\n" +">>> c.method.whoami\n" +"'my name is method'" #: ../../library/stdtypes.rst:6366 msgid "See :ref:`instance-methods` for more information." @@ -9838,65 +10860,77 @@ msgstr "``None`` と書き表されます。" msgid "The Ellipsis Object" msgstr "Ellipsis オブジェクト" -#: ../../library/stdtypes.rst:6435 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " "named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces " "the :const:`Ellipsis` singleton." msgstr "" +"このオブジェクトは、何かが省略されていることを表すためによく使われます。\n" +"特別な演算はサポートしていません。\n" +"省略記号オブジェクトはちょうど一つだけ存在し、組み込み名 :const:`Ellipsis` が" +"付いています。\n" +"``type(Ellipsis)()`` は :const:`Ellipsis` シングルトンを生成します。" #: ../../library/stdtypes.rst:6440 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "``Ellipsis`` または ``...`` と書き表されます。" -#: ../../library/stdtypes.rst:6442 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" +"通常、``Ellipsis`` オブジェクトとしての ``...`` は、例えば次のような箇所で使" +"われます:" -#: ../../library/stdtypes.rst:6445 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" +":ref:`呼び出し可能オブジェクトの引数 ` や :ref:`タプル" +"の要素 ` などの型アノテーション。" -#: ../../library/stdtypes.rst:6448 msgid "" "As the body of a function instead of a :ref:`pass statement `." -msgstr "" +msgstr ":ref:`pass 文 ` の代わりとなる関数本体。" -#: ../../library/stdtypes.rst:6450 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" +"`NumPy のスライスとストライド `_ などのサードパーティライブラリ。" -#: ../../library/stdtypes.rst:6453 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" +"Python では、``Ellipsis`` オブジェクト以外の意味でも3個のドットを使います。\n" +"例えば、次のような場合です:" -#: ../../library/stdtypes.rst:6455 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" +"省略された内容にマッチするパターンとしての、doctest の :const:`ELLIPSIS " +"`。" -#: ../../library/stdtypes.rst:6457 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" +"入力がまだ完了していないときの、:term:`対話型 ` シェルの Python " +"のデフォルトプロンプト。" -#: ../../library/stdtypes.rst:6459 msgid "" "Lastly, the Python documentation often uses three dots in conventional " "English usage to mean omitted content, even in code examples that also use " "them as the ``Ellipsis``." msgstr "" +"最後に、Python ドキュメントでは内容の省略を意味する通常の英語の用法でも3個の" +"ドットをよく使います。\n" +"これは、``Ellipsis`` としても3個のドットを使っているコード例にも当てはまりま" +"す。" #: ../../library/stdtypes.rst:6467 msgid "The NotImplemented Object" @@ -9959,21 +10993,23 @@ msgstr "" "クラス、関数、メソッド、デスクリプタ、ジェネレータインスタンスの :term:`修飾" "名 ` です。" -#: ../../library/stdtypes.rst:6513 msgid "The name of the module in which a class or function was defined." -msgstr "" +msgstr "クラスまたは関数が定義されたモジュールの名前。" -#: ../../library/stdtypes.rst:6518 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" +"クラスまたは関数のドキュメンテーション文字列。\n" +"未定義の場合は ``None``。" -#: ../../library/stdtypes.rst:6523 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" +"ジェネリッククラスや関数、および :ref:`型エイリアス ` の :ref:`" +"型パラメータ `。\n" +"ジェネリックでないクラスや関数では空のタプルになります。" #: ../../library/stdtypes.rst:6533 msgid "Integer string conversion length limitation" @@ -10028,7 +11064,6 @@ msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "演算の結果が制限を超えると、:exc:`ValueError` が送出されます:" -#: ../../library/stdtypes.rst:6555 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -10051,6 +11086,26 @@ msgid "" "7144\n" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" +">>> import sys\n" +">>> sys.set_int_max_str_digits(4300) # 例示用。これはデフォルト値。\n" +">>> _ = int('2' * 5432)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion: " +"value has 5432 digits; use sys.set_int_max_str_digits() to increase the " +"limit\n" +">>> i = int('2' * 4300)\n" +">>> len(str(i))\n" +"4300\n" +">>> i_squared = i*i\n" +">>> len(str(i_squared))\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion; " +"use sys.set_int_max_str_digits() to increase the limit\n" +">>> len(hex(i_squared))\n" +"7144\n" +">>> assert int(hex(i_squared), base=16) == i*i # 16進数は制限されない。" #: ../../library/stdtypes.rst:6575 msgid "" @@ -10068,7 +11123,6 @@ msgstr "" msgid "Verification:" msgstr "確認:" -#: ../../library/stdtypes.rst:6582 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -10078,6 +11132,13 @@ msgid "" "... '571186405732').to_bytes(53, 'big')\n" "..." msgstr "" +">>> import sys\n" +">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" +">>> assert sys.int_info.str_digits_check_threshold == 640, sys.int_info\n" +">>> msg = int('578966293710682886880994035146873798396722250538762761564'\n" +"... '9252925514383915483333812743580549779436104706260696366600'\n" +"... '571186405732').to_bytes(53, 'big')\n" +"..." #: ../../library/stdtypes.rst:6595 msgid "Affected APIs" @@ -10281,7 +11342,6 @@ msgstr "" msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/stdtypes.rst:6675 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -10293,6 +11353,15 @@ msgid "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" +">>> import sys\n" +">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" +"... upper_bound = 68000\n" +"... lower_bound = 4004\n" +"... current_limit = sys.get_int_max_str_digits()\n" +"... if current_limit == 0 or current_limit > upper_bound:\n" +"... sys.set_int_max_str_digits(upper_bound)\n" +"... elif current_limit < lower_bound:\n" +"... sys.set_int_max_str_digits(lower_bound)" #: ../../library/stdtypes.rst:6685 msgid "If you need to disable it entirely, set it to ``0``." @@ -10876,17 +11945,14 @@ msgstr "universal newlines" msgid "str.splitlines method" msgstr "str.splitlines メソッド" -#: ../../library/stdtypes.rst:2931 msgid "! formatted string literal" -msgstr "" +msgstr "! フォーマット済み文字列リテラル" -#: ../../library/stdtypes.rst:2931 msgid "formatted string literals" -msgstr "" +msgstr "フォーマット済み文字列リテラル" -#: ../../library/stdtypes.rst:2931 msgid "! f-string" -msgstr "" +msgstr "! f-string" msgid "f-strings" msgstr "f-strings" @@ -10907,13 +11973,11 @@ msgstr "補間リテラル" msgid "{} (curly brackets)" msgstr "{} (波括弧)" -#: ../../library/stdtypes.rst:2931 msgid "in formatted string literal" -msgstr "" +msgstr "フォーマット済み文字列リテラル内" -#: ../../library/stdtypes.rst:2931 msgid "! (exclamation mark)" -msgstr "" +msgstr "! (感嘆符)" #: ../../library/stdtypes.rst:2931 msgid ": (colon)" @@ -10923,9 +11987,8 @@ msgstr ": (コロン)" msgid "= (equals)" msgstr "= (等号)" -#: ../../library/stdtypes.rst:2931 msgid "for help in debugging using string literals" -msgstr "" +msgstr "文字列リテラルを使ったデバッグの補助" #: ../../library/stdtypes.rst:3103 msgid "formatting, string (%)" diff --git a/library/threadsafety.po b/library/threadsafety.po index e8793d51f..0d9a28555 100644 --- a/library/threadsafety.po +++ b/library/threadsafety.po @@ -18,59 +18,65 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/threadsafety.rst:5 msgid "Thread Safety Guarantees" -msgstr "" +msgstr "スレッドセーフ性の保証" -#: ../../library/threadsafety.rst:7 msgid "" "This page documents thread-safety guarantees for built-in types in Python's " "free-threaded build. The guarantees described here apply when using Python " "with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled, " "most operations are implicitly serialized." msgstr "" +"このページでは、Python のフリースレッドビルドにおける組み込み型のスレッドセー" +"フ性の保証を説明します。\n" +"ここで説明する保証は、:term:`GIL` を無効にして Python を使う場合 (フリース" +"レッドモード) に適用されます。\n" +"GIL が有効な場合、ほとんどの操作は暗黙に直列化されます。" -#: ../../library/threadsafety.rst:12 msgid "" "For general guidance on writing thread-safe code in free-threaded Python, " "see :ref:`freethreading-python-howto`." msgstr "" +"フリースレッドの Python でスレッドセーフなコードを書くための一般的な指針は、:" +"ref:`freethreading-python-howto` を参照してください。" -#: ../../library/threadsafety.rst:19 msgid "Thread safety levels" -msgstr "" +msgstr "スレッドセーフ性のレベル" -#: ../../library/threadsafety.rst:21 msgid "" "The C API documentation uses the following levels to describe the thread " "safety guarantees of each function. The levels are listed from least to most " "safe." msgstr "" +"C API のドキュメントでは、各関数のスレッドセーフ性の保証を次のレベルで表しま" +"す。\n" +"安全性の低いものから高いものの順に示します。" -#: ../../library/threadsafety.rst:28 msgid "Incompatible" -msgstr "" +msgstr "並行使用不可 (Incompatible)" -#: ../../library/threadsafety.rst:30 msgid "" "A function or operation that cannot be made safe for concurrent use even " "with external synchronization. Incompatible code typically accesses global " "state in an unsynchronized way and must only be called from a single thread " "throughout the program's lifetime." msgstr "" +"外部で同期しても、安全に並行使用できない関数や操作です。\n" +"このレベルのコードは通常、同期せずにグローバル状態へアクセスするため、プログ" +"ラムの存続期間を通して、単一のスレッドからだけ呼び出さなければなりません。" -#: ../../library/threadsafety.rst:35 msgid "" "Example: a function that modifies process-wide state such as signal handlers " "or environment variables, where concurrent calls from any threads, even with " "external locking, can conflict with the runtime or other libraries." msgstr "" +"例: シグナルハンドラや環境変数など、プロセス全体の状態を変更する関数です。\n" +"外部でロックを取得していても、複数のスレッドからの並行呼び出しが、ランタイム" +"やほかのライブラリと競合する可能性があります。" -#: ../../library/threadsafety.rst:42 msgid "Compatible" -msgstr "" +msgstr "外部同期により並行使用可能 (Compatible)" -#: ../../library/threadsafety.rst:44 msgid "" "A function or operation that is safe to call from multiple threads " "*provided* the caller supplies appropriate external synchronization, for " @@ -78,19 +84,25 @@ msgid "" "such synchronization, concurrent calls may produce :term:`race conditions " "` or :term:`data races `." msgstr "" +"呼び出し側が外部で適切に同期する *ことを条件に*、複数のスレッドから安全に呼び" +"出せる関数や操作です。\n" +"たとえば、呼び出しのたびに、呼び出しが続く間 :term:`ロック ` を保持して" +"同期します。\n" +"こうした同期がないと、並行呼び出しによって :term:`競合状態 ` " +"や :term:`データ競合 ` が発生する可能性があります。" -#: ../../library/threadsafety.rst:50 msgid "" "Example: a function that reads from or writes to an object whose internal " "state is not protected by a lock. Callers must ensure that no two threads " "access the same object at the same time." msgstr "" +"例: 内部状態がロックで保護されていないオブジェクトを読み書きする関数です。\n" +"呼び出し側は、二つのスレッドが同じオブジェクトに同時にアクセスしないことを保" +"証しなければなりません。" -#: ../../library/threadsafety.rst:57 msgid "Safe on distinct objects" -msgstr "" +msgstr "異なるオブジェクトなら安全" -#: ../../library/threadsafety.rst:59 msgid "" "A function or operation that is safe to call from multiple threads without " "external synchronization, as long as each thread operates on a **different** " @@ -98,20 +110,26 @@ msgid "" "not pass the same object (or objects that share underlying state) as " "arguments." msgstr "" +"各スレッドが **異なる** オブジェクトを操作する限り、外部で同期せずに複数のス" +"レッドから安全に呼び出せる関数や操作です。\n" +"二つのスレッドが同時にこの関数を呼び出してもかまいませんが、同じオブジェクト " +"(または内部の状態を共有するオブジェクト) を引数に渡してはなりません。" -#: ../../library/threadsafety.rst:65 msgid "" "Example: a function that modifies fields of a struct using non-atomic " "writes. Two threads can each call the function on their own struct instance " "safely, but concurrent calls on the *same* instance require external " "synchronization." msgstr "" +"例: アトミックでない書き込みを使って、構造体のフィールドを変更する関数で" +"す。\n" +"二つのスレッドがそれぞれ自分の構造体インスタンスに対してこの関数を呼び出すの" +"は安全ですが、*同じ* インスタンスに対する並行呼び出しには、外部での同期が必要" +"です。" -#: ../../library/threadsafety.rst:73 msgid "Safe on shared objects" -msgstr "" +msgstr "共有オブジェクトでも安全" -#: ../../library/threadsafety.rst:75 msgid "" "A function or operation that is safe for concurrent use on the **same** " "object. The implementation uses internal synchronization (such as :term:`per-" @@ -119,6 +137,11 @@ msgid "" "section-api>`) to protect shared mutable state, so callers do not need to " "supply their own locking." msgstr "" +"**同じ** オブジェクトに対して安全に並行使用できる関数や操作です。\n" +"実装が内部で同期 (:term:`オブジェクトごとのロック ` や :ref:" +"`クリティカルセクション ` など) を行って共有され" +"た可変の状態を保護するため、呼び出し側で独自にロックを用意する必要はありませ" +"ん。" #: ../../library/threadsafety.rst:81 msgid "" @@ -127,50 +150,56 @@ msgid "" "serialize access." msgstr "" -#: ../../library/threadsafety.rst:88 msgid "Atomic" -msgstr "" +msgstr "アトミック" -#: ../../library/threadsafety.rst:90 msgid "" "A function or operation that appears :term:`atomic ` with " "respect to other threads - it executes instantaneously from the perspective " "of other threads. This is the strongest form of thread safety." msgstr "" +"ほかのスレッドから見ると :term:`アトミック ` に実行される関" +"数や操作です。\n" +"つまり、ほかのスレッドの視点では、一瞬で実行されるように見えます。\n" +"これはスレッドセーフ性の最も強い保証です。" -#: ../../library/threadsafety.rst:94 msgid "" "Example: :c:func:`PyMutex_IsLocked` performs an atomic read of the mutex " "state and can be called from any thread at any time." msgstr "" +"例: :c:func:`PyMutex_IsLocked` はミューテックスの状態をアトミックに読み取り、" +"どのスレッドからでも、いつでも呼び出せます。" -#: ../../library/threadsafety.rst:101 msgid "Thread safety for list objects" -msgstr "" +msgstr "``list`` オブジェクトのスレッドセーフ性" -#: ../../library/threadsafety.rst:103 msgid "" "Reading a single element from a :class:`list` is :term:`atomic `:" msgstr "" +":class:`list` からの単一要素の読み取りは :term:`アトミック ` です。" -#: ../../library/threadsafety.rst:106 msgid "lst[i] # list.__getitem__" -msgstr "" +msgstr "lst[i] # list.__getitem__" -#: ../../library/threadsafety.rst:111 msgid "" "The following methods traverse the list and use :term:`atomic ` reads of each item to perform their function. That means that " "they may return results affected by concurrent modifications:" msgstr "" +"次のメソッドはリストを走査し、各要素を :term:`アトミック ` " +"に読み取って処理を行います。\n" +"そのため、並行して行われる変更の影響を受けた結果を返すことがあります。" -#: ../../library/threadsafety.rst:115 msgid "" "item in lst\n" "lst.index(item)\n" "lst.count(item)" msgstr "" +"item in lst\n" +"lst.index(item)\n" +"lst.count(item)" #: ../../library/threadsafety.rst:122 msgid "" @@ -179,76 +208,92 @@ msgid "" "that hold a lock will not block these from observing intermediate states." msgstr "" -#: ../../library/threadsafety.rst:127 msgid "" "All other operations from here on block using the :term:`per-object lock`." msgstr "" +"これ以降のほかの操作はすべて、:term:`オブジェクトごとのロック ` を使ってブロックします。" -#: ../../library/threadsafety.rst:129 msgid "" "Writing a single item via ``lst[i] = x`` is safe to call from multiple " "threads and will not corrupt the list." msgstr "" +"``lst[i] = x`` による単一要素の書き込みは、複数のスレッドから安全に実行でき、" +"リストを破損させません。" -#: ../../library/threadsafety.rst:132 msgid "" "The following operations return new objects and appear :term:`atomic ` to other threads:" msgstr "" +"次の操作は新しいオブジェクトを返し、ほかのスレッドから見ると :term:`アトミッ" +"ク ` に実行されます。" -#: ../../library/threadsafety.rst:135 msgid "" "lst1 + lst2 # concatenates two lists into a new list\n" "x * lst # repeats lst x times into a new list\n" "lst.copy() # returns a shallow copy of the list" msgstr "" +"lst1 + lst2 # 二つのリストを結合して新しいリストを作成する\n" +"x * lst # lst を x 回繰り返して新しいリストを作成する\n" +"lst.copy() # リストの浅いコピーを返す" -#: ../../library/threadsafety.rst:142 msgid "" "The following methods that only operate on a single element with no shifting " "required are :term:`atomic `:" msgstr "" +"次のメソッドは、要素をずらす必要がなく、単一の要素だけを操作するため、:term:`" +"アトミック ` です。" -#: ../../library/threadsafety.rst:145 msgid "" "lst.append(x) # append to the end of the list, no shifting required\n" "lst.pop() # pop element from the end of the list, no shifting required" msgstr "" +"lst.append(x) # リストの末尾に追加するため、要素をずらす必要はない\n" +"lst.pop() # リストの末尾の要素を取り出して削除するため、要素をずらす必要" +"はない" -#: ../../library/threadsafety.rst:151 msgid "" "The :meth:`~list.clear` method is also :term:`atomic `. " "Other threads cannot observe elements being removed." msgstr "" +":meth:`~list.clear` メソッドも :term:`アトミック ` です。\n" +"ほかのスレッドから、要素が削除されていく途中の状態は観測できません。" -#: ../../library/threadsafety.rst:154 msgid "" "The :meth:`~list.sort` method is not :term:`atomic `. " "Other threads cannot observe intermediate states during sorting, but the " "list appears empty for the duration of the sort." msgstr "" +":meth:`~list.sort` メソッドは :term:`アトミック ` ではあり" +"ません。\n" +"ほかのスレッドからソート途中の状態は観測できませんが、ソート中のリストは空に" +"見えます。" -#: ../../library/threadsafety.rst:158 msgid "" "The following operations may allow :term:`lock-free` operations to observe " "intermediate states since they modify multiple elements in place:" msgstr "" +"次の操作は複数の要素をその場で変更するため、:term:`ロックフリーな ` 操作から途中の状態が観測されることがあります。" -#: ../../library/threadsafety.rst:161 msgid "" "lst.insert(idx, item) # shifts elements\n" "lst.pop(idx) # idx not at the end of the list, shifts elements\n" "lst *= x # copies elements in place" msgstr "" +"lst.insert(idx, item) # 要素をずらす\n" +"lst.pop(idx) # idx がリストの末尾でなければ、要素をずらす\n" +"lst *= x # 要素をその場でコピーする" -#: ../../library/threadsafety.rst:168 msgid "" "The :meth:`~list.remove` method may allow concurrent modifications since " "element comparison may execute arbitrary Python code (via :meth:`~object." "__eq__`)." msgstr "" +"要素の比較で (:meth:`~object.__eq__` を通じて) 任意の Python コードを実行する" +"可能性があるため、:meth:`~list.remove` メソッドの実行中に並行して変更が行われ" +"ることがあります。" -#: ../../library/threadsafety.rst:172 msgid "" ":meth:`~list.extend` is safe to call from multiple threads. However, its " "guarantees depend on the iterable passed to it. If it is a :class:`list`, a :" @@ -259,21 +304,33 @@ msgid "" "another thread. The same applies to inplace concatenation of a list with " "other iterables when using ``lst += iterable``." msgstr "" +":meth:`~list.extend` は複数のスレッドから安全に呼び出せます。\n" +"ただし、その保証は渡されたイテラブルによって異なります。\n" +"渡されたイテラブルが :class:`list`、:class:`tuple`、:class:`set`、:class:" +"`frozenset`、:class:`dict`、:ref:`辞書ビューオブジェクト ` のいず" +"れか (サブクラスは除く) である場合、``extend`` 操作はそのイテラブルに対する並" +"行変更から保護されます。\n" +"それ以外の場合は、ほかのスレッドによって並行して変更される可能性があるイテ" +"レータが作成されます。\n" +"``lst += iterable`` を使ってリストとほかのイテラブルをインプレースに結合する" +"場合も、同じことが当てはまります。" -#: ../../library/threadsafety.rst:181 msgid "" "Similarly, assigning to a list slice with ``lst[i:j] = iterable`` is safe to " "call from multiple threads, but ``iterable`` is only locked when it is also " "a :class:`list` (but not its subclasses)." msgstr "" +"同様に、``lst[i:j] = iterable`` によるリストのスライスへの代入も、複数のス" +"レッドから安全に実行できますが、``iterable`` がロックされるのは、" +"``iterable`` も :class:`list` (サブクラスは除く) である場合だけです。" -#: ../../library/threadsafety.rst:185 msgid "" "Operations that involve multiple accesses, as well as iteration, are never " "atomic. For example:" msgstr "" +"複数回のアクセスを伴う操作やイテレーションは、アトミックではありません。\n" +"たとえば、次のような操作です。" -#: ../../library/threadsafety.rst:188 msgid "" "# NOT atomic: read-modify-write\n" "lst[i] = lst[i] + 1\n" @@ -286,16 +343,26 @@ msgid "" "for item in lst:\n" " process(item) # another thread may modify lst" msgstr "" +"# アトミックではない: 読み取り、変更、書き込み\n" +"lst[i] = lst[i] + 1\n" +"\n" +"# アトミックではない: 確認してから実行\n" +"if lst:\n" +" item = lst.pop()\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for item in lst:\n" +" process(item) # ほかのスレッドが lst を変更する可能性がある" -#: ../../library/threadsafety.rst:202 msgid "" "Consider external synchronization when sharing :class:`list` instances " "across threads." msgstr "" +"スレッド間で :class:`list` インスタンスを共有する場合は、外部での同期を検討し" +"てください。" -#: ../../library/threadsafety.rst:209 msgid "Thread safety for dict objects" -msgstr "" +msgstr "``dict`` オブジェクトのスレッドセーフ性" #: ../../library/threadsafety.rst:211 msgid "" @@ -311,25 +378,28 @@ msgid "" "`atomic `." msgstr "" -#: ../../library/threadsafety.rst:220 msgid "" "d[key] # dict.__getitem__\n" "d.get(key) # dict.get\n" "key in d # dict.__contains__\n" "len(d) # dict.__len__" msgstr "" +"d[key] # dict.__getitem__\n" +"d.get(key) # dict.get\n" +"key in d # dict.__contains__\n" +"len(d) # dict.__len__" #: ../../library/threadsafety.rst:228 msgid "All other operations from here on hold the :term:`per-object lock`." msgstr "" -#: ../../library/threadsafety.rst:230 msgid "" "Writing or removing a single item is safe to call from multiple threads and " "will not corrupt the dictionary:" msgstr "" +"単一の要素の書き込みや削除は、複数のスレッドから安全に実行でき、辞書を破損さ" +"せません。" -#: ../../library/threadsafety.rst:233 msgid "" "d[key] = value # write\n" "del d[key] # delete\n" @@ -337,8 +407,12 @@ msgid "" "d.popitem() # remove and return last item\n" "d.setdefault(key, v) # insert if missing" msgstr "" +"d[key] = value # 書き込む\n" +"del d[key] # 削除する\n" +"d.pop(key) # 削除して返す\n" +"d.popitem() # 最後の要素を削除して返す\n" +"d.setdefault(key, v) # 存在しなければ挿入する" -#: ../../library/threadsafety.rst:242 msgid "" "These operations may compare keys using :meth:`~object.__eq__`, which can " "execute arbitrary Python code. During such comparisons, the dictionary may " @@ -346,6 +420,12 @@ msgid "" "`int`, and :class:`float`, that implement :meth:`~object.__eq__` in C, the " "underlying lock is not released during comparisons and this is not a concern." msgstr "" +"これらの操作は :meth:`~object.__eq__` を使ってキーを比較することがあり、その" +"際に任意の Python コードを実行する可能性があります。\n" +"このような比較中に、ほかのスレッドが辞書を変更する可能性があります。\n" +":meth:`~object.__eq__` を C で実装している :class:`str`、:class:`int`、:" +"class:`float` などの組み込み型では、比較中に内部のロックを解放しないため、こ" +"の心配はありません。" #: ../../library/threadsafety.rst:249 msgid "" @@ -353,7 +433,6 @@ msgid "" "lock` for the duration of the operation:" msgstr "" -#: ../../library/threadsafety.rst:252 msgid "" "d.copy() # returns a shallow copy of the dictionary\n" "d | other # merges two dicts into a new dict\n" @@ -361,14 +440,19 @@ msgid "" "d.values() # returns a new dict_values view object\n" "d.items() # returns a new dict_items view object" msgstr "" +"d.copy() # 辞書の浅いコピーを返す\n" +"d | other # 二つの辞書をマージして新しい辞書を作成する\n" +"d.keys() # 新しい dict_keys ビューオブジェクトを返す\n" +"d.values() # 新しい dict_values ビューオブジェクトを返す\n" +"d.items() # 新しい dict_items ビューオブジェクトを返す" -#: ../../library/threadsafety.rst:261 msgid "" "The :meth:`~dict.clear` method holds the lock for its duration. Other " "threads cannot observe elements being removed." msgstr "" +":meth:`~dict.clear` メソッドは、処理中ずっとロックを保持します。\n" +"ほかのスレッドから、要素が削除されていく途中の状態は観測できません。" -#: ../../library/threadsafety.rst:264 msgid "" "The following operations lock both dictionaries. For :meth:`~dict.update` " "and ``|=``, this applies only when the other operand is a :class:`dict` that " @@ -376,56 +460,70 @@ msgid "" "iteration). For equality comparison, this applies to :class:`dict` and its " "subclasses:" msgstr "" +"次の操作は両方の辞書をロックします。\n" +":meth:`~dict.update` と ``|=`` では、もう一方のオペランドが標準の辞書イテレー" +"タを使う :class:`dict` である場合だけ、この保証が適用されます (イテレーション" +"をオーバーライドするサブクラスは除きます)。\n" +"等値比較では、:class:`dict` とそのサブクラスにこの保証が適用されます。" -#: ../../library/threadsafety.rst:270 msgid "" "d.update(other_dict) # both locked when other_dict is a dict\n" "d |= other_dict # both locked when other_dict is a dict\n" "d == other_dict # both locked for dict and subclasses" msgstr "" +"d.update(other_dict) # other_dict が dict の場合は両方をロックする\n" +"d |= other_dict # other_dict が dict の場合は両方をロックする\n" +"d == other_dict # dict とそのサブクラスの場合は両方をロックする" -#: ../../library/threadsafety.rst:277 msgid "" "All comparison operations also compare values using :meth:`~object.__eq__`, " "so for non-built-in types the lock may be released during comparison." msgstr "" +"比較操作はすべて、値の比較にも :meth:`~object.__eq__` を使うため、組み込み型" +"でない場合は比較中にロックを解放することがあります。" -#: ../../library/threadsafety.rst:280 msgid "" ":meth:`~dict.fromkeys` locks both the new dictionary and the iterable when " "the iterable is exactly a :class:`dict`, :class:`set`, or :class:`frozenset` " "(not subclasses):" msgstr "" +"イテラブルが :class:`dict`、:class:`set`、:class:`frozenset` そのもの (サブク" +"ラスは除く) である場合、:meth:`~dict.fromkeys` は新しい辞書とそのイテラブルの" +"両方をロックします。" -#: ../../library/threadsafety.rst:284 msgid "" "dict.fromkeys(a_dict) # locks both\n" "dict.fromkeys(a_set) # locks both\n" "dict.fromkeys(a_frozenset) # locks both" msgstr "" +"dict.fromkeys(a_dict) # 両方をロックする\n" +"dict.fromkeys(a_set) # 両方をロックする\n" +"dict.fromkeys(a_frozenset) # 両方をロックする" -#: ../../library/threadsafety.rst:291 msgid "" "When updating from a non-dict iterable, only the target dictionary is " "locked. The iterable may be concurrently modified by another thread:" msgstr "" +"辞書ではないイテラブルから更新する場合、更新先の辞書だけをロックします。\n" +"イテラブルは、ほかのスレッドによって並行して変更される可能性があります。" -#: ../../library/threadsafety.rst:294 msgid "" "d.update(iterable) # iterable is not a dict: only d locked\n" "d |= iterable # iterable is not a dict: only d locked\n" "dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only " "result locked" msgstr "" +"d.update(iterable) # iterable が dict ではない: d だけをロックする\n" +"d |= iterable # iterable が dict ではない: d だけをロックする\n" +"dict.fromkeys(iterable) # iterable が dict/set/frozenset ではない: 結果だけ" +"をロックする" -#: ../../library/threadsafety.rst:301 ../../library/threadsafety.rst:434 -#: ../../library/threadsafety.rst:525 msgid "" "Operations that involve multiple accesses, as well as iteration, are never " "atomic:" msgstr "" +"複数回のアクセスを伴う操作やイテレーションは、アトミックではありません。" -#: ../../library/threadsafety.rst:304 msgid "" "# NOT atomic: read-modify-write\n" "d[key] = d[key] + 1\n" @@ -438,14 +536,24 @@ msgid "" "for key, value in d.items():\n" " process(key) # another thread may modify d" msgstr "" +"# アトミックではない: 読み取り、変更、書き込み\n" +"d[key] = d[key] + 1\n" +"\n" +"# アトミックではない: 確認してから実行 (TOCTOU)\n" +"if key in d:\n" +" del d[key]\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for key, value in d.items():\n" +" process(key) # ほかのスレッドが d を変更する可能性がある" -#: ../../library/threadsafety.rst:318 msgid "" "To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic operations " "or handle exceptions:" msgstr "" +"確認から使用までの間に状態が変わる問題 (TOCTOU: time-of-check to time-of-" +"use) を避けるには、アトミックな操作を使うか、例外を処理してください。" -#: ../../library/threadsafety.rst:321 msgid "" "# Use pop() with default instead of check-then-delete\n" "d.pop(key, None)\n" @@ -456,34 +564,46 @@ msgid "" "except KeyError:\n" " pass" msgstr "" +"# 確認してから削除する代わりに、デフォルト値付きの pop() を使う\n" +"d.pop(key, None)\n" +"\n" +"# または例外を処理する\n" +"try:\n" +" del d[key]\n" +"except KeyError:\n" +" pass" -#: ../../library/threadsafety.rst:333 msgid "" "To safely iterate over a dictionary that may be modified by another thread, " "iterate over a copy:" msgstr "" +"ほかのスレッドによって変更される可能性のある辞書を安全にイテレートするには、" +"コピーをイテレートしてください。" -#: ../../library/threadsafety.rst:336 msgid "" "# Make a copy to iterate safely\n" "for key, value in d.copy().items():\n" " process(key)" msgstr "" +"# 安全にイテレートするためにコピーを作成する\n" +"for key, value in d.copy().items():\n" +" process(key)" -#: ../../library/threadsafety.rst:343 msgid "" "Consider external synchronization when sharing :class:`dict` instances " "across threads." msgstr "" +"スレッド間で :class:`dict` インスタンスを共有する場合は、外部での同期を検討し" +"てください。" -#: ../../library/threadsafety.rst:350 msgid "Thread safety for set objects" -msgstr "" +msgstr "``set`` オブジェクトのスレッドセーフ性" -#: ../../library/threadsafety.rst:352 ../../library/threadsafety.rst:457 msgid "" "The :func:`len` function is lock-free and :term:`atomic `." msgstr "" +":func:`len` 関数はロックフリーで、:term:`アトミック ` で" +"す。" #: ../../library/threadsafety.rst:354 msgid "" @@ -492,9 +612,8 @@ msgid "" "the per-object lock:" msgstr "" -#: ../../library/threadsafety.rst:358 msgid "elem in s # set.__contains__" -msgstr "" +msgstr "elem in s # set.__contains__" #: ../../library/threadsafety.rst:363 msgid "" @@ -505,41 +624,47 @@ msgid "" "lock during comparisons and this is not a concern." msgstr "" -#: ../../library/threadsafety.rst:369 ../../library/threadsafety.rst:470 msgid "All other operations from here on hold the per-object lock." -msgstr "" +msgstr "これ以降のほかの操作はすべて、オブジェクトごとのロックを保持します。" -#: ../../library/threadsafety.rst:371 msgid "" "Adding or removing a single element is safe to call from multiple threads " "and will not corrupt the set:" msgstr "" +"単一の要素の追加や削除は、複数のスレッドから安全に実行でき、集合を破損させま" +"せん。" -#: ../../library/threadsafety.rst:374 msgid "" "s.add(elem) # add element\n" "s.remove(elem) # remove element, raise if missing\n" "s.discard(elem) # remove element if present\n" "s.pop() # remove and return arbitrary element" msgstr "" +"s.add(elem) # 要素を追加する\n" +"s.remove(elem) # 要素を削除し、存在しなければ例外を送出する\n" +"s.discard(elem) # 要素が存在すれば削除する\n" +"s.pop() # 任意の要素を削除して返す" -#: ../../library/threadsafety.rst:382 msgid "" "These operations also compare elements, so the same :meth:`~object.__eq__` " "considerations as above apply." msgstr "" +"これらの操作も要素を比較するため、:meth:`~object.__eq__` についての上記と同じ" +"注意事項が当てはまります。" -#: ../../library/threadsafety.rst:385 msgid "" "The :meth:`~set.copy` method returns a new object and holds the per-object " "lock for the duration so that it is always atomic." msgstr "" +":meth:`~set.copy` メソッドは新しいオブジェクトを返し、処理中ずっとオブジェク" +"トごとのロックを保持するため、常にアトミックです。" -#: ../../library/threadsafety.rst:388 msgid "" "The :meth:`~set.clear` method holds the lock for its duration. Other threads " "cannot observe elements being removed." msgstr "" +":meth:`~set.clear` メソッドは、処理中ずっとロックを保持します。\n" +"ほかのスレッドから、要素が削除されていく途中の状態は観測できません。" #: ../../library/threadsafety.rst:391 msgid "" @@ -547,7 +672,6 @@ msgid "" "operands and always lock both objects:" msgstr "" -#: ../../library/threadsafety.rst:394 msgid "" "s |= other # other must be set/frozenset\n" "s &= other # other must be set/frozenset\n" @@ -558,13 +682,24 @@ msgid "" "s - other # other must be set/frozenset\n" "s ^ other # other must be set/frozenset" msgstr "" +"s |= other # other は set/frozenset でなければならない\n" +"s &= other # other は set/frozenset でなければならない\n" +"s -= other # other は set/frozenset でなければならない\n" +"s ^= other # other は set/frozenset でなければならない\n" +"s & other # other は set/frozenset でなければならない\n" +"s | other # other は set/frozenset でなければならない\n" +"s - other # other は set/frozenset でなければならない\n" +"s ^ other # other は set/frozenset でなければならない" -#: ../../library/threadsafety.rst:406 msgid "" ":meth:`set.update`, :meth:`set.union`, :meth:`set.intersection` and :meth:" "`set.difference` can take multiple iterables as arguments. They all iterate " "through all the passed iterables and do the following:" msgstr "" +":meth:`set.update`、:meth:`set.union`、:meth:`set.intersection`、:meth:`set." +"difference` は、引数として複数のイテラブルを受け取れます。\n" +"これらはいずれも、渡されたすべてのイテラブルをイテレートし、次の処理を行いま" +"す。" #: ../../library/threadsafety.rst:410 msgid ":meth:`set.update` and :meth:`set.union` lock both objects only when" @@ -583,15 +718,14 @@ msgstr "" msgid "all objects." msgstr "" -#: ../../library/threadsafety.rst:415 msgid ":meth:`set.symmetric_difference` tries to lock both objects." msgstr "" +":meth:`set.symmetric_difference` は両方のオブジェクトのロックを試みます。" -#: ../../library/threadsafety.rst:417 msgid "" "The update variants of the above methods also have some differences between " "them:" -msgstr "" +msgstr "上記のメソッドに対応する更新用メソッドにも、次のような違いがあります。" #: ../../library/threadsafety.rst:420 msgid ":meth:`set.difference_update` and :meth:`set.intersection_update` try" @@ -610,18 +744,18 @@ msgstr "" msgid "of type :class:`set`, :class:`frozenset`, or :class:`dict`." msgstr "" -#: ../../library/threadsafety.rst:425 msgid "The following methods always try to lock both objects:" -msgstr "" +msgstr "次のメソッドは、常に両方のオブジェクトのロックを試みます。" -#: ../../library/threadsafety.rst:427 msgid "" "s.isdisjoint(other) # both locked\n" "s.issubset(other) # both locked\n" "s.issuperset(other) # both locked" msgstr "" +"s.isdisjoint(other) # 両方をロックする\n" +"s.issubset(other) # 両方をロックする\n" +"s.issuperset(other) # 両方をロックする" -#: ../../library/threadsafety.rst:437 msgid "" "# NOT atomic: check-then-act\n" "if elem in s:\n" @@ -631,49 +765,62 @@ msgid "" "for elem in s:\n" " process(elem) # another thread may modify s" msgstr "" +"# アトミックではない: 確認してから実行\n" +"if elem in s:\n" +" s.remove(elem)\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for elem in s:\n" +" process(elem) # ほかのスレッドが s を変更する可能性がある" -#: ../../library/threadsafety.rst:448 msgid "" "Consider external synchronization when sharing :class:`set` instances across " "threads. See :ref:`freethreading-python-howto` for more information." msgstr "" +"スレッド間で :class:`set` インスタンスを共有する場合は、外部での同期を検討し" +"てください。\n" +"詳細については、:ref:`freethreading-python-howto` を参照してください。" -#: ../../library/threadsafety.rst:455 msgid "Thread safety for bytearray objects" -msgstr "" +msgstr "``bytearray`` オブジェクトのスレッドセーフ性" -#: ../../library/threadsafety.rst:459 msgid "" "Concatenation and comparisons use the buffer protocol, which prevents " "resizing but does not hold the per-object lock. These operations may observe " "intermediate states from concurrent modifications:" msgstr "" +"結合と比較はバッファプロトコルを使います。\n" +"バッファプロトコルはサイズの変更を防ぎますが、オブジェクトごとのロックは保持" +"しません。\n" +"これらの操作は、並行して行われる変更の途中の状態を観測することがあります。" -#: ../../library/threadsafety.rst:463 msgid "" "ba + other # may observe concurrent writes\n" "ba == other # may observe concurrent writes\n" "ba < other # may observe concurrent writes" msgstr "" +"ba + other # 並行して行われる書き込みを観測する可能性がある\n" +"ba == other # 並行して行われる書き込みを観測する可能性がある\n" +"ba < other # 並行して行われる書き込みを観測する可能性がある" -#: ../../library/threadsafety.rst:472 msgid "" "Reading a single element or slice is safe to call from multiple threads:" msgstr "" +"単一の要素やスライスの読み取りは、複数のスレッドから安全に実行できます。" -#: ../../library/threadsafety.rst:474 msgid "" "ba[i] # bytearray.__getitem__\n" "ba[i:j] # slice" msgstr "" +"ba[i] # bytearray.__getitem__\n" +"ba[i:j] # スライス" -#: ../../library/threadsafety.rst:480 msgid "" "The following operations are safe to call from multiple threads and will not " "corrupt the bytearray:" msgstr "" +"次の操作は複数のスレッドから安全に実行でき、バイト配列を破損させません。" -#: ../../library/threadsafety.rst:483 msgid "" "ba[i] = x # write single byte\n" "ba[i:j] = values # write slice\n" @@ -686,35 +833,45 @@ msgid "" "ba.reverse() # reverse in place\n" "ba.clear() # remove all bytes" msgstr "" +"ba[i] = x # 単一のバイトを書き込む\n" +"ba[i:j] = values # スライスに書き込む\n" +"ba.append(x) # 単一のバイトを末尾に追加する\n" +"ba.extend(other) # イテラブルを使って拡張する\n" +"ba.insert(i, x) # 単一のバイトを挿入する\n" +"ba.pop() # 最後のバイトを削除して返す\n" +"ba.pop(i) # 指定のインデックスのバイトを削除して返す\n" +"ba.remove(x) # 最初に現れた値を削除する\n" +"ba.reverse() # その場で順序を反転する\n" +"ba.clear() # すべてのバイトを削除する" -#: ../../library/threadsafety.rst:497 msgid "" "Slice assignment locks both objects when *values* is a :class:`bytearray`:" msgstr "" +"``values`` が :class:`bytearray` の場合、スライスへの代入は両方のオブジェクト" +"をロックします。" -#: ../../library/threadsafety.rst:499 msgid "ba[i:j] = other_bytearray # both locked" -msgstr "" +msgstr "ba[i:j] = other_bytearray # 両方をロックする" -#: ../../library/threadsafety.rst:504 msgid "" "The following operations return new objects and hold the per-object lock for " "the duration:" msgstr "" +"次の操作は新しいオブジェクトを返し、処理中ずっとオブジェクトごとのロックを保" +"持します。" -#: ../../library/threadsafety.rst:507 msgid "" "ba.copy() # returns a shallow copy\n" "ba * n # repeat into new bytearray" msgstr "" +"ba.copy() # 浅いコピーを返す\n" +"ba * n # 繰り返して新しいバイト配列を作成する" -#: ../../library/threadsafety.rst:513 msgid "The membership test holds the lock for its duration:" -msgstr "" +msgstr "要素が含まれるかどうかの判定では、処理中ずっとロックを保持します。" -#: ../../library/threadsafety.rst:515 msgid "x in ba # bytearray.__contains__" -msgstr "" +msgstr "x in ba # bytearray.__contains__" #: ../../library/threadsafety.rst:520 msgid "" @@ -723,7 +880,6 @@ msgid "" "etc.) hold the per-object lock for their duration." msgstr "" -#: ../../library/threadsafety.rst:528 msgid "" "# NOT atomic: check-then-act\n" "if x in ba:\n" @@ -733,36 +889,50 @@ msgid "" "for byte in ba:\n" " process(byte) # another thread may modify ba" msgstr "" +"# アトミックではない: 確認してから実行\n" +"if x in ba:\n" +" ba.remove(x)\n" +"\n" +"# スレッドセーフではない: 変更中のイテレーション\n" +"for byte in ba:\n" +" process(byte) # ほかのスレッドが ba を変更する可能性がある" -#: ../../library/threadsafety.rst:539 msgid "" "To safely iterate over a bytearray that may be modified by another thread, " "iterate over a copy:" msgstr "" +"ほかのスレッドによって変更される可能性のあるバイト配列を安全にイテレートする" +"には、コピーをイテレートしてください。" -#: ../../library/threadsafety.rst:542 msgid "" "# Make a copy to iterate safely\n" "for byte in ba.copy():\n" " process(byte)" msgstr "" +"# 安全にイテレートするためにコピーを作成する\n" +"for byte in ba.copy():\n" +" process(byte)" -#: ../../library/threadsafety.rst:549 msgid "" "Consider external synchronization when sharing :class:`bytearray` instances " "across threads. See :ref:`freethreading-python-howto` for more information." msgstr "" +"スレッド間で :class:`bytearray` インスタンスを共有する場合は、外部での同期を" +"検討してください。\n" +"詳細については、:ref:`freethreading-python-howto` を参照してください。" -#: ../../library/threadsafety.rst:556 msgid "Thread safety for memoryview objects" -msgstr "" +msgstr "``memoryview`` オブジェクトのスレッドセーフ性" -#: ../../library/threadsafety.rst:558 msgid "" ":class:`memoryview` objects provide access to the internal data of an " "underlying object without copying. Thread safety depends on both the " "memoryview itself and the underlying buffer exporter." msgstr "" +":class:`memoryview` オブジェクトは、参照先のオブジェクトの内部データに、コ" +"ピーせずにアクセスする手段を提供します。\n" +"スレッドセーフ性は、メモリービュー自体と、参照先のバッファを提供するオブジェ" +"クトの両方によって決まります。" #: ../../library/threadsafety.rst:562 msgid "" @@ -774,20 +944,23 @@ msgid "" "memoryview has not been released." msgstr "" -#: ../../library/threadsafety.rst:569 msgid "" "However, the actual data accessed through the memoryview is owned by the " "underlying object. Concurrent access to this data is only safe if the " "underlying object supports it:" msgstr "" +"ただし、メモリービューを通じてアクセスする実際のデータは、参照先のオブジェク" +"トが所有しています。\n" +"このデータへの並行アクセスが安全なのは、参照先のオブジェクトがそれをサポート" +"している場合だけです。" -#: ../../library/threadsafety.rst:573 msgid "" "For immutable objects like :class:`bytes`, concurrent reads through multiple " "memoryviews are safe." msgstr "" +":class:`bytes` のような不変のオブジェクトでは、複数のメモリービューを通じて並" +"行して読み取っても安全です。" -#: ../../library/threadsafety.rst:576 msgid "" "For mutable objects like :class:`bytearray`, reading and writing the same " "memory region from multiple threads without external synchronization is not " @@ -795,8 +968,13 @@ msgid "" "of mutable objects do not prevent data races if the underlying object is " "modified from another thread." msgstr "" +":class:`bytearray` のような可変のオブジェクトでは、外部で同期せずに、複数のス" +"レッドから同じメモリー領域を読み書きするのは安全ではなく、データの破損を引き" +"起こす可能性があります。\n" +"可変のオブジェクトに対する読み取り専用のメモリービューであっても、ほかのス" +"レッドから参照先のオブジェクトが変更されると、データ競合を防げないことに注意" +"してください。" -#: ../../library/threadsafety.rst:583 msgid "" "# NOT safe: concurrent writes to the same buffer\n" "data = bytearray(1000)\n" @@ -804,8 +982,12 @@ msgid "" "# Thread 1: view[0:500] = b'x' * 500\n" "# Thread 2: view[0:500] = b'y' * 500" msgstr "" +"# 安全ではない: 同じバッファへの並行書き込み\n" +"data = bytearray(1000)\n" +"view = memoryview(data)\n" +"# スレッド 1: view[0:500] = b'x' * 500\n" +"# スレッド 2: view[0:500] = b'y' * 500" -#: ../../library/threadsafety.rst:592 msgid "" "# Safe: use a lock for concurrent access\n" "import threading\n" @@ -816,10 +998,21 @@ msgid "" "with lock:\n" " view[0:500] = b'x' * 500" msgstr "" +"# 安全: 並行アクセスにはロックを使う\n" +"import threading\n" +"lock = threading.Lock()\n" +"data = bytearray(1000)\n" +"view = memoryview(data)\n" +"\n" +"with lock:\n" +" view[0:500] = b'x' * 500" -#: ../../library/threadsafety.rst:604 msgid "" "Resizing or reallocating the underlying object (such as calling :meth:" "`bytearray.resize`) while a memoryview is exported raises :exc:" "`BufferError`. This is enforced regardless of threading." msgstr "" +"メモリービューによってバッファが公開されている間に、参照先のオブジェクトのサ" +"イズを変更したり、メモリーを再割り当てしたりすると (:meth:`bytearray.resize` " +"の呼び出しなど)、:exc:`BufferError` が送出されます。\n" +"これは、スレッドの使用に関係なく適用されます。" diff --git a/library/time-complexity.po b/library/time-complexity.po index acb3b8b58..a58e2465e 100644 --- a/library/time-complexity.po +++ b/library/time-complexity.po @@ -22,29 +22,34 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/time-complexity.rst:5 msgid "Time complexity of operations on built-in types" -msgstr "" +msgstr "組み込み型の操作の時間計算量" -#: ../../library/time-complexity.rst:7 msgid "" "This page documents the time complexity of various operations on built-in " "types in CPython. Other Python implementations may have different " "performance characteristics. Additionally, the listed costs assume exact " "built-in types, as instances of subclasses may have different costs." msgstr "" +"このページでは、CPython の組み込み型に対するさまざまな操作の時間計算量を説明" +"します。\n" +"ほかの Python 実装では、性能の特性が異なる場合があります。\n" +"また、サブクラスのインスタンスではコストが異なる場合があるため、ここに示すコ" +"ストは組み込み型そのものを前提としています。" -#: ../../library/time-complexity.rst:12 msgid "" "We use |big O notation|_ to describe how the running time of an operation " "grows with the size of its inputs. Unless stated otherwise, *n* denotes the " "number of elements currently in the container, and *k* is the value of a " "numeric parameter, such as an index or a repeat count." msgstr "" +"|big O notation|_ を使って、入力のサイズに応じて操作の実行時間がどのように増" +"加するかを説明します。\n" +"特に断りのない限り、*n* は現在コンテナに含まれる要素の数を表し、*k* はイン" +"デックスや繰り返し回数などの数値引数の値を表します。" -#: ../../library/time-complexity.rst:22 msgid ":class:`!list`" -msgstr "" +msgstr ":class:`!list`" #: ../../library/time-complexity.rst:24 msgid "" @@ -63,204 +68,142 @@ msgstr "" msgid "Operation" msgstr "演算" -#: ../../library/time-complexity.rst:35 ../../library/time-complexity.rst:86 -#: ../../library/time-complexity.rst:125 ../../library/time-complexity.rst:160 -#: ../../library/time-complexity.rst:203 ../../library/time-complexity.rst:236 -#: ../../library/time-complexity.rst:263 msgid "Complexity" -msgstr "" +msgstr "計算量" -#: ../../library/time-complexity.rst:36 msgid "Copy (``l.copy()``)" -msgstr "" +msgstr "コピー (``l.copy()``)" -#: ../../library/time-complexity.rst:37 ../../library/time-complexity.rst:51 -#: ../../library/time-complexity.rst:68 ../../library/time-complexity.rst:70 -#: ../../library/time-complexity.rst:98 ../../library/time-complexity.rst:100 -#: ../../library/time-complexity.rst:102 ../../library/time-complexity.rst:129 -#: ../../library/time-complexity.rst:139 ../../library/time-complexity.rst:164 -#: ../../library/time-complexity.rst:213 ../../library/time-complexity.rst:217 -#: ../../library/time-complexity.rst:219 ../../library/time-complexity.rst:244 -#: ../../library/time-complexity.rst:246 ../../library/time-complexity.rst:248 -#: ../../library/time-complexity.rst:273 ../../library/time-complexity.rst:275 msgid "*O*\\ (*n*)" -msgstr "" +msgstr "*O*\\ (*n*)" -#: ../../library/time-complexity.rst:38 msgid "Append (``l.append(x)``) [1]_" -msgstr "" +msgstr "末尾への追加 (``l.append(x)``) [1]_" -#: ../../library/time-complexity.rst:39 ../../library/time-complexity.rst:45 -#: ../../library/time-complexity.rst:47 ../../library/time-complexity.rst:72 -#: ../../library/time-complexity.rst:88 ../../library/time-complexity.rst:90 -#: ../../library/time-complexity.rst:104 ../../library/time-complexity.rst:127 -#: ../../library/time-complexity.rst:131 ../../library/time-complexity.rst:133 -#: ../../library/time-complexity.rst:135 ../../library/time-complexity.rst:141 -#: ../../library/time-complexity.rst:162 ../../library/time-complexity.rst:166 -#: ../../library/time-complexity.rst:168 ../../library/time-complexity.rst:186 -#: ../../library/time-complexity.rst:205 ../../library/time-complexity.rst:221 -#: ../../library/time-complexity.rst:238 ../../library/time-complexity.rst:240 -#: ../../library/time-complexity.rst:242 ../../library/time-complexity.rst:250 -#: ../../library/time-complexity.rst:265 ../../library/time-complexity.rst:267 -#: ../../library/time-complexity.rst:269 ../../library/time-complexity.rst:271 -#: ../../library/time-complexity.rst:277 msgid "*O*\\ (1)" -msgstr "" +msgstr "*O*\\ (1)" -#: ../../library/time-complexity.rst:40 msgid "Pop (``l.pop(k)``) [1]_ [2]_" -msgstr "" +msgstr "取り出して削除 (``l.pop(k)``) [1]_ [2]_" -#: ../../library/time-complexity.rst:41 ../../library/time-complexity.rst:43 -#: ../../library/time-complexity.rst:49 msgid "*O*\\ (*n* - *k*)" -msgstr "" +msgstr "*O*\\ (*n* - *k*)" -#: ../../library/time-complexity.rst:42 msgid "Insert (``l.insert(k, x)``) [1]_ [2]_" -msgstr "" +msgstr "挿入 (``l.insert(k, x)``) [1]_ [2]_" -#: ../../library/time-complexity.rst:44 msgid "Get item (``l[k]``)" -msgstr "" +msgstr "要素の取得 (``l[k]``)" -#: ../../library/time-complexity.rst:46 msgid "Set item (``l[k] = x``)" -msgstr "" +msgstr "要素の設定 (``l[k] = x``)" -#: ../../library/time-complexity.rst:48 msgid "Delete item (``del l[k]``) [2]_" -msgstr "" +msgstr "要素の削除 (``del l[k]``) [2]_" #: ../../library/time-complexity.rst:50 ../../library/time-complexity.rst:97 #: ../../library/time-complexity.rst:218 ../../library/time-complexity.rst:272 msgid "Iteration" msgstr "イテレーション" -#: ../../library/time-complexity.rst:52 msgid "Get slice (``l[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``l[i:j]``)" -#: ../../library/time-complexity.rst:53 ../../library/time-complexity.rst:92 -#: ../../library/time-complexity.rst:207 msgid "*O*\\ (*j* - *i*)" -msgstr "" +msgstr "*O*\\ (*j* - *i*)" -#: ../../library/time-complexity.rst:54 msgid "Set slice (``l[i:j] = t``) [1]_" -msgstr "" +msgstr "スライスへの代入 (``l[i:j] = t``) [1]_" -#: ../../library/time-complexity.rst:55 msgid "" "*O*\\ (*j* - *i*) if len(*t*) == *j* - *i*, otherwise *O*\\ (*n* - *i* + " "len(*t*))" msgstr "" +"len(*t*) == *j* - *i* の場合は *O*\\ (*j* - *i*)、それ以外の場合は *O*\\ " +"(*n* - *i* + len(*t*))" -#: ../../library/time-complexity.rst:57 msgid "Delete slice (``del l[i:j]``)" -msgstr "" +msgstr "スライスの削除 (``del l[i:j]``)" -#: ../../library/time-complexity.rst:58 msgid "*O*\\ (*n* - *i*)" -msgstr "" +msgstr "*O*\\ (*n* - *i*)" -#: ../../library/time-complexity.rst:59 msgid "Extend (``l.extend(t)``) [1]_ [3]_" -msgstr "" +msgstr "拡張 (``l.extend(t)``) [1]_ [3]_" -#: ../../library/time-complexity.rst:60 ../../library/time-complexity.rst:137 msgid "*O*\\ (len(*t*))" -msgstr "" +msgstr "*O*\\ (len(*t*))" -#: ../../library/time-complexity.rst:61 msgid "Sort (``l.sort()``) [4]_" -msgstr "" +msgstr "ソート (``l.sort()``) [4]_" -#: ../../library/time-complexity.rst:62 msgid "*O*\\ (*n* log *n*)" -msgstr "" +msgstr "*O*\\ (*n* log *n*)" -#: ../../library/time-complexity.rst:63 msgid "Concatenate (``l1 + l2``)" -msgstr "" +msgstr "結合 (``l1 + l2``)" -#: ../../library/time-complexity.rst:64 msgid "*O*\\ (len(*l1*) + len(*l2*))" -msgstr "" +msgstr "*O*\\ (len(*l1*) + len(*l2*))" -#: ../../library/time-complexity.rst:65 msgid "Multiply (``l * k``)" -msgstr "" +msgstr "繰り返し (``l * k``)" -#: ../../library/time-complexity.rst:66 ../../library/time-complexity.rst:96 -#: ../../library/time-complexity.rst:211 msgid "*O*\\ (*nk*)" -msgstr "" +msgstr "*O*\\ (*nk*)" -#: ../../library/time-complexity.rst:67 msgid "``x in l``" -msgstr "" +msgstr "``x in l``" -#: ../../library/time-complexity.rst:69 msgid "``min(l)``, ``max(l)``" -msgstr "" +msgstr "``min(l)``, ``max(l)``" -#: ../../library/time-complexity.rst:71 msgid "Get length (``len(l)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(l)``) [5]_" -#: ../../library/time-complexity.rst:76 msgid ":class:`!tuple`" -msgstr "" +msgstr ":class:`!tuple`" -#: ../../library/time-complexity.rst:78 msgid "" "A :class:`tuple` is an :term:`immutable` sequence. Because a tuple can never " "change, there are no insertion or deletion costs, and making a copy simply " "returns the same object, so is constant time (*O*\\ (1))." msgstr "" +":class:`tuple` は :term:`不変の ` シーケンスです。\n" +"タプルは変更できないため、挿入や削除のコストはありません。\n" +"また、コピーの作成では同じオブジェクトを返すだけなので、定数時間 (*O*\\ (1)) " +"で済みます。" -#: ../../library/time-complexity.rst:87 msgid "Copy (``tuple(t)``)" -msgstr "" +msgstr "コピー (``tuple(t)``)" -#: ../../library/time-complexity.rst:89 msgid "Get item (``t[k]``)" -msgstr "" +msgstr "要素の取得 (``t[k]``)" -#: ../../library/time-complexity.rst:91 msgid "Get slice (``t[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``t[i:j]``)" -#: ../../library/time-complexity.rst:93 msgid "Concatenate (``t1 + t2``)" -msgstr "" +msgstr "結合 (``t1 + t2``)" -#: ../../library/time-complexity.rst:94 msgid "*O*\\ (len(*t1*) + len(*t2*))" -msgstr "" +msgstr "*O*\\ (len(*t1*) + len(*t2*))" -#: ../../library/time-complexity.rst:95 msgid "Multiply (``t * k``)" -msgstr "" +msgstr "繰り返し (``t * k``)" -#: ../../library/time-complexity.rst:99 msgid "``x in t``" -msgstr "" +msgstr "``x in t``" -#: ../../library/time-complexity.rst:101 msgid "``min(t)``, ``max(t)``" -msgstr "" +msgstr "``min(t)``, ``max(t)``" -#: ../../library/time-complexity.rst:103 msgid "Get length (``len(t)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(t)``) [5]_" -#: ../../library/time-complexity.rst:108 msgid ":class:`!dict`, :class:`!frozendict`" -msgstr "" +msgstr ":class:`!dict`, :class:`!frozendict`" -#: ../../library/time-complexity.rst:110 msgid "" "The times listed for dict objects are average-case times, as they assume the " "hash function for the objects is sufficiently robust to make collisions " @@ -270,145 +213,140 @@ msgid "" "also assume that hashing and comparing a key is *O*\\ (1). For more detail " "on the implementation, see :ref:`how-are-dictionaries-implemented`." msgstr "" +"``dict`` オブジェクトについて示す時間は、平均的な場合の時間です。\n" +"オブジェクトのハッシュ関数が十分に堅牢で、衝突がめったに起こらないことを前提" +"としているためです。\n" +"また、取り得るキーの集合の中で、キーが偏りなく分布していることも前提としてい" +"ます。\n" +"すべてのキーが同じハッシュ値を持つ最悪の場合には、以下で *O*\\ (1) と示す各操" +"作に *O*\\ (*n*) の時間がかかります。\n" +"さらに、キーのハッシュ値の計算と比較が *O*\\ (1) であることも前提としていま" +"す。\n" +"実装の詳細については、:ref:`how-are-dictionaries-implemented` を参照してくだ" +"さい。" -#: ../../library/time-complexity.rst:118 msgid "" "A :class:`frozendict` is immutable, so it does not support setting, " "deleting, or updating items. The other operations below apply to it at the " "same costs." msgstr "" +":class:`frozendict` は不変なので、要素の設定、削除、更新をサポートしませ" +"ん。\n" +"以下のほかの操作は、同じコストで適用できます。" -#: ../../library/time-complexity.rst:126 msgid "``key in d``" -msgstr "" +msgstr "``key in d``" -#: ../../library/time-complexity.rst:128 msgid "Copy (``d.copy()``) [6]_ [7]_" -msgstr "" +msgstr "コピー (``d.copy()``) [6]_ [7]_" -#: ../../library/time-complexity.rst:130 msgid "Get item (``d[key]``, ``d.get(key)``)" -msgstr "" +msgstr "要素の取得 (``d[key]``, ``d.get(key)``)" -#: ../../library/time-complexity.rst:132 msgid "Set item (``d[key] = value``) [1]_" -msgstr "" +msgstr "要素の設定 (``d[key] = value``) [1]_" -#: ../../library/time-complexity.rst:134 msgid "Delete item (``del d[key]``, ``d.pop(key)``)" -msgstr "" +msgstr "要素の削除 (``del d[key]``, ``d.pop(key)``)" -#: ../../library/time-complexity.rst:136 msgid "Update (``d.update(t)``, ``d |= t``) [1]_ [3]_ [7]_" -msgstr "" +msgstr "更新 (``d.update(t)``, ``d |= t``) [1]_ [3]_ [7]_" -#: ../../library/time-complexity.rst:138 msgid "Iteration [7]_" -msgstr "" +msgstr "イテレーション [7]_" -#: ../../library/time-complexity.rst:140 msgid "Get length (``len(d)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(d)``) [5]_" -#: ../../library/time-complexity.rst:145 msgid ":class:`!set`, :class:`!frozenset`" -msgstr "" +msgstr ":class:`!set`, :class:`!frozenset`" -#: ../../library/time-complexity.rst:147 msgid "" "See :class:`dict` as the :class:`set` and :class:`frozenset` implementations " "are similar, and the same caveats apply. In the worst case, *O*\\ (1) " "operations instead take *O*\\ (*n*) time, and operations that look up every " "element degrade accordingly." msgstr "" +":class:`set` と :class:`frozenset` の実装は辞書と似ていて、同じ注意事項が当て" +"はまるため、:class:`dict` の説明を参照してください。\n" +"最悪の場合、*O*\\ (1) の操作に *O*\\ (*n*) の時間がかかり、すべての要素を検索" +"する操作の性能もそれに応じて低下します。" -#: ../../library/time-complexity.rst:152 msgid "" "A :class:`frozenset` is :term:`immutable`, so it does not support adding, " "discarding, or the in-place update operations. The others below apply to it " "at the same costs." msgstr "" +":class:`frozenset` は :term:`不変 ` なので、要素の追加や除去、イン" +"プレースの更新操作をサポートしません。\n" +"以下のほかの操作は、同じコストで適用できます。" #: ../../library/time-complexity.rst:161 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/time-complexity.rst:163 msgid "Copy (``s.copy()``) [6]_ [7]_" -msgstr "" +msgstr "コピー (``s.copy()``) [6]_ [7]_" -#: ../../library/time-complexity.rst:165 msgid "Add (``s.add(x)``) [1]_" -msgstr "" +msgstr "追加 (``s.add(x)``) [1]_" -#: ../../library/time-complexity.rst:167 msgid "Discard (``s.discard(x)``, ``s.remove(x)``)" -msgstr "" +msgstr "除去 (``s.discard(x)``, ``s.remove(x)``)" -#: ../../library/time-complexity.rst:169 msgid "Union (``s1 | s2``, ``s1.union(s2)``) [7]_" -msgstr "" +msgstr "和集合 (``s1 | s2``, ``s1.union(s2)``) [7]_" -#: ../../library/time-complexity.rst:170 ../../library/time-complexity.rst:182 msgid "*O*\\ (len(*s1*) + len(*s2*))" -msgstr "" +msgstr "*O*\\ (len(*s1*) + len(*s2*))" -#: ../../library/time-complexity.rst:171 msgid "Update (``s1 |= s2``, ``s1.update(s2)``) [1]_ [7]_" -msgstr "" +msgstr "更新 (``s1 |= s2``, ``s1.update(s2)``) [1]_ [7]_" -#: ../../library/time-complexity.rst:172 ../../library/time-complexity.rst:184 msgid "*O*\\ (len(*s2*))" -msgstr "" +msgstr "*O*\\ (len(*s2*))" -#: ../../library/time-complexity.rst:173 msgid "Intersection (``s1 & s2``, ``s1.intersection(s2)``) [7]_ [8]_" -msgstr "" +msgstr "共通集合 (``s1 & s2``, ``s1.intersection(s2)``) [7]_ [8]_" -#: ../../library/time-complexity.rst:174 ../../library/time-complexity.rst:176 -#: ../../library/time-complexity.rst:180 msgid "*O*\\ (min(len(*s1*), len(*s2*)))" -msgstr "" +msgstr "*O*\\ (min(len(*s1*), len(*s2*)))" -#: ../../library/time-complexity.rst:175 msgid "" "Intersection update (``s1 &= s2``, ``s1.intersection_update(s2)``) [1]_ [7]_ " "[8]_" msgstr "" +"共通集合による更新 (``s1 &= s2``, ``s1.intersection_update(s2)``) [1]_ [7]_ " +"[8]_" -#: ../../library/time-complexity.rst:177 msgid "Difference (``s1 - s2``, ``s1.difference(s2)``) [7]_ [9]_" -msgstr "" +msgstr "差集合 (``s1 - s2``, ``s1.difference(s2)``) [7]_ [9]_" -#: ../../library/time-complexity.rst:178 msgid "*O*\\ (len(*s1*))" -msgstr "" +msgstr "*O*\\ (len(*s1*))" -#: ../../library/time-complexity.rst:179 msgid "" "Difference update (``s1 -= s2``, ``s1.difference_update(s2)``) [1]_ [7]_ [8]_" msgstr "" +"差集合による更新 (``s1 -= s2``, ``s1.difference_update(s2)``) [1]_ [7]_ [8]_" -#: ../../library/time-complexity.rst:181 msgid "" "Symmetric difference (``s1 ^ s2``, ``s1.symmetric_difference(s2)``) [7]_" -msgstr "" +msgstr "対称差 (``s1 ^ s2``, ``s1.symmetric_difference(s2)``) [7]_" -#: ../../library/time-complexity.rst:183 msgid "" "Symmetric difference update (``s1 ^= s2``, ``s1." "symmetric_difference_update(s2)``) [1]_ [7]_" msgstr "" +"対称差による更新 (``s1 ^= s2``, ``s1.symmetric_difference_update(s2)``) [1]_ " +"[7]_" -#: ../../library/time-complexity.rst:185 ../../library/time-complexity.rst:220 msgid "Get length (``len(s)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(s)``) [5]_" -#: ../../library/time-complexity.rst:190 msgid ":class:`!str`, :class:`!bytes`, :class:`!bytearray`" -msgstr "" +msgstr ":class:`!str`, :class:`!bytes`, :class:`!bytearray`" -#: ../../library/time-complexity.rst:192 msgid "" ":class:`str` and :class:`bytes` objects are immutable sequences of " "characters and bytes, respectively. As with tuples, copying one returns the " @@ -418,130 +356,121 @@ msgid "" "k]``) only advances the start of the buffer instead of moving the remaining " "bytes, and is amortized *O*\\ (1)." msgstr "" +":class:`str` と :class:`bytes` のオブジェクトは、それぞれ文字とバイトからなる" +"不変のシーケンスです。\n" +"タプルと同様に、コピーすると元のオブジェクトが返されます。\n" +":class:`bytearray` は可変で、:class:`list` の変更操作 (:meth:`!sort` を除く) " +"も同じコストでサポートします。\n" +"ただし、``del`` で先頭の要素を削除する場合 (``del b[0]``、``del b[:k]``) は、" +"残りのバイトを移動せず、バッファの開始位置を進めるだけなので、償却計算量は " +"*O*\\ (1) です。" -#: ../../library/time-complexity.rst:204 msgid "Get item (``s[k]``)" -msgstr "" +msgstr "要素の取得 (``s[k]``)" -#: ../../library/time-complexity.rst:206 msgid "Get slice (``s[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``s[i:j]``)" -#: ../../library/time-complexity.rst:208 msgid "Concatenate (``s + t``) [10]_" -msgstr "" +msgstr "結合 (``s + t``) [10]_" -#: ../../library/time-complexity.rst:209 msgid "*O*\\ (len(*s*) + len(*t*))" -msgstr "" +msgstr "*O*\\ (len(*s*) + len(*t*))" -#: ../../library/time-complexity.rst:210 msgid "Multiply (``s * k``)" -msgstr "" +msgstr "繰り返し (``s * k``)" -#: ../../library/time-complexity.rst:212 msgid "Substring search (``x in s``, ``s.find(x)``, ``s.index(x)``) [11]_" -msgstr "" +msgstr "部分文字列の検索 (``x in s``, ``s.find(x)``, ``s.index(x)``) [11]_" -#: ../../library/time-complexity.rst:214 msgid "Reverse substring search (``s.rfind(x)``, ``s.rindex(x)``) [11]_ [12]_" -msgstr "" +msgstr "逆方向の部分文字列の検索 (``s.rfind(x)``, ``s.rindex(x)``) [11]_ [12]_" -#: ../../library/time-complexity.rst:215 msgid "*O*\\ (*n* × len(*x*))" -msgstr "" +msgstr "*O*\\ (*n* × len(*x*))" -#: ../../library/time-complexity.rst:216 msgid "Encode or decode [13]_" -msgstr "" +msgstr "エンコードまたはデコード [13]_" -#: ../../library/time-complexity.rst:225 msgid ":class:`!memoryview`" -msgstr "" +msgstr ":class:`!memoryview`" -#: ../../library/time-complexity.rst:227 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying. In particular, slicing a memory view returns a new view onto the " "same buffer." msgstr "" +":class:`memoryview` オブジェクトを使うと、Python コードから :ref:`バッファプ" +"ロトコル ` をサポートするオブジェクトの内部データに、コピーせ" +"ずにアクセスできます。\n" +"特に、メモリービューのスライスは、同じバッファを参照する新しいビューを返しま" +"す。" -#: ../../library/time-complexity.rst:237 msgid "Create (``memoryview(obj)``)" -msgstr "" +msgstr "作成 (``memoryview(obj)``)" -#: ../../library/time-complexity.rst:239 msgid "Get item (``v[k]``)" -msgstr "" +msgstr "要素の取得 (``v[k]``)" -#: ../../library/time-complexity.rst:241 msgid "Get slice (``v[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``v[i:j]``)" -#: ../../library/time-complexity.rst:243 msgid "Index (``v.index(x)``) [11]_ [14]_" -msgstr "" +msgstr "インデックスの検索 (``v.index(x)``) [11]_ [14]_" -#: ../../library/time-complexity.rst:245 msgid "Count (``v.count(x)``) [14]_" -msgstr "" +msgstr "出現回数の取得 (``v.count(x)``) [14]_" -#: ../../library/time-complexity.rst:247 msgid "Convert to bytes (``v.tobytes()``, ``bytes(v)``)" -msgstr "" +msgstr "バイト列への変換 (``v.tobytes()``, ``bytes(v)``)" -#: ../../library/time-complexity.rst:249 msgid "Get length (``len(v)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(v)``) [5]_" -#: ../../library/time-complexity.rst:254 msgid ":class:`!range`" -msgstr "" +msgstr ":class:`!range`" -#: ../../library/time-complexity.rst:256 msgid "" "A :class:`range` object computes its items on demand from its *start*, " "*stop* and *step* values, so most operations do not depend on the length of " "the range." msgstr "" +":class:`range` オブジェクトは、``start``、``stop``、``step`` の値から必要に応" +"じて要素を計算するため、ほとんどの操作は範囲の長さに依存しません。" -#: ../../library/time-complexity.rst:264 msgid "Get item (``r[k]``)" -msgstr "" +msgstr "要素の取得 (``r[k]``)" -#: ../../library/time-complexity.rst:266 msgid "Get slice (``r[i:j]``)" -msgstr "" +msgstr "スライスの取得 (``r[i:j]``)" -#: ../../library/time-complexity.rst:268 msgid "``x in r`` [15]_" -msgstr "" +msgstr "``x in r`` [15]_" -#: ../../library/time-complexity.rst:270 msgid "Index and count (``r.index(x)``, ``r.count(x)``) [15]_" -msgstr "" +msgstr "インデックスと出現回数の取得 (``r.index(x)``, ``r.count(x)``) [15]_" -#: ../../library/time-complexity.rst:274 msgid "``min(r)``, ``max(r)``" -msgstr "" +msgstr "``min(r)``, ``max(r)``" -#: ../../library/time-complexity.rst:276 msgid "Get length (``len(r)``) [5]_" -msgstr "" +msgstr "長さの取得 (``len(r)``) [5]_" #: ../../library/time-complexity.rst:281 msgid "Notes" msgstr "注釈" -#: ../../library/time-complexity.rst:283 msgid "" "Amortized. An individual operation may occasionally be *O*\\ (*n*) when the " "underlying storage is resized, but this cost is spread over many operations, " "depending on the history of the container." msgstr "" +"償却計算量です。\n" +"内部の記憶領域のサイズを変更するときに、個々の操作が *O*\\ (*n*) になることが" +"ありますが、コンテナに対してそれまでに行った操作に応じて、このコストは多数の" +"操作に分散されます。" -#: ../../library/time-complexity.rst:287 msgid "" "Popping or deleting the element at index *k* of a list of size *n* shifts " "all elements after *k* one slot to the left, moving *n* - *k* - 1 elements; " @@ -551,31 +480,47 @@ msgid "" "of the list, takes *O*\\ (*n*/2) = *O*\\ (*n*) operations; and operating at " "the end of the list moves nothing and is *O*\\ (1)." msgstr "" +"要素数 *n* のリストで、インデックス *k* の要素を取り出して削除するか、単に削" +"除すると、*k* より後のすべての要素が 1 要素分ずつ左にずれ、*n* - *k* - 1 個の" +"要素が移動します。\n" +"インデックス *k* に挿入すると、*k* 以降の要素が 1 要素分ずつ右にずれ、*n* - " +"*k* 個の要素が移動します。\n" +"最悪の場合はインデックスが 0 のときで、リストの残りの要素すべてを移動しなけれ" +"ばなりません。\n" +"平均的な場合はリストの中央のインデックスで、*O*\\ (*n*/2) = *O*\\ (*n*) の操" +"作が必要です。\n" +"リストの末尾で操作する場合は何も移動せず、*O*\\ (1) です。" -#: ../../library/time-complexity.rst:296 msgid "" "Plus the cost of iterating over *t*, which may be expensive for an arbitrary " "iterable." msgstr "" +"これに加えて、*t* をイテレートするコストがかかります。\n" +"任意のイテラブルでは、このコストが高くなる場合があります。" -#: ../../library/time-complexity.rst:299 msgid "" "This is the worst case scenario. Sorting is adaptive and input that is " "already sorted or reverse-sorted takes only *O*\\ (*n*) comparisons. See :" "source:`Objects/listsort.txt` for more information." msgstr "" +"これは最悪の場合です。\n" +"ソートは入力の状態に適応するため、すでにソート済み、または逆順にソート済みの" +"入力では、比較は *O*\\ (*n*) 回で済みます。\n" +"詳細については、:source:`Objects/listsort.txt` を参照してください。" -#: ../../library/time-complexity.rst:303 msgid "" "The number of elements is stored in the object, so ``len()`` does not need " "to count them." msgstr "" +"要素数はオブジェクトに格納されているため、``len()`` が要素を数える必要はあり" +"ません。" -#: ../../library/time-complexity.rst:306 msgid "" "Copying a :class:`frozendict` or a :class:`frozenset` is *O*\\ (1) as it " "returns the original object." msgstr "" +":class:`frozendict` または :class:`frozenset` のコピーは元のオブジェクトを返" +"すため、*O*\\ (1) です。" #: ../../library/time-complexity.rst:309 msgid "" @@ -585,21 +530,23 @@ msgid "" "insertion triggers a resize." msgstr "" -#: ../../library/time-complexity.rst:314 msgid "*O*\\ (len(*t*)) if *t* is not a set." -msgstr "" +msgstr "*t* が集合型のオブジェクトでない場合は *O*\\ (len(*t*)) です。" -#: ../../library/time-complexity.rst:316 msgid "*O*\\ (len(*s*) + len(*t*)) if *t* is not a set." msgstr "" +"*t* が集合型のオブジェクトでない場合は *O*\\ (len(*s*) + len(*t*)) です。" -#: ../../library/time-complexity.rst:318 msgid "" "Each concatenation builds a new object, so building a string by " "concatenating many pieces in a loop is quadratic in the total length. See " "the :ref:`note on concatenating immutable sequences ` for alternatives." msgstr "" +"結合のたびに新しいオブジェクトが作成されるため、ループ内で多数の断片を結合し" +"て文字列を構築すると、実行時間は全体の長さの二乗に比例します。\n" +"ほかの方法については、:ref:`不変のシーケンスの結合に関する注記 ` を参照してください。" #: ../../library/time-complexity.rst:323 msgid "" @@ -607,26 +554,33 @@ msgid "" "rather than of *s*, and unlike slicing nothing is copied." msgstr "" -#: ../../library/time-complexity.rst:326 msgid "" "This is the worst case. Reverse searches are *O*\\ (*n*) on typical input. " "Forward searches instead use a more elaborate algorithm with a linear worst " "case, described in :source:`Objects/stringlib/stringlib_find_two_way_notes." "txt`." msgstr "" +"これは最悪の場合です。\n" +"通常の入力では、逆方向の検索は *O*\\ (*n*) です。\n" +"一方、順方向の検索は、最悪の場合でも線形時間となる、より精巧なアルゴリズムを" +"使います。\n" +"このアルゴリズムは :source:`Objects/stringlib/stringlib_find_two_way_notes." +"txt` で説明しています。" -#: ../../library/time-complexity.rst:331 msgid "This assumes a codec that does a constant amount of work per character." -msgstr "" +msgstr "1 文字ごとに一定量の処理を行うコーデックを前提としています。" -#: ../../library/time-complexity.rst:333 msgid "" "These unpack and compare each element individually, so they are much slower " "than the equivalent :class:`bytes` methods." msgstr "" +"これらの操作は各要素を個別にアンパックして比較するため、対応する :class:" +"`bytes` のメソッドよりはるかに遅くなります。" -#: ../../library/time-complexity.rst:336 msgid "" "Assuming :class:`int` or :class:`bool` arguments. For other types, the range " "is searched like any other sequence in *O*\\ (*n*) time." msgstr "" +"引数が :class:`int` または :class:`bool` であることを前提としています。\n" +"ほかの型の場合は、ほかのシーケンスと同様に、``range`` オブジェクト内を *O*\\ " +"(*n*) の時間で検索します。" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 56272725b..5b5e2685a 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -1758,9 +1758,8 @@ msgstr ":class:`dict`" msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1175 msgid ":class:`frozendict`" -msgstr "" +msgstr ":class:`frozendict`" #: ../../reference/compound_stmts.rst:1176 msgid ":class:`frozenset`" diff --git a/reference/datamodel.po b/reference/datamodel.po index 7ab02fd24..2bf7c148f 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -753,9 +753,8 @@ msgstr "" "は挿入順序は保持されましたが、それは策定された言語の仕様というより、その当時" "の実装の細部とみなされていました。" -#: ../../reference/datamodel.rst:539 msgid "Frozen dictionaries" -msgstr "" +msgstr "凍結辞書" #: ../../reference/datamodel.rst:543 msgid "" @@ -4706,10 +4705,11 @@ msgstr "" "は :class:`~numbers.Integral` (たいていは :class:`int`) に切り詰められたオブ" "ジェクトの値を返すべきです。" -#: ../../reference/datamodel.rst:3556 msgid "" ":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." msgstr "" +":func:`int` は :meth:`~object.__trunc__` メソッドに処理を委譲しなくなりまし" +"た。" #: ../../reference/datamodel.rst:3563 msgid "With Statement Context Managers" @@ -5229,11 +5229,12 @@ msgstr "" "meth:`~object.__await__` の返り値に対して反復処理を行ったときと同じです。\n" "例外がコルーチンの中で捕捉されなかった場合、呼び出し元へ伝搬されます。" -#: ../../reference/datamodel.rst:3907 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" +"2番目のシグネチャ \\(type\\[, value\\[, traceback\\]\\]\\) は非推奨となり、将" +"来のバージョンの Python で削除される可能性があります。" #: ../../reference/datamodel.rst:3912 msgid "" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 4827ba408..7647cc117 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -1591,21 +1591,22 @@ msgstr "" msgid "f-strings" msgstr "f-strings" -#: ../../reference/lexical_analysis.rst:1047 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" +"f-string 内の式で :keyword:`await` と :keyword:`async for` を使えるようになり" +"ました。" -#: ../../reference/lexical_analysis.rst:1050 msgid "Added the debug specifier (``=``)" -msgstr "" +msgstr "デバッグ指定子 (``=``) を追加しました" -#: ../../reference/lexical_analysis.rst:1052 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" +"f-string 内の式に対する多くの制限が取り除かれました。\n" +"特に、文字列の入れ子、コメント、バックスラッシュが使えるようになりました。" #: ../../reference/lexical_analysis.rst:1056 msgid "" @@ -1748,13 +1749,13 @@ msgid "" "whitespace on one or both sides;" msgstr "" -#: ../../reference/lexical_analysis.rst:1148 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" +"*変換指定子* である ``!s``、``!r``、``!a`` のいずれか。\n" +"これと次の書式指定子は、どちらか一方または両方を指定できます。" -#: ../../reference/lexical_analysis.rst:1149 msgid "a *format specifier* prefixed with a colon (``:``)." -msgstr "" +msgstr "コロン (``:``) を先頭に付けた *書式指定子*。" #: ../../reference/lexical_analysis.rst:1151 msgid "" @@ -2547,9 +2548,8 @@ msgstr "" msgid "{} (curly brackets)" msgstr "{} (波括弧)" -#: ../../reference/lexical_analysis.rst:1026 msgid "in formatted string literal" -msgstr "" +msgstr "フォーマット済み文字列リテラル内" #: ../../reference/lexical_analysis.rst:1026 msgid "! (exclamation)" @@ -2563,9 +2563,8 @@ msgstr ": (コロン)" msgid "= (equals)" msgstr "= (等号)" -#: ../../reference/lexical_analysis.rst:1026 msgid "for help in debugging using string literals" -msgstr "" +msgstr "文字列リテラルを使ったデバッグの補助" #: ../../reference/lexical_analysis.rst:1308 msgid "number" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index cea2abbe2..9c0b8f602 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -1271,11 +1271,12 @@ msgstr "" msgid "Type hints can now be written in a more succinct manner::" msgstr "" -#: ../../whatsnew/3.10.rst:737 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" msgstr "" +"def square(number: int | float) -> int | float:\n" +" return number ** 2" #: ../../whatsnew/3.10.rst:741 msgid "" From b26693dbc1a31056f700452121e3cf892fb05146 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 26 Oct 2026 07:18:28 +0000 Subject: [PATCH 15/21] Merge 3.15 into 3.14 --- library/__future__.po | 5 +- library/_thread.po | 6 +- library/argparse.po | 7 +- library/ast.po | 17 +- library/asyncio-eventloop.po | 30 ++-- library/asyncio-llapi-index.po | 3 +- library/asyncio-protocol.po | 40 +++-- library/asyncio-queue.po | 10 +- library/asyncio-stream.po | 14 +- library/asyncio-task.po | 34 ++-- library/atexit.po | 13 +- library/bdb.po | 11 +- library/binascii.po | 28 +-- library/bisect.po | 3 +- library/bz2.po | 14 +- library/calendar.po | 17 +- library/cmd.po | 5 +- library/code.po | 34 ++-- library/codecs.po | 36 ++-- library/codeop.po | 22 ++- library/collections.abc.po | 15 +- library/collections.po | 80 ++++----- library/compileall.po | 18 +- library/compression.zstd.po | 3 +- library/concurrent.futures.po | 24 ++- library/configparser.po | 25 +-- library/contextlib.po | 19 +- library/contextvars.po | 3 +- library/copy.po | 5 +- library/csv.po | 24 +-- library/ctypes.po | 46 +++-- library/curses.po | 66 +++---- library/dataclasses.po | 14 +- library/datetime.po | 148 +++++++-------- library/debug.po | 12 +- library/decimal.po | 103 ++++++----- library/difflib.po | 70 ++++---- library/doctest.po | 81 ++++----- library/email.charset.po | 18 +- library/email.compat32-message.po | 59 +++--- library/email.header.po | 40 ++--- library/email.headerregistry.po | 22 +-- library/email.message.po | 17 +- library/email.mime.po | 15 +- library/email.parser.po | 23 +-- library/email.policy.po | 21 +-- library/email.utils.po | 15 +- library/ensurepip.po | 20 +-- library/enum.po | 27 ++- library/errno.po | 5 +- library/faulthandler.po | 25 ++- library/fcntl.po | 5 +- library/filecmp.po | 3 +- library/fileinput.po | 8 +- library/fnmatch.po | 12 +- library/ftplib.po | 56 +++--- library/functional.po | 5 +- library/functools.po | 60 +++---- library/gc.po | 23 ++- library/getpass.po | 24 ++- library/gettext.po | 22 ++- library/graphlib.po | 3 +- library/gzip.po | 16 +- library/hashlib.po | 5 +- library/heapq.po | 71 ++++---- library/hmac.po | 22 +-- library/html.parser.po | 23 ++- library/html.po | 11 +- library/http.client.po | 14 +- library/http.cookiejar.po | 59 +++--- library/http.cookies.po | 43 +++-- library/http.server.po | 3 +- library/idle.po | 54 +++--- library/imaplib.po | 49 +++-- library/importlib.metadata.po | 17 +- library/importlib.po | 95 +++++----- library/importlib.resources.po | 10 +- library/inspect.po | 77 ++++---- library/io.po | 75 ++++---- library/ipaddress.po | 29 +-- library/itertools.po | 30 ++-- library/json.po | 41 ++--- library/locale.po | 75 ++++---- library/logging.config.po | 65 +++---- library/logging.handlers.po | 152 ++++++++-------- library/logging.po | 193 ++++++++++---------- library/lzma.po | 52 +++--- library/mailbox.po | 88 ++++----- library/math.po | 49 +++-- library/mmap.po | 8 +- library/modulefinder.po | 19 +- library/multiprocessing.po | 290 ++++++++++++++---------------- library/netrc.po | 11 +- library/numbers.po | 6 +- library/operator.po | 3 +- library/optparse.po | 31 ++-- library/os.path.po | 21 ++- library/os.po | 189 ++++++++++--------- library/pathlib.po | 51 +++--- library/pdb.po | 26 ++- library/pickle.po | 91 +++++----- library/pickletools.po | 27 +-- library/pkgutil.po | 8 +- library/platform.po | 13 +- library/poplib.po | 58 +++--- library/posix.po | 7 +- library/pprint.po | 47 ++--- library/profile.po | 40 ++--- library/pty.po | 12 +- library/py_compile.po | 9 +- library/pyexpat.po | 56 +++--- library/queue.po | 4 +- library/random.po | 44 ++--- library/re.po | 85 +++++---- library/resource.po | 5 +- library/sched.po | 45 +++-- library/secrets.po | 5 +- library/select.po | 51 +++--- library/selectors.po | 49 +++-- library/shelve.po | 8 +- library/shlex.po | 12 +- library/shutil.po | 41 ++--- library/signal.po | 53 +++--- library/smtplib.po | 111 ++++++------ library/socket.po | 123 +++++++------ library/socketserver.po | 15 +- library/sqlite3.po | 154 ++++++++-------- library/ssl.po | 54 +++--- library/statistics.po | 7 +- library/textwrap.po | 12 +- library/threading.po | 17 +- library/tkinter.ttk.po | 5 +- library/unittest.po | 11 +- library/urllib.error.po | 15 +- library/urllib.request.po | 29 +-- library/weakref.po | 52 +++--- library/xml.dom.po | 15 +- library/xml.sax.reader.po | 16 +- library/zipfile.po | 21 ++- library/zlib.po | 10 +- 140 files changed, 2465 insertions(+), 2678 deletions(-) diff --git a/library/__future__.po b/library/__future__.po index 2b8d573e1..ada1f1f55 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -202,13 +202,12 @@ msgid "" " CompilerFlag)" msgstr "" -#: ../../library/__future__.rst:98 msgid "" "where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " "are 5-tuples of the same form as :data:`sys.version_info`::" msgstr "" -"ここで、普通は、 *OptionalRelease* は *MandatoryRelease* より小さく、2つと" -"も :data:`sys.version_info` と同じフォーマットの5つのタプルからなります::" +"通常、*OptionalRelease* は *MandatoryRelease* より小さく、どちらも :data:" +"`sys.version_info` と同じ形式の 5 要素のタプルです。 ::" #: ../../library/__future__.rst:101 msgid "" diff --git a/library/_thread.po b/library/_thread.po index bad37566e..771431a1c 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -284,13 +284,13 @@ msgstr "" "ロックを解放します。そのロックは既に獲得されたものでなければなりませんが、し" "かし同じスレッドによって獲得されたものである必要はありません。" -#: ../../library/_thread.rst:208 msgid "" "Return the status of the lock: ``True`` if it has been acquired by some " "thread, ``False`` if not." msgstr "" -"ロックの状態を返します: 同じスレッドによって獲得されたものなら ``True`` 、違" -"うのなら ``False`` を返します。" +"ロックの状態を返します。\n" +"いずれかのスレッドがロックを獲得していれば ``True``、そうでなければ " +"``False`` を返します。" #: ../../library/_thread.rst:211 msgid "" diff --git a/library/argparse.po b/library/argparse.po index 1c08816f8..b49366da3 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -486,15 +486,14 @@ msgid "" "Namespace(bar='YYY', parent=None)" msgstr "" -#: ../../library/argparse.rst:281 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " "parent and one in the child) and raise an error." msgstr "" -"一番親になるパーサーに ``add_help=False`` を指定していることに注目してくださ" -"い。こうしないと、:class:`ArgumentParser` は2つの ``-h/--help`` オプションを" -"与えられる (1つは親から、もうひとつは子から) ことになり、エラーを発生します。" +"多くの親パーサーでは ``add_help=False`` を指定します。\n" +"そうしないと、:class:`ArgumentParser` は親と子に一つずつ、計二つの ``-h/--" +"help`` オプションを検出してエラーを発生させます。" #: ../../library/argparse.rst:286 msgid "" diff --git a/library/ast.po b/library/ast.po index 5851e437e..94e5d43d7 100644 --- a/library/ast.po +++ b/library/ast.po @@ -822,14 +822,13 @@ msgstr "" "ト を順序が一致した形で (それぞれ :code:`dictionary.keys()` と :code:" "`dictionary.values()` を呼び出したときに返される順序で) 保持します。" -#: ../../library/ast.rst:454 msgid "" "When doing dictionary unpacking using dictionary literals the expression to " "be expanded goes in the ``values`` list, with a ``None`` at the " "corresponding position in ``keys``." msgstr "" -"辞書リテラルを使って辞書を展開した場合、展開された式ツリーにおいて辞書は " -"``values`` リストに入り、 ``keys`` の対応する位置には ``None`` が入ります。" +"辞書リテラルで辞書のアンパックを行う場合、展開対象の式が ``values`` リストに" +"入り、``keys`` の対応する位置には ``None`` が入ります。" #: ../../library/ast.rst:458 msgid "" @@ -2951,15 +2950,14 @@ msgstr "" ":class:`ast.AST` オブジェクトを逆に構文解析して、 :func:`ast.parse` が元の :" "class:`ast.AST` と等価なオブジェクトを生成できるような文字列を生成します。" -#: ../../library/ast.rst:2305 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -"生成されたコード文字列は、生成元のコードである :class:`ast.AST` オブジェクト" -"と必ずしも等価であるとは限りません (定数タプルや frozenset などに対するコンパ" -"イラ最適化なしのコードです)。" +":class:`ast.AST` オブジェクトの生成元となったコードと、生成されたコード文字列" +"が一致するとは限りません (定数タプルや frozenset などに対するコンパイラ最適化" +"を行わない場合でも同様です)。" #: ../../library/ast.rst:2310 msgid "" @@ -3226,14 +3224,13 @@ msgid "" "NodeVisitor.generic_visit` method for the node first." msgstr "" -#: ../../library/ast.rst:2487 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -"文のコレクションであるようなノード (全ての文のノードが当てはまります) に対し" -"て、このビジターは単独のノードではなくノードのリストを返すかもしれません。" +"文のコレクションの要素であるノード (すべての文ノードが該当します) に対して" +"は、ビジターは単一のノードの代わりにノードのリストを返すこともできます。" #: ../../library/ast.rst:2491 msgid "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 9ebd842c3..261749a4b 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -27,13 +27,12 @@ msgstr "" msgid "Event loop" msgstr "" -#: ../../library/asyncio-eventloop.rst:10 msgid "" "**Source code:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/" "base_events.py`" msgstr "" -"**ソースコード:** :source:`Lib/asyncio/profile.py` と :source:`Lib/asyncio/" -"pstats.py`" +"**ソースコード:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/" +"base_events.py`" #: ../../library/asyncio-eventloop.rst:16 msgid "Preface" @@ -1065,15 +1064,14 @@ msgid "" "exc:`OSError` with :attr:`!errno.WSAEINVAL` will be raised when running it." msgstr "" -#: ../../library/asyncio-eventloop.rst:637 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -"*remote_addr* が指定される場合、``(remote_host, remote_por)`` のタプルで、ソ" -"ケットをリモートアドレスに束縛するために使用されます。*remote_host* と " -"*remote_port* は :meth:`getaddrinfo` を使用して検索されます。" +"*remote_addr* を指定する場合は、ソケットをリモートアドレスに接続するための " +"``(remote_host, remote_port)`` タプルを渡します。\n" +"*remote_host* と *remote_port* は :meth:`getaddrinfo` を使って検索されます。" #: ../../library/asyncio-eventloop.rst:641 msgid "" @@ -1931,9 +1929,8 @@ msgstr "" msgid "Working with pipes" msgstr "パイプとやりとりする" -#: ../../library/asyncio-eventloop.rst:1276 msgid "Register the read end of *pipe* in the event loop." -msgstr "イベントループの読み込み側終端に *pipe* を登録します。" +msgstr "*pipe* の読み込み側の終端をイベントループに登録します。" #: ../../library/asyncio-eventloop.rst:1281 #: ../../library/asyncio-eventloop.rst:1300 @@ -1952,14 +1949,12 @@ msgstr "" "`ReadTransport` のインターフェースをサポートし、 *protocol* は " "*protocol_factory* ファクトリでインスタンス化されたオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1289 -#: ../../library/asyncio-eventloop.rst:1308 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -":class:`SelectorEventLoop` イベントループの場合、*pipe* は非ブロックモードに" -"設定されていなければなりません。" +":class:`SelectorEventLoop` イベントループでは、*pipe* が非ブロックモードに設" +"定されます。" #: ../../library/asyncio-eventloop.rst:1295 msgid "Register the write end of *pipe* in the event loop." @@ -2044,17 +2039,16 @@ msgid "" "positional arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1359 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " "registered using :func:`signal.signal`, a callback registered with this " "function is allowed to interact with the event loop." msgstr "" -"コールバックは *loop*、登録された他のコールバック、およびイベントループの実行" -"可能なコルーチンから呼び出されます。 :func:`signal.signal` を使って登録された" -"シグナルハンドラと異なり、この関数で登録されたコールバックはイベントループと" -"相互作用することが可能です。" +"このコールバックは、キューに入っている他のコールバックや実行可能なコルーチン" +"とともに、イベントループ *loop* によって呼び出されます。\n" +":func:`signal.signal` で登録したシグナルハンドラとは異なり、この関数で登録し" +"たコールバックはイベントループとやりとりできます。" #: ../../library/asyncio-eventloop.rst:1364 msgid "" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index b7655b874..b9b3a9e8b 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -175,9 +175,8 @@ msgstr "コールバックのスケジューリング" msgid ":meth:`loop.call_soon`" msgstr ":meth:`loop.call_soon`" -#: ../../library/asyncio-llapi-index.rst:87 msgid "Invoke a callback soon." -msgstr "コールバックを即座に実行します。" +msgstr "コールバックがまもなく実行されるようにスケジュールします。" #: ../../library/asyncio-llapi-index.rst:89 msgid ":meth:`loop.call_soon_threadsafe`" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index cc2d7e092..6cf362390 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -564,7 +564,6 @@ msgstr "" "が *low* の値以下になると :meth:`~BaseProtocol.resume_writing` メソッドが呼び" "出されます。" -#: ../../library/asyncio-protocol.rst:315 msgid "" "The defaults are implementation-specific. If only the high watermark is " "given, the low watermark defaults to an implementation-specific value less " @@ -575,13 +574,16 @@ msgid "" "Use of zero for either limit is generally sub-optimal as it reduces " "opportunities for doing I/O and computation concurrently." msgstr "" -"デフォルト値は実装固有になります。 *high* のみ与えられた場合、 *low* は " -"*high* 以下の実装固有のデフォルト値になります。 *high* をゼロに設定すると " -"*low* も強制的にゼロになり、バッファーが空でなくなるとすぐに :meth:" -"`~BaseProtocol.pause_writing` メソッドが呼び出されるようになります。 *low* を" -"ゼロに設定すると、バッファーが空にな :meth:`~BaseProtocol.resume_writing` が" -"呼び出されるようになります。どちらかにゼロを設定することは I/O と計算を並行に" -"実行する機会を減少させるため、一般に最適ではありません。" +"デフォルト値は実装固有になります。\n" +"*high* のみ与えられた場合、 *low* は *high* 以下の実装固有のデフォルト値にな" +"ります。\n" +"*high* をゼロに設定すると *low* も強制的にゼロになり、バッファーが空でなくな" +"るとすぐに :meth:`~BaseProtocol.pause_writing` メソッドが呼び出されるようにな" +"ります。\n" +"*low* をゼロに設定すると、バッファーが空になって初めて :meth:`~BaseProtocol." +"resume_writing` が呼び出されるようになります。\n" +"どちらかにゼロを設定することは I/O と計算を並行に実行する機会を減少させるた" +"め、一般に最適ではありません。" #: ../../library/asyncio-protocol.rst:326 msgid "Use :meth:`~WriteTransport.get_write_buffer_limits` to get the limits." @@ -852,9 +854,10 @@ msgid "" "successful connection. All other protocol callbacks can only be called " "between those two methods." msgstr "" -"コネクションコールバックは全てのプロトコルから、成功したコネクションそれぞれ" -"につきただ一度だけ呼び出されます。その他の全てのプロトコルコールバックはこれ" -"ら2つのメソッドの間に呼び出すことができます。" +"コネクションコールバックはすべてのプロトコルに対して、成功した接続ごとにそれ" +"ぞれ一度だけ呼び出されます。\n" +"他のプロトコルコールバックは、これら二つのメソッドの呼び出しの間にのみ呼び出" +"されます。" #: ../../library/asyncio-protocol.rst:498 msgid "Called when a connection is made." @@ -923,16 +926,15 @@ msgstr "" "pause_writing` は呼び出されません: バッファーサイズは必ず制限値を超えなければ" "なりません。" -#: ../../library/asyncio-protocol.rst:533 msgid "" "Conversely, :meth:`~BaseProtocol.resume_writing` is called when the buffer " "size is equal or lower than the low watermark. These end conditions are " "important to ensure that things go as expected when either mark is zero." msgstr "" "それに対して、 :meth:`~BaseProtocol.resume_writing` はバッファーサイズが最低" -"水位点と等しいかそれよりも小さい場合に呼び出されます。これらの境界条件は、ど" -"ちらの基準値もゼロである場合の処理が期待通りとなることを保証するために重要で" -"す。" +"水位点と等しいかそれよりも小さい場合に呼び出されます。\n" +"これらの境界条件は、どちらかの基準値がゼロである場合の処理が期待通りとなるこ" +"とを保証するために重要です。" #: ../../library/asyncio-protocol.rst:540 msgid "Streaming Protocols" @@ -1174,15 +1176,15 @@ msgstr "" "どの場合、データグラムが配信できなければそのまま通知されることなく破棄されま" "す。" -#: ../../library/asyncio-protocol.rst:677 msgid "" "On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for " "datagram protocols, because there is no reliable way to detect send failures " "caused by writing too many packets." msgstr "" -"BSD システム (macOS, FreeBSD など) ではフロー制御はサポートされていません。こ" -"れは非常に多くのパケットを書き込もうとしたことによる送信の失敗を検出する信頼" -"できる方法が存在しないためです。" +"BSD システム (macOS, FreeBSD など) ではデータグラムプロトコルのフロー制御はサ" +"ポートされていません。\n" +"これは非常に多くのパケットを書き込もうとしたことによる送信の失敗を検出する信" +"頼できる方法が存在しないためです。" #: ../../library/asyncio-protocol.rst:681 msgid "" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 78e38861a..b64e9fa39 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -121,12 +121,11 @@ msgid "" "if the queue has been shut down immediately." msgstr "" -#: ../../library/asyncio-queue.rst:71 msgid "" "Return an item if one is immediately available, else raise :exc:`QueueEmpty`." msgstr "" -"直ちに利用できるアイテムがあるときはそれを、そうでなければ :exc:`QueueEmpty` " -"を返します。" +"直ちに利用できる要素がある場合はその要素を返し、そうでなければ :exc:" +"`QueueEmpty` を送出します。" #: ../../library/asyncio-queue.rst:74 msgid "" @@ -241,13 +240,12 @@ msgstr "" "`~Queue.put` でキューに追加された全アイテムの :meth:`task_done` の呼び出しを" "受信したとき) に再開します。" -#: ../../library/asyncio-queue.rst:153 msgid "" "Raises :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "" -"キューに追加されているアイテム数以上の呼び出しが行われたときに :exc:" -"`ValueError` を送出します。" +"呼び出し回数がキューに追加されたアイテムの総数を超えると :exc:`ValueError` を" +"送出します。" #: ../../library/asyncio-queue.rst:158 msgid "Priority Queue" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 01462083a..bd5a16783 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -264,9 +264,8 @@ msgstr "" "*StreamReader* オブジェクトを直接インスタンス化することは推奨されません; 代わ" "りに :func:`open_connection` や :func:`start_server` を使ってください。" -#: ../../library/asyncio-stream.rst:224 msgid "Acknowledge the EOF." -msgstr "EOF の肯定応答を行います。" +msgstr "EOF に達したことをストリームに通知します。" #: ../../library/asyncio-stream.rst:229 msgid "Read up to *n* bytes from the stream." @@ -496,7 +495,6 @@ msgid "" "await writer.drain()" msgstr "" -#: ../../library/asyncio-stream.rst:378 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -504,11 +502,11 @@ msgid "" "writing can be resumed. When there is nothing to wait for, the :meth:" "`drain` returns immediately." msgstr "" -"このメソッドは背後にある IO 書き込みバッファーとやりとりを行うフロー制御メ" -"ソッドです。バッファーのサイズが最高水位点に達した場合、*drain()* はバッファ" -"のサイズが最低水位点を下回るまで減量され、書き込み再開可能になるまで書き込み" -"をブロックします。待ち受けの必要がない場合、 :meth:`drain` は即座にリターンし" -"ます。" +"このメソッドは背後にある IO 書き込みバッファとやりとりを行うフロー制御メソッ" +"ドです。\n" +"バッファのサイズが最高水位点に達すると、*drain()* はサイズが最低水位点まで減" +"り、書き込みを再開できるようになるまで待機します。\n" +"待つ必要がない場合、:meth:`drain` はすぐに返ります。" #: ../../library/asyncio-stream.rst:387 msgid "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index fab3e587a..a0e072754 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -1014,7 +1014,6 @@ msgstr "は、以下と同じです ::" msgid "res = await something()" msgstr "" -#: ../../library/asyncio-task.rst:687 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -1022,11 +1021,11 @@ msgid "" "still cancelled, so the \"await\" expression still raises a :exc:" "`CancelledError`." msgstr "" -"それを含むコルーチンがキャンセルされた場合を *除き*、``something()`` 内で動作" -"している Task はキャンセルされません。\n" -"``something()`` 側から見るとキャンセルは発生しません。\n" -"呼び出し元がキャンセルされた場合でも、 \"await\" 式は :exc:`CancelledError` " -"を送出します。" +"ただし、これを含むコルーチンがキャンセルされても、``something()`` を実行して" +"いる Task はキャンセルされない *という違いがあります*。\n" +"``something()`` 側から見ると、キャンセルは発生していません。\n" +"呼び出し元はキャンセルされるため、\"await\" 式は :exc:`CancelledError` を送出" +"します。" #: ../../library/asyncio-task.rst:693 msgid "" @@ -1751,7 +1750,6 @@ msgstr "" "Task が Future の完了を待っているときは、イベントループは他の Task やコール" "バックを動作させるか、 IO 処理を実行します。" -#: ../../library/asyncio-task.rst:1228 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " @@ -1760,7 +1758,7 @@ msgstr "" "Task を作成するには高レベルの :func:`asyncio.create_task` 関数、あるいは低レ" "ベルの :meth:`loop.create_task` 関数や :func:`ensure_future` 関数を使用してく" "ださい。\n" -"手作業での Task の実装は推奨されません。" +"Task を直接インスタンス化することは推奨されません。" #: ../../library/asyncio-task.rst:1233 msgid "" @@ -1770,16 +1768,14 @@ msgid "" "cancellation, the awaited object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1238 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -":meth:`cancelled` は、タスクがキャンセルされたかを調べるのに使用できます。タ" -"スクを内包するコルーチンで :exc:`CancelledError` 例外が抑制されておらず、かつ" -"タスクが実際にキャンセルされている場合に、このメソッドは ``True`` を変えま" -"す。" +":meth:`cancelled` を使うと Task がキャンセルされたかどうかを確認できます。\n" +"Task が内包するコルーチンが :exc:`CancelledError` 例外を抑制せず、実際にキャ" +"ンセルされた場合、このメソッドは ``True`` を返します。" #: ../../library/asyncio-task.rst:1243 msgid "" @@ -1937,7 +1933,6 @@ msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" "サスペンドされているコルーチンの場合スタックフレームが 1 個だけ返されます。" -#: ../../library/asyncio-task.rst:1345 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1945,11 +1940,12 @@ msgid "" "newest frames of a stack are returned, but the oldest frames of a traceback " "are returned. (This matches the behavior of the traceback module.)" msgstr "" -"オプション引数 *limit* は返すフレームの最大数を指定します; デフォルトでは取得" -"可能な全てのフレームを返します。返されるリストの順番は、スタックが返される" -"か、トレースバックが返されるかによって変わります: スタックでは新しい順に並ん" -"だリストが返されますが、トレースバックでは古い順に並んだリストが返されます" -"(これは traceback モジュールの振る舞いと一致します)。" +"省略可能な *limit* 引数は返すフレーム数の上限を指定します。\n" +"デフォルトでは取得可能なすべてのフレームを返します。\n" +"返されるリストの順序は、スタックとトレースバックのどちらを返すかによって異な" +"ります。\n" +"スタックの場合は最も新しいフレーム群、トレースバックの場合は最も古いフレーム" +"群が返されます (これは traceback モジュールの動作と一致します)。" #: ../../library/asyncio-task.rst:1354 msgid "Print the stack or traceback for this Task." diff --git a/library/atexit.po b/library/atexit.po index 91fc7b342..7cbdcc678 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -135,16 +135,16 @@ msgstr "" msgid ":mod:`!atexit` Example" msgstr "" -#: ../../library/atexit.rst:91 msgid "" "The following simple example demonstrates how a module can initialize a " "counter from a file when it is imported and save the counter's updated value " "automatically when the program terminates without relying on the application " "making an explicit call into this module at termination. ::" msgstr "" -"次の簡単な例では、あるモジュールを import した時にカウンタを初期化しておき、" -"プログラムが終了するときにアプリケーションがこのモジュールを明示的に呼び出さ" -"なくてもカウンタが更新されるようにする方法を示しています。 ::" +"次の簡単な例では、モジュールのインポート時にファイルからカウンタの値を読み込" +"んで初期化し、プログラムの終了時に更新後の値を自動保存する方法を示します。\n" +"アプリケーションが終了時にこのモジュールを明示的に呼び出す必要はありませ" +"ん。 ::" #: ../../library/atexit.rst:96 msgid "" @@ -200,8 +200,5 @@ msgid "" " print('You are now leaving the Python sector.')" msgstr "" -#: ../../library/atexit.rst:134 msgid "This only works with functions that can be called without arguments." -msgstr "" -"デコレータとして利用できるのは、その関数が引数なしで呼び出された場合に限られ" -"ます。" +msgstr "デコレータとして利用できるのは、引数なしで呼び出せる関数に限られます。" diff --git a/library/bdb.po b/library/bdb.po index d32ce6982..6876d90f8 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -56,18 +56,17 @@ msgstr "" "このクラスはテンポラリブレークポイント、無視するカウント、無効化と再有効化、" "条件付きブレークポイントを実装しています。" -#: ../../library/bdb.rst:28 msgid "" "Breakpoints are indexed by number through a list called :attr:`bpbynumber` " "and by ``(file, line)`` pairs through :attr:`bplist`. The former points to " "a single instance of class :class:`Breakpoint`. The latter points to a list " "of such instances since there may be more than one breakpoint per line." msgstr "" -"ブレークポイントは :attr:`bpbynumber` という名前のリストで番号によりインデッ" -"クスされ、 :attr:`bplist` により ``(file, line)`` の形でインデックスされま" -"す。 ``bpbynumber`` は :class:`Breakpoint` クラスのインスタンスを指していま" -"す。一方 ``bplist`` は、同じ行に複数のブレークポイントが設定される場合がある" -"ので、インスタンスのリストを指しています。" +"ブレークポイントは :attr:`bpbynumber` というリストでは番号を使って、:attr:" +"`bplist` では ``(file, line)`` の組を使って参照します。\n" +"前者では一つの :class:`Breakpoint` インスタンスが得られます。\n" +"同じ行に複数のブレークポイントを設定できるため、後者ではインスタンスのリスト" +"が得られます。" #: ../../library/bdb.rst:33 msgid "" diff --git a/library/binascii.po b/library/binascii.po index f88640335..d2ba363ef 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -56,15 +56,15 @@ msgstr "" msgid "The :mod:`!binascii` module defines the following functions:" msgstr "" -#: ../../library/binascii.rst:36 msgid "" "Convert a single line of uuencoded data back to binary and return the binary " "data. Lines normally contain 45 (binary) bytes, except for the last line. " "Line data may be followed by whitespace." msgstr "" "uuencode された 1 行のデータをバイナリに変換し、変換後のバイナリデータを返し" -"ます。最後の行を除いて、通常 1 行には (バイナリデータで) 45 バイトが含まれま" -"す。入力データの先頭には空白文字が連続していてもかまいません。" +"ます。\n" +"最後の行を除いて、通常 1 行には (バイナリデータで) 45 バイトが含まれます。\n" +"行データの後ろには空白文字が続いていてもかまいません。" #: ../../library/binascii.rst:43 msgid "" @@ -412,7 +412,6 @@ msgstr "" "度に 1 行以上のデータを渡すことができます。オプション引数 *header* が与えられ" "ており、かつその値が真であれば、アンダースコアは空白文字にデコードされます。" -#: ../../library/binascii.rst:295 msgid "" "Convert binary data to a line(s) of ASCII characters in quoted-printable " "encoding. The return value is the converted line(s). If the optional " @@ -425,15 +424,18 @@ msgid "" "might corrupt the binary data stream." msgstr "" "バイナリデータを quoted-printable 形式でエンコードして 1 行から複数行の " -"ASCII 文字列に変換します。変換後の文字列を返します。オプション引数 " -"*quptetabs* が存在し、かつその値が真であれば、全てのタブおよび空白文字もエン" -"コードされます。オプション引数 *istext* が存在し、かつその値が真であれば、改" -"行はエンコードされませんが、行末の空白文字はエンコードされます。オプション引" -"数 *header* が存在し、かつその値が真である場合、空白文字は :rfc:`1522` にした" -"がってアンダースコアにエンコードされます。オプション引数 *header* が存在し、" -"かつその値が偽である場合、改行文字も同様にエンコードされます。そうでない場" -"合、復帰 (linefeed) 文字の変換によってバイナリデータストリームが破損してしま" -"うかもしれません。" +"ASCII 文字列に変換します。\n" +"変換後の文字列を返します。\n" +"オプション引数 *quotetabs* が存在し、かつその値が真であれば、全てのタブおよび" +"空白文字もエンコードされます。\n" +"オプション引数 *istext* が存在し、かつその値が真であれば、改行はエンコードさ" +"れませんが、行末の空白文字はエンコードされます。\n" +"オプション引数 *header* が存在し、かつその値が真である場合、空白文字は :rfc:" +"`1522` にしたがってアンダースコアにエンコードされます。\n" +"オプション引数 *header* が存在し、かつその値が偽である場合、改行文字も同様に" +"エンコードされます。\n" +"そうでない場合、改行 (linefeed) 文字の変換によってバイナリデータストリームが" +"破損してしまうかもしれません。" #: ../../library/binascii.rst:308 msgid "" diff --git a/library/bisect.po b/library/bisect.po index 6d5af59ec..657fca243 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -244,7 +244,6 @@ msgstr "" "使うには厄介であったり、使いにくい場合があります。 以下の5つの関数は、それら" "をソートされたリストの標準的な検索に変換する方法を示しています::" -#: ../../library/bisect.rst:157 msgid "" "def index(a, x):\n" " 'Locate the leftmost value exactly equal to x'\n" @@ -310,7 +309,7 @@ msgstr "" " raise ValueError\n" "\n" "def find_ge(a, x):\n" -" '左端の項目がx以上であることを確認する'\n" +" 'x以上の左端の要素を見つける'\n" " i = bisect_left(a, x)\n" " if i != len(a):\n" " return a[i]\n" diff --git a/library/bz2.po b/library/bz2.po index c1432d952..b10844116 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -389,18 +389,17 @@ msgstr "" "タ展開に使用できます。一度に展開したい場合は、:func:`decompress` 関数を使って" "ください。" -#: ../../library/bz2.rst:231 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " "need to decompress a multi-stream input with :class:`BZ2Decompressor`, you " "must use a new decompressor for each stream." msgstr "" -"このクラスは、:func:`decompress` や :class:`BZ2File` とは異なり、複数の圧縮レ" -"ベルが混在しているデータを透過的に扱うことができません。 :class:" -"`BZ2Decompressor` クラスを用いて、複数のストリームからなるデータを展開する場" -"合は、それぞれのストリームについてデコンプレッサオブジェクトを用意してくださ" -"い。" +"このクラスは、:func:`decompress` や :class:`BZ2File` とは異なり、\n" +"複数の圧縮ストリームを含む入力を透過的に扱うことができません。\n" +":class:`BZ2Decompressor` クラスを用いて、複数のストリームからなるデータを展開" +"する場合は、\n" +"それぞれのストリームについてデコンプレッサオブジェクトを用意してください。" #: ../../library/bz2.rst:238 msgid "" @@ -429,13 +428,12 @@ msgstr "" "``False`` に設定されます。この場合、 :meth:`~.decompress` を次に呼び出すと、" "*data* を ``b''`` として提供し、出力をさらに取得することができます。" -#: ../../library/bz2.rst:251 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -"入力データの全てが圧縮され返された (*max_length* バイトより少ないためか " +"入力データの全てが展開され返された (*max_length* バイトより少ないためか " "*max_length* が負のため) 場合、\n" ":attr:`~.needs_input` 属性は ``True`` になります。" diff --git a/library/calendar.po b/library/calendar.po index 37e35cef1..b77a7fb50 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -289,7 +289,6 @@ msgstr "" msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr ":meth:`formatmonth` で返されるひと月分のカレンダーを出力します。" -#: ../../library/calendar.rst:218 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " @@ -298,11 +297,12 @@ msgid "" "`setfirstweekday` method. The earliest year for which a calendar can be " "generated is platform-dependent." msgstr "" -"*m* 列からなる一年間のカレンダーを複数行の文字列で返します。任意の引数 *w*, " -"*l*, *c* はそれぞれ、日付列の表示幅、各週の行数及び月と月の間のスペースの数を" -"変更するためのものです。 :meth:`setfirstweekday` メソッドでセットされた週の最" -"初の曜日に依存します。カレンダーを出力できる最初の年はプラットフォームに依存" -"します。" +"*m* 列からなる一年間のカレンダーを複数行の文字列で返します。\n" +"任意の引数 *w*, *l*, *c* はそれぞれ、日付列の表示幅、各週の行数及び月と月の間" +"のスペースの数を変更するためのものです。\n" +"コンストラクタで指定された、または :meth:`setfirstweekday` メソッドで設定され" +"た週の最初の曜日に依存します。\n" +"カレンダーを出力できる最初の年はプラットフォームに依存します。" #: ../../library/calendar.rst:228 msgid "" @@ -492,13 +492,12 @@ msgstr "" "*year* が閏年なら :const:`True` を、そうでなければ :const:`False` を返しま" "す。" -#: ../../library/calendar.rst:391 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." msgstr "" -"範囲(*y1* ... *y2*)指定された期間の閏年の回数を返します。ここで *y1* や *y2* " -"は年を表します。" +"*y1* 以上 *y2* 未満の年の範囲に含まれる閏年の数を返します。\n" +"*y1* と *y2* は年を表します。" #: ../../library/calendar.rst:394 msgid "This function works for ranges spanning a century change." diff --git a/library/cmd.po b/library/cmd.po index 4b349fa85..3162b38d1 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -304,13 +304,12 @@ msgstr "" "meth:`cmdloop` 内でチェックされます; これが空でない場合、その要素は、あたかも" "プロンプトから入力されたかのように順に処理されます。" -#: ../../library/cmd.rst:201 msgid "" "A string to issue as an intro or banner. May be overridden by giving the :" "meth:`cmdloop` method an argument." msgstr "" -"イントロあるいはバナーとして表示される文字列。 :meth:`cmdloop` メソッドに引数" -"を与えるために、オーバーライドされるかもしれません。" +"イントロやバナーとして表示する文字列です。\n" +":meth:`cmdloop` メソッドに引数を渡すと、この値を上書きできます。" #: ../../library/cmd.rst:207 msgid "" diff --git a/library/code.po b/library/code.po index cdaeaf7cb..00a2c07b2 100644 --- a/library/code.po +++ b/library/code.po @@ -219,7 +219,6 @@ msgstr "" "る可能性がありますし、常に捕らえることができるとは限りません。呼び出し側はそ" "れを処理するために準備しておくべきです。" -#: ../../library/code.rst:123 msgid "" "Display the syntax error that just occurred. This does not display a stack " "trace because there isn't one for syntax errors. If *filename* is given, it " @@ -227,11 +226,13 @@ msgid "" "Python's parser, because it always uses ``''`` when reading from a " "string. The output is written by the :meth:`write` method." msgstr "" -"起きたばかりの構文エラーを表示します。複数の構文エラーに対して一つあるのでは" -"ないため、これはスタックトレースを表示しません。 *filename* が与えられた場合" -"は、Pythonのパーサが与えるデフォルトのファイル名の代わりに例外の中へ入れられ" -"ます。なぜなら、文字列から読み込んでいるときはパーサは常に ``''`` を" -"使うからです。出力は :meth:`write` メソッドによって書き込まれます。" +"起きたばかりの構文エラーを表示します。\n" +"構文エラーにはスタックトレースがないため、スタックトレースは表示しません。\n" +"*filename* を指定すると、Python のパーサーが提供するデフォルトのファイル名の" +"代わりに、その値を例外に設定します。\n" +"これは、文字列から読み込む場合にパーサーが常に ``''`` を使うためで" +"す。\n" +"出力は :meth:`write` メソッドで書き込まれます。" #: ../../library/code.rst:132 msgid "" @@ -306,7 +307,6 @@ msgstr "バナーの表示を抑制するには、空の文字列を渡してく msgid "Print an exit message when exiting." msgstr "終了時に、終了メッセージを表示します。" -#: ../../library/code.rst:177 msgid "" "Push a line of source text to the interpreter. The line should not have a " "trailing newline; it may have internal newlines. The line is appended to a " @@ -318,14 +318,18 @@ msgid "" "is required, ``False`` if the line was dealt with in some way (this is the " "same as :meth:`!runsource`)." msgstr "" -"ソーステキストの一行をインタープリターへ送ります。その行の末尾に改行がついて" -"いてはいけません。内部に改行を持っているかもしれません。その行はバッファへ追" -"加され、ソースとして連結されたバッファの内容が渡されインタープリターの :meth:" -"`~InteractiveInterpreter.runsource` メソッドが呼び出されます。コマンドが実行" -"されたか、有効であることをこれが示している場合は、バッファはリセットされま" -"す。そうでなければ、コマンドが不完全で、その行が付加された後のままバッファは" -"残されます。さらに入力が必要ならば、戻り値は ``True`` です。その行がある方法" -"で処理されたならば、 ``False`` です(これは :meth:`!runsource` と同じです)。" +"ソーステキストの1行をインタープリターへ送ります。\n" +"``line`` の末尾に改行を含めてはいけませんが、内部には含められます。\n" +"その行はバッファに追加され、バッファの内容を連結したものをソースとして、\n" +"インタープリターの :meth:`~InteractiveInterpreter.runsource` メソッドが呼び出" +"されます。\n" +"この呼び出しの結果が、コマンドが実行されたか無効だったことを示す場合、バッ" +"ファはリセットされます。\n" +"そうでない場合、コマンドは不完全なので、その行を追加した後のバッファがそのま" +"ま保持されます。\n" +"さらに入力が必要な場合は ``True`` を返し、その行が何らかの形で処理された場合" +"は ``False`` を返します\n" +"(これは :meth:`!runsource` と同じです)。" #: ../../library/code.rst:189 msgid "Remove any unhandled source text from the input buffer." diff --git a/library/codecs.po b/library/codecs.po index 1571371e1..e01b48fe4 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -417,17 +417,17 @@ msgid "" "argument) is passed through to the incremental decoder." msgstr "" -#: ../../library/codecs.rst:265 msgid "" "This function requires that the codec accept :class:`bytes` objects to " "decode. Therefore it does not support text-to-text encoders such as " "``rot_13``, although ``rot_13`` may be used equivalently with :func:" "`iterencode`." msgstr "" -"この関数では、コーデックはエンコードする :class:`bytes` オブジェクトを受け付" -"ける必要があります。\n" -"従って、 ``rot_13`` のようなテキストからテキストへのエンコーダが :func:" -"`iterencode` で同等に使えるとしても、この関数ではサポートしていません。" +"この関数では、コーデックはデコードする :class:`bytes` オブジェクトを受け付け" +"る必要があります。\n" +"従って、``rot_13`` のようなテキストからテキストへのエンコーダはサポートしませ" +"んが、\n" +"``rot_13`` は :func:`iterencode` で同じように使えます。" #: ../../library/codecs.rst:273 msgid "" @@ -1299,16 +1299,15 @@ msgid "Decodes data from the stream and returns the resulting object." msgstr "" "ストリームからのデータをデコードし、デコード済のオブジェクトを返します。" -#: ../../library/codecs.rst:834 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -"*chars* 引数は、いくつのデコードされたコードポイントまたはバイト列を返すかを" -"表します。 :func:`read` メソッドは、要求された数以上のデータを返すことはあり" -"ませんが、データがそれより少ない場合には要求された数未満のデータを返す場合が" -"あります。" +"*chars* 引数は、デコードして返すコードポイント数またはバイト数を指定しま" +"す。\n" +":func:`read` メソッドは要求された量を超えるデータを返すことはありません。\n" +"利用できるデータが足りない場合は、それより少ない量を返すことがあります。" #: ../../library/codecs.rst:839 msgid "" @@ -1532,7 +1531,6 @@ msgstr "" "それらは、集合的に :term:`テキストエンコーディング ` と呼ばれ" "ます。" -#: ../../library/codecs.rst:968 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1545,12 +1543,13 @@ msgstr "" "最も単純なテキストエンコーディング (``'latin-1'`` または ``'iso-8859-1'``) で" "は、0--255 の範囲にあるコードポイントを ``0x0``--``0xff`` のバイトにマップし" "ます。\n" -"つまり、この codec では ``U+00FF`` 以上のコードポイントを含む文字列オブジェク" -"トをエンコードすることはできません。\n" +"つまり、この codec では ``U+00FF`` より大きいのコードポイントを含む文字列オブ" +"ジェクトをエンコードすることはできません。\n" "このようなエンコード処理をしようとすると、次のように :exc:" -"`UnicodeEncodeError` が送出されます (エラーメッセージの細かところは異なる場合" -"があります。): ``UnicodeEncodeError: 'latin-1' codec can't encode character " -"'\\u1234' in position 3: ordinal not in range(256)`` 。" +"`UnicodeEncodeError` が送出されます (エラーメッセージの細かいところは異なる場" +"合があります。\n" +"): ``UnicodeEncodeError: 'latin-1' codec can't encode character '\\u1234' in " +"position 3: ordinal not in range(256)`` 。" #: ../../library/codecs.rst:976 msgid "" @@ -1765,7 +1764,6 @@ msgid "" "platforms." msgstr "" -#: ../../library/codecs.rst:1092 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1780,8 +1778,8 @@ msgstr "" "別しない) 別名に対してのみです: utf-8, utf8, latin-1, latin1, iso-8859-1, " "iso8859-1, mbcs (Windows のみ), ascii, us-ascii, utf-16, utf16, utf-32, " "utf32 およびダッシュの代わりにアンダースコアを用いたもの。\n" -"これらのエンコーディングの別のつづりを使用すると実行時間の低下を招くかもしれ" -"ません。" +"これらのエンコーディングの別のつづりを使用すると実行が遅くなることがありま" +"す。" #: ../../library/codecs.rst:1100 msgid "Optimization opportunity recognized for us-ascii." diff --git a/library/codeop.po b/library/codeop.po index 43ef5d6bb..d36aafdd7 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -118,7 +118,6 @@ msgstr "" "えば、バックスラッシュの後ろに改行が2つあって、その後ろにゴミがあるかもしれま" "せん。パーサのAPIがより良くなればすぐに、この挙動は修正されるでしょう。" -#: ../../library/codeop.rst:58 msgid "" "Instances of this class have :meth:`~object.__call__` methods identical in " "signature to the built-in function :func:`compile`, but with the difference " @@ -126,13 +125,12 @@ msgid "" "statement, the instance 'remembers' and compiles all subsequent program " "texts with the statement in force." msgstr "" -"このクラスのインスタンスは組み込み関数 :func:`compile` とシグネチャが一致す" -"る :meth:`~object.__call__` メソッドを持っていますが、インスタンスが :mod:" -"`__future__` 文を含むプログラムテキストをコンパイルする場合は、インスタンスは" -"有効なその文とともに続くすべてのプログラムテキストを'覚えていて'コンパイルす" -"るという違いがあります。" +"このクラスのインスタンスは、組み込み関数 :func:`compile` と同じシグネチャの :" +"meth:`~object.__call__` メソッドを持ちます。\n" +"ただし、:mod:`__future__` 文を含むプログラムテキストをコンパイルすると、その" +"文の指定を記憶し、以後のすべてのプログラムテキストにもその指定を適用してコン" +"パイルします。" -#: ../../library/codeop.rst:67 msgid "" "Instances of this class have :meth:`~object.__call__` methods identical in " "signature to :func:`compile_command`; the difference is that if the instance " @@ -140,8 +138,8 @@ msgid "" "'remembers' and compiles all subsequent program texts with the statement in " "force." msgstr "" -"このクラスのインスタンスは :func:`compile_command` とシグネチャが一致する :" -"meth:`~object.__call__` メソッドを持っています。インスタンスが :mod:" -"`__future__` 文を含むプログラムテキストをコンパイルする場合に、インスタンスは" -"有効なその文とともにそれに続くすべてのプログラムテキストを'覚えていて'コンパ" -"イルするという違いがあります。" +"このクラスのインスタンスは、:func:`compile_command` と同じシグネチャの :meth:" +"`~object.__call__` メソッドを持ちます。\n" +"ただし、:mod:`__future__` 文を含むプログラムテキストをコンパイルすると、その" +"文の指定を記憶し、以後のすべてのプログラムテキストにもその指定を適用してコン" +"パイルします。" diff --git a/library/collections.abc.po b/library/collections.abc.po index 5ec2d5ce6..8437a07e7 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -706,9 +706,10 @@ msgstr "" msgid "See :pep:`PEP 688 <688#current-options>` for more details." msgstr "" -#: ../../library/collections.abc.rst:311 msgid "ABCs for read-only and mutable :ref:`sets `." -msgstr "読み出し専用でミュータブルな :ref:`集合 ` の ABC です。" +msgstr "" +"読み出し専用の :ref:`集合 ` とミュータブルな集合のための ABC で" +"す。" #: ../../library/collections.abc.rst:316 msgid "ABCs for read-only and mutable :term:`mappings `." @@ -731,13 +732,12 @@ msgstr "" ":keyword:`await` で使用できる :term:`awaitable` オブジェクトの ABC です。カス" "タムの実装は、:meth:`~object.__await__` メソッドを提供しなければなりません。" -#: ../../library/collections.abc.rst:331 msgid "" ":term:`Coroutine ` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -":class:`~collections.abc.Coroutine` ABC の :term:`Coroutine ` オブ" -"ジェクトとインスタンスは、すべてこの ABC のインスタンスです。" +":term:`コルーチン ` オブジェクトと :class:`~collections.abc." +"Coroutine` ABC のインスタンスは、いずれもこの ABC のインスタンスです。" #: ../../library/collections.abc.rst:335 msgid "" @@ -772,15 +772,14 @@ msgid "" "to detect them." msgstr "" -#: ../../library/collections.abc.rst:359 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!Coroutine` in type annotations. The variance and order of type parameters " "correspond to those of :class:`Generator`." msgstr "" ":class:`!Coroutine` を型アノテーションで使う方法の詳細は、 :ref:`annotating-" -"generators-and-coroutines` を参照してください。型パラメータの意味と順序は :" -"class:`Generator` と同様です。" +"generators-and-coroutines` を参照してください。\n" +"型パラメータの変性と順序は :class:`Generator` と同様です。" #: ../../library/collections.abc.rst:368 msgid "" diff --git a/library/collections.po b/library/collections.po index 0f3b8f167..a245aa065 100644 --- a/library/collections.po +++ b/library/collections.po @@ -184,17 +184,18 @@ msgstr "" "サブコンテキストを作成するメソッド、最初のマッピング以外のすべてにアクセスす" "るためのプロパティがあります:" -#: ../../library/collections.rst:67 msgid "" "A user updateable list of mappings. The list is ordered from first-searched " "to last-searched. It is the only stored state and can be modified to change " "which mappings are searched. The list should always contain at least one " "mapping." msgstr "" -"マッピングのユーザがアップデートできるリストです。このリストは最初に探される" -"ものから最後に探されるものの順に並んでいます。これが唯一のソートされた状態で" -"あり、変更してマッピングが探される順番を変更できます。このリストは常に一つ以" -"上のマッピングを含んでいなければなりません。" +"ユーザーが更新できるマッピングのリストです。\n" +"マッピングは最初に検索されるものから最後に検索されるものの順に並んでいま" +"す。\n" +"保存される状態はこのリストだけであり、リストを変更すると検索対象のマッピング" +"を変更できます。\n" +"リストには常に少なくとも一つのマッピングが含まれていなければなりません。" #: ../../library/collections.rst:74 msgid "" @@ -542,16 +543,17 @@ msgstr "" "は挿入した順番で返されます。ある要素のカウントが 1 未満なら、 :meth:" "`elements` はそれを無視します。" -#: ../../library/collections.rst:294 msgid "" "Return a list of the *n* most common elements and their counts from the most " "common to the least. If *n* is omitted or ``None``, :meth:`most_common` " "returns *all* elements in the counter. Elements with equal counts are " "ordered in the order first encountered:" msgstr "" -"最も多い *n* 要素を、カウントが多いものから少ないものまで順に並べたリストを返" -"します。 *n* が省略されるか ``None`` であれば、 :meth:`most_common` はカウン" -"タの *すべての* 要素を返します。等しいカウントの要素は挿入順に並べられます:" +"出現回数が多い順に *n* 個の要素とそれぞれのカウントを並べたリストを返しま" +"す。\n" +"*n* が省略されるか ``None`` であれば、 :meth:`most_common` はカウンタの *すべ" +"ての* 要素を返します。\n" +"等しいカウントの要素は挿入順に並べられます:" #: ../../library/collections.rst:306 msgid "" @@ -1123,16 +1125,15 @@ msgid "" " iterators.popleft()" msgstr "" -#: ../../library/collections.rst:709 msgid "" "The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " "slicing and deletion. For example, a pure Python implementation of ``del " "d[n]`` relies on the ``rotate()`` method to position elements to be popped::" msgstr "" -":meth:`~deque.rotate` メソッドは、 :class:`deque` のスライスや削除の機能を提" -"供します。\n" -"例えば、 純粋な Python 実装の ``del d[n]`` は ``rotate()`` メソッドを頼りに、" -"pop される要素の位置を割り出します::" +":meth:`~deque.rotate` メソッドを使うと :class:`deque` のスライスや削除を実装" +"できます。\n" +"例えば、``del d[n]`` を純粋な Python で実装するには、``rotate()`` メソッドで" +"削除対象の要素を取り出せる位置に移動します。 ::" #: ../../library/collections.rst:713 msgid "" @@ -1207,15 +1208,14 @@ msgstr "" "もし :attr:`default_factory` 属性が ``None`` であれば、このメソッドは :exc:" "`KeyError` 例外を、 *key* を引数として発生させます。" -#: ../../library/collections.rst:756 msgid "" "If :attr:`default_factory` is not ``None``, it is called without arguments " "to provide a default value for the given *key*, this value is inserted in " "the dictionary for the *key*, and returned." msgstr "" -"もし :attr:`default_factory` 属性が ``None`` でない場合、このメソッドは引数な" -"しで呼び出され、与えらえた *key* に対応するデフォルト値を提供します。この値" -"は、辞書内に *key* に対応して登録され、最後に返されます。" +":attr:`default_factory` が ``None`` でない場合は、それを引数なしで呼び出して " +"*key* のデフォルト値を取得します。\n" +"この値を辞書に *key* の値として登録し、返します。" #: ../../library/collections.rst:760 msgid "" @@ -1283,7 +1283,6 @@ msgstr "" ":class:`list` を :attr:`~defaultdict.default_factory` とすることで、キー=値ペ" "アのシーケンスをリストの辞書へ簡単にグループ化できます。:" -#: ../../library/collections.rst:801 msgid "" "When each key is encountered for the first time, it is not already in the " "mapping; so an entry is automatically created using the :attr:`~defaultdict." @@ -1294,13 +1293,15 @@ msgid "" "list. This technique is simpler and faster than an equivalent technique " "using :meth:`dict.setdefault`:" msgstr "" -"それぞれのキーが最初に登場したとき、マッピングにはまだ存在しません。そのため" -"エントリは :attr:`~defaultdict.default_factory` 関数が返す空の :class:`list` " -"を使って自動的に作成されます。 :meth:`list.append` 操作は新しいリストに紐付け" -"られます。キーが再度出現した場合には、通常の参照動作が行われます(そのキーに対" -"応するリストが返ります)。そして :meth:`list.append` 操作で別の値をリストに追" -"加します。このテクニックは :meth:`dict.setdefault` を使った等価なものよりシン" -"プルで速いです:" +"それぞれのキーが最初に登場したとき、マッピングにはまだ存在しません。\n" +"そのためエントリは :attr:`~defaultdict.default_factory` 関数が返す空の :" +"class:`list` を使って自動的に作成されます。\n" +":meth:`list.append` 操作は新しいリストに値を追加します。\n" +"キーが再度出現した場合には、通常の参照動作が行われます(そのキーに対応するリス" +"トが返ります)。\n" +"そして :meth:`list.append` 操作で別の値をリストに追加します。\n" +"このテクニックは :meth:`dict.setdefault` を使った等価なものよりシンプルで速い" +"です:" #: ../../library/collections.rst:816 msgid "" @@ -1312,26 +1313,26 @@ msgstr "" "`defaultdict` を(他の言語の bag や multisetのように)要素の数え上げに便利に使" "うことができます:" -#: ../../library/collections.rst:828 msgid "" "When a letter is first encountered, it is missing from the mapping, so the :" "attr:`~defaultdict.default_factory` function calls :func:`int` to supply a " "default count of zero. The increment operation then builds up the count for " "each letter." msgstr "" -"最初に文字が出現したときは、マッピングが存在しないので :attr:`~defaultdict." -"default_factory` 関数が :func:`int` を呼んでデフォルトのカウント0を生成しま" -"す。インクリメント操作が各文字を数え上げます。" +"最初に文字が出現したときは、その文字がマッピングに存在しないので :attr:" +"`~defaultdict.default_factory` 関数が :func:`int` を呼んでデフォルトのカウン" +"ト0を生成します。\n" +"インクリメント操作が各文字を数え上げます。" -#: ../../library/collections.rst:832 msgid "" "The function :func:`int` which always returns zero is just a special case of " "constant functions. A faster and more flexible way to create constant " "functions is to use a lambda function which can supply any constant value " "(not just zero):" msgstr "" -"常に0を返す :func:`int` は特殊な関数でした。定数を生成するより速くて柔軟な方" -"法は、 0に限らず何でも定数を生成するラムダ関数を使うことです:" +"常に 0 を返す :func:`int` は、一定の値を返す関数の一例にすぎません。\n" +"そのような関数をより高速かつ柔軟に作るには、0 に限らず任意の定数を返せるラム" +"ダ関数を使います。" #: ../../library/collections.rst:845 msgid "" @@ -1357,7 +1358,6 @@ msgstr "" "でも利用でき、場所に対するインデックスの代わりに名前を使ってフィールドにアク" "セスできるようになります。" -#: ../../library/collections.rst:866 msgid "" "Returns a new tuple subclass named *typename*. The new subclass is used to " "create tuple-like objects that have fields accessible by attribute lookup as " @@ -1366,12 +1366,12 @@ msgid "" "`~object.__repr__` method which lists the tuple contents in a ``name=value`` " "format." msgstr "" -"*typename* という名前の tuple の新しいサブクラスを返します。新しいサブクラス" -"は、 tuple に似ているけれどもインデックスやイテレータだけでなく属性名によるア" -"クセスもできるオブジェクトを作るのに使います。このサブクラスのインスタンス" -"は、わかりやすい docstring (型名と属性名が入っています) や、 tuple の内容を " -"``name=value`` という形のリストで返す使いやすい :meth:`~object.__repr__` も" -"持っています。" +"*typename* という名前の新しいタプルのサブクラスを返します。\n" +"このサブクラスでは、インデックスによるアクセスや反復に加えて、属性名でも" +"フィールドにアクセスできるタプルに似たオブジェクトを作成できます。\n" +"インスタンスには *typename* と *field_names* を含む便利な docstring と、タプ" +"ルの内容を ``name=value`` 形式で列挙する便利な :meth:`~object.__repr__` メ" +"ソッドもあります。" #: ../../library/collections.rst:873 msgid "" diff --git a/library/compileall.po b/library/compileall.po index fe5237ce1..93f9bb792 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -190,16 +190,18 @@ msgid "" "`SOURCE_DATE_EPOCH` environment variable is not set, and ``checked-hash`` if " "the ``SOURCE_DATE_EPOCH`` environment variable is set." msgstr "" -"生成したバイトコードファイルを実行時に無効化する方法を制御します。" +"生成したバイトコードファイルを実行時に無効化する方法を制御します。\n" "``timestamp`` を指定すると、生成した ``.pyc`` ファイルにソースファイルのタイ" -"ムスタンプとサイズを埋め込みます。``checked-hash`` と ``unchecked-hash`` を指" -"定すると、ハッシュベースの pycファイルが生成されます。ハッシュベースのpycファ" -"イルは、ソースファイルにタイムスタンプではなくハッシュ値を埋め込みます。" +"ムスタンプとサイズを埋め込みます。\n" +"``checked-hash`` と ``unchecked-hash`` を指定すると、ハッシュベースの pycファ" +"イルが生成されます。\n" +"ハッシュベースの pyc ファイルには、タイムスタンプの代わりにソースファイルの内" +"容のハッシュ値を埋め込みます。\n" "Python がバイトコードキャッシュファイルを実行時に検証する方法の詳細を知るに" -"は、:ref:`pyc-invalidation` を参照してください。デフォルト値は、:envvar:" -"`SOURCE_DATE_EPOCH` 環境変数が設定されていなければ ``timestamp`` で、" -"``SOURCE_DATE_EPOCH`` 環境変数が設定されていれば、``checked-hash`` になりま" -"す。" +"は、:ref:`pyc-invalidation` を参照してください。\n" +"デフォルト値は、:envvar:`SOURCE_DATE_EPOCH` 環境変数が設定されていなければ " +"``timestamp`` で、``SOURCE_DATE_EPOCH`` 環境変数が設定されていれば、" +"``checked-hash`` になります。" #: ../../library/compileall.rst:118 msgid "" diff --git a/library/compression.zstd.po b/library/compression.zstd.po index 75711265a..2b26fb199 100644 --- a/library/compression.zstd.po +++ b/library/compression.zstd.po @@ -457,13 +457,12 @@ msgid "" " process_output(d.decompress(b\"\", max_length))" msgstr "" -#: ../../library/compression.zstd.rst:343 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -"入力データの全てが圧縮され返された (*max_length* バイトより少ないためか " +"入力データの全てが展開され返された (*max_length* バイトより少ないためか " "*max_length* が負のため) 場合、\n" ":attr:`~.needs_input` 属性は ``True`` になります。" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 3e6bf6544..364a54e02 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -117,7 +117,6 @@ msgid "" "concurrently." msgstr "" -#: ../../library/concurrent.futures.rst:61 msgid "" "The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator." "__next__` is called and the result isn't available after *timeout* seconds " @@ -127,8 +126,9 @@ msgid "" msgstr "" "もし :meth:`~iterator.__next__` が呼ばれその結果が元々の :meth:`Executor." "map` の呼び出しから *timeout* 秒経った後も利用できない場合、返されるイテレー" -"タは :exc:`TimeoutError` を送出します。*timeout* は整数または浮動小数点数で" -"す。もし *timeout* が指定されないか の場合、待ち時間に制限はありません。" +"タは :exc:`TimeoutError` を送出します。\n" +"*timeout* は整数または浮動小数点数です。\n" +"*timeout* を省略するか ``None`` を指定した場合、待ち時間に制限はありません。" #: ../../library/concurrent.futures.rst:67 msgid "" @@ -836,14 +836,13 @@ msgstr "" "以下の :class:`Future` メソッドは、ユニットテストでの使用と :class:" "`Executor` を実装することを意図しています。" -#: ../../library/concurrent.futures.rst:574 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " "tests." msgstr "" -"このメソッドは、:class:`Future` に関連付けられたワークやユニットテストによる" -"ワークの実行前に、 :class:`Executor` の実装によってのみ呼び出してください。" +"このメソッドを呼び出してよいのは、:class:`Future` に関連付けられた処理を実行" +"する前の :class:`Executor` の実装と、ユニットテストだけです。" #: ../../library/concurrent.futures.rst:578 msgid "" @@ -857,24 +856,21 @@ msgstr "" "class:`Future` の完了を (:func:`as_completed` または :func:`wait` により) " "待機するすべてのスレッドが起動します。" -#: ../../library/concurrent.futures.rst:583 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " "will return ``True``." msgstr "" -"このメソッドが ``True`` を返す場合、 :class:`Future` はキャンセルされて、実行" -"状態に移行されています。つまり、 :meth:`Future.running` を呼び出すと " -"``True`` が返ります。" +"このメソッドが ``True`` を返す場合、 :class:`Future` はキャンセルされておら" +"ず、実行状態に移行しています。\n" +"つまり、 :meth:`Future.running` を呼び出すと ``True`` が返ります。" -#: ../../library/concurrent.futures.rst:587 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." msgstr "" -"このメソッドは、一度だけ呼び出すことができ、:meth:`Future.set_result` また" -"は :meth:`Future.set_exception` がキャンセルされた後には呼び出すことができま" -"せん。" +"このメソッドは一度だけ呼び出すことができ、:meth:`Future.set_result` または :" +"meth:`Future.set_exception` が呼び出された後には呼び出すことができません。" #: ../../library/concurrent.futures.rst:593 msgid "" diff --git a/library/configparser.po b/library/configparser.po index 3800ddff0..77f427cac 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -1686,7 +1686,6 @@ msgstr "" msgid "This method can be used to copy state between parsers." msgstr "このメソッドを使ってパーサー間で状態をコピーできます。" -#: ../../library/configparser.rst:1172 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -1694,10 +1693,13 @@ msgid "" "*fallback* is provided, it is used as a fallback value. ``None`` can be " "provided as a *fallback* value." msgstr "" -"指名された *section* の *option* の値を取得します。*vars* が提供されるなら、" -"それは辞書でなければならず、(与えられたなら) *vars*, *section*, " -"*DEFAULTSECT* 内からこの順で *option* が探索されます。*fallback* の値として " -"``None`` を与えられます。" +"指定された *section* の *option* の値を取得します。\n" +"*vars* を指定する場合は辞書でなければなりません。\n" +"*option* は *vars* (指定されている場合)、*section*、*DEFAULTSECT* の順に検索" +"されます。\n" +"キーが見つからず、*fallback* が指定されている場合は、その値を代わりに返しま" +"す。\n" +"*fallback* には ``None`` も指定できます。" #: ../../library/configparser.rst:1178 msgid "" @@ -1734,7 +1736,6 @@ msgid "" "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1204 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -1745,12 +1746,12 @@ msgid "" "`ValueError`. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -"指定された *section* 中の *option* をブール値に型強制する補助メソッドです。な" -"お、このオプションで受け付けられる値はこのメソッドが ``True`` を返す " -"``'1'``, ``'yes'``, ``'true'``, および ``'on'``,と、このメソッドが ``False`` " -"を返す ``'0'``, ``'no'``, ``'false'``, and ``'off'`` です。その他のいかなる値" -"も :exc:`ValueError` を送出します。 *raw*, *vars* および *fallback* の説明" -"は :meth:`get` を参照してください。" +"指定された *section* の *option* をブール値に変換する便利なメソッドです。\n" +"``'1'``、``'yes'``、``'true'``、``'on'`` に対しては ``True`` を、\n" +"``'0'``、``'no'``、``'false'``、``'off'`` に対しては ``False`` を返します。\n" +"これらの文字列値は大文字と小文字を区別せずに調べられます。\n" +"その他の値に対しては :exc:`ValueError` を送出します。\n" +"*raw*、*vars*、*fallback* の説明は :meth:`get` を参照してください。" #: ../../library/configparser.rst:1217 msgid "" diff --git a/library/contextlib.po b/library/contextlib.po index 2def6f8d6..97fe34edc 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -1579,7 +1579,6 @@ msgstr "" msgid "Reusable context managers" msgstr "再利用可能なコンテキストマネージャ" -#: ../../library/contextlib.rst:1032 msgid "" "Distinct from both single use and reentrant context managers are " "\"reusable\" context managers (or, to be completely explicit, \"reusable, " @@ -1591,10 +1590,11 @@ msgstr "" "単回使用のコンテキストマネージャとリエントラントなコンテキストマネージャのい" "ずれとも異なるタイプに \"再利用可能\" なコンテキストマネージャがあります (あ" "るいは、より明確には、\"再利用可能だがリエントラントでない\" コンテキストマ" -"ネージャです。リエントラントなコンテキストマネージャもまた再利用可能だからで" -"す)。再利用可能なコンテキストマネージャは複数回利用をサポートしますが、同じコ" -"ンテキストマネージャのインスタンスがすでに with 文で使われている場合には失敗" -"します (もしくは正しく動作しません)。" +"ネージャです。\n" +"リエントラントなコンテキストマネージャもまた再利用可能だからです)。\n" +"再利用可能なコンテキストマネージャは複数回利用をサポートしますが、同じコンテ" +"キストマネージャのインスタンスが外側の with 文ですでに使用中の場合には失敗し" +"ます (もしくは正しく動作しません)。" #: ../../library/contextlib.rst:1039 msgid "" @@ -1606,15 +1606,16 @@ msgstr "" "ネージャの例です (リエントラントなロックのためには :class:`threading.RLock` " "を代わりに使う必要があります)。" -#: ../../library/contextlib.rst:1043 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "any with statement, regardless of where those callbacks were added::" msgstr "" -"再利用可能だがリエントラントでないコンテキストマネージャのもうひとつの例は :" -"class:`ExitStack` です。これは現在登録されている *全ての* コールバック関数" -"を、どこで登録されたかにかかわらず、呼び出します::" +"再利用可能だがリエントラントでないコンテキストマネージャのもう一つの例は :" +"class:`ExitStack` です。\n" +"これを使うどの with 文を抜けるときにも、現在登録されている *すべての* コール" +"バックを呼び出します。\n" +"コールバックをどこで登録したかは関係ありません。 ::" #: ../../library/contextlib.rst:1048 msgid "" diff --git a/library/contextvars.po b/library/contextvars.po index cc2078607..d7f58a0f9 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -292,9 +292,8 @@ msgstr "" "この関数の複雑性は *O*\\ (1) です。つまり、少数のコンテキスト変数を持つコンテ" "キストと多くの変数を持つコンテキストで同程度の速度で動作します。" -#: ../../library/contextvars.rst:180 msgid "A mapping of :class:`ContextVars ` to their values." -msgstr ":class:`ContextVars` とその値の対応付け。" +msgstr ":class:`ContextVar` とその値を対応付けるマッピング。" #: ../../library/contextvars.rst:182 msgid "" diff --git a/library/copy.po b/library/copy.po index da634aecd..63608c834 100644 --- a/library/copy.po +++ b/library/copy.po @@ -87,13 +87,12 @@ msgstr "" "限り) 元のオブジェクト中に見つかったオブジェクトに対する *参照* を挿入しま" "す。" -#: ../../library/copy.rst:50 msgid "" "A *deep copy* constructs a new compound object and then, recursively, " "inserts *copies* into it of the objects found in the original." msgstr "" -"*深いコピー (deep copy)* は新たな複合オブジェクトを作成し、その後元のオブジェ" -"クト中に見つかったオブジェクトの *コピー* を挿入します。" +"*深いコピー (deep copy)* は新しい複合オブジェクトを作成し、元のオブジェクトに" +"含まれるオブジェクトを再帰的に *コピー* して挿入します。" #: ../../library/copy.rst:53 msgid "" diff --git a/library/csv.po b/library/csv.po index ff9029fa1..45c1bf843 100644 --- a/library/csv.po +++ b/library/csv.po @@ -325,7 +325,6 @@ msgid "" "John,Cleese" msgstr "" -#: ../../library/csv.rst:220 msgid "" "Create an object which operates like a regular writer but maps dictionaries " "onto output rows. The *fieldnames* parameter is a :mod:`sequence " @@ -341,15 +340,20 @@ msgid "" "to the underlying :class:`writer` instance." msgstr "" "通常の writer のように動作しますが、辞書を出力行にマップするオブジェクトを生" -"成します。 *fieldnames* パラメータは、:meth:`~csvwriter.writerow` メソッドに" -"渡された辞書の値がどのような順番でファイル *f* に書かれるかを指定するキーの :" -"mod:`sequence ` です。 :meth:`~csvwriter.writerow` メソッド" -"に渡された辞書に *fieldnames* には存在しないキーが含まれている場合、オプショ" -"ンの *extrasaction* パラメータによってどんな動作を行うかが指定されます。この" -"値がデフォルト値である ``'raise'`` に設定されている場合、 :exc:`ValueError` " -"が送出されます。 ``'ignore'`` に設定されている場合、辞書の余分な値は無視され" -"ます。その他のパラメータはベースになっている :class:`writer` インスタンスに渡" -"されます。" +"成します。\n" +"*fieldnames* パラメータは、:meth:`~csvwriter.writerow` メソッドに渡された辞書" +"の値がどのような順番でファイル *f* に書かれるかを指定するキーの :mod:" +"`sequence ` です。\n" +"省略可能な *restval* パラメータは、辞書に *fieldnames* のキーがない場合に書き" +"込む値を指定します。\n" +":meth:`~csvwriter.writerow` メソッドに渡された辞書に *fieldnames* には存在し" +"ないキーが含まれている場合、オプションの *extrasaction* パラメータによってど" +"んな動作を行うかが指定されます。\n" +"この値がデフォルト値である ``'raise'`` に設定されている場合、 :exc:" +"`ValueError` が送出されます。\n" +"``'ignore'`` に設定されている場合、辞書の余分な値は無視されます。\n" +"その他のパラメータはベースになっている :class:`writer` インスタンスに渡されま" +"す。" #: ../../library/csv.rst:235 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index c1d4f5260..fc5334e33 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -2350,7 +2350,6 @@ msgid "" ">>>" msgstr "" -#: ../../library/ctypes.rst:1388 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -2358,11 +2357,12 @@ msgid "" "the contents of ``temp1``. So, the last assignment ``rc.b = temp1``, doesn't " "have the expected effect." msgstr "" -"``temp0`` と ``temp1`` は前記の ``rc`` オブジェクトの内部バッファでまだ使われ" -"ているオブジェクトです。したがって、 ``rc.a = temp0`` を実行すると ``temp0`` " -"のバッファ内容が ``rc`` のバッファへコピーされます。さらに、これは ``temp1`` " -"の内容を変更します。そのため、最後の代入 ``rc.b = temp1`` は、期待する結果に" -"はならないのです。" +"``temp0`` と ``temp1`` は前記の ``rc`` オブジェクトの内部バッファを引き続き使" +"用しているオブジェクトです。\n" +"したがって、 ``rc.a = temp0`` を実行すると ``temp0`` のバッファ内容が ``rc`` " +"のバッファへコピーされます。\n" +"さらに、これは ``temp1`` の内容を変更します。\n" +"そのため、最後の代入 ``rc.b = temp1`` は、期待する結果にはならないのです。" #: ../../library/ctypes.rst:1394 msgid "" @@ -2574,14 +2574,13 @@ msgid "" "across platforms." msgstr "" -#: ../../library/ctypes.rst:1530 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " "ignored. On posix systems, RTLD_NOW is always added, and is not " "configurable." msgstr "" -"*mode* パラメータを使うと、ライブラリがどうやってロードされたかを特定できま" +"*mode* パラメータを使うと、ライブラリをどのようにロードするかを指定できま" "す。\n" "詳細は :manpage:`dlopen(3)` マニュアルページを参考にしてください。\n" "Windows では *mode* は無視されます。\n" @@ -4033,7 +4032,6 @@ msgstr "" "オブジェクトはデバッグでのみ使われます。決してディクショナリの内容を変更しな" "いで下さい。" -#: ../../library/ctypes.rst:2573 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -4041,26 +4039,27 @@ msgid "" "class:`_CData`, so it inherits their methods and attributes. ctypes data " "types that are not and do not contain pointers can now be pickled." msgstr "" -"この非公開クラスは、全ての基本的な ctypes データ型の基底クラスです。これは基" -"本的な ctypes データ型に共通の属性を持っているので、ここで触れておきます。 :" -"class:`_SimpleCData` は :class:`_CData` の子クラスなので、そのメソッドと属性" -"を継承しています。ポインタでないかポインタを含まない ctypes データ型は、現在" -"は pickle 化できます。" +"この非公開クラスは、全ての基本的な ctypes データ型の基底クラスです。\n" +"これは基本的な ctypes データ型に共通の属性を持っているので、ここで触れておき" +"ます。\n" +":class:`_SimpleCData` は :class:`_CData` の子クラスなので、そのメソッドと属性" +"を継承しています。\n" +"ポインタそのものではなく、ポインタも含まない ctypes データ型は、現在は " +"pickle 化できます。" #: ../../library/ctypes.rst:2579 msgid "Instances have a single attribute:" msgstr "インスタンスは一つだけ属性を持ちます:" -#: ../../library/ctypes.rst:2583 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " "character bytes object or string, for character pointer types it is a Python " "bytes object or string." msgstr "" -"この属性は、インスタンスの実際の値を持ちます。整数型とポインタ型に対しては整" -"数型、文字型に対しては一文字のバイト列オブジェクト、文字へのポインタに対して" -"は Python のバイト列オブジェクトもしくは文字列となります。" +"この属性はインスタンスの実際の値を保持します。\n" +"整数型とポインタ型では整数、文字型では一文字の bytes オブジェクトまたは文字" +"列、文字へのポインタ型では Python の bytes オブジェクトまたは文字列です。" #: ../../library/ctypes.rst:2588 msgid "" @@ -4689,7 +4688,6 @@ msgid "" " (\"vt\", VARTYPE)]" msgstr "" -#: ../../library/ctypes.rst:3064 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4699,11 +4697,11 @@ msgid "" "temporary union instance::" msgstr "" "``TYPEDESC`` 構造体はCOMデータ型を表現しており、 ``vt`` フィールドは共用体" -"フィールドのどれが有効であるかを指定します。 ``u`` フィールドは匿名フィールド" -"として定義されているため、 TYPEDESC インスタンスから取り除かれてそのメンバー" -"へ直接アクセスできます。 ``td.lptdesc`` と ``td.u.lptdesc`` は同等ですが、前" -"者がより高速です。なぜなら一時的な共用体インスタンスを作る必要がないためで" -"す。::" +"フィールドのどれが有効であるかを指定します。\n" +"``u`` フィールドは匿名フィールドとして定義されているため、 ``TYPEDESC`` イン" +"スタンスからそのメンバーに直接アクセスできます。\n" +"``td.lptdesc`` と ``td.u.lptdesc`` は同等ですが、前者がより高速です。\n" +"なぜなら一時的な共用体インスタンスを作る必要がないためです。 ::" #: ../../library/ctypes.rst:3071 msgid "" diff --git a/library/curses.po b/library/curses.po index 807daf6da..246c741a9 100644 --- a/library/curses.po +++ b/library/curses.po @@ -532,13 +532,12 @@ msgid "" "no flushing is done." msgstr "" -#: ../../library/curses.rst:358 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." msgstr "" -":func:`resize_term` によってウィンドウ構造が変更されている場合に ``True`` " -"を、そうでない場合は ``False`` を返します。" +":func:`resize_term` を呼び出した場合にウィンドウ構造が変更されるなら " +"``True`` を、そうでなければ ``False`` を返します。" #: ../../library/curses.rst:364 msgid "" @@ -548,7 +547,6 @@ msgstr "" ":func:`endwin` がすでに呼び出されている (すなわち、curses ライブラリが非初期" "化されてしまっている) 場合に ``True`` を返します。" -#: ../../library/curses.rst:370 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -558,12 +556,12 @@ msgid "" "of the prefix ``b'M-'`` followed by the name of the corresponding ASCII " "character." msgstr "" -"bytes オブジェクト *k* に番号付けされているキーの名前を返します。\n" +"番号 *k* のキーの名前を bytes オブジェクトで返します。\n" "印字可能な ASCII 文字を生成するキーの名前はそのキーの文字自体になります。\n" "コントロールキーと組み合わせたキーの名前は、キャレット(``b'^'``)の後に対応す" "る ASCII 文字が続く 2 バイトの bytes オブジェクトになります。\n" "Alt キーと組み合わせたキー (128--255) の名前は、先頭に ``b'M-'`` が付き、その" -"後に対応する ASCII 文字が続く bytes オブジェクトになります。" +"後に対応する ASCII 文字の名前が続く bytes オブジェクトになります。" #: ../../library/curses.rst:377 msgid "Raise a :exc:`ValueError` if *k* is negative." @@ -681,7 +679,6 @@ msgstr "" msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "echo モードを終了します。入力のエコーバックはオフにされます。" -#: ../../library/curses.rst:471 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -690,12 +687,12 @@ msgid "" "translation off, curses can sometimes speed up vertical motion a little; " "also, it will be able to detect the return key on input." msgstr "" -"newline モードを終了します。入力時のリターンキーから改行への変換、および出力" -"時の改行から復帰/改行への低レベル変換を無効化します (ただし、" -"``addch('\\n')`` の振る舞いは変更せず、仮想スクリーン上では常に復帰と改行に等" -"しくなります)。変換をオフにすることで、curses は水平方向の動きを少しだけ高速" -"化できることがあります; また、入力中のリターンキーの検出ができるようになりま" -"す。" +"newline モードを終了します。\n" +"入力時のリターンキーから改行への変換、および出力時の改行から復帰/改行への低レ" +"ベル変換を無効化します (ただし、``addch('\\n')`` の振る舞いは変更せず、仮想ス" +"クリーン上では常に復帰と改行に等しくなります)。\n" +"変換をオフにすることで、curses は垂直方向の動きを少しだけ高速化できることがあ" +"ります; また、入力中のリターンキーの検出ができるようになります。" #: ../../library/curses.rst:481 msgid "" @@ -1135,13 +1132,12 @@ msgid "" "`!addstr` separately for each line." msgstr "" -#: ../../library/curses.rst:828 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -"現在のウィンドウに書き込まれたすべての内容に対し \"バックグラウンド\" に設定" -"された属性 *attr* を除去します。" +"現在のウィンドウへのすべての書き込みに適用される \"バックグラウンド\" の属性" +"セットから *attr* を取り除きます。" #: ../../library/curses.rst:834 msgid "" @@ -1333,13 +1329,12 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:921 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -":meth:`erase` に似ていますが、次に :meth:`refresh` が呼び出された際にすべての" -"ウィンドウを再描画するようにします。" +":meth:`erase` に似ていますが、次に :meth:`refresh` が呼び出された際にウィンド" +"ウ全体を再描画するようにします。" #: ../../library/curses.rst:927 msgid "" @@ -1349,13 +1344,13 @@ msgstr "" "*flag* が ``True`` ならば、次の :meth:`refresh` はウィンドウを完全に消去しま" "す。" -#: ../../library/curses.rst:933 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -"カーソルの位置からウィンドウの端までを消去します: カーソル以降のすべての行が" -"削除されるため、:meth:`clrtoeol` と等価です。" +"カーソル位置からウィンドウの末尾までを消去します。\n" +"まずカーソルのある行より下のすべての行を消去し、次に :meth:`clrtoeol` と同等" +"の処理を行います。" #: ../../library/curses.rst:939 msgid "Erase from cursor to the end of the line." @@ -1394,13 +1389,12 @@ msgstr "" "ではなく、ウィンドウの原点からの相対位置です。派生したウィンドウオブジェクト" "が返されます。" -#: ../../library/curses.rst:970 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -"文字 *ch* に属性 *attr* を付与し、即座に :meth:`refresh` をウィンドウに対して" -"呼び出します。" +"属性 *attr* を持つ文字 *ch* を追加し、すぐにウィンドウの :meth:`refresh` を呼" +"び出します。" #: ../../library/curses.rst:976 msgid "" @@ -1588,7 +1582,6 @@ msgid "" "line being lost. The cursor position does not change." msgstr "" -#: ../../library/curses.rst:1156 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1596,10 +1589,12 @@ msgid "" "up. The bottom *nlines* lines are cleared. The current cursor position " "remains the same." msgstr "" -"*nlines* 行を指定されたウィンドウの現在の行の上に挿入します。その下にある " -"*nlines* 行は失われます。負の *nlines* を指定すると、カーソルのある行以降の " -"*nlines* を削除し、削除された行の後ろに続く内容が上に来ます。その下にある " -"*nlines* は消去されます。現在のカーソル位置はそのままです。" +"指定されたウィンドウの現在の行の上に *nlines* 行を挿入します。\n" +"最下部の *nlines* 行は失われます。\n" +"*nlines* が負の場合は、カーソルのある行からその絶対値に相当する行数を削除し、" +"残りの行を上に移動します。\n" +"最下部の同じ行数分は消去されます。\n" +"現在のカーソル位置は変わりません。" #: ../../library/curses.rst:1165 msgid "" @@ -1951,24 +1946,21 @@ msgstr "" "``-1`` を返します。*delay* が正の値であれば、:meth:`getch` は *delay* ミリ秒" "間ブロックし、ブロック後の時点で入力がない場合には ``-1`` を返します。" -#: ../../library/curses.rst:1429 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " "having been changed (*changed*\\ ``=True``) or unchanged (*changed*\\ " "``=False``)." msgstr "" -"*start* から始まる *count* 行が変更されたかのように振舞わせます。もし " -"*changed* が与えられた場合、その引数は指定された行が変更された(*changed*\\ " -"``=True``)か、変更されていないか(*changed*\\ )を指定します。" +"*start* 行から *count* 行が変更されたものとして扱います。\n" +"*changed* を指定した場合は、対象の行を変更済み (*changed*\\ ``=True``) とする" +"か、未変更 (*changed*\\ ``=False``) とするかを指定します。" -#: ../../library/curses.rst:1436 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -"描画を最適化するために、すべてのウィンドウが変更されたかのように振舞わせま" -"す。" +"描画を最適化するために、ウィンドウ全体が変更されたかのように振舞わせます。" #: ../../library/curses.rst:1442 msgid "" diff --git a/library/dataclasses.po b/library/dataclasses.po index 9feb22b19..b5466be0a 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -878,14 +878,13 @@ msgid "" "automatically be called." msgstr "" -#: ../../library/dataclasses.rst:581 msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" msgstr "" -"他の機能と組み合わせることで、他の 1 つ以上のフィールドに依存しているフィール" -"ドが初期化できます。\n" -"例えば次のようにできます::" +"用途の一例として、他の一つ以上のフィールドに依存するフィールドの値を初期化で" +"きます。\n" +"例えば次のようにできます。 ::" #: ../../library/dataclasses.rst:584 msgid "" @@ -1113,15 +1112,14 @@ msgid "" "int = 0):" msgstr "" -#: ../../library/dataclasses.rst:741 msgid "" "Note that the parameters have been re-ordered from how they appear in the " "list of fields: parameters derived from regular fields are followed by " "parameters derived from keyword-only fields." msgstr "" -"パラメータは、フィールドのリストの表示方法によって並べ替えられます。通常の" -"フィールドから派生したパラメータの後に、キーワードのみのフィールドから派生し" -"たパラメータが続きます。" +"引数の順序はフィールドのリストに現れる順序から変更されています。\n" +"通常のフィールドに対応する引数の後に、キーワード専用フィールドに対応する引数" +"が続きます。" #: ../../library/dataclasses.rst:745 msgid "" diff --git a/library/datetime.po b/library/datetime.po index 06a09508d..f08d366f3 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -147,7 +147,6 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:67 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`!datetime` module. The :class:`!timezone` class can " @@ -157,14 +156,14 @@ msgid "" "across the world are more political than rational, change frequently, and " "there is no standard suitable for every application aside from UTC." msgstr "" -"ただ一つの具象 :class:`tzinfo` クラスである :class:`timezone` クラスが :mod:" -"`!datetime` モジュールで提供されています。 :class:`!timezone` クラスは、UTCか" -"らのオフセットが固定である単純なタイムゾーン(例えばUTCそれ自体)、および北ア" -"メリカにおける東部標準時(EST)/東部夏時間(EDT)のような単純ではないタイム" -"ゾーンの両方を表現できます。より深く詳細までタイムゾーンをサポートするかはア" -"プリケーションに依存します。世界中の時刻の調整を決めるルールは合理的というよ" -"りかは政治的なもので、頻繁に変わり、UTC を除くと都合のよい基準というものはあ" -"りません。" +":mod:`!datetime` モジュールが提供する具象 :class:`tzinfo` クラスは :class:" +"`timezone` だけです。\n" +":class:`!timezone` クラスは、UTC 自体や北米の EST、EDT など、UTC からのオフ" +"セットが固定された単純なタイムゾーンを表現できます。\n" +"より詳細なタイムゾーンの扱いはアプリケーションに任されています。\n" +"世界各地の時刻調整のルールは合理的というより政治的なもので、頻繁に変更されま" +"す。\n" +"UTC を除けば、あらゆるアプリケーションに適した標準はありません。" #: ../../library/datetime.rst:77 msgid "Constants" @@ -457,7 +456,6 @@ msgid "" "i-import-pythons-datetime-module/>`__." msgstr "" -#: ../../library/datetime.rst:253 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -465,10 +463,11 @@ msgid "" "tiebreaker. If no argument is a float, the conversion and normalization " "processes are exact (no information is lost)." msgstr "" -"引数のいずれかが浮動小数点であり、小数のマイクロ秒が存在する場合、小数のマイ" -"クロ秒は全ての引数から一度取り置かれ、それらの和は最近接偶数のマイクロ秒に丸" -"められます。浮動小数点の引数がない場合、値の変換と正規化の過程は厳密な (失わ" -"れる情報がない) ものとなります。" +"引数に浮動小数点数があり、マイクロ秒未満の端数が生じる場合は、すべての引数の" +"端数を合計し、最も近いマイクロ秒に丸めます。\n" +"ちょうど中間の値は偶数側に丸めます。\n" +"浮動小数点数の引数がなければ、変換と正規化は厳密に行われ、情報は失われませ" +"ん。" #: ../../library/datetime.rst:260 msgid "" @@ -1193,7 +1192,6 @@ msgstr "``date1 >= date2``" msgid "Order comparison. (5)" msgstr "順序の比較。(5)" -#: ../../library/datetime.rst:688 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -1205,7 +1203,7 @@ msgstr "" "0`` の場合は戻る方向に移動します。\n" "演算後は ``date2 - date1 == timedelta.days`` が成立します。\n" "``timedelta.seconds`` および ``timedelta.microseconds`` は無視されます。\n" -"``date2.year`` が :const:`MINYEAR` になってしまったり、 :const:`MAXYEAR` より" +"``date2.year`` が :const:`MINYEAR` より小さくなったり、 :const:`MAXYEAR` より" "大きくなってしまう場合には :exc:`OverflowError` が送出されます。" #: ../../library/datetime.rst:695 @@ -1257,12 +1255,10 @@ msgid "" "in subclasses." msgstr "" -#: ../../library/datetime.rst:725 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -"ブール演算コンテキストでは、全ての :class:`.time` オブジェクトは真とみなされ" -"ます。" +"ブール値の文脈では、すべての :class:`date` オブジェクトは真とみなされます。" #: ../../library/datetime.rst:731 msgid "" @@ -1641,18 +1637,18 @@ msgstr "" msgid "Return the current local date and time." msgstr "現在のローカルな日時を返します。" -#: ../../library/datetime.rst:974 msgid "" "If optional argument *tz* is ``None`` or not specified, this is like :meth:" "`today`, but, if possible, supplies more precision than can be gotten from " "going through a :func:`time.time` timestamp (for example, this may be " "possible on platforms supplying the C :c:func:`gettimeofday` function)." msgstr "" -"オプションの引数 *tz* が ``None`` であるか指定されていない場合、このメソッド" -"は :meth:`today` と同様ですが、可能ならば :func:`time.time` タイムスタンプを" -"通じて得ることができる、より高い精度で時刻を提供します (例えば、プラット" -"フォームが C 関数 :c:func:`gettimeofday` をサポートする場合には可能なことが" -"あります)。" +"省略可能な引数 *tz* が ``None`` または未指定の場合、このメソッドは :meth:" +"`today` と同様に動作します。\n" +"ただし可能であれば、:func:`time.time` のタイムスタンプ経由で得られる精度より" +"も高い精度で時刻を返します\n" +"(例えば、C 関数 :c:func:`gettimeofday` を提供するプラットフォームでは可能な場" +"合があります)。" #: ../../library/datetime.rst:980 msgid "" @@ -1765,10 +1761,10 @@ msgstr "" "くは :c:func:`gmtime` の呼び出し失敗で :exc:`ValueError` ではなく :exc:" "`OSError` を送出するようになりました。" -#: ../../library/datetime.rst:1039 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -":meth:`fromtimestamp` は :attr:`.fold` を1にしてインスタンスを返します。" +":meth:`fromtimestamp` は :attr:`.fold` が 1 に設定されたインスタンスを返すこ" +"とがあります。" #: ../../library/datetime.rst:1048 msgid "" @@ -1778,16 +1774,15 @@ msgstr "" "POSIX タイムスタンプに対応する、:attr:`tzinfo` が ``None`` の UTC での :" "class:`.datetime` を返します。(返されるオブジェクトは naive です。)" -#: ../../library/datetime.rst:1051 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`gmtime` function, and :exc:" "`OSError` on :c:func:`gmtime` failure. It's common for this to be restricted " "to years in 1970 through 2038." msgstr "" -"タイムスタンプがプラットフォームにおける C 関数 :c:func:`localtime` でサポー" -"トされている範囲を超えている場合には :exc:`OverflowError` を、:c:func:" -"`gmtime` が失敗した場合には :exc:`OSError` を送出します。\n" +"タイムスタンプがプラットフォームにおける C 関数 :c:func:`gmtime` でサポートさ" +"れている範囲を超えている場合には :exc:`OverflowError` を、:c:func:`gmtime` が" +"失敗した場合には :exc:`OSError` を送出します。\n" "これはたいてい 1970 年から 2038 年に制限されています。" #: ../../library/datetime.rst:1056 @@ -1811,13 +1806,12 @@ msgid "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" -#: ../../library/datetime.rst:1065 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -"後者を除き、式は常に年の全範囲 (:const:`MINYEAR` から :const:`MAXYEAR` を含み" -"ます) をサポートします。" +"ただし、後者の式は常に年の全範囲 (:const:`MINYEAR` から :const:`MAXYEAR` ま" +"で、両端を含む) をサポートするという違いがあります。" #: ../../library/datetime.rst:1070 msgid "" @@ -2256,7 +2250,6 @@ msgstr "" "日付および時刻データを調整して、返り値が *self* と同じ UTC 時刻を持ち、 *tz* " "におけるローカルな時刻を表すようにします。" -#: ../../library/datetime.rst:1413 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " @@ -2264,8 +2257,9 @@ msgid "" msgstr "" "もし与えられた場合、 *tz* は :class:`tzinfo` のサブクラスのインスタンスでなけ" "ればならず、 インスタンスの :meth:`utcoffset` および :meth:`dst` メソッドは " -"``None`` を返してはなりません。もし *self* が naive ならば、おそらくシステム" -"のタイムゾーンで時間を表現します。" +"``None`` を返してはなりません。\n" +"*self* が naive の場合は、システムのタイムゾーンの時刻を表すものとして扱われ" +"ます。" #: ../../library/datetime.rst:1417 msgid "" @@ -2342,7 +2336,6 @@ msgstr "" "呼び出せるようになりました。これは、システムのローカルな時間を表現していると" "想定されます。" -#: ../../library/datetime.rst:1455 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " @@ -2350,7 +2343,7 @@ msgid "" msgstr "" ":attr:`.tzinfo` が ``None`` の場合、 ``None`` を返し、そうでない場合には " "``self.tzinfo.utcoffset(self)`` を返します。\n" -"後者の式が ``None`` あるいは 1 日以下の大きさを持つ :class:`timedelta` オブ" +"後者の式が ``None`` あるいは 1 日未満の大きさを持つ :class:`timedelta` オブ" "ジェクトのいずれかを返さない場合には例外を送出します。" #: ../../library/datetime.rst:1459 ../../library/datetime.rst:2081 @@ -2428,7 +2421,6 @@ msgid "" "and UTC adjustment spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1514 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -2439,11 +2431,12 @@ msgid "" msgstr "" "naive な ``datetime`` オブジェクトは多くの ``datetime`` メソッドでローカルな" "時間として扱われるため、 aware な datetime を使って UTC の時刻を表すのが好ま" -"しいです。結果として、 :meth:`datetime.utctimetuple` は誤解を招きやすい返り値" -"を返すかもしれません。\n" -"UTC を表す naive な ``datetime`` があった場合、 :meth:`.datetime.timetuple` " -"が使えるところでは ``datetime.replace(tzinfo=timezone.utc)`` で aware にしま" -"す。" +"しいです。\n" +"結果として、 :meth:`datetime.utctimetuple` は誤解を招きやすい返り値を返すかも" +"しれません。\n" +"UTC を表す naive な ``datetime`` があった場合、 ``datetime." +"replace(tzinfo=timezone.utc)`` で aware にしてから :meth:`.datetime." +"timetuple` を使えます。" #: ../../library/datetime.rst:1524 msgid "" @@ -2453,14 +2446,13 @@ msgstr "" "先発グレゴリオ暦における日付序数を返します。``self.date().toordinal()`` と同" "じです。" -#: ../../library/datetime.rst:1530 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" ":class:`.datetime` インスタンスに対応する POSIX タイムスタンプを返します。\n" -"返り値は :func:`time.time` で返される値に近い :class:`float` です。" +":func:`time.time` の返り値と同様に、返り値は :class:`float` です。" #: ../../library/datetime.rst:1534 msgid "" @@ -2648,19 +2640,17 @@ msgstr "" "``'seconds'``: :attr:`hour` 、 :attr:`minute` 、 :attr:`second` を ``HH:MM:" "SS`` の書式で含めます。" -#: ../../library/datetime.rst:1636 ../../library/datetime.rst:2031 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -"``'milliseconds'``: 全ての時刻を含みますが、小数第二位をミリ秒に切り捨てま" -"す。\n" -"``HH:MM:SS.sss`` の書式で表現します。" +"``'milliseconds'``: 時刻全体を含めますが、秒の小数部分はミリ秒単位で切り捨て" +"ます。\n" +"``HH:MM:SS.sss`` 形式になります。" -#: ../../library/datetime.rst:1638 ../../library/datetime.rst:2033 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -"``'microseconds'``: 全ての時刻を ``HH:MM:SS.mmmmmm`` の書式で含めます。" +"``'microseconds'``: 全ての時刻を ``HH:MM:SS.ffffff`` の書式で含めます。" #: ../../library/datetime.rst:1642 ../../library/datetime.rst:2037 msgid "Excluded time components are truncated, not rounded." @@ -3167,7 +3157,6 @@ msgstr "" ":ref:`strftime-strptime-behavior` および :meth:`time.isoformat` も参照してく" "ださい。" -#: ../../library/datetime.rst:2077 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(None)``, and raises an exception if the latter doesn't return " @@ -3175,7 +3164,7 @@ msgid "" msgstr "" ":attr:`.tzinfo` が ``None`` の場合、 ``None`` を返し、そうでない場合には " "``self.tzinfo.utcoffset(None)`` を返します。\n" -"後者の式が ``None`` あるいは 1 日以下の大きさを持つ :class:`timedelta` オブ" +"後者の式が ``None`` あるいは 1 日未満の大きさを持つ :class:`timedelta` オブ" "ジェクトのいずれかを返さない場合には例外を送出します。" #: ../../library/datetime.rst:2087 @@ -3351,7 +3340,6 @@ msgstr "" "夏時間 (DST) 修正を、 :class:`timedelta` オブジェクトで返します。\n" "DST 情報が未知の場合、 ``None`` が返されます。" -#: ../../library/datetime.rst:2200 msgid "" "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " "the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " @@ -3363,16 +3351,17 @@ msgid "" "tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` " "to account for DST changes when crossing time zones." msgstr "" -"DST が有効でない場合には ``timedelta(0)`` を返します。\n" -"DST が有効の場合、オフセットは :class:`timedelta` オブジェクトで返します (詳" -"細は :meth:`utcoffset` を参照してください)。\n" -"DST オフセットが利用可能な場合、この値は :meth:`utcoffset` が返す UTC からの" -"オフセットには既に加算されているため、 DST を個別に取得する必要がない限り :" -"meth:`dst` を使って問い合わせる必要はないので注意してください。\n" -"例えば、 :meth:`datetime.timetuple` は :attr:`~.datetime.tzinfo` 属性の :" -"meth:`dst` メソッドを呼んで :attr:`~time.struct_time.tm_isdst` フラグがセット" -"されているかどうか判断し、 :meth:`tzinfo.fromutc` は :meth:`dst` タイムゾーン" -"を移動する際に DST による変更があるかどうかを調べます。" +"DST が適用されない場合は ``timedelta(0)`` を返します。\n" +"適用される場合は、調整量を :class:`timedelta` オブジェクトで返します (詳細" +"は :meth:`utcoffset` を参照してください)。\n" +"DST の調整量は :meth:`utcoffset` が返す UTC オフセットにすでに加算されている" +"ため、DST 情報を個別に取得したい場合を除き、:meth:`dst` を呼び出す必要はあり" +"ません。\n" +"例えば、:meth:`datetime.timetuple` は :attr:`~.datetime.tzinfo` 属性の :meth:" +"`dst` メソッドを呼び出して、:attr:`~time.struct_time.tm_isdst` フラグに設定す" +"る値を決定します。\n" +"また :meth:`tzinfo.fromutc` は :meth:`dst` を呼び出し、タイムゾーンをまたぐ際" +"の DST の変化を考慮します。" #: ../../library/datetime.rst:2210 msgid "" @@ -3504,7 +3493,6 @@ msgstr "" "サブクラスでオーバーライドすると良い、もう 1 つの :class:`tzinfo` のメソッド" "があります:" -#: ../../library/datetime.rst:2290 msgid "" "This is called from the default :meth:`datetime.astimezone` implementation. " "When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " @@ -3512,11 +3500,11 @@ msgid "" "`fromutc` is to adjust the date and time data, returning an equivalent " "datetime in *self*'s local time." msgstr "" -"デフォルトの 実装で呼び出されます。 :meth:`datetime.astimezone` から呼ばれた" -"場合、 ``dt.tzinfo`` は *self* であり、 *dt* の日付および時刻データは UTC 時" -"刻を表しているものとして見えます。 :meth:`fromutc` の目的は、 *self* のローカ" -"ル時刻に等しい ``datetime`` オブジェクトを返すことにより日付と時刻データメン" -"バを修正することにあります。" +"デフォルトの :meth:`datetime.astimezone` 実装から呼び出されます。\n" +"その場合、``dt.tzinfo`` は *self* であり、*dt* の日付と時刻は UTC を表すもの" +"として解釈します。\n" +":meth:`fromutc` は日付と時刻を調整し、同じ時点を *self* のローカル時刻で表す " +"datetime を返すためのメソッドです。" #: ../../library/datetime.rst:2296 msgid "" @@ -3762,7 +3750,6 @@ msgid "" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" -#: ../../library/datetime.rst:2333 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -3774,7 +3761,7 @@ msgstr "" "間の移行のときに、回避不能の難解な問題が年に 2 度あるので注意してください。\n" "具体的な例として、東部アメリカ時刻 (US Eastern, UTC -0500) を考えます。\n" "EDT は 3 月の第二日曜日の 1:59 (EST) の 1 分後に開始し、11 月の最初の日曜日" -"の (EDTの) 1:59 に終了します::" +"の 1:59 (EDT) の 1 分後に終了します。 ::" #: ../../library/datetime.rst:2339 msgid "" @@ -3978,7 +3965,6 @@ msgstr "" "返り値は、ローカル時刻と UTC の差分に等しい :class:`timedelta` インスタンスで" "す。" -#: ../../library/datetime.rst:2464 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -3989,9 +3975,9 @@ msgstr "" "*name* が構築時に与えられなかった場合、 ``tzname(dt)`` によって返される name " "は以下の様に ``offset`` の値から生成されます。\n" "*offset* が ``timedelta(0)`` であった場合、 name は \"UTC\"になります。\n" -"それ以外の場合、 'UTC±HH:MM' という書式の文字列になり、± は ``offset`` を、" -"HH と MM はそれぞれ二桁の ``offset.hours`` と ``offset.minutes`` を表現しま" -"す。" +"それ以外の場合、 'UTC±HH:MM' という書式の文字列になり、± は ``offset`` の符号" +"を、HH と MM はそれぞれ二桁の ``offset.hours`` と ``offset.minutes`` を表現し" +"ます。" #: ../../library/datetime.rst:2470 msgid "" @@ -4882,15 +4868,13 @@ msgstr "" "バージョン 3.2 では、 :meth:`~.datetime.strftime` メソッドは years >= 1000 の" "範囲の年数しか扱えませんでした。" -#: ../../library/datetime.rst:2820 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " "only affects the output hour field if the ``%I`` directive is used to parse " "the hour." msgstr "" -":meth:`~.datetime.strptime` メソッドと共に使われた場合、 ``%p`` 指定子は出力" -"の時間フィールドのみに影響し、 ``%I`` 指定子が使われたかのように振る舞いま" -"す。" +":meth:`~.datetime.strptime` メソッドで ``%p`` 指定子が出力の時フィールドに影" +"響するのは、時の解析に ``%I`` 指定子を使う場合だけです。" #: ../../library/datetime.rst:2824 msgid "" diff --git a/library/debug.po b/library/debug.po index e2029f892..e252e5140 100644 --- a/library/debug.po +++ b/library/debug.po @@ -26,7 +26,6 @@ msgstr "" msgid "Debugging and profiling" msgstr "" -#: ../../library/debug.rst:5 msgid "" "These libraries help you with Python development: the debugger enables you " "to step through code, analyze stack frames and set breakpoints etc., and the " @@ -35,7 +34,10 @@ msgid "" "provide visibility into runtime behaviors that would otherwise require " "intrusive debugging or patching." msgstr "" -"ここに含まれるライブラリは Python での開発を手助けするものです。デバッガを使" -"うと、コードのステップ実行や、スタックフレームの解析、ブレークポイントの設定" -"などができます。プロファイラはコードを実行して実行時間の詳細を提供し、プログ" -"ラムのボトルネックを特定できるようにします。" +"ここに含まれるライブラリは Python での開発を手助けします。\n" +"デバッガを使うと、コードのステップ実行やスタックフレームの解析、ブレークポイ" +"ントの設定などができます。\n" +"プロファイラはコードを実行して実行時間の詳しい内訳を示すので、プログラムのボ" +"トルネックを特定できます。\n" +"監査イベントを使うと、通常ならプログラムに手を加えるデバッグやパッチ適用が必" +"要な実行時の振る舞いを把握できます。" diff --git a/library/decimal.po b/library/decimal.po index f96351b5a..40a402814 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -91,15 +91,14 @@ msgstr "" "す。例えば、 ``1.3 * 1.2`` は ``1.56`` になり、 ``1.30 * 1.20`` は " "``1.5600`` になります。" -#: ../../library/decimal.rst:55 msgid "" "Unlike hardware based binary floating point, the decimal module has a user " "alterable precision (defaulting to 28 places) which can be as large as " "needed for a given problem:" msgstr "" -"ハードウェアによる 2 進浮動小数点表現と違い、 ``decimal`` モジュールでは計算" -"精度をユーザが変更できます(デフォルトでは 28 桁です)。この桁数はほとんどの問" -"題解決に十分な大きさです:" +"ハードウェアによる 2 進浮動小数点演算と違い、``decimal`` モジュールではユー" +"ザーが精度を変更できます (デフォルトは 28 桁です)。\n" +"問題に応じて必要なだけ精度を高くできます:" #: ../../library/decimal.rst:67 msgid "" @@ -756,13 +755,12 @@ msgstr "" "変換は正確に行われます。無限大に対してはOverflowErrorを、NaNに対しては" "ValueError を送出します。" -#: ../../library/decimal.rst:491 msgid "" "Return a :term:`named tuple` representation of the number: " "``DecimalTuple(sign, digits, exponent)``." msgstr "" "数値を表現するための :term:`名前付きタプル `: " -"``DecimalTuple(sign, digittuple, exponent)`` を返します。" +"``DecimalTuple(sign, digits, exponent)`` を返します。" #: ../../library/decimal.rst:497 msgid "" @@ -894,7 +892,6 @@ msgid "" "class:`int`." msgstr "" -#: ../../library/decimal.rst:595 msgid "" "Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``. " "Since 0.1 is not exactly representable in binary floating point, the value " @@ -903,8 +900,10 @@ msgid "" "``0.1000000000000000055511151231257827021181583404541015625``." msgstr "" "なお、``Decimal.from_float(0.1)`` は ``Decimal('0.1')`` と同じではありませ" -"ん。0.1 は二進浮動小数点数で正確に表せないので、その値は表現できる最も近い" -"値、``0x1.999999999999ap-4`` として記憶されます。浮動小数点数での等価な値は " +"ん。\n" +"0.1 は二進浮動小数点数で正確に表せないので、その値は表現できる最も近い値、" +"``0x1.999999999999ap-4`` として記憶されます。\n" +"同じ値を十進数で表すと " "``0.1000000000000000055511151231257827021181583404541015625`` です。" #: ../../library/decimal.rst:601 @@ -1049,7 +1048,6 @@ msgstr "" "演算対象の底 10 の対数を返します。結果は :const:`ROUND_HALF_EVEN` 丸めモード" "で正しく丸められます。" -#: ../../library/decimal.rst:705 msgid "" "For a nonzero number, return the adjusted exponent of its operand as a :" "class:`Decimal` instance. If the operand is a zero then ``Decimal('-" @@ -1057,9 +1055,10 @@ msgid "" "the operand is an infinity then ``Decimal('Infinity')`` is returned." msgstr "" "非零の数値については、 :class:`Decimal` インスタンスとして調整された指数を返" -"します。演算対象がゼロだった場合、 ``Decimal('-Infinity')`` が返され :const:" -"`DivisionByZero` フラグが送出されます。演算対象が無限大だった場合、 " -"``Decimal('Infinity')`` が返されます。" +"します。\n" +"演算対象がゼロだった場合、 ``Decimal('-Infinity')`` が返され :const:" +"`DivisionByZero` フラグがセットされます。\n" +"演算対象が無限大だった場合、 ``Decimal('Infinity')`` が返されます。" #: ../../library/decimal.rst:713 msgid "" @@ -1315,7 +1314,6 @@ msgstr "" msgid "If the result is zero then its sign will be the sign of *self*." msgstr "結果が0になる場合の符号は *self* の符号と同じになります。" -#: ../../library/decimal.rst:865 msgid "" "Return the result of rotating the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -1326,12 +1324,15 @@ msgid "" "length precision if necessary. The sign and exponent of the first operand " "are unchanged." msgstr "" -"一つ目の演算対象の数字を二つ目で指定された量だけ巡回(rotate)した結果を返しま" -"す。二つめの演算対象は -precision から precision までの範囲の整数でなければな" -"りません。この二つ目の演算対象の絶対値を何桁ずらすかを決めます。そしてもし正" -"の数ならば巡回の方向は左に、そうでなければ右になります。一つ目の演算対象の仮" -"数部は必要ならば精度いっぱいまでゼロで埋められます。符号と指数は変えられませ" -"ん。" +"1 つ目の演算対象の数字を、2 つ目の演算対象で指定した桁数だけ巡回させた結果を" +"返します。\n" +"2 つ目の演算対象は -precision から precision までの整数でなければなりませ" +"ん。\n" +"その絶対値が巡回させる桁数を表し、正なら左へ、それ以外なら右へ巡回させま" +"す。\n" +"必要に応じて 1 つ目の演算対象の係数の左側をゼロで埋め、長さを precision に揃" +"えます。\n" +"1 つ目の演算対象の符号と指数は変わりません。" #: ../../library/decimal.rst:876 msgid "" @@ -1351,7 +1352,6 @@ msgstr "" "が、一つめの演算対象を ``10**other`` 倍したものを返します。二つ目の演算対象は" "整数でなければなりません。" -#: ../../library/decimal.rst:891 msgid "" "Return the result of shifting the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -1361,11 +1361,14 @@ msgid "" "right. Digits shifted into the coefficient are zeros. The sign and " "exponent of the first operand are unchanged." msgstr "" -"一つ目の演算対象の数字を二つ目で指定された量だけシフトした結果を返します。二" -"つ目の演算対象は -precision から precision までの範囲の整数でなければなりませ" -"ん。この二つ目の演算対象の絶対値が何桁ずらすかを決めます。そしてもし正の数な" -"らばシフトの方向は左に、そうでなければ右になります。一つ目の演算対象の係数は" -"必要ならば精度いっぱいまでゼロで埋められます。符号と指数は変えられません。" +"1 つ目の演算対象の数字を、2 つ目の演算対象で指定した桁数だけシフトした結果を" +"返します。\n" +"2 つ目の演算対象は -precision から precision までの整数でなければなりませ" +"ん。\n" +"その絶対値がシフトする桁数を表し、正なら左へ、それ以外なら右へシフトしま" +"す。\n" +"シフトによって係数に入る数字はゼロです。\n" +"1 つ目の演算対象の符号と指数は変わりません。" #: ../../library/decimal.rst:901 msgid "Return the square root of the argument to full precision." @@ -1376,15 +1379,14 @@ msgid "" "Convert to a string, using engineering notation if an exponent is needed." msgstr "文字列に変換します。指数が必要なら工学表記が使われます。" -#: ../../library/decimal.rst:908 ../../library/decimal.rst:1565 msgid "" "Engineering notation has an exponent which is a multiple of 3. This can " "leave up to 3 digits to the left of the decimal place and may require the " "addition of either one or two trailing zeros." msgstr "" -"工学表記法では指数は 3 の倍数になります。これにより、基数の小数部には最大で " -"3 桁までの数字が残されるとともに、末尾に 1 つまたは 2 つの 0 の付加が必要とさ" -"れるかもしれません。" +"工学表記法では指数が 3 の倍数になります。\n" +"そのため、小数点の左側には最大 3 桁の数字が残り、末尾にゼロを 1 つまたは 2 つ" +"追加する必要が生じることがあります。" #: ../../library/decimal.rst:912 msgid "" @@ -1709,16 +1711,16 @@ msgstr "" "上に挙げた三つのコンテキストに加え、 :class:`Context` コンストラクタを使って" "新たなコンテキストを生成できます。" -#: ../../library/decimal.rst:1109 msgid "" "Creates a new context. If a field is not specified or is :const:`None`, the " "default values are copied from the :const:`DefaultContext`. If the *flags* " "field is not specified or is :const:`None`, all flags are cleared." msgstr "" -"新たなコンテキストを生成します。あるフィールドが定義されていないか :const:" -"`None` であれば、 :const:`DefaultContext` からデフォルト値をコピーします。 " -"*flags* フィールドが設定されていいか :const:`None` の場合には、全てのフラグが" -"クリアされます。" +"新たなコンテキストを生成します。\n" +"あるフィールドが定義されていないか :const:`None` であれば、 :const:" +"`DefaultContext` からデフォルト値をコピーします。\n" +"*flags* フィールドが指定されていないか :const:`None` の場合には、全てのフラグ" +"がクリアされます。" #: ../../library/decimal.rst:1115 msgid "" @@ -1777,7 +1779,6 @@ msgstr "" "*clamp* の値 ``1`` は、IEEE 754 で規定された固定幅十進交換形式と互換にできま" "す。" -#: ../../library/decimal.rst:1160 msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " @@ -1789,15 +1790,16 @@ msgid "" "exp(context=C)``. Each :class:`Context` method accepts a Python integer (an " "instance of :class:`int`) anywhere that a Decimal instance is accepted." msgstr "" -":class:`Context` クラスでは、いくつかの汎用のメソッドの他、現在のコンテキスト" -"で算術演算を直接行うためのメソッドを数多く定義しています。加えて、 :class:" -"`Decimal` の各メソッドについて(:meth:`~Decimal.adjusted` および :meth:" -"`~Decimal.as_tuple` メソッドを例外として)対応する :class:`Context` のメソッド" -"が存在します。たとえば、 :class:`Context` インスタンス ``C`` と :class:" -"`Decimal` インスタンス ``x`` に対して、 ``C.exp(x)`` は ``x.exp(context=C)`` " -"と等価です。それぞれの :class:`Context` メソッドは、Decimal インスタンスが受" -"け付けられるところならどこでも、Python の整数 (:class:`int` のインスタンス) " -"を受け付けます。" +":class:`Context` クラスでは、いくつかの汎用のメソッドの他、指定されたコンテキ" +"ストで算術演算を直接行うためのメソッドを数多く定義しています。\n" +"加えて、 :class:`Decimal` の各メソッドについて(:meth:`~Decimal.adjusted` およ" +"び :meth:`~Decimal.as_tuple` メソッドを例外として)対応する :class:`Context` " +"のメソッドが存在します。\n" +"たとえば、 :class:`Context` インスタンス ``C`` と :class:`Decimal` インスタ" +"ンス ``x`` に対して、 ``C.exp(x)`` は ``x.exp(context=C)`` と等価です。\n" +"それぞれの :class:`Context` メソッドは、Decimal インスタンスが受け付けられる" +"ところならどこでも、Python の整数 (:class:`int` のインスタンス) を受け付けま" +"す。" #: ../../library/decimal.rst:1173 msgid "Resets all of the flags to ``0``." @@ -1883,14 +1885,13 @@ msgid "" "decimal.Inexact: None" msgstr "" -#: ../../library/decimal.rst:1235 msgid "" "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " "value for subnormal results. When underflow occurs, the exponent is set to :" "const:`Etiny`." msgstr "" -"``Emin - prec + 1`` に等しい値を返します。演算結果の劣化が起こる桁の最小値で" -"す。アンダーフローが起きた場合、指数は :const:`Etiny` に設定されます。" +"非正規数の演算結果で取り得る最小の指数 ``Emin - prec + 1`` を返します。\n" +"アンダーフローが起きた場合、指数は :const:`Etiny` に設定されます。" #: ../../library/decimal.rst:1241 msgid "Returns a value equal to ``Emax - prec + 1``." @@ -2217,17 +2218,15 @@ msgstr "一つめの演算対象の指数部に二つめの値を加えたもの msgid "Returns a shifted copy of *x*, *y* times." msgstr "*x* を *y* 回シフトしたコピーを返します。" -#: ../../library/decimal.rst:1553 msgid "Square root of a non-negative number to context precision." -msgstr "*x* の平方根を精度いっぱいまで求めます。" +msgstr "非負の数の平方根をコンテキストの精度で求めます。" #: ../../library/decimal.rst:1558 msgid "Return the difference between *x* and *y*." msgstr "*x* と *y* の間の差を返します。" -#: ../../library/decimal.rst:1572 msgid "Rounds to an integer." -msgstr "最近傍の整数に値を丸めます。" +msgstr "整数に丸めます。" #: ../../library/decimal.rst:1577 msgid "Converts a number to a string using scientific notation." diff --git a/library/difflib.po b/library/difflib.po index 27557a5a1..768aea7f0 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -692,21 +692,22 @@ msgstr "" msgid "lambda x: x in \" \\t\"" msgstr "" -#: ../../library/difflib.rst:465 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." -msgstr "空白とタブ文字を無視して文字のシーケンスを比較します。" +msgstr "" +"これは、行を文字のシーケンスとして比較する際に、空白やタブ文字を対応付けの基" +"点にしたくない場合の例です。" -#: ../../library/difflib.rst:468 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" "`hashable`." msgstr "" -"オプションの引数 *a* と *b* は、比較される文字列で、デフォルトでは空の文字列" -"です。両方のシーケンスの要素は、 :term:`ハッシュ可能 ` である必要が" -"あります。" +"省略可能な引数 *a* と *b* は比較するシーケンスで、どちらもデフォルトは空文字" +"列です。\n" +"両方のシーケンスの要素は :term:`ハッシュ可能 ` でなければなりませ" +"ん。" #: ../../library/difflib.rst:471 msgid "" @@ -744,21 +745,20 @@ msgstr "*bjunk* および *bpopular* 属性。" msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr ":class:`SequenceMatcher` オブジェクトは以下のメソッドを持ちます:" -#: ../../library/difflib.rst:491 msgid "Set the two sequences to be compared." -msgstr "比較される2つの文字列を設定します。" +msgstr "比較する 2 つのシーケンスを設定します。" -#: ../../library/difflib.rst:493 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " "sequences, use :meth:`set_seq2` to set the commonly used sequence once and " "call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" -":class:`SequenceMatcher` オブジェクトは、2つ目のシーケンスについての詳細な情" -"報を計算し、キャッシュします。 1つのシーケンスをいくつものシーケンスと比較す" -"る場合、まず :meth:`set_seq2` を使って文字列を設定しておき、別の文字列を1つず" -"つ比較するために、繰り返し :meth:`set_seq1` を呼び出します。" +":class:`SequenceMatcher` は 2 つ目のシーケンスの詳細な情報を計算してキャッ" +"シュします。\n" +"1 つのシーケンスを多数のシーケンスと比較するには、:meth:`set_seq2` で共通の" +"シーケンスを一度設定し、比較相手のシーケンスごとに :meth:`set_seq1` を呼び出" +"します。" #: ../../library/difflib.rst:501 msgid "" @@ -780,7 +780,6 @@ msgstr "" msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "``a[alo:ahi]`` と ``b[blo:bhi]`` の中から、最長のマッチ列を探します。" -#: ../../library/difflib.rst:515 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " @@ -791,15 +790,14 @@ msgid "" "all those maximal matching blocks that start earliest in *a*, return the one " "that starts earliest in *b*." msgstr "" -"*isjunk* が省略されたか ``None`` の時、 :meth:`find_longest_match` は ``a[i:" -"i+k]`` が ``b[j:j+k]`` と等しいような ``(i, j, k)`` を返します。その値は " -"``alo <= i <= i+k <= ahi`` かつ ``blo <= j <= j+k <= bhi`` となります。 " -"``(i', j', k')`` でも、同じようになります。さらに ``k >= k'``, ``i <= i'`` " -"が ``i == i'``, ``j <= j'`` でも同様です。言い換えると、いくつものマッチ列す" -"べてのうち、 *a* 内で最初に始まるものを返します。そしてその *a* 内で最初の" -"マッチ列すべてのうち *b* 内で最初に始まるものを返します。" +"*isjunk* が省略されたか ``None`` の場合、:meth:`find_longest_match` は ``a[i:" +"i+k]`` が ``b[j:j+k]`` に等しくなる ``(i, j, k)`` を返します。\n" +"ここで ``alo <= i <= i+k <= ahi`` かつ ``blo <= j <= j+k <= bhi`` です。\n" +"これらの条件を満たす任意の ``(i', j', k')`` に対して、さらに ``k >= k'``、" +"``i <= i'``、および ``i == i'`` ならば ``j <= j'`` という条件も満たします。\n" +"つまり、最長の一致ブロックのうち *a* 内で最も早く始まるものを返します。\n" +"そのようなブロックが複数あれば、*b* 内で最も早く始まるものを返します。" -#: ../../library/difflib.rst:528 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " @@ -807,11 +805,12 @@ msgid "" "(only) junk elements on both sides. So the resulting block never matches on " "junk except as identical junk happens to be adjacent to an interesting match." msgstr "" -"引数 *isjunk* が与えられている場合、上記の通り、はじめに最長のマッチ列を判定" -"します。ブロック内に junk 要素が見当たらないような追加条件の際はこれに該当し" -"ません。次にそのマッチ列を、その両側の junk 要素にマッチするよう、できる限り" -"広げていきます。そのため結果となる列は、探している列のたまたま直前にあった同" -"一の junk 以外の junk にはマッチしません。" +"引数 *isjunk* が与えられている場合、まず上記のように最長のマッチ列を判定しま" +"すが、列に junk 要素を含めないという制約が加わります。\n" +"次に、その列の両側にある junk 要素だけをマッチさせて、列をできる限り広げま" +"す。\n" +"したがって、junk 以外の要素のマッチ列に同一の junk 要素が隣接している場合を除" +"き、結果の列で junk 要素がマッチすることはありません。" #: ../../library/difflib.rst:535 msgid "" @@ -837,15 +836,14 @@ msgstr "このメソッドは :term:`named tuple` ``Match(a, b, size)`` を返 msgid "Added default arguments." msgstr "デフォルト引数が追加されました。" -#: ../../library/difflib.rst:554 msgid "" "Return list of triples describing non-overlapping matching subsequences. " "Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" "j+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" -"マッチした互いに重複の無いシーケンスを表す、3つ組の値のリストを返します。\n" -"それぞれの値は ``(i, j, n)`` という形式で表され、``a[i:i+n] == b[j:j+n]`` と" -"いう関係を意味します。3つの値は *i* と *j* の間で単調に増加します。" +"重複しない一致部分シーケンスを表す 3 要素タプルのリストを返します。\n" +"各タプルは ``(i, j, n)`` の形式で、``a[i:i+n] == b[j:j+n]`` を意味します。\n" +"タプルの並びでは *i* と *j* がそれぞれ単調に増加します。" #: ../../library/difflib.rst:559 msgid "" @@ -868,17 +866,17 @@ msgid "" "[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" msgstr "" -#: ../../library/difflib.rst:576 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " "0``, and remaining tuples have *i1* equal to the *i2* from the preceding " "tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" -"*a* を *b* にするための方法を記述する5つのタプルを返します。それぞれのタプル" -"は ``(tag, i1, i2, j1, j2)`` という形式であらわされます。最初のタプルは ``i1 " -"== j1 == 0`` であり、*i1* はその前にあるタプルの *i2* と同じ値です。同様に " -"*j1* は前の *j2* と同じ値になります。" +"*a* を *b* にするための方法を記述する、5 要素のタプルのリストを返します。\n" +"それぞれのタプルは ``(tag, i1, i2, j1, j2)`` という形式です。\n" +"最初のタプルでは ``i1 == j1 == 0`` であり、残りのタプルでは *i1* が直前のタプ" +"ルの *i2* と同じ値になります。\n" +"同様に、*j1* は直前のタプルの *j2* と同じ値になります。" #: ../../library/difflib.rst:581 msgid "The *tag* values are strings, with these meanings:" diff --git a/library/doctest.po b/library/doctest.po index b44e868c0..1c1e2e56b 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -839,7 +839,6 @@ msgid "" "detail" msgstr "" -#: ../../library/doctest.rst:517 msgid "" "Note that tracebacks are treated very specially. In particular, in the " "rewritten example, the use of ``...`` is independent of doctest's :const:" @@ -847,11 +846,12 @@ msgid "" "just as well be three (or three hundred) commas or digits, or an indented " "transcript of a Monty Python skit." msgstr "" -"トレースバックの扱いは非常に特殊なので注意してください。特に、上の書き直した" -"実行例では、 ``...`` の扱いは doctest の :const:`ELLIPSIS` オプションとは独立" -"しています。この例での省略記号は何かの省略を表しているかもしれませんし、コン" -"マや数字が 3 個 (または 300 個) かもしれませんし、 Monty Python のスキットを" -"インデントして書き写したものかもしれません。" +"トレースバックは特別な方法で扱われる点に注意してください。\n" +"特に、上の書き直した実行例での ``...`` の使用は doctest の :const:`ELLIPSIS` " +"オプションとは無関係です。\n" +"この例の省略記号は省いてもかまいませんし、代わりにコンマや数字を 3 個 (また" +"は 300 個) 並べたり、Monty Python の寸劇をインデントして書き写したりしてもか" +"まいません。" #: ../../library/doctest.rst:523 msgid "Some details you should read once, but won't need to remember:" @@ -1208,15 +1208,15 @@ msgstr "" msgid "Directives" msgstr "ディレクティブ (Directives)" -#: ../../library/doctest.rst:751 msgid "" "Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python " "comments following an example's source code:" msgstr "" -"doctest ディレクティブは個々の実行例の :ref:`オプションフラグ ` を操作するために使われます。 doctest ディレクティブは後のソースコー" -"ド例にあるような特殊な Python コメントです:" +"doctest ディレクティブを使うと、個々の実行例の :ref:`オプションフラグ " +"` を変更できます。\n" +"doctest ディレクティブは、実行例のソースコードの後ろに置く特殊な Python コメ" +"ントです:" #: ../../library/doctest.rst:762 msgid "" @@ -1827,15 +1827,15 @@ msgstr "" "め、各ファイル名はパスを分割するのに ``/`` 文字を使わなければならず、絶対パス" "にしてはなりません (パス文字列を ``/`` で始めてはなりません)。" -#: ../../library/doctest.rst:1080 msgid "" "If *module_relative* is ``False``, then each filename in *paths* specifies " "an OS-specific path. The path may be absolute or relative; relative paths " "are resolved with respect to the current working directory." msgstr "" -"*module_relative* が ``False`` の場合、*filename* は OS 依存のパスを示しま" -"す。パスは絶対パスでも相対パスでもかまいません; 相対パスにした場合、現在の作" -"業ディレクトリを基準に解決します。" +"*module_relative* が ``False`` の場合、*paths* 内の各ファイル名は OS 依存のパ" +"スを示します。\n" +"パスは絶対パスでも相対パスでもかまいません; 相対パスにした場合、現在の作業" +"ディレクトリを基準に解決します。" #: ../../library/doctest.rst:1084 msgid "" @@ -1852,19 +1852,18 @@ msgstr "" "レクトリを相対の基準ディレクトリとして使います。*module_relative* を " "``False`` に指定している場合、*package* を指定するとエラーになります。" -#: ../../library/doctest.rst:1091 msgid "" "Optional argument *setUp* specifies a set-up function for the test suite. " "This is called before running the tests in each file. The *setUp* function " "will be passed a :class:`DocTest` object. The *setUp* function can access " "the test globals as the :attr:`~DocTest.globs` attribute of the test passed." msgstr "" -"オプション引数 *setUp* には、テストスイートのセットアップに使う関数を指定しま" -"す。この関数は、各ファイルのテストを実行する前に呼び出されます。 setUp 関数" -"は :class:`DocTest` オブジェクトに引き渡されます。 *setUp* は :attr:" -"`~DocTest.globs` 属性を介してテストのグローバル変数にアクセスできます。" +"省略可能な引数 *setUp* には、テストスイートの準備を行う関数を指定します。\n" +"この関数は各ファイルのテストを実行する前に呼び出されます。\n" +"*setUp* 関数には :class:`DocTest` オブジェクトが渡されます。\n" +"渡されたテストの :attr:`~DocTest.globs` 属性を使うと、テストのグローバル変数" +"にアクセスできます。" -#: ../../library/doctest.rst:1096 msgid "" "Optional argument *tearDown* specifies a tear-down function for the test " "suite. This is called after running the tests in each file. The *tearDown* " @@ -1872,11 +1871,12 @@ msgid "" "can access the test globals as the :attr:`~DocTest.globs` attribute of the " "test passed." msgstr "" -"オプション引数 *tearDown* には、テストを解体 (tear-down) するための関数を指定" -"します。この関数は、各ファイルのテストの実行を終了するたびに呼び出されます。 " -"*tearDown* 関数は :class:`DocTest` オブジェクトに引き渡されます。 " -"*tearDown* は :attr:`~DocTest.globs` 属性を介してテストのグローバル変数にアク" -"セスできます。" +"省略可能な引数 *tearDown* には、テストスイートの後片付けを行う関数を指定しま" +"す。\n" +"この関数は各ファイルのテストを実行した後に呼び出されます。\n" +"*tearDown* 関数には :class:`DocTest` オブジェクトが渡されます。\n" +"渡されたテストの :attr:`~DocTest.globs` 属性を使うと、テストのグローバル変数" +"にアクセスできます。" #: ../../library/doctest.rst:1102 msgid "" @@ -2373,15 +2373,14 @@ msgstr "" "*obj* または *obj* 内に入っているオブジェクトの docstring 中で定義されてい" "る :class:`DocTest` のリストを返します。" -#: ../../library/doctest.rst:1412 msgid "" "The optional argument *name* specifies the object's name; this name will be " "used to construct names for the returned :class:`DocTest`\\ s. If *name* is " "not specified, then ``obj.__name__`` is used." msgstr "" -"オプション引数 *name* には、オブジェクトの名前を指定します。この名前は、関数" -"が返す :class:`DocTest` の名前になります。 *name* を指定しない場合、 ``obj." -"__name__`` を使います。" +"オプション引数 *name* には、オブジェクトの名前を指定します。\n" +"この名前は、返される :class:`DocTest` の名前を組み立てるために使われます。\n" +"*name* を指定しない場合、 ``obj.__name__`` を使います。" #: ../../library/doctest.rst:1416 msgid "" @@ -2420,7 +2419,6 @@ msgstr "オブジェクトの入っているファイル名を調べるために msgid "To help find the line number of the object within its file." msgstr "オブジェクトがファイル内の何行目にあるかを調べる手助けにします。" -#: ../../library/doctest.rst:1430 msgid "" "If *module* is ``False``, no attempt to find the module will be made. This " "is obscure, of use mostly in testing doctest itself: if *module* is " @@ -2428,12 +2426,12 @@ msgid "" "objects are considered to belong to the (non-existent) module, so all " "contained objects will (recursively) be searched for doctests." msgstr "" -"*module* が ``False`` の場合には、モジュールの検索を試みません。これは正確さ" -"を欠くような使い方で、通常 doctest 自体のテストにしか使いません。*module* が " -"``False`` の場合、または *module* が ``None`` で自動的に的確なモジュールを見" -"つけ出せない場合には、すべてのオブジェクトは ``(non-existent)`` モジュールに" -"属するとみなされ、そのオブジェクト内のすべてのオブジェクトに対して (再帰的" -"に) doctest の検索を行います。" +"*module* が ``False`` の場合、モジュールを検索しません。\n" +"これは主に doctest 自体のテストで使う特殊な機能です。\n" +"*module* が ``False`` の場合、または ``None`` でモジュールを自動的に見つけら" +"れなかった場合、すべてのオブジェクトがその (実在しない) モジュールに属すると" +"みなします。\n" +"そのため、内部のすべてのオブジェクトから doctest を再帰的に検索します。" #: ../../library/doctest.rst:1436 msgid "" @@ -3250,18 +3248,17 @@ msgid "" "topics to docstrings containing test cases." msgstr "" -#: ../../library/doctest.rst:1975 msgid "" "When you have placed your tests in a module, the module can itself be the " "test runner. When a test fails, you can arrange for your test runner to re-" "run only the failing doctest while you debug the problem. Here is a minimal " "example of such a test runner::" msgstr "" -"テストコードをモジュールに組み込むことで、そのモジュールは、モジュール自身が" -"テストランナーになることができます。テストが失敗した場合には、問題箇所をデ" -"バッグする際に、失敗したdoctestだけを再度実行することで、作成したテストラン" -"ナーを修正することができます。これがこのようなテストランナーの最小例となりま" -"す。" +"テストをモジュール内に置くと、そのモジュール自体をテストランナーにできま" +"す。\n" +"テストが失敗したときは、問題をデバッグする間、失敗した doctest だけを再実行す" +"るようにテストランナーを設定できます。\n" +"次に、そのようなテストランナーの最小限の例を示します。 ::" #: ../../library/doctest.rst:1980 msgid "" diff --git a/library/email.charset.po b/library/email.charset.po index eaf9c398f..4310ad077 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -172,15 +172,13 @@ msgstr "" "*input_charset* を Unicode に変換するための Python 用コーデック名です。変換用" "のコーデックが必要ないときは、この値は ``None`` になります。" -#: ../../library/email.charset.rst:91 msgid "" "The name of the Python codec used to convert Unicode to the " "*output_charset*. If no conversion codec is necessary, this attribute will " "have the same value as the *input_codec*." msgstr "" -"Unicode を *output_charset* に変換するための Python 用コーデック名です。変換" -"用のコーデックが必要ないときは、この値は ``None`` になります。この属性は " -"*input_codec* と同じ値を持つことになるでしょう。" +"Unicode を *output_charset* に変換するための Python コーデック名です。\n" +"変換用のコーデックが不要な場合、この属性は *input_codec* と同じ値になります。" #: ../../library/email.charset.rst:96 msgid ":class:`Charset` instances also have the following methods:" @@ -192,7 +190,6 @@ msgstr "" "メッセージ本体のエンコードに使われる content-transfer-encoding の値を返しま" "す。" -#: ../../library/email.charset.rst:102 msgid "" "This is either the string ``quoted-printable`` or ``base64`` depending on " "the encoding used, or it is a function, in which case you should call the " @@ -200,11 +197,12 @@ msgid "" "function should then set the :mailheader:`Content-Transfer-Encoding` header " "itself to whatever is appropriate." msgstr "" -"この値は使用しているエンコーディングの文字列 ``quoted-printable`` または " -"``base64`` か、あるいは関数のいずれかです。後者の場合、これはエンコードされ" -"る Message オブジェクトを単一の引数として取るような関数である必要があります。" -"この関数は変換後 :mailheader:`Content-Transfer-Encoding` ヘッダ自体を、なんで" -"あれ適切な値に設定する必要があります。" +"使用するエンコーディングに応じて、文字列 ``quoted-printable`` または " +"``base64``、あるいは関数を返します。\n" +"関数の場合は、エンコードする Message オブジェクトを唯一の引数としてその関数を" +"呼び出してください。\n" +"その関数が :mailheader:`Content-Transfer-Encoding` ヘッダーを適切な値に設定し" +"ます。" #: ../../library/email.charset.rst:108 msgid "" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 8331101f0..b9982a72d 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -313,16 +313,15 @@ msgid "" "get_content` and :meth:`~email.message.EmailMessage.iter_parts`." msgstr "" -#: ../../library/email.compat32-message.rst:234 msgid "" "Set the entire message object's payload to *payload*. It is the client's " "responsibility to ensure the payload invariants. Optional *charset* sets " "the message's default character set; see :meth:`set_charset` for details." msgstr "" -"メッセージオブジェクト全体のペイロードを *payload* に設定します。クライアント" -"はペイロードを変更してはいけません。オプションの *charset* はメッセージのデ" -"フォルト文字セットを設定します。詳しくは :meth:`set_charset` を参照してくださ" -"い。" +"メッセージオブジェクトのペイロード全体を *payload* に設定します。\n" +"ペイロードが満たすべき条件を維持する責任は呼び出し側にあります。\n" +"省略可能な *charset* はメッセージのデフォルトの文字セットを設定します。\n" +"詳しくは :meth:`set_charset` を参照してください。" #: ../../library/email.compat32-message.rst:238 msgid "" @@ -557,16 +556,17 @@ msgstr "" "前のヘッダがメッセージ中に含まれていない場合は *failobj* (デフォルトでは " "``None``) が返されます。" -#: ../../library/email.compat32-message.rst:386 msgid "" "Extended header setting. This method is similar to :meth:`__setitem__` " "except that additional header parameters can be provided as keyword " "arguments. *_name* is the header field to add and *_value* is the *primary* " "value for the header." msgstr "" -"拡張ヘッダ設定。このメソッドは :meth:`__setitem__` と似ていますが、追加のヘッ" -"ダ・パラメータをキーワード引数で指定できるところが違っています。 *_name* に追" -"加するヘッダフィールドを、 *_value* にそのヘッダの *最初の* 値を渡します。" +"拡張ヘッダ設定。\n" +"このメソッドは :meth:`__setitem__` と似ていますが、追加のヘッダ・パラメータを" +"キーワード引数で指定できるところが違っています。\n" +"*_name* に追加するヘッダフィールドを、 *_value* にそのヘッダの *主たる* 値を" +"渡します。" #: ../../library/email.compat32-message.rst:391 msgid "" @@ -749,16 +749,16 @@ msgid "" "header objects returned by the header access methods." msgstr "" -#: ../../library/email.compat32-message.rst:496 msgid "" "Return the value of the :mailheader:`Content-Type` header's parameter " "*param* as a string. If the message has no :mailheader:`Content-Type` " "header or if there is no such parameter, then *failobj* is returned " "(defaults to ``None``)." msgstr "" -"メッセージの :mailheader:`Content-Type` ヘッダ中のパラメータ *param* を文字列" -"として返します。そのメッセージ中に :mailheader:`Content-Type` ヘッダが存在し" -"なかった場合、 *failobj* (デフォルトは ``None``) が返されます。" +":mailheader:`Content-Type` ヘッダーのパラメータ *param* の値を文字列で返しま" +"す。\n" +"メッセージに :mailheader:`Content-Type` ヘッダーがない場合、または指定された" +"パラメータがない場合は *failobj* (デフォルトは ``None``) を返します。" #: ../../library/email.compat32-message.rst:501 msgid "" @@ -768,7 +768,6 @@ msgstr "" "オプション引数 *header* が与えられた場合、 :mailheader:`Content-Type` のかわ" "りにそのヘッダが使用されます。" -#: ../../library/email.compat32-message.rst:504 msgid "" "Parameter keys are always compared case insensitively. The return value can " "either be a string, or a 3-tuple if the parameter was :rfc:`2231` encoded. " @@ -777,12 +776,15 @@ msgid "" "``None``, in which case you should consider ``VALUE`` to be encoded in the " "``us-ascii`` charset. You can usually ignore ``LANGUAGE``." msgstr "" -"パラメータのキー比較は常に大文字小文字を区別しません。返り値は文字列か 3 要素" -"のタプルで、タプルになるのはパラメータが :rfc:`2231` エンコードされている場合" -"です。3 要素タプルの場合、各要素の値は ``(CHARSET, LANGUAGE, VALUE)`` の形式" -"になっています。 ``CHARSET`` と ``LAGUAGE`` は ``None`` になることがあり、そ" -"の場合 ``VALUE`` は ``us-ascii`` 文字セットでエンコードされているとみなさなけ" -"ればならないので注意してください。普段は ``LANGUAGE`` を無視できます。" +"パラメータのキー比較は常に大文字小文字を区別しません。\n" +"返り値は文字列か 3 要素のタプルで、タプルになるのはパラメータが :rfc:`2231` " +"エンコードされている場合です。\n" +"3 要素タプルの場合、各要素の値は ``(CHARSET, LANGUAGE, VALUE)`` の形式になっ" +"ています。\n" +"``CHARSET`` と ``LANGUAGE`` は ``None`` になることがあり、その場合 ``VALUE`` " +"は ``us-ascii`` 文字セットでエンコードされているとみなさなければならないので" +"注意してください。\n" +"普段は ``LANGUAGE`` を無視できます。" #: ../../library/email.compat32-message.rst:512 msgid "" @@ -953,7 +955,6 @@ msgstr "" "quote します。そのメッセージが :mailheader:`Content-Type` ヘッダを含んでいな" "い場合、 :exc:`~email.errors.HeaderParseError` が発生します。" -#: ../../library/email.compat32-message.rst:612 msgid "" "Note that using this method is subtly different than deleting the old :" "mailheader:`Content-Type` header and adding a new one with the new boundary " @@ -964,20 +965,22 @@ msgid "" msgstr "" "注意: このメソッドを使うのは、古い :mailheader:`Content-Type` ヘッダを削除し" "て新しい boundary をもったヘッダを :meth:`add_header` で足すのとは少し違いま" -"す。 :meth:`set_boundary` は一連のヘッダ中での :mailheader:`Content-Type` " -"ヘッダの位置を保つからです。しかし、これは元の :mailheader:`Content-Type` " -"ヘッダ中に存在していた連続する行の順番までは *保ちません* 。" +"す。\n" +":meth:`set_boundary` は一連のヘッダ中での :mailheader:`Content-Type` ヘッダの" +"位置を保つからです。\n" +"しかし、これは元の :mailheader:`Content-Type` ヘッダ中に存在していた継続行は " +"*保持しません* 。" -#: ../../library/email.compat32-message.rst:622 msgid "" "Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " "coerced to lower case. If there is no :mailheader:`Content-Type` header, or " "if that header has no ``charset`` parameter, *failobj* is returned." msgstr "" "そのメッセージ中の :mailheader:`Content-Type` ヘッダにある、 ``charset`` パラ" -"メータの値を返します。値はすべて小文字に変換されます。メッセージ中に :" -"mailheader:`Content-Type` がなかったり、このヘッダ中に ``charaset`` パラメー" -"タがない場合には *failobj* が返されます。" +"メータの値を返します。\n" +"値はすべて小文字に変換されます。\n" +"メッセージ中に :mailheader:`Content-Type` がなかったり、このヘッダ中に " +"``charset`` パラメータがない場合には *failobj* が返されます。" #: ../../library/email.compat32-message.rst:626 msgid "" diff --git a/library/email.header.po b/library/email.header.po index 7d2f88a85..f663e9450 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -146,7 +146,6 @@ msgstr "" "場合 (デフォルト)、初期値の *s* および以後の :meth:`append` 呼び出しにおける" "文字集合として ``us-ascii`` が使われます。" -#: ../../library/email.header.rst:77 msgid "" "The maximum line length can be specified explicitly via *maxlinelen*. For " "splitting the first line to a shorter value (to account for the field header " @@ -155,12 +154,12 @@ msgid "" "value for *header_name* is ``None``, meaning it is not taken into account " "for the first line of a long, split header." msgstr "" -"行の最大長は *maxlinelen* によって明示的に指定できます。最初の行を (:" -"mailheader:`Subject` などの *s* に含まれないフィールドヘッダの責任をとるた" -"め) 短く切りとる場合、 *header_name* にそのフィールド名を指定してください。 " -"*maxlinelen* のデフォルト値は 78 であり、 *header_name* のデフォルト値は " -"``None`` です。これはその最初の行を長い、切りとられたヘッダとして扱わないこと" -"を意味します。" +"行の最大長は *maxlinelen* で明示的に指定できます。\n" +":mailheader:`Subject` など、*s* に含まれないフィールド名の長さを考慮して最初" +"の行を短くするには、*header_name* にフィールド名を渡してください。\n" +"*maxlinelen* のデフォルトは 78 です。\n" +"*header_name* のデフォルトは ``None`` で、この場合は長いヘッダーを折り返す" +"際、最初の行でフィールド名の長さを考慮しません。" #: ../../library/email.header.rst:84 msgid "" @@ -247,7 +246,6 @@ msgstr "" "返され、非 ASCII 部分は base64 または quoted-printable エンコーディングで包含" "されるでしょう。" -#: ../../library/email.header.rst:125 msgid "" "Optional *splitchars* is a string containing characters which should be " "given extra weight by the splitting algorithm during normal header " @@ -259,14 +257,16 @@ msgid "" "point when other split chars do not appear in the line being split. " "Splitchars does not affect :RFC:`2047` encoded lines." msgstr "" -"オプション引数 *splitchars* は、通常のヘッダーの折り返し処理の間に分割アルゴ" -"リズムによって特別な重みが与えられるべき文字を含む文字列です。これは、 :RFC:" -"`2822` の 'higher level syntactic breaks' の非常に荒いサポートです: " -"splitchar の後の分割点は、行分割において優先されます。 分割文字は文字列中での" -"出現順に優先されます。スペースとタブは、分割しようとする行に他の分割文字が出" -"現しない時に、分割点として他の文字と比べてどのような優先順位が与えられるべき" -"かを示すために、文字列に含めることができます。 Splitchars は :RFC:`2047` エン" -"コードされた行には影響しません。" +"省略可能な *splitchars* は、通常のヘッダーの折り返しで分割位置を決める際に優" +"先する文字を含む文字列です。\n" +"これは :RFC:`2822` の「上位の構文上の区切り」を大まかにサポートするもので" +"す。\n" +"指定された文字の直後を分割位置として優先し、その優先順位は文字列内での並び順" +"に従います。\n" +"スペースとタブもこの文字列に含められます。\n" +"これにより、分割する行に他の分割文字がない場合、スペースとタブのどちらを分割" +"位置として優先するかを指定できます。\n" +"``splitchars`` は :RFC:`2047` でエンコードされた行には影響しません。" #: ../../library/email.header.rst:135 msgid "" @@ -398,15 +398,15 @@ msgstr "" "charset)`` という形式の 2要素タプルからなるリストを返します。ここで " "*decoded_string* はデコードされた文字列、 *charset* はその文字集合です。" -#: ../../library/email.header.rst:222 msgid "" "This function takes one of those sequence of pairs and returns a :class:" "`Header` instance. Optional *maxlinelen*, *header_name*, and " "*continuation_ws* are as in the :class:`Header` constructor." msgstr "" -"この関数はこれらのリストの項目から、 :class:`Header` インスタンスを返します。" -"オプション引数 *maxlinelen* 、 *header_name* および *continuation_ws* は :" -"class:`Header` コンストラクタに与えるものと同じです。" +"この関数は、そのようなペアのシーケンスを受け取り、:class:`Header` インスタン" +"スを返します。\n" +"省略可能な *maxlinelen*、*header_name*、*continuation_ws* は :class:`Header` " +"コンストラクタと同じです。" #: ../../library/email.header.rst:228 msgid "" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 00e2014f3..61b7b974f 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -200,9 +200,10 @@ msgid "" "``BaseHeader`` itself. Such an ``init`` method should look like this::" msgstr "" "その後、 ``BaseHeader`` の ``__new__`` がヘッダのインスタンスを生成し、 " -"``init`` メソッドを呼び出します。 特殊クラスは、 ``BaseHeader`` が提供しない" -"属性を設定したい場合にのみ ``init`` メソッドを提供する必要があります。 このよ" -"うな ``init`` メソッドは以下のようなものです:" +"``init`` メソッドを呼び出します。\n" +"特殊クラスは、 ``BaseHeader`` が提供しない属性を設定したい場合にのみ " +"``init`` メソッドを提供する必要があります。\n" +"このような ``init`` メソッドは以下のようなものです。 ::" #: ../../library/email.headerregistry.rst:108 msgid "" @@ -277,13 +278,13 @@ msgid "" "`datetime.timezone` to record the timezone offset." msgstr "" -#: ../../library/email.headerregistry.rst:158 msgid "" "The ``decoded`` value of the header is determined by formatting the " "``datetime`` according to the :rfc:`5322` rules; that is, it is set to::" msgstr "" -"ヘッダーの ``decoded`` 値は、 ``datetime`` を :rfc:`5322` のルールに従って" -"フォーマットすることで決定されます。" +"ヘッダーの ``decoded`` 値は、``datetime`` を :rfc:`5322` の規則に従って書式化" +"したものです。\n" +"つまり、次のように設定されます。 ::" #: ../../library/email.headerregistry.rst:161 msgid "email.utils.format_datetime(self.datetime)" @@ -303,17 +304,16 @@ msgstr "" msgid "msg['Date'] = datetime(2011, 7, 15, 21)" msgstr "" -#: ../../library/email.headerregistry.rst:169 msgid "" "Because this is a naive ``datetime`` it will be interpreted as a UTC " "timestamp, and the resulting value will have a timezone of ``-0000``. Much " "more useful is to use the :func:`~email.utils.localtime` function from the :" "mod:`~email.utils` module::" msgstr "" -"これは単純な ``datetime`` であるため、UTC タイムスタンプとして解釈され、結果" -"として ``-0000`` というタイムゾーンを持つ値になります。 もっと便利なのは :" -"mod:`~email.utils` モジュールの :func:`~email.utils.localtime` 関数を使用する" -"ことです::" +"これはnaive な ``datetime`` であるため、UTC タイムスタンプとして解釈され、結" +"果として ``-0000`` というタイムゾーンを持つ値になります。\n" +"もっと便利なのは :mod:`~email.utils` モジュールの :func:`~email.utils." +"localtime` 関数を使用することです。 ::" #: ../../library/email.headerregistry.rst:174 msgid "msg['Date'] = utils.localtime()" diff --git a/library/email.message.po b/library/email.message.po index 9ec280c49..6a1a29fff 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -349,16 +349,17 @@ msgstr "" "前のヘッダがメッセージ中に含まれていない場合は *failobj* (デフォルトでは " "``None``) が返されます。" -#: ../../library/email.message.rst:263 msgid "" "Extended header setting. This method is similar to :meth:`__setitem__` " "except that additional header parameters can be provided as keyword " "arguments. *_name* is the header field to add and *_value* is the *primary* " "value for the header." msgstr "" -"拡張ヘッダ設定。このメソッドは :meth:`__setitem__` と似ていますが、追加のヘッ" -"ダ・パラメータをキーワード引数で指定できるところが違っています。 *_name* に追" -"加するヘッダフィールドを、 *_value* にそのヘッダの *最初の* 値を渡します。" +"拡張ヘッダ設定。\n" +"このメソッドは :meth:`__setitem__` と似ていますが、追加のヘッダ・パラメータを" +"キーワード引数で指定できるところが違っています。\n" +"*_name* に追加するヘッダフィールドを、 *_value* にそのヘッダの *主たる* 値を" +"渡します。" #: ../../library/email.message.rst:268 msgid "" @@ -576,16 +577,16 @@ msgid "" "the :mailheader:`Content-Type` header in the list of headers." msgstr "" -#: ../../library/email.message.rst:430 msgid "" "Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " "coerced to lower case. If there is no :mailheader:`Content-Type` header, or " "if that header has no ``charset`` parameter, *failobj* is returned." msgstr "" "そのメッセージ中の :mailheader:`Content-Type` ヘッダにある、 ``charset`` パラ" -"メータの値を返します。値はすべて小文字に変換されます。メッセージ中に :" -"mailheader:`Content-Type` がなかったり、このヘッダ中に ``charaset`` パラメー" -"タがない場合には *failobj* が返されます。" +"メータの値を返します。\n" +"値はすべて小文字に変換されます。\n" +"メッセージ中に :mailheader:`Content-Type` がなかったり、このヘッダ中に " +"``charset`` パラメータがない場合には *failobj* が返されます。" #: ../../library/email.message.rst:437 msgid "" diff --git a/library/email.mime.po b/library/email.mime.po index b5bf71cb2..8bc9ba362 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -381,7 +381,6 @@ msgstr "" "は ``utf-8`` がデフォルトになっています。 *_charset* パラメータは、文字列と :" "class:`~email.charset.Charset` インスタンスの両方を受け付けます。" -#: ../../library/email.mime.rst:244 msgid "" "Unless the *_charset* argument is explicitly set to ``None``, the MIMEText " "object created will have both a :mailheader:`Content-Type` header with a " @@ -395,13 +394,13 @@ msgid "" msgstr "" "``_charset`` 引数に明示的に ``None`` をセットしない限りは、作成される " "MIMEText オブジェクトは ``charset`` の付いた :mailheader:`Content-Type` ヘッ" -"ダと :mailheader:`Content-Transfer-Endcoding` ヘッダの両方を持ちます。これは" -"後続の ``set_payload`` 呼び出しが、 ``set_payload`` コマンドに charset が渡し" -"たとしてもエンコードされたペイロードにはならないことを意味します。 ``Content-" -"Transfer-Encoding`` ヘッダを削除することでこの振る舞いを「リセット」出来ま" -"す。これにより ``set_payload`` 呼び出しが新たなペイロードを自動的にエンコー" -"ド (そして新たな :mailheader:`Content-Transfer-Encoding` ヘッダを追加) しま" -"す。" +"ダと :mailheader:`Content-Transfer-Encoding` ヘッダの両方を持ちます。\n" +"これは後続の ``set_payload`` 呼び出しが、 ``set_payload`` コマンドに charset " +"を渡したとしてもエンコードされたペイロードにはならないことを意味します。\n" +"``Content-Transfer-Encoding`` ヘッダを削除することでこの振る舞いを「リセッ" +"ト」出来ます。\n" +"これにより ``set_payload`` 呼び出しが新たなペイロードを自動的にエンコード (そ" +"して新たな :mailheader:`Content-Transfer-Encoding` ヘッダを追加) します。" #: ../../library/email.mime.rst:256 msgid "*_charset* also accepts :class:`~email.charset.Charset` instances." diff --git a/library/email.parser.po b/library/email.parser.po index e8cc71d1f..c87af83a8 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -95,7 +95,6 @@ msgid "" "and results of the two parser APIs are identical." msgstr "" -#: ../../library/email.parser.rst:60 msgid "" "The :class:`BytesFeedParser`'s API is simple; you create an instance, feed " "it a bunch of bytes until there's no more to feed it, then close the parser " @@ -107,15 +106,19 @@ msgid "" "it found in a message. See the :mod:`email.errors` module for the list of " "defects that it can find." msgstr "" -":class:`BytesFeedParser` API は簡単です。まずインスタンスをつくり、それに " -"bytes を (それ以上 bytes が必要なくなるまで) 流しこみます。その後パーザを " -"close すると根っこ (root) のメッセージオブジェクトが返されます。標準に従った" -"メッセージを解析する場合、 :class:`BytesFeedParser` は非常に正確であり、標準" -"に従っていないメッセージでもちゃんと動きます。そのさい、これはメッセージがど" -"のように壊れていると認識されたかについての情報を残します。これはメッセージオ" -"ブジェクトの :attr:`~email.message.EmailMessage.defects` 属性にリストとして現" -"れ、メッセージ中に発見された問題が記録されます。パーザが検出できる障害 " -"(defect) については :mod:`email.errors` モジュールを参照してください。" +":class:`BytesFeedParser` API は簡単です。\n" +"まずインスタンスをつくり、それに bytes を (渡す bytes がなくなるまで) 流しこ" +"みます。\n" +"その後パーザを close すると根っこ (root) のメッセージオブジェクトが返されま" +"す。\n" +"標準に従ったメッセージを解析する場合、 :class:`BytesFeedParser` は非常に正確" +"であり、標準に従っていないメッセージでもちゃんと動きます。\n" +"そのさい、これはメッセージがどのように壊れていると認識されたかについての情報" +"を残します。\n" +"これはメッセージオブジェクトの :attr:`~email.message.EmailMessage.defects` 属" +"性にリストとして現れ、メッセージ中に発見された問題が記録されます。\n" +"パーザが検出できる障害 (defect) については :mod:`email.errors` モジュールを参" +"照してください。" #: ../../library/email.parser.rst:70 msgid "Here is the API for the :class:`BytesFeedParser`:" diff --git a/library/email.policy.po b/library/email.policy.po index 0ab95277e..4b8fd3e19 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -30,7 +30,6 @@ msgstr "" msgid "**Source code:** :source:`Lib/email/policy.py`" msgstr "**ソースコード:** :source:`Lib/email/policy.py`" -#: ../../library/email.policy.rst:13 msgid "" "The :mod:`email` package's prime focus is the handling of email messages as " "described by the various email and MIME RFCs. However, the general format " @@ -44,15 +43,17 @@ msgid "" "the standards, or that implement extensions you want to use in ways that " "violate the standards." msgstr "" -":mod:`email` パッケージの主要な目的は様々なEメールやMIMEのRFCで記述されたE" -"メールメッセージを取り扱うことにあります。しかし、Eメールメッセージの一般的な" -"フォーマット(名前の後にコロンが続き、コロンの後に値が続くという構成の複数の" -"ヘッダーフィールドのブロック、空白行、任意の 'body')はEメールの分野外での用途" -"が見いだされたフォーマットです。これらの用途には主となるEメールのRFCに厳密に" -"従っているものもあれば、そうでないものもあります。Eメールを使ったworkingのと" -"きでさえも、厳密なRFC準拠にしないのが望ましいことがあります。たとえば、基準に" -"従わないEメールサーバーと相互運用するEメールを作成するときや、基準に違反する" -"方法で使用したい拡張機能を実装するEメールを作成するときです。" +":mod:`email` パッケージの主な目的は、メールや MIME に関する各種 RFC に従って" +"メールメッセージを扱うことです。\n" +"しかし、メールの一般的な形式はメール以外の用途でも使われています。\n" +"この形式は、名前、コロン、値からなるヘッダーフィールドを並べたブロックと、そ" +"の後に続く空行、任意の「本文」で構成されます。\n" +"メール以外の用途には、主要なメールの RFC にほぼ準拠するものもあれば、そうでな" +"いものもあります。\n" +"メールを扱う場合でも、RFC への厳密な準拠を避けたいことがあります。\n" +"例えば、規格に従わないメールサーバーとやり取りするメールを生成する場合や、利" +"用したい拡張機能を規格に反する方法で実装しているサーバーとやり取りする場合で" +"す。" #: ../../library/email.policy.rst:25 msgid "" diff --git a/library/email.utils.po b/library/email.utils.po index 3932e6723..1d946c2e8 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -91,16 +91,17 @@ msgstr "" "がダブルクォートだった場合、それらは取り除かれます。同様に *str* の先頭と末尾" "が角ブラケット (<、>) だった場合もそれらは取り除かれます。" -#: ../../library/email.utils.rst:62 msgid "" "Parse address -- which should be the value of some address-containing field " "such as :mailheader:`To` or :mailheader:`Cc` -- into its constituent " "*realname* and *email address* parts. Returns a tuple of that information, " "unless the parse fails, in which case a 2-tuple of ``('', '')`` is returned." msgstr "" -":mailheader:`To` や :mailheader:`Cc` のようなフィールドを持つアドレスをパース" -"して、構成要素の *実名* と *電子メールアドレス* を取り出します。 パースに成功" -"した場合、これらの情報持つタプルを返します。失敗した場合は 2 要素のタプル " +"アドレスを解析して、構成要素である *実名* と *電子メールアドレス* に分けま" +"す。\n" +"渡すアドレスは :mailheader:`To` や :mailheader:`Cc` など、アドレスを含む" +"フィールドの値です。\n" +"解析に成功した場合はこれらの情報をタプルで返し、失敗した場合は 2 要素タプル " "``('', '')`` を返します。" #: ../../library/email.utils.rst:67 ../../library/email.utils.rst:95 @@ -305,13 +306,13 @@ msgstr "" "場合には、これは文字列でなければなりません。その場合にはクォートを除いた文字" "列を返します。" -#: ../../library/email.utils.rst:220 msgid "" "Decode parameters list according to :rfc:`2231`. *params* is a sequence of " "2-tuples containing elements of the form ``(content-type, string-value)``." msgstr "" -":rfc:`2231` に従って引数のリストをデコードします。 *params* は ``(content-" -"type, string-value)`` のような形式の 2 要素タプルです。" +":rfc:`2231` に従ってパラメータのリストをデコードします。\n" +"*params* は ``(content-type, string-value)`` 形式の 2 要素タプルからなるシー" +"ケンスです。" #: ../../library/email.utils.rst:225 msgid "Footnotes" diff --git a/library/ensurepip.po b/library/ensurepip.po index 65ee01394..274c377b6 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -41,18 +41,17 @@ msgid "" "interpreter." msgstr "" -#: ../../library/ensurepip.rst:21 msgid "" "In most cases, end users of Python shouldn't need to invoke this module " "directly (as ``pip`` should be bootstrapped by default), but it may be " "needed if installing ``pip`` was skipped when installing Python (or when " "creating a virtual environment) or after explicitly uninstalling ``pip``." msgstr "" -"ほとんどの場合、Python のエンドユーザーがこのモジュールを直接呼び出す必要はな" -"いでしょう(``pip`` はデフォルトでブートストラップされるからです)。しかし、も" -"し Python のインストール時に ``pip`` のインストールをスキップしたり、仮想環境" -"を構築したり、明示的に ``pip`` をアンインストールした場合、直接呼び出す必要が" -"あるかもしれません。" +"通常、``pip`` はデフォルトでブートストラップされるため、Python のエンドユー" +"ザーがこのモジュールを直接呼び出す必要はありません。\n" +"ただし、Python のインストール時や仮想環境の作成時に ``pip`` のインストールを" +"省略した場合や、``pip`` を明示的にアンインストールした場合には、必要になるこ" +"とがあります。" #: ../../library/ensurepip.rst:29 msgid "" @@ -116,17 +115,16 @@ msgstr "最も簡単な起動方法は::" msgid "python -m ensurepip" msgstr "" -#: ../../library/ensurepip.rst:58 msgid "" "This invocation will install ``pip`` if it is not already installed, but " "otherwise does nothing. To ensure the installed version of ``pip`` is at " "least as recent as the one available in ``ensurepip``, pass the ``--" "upgrade`` option::" msgstr "" -"この起動方法は ``pip`` をインストールします。既にインストールされていた場合は" -"何もしません。インストールされた ``pip`` のバージョンを ``ensurepip`` で利用" -"できるもののうち、できるだけ新しいものにするためには、``--upgrade`` オプショ" -"ンを追加して::" +"この方法で起動すると、``pip`` が未インストールならインストールし、インストー" +"ル済みなら何もしません。\n" +"インストールされている ``pip`` を、``ensurepip`` に同梱されたものと同じかそれ" +"より新しいバージョンにするには、``--upgrade`` オプションを指定します。 ::" #: ../../library/ensurepip.rst:63 msgid "python -m ensurepip --upgrade" diff --git a/library/enum.po b/library/enum.po index e9bbe2f4e..392b0bc63 100644 --- a/library/enum.po +++ b/library/enum.po @@ -483,13 +483,12 @@ msgid "" "True" msgstr "" -#: ../../library/enum.rst:216 msgid "" "Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " "in a containment check." msgstr "" -"Python 3.12 以前では、非Enumメンバーの包含判定が行われた場合、``TypeError`` " -"が送出されます。" +"Python 3.12 より前では、非Enumメンバーの包含判定が行われた場合、" +"``TypeError`` が送出されます。" #: ../../library/enum.rst:221 msgid "" @@ -507,11 +506,12 @@ msgid "" "'__module__', '__name__', '__qualname__']" msgstr "" -#: ../../library/enum.rst:229 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" -msgstr "*cls* 内の一致するメンバーを返すか、:exc:`KeyError` を送出します::" +msgstr "" +"*cls* 内で *name* に一致する Enum メンバーを返します。\n" +"見つからなければ :exc:`KeyError` を送出します。 ::" #: ../../library/enum.rst:231 msgid "" @@ -1045,9 +1045,9 @@ msgid "" "False" msgstr "" -#: ../../library/enum.rst:634 msgid "Returns all contained non-alias members::" -msgstr "エイリアスでない、全てのメンバーを返します::" +msgstr "" +"このフラグに含まれるメンバーのうち、エイリアスでないものをすべて返します。 ::" #: ../../library/enum.rst:636 msgid "" @@ -1294,13 +1294,13 @@ msgid "" "ValueError: invalid enum 'Color': missing values 3, 4" msgstr "" -#: ../../library/enum.rst:818 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" -"任意のフラググループ/マスクが、名前付きフラグのみを含むことを確認します -- 値" -"を指定するのではなく、:func:`auto` によって生成される場合に便利です::" +"フラグのグループやマスクに、名前付きのフラグだけが含まれることを確認しま" +"す。\n" +":func:`auto` で値を生成する代わりに、値を直接指定する場合に便利です。 ::" #: ../../library/enum.rst:821 msgid "" @@ -1451,13 +1451,12 @@ msgstr ":attr:`~Enum._name_` -- メンバー名" msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr ":attr:`~Enum._value_` -- メンバーの値; ``__new__`` で設定できます" -#: ../../library/enum.rst:945 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" ":meth:`~Enum._missing_` -- 値が見付からなかったときに使われる検索関数; オー" -"バーライドされていることがあります" +"バーライドできます" #: ../../library/enum.rst:947 msgid "" @@ -1475,13 +1474,13 @@ msgid "" "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:953 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" ":meth:`~Enum._generate_next_value_` -- 列挙型のメンバーの適切な値を取得するの" -"に使われます。オーバーライドされます。" +"に使われます。\n" +"オーバーライドできます。" #: ../../library/enum.rst:956 msgid "" diff --git a/library/errno.po b/library/errno.po index 0ec9072a3..b5d241b87 100644 --- a/library/errno.po +++ b/library/errno.po @@ -438,11 +438,10 @@ msgstr "" msgid "Illegal byte sequence" msgstr "不正なバイト列です (Illegal byte sequence)" -#: ../../library/errno.rst:461 msgid "Interrupted system call should be restarted" msgstr "" -"割り込みシステムコールを復帰しなければなりません (Interrupted system call " -"should be restarted)" +"割り込まれたシステムコールを再実行する必要があります (Interrupted system " +"call should be restarted)" #: ../../library/errno.rst:466 msgid "Streams pipe error" diff --git a/library/faulthandler.po b/library/faulthandler.po index 0d49b451f..b966597e9 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -27,7 +27,6 @@ msgstr "" msgid ":mod:`!faulthandler` --- Dump the Python traceback" msgstr ":mod:`!faulthandler` --- Python トレースバックをダンプする" -#: ../../library/faulthandler.rst:11 msgid "" "This module contains functions to dump Python tracebacks explicitly, on a " "fault, after a timeout, or on a user signal. Call :func:`faulthandler." @@ -37,14 +36,16 @@ msgid "" "setting the :envvar:`PYTHONFAULTHANDLER` environment variable or by using " "the :option:`-X` ``faulthandler`` command line option." msgstr "" -"このモジュールは、例外発生時、タイムアウト時、ユーザシグナルの発生時などのタ" -"イミングでpython tracebackを明示的にダンプするための関数を含んでいます。これ" -"らのシグナル、:const:`~signal.SIGSEGV`、:const:`~signal.SIGFPE`、:const:" -"`~signal.SIGABRT`、:const:`~signal.SIGBUS`、:const:`~signal.SIGILL` に対する" -"フォールトハンドラをインストールするには :func:`faulthandler.enable` を実行し" -"てください。python起動時に有効にするには環境変数 :envvar:" -"`PYTHONFAULTHANDLER` を設定するか、コマンドライン引数に :option:`-X` " -"``faulthandler`` を指定してください。" +"このモジュールには、Python のトレースバックを明示的にダンプしたり、フォールト" +"の発生時、タイムアウト後、ユーザーシグナルの受信時にダンプしたりする関数があ" +"ります。\n" +":const:`~signal.SIGSEGV`、:const:`~signal.SIGFPE`、:const:`~signal." +"SIGABRT`、:const:`~signal.SIGBUS`、:const:`~signal.SIGILL` シグナルに対する" +"フォールトハンドラを登録するには、:func:`faulthandler.enable` を呼び出してく" +"ださい。\n" +"環境変数 :envvar:`PYTHONFAULTHANDLER` を設定するか、コマンドラインオプショ" +"ン :option:`-X` ``faulthandler`` を指定すると、起動時に有効にすることもできま" +"す。" #: ../../library/faulthandler.rst:19 msgid "" @@ -83,12 +84,11 @@ msgstr "" msgid "Each string is limited to 500 characters." msgstr "すべての文字列は500文字以内に制限されています。" -#: ../../library/faulthandler.rst:32 msgid "" "Only the filename, the function name and the line number are displayed. (no " "source code)" msgstr "" -"ファイル名、関数名、行数のみ表示します。(ソースコードの表示はありません)" +"ファイル名、関数名、行番号だけを表示します (ソースコードは表示しません)。" #: ../../library/faulthandler.rst:34 msgid "" @@ -96,9 +96,8 @@ msgid "" "*max_threads*)." msgstr "" -#: ../../library/faulthandler.rst:36 msgid "The order is reversed: the most recent call is shown first." -msgstr "順番は保持されます: 最新の呼び出しが最初に表示されます。" +msgstr "順序は逆で、最も新しい呼び出しから表示します。" #: ../../library/faulthandler.rst:38 msgid "" diff --git a/library/fcntl.po b/library/fcntl.po index 2692da483..492f1642b 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -373,9 +373,10 @@ msgstr "" "引数 ``fd``, ``cmd``, ``len``, ``start``, ``whence`` を指定して :ref:`監査イ" "ベント ` ``fcntl.lockf`` を送出します。" -#: ../../library/fcntl.rst:248 msgid "Examples (all on a SVR4 compliant system)::" -msgstr "以下に (全ての SVR4 互換システムでの) 例を示します::" +msgstr "" +"以下に例を示します。\n" +"いずれも SVR4 準拠のシステムで実行したものです。 ::" #: ../../library/fcntl.rst:250 msgid "" diff --git a/library/filecmp.po b/library/filecmp.po index 597f369f6..da18a69a0 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -253,9 +253,8 @@ msgstr "" "*a* と *b* の両方に存在し、クラスのファイル比較オペレータに基づいて内容が異な" "るファイルです。" -#: ../../library/filecmp.rst:176 msgid "Files which are in both *a* and *b*, but could not be compared." -msgstr "*a* および *b* 両方にあるが、比較されなかったファイルです。" +msgstr "*a* と *b* の両方に存在するものの、比較できなかったファイルです。" #: ../../library/filecmp.rst:181 msgid "" diff --git a/library/fileinput.po b/library/fileinput.po index 2fb292113..85aa18714 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -129,16 +129,16 @@ msgstr "" msgid "The following function is the primary interface of this module:" msgstr "以下の関数がこのモジュールの基本的なインターフェースです:" -#: ../../library/fileinput.rst:58 msgid "" "Create an instance of the :class:`FileInput` class. The instance will be " "used as global state for the functions of this module, and is also returned " "to use during iteration. The parameters to this function will be passed " "along to the constructor of the :class:`FileInput` class." msgstr "" -":class:`FileInput` クラスのインスタンスを作ります。生成されたインスタンスは、" -"このモジュールの関数群が利用するグローバルな状態として利用されます。この関数" -"への引数は :class:`FileInput` クラスのコンストラクタへ渡されます。" +":class:`FileInput` クラスのインスタンスを作成します。\n" +"このインスタンスはモジュール内の関数が使うグローバルな状態になり、反復処理に" +"使えるよう戻り値としても返されます。\n" +"この関数の引数は :class:`FileInput` クラスのコンストラクタに渡されます。" #: ../../library/fileinput.rst:63 msgid "" diff --git a/library/fnmatch.po b/library/fnmatch.po index 2b656d4f0..c3c590425 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -88,7 +88,6 @@ msgstr "" "リテラルにマッチさせるには、メタ文字を括弧に入れてください。例えば、" "``'[?]'`` は文字 ``'?'`` にマッチします。" -#: ../../library/fnmatch.rst:43 msgid "" "Note that the filename separator (``'/'`` on Unix) is *not* special to this " "module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses :" @@ -96,11 +95,12 @@ msgid "" "with a period are not special for this module, and are matched by the ``*`` " "and ``?`` patterns." msgstr "" -"ファイル名の区切り文字 (Unixでは ``'/'``) はこのモジュールに固有なものでは *" -"ない* ことに注意してください。パス名展開については、 :mod:`glob` モジュールを" -"参照してください (:mod:`glob` はパス名の部分にマッチさせるのに :func:`." -"filter` を使っています)。同様に、ピリオドで始まるファイル名はこのモジュールに" -"固有ではなくて、 ``*`` と ``?`` のパターンでマッチします。" +"ファイル名の区切り文字 (Unix では ``'/'``) は、このモジュールでは特別扱い *さ" +"れません*。\n" +"パス名の展開については :mod:`glob` モジュールを参照してください (:mod:`glob` " +"はパス名の各部分の照合に :func:`.filter` を使います)。\n" +"同様に、ピリオドで始まるファイル名も特別扱いされず、``*`` や ``?`` のパターン" +"にマッチします。" #: ../../library/fnmatch.rst:49 msgid "" diff --git a/library/ftplib.po b/library/ftplib.po index 19face4d8..bb7411bd9 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -362,7 +362,6 @@ msgid "" "parameter callable that is called on each line after it is sent." msgstr "" -#: ../../library/ftplib.rst:327 msgid "" "Initiate a transfer over the data connection. If the transfer is active, " "send an ``EPRT`` or ``PORT`` command and the transfer command specified by " @@ -370,10 +369,12 @@ msgid "" "``EPSV`` or ``PASV`` command, connect to it, and start the transfer " "command. Either way, return the socket for the connection." msgstr "" -"データ接続中に転送を初期化します。もし転送中なら、``EPRT`` あるいは ``PORT`` " -"コマンドと、*cmd* で指定したコマンドを送信し、接続を続けます。サーバがパッシ" -"ブなら、``EPSV`` あるいは ``PASV`` コマンドを送信して接続し、転送コマンドを開" -"始します。どちらの場合も、接続のためのソケットを返します。" +"データ接続での転送を開始します。\n" +"アクティブモードの場合は ``EPRT`` または ``PORT`` コマンドと、*cmd* で指定さ" +"れた転送コマンドを送信して、接続を受け入れます。\n" +"パッシブモードの場合は ``EPSV`` または ``PASV`` コマンドを送信してサーバーに" +"接続し、転送コマンドを開始します。\n" +"どちらの場合も、その接続のソケットを返します。" #: ../../library/ftplib.rst:333 msgid "" @@ -388,16 +389,16 @@ msgid "" "simply call :meth:`transfercmd` without a *rest* argument." msgstr "" -#: ../../library/ftplib.rst:346 msgid "" "Like :meth:`transfercmd`, but returns a tuple of the data connection and the " "expected size of the data. If the expected size could not be computed, " "``None`` will be returned as the expected size. *cmd* and *rest* means the " "same thing as in :meth:`transfercmd`." msgstr "" -":meth:`transfercmd` と同様ですが、データと予想されるサイズとのタプルを返しま" -"す。もしサイズが計算できないなら、サイズの代わりに ``None`` が返されます。 " -"*cmd* と *rest* は :meth:`transfercmd` のものと同じです。" +":meth:`transfercmd` と同様ですが、データ接続と転送データの予想サイズのタプル" +"を返します。\n" +"予想サイズを計算できない場合、その要素は ``None`` になります。\n" +"*cmd* と *rest* の意味は :meth:`transfercmd` と同じです。" #: ../../library/ftplib.rst:354 msgid "" @@ -441,15 +442,15 @@ msgstr "" msgid "Rename file *fromname* on the server to *toname*." msgstr "サーバ上のファイルのファイル名 *fromname* を *toname* へ変更します。" -#: ../../library/ftplib.rst:395 msgid "" "Remove the file named *filename* from the server. If successful, returns " "the text of the response, otherwise raises :exc:`error_perm` on permission " "errors or :exc:`error_reply` on other errors." msgstr "" -"サーバからファイル *filename* を削除します。成功したら応答のテキストを返し、" -"そうでないならパーミッションエラーでは :exc:`error_perm` を、他のエラーでは :" -"exc:`error_reply` を返します。" +"サーバーから *filename* という名前のファイルを削除します。\n" +"成功した場合は応答のテキストを返します。\n" +"失敗した場合は、権限のエラーなら :exc:`error_perm`、それ以外のエラーなら :" +"exc:`error_reply` を送出します。" #: ../../library/ftplib.rst:402 msgid "Set the current directory on the server." @@ -478,7 +479,6 @@ msgstr "" "整数で返され、そうでないなら ``None`` が返されます。 ``SIZE`` コマンドは標準" "化されていませんが、多くの普通のサーバで実装されていることに注意して下さい。" -#: ../../library/ftplib.rst:430 msgid "" "Send a ``QUIT`` command to the server and close the connection. This is the " "\"polite\" way to close a connection, but it may raise an exception if the " @@ -486,11 +486,11 @@ msgid "" "to the :meth:`close` method which renders the :class:`FTP` instance useless " "for subsequent calls (see below)." msgstr "" -"サーバに ``QUIT`` コマンドを送信し、接続を閉じます。これは接続を閉じるのに" -"\"礼儀正しい\"方法ですが、 ``QUIT`` コマンドに反応してサーバの例外が発生する" -"かもしれません。この例外は、 :meth:`close` メソッドによって :class:`FTP` イン" -"スタンスに対するその後のコマンド使用が不可になっていることを示しています(下" -"記参照)。" +"サーバーに ``QUIT`` コマンドを送信して接続を閉じます。\n" +"これは接続を閉じる「礼儀正しい」方法ですが、サーバーが ``QUIT`` コマンドにエ" +"ラーを返した場合には例外が送出されることがあります。\n" +"この処理では :meth:`close` メソッドも呼び出されるため、その後は :class:`FTP` " +"インスタンスを使えなくなります (下記参照)。" #: ../../library/ftplib.rst:439 msgid "" @@ -540,22 +540,19 @@ msgstr "" msgid "Added the *source_address* parameter." msgstr "" -#: ../../library/ftplib.rst:500 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" -"このクラスは :attr:`ssl.SSLContext.check_hostname` と *Server Name " -"Indication* でホスト名のチェックをサポートしました。(:const:`ssl.HAS_SNI` を" -"参照してください)。" +"このクラスは :attr:`ssl.SSLContext.check_hostname` によるホスト名の検証と、" +"*Server Name Indication* に対応しました (:const:`ssl.HAS_SNI` を参照)。" #: ../../library/ftplib.rst:511 msgid "The deprecated *keyfile* and *certfile* parameters have been removed." msgstr "非推奨の *keyfile* と *certfile* 引数を削除しました。" -#: ../../library/ftplib.rst:514 msgid "Here's a sample session using the :class:`FTP_TLS` class::" -msgstr ":class:`FTP_TLS` クラスを使ったサンプルセッションはこちらです:" +msgstr ":class:`FTP_TLS` クラスを使ったセッションの例を示します。 ::" #: ../../library/ftplib.rst:516 msgid "" @@ -638,17 +635,16 @@ msgstr "" "File Transfer Protocol の応答仕様に適合しない、すなわち1--5の数字で始まらない" "応答コードをサーバから受け取った時に発生する例外。" -#: ../../library/ftplib.rst:582 msgid "" "The set of all exceptions (as a tuple) that methods of :class:`FTP` " "instances may raise as a result of problems with the FTP connection (as " "opposed to programming errors made by the caller). This set includes the " "four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." msgstr "" -":class:`FTP` インスタンスのメソッド実行時、FTP接続で (プログラミングのエラー" -"と考えられるメソッドの実行によって) 発生する全ての例外 (タプル形式)。この例外" -"には以上の4つのエラーはもちろん、 :exc:`OSError` と :exc:`EOFError` も含まれ" -"ます。" +":class:`FTP` インスタンスのメソッドが FTP 接続の問題によって送出する可能性の" +"ある例外を、すべてまとめたタプルです。\n" +"呼び出し側のプログラミング上の誤りによる例外は含みません。\n" +"上記の 4 つの例外に加え、:exc:`OSError` と :exc:`EOFError` も含まれます。" #: ../../library/ftplib.rst:590 msgid "Module :mod:`netrc`" diff --git a/library/functional.po b/library/functional.po index ca440f224..f941686dd 100644 --- a/library/functional.po +++ b/library/functional.po @@ -26,13 +26,12 @@ msgstr "" msgid "Functional Programming Modules" msgstr "関数型プログラミング用モジュール" -#: ../../library/functional.rst:5 msgid "" "The modules described in this chapter provide functions and classes that " "support a functional programming style, and general operations on callables." msgstr "" -"この章では、関数型プログラミングスタイルをサポートする呼び出し可能で汎用な操" -"作を実現する関数やクラスについて説明します。" +"この章で説明するモジュールは、関数型プログラミングのスタイルをサポートする関" +"数やクラスと、呼び出し可能オブジェクトに対する汎用的な操作を提供します。" #: ../../library/functional.rst:8 msgid "The following modules are documented in this chapter:" diff --git a/library/functools.po b/library/functools.po index 5a86d7d77..872d69ff4 100644 --- a/library/functools.po +++ b/library/functools.po @@ -130,7 +130,6 @@ msgid "" "defined. In contrast, a *cached_property* allows writes." msgstr "" -#: ../../library/functools.rst:82 msgid "" "The *cached_property* decorator only runs on lookups and only when an " "attribute of the same name doesn't exist. When it does run, the " @@ -138,10 +137,11 @@ msgid "" "attribute reads and writes take precedence over the *cached_property* method " "and it works like a normal attribute." msgstr "" -"*cached_property* デコレータはルックアップテーブルで、同名の属性が存在しない" -"場合のみ動作します。動作した場合、 *cached_property* は同名の属性に書き込みを" -"行います。その後の属性の読み込みと書き込みは *cached_property* メソッドより優" -"先され、通常の属性のように働きます。" +"*cached_property* デコレータが実行されるのは、属性が検索され、かつ同名の属性" +"がまだ存在しない場合だけです。\n" +"実行されると、*cached_property* は同名の属性に値を書き込みます。\n" +"その後の属性の読み書きは *cached_property* メソッドより優先されるため、通常の" +"属性と同じように動作します。" #: ../../library/functools.rst:88 msgid "" @@ -162,14 +162,14 @@ msgid "" "property access." msgstr "" -#: ../../library/functools.rst:99 msgid "" "Note, this decorator interferes with the operation of :pep:`412` key-sharing " "dictionaries. This means that instance dictionaries can take more space " "than usual." msgstr "" -"このデコレータは :pep:`412` のキー共有辞書のインターフェースを持ちます。これ" -"は、インスタンス辞書がより多くのスペースを使う可能性があることを意味します。" +"このデコレータは :pep:`412` のキー共有辞書の動作を妨げる点に注意してくださ" +"い。\n" +"そのため、インスタンスの辞書が通常より多くのメモリを使うことがあります。" #: ../../library/functools.rst:103 msgid "" @@ -261,17 +261,16 @@ msgstr "" "結果のキャッシュには辞書が使われるので、関数の位置引数およびキーワード引数" "は :term:`ハッシュ可能 ` でなくてはなりません。" -#: ../../library/functools.rst:166 msgid "" "Distinct argument patterns may be considered to be distinct calls with " "separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " "differ in their keyword argument order and may have two separate cache " "entries." msgstr "" -"引数のパターンが異なる場合は、異なる呼び出しと見なされ別々のキャッシュエント" -"リーとなります。\n" -"例えば、 ``f(a=1, b=2)`` と ``f(b=2, a=1)`` はキーワード引数の順序が異なって" -"いるので、2つの別個のキャッシュエントリーになります。" +"引数のパターンが異なると、別の呼び出しとして扱われ、個別のキャッシュエント" +"リーになることがあります。\n" +"例えば、``f(a=1, b=2)`` と ``f(b=2, a=1)`` はキーワード引数の順序が異なるた" +"め、2 つの別々のキャッシュエントリーになる可能性があります。" #: ../../library/functools.rst:171 msgid "" @@ -337,15 +336,14 @@ msgid "" "invalidating the cache." msgstr "" -#: ../../library/functools.rst:213 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " "the cache, or for rewrapping the function with a different cache." msgstr "" -"元々の基底の関数には、 :attr:`__wrapped__` 属性を通してアクセスできます。これ" -"はキャッシュを回避して、または関数を別のキャッシュでラップして、内観するのに" -"便利です。" +"ラップされた元の関数には :attr:`__wrapped__` 属性でアクセスできます。\n" +"これは内観やキャッシュの回避、別のキャッシュによる関数のラップし直しに便利で" +"す。" #: ../../library/functools.rst:217 msgid "" @@ -643,7 +641,6 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:429 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -651,11 +648,11 @@ msgid "" "argument, even before the *args* and *keywords* supplied to the :class:" "`partialmethod` constructor." msgstr "" -"*func* が記述子以外の呼び出し可能オブジェクトである場合、適切な束縛メソッドが" -"動的に作成されます。この func は、メソッドとして使用された場合、Python の通常" -"の関数と同様に動作します。 :class:`partialmethod` コンストラクタに *args* と " -"*keywords* が渡されるよりも前に、 *self* 引数が最初の位置引数として挿入されま" -"す。" +"*func* が記述子ではない呼び出し可能オブジェクトの場合、適切な束縛メソッドを動" +"的に作成します。\n" +"これは通常の Python 関数をメソッドとして使う場合と同じように動作します。\n" +"*self* 引数は、:class:`partialmethod` コンストラクタに渡した *args* や " +"*keywords* よりも前に、最初の位置引数として挿入されます。" #: ../../library/functools.rst:437 msgid "" @@ -898,7 +895,6 @@ msgid "" "0.615" msgstr "" -#: ../../library/functools.rst:615 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -906,10 +902,11 @@ msgid "" "class:`object` type, which means it is used if no better implementation is " "found." msgstr "" -"特定の型について登録された実装が存在しない場合、その型のメソッド解決順序が、" -"汎用の実装をさらに検索するために使用されます。``@singledispatch`` でデコレー" -"トされた元の関数は基底の :class:`object` 型に登録されます。これは、他によりよ" -"い実装が見つからないことを意味します。" +"特定の型に対する実装が登録されていない場合、その型のメソッド解決順序に従っ" +"て、より汎用的な実装を探します。\n" +"``@singledispatch`` でデコレートした元の関数は、基底型 :class:`object` に対す" +"る実装として登録されます。\n" +"そのため、より適切な実装が見つからなければ元の関数が使われます。" #: ../../library/functools.rst:621 msgid "" @@ -1110,15 +1107,14 @@ msgid "" "attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:756 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -"ラップされた関数が ``__wrapped__`` を定義していない場合でも、 " -"``__wrapped__`` が常にラップされた関数を参照するようになりました。(:issue:" -"`17482` を参照)" +"ラップされた関数が ``__wrapped__`` を定義している場合でも、 ``__wrapped__`` " +"が常にラップされた関数を参照するようになりました。\n" +"(:issue:`17482` を参照)" #: ../../library/functools.rst:761 msgid "" diff --git a/library/gc.po b/library/gc.po index 88eaa1906..ebc09feea 100644 --- a/library/gc.po +++ b/library/gc.po @@ -279,7 +279,6 @@ msgstr "" "引数 ``objs`` を指定して :ref:`監査イベント ` ``gc.get_referrers`` " "を送出します。" -#: ../../library/gc.rst:180 msgid "" "Return a list of objects directly referred to by any of the arguments. The " "referents returned are those objects visited by the arguments' C-level :c:" @@ -290,14 +289,15 @@ msgid "" "example, if an integer is directly reachable from an argument, that integer " "object may or may not appear in the result list." msgstr "" -"引数で指定したオブジェクトのいずれかから参照されている、全てのオブジェクトの" -"リストを返します。参照先のオブジェクトは、引数で指定したオブジェクトの Cレベ" -"ルメソッド :c:member:`~PyTypeObject.tp_traverse` で取得し、全てのオブジェクト" -"が直接到達可能な全てのオブジェクトを返すわけではありません。 :c:member:" -"`~PyTypeObject.tp_traverse` はガベージコレクションをサポートするオブジェクト" -"のみが実装しており、ここで取得できるオブジェクトは循環参照の一部となる可能性" -"のあるオブジェクトのみです。従って、例えば整数オブジェクトが直接到達可能で" -"あっても、このオブジェクトは戻り値には含まれません。" +"引数のいずれかから直接参照されているオブジェクトのリストを返します。\n" +"返される参照先は、各引数の C レベルの :c:member:`~PyTypeObject.tp_traverse` " +"メソッド (存在する場合) がたどったオブジェクトであり、実際に直接到達できるオ" +"ブジェクトがすべて含まれるとは限りません。\n" +":c:member:`~PyTypeObject.tp_traverse` メソッドをサポートするのはガベージコレ" +"クションをサポートするオブジェクトだけで、循環参照に関与し得るオブジェクトだ" +"けをたどることが要求されます。\n" +"例えば、引数から整数オブジェクトに直接到達できる場合、その整数が結果のリスト" +"に含まれることも、含まれないこともあります。" msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " @@ -390,13 +390,12 @@ msgstr "" msgid "Return the number of objects in the permanent generation." msgstr "Permanent世代領域にあるオブジェクトの数を返します。" -#: ../../library/gc.rst:266 msgid "" "The following variables are provided for read-only access (you can mutate " "the values but should not rebind them):" msgstr "" -"以下の変数は読み出し専用アクセスのために提供されています。(この変数を操作する" -"ことはできますが、その値は記憶されません):" +"以下の変数は読み出し専用で提供されます (参照先の値を変更することはできます" +"が、変数に別の値を再代入すべきではありません):" #: ../../library/gc.rst:271 msgid "" diff --git a/library/getpass.po b/library/getpass.po index a4496511b..9290e3d56 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -45,7 +45,6 @@ msgstr "" msgid "The :mod:`!getpass` module provides two functions:" msgstr "" -#: ../../library/getpass.rst:17 msgid "" "Prompt the user for a password without echoing. The user is prompted using " "the string *prompt*, which defaults to ``'Password: '``. On Unix, the " @@ -54,12 +53,13 @@ msgid "" "dev/tty`) or if that is unavailable to ``sys.stderr`` (this argument is " "ignored on Windows)." msgstr "" -"エコーなしでユーザーにパスワードを入力させるプロンプト。ユーザーは *prompt* " -"の文字列をプロンプトに使え、デフォルトは ``'Password: '`` です。 Unixではプロ" -"ンプトはファイルに似たオブジェクト *stream* へ、必要なら置き換えられたエラー" -"ハンドラを使って出力されます。 *stream* のデフォルトは、制御端末(:file:`/dev/" -"tty`)か、それが利用できない場合は ``sys.stderr`` です (この引数は Windowsでは" -"無視されます)。" +"エコーなしでユーザーにパスワードを入力させるプロンプト。\n" +"ユーザーは *prompt* の文字列をプロンプトに使え、デフォルトは ``'Password: " +"'`` です。\n" +"Unixではプロンプトはファイルに似たオブジェクト *stream* へ、必要なら " +"``replace`` エラーハンドラを使って出力されます。\n" +"*stream* のデフォルトは、制御端末(:file:`/dev/tty`)か、それが利用できない場合" +"は ``sys.stderr`` です (この引数は Windowsでは無視されます)。" #: ../../library/getpass.rst:24 msgid "" @@ -80,13 +80,12 @@ msgstr "" "メッセージを出力し、 ``sys.stdin`` から読み込み、 :exc:`GetPassWarning` 警告" "を発生させます。" -#: ../../library/getpass.rst:35 msgid "" "If you call getpass from within IDLE, the input may be done in the terminal " "you launched IDLE from rather than the idle window itself." msgstr "" -"IDLE から getpass を呼び出した場合、入力はIDLEのウィンドウではなく、IDLE を起" -"動したターミナルから行われます。" +"IDLE 内から ``getpass()`` を呼び出すと、IDLE のウィンドウではなく、IDLE を起" +"動したターミナルで入力することになる場合があります。" #: ../../library/getpass.rst:39 msgid "" @@ -141,11 +140,10 @@ msgid "" "terminal's control character configuration." msgstr "" -#: ../../library/getpass.rst:65 msgid "A :exc:`UserWarning` subclass issued when password input may be echoed." msgstr "" -":exc:`UserWarning` のサブクラスで、入力がエコーされてしまった場合に発生しま" -"す。" +"パスワードの入力内容がエコーされる可能性がある場合に発行される、:exc:" +"`UserWarning` のサブクラスです。" #: ../../library/getpass.rst:70 msgid "Return the \"login name\" of the user." diff --git a/library/gettext.po b/library/gettext.po index b6c161ad5..2a79dd0e8 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -519,7 +519,6 @@ msgid "" "The following methods are overridden from the base class implementation:" msgstr "以下のメソッドは基底クラスの実装からオーバライドされています:" -#: ../../library/gettext.rst:327 msgid "" "Look up the *message* id in the catalog and return the corresponding message " "string, as a Unicode string. If there is no entry in the catalog for the " @@ -527,8 +526,8 @@ msgid "" "fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the " "*message* id is returned." msgstr "" -"カタログから *message* id を検索して、対応するメッセージ文字列を Unicode でエ" -"ンコードして返します。\n" +"カタログから *message* id を検索して、対応するメッセージ文字列を Unicode 文字" +"列として返します。\n" "*message* id に対応するエントリがカタログに存在せず、フォールバックが設定され" "ている場合、検索処理をフォールバックの :meth:`~NullTranslations.gettext` メ" "ソッドに移譲します。\n" @@ -571,7 +570,6 @@ msgid "" " n) % {'num': n}" msgstr "" -#: ../../library/gettext.rst:357 msgid "" "Look up the *context* and *message* id in the catalog and return the " "corresponding message string, as a Unicode string. If there is no entry in " @@ -579,11 +577,12 @@ msgid "" "the look up is forwarded to the fallback's :meth:`pgettext` method. " "Otherwise, the *message* id is returned." msgstr "" -"カタログから *context* と *message* id を検索して、対応するメッセージ文字列" -"を、 Unicode でエンコードして返します。 *message* id と *context* に対するエ" -"ントリがカタログに存在せず、フォールバックが設定されている場合、フォールバッ" -"ク検索はオブジェクトの :meth:`pgettext` メソッドに転送されます。そうでない場" -"合、 *message* id 自体が返されます。" +"カタログから *context* と *message* ID を検索し、対応するメッセージを " +"Unicode 文字列として返します。\n" +"*message* ID と *context* に対応するエントリがなく、フォールバックが設定され" +"ている場合は、そのフォールバックの :meth:`pgettext` メソッドに検索を委ねま" +"す。\n" +"そうでなければ *message* ID 自体を返します。" #: ../../library/gettext.rst:368 msgid "" @@ -857,13 +856,12 @@ msgid "" "gettext.install('myapplication')" msgstr "" -#: ../../library/gettext.rst:512 msgid "" "If you need to set the locale directory, you can pass it into the :func:" "`install` function::" msgstr "" -"ロケールの辞書を設定する必要がある場合、:func:`install` 関数に渡すことが出来" -"ます::" +"ロケールのディレクトリを設定する必要がある場合は、:func:`install` 関数に渡す" +"ことができます。 ::" #: ../../library/gettext.rst:515 msgid "" diff --git a/library/graphlib.po b/library/graphlib.po index f4a4dbd3d..507aa2861 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -231,9 +231,8 @@ msgid "" " ..." msgstr "" -#: ../../library/graphlib.rst:132 msgid "it is possible to simply do::" -msgstr "このように簡単に記述できます:" +msgstr "次のように簡単に書けます。 ::" #: ../../library/graphlib.rst:134 msgid "" diff --git a/library/gzip.po b/library/gzip.po index 37aeee63f..90f152c28 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -160,17 +160,18 @@ msgid "" "invalid gzip files." msgstr "" -#: ../../library/gzip.rst:79 msgid "" "Constructor for the :class:`GzipFile` class, which simulates most of the " "methods of a :term:`file object`, with the exception of the :meth:`~io." "IOBase.truncate` method. At least one of *fileobj* and *filename* must be " "given a non-trivial value." msgstr "" -":class:`GzipFile` クラスのコンストラクタです。 ``GzipFile`` オブジェクトは :" -"meth:`~io.IOBase.truncate` メソッドを除くほとんどの :term:`ファイルオブジェク" -"ト ` のメソッドをシミュレートします。少なくとも *fileobj* およ" -"び *filename* は有効な値でなければなりません。" +":class:`GzipFile` クラスのコンストラクタです。\n" +"``GzipFile`` オブジェクトは :meth:`~io.IOBase.truncate` メソッドを除くほとん" +"どの :term:`ファイルオブジェクト ` のメソッドをシミュレートしま" +"す。\n" +"*fileobj* と *filename* の少なくとも一方には、有効な値を指定しなければなりま" +"せん。" #: ../../library/gzip.rst:84 msgid "" @@ -275,13 +276,12 @@ msgstr "" msgid ":class:`GzipFile` also provides the following method and attribute:" msgstr ":class:`GzipFile` は以下のメソッドと属性も提供しています:" -#: ../../library/gzip.rst:135 msgid "" "Read *n* uncompressed bytes without advancing the file position. The number " "of bytes returned may be more or less than requested." msgstr "" -"ファイル内の位置を移動せずに展開した *n* バイトを読み込みます。返されるバイト" -"数はほぼ要求した値になります。" +"ファイル位置を進めずに、展開後のデータを *n* バイト読み込みます。\n" +"返されるバイト数は要求した数より多くなることも少なくなることもあります。" #: ../../library/gzip.rst:138 msgid "" diff --git a/library/hashlib.po b/library/hashlib.po index acef7d13b..66c4fefc7 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -961,13 +961,12 @@ msgid "" "00 01" msgstr "" -#: ../../library/hashlib.rst:751 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" -"次の例では、64バイトの内部桁が使われ、32バイトの最終的なダイジェストを返して" -"います::" +"この例では 64 バイトの内部ダイジェストを使い、32 バイトの最終ダイジェストを返" +"します。 ::" #: ../../library/hashlib.rst:754 msgid "" diff --git a/library/heapq.po b/library/heapq.po index f0fc5b2d3..5e7947087 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -122,15 +122,14 @@ msgid "" "the smallest item without popping it, use ``heap[0]``." msgstr "" -#: ../../library/heapq.rst:75 msgid "" "Push *item* on the heap, then pop and return the smallest item from the " "*heap*. The combined action runs more efficiently than :func:`heappush` " "followed by a separate call to :func:`heappop`." msgstr "" -"*item* を *heap* に push した後、pop を行って *heap* から最初の要素を返しま" -"す。この一続きの動作を :func:`heappush` に引き続いて :func:`heappop` を別々に" -"呼び出すよりも効率的に実行します。" +"*item* を *heap* に追加し、その後で最小の要素を取り出して返します。\n" +"この操作は、:func:`heappush` に続けて :func:`heappop` を個別に呼び出すより効" +"率的です。" #: ../../library/heapq.rst:82 msgid "" @@ -245,17 +244,16 @@ msgstr "" "力の各要素から比較のキーを取り出すのに使われます。デフォルト値は ``None`` で" "す (要素を直接比較します)。" -#: ../../library/heapq.rst:165 msgid "" "*reverse* is a boolean value. If set to ``True``, then the input elements " "are merged as if each comparison were reversed. To achieve behavior similar " "to ``sorted(itertools.chain(*iterables), reverse=True)``, all iterables must " "be sorted from largest to smallest." msgstr "" -"*reverse* は真偽値です。 ``True`` を設定した場合、挿入要素は逆向きに比較され" -"たかのように結合されます。 ``sorted(itertools.chain(*iterables), " -"reverse=True)`` でこれに似た挙動を実現するには、全てのイテラブルは降順で並ん" -"でいなければなりません。" +"*reverse* は真偽値です。\n" +"``True`` の場合は比較の向きを逆にして入力要素をマージします。\n" +"``sorted(itertools.chain(*iterables), reverse=True)`` と同様の動作にするに" +"は、すべての入力イテラブルをあらかじめ降順にソートしておく必要があります。" #: ../../library/heapq.rst:170 msgid "Added the optional *key* and *reverse* parameters." @@ -558,7 +556,6 @@ msgstr "" msgid "Example (min-heap) binary tree." msgstr "" -#: ../../library/heapq.rst:353 msgid "" "In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a " "usual binary tournament we see in sports, each cell is the winner over the " @@ -570,14 +567,16 @@ msgid "" "two cells it tops contain three different items, but the top cell \"wins\" " "over the two topped cells." msgstr "" -"上の木構造では、各セル *k* は ``2*k+1`` および ``2*k+2`` を最大値としていま" -"す。スポーツに見られるような通常の 2 つ組勝ち抜き戦では、各セルはその下にある" -"二つのセルに対する勝者となっていて、個々のセルの勝者を追跡していくことによ" -"り、そのセルに対する全ての相手を見ることができます。しかしながら、このような" -"勝ち抜き戦を使う計算機アプリケーションの多くでは、勝歴を追跡する必要はりませ" -"ん。メモリ効率をより高めるために、勝者が上位に進級した際、下のレベルから持っ" -"てきて置き換えることにすると、あるセルとその下位にある二つのセルは異なる三つ" -"の要素を含み、かつ上位のセルは二つの下位のセルに対して \"勝者と\" なります。" +"上の木構造では、各セル *k* の直下に ``2*k+1`` と ``2*k+2`` があります。\n" +"スポーツで見る通常の勝ち抜き戦では、各セルはその直下の 2 つのセルに対する勝者" +"を表します。\n" +"勝者を木の下方へたどると、それまでに対戦した相手をすべて確認できます。\n" +"しかし、コンピューターでこのような勝ち抜き戦を利用する場合、勝者の履歴をたど" +"る必要がないことも多くあります。\n" +"メモリを節約するため、勝者を上位へ進めたら、空いた場所を下位の別の要素で置き" +"換えます。\n" +"この場合の規則は、あるセルとその直下の 2 つのセルが異なる 3 つの要素を持ち、" +"上のセルが下の 2 つのセルに「勝つ」というものになります。" #: ../../library/heapq.rst:362 msgid "" @@ -631,7 +630,6 @@ msgstr "" "どい速度になるとしても、全体的にはより効率の高い他のデータ構造表現も存在しま" "す。" -#: ../../library/heapq.rst:384 msgid "" "Heaps are also very useful in big disk sorts. You most probably all know " "that a big sort implies producing \"runs\" (which are pre-sorted sequences, " @@ -644,17 +642,18 @@ msgid "" "which are twice the size of the memory for random input, and much better for " "input fuzzily ordered." msgstr "" -"ヒープはまた、巨大なディスクのソートでも非常に有用です。おそらくご存知のよう" -"に、巨大なソートを行うと、複数の \"ラン (run)\" (予めソートされた配列で、その" -"サイズは通常 CPU メモリの量に関係しています) が生成され、続いて統合処理 " -"(merging) がこれらのランを判定します。この統合処理はしばしば非常に巧妙に組織" -"されています [#]_。重要なのは、最初のソートが可能な限り長いランを生成すること" -"です。勝ち抜き戦はこれを達成するための良い方法です。もし利用可能な全てのメモ" -"リを使って勝ち抜き戦を行い、要素を置換および濾過処理して現在のランに収めれ" -"ば、ランダムな入力に対してメモリの二倍のサイズのランを生成することになり、大" -"体順序づけがなされている入力に対してはもっと高い効率になります。" +"ヒープはディスク上の大量のデータのソートにも非常に役立ちます。\n" +"ご存じのように、大規模なソートではまず「ラン」(ソート済みのシーケンスで、その" +"大きさは通常、主記憶の容量に関係します) を生成し、続いてこれらのランをマージ" +"します。\n" +"このマージ処理は非常に巧妙に組み立てられることがよくあります [#]_。\n" +"最初のソートで、できるだけ長いランを生成することが重要です。\n" +"勝ち抜き戦はそのための良い方法です。\n" +"利用可能なメモリをすべて使って勝ち抜き戦を保持し、現在のランに収まる要素を置" +"き換えて木の下方へ移動させると、ランダムな入力に対してはメモリ容量の 2 倍の長" +"さのランを生成できます。\n" +"おおむね順序の揃った入力なら、さらに長いランを生成できます。" -#: ../../library/heapq.rst:394 msgid "" "Moreover, if you output the 0'th item on disk and get an input which may not " "fit in the current tournament (because the value \"wins\" over the last " @@ -664,12 +663,14 @@ msgid "" "the first heap is melting. When the first heap completely vanishes, you " "switch heaps and start a new run. Clever and quite effective!" msgstr "" -"さらに、ディスク上の 0 番目の要素を出力して、現在の勝ち抜き戦に (最後に出力し" -"た値に \"勝って\" しまうために) 収められない入力を得たなら、ヒープには収まら" -"ないため、ヒープのサイズは減少します。解放されたメモリは二つ目のヒープを段階" -"的に構築するために巧妙に再利用することができ、この二つ目のヒープは最初のヒー" -"プが崩壊していくのと同じ速度で成長します。最初のヒープが完全に消滅したら、" -"ヒープを切り替えて新たなランを開始します。なんと巧妙で効率的なのでしょう!" +"さらに、0 番目の要素をディスクに出力して、現在の勝ち抜き戦に (最後に出力した" +"値に \"勝って\" しまうために) 収められない入力を得たなら、ヒープには収まらな" +"いため、ヒープのサイズは減少します。\n" +"解放されたメモリは二つ目のヒープを段階的に構築するために巧妙に再利用すること" +"ができ、この二つ目のヒープは最初のヒープが崩壊していくのと同じ速度で成長しま" +"す。\n" +"最初のヒープが完全に消滅したら、ヒープを切り替えて新たなランを開始します。\n" +"なんと巧妙で効率的なのでしょう!" #: ../../library/heapq.rst:402 msgid "" diff --git a/library/hmac.po b/library/hmac.po index c1777f5d1..fe9aa84b2 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -77,14 +77,14 @@ msgstr "" "メータ *key* 、 *msg* 、および *digest* は、 :func:`~hmac.new` と同じ意味を持" "ちます。" -#: ../../library/hmac.rst:43 msgid "" "CPython implementation detail, the optimized C implementation is only used " "when *digest* is a string and name of a digest algorithm, which is supported " "by OpenSSL." msgstr "" -"CPython実装の詳細、最適化されたC実装は、OpenSSLがサポートするダイジェストアル" -"ゴリズムの文字列と名前が *digest* の場合にのみ使用されます。" +"CPython の実装上の詳細として、最適化された C 実装が使われるのは、*digest* が " +"OpenSSL でサポートされているダイジェストアルゴリズムの名前を表す文字列の場合" +"だけです。" #: ../../library/hmac.rst:52 msgid "An HMAC object has the following methods:" @@ -105,16 +105,17 @@ msgid "Parameter *msg* can be of any type supported by :mod:`hashlib`." msgstr "" "引数 *msg* は :mod:`hashlib` がサポートしているあらゆる型のいずれかです。" -#: ../../library/hmac.rst:66 msgid "" "Return the digest of the bytes passed to the :meth:`update` method so far. " "This bytes object will be the same length as the *digest_size* of the digest " "given to the constructor. It may contain non-ASCII bytes, including NUL " "bytes." msgstr "" -"これまで :meth:`update` メソッドに渡されたバイト列のダイジェスト値を返しま" -"す。これはコンストラクタに与えられた *digest_size* と同じ長さのバイト列で、 " -"NUL バイトを含む非 ASCII 文字が含まれることがあります。" +"これまで :meth:`update` メソッドに渡されたバイト列のダイジェストを返しま" +"す。\n" +"返される bytes オブジェクトの長さは、コンストラクタに指定したダイジェストの " +"*digest_size* と同じです。\n" +"NUL バイトを含め、非 ASCII のバイトが含まれることがあります。" #: ../../library/hmac.rst:73 msgid "" @@ -191,15 +192,14 @@ msgstr "" "えば :meth:`HMAC.hexdigest` が返したような ASCII のみの) :class:`str` また" "は :term:`bytes-like object` のどちらか一方。" -#: ../../library/hmac.rst:134 msgid "" "If *a* and *b* are of different lengths, or if an error occurs, a timing " "attack could theoretically reveal information about the types and lengths of " "*a* and *b*—but not their values." msgstr "" -"*a* と *b* が異なる長さであったりエラーが発生した場合には、タイミング攻撃で理" -"論上 *a* と *b* の型と長さについての情報が暴露されますが、その値は明らかにな" -"りません。" +"*a* と *b* の長さが異なる場合やエラーが発生した場合、理論上はタイミング攻撃に" +"よって *a* と *b* の型や長さに関する情報が漏れる可能性がありますが、値は漏れ" +"ません。" #: ../../library/hmac.rst:142 msgid "" diff --git a/library/html.parser.po b/library/html.parser.po index 64eb36e67..cd746a1e0 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -58,17 +58,17 @@ msgid "" "parsed." msgstr "" -#: ../../library/html.parser.rst:30 msgid "" "An :class:`.HTMLParser` instance is fed HTML data and calls handler methods " "when start tags, end tags, text, comments, and other markup elements are " "encountered. The user should subclass :class:`.HTMLParser` and override its " "methods to implement the desired behavior." msgstr "" -":class:`.HTMLParser` インスタンスは、HTML データが入力されると、開始タグ、終" -"了タグ、およびその他の要素が見つかる度にハンドラーメソッドを呼び出します。各" -"メソッドの挙動を実装するには :class:`.HTMLParser` サブクラスを使ってそれぞれ" -"を上書きして行います。" +":class:`.HTMLParser` インスタンスに HTML データを渡すと、開始タグ、終了タグ、" +"テキスト、コメント、その他のマークアップ要素を見つけるたびにハンドラーメソッ" +"ドを呼び出します。\n" +"利用者は :class:`.HTMLParser` のサブクラスを作り、メソッドをオーバーライドし" +"て必要な動作を実装します。" #: ../../library/html.parser.rst:35 msgid "" @@ -150,16 +150,15 @@ msgstr ":class:`.HTMLParser` メソッド" msgid ":class:`HTMLParser` instances have the following methods:" msgstr ":class:`HTMLParser` インスタンスは以下のメソッドを提供します:" -#: ../../library/html.parser.rst:99 msgid "" "Feed some text to the parser. It is processed insofar as it consists of " "complete elements; incomplete data is buffered until more data is fed or :" "meth:`close` is called. *data* must be :class:`str`." msgstr "" -"パーサーにテキストを入力します。入力が完全なタグ要素で構成されている場合に限" -"り処理が行われます; 不完全なデータであった場合、新たにデータが入力されるか、:" -"meth:`close` が呼び出されるまでバッファーされます。 *data* は :class:`str` で" -"なければなりません。" +"パーサーにテキストを渡します。\n" +"完全な要素からなる部分までを処理し、不完全なデータは追加のデータが渡される" +"か :meth:`close` が呼ばれるまでバッファーに保持します。\n" +"*data* は :class:`str` でなければなりません。" #: ../../library/html.parser.rst:106 msgid "" @@ -237,12 +236,12 @@ msgstr "" "ドは ``handle_starttag('a', [('href', 'https://www.cwi.nl/')])`` として呼び出" "されます。" -#: ../../library/html.parser.rst:149 msgid "" "All entity references from :mod:`html.entities` are replaced in the " "attribute values." msgstr "" -":mod:`html.entities` からのすべての実態参照は、属性値に置き換えられます。" +"属性値に含まれる実体参照は、:mod:`html.entities` の定義に従ってすべて置換され" +"ます。" #: ../../library/html.parser.rst:155 msgid "" diff --git a/library/html.po b/library/html.po index fe1cf491e..544f9127a 100644 --- a/library/html.po +++ b/library/html.po @@ -45,7 +45,6 @@ msgid "" "(``'``) are not translated." msgstr "" -#: ../../library/html.rst:29 msgid "" "Convert all named and numeric character references (e.g. ``>``, ``>" "``, ``>``) in the string *s* to the corresponding Unicode characters. " @@ -53,11 +52,11 @@ msgid "" "and invalid character references, and the :data:`list of HTML 5 named " "character references `." msgstr "" -"文字列 *s* 中の名前や数字による参照 (例えば ``>``, ``>``, ``>``) " -"を全て対応するユニコード文字に変換します。\n" -"この関数は、 HTML 5 標準規格で定められた有効な文字参照および無効な文字参" -"照、 :data:`list of HTML 5 named character references ` " -"を対象とします。" +"文字列 *s* 内の名前付き文字参照と数値文字参照 (例えば ``>``、``>``、" +"``>``) を、すべて対応する Unicode 文字に変換します。\n" +"この関数は、有効な文字参照にも無効な文字参照にも HTML 5 標準で定められた規則" +"を適用し、:data:`HTML 5 の名前付き文字参照のリスト ` を" +"使います。" #: ../../library/html.rst:39 msgid "Submodules in the ``html`` package are:" diff --git a/library/http.client.po b/library/http.client.po index da41dacc0..0bec5d782 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -193,13 +193,12 @@ msgid "" "been removed." msgstr "" -#: ../../library/http.client.rst:123 msgid "" "Class whose instances are returned upon successful connection. Not " "instantiated directly by user." msgstr "" -"コネクションに成功したときに、このクラスのインスタンスが返されます。ユーザー" -"から直接利用されることはありません。" +"接続に成功すると、このクラスのインスタンスが返されます。\n" +"利用者が直接インスタンス化するクラスではありません。" #: ../../library/http.client.rst:126 msgid "" @@ -267,13 +266,13 @@ msgstr "" msgid "A subclass of :exc:`ImproperConnectionState`." msgstr ":exc:`ImproperConnectionState` のサブクラスです。" -#: ../../library/http.client.rst:212 msgid "" "A subclass of :exc:`HTTPException`. Raised if a server responds with a HTTP " "status code that we don't understand." msgstr "" -":exc:`HTTPException` のサブクラスです。サーバが理解できない HTTP 状態コードで" -"応答した場合に送出されます。" +":exc:`HTTPException` のサブクラスです。\n" +"サーバーから返された HTTP ステータスコードをクライアントが理解できない場合に" +"送出されます。" #: ../../library/http.client.rst:218 msgid "" @@ -417,9 +416,8 @@ msgid "" "can send a new request to the server." msgstr "" -#: ../../library/http.client.rst:328 msgid "*body* can now be an iterable." -msgstr "*body* は iterable オブジェクトとして使用できます。" +msgstr "*body* にイテラブルを指定できるようになりました。" #: ../../library/http.client.rst:331 msgid "" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 39f3a87bd..567b410b7 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -74,13 +74,12 @@ msgstr "" "むのに失敗した場合に発生します。 :exc:`LoadError` は :exc:`OSError` のサブク" "ラスです。" -#: ../../library/http.cookiejar.rst:43 msgid "" ":exc:`LoadError` used to be a subtype of :exc:`IOError`, which is now an " "alias of :exc:`OSError`." msgstr "" -":exc:`LoadError` は以前は :exc:`IOError` のサブタイプでしたが、 :exc:" -"`OSError` のエイリアスになりました。" +":exc:`LoadError` は以前は :exc:`IOError` のサブタイプでした。\n" +"現在、``IOError`` は :exc:`OSError` のエイリアスです。" #: ../../library/http.cookiejar.rst:48 msgid "The following classes are provided:" @@ -114,18 +113,18 @@ msgstr "" "*policy* は :class:`CookiePolicy` インターフェイスを実装するオブジェクトで" "す。これ以外の引数については、該当する属性の説明を参照してください。" -#: ../../library/http.cookiejar.rst:66 msgid "" "A :class:`CookieJar` which can load cookies from, and perhaps save cookies " "to, a file on disk. Cookies are **NOT** loaded from the named file until " "either the :meth:`load` or :meth:`revert` method is called. Subclasses of " "this class are documented in section :ref:`file-cookie-jar-classes`." msgstr "" -":class:`FileCookieJar` はディスク上のファイルからのクッキーの読み込み、もしく" -"は書き込みをサポートします。実際には、 :meth:`load` または :meth:`revert` の" -"どちらかのメソッドが呼ばれるまでクッキーは指定されたファイルからはロード **さ" -"れません** 。このクラスのサブクラスは :ref:`file-cookie-jar-classes` 節で説明" -"します。" +"ディスク上のファイルからクッキーを読み込める :class:`CookieJar` で、ファイル" +"への保存も可能な場合があります。\n" +":meth:`load` または :meth:`revert` メソッドを呼び出すまで、指定されたファイル" +"からクッキーは読み込まれ **ません**。\n" +"このクラスのサブクラスについては :ref:`file-cookie-jar-classes` を参照してく" +"ださい。" #: ../../library/http.cookiejar.rst:71 msgid "" @@ -340,13 +339,12 @@ msgstr "" "*response* オブジェクトから得られた :class:`Cookie` オブジェクトからなるシー" "ケンスを返します。" -#: ../../library/http.cookiejar.rst:218 msgid "" "See the documentation for :meth:`extract_cookies` for the interfaces " "required of the *response* and *request* arguments." msgstr "" -"*response* および *request* 引数で要求されるインスタンスについては、 :meth:" -"`extract_cookies` の説明を参照してください。" +"*response* および *request* 引数で要求されるインターフェイスについては、 :" +"meth:`extract_cookies` の説明を参照してください。" #: ../../library/http.cookiejar.rst:224 msgid "Set a :class:`Cookie` if policy says it's OK to do so." @@ -456,15 +454,15 @@ msgstr "それまでのクッキーは新しいものに上書きされない限 msgid "Arguments are as for :meth:`save`." msgstr "ここでの引数の値は :meth:`save` と同じです。" -#: ../../library/http.cookiejar.rst:290 msgid "" "The named file must be in the format understood by the class, or :exc:" "`LoadError` will be raised. Also, :exc:`OSError` may be raised, for example " "if the file does not exist." msgstr "" -"名前のついたファイルはこのクラスがわかるやり方で指定する必要があります。さも" -"ないと :exc:`LoadError` が発生します。さらに、例えばファイルが存在しないよう" -"な時に :exc:`OSError` が発生する場合があります。" +"指定されたファイルは、このクラスが理解できる形式でなければなりません。\n" +"そうでなければ :exc:`LoadError` が送出されます。\n" +"さらに、例えばファイルが存在しない場合などには :exc:`OSError` が送出されるこ" +"とがあります。" #: ../../library/http.cookiejar.rst:294 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." @@ -497,7 +495,6 @@ msgstr "" "クッキーを保存するデフォルトのファイル名を指定します。この属性には代入するこ" "とができます。" -#: ../../library/http.cookiejar.rst:316 msgid "" "If true, load cookies lazily from disk. This attribute should not be " "assigned to. This is only a hint, since this only affects performance, not " @@ -505,12 +502,13 @@ msgid "" "object may ignore it. None of the :class:`FileCookieJar` classes included " "in the standard library lazily loads cookies." msgstr "" -"真であれば、クッキーを読み込むさいにディスクから遅延読み込みします。この属性" -"には代入することができません。この情報は単なるヒントであり、 (ディスク上の" -"クッキーが変わらない限りは) インスタンスのふるまいには影響を与えず、パフォー" -"マンスのみに影響します。 :class:`CookieJar` オブジェクトはこの値を無視するこ" -"ともあります。標準ライブラリに含まれている :class:`FileCookieJar` クラスで遅" -"延読み込みをおこなうものはありません。" +"真であれば、クッキーを読み込むさいにディスクから遅延読み込みします。\n" +"この属性には代入しないでください。\n" +"この情報は単なるヒントであり、 (ディスク上のクッキーが変わらない限りは) イン" +"スタンスのふるまいには影響を与えず、パフォーマンスのみに影響します。\n" +":class:`CookieJar` オブジェクトはこの値を無視することもあります。\n" +"標準ライブラリに含まれている :class:`FileCookieJar` クラスで遅延読み込みをお" +"こなうものはありません。" #: ../../library/http.cookiejar.rst:326 msgid "FileCookieJar subclasses and co-operation with web browsers" @@ -622,18 +620,17 @@ msgstr "" "与えられたクッキーのドメインに対して、そこにクッキーを返すべきでない場合には " "``False`` を返します。" -#: ../../library/http.cookiejar.rst:393 msgid "" "This method is an optimization. It removes the need for checking every " "cookie with a particular domain (which might involve reading many files). " "Returning true from :meth:`domain_return_ok` and :meth:`path_return_ok` " "leaves all the work to :meth:`return_ok`." msgstr "" -"このメソッドは高速化のためのものです。これにより、すべてのクッキーをある特定" -"のドメインに対してチェックする (これには多数のファイル読みこみを伴なう場合が" -"あります) 必要がなくなります。 :meth:`domain_return_ok` および :meth:" -"`path_return_ok` の両方から true が返された場合、すべての決定は :meth:" -"`return_ok` に委ねられます。" +"このメソッドは高速化のためのものです。\n" +"これにより、ある特定のドメインに属するクッキーをすべてチェックする (これには" +"多数のファイル読みこみを伴なう場合があります) 必要がなくなります。\n" +":meth:`domain_return_ok` および :meth:`path_return_ok` の両方から true が返さ" +"れた場合、すべての決定は :meth:`return_ok` に委ねられます。" #: ../../library/http.cookiejar.rst:398 msgid "" @@ -836,12 +833,12 @@ msgstr "" msgid "Set the sequence of allowed domains, or ``None``." msgstr "" -#: ../../library/http.cookiejar.rst:523 msgid "" "Return ``True`` if *domain* is not on the allowlist for setting or receiving " "cookies." msgstr "" -"*domain* がクッキーを授受する許可リストに載っていれば ``True`` を返します。" +"*domain* がクッキーを授受する許可リストに載っていなければ ``True`` を返しま" +"す。" #: ../../library/http.cookiejar.rst:526 msgid "" diff --git a/library/http.cookies.po b/library/http.cookies.po index 9d38a7607..95560821d 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -101,7 +101,6 @@ msgid "If *input* is given, it is passed to the :meth:`load` method." msgstr "" "*input* が与えられたときは、そのまま :meth:`load` メソッドへ渡されます。" -#: ../../library/http.cookies.rst:55 msgid "" "This class derives from :class:`BaseCookie` and overrides :meth:`~BaseCookie." "value_decode` and :meth:`~BaseCookie.value_encode`. :class:`!SimpleCookie` " @@ -110,10 +109,11 @@ msgid "" "string. Values received from HTTP are kept as strings." msgstr "" "このクラスは :class:`BaseCookie` を継承し、 :meth:`~BaseCookie.value_decode` " -"と :meth:`~BaseCookie.value_encode` をオーバーライドします。 :class:`!" -"SimpleCookie` は文字列と cookie 値をサポートします。値を設定するとき、 :" -"class:`!SimpleCookie` は組み込みの :func:`str` を呼び出して値を文字列に変換し" -"ます。HTTP から受け取った値は文字列として保持されます。" +"と :meth:`~BaseCookie.value_encode` をオーバーライドします。\n" +":class:`!SimpleCookie` はcookie の値として文字列をサポートします。\n" +"値を設定するとき、 :class:`!SimpleCookie` は組み込みの :func:`str` を呼び出し" +"て値を文字列に変換します。\n" +"HTTP から受け取った値は文字列として保持されます。" #: ../../library/http.cookies.rst:63 msgid "Module :mod:`http.cookiejar`" @@ -137,15 +137,15 @@ msgstr "このモジュールが実装しているHTTPの状態管理に関す msgid "Cookie Objects" msgstr "Cookieオブジェクト" -#: ../../library/http.cookies.rst:79 msgid "" "Return a tuple ``(real_value, coded_value)`` from a string representation. " "``real_value`` can be any type. This method does no decoding in :class:" "`BaseCookie` --- it exists so it can be overridden." msgstr "" -"文字列表現のタプル ``(real_value, coded_value)`` を返します。 ``real_value`` " -"の型はどのようなものでも許容されます。このメソッドは :class:`BaseCookie` にお" -"いてデコードを行わず、オーバーライドされるためにだけ存在します。" +"文字列表現からタプル ``(real_value, coded_value)`` を返します。\n" +"``real_value`` の型はどのようなものでも許容されます。\n" +"このメソッドは :class:`BaseCookie` においてデコードを行わず、オーバーライドさ" +"れるためにだけ存在します。" #: ../../library/http.cookies.rst:86 msgid "" @@ -158,13 +158,12 @@ msgstr "" "は :class:`BaseCookie` においてエンコードを行わず、オーバーライドされるために" "だけ存在します。" -#: ../../library/http.cookies.rst:91 msgid "" "In general, it should be the case that :meth:`value_encode` and :meth:" "`value_decode` are inverses on the range of *value_decode*." msgstr "" -"通常 :meth:`value_encode` と :meth:`value_decode` はともに *value_decode* の" -"処理内容から逆算した範囲に収まっていなければなりません。" +"一般に、:meth:`value_encode` と :meth:`value_decode` は、*value_decode* が返" +"す値の範囲で互いに逆変換となる必要があります。" #: ../../library/http.cookies.rst:97 msgid "" @@ -213,17 +212,16 @@ msgstr "" msgid "Morsel Objects" msgstr "Morselオブジェクト" -#: ../../library/http.cookies.rst:134 msgid "Abstract a key/value pair, which has some :rfc:`2109` attributes." -msgstr ":rfc:`2109` の属性をキーと値で保持するabstractクラスです。" +msgstr ":rfc:`2109` の属性を持つ、キーと値のペアを抽象化したものです。" -#: ../../library/http.cookies.rst:136 msgid "" "Morsels are dictionary-like objects, whose set of keys is constant --- the " "valid :rfc:`2109` attributes, which are:" msgstr "" -"Morselは辞書風のオブジェクトで、キーは次のような :rfc:`2109` 準拠の定数となっ" -"ています:" +"Morsel は辞書のようなオブジェクトで、使用できるキーの集合は固定されていま" +"す。\n" +"キーは :rfc:`2109` で有効な次の属性です:" #: ../../library/http.cookies.rst:150 msgid "" @@ -309,16 +307,16 @@ msgstr "属性 *key* 、 *value* 、 *coded_value* に値をセットします msgid "Whether *K* is a member of the set of keys of a :class:`Morsel`." msgstr "*K* が :class:`Morsel` のキーであるかどうかを判定します。" -#: ../../library/http.cookies.rst:219 msgid "" "Return a string representation of the Morsel, suitable to be sent as an HTTP " "header. By default, all the attributes are included, unless *attrs* is " "given, in which case it should be a list of attributes to use. *header* is " "by default ``\"Set-Cookie:\"``." msgstr "" -"MoselをHTTPヘッダ形式の文字列表現にして返します。 *attrs* を指定しない場合、" -"デフォルトですべての属性を含めます。 *attrs* を指定する場合、属性をリストで渡" -"さなければなりません。 *header* のデフォルトは ``\"Set-Cookie:\"`` です。" +"MorselをHTTPヘッダ形式の文字列表現にして返します。\n" +"*attrs* を指定しない場合、デフォルトですべての属性を含めます。\n" +"*attrs* を指定する場合、属性をリストで渡さなければなりません。\n" +"*header* のデフォルトは ``\"Set-Cookie:\"`` です。" #: ../../library/http.cookies.rst:227 msgid "" @@ -335,11 +333,10 @@ msgid "" "`~http.cookies.Morsel.output` instead to generate HTTP headers." msgstr "" -#: ../../library/http.cookies.rst:241 msgid "" "Return a string representing the Morsel, without any surrounding HTTP or " "JavaScript." -msgstr "Moselの文字列表現をHTTPやJavaScriptで囲まずに出力します。" +msgstr "HTTP ヘッダーや JavaScript で囲まずに、Morsel を表す文字列を返します。" #: ../../library/http.cookies.rst:249 msgid "" diff --git a/library/http.server.po b/library/http.server.po index 017f46f56..1ebc451d0 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -628,14 +628,13 @@ msgid "" "*extensions_map* variable, and the file contents are returned." msgstr "" -#: ../../library/http.server.rst:470 msgid "" "A ``'Content-type:'`` header with the guessed content type is output, " "followed by a ``'Content-Length:'`` header with the file's size and a " "``'Last-Modified:'`` header with the file's modification time." msgstr "" "出力は ``'Content-type:'`` と推測されたコンテントタイプで、その後にファイルサ" -"イズを示す ``'Content-Length;'`` ヘッダと、ファイルの更新日時を示す ``'Last-" +"イズを示す ``'Content-Length:'`` ヘッダと、ファイルの更新日時を示す ``'Last-" "Modified:'`` ヘッダが続きます。" #: ../../library/http.server.rst:474 diff --git a/library/idle.po b/library/idle.po index 1931005e4..d1ede48b7 100644 --- a/library/idle.po +++ b/library/idle.po @@ -109,16 +109,15 @@ msgstr "" "後で解説するそれぞれのメニューは、ウィンドウがどちらのウィンドウタイプなのか" "を示しています。" -#: ../../library/idle.rst:50 msgid "" "Output windows, such as used for Edit => Find in Files, are a subtype of " "editor window. They currently have the same top menu but a different " "default title and context menu." msgstr "" -"ファイル内の編集 (Edit) => 検索 (Find) で使われるような出力ウィンドウ " -"(Output ウィンドウ) は editor ウィンドウのサブタイプで、 Editor ウィンドウと" -"同じトップメニューを持ちますが、デフォルトタイトルとコンテキストメニューが違" -"います。" +"Edit => Find in Files などで使われる Output ウィンドウは、Editor ウィンドウの" +"サブタイプです。\n" +"現在は同じトップメニューを持ちますが、デフォルトのタイトルとコンテキストメ" +"ニューが異なります。" #: ../../library/idle.rst:54 msgid "" @@ -414,9 +413,8 @@ msgstr "" msgid "Highlight the surrounding parenthesis." msgstr "囲んでいる括弧をハイライトします。" -#: ../../library/idle.rst:176 msgid "Format menu (Editor window only)" -msgstr "Format メニュー (Shell ウィンドウ、Editor ウィンドウ)" +msgstr "Format メニュー (Editor ウィンドウのみ)" #: ../../library/idle.rst:178 msgid "Format Paragraph" @@ -632,7 +630,6 @@ msgstr "Debug メニュー (Shell ウィンドウのみ)" msgid "Go to File/Line" msgstr "Go to File/Line [ファイル/行へ移動]" -#: ../../library/idle.rst:276 msgid "" "Look on the current line. with the cursor, and the line above for a filename " "and line number. If found, open the file if not already open, and show the " @@ -640,11 +637,12 @@ msgid "" "and lines found by Find in Files. Also available in the context menu of the " "Shell window and Output windows." msgstr "" -"カーソルのある現在行の上にファイル名と行番号が見つかれば、(開かれていなけれ" -"ば) そのファイルを開いてその行に飛びます。例外のトレースバックが参照している" -"ソース行を見るのにこれを使いましょう。そのようなファイル名・行番号表示をして" -"いる行を見つけるのには Find を使えます。この機能は Shell ウィンドウと Output " -"ウィンドウのコンテキストメニューからも使えます。" +"カーソルのある現在行とその上の行から、ファイル名と行番号を探します。\n" +"見つかったファイルがまだ開かれていなければ開き、その行を表示します。\n" +"例外のトレースバックが参照するソース行や、Find in Files で見つかった行を見る" +"ために使います。\n" +"Shell ウィンドウと Output ウィンドウのコンテキストメニューからも利用できま" +"す。" #: ../../library/idle.rst:286 msgid "Debugger (toggle)" @@ -708,17 +706,15 @@ msgstr "" msgid "Show/Hide Code Context (Editor Window only)" msgstr "" -#: ../../library/idle.rst:313 msgid "" "Open a pane at the top of the edit window which shows the block context of " "the code which has scrolled above the top of the window. See :ref:`Code " "Context ` in the Editing and Navigation section below." msgstr "" -"Editor ウィンドウの上部にペインが開き、そこにウィンドウの一番上のコードのブ" -"ロックコンテキスト (訳注: コードが含まれているブロックのインデント構造) が表" -"示されます。\n" +"Editor ウィンドウの上部にペインを開き、スクロールによってウィンドウの上端より" +"上に隠れたコードのブロックコンテキストを表示します。\n" "下の編集とナビゲーションの節にある :ref:`コードコンテキスト ` " -"の項を参照してください。" +"を参照してください。" #: ../../library/idle.rst:318 msgid "Show/Hide Line Numbers (Editor Window only)" @@ -802,16 +798,15 @@ msgstr "" "Python コード例とタートルによる描画を使って turtledemo モジュールを実行しま" "す。" -#: ../../library/idle.rst:354 msgid "" "Additional help sources may be added here with the Configure IDLE dialog " "under the General tab. See the :ref:`Help sources ` subsection " "below for more on Help menu choices." msgstr "" -"General タブの下の方にある Configure IDLE ダイアログで、追加のヘルプソースを " -"Help メニューに加えられます。\n" -"下の編集とナビゲーションの節にある :ref:`ヘルプソース ` の項を" -"参照してください。" +"Configure IDLE ダイアログの General タブで、追加のヘルプソースをここに加えら" +"れます。\n" +"Help メニューの項目について詳しくは、下の :ref:`ヘルプソース ` " +"を参照してください。" #: ../../library/idle.rst:367 msgid "Context menus" @@ -980,7 +975,6 @@ msgstr "" msgid "Automatic indentation" msgstr "自動的な字下げ" -#: ../../library/idle.rst:463 msgid "" "After a block-opening statement, the next line is indented by 4 spaces (in " "the Python Shell window by one tab). After certain keywords (break, return " @@ -990,11 +984,13 @@ msgid "" "tabs are restricted to four spaces due to Tcl/Tk limitations." msgstr "" "ブロックの始まりの文の後、次の行は 4 つの空白 (Python Shell ウィンドウでは、" -"一つのタブ) で字下げされます。あるキーワード (break、return など) の後では、" -"次の行は字下げが解除 (dedent) されます。先頭の字下げでは、 :kbd:`Backspace` " -"は 4 つの空白があれば削除します。 :kbd:`Tab` はインデント幅に対応する数の空" -"白 (Python Shell ウィンドウでは一つのタブ) を挿入します。現在、タブは Tcl/Tk " -"の制約のため 4 つの空白に固定されています。" +"一つのタブ) で字下げされます。\n" +"あるキーワード (break、return など) の後では、次の行は字下げが解除 (dedent) " +"されます。\n" +"先頭の字下げでは、 :kbd:`Backspace` は 空白があれば最大 4 つ削除します。\n" +":kbd:`Tab` はインデント幅に対応する数の空白 (Python Shell ウィンドウでは一つ" +"のタブ) を挿入します。\n" +"現在、タブは Tcl/Tk の制約のため 4 つの空白に固定されています。" #: ../../library/idle.rst:470 msgid "" diff --git a/library/imaplib.po b/library/imaplib.po index 144f65ae5..6410f0372 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -67,15 +67,15 @@ msgid "" "timeout is used." msgstr "" -#: ../../library/imaplib.rst:37 msgid "" "The :class:`IMAP4` class supports the :keyword:`with` statement. When used " "like this, the IMAP4 ``LOGOUT`` command is issued automatically when the :" "keyword:`!with` statement exits. E.g.::" msgstr "" -" :class:`IMAP4` クラスは :keyword:`with` 構文をサポートしています。このように" -"使用すると、 :keyword:`!with` 構文が終了すると、IMAP4の ``LOGOUT`` コマンドが" -"自動的に発行されます。たとえば、" +":class:`IMAP4` クラスは :keyword:`with` 文をサポートしています。\n" +"このように使うと、:keyword:`!with` 文を抜けるときに IMAP4 の ``LOGOUT`` コマ" +"ンドが自動的に発行されます。\n" +"例えば次のように使います。 ::" #: ../../library/imaplib.rst:41 msgid "" @@ -163,14 +163,12 @@ msgstr "" msgid "*ssl_context* parameter was added." msgstr "*ssl_context* 引数が追加されました。" -#: ../../library/imaplib.rst:106 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" -"このクラスは :attr:`ssl.SSLContext.check_hostname` と *Server Name " -"Indication* でホスト名のチェックをサポートしました。(:const:`ssl.HAS_SNI` を" -"参照してください)。" +"このクラスは :attr:`ssl.SSLContext.check_hostname` によるホスト名の検証と、" +"*Server Name Indication* に対応しました (:const:`ssl.HAS_SNI` を参照)。" #: ../../library/imaplib.rst:114 msgid "The deprecated *keyfile* and *certfile* parameters have been removed." @@ -439,13 +437,12 @@ msgstr "" "``quota`` *root* により、リソース使用状況と制限値を取得します。このメソッド" "は :rfc:`2087` で定義されている IMAP4 QUOTA 拡張の一部です。" -#: ../../library/imaplib.rst:316 msgid "" "Get the list of ``quota`` ``roots`` for the named *mailbox*. This method is " "part of the IMAP4 QUOTA extension defined in rfc2087." msgstr "" -"*mailbox* に対して ``quota`` *root* を実行した結果のリストを取得します。この" -"メソッドは :rfc:`2087` で定義されている IMAP4 QUOTA 拡張の一部です。" +"指定した *mailbox* の ``quota`` ``roots`` のリストを取得します。\n" +"このメソッドは rfc2087 で定義されている IMAP4 QUOTA 拡張の一部です。" #: ../../library/imaplib.rst:322 msgid "" @@ -641,13 +638,12 @@ msgstr "" msgid "The *timeout* parameter was added." msgstr "*timeout* 引数が追加されました。" -#: ../../library/imaplib.rst:478 msgid "" "Fetch truncated part of a message. Returned data is a tuple of message part " "envelope and data." msgstr "" -"メッセージの後略された部分を取り寄せます。返されるデータはメッセージパートエ" -"ンベロープ情報とデータからなるタプルです。" +"メッセージの一部を取り寄せます。\n" +"返されるデータはメッセージパートエンベロープ情報とデータからなるタプルです。" #: ../../library/imaplib.rst:484 msgid "" @@ -753,13 +749,12 @@ msgstr "" "``ANNOTATION`` を *mailbox* に設定します。このメソッドは非標準ですが、" "``Cyrus`` サーバでサポートされています。" -#: ../../library/imaplib.rst:561 msgid "" "Set the ``quota`` *root*'s resource *limits*. This method is part of the " "IMAP4 QUOTA extension defined in rfc2087." msgstr "" -"``quota`` *root* のリソースを *limits* に設定します。このメソッドは :rfc:" -"`2087` で定義されている IMAP4 QUOTA 拡張の一部です。" +"``quota`` *root* のリソースの制限値を *limits* に設定します。\n" +"このメソッドは rfc2087 で定義されている IMAP4 QUOTA 拡張の一部です。" #: ../../library/imaplib.rst:567 msgid "" @@ -783,7 +778,6 @@ msgstr "" "れるデータには、条件に合致するメッセージ番号をスペースで分割したリストが入っ" "ています。" -#: ../../library/imaplib.rst:582 msgid "" "Sort has two arguments before the *search_criterion* argument(s); a " "parenthesized list of *sort_criteria*, and the searching *charset*. Note " @@ -795,12 +789,13 @@ msgid "" "searching criteria. It then returns the numbers of matching messages." msgstr "" "sort 命令は *search_criterion* の前に二つの引数を持ちます; *sort_criteria* " -"のリストを丸括弧で囲ったものと、検索時の *charset* です。``search`` と違っ" -"て、検索時の *charset* は必須です。``uid sort`` 命令もあり、``search`` に対す" -"る ``uid search`` と同じように ``sort`` 命令に対応します。``sort`` 命令はま" -"ず、charset 引数の指定に従って searching criteria の文字列を解釈し、メール" -"ボックスから与えられた検索条件に合致するメッセージを探します。次に、合致した" -"メッセージの数を返します。" +"のリストを丸括弧で囲ったものと、検索時の *charset* です。\n" +"``search`` と違って、検索時の *charset* は必須です。\n" +"``uid sort`` 命令もあり、``search`` に対する ``uid search`` と同じように " +"``sort`` 命令に対応します。\n" +"``sort`` 命令はまず、``charset`` 引数の指定に従って 検索条件の文字列を解釈" +"し、メールボックスから与えられた検索条件に合致するメッセージを探します。\n" +"次に、合致したメッセージの番号を返します。" #: ../../library/imaplib.rst:591 ../../library/imaplib.rst:669 msgid "This is an ``IMAP4rev1`` extension command." @@ -948,14 +943,14 @@ msgstr "" "サーバから返された ``CAPABILITY`` 応答にある、サポートされている最新のプロト" "コルです。" -#: ../../library/imaplib.rst:723 msgid "" "Integer value to control debugging output. The initialize value is taken " "from the module variable ``Debug``. Values greater than three trace each " "command." msgstr "" -"デバッグ出力を制御するための整数値です。初期値はモジュール変数 ``Debug`` から" -"取られます。3 以上の値にすると各命令をトレースします。" +"デバッグ出力を制御するための整数値です。\n" +"初期値はモジュール変数 ``Debug`` から取られます。\n" +"3 より大きい値にすると各命令をトレースします。" #: ../../library/imaplib.rst:729 msgid "" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 220ade567..1d5c2e110 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -91,7 +91,6 @@ msgstr "" msgid "https://importlib-metadata.readthedocs.io/" msgstr "https://importlib-metadata.readthedocs.io/" -#: ../../library/importlib.metadata.rst:54 msgid "" "The documentation for ``importlib_metadata``, which supplies a backport of " "``importlib.metadata``. This includes an `API reference `__ for existing users of " "``pkg_resources``." msgstr "" -"``importlib_metadata`` のドキュメントは ``importlib.metadata`` のバックポート" -"です。これには、このモジュールのクラスと関数の `APIリファレンス `__ と、 " -"``pkg_resources`` の既存のユーザーのための `移行ガイド `__ があります。" +"``importlib.metadata`` のバックポートを提供する ``importlib_metadata`` のド" +"キュメントです。\n" +"これには、このモジュールのクラスと関数の `APIリファレンス `__ と、 ``pkg_resources`` の既存" +"のユーザーのための `移行ガイド `__ があります。" #: ../../library/importlib.metadata.rst:65 msgid "Overview" @@ -815,13 +815,12 @@ msgstr "" "``importlib.metadata`` は ``sys.path`` の :class:`bytes` オブジェクトを受け入" "れません。" -#: ../../library/importlib.metadata.rst:557 msgid "" "``importlib.metadata`` will incidentally honor :py:class:`pathlib.Path` " "objects on ``sys.path`` even though such values will be ignored for imports." msgstr "" -"``importlib.metadata`` は、インポート時には無視されますが、 ``sys.path`` 上" -"の :py:class:`pathlib.Path` オブジェクトを優先的に使用します。" +"``importlib.metadata`` は、インポート時には無視される ``sys.path`` 上の :py:" +"class:`pathlib.Path` オブジェクトも、副次的に受け付けます。" #: ../../library/importlib.metadata.rst:561 msgid "" diff --git a/library/importlib.po b/library/importlib.po index 0c41eef8a..c76f97e98 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -38,7 +38,6 @@ msgstr "はじめに" msgid "The purpose of the :mod:`!importlib` package is three-fold." msgstr "" -#: ../../library/importlib.rst:19 msgid "" "One is to provide the implementation of the :keyword:`import` statement (and " "thus, by extension, the :func:`__import__` function) in Python source code. " @@ -47,11 +46,12 @@ msgid "" "to comprehend than one implemented in a programming language other than " "Python." msgstr "" -"1つ目は Python ソースコード中にある :keyword:`import` 文の(そして、拡張とし" -"て、 :func:`__import__` 関数の)実装を提供することです。このパッケージは :" -"keyword:`!import` 文の、どの Python インタープリターでも動作する実装を提供し" -"ます。また、 Python 以外の言語で実装されたどの実装よりも把握しやすい実装を提" -"供します。" +"1 つ目は :keyword:`import` 文 (ひいては :func:`__import__` 関数) の実装を " +"Python のソースコードで提供することです。\n" +"これにより、どの Python インタープリターにも移植できる :keyword:`!import` の" +"実装を提供します。\n" +"また、Python 以外のプログラミング言語による実装よりも理解しやすい実装になりま" +"す。" #: ../../library/importlib.rst:26 msgid "" @@ -286,7 +286,6 @@ msgstr "" msgid "Parent packages are automatically imported." msgstr "親パッケージは自動的にインポートされます。" -#: ../../library/importlib.rst:133 msgid "" "Invalidate the internal caches of finders stored at :data:`sys.meta_path`. " "If a finder implements ``invalidate_caches()`` then it will be called to " @@ -295,10 +294,12 @@ msgid "" "will notice the new module's existence." msgstr "" ":data:`sys.meta_path` に保存されたファインダーの内部キャッシュを無効にしま" -"す。ファインダーが ``invalidate_caches()`` を実装していれば、無効化を行うため" -"にそれが呼び出されます。すべてのファインダーが新しいモジュールの存在に気づく" -"ことを保証しているプログラムの実行中に、モジュールが作成またはインストールさ" -"れたなら、この関数が呼び出されるべきです。" +"す。\n" +"ファインダーが ``invalidate_caches()`` を実装していれば、無効化のために呼び出" +"します。\n" +"プログラムの実行中にモジュールを作成またはインストールした場合は、すべての" +"ファインダーが新しいモジュールの存在を認識できるよう、この関数を呼び出してく" +"ださい。" #: ../../library/importlib.rst:141 msgid "" @@ -399,7 +400,6 @@ msgid "" " cache = {}" msgstr "" -#: ../../library/importlib.rst:188 msgid "" "It is generally not very useful to reload built-in or dynamically loaded " "modules. Reloading :mod:`sys`, :mod:`__main__`, :mod:`builtins` and other " @@ -408,10 +408,11 @@ msgid "" "when reloaded." msgstr "" "組み込みモジュールや動的にロードされるモジュールを再ロードすることは、一般的" -"にそれほど便利ではありません。 :mod:`sys`, :mod:`__main__`, :mod:`builtins` " -"やその他重要なモジュールの再ロードはお勧め出来ません。多くの場合、拡張モ" -"ジュールは 1 度以上初期化されるようには設計されておらず、再ロードされた場合に" -"は何らかの理由で失敗するかもしれません。" +"にそれほど便利ではありません。\n" +":mod:`sys`, :mod:`__main__`, :mod:`builtins` やその他重要なモジュールの再ロー" +"ドはお勧め出来ません。\n" +"多くの場合、拡張モジュールは 複数回初期化されるようには設計されておらず、再" +"ロードされた場合には何らかの理由で失敗するかもしれません。" #: ../../library/importlib.rst:194 msgid "" @@ -877,7 +878,6 @@ msgstr "" "ソースファイルへのパスのみを返す必要があります。ソースなしのロードはサポート" "されていません。" -#: ../../library/importlib.rst:562 msgid "" "The abstract methods defined by this class are to add optional bytecode file " "support. Not implementing these optional methods (or causing them to raise :" @@ -889,13 +889,16 @@ msgid "" "bytecode-specific API is exposed." msgstr "" "このクラスでこれらの抽象メソッドを定義することで、バイトコードファイルを追加" -"でサポートします。これらのメソッドを定義しなければ (またはそのモジュールが :" -"exc:`NotImplementedError` を送出すれば)、このローダーはソースコードに対しての" -"み働きます。これらのメソッドを実装することで、ローダーはソースとバイトコード" -"ファイル *の組み合わせ* に対して働きます。バイトコードのみを与えた *ソースの" -"ない* ロードは認められません。バイトコードファイルは、 Python コンパイラによ" -"る解析の工程をなくして速度を上げる最適化です。ですから、バイトコード特有の " -"API は公開されていません。" +"でサポートします。\n" +"これらのメソッドを定義しなければ (またはそのメソッドが :exc:" +"`NotImplementedError` を送出すれば)、このローダーはソースコードに対してのみ働" +"きます。\n" +"これらのメソッドを実装することで、ローダーはソースとバイトコードファイル *の" +"組み合わせ* に対して働きます。\n" +"バイトコードのみを与えた *ソースのない* ロードは認められません。\n" +"バイトコードファイルは、 Python コンパイラによる解析の工程をなくして速度を上" +"げる最適化です。\n" +"ですから、バイトコード特有の API は公開されていません。" #: ../../library/importlib.rst:576 msgid "" @@ -934,15 +937,14 @@ msgid "" "specified path." msgstr "指定されたパスの更新時刻を返す、オプションの抽象メソッドです。" -#: ../../library/importlib.rst:596 msgid "" "This method is deprecated in favour of :meth:`path_stats`. You don't have " "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" -"このメソッドは廃止され、 :meth:`path_stats` が推奨されます。このモジュールを" -"実装する必要はありませんが、互換性のため現在も利用できます。パスが扱えなけれ" -"ば、 :exc:`OSError` が送出されます。" +"このメソッドは非推奨で、代わりに :meth:`path_stats` を使います。\n" +"実装する必要はありませんが、互換性のために引き続き利用できます。\n" +"パスを扱えない場合は :exc:`OSError` を送出してください。" #: ../../library/importlib.rst:606 msgid "" @@ -1044,13 +1046,10 @@ msgstr "" msgid "The value is no longer dependent on ``__debug__``." msgstr "この値は ``__debug__`` に依存しなくなりました。" -#: ../../library/importlib.rst:692 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." -msgstr "" -"認識されている最適化された拡張モジュールのファイル接尾辞を表す文字列のリスト" -"です。" +msgstr "認識されている拡張モジュールのファイル接尾辞を表す文字列のリストです。" #: ../../library/importlib.rst:699 msgid "" @@ -1065,16 +1064,16 @@ msgstr "" "スがモジュールを参照する可能性があるかだけを知りたくて、そのモジュールの種類" "を詳しく知る必要はないコード (例えば :func:`inspect.getmodulename`) です。" -#: ../../library/importlib.rst:710 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -"組み込みモジュールの :term:`importer` です。すべての既知のモジュールは :data:" -"`sys.builtin_module_names` に列挙されています。このクラスは :class:" -"`importlib.abc.MetaPathFinder` および :class:`importlib.abc.InspectLoader` 抽" -"象基底クラスを実装します。" +"組み込みモジュールの :term:`importer` です。\n" +"すべての既知の組み込みモジュールは :data:`sys.builtin_module_names` に列挙さ" +"れています。\n" +"このクラスは :class:`importlib.abc.MetaPathFinder` および :class:`importlib." +"abc.InspectLoader` 抽象基底クラスを実装します。" #: ../../library/importlib.rst:715 ../../library/importlib.rst:730 #: ../../library/importlib.rst:744 ../../library/importlib.rst:759 @@ -1195,11 +1194,10 @@ msgstr "" "ファイルシステムからの結果をキャッシュする :class:`importlib.abc." "PathEntryFinder` の具象実装です。" -#: ../../library/importlib.rst:803 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." -msgstr "*path* 引数は検索を担当するファインダーのディレクトリです。" +msgstr "*path* 引数は、このファインダーが検索を担当するディレクトリです。" #: ../../library/importlib.rst:806 msgid "" @@ -1234,9 +1232,8 @@ msgstr "" "検索が失敗します。これを防ぐためには、モジュールを動的に作成する際に、必ず :" "func:`importlib.invalidate_caches` を呼び出してください。" -#: ../../library/importlib.rst:825 msgid "The path the finder will search in." -msgstr "ファインダーが検索されるパスです。" +msgstr "ファインダーが検索するパスです。" #: ../../library/importlib.rst:829 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." @@ -1375,12 +1372,11 @@ msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" ":attr:`path` から作成された :attr:`name` のコードオブジェクトを返します。" -#: ../../library/importlib.rst:943 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -"このローダーが使われたとき、バイトコードファイルのソースがなければ ``None`` " -"を返します。" +"このローダーを使う場合、バイトコードファイルにはソースがないため ``None`` を" +"返します。" #: ../../library/importlib.rst:949 msgid "" @@ -1435,13 +1431,11 @@ msgid "" "based on :const:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:992 msgid "Returns ``None`` as extension modules lack a code object." -msgstr "拡張モジュールにコードオブジェクトがなければ ``None`` を返します。" +msgstr "拡張モジュールにはコードオブジェクトがないため ``None`` を返します。" -#: ../../library/importlib.rst:996 msgid "Returns ``None`` as extension modules do not have source code." -msgstr "拡張モジュールにソースコードがなければ ``None`` を返します。" +msgstr "拡張モジュールにはソースコードがないため ``None`` を返します。" #: ../../library/importlib.rst:1007 msgid "" @@ -1874,13 +1868,12 @@ msgid "" "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1351 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -"モジュールが属性アクセスできるようになるまで、モジュールのローダーの実行を遅" -"延するクラス。" +"モジュールの属性がアクセスされるまで、そのモジュールのローダーの実行を遅延す" +"るクラスです。" #: ../../library/importlib.rst:1354 msgid "" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 4a4f3d1ad..f034365ea 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -56,7 +56,6 @@ msgstr "" msgid "Resources can be opened or read in either binary or text mode." msgstr "" -#: ../../library/importlib.resources.rst:28 msgid "" "Resources are roughly akin to files inside directories, though it's " "important to keep in mind that this is just a metaphor. Resources and " @@ -64,9 +63,12 @@ msgid "" "file system: for example, a package and its resources can be imported from a " "zip file using :py:mod:`zipimport`." msgstr "" -"リソースは大体ディレクトリの中のファイルに似ていますが、これは単なる例え話で" -"あることを頭に入れておくことが重要です。例えば、パッケージとそのリソースは :" -"py:mod:`zipimport` を使って zip ファイルからインポートすることができます。" +"リソースはおおむねディレクトリ内のファイルに似ていますが、これは単なる比喩で" +"ある点に注意してください。\n" +"リソースとパッケージは、ファイルシステム上の物理的なファイルやディレクトリと" +"して存在する必要は **ありません**。\n" +"例えば、:py:mod:`zipimport` を使うとパッケージとそのリソースを zip ファイルか" +"らインポートできます。" #: ../../library/importlib.resources.rst:36 msgid "" diff --git a/library/inspect.po b/library/inspect.po index 0d4cfd2cb..f4037bd67 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -429,9 +429,8 @@ msgstr "コードオブジェクトを生成したファイルのファイル名 msgid "co_firstlineno" msgstr "co_firstlineno" -#: ../../library/inspect.rst:191 msgid "number of first line in Python source code" -msgstr "Python ソースコードの先頭行" +msgstr "Python ソースコードの先頭行の番号" #: ../../library/inspect.rst:194 msgid "co_flags" @@ -749,27 +748,27 @@ msgstr "" "合、各メンバーの ``value`` オブジェクトを引数として *predicate* が呼ばれ、そ" "の戻り値が真となるとなるメンバーだけがリストに含まれます。" -#: ../../library/inspect.rst:370 msgid "" ":func:`getmembers` will only return class attributes defined in the " "metaclass when the argument is a class and those attributes have been listed " "in the metaclass' custom :meth:`~object.__dir__`." msgstr "" -"引数がクラスでその属性がメタクラスで特別に定義された :meth:`~object.__dir__` " -"に列挙されている場合、:func:`getmembers` はメタクラスで定義されたクラス属性の" -"みを返します。" +":func:`getmembers` がメタクラスで定義されたクラス属性を返すのは、引数がクラス" +"で、かつその属性がメタクラスのカスタム :meth:`~object.__dir__` に列挙されてい" +"る場合だけです。" -#: ../../library/inspect.rst:377 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name without triggering dynamic lookup via the descriptor " "protocol, __getattr__ or __getattribute__. Optionally, only return members " "that satisfy a given predicate." msgstr "" -"オブジェクトの全てのメンバーを ``(name, value)`` ペアのリストで返します。ただ" -"し、デスクリプタプロトコルの __getattr__ や __getattribute__ を介した動的な" -"ルックアップは行いません。オプションとして、引数に与えられた predicate を満た" -"すメンバーのみを返すこともできます。" +"オブジェクトのすべてのメンバーを、名前順に並べた ``(name, value)`` ペアのリス" +"トで返します。\n" +"デスクリプタプロトコルや ``__getattr__``、``__getattribute__`` を介した動的な" +"属性検索は行いません。\n" +"必要に応じて、指定した ``predicate`` を満たすメンバーだけを返すこともできま" +"す。" #: ../../library/inspect.rst:384 msgid "" @@ -831,9 +830,9 @@ msgid "" "genericalias>` of classes, such as ``list[int]``." msgstr "" -#: ../../library/inspect.rst:425 msgid "Return ``True`` if the object is a bound method written in Python." -msgstr "オブジェクトがメソッドの場合 ``True`` を返します。" +msgstr "" +"オブジェクトが Python で書かれた束縛メソッドの場合、``True`` を返します。" #: ../../library/inspect.rst:429 msgid "For example, given this class::" @@ -1345,7 +1344,6 @@ msgid "" "`TypeError` if the object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:780 msgid "" "Return a list of source lines and starting line number for an object. The " "argument may be a module, class, method, function, traceback, frame, or code " @@ -1356,12 +1354,15 @@ msgid "" "built-in module, class, or function." msgstr "" "オブジェクトを定義しているソースコードの行のリストと、定義の開始行番号を返し" -"ます。引数にはモジュール、クラス、メソッド、関数、トレースバック、またはコー" -"ドオブジェクトを渡すことができます。オブジェクトに対応するソースコードが行の" -"リストとして返されます。また行番号は、元のソースファイル中でコードが見つかっ" -"た最初の行を示します。ソースコードを探し出すことができなかった場合、 :exc:" -"`OSError` 例外が送出されます。オブジェクトが組み込みのモジュール、クラス、ま" -"たは関数である場合は :exc:`TypeError` 例外が送出されます。" +"ます。\n" +"引数にはモジュール、クラス、メソッド、関数、トレースバック、フレーム、または" +"コードオブジェクトを渡すことができます。\n" +"オブジェクトに対応するソースコードが行のリストとして返されます。\n" +"また行番号は、元のソースファイル中でコードが見つかった最初の行を示します。\n" +"ソースコードを探し出すことができなかった場合、 :exc:`OSError` 例外が送出され" +"ます。\n" +"オブジェクトが組み込みのモジュール、クラス、または関数である場合は :exc:" +"`TypeError` 例外が送出されます。" #: ../../library/inspect.rst:789 ../../library/inspect.rst:803 msgid "" @@ -1620,15 +1621,14 @@ msgstr "" "ングです。パラメータは、キーワード専用パラメータも含めて、厳密な定義順に現れ" "ます。" -#: ../../library/inspect.rst:937 ../../library/inspect.rst:1309 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -"バージョン 3.7 までは、Python はキーワード専用パラメータだけしか順序を保つこ" -"とを明確に保証していませんでした。とはいえ Python 3 では事実上パラメータの順" -"序は維持されていました。" +"Python がキーワード専用パラメータの宣言順序の保持を明示的に保証するようになっ" +"たのは、バージョン 3.7 からです。\n" +"ただし、実際には Python 3 では常にこの順序が保持されていました。" #: ../../library/inspect.rst:944 msgid "" @@ -1716,7 +1716,6 @@ msgstr "" "*max_width* 文字になるようにフォーマットを試みます。シグネチャが *max_width* " "よりも長くなってしまう場合は、全てのパラメータごとに改行されます。" -#: ../../library/inspect.rst:992 msgid "" "If *quote_annotation_strings* is False, :term:`annotations ` in " "the signature are displayed without opening and closing quotation marks if " @@ -1724,11 +1723,10 @@ msgid "" "`~annotationlib.Format.STRING` format or if ``from __future__ import " "annotations`` was used." msgstr "" -"*quote_annotation_strings* が偽の場合、文字列で表されたシグネチャの中の :" -"term:`アノテーション ` は、最初と最後のクォート記号無しで表示され" -"ます。この挙動は、シグネチャが :attr:`~annotationlib.Format.STRING` フォー" -"マットで作られた場合や ``from __future__ import annotations`` が使われた場合" -"に有用です。" +"*quote_annotation_strings* が偽の場合、シグネチャ内の :term:`アノテーション " +"` が文字列であれば、前後の引用符を付けずに表示します。\n" +"これは、シグネチャが :attr:`~annotationlib.Format.STRING` 形式で作られた場合" +"や、``from __future__ import annotations`` を使った場合に便利です。" #: ../../library/inspect.rst:1000 msgid "The *unquote_annotations* parameter was added." @@ -2288,7 +2286,6 @@ msgstr "" "優先順位はクラスの型によって異なります。非常に特殊なユーザ定義のメタクラスを" "使用していない限り、*cls* が戻り値の先頭要素となります。" -#: ../../library/inspect.rst:1350 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -2300,14 +2297,16 @@ msgid "" "exception of the same type and the same or similar message is raised. For " "example:" msgstr "" -"*args* と *kwds* を、あたかもそれらをパラメータとして呼ばれたかのように、 " -"Python 関数またはメソッド *func* に束縛します。また、第一引数 (通常 ``self`` " -"という名前です) を関連するインスタンスに束縛します。引数名 (もし存在すれば " -"``*`` や ``**`` で始まる引数も含む) を *args* および *kwds* で与えられた値に" -"マッピングする辞書を返します。 *func* を不正に呼び出した場合、すなわち " -"``func(*args, **kwds)`` の呼び出しが不完全なシグネチャにより例外を送出するよ" -"うな場合は、同じ型の例外を同一またはよく似たメッセージとともに送出します。以" -"下は使用例です:" +"*args* と *kwds* を使って Python 関数またはメソッド *func* を呼び出した場合と" +"同じように、それぞれの値を引数名に対応付けます。\n" +"束縛メソッドの場合は、最初の引数 (通常は ``self``) にも対応するインスタンスを" +"割り当てます。\n" +"引数名 (``*`` や ``**`` の引数があればその名前も含む) から、*args* と *kwds* " +"で与えられた値への対応を表す辞書を返します。\n" +"*func* の呼び出し方が不正な場合、つまり ``func(*args, **kwds)`` がシグネチャ" +"に合わず例外を送出する場合は、同じ型の例外を同じか類似のメッセージとともに送" +"出します。\n" +"以下は使用例です:" #: ../../library/inspect.rst:1359 msgid "" diff --git a/library/io.po b/library/io.po index 7cc02ebe4..52bb5adfe 100644 --- a/library/io.po +++ b/library/io.po @@ -45,7 +45,6 @@ msgid "" "are *stream* and *file-like object*." msgstr "" -#: ../../library/io.rst:26 msgid "" "Independent of its category, each concrete stream object will also have " "various capabilities: it can be read-only, write-only, or read-write. It can " @@ -53,11 +52,11 @@ msgid "" "location), or only sequential access (for example in the case of a socket or " "pipe)." msgstr "" -"それぞれの具象ストリームオブジェクトは、カテゴリに応じた機能を持ちます。スト" -"リームは読み込み専用、書き込み専用、読み書き可能のいずかになります。任意のラ" -"ンダムアクセス(前方、後方の任意の場所にシークする)が可能かもしれませんし、" -"シーケンシャルアクセスしかできないかもしれません(例えばソケットやパイプな" -"ど)。" +"それぞれの具象ストリームオブジェクトは、カテゴリとは独立にさまざまな機能を持" +"ちます。\n" +"読み込み専用、書き込み専用、読み書き可能のいずれかであり、任意のランダムアク" +"セス (前後の任意の位置へのシーク) ができるものもあれば、ソケットやパイプのよ" +"うにシーケンシャルアクセスしかできないものもあります。" #: ../../library/io.rst:32 msgid "" @@ -609,15 +608,15 @@ msgstr "" "ナリストリームか (文字列を yield する) テキストストリームかによって、 少し異" "なります。下の :meth:`~IOBase.readline` を参照してください。" -#: ../../library/io.rst:336 msgid "" ":class:`IOBase` is also a context manager and therefore supports the :" "keyword:`with` statement. In this example, *file* is closed after the :" "keyword:`!with` statement's suite is finished---even if an exception occurs::" msgstr "" -":class:`IOBase` はコンテキストマネージャでもあります。そのため :keyword:" -"`with` 構文をサポートします。 次の例では、 :keyword:`!with` 構文が終わった後" -"で---たとえ例外が発生した場合でも、 *file* は閉じられます。" +":class:`IOBase` はコンテキストマネージャでもあるため、:keyword:`with` 文をサ" +"ポートします。\n" +"次の例では、例外が発生した場合でも :keyword:`!with` 文の本体を抜けた後で " +"*file* が閉じられます。 ::" #: ../../library/io.rst:340 msgid "" @@ -870,13 +869,12 @@ msgid "" "The default implementation defers to :meth:`readall` and :meth:`readinto`." msgstr "デフォルトの実装は :meth:`readall` と :meth:`readinto` に従います。" -#: ../../library/io.rst:492 msgid "" "Read and return all the bytes from the stream until EOF, using multiple " "calls to the stream if necessary." msgstr "" -"EOF までストリームからすべてのバイトを読み込みます。必要な場合はストリームに" -"対して複数の呼び出しをします。" +"EOF までストリームからすべてのバイトを読み込んで返します。\n" +"必要な場合はストリームに対して複数の呼び出しをします。" #: ../../library/io.rst:495 msgid "" @@ -1093,15 +1091,14 @@ msgstr "" "ともあれば、パフォーマンスやレイテンシの関係でバッファに保持されることもあり" "ます。" -#: ../../library/io.rst:642 msgid "" "When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data " "needed to be written to the raw stream but it couldn't accept all the data " "without blocking." msgstr "" -"ノンブロッキングモードであるとき、バッファが満杯で根底の生ストリームが書き込" -"み時点でさらなるデータを受け付けられない場合 :exc:`BlockingIOError` が送出さ" -"れます。" +"ノンブロッキングモードでは、生ストリームへの書き込みが必要になった際に、ブ" +"ロックせずにすべてのデータを受け付けられない場合、:exc:`BlockingIOError` を送" +"出します。" #: ../../library/io.rst:646 msgid "" @@ -1139,7 +1136,6 @@ msgstr "" "この場合、closefd は ``True`` (デフォルト) でなければなりません。\n" "``True`` でない場合、エラーが送出されます。" -#: ../../library/io.rst:667 msgid "" "an integer representing the number of an existing OS-level file descriptor " "to which the resulting :class:`FileIO` object will give access. When the " @@ -1147,8 +1143,9 @@ msgid "" "set to ``False``." msgstr "" "結果の :class:`FileIO` オブジェクトがアクセスを与える、既存の OS レベルファイ" -"ル記述子の数を表す整数。FileIO オブジェクトが閉じられると、*closefd* が " -"``False`` に設定されていない場合、この fd も閉じられます。" +"ル記述子の番号を表す整数。\n" +"FileIO オブジェクトが閉じられると、*closefd* が ``False`` に設定されていない" +"場合、この fd も閉じられます。" #: ../../library/io.rst:672 msgid "" @@ -1290,13 +1287,12 @@ msgid "" "b'ab56ef'" msgstr "" -#: ../../library/io.rst:752 msgid "" "As long as the view exists, the :class:`BytesIO` object cannot be resized or " "closed." msgstr "" -"ビューが存在する限り、:class:`BytesIO` オブジェクトはリサイズやクローズされま" -"せん。" +"ビューが存在する限り、:class:`BytesIO` オブジェクトはリサイズやクローズができ" +"ません。" #: ../../library/io.rst:759 msgid "Return :class:`bytes` containing the entire contents of the buffer." @@ -1337,15 +1333,15 @@ msgstr "" "保持されることがあります。バッファされたデータはその後の読み出し処理で直接返" "すことができます。" -#: ../../library/io.rst:785 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " "*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" "`DEFAULT_BUFFER_SIZE` is used." msgstr "" -"このコンストラクタは与えられた *raw* ストリームと *buffer_size* に対し :" -"class:`BufferedReader` を生成します。 *buffer_size* が省略された場合、代わり" -"に :data:`DEFAULT_BUFFER_SIZE` が使われます。" +"このコンストラクタは与えられた読み取り可能な *raw* ストリームと " +"*buffer_size* に対し :class:`BufferedReader` を生成します。\n" +"*buffer_size* が省略された場合、代わりに :data:`DEFAULT_BUFFER_SIZE` が使われ" +"ます。" #: ../../library/io.rst:789 msgid "" @@ -1530,15 +1526,14 @@ msgstr "" msgid "The error setting of the decoder or encoder." msgstr "このエンコーダやデコーダのエラー設定です。" -#: ../../library/io.rst:902 msgid "" "A string, a tuple of strings, or ``None``, indicating the newlines " "translated so far. Depending on the implementation and the initial " "constructor flags, this may not be available." msgstr "" -"文字列、文字列のタプル、または ``None`` で、改行がどのように読み換えられるか" -"を指定します。実装や内部コンストラクタのフラグに依って、これは利用できないこ" -"とがあります。" +"これまでに変換した改行の種類を示す文字列、文字列のタプル、または ``None`` で" +"す。\n" +"実装やコンストラクタに渡した初期フラグによっては利用できません。" #: ../../library/io.rst:908 msgid "" @@ -1733,18 +1728,17 @@ msgstr "" msgid "The *write_through* argument has been added." msgstr "*write_through* 引数が追加されました。" -#: ../../library/io.rst:1029 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " "encoding using :func:`locale.setlocale`, use the current locale encoding " "instead of the user preferred encoding." msgstr "" -"*encoding* の規定値が ``locale.getpreferredencoding()`` から ``locale." -"getpreferredencoding(False)`` になりました。\n" -":func:`locale.setlocale` を用いてロケールのエンコーディングを一時的に変更して" -"はいけません。ユーザが望むエンコーディングではなく現在のロケールのエンコー" -"ディングを使用してください。" +"*encoding* のデフォルト値が ``locale.getpreferredencoding()`` から ``locale." +"getpreferredencoding(False)`` に変わりました。\n" +":func:`locale.setlocale` でロケールのエンコーディングを一時的に変更しなくな" +"り、ユーザーが望むエンコーディングの代わりに現在のロケールのエンコーディング" +"を使います。" #: ../../library/io.rst:1035 msgid "" @@ -1781,14 +1775,13 @@ msgstr "" "このテキストストリームを *encoding*, *errors*, *newline*, *line_buffering* " "と *write_through* を新しい設定として再設定します。" -#: ../../library/io.rst:1063 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -"*encoding* が指定されており、*errors* が指定されていないときに、 " -"``errors='strict'`` が使われている場合を除き、指定されなかったパラメータは現" -"在の設定が保持されます。" +"指定しなかったパラメータは現在の設定を保持します。\n" +"ただし、*encoding* を指定して *errors* を指定しなかった場合は、" +"``errors='strict'`` を使います。" #: ../../library/io.rst:1067 msgid "" diff --git a/library/ipaddress.po b/library/ipaddress.po index 111538b9e..da4fca687 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -100,7 +100,6 @@ msgstr "" "*address* が正しい IPv4, IPv6 アドレスを表現していない場合や、ネットワークの " "host bit がセットされていた場合は :exc:`ValueError` を発生させます。" -#: ../../library/ipaddress.rst:68 msgid "" "Return an :class:`IPv4Interface` or :class:`IPv6Interface` object depending " "on the IP address passed as argument. *address* is a string or integer " @@ -110,9 +109,10 @@ msgid "" "IPv6 address." msgstr "" "引数に渡された IP address に応じて、 :class:`IPv4Interface` か :class:" -"`IPv6Interface` のオブジェクトを返します。 *address* は IP ネットワークを示す" -"文字列あるいは整数です。 IPv4 か IPv6 のネットワークを受け取ります; " -"``2**32`` より小さい整数はデフォルトでは IPv4 アドレスだと判断されます。 " +"`IPv6Interface` のオブジェクトを返します。\n" +"*address* は IP アドレスを示す文字列あるいは整数です。\n" +"IPv4 か IPv6 のアドレスを受け取ります; ``2**32`` より小さい整数はデフォルトで" +"は IPv4 アドレスだと判断されます。\n" "*address* が正しい IPv4, IPv6 アドレスを表現していない場合は :exc:" "`ValueError` を発生させます。" @@ -1212,7 +1212,6 @@ msgstr "" "だったり IPv6 IPアドレスとして大きすぎる場合は :exc:`ValueError` 例外を発生さ" "せます。" -#: ../../library/ipaddress.rst:992 msgid "" "Return an iterator of the summarized network range given the first and last " "IP addresses. *first* is the first :class:`IPv4Address` or :class:" @@ -1222,13 +1221,15 @@ msgid "" "`ValueError` is raised if *last* is not greater than *first* or if *first* " "address version is not 4 or 6." msgstr "" -"first と last で指定された IPアドレス帯に対するイテレーターを返します。 " +"最初と最後の IP アドレスで指定した範囲を集約したネットワークのイテレータを返" +"します。\n" "*first* はアドレス帯の中の最初の :class:`IPv4Address` か :class:" "`IPv6Address` で、 *last* はアドレス帯の中の最後の :class:`IPv4Address` か :" -"class:`IPv6Address` です。 *first* か *last* がIPアドレスでない場合や、2つの" -"型が揃っていない場合に、 :exc:`TypeError` を発生させます。 *last* が *first* " -"より大きくない場合や、 *first* アドレスのバージョンが 4 でも 6 でもない場合" -"は :exc:`ValueError` を発生させます。" +"class:`IPv6Address` です。\n" +"*first* か *last* がIPアドレスでない場合や、2つの型が揃っていない場合に、 :" +"exc:`TypeError` を発生させます。\n" +"*last* が *first* より大きくない場合や、 *first* アドレスのバージョンが 4 で" +"も 6 でもない場合は :exc:`ValueError` を発生させます。" #: ../../library/ipaddress.rst:1008 msgid "" @@ -1238,15 +1239,15 @@ msgid "" "if *addresses* contains mixed version objects." msgstr "" -#: ../../library/ipaddress.rst:1021 msgid "" "Return a key suitable for sorting between networks and addresses. Address " "and Network objects are not sortable by default; they're fundamentally " "different, so the expression::" msgstr "" -"ネットワークとアドレスをソートするための key 関数を返します。アドレスとネット" -"ワークは本質的に違うものなので、デフォルトでは比較できません。そのため、次の" -"式は::" +"ネットワークとアドレスをソートするための キーを返します。\n" +"アドレスとネットワークは本質的に違うものなので、デフォルトでは比較できませ" +"ん。\n" +"そのため、次の式は::" #: ../../library/ipaddress.rst:1025 msgid "IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')" diff --git a/library/itertools.po b/library/itertools.po index bf69b1ea2..3f8059a3d 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -831,7 +831,6 @@ msgid "" " yield x" msgstr "" -#: ../../library/itertools.rst:405 msgid "" "Make an iterator that returns consecutive keys and groups from the " "*iterable*. The *key* is a function computing a key value for each element. " @@ -839,13 +838,13 @@ msgid "" "returns the element unchanged. Generally, the iterable needs to already be " "sorted on the same key function." msgstr "" -"同じキーをもつような要素からなる *iterable* 中のグループに対して、キーとグ" -"ループを返すようなイテレータを作成します。*key* は各要素に対するキー値を計算" -"する関数です。キーを指定しない場合や ``None`` にした場合、*key* 関数のデフォ" -"ルトは恒等関数になり要素をそのまま返します。通常、*iterable* は同じキー関数で" -"ソート済みである必要があります。" +"*iterable* 内で同じキーを持つ連続した要素をグループにまとめ、キーとグループを" +"返すイテレータを作成します。\n" +"*key* は各要素に対するキー値を計算する関数です。\n" +"キーを指定しない場合や ``None`` にした場合、*key* 関数のデフォルトは恒等関数" +"になり要素をそのまま返します。\n" +"通常、*iterable* は同じキー関数でソート済みである必要があります。" -#: ../../library/itertools.rst:411 msgid "" "The operation of :func:`groupby` is similar to the ``uniq`` filter in Unix. " "It generates a break or new group every time the value of the key function " @@ -853,10 +852,10 @@ msgid "" "the same key function). That behavior differs from SQL's GROUP BY which " "aggregates common elements regardless of their input order." msgstr "" -":func:`groupby` の操作は Unix の ``uniq`` フィルターと似ています。 key 関数の" -"値が変わるたびに休止または新しいグループを生成します (このために通常同じ key " -"関数でソートしておく必要があるのです)。この動作は SQL の入力順に関係なく共通" -"の要素を集約する GROUP BY とは違います。" +":func:`groupby` の操作は Unix の ``uniq`` フィルターと似ています。\n" +"``key`` 関数の値が変わるたびに区切りを入れ、新しいグループを生成します (この" +"ために通常同じ ``key`` 関数でソートしておく必要があるのです)。\n" +"この動作は SQL の入力順に関係なく共通の要素を集約する GROUP BY とは違います。" #: ../../library/itertools.rst:417 msgid "" @@ -1298,17 +1297,16 @@ msgid "" "even if the original *iterable* is threadsafe." msgstr "" -#: ../../library/itertools.rst:755 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " "most or all of the data before another iterator starts, it is faster to use :" "func:`list` instead of :func:`tee`." msgstr "" -":func:`tee` はかなり大きなメモリ領域を使用するかもしれません (使用するメモリ" -"量はiterableの大きさに依存します)。一般には、一つのイテレータが他のイテレータ" -"よりも先にほとんどまたは全ての要素を消費するような場合には、 ``tee()`` より" -"も :func:`list` を使った方が高速です。" +"このイテレータツールは、一時的に保存する必要があるデータ量によっては、多くの" +"補助記憶領域を必要とすることがあります。\n" +"一般に、一方のイテレータが他方の処理開始前にデータの大半またはすべてを使う場" +"合は、:func:`tee` より :func:`list` を使う方が高速です。" #: ../../library/itertools.rst:763 msgid "Make an iterator that aggregates elements from each of the *iterables*." diff --git a/library/json.po b/library/json.po index b60311b0b..1f0c21064 100644 --- a/library/json.po +++ b/library/json.po @@ -276,17 +276,16 @@ msgstr "" msgid "See :ref:`json-commandline` for detailed documentation." msgstr "詳細については :ref:`json-commandline` を参照してください。" -#: ../../library/json.rst:136 msgid "" "JSON is a subset of `YAML `_ 1.2. The JSON produced by " "this module's default settings (in particular, the default *separators* " "value) is also a subset of YAML 1.0 and 1.1. This module can thus also be " "used as a YAML serializer." msgstr "" -"JSON は `YAML `_ 1.2 のサブセットです。このモジュールのデ" -"フォルト設定 (特に、デフォルトの *セパレータ* 値) で生成される JSON は YAML " -"1.0 および 1.1 のサブセットでもあります。このモジュールは YAML シリアライザと" -"しても使えます。" +"JSON は `YAML `_ 1.2 のサブセットです。\n" +"このモジュールのデフォルト設定 (特に、デフォルトの *separators* 値) で生成さ" +"れる JSON は YAML 1.0 および 1.1 のサブセットでもあります。\n" +"このモジュールは YAML シリアライザとしても使えます。" #: ../../library/json.rst:143 msgid "" @@ -535,7 +534,6 @@ msgstr "" "*fp* には :term:`binary file` 型も使えるようになりました。入力のエンコーディ" "ングは UTF-8, UTF-16, UTF-32 のいずれかでなければなりません。" -#: ../../library/json.rst:356 msgid "" "The default *parse_int* of :func:`int` now limits the maximum length of the " "integer string via the interpreter's :ref:`integer string conversion length " @@ -543,7 +541,7 @@ msgid "" msgstr "" "デフォルトの *parse_int* である :func:`int` は、インタープリタの :ref:" "`integer string conversion length limitation ` により整数" -"文字列の最大長を制限するようになり、サービスを妨害する攻撃を拒否します。" +"文字列の最大長を制限するようになり、サービス拒否攻撃の回避に役立てます。" #: ../../library/json.rst:362 msgid "Added the optional *array_hook* parameter." @@ -808,18 +806,16 @@ msgstr "int と float の派生列挙型クラスの対応が追加されまし msgid "Added support for :class:`frozendict`." msgstr "" -#: ../../library/json.rst:511 msgid "" "To extend this to recognize other objects, subclass and implement a :meth:" "`~JSONEncoder.default` method with another method that returns a " "serializable object for ``o`` if possible, otherwise it should call the " "superclass implementation (to raise :exc:`TypeError`)." msgstr "" -"このクラスを拡張して他のオブジェクトも認識するようにするには、サブクラスを" -"作って :meth:`~JSONEncoder.default` メソッドを次のように実装します。もう一つ" -"別のメソッドでオブジェクト ``o`` に対する直列化可能なオブジェクトを返すものを" -"呼び出すようにします。変換できない時はスーパークラスの実装を (:exc:" -"`TypeError` を送出させるために) 呼ばなければなりません。" +"他のオブジェクトも認識するように拡張するには、サブクラスを作って :meth:" +"`~JSONEncoder.default` メソッドをオーバーライドします。\n" +"可能であれば ``o`` に対応する直列化可能なオブジェクトを返し、そうでなければ" +"スーパークラスの実装を呼び出して :exc:`TypeError` を送出します。" #: ../../library/json.rst:516 msgid "" @@ -1144,7 +1140,6 @@ msgstr "" msgid "Repeated Names Within an Object" msgstr "オブジェクト中に重複した名前の扱い" -#: ../../library/json.rst:710 msgid "" "The RFC specifies that the names within a JSON object should be unique, but " "does not mandate how repeated names in JSON objects should be handled. By " @@ -1152,9 +1147,10 @@ msgid "" "but the last name-value pair for a given name::" msgstr "" "RFC は JSON オブジェクト中の名前はユニークでなければならないと規定しています" -"が、JSONオブジェクトで名前が繰り返された場合の扱いについて指定していません。" +"が、JSONオブジェクトで名前が繰り返された場合の扱いについて指定していませ" +"ん。\n" "デフォルトでは、このモジュールは例外を送出せず、かわりに重複した名前のうち、" -"最後に出現した名前と値のペア以外を無視します。" +"最後に出現した名前と値のペア以外を無視します。 ::" #: ../../library/json.rst:715 msgid "" @@ -1228,7 +1224,6 @@ msgstr "" "このモジュールは関連する Python データ型や Python インタプリタ自身の制約の世" "界を超えたそのような制約を強要はしません。" -#: ../../library/json.rst:749 msgid "" "When serializing to JSON, beware any such limitations in applications that " "may consume your JSON. In particular, it is common for JSON numbers to be " @@ -1238,12 +1233,12 @@ msgid "" "magnitude, or when serializing instances of \"exotic\" numerical types such " "as :class:`decimal.Decimal`." msgstr "" -"JSON にシリアライズする際には、あなたの JSON を消費する側のアプリケーションが" -"持つ当該制約に思いを馳せてください。とりわけJSON 数値を IEEE 754 倍精度浮動小" -"数にデシリアライズする際の問題はありがちで、すなわちその有効桁数と精度の制限" -"の影響を受けます。これは、極端に大きな値を持った Python :class:`int` をシリア" -"ライズするとき、あるいは :class:`decimal.Decimal` のような \"風変わりな\" 数" -"値型をシリアライズするとき、に特に関係があります。" +"JSON に直列化する際は、その JSON を読み込むアプリケーションが持つこれらの制限" +"に注意してください。\n" +"特に、JSON の数値は IEEE 754 倍精度浮動小数点数に復元されることが多く、その表" +"現の値の範囲と精度の制限を受けます。\n" +"これは、絶対値が極めて大きい Python の :class:`int` 値や、:class:`decimal." +"Decimal` のような特殊な数値型のインスタンスを直列化する場合に特に関係します。" #: ../../library/json.rst:762 msgid "Command-line interface" diff --git a/library/locale.po b/library/locale.po index a1c9ddff8..f6a19bc6a 100644 --- a/library/locale.po +++ b/library/locale.po @@ -111,16 +111,16 @@ msgid "" "locale.setlocale(locale.LC_ALL, '')" msgstr "" -#: ../../library/locale.rst:65 msgid "" "This sets the locale for all categories to the user's default setting " "(typically specified in the :envvar:`LANG` environment variable). If the " "locale is not changed thereafter, using multithreading should not cause " "problems." msgstr "" -"から書き始めます。これは全てのカテゴリをユーザの環境における標準設定 (大抵は" -"環境変数 :envvar:`LANG` で指定されています) に設定します。その後複数スレッド" -"を使ってロケールを変更したりしない限り、問題は起こらないはずです。" +"これにより、すべてのカテゴリのロケールがユーザーのデフォルト設定 (通常は環境" +"変数 :envvar:`LANG` で指定) になります。\n" +"その後ロケールを変更しなければ、複数のスレッドを使っても問題は起こらないはず" +"です。" #: ../../library/locale.rst:69 msgid "Support language codes with ``@``-modifiers." @@ -365,25 +365,22 @@ msgstr "``CHAR_MAX``" msgid "Nothing is specified in this locale." msgstr "このロケールでは特に指定しません。" -#: ../../library/locale.rst:166 msgid "" "The function temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` " "locale or the ``LC_MONETARY`` locale if locales are different and numeric or " "monetary strings are non-ASCII. This temporary change affects other threads." msgstr "" -"``LC_NUMERIC`` ロケールや ``LC_MONETARY`` ロケールが ``LC_CTYPE`` ロケールと" -"異なっていて、数値文字列や通貨文字列が非 ASCII 文字列の場合、この関数は一時的" -"に ``LC_NUMERIC`` ロケールや ``LC_MONETARY`` ロケールに ``LC_CTYPE`` ロケール" -"を設定します。\n" -"この一時的な変更は他のスレッドに影響を及ぼします。" +"``LC_NUMERIC`` または ``LC_MONETARY`` のロケールが ``LC_CTYPE`` と異なり、数" +"値や通貨の文字列が非 ASCII 文字を含む場合、この関数は ``LC_CTYPE`` のロケール" +"を一時的に ``LC_NUMERIC`` または ``LC_MONETARY`` のロケールに設定します。\n" +"この一時的な変更は他のスレッドに影響します。" -#: ../../library/locale.rst:170 msgid "" "The function now temporarily sets the ``LC_CTYPE`` locale to the " "``LC_NUMERIC`` locale in some cases." msgstr "" -"この関数は、一時的に ``LC_NUMERIC`` ロケールに ``LC_CTYPE`` ロケールを設定す" -"る場合があります。" +"状況によっては、この関数が ``LC_CTYPE`` のロケールを一時的に ``LC_NUMERIC`` " +"のロケールに設定するようになりました。" #: ../../library/locale.rst:177 msgid "" @@ -602,7 +599,6 @@ msgstr "" "Python では現在のロケール設定に干渉したくないので、上で述べたような方法でその" "挙動をエミュレーションしています。" -#: ../../library/locale.rst:357 msgid "" "To maintain compatibility with other platforms, not only the :envvar:`LANG` " "variable is tested, but a list of variables given as envvars parameter. The " @@ -612,11 +608,12 @@ msgid "" "``'LC_CTYPE'``, ``'LANG'`` and ``'LANGUAGE'``, in that order." msgstr "" "他のプラットフォームとの互換性を維持するために、環境変数 :envvar:`LANG` だけ" -"でなく、引数 *envvars* で指定された環境変数のリストも調べられます。最初に見つ" -"かった定義が使われます。 *envvars* は標準では GNU gettext で使われている検索" -"順になります; これは常に変数名 ``LANG`` を探します。GNU gettext では " -"``'LC_ALL'`` 、 ``'LC_CTYPE'`` 、 ``'LANG'`` 、および ``'LANGUAGE'`` の順に調" -"べられます。" +"でなく、引数 *envvars* で指定された環境変数のリストも調べられます。\n" +"最初に見つかった定義が使われます。\n" +"*envvars* は標準では GNU gettext で使われている検索順になります; このリストに" +"は必ず変数名 ``'LANG'`` を含める必要があります。\n" +"GNU gettext では ``'LC_ALL'`` 、 ``'LC_CTYPE'`` 、 ``'LANG'`` 、および " +"``'LANGUAGE'`` の順に調べられます。" #: ../../library/locale.rst:364 msgid "" @@ -769,12 +766,12 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: ../../library/locale.rst:465 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -"*monetary* が真なら、桁区切り記号やグループ化文字列を用いて変換を行います。" +"*monetary* が真なら、通貨用の桁区切り記号やグループ化文字列を用いて変換を行い" +"ます。" #: ../../library/locale.rst:468 msgid "" @@ -939,17 +936,17 @@ msgstr ":func:`localeconv` の返す特別な値のためのシンボル定数 msgid "Background, details, hints, tips and caveats" msgstr "ロケールの背景、詳細、ヒント、助言および補足説明" -#: ../../library/locale.rst:592 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " "broken in such a way that frequent locale changes may cause core dumps. " "This makes the locale somewhat painful to use correctly." msgstr "" -"C 標準では、ロケールはプログラム全体にわたる特性であり、その変更は高価な処理" -"であるとしています。加えて、頻繁にロケールを変更するようなひどい実装はコアダ" -"ンプを引き起こすこともあります。このことがロケールを正しく利用する上で苦痛と" -"なっています。" +"C 標準では、ロケールはプログラム全体に適用される特性で、その変更には比較的大" +"きなコストが掛かることがあります。\n" +"さらに、実装によっては不具合があり、ロケールを頻繁に変更するとコアダンプが起" +"きる場合があります。\n" +"そのため、ロケールを正しく使うのはやや厄介です。" #: ../../library/locale.rst:597 msgid "" @@ -967,7 +964,6 @@ msgstr "" "``setlocale(LC_ALL, '')`` を呼び出して、明示的にユーザの希望するロケール設定" "を行わなければなりません。" -#: ../../library/locale.rst:604 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -975,11 +971,10 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" ":func:`setlocale` をライブラリルーチン内で呼ぶことは、それがプログラム全体に" -"及ぼす副作用の面から、一般的によくない考えです。ロケールを保存したり復帰した" -"りするのもよくありません: 高価な処理であり、ロケールの設定が復帰する以前に起" -"動してしまった他のスレッドに悪影響を及ぼすからです。" +"及ぼす副作用の面から、一般的によくない考えです。\n" +"ロケールを保存したり復帰したりするのもよくありません: 高価な処理であり、ロ" +"ケールの設定が復帰する以前に実行される他のスレッドに悪影響を及ぼすからです。" -#: ../../library/locale.rst:609 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -992,9 +987,11 @@ msgstr "" "もし、汎用を目的としたモジュールを作っていて、ロケールによって影響をうけるよ" "うな操作 (例えば :func:`time.strftime` の書式の一部) のロケール独立のバージョ" "ンが必要ということになれば、標準ライブラリルーチンを使わずに何とかしなければ" -"なりません。よりましな方法は、ロケール設定が正しく利用できているか確かめるこ" -"とです。最後の手段は、あなたのモジュールが ``C`` ロケール以外の設定には互換性" -"がないとドキュメントに書くことです。" +"なりません。\n" +"それよりも、ロケール設定に従う動作で問題ないと判断できれば、その方がよいで" +"しょう。\n" +"最後の手段は、あなたのモジュールが ``C`` ロケール以外の設定には互換性がないと" +"ドキュメントに書くことです。" #: ../../library/locale.rst:616 msgid "" @@ -1123,7 +1120,6 @@ msgstr "" msgid "Access to message catalogs" msgstr "メッセージカタログへのアクセス" -#: ../../library/locale.rst:713 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`gettext`, :func:" @@ -1133,10 +1129,11 @@ msgid "" "format for message catalogs, and the C library's search algorithms for " "locating message catalogs." msgstr "" -"C ライブラリの gettext インタフェースが提供されているシステムでは、 locake モ" -"ジュールでそのインタフェースを公開しています。このインタフェースは関数 :func:" -"`gettext` 、 :func:`dgettext` 、 :func:`dcgettext` 、 :func:`textdomain` 、 :" -"func:`bindtextdomain` 、および :func:`bind_textdomain_codeset` からなります。" +"C ライブラリの gettext インタフェースが提供されているシステムでは、 locale モ" +"ジュールでそのインタフェースを公開しています。\n" +"このインタフェースは関数 :func:`gettext` 、 :func:`dgettext` 、 :func:" +"`dcgettext` 、 :func:`textdomain` 、 :func:`bindtextdomain` 、および :func:" +"`bind_textdomain_codeset` からなります。\n" "これらは :mod:`gettext` モジュールの同名の関数に似ていますが、メッセージカタ" "ログとして C ライブラリのバイナリフォーマットを使い、メッセージカタログを探す" "ために C ライブラリのサーチアルゴリズムを使います。" diff --git a/library/logging.config.po b/library/logging.config.po index d4d248bdc..f9a7d64a9 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -110,9 +110,8 @@ msgstr "インクリメンタルな呼び出しの中で見つかった存在し msgid "An invalid logger name." msgstr "無効なロガー名。" -#: ../../library/logging.config.rst:51 msgid "Inability to resolve to an internal or external object." -msgstr "内部や外部のオブジェクトに関わる不可能性。" +msgstr "内部または外部のオブジェクトへの参照を解決できない場合。" #: ../../library/logging.config.rst:53 msgid "" @@ -294,15 +293,15 @@ msgstr "" "渡されたものと同じかもしれませんし、あるいは(おそらく暗号化の復号が行われて)" "まったく異なるものかもしれません。" -#: ../../library/logging.config.rst:156 msgid "" "To send a configuration to the socket, read in the configuration file and " "send it to the socket as a sequence of bytes preceded by a four-byte length " "string packed in binary using ``struct.pack('>L', n)``." msgstr "" -"ソケットに設定を送るには、まず設定ファイルを読み、それを ``struct.pack('>L', " -"n)`` を使って長さ 4 バイトのバイナリにパックしたものを前に付けたバイト列とし" -"てソケットに送ります。" +"ソケットに設定を送るには、設定ファイルを読み込み、そのバイト列の先頭にデータ" +"長を付けて送信します。\n" +"データ長は ``struct.pack('>L', n)`` を使って 4 バイトのバイナリ形式にパックし" +"ます。" #: ../../library/logging.config.rst:164 msgid "" @@ -630,13 +629,12 @@ msgid "" "``handlers`` (optional). A list of ids of the handlers for this logger." msgstr "``handlers`` (任意)。このロガーへのハンドラの id のリストです。" -#: ../../library/logging.config.rst:344 msgid "" "The specified loggers will be configured according to the level, " "propagation, filters and handlers specified." msgstr "" -"指定されたロガーは、指定されたレベル、伝播、ハンドラに従って環境設定されま" -"す。" +"指定されたロガーは、指定されたレベル、伝播、フィルタ、ハンドラに従って環境設" +"定されます。" #: ../../library/logging.config.rst:347 msgid "" @@ -695,7 +693,6 @@ msgstr "" "タのようなオブジェクトは匿名なので、一旦環境設定がなされると、設定を拡張する" "ときにそのような匿名オブジェクトを参照することができません。" -#: ../../library/logging.config.rst:376 msgid "" "Furthermore, there is not a compelling case for arbitrarily altering the " "object graph of loggers, handlers, filters, formatters at run-time, once a " @@ -706,11 +703,12 @@ msgid "" "worth the complexity it adds to the implementation." msgstr "" "さらに、一旦環境設定がなされた後、実行時にロガー、ハンドラ、フィルタ、フォー" -"マッタのオブジェクトグラフを任意に変えなければならない例もありません。ロガー" -"とハンドラの冗長性は、レベル (または、ロガーの場合には、伝播フラグ) を設定す" -"ることによってのみ制御できます。安全な方法でオブジェクトグラフを任意に変える" -"ことは、マルチスレッド環境で問題となります。不可能ではないですが、その効用は" -"実装に加えられる複雑さに見合いません。" +"マッタのオブジェクトグラフを任意に変えなければならない例もありません。\n" +"ロガーとハンドラの冗長性は、レベル (または、ロガーの場合には、伝播フラグ) を" +"設定するだけで制御できます。\n" +"安全な方法でオブジェクトグラフを任意に変えることは、マルチスレッド環境で問題" +"となります。\n" +"不可能ではないですが、その効用は実装に加えられる複雑さに見合いません。" #: ../../library/logging.config.rst:385 msgid "" @@ -1124,7 +1122,6 @@ msgstr "" "``filters`` および ``formatter`` の項目は、オブジェクト id を取って、適切な送" "信先オブジェクトを決定します。" -#: ../../library/logging.config.rst:636 msgid "" "However, a more generic mechanism is needed for user-defined objects which " "are not known to the :mod:`logging` module. For example, consider :class:" @@ -1137,15 +1134,17 @@ msgid "" "that the ``alternate`` referred to a handler. To cater for this, a generic " "resolution system allows the user to specify:" msgstr "" -"しかし、ユーザ定義モジュールには、 :mod:`logging` モジュールには分からないよ" -"うな、より一般的な機構が必要です。例えば、 :class:`logging.handlers." -"MemoryHandler` があって、委譲する先の別のハンドラである ``target`` 引数を取る" -"とします。システムはこのクラスをすでに知っていますから、設定中で、与えられた " +"しかし、:mod:`logging` モジュールが認識していないユーザー定義オブジェクトに" +"は、より汎用的な機構が必要です。\n" +"例えば、 :class:`logging.handlers.MemoryHandler` があって、委譲する先の別のハ" +"ンドラである ``target`` 引数を取るとします。\n" +"システムはこのクラスをすでに知っていますから、設定中で、与えられた " "``target`` は関連するターゲットハンドラのオブジェクト id でさえあればよく、シ" -"ステムはその id からハンドラを決定します。しかし、ユーザが ``my.package." -"MyHandler`` を定義して、それが ``alternate`` ハンドラを持つなら、設定システム" -"は ``alternate`` がハンドラを参照していることを知りません。これを知らせるの" -"に、一般的な解析システムで、ユーザはこのように指定できます:" +"ステムはその id からハンドラを決定します。\n" +"しかし、ユーザが ``my.package.MyHandler`` を定義して、それが ``alternate`` ハ" +"ンドラを持つなら、設定システムは ``alternate`` がハンドラを参照していることを" +"知りません。\n" +"これを知らせるのに、一般的な解析システムで、ユーザはこのように指定できます:" #: ../../library/logging.config.rst:648 msgid "" @@ -1413,7 +1412,6 @@ msgstr "" "ガーの設定は ``[logger_root]`` と呼ばれるセクションで指定されていなければなり" "ません。" -#: ../../library/logging.config.rst:818 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -1426,13 +1424,16 @@ msgid "" "when it's convenient to do so." msgstr "" ":func:`fileConfig` API は :func:`dictConfig` API よりも古く、ロギングのある種" -"の側面についてカバーする機能に欠けています。たとえば :func:`fileConfig` では" -"数値レベルを超えたメッセージを単に拾うフィルタリングを行う :class:`~logging." -"Filter` オブジェクトを構成出来ません。 :class:`~logging.Filter` のインスタン" -"スをロギングの設定において持つ必要があるならば、 :func:`dictConfig` を使う必" -"要があるでしょう。設定の機能における将来の拡張は :func:`dictConfig` に対して" -"行われることに注意してください。ですから、そうするのが便利であるときに新しい " -"API に乗り換えるのは良い考えです。" +"の側面についてカバーする機能に欠けています。\n" +"たとえば :func:`fileConfig` では単純な整数のレベルによる判定以外の方法でメッ" +"セージをフィルタリングを行う :class:`~logging.Filter` オブジェクトを構成出来" +"ません。\n" +":class:`~logging.Filter` のインスタンスをロギングの設定において持つ必要がある" +"ならば、 :func:`dictConfig` を使う必要があるでしょう。\n" +"設定の機能における将来の拡張は :func:`dictConfig` に対して行われることに注意" +"してください。\n" +"ですから、そうするのが便利であるときに新しい API に乗り換えるのは良い考えで" +"す。" #: ../../library/logging.config.rst:828 msgid "Examples of these sections in the file are given below." diff --git a/library/logging.handlers.po b/library/logging.handlers.po index cdff2b1f7..f6ecf8cf1 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -241,13 +241,12 @@ msgstr ":class:`NullHandler` クラスの新しいインスタンスを返しま msgid "This method does nothing." msgstr "このメソッドは何もしません。" -#: ../../library/logging.handlers.rst:146 msgid "" "This method returns ``None`` for the lock, since there is no underlying I/O " "to which access needs to be serialized." msgstr "" -"アクセスが特殊化される必要がある I/O が下にないので、このメソッドはロックに対" -"して ``None`` を返します。" +"アクセスを直列化する必要のある I/O がないため、このメソッドはロックとして " +"``None`` を返します。" #: ../../library/logging.handlers.rst:150 msgid "" @@ -285,7 +284,6 @@ msgstr "" "たと判断します。) ファイルが変わったら古いファイルのストリームは閉じて、現在" "のファイルを新しいストリームを取得するために開きます。" -#: ../../library/logging.handlers.rst:171 msgid "" "This handler is not appropriate for use under Windows, because under Windows " "open log files cannot be moved or renamed - logging opens the files with " @@ -293,11 +291,12 @@ msgid "" "*ST_INO* is not supported under Windows; :func:`~os.stat` always returns " "zero for this value." msgstr "" -"このハンドラを Windows で使うことは適切ではありません。というのも Windows で" -"は開いているログファイルを移動したり削除したりできないからです - logging は" -"ファイルを排他的ロックを掛けて開きます - そのためこうしたハンドラは必要ないの" -"です。さらに、 Windows では *ST_INO* がサポートされていません; :func:`~os." -"stat` はこの値として常に 0 を返します。" +"このハンドラを Windows で使うことは適切ではありません。\n" +"というのも Windows では開いているログファイルを移動したり名前を変更したりでき" +"ないからです - logging はファイルを排他的ロックを掛けて開きます - そのためこ" +"うしたハンドラは必要ないのです。\n" +"さらに、 Windows では *ST_INO* がサポートされていません; :func:`~os.stat` は" +"この値として常に 0 を返します。" #: ../../library/logging.handlers.rst:180 msgid "" @@ -310,15 +309,15 @@ msgid "" "errors are handled." msgstr "" -#: ../../library/logging.handlers.rst:196 msgid "" "Checks to see if the file has changed. If it has, the existing stream is " "flushed and closed and the file opened again, typically as a precursor to " "outputting the record to the file." msgstr "" -"ファイルが変更されていないかチェックします。\n" -"もし変更されていれば、手始めにレコードをファイルに出力し、既存のストリームは" -"フラッシュして閉じられ、ファイルが再度開かれます。" +"ファイルが変更されたか確認します。\n" +"変更されていれば既存のストリームをフラッシュして閉じ、ファイルを開き直しま" +"す。\n" +"通常は、レコードをファイルに出力する前の準備として行います。" #: ../../library/logging.handlers.rst:205 msgid "" @@ -367,7 +366,6 @@ msgstr "" "返すべきです。そうでなければ、ロールオーバーの振る舞いは期待通りに動かないか" "もしれません。" -#: ../../library/logging.handlers.rst:234 msgid "" "It's also worth noting that care should be taken when using a namer to " "preserve certain attributes in the filename which are used during rotation. " @@ -383,18 +381,20 @@ msgid "" "`~TimedRotatingFileHandler.getFilesToDelete` method to fit in with the " "custom naming scheme.)" msgstr "" -"namer 属性にローテーションの際に使われるファイル名に埋め込むための特定の属性" -"を保持しようとする場合に注意が必要なことは、注意喚起しておくべきでしょう。た" -"とえば :class:`RotatingFileHandler` は、ローテーションが期待通りに動作するた" -"めに、名前に連続した番号を含むようなファイル名のリストを持つことを期待しま" -"す。また :class:`TimedRotatingFileHandler` は (ハンドラの初期化時に渡された " +"``namer`` を使う場合は、ローテーションで利用されるファイル名の特徴を保つ必要" +"がある点にも注意してください。\n" +"たとえば :class:`RotatingFileHandler` は、ローテーションが期待通りに動作する" +"ために、名前に連続した番号を含むようなファイル名のリストを持つことを期待しま" +"す。\n" +"また :class:`TimedRotatingFileHandler` は (ハンドラの初期化時に渡された " "``backupCount`` にもとづいて) 削除すべき古いファイルを決定しながら、古いログ" -"ファイルを削除します。この仕組みが動作するためには、ファイル名は名前に含まれ" -"る日付や時刻でソート可能である必要があり、 namer はそれを尊重しなければなりま" -"せん (namer がこの規則を尊重したくない場合、そのような namer は :meth:" -"`~TimedRotatingFileHandler.getFilesToDelete` メソッドが特定の命名規則に適合す" -"るようにオーバーライドされた :class:`TimedRotatingFileHandler` の派生クラス内" -"で使う必要があるでしょう)。" +"ファイルを削除します。\n" +"この仕組みが動作するためには、ファイル名は名前に含まれる日付や時刻でソート可" +"能である必要があり、 namer はそれを尊重しなければなりません (namer がこの規則" +"を尊重したくない場合、そのような namer は :meth:`~TimedRotatingFileHandler." +"getFilesToDelete` メソッドが特定の命名規則に適合するようにオーバーライドされ" +"た :class:`TimedRotatingFileHandler` の派生クラス内で使う必要があるでしょ" +"う)。" #: ../../library/logging.handlers.rst:252 msgid "" @@ -752,7 +752,6 @@ msgid "" msgstr "" "*errors* が指定されると、エンコーディングエラーの取り扱い方法を決定します。" -#: ../../library/logging.handlers.rst:429 msgid "" "Calculation of the initial rollover time is done when the handler is " "initialised. Calculation of subsequent rollover times is done only when " @@ -766,14 +765,17 @@ msgid "" "five minutes (say), then there will be gaps in the file times corresponding " "to the minutes where no output (and hence no rollover) occurred." msgstr "" -"最初のロールオーバーの計算はハンドラーが初期化されたときに行われます。後続の" -"ロールオーバーは、ロールオーバーが発生し、ロールオーバーが出力した時にのみ行" -"われます。これを念頭に置いておかないと混乱する可能性があります。例えば、イン" -"ターバルが *毎分* に設定されていて、1分ごとにログファイルが常に生成されるとは" -"限りません。アプリケーションが実行されている間、1分に1回以上のログ出力されて " -"*いるとすると* 毎分、分割されたログファイルが出力されますが、そうでなく、5分" -"ごとに出力される場合は、出力されずにロールオーバーが実行されなかった時間分の" -"ギャップが生じます。" +"最初のロールオーバーの計算はハンドラーが初期化されたときに行われます。\n" +"次回のロールオーバー時刻を計算するのは、ロールオーバーが起きたときだけで" +"す。\n" +"また、ロールオーバー自体はログの出力時にしか起きません。\n" +"これを念頭に置いておかないと混乱する可能性があります。\n" +"例えば、インターバルが *毎分* に設定されていて、1分ごとにログファイルが常に生" +"成されるとは限りません。\n" +"アプリケーションが実行されている間、1分に1回以上のログ出力されて *いるとする" +"と* 毎分、分割されたログファイルが出力されますが、そうでなく、5分ごとに出力さ" +"れる場合は、出力されずにロールオーバーが実行されなかった時間分のギャップが生" +"じます。" #: ../../library/logging.handlers.rst:442 msgid "*atTime* parameter was added." @@ -1003,18 +1005,16 @@ msgstr "" "``port`` に ``None`` を指定すると、Unix ドメインソケットが ``host`` 値を用い" "て作られます - そうでない場合は UDP ソケットが作られます。" -#: ../../library/logging.handlers.rst:594 msgid "" "Pickles the record's attribute dictionary and writes it to the socket in " "binary format. If there is an error with the socket, silently drops the " "packet. To unpickle the record at the receiving end into a :class:`~logging." "LogRecord`, use the :func:`~logging.makeLogRecord` function." msgstr "" -"レコードの属性辞書を pickle して、バイナリ形式でソケットに書き込みます。ソ" -"ケット操作でエラーが生じた場合、暗黙のうちにパケットは捨てられます。事前に接" -"続が失われていた場合、接続を再度確立します。受信端でレコードを unpickle し" -"て :class:`~logging.LogRecord` にするには、 :func:`~logging.makeLogRecord` 関" -"数を使ってください。" +"レコードの属性辞書を pickle して、バイナリ形式でソケットに書き込みます。\n" +"ソケット操作でエラーが生じた場合、暗黙のうちにパケットは捨てられます。\n" +"受信端でレコードを unpickle して :class:`~logging.LogRecord` にするには、 :" +"func:`~logging.makeLogRecord` 関数を使ってください。" #: ../../library/logging.handlers.rst:603 msgid "" @@ -1461,7 +1461,6 @@ msgid "" "Hammond's Win32 extensions for Python installed." msgstr "" -#: ../../library/logging.handlers.rst:805 msgid "" "Returns a new instance of the :class:`NTEventLogHandler` class. The " "*appname* is used to define the application name as it appears in the event " @@ -1476,16 +1475,20 @@ msgid "" "in the event log). The *logtype* is one of ``'Application'``, ``'System'`` " "or ``'Security'``, and defaults to ``'Application'``." msgstr "" -":class:`NTEventLogHandler` クラスの新たなインスタンスを返します。 *appname* " -"はイベントログに表示する際のアプリケーション名を定義するために使われます。こ" -"の名前を使って適切なレジストリエントリが生成されます。 *dllname* はログに保存" -"するメッセージ定義の入った .dll または .exe ファイルへの完全修飾パス名を与え" -"なければなりません (指定されない場合、 ``'win32service.pyd'`` が使われます - " -"このライブラリは Win32 拡張とともにインストールされ、いくつかのプレースホルダ" -"となるメッセージ定義を含んでいます)。これらのプレースホルダを利用すると、メッ" -"セージの発信源全体がログに記録されるため、イベントログは巨大になるので注意し" -"てください。 *logtype* は ``'Application'``, ``'System'``, ``'Security'`` の" -"いずれかで、デフォルトは ``'Application'`` です。" +":class:`NTEventLogHandler` クラスの新たなインスタンスを返します。\n" +"*appname* はイベントログに表示する際のアプリケーション名を定義するために使わ" +"れます。\n" +"この名前を使って適切なレジストリエントリが生成されます。\n" +"*dllname* はログに保存するメッセージ定義の入った .dll または .exe ファイルへ" +"の完全修飾パス名を与えなければなりません (指定されない場合、 ``'win32service." +"pyd'`` が使われます - このライブラリは Win32 拡張とともにインストールされ、い" +"くつかのプレースホルダとなるメッセージ定義を含んでいます)。\n" +"これらのプレースホルダを利用すると、メッセージの発信源全体がログに記録される" +"ため、イベントログは巨大になるので注意してください。\n" +"ログを小さくしたい場合は、イベントログで使うメッセージ定義を含む独自の .dll " +"または .exe の名前を渡す必要があります。\n" +"*logtype* は ``'Application'``, ``'System'``, ``'Security'`` のいずれかで、デ" +"フォルトは ``'Application'`` です。" #: ../../library/logging.handlers.rst:821 msgid "" @@ -1713,9 +1716,8 @@ msgid "" "behavior." msgstr "" -#: ../../library/logging.handlers.rst:972 msgid "Sets the target handler for this handler." -msgstr "ターゲットハンドラをこのハンドラに設定します。" +msgstr "このハンドラの送信先となるハンドラを設定します。" #: ../../library/logging.handlers.rst:977 msgid "Checks for buffer full or a record at the *flushLevel* or higher." @@ -1828,7 +1830,6 @@ msgstr "" "ような) 潜在的に遅い操作が行われるような、ウェブアプリケーションおよびその他" "のサービスアプリケーションにおいて重要です。" -#: ../../library/logging.handlers.rst:1050 msgid "" "Returns a new instance of the :class:`QueueHandler` class. The instance is " "initialized with the queue to send messages to. The *queue* can be any queue-" @@ -1837,12 +1838,13 @@ msgid "" "task tracking API, which means that you can use :class:`~queue.SimpleQueue` " "instances for *queue*." msgstr "" -":class:`QueueHandler` クラスの新しいインスタンスを返します。インスタンスは、" -"キューにメッセージを送るように初期化されます。キューは任意のキューのようなオ" -"ブジェクトが可能です; それはそのまま :meth:`enqueue` メソッドによって使用され" -"ます。そのメソッドはメッセージを送る方法を知っている必要があります。もしタス" -"クのトラッキングAPIにキューが必要でない場合はキューとして :class:`~queue." -"SimpleQueue` のインスタンスが使用できます。" +":class:`QueueHandler` クラスの新しいインスタンスを返します。\n" +"インスタンスは、メッセージの送信先となるキューを指定して初期化します。\n" +"*queue* には任意のキューのようなオブジェクトを指定できます。\n" +":meth:`enqueue` メソッドにそのまま渡されるので、そのメソッドでキューにメッ" +"セージを送る方法を扱う必要があります。\n" +"キューがタスク追跡 API を持つ必要は *ない* ため、*queue* に :class:`~queue." +"SimpleQueue` インスタンスも使えます。" #: ../../library/logging.handlers.rst:1057 #: ../../library/logging.handlers.rst:1155 @@ -1882,7 +1884,6 @@ msgstr "" "キューに追加するためレコードを準備します。このメソッドが返したオブジェクトが" "キューに追加されます。" -#: ../../library/logging.handlers.rst:1083 msgid "" "The base implementation formats the record to merge the message, arguments, " "exception and stack information, if present. It also removes unpickleable " @@ -1892,12 +1893,12 @@ msgid "" "attr:`exc_info` and :attr:`exc_text` attributes to ``None``." msgstr "" "基底の実装はレコードがメッセージや引数と、またもし存在すれば、発生した例外お" -"よびスタック情報と統合されるようにフォーマットします。またこの実装では非 " -"pickle 化不可能な要素をレコードから削除します。特に、この実装はレコードの :" -"attr:`msg` と :attr:`message` 属性を (ハンドラの :meth:`format` メソッドを呼" -"び出すことによって得られる) 統合されたメッセージで上書きし、同時に :attr:" -"`args`, :attr:`exc_info`, :attr:`exc_text` の3つの属性値をすべて ``None`` に" -"設定します。" +"よびスタック情報と統合されるようにフォーマットします。\n" +"またこの実装ではpickle 化不可能な要素をレコードから削除します。\n" +"特に、この実装はレコードの :attr:`msg` と :attr:`message` 属性を (ハンドラ" +"の :meth:`format` メソッドを呼び出すことによって得られる) 統合されたメッセー" +"ジで上書きし、同時に :attr:`args`, :attr:`exc_info`, :attr:`exc_text` の3つの" +"属性値をすべて ``None`` に設定します。" #: ../../library/logging.handlers.rst:1091 msgid "" @@ -1986,7 +1987,6 @@ msgstr "" "ような) 潜在的に遅い操作が行われるような、ウェブアプリケーションおよびその他" "のサービスアプリケーションにおいて重要です。" -#: ../../library/logging.handlers.rst:1147 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1996,14 +1996,14 @@ msgid "" "tracking API (though it's used if available), which means that you can use :" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -":class:`QueueListener` クラスの新しいインスタンスを返します。インスタンスは、" -"メッセージを送るためのキューと、キューに格納されたエントリーを処理するハンド" -"ラーのリストが設定されて初期化されます。キューは任意のキューのようなオブジェ" -"クトが可能です; それはそのまま :meth:`dequeue` メソッドによって使用されます。" -"そのメソッドはメッセージを送る方法を知っている必要があります。もしタスクのト" -"ラッキングAPIにキューが必要でない場合はキューとして :class:`~queue." -"SimpleQueue` のインスタンスが使用できます(トラッキングAPIが使用可能な場合は" -"使用されます)。" +":class:`QueueListener` クラスの新しいインスタンスを返します。\n" +"インスタンスは、メッセージの送信先となるキューと、キューに入ったエントリーを" +"処理するハンドラのリストを指定して初期化します。\n" +"任意のキューのようなオブジェクトを使えます。\n" +":meth:`dequeue` メソッドにそのまま渡されるので、そのメソッドでキューからメッ" +"セージを取り出す方法を扱う必要があります。\n" +"キューがタスク追跡 API を持つ必要は *ありません* が、利用可能なら使います。\n" +"そのため、*queue* に :class:`~queue.SimpleQueue` インスタンスも使えます。" #: ../../library/logging.handlers.rst:1158 msgid "" diff --git a/library/logging.po b/library/logging.po index 8397c673b..ee5736af5 100644 --- a/library/logging.po +++ b/library/logging.po @@ -51,13 +51,12 @@ msgstr ":ref:`上級チュートリアル `" msgid ":ref:`Logging Cookbook `" msgstr ":ref:`ロギングクックブック `" -#: ../../library/logging.rst:22 msgid "" "This module defines functions and classes which implement a flexible event " "logging system for applications and libraries." msgstr "" -"このモジュールは、アプリケーションやライブラリのための柔軟なエラーログ記録 " -"(logging) システムを実装するための関数やクラスを定義しています。" +"このモジュールは、アプリケーションやライブラリのための柔軟なイベントのログ記" +"録 (logging) システムを実装するための関数やクラスを定義しています。" #: ../../library/logging.rst:25 msgid "" @@ -453,17 +452,17 @@ msgstr "" "として保存されますし、 :meth:`getEffectiveLevel` や :meth:`isEnabledFor` と" "いったメソッドは、整数を返し、また渡されるものと期待します。" -#: ../../library/logging.rst:220 msgid "" "Indicates if a message of severity *level* would be processed by this " "logger. This method checks first the module-level level set by ``logging." "disable(level)`` and then the logger's effective level as determined by :" "meth:`getEffectiveLevel`." msgstr "" -"深刻度が *lvl* のメッセージが、このロガーで処理されることになっているかどうか" -"を示します。このメソッドはまず、 ``logging.disable(level)`` で設定されるモ" -"ジュールレベルの深刻度レベルを調べ、次にロガーの実効レベルを :meth:" -"`getEffectiveLevel` で調べます。" +"深刻度が *level* のメッセージが、このロガーで処理されることになっているかどう" +"かを示します。\n" +"このメソッドはまず、 ``logging.disable(level)`` で設定されるモジュールレベル" +"の深刻度レベルを調べ、次にロガーの実効レベルを :meth:`getEffectiveLevel` で調" +"べます。" #: ../../library/logging.rst:228 msgid "" @@ -479,7 +478,6 @@ msgstr "" "見つかった場合、その値が返されます。返される値は整数で、典型的には :const:" "`logging.DEBUG`, :const:`logging.INFO` 等のうち一つです。" -#: ../../library/logging.rst:238 msgid "" "Returns a logger which is a descendant to this logger, as determined by the " "suffix. Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return " @@ -487,11 +485,12 @@ msgid "" "ghi')``. This is a convenience method, useful when the parent logger is " "named using e.g. ``__name__`` rather than a literal string." msgstr "" -"このロガーの子であるロガーを、接頭辞によって決定し、返します。従って、" -"``logging.getLogger('abc').getChild('def.ghi')`` は、``logging." +"このロガーの子孫であるロガーを、接尾辞によって決定し、返します。\n" +"従って、``logging.getLogger('abc').getChild('def.ghi')`` は、``logging." "getLogger('abc.def.ghi')`` によって返されるのと同じロガーを返すことになりま" -"す。これは簡便なメソッドで、親ロガーがリテラルでなく ``__name__`` などを使っ" -"て名付けられているときに便利です。" +"す。\n" +"これは簡便なメソッドで、親ロガーがリテラルでなく ``__name__`` などを使って名" +"付けられているときに便利です。" #: ../../library/logging.rst:249 msgid "" @@ -1205,7 +1204,6 @@ msgid "" "specified, the default described in :meth:`formatTime` is used." msgstr "" -#: ../../library/logging.rst:675 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -1215,13 +1213,15 @@ msgid "" "methods. However, there are :ref:`other ways ` to use " "``{``- and ``$``-formatting for log messages." msgstr "" -"``'%'``, または ``'$'`` のいずれかで、書式文字列がログデータとどのようにマー" -"ジされるかを決めます: :ref:`old-string-formatting` (``%``), :meth:`str." -"format` (``{``) または :class:`string.Template` () のいずれかを使います。この" -"引数は *fmt* だけに適用されます (たとえば ``'%(message)s'`` に対して " +"``'%'``、``'{'`` または ``'$'`` のいずれかで、書式文字列がログデータとどのよ" +"うにマージされるかを決めます: :ref:`old-string-formatting` (``%``), :meth:" +"`str.format` (``{``) または :class:`string.Template` (``$``) のいずれかを使い" +"ます。\n" +"この引数は *fmt* だけに適用されます (たとえば ``'%(message)s'`` に対して " "``'{message}'``) が、ロギングメソッドに渡された実際のログメッセージには適用さ" -"れません。いっぽう、 ``'{'`` や ``$`` を使ってログメッセージをフォーマットす" -"る :ref:`他の方法 ` も存在します。" +"れません。\n" +"いっぽう、 ``'{'`` や ``$`` を使ってログメッセージをフォーマットする :ref:`他" +"の方法 ` も存在します。" #: ../../library/logging.rst:685 msgid "" @@ -1362,9 +1362,8 @@ msgstr "" "``default_time_format`` (strptime 書式文字列用) と ``default_msec_format`` " "(ミリ秒値の追加用) です。" -#: ../../library/logging.rst:760 msgid "The ``default_msec_format`` can be ``None``." -msgstr "``default_msec_format`` 引数が ``None`` であることを許容します。" +msgstr "``default_msec_format`` 属性が ``None`` であることを許容します。" #: ../../library/logging.rst:765 msgid "" @@ -1401,39 +1400,38 @@ msgstr "" "のフォーマッタ (イベントのメッセージだけを出力するフォーマッタ) が使われま" "す。" -#: ../../library/logging.rst:786 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records, a title or a " "separator line." msgstr "" -"*複数のレコード* のリストに対するヘッダを返します。基底クラスの実装は単に空の" -"文字列を返すだけです。レコード数やタイトルを表示したり、あるいはセパレータ行" -"したいなど、ヘッダに対して特別な振る舞いが必要な場合はこのメソッドをオーバー" -"ライドする必要があります。" +"リスト *records*に対するヘッダを返します。\n" +"基底クラスの実装は単に空の文字列を返すだけです。\n" +"レコード数やタイトルを表示したり、あるいはセパレータ行を表示したいなど、ヘッ" +"ダに対して特別な振る舞いが必要な場合はこのメソッドをオーバーライドする必要が" +"あります。" -#: ../../library/logging.rst:793 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -"*複数のレコード* のリストに対するフッタを返します。基底クラスの実装は単に空の" -"文字列を返すだけです。レコード数やセパレータ行の表示など、フッタに対して特別" -"な振る舞いが必要な場合はこのメソッドをオーバーライドする必要があります。" +"リスト *records*に対するフッタを返します。\n" +"基底クラスの実装は単に空の文字列を返すだけです。\n" +"レコード数やセパレータ行の表示など、フッタに対して特別な振る舞いが必要な場合" +"はこのメソッドをオーバーライドする必要があります。" -#: ../../library/logging.rst:800 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " "concatenation of the header, each record formatted with the line formatter, " "and the footer." msgstr "" -"*複数のレコード* のリストに対するフォーマット済みテキストを返します。基底クラ" -"スの実装は、レコードがなければ空の文字列を返し、レコードがある場合はヘッダ、" -"単一のレコードをフォーマットするためのラインフォーマッタで各レコードをフォー" -"マットした文字列、そしてフッタを全て連結したものを返します。" +"リスト *records*に対するフォーマット済みテキストを返します。\n" +"基底クラスの実装は、レコードがなければ空の文字列を返し、レコードがある場合は" +"ヘッダ、単一のレコードをフォーマットするためのラインフォーマッタで各レコード" +"をフォーマットした文字列、そしてフッタを全て連結したものを返します。" #: ../../library/logging.rst:808 msgid "Filter Objects" @@ -1455,17 +1453,17 @@ msgstr "" "D' 等によって記録されたイベントは許可しますが、'A.BB', 'B.A.B' などは許可しま" "せん。空の文字列で初期化された場合、すべてのイベントを通過させます。" -#: ../../library/logging.rst:820 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " "allowed through the filter. If *name* is the empty string, allows every " "event." msgstr "" -":class:`Filter` クラスのインスタンスを返します。 *name* が指定されていれば、 " -"*name* はロガーの名前を表します。指定されたロガーとその子ロガーのイベントが" -"フィルタを通過できるようになります。 *name* が指定されなければ、すべてのイベ" -"ントを通過させます。" +":class:`Filter` クラスのインスタンスを返します。\n" +"*name* が指定されていれば、 *name* はロガーの名前を表します。\n" +"指定されたロガーとその子ロガーのイベントがフィルタを通過できるようになりま" +"す。\n" +"*name* が空文字列なら、すべてのイベントを通過させます。" #: ../../library/logging.rst:827 msgid "" @@ -1651,7 +1649,6 @@ msgstr "" "現在のスレッドのスタックベースからログ呼び出しまでの間のスタック情報を表わす" "テキスト文字列。" -#: ../../library/logging.rst:935 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1660,10 +1657,11 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" "ユーザが提供した引数をメッセージに交ぜた後、この :class:`LogRecord` インスタ" -"ンスへのメッセージを返します。ユーザがロギングの呼び出しに与えた引数が文字列" -"でなければ、その引数に :func:`str` が呼ばれ、文字列に変換されます。これによ" -"り、 ``__str__`` メソッドが実際のフォーマット文字列を返せるようなユーザ定義の" -"クラスをメッセージとして使えます。" +"ンスへのメッセージを返します。\n" +"ユーザがロギングの呼び出しに与えたメッセージ引数が文字列でなければ、その引数" +"に :func:`str` が呼ばれ、文字列に変換されます。\n" +"これにより、 ``__str__`` メソッドが実際のフォーマット文字列を返せるようなユー" +"ザ定義のクラスをメッセージとして使えます。" #: ../../library/logging.rst:942 msgid "" @@ -1963,15 +1961,14 @@ msgstr ":class:`LogRecord` が生成された時刻のミリ秒部分。" msgid "msg" msgstr "msg" -#: ../../library/logging.rst:1041 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -"元のロギングの呼び出しで渡されたフォーマット文字列。 ``args`` と合わせて、 " -"``message`` 、または任意のオブジェクトを生成します (:ref:`arbitrary-object-" -"messages` 参照)。" +"元のロギング呼び出しに渡された書式文字列です。\n" +"``args`` と組み合わせて ``message`` を生成します。\n" +"任意のオブジェクトも指定できます (:ref:`arbitrary-object-messages` を参照)。" #: ../../library/logging.rst:0 ../../library/logging.rst:1046 msgid "name" @@ -2136,9 +2133,8 @@ msgstr "" "は (*msg*, *kwargs*) というタプルで、(変更されているはずの) 渡された引数を含" "みます。" -#: ../../library/logging.rst:1107 msgid "Delegates to the underlying :attr:`!manager` on *logger*." -msgstr "背後にある *logger* の :attr:`!manager` メソッドを代理で呼び出します。" +msgstr "背後にある *logger* の :attr:`!manager` 属性に委譲します。" #: ../../library/logging.rst:1111 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." @@ -2193,7 +2189,6 @@ msgstr "*merge_extra* 引数が追加されました。" msgid "Thread Safety" msgstr "スレッドセーフ性" -#: ../../library/logging.rst:1145 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this through using threading " @@ -2201,11 +2196,11 @@ msgid "" "and each handler also creates a lock to serialize access to its underlying I/" "O." msgstr "" -"logging モジュールは、クライアントで特殊な作業を必要としない限りスレッドセー" -"フになっています。このスレッドセーフ性はスレッドロックによって達成されていま" -"す; モジュールの共有データへのアクセスを直列化するためのロックが一つ存在し、" -"各ハンドラでも背後にある I/O へのアクセスを直列化するためにロックを生成しま" -"す。" +"logging モジュールは、利用側で特別な対応をしなくてもスレッドセーフになるよう" +"設計されています。\n" +"このスレッドセーフ性はスレッドロックによって達成されています; モジュールの共" +"有データへのアクセスを直列化するためのロックが一つ存在し、各ハンドラでも背後" +"にある I/O へのアクセスを直列化するためにロックを生成します。" #: ../../library/logging.rst:1150 msgid "" @@ -2392,7 +2387,6 @@ msgstr "" "ルートロガーに対して *level* で指定したログレベルでメッセージを記録します。引" "数と振る舞いは、ログレベルを除けば :func:`debug` と同じです。" -#: ../../library/logging.rst:1258 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -2405,14 +2399,15 @@ msgid "" "level, so that logging output again depends on the effective levels of " "individual loggers." msgstr "" -"全てのロガーのレベル *level* を上書きし、これはロガー自身の出力レベルよりも優" -"先されます。アプリケーション全体を横断するログ出力を一時的に調整する必要が生" -"じたら、この関数は便利でしょう。これの効果は重大度 *level* 以下の全てのロギン" -"グ呼び出しを無効にすることですので、INFO で呼び出しをすれば、INFO と DEBUG イ" -"ベントが捨てられる一方で、重大度 WARNING 以上のものは、ロガーの有効レベルに基" -"いて処理されます。 ``logging.disable(logging.NOTSET)`` が呼び出されると、この" -"上書きレベルは削除され、ログ出力は再び個々のロガーの有効レベルに依存するよう" -"になります。" +"すべてのロガーに対して、それぞれのロガー自身のレベルよりも優先される閾値 " +"*level* を設定します。\n" +"アプリケーション全体を横断するログ出力を一時的に調整する必要が生じたら、この" +"関数は便利でしょう。\n" +"これの効果は重大度 *level* 以下の全てのロギング呼び出しを無効にすることですの" +"で、INFO で呼び出しをすれば、INFO と DEBUG イベントが捨てられる一方で、重大" +"度 WARNING 以上のものは、ロガーの有効レベルに基いて処理されます。\n" +"``logging.disable(logging.NOTSET)`` が呼び出されると、この上書きレベルは削除" +"され、ログ出力は再び個々のロガーの有効レベルに依存するようになります。" #: ../../library/logging.rst:1269 msgid "" @@ -2433,7 +2428,6 @@ msgstr "" "*level* 引数のデフォルトが ``CRITICAL`` レベルになりました。この変更について" "のより詳しいことは :issue:`28524` を参照してください。" -#: ../../library/logging.rst:1280 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -2442,10 +2436,11 @@ msgid "" "must be registered using this function, levels should be positive integers " "and they should increase in increasing order of severity." msgstr "" -"内部的な辞書の中でレベル *level* をテキスト *levelName* に関連付けます。これ" -"は例えば :class:`Formatter` でメッセージを書式化する際のように、数字のレベル" -"をテキスト表現に対応付ける際に用いられます。この関数は自作のレベルを定義する" -"ために使うこともできます。使われるレベルに対する唯一の制限は、レベルは正の整" +"内部的な辞書の中でレベル *level* をテキスト *levelName* に関連付けます。\n" +"これは例えば :class:`Formatter` でメッセージを書式化する際のように、数字のレ" +"ベルをテキスト表現に対応付ける際に用いられます。\n" +"この関数は自作のレベルを定義するために使うこともできます。\n" +"制約は、使用するすべてのレベルをこの関数で登録すること、そしてレベルは正の整" "数でなくてはならず、メッセージの深刻度が上がるに従ってレベルの数も上がらなく" "てはならないということです。" @@ -2467,9 +2462,8 @@ msgstr "" "\"CRITICAL\" は :const:`CRITICAL` にマップされます。この関数が返すマッピング" "オブジェクトは、関数呼び出しのたびに内部のマッピングをコピーしたものです。" -#: ../../library/logging.rst:1300 msgid "Returns the textual or numeric representation of logging level *level*." -msgstr "テキストまたは数値表現でログレベル *level* を返してください。" +msgstr "テキストまたは数値表現でログレベル *level* を返します。" #: ../../library/logging.rst:1302 msgid "" @@ -2504,7 +2498,6 @@ msgstr "" "もし渡された数値や文字列がマッチしなければ、 'Level %s' % level が返されま" "す。" -#: ../../library/logging.rst:1316 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -2513,9 +2506,10 @@ msgid "" "vice versa." msgstr "" "レベルは内部的には整数です(これはロギングのロジックが大小比較をする必要がある" -"からです)。この関数は、数値のレベルを、書式記述子 ``%(levelname)s`` (:ref:" -"`logrecord-attributes` 参照)によって書式化されるログ出力の表示用レベル名に変" -"換するなどの用途に使用されます。" +"からです)。\n" +"この関数は、数値のレベルを、書式記述子 ``%(levelname)s`` (:ref:`logrecord-" +"attributes` 参照)によって書式化されるログ出力の表示用レベル名に変換する用途" +"や、その逆の変換に使用されます。" #: ../../library/logging.rst:1322 msgid "" @@ -2567,7 +2561,6 @@ msgstr "" "この関数は *force* キーワード引数に ``True`` が設定されない限り、ルートロガー" "に設定されたハンドラがあれば何もしません。" -#: ../../library/logging.rst:1361 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -2576,10 +2569,11 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" "この関数は、他のスレッドが開始される前にメインスレッドから呼び出されるべきで" -"す。Python の 2.7.1 や 3.2 以前のバージョンでは、この関数が複数のスレッドから" -"呼ばれると(珍しい状況下とはいえ)ハンドラがルートロガーに複数回加えられること" -"があり、ログ内のメッセージが重複するという予期しない結果をもたらすことがあり" -"ます。" +"す。\n" +"Python の 2.7.1 や 3.2 より前のバージョンでは、この関数が複数のスレッドから呼" +"ばれると(珍しい状況下とはいえ)ハンドラがルートロガーに複数回加えられることが" +"あり、ログ内のメッセージが重複するという予期しない結果をもたらすことがありま" +"す。" #: ../../library/logging.rst:1368 msgid "The following keyword arguments are supported." @@ -2721,7 +2715,6 @@ msgstr "" msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1428 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -2731,9 +2724,10 @@ msgid "" msgstr "" "もしこのキーワード引数が *filename* とともに指定された場合、 :class:" "`FileHandler` が作成されるときのこの値が使用され、出力ファイルを開く時に使わ" -"れます。もし指定されなかった場合、 'backslashreplace' が使用されます。もし " -"``None`` が指定されると :func:`open` のように渡され、'errors' を渡したのと同" -"じように扱われます。" +"れます。\n" +"もし指定されなかった場合、 'backslashreplace' が使用されます。\n" +"もし ``None`` が指定されると :func:`open` にそのまま渡され、'errors' を渡した" +"のと同じように扱われます。" #: ../../library/logging.rst:1438 msgid "*formatter*" @@ -2753,12 +2747,12 @@ msgstr "" msgid "The *style* argument was added." msgstr "*style* 引数が追加されました。" -#: ../../library/logging.rst:1455 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" +"*handlers* 引数が追加されました。\n" "互換性のない引数が指定された状況 (例えば *handlers* が *stream* や " "*filename* と一緒に指定されたり、*stream* が *filename* と一緒に指定された場" "合) を捕捉するために、追加のチェックが加えられました。" @@ -2871,9 +2865,8 @@ msgstr "ログ呼び出しが行われたファイルのフルパス名。" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1510 msgid "The line number in the file where the logging call was made." -msgstr "ログ呼び出しが行われたファイルの行数。" +msgstr "ログ呼び出しが行われたファイルの行番号。" #: ../../library/logging.rst:1511 msgid "The logging message." @@ -2919,7 +2912,6 @@ msgstr "追加のキーワード引数。" msgid "Module-Level Attributes" msgstr "モジュールレベル属性" -#: ../../library/logging.rst:1526 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2929,13 +2921,15 @@ msgid "" "could be found for logger XYZ\". If you need the earlier behaviour for some " "reason, ``lastResort`` can be set to ``None``." msgstr "" -"「最後の手段のハンドラ」が、この属性で利用可能です。これは :class:" -"`StreamHandler` が ``sys.stderr`` に ``WARNING`` レベルで書き出しているのがそ" -"うですし、ロギングの設定がなにか不在のロギングイベントを扱う場合に使われま" -"す。最終的な結果は、メッセージを単に ``sys.stderr`` に出力することです。これ" -"はかつて「logger XYZ についてのハンドラが見つかりません」と言っていたエラー" -"メッセージを置き換えています。もしも何らかの理由でその昔の振る舞いが必要な場" -"合は、 ``lastResort`` に ``None`` をセットすれば良いです。" +"この属性を通じて「最後の手段となるハンドラ」を利用できます。\n" +"これは、レベルが ``WARNING`` に設定され、``sys.stderr`` に書き込む :class:" +"`StreamHandler` です。\n" +"ロギングがまったく設定されていない場合のログイベント処理に使われ、単にメッ" +"セージを ``sys.stderr`` に表示します。\n" +"従来の「ロガー XYZ のハンドラが見つからない」というエラーメッセージは、この動" +"作に置き換えられました。\n" +"何らかの理由で以前の動作が必要な場合は、``lastResort`` を ``None`` に設定でき" +"ます。" #: ../../library/logging.rst:1538 msgid "Used to see if exceptions during handling should be propagated." @@ -2969,10 +2963,9 @@ msgid "" "logging` with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1556 msgid "" "This function is used to turn the capture of warnings by logging on and off." -msgstr "この関数は、logging による警告の補足を、有効にまたは無効にします。" +msgstr "この関数は、logging による警告の捕捉を、有効にまたは無効にします。" #: ../../library/logging.rst:1559 msgid "" diff --git a/library/lzma.po b/library/lzma.po index 91f86085b..68ac91080 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -64,13 +64,12 @@ msgid "" "module-requirements`." msgstr "" -#: ../../library/lzma.rst:28 msgid "" "This exception is raised when an error occurs during compression or " "decompression, or while initializing the compressor/decompressor state." msgstr "" -"この例外は圧縮あるいは展開中にエラーが発生した場合、または圧縮/展開状態の初期" -"化中に送出されます。" +"圧縮や展開の処理中、またはコンプレッサやデコンプレッサの状態を初期化している" +"間にエラーが起きると、この例外が送出されます。" #: ../../library/lzma.rst:33 msgid "Reading and writing compressed files" @@ -126,15 +125,15 @@ msgstr "" "書き出し用にオープンした場合、引数 *format*、*check*、*preset*、および " "*filters* は :class:`LZMACompressor` と同じ意味になります。" -#: ../../library/lzma.rst:56 msgid "" "For binary mode, this function is equivalent to the :class:`LZMAFile` " "constructor: ``LZMAFile(filename, mode, ...)``. In this case, the " "*encoding*, *errors* and *newline* arguments must not be provided." msgstr "" "バイナリモードでは、この関数は :class:`LZMAFile` コンストラクタと等価になりま" -"す (``LZMAFile(filename, mode, ...)``)。この場合、引数 *encoding*、*errors*、" -"および *newline* を指定しなければなりません。" +"す (``LZMAFile(filename, mode, ...)``)。\n" +"この場合、引数 *encoding*、*errors*、および *newline* を指定してはいけませ" +"ん。" #: ../../library/lzma.rst:60 msgid "" @@ -186,13 +185,12 @@ msgstr "" "ずれかを指定できます。これらはそれぞれ ``\"rb\"``、``\"wb\"``、``\"xb\"``、お" "よび ``\"ab\"`` と等価です。" -#: ../../library/lzma.rst:87 msgid "" "If *filename* is a file object (rather than an actual file name), a mode of " "``\"w\"`` does not truncate the file, and is instead equivalent to ``\"a\"``." msgstr "" "*filename* が (実際のファイル名でなく) ファイルオブジェクトの場合、``\"w\"`` " -"モードはファイルを上書きせず、``\"a\"`` と等価になります。" +"モードはファイルを切り詰めず、``\"a\"`` と等価になります。" #: ../../library/lzma.rst:90 msgid "" @@ -349,7 +347,6 @@ msgstr "" "引数 *filters* を指定する場合、フィルタチェイン指定子でなければなりません。詳" "しくは :ref:`filter-chain-specs` を参照してください。" -#: ../../library/lzma.rst:190 msgid "" "Compress *data* (a :class:`bytes` object), returning a :class:`bytes` object " "containing compressed data for at least part of the input. Some of *data* " @@ -357,11 +354,12 @@ msgid "" "meth:`flush`. The returned data should be concatenated with the output of " "any previous calls to :meth:`compress`." msgstr "" -"*data* (:class:`bytes` オブジェクト) を圧縮し、少なくともその一部が圧縮された" -"データを格納する :class:`bytes` オブジェクトを返します。*data* の一部は、後" -"で :meth:`compress` および :meth:`flush` の呼び出しに使用するため内部でバッ" -"ファされている場合があります。返すデータは以前の :meth:`compress` 呼び出しの" -"出力を連結したものです。" +"*data* (:class:`bytes` オブジェクト) を圧縮し、入力の少なくとも一部を圧縮した" +"データを含む :class:`bytes` オブジェクトを返します。\n" +"*data* の一部は、後で :meth:`compress` および :meth:`flush` の呼び出しに使用" +"するため内部でバッファされている場合があります。\n" +"返されたデータは、以前の :meth:`compress` 呼び出しの出力に連結する必要があり" +"ます。" #: ../../library/lzma.rst:198 msgid "" @@ -414,17 +412,17 @@ msgstr "" "この引数を指定した場合、そのメモリ量で展開ができないと :class:`LZMAError` を" "送出します。" -#: ../../library/lzma.rst:222 msgid "" "The *filters* argument specifies the filter chain that was used to create " "the stream being decompressed. This argument is required if *format* is :" "const:`FORMAT_RAW`, but should not be used for other formats. See :ref:" "`filter-chain-specs` for more information about filter chains." msgstr "" -"引数 *filters* には展開されるストリームの作成に使用するフィルタチェインを指定" -"します。この引数を使用する際は、引数 *format* に :const:`FORMAT_RAW` を指定し" -"なければなりません。フィルタチェインについての詳細は :ref:`filter-chain-" -"specs` を参照してください。" +"引数 *filters* には、展開するストリームの作成時に使ったフィルタチェインを指定" +"します。\n" +"*format* が :const:`FORMAT_RAW` の場合は必須ですが、他の形式では指定しないで" +"ください。\n" +"フィルタチェインの詳細は :ref:`filter-chain-specs` を参照してください。" #: ../../library/lzma.rst:228 msgid "" @@ -465,13 +463,12 @@ msgstr "" "``False`` に設定されます。この場合、 :meth:`~.decompress` を次に呼び出すと、" "*data* を ``b''`` として提供し、出力をさらに取得することができます。" -#: ../../library/lzma.rst:248 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -"入力データの全てが圧縮され返された (*max_length* バイトより少ないためか " +"入力データの全てが展開され返された (*max_length* バイトより少ないためか " "*max_length* が負のため) 場合、\n" ":attr:`~.needs_input` 属性は ``True`` になります。" @@ -738,7 +735,6 @@ msgstr "" "これは差し引くバイトどうしの距離を示します。\n" "デフォルトは 1 で、隣接するバイトの差異を扱います。" -#: ../../library/lzma.rst:373 msgid "" "The BCJ filters are intended to be applied to machine code. They convert " "relative branches, calls and jumps in the code to use absolute addressing, " @@ -747,12 +743,12 @@ msgid "" "specifies the address that should be mapped to the beginning of the input " "data. The default is 0." msgstr "" -" BMC フィルターは、マシンコードに対して適用されるように設計されています。この" -"フィルターは、コード内の相対的なブランチ、呼び出し、ジャンプを変換し、絶対ア" -"ドレス指定として使用します。ここでは、コンプレッサーにより exploit されうる冗" -"長性を増加させることが目的です。これらのフィルターは、 ``start_offset`` オプ" -"ションをサポートしています。これは、入力データの先頭にマップされるべきアドレ" -"スを指定します。" +"BCJ フィルターはマシンコードに適用するためのものです。\n" +"コード内の相対的な分岐、呼び出し、ジャンプを絶対アドレス指定に変換し、コンプ" +"レッサが利用できる冗長性を増やします。\n" +"これらのフィルターは ``start_offset`` というオプションを 1 つサポートしま" +"す。\n" +"入力データの先頭に対応するアドレスを指定するもので、デフォルトは 0 です。" #: ../../library/lzma.rst:381 msgid "Constants" diff --git a/library/mailbox.po b/library/mailbox.po index 71bcafd4f..e9197fbd2 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -372,7 +372,6 @@ msgstr "" "manager>` プロトコルをサポートしています: :keyword:`with` 文を用いることで自" "動的にファイルを閉じることができます。" -#: ../../library/mailbox.rst:234 msgid "" "Unlike other representations of messages, :term:`file-like ` representations are not necessarily independent of the :class:`!" @@ -380,8 +379,9 @@ msgid "" "specific documentation is provided by each subclass." msgstr "" "他の表現方法とは違い、:term:`ファイル風 ` 表現はそれを作り" -"出した :class:`!Mailbox` インスタンスやそれが基づいているメールボックスと独立" -"である必要がありません。より詳細な説明は各サブクラスごとにあります。" +"出した :class:`!Mailbox` インスタンスやそれが基づいているメールボックスと必ず" +"しも独立しているとは限りません。\n" +"より詳細な説明は各サブクラスごとにあります。" #: ../../library/mailbox.rst:243 msgid "Return ``True`` if *key* corresponds to a message, ``False`` otherwise." @@ -397,7 +397,6 @@ msgstr "メールボックス中のメッセージ数を返します。" msgid "Delete all messages from the mailbox." msgstr "メールボックスから全てのメッセージを削除します。" -#: ../../library/mailbox.rst:258 msgid "" "Return a representation of the message corresponding to *key* and delete the " "message. If no such message exists, return *default*. The message is " @@ -405,12 +404,13 @@ msgid "" "`Message` subclass unless a custom message factory was specified when the :" "class:`!Mailbox` instance was initialized." msgstr "" -"*key* に対応するメッセージの表現を返します。メッセージは適切な形式ごとの :" -"class:`Message` サブクラスのインスタンスとして表現されるのが普通ですが、 :" -"class:`!Mailbox` インスタンスが初期化されるときに指定すればお好みのメッセージ" -"ファクトリを使うこともできます。" +"*key* に対応するメッセージの表現を返し、そのメッセージを削除します。\n" +"対応するメッセージが存在しない場合は *default* を返します。\n" +"メッセージは適切な形式ごとの :class:`Message` サブクラスのインスタンスとして" +"表現されるのが普通ですが、\n" +":class:`!Mailbox` インスタンスが初期化されるときに指定すればお好みのメッセー" +"ジファクトリを使うこともできます。" -#: ../../library/mailbox.rst:267 msgid "" "Return an arbitrary (*key*, *message*) pair, where *key* is a key and " "*message* is a message representation, and delete the corresponding message. " @@ -419,12 +419,14 @@ msgid "" "`Message` subclass unless a custom message factory was specified when the :" "class:`!Mailbox` instance was initialized." msgstr "" -"任意に選んだ (*key*, *message*) ペアを返します。ただしここで *key* はキーで " -"*message* はメッセージ表現です。もしメールボックスが空ならば、 :exc:" -"`KeyError` 例外を送出します。メッセージは適切な形式ごとの :class:`Message` サ" -"ブクラスのインスタンスとして表現されるのが普通ですが、 :class:`!Mailbox` イン" -"スタンスが初期化されるときに指定すればお好みのメッセージファクトリを使うこと" -"もできます。" +"任意に選んだ (*key*, *message*) ペアを返し、対応するメッセージを削除しま" +"す。\n" +"ただしここで *key* はキーで *message* はメッセージ表現です。\n" +"もしメールボックスが空ならば、 :exc:`KeyError` 例外を送出します。\n" +"メッセージは適切な形式ごとの :class:`Message` サブクラスのインスタンスとして" +"表現されるのが普通ですが、\n" +":class:`!Mailbox` インスタンスが初期化されるときに指定すればお好みのメッセー" +"ジファクトリを使うこともできます。" #: ../../library/mailbox.rst:277 msgid "" @@ -460,7 +462,6 @@ msgstr "" "しないということもありますが、それでもこのメソッドを呼ぶように習慣付けておき" "ましょう。" -#: ../../library/mailbox.rst:299 msgid "" "Acquire an exclusive advisory lock on the mailbox so that other processes " "know not to modify it. An :exc:`ExternalClashError` is raised if the lock is " @@ -468,10 +469,11 @@ msgid "" "mailbox format. You should *always* lock the mailbox before making any " "modifications to its contents." msgstr "" -"メールボックスの排他的アドバイザリロックを取得し、他のプロセスが変更しないよ" -"うにします。ロックが取得できない場合 :exc:`ExternalClashError` が送出されま" -"す。ロック機構はメールボックス形式によって変わります。メールボックスの内容に" -"変更を加えるときは *いつも* ロックを掛けるべきです。" +"メールボックスの排他的アドバイザリロックを取得し、他のプロセスに変更すべきで" +"ないことを知らせます。\n" +"ロックが取得できない場合 :exc:`ExternalClashError` が送出されます。\n" +"ロック機構はメールボックス形式によって変わります。\n" +"メールボックスの内容に変更を加えるときは *いつも* ロックを掛けるべきです。" #: ../../library/mailbox.rst:308 msgid "Release the lock on the mailbox, if any." @@ -1084,7 +1086,6 @@ msgstr "" "これらのメソッドはメッセージを直ちに削除します。名前の前にコンマを付加して" "メッセージに削除の印を付けるという MH の規約は使いません。" -#: ../../library/mailbox.rst:735 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" "func:`!flock` and :c:func:`!lockf` system calls. For MH mailboxes, locking " @@ -1092,10 +1093,11 @@ msgid "" "duration of any operations that affect them, locking individual message " "files." msgstr "" -"3種類のロック機構が使われます --- ドットロッキングと、もし使用可能ならば :c:" -"func:`!flock` と :c:func:`!lockf` システムコールです。 MH メールボックスに対" -"するロックとは :file:`.mh_sequences` のロックと、それが影響を与える操作中だけ" -"の個々のメッセージファイルに対するロックを意味します。" +"ドットロッキングと、利用可能なら :c:func:`!flock` および :c:func:`!lockf` シ" +"ステムコールという 3 種類のロック機構を使います。\n" +"MH メールボックスのロックでは :file:`.mh_sequences` ファイルをロックしま" +"す。\n" +"個々のメッセージファイルも、それぞれに影響する操作の間だけロックします。" #: ../../library/mailbox.rst:744 msgid "" @@ -1425,7 +1427,6 @@ msgstr "" "Maildir 固有の動作をするメッセージ。引数 *message* は :class:`Message` のコン" "ストラクタと同じ意味を持ちます。" -#: ../../library/mailbox.rst:957 msgid "" "Typically, a mail user agent application moves all of the messages in the :" "file:`new` subdirectory to the :file:`cur` subdirectory after the first time " @@ -1439,14 +1440,17 @@ msgid "" "flags for Maildir messages are as follows:" msgstr "" "通常、メールユーザエージェントは :file:`new` サブディレクトリにある全てのメッ" -"セージをユーザが最初にメールボックスを開くか閉じるかした後で :file:`cur` サブ" -"ディレクトリに移動し、メッセージが実際に読まれたかどうかを記録します。 :file:" -"`cur` にある各メッセージには状態情報を保存するファイル名に付け加えられた " -"\"info\" セクションがあります。(メールリーダの中には \"info\" セクションを :" -"file:`new` にあるメッセージに付けることもあります。) \"info\" セクションには" -"二つの形式があります。一つは \"2,\" の後に標準化されたフラグのリストを付けた" -"もの (たとえば \"2,FR\")、もう一つは \"1,\" の後にいわゆる実験的情報を付け加" -"えるものです。 Maildir の標準的なフラグは以下の通りです:" +"セージをユーザが最初にメールボックスを開いて閉じた後で :file:`cur` サブディレ" +"クトリに移動し、実際に読まれたかどうかに関係なく、メッセージが古いものになっ" +"たと記録します。\n" +":file:`cur` にある各メッセージには状態情報を保存するファイル名に付け加えられ" +"た \"info\" セクションがあります。\n" +"(メールリーダの中には \"info\" セクションを :file:`new` にあるメッセージに付" +"けることもあります。\n" +") \"info\" セクションには二つの形式があります。\n" +"一つは \"2,\" の後に標準化されたフラグのリストを付けたもの (たとえば \"2," +"FR\")、もう一つは \"1,\" の後にいわゆる実験的情報を付け加えるものです。\n" +"Maildir の標準的なフラグは以下の通りです:" #: ../../library/mailbox.rst:969 ../../library/mailbox.rst:1136 #: ../../library/mailbox.rst:1507 @@ -1924,14 +1928,14 @@ msgstr "" "形式に準拠しているならば、結果は次の順に並べられた 0回か1回の ``'R'``、" "``'O'``、``'D'``、``'F'``、``'A'`` です。" -#: ../../library/mailbox.rst:1183 ../../library/mailbox.rst:1555 msgid "" "Set the flags specified by *flags* and unset all others. Parameter *flags* " "should be the concatenation in any order of zero or more occurrences of each " "of ``'R'``, ``'O'``, ``'D'``, ``'F'``, and ``'A'``." msgstr "" -"*flags* で指定されたフラグをセットして、他のフラグは下ろします。*flags* は並" -"べられたゼロまたは1回の ``'R'``、``'O'``、``'D'``、``'F'``、``'A'`` です。" +"*flags* で指定したフラグをセットし、他のフラグは解除します。\n" +"*flags* には ``'R'``、``'O'``、``'D'``、``'F'``、``'A'`` をそれぞれ 0 回以" +"上、任意の順序で連結した文字列を指定します。" #: ../../library/mailbox.rst:1190 ../../library/mailbox.rst:1562 msgid "" @@ -2435,17 +2439,17 @@ msgid "" "destination.unlock()" msgstr "" -#: ../../library/mailbox.rst:1704 msgid "" "This example sorts mail from several mailing lists into different mailboxes, " "being careful to avoid mail corruption due to concurrent modification by " "other programs, mail loss due to interruption of the program, or premature " "termination due to malformed messages in the mailbox::" msgstr "" -"この例は幾つかのメーリングリストのメールをソートするものです。他のプログラム" -"と平行して変更を加えることでメールが破損したり、プログラムを中断することで" -"メールを失ったり、はたまた半端なメッセージがメールボックス中にあることで途中" -"で終了してしまう、といったことを避けるように注意深く扱っています::" +"この例では、複数のメーリングリストから届くメールを別々のメールボックスに振り" +"分けます。\n" +"他のプログラムによる同時変更でメールが破損すること、プログラムの中断でメール" +"が失われること、形式が不正なメッセージによって処理が途中で終了することを避け" +"るようにしています。 ::" #: ../../library/mailbox.rst:1709 msgid "" diff --git a/library/math.po b/library/math.po index a506a86a3..35749fa79 100644 --- a/library/math.po +++ b/library/math.po @@ -693,7 +693,6 @@ msgid "" "is no such thing in Python)." msgstr "" -#: ../../library/math.rst:211 msgid "" "Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " "*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " @@ -703,25 +702,24 @@ msgid "" "thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" "IEEE 754 標準方式の *x* を *y* で割った剰余を返します。\n" -"有限な *x* と有限な *y* では、分数 ``x / y`` の厳密な値に最も近い整数を " -"``n`` として、 ``x - n*y`` がこの返り値となります。\n" +"有限な *x* とゼロでない有限な *y* では、分数 ``x / y`` の厳密な値に最も近い整" +"数を ``n`` として、 ``x - n*y`` がこの返り値となります。\n" "``x / y`` が隣り合う 2 つの整数のちょうど真ん中だった場合は、最も近い *偶数* " "が ``n`` として使われます。\n" "従って、剰余 ``r = remainder(x, y)`` は常に ``abs(r) <= 0.5 * abs(y)`` を満た" "します。" -#: ../../library/math.rst:218 msgid "" "Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " "*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " "x)`` raise :exc:`ValueError` for any non-NaN *x*. If the result of the " "remainder operation is zero, that zero will have the same sign as *x*." msgstr "" -"特殊なケースについては IEEE 754 に従います: 任意の有限な *x* に対する " -"``remainder(x, math.inf)`` 、および任意の非 NaN の *x* に対する " -"``remainder(x, 0)`` と ``remainder(math.inf, x)`` は :exc:`ValueError` を送出" -"します。\n" -"剰余演算の結果がゼロの場合、そのゼロは *x* と同じ符号を持ちます。" +"特殊な場合は IEEE 754 に従います。\n" +"特に、有限な *x* に対して ``remainder(x, math.inf)`` は *x* を返します。\n" +"一方、NaN でない *x* に対して ``remainder(x, 0)`` と ``remainder(math.inf, " +"x)`` は :exc:`ValueError` を送出します。\n" +"剰余演算の結果がゼロなら、そのゼロの符号は *x* と同じになります。" #: ../../library/math.rst:224 msgid "" @@ -743,7 +741,6 @@ msgstr "" "`x.__trunc__ ` が実行され、 :class:`~numbers.Integral` 値が" "返されます。" -#: ../../library/math.rst:239 msgid "" "For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " "*all* floating-point numbers of sufficiently large magnitude are exact " @@ -752,10 +749,10 @@ msgid "" "``abs(x) >= 2**52`` necessarily has no fractional bits." msgstr "" ":func:`ceil` 、 :func:`floor` 、および :func:`modf` 関数については、非常に大" -"きな浮動小数点数が *全て* 整数そのものになるということに注意してください。通" -"常、Python の浮動小数点型は 53 ビット以上の精度をもたない (プラットフォームに" -"おける C double 型と同じ) ので、結果的に ``abs(x) >= 2**52`` であるような浮動" -"小数点型 *x* は小数部分を持たなくなるのです。" +"きな浮動小数点数が *全て* 整数そのものになるということに注意してください。\n" +"通常、Python の浮動小数点型は 53 ビットを超える精度をもたない (プラットフォー" +"ムにおける C double 型と同じ) ので、結果的に ``abs(x) >= 2**52`` であるような" +"浮動小数点型 *x* は小数部分を持たなくなるのです。" #: ../../library/math.rst:247 msgid "Floating point manipulation functions" @@ -1115,7 +1112,6 @@ msgid "" "loss of precision by tracking multiple intermediate partial sums." msgstr "" -#: ../../library/math.rst:521 msgid "" "The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " "typical case where the rounding mode is half-even. On some non-Windows " @@ -1123,10 +1119,10 @@ msgid "" "occasionally double-round an intermediate sum causing it to be off in its " "least significant bit." msgstr "" -"アルゴリズムの正確性は、 IEEE-754 演算の保証と、丸めモードが偶数丸め (half-" -"even) である典型的な場合に依存します。Windows 以外のいくつかのビルドでは、下" -"層の C ライブラリが拡張精度の加算を行い、時々計算途中の和を double 型へ丸めて" -"しまうため、最下位ビットが消失することがあります。" +"このアルゴリズムの精度は、IEEE-754 演算の保証と、丸めモードが通常は偶数丸め " +"(half-even) であることに依存します。\n" +"Windows 以外の一部のビルドでは、下層の C ライブラリが拡張精度で加算するため、" +"中間の和に二重丸めが起き、最下位ビットに誤差が生じることがあります。" #: ../../library/math.rst:527 msgid "" @@ -1242,7 +1238,6 @@ msgid "" msgstr "" "*x* の逆正接を、ラジアンで返します。結果は ``-pi/2`` と ``pi/2`` の間です。" -#: ../../library/math.rst:616 msgid "" "Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " "``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " @@ -1251,12 +1246,14 @@ msgid "" "for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " "``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." msgstr "" -"``atan(y / x)`` を、ラジアンで返します。戻り値は ``-pi`` から ``pi`` の間にな" -"ります。この角度は、極座標平面において原点から ``(x, y)`` へのベクトルが X 軸" -"の正の方向となす角です。 :func:`atan2` のポイントは、両方の入力の符号が既知で" -"あるために、位相角の正しい象限を計算できることにあります。例えば、 " -"``atan(1)`` と ``atan2(1, 1)`` はいずれも ``pi/4`` ですが、 ``atan2(-1, " -"-1)`` は ``-3*pi/4`` になります。" +"``atan(y / x)`` を、ラジアンで返します。\n" +"戻り値は ``-pi`` から ``pi`` の間になります。\n" +"この角度は、平面において原点から ``(x, y)`` へのベクトルが X 軸の正の方向とな" +"す角です。\n" +":func:`atan2` のポイントは、両方の入力の符号が既知であるために、位相角の正し" +"い象限を計算できることにあります。\n" +"例えば、 ``atan(1)`` と ``atan2(1, 1)`` はいずれも ``pi/4`` ですが、 " +"``atan2(-1, -1)`` は ``-3*pi/4`` になります。" #: ../../library/math.rst:626 msgid "Return the cosine of *x* radians." diff --git a/library/mmap.po b/library/mmap.po index 9fbfaa8c4..2cdfd2c2f 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -559,7 +559,6 @@ msgstr "" msgid "Returns the current position of the file pointer." msgstr "ファイルポインタの現在位置を返します。" -#: ../../library/mmap.rst:368 msgid "" "Write the bytes in *bytes* into memory at the current position of the file " "pointer and return the number of bytes written (never less than " @@ -570,9 +569,10 @@ msgid "" msgstr "" "メモリ内のファイルポイントの現在位置に *bytes* のバイト列を書き込み、書き込ま" "れたバイト数を返します(もし書き込みが失敗したら :exc:`ValueError` が送出され" -"るため、``len(bytes)`` より少なくなりません)。ファイル位置はバイト列が書き込" -"まれた位置に更新されます。もしmmapが :const:`ACCESS_READ` とともに作成されて" -"いた場合は、書き込みは :exc:`TypeError` 例外を送出するでしょう。" +"るため、``len(bytes)`` より少なくなりません)。\n" +"ファイル位置は書き込んだバイト列の直後を指すように更新されます。\n" +"もしmmapが :const:`ACCESS_READ` とともに作成されていた場合は、書き込みは :" +"exc:`TypeError` 例外を送出するでしょう。" #: ../../library/mmap.rst:378 msgid "The number of bytes written is now returned." diff --git a/library/modulefinder.po b/library/modulefinder.po index 2b69bfae7..0f14d8d6e 100644 --- a/library/modulefinder.po +++ b/library/modulefinder.po @@ -49,15 +49,13 @@ msgid "" msgstr "" "*pkg_name* という名前のパッケージの在り処が *path* であることを記録します。" -#: ../../library/modulefinder.rst:24 msgid "" "Allows specifying that the module named *oldname* is in fact the package " "named *newname*." msgstr "" -"実際にはパッケージ内で *oldname* という名前になっているモジュールを " -"*newname* という名前で指定できるようにします。" +"*oldname* という名前のモジュールが、実際には *newname* という名前のパッケージ" +"であると指定できます。" -#: ../../library/modulefinder.rst:30 msgid "" "This class provides :meth:`run_script` and :meth:`report` methods to " "determine the set of modules imported by a script. *path* can be a list of " @@ -68,11 +66,14 @@ msgid "" "newpath)`` tuples that will be replaced in module paths." msgstr "" "このクラスでは :meth:`run_script` および :meth:`report` メソッドを提供してい" -"ます。これらのメソッドは何らかのスクリプト中で import されているモジュールの" -"集合を調べます。 *path* はモジュールを検索する先のディレクトリ名からなるリス" -"トです。 *path* を指定しない場合、 ``sys.path`` を使います。 *debug* にはデ" -"バッグレベルを設定します; 値を大きくすると、実行している内容を表すデバッグ" -"メッセージを出力します。 *excludes* は検索から除外するモジュール名です。 " +"ます。\n" +"これらのメソッドは何らかのスクリプト中で import されているモジュールの集合を" +"調べます。\n" +"*path* はモジュールを検索する先のディレクトリ名からなるリストです。\n" +"*path* を指定しない場合、 ``sys.path`` を使います。\n" +"*debug* にはデバッグレベルを設定します; 値を大きくすると、実行している内容を" +"表すデバッグメッセージを出力します。\n" +"*excludes* は解析から除外するモジュール名のリストです。\n" "*replace_paths* には、モジュールパス内で置き換えられるパスをタプル " "``(oldpath, newpath)`` からなるリストで指定します。" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index bcb058e74..f38e66e24 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -624,16 +624,14 @@ msgstr "" msgid "**Server process**" msgstr "**サーバープロセス (Server process)**" -#: ../../library/multiprocessing.rst:398 msgid "" "A manager object returned by :func:`Manager` controls a server process which " "holds Python objects and allows other processes to manipulate them using " "proxies." msgstr "" -":func:`Manager` 関数により生成されたマネージャーオブジェクトはサーバープロセ" -"スを管理します。マネージャーオブジェクトは Python のオブジェクトを保持して、" -"他のプロセスがプロキシ経由でその Python オブジェクトを操作することができま" -"す。" +":func:`Manager` が返すマネージャーオブジェクトは、Python オブジェクトを保持す" +"るサーバープロセスを管理します。\n" +"他のプロセスはプロキシを使って、その Python オブジェクトを操作できます。" #: ../../library/multiprocessing.rst:402 msgid "" @@ -940,17 +938,17 @@ msgstr "" msgid "Method representing the process's activity." msgstr "プロセスが実行する処理を表すメソッドです。" -#: ../../library/multiprocessing.rst:619 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " "argument, if any, with sequential and keyword arguments taken from the " "*args* and *kwargs* arguments, respectively." msgstr "" -"このメソッドはサブクラスでオーバーライドすることができます。標準の :meth:" -"`run` メソッドは、コンストラクターの target 引数として渡された呼び出し可能オ" -"ブジェクトを呼び出します。もしコンストラクターに *args* もしくは *kwargs* 引" -"数が渡されていれば、呼び出すオブジェクトにこれらの引数を渡します。" +"このメソッドはサブクラスでオーバーライドできます。\n" +"標準の :meth:`run` メソッドは、コンストラクターの ``target`` 引数に呼び出し可" +"能オブジェクトが渡されていれば、それを呼び出します。\n" +"その際、*args* の要素を位置引数として、*kwargs* の内容をキーワード引数として" +"渡します。" #: ../../library/multiprocessing.rst:624 msgid "" @@ -987,7 +985,6 @@ msgstr "" "各 Process オブジェクトに対し、このメソッドが2回以上呼び出されてはいけませ" "ん。各プロセスでオブジェクトの :meth:`run` メソッドを呼び出す準備を行います。" -#: ../../library/multiprocessing.rst:646 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -996,12 +993,12 @@ msgid "" "times out. Check the process's :attr:`exitcode` to determine if it " "terminated." msgstr "" -"オプションの引数 *timeout* が ``None`` (デフォルト) の場合、 :meth:`join` メ" -"ソッドが呼ばれたプロセスは処理が終了するまでブロックします。\n" +"オプションの引数 *timeout* が ``None`` (デフォルト) の場合、このメソッドは :" +"meth:`join` の対象プロセスが終了するまでブロックします。\n" "*timeout* が正の数である場合、最大 *timeout* 秒ブロックします。\n" -"プロセスが終了あるいはタイムアウトした場合、メソッドは ``None`` を返すことに" -"注意してください。\n" -"プロセスの :attr:`exitcode` を確認し終了したかどうかを判断してください。" +"対象プロセスが終了した場合も、メソッドがタイムアウトした場合も、戻り値は " +"``None`` であることに注意してください。\n" +"プロセスの :attr:`exitcode` を確認し、終了したかどうかを判断してください。" #: ../../library/multiprocessing.rst:653 msgid "A process can be joined many times." @@ -1040,13 +1037,12 @@ msgstr "" msgid "Return whether the process is alive." msgstr "プロセスが実行中かを判別します。" -#: ../../library/multiprocessing.rst:673 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -"おおまかに言って、プロセスオブジェクトは :meth:`start` メソッドを呼び出してか" -"ら子プロセス終了までの期間が実行中となります。" +"おおまかに言って、プロセスオブジェクトは :meth:`start` メソッドから戻ってから" +"子プロセス終了までの期間が実行中となります。" #: ../../library/multiprocessing.rst:678 msgid "" @@ -1233,15 +1229,14 @@ msgstr "" "meth:`close` が成功した場合、:class:`Process` オブジェクトの他のメソッドや属" "性は、ほとんどが :exc:`ValueError` を送出します。" -#: ../../library/multiprocessing.rst:793 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -"プロセスオブジェクトが作成したプロセスのみが :meth:`start`, :meth:`join`, :" -"meth:`is_alive`, :meth:`terminate` と :attr:`exitcode` のメソッドを呼び出すべ" -"きです。" +":meth:`start`、:meth:`join`、:meth:`is_alive`、:meth:`terminate` の呼び出し" +"と :attr:`exitcode` の参照は、そのプロセスオブジェクトを作成したプロセスだけ" +"が行うべきです。" #: ../../library/multiprocessing.rst:797 msgid "Example usage of some of the methods of :class:`Process`:" @@ -1365,7 +1360,6 @@ msgid "" "multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:875 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -1373,23 +1367,23 @@ msgid "" "practical difficulties -- if they really bother you then you can instead use " "a queue created with a :ref:`manager `." msgstr "" -"オブジェクトがキューに追加される際、そのオブジェクトは pickle 化されていま" -"す。そのため、バックグラウンドのスレッドが後になって下位層のパイプに pickle " -"化されたデータをフラッシュすることがあります。これにより、少し驚くような結果" -"になりますが、実際に問題になることはないはずです。これが問題になるような状況" -"では、かわりに :ref:`manager ` を使ってキューを作成" -"することができるからです。" +"オブジェクトをキューに追加すると、そのオブジェクトは pickle 化されます。\n" +"その後、バックグラウンドのスレッドが pickle 化されたデータを下層のパイプにフ" +"ラッシュします。\n" +"このため、少し意外な動作をすることがありますが、通常は実用上の問題にはなりま" +"せん。\n" +"問題になる場合は、代わりに :ref:`マネージャー ` で" +"作成したキューを使えます。" -#: ../../library/multiprocessing.rst:882 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -"空のキューの中にオブジェクトを追加した後、キューの :meth:`~Queue.empty` メ" -"ソッドが :const:`False` を返すまでの間にごくわずかな遅延が起きることがあり、:" -"meth:`~Queue.get_nowait` が :exc:`queue.Empty` を発生させることなく制御が呼び" -"出し元に返ってしまうことがあります。" +"空のキューにオブジェクトを追加してから、キューの :meth:`~Queue.empty` メソッ" +"ドが :const:`False` を返し、:meth:`~Queue.get_nowait` が :exc:`queue.Empty` " +"を送出せずにオブジェクトを返せるようになるまで、ごくわずかな遅延が生じること" +"があります。" #: ../../library/multiprocessing.rst:887 msgid "" @@ -1748,22 +1742,22 @@ msgstr "" "`~Queue.get` に対して、 後続の :meth:`task_done` 呼び出しはタスクの処理が完了" "したことをキューへ伝えます。" -#: ../../library/multiprocessing.rst:1100 msgid "" "If a :meth:`~queue.Queue.join` is currently blocking, it will resume when " "all items have been processed (meaning that a :meth:`task_done` call was " "received for every item that had been :meth:`~Queue.put` into the queue)." msgstr "" -"もし :meth:`~queue.Queue.join` がブロッキング状態なら、 すべての要素が処理さ" -"れたときに復帰します( :meth:`task_done` 呼び出しが すべての要素からキュー内" -"へ :meth:`~Queue.put` されたと受け取ったことを意味します)。" +":meth:`~queue.Queue.join` が現在ブロックしている場合、すべての要素が処理され" +"ると復帰します。\n" +"これは、キューに :meth:`~Queue.put` されたすべての要素について :meth:" +"`task_done` の呼び出しを受け取ったことを意味します。" -#: ../../library/multiprocessing.rst:1104 msgid "" "Raises a :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "" -"キューにある要素より多く呼び出された場合 :exc:`ValueError` が発生します。" +"キューに追加された要素の総数を超えて呼び出すと :exc:`ValueError` を送出しま" +"す。" #: ../../library/multiprocessing.rst:1110 msgid "Block until all items in the queue have been gotten and processed." @@ -1791,12 +1785,11 @@ msgstr "その他" msgid "Return list of all live children of the current process." msgstr "カレントプロセスのすべてのアクティブな子プロセスのリストを返します。" -#: ../../library/multiprocessing.rst:1126 msgid "" "Calling this has the side effect of \"joining\" any processes which have " "already finished." msgstr "" -"これを呼び出すと \"join\" してすでに終了しているプロセスには副作用がありま" +"この関数を呼び出すと、副作用として終了済みのプロセスがすべて \"join\" されま" "す。" #: ../../library/multiprocessing.rst:1131 @@ -2063,19 +2056,19 @@ msgstr "" "に大きすぎる (OS にも依りますが、およそ 32 MiB+) と、 :exc:`ValueError` 例外" "が送出されることがあります。" -#: ../../library/multiprocessing.rst:1323 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" "コネクションの相手側から :meth:`send` を使用して送られたオブジェクトを返しま" -"す。 何か受け取るまでブロックします。何も受け取らずにコネクションの相手側でク" -"ローズされた場合 :exc:`EOFError` が発生します。" +"す。\n" +"何か受け取るまでブロックします。\n" +"受信するデータが残っておらず、コネクションの相手側がクローズされている場合 :" +"exc:`EOFError` が発生します。" -#: ../../library/multiprocessing.rst:1330 msgid "Return the file descriptor or handle used by the connection." -msgstr "コネクションが使用するハンドラーか、ファイル記述子を返します。" +msgstr "コネクションが使用するファイル記述子またはハンドルを返します。" #: ../../library/multiprocessing.rst:1334 msgid "Close the connection." @@ -2220,17 +2213,16 @@ msgstr "" "す。それはメッセージを送ったプロセスが信頼できる場合を除いてセキュリティリス" "クになります。" -#: ../../library/multiprocessing.rst:1428 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " "methods after performing some sort of authentication. See :ref:" "`multiprocessing-auth-keys`." msgstr "" -"そのため :func:`Pipe` を使用してコネクションオブジェクトを生成する場合を除い" -"て、何らかの認証処理を実行した後で :meth:`~Connection.recv` や :meth:" -"`~Connection.send` メソッドのみを使用すべきです。詳細は :ref:" -"`multiprocessing-auth-keys` を参照してください。" +"そのため、:func:`Pipe` で生成したコネクションオブジェクトを除き、:meth:" +"`~Connection.recv` と :meth:`~Connection.send` は何らかの認証を済ませてから使" +"うべきです。\n" +":ref:`multiprocessing-auth-keys` を参照してください。" #: ../../library/multiprocessing.rst:1435 msgid "" @@ -2300,9 +2292,8 @@ msgstr "" "macOS では ``sem_getvalue()`` が実装されていないので :class:`Semaphore` と区" "別がつきません。" -#: ../../library/multiprocessing.rst:1484 msgid "A condition variable: an alias for :class:`threading.Condition`." -msgstr "状態変数: :class:`threading.Condition` の別名です。" +msgstr "条件変数: :class:`threading.Condition` の別名です。" #: ../../library/multiprocessing.rst:1486 msgid "" @@ -2319,7 +2310,6 @@ msgstr ":meth:`~threading.Condition.wait_for` メソッドが追加されまし msgid "A clone of :class:`threading.Event`." msgstr ":class:`threading.Event` のクローンです。" -#: ../../library/multiprocessing.rst:1504 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -2329,13 +2319,13 @@ msgid "" "`multiprocessing.Lock` as it applies to either processes or threads, except " "as noted." msgstr "" -"再帰しないロックオブジェクトで、 :class:`threading.Lock` 相当のものです。プロ" -"セスやスレッドがロックをいったん獲得 (acquire) すると、それに続くほかのプロセ" -"スやスレッドが獲得しようとする際、それが解放 (release) されるまではブロックさ" -"れます。解放はどのプロセス、スレッドからも行えます。スレッドに対して適用され" -"る :class:`threading.Lock` のコンセプトと振る舞いは、特筆すべきものがない限" -"り、プロセスとスレッドに適用される :class:`multiprocessing.Lock` に引き継がれ" -"ています。" +"再帰しないロックオブジェクトで、 :class:`threading.Lock` 相当のものです。\n" +"プロセスやスレッドがいったんロックを獲得 (acquire) すると、その後は、どのプロ" +"セスやスレッドから獲得しようとしても、ロックが解放 (release) されるまでブロッ" +"クします。\n" +"解放はどのプロセスやスレッドからも行えます。\n" +"特に明記した点を除き、:class:`threading.Lock` がスレッドに適用する概念と動作" +"を、:class:`multiprocessing.Lock` はプロセスとスレッドの両方に適用します。" #: ../../library/multiprocessing.rst:1512 msgid "" @@ -2434,14 +2424,13 @@ msgstr "" "ロセスやスレッドはブロックされずに再度獲得出来ます。そのプロセスやスレッドは" "獲得した回数ぶん解放しなければなりません。" -#: ../../library/multiprocessing.rst:1572 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" ":class:`RLock` は実際にはファクトリ関数で、デフォルトコンテキストで初期化され" -"た ``multiprocessing.synchronize.Lock`` のインスタンスを返すことに注意してく" +"た ``multiprocessing.synchronize.RLock`` のインスタンスを返すことに注意してく" "ださい。" #: ../../library/multiprocessing.rst:1579 @@ -2452,7 +2441,6 @@ msgstr "" ":class:`RLock` は :term:`context manager` プロトコルをサポートしています。つ" "まり :keyword:`with` 文で使うことができます。" -#: ../../library/multiprocessing.rst:1587 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -2464,13 +2452,14 @@ msgid "" "of :meth:`threading.RLock.acquire`, starting with the name of the argument " "itself." msgstr "" -"*block* 引数を ``True`` にして呼び出した場合、ロックが既にカレントプロセスも" -"しくはカレントスレッドが既に所有していない限りは、アンロック状態 (どのプロセ" -"ス、スレッドも所有していない状態) になるまでブロックします。ブロックから抜け" -"るとカレントプロセスもしくはカレントスレッドが (既に持っていなければ) 所有権" -"を得て、再帰レベルをインクリメントし、 ``True`` で戻ります。 :meth:" -"`threading.RLock.acquire` の実装とはこの最初の引数の振る舞いが、その名前自身" -"を始めとしていくつか違うので注意してください。" +"*block* 引数を ``True`` にして呼び出した場合、現在のプロセスまたはスレッドが" +"既にロックを所有している場合を除き、アンロック状態 (どのプロセス、スレッドも" +"所有していない状態) になるまでブロックします。\n" +"ブロックから抜けるとカレントプロセスもしくはカレントスレッドが (既に持ってい" +"なければ) 所有権を得て、再帰レベルをインクリメントし、 ``True`` で戻りま" +"す。\n" +":meth:`threading.RLock.acquire` の実装とはこの最初の引数の振る舞いが、その名" +"前自身を始めとしていくつか違うので注意してください。" #: ../../library/multiprocessing.rst:1597 msgid "" @@ -2612,15 +2601,14 @@ msgstr "" "れたオブジェクトへのアクセスはロックにより自動的に保護されません。そのため、" "必ずしも \"プロセスセーフ\" ではありません。" -#: ../../library/multiprocessing.rst:1697 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -"``+=`` のような演算は、読み込みと書き込みを含むためアトミックでありません。こ" -"のため、たとえば自動的に共有の値を増加させたい場合、以下のようにするのでは不" -"十分です ::" +"``+=`` のような演算は、読み込みと書き込みを含むためアトミックでありません。\n" +"このため、たとえばアトミックに共有の値を増加させたい場合、以下のようにするの" +"では不十分です ::" #: ../../library/multiprocessing.rst:1701 msgid "counter.value += 1" @@ -2704,7 +2692,6 @@ msgid "" "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1754 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -2712,11 +2699,12 @@ msgid "" "second process and trying to dereference the pointer from the second process " "may cause a crash." msgstr "" -"共有メモリのポインターを格納することは可能ではありますが、特定プロセスのアド" -"レス空間の位置を参照するということを覚えておいてください。しかし、そのポイン" -"ターは別のプロセスのコンテキストにおいて無効になる確率が高いです。そして、別" -"のプロセスからそのポインターを逆参照しようとするとクラッシュを引き起こす可能" -"性があります。" +"共有メモリにポインターを格納することは可能ではありますが、特定プロセスのアド" +"レス空間の位置を参照するということを覚えておいてください。\n" +"しかし、そのポインターは別のプロセスのコンテキストにおいて無効になる確率が高" +"いです。\n" +"そして、別のプロセスからそのポインターを逆参照しようとするとクラッシュを引き" +"起こす可能性があります。" #: ../../library/multiprocessing.rst:1762 msgid "Return a ctypes array allocated from shared memory." @@ -2821,13 +2809,10 @@ msgstr "" ":func:`RawValue` と同様ですが、 *lock* の値によっては ctypes オブジェクトをそ" "のまま返す代わりに、プロセスセーフな同期ラッパーが返されます。" -#: ../../library/multiprocessing.rst:1832 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." -msgstr "" -"共有メモリから割り当てられた ctypes オブジェクト *obj* をコピーしたオブジェク" -"トを返します。" +msgstr "ctypes オブジェクト *obj* のコピーを共有メモリに割り当てて返します。" #: ../../library/multiprocessing.rst:1837 msgid "" @@ -2863,15 +2848,14 @@ msgstr "" "synchronized オブジェクトは :term:`コンテキストマネージャ ` " "プロトコルをサポートしています。" -#: ../../library/multiprocessing.rst:1856 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -"次の表は通常の ctypes 構文で共有メモリから共有 ctypes オブジェクトを作成する" -"ための構文を比較します。 (``MyStruct`` テーブル内には :class:`ctypes." -"Structure` のサブクラスがあります。)" +"次の表は、共有メモリ上に共有 ctypes オブジェクトを作成する構文と、通常の " +"ctypes の構文を比較したものです。\n" +"表中の ``MyStruct`` は :class:`ctypes.Structure` のサブクラスです。" #: ../../library/multiprocessing.rst:1861 msgid "ctypes" @@ -3000,17 +2984,16 @@ msgstr "" "す。他のプロセスはプロキシ経由で共有オブジェクトへアクセスすることができま" "す。" -#: ../../library/multiprocessing.rst:1932 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " "manager object corresponds to a spawned child process and has methods which " "will create shared objects and return corresponding proxies." msgstr "" -"プロセス間でオブジェクトを共有するために使用される :class:`~multiprocessing." -"managers.SyncManager` オブジェクトを返します。返されたマネージャーオブジェク" -"トは生成される子プロセスに対応付けられ、共有オブジェクトを作成するメソッド" -"や、共有オブジェクトに対応するプロキシを返すメソッドを持ちます。" +"プロセス間でオブジェクトを共有するための、起動済みの :class:" +"`~multiprocessing.managers.SyncManager` オブジェクトを返します。\n" +"返されるマネージャーオブジェクトは起動された子プロセスに対応し、共有オブジェ" +"クトを作成してそのプロキシを返すメソッドを持ちます。" #: ../../library/multiprocessing.rst:1940 msgid "" @@ -3105,9 +3088,10 @@ msgstr "" msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr ":class:`Server` はさらに :attr:`address` 属性も持っています。" -#: ../../library/multiprocessing.rst:1994 msgid "Connect a local manager object to a remote manager process::" -msgstr "ローカルからリモートのマネージャーオブジェクトへ接続します::" +msgstr "" +"ローカルのマネージャーオブジェクトをリモートのマネージャープロセスに接続しま" +"す。 ::" #: ../../library/multiprocessing.rst:1996 msgid "" @@ -3166,7 +3150,6 @@ msgstr "" "される :class:`BaseProxy` のサブクラスです。 ``None`` の場合、プロキシクラス" "は自動的に作成されます。" -#: ../../library/multiprocessing.rst:2025 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -3176,15 +3159,15 @@ msgid "" "\"public method\" means any attribute which has a :meth:`~object.__call__` " "method and whose name does not begin with ``'_'``.)" msgstr "" -"*exposed* は :meth:`BaseProxy._callmethod` を使用したアクセスが許されるべき " -"typeid をプロキシするメソッド名のシーケンスを指定するために使用されます " -"(*exposed* が ``None`` の場合 :attr:`proxytype._exposed_` が存在すればそれが" -"代わりに使用されます)。*exposed* リストが指定されない場合、共有オブジェクトの" -"すべての \"パブリックメソッド\" がアクセス可能になります。 (ここでいう \"パブ" -"リックメソッド\" とは :meth:`~object.__call__` メソッドを持つものと名前が " -"``'_'`` で始まらないあらゆる属性を意味します。)" +"*exposed* には、この ``typeid`` のプロキシが :meth:`BaseProxy._callmethod` を" +"使ってアクセスできるメソッド名のシーケンスを指定します。\n" +"*exposed* が ``None`` の場合は、:attr:`proxytype._exposed_` があれば代わりに" +"使います。\n" +"公開するメソッドのリストを指定しなければ、共有オブジェクトのすべての「パブ" +"リックメソッド」にアクセスできます。\n" +"ここでいう「パブリックメソッド」は、:meth:`~object.__call__` メソッドを持ち、" +"かつ名前が ``'_'`` で始まらない属性を指します。" -#: ../../library/multiprocessing.rst:2034 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -3193,12 +3176,14 @@ msgid "" "not a key of this mapping or if the mapping is ``None`` then the object " "returned by the method will be copied by value." msgstr "" -"*method_to_typeid* はプロキシが返す exposed メソッドの返り値の型を指定するた" -"めに使用されるマッピングで、メソッド名を typeid 文字列にマップします。 " +"*method_to_typeid* は公開されるメソッドのうち、プロキシを返すメソッドの返り値" +"の型を指定するために使用されるマッピングで、メソッド名を typeid 文字列にマッ" +"プします。\n" "(*method_to_typeid* が ``None`` の場合 :attr:`proxytype._method_to_typeid_` " -"が存在すれば、それが代わりに使用されます。) メソッド名がこのマッピングのキー" -"ではないか、マッピングが ``None`` の場合、そのメソッドによって返されるオブ" -"ジェクトが値として (by value) コピーされます。" +"が存在すれば、それが代わりに使用されます。\n" +") メソッド名がこのマッピングのキーではないか、マッピングが ``None`` の場合、" +"そのメソッドによって返されるオブジェクトが値として (by value) コピーされま" +"す。" #: ../../library/multiprocessing.rst:2041 msgid "" @@ -3278,13 +3263,12 @@ msgstr "" "共有 :class:`threading.Condition` オブジェクトを作成して、そのプロキシを返し" "ます。" -#: ../../library/multiprocessing.rst:2087 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -"*lock* が提供される場合 :class:`threading.Lock` か :class:`threading.RLock` " -"オブジェクトのためのプロキシになります。" +"*lock* を指定する場合は、:class:`threading.Lock` または :class:`threading." +"RLock` オブジェクトのプロキシを渡してください。" #: ../../library/multiprocessing.rst:2095 msgid "" @@ -3328,11 +3312,12 @@ msgstr "" msgid "Create an array and return a proxy for it." msgstr "配列を作成して、そのプロキシを返します。" -#: ../../library/multiprocessing.rst:2124 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." -msgstr "書き込み可能な ``value`` 属性を作成して、そのプロキシを返します。" +msgstr "" +"書き込み可能な ``value`` 属性を持つオブジェクトを作成し、そのプロキシを返しま" +"す。" #: ../../library/multiprocessing.rst:2131 msgid "Create a shared :class:`dict` object and return a proxy for it." @@ -3620,7 +3605,6 @@ msgid "" "{'c': 3, 'z': 26}" msgstr "" -#: ../../library/multiprocessing.rst:2323 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -3637,7 +3621,7 @@ msgstr "" "無いのです。\n" "しかし、コンテナプロキシに値を保存する (これはプロキシオブジェクトの " "``__setitem__`` を起動します) 場合はマネージャーを通して変更が伝搬され、その" -"要素を実際に変更するために、コンテナプロキシに変更後の値が再代入されます::" +"要素の変更を反映するには、変更後の値をコンテナプロキシに再代入できます。 ::" #: ../../library/multiprocessing.rst:2331 msgid "" @@ -3758,9 +3742,8 @@ msgstr "" msgid "Return a copy of the referent." msgstr "参照対象のコピーを返します。" -#: ../../library/multiprocessing.rst:2406 msgid "If the referent is unpicklable then this will raise an exception." -msgstr "参照対象が unpickle 化できるなら例外を発生します。" +msgstr "参照対象を pickle 化できなければ例外を送出します。" #: ../../library/multiprocessing.rst:2410 msgid "Return a representation of the proxy object." @@ -3774,14 +3757,13 @@ msgstr "参照対象のオブジェクト表現を返します。" msgid "Cleanup" msgstr "クリーンアップ" -#: ../../library/multiprocessing.rst:2420 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -"プロキシオブジェクトは弱参照(weakref)コールバックを使用します。プロキシオブ" -"ジェクトがガベージコレクトされるときにその参照対象が所有するマネージャーから" -"その登録を取り消せるようにするためです。" +"プロキシオブジェクトは弱参照のコールバックを使います。\n" +"これにより、プロキシがガベージコレクトされると、その参照対象を所有するマネー" +"ジャーからプロキシの登録が解除されます。" #: ../../library/multiprocessing.rst:2423 msgid "" @@ -4049,13 +4031,12 @@ msgstr "" "ジェクトの *iterable* をイテレートして、 unpack したイテレート可能オブジェク" "トを伴って *func* を呼び出します。結果オブジェクトを返します。" -#: ../../library/multiprocessing.rst:2590 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -"これ以上プールでタスクが実行されないようにします。すべてのタスクが完了した後" -"でワーカープロセスが終了します。" +"これ以上プールにタスクが投入されないようにします。\n" +"すべてのタスクが完了すると、ワーカープロセスは終了します。" #: ../../library/multiprocessing.rst:2595 msgid "" @@ -4328,13 +4309,12 @@ msgstr "リスナーオブジェクトは次の読み出し専用属性を持っ msgid "The address which is being used by the Listener object." msgstr "リスナーオブジェクトが使用中のアドレスです。" -#: ../../library/multiprocessing.rst:2770 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -"最後にコネクションを受け付けたアドレスです。有効なアドレスがない場合は " -"``None`` になります。" +"最後に受け付けた接続の接続元アドレスです。\n" +"取得できない場合は ``None`` になります。" #: ../../library/multiprocessing.rst:2773 msgid "" @@ -4562,19 +4542,17 @@ msgstr "" "`Listener` や :func:`Client` はダイジェスト認証を提供するために :mod:`hmac` " "モジュールを使用します。" -#: ../../library/multiprocessing.rst:2917 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " "the other knows the authentication key. (Demonstrating that both ends are " "using the same key does **not** involve sending the key over the connection.)" msgstr "" -"認証キーはパスワードとして見なされるバイト文字列です。コネクションが確立する" -"と、双方の終点で正しい接続先であることを証明するために 知っているお互いの認証" -"キーを要求します。(双方の終点が同じキーを使用して通信しようとしても、コネク" -"ション上でそのキーを送信することは **できません**。)" +"認証キーはパスワードと考えられるバイト文字列です。\n" +"接続が確立すると、双方が相手に対して認証キーを知っている証拠を要求します。\n" +"双方が同じキーを使っていることを証明する際に、接続を通じてキー自体を送ること" +"は **ありません**。" -#: ../../library/multiprocessing.rst:2923 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -4585,11 +4563,12 @@ msgid "" "setting up connections between themselves." msgstr "" "認証が要求されているにもかかわらず認証キーが指定されていない場合 " -"``current_process().authkey`` の返す値が使用されます。 (詳細は :class:" -"`~multiprocessing.Process` を参照してください。) この値はカレントプロセスを作" -"成する :class:`~multiprocessing.Process` オブジェクトによって自動的に継承され" -"ます。 これは(デフォルトでは)複数プロセスのプログラムの全プロセスが相互にコネ" -"クションを 確立するときに使用される1つの認証キーを共有することを意味します。" +"``current_process().authkey`` の返す値が使用されます。\n" +"(詳細は :class:`~multiprocessing.Process` を参照してください。\n" +") この値はカレントプロセスが作成する :class:`~multiprocessing.Process` オブ" +"ジェクトによって自動的に継承されます。\n" +"これは(デフォルトでは)複数プロセスのプログラムの全プロセスが相互にコネクショ" +"ンを 確立するときに使用される1つの認証キーを共有することを意味します。" #: ../../library/multiprocessing.rst:2931 msgid "" @@ -4614,16 +4593,16 @@ msgstr "" msgid "Logging" msgstr "ログ記録" -#: ../../library/multiprocessing.rst:2947 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " "(depending on the handler type) for messages from different processes to get " "mixed up." msgstr "" -"ロギングのためにいくつかの機能が利用可能です。しかし :mod:`logging` パッケー" -"ジは、 (ハンドラー種別に依存して)違うプロセスからのメッセージがごちゃ混ぜにな" -"るので、プロセスの共有ロックを使用しないことに注意してください。" +"ロギングをサポートする機能もいくつかあります。\n" +"ただし、:mod:`logging` パッケージはプロセス間で共有するロックを使わないため、" +"ハンドラーの種類によっては異なるプロセスからのメッセージが混ざる可能性があり" +"ます。" #: ../../library/multiprocessing.rst:2954 msgid "" @@ -4638,14 +4617,13 @@ msgid "" "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2961 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -"Windows 上では子プロセスが親プロセスのロガーレベルを継承しないことに注意して" -"ください。さらにその他のロガーのカスタマイズ内容もすべて継承されません。" +"Windows では、子プロセスは親プロセスのロガーのレベルだけを継承します。\n" +"それ以外のロガーのカスタマイズは継承しません。" #: ../../library/multiprocessing.rst:2968 msgid "" @@ -4774,14 +4752,13 @@ msgid "" msgstr "" "できるだけプロセス間で巨大なデータを移動することは避けるようにすべきです。" -#: ../../library/multiprocessing.rst:3061 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -"プロセス間の通信には、 ``threading`` モジュールの低レベルな同期プリミティブを" -"使うのではなく、キューやパイプを使うのが良いでしょう。" +"プロセス間の通信には、 低レベルな同期プリミティブを使うのではなく、キューやパ" +"イプを使うのが良いでしょう。" #: ../../library/multiprocessing.rst:3065 msgid "Picklability" @@ -4933,7 +4910,6 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:3146 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -4941,11 +4917,11 @@ msgid "" "This might be important if some resource is freed when the object is garbage " "collected in the parent process." msgstr "" -"Windows や他の開始方式と (将来的にでも) 互換性のあるコードを書く場合は別とし" +"Windows や他の開始方式と (将来的にでも) 互換性を持つコードにできることに加え" "て、これは子プロセスが実行中である限りは親プロセス内でオブジェクトがガベージ" -"コレクトされないことも保証します。これは親プロセス内でオブジェクトがガベージ" -"コレクトされたときに一部のリソースが開放されてしまう場合に重要かもしれませ" -"ん。" +"コレクトされないことも保証します。\n" +"これは親プロセス内でオブジェクトがガベージコレクトされたときに一部のリソース" +"が開放されてしまう場合に重要かもしれません。" #: ../../library/multiprocessing.rst:3153 msgid "So for instance ::" diff --git a/library/netrc.po b/library/netrc.po index e33bf02e0..c45d17e1e 100644 --- a/library/netrc.po +++ b/library/netrc.po @@ -73,7 +73,6 @@ msgstr "" "引数で *file* が渡されなかったときは、 :file:`.netrc` ファイルの場所を探すの" "に :func:`os.path.expanduser` が使われるようになりました。" -#: ../../library/netrc.rst:39 msgid "" ":class:`netrc` try UTF-8 encoding before using locale specific encoding. The " "entry in the netrc file no longer needs to contain all tokens. The missing " @@ -83,10 +82,12 @@ msgid "" "check." msgstr "" ":class:`netrc` は、ロケール固有のエンコーディングを使用する前に、 UTF-8 での" -"エンコーディングを試みます。 netrc ファイルのエントリがすべてのトークンを含む" -"必要はなくなりました。欠落したトークンのデフォルト値は空文字列です。すべての" -"トークンとその値は空白や非 ASCII 文字のような任意の文字を使用できるようになり" -"ました。ログイン名が匿名の場合、セキュリティチェックはトリガーしません。" +"エンコーディングを試みます。\n" +"netrc ファイルのエントリがすべてのトークンを含む必要はなくなりました。\n" +"欠落したトークンのデフォルト値は空文字列です。\n" +"すべてのトークンとその値は空白や非 ASCII 文字のような任意の文字を使用できるよ" +"うになりました。\n" +"ログイン名が ``anonymous`` の場合、セキュリティチェックはトリガーしません。" #: ../../library/netrc.rst:50 msgid "" diff --git a/library/numbers.po b/library/numbers.po index 37e2dc992..d413e8abc 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -72,13 +72,13 @@ msgstr "抽象プロパティ。この数の実部を取り出します。" msgid "Abstract. Retrieves the imaginary component of this number." msgstr "抽象プロパティ。この数の虚部を取り出します。" -#: ../../library/numbers.rst:44 msgid "" "Abstract. Returns the complex conjugate. For example, ``(1+3j).conjugate() " "== (1-3j)``." msgstr "" -"抽象プロパティ。複素共役を返します。たとえば、``(1+3j).conjugate() == " -"(1-3j)`` です。" +"抽象メソッド。\n" +"複素共役を返します。\n" +"たとえば、``(1+3j).conjugate() == (1-3j)`` です。" #: ../../library/numbers.rst:49 msgid "" diff --git a/library/operator.po b/library/operator.po index 61be1c51e..44d290fd2 100644 --- a/library/operator.po +++ b/library/operator.po @@ -170,9 +170,8 @@ msgstr "" msgid "Return ``a @ b``." msgstr "``a @ b`` を返します。" -#: ../../library/operator.rst:169 msgid "Return *obj* negated (``-obj``)." -msgstr "負の *obj* (``-obj``) を返します。" +msgstr "*obj* の符号を反転した値を返します (``-obj``)。" #: ../../library/operator.rst:175 msgid "Return ``a | b``." diff --git a/library/optparse.po b/library/optparse.po index 0606dbc25..47fd5dddc 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -680,14 +680,14 @@ msgstr "" msgid "parser.add_option(\"-f\", \"--file\", ...)" msgstr "" -#: ../../library/optparse.rst:379 msgid "" "You're free to define as many short option strings and as many long option " "strings as you like (including zero), as long as there is at least one " "option string overall." msgstr "" -"オプション文字列は、(ゼロ文字の場合も含め)いくらでも短く、またいくらでも長く" -"できます。ただしオプション文字列は少なくとも一つなければなりません。" +"短いオプション文字列と長いオプション文字列は、それぞれ好きな数だけ定義できま" +"す (どちらか一方はゼロ個でも構いません)。\n" +"ただし、全体で少なくとも一つのオプション文字列が必要です。" #: ../../library/optparse.rst:383 msgid "" @@ -1692,14 +1692,13 @@ msgstr "" msgid "pass it an Option instance (as returned by :func:`make_option`)" msgstr "(:func:`make_option` などが返す) ``Option`` インスタンスを渡します" -#: ../../library/optparse.rst:977 msgid "" "pass it any combination of positional and keyword arguments that are " "acceptable to :func:`make_option` (i.e., to the Option constructor), and it " "will create the Option instance for you" msgstr "" -":func:`make_option` に (すなわち ``Option`` のコンストラクタに) 位置引数と" -"キーワード引数の組み合わせを渡して、 ``Option`` インスタンスを生成させます" +":func:`make_option` (つまり ``Option`` コンストラクター) が受け取れる位置引数" +"とキーワード引数を組み合わせて渡すと、``Option`` インスタンスが作成されます。" #: ../../library/optparse.rst:981 msgid "" @@ -2136,12 +2135,11 @@ msgid "" "options.f = \"bar.txt\"" msgstr "" -#: ../../library/optparse.rst:1242 msgid "" "``\"store_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -"``\"store_const\"`` [関連: :attr:`~Option.const`; 関連: :attr:`~Option.dest`]" +"``\"store_const\"`` [必須: :attr:`~Option.const`; 関連: :attr:`~Option.dest`]" #: ../../library/optparse.rst:1245 msgid "The value :attr:`~Option.const` is stored in :attr:`~Option.dest`." @@ -2263,12 +2261,11 @@ msgid "" "['~/.mypkg/defaults', 'overrides.mypkg']" msgstr "" -#: ../../library/optparse.rst:1312 msgid "" "``\"append_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -"``\"append_const\"`` [関連: :attr:`~Option.const`; 関連: :attr:`~Option." +"``\"append_const\"`` [必須: :attr:`~Option.const`; 関連: :attr:`~Option." "dest`]" #: ../../library/optparse.rst:1315 @@ -3139,13 +3136,12 @@ msgstr "" msgid "``kwargs``" msgstr "``kwargs``" -#: ../../library/optparse.rst:1793 msgid "" "is a dictionary of arbitrary keyword arguments supplied via :attr:`~Option." "callback_kwargs`." msgstr "" ":attr:`~Option.callback_kwargs` オプション属性で与えられた任意のキーワード引" -"数からなるタプルです。" +"数からなる辞書です。" #: ../../library/optparse.rst:1800 msgid "Raising errors in a callback" @@ -3241,7 +3237,6 @@ msgstr "" msgid "Callback example 4: check arbitrary condition" msgstr "コールバックの例 4: 任意の条件をチェックする" -#: ../../library/optparse.rst:1866 msgid "" "Of course, you could put any condition in there---you're not limited to " "checking the values of already-defined options. For example, if you have " @@ -3249,8 +3244,9 @@ msgid "" "is this::" msgstr "" "もちろん、単に定義済みのオプションの値を調べるだけにとどまらず、コールバック" -"には任意の条件を入れられます。例えば、満月でなければ呼び出してはならないオプ" -"ションがあるとしましょう。やらなければならないことはこれだけです::" +"には任意の条件を入れられます。\n" +"例えば、満月のときには呼び出してはならないオプションがあるとしましょう。\n" +"やらなければならないことはこれだけです::" #: ../../library/optparse.rst:1870 msgid "" @@ -3354,13 +3350,12 @@ msgid "" "thing directly)." msgstr "" -#: ../../library/optparse.rst:1934 msgid "" "Nevertheless, here's a stab at a callback for an option with variable " "arguments::" msgstr "" -"とはいえ、可変個の引数をもつオプションに対するスタブ (stub、仲介インター" -"フェース) を以下に示しておきます::" +"それでは、可変個の引数をとるオプション用のコールバックを試しに実装してみま" +"す。 ::" #: ../../library/optparse.rst:1937 msgid "" diff --git a/library/os.path.po b/library/os.path.po index 40cdebd19..4c5ab33c0 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -92,16 +92,15 @@ msgstr "UNIX 形式のパスを扱う :mod:`!posixpath`" msgid ":mod:`!ntpath` for Windows paths" msgstr "Windows のパスを扱う :mod:`!ntpath`" -#: ../../library/os.path.rst:51 msgid "" ":func:`exists`, :func:`lexists`, :func:`isdir`, :func:`isfile`, :func:" "`islink`, and :func:`ismount` now return ``False`` instead of raising an " "exception for paths that contain characters or bytes unrepresentable at the " "OS level." msgstr "" -":func:`exists`、 :func:`lexists`、 :func:`isdir`、 :func:`isfile`、 :func:" -"`islink`、および :func:`ismount` は、OS レベルで表現できない文字列を含む可能" -"性がある例外を送出する代わりに ``False`` を返すようになりました。" +":func:`exists`、:func:`lexists`、:func:`isdir`、:func:`isfile`、:func:" +"`islink`、:func:`ismount` は、OS レベルで表現できない文字やバイトを含むパスに" +"対して、例外を送出する代わりに ``False`` を返すようになりました。" #: ../../library/os.path.rst:59 msgid "" @@ -393,14 +392,13 @@ msgid "" "supported on the current platform." msgstr "" -#: ../../library/os.path.rst:310 msgid "" "Return ``True`` if *path* refers to an :func:`existing ` directory " "entry that is a symbolic link. Always ``False`` if symbolic links are not " "supported by the Python runtime." msgstr "" -"*path* が :func:`存在する ` ディレクトリを指すシンボリックリンクなら " -"``True`` を返します。\n" +"*path* が、シンボリックリンクである :func:`既存の ` ディレクトリエン" +"トリを指している場合に ``True`` を返します。\n" "Python ランタイムがシンボリックリンクをサポートしていないプラットフォームで" "は、常に ``False`` を返します。" @@ -681,7 +679,6 @@ msgstr "" "ファイル記述子 *fp1* と *fp2* が同じファイルを参照していたら ``True`` を返し" "ます。" -#: ../../library/os.path.rst:554 msgid "" "Return ``True`` if the stat tuples *stat1* and *stat2* refer to the same " "file. These structures may have been returned by :func:`os.fstat`, :func:`os." @@ -689,9 +686,11 @@ msgid "" "comparison used by :func:`samefile` and :func:`sameopenfile`." msgstr "" "stat タプル *stat1* と *stat2* が同じファイルを参照していれば ``True`` を返し" -"ます。これらのタプルは :func:`os.fstat` 、 :func:`os.lstat` あるいは :func:" -"`os.stat` の返り値で構いません。この関数は :func:`samefile` と :func:" -"`sameopenfile` を使用した比較に基いて実装しています。" +"ます。\n" +"これらのタプルは :func:`os.fstat` 、 :func:`os.lstat` あるいは :func:`os." +"stat` の返り値で構いません。\n" +"この関数は :func:`samefile` と :func:`sameopenfile` が内部で使う比較処理を実" +"装しています。" #: ../../library/os.path.rst:565 msgid "" diff --git a/library/os.po b/library/os.po index af14a9eda..46f9320c6 100644 --- a/library/os.po +++ b/library/os.po @@ -182,15 +182,15 @@ msgstr "" "コードできないバイト列は Unicode 文字 U+DC\\ *xx* に置き換えられ、それらはエ" "ンコード時に再び元のバイト列に変換されることを意味します。" -#: ../../library/os.rst:95 msgid "" "The :term:`file system encoding ` " "must guarantee to successfully decode all bytes below 128. If the file " "system encoding fails to provide this guarantee, API functions can raise :" "exc:`UnicodeError`." msgstr "" -":term:`file system encoding ` では、す" -"べてが 128 バイト以下に正常にデコードされることが保証されなくてはなりません。" +":term:`file system encoding ` では、値" +"が 128 未満のすべてのバイトを正常にデコードできることが保証されなくてはなりま" +"せん。\n" "ファイルシステムのエンコーディングでこれが保証されなかった場合は、API 関数" "が :exc:`UnicodeError` を送出します。" @@ -470,14 +470,14 @@ msgstr "" msgid "These functions are described in :ref:`os-file-dir`." msgstr "これらの関数は、 :ref:`os-file-dir` 節で説明されています。" -#: ../../library/os.rst:286 msgid "" "Encode :term:`path-like ` *filename* to the :term:" "`filesystem encoding and error handler`; return :class:`bytes` unchanged." msgstr "" ":term:`path-like ` な *filename* を :term:`ファイルシステム" "のエンコーディングとエラーハンドラ ` " -"にエンコードします。未変更の :class:`bytes` オブジェクトを返します。" +"にエンコードします。\n" +"入力が :class:`bytes` の場合は、そのまま返します。" #: ../../library/os.rst:290 msgid ":func:`fsdecode` is the reverse function." @@ -491,14 +491,14 @@ msgstr "" ":class:`os.PathLike` インターフェースを実装したオブジェクトを受け入れるように" "なりました。" -#: ../../library/os.rst:301 msgid "" "Decode the :term:`path-like ` *filename* from the :term:" "`filesystem encoding and error handler`; return :class:`str` unchanged." msgstr "" ":term:`path-like ` な *filename* を :term:`ファイルシステム" "のエンコーディングとエラーハンドラ ` " -"からデコードします。未変更の :class:`str` オブジェクトを返します。" +"からデコードします。\n" +"入力が :class:`str` の場合は、そのまま返します。" #: ../../library/os.rst:305 msgid ":func:`fsencode` is the reverse function." @@ -508,17 +508,17 @@ msgstr ":func:`fsencode` はこの逆変換を行う関数です。" msgid "Return the file system representation of the path." msgstr "path のファイルシステム表現を返します。" -#: ../../library/os.rst:318 msgid "" "If :class:`str` or :class:`bytes` is passed in, it is returned unchanged. " "Otherwise :meth:`~os.PathLike.__fspath__` is called and its value is " "returned as long as it is a :class:`str` or :class:`bytes` object. In all " "other cases, :exc:`TypeError` is raised." msgstr "" -"もし :class:`str` か :class:`bytes:` のオブジェクトが渡された場合は、変更せず" -"にそのまま返します。さもなければ、 :meth:`~os.PathLike.__fspath__` が呼び出さ" -"れ、その戻り値が :class:`str` か :class:`bytes` のオブジェクトであれば、その" -"値を返します。他のすべてのケースでは :exc:`TypeError` が送出されます。" +"もし :class:`str` か :class:`bytes` のオブジェクトが渡された場合は、変更せず" +"にそのまま返します。\n" +"さもなければ、 :meth:`~os.PathLike.__fspath__` が呼び出され、その戻り値が :" +"class:`str` か :class:`bytes` のオブジェクトであれば、その値を返します。\n" +"他のすべてのケースでは :exc:`TypeError` が送出されます。" #: ../../library/os.rst:328 msgid "" @@ -810,18 +810,18 @@ msgstr "現在のプロセスに実効ユーザー id をセットします。" msgid "Set the current process' group id." msgstr "現在のプロセスにグループ id をセットします。" -#: ../../library/os.rst:632 msgid "" "Set the list of supplemental group ids associated with the current process " "to *groups*. *groups* must be a sequence, and each element must be an " "integer identifying a group. This operation is typically available only to " "the superuser." msgstr "" -"現在のグループに関連付けられた従属グループ id のリストを *groups* に設定しま" -"す。 *groups* はシーケンス型でなくてはならず、各要素はグループを特定する整数" -"でなくてはなりません。通常、この操作はスーパユーザーしか利用できません。" +"現在のプロセスに関連付けられた従属グループ id のリストを *groups* に設定しま" +"す。\n" +"*groups* はシーケンス型でなくてはならず、各要素はグループを特定する整数でなく" +"てはなりません。\n" +"通常、この操作はスーパユーザーしか利用できません。" -#: ../../library/os.rst:638 msgid "" "On macOS, the length of *groups* may not exceed the system-defined maximum " "number of effective group ids, typically 16. See the documentation for :func:" @@ -829,9 +829,9 @@ msgid "" "calling setgroups()." msgstr "" "macOS では、 *groups* の長さはシステムで定義された実効グループ id の最大数 " -"( 通常は 16) を超えない場合があります。 setgroups() 呼び出しで設定されたもの" -"と同じグループリストが返されないケースについては、 :func:`getgroups` のドキュ" -"メントを参照してください。" +"( 通常は 16) を超えてはいけません。\n" +"setgroups() 呼び出しで設定されたものと同じグループリストが返されないケースに" +"ついては、 :func:`getgroups` のドキュメントを参照してください。" #: ../../library/os.rst:645 msgid "" @@ -1634,17 +1634,17 @@ msgstr "" msgid "These operations only make sense for filesystems that support them." msgstr "" -#: ../../library/os.rst:1309 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " "its mode according to *mode*. When computing *mode*, the current umask " "value is first masked out. Return the file descriptor for the newly opened " "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -"ファイル *path* を開き、*flag* に従って様々なフラグを設定し、可能なら *mode* " -"に従ってファイルモードを設定します。*mode* を計算する際、まず現在の umask 値" -"でマスクされます。新たに開いたファイルのファイル記述子を返します。新しいファ" -"イル記述子は :ref:`継承不可` です。" +"ファイル *path* を開き、*flags* に従って様々なフラグを設定し、必要に応じて " +"*mode* に従ってファイルモードを設定します。\n" +"*mode* を計算する際、まず現在の umask 値でマスクされます。\n" +"新たに開いたファイルのファイル記述子を返します。\n" +"新しいファイル記述子は :ref:`継承不可` です。" #: ../../library/os.rst:1314 msgid "" @@ -1889,13 +1889,12 @@ msgstr "" "データをそれぞれのバッファがいっぱいになるまで移し、いっぱいになったらシーケ" "ンスの次のバッファに処理を移し、残りのデータを読み込ませます。" -#: ../../library/os.rst:1533 ../../library/os.rst:1637 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -"flags 引数にはゼロあるいは次のフラグのバイトごとの OR を取った結果が保持され" -"ています。" +"``flags`` 引数には、次のフラグを 0 個以上、ビット単位 OR で組み合わせて指定し" +"ます。" #: ../../library/os.rst:1536 msgid ":data:`RWF_HIPRI`" @@ -2108,16 +2107,14 @@ msgid "" "readinto`, :meth:`io.BufferedIOBase.read`, or :meth:`io.TextIOBase.read`" msgstr "" -#: ../../library/os.rst:1745 msgid "" "Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* " "starting at *offset*. Return the number of bytes sent. When EOF is reached " "return ``0``." msgstr "" -"ファイル記述子 *in_fd* からファイル記述子 *out_fd* への開始位置 *offset* へ " -"*count* バイトコピーします。\n" -"送信バイト数を返します。\n" -"EOF に達した場合は ``0`` を返します。" +"ファイル記述子 *in_fd* の位置 *offset* から *count* バイトをファイル記述子 " +"*out_fd* にコピーします。\n" +"送信したバイト数を返し、EOF に達すると ``0`` を返します。" #: ../../library/os.rst:1749 msgid "" @@ -2378,12 +2375,12 @@ msgstr "" "オプションの引数 ``fd`` には問い合わせるファイル記述子を指定します (デフォル" "トは ``STDOUT_FILENO``、または標準出力)。" -#: ../../library/os.rst:1982 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -"ファイル記述子が接続されていなかった場合、 :exc:`OSError` が送出されます。" +"ファイル記述子が端末に接続されていなかった場合、 :exc:`OSError` が送出されま" +"す。" #: ../../library/os.rst:1985 msgid "" @@ -2497,7 +2494,6 @@ msgid "" "function prefixed with ``f`` (e.g. call ``fchdir`` instead of ``chdir``)." msgstr "" -#: ../../library/os.rst:2068 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -2505,9 +2501,9 @@ msgid "" "`NotImplementedError`." msgstr "" ":data:`os.supports_fd` を使うことで、そのプラットフォーム上で *path* にファイ" -"ル記述子を指定できるかどうかを確認することができます。この機能が利用可能でな" -"い場合、 ``os.supports_fd`` の利用は :exc:`NotImplementedError` 例外を送出し" -"ます。" +"ル記述子を指定できるかどうかを確認することができます。\n" +"この機能が利用可能でない場合、 その関数にファイル記述子を指定すると :exc:" +"`NotImplementedError` 例外を送出します。" #: ../../library/os.rst:2073 msgid "" @@ -3072,13 +3068,12 @@ msgstr "" "``文字列型`` のファイル名を ``バイト列型`` にエンコードするには、:func:`~os." "fsencode` を使用します。" -#: ../../library/os.rst:2438 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" "ディレクトリエントリに加えてファイル属性情報も返す :func:`scandir` 関数の方" -"が、多くの一般的な用途では使い勝手が良くなります。" +"が、多くの一般的な用途では性能が向上します。" #: ../../library/os.rst:2442 msgid "The *path* parameter became optional." @@ -3605,13 +3600,12 @@ msgstr "" "トリ構造をまず作成しようと試みます。名前変更の後、元のファイル名のパス要素" "は :func:`removedirs` を使って右側から順に削除されます。" -#: ../../library/os.rst:2871 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -"この関数はコピー元の末端のディレクトリまたはファイルを削除する権限がない場合" -"には失敗します。" +"末端のディレクトリやファイルを削除する権限がないと、新しいディレクトリ構造を" +"作成した後にこの関数が失敗する場合があります。" #: ../../library/os.rst:2876 msgid "Accepts a :term:`path-like object` for *old* and *new*." @@ -3919,16 +3913,16 @@ msgstr "" "はたどりません) の場合にのみ ``True`` を返します。項目がディレクトリ以外の" "ファイルである場合や、項目がもはや存在しない場合は ``False`` を返します。" -#: ../../library/os.rst:3083 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -"結果は ``os.DirEntry`` オブジェクトにキャッシュされます。*follow_symlinks* " -"が ``True`` の場合と ``False`` の場合とでは、別のオブジェクトにキャッシュされ" -"ます。最新の情報を取得するには :func:`stat.S_ISDIR` と共に :func:`os.stat` を" -"呼び出してください。" +"結果は ``os.DirEntry`` オブジェクトにキャッシュされます。\n" +"*follow_symlinks* が ``True`` の場合と ``False`` の場合とでは、キャッシュを" +"別々に保持します。\n" +"最新の情報を取得するには :func:`stat.S_ISDIR` と共に :func:`os.stat` を呼び出" +"してください。" #: ../../library/os.rst:3087 msgid "" @@ -4026,15 +4020,15 @@ msgid "" "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:3140 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -"この項目の :class:`stat_result` オブジェクトを返します。このメソッドは、デ" -"フォルトでシンボリックリンクをたどります。シンボリックリンクを開始するには、 " -"``follow_symlinks=False`` 引数を追加します。" +"この項目の :class:`stat_result` オブジェクトを返します。\n" +"このメソッドはデフォルトでシンボリックリンクをたどります。\n" +"シンボリックリンク自体の情報を取得するには、``follow_symlinks=False`` 引数を" +"追加します。" #: ../../library/os.rst:3144 msgid "" @@ -4053,15 +4047,15 @@ msgstr "" "``st_nlink`` 属性は常にゼロに設定されます。これらの属性を取得するには、 :" "func:`os.stat` を呼び出します。" -#: ../../library/os.rst:3153 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -"結果は ``os.DirEntry`` オブジェクトにキャッシュされます。*follow_symlinks* " -"が ``True`` の場合と ``False`` の場合とでは、別のオブジェクトにキャッシュされ" -"ます。最新の情報を取得するには、 :func:`os.stat` を呼び出してください。" +"結果は ``os.DirEntry`` オブジェクトにキャッシュされます。\n" +"*follow_symlinks* が ``True`` の場合と ``False`` の場合とでは、キャッシュを" +"別々に保持します。\n" +"最新の情報を取得するには、 :func:`os.stat` を呼び出してください。" #: ../../library/os.rst:3157 msgid "" @@ -4212,15 +4206,15 @@ msgstr "ファイル所有者のユーザ識別子。" msgid "Group identifier of the file owner." msgstr "ファイル所有者のグループ識別子。" -#: ../../library/os.rst:3274 ../../library/os.rst:3720 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" "ファイルが通常のファイルまたはシンボリックリンクの場合、そのファイルのバイト" -"単位でのサイズです。シンボリックリンクのサイズは、含まれるパス名の長さで、" -"null バイトで終わることはありません。" +"単位でのサイズです。\n" +"シンボリックリンクのサイズは、含まれるパス名の長さで、終端の null バイトは含" +"みません。" #: ../../library/os.rst:3278 msgid "Timestamps:" @@ -5355,13 +5349,12 @@ msgid "" " os.rmdir(name, dir_fd=rootfd)" msgstr "" -#: ../../library/os.rst:4370 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -"引数 ``top``, ``topdown``, ``onerror``, ``follow_symlinks`` を指定して :ref:`" -"監査イベント ` ``os.fwalk`` を送出します。" +"引数 ``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd`` を指" +"定して :ref:`監査イベント ` ``os.fwalk`` を送出します。" #: ../../library/os.rst:4379 msgid "Added support for :class:`bytes` paths." @@ -5848,13 +5841,12 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:4813 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -"Linux カーネル 2.6.39 以前では、バグのため一部のファイルシステムで引数 flags " -"が無視されます。" +"Linux カーネル 2.6.39 より前では、バグのため一部のファイルシステムで引数 " +"``flags`` が無視されます。" #: ../../library/os.rst:4816 msgid "" @@ -5969,7 +5961,6 @@ msgid "" "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:4906 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -5977,9 +5968,10 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" "これらの関数はすべて、現在のプロセスを置き換える形で新たなプログラムを実行し" -"ます ; 現在のプロセスは返り値を返しません。 Unix では、新たに実行される実行" -"コードは現在のプロセス内に読み込まれ、呼び出し側と同じプロセス ID を持つこと" -"になります。エラーは :exc:`OSError` 例外として報告されます。" +"ます ; これらの関数から呼び出し元に戻ることはありません。\n" +"Unix では、新たに実行される実行コードは現在のプロセス内に読み込まれ、呼び出し" +"側と同じプロセス ID を持つことになります。\n" +"エラーは :exc:`OSError` 例外として報告されます。" #: ../../library/os.rst:4911 msgid "" @@ -6261,7 +6253,6 @@ msgid "" "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:5159 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -6269,11 +6260,12 @@ msgid "" "the master end of the pseudo-terminal. For a more portable approach, use " "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -"子プロセスを fork します。この時新しい擬似端末を子プロセスの制御端末として使" -"います。親プロセスでは ``(pid, fd)`` からなるペアが返り、 *fd* は擬似端末のマ" -"スター側のファイル記述子となります。可搬性のあるアプローチを取るには、 :mod:" -"`pty` モジュールを利用してください。エラーが発生した場合は、 :exc:`OSError` " -"を送出します。" +"子プロセスを fork し、新しい擬似端末を子プロセスの制御端末として使います。\n" +"``(pid, fd)`` のペアを返します。\n" +"*pid* は子プロセスでは ``0``、親プロセスでは新しい子プロセスのプロセス ID と" +"なり、*fd* は擬似端末のマスター側のファイル記述子となります。\n" +"より可搬性のある方法としては、:mod:`pty` モジュールを利用してください。\n" +"エラーが発生した場合は :exc:`OSError` を送出します。" #: ../../library/os.rst:5165 msgid "" @@ -6378,7 +6370,6 @@ msgstr "" "プログラムのセグメントをメモリ内にロックします。 *op* (```` で定" "義されています ) にはどのセグメントをロックするかを指定します。" -#: ../../library/os.rst:5267 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -6387,14 +6378,15 @@ msgid "" "`open` function. The returned file object reads or writes text strings " "rather than bytes." msgstr "" -"コマンド *cmd* への、または *cmd* からのパイプ入出力を開きます。戻り値はパイ" -"プに接続されている開かれたファイルオブジェクトで、 *mode* が ``'r'`` (デフォ" -"ルト) または ``'w'`` かによって読み出しまたは書き込みを行うことができます。引" -"数 *bufsize* は、組み込み関数 :func:`open` における対応する引数と同じ意味を持" -"ちます。 返されるファイルオブジェクトは、バイトではなくテキスト文字列を読み書" -"きします。" +"コマンド *cmd* への、または *cmd* からのパイプ入出力を開きます。\n" +"戻り値はパイプに接続されている開かれたファイルオブジェクトで、 *mode* が " +"``'r'`` (デフォルト) または ``'w'`` かによって読み出しまたは書き込みを行うこ" +"とができます。\n" +"引数 *buffering* は、組み込み関数 :func:`open` における対応する引数と同じ意味" +"を持ちます。\n" +"返されるファイルオブジェクトは、バイトではなくテキスト文字列を読み書きしま" +"す。" -#: ../../library/os.rst:5275 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -6406,12 +6398,15 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" "``close`` メソッドは、サブプロセスが正常に終了した場合は :const:`None` を返" -"し、エラーが発生した場合にはサブプロセスの返りコードを返します。POSIX システ" -"ムでは、返りコードが正の場合、そのコードは1バイト左にシフトしてプロセスが終了" -"したことを示します。返りコードが負の場合、プロセスは返りコードの符号を変えた" -"信号により終了します 。 (例えば、サブプロセスが kill された場合、返り値は " -"``- signal.SIGKILL`` となる場合があります。) Windows システムでは、返り値には" -"子プロセスからの符号のついた整数の返りコードを含まれます。" +"し、エラーが発生した場合にはサブプロセスの返りコードを返します。\n" +"POSIX システムでは、返りコードが正の場合、その値はプロセスの終了コードを 1 バ" +"イト左にシフトしたものです。\n" +"返りコードが負の場合、プロセスは返りコードの符号を変えた信号により終了しま" +"す 。\n" +"(例えば、サブプロセスが kill された場合、返り値は ``- signal.SIGKILL`` となる" +"場合があります。\n" +") Windows システムでは、返り値には子プロセスからの符号のついた整数の返りコー" +"ドを含まれます。" #: ../../library/os.rst:5285 msgid "" @@ -7339,15 +7334,14 @@ msgstr "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` 関数。" -#: ../../library/os.rst:5943 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" "以下の関数は :func:`system` 、 :func:`wait` 、あるいは :func:`waitpid` が返す" -"プロセス状態コードを引数にとります。これらの関数はプロセスの配置を決めるため" -"に利用できます。" +"プロセス状態コードを引数にとります。\n" +"これらの関数はプロセスの状態を判定するために利用できます。" #: ../../library/os.rst:5949 msgid "" @@ -7633,17 +7627,16 @@ msgid "" msgstr "" "*name* に指定された設定値が定義されていない場合、 ``None`` を返します。" -#: ../../library/os.rst:6179 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " "included in ``confstr_names``, an :exc:`OSError` is raised with :const:" "`errno.EINVAL` for the error number." msgstr "" -"*name* が文字列で、かつ不明の場合、 :exc:`ValueError` を送出します。 *name* " -"の指定値がホストシステムでサポートされておらず、 ``confstr_names`` にも入って" -"いない場合、 :const:`errno.EINVAL` をエラー番号として :exc:`OSError` を送出し" -"ます。" +"*name* が文字列で、かつ不明の場合、 :exc:`ValueError` を送出します。\n" +"*name* の指定値がホストシステムでサポートされておらず、 ``confstr_names`` に" +"含まれていたとしても、 :const:`errno.EINVAL` をエラー番号として :exc:" +"`OSError` を送出します。" #: ../../library/os.rst:6189 msgid "" diff --git a/library/pathlib.po b/library/pathlib.po index 35fdae61e..26f63ce33 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -338,15 +338,15 @@ msgstr "" ">>> PurePath('foo/../bar')\n" "PurePosixPath('foo/../bar')" -#: ../../library/pathlib.rst:167 msgid "" "(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to " "``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to " "another directory)" msgstr "" -"(通常 ``PurePosixPath('foo/../bar')`` は ``PurePosixPath('bar')`` と等価にな" -"りますが、``foo`` が他のディレクトリへのシンボリックリンクの場合は等価になり" -"ません)" +"(単純な実装なら ``PurePosixPath('foo/../bar')`` を ``PurePosixPath('bar')`` " +"と同じにしてしまいますが、``foo`` が別のディレクトリへのシンボリックリンクの" +"場合、これは誤りです。\n" +")" #: ../../library/pathlib.rst:171 msgid "" @@ -414,16 +414,15 @@ msgstr "" msgid "General properties" msgstr "全般的な性質" -#: ../../library/pathlib.rst:208 msgid "" "Paths are immutable and :term:`hashable`. Paths of a same flavour are " "comparable and orderable. These properties respect the flavour's case-" "folding semantics::" msgstr "" -"パスオブジェクトはイミュータブルで :term:`ハッシュ可能 ` です。同じ" -"フレーバーのパスオブジェクトは比較ならびに順序付け可能です。これらのプロパ" -"ティは、フレーバーのケースフォールディング (訳注: 比較のために正規化するこ" -"と、例えば全て大文字にする) のセマンティクスに従います。" +"パスオブジェクトはイミュータブルで :term:`ハッシュ可能 ` です。\n" +"同じフレーバーのパスオブジェクトは比較ならびに順序付け可能です。\n" +"これらのプロパティは、フレーバーのケースフォールディング (訳注: 比較のために" +"正規化すること、例えば全て大文字にする) のセマンティクスに従います。 ::" #: ../../library/pathlib.rst:212 msgid "" @@ -941,13 +940,12 @@ msgid "" msgstr "" "追加の引数指定は非推奨となりました。指定された場合は *other* と連結されます。" -#: ../../library/pathlib.rst:552 msgid "" "Calling this method is equivalent to combining the path with each of the " "given *pathsegments* in turn::" msgstr "" -"このメソッドの呼び出しは、与えられた *pathsegments* のパスを順番に結合するこ" -"とと等価です。" +"このメソッドの呼び出しは、このパスに *pathsegments* の各要素を順番に結合する" +"ことと等価です。 ::" #: ../../library/pathlib.rst:555 msgid "" @@ -1138,13 +1136,12 @@ msgid "" "ValueError: PureWindowsPath('c:/') has an empty name" msgstr "" -#: ../../library/pathlib.rst:683 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -"現在のパスの :attr:`stem` 部分を変更したパスを返します。オリジナルパスに " -"``stem`` 部分がない場合は ValueError が送出されます::" +"現在のパスの :attr:`stem` 部分を変更したパスを返します。\n" +"オリジナルパスに ``name`` 部分がない場合は ValueError が送出されます::" #: ../../library/pathlib.rst:686 msgid "" @@ -1528,9 +1525,8 @@ msgid "" "whether it exists." msgstr "" -#: ../../library/pathlib.rst:968 msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." -msgstr "*strict* 引数を追加しました(3.6以前の挙動は strict です)。" +msgstr "*strict* 引数を追加しました(3.6 より前の挙動は strict です)。" #: ../../library/pathlib.rst:971 msgid "" @@ -1588,15 +1584,14 @@ msgid "" "exceptions." msgstr "" -#: ../../library/pathlib.rst:1018 msgid "" "Return an :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -"(:func:`os.stat` と同様の) 現在のパスについて :class:`os.stat_result` オブ" -"ジェクトが含む情報を返します。値はそれぞれのメソッドを呼び出した時点のものに" -"なります。" +"このパスの情報を含む :class:`os.stat_result` オブジェクトを :func:`os.stat` " +"と同様に返します。\n" +"このメソッドを呼ぶたびに情報を取得します。" #: ../../library/pathlib.rst:1021 msgid "" @@ -2479,21 +2474,21 @@ msgstr "" "*missing_ok* の値が (デフォルトの) 偽の場合、対象のファイルが存在しないと :" "exc:`FileNotFoundError` を送出します。" -#: ../../library/pathlib.rst:1714 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -"*missing_ok* の値が真の場合、 :exc:`FileExistsError` 例外を送出しません " +"*missing_ok* の値が真の場合、:exc:`FileNotFoundError` 例外は無視されます " "(POSIX の ``rm -f`` コマンドの挙動と同じ)。" #: ../../library/pathlib.rst:1717 msgid "The *missing_ok* parameter was added." msgstr "*missing_ok* 引数が追加されました。" -#: ../../library/pathlib.rst:1723 msgid "Remove this directory. The directory must be empty." -msgstr "現在のディレクトリを削除します。ディレクトリは空でなければなりません。" +msgstr "" +"このパスが指すディレクトリを削除します。\n" +"ディレクトリは空でなければなりません。" #: ../../library/pathlib.rst:1727 msgid "Permissions and ownership" @@ -2523,13 +2518,13 @@ msgstr "" ":mod:`pwd` モジュールが利用できない場合 :exc:`UnsupportedOperation` を送出し" "ます。以前のバージョンでは :exc:`NotImplementedError` を送出していました。" -#: ../../library/pathlib.rst:1747 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's group identifier (GID) isn't found in the system database." msgstr "" -"ファイルの所有者のグループ名を返します。ファイルのグループID(GID)がシステムの" -"データベースに見つからない場合 :exc:`KeyError` が送出されます。" +"ファイルの所有グループ名を返します。\n" +"ファイルのグループID(GID)がシステムのデータベースに見つからない場合 :exc:" +"`KeyError` が送出されます。" #: ../../library/pathlib.rst:1750 msgid "" diff --git a/library/pdb.po b/library/pdb.po index b8bb448f1..04c0e70a1 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -745,17 +745,16 @@ msgstr "" "のブレークポイントを解除します。引数なしの場合は、すべてのブレークポイントを" "解除します ( が、はじめに確認します ) 。" -#: ../../library/pdb.rst:486 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " "execution, but unlike clearing a breakpoint, it remains in the list of " "breakpoints and can be (re-)enabled." msgstr "" -"ブレークポイント番号 *bpnumber* のブレークポイントを無効にします。ブレークポ" -"イントを無効にすると、プログラムの実行を止めることができなくなりますが、ブ" -"レークポイントの解除と違いブレークポイントのリストに残っており、(再び) 有効に" -"できます。" +"空白で区切って指定した番号のブレークポイントを無効にします。\n" +"ブレークポイントを無効にすると、プログラムの実行を止めることができなくなりま" +"すが、ブレークポイントの解除と違いブレークポイントのリストに残っており、(再" +"び) 有効にできます。" #: ../../library/pdb.rst:493 msgid "Enable the breakpoints specified." @@ -873,11 +872,10 @@ msgstr "" "部で停止するのに対し、 :pdbcmd:`next` は呼び出された関数を (ほぼ) 全速力で実" "行し、現在の関数内の次の行で停止するだけです。)" -#: ../../library/pdb.rst:562 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." -msgstr "引数なしだと、現在の行から 1 行先まで実行します。" +msgstr "引数を省略すると、現在より大きい行番号の行に達するまで実行を続けます。" #: ../../library/pdb.rst:565 msgid "" @@ -973,13 +971,12 @@ msgstr "" "``print()`` も使えますが、これはデバッガーコマンドではありません --- これは " "Python の関数 :func:`print` が実行されます。" -#: ../../library/pdb.rst:629 msgid "" "Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" -":pdbcmd:`p` コマンドに似ていますが、*expression* の値以外は :mod:`pprint` モ" -"ジュールを使用して \"pretty-print\" されます。" +":pdbcmd:`p` コマンドと同様ですが、*expression* の値を :mod:`pprint` モジュー" +"ルで読みやすく整形して表示します。" #: ../../library/pdb.rst:634 msgid "Print the type of *expression*." @@ -989,19 +986,18 @@ msgstr "*expression* の型を表示します。" msgid "Try to get source code of *expression* and display it." msgstr "*expression* のソースコードの取得を試み、可能であれば表示します。" -#: ../../library/pdb.rst:644 msgid "" "Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" -"*expression* の値が変更されていれば表示します。毎回実行は現在のフレームで停止" -"します。" +"現在のフレームで実行が停止するたびに *expression* の値を調べ、変化していれば" +"表示します。" -#: ../../library/pdb.rst:647 msgid "" "Without *expression*, list all display expressions for the current frame." msgstr "" -"*expression* を指定しない場合、現在のフレームのすべての式を表示します。" +"*expression* を指定しない場合、現在のフレームで表示対象として登録されているす" +"べての式を表示します。" #: ../../library/pdb.rst:651 msgid "" diff --git a/library/pickle.po b/library/pickle.po index c2c8d3c22..8f6ebe274 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -153,7 +153,6 @@ msgstr "" "JSON は相互運用可能で Python 以外でも広く使用されていますが、pickle は " "Python 固有です;" -#: ../../library/pickle.rst:88 msgid "" "JSON, by default, can only represent a subset of the Python built-in types, " "and no custom classes; pickle can represent an extremely large number of " @@ -162,10 +161,9 @@ msgid "" "`specific object APIs `);" msgstr "" "JSON は、デフォルトでは Python の組み込み型の一部しか表現することができず、カ" -"スタムクラスに対しても行えません; pickle は極めて多くの Python 組み込み型を表" -"現できます (その多くは賢い Python 内省機構によって自動的に行われます; 複雑な" -"ケースでは :ref:`固有のオブジェクト API ` によって対応できま" -"す)。" +"スタムクラスに対しても行えません; pickle は極めて多くの Python の型を表現でき" +"ます (その多くは賢い Python 内省機構によって自動的に行われます; 複雑なケース" +"では :ref:`固有のオブジェクト API ` によって対応できます)。" #: ../../library/pickle.rst:94 msgid "" @@ -509,17 +507,17 @@ msgstr "" "す。指定されない場合、:data:`DEFAULT_PROTOCOL` が使用されます。負数が与えられ" "た場合、:data:`HIGHEST_PROTOCOL` が使用されます。" -#: ../../library/pickle.rst:299 msgid "" "The *file* argument must have a write() method that accepts a single bytes " "argument. It can thus be an on-disk file opened for binary writing, an :" "class:`io.BytesIO` instance, or any other custom object that meets this " "interface." msgstr "" -"引数 *file* は、1 バイトの引数一つを受け付ける write() メソッドを持たなければ" -"なりません。すなわち、*file* には、バイナリの書き込み用にオープンされたファイ" -"ルオブジェクト、:class:`io.BytesIO` オブジェクト、このインターフェースに適合" -"するその他のカスタムオブジェクトをとることができます。" +"引数 *file* は、単一の ``bytes`` 引数を受け付ける ``write()`` メソッドを持た" +"なければなりません。\n" +"したがって、バイナリ書き込み用にオープンされたディスク上のファイル、:class:" +"`io.BytesIO` インスタンス、またはこのインターフェースに適合するその他のカスタ" +"ムオブジェクトを指定できます。" #: ../../library/pickle.rst:304 msgid "" @@ -749,17 +747,18 @@ msgstr "" "スタンス化されたとき (または :func:`dump` や :func:`dumps` が呼び出されたと" "き) に *buffer_callback* 引数に ``None`` を指定したことに相当します。" -#: ../../library/pickle.rst:428 msgid "" "If *buffers* is not ``None``, it should be an iterable of buffer-enabled " "objects that is consumed each time the pickle stream references an :ref:`out-" "of-band ` buffer view. Such buffers have been given in order to " "the *buffer_callback* of a Pickler object." msgstr "" -"*buffers* が ``None`` でない場合、各イテレーションで :ref:`アウトオブバウン" -"ド (out-of-band) ` のバッファビューを参照する pickle ストリームを" -"消費する、バッファ対応のイテラブルでなければなりません。ここに指定するバッ" -"ファは Pickler オブジェクトの *buffer_callback* に順番に渡されたものです。" +"*buffers* が ``None`` でない場合は、バッファを提供するオブジェクトのイテラブ" +"ルでなければなりません。\n" +"pickle ストリームが :ref:`帯域外 (out-of-band) ` のバッファビュー" +"を参照するたびに、このイテラブルからバッファを 1 つ取得します。\n" +"これらのバッファは、Pickler オブジェクトの *buffer_callback* に渡された順に並" +"べます。" #: ../../library/pickle.rst:438 msgid "" @@ -817,8 +816,8 @@ msgid "" "Raises an :ref:`auditing event ` ``pickle.find_class`` with " "arguments ``module``, ``name``." msgstr "" -"引数 ``modulet``, ``name`` を指定して :ref:`監査イベント ` " -"``pickle.find_class`` を送出します。" +"引数 ``module``, ``name`` を指定して :ref:`監査イベント ` ``pickle." +"find_class`` を送出します。" #: ../../library/pickle.rst:472 msgid "" @@ -896,17 +895,16 @@ msgid "" "tuples, lists, sets, and dictionaries containing only picklable objects;" msgstr "pickle 化可能なオブジェクトからなるタプル、リスト、集合および辞書" -#: ../../library/pickle.rst:514 msgid "" "functions (built-in and user-defined) accessible from the top level of a " "module (using :keyword:`def`, not :keyword:`lambda`);" msgstr "" -"モジュールのトップレベルで定義された関数 (:keyword:`def` で定義されたもののみ" -"で :keyword:`lambda` で定義されたものは含まない)" +"モジュールのトップレベルからアクセスできる関数 (組み込み関数とユーザー定義関" +"数。\n" +":keyword:`lambda` ではなく :keyword:`def` で定義したもの)" -#: ../../library/pickle.rst:517 msgid "classes accessible from the top level of a module;" -msgstr "モジュールのトップレベルで定義されているクラス" +msgstr "モジュールのトップレベルからアクセスできるクラス" #: ../../library/pickle.rst:519 msgid "" @@ -1088,12 +1086,11 @@ msgstr "" ":meth:`__getnewargs_ex__` が定義されていると :meth:`__getnewargs__` は呼び出" "しません。" -#: ../../library/pickle.rst:613 msgid "" "Before Python 3.6, :meth:`__getnewargs__` was called instead of :meth:" "`__getnewargs_ex__` in protocols 2 and 3." msgstr "" -"Python 3.6以前のプロトコル 2 と 3 では、:meth:`__getnewargs_ex__` の代わり" +"Python 3.6 より前のプロトコル 2 と 3 では、:meth:`__getnewargs_ex__` の代わり" "に :meth:`__getnewargs__` が呼び出されていました。" #: ../../library/pickle.rst:620 @@ -1195,7 +1192,6 @@ msgstr "" "トコルの一部です。コピープロトコルは、pickle 化とオブジェクトのコピーに必要" "な、データを取得するための統一されたインターフェースを提供します。 [#]_" -#: ../../library/pickle.rst:680 msgid "" "Although powerful, implementing :meth:`~object.__reduce__` directly in your " "classes is error prone. For this reason, class designers should use the " @@ -1205,11 +1201,12 @@ msgid "" "option or leads to more efficient pickling or both." msgstr "" "強力ですが、クラスに :meth:`~object.__reduce__` メソッドを直接実装することは" -"エラーを起こしやすくなります。この理由のため、クラスの設計者は可能なかぎり高" -"レベルインターフェース (:meth:`~object.__getnewargs_ex__`、:meth:`~object." -"__getstate__` および :meth:`~object.__setstate__`) を使用するべきです。公開は" -"しているものの、:meth:`!__reduce__` の使用は、あくまでオプションとして、より" -"効果的な pickle 化につながる場合、あるいはその両方の場合のみにしてください。" +"エラーを起こしやすくなります。\n" +"この理由のため、クラスの設計者は可能なかぎり高レベルインターフェース (:meth:" +"`~object.__getnewargs_ex__`、:meth:`~object.__getstate__` および :meth:" +"`~object.__setstate__`) を使用するべきです。\n" +"ただし、:meth:`!__reduce__` を使う以外に方法がない場合、使うことで pickle 化" +"が効率的になる場合、またはその両方に当てはまる場合についても説明します。" #: ../../library/pickle.rst:689 msgid "" @@ -1358,7 +1355,6 @@ msgid "" "persistent_load` respectively." msgstr "" -#: ../../library/pickle.rst:774 msgid "" "To pickle objects that have an external persistent ID, the pickler must have " "a custom :meth:`~Pickler.persistent_id` method that takes an object as an " @@ -1368,11 +1364,13 @@ msgid "" "object, along with a marker so that the unpickler will recognize it as a " "persistent ID." msgstr "" -"外部の永続的 ID を持つ pickle オブジェクトの pickler は、引数にオブジェクトを" -"取り、``None`` かオブジェクトの永続的 ID を返すカスタム :meth:`~Pickler." -"persistent_id` メソッドを持たなくてはなりません。``None`` を返す場合、" -"pickler は通常通りマーカーとともにオブジェクトを pickle 化するため、" -"unpickler はそれを永続的 ID として認識します。" +"外部の永続的 ID を持つオブジェクトを pickle 化するには、pickler は、オブジェ" +"クトを引数として取り、``None`` またはそのオブジェクトの永続的 ID を返す、カス" +"タムの :meth:`~Pickler.persistent_id` メソッドを持たなければなりません。\n" +"``None`` が返された場合、pickler はそのオブジェクトを通常どおり pickle 化しま" +"す。\n" +"永続的 ID の文字列が返された場合、pickler は、unpickler がそれを永続的 ID と" +"して認識できるように、マーカーとともにその ID を pickle 化します。" #: ../../library/pickle.rst:781 msgid "" @@ -1646,9 +1644,10 @@ msgid "" "the object's type, or we may want to customize the pickling of functions and " "classes." msgstr "" -":attr:`~Pickler.dispatch_table` は、ときにその柔軟性が十分でないがことありま" -"す。特に、オブジェクトの型以外の別の条件で pickle 化をカスタマイズしたい場合" -"や、関数やクラスを使って pickle 化をカスタマイズしたい場合などです。" +":attr:`~Pickler.dispatch_table` は、ときにその柔軟性が十分でないことありま" +"す。\n" +"特に、オブジェクトの型以外の別の条件で pickle 化をカスタマイズしたい場合や、" +"関数やクラスの pickle 化をカスタマイズしたい場合などです。" #: ../../library/pickle.rst:908 msgid "" @@ -1754,17 +1753,16 @@ msgstr "" msgid "Provider API" msgstr "生産者 API" -#: ../../library/pickle.rst:978 msgid "" "The large data objects to be pickled must implement a :meth:`~object." "__reduce_ex__` method specialized for protocol 5 and higher, which returns " "a :class:`PickleBuffer` instance (instead of e.g. a :class:`bytes` object) " "for any large data." msgstr "" -"pickle 化される大きなサイズのデータオブジェクトは、プロトコル5以上でサポート" -"された :meth:`~object.__reduce_ex__` メソッドを実装しなければなりません。この" -"メソッドは大きなデータに対して (:class:`bytes` オブジェクトなどの代わりに) :" -"class:`PickleBuffer` インスタンスを返します。" +"pickle 化される大きなサイズのデータオブジェクトは、プロトコル 5 以上に対応し" +"た :meth:`~object.__reduce_ex__` メソッドを実装しなければなりません。\n" +"このメソッドは大きなデータに対して (:class:`bytes` オブジェクトなどの代わり" +"に) :class:`PickleBuffer` インスタンスを返します。" #: ../../library/pickle.rst:983 msgid "" @@ -1834,13 +1832,12 @@ msgstr "" msgid "Example" msgstr "使用例" -#: ../../library/pickle.rst:1018 msgid "" "Here is a trivial example where we implement a :class:`bytearray` subclass " "able to participate in out-of-band buffer pickling::" msgstr "" -"以下は、アウトオブバウンドのバッファを使った pickle 処理に関与することができ" -"るサブクラス :class:`bytearray` を実装したささいな例です::" +"以下は、帯域外バッファを使った pickle 化に対応する :class:`bytearray` のサブ" +"クラスを実装する簡単な例です。 ::" #: ../../library/pickle.rst:1021 msgid "" diff --git a/library/pickletools.po b/library/pickletools.po index 27b8d805f..eb30486da 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -125,7 +125,6 @@ msgstr "" msgid "Programmatic interface" msgstr "" -#: ../../library/pickletools.rst:93 msgid "" "Outputs a symbolic disassembly of the pickle to the file-like object *out*, " "defaulting to ``sys.stdout``. *pickle* can be a string or a file-like " @@ -138,19 +137,20 @@ msgid "" "where annotation should start." msgstr "" "pickle の抽象的な逆アセンブリを file-like オブジェクト *out* (デフォルトは " -"``sys.stdout``) に出力します。*pickle* は文字列または file-like オブジェクト" -"です。*memo* は Python の辞書で、pickle のメモとして使われます; これは、" -"pickle 処理を行う 1 つのオブジェクトが、複数の pickle にわたって逆アセンブル" -"を行うために使われます。ストリーム上の ``MARK`` 命令コードが示す後続のレベル" -"は、*indentlevel* 個の空白でインデントされます。*annotate* に非ゼロの値が与え" -"られた場合、出力される各命令コードは短い命令コードに注釈が付けられます。" +"``sys.stdout``) に出力します。\n" +"*pickle* は文字列または file-like オブジェクトです。\n" +"*memo* は Python の辞書で、pickle のメモとして使われます; これは、同じ " +"pickler が作成した複数の pickle を続けて逆アセンブルするために使えます。\n" +"ストリーム上の ``MARK`` 命令コードが示す後続のレベルは、*indentlevel* 個の空" +"白でインデントされます。\n" +"*annotate* に非ゼロの値が与えられた場合、出力される各命令コードに短い説明が注" +"釈として付けられます。\n" "*annotate* の値は、注釈の先頭の位置のヒントとして使われます。" #: ../../library/pickletools.rst:104 msgid "Added the *annotate* parameter." msgstr "*annotate* パラメーターを追加しました。" -#: ../../library/pickletools.rst:109 msgid "" "Provides an :term:`iterator` over all of the opcodes in a pickle, returning " "a sequence of ``(opcode, arg, pos)`` triples. *opcode* is an instance of " @@ -159,11 +159,12 @@ msgid "" "is located. *pickle* can be a string or a file-like object." msgstr "" "pickle 内の全ての opcode を取り出す :term:`イテレータ ` を返しま" -"す。このイテレータは ``(opcode, arg, pos)`` の三つ組みからなる配列を返しま" -"す。 *opcode* は :class:`OpcodeInfo` クラスのインスタンスのクラスです。 " -"*arg* は *opcode* の引数としてデコードされた Python オブジェクトの値です。 " -"*pos* は *opcode* の場所を表す値です。 *pickle* は文字列でもファイル類似オブ" -"ジェクトでもかまいません。" +"す。\n" +"このイテレータは ``(opcode, arg, pos)`` の 3 要素タプルを順に返します。\n" +"*opcode* は :class:`OpcodeInfo` クラスのインスタンスです。\n" +"*arg* は *opcode* の引数としてデコードされた Python オブジェクトの値です。\n" +"*pos* は *opcode* の場所を表す値です。\n" +"*pickle* は文字列でもファイル類似オブジェクトでもかまいません。" #: ../../library/pickletools.rst:117 msgid "" diff --git a/library/pkgutil.po b/library/pkgutil.po index 61a96d318..470c7f1c8 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -76,15 +76,15 @@ msgid "" "they exist on the filesystem (this is a feature)." msgstr "" -#: ../../library/pkgutil.rst:42 msgid "" "If the input path is not a list (as is the case for frozen packages) it is " "returned unchanged. The input path is not modified; an extended copy is " "returned. Items are only appended to the copy at the end." msgstr "" -"入力パスがリストでない場合(フリーズされたパッケージのとき)は何もせずにリター" -"ンします。入力パスが変更されていなければ、アイテムを末尾に追加しただけのコ" -"ピーを返します。" +"入力パスがリストでない場合 (凍結されたパッケージなど) は、そのまま返しま" +"す。\n" +"入力パスは変更せず、拡張したコピーを返します。\n" +"要素の追加はコピーの末尾にのみ行います。" #: ../../library/pkgutil.rst:46 msgid "" diff --git a/library/platform.po b/library/platform.po index 810f375ca..6f902bf84 100644 --- a/library/platform.po +++ b/library/platform.po @@ -139,16 +139,16 @@ msgstr "" "戻り値は機械で処理しやすい形式ではなく、*人間にとって読みやすい* 形式となって" "います。異なったプラットフォームでは異なった戻り値となるようになっています。" -#: ../../library/platform.rst:73 msgid "" "If *aliased* is true, the function will use aliases for various platforms " "that report system names which differ from their common names, for example " "SunOS will be reported as Solaris. The :func:`system_alias` function is " "used to implement this." msgstr "" -"*aliased* が真なら、システムの名称として一般的な名称ではなく、別名を使用して" -"結果を返します。たとえば、SunOS は Solaris となります。この機能は :func:" -"`system_alias` で実装されています。" +"*aliased* が真の場合、報告されるシステム名が一般的な名称と異なるプラット" +"フォームでは、その一般的な名称を返します。\n" +"例えば SunOS は Solaris として報告されます。\n" +"この処理には :func:`system_alias` を使います。" #: ../../library/platform.rst:78 msgid "" @@ -448,11 +448,8 @@ msgstr "" "ンを特定します。この違いは :program:`gcc` でコンパイルされた実行可能ファイル" "でのみ有効だと思われます。" -#: ../../library/platform.rst:275 msgid "The file is read and scanned in chunks of *chunksize* bytes." -msgstr "" -"*chunksize* にはファイルから情報を取得するために読み込むバイト数を指定しま" -"す。" +msgstr "ファイルを *chunksize* バイトずつ読み込み、調べます。" #: ../../library/platform.rst:279 msgid "Linux platforms" diff --git a/library/poplib.po b/library/poplib.po index 1311225d6..8e1c6d364 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -107,16 +107,14 @@ msgstr "" "引数 ``self``, ``host``, ``port`` 付きで :ref:`監査イベント ` " "``poplib.connect`` を送出します。" -#: ../../library/poplib.rst:43 ../../library/poplib.rst:45 -#: ../../library/poplib.rst:65 ../../library/poplib.rst:67 msgid "" "All commands will raise an :ref:`auditing event ` ``poplib." "putline`` with arguments ``self`` and ``line``, where ``line`` is the bytes " "about to be sent to the remote host." msgstr "" "全てのコマンドは引数 ``self`` と ``line`` を指定して :ref:`auditing event " -"` ``poplib.putline`` を送出します。ここで ``line`` はリモートホスト" -"に送信されるバイト数です。" +"` ``poplib.putline`` を送出します。\n" +"ここで ``line`` はリモートホストに送信されるバイト列です。" #: ../../library/poplib.rst:49 ../../library/poplib.rst:79 msgid "" @@ -148,14 +146,12 @@ msgstr "" msgid "*context* parameter added." msgstr "*context* 引数が追加されました。" -#: ../../library/poplib.rst:74 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" -"このクラスは :attr:`ssl.SSLContext.check_hostname` と *Server Name " -"Indication* でホスト名のチェックをサポートしました。(:const:`ssl.HAS_SNI` を" -"参照してください)。" +"このクラスは :attr:`ssl.SSLContext.check_hostname` によるホスト名の検証と、" +"*Server Name Indication* に対応しました (:const:`ssl.HAS_SNI` を参照)。" #: ../../library/poplib.rst:83 msgid "The deprecated *keyfile* and *certfile* parameters have been removed." @@ -217,7 +213,6 @@ msgstr "" msgid "A :class:`POP3` instance has the following methods:" msgstr ":class:`POP3` クラスのインスタンスは以下のメソッドを持ちます:" -#: ../../library/poplib.rst:120 msgid "" "Set the instance's debugging level. This controls the amount of debugging " "output printed. The default, ``0``, produces no debugging output. A value " @@ -226,11 +221,13 @@ msgid "" "debugging output, logging each line sent and received on the control " "connection." msgstr "" -"インスタンスのデバッグレベルを設定します。この設定によってデバッグ時に出力さ" -"れる量を調節します。デフォルトは ``0`` で、何も出力されません。 ``1`` なら、" -"一般的に1つのコマンドあたり1行の適当な量のデバッグ出力を行います。 ``2`` 以" -"上なら、コントロール接続で受信した各行を出力して、最大のデバッグ出力をしま" -"す。" +"インスタンスのデバッグレベルを設定します。\n" +"この設定によってデバッグ時に出力される量を調節します。\n" +"デフォルトは ``0`` で、何も出力されません。\n" +"``1`` なら、一般的に1つのコマンドあたり1行の適当な量のデバッグ出力を行いま" +"す。\n" +"``2`` 以上なら、コントロール接続で送受信した各行を出力して、最大のデバッグ出" +"力をします。" #: ../../library/poplib.rst:129 msgid "Returns the greeting string sent by the POP3 server." @@ -294,16 +291,16 @@ msgstr "" "*which* 番のメッセージ全体を取り出し、そのメッセージに既読フラグを立てます。" "結果は ``(response, ['line', ...], octets)`` という形式で表されます。" -#: ../../library/poplib.rst:181 msgid "" "Flag message number *which* for deletion. On most servers deletions are not " "actually performed until QUIT (the major exception is Eudora QPOP, which " "deliberately violates the RFCs by doing pending deletes on any disconnect)." msgstr "" -"*which* 番のメッセージに削除のためのフラグを立てます。ほとんどのサーバで、" -"QUITコマンドが実行されるまでは実際の削除は行われません(もっとも良く知られた" -"例外は Eudora QPOPで、その配送メカニズムはRFCに違反しており、どんな切断状況で" -"も削除操作を未解決にしています)。" +"*which* 番のメッセージに削除のためのフラグを立てます。\n" +"ほとんどのサーバでは、``QUIT`` コマンドが実行されるまで実際の削除は行われませ" +"ん\n" +"(主な例外は Eudora QPOP で、どのような切断時にも保留中の削除を実行すること" +"で、意図的に RFC に違反しています)。" #: ../../library/poplib.rst:188 msgid "Remove any deletion marks for the mailbox." @@ -319,15 +316,14 @@ msgstr "" "サインオフ: 変更をコミットし、メールボックスをアンロックして、接続を破棄しま" "す。" -#: ../../library/poplib.rst:203 msgid "" "Retrieves the message header plus *howmuch* lines of the message after the " "header of message number *which*. Result is in form ``(response, " "['line', ...], octets)``." msgstr "" -"メッセージヘッダと *howmuch* で指定した行数のメッセージを、 *which* で指定し" -"たメッセージ分取り出します。結果は以下のような形式となります。 ``(response, " -"['line', ...], octets)``." +"*which* 番のメッセージから、ヘッダーとその直後の本文 *howmuch* 行を取得しま" +"す。\n" +"結果は ``(response, ['line', ...], octets)`` という形式です。" #: ../../library/poplib.rst:207 msgid "" @@ -342,16 +338,16 @@ msgstr "" "ん。このメソッドを信用してしまう前に、実際に使用するPOPサーバーでテストをして" "ください。" -#: ../../library/poplib.rst:215 msgid "" "Return message digest (unique id) list. If *which* is specified, result " "contains the unique id for that message in the form ``'response mesgnum " "uid``, otherwise result is list ``(response, ['mesgnum uid', ...], octets)``." msgstr "" -"(ユニークIDによる)メッセージダイジェストのリストを返します。 *which* が設定" -"されている場合、結果はユニークIDを含みます。それは ``'response mesgnum uid`` " -"という形式のメッセージ、または ``(response, ['mesgnum uid', ...], octets)`` " -"という形式のリストとなります。" +"メッセージダイジェスト (一意な ID) のリストを返します。\n" +"*which* を指定した場合、そのメッセージの一意な ID を含む ``'response mesgnum " +"uid`` 形式の結果を返します。\n" +"省略した場合は ``(response, ['mesgnum uid', ...], octets)`` 形式のリストを返" +"します。" #: ../../library/poplib.rst:222 msgid "" @@ -381,14 +377,12 @@ msgstr "" "存在し続けうる) 構造にまとめた :class:`ssl.SSLContext` オブジェクトです。ベス" "トプラクティスについては :ref:`ssl-security` を参照してください。" -#: ../../library/poplib.rst:238 msgid "" "This method supports hostname checking via :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" -"このメソッドは :attr:`ssl.SSLContext.check_hostname` と *Server Name " -"Indication* でホスト名のチェックをサポートしました。(:const:`ssl.HAS_SNI` を" -"参照してください)。" +"このメソッドは :attr:`ssl.SSLContext.check_hostname` によるホスト名の検証と、" +"*Server Name Indication* (:const:`ssl.HAS_SNI` を参照) をサポートしています。" #: ../../library/poplib.rst:245 msgid "" diff --git a/library/posix.po b/library/posix.po index 61d9ed2fe..e4f7589c9 100644 --- a/library/posix.po +++ b/library/posix.po @@ -79,7 +79,6 @@ msgstr "" "ています。このようなファイルは時にラージファイル (:dfn:`large files`) と呼ば" "れます。" -#: ../../library/posix.rst:45 msgid "" "Large file support is enabled in Python when the size of an :c:type:`off_t` " "is larger than a :c:expr:`long` and the :c:expr:`long long` is at least as " @@ -90,10 +89,8 @@ msgstr "" "Python では、 :c:type:`off_t` のサイズが :c:expr:`long` より大きく、かつ :c:" "expr:`long long` が少なくとも :c:type:`off_t` と同じくらい大きなサイズである" "とき、ラージファイルのサポートが有効になります。\n" -"この場合、ファイルのサイズ、オフセットおよび Python の通常整数型の範囲を超え" -"るような値の表現には Python の長整数型が使われます。\n" -"このモードを有効にするのに、 :program:`configure` で Python のコンパイルに特" -"定のコンパイルフラグを必要とするかもしれません。\n" +"このモードを有効にするのに、 ``configure`` で Python のコンパイルに特定のコン" +"パイルフラグを必要とするかもしれません。\n" "例えば、Solaris 2.6 および 2.7 では、以下のようにする必要があります::" #: ../../library/posix.rst:52 diff --git a/library/pprint.po b/library/pprint.po index ff8d62a72..5be45d6cf 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -156,15 +156,14 @@ msgid "" "parameters and their meanings are as described in the documentation above." msgstr "" -#: ../../library/pprint.rst:128 msgid "" "Determine if the formatted representation of *object* is \"readable\", or " "can be used to reconstruct the value using :func:`eval`. This always " "returns ``False`` for recursive objects." msgstr "" -"*object* を書式化して出力できる(\"readable\") か、あるいは :func:`eval` を" -"使って値を再構成できるかを返します。再帰的なオブジェクトに対しては常に " -"``False`` を返します。" +"オブジェクトの整形された表現が「読み込み可能」、つまり :func:`eval` で元の値" +"を再構成できるかどうかを返します。\n" +"再帰的なオブジェクトに対しては常に ``False`` を返します。" #: ../../library/pprint.rst:138 msgid "" @@ -247,7 +246,6 @@ msgstr "" "ソッドをインスタンスに対して使うと、新たに :class:`PrettyPrinter` オブジェク" "トを作る必要がないのでちょっぴり効果的です。" -#: ../../library/pprint.rst:251 msgid "" "Determine if the formatted representation of the object is \"readable,\" or " "can be used to reconstruct the value using :func:`eval`. Note that this " @@ -255,11 +253,11 @@ msgid "" "class:`PrettyPrinter` is set and the object is deeper than allowed, this " "returns ``False``." msgstr "" -"*object* を書式化して出力できる(\"readable\")か、あるいは :func:`eval` を" -"使って値を再構成できるかを返します。これは再帰的なオブジェクトに対して " -"``False`` を返すことに注意して下さい。もし :class:`PrettyPrinter` の *depth* " -"引数が設定されていて、オブジェクトのレベルが設定よりも深かったら、 ``False`` " -"を返します。" +"オブジェクトの整形された表現が「読み込み可能」、つまり :func:`eval` で元の値" +"を再構成できるかどうかを返します。\n" +"これは再帰的なオブジェクトに対して ``False`` を返すことに注意して下さい。\n" +"もし :class:`PrettyPrinter` の *depth* 引数が設定されていて、オブジェクトのレ" +"ベルが設定よりも深かったら、 ``False`` を返します。" #: ../../library/pprint.rst:260 msgid "Determine if the object requires a recursive representation." @@ -275,7 +273,6 @@ msgstr "" "修正するのが可能になっています。デフォルトの実装では、内部で :func:" "`saferepr` を呼び出しています。" -#: ../../library/pprint.rst:269 msgid "" "Returns three values: the formatted version of *object* as a string, a flag " "indicating whether the result is readable, and a flag indicating whether " @@ -292,18 +289,22 @@ msgid "" "the current level; recursive calls should be passed a value less than that " "of the current call." msgstr "" -"次の3つの値を返します。*object* をフォーマット化して文字列にしたもの、その結" -"果が読み込み可能かどうかを示すフラグ、再帰が含まれているかどうかを示すフラ" -"グ。最初の引数は表示するオブジェクトです。 2つめの引数はオブジェクトの :func:" -"`id` をキーとして含むディクショナリで、オブジェクトを含んでいる現在の(直接、" -"間接に *object* のコンテナとして表示に影響を与える)環境です。ディクショナリ " -"*context* の中でどのオブジェクトが表示されたか表示する必要があるなら、3つめの" -"返り値は ``True`` になります。 :meth:`format` メソッドの再帰呼び出しではこの" -"ディクショナリのコンテナに対してさらにエントリを加えます。 3つめの引数 " -"*maxlevels* で再帰呼び出しのレベルを制限します。制限しない場合、 ``0`` になり" -"ます。この引数は再帰呼び出しでそのまま渡されます。 4つめの引数 *level* で現在" -"のレベルを設定します。再帰呼び出しでは、現在の呼び出しより小さい値が渡されま" -"す。" +"次の3つの値を返します。\n" +"*object* をフォーマット化して文字列にしたもの、その結果が読み込み可能かどうか" +"を示すフラグ、再帰が含まれているかどうかを示すフラグ。\n" +"最初の引数は表示するオブジェクトです。\n" +"2つめの引数はオブジェクトの :func:`id` をキーとして含むディクショナリで、オブ" +"ジェクトを含んでいる現在の(直接、間接に *object* のコンテナとして表示に影響" +"を与える)環境です。\n" +"既に *context* に含まれているオブジェクトを表示する必要があるなら、3つめの返" +"り値は ``True`` になります。\n" +":meth:`.format` メソッドの再帰呼び出しではこのディクショナリのコンテナに対し" +"てさらにエントリを加えます。\n" +"3つめの引数 *maxlevels* で再帰呼び出しのレベルを制限します。\n" +"制限しない場合、 ``0`` になります。\n" +"この引数は再帰呼び出しでそのまま渡されます。\n" +"4つめの引数 *level* で現在のレベルを設定します。\n" +"再帰呼び出しでは、現在の呼び出しより小さい値が渡されます。" #: ../../library/pprint.rst:287 msgid "Example" diff --git a/library/profile.po b/library/profile.po index b3fe33f3e..879ed8815 100644 --- a/library/profile.po +++ b/library/profile.po @@ -370,7 +370,6 @@ msgstr "" msgid "Limitations" msgstr "制限事項" -#: ../../library/profile.rst:239 msgid "" "One limitation has to do with accuracy of timing information. There is a " "fundamental problem with deterministic profilers involving accuracy. The " @@ -380,14 +379,15 @@ msgid "" "then the \"error\" will tend to average out. Unfortunately, removing this " "first error induces a second source of error." msgstr "" -"一つの制限はタイミング情報の正確さに関するものです。決定論的プロファイラには" -"正確さに関する根本的問題があります。最も明白な制限は、 (一般に) \"クロック" -"\"は .001 秒の精度しかないということです。これ以上の精度で計測することはでき" -"ません。仮に充分な精度が得られたとしても、\"誤差\"が計測の平均値に影響を及ぼ" -"すことがあります。この最初の誤差を取り除いたとしても、それがまた別の誤差を引" -"き起こす原因となります。" +"一つの制限はタイミング情報の正確さに関するものです。\n" +"決定論的プロファイラには正確さに関する根本的問題があります。\n" +"最も明白な制限は、 (一般に) \"クロック\"は .001 秒の精度しかないということで" +"す。\n" +"これ以上の精度で計測することはできません。\n" +"十分な回数の測定を行えば、「誤差」は平均化される傾向があります。\n" +"この最初の誤差を取り除いたとしても、それがまた別の誤差を引き起こす原因となり" +"ます。" -#: ../../library/profile.rst:247 msgid "" "The second problem is that it \"takes a while\" from when an event is " "dispatched until the profiler's call to get the time actually *gets* the " @@ -400,13 +400,14 @@ msgid "" "clock tick), but it *can* accumulate and become very significant." msgstr "" "もう一つの問題として、イベントを検知してからプロファイラがその時刻を実際に *" -"取得* するまでに \"いくらかの時間がかかる\" ことです。同様に、イベントハンド" -"ラが終了する時にも、時刻を取得して (そしてその値を保存して) から、ユーザコー" -"ドが処理を再開するまでの間に遅延が発生します。結果的に多く呼び出される関数ま" -"たは多数の関数から呼び出される関数の情報にはこの種の誤差が蓄積する傾向にあり" -"ます。このようにして蓄積される誤差は、典型的にはクロックの精度を下回ります (1" -"クロック以下) が、一方でこの時間が累計して非常に大きな値になることも *あり得" -"ます* 。" +"取得* するまでに \"いくらかの時間がかかる\" ことです。\n" +"同様に、イベントハンドラが終了する時にも、時刻を取得して (そしてその値を保存" +"して) から、ユーザコードが処理を再開するまでの間に遅延が発生します。\n" +"結果的に多く呼び出される関数または多数の関数を呼び出す関数の情報にはこの種の" +"誤差が蓄積する傾向にあります。\n" +"このようにして蓄積される誤差は、典型的にはクロックの精度を下回ります (1クロッ" +"ク以下) が、一方でこの時間が累計して非常に大きな値になることも *あり得ます" +"* 。" #: ../../library/profile.rst:257 msgid "" @@ -459,16 +460,15 @@ msgstr "" "Intel Core i5 で macOS を使用、 Python の time.process_time() をタイマとして" "使った場合、値はおよそ 4.04e-6 となります。" -#: ../../library/profile.rst:291 msgid "" "The object of this exercise is to get a fairly consistent result. If your " "computer is *very* fast, or your timer function has poor resolution, you " "might have to pass 100000, or even 1000000, to get consistent results." msgstr "" -"この手順で使用しているオブジェクトはほぼ一定の結果を返します。 *非常に* 早い" -"コンピュータを使う場合、もしくはタイマの性能が貧弱な場合は、一定の結果を得る" -"ために引数に 100000 や 1000000 といった大きな値を指定する必要があるかもしれま" -"せん。" +"この手順の目的は、十分に安定した結果を得ることです。\n" +"*非常に* 早いコンピュータを使う場合、もしくはタイマの分解能が低いな場合は、一" +"定の結果を得るために引数に 100000 や 1000000 といった大きな値を指定する必要が" +"あるかもしれません。" #: ../../library/profile.rst:295 msgid "" diff --git a/library/pty.po b/library/pty.po index 19eefbdd3..1d95f4904 100644 --- a/library/pty.po +++ b/library/pty.po @@ -51,7 +51,6 @@ msgstr "" msgid "The :mod:`!pty` module defines the following functions:" msgstr "" -#: ../../library/pty.rst:26 msgid "" "Fork. Connect the child's controlling terminal to a pseudo-terminal. Return " "value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is " @@ -59,11 +58,12 @@ msgid "" "a file descriptor connected to the child's controlling terminal (and also to " "the child's standard input and output)." msgstr "" -"forkします。子プロセスの制御端末を擬似端末に接続します。返り値は ``(pid, " -"fd)`` です。子プロセスは *pid* として0、*fd* として *invalid* をそれぞれ受け" -"とります。親プロセスは *pid* として子プロセスのPID、*fd* として子プロセスの制" -"御端末 (子プロセスの標準入出力に接続されている)のファイル記述子を受けとりま" -"す。" +"forkします。\n" +"子プロセスの制御端末を擬似端末に接続します。\n" +"返り値は ``(pid, fd)`` です。\n" +"子プロセスでは *pid* は 0 で、*fd* は *無効* です。\n" +"親プロセスは *pid* として子プロセスのPID、*fd* として子プロセスの制御端末 (子" +"プロセスの標準入出力に接続されている)のファイル記述子を受けとります。" #: ../../library/pty.rst:32 msgid "" diff --git a/library/py_compile.po b/library/py_compile.po index 0a9c3b1b6..454f17156 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -37,16 +37,15 @@ msgid "" "file is invoked as a script." msgstr "" -#: ../../library/py_compile.rst:17 msgid "" "Though not often needed, this function can be useful when installing modules " "for shared use, especially if some of the users may not have permission to " "write the byte-code cache files in the directory containing the source code." msgstr "" -"頻繁に必要となるわけではありませんが、共有ライブラリとしてモジュールをインス" -"トールする場合や、特にソースコードのあるディレクトリにバイトコードのキャッ" -"シュファイルを書き込む権限がないユーザがいるときには、この関数は役に立ちま" -"す。" +"頻繁に必要となるわけではありませんが、複数のユーザーが共用するモジュールをイ" +"ンストールする場合、、特にソースコードのあるディレクトリにバイトコードの" +"キャッシュファイルを書き込む権限がないユーザがいるときには、この関数は役に立" +"ちます。" #: ../../library/py_compile.rst:24 msgid "" diff --git a/library/pyexpat.po b/library/pyexpat.po index e6e80cbb7..53525ecba 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -43,14 +43,13 @@ msgid "" "in the XML document." msgstr "" -#: ../../library/pyexpat.rst:35 msgid "" "This module uses the :mod:`pyexpat` module to provide access to the Expat " "parser. Direct use of the :mod:`pyexpat` module is deprecated." msgstr "" "このモジュールでは、Expatパーザへのアクセスを提供するために :mod:`pyexpat` モ" -"ジュールを使用します。 :mod:`pyexpat` モジュールの直接使用は撤廃されていま" -"す。" +"ジュールを使用します。\n" +":mod:`pyexpat` モジュールの直接使用は非推奨です。" #: ../../library/pyexpat.rst:38 msgid "" @@ -284,7 +283,6 @@ msgstr "" "でなければなりません。子のパーザは :attr:`ordered_attributes`, :attr:" "`specified_attributes` が現在のパーザの値に設定されて生成されます。" -#: ../../library/pyexpat.rst:220 msgid "" "Control parsing of parameter entities (including the external DTD subset). " "Possible *flag* values are :const:`XML_PARAM_ENTITY_PARSING_NEVER`, :const:" @@ -292,11 +290,11 @@ msgid "" "`XML_PARAM_ENTITY_PARSING_ALWAYS`. Return true if setting the flag was " "successful." msgstr "" -"パラメータエンティティ (外部DTDサブセットを含む) の解析を制御します。 *flag* " -"の有効な値は、 :const:`XML_PARAM_ENTITY_PARSING_NEVER`, :const:" +"パラメータエンティティ (外部DTDサブセットを含む) の解析を制御します。\n" +"*flag* の有効な値は、 :const:`XML_PARAM_ENTITY_PARSING_NEVER`, :const:" "`XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE`, :const:" -"`XML_PARAM_ENTITY_PARSING_ALWAYS` です。 flag の設定をしたら true を返しま" -"す。" +"`XML_PARAM_ENTITY_PARSING_ALWAYS` です。\n" +"フラグの設定に成功した場合は真を返します。" #: ../../library/pyexpat.rst:228 msgid "" @@ -635,7 +633,6 @@ msgstr "エラーの発生したカラム番号です。" msgid "Line number at which an error occurred." msgstr "エラーの発生した行番号です。" -#: ../../library/pyexpat.rst:496 msgid "" "The following attributes contain values relating to the current parse " "location in an :class:`xmlparser` object. During a callback reporting a " @@ -645,10 +642,11 @@ msgid "" "whether there was an associated callback)." msgstr "" "以下の属性は :class:`xmlparser` オブジェクトがその時パースしている位置に関す" -"る値を保持しています。コールバックがパースイベントを報告している間、これらの" -"値はイベントの生成した文字列の先頭の位置を指し示します。コールバックの外から" -"参照された時には、(対応するコールバックであるかにかかわらず)直前のパースイ" -"ベントの位置を示します。" +"る値を保持しています。\n" +"コールバックがパースイベントを報告している間、これらの値はイベントを発生させ" +"た文字列の先頭の位置を指し示します。\n" +"コールバックの外から参照された時には、対応するコールバックの有無にかかわら" +"ず、最後のパースイベントの直後の位置を示します。" #: ../../library/pyexpat.rst:506 msgid "Current byte index in the parser input." @@ -795,7 +793,6 @@ msgstr "" "置されている要素に対して :attr:`StartElementHandler` が呼び出される前に処理さ" "れます。" -#: ../../library/pyexpat.rst:639 msgid "" "Called when the closing tag is reached for an element that contained a " "namespace declaration. This is called once for each namespace declaration " @@ -804,11 +801,11 @@ msgid "" "namespace declaration's scope. Calls to this handler are made after the " "corresponding :attr:`EndElementHandler` for the end of the element." msgstr "" -"名前空間宣言を含んでいたエレメントの終了タグに到達したときに呼び出されます。" -"このハンドラは、要素に関する名前空間宣言ごとに、 :attr:" -"`StartNamespaceDeclHandler` とは逆の順番で一度だけ呼び出され、各名前空間宣言" -"のスコープが開始されたことを示します。このハンドラは、要素が終了する際、対応" -"する :attr:`EndElementHandler` が呼ばれた後に呼び出されます。" +"名前空間宣言を含む要素の終了タグに達すると呼び出されます。\n" +"その要素の名前空間宣言ごとに 1 回ずつ、各宣言のスコープ開始を知らせた :attr:" +"`StartNamespaceDeclHandler` とは逆順に呼び出されます。\n" +"このハンドラーは、その要素の終了を知らせる :attr:`EndElementHandler` の後に呼" +"び出されます。" #: ../../library/pyexpat.rst:649 msgid "" @@ -889,7 +886,6 @@ msgstr "" "す。 *context* の値は不明瞭なものであり、以下に記述するようにしか使ってはなり" "ません。" -#: ../../library/pyexpat.rst:706 msgid "" "For external entities to be parsed, this handler must be implemented. It is " "responsible for creating the sub-parser using " @@ -899,11 +895,12 @@ msgid "" "`XML_ERROR_EXTERNAL_ENTITY_HANDLING` error, otherwise parsing will continue." msgstr "" "外部エンティティが解析されるようにするには、このハンドラを実装しなければなり" -"ません。このハンドラは、 ``ExternalEntityParserCreate(context)`` を使って適切" -"なコールバックを指定し、子パーザを生成して、エンティティを解析する役割を担い" -"ます。このハンドラは整数を返さなければなりません; ``0`` を返した場合、パーザ" -"は :const:`XML_ERROR_EXTERNAL_ENTITY_HANDLING` エラーを送出します。そうでない" -"場合、解析を継続します。" +"ません。\n" +"このハンドラは、 ``ExternalEntityParserCreate(context)`` で子パーサーを作り、" +"適切なコールバックを設定してからエンティティを解析する役割を担います。\n" +"このハンドラは整数を返さなければなりません; ``0`` を返した場合、パーザは :" +"const:`XML_ERROR_EXTERNAL_ENTITY_HANDLING` エラーを送出します。\n" +"そうでない場合、解析を継続します。" #: ../../library/pyexpat.rst:714 msgid "" @@ -1304,26 +1301,23 @@ msgstr "" "です。このエラーは追加の入力を行なおうとしている場合、もしくはパーサが停止し" "ようとしている場合にも送出されます。" -#: ../../library/pyexpat.rst:1087 msgid "" "An attempt to resume the parser was made when the parser had not been " "suspended." -msgstr "パーサを一時停止しようとしましたが、停止されませんでした。" +msgstr "一時停止していないパーサーを再開しようとしました。" #: ../../library/pyexpat.rst:1092 ../../library/pyexpat.rst:1125 #: ../../library/pyexpat.rst:1130 msgid "This should not be reported to Python applications." msgstr "Pythonアプリケーションには通知されません。" -#: ../../library/pyexpat.rst:1097 msgid "" "The requested operation was made on a parser which was finished parsing " "input, but isn't allowed. This includes attempts to provide additional " "input or to stop the parser." msgstr "" -"要求された操作で、パース対象となる入力が完了したと判断しましたが、入力は受理" -"されませんでした。このエラーは追加の入力を行なおうとしている場合、もしくは" -"パーサが停止しようとしている場合に送出されます。" +"入力の解析が完了したパーサーに対して、許可されない操作を要求しました。\n" +"追加の入力を渡す操作や、パーサーを停止する操作などが該当します。" #: ../../library/pyexpat.rst:1107 msgid "" diff --git a/library/queue.po b/library/queue.po index f82be1e11..4ade17096 100644 --- a/library/queue.po +++ b/library/queue.po @@ -322,12 +322,12 @@ msgstr "" "`put` された全てのitemに対して :meth:`task_done` が呼び出されたことを意味しま" "す) 時に復帰します。" -#: ../../library/queue.rst:192 msgid "" "Raises a :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "" -"キューにある要素より多く呼び出された場合 :exc:`ValueError` が発生します。" +"キューに追加された要素の総数を超えて呼び出すと :exc:`ValueError` を送出しま" +"す。" #: ../../library/queue.rst:198 msgid "Blocks until all items in the queue have been gotten and processed." diff --git a/library/random.po b/library/random.po index 7d360cf71..3bec40c20 100644 --- a/library/random.po +++ b/library/random.po @@ -38,16 +38,16 @@ msgid "" "distributions." msgstr "このモジュールでは様々な分布をもつ擬似乱数生成器を実装しています。" -#: ../../library/random.rst:14 msgid "" "For integers, there is uniform selection from a range. For sequences, there " "is uniform selection of a random element, a function to generate a random " "permutation of a list in-place, and a function for random sampling without " "replacement." msgstr "" -"整数用に、ある範囲からの一様な選択があります。シーケンス用には、シーケンスか" -"らのランダムな要素の一様な選択、リストのランダムな置換をインプレースに生成す" -"る関数、順列を置換せずにランダムサンプリングする関数があります。" +"整数用に、ある範囲からの一様な選択があります。\n" +"シーケンス用には、シーケンスからのランダムな要素の一様な選択、リストのランダ" +"ムな置換をインプレースに生成する関数、選んだ要素を母集団に戻さずにランダムサ" +"ンプリングする関数があります。" #: ../../library/random.rst:19 msgid "" @@ -288,17 +288,17 @@ msgstr "" "``a <= N <= b`` であるようなランダムな整数 *N* を返します。``randrange(a, " "b+1)`` のエイリアスです。" -#: ../../library/random.rst:158 msgid "" "Returns a non-negative Python integer with *k* random bits. This method is " "supplied with the Mersenne Twister generator and some other generators may " "also provide it as an optional part of the API. When available, :meth:" "`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges." msgstr "" -"*k* 桁の乱数ビットを持つ Python の整数を生成し、返します。このメソッドはメル" -"センヌツイスタ生成器で提供されており、その他の乱数生成器でもオプションの API " -"として提供されている場合があります。:meth:`getrandbits` が使用可能な場合、:" -"meth:`randrange` は任意の範囲の乱数を生成できるようになります。" +"*k* 桁の乱数ビットを持つ Python の非負整数を生成し、返します。\n" +"このメソッドはメルセンヌツイスタ生成器で提供されており、その他の乱数生成器で" +"もオプションの API として提供されている場合があります。\n" +":meth:`getrandbits` が使用可能な場合、:meth:`randrange` は任意の範囲の乱数を" +"生成できるようになります。" #: ../../library/random.rst:164 msgid "This method now accepts zero for *k*." @@ -353,7 +353,6 @@ msgstr "" "と同じでなければなりません。*weights* と *cum_weights* を同時に与えると :exc:" "`TypeError` が送出されます。" -#: ../../library/random.rst:195 msgid "" "The *weights* or *cum_weights* can use any numeric type that interoperates " "with the :class:`float` values returned by :func:`random` (that includes " @@ -361,10 +360,11 @@ msgid "" "to be non-negative and finite. A :exc:`ValueError` is raised if all weights " "are zero." msgstr "" -"*weights* や *cum_weights* には :func:`random` が返す :class:`float` 値と相互" -"に変換できるような、任意の数値型を使用できます (int、float、fraction を含みま" -"すが、decimal は除きます)。重みには非負で有限の値を指定することが規定されま" -"す。全ての重みが 0 の場合、例外 :exc:`ValueError` が送出されます。" +"*weights* や *cum_weights* には、:func:`random` が返す :class:`float` 値と組" +"み合わせて演算できる任意の数値型を使用できます (整数、浮動小数点数、有理数は" +"含みますが、十進数は除きます)。\n" +"重みは非負かつ有限であることが前提です。\n" +"すべての重みが 0 の場合、:exc:`ValueError` が送出されます。" #: ../../library/random.rst:201 msgid "" @@ -416,13 +416,13 @@ msgstr "" msgid "Removed the optional parameter *random*." msgstr "オプション引数 *random* が削除されました。" -#: ../../library/random.rst:233 msgid "" "Return a *k* length list of unique elements chosen from the population " "sequence. Used for random sampling without replacement." msgstr "" -"母集団のシーケンスから選ばれた長さ *k* の一意な要素からなるリストを返します。" -"値の置換を行わないランダムサンプリングに用いられます。" +"母集団のシーケンスから選ばれた長さ *k* の一意な要素からなるリストを返しま" +"す。\n" +"選んだ要素を母集団に戻さない非復元抽出に用いられます。" #: ../../library/random.rst:236 msgid "" @@ -738,7 +738,6 @@ msgid "" "randbytes` behaviour of :class:`!Random` instances." msgstr "" -#: ../../library/random.rst:458 msgid "" "Class that uses the :func:`os.urandom` function for generating random " "numbers from sources provided by the operating system. Not available on all " @@ -748,10 +747,11 @@ msgid "" "`NotImplementedError` if called." msgstr "" "オペレーティングシステムの提供する発生源によって乱数を生成する :func:`os." -"urandom` 関数を使うクラスです。すべてのシステムで使えるメソッドではありませ" -"ん。ソフトウェアの状態に依存してはいけませんし、一連の操作は再現不能です。" -"従って、 :meth:`seed` メソッドは何の影響も及ぼさず、無視されます。 :meth:" -"`getstate` と :meth:`setstate` メソッドが呼び出されると、例外 :exc:" +"urandom` 関数を使うクラスです。\n" +"すべてのシステムで使えるメソッドではありません。\n" +"ソフトウェアの状態に依存せず、生成される乱数列は再現できません。\n" +"従って、 :meth:`seed` メソッドは何の影響も及ぼさず、無視されます。\n" +":meth:`getstate` と :meth:`setstate` メソッドが呼び出されると、例外 :exc:" "`NotImplementedError` が送出されます。" #: ../../library/random.rst:467 diff --git a/library/re.po b/library/re.po index 2c0828b36..66a645913 100644 --- a/library/re.po +++ b/library/re.po @@ -862,7 +862,6 @@ msgstr "" msgid "``(?<=...)``" msgstr "``(?<=...)``" -#: ../../library/re.rst:471 msgid "" "Matches if the current position in the string is preceded by a match for " "``...`` that ends at the current position. This is called a :dfn:`positive " @@ -876,14 +875,16 @@ msgid "" "func:`match` function:" msgstr "" "その文字列における現在位置の前に、現在位置で終わる ``...`` とのマッチがあれ" -"ば、マッチします。これは :dfn:`後読みアサーション` と呼ばれます。``(?" -"<=abc)def`` は、後読みは 3 文字をバックアップし、含まれているパターンがマッチ" -"するか検査するので ``'abcdef'`` にマッチを見つけます。含まれるパターンは、固" -"定長の文字列にのみマッチしなければなりません。すなわち、 ``abc`` や ``a|b`` " -"は許されますが、``a*`` や ``a{3,4}`` は許されません。肯定後読みアサーションで" -"始まるパターンは、検索される文字列の先頭とは決してマッチしないことに注意して" -"下さい。:func:`match` 関数ではなく :func:`search` 関数を使う方が望ましいで" -"しょう:" +"ば、マッチします。\n" +"これは :dfn:`後読みアサーション` と呼ばれます。\n" +"``(?<=abc)def`` は、後読みは 3 文字分戻り、含まれているパターンがマッチするか" +"検査するので ``'abcdef'`` にマッチを見つけます。\n" +"含まれるパターンは、固定長の文字列にのみマッチしなければなりません。\n" +"すなわち、 ``abc`` や ``a|b`` は許されますが、``a*`` や ``a{3,4}`` は許されま" +"せん。\n" +"肯定後読みアサーションで始まるパターンは、検索される文字列の先頭とは決して" +"マッチしないことに注意して下さい。\n" +":func:`match` 関数ではなく :func:`search` 関数を使う方が望ましいでしょう:" #: ../../library/re.rst:486 msgid "This example looks for a word following a hyphen:" @@ -935,16 +936,16 @@ msgstr "" "ターンではグループの *名前* にASCIIの範囲(``b'\\x00'``-``b'\\x7f'``)のバイト" "のみを含めることができます。" -#: ../../library/re.rst:524 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " "then the resulting RE will match the second character. For example, ``\\$`` " "matches the character ``'$'``." msgstr "" -"特殊シーケンスは ``'\\'`` と以下のリストの文字から構成されます。通常文字が " -"ASCII 数字でも ASCII 文字でもなければ、結果の正規表現は 2 番目の文字にマッチ" -"します。例えば、``\\$`` は文字 ``'$'`` にマッチします。" +"特殊シーケンスは ``'\\'`` と以下のリストの文字から構成されます。\n" +"通常文字が ASCII 数字でも ASCII 英字でもなければ、結果の正規表現は 2 番目の文" +"字にマッチします。\n" +"例えば、``\\$`` は文字 ``'$'`` にマッチします。" #: ../../library/re.rst:531 msgid "``\\number``" @@ -1221,8 +1222,10 @@ msgid "" "of ASCII letters are reserved for future use and treated as errors." msgstr "" "``'\\u'``、``'\\U'`` および ``'\\N'`` エスケープシーケンスは、Unicode (str)パ" -"ターン内でのみ認識されます。バイト列ではエラーとなります。ASCII 文字のエス" -"ケープで未知のものは将来使うために予約されていて、エラーとして扱われます。" +"ターン内でのみ認識されます。\n" +"バイト列ではエラーとなります。\n" +"ASCII 英字のエスケープで未知のものは将来使うために予約されていて、エラーとし" +"て扱われます。" #: ../../library/re.rst:703 msgid "" @@ -1240,19 +1243,18 @@ msgstr "" msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "``'\\u'`` と ``'\\U'`` エスケープシーケンスが追加されました。" -#: ../../library/re.rst:711 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." -msgstr "``'\\'`` と ASCII 文字からなる未知のエスケープはエラーになります。" +msgstr "``'\\'`` と ASCII 英字からなる未知のエスケープはエラーになります。" -#: ../../library/re.rst:714 msgid "" "The :samp:`'\\\\N\\\\{{name}\\\\}'` escape sequence has been added. As in " "string literals, it expands to the named Unicode character (e.g. ``'\\N{EM " "DASH}'``)." msgstr "" -":samp:`'\\\\N\\\\{{name}\\\\}'` エスケープシーケンスが追加されました。文字列" -"リテラルでは、同名のUnicode 文字に展開されます。(``'\\N{EM DASH}'`` など)" +":samp:`'\\\\N\\\\{{name}\\\\}'` エスケープシーケンスが追加されました。\n" +"文字列リテラルと同様に、指定した名前の Unicode 文字に展開されます。\n" +"(``'\\N{EM DASH}'`` など)" #: ../../library/re.rst:722 msgid "Module contents" @@ -1639,14 +1641,14 @@ msgid "" "['0', '3', '9']" msgstr "" -#: ../../library/re.rst:1001 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" "セパレータ中にキャプチャグループがあり、それが文字列の先頭にマッチするなら、" -"結果は空文字列で始まります。同じことが文字列の末尾にも言えます。" +"結果は空文字列で始まります。\n" +"同じことが文字列の末尾にも言えます。 ::" #: ../../library/re.rst:1005 msgid "" @@ -1728,7 +1730,6 @@ msgstr "" "*string* は左から右へ走査され、マッチは見つかった順で返されます。空マッチは結" "果に含まれます。" -#: ../../library/re.rst:1082 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1749,7 +1750,7 @@ msgstr "" "す。\n" "``\\n`` は 1 つの改行文字に変換され、 ``\\r`` はキャリッジリターンに変換され" "る、などです。\n" -"ASCII 文字のエスケープで未知のものは将来使うために予約されていて、エラーとし" +"ASCII 英字のエスケープで未知のものは将来使うために予約されていて、エラーとし" "て扱われます。\n" "それ以外の ``\\&`` のような未知のエスケープは残されます。\n" "``\\6`` のような後方参照は、パターンのグループ 6 がマッチした部分文字列で置換" @@ -1764,15 +1765,15 @@ msgid "" "'static PyObject*\\npy_myfunc(void)\\n{'" msgstr "" -#: ../../library/re.rst:1098 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :class:`~re.Match` argument, and " "returns the replacement string. For example::" msgstr "" "もし *repl* が関数であれば、重複しない *pattern* が発生するたびにその関数が呼" -"ばれます。この関数は一つの :class:`~re.Match` 引数を取り、置換文字列を返しま" -"す。例えば:" +"ばれます。\n" +"この関数は一つの :class:`~re.Match` 引数を取り、置換文字列を返します。\n" +"例えば次のように使います。 ::" #: ../../library/re.rst:1102 msgid "" @@ -1830,12 +1831,11 @@ msgstr "" msgid "Unmatched groups are replaced with an empty string." msgstr "マッチしなかったグループは空文字列に置き換えられます。" -#: ../../library/re.rst:1144 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -"*pattern* 中に ``'\\'`` と ASCII 文字からなる未知のエスケープがあると、エラー" +"*pattern* 中に ``'\\'`` と ASCII 英字からなる未知のエスケープがあると、エラー" "になります。" #: ../../library/re.rst:1148 @@ -1858,22 +1858,21 @@ msgid "" "only_parameter>`." msgstr "" -#: ../../library/re.rst:1166 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -":func:`sub` と同じ操作を行いますが、タプル ``(new_string、 " +":func:`sub` と同じ操作を行いますが、タプル ``(new_string, " "number_of_subs_made)`` を返します。" -#: ../../library/re.rst:1176 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -"*pattern* 中の特殊文字をエスケープします。これは正規表現メタ文字を含みうる任" -"意のリテラル文字列にマッチしたい時に便利です。" +"*pattern* 中の特殊文字をエスケープします。\n" +"これは正規表現メタ文字を含みうる任意のリテラル文字列にマッチしたい時に便利で" +"す。 ::" #: ../../library/re.rst:1180 msgid "" @@ -2059,13 +2058,12 @@ msgid "" "beginning of the string and not at the beginning of each line." msgstr "" -#: ../../library/re.rst:1304 ../../library/re.rst:1339 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" "オプションの *pos* および *endpos* 引数は :meth:`~Pattern.search` メソッドの" -"ものと同じ意味です。" +"ものと同じ意味です。 ::" #: ../../library/re.rst:1307 msgid "" @@ -2195,15 +2193,14 @@ msgstr "" msgid "Match objects" msgstr "" -#: ../../library/re.rst:1414 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -"マッチオブジェクトのブール値は常に ``True`` です。 :meth:`~Pattern.match` お" -"よび :meth:`~Pattern.search` はマッチがないとき ``None`` を返すので、マッチが" -"あるか単純な ``if`` 文で判定できます。" +"マッチオブジェクトのブール値は常に ``True`` です。\n" +":meth:`~Pattern.match` および :meth:`~Pattern.search` はマッチがないとき " +"``None`` を返すので、マッチがあるか単純な ``if`` 文で判定できます。 ::" #: ../../library/re.rst:1419 msgid "" @@ -2370,15 +2367,15 @@ msgid "" "('24', '1632')" msgstr "" -#: ../../library/re.rst:1533 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -"少数位およびその後の全てをオプションにすると、全てのグループがマッチに関係す" -"るとは限りません。そういったグループは *default* 引数が与えられない限りデフォ" -"ルトで ``None`` になります。" +"小数点およびその後の全てをオプションにすると、全てのグループがマッチに関係す" +"るとは限りません。\n" +"そういったグループは *default* 引数が与えられない限りデフォルトで ``None`` に" +"なります。 ::" #: ../../library/re.rst:1537 msgid "" diff --git a/library/resource.po b/library/resource.po index 1f1c7ceb5..2e5ad32d5 100644 --- a/library/resource.po +++ b/library/resource.po @@ -669,13 +669,12 @@ msgstr "" ":func:`getrusage` に渡すと呼び出し中のプロセスが消費しているリソースを要求し" "ます。そのプロセスの全スレッドが使用するリソースの合計です。" -#: ../../library/resource.rst:425 msgid "" "Pass to :func:`getrusage` to request resources consumed by child processes " "of the calling process which have been terminated and waited for." msgstr "" -"呼び出し元のプロセスの子プロセスが消費するリソースを要求するために、 :func:" -"`getrusage` に渡して終了させ、待機させることができます。" +":func:`getrusage` に渡すと、呼び出し元プロセスの子プロセスのうち、終了して " +"wait による回収も済んだものが消費したリソースを取得できます。" #: ../../library/resource.rst:431 msgid "" diff --git a/library/sched.po b/library/sched.po index 442243470..752e7f06c 100644 --- a/library/sched.po +++ b/library/sched.po @@ -36,7 +36,6 @@ msgid "" "event scheduler:" msgstr "" -#: ../../library/sched.rst:18 msgid "" "The :class:`scheduler` class defines a generic interface to scheduling " "events. It needs two functions to actually deal with the \"outside world\" " @@ -48,14 +47,15 @@ msgid "" "to run in multi-threaded applications." msgstr "" ":class:`scheduler` クラスはイベントをスケジュールするための一般的なインター" -"フェースを定義します。それは \"外の世界\" を実際に扱うための2つの関数を必要と" -"します --- *timefunc* は引数なしで呼ばれて 1 つの数値を返す callable オブジェ" -"クトでなければなりません (戻り値は任意の単位で「時間」を表します)。 " +"フェースを定義します。\n" +"それは \"外の世界\" を実際に扱うための2つの関数を必要とします --- *timefunc* " +"は引数なしで呼ばれて 1 つの数値を返す callable オブジェクトでなければなりませ" +"ん (戻り値は任意の単位で「時間」を表します)。\n" "*delayfunc* は 1 つの引数を持つ callable オブジェクトでなければならず、その時" -"間だけ遅延する必要があります (引数は *timefunc* の出力と互換)。 *delayfunc* " -"は、各々のイベントが実行された後に引数 ``0`` で呼ばれることがあります。これ" -"は、マルチスレッドアプリケーションの中で他のスレッドが実行する機会を与えるた" -"めです。" +"間だけ遅延する必要があります (引数は *timefunc* の出力と互換)。\n" +"*delayfunc* は、各々のイベントが実行された後に引数 ``0`` でも呼ばれます。\n" +"これは、マルチスレッドアプリケーションの中で他のスレッドが実行する機会を与え" +"るためです。" #: ../../library/sched.rst:27 msgid "*timefunc* and *delayfunc* parameters are optional." @@ -152,22 +152,22 @@ msgstr "*argument* 引数が任意になりました。" msgid "*kwargs* parameter was added." msgstr "*kwargs* 引数が追加されました。" -#: ../../library/sched.rst:93 msgid "" "Schedule an event for *delay* more time units. Other than the relative time, " "the other arguments, the effect and the return value are the same as those " "for :meth:`enterabs`." msgstr "" -"時間単位以上の *delay* でイベントをスケジュールします。相対的時間以外の、引" -"数、効果、戻り値は、 :meth:`enterabs` に対するものと同じです。" +"現在から *delay* 時間単位後にイベントをスケジュールします。\n" +"時刻を相対値で指定する点を除き、引数、動作、戻り値は :meth:`enterabs` と同じ" +"です。" -#: ../../library/sched.rst:105 msgid "" "Remove the event from the queue. If *event* is not an event currently in the " "queue, this method will raise a :exc:`ValueError`." msgstr "" -"キューからイベントを消去します。もし *event* がキューにある現在のイベントでな" -"いならば、このメソッドは :exc:`ValueError` を送出します。" +"キューからイベントを消去します。\n" +"もし *event* が現在キューに入っているイベントでないならば、このメソッドは :" +"exc:`ValueError` を送出します。" #: ../../library/sched.rst:111 msgid "Return ``True`` if the event queue is empty." @@ -193,28 +193,27 @@ msgid "" "the queue is empty, returns ``None``." msgstr "" -#: ../../library/sched.rst:126 msgid "" "Either *action* or *delayfunc* can raise an exception. In either case, the " "scheduler will maintain a consistent state and propagate the exception. If " "an exception is raised by *action*, the event will not be attempted in " "future calls to :meth:`run`." msgstr "" -"*action* あるいは *delayfunc* は例外を投げることができます。いずれの場合も、" -"スケジューラは一貫した状態を維持し、例外を伝播するでしょう。例外が *action* " -"によって投げられる場合、イベントは :meth:`run` への呼出しを未来に行なわないで" -"しょう。" +"*action* または *delayfunc* が例外を送出することがあります。\n" +"どちらの場合もスケジューラーは一貫した状態を保ち、例外を伝播します。\n" +"*action* が例外を送出した場合、その後 :meth:`run` を呼び出しても、そのイベン" +"トを再試行しません。" -#: ../../library/sched.rst:131 msgid "" "If a sequence of events takes longer to run than the time available before " "the next event, the scheduler will simply fall behind. No events will be " "dropped; the calling code is responsible for canceling events which are no " "longer pertinent." msgstr "" -"イベントのシーケンスが、次イベントの前に、利用可能時間より実行時間が長いと、" -"スケジューラは単に遅れることになるでしょう。イベントが落ちることはありませ" -"ん; 呼出しコードはもはや適切でないキャンセルイベントに対して責任があります。" +"一連のイベントの実行時間が次のイベントまでの時間を超えると、スケジューラーの" +"実行が遅れます。\n" +"イベントを破棄することはありません。\n" +"不要になったイベントのキャンセルは、呼び出し側のコードで行う必要があります。" #: ../../library/sched.rst:136 msgid "*blocking* parameter was added." diff --git a/library/secrets.po b/library/secrets.po index 66bdd88a5..670402600 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -231,13 +231,12 @@ msgstr "" "でパスワードを保存 <257>` してはいけません。パスワードは暗号学的に強い一方向 " "(非可逆) ハッシュ関数を用いてソルトしハッシュしなければなりません。" -#: ../../library/secrets.rst:168 msgid "" "Generate a ten-character alphanumeric password with at least one lowercase " "character, at least one uppercase character, and at least three digits:" msgstr "" -"アルファべットと数字からなり、小文字を少なくとも1つと数字を少なくとも3つ含" -"む、10文字のパスワードを生成するには:" +"小文字を少なくとも1つ、大文字を少なくとも1つ、数字を少なくとも3つ含む、英数字" +"10文字のパスワードを生成する例です。 ::" #: ../../library/secrets.rst:172 msgid "" diff --git a/library/select.po b/library/select.po index 90d783bb6..527a226b5 100644 --- a/library/select.po +++ b/library/select.po @@ -125,13 +125,12 @@ msgid "" "raised." msgstr "" -#: ../../library/select.rst:74 msgid "" "See the :ref:`epoll-objects` section below for the methods supported by " "epolling objects." msgstr "" -"エッジポーリングオブジェクトが提供しているメソッドについては :ref:`epoll-" -"objects` 節を参照してください。" +"epoll オブジェクトが提供するメソッドについては、後述の :ref:`epoll-objects` " +"節を参照してください。" #: ../../library/select.rst:77 msgid "" @@ -369,7 +368,6 @@ msgid "" "ignored." msgstr "登録されていないファイル記述子の削除を試みるのは安全に無視されます。" -#: ../../library/select.rst:275 msgid "" "Polls the set of registered file descriptors, and returns a possibly empty " "list containing ``(fd, event)`` 2-tuples for the descriptors that have " @@ -384,15 +382,19 @@ msgid "" msgstr "" "登録されたファイル記述子に対してポーリングを行い、報告すべき I/O イベントまた" "はエラーの発生したファイル記述子毎に 2 要素のタプル ``(fd, event)`` からなる" -"リストを返します。リストは空になることもあります。 *fd* はファイル記述子で、 " -"*event* は該当するファイル記述子について報告されたイベントを表すビットマスク" -"です --- 例えば :const:`POLLIN` は入力待ちを示し、 :const:`POLLOUT` はファイ" -"ル記述子に対する書き込みが可能を示す、などです。空のリストは呼び出しがタイム" -"アウトしたか、報告すべきイベントがどのファイル記述子でも発生しなかったことを" -"示します。 *timeout* が与えられた場合、処理を戻すまで待機する時間の長さをミリ" -"秒単位で指定します。 *timeout* が省略されたり、 -1 であったり、あるいは :" -"const:`None` の場合、そのポーリングオブジェクトが監視している何らかのイベント" -"が発生するまでブロックします。" +"リストを返します。\n" +"リストは空になることもあります。\n" +"*fd* はファイル記述子で、 *event* は該当するファイル記述子について報告された" +"イベントを表すビットマスクです --- 例えば :const:`POLLIN` は入力待ちを示" +"し、 :const:`POLLOUT` はファイル記述子に対する書き込みが可能を示す、などで" +"す。\n" +"空のリストは報告すべきイベントがどのファイル記述子でも発生しないまま、呼び出" +"しがタイムアウトしたことを示します。\n" +"*timeout* が与えられた場合、処理を戻すまで待機する時間の長さをミリ秒単位で指" +"定します。\n" +"*timeout* が省略されたり、 -1 であったり、あるいは :const:`None` の場合、その" +"ポーリングオブジェクトが監視している何らかのイベントが発生するまでブロックし" +"ます。" #: ../../library/select.rst:299 msgid "Edge and level trigger polling (epoll) objects" @@ -713,7 +715,6 @@ msgstr "" "登録されていないファイル記述子を登録解除しようとすると :exc:`KeyError` 例外が" "送出されます。" -#: ../../library/select.rst:477 msgid "" "Polls the set of registered file descriptors, and returns a possibly empty " "list containing ``(fd, event)`` 2-tuples for the descriptors that have " @@ -728,15 +729,19 @@ msgid "" msgstr "" "登録されたファイル記述子に対してポーリングを行い、報告すべき I/O イベントまた" "はエラーの発生したファイル記述子毎に 2 要素のタプル ``(fd, event)`` からなる" -"リストを返します。リストは空になることもあります。 *fd* はファイル記述子で、 " -"*event* は該当するファイル記述子について報告されたイベントを表すビットマスク" -"です --- 例えば :const:`POLLIN` は入力待ちを示し、 :const:`POLLOUT` はファイ" -"ル記述子に対する書き込みが可能を示す、などです。空のリストは呼び出しがタイム" -"アウトしたか、報告すべきイベントがどのファイル記述子でも発生しなかったことを" -"示します。 *timeout* が与えられた場合、処理を戻すまで待機する時間の長さをミリ" -"秒単位で指定します。 *timeout* が省略されたり、負の値であったり、あるいは :" -"const:`None` の場合、そのポーリングオブジェクトが監視している何らかのイベント" -"が発生するまでブロックします。" +"リストを返します。\n" +"リストは空になることもあります。\n" +"*fd* はファイル記述子で、 *event* は該当するファイル記述子について報告された" +"イベントを表すビットマスクです --- 例えば :const:`POLLIN` は入力待ちを示" +"し、 :const:`POLLOUT` はファイル記述子に対する書き込みが可能を示す、などで" +"す。\n" +"空のリストは報告すべきイベントがどのファイル記述子でも発生しないまま、呼び出" +"しがタイムアウトしたことを示します。\n" +"*timeout* が与えられた場合、処理を戻すまで待機する時間の長さをミリ秒単位で指" +"定します。\n" +"*timeout* が省略されたり、負の値であったり、あるいは :const:`None` の場合、そ" +"のポーリングオブジェクトが監視している何らかのイベントが発生するまでブロック" +"します。" #: ../../library/select.rst:494 msgid "" diff --git a/library/selectors.po b/library/selectors.po index bc191178a..a07b890a8 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -142,17 +142,16 @@ msgstr "読み込み可能" msgid "Available for write" msgstr "書き込み可能" -#: ../../library/selectors.rst:71 msgid "" "A :class:`SelectorKey` is a :class:`~collections.namedtuple` used to " "associate a file object to its underlying file descriptor, selected event " "mask and attached data. It is returned by several :class:`BaseSelector` " "methods." msgstr "" -":class:`SelectorKey` はそれの下層のファイルディスクリプタ、選択したイベントマ" -"スク、および付属データへのファイルオブジェクトの関連付けに使用される :class:" -"`~collections.namedtuple` です。いくつかの :class:`BaseSelector` メソッドを返" -"します。" +":class:`SelectorKey` は、ファイルオブジェクトを、そのファイル記述子、選択した" +"イベントマスク、付随するデータに関連付ける :class:`~collections.namedtuple` " +"です。\n" +":class:`BaseSelector` のいくつかのメソッドが返す値です。" #: ../../library/selectors.rst:78 msgid "File object registered." @@ -175,7 +174,6 @@ msgstr "" "です。例えば、これはクライアントごとのセッション ID を格納するために使用でき" "ます。" -#: ../../library/selectors.rst:96 msgid "" "A :class:`BaseSelector` is used to wait for I/O event readiness on multiple " "file objects. It supports file stream registration, unregistration, and a " @@ -187,47 +185,46 @@ msgid "" "implementations support the :term:`context manager` protocol." msgstr "" ":class:`BaseSelector` は複数のファイルオブジェクトの I/O イベントの準備状況の" -"待機に使用されます。これはファイルストリームを登録、登録解除、およびこれらの" -"ストリームでの I/O イベントを待機 (オプションでタイムアウト) するメソッドをサ" -"ポートします。これは抽象基底クラスであるため、インスタンスを作成できません。" -"使用する実装を明示的に指定したい、そしてプラットフォームがそれをサポートして" -"いる場合は、代わりに :class:`DefaultSelector` を使用するか、:class:" -"`SelectSelector` や :class:`KqueueSelector` などの一つを使用します。:class:" -"`BaseSelector` とその具象実装は :term:`コンテキストマネージャー ` プロトコルをサポートしています。" +"待機に使用されます。\n" +"これはファイルストリームを登録、登録解除、およびこれらのストリームでの I/O イ" +"ベントを待機 (オプションでタイムアウト) するメソッドをサポートします。\n" +"これは抽象基底クラスであるため、インスタンスを作成できません。\n" +"代わりに :class:`DefaultSelector` を使用してください。\n" +"特定の実装を明示的に使いたい場合は、そのプラットフォームが対応していれば :" +"class:`SelectSelector` や :class:`KqueueSelector` などを使用できます。\n" +":class:`BaseSelector` とその具象実装は :term:`コンテキストマネージャー " +"` プロトコルをサポートしています。" #: ../../library/selectors.rst:109 msgid "Register a file object for selection, monitoring it for I/O events." msgstr "I/O イベントを監視するファイルオブジェクトをセレクションに登録します。" -#: ../../library/selectors.rst:111 msgid "" "*fileobj* is the file object to monitor. It may either be an integer file " "descriptor or an object with a ``fileno()`` method. *events* is a bitwise " "mask of events to monitor. *data* is an opaque object." msgstr "" -"*fileobj* は監視するファイルオブジェクトです。これは整数のファイル記述子か、" -"``fileno()`` メソッドを持つオブジェクトのどちらかになります。*events* は監視" -"するイベントのビット幅マスクになります。*data* は不透明型 (Opaque) オブジェク" -"トです。" +"*fileobj* は監視するファイルオブジェクトです。\n" +"これは整数のファイル記述子か、``fileno()`` メソッドを持つオブジェクトのどちら" +"かになります。\n" +"*events* は監視するイベントのビットマスクになります。\n" +"*data* は不透明型 (Opaque) オブジェクトです。" -#: ../../library/selectors.rst:116 msgid "" "This returns a new :class:`SelectorKey` instance, or raises a :exc:" "`ValueError` in case of invalid event mask or file descriptor, or :exc:" "`KeyError` if the file object is already registered." msgstr "" -"これは新しい :class:`SelectorKey` インスタンスを返します。不正なイベントマス" -"ク化ファイル記述子のときは :exc:`ValueError` が、ファイルオブジェクトがすでに" -"登録済みのときは :exc:`KeyError` が送出されます。" +"これは新しい :class:`SelectorKey` インスタンスを返します。\n" +"不正なイベントマスクかファイル記述子のときは :exc:`ValueError` が、ファイルオ" +"ブジェクトがすでに登録済みのときは :exc:`KeyError` が送出されます。" -#: ../../library/selectors.rst:123 msgid "" "Unregister a file object from selection, removing it from monitoring. A file " "object shall be unregistered prior to being closed." msgstr "" -"ファイルオブジェクトのセレクション登録を解除し、監視対象から外します。ファイ" -"ルオブジェクトの登録解除はそのクローズより前に行われます。" +"ファイルオブジェクトのセレクション登録を解除し、監視対象から外します。\n" +"ファイルオブジェクトを閉じる前に、登録を解除する必要があります。" #: ../../library/selectors.rst:126 msgid "*fileobj* must be a file object previously registered." diff --git a/library/shelve.po b/library/shelve.po index ee33ede68..fab975644 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -187,13 +187,12 @@ msgid "" "empty space resulting from deletions." msgstr "" -#: ../../library/shelve.rst:110 msgid "" "Synchronize and close the persistent *dict* object. Operations on a closed " "shelf will fail with a :exc:`ValueError`." msgstr "" -"永続的な *辞書* オブジェクトを同期して閉じます。既に閉じられているシェルフに" -"対して呼び出すと :exc:`ValueError` を出し失敗します。" +"永続的な *辞書* オブジェクトを同期して閉じます。\n" +"閉じたシェルフに対する操作は :exc:`ValueError` で失敗します。" #: ../../library/shelve.rst:116 msgid "" @@ -264,7 +263,6 @@ msgid "" "discussion of the pickle protocols." msgstr "" -#: ../../library/shelve.rst:163 msgid "" "If the *writeback* parameter is ``True``, the object will hold a cache of " "all entries accessed and write them back to the *dict* at sync and close " @@ -272,7 +270,7 @@ msgid "" "much more memory and make sync and close take a long time." msgstr "" "*writeback* パラメータが ``True`` に設定されていれば、アクセスされたすべての" -"エントリはメモリ上にキャッシュされ、ファイルを閉じる際に *dict* に書き戻され" +"エントリはメモリ上にキャッシュされ、同期時とクローズ時に *dict* に書き戻され" "ます; この機能により、可変のエントリに対して自然な操作が可能になりますが、さ" "らに多くのメモリを消費し、辞書をファイルと同期して閉じる際に長い時間がかかる" "ようになります。" diff --git a/library/shlex.po b/library/shlex.po index c7ee75735..5420a08f0 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -30,7 +30,6 @@ msgstr ":mod:`!shlex` --- 単純な字句解析" msgid "**Source code:** :source:`Lib/shlex.py`" msgstr "**ソースコード:** :source:`Lib/shlex.py`" -#: ../../library/shlex.rst:11 msgid "" "The :class:`~shlex.shlex` class makes it easy to write lexical analyzers for " "simple syntaxes resembling that of the Unix shell. This will often be " @@ -38,8 +37,9 @@ msgid "" "Python applications) or for parsing quoted strings." msgstr "" ":class:`~shlex.shlex` クラスは Unix シェルに似た、単純な構文に対する字句解析" -"器を簡単に書けるようにします。このクラスはしばしば、 Python アプリケーション" -"のための実行制御ファイルのような小規模言語を書く上で便利です。" +"器を簡単に書けるようにします。\n" +"このクラスはしばしば、 Python アプリケーションのための実行制御ファイルのよう" +"な小規模言語を書く場合や、引用符で囲まれた文字列を解析する場合に便利です。" #: ../../library/shlex.rst:16 msgid "The :mod:`!shlex` module defines the following functions:" @@ -303,14 +303,14 @@ msgstr "" ":class:`~shlex.shlex` サブクラスのインスタンスは、字句解析を制御したり、デ" "バッグに使えるような public なインスタンス変数を持っています:" -#: ../../library/shlex.rst:222 msgid "" "The string of characters that are recognized as comment beginners. All " "characters from the comment beginner to end of line are ignored. Includes " "just ``'#'`` by default." msgstr "" -"コメントの開始として認識される文字列です。コメントの開始から行末までのすべて" -"のキャラクタ文字は無視されます。標準では単に ``'#'`` が入っています。" +"コメントの開始と認識する文字を並べた文字列です。\n" +"コメント開始文字から行末までは、すべて無視されます。\n" +"デフォルトでは ``'#'`` だけが含まれます。" #: ../../library/shlex.rst:229 msgid "" diff --git a/library/shutil.po b/library/shutil.po index 2161e5370..632d8ceb6 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -65,7 +65,6 @@ msgstr "" msgid "Directory and files operations" msgstr "ディレクトリとファイルの操作" -#: ../../library/shutil.rst:39 msgid "" "Copy the contents of the :term:`file-like object ` *fsrc* to " "the file-like object *fdst*. The integer *length*, if given, is the buffer " @@ -76,11 +75,14 @@ msgid "" "current file position to the end of the file will be copied." msgstr "" ":term:`file-like object ` *fsrc* の内容を *fdst* へコピーしま" -"す。整数値 *length* は与えられた場合バッファサイズを表します。特に *length* " -"が負の場合、チャンク内のソースデータを繰り返し操作することなくデータをコピー" -"します。デフォルトでは、制御不能なメモリ消費を避けるためにデータはチャンク内" -"に読み込まれます。 *fsrc* オブジェクトの現在のファイル位置が0でない場合、現在" -"の位置からファイル終端までの内容のみがコピーされることに注意してください。" +"す。\n" +"整数値 *length* は与えられた場合バッファサイズを表します。\n" +"特に *length* が負の場合、コピー元のデータをチャンク単位で繰り返し読み込むこ" +"となく、一度にコピーします。\n" +"デフォルトでは、制御不能なメモリ消費を避けるためにデータはチャンク単位で読み" +"込まれます。\n" +"*fsrc* オブジェクトの現在のファイル位置が0でない場合、現在の位置からファイル" +"終端までの内容のみがコピーされることに注意してください。" #: ../../library/shutil.rst:47 msgid "" @@ -93,7 +95,6 @@ msgid "" "destination file." msgstr "" -#: ../../library/shutil.rst:57 msgid "" "Copy the contents (no metadata) of the file named *src* to a file named " "*dst* and return *dst* in the most efficient way possible. *src* and *dst* " @@ -101,8 +102,9 @@ msgid "" "strings." msgstr "" "*src* という名前のファイルの内容 (メタデータを含まない) を *dst* という名前の" -"ファイルにコピーし、最も効率的な方法で *dst* を返します。 *src* と *dst* は :" -"term:`path-like object ` または文字列でパス名を指定します。" +"ファイルに、できるだけ効率的な方法でコピーし、*dst* を返します。\n" +"*src* と *dst* は :term:`path-like object ` または文字列で" +"パス名を指定します。" #: ../../library/shutil.rst:61 msgid "" @@ -325,18 +327,17 @@ msgstr "" "リックリンクとして作成されます。 *follow_symlinks* が真で *src* がシンボリッ" "クリンクの場合、 *dst* には *src* のリンク先のファイルがコピーされます。" -#: ../../library/shutil.rst:182 msgid "" ":func:`~shutil.copy` copies the file data and the file's permission mode " "(see :func:`os.chmod`). Other metadata, like the file's creation and " "modification times, is not preserved. To preserve all file metadata from the " "original, use :func:`~shutil.copy2` instead." msgstr "" -":func:`~shutil.copy` はファイルのデータとパーミッションをコピーします。 (:" -"func:`os.chmod` を参照)\n" +":func:`~shutil.copy` はファイルのデータとパーミッションをコピーします。\n" +"(:func:`os.chmod` を参照)\n" "その他の、ファイルの作成時間や変更時間などのメタデータはコピーしません。\n" -"コピー元のファイルのメタデータを保存したい場合は、 :func:`~shutils.copy2` を" -"利用してください。" +"コピー元のファイルのメタデータを保存したい場合は、 :func:`~shutil.copy2` を利" +"用してください。" #: ../../library/shutil.rst:192 msgid "" @@ -469,7 +470,6 @@ msgid "" "If exception(s) occur, an :exc:`Error` is raised with a list of reasons." msgstr "例外が発生した場合、理由のリストとともに :exc:`Error` を送出します。" -#: ../../library/shutil.rst:275 msgid "" "If *copy_function* is given, it must be a callable that will be used to copy " "each file. It will be called with the source path and the destination path " @@ -477,9 +477,10 @@ msgid "" "that supports the same signature (like :func:`~shutil.copy`) can be used." msgstr "" "*copy_function* は各ファイルをコピーするために利用される呼び出し可能オブジェ" -"クトでなければなりません。*copy_function* はコピー元のパスとコピー先のパスを" -"引数に呼び出されます。デフォルトでは :func:`~shutil.copy2` が利用されますが、" -"同じ特徴を持つ関数 (:func:`shutil.copy` など) ならどれでも利用可能です。" +"クトでなければなりません。\n" +"*copy_function* はコピー元のパスとコピー先のパスを引数に呼び出されます。\n" +"デフォルトでは :func:`~shutil.copy2` が利用されますが、同じシグネチャを持つ関" +"数 (:func:`~shutil.copy` など) ならどれでも利用可能です。" #: ../../library/shutil.rst:280 msgid "" @@ -1429,13 +1430,13 @@ msgstr "" " └── please_add.txt\n" " └── do_not_add.txt" -#: ../../library/shutil.rst:866 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" "作成するアーカイブには :file:`please_add.txt` が含まれますが、いっぽう :file:" -"`do_not_add.txt` は含まないようにします。この場合以下のようにします。" +"`do_not_add.txt` は含まないようにします。\n" +"この場合以下のようにします。 ::" #: ../../library/shutil.rst:869 msgid "" diff --git a/library/signal.po b/library/signal.po index b73b1fee1..5c3239f66 100644 --- a/library/signal.po +++ b/library/signal.po @@ -39,7 +39,6 @@ msgstr "" msgid "General rules" msgstr "一般的なルール" -#: ../../library/signal.rst:17 msgid "" "The :func:`signal.signal` function allows defining custom handlers to be " "executed when a signal is received. A small number of default handlers are " @@ -48,12 +47,14 @@ msgid "" "translated into a :exc:`KeyboardInterrupt` exception if the parent process " "has not changed it." msgstr "" -":func:`signal.signal` 関数を使って、シグナルを受信した時に実行されるハンドラ" -"を定義することができます。 Python は標準でごく少数のシグナルハンドラをインス" -"トールしています: :const:`SIGPIPE` は無視され (したがって、 pipe や socket に" -"対する書き込みで生じたエラーは通常の Python 例外として報告されます)、 :const:" -"`SIGINT` は :exc:`KeyboardInterrupt` 例外に変換されます。親プロセスが変更して" -"いない場合は、これらはどれも上書きすることができます。" +":func:`signal.signal` 関数で、シグナルを受信したときに実行するハンドラーを定" +"義できます。\n" +"デフォルトでは少数のハンドラーが設定されています。\n" +":const:`SIGPIPE` は無視されます。\n" +"これにより、パイプやソケットへの書き込みエラーを通常の Python 例外として報告" +"できます。\n" +"親プロセスが処理方法を変更していなければ、:const:`SIGINT` は :exc:" +"`KeyboardInterrupt` 例外に変換されます。" #: ../../library/signal.rst:24 msgid "" @@ -414,13 +415,12 @@ msgstr "" ":func:`pthread_sigmask` の *how* 引数に渡せる値で、シグナルがブロック解除され" "ることを意味します。" -#: ../../library/signal.rst:354 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that the signal mask is to be replaced." msgstr "" -":func:`pthread_sigmask` の *how* 引数に渡せる値で、シグナルが置換されることを" -"意味します。" +":func:`pthread_sigmask` の *how* 引数に渡せる値で、シグナルマスクが置換される" +"ことを意味します。" #: ../../library/signal.rst:360 msgid "The :mod:`!signal` module defines one exception:" @@ -438,13 +438,12 @@ msgstr "" "された場合、このエラーを予期してください。このエラーは :exc:`OSError` を継承" "しています。" -#: ../../library/signal.rst:369 msgid "" "This error used to be a subtype of :exc:`IOError`, which is now an alias of :" "exc:`OSError`." msgstr "" -"このエラーは以前は :exc:`IOError` のサブタイプでしたが、 :exc:`OSError` のエ" -"イリアスになりました。" +"このエラーは以前は :exc:`IOError` のサブタイプでした。\n" +"現在、``IOError`` は :exc:`OSError` のエイリアスです。" #: ../../library/signal.rst:374 msgid "The :mod:`!signal` module defines the following functions:" @@ -657,18 +656,18 @@ msgid "" "*seconds* to zero." msgstr "" -#: ../../library/signal.rst:525 msgid "" "When an interval timer fires, a signal is sent to the process. The signal " "sent is dependent on the timer being used; :const:`signal.ITIMER_REAL` will " "deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:" "`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`." msgstr "" -"インターバルタイマーが起動したとき、シグナルがプロセスに送られます。送られる" -"シグナルは利用されたタイマーの種類に依存します。 :const:`signal.ITIMER_REAL` " -"の場合は :const:`SIGALRM` が、 :const:`signal.ITIMER_VIRTUAL` の場合は :" -"const:`SIGVTALRM` が、 :const:`signal.ITIMER_PROF` の場合は :const:`SIGPROF` " -"が送られます。" +"インターバルタイマーが設定時間に達したとき、シグナルがプロセスに送られま" +"す。\n" +"送られるシグナルは利用されたタイマーの種類に依存します。\n" +":const:`signal.ITIMER_REAL` の場合は :const:`SIGALRM` が、 :const:`signal." +"ITIMER_VIRTUAL` の場合は :const:`SIGVTALRM` が、 :const:`signal.ITIMER_PROF` " +"の場合は :const:`SIGPROF` が送られます。" #: ../../library/signal.rst:531 msgid "" @@ -922,7 +921,6 @@ msgstr "" msgid "Examples" msgstr "使用例" -#: ../../library/signal.rst:727 msgid "" "Here is a minimal example program. It uses the :func:`alarm` function to " "limit the time spent waiting to open a file; this is useful if the file is " @@ -931,13 +929,14 @@ msgid "" "alarm before opening the file; if the operation takes too long, the alarm " "signal will be sent, and the handler raises an exception. ::" msgstr "" -"以下は最小限のプログラム例です。この例では :func:`alarm` を使ってファイルを開" -"く処理を待つのに費やす時間を制限します; 例えば、電源の入っていないシリアルデ" -"バイスを開こうとすると、通常 :func:`os.open` は未定義の期間ハングアップしてし" -"まいますが、この方法はそうした場合に便利です。ここではファイルを開くまで 5 秒" -"間のアラームを設定することで解決しています; ファイルを開く処理が長くかかりす" -"ぎると、アラームシグナルが送信され、ハンドラが例外を送出するようになっていま" -"す。 ::" +"以下は最小限のプログラム例です。\n" +"この例では :func:`alarm` を使ってファイルを開く処理を待つのに費やす時間を制限" +"します; 例えば、電源の入っていないシリアルデバイスを開こうとすると、通常 :" +"func:`os.open` は無期限にハングしてしまいますが、この方法はそうした場合に便利" +"です。\n" +"ここではファイルを開く前に 5 秒後のアラームを設定することで解決しています; " +"ファイルを開く処理が長くかかりすぎると、アラームシグナルが送信され、ハンドラ" +"が例外を送出するようになっています。 ::" #: ../../library/signal.rst:734 msgid "" diff --git a/library/smtplib.po b/library/smtplib.po index 946c9b591..26b832f8a 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -87,15 +87,15 @@ msgstr "" "普通に使う場合は、初期化と接続を行ってから、 :meth:`sendmail` と :meth:`SMTP." "quit` メソッドを呼びます。使用例は先の方で記載しています。" -#: ../../library/smtplib.rst:49 msgid "" "The :class:`SMTP` class supports the :keyword:`with` statement. When used " "like this, the SMTP ``QUIT`` command is issued automatically when the :" "keyword:`!with` statement exits. E.g.::" msgstr "" -" :class:`SMTP` クラスは :keyword:`with` 構文をサポートしています。このように" -"使用すると、 :keyword:`!with` 構文が終了すると、SMTPの ``QUIT`` コマンドが自" -"動的に発行されます。たとえば、" +":class:`SMTP` クラスは :keyword:`with` 構文をサポートしています。\n" +"このように使用すると、 :keyword:`!with` 構文が終了すると、SMTPの ``QUIT`` コ" +"マンドが自動的に発行されます。\n" +"例えば次のように使います。 ::" #: ../../library/smtplib.rst:53 msgid "" @@ -107,15 +107,14 @@ msgid "" ">>>" msgstr "" -#: ../../library/smtplib.rst:60 ../../library/smtplib.rst:62 msgid "" "All commands will raise an :ref:`auditing event ` ``smtplib.SMTP." "send`` with arguments ``self`` and ``data``, where ``data`` is the bytes " "about to be sent to the remote host." msgstr "" "全てのコマンドは引数 ``self`` と ``data`` を指定して :ref:`auditing event " -"` ``smtplib.SMTP.send`` を送出します。ここで ``data`` はリモートホ" -"ストに送信されるバイト数です。" +"` ``smtplib.SMTP.send`` を送出します。\n" +"ここで ``data`` はリモートホストに送信されるバイト列です。" #: ../../library/smtplib.rst:68 msgid "The default port used for SMTP connections (25)." @@ -177,14 +176,12 @@ msgstr "*context* が追加されました。" msgid "The *source_address* argument was added." msgstr "" -#: ../../library/smtplib.rst:111 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" -"このクラスは :attr:`ssl.SSLContext.check_hostname` と *Server Name " -"Indication* でホスト名のチェックをサポートしました。(:const:`ssl.HAS_SNI` を" -"参照してください)。" +"このクラスは :attr:`ssl.SSLContext.check_hostname` によるホスト名の検証と、" +"*Server Name Indication* に対応しました (:const:`ssl.HAS_SNI` を参照)。" #: ../../library/smtplib.rst:116 msgid "" @@ -208,15 +205,15 @@ msgid "" "socket, you must use an absolute path for *host*, starting with a '/'." msgstr "" -#: ../../library/smtplib.rst:133 msgid "" "Authentication is supported, using the regular SMTP mechanism. When using a " "Unix socket, LMTP generally don't support or require any authentication, but " "your mileage might vary." msgstr "" -"認証は、通常のSMTP機構を利用してサポートされています。 Unixソケットを利用する" -"場合、LMTPは通常認証をサポートしたり要求したりはしません。しかし、あなたが必" -"要であれば、利用することができます。" +"認証は、通常のSMTP機構を利用してサポートされています。\n" +"Unixソケットを利用する場合、LMTPは通常認証をサポートしたり要求したりはしませ" +"ん。\n" +"ただし、環境によって異なる場合があります。" #: ../../library/smtplib.rst:137 msgid "The optional *timeout* parameter was added." @@ -238,14 +235,13 @@ msgstr "" msgid "SMTPException became subclass of :exc:`OSError`" msgstr "SMTPException が :exc:`OSError` の派生クラスになりました。" -#: ../../library/smtplib.rst:155 msgid "" "This exception is raised when the server unexpectedly disconnects, or when " "an attempt is made to use the :class:`SMTP` instance before connecting it to " "a server." msgstr "" -"この例外はサーバが突然接続が切断されるか、:class:`SMTP` インスタンスを生成す" -"る前に接続しようとした場合に送出されます。" +"サーバーとの接続が予期せず切断された場合や、サーバーに接続する前に :class:" +"`SMTP` インスタンスを使おうとした場合に送出されます。" #: ../../library/smtplib.rst:162 msgid "" @@ -262,15 +258,14 @@ msgstr "エラーコード。" msgid "The error message." msgstr "" -#: ../../library/smtplib.rst:176 msgid "" "Sender address refused. In addition to the attributes set by on all :exc:" "`SMTPResponseException` exceptions, this sets 'sender' to the string that " "the SMTP server refused." msgstr "" -"送信者のアドレスが弾かれたときに送出される例外です。全ての :exc:" -"`SMTPResponseException` 例外に、 SMTPサーバが弾いた 'sender' アドレスの文字列" -"がセットされます。" +"送信者のアドレスが拒否されたときに送出されます。\n" +":exc:`SMTPResponseException` に共通する属性に加え、``sender`` 属性に SMTP " +"サーバーが拒否したアドレスの文字列が設定されます。" #: ../../library/smtplib.rst:183 msgid "All recipient addresses refused." @@ -392,7 +387,6 @@ msgstr "" "応答待ちのときにサーバへの接続が切れると :exc:`SMTPServerDisconnected` が送出" "されます。" -#: ../../library/smtplib.rst:267 msgid "" "Connect to a host on a given port. The defaults are to connect to the local " "host at the standard SMTP port (25). If the hostname ends with a colon " @@ -402,12 +396,14 @@ msgid "" "Returns a 2-tuple of the response code and message sent by the server in its " "connection response." msgstr "" -"ホスト名とポート番号をもとに接続します。デフォルトはlocalhostの標準的なSMTP" -"ポート(25番)に接続します。もしホスト名の末尾がコロン(``':'``)で、後に番号がつ" -"いている場合は、「ホスト名:ポート番号」として扱われます。このメソッドはコンス" -"トラクタにホスト名及びポート番号が指定されている場合、自動的に呼び出されま" -"す。戻り値は、この接続の応答内でサーバによって送信された応答コードとメッセー" -"ジの2要素タプルです。" +"ホスト名とポート番号をもとに接続します。\n" +"デフォルトはlocalhostの標準的なSMTPポート(25番)に接続します。\n" +"もしホスト名の末尾がコロン(``':'``)で、後に番号がついている場合は、「ホスト" +"名:ポート番号」として扱われます。\n" +"このメソッドはコンストラクタにホスト名が指定されている場合、自動的に呼び出さ" +"れます。\n" +"戻り値は、この接続の応答内でサーバによって送信された応答コードとメッセージの2" +"要素タプルです。" #: ../../library/smtplib.rst:275 msgid "" @@ -422,16 +418,17 @@ msgstr "" "引数 ``self``, ``host``, ``port`` を指定して :ref:`監査イベント ` " "``smtplib.connect`` を送出します。" -#: ../../library/smtplib.rst:283 msgid "" "Identify yourself to the SMTP server using ``HELO``. The hostname argument " "defaults to the fully qualified domain name of the local host. The message " "returned by the server is stored as the :attr:`helo_resp` attribute of the " "object." msgstr "" -"SMTPサーバに ``HELO`` コマンドで身元を示します。デフォルトではhostname引数は" -"ローカルホストを指します。サーバーが返したメッセージは、オブジェクトの :attr:" -"`helo_resp` 属性に格納されます。" +"SMTPサーバに ``HELO`` コマンドで身元を示します。\n" +"ホスト名を指定する引数のデフォルトは、ローカルホストの完全修飾ドメイン名で" +"す。\n" +"サーバーが返したメッセージは、オブジェクトの :attr:`helo_resp` 属性に格納され" +"ます。" #: ../../library/smtplib.rst:288 msgid "" @@ -516,7 +513,6 @@ msgstr "" "ほとんどのサイトはスパマーの裏をかくためにSMTPの ``VRFY`` は使用不可になって" "います。" -#: ../../library/smtplib.rst:337 msgid "" "Log in on an SMTP server that requires authentication. The arguments are the " "username and the password to authenticate with. If there has been no " @@ -524,11 +520,12 @@ msgid "" "``EHLO`` first. This method will return normally if the authentication was " "successful, or may raise the following exceptions:" msgstr "" -"認証が必要なSMTPサーバにログインします。認証に使用する引数はユーザ名とパス" -"ワードです。まだセッションが無い場合は、 ``EHLO`` または ``HELO`` コマンドで" -"セッションを作ります。ESMTPの場合は ``EHLO`` が先に試されます。認証が成功した" -"場合は通常このメソッドは戻りますが、例外が起こった場合は以下の例外が上がりま" -"す:" +"認証が必要な SMTP サーバにログインします。\n" +"引数は認証に使用するユーザ名とパスワードです。\n" +"このセッションでまだ ``EHLO`` または ``HELO`` コマンドを送信していない場合" +"は、まず ESMTP の ``EHLO`` を試みます。\n" +"認証に成功するとこのメソッドは正常に戻りますが、次の例外を送出する場合があり" +"ます:" #: ../../library/smtplib.rst:346 msgid ":exc:`SMTPAuthenticationError`" @@ -642,14 +639,14 @@ msgid "" "by :mod:`!smtplib`." msgstr "" -#: ../../library/smtplib.rst:414 msgid "" "Put the SMTP connection in TLS (Transport Layer Security) mode. All SMTP " "commands that follow will be encrypted. You should then call :meth:`ehlo` " "again." msgstr "" -"TLS (Transport Layer Security) モードで SMTP 接続します。続く全てのSMTP コマ" -"ンドは暗号化されます。その後、もう一度 :meth:`ehlo` を呼んでください。" +"SMTP 接続を TLS (Transport Layer Security) モードに切り替えます。\n" +"続く全てのSMTP コマンドは暗号化されます。\n" +"その後、もう一度 :meth:`ehlo` を呼んでください。" #: ../../library/smtplib.rst:418 msgid "" @@ -728,7 +725,6 @@ msgid "" "byte string is not modified." msgstr "" -#: ../../library/smtplib.rst:478 msgid "" "If there has been no previous ``EHLO`` or ``HELO`` command this session, " "this method tries ESMTP ``EHLO`` first. If the server does ESMTP, message " @@ -736,13 +732,12 @@ msgid "" "is in the feature set the server advertises). If ``EHLO`` fails, ``HELO`` " "will be tried and ESMTP options suppressed." msgstr "" -"まだセッションが無い場合は、 ``EHLO`` または ``HELO`` コマンドでセッションを" -"作ります。ESMTPの場合は ``EHLO`` が先に試されます。また、サーバがESMTP対応な" -"らば、メッセージサイズとそれぞれ指定されたオプションも渡します。(featureオプ" -"ションがあればサーバの広告をセットします) ``EHLO`` が失敗した場合は、ESMTPオ" -"プションの無い ``HELO`` が試されます。" +"このセッションでまだ ``EHLO`` または ``HELO`` コマンドを送っていない場合、ま" +"ず ESMTP の ``EHLO`` を試みます。\n" +"サーバーが ESMTP に対応していれば、メッセージサイズと、指定された各オプション" +"のうちサーバーが対応を通知したものを渡します。\n" +"``EHLO`` が失敗すると ``HELO`` を試み、ESMTP オプションは渡しません。" -#: ../../library/smtplib.rst:484 msgid "" "This method will return normally if the mail is accepted for at least one " "recipient. Otherwise it will raise an exception. That is, if this method " @@ -751,11 +746,14 @@ msgid "" "for each recipient that was refused. Each entry contains a tuple of the " "SMTP error code and the accompanying error message sent by the server." msgstr "" -"このメソッドは最低でも1人の受信者にメールが受け取られたときは正常に戻ります。" -"そうでない場合は例外を投げます。つまり、このメソッドが例外を送出しないときは" -"誰かが送信したメールを受け取ったはずです。また、例外を送出しない場合は拒絶さ" -"れた受信者ごとに項目のある辞書を返します。各項目はサーバーが送ったSMTPエラー" -"コードと付随するエラーメッセージのタプルを持ちます。" +"このメソッドは少なくとも 1 人の受信者宛てのメールが受理されたときは正常に戻り" +"ます。\n" +"そうでない場合は例外を投げます。\n" +"つまり、このメソッドが例外を送出しないときは誰かにはメールが届くはずです。\n" +"また、例外を送出しない場合は拒絶された受信者ごとに項目のある辞書を返しま" +"す。\n" +"各項目はサーバーが送ったSMTPエラーコードと付随するエラーメッセージのタプルを" +"持ちます。" #: ../../library/smtplib.rst:491 msgid "" @@ -803,13 +801,12 @@ msgstr "" "*mail_options* に ``SMTPUTF8`` が与えられましたが、サーバがサポートしていませ" "ん。" -#: ../../library/smtplib.rst:513 msgid "" "Unless otherwise noted, the connection will be open even after an exception " "is raised." msgstr "" -"また、この他の注意として、例外が上がった後もコネクションは開いたままになって" -"います。" +"特に記載がない限り、例外が送出された後もコネクションは開いたままになっていま" +"す。" #: ../../library/smtplib.rst:516 msgid "*msg* may be a byte string." diff --git a/library/socket.po b/library/socket.po index 62395bc90..ab6bb23f7 100644 --- a/library/socket.po +++ b/library/socket.po @@ -237,14 +237,12 @@ msgstr "" "*addr_type* が :const:`TIPC_ADDR_NAME` の場合、 *v1* はサーバータイプ、 *v2* " "はポートID (the port identifier)、そして *v3* は 0 であるべきです。" -#: ../../library/socket.rst:112 msgid "" "If *addr_type* is :const:`TIPC_ADDR_NAMESEQ`, then *v1* is the server type, " "*v2* is the lower port number, and *v3* is the upper port number." msgstr "" "*addr_type* が :const:`TIPC_ADDR_NAMESEQ` の場合、 *v1* はサーバータイプ、 " -"*v2* はポート番号下位(lower port number)、 *v3* はポート番号上位(upper port " -"number) です。" +"*v2* はポート番号の下限、 *v3* はポート番号の上限 です。" #: ../../library/socket.rst:115 msgid "" @@ -1235,7 +1233,6 @@ msgid "" "This function wraps the C function ``getaddrinfo`` of the underlying system." msgstr "" -#: ../../library/socket.rst:989 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -1245,10 +1242,12 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" "*host* / *port* 引数の指すアドレス情報を、そのサービスに接続されたソケットを" -"作成するために必要な全ての引数が入った 5 要素のタプルに変換します。 *host* は" -"ドメイン名、IPv4/v6アドレスの文字列、または ``None`` です。 *port* は " -"``'http'`` のようなサービス名文字列、ポート番号を表す数値、または ``None`` で" -"す。 *host* と *port* に ``None`` を指定すると C APIに ``NULL`` を渡せます。" +"作成するために必要な全ての引数が入った 5 要素のタプルのシーケンスに変換しま" +"す。\n" +"*host* はドメイン名、IPv4/v6アドレスの文字列、または ``None`` です。\n" +"*port* は ``'http'`` のようなサービス名文字列、ポート番号を表す数値、または " +"``None`` です。\n" +"*host* と *port* に ``None`` を指定すると C APIに ``NULL`` を渡せます。" #: ../../library/socket.rst:996 msgid "" @@ -1592,12 +1591,11 @@ msgstr "" "値は、標準Cライブラリの :c:struct:`in_addr` 型を使用する関数に渡す事ができま" "す。" -#: ../../library/socket.rst:1232 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -":func:`inet_aton` はドットが 3 個以下の文字列も受け取ります; 詳細については " +":func:`inet_aton` はドットが 3 個未満の文字列も受け取ります; 詳細については " "Unix のマニュアル :manpage:`inet(3)` を参照してください。" #: ../../library/socket.rst:1235 @@ -1617,7 +1615,6 @@ msgstr "" ":func:`inet_aton` は、IPv6をサポートしません。IPv4/v6のデュアルスタックをサ" "ポートする場合は :func:`inet_pton` を使用します。" -#: ../../library/socket.rst:1245 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1627,10 +1624,11 @@ msgid "" "argument." msgstr "" "32 ビットにパックされた IPv4 アドレス (長さ 4 バイトの :term:`bytes-like " -"object`) を、標準的なドット記法による 4 桁の文字列 ('123.45.67.89' など) に変" -"換します。この関数は、:c:struct:`in_addr` 型、つまりこの関数が引数として受け" -"取る 32 ビットにパックされたバイナリデータに対する C の型、を使用する標準 C " -"ライブラリのプログラムとやりとりする場合に便利です。" +"object`) を、4 つの数をドットで区切る標準的な文字列形式 ('123.45.67.89' な" +"ど) に変換します。\n" +"この関数は、:c:struct:`in_addr` 型、つまりこの関数が引数として受け取る 32 " +"ビットにパックされたバイナリデータに対する C の型、を使用する標準 C ライブラ" +"リのプログラムとやりとりする場合に便利です。" #: ../../library/socket.rst:1252 msgid "" @@ -1699,7 +1697,6 @@ msgstr "" "ファミリで適切な長さでない場合、 :exc:`ValueError` が発生します。 :func:" "`inet_ntop` の呼び出しでエラーが起こると、 :exc:`OSError` が発生します。" -#: ../../library/socket.rst:1311 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1709,20 +1706,20 @@ msgid "" "the last in the buffer. Raises :exc:`OverflowError` if *length* is outside " "the permissible range of values." msgstr "" -"指定された *length* にある制御メッセージ(CMSG)から、末尾のパディングを除い" -"た全体の長さを返します。この値は多くの場合、 :meth:`~socket.recvmsg` が制御" -"メッセージの一連の要素を受信するためのバッファサイズとして使用できますが、" -"バッファの末尾が要素である場合であってもパディングは含まれるので、バッファサ" -"イズを取得するには :rfc:`3542` で求められているように、 :func:`CMSG_SPACE` を" -"使用した移植可能なアプリケーションが必要です。通常 *length* は定数であり、許" -"容範囲外の値が指定された場合は :exc:`OverflowError` 例外が送出されます。" +"長さ *length* のデータを伴う制御メッセージ (補助データ) 1 件について、末尾の" +"パディングを除いた全体の長さを返します。\n" +"この値は、:meth:`~socket.recvmsg` で制御メッセージを 1 件受信するためのバッ" +"ファサイズとして使える場合が多くあります。\n" +"ただし :rfc:`3542` では、移植可能なアプリケーションは :func:`CMSG_SPACE` を使" +"い、バッファの最後のメッセージであってもパディング用の領域を含める必要がある" +"と定めています。\n" +"*length* が許容範囲外の場合は :exc:`OverflowError` を送出します。" #: ../../library/socket.rst:1322 ../../library/socket.rst:1874 #: ../../library/socket.rst:1918 ../../library/socket.rst:2026 msgid "Most Unix platforms." msgstr "Unix プラットフォーム。" -#: ../../library/socket.rst:1329 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1731,11 +1728,12 @@ msgid "" "Raises :exc:`OverflowError` if *length* is outside the permissible range of " "values." msgstr "" -"指定された *length* の制御メッセージ(CMSG)の要素を :meth:`~socket.recvmsg` " -"が受信するために必要な、パディングを含めたバッファサイズを返します。複数の項" -"目を受信するために必要なバッファスペースは、 :func:`CMSG_SPACE` が返すそれぞ" -"れの要素の長さの合計です。通常 *length* は定数であり、許容範囲外の値が指定さ" -"れた場合は :exc:`OverflowError` 例外が送出されます。" +"長さ *length* のデータを伴う制御メッセージ (補助データ) 1 件を :meth:" +"`~socket.recvmsg` で受信するために必要な、末尾のパディングを含むバッファサイ" +"ズを返します。\n" +"複数件を受信するには、それぞれのデータ長に対する :func:`CMSG_SPACE` の戻り値" +"を合計したバッファサイズが必要です。\n" +"*length* が許容範囲外の場合は :exc:`OverflowError` を送出します。" #: ../../library/socket.rst:1337 msgid "" @@ -1790,12 +1788,12 @@ msgstr "" "引数 ``name`` を指定して :ref:`監査イベント ` ``socket." "sethostname`` を送出します。" -#: ../../library/socket.rst:1382 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -"ネットワークインターフェース情報 (index int, name string)のタプルを返します。" +"ネットワークインターフェース情報を表すタプル (インデックスの整数、名前の文字" +"列) のリストを返します。\n" "システムコールが失敗した場合、 :exc:`OSError` 例外を送出します。" #: ../../library/socket.rst:1390 ../../library/socket.rst:1417 @@ -2116,12 +2114,12 @@ msgstr "" msgid "Duplicate the socket." msgstr "ソケットを複製します。" -#: ../../library/socket.rst:1658 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -"ソケットのファイル記述子を短い整数型で返します。失敗時には、-1 を返します。" +"ソケットのファイル記述子を小さな整数で返します。\n" +"失敗時には、-1 を返します。\n" "ファイル記述子は、 :func:`select.select` などで使用します。" #: ../../library/socket.rst:1661 @@ -2401,7 +2399,6 @@ msgid "" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1886 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -2414,25 +2411,26 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" ":meth:`recvmsg` と同様に動作してソケットから通常のデータと付属的なデータを受" -"信しますが、非付属的データは新しいバイトオブジェクトとして返すのではなく、一" -"連のバッファとして返します。*buffers* 引数は書き込み可能なバッファをエクス" -"ポートするオブジェクトのイテラブルでなければなりません (例: :class:" -"`bytearray` オブジェクト)。これらは、全てに書き込まれるか、残りバッファがなく" -"なるまで、非付属的データの連続チャンクで埋められます。オペレーティングシステ" -"ムによって、使用できるバッファの数が制限 (:func:`~os.sysconf` 値 " -"``SC_IOV_MAX``) されている場合があります。*ancbufsize* 引数と *flags* 引数" -"は、:meth:`recvmsg` での意味と同じ意味を持ちます。" +"信しますが、非付属的データは新しいバイトオブジェクトとして返すのではなく、指" +"定された一連のバッファに分散して書き込みます。\n" +"*buffers* 引数は書き込み可能なバッファをエクスポートするオブジェクトのイテラ" +"ブルでなければなりません (例: :class:`bytearray` オブジェクト)。\n" +"これらは、全てに書き込まれるか、残りバッファがなくなるまで、非付属的データの" +"連続チャンクで埋められます。\n" +"オペレーティングシステムによって、使用できるバッファの数が制限 (:func:`~os." +"sysconf` 値 ``SC_IOV_MAX``) されている場合があります。\n" +"*ancbufsize* 引数と *flags* 引数は、:meth:`recvmsg` での意味と同じ意味を持ち" +"ます。" -#: ../../library/socket.rst:1897 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " "into the buffers, and *ancdata*, *msg_flags* and *address* are the same as " "for :meth:`recvmsg`." msgstr "" -"戻り値は 4 要素のタプル ``(nbytes, ancdata, msg_flags, address)`` です。ここ" -"で、*nbytes* はバッファに書き込まれた非付属的データの総数で、*ancdata*、" -"*msg_flags*、*address* は :meth:`recvmsg` と同様です。" +"戻り値は 4 要素のタプル ``(nbytes, ancdata, msg_flags, address)`` です。\n" +"ここで、*nbytes* はバッファに書き込まれた非付属的データの総バイト数で、" +"*ancdata*、*msg_flags*、*address* は :meth:`recvmsg` と同様です。" #: ../../library/socket.rst:1902 msgid "Example::" @@ -2591,7 +2589,6 @@ msgstr "" "す。:const:`AF_ALG` ソケットの、モード、IV、AEAD に関連づけられたデータ長、フ" "ラグを設定します。" -#: ../../library/socket.rst:2048 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2605,23 +2602,25 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" "高性能の :mod:`os.sendfile` を使用して、ファイルを EOF まで送信し、送信された" -"バイトの総数を返します。*file* は、バイナリモードで開かれた標準的なファイルオ" -"ブジェクトです。:mod:`os.sendfile` が使用できない場合 (例: Windows)、または " -"*file* が標準的なファイルでない場合、代わりに :meth:`send` が使用されます。" -"*offset* は、ファイルの読み出し開始位置を指定します。*count* が指定されている" -"場合、ファイルを EOF まで送信するのではなく、転送するバイトの総数を指定しま" -"す。ファイルの位置は、返る時に更新されます。あるいは、エラー時には :meth:" -"`file.tell() `  を使用して送信されたバイトの数を確認すること" -"ができます。ソケットは :const:`SOCK_STREAM` タイプでなければなりません。非ブ" -"ロックソケットはサポートされていません。" - -#: ../../library/socket.rst:2064 +"バイトの総数を返します。\n" +"*file* は、バイナリモードで開かれた標準的なファイルオブジェクトです。\n" +":mod:`os.sendfile` が使用できない場合 (例: Windows)、または *file* が標準的な" +"ファイルでない場合、代わりに :meth:`send` が使用されます。\n" +"*offset* は、ファイルの読み出し開始位置を指定します。\n" +"*count* が指定されている場合、ファイルを EOF まで送信するのではなく、転送する" +"バイトの総数を指定します。\n" +"正常に戻る場合もエラーが起きた場合も、ファイル位置は更新されます。\n" +"エラー時には :meth:`file.tell() `  を使用して送信されたバイト" +"の数を確認することができます。\n" +"ソケットは :const:`SOCK_STREAM` タイプでなければなりません。\n" +"非ブロックソケットはサポートされていません。" + msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" "ソケットのファイル記述子、またはソケットのハンドルの、 :ref:`継承可能フラグ " -"` を立てます。" +"` を設定します。" #: ../../library/socket.rst:2072 msgid "" @@ -3032,15 +3031,15 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: ../../library/socket.rst:2380 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" "次の例では、ソケットインターフェースを使用してローソケットプロトコルを使用す" -"る CAN ネットワークと通信する方法を説明します。ブロードキャストマネージャプロ" -"トコロルで CAN を使用するには、以下でソケットを開きます。" +"る CAN ネットワークと通信する方法を説明します。\n" +"ブロードキャストマネージャプロトコルで CAN を使用するには、以下でソケットを開" +"きます。 ::" #: ../../library/socket.rst:2384 msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" diff --git a/library/socketserver.po b/library/socketserver.po index 2f9ea8b23..a98c03804 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -123,7 +123,6 @@ msgstr "" "に、(:keyword:`!with` 文を使っていなかったなら) :meth:`~BaseServer." "server_close` を呼び出してソケットを閉じます。" -#: ../../library/socketserver.rst:66 msgid "" "When inheriting from :class:`ThreadingMixIn` for threaded connection " "behavior, you should explicitly declare how you want your threads to behave " @@ -134,12 +133,14 @@ msgid "" "meaning that Python will not exit until all threads created by :class:" "`ThreadingMixIn` have exited." msgstr "" -":class:`ThreadingMixIn` から継承してスレッドを利用した接続を行う場合、突発的" -"な通信切断時の処理を明示的に指定する必要があります。 :class:`ThreadingMixIn` " -"クラスには *daemon_threads* 属性があり、サーバがスレッドの終了を待ち合わせる" -"かどうかを指定する事ができます。スレッドが独自の処理を行う場合は、このフラグ" -"を明示的に指定します。デフォルトは :const:`False` で、Pythonは :class:" -"`ThreadingMixIn` クラスが起動した全てのスレッドが終了するまで実行し続けます。" +":class:`ThreadingMixIn` から継承してスレッドを利用した接続を行う場合、突然終" +"了する場合のスレッドの動作を明示的に指定する必要があります。\n" +":class:`ThreadingMixIn` クラスには *daemon_threads* 属性があり、サーバがス" +"レッドの終了を待ち合わせるかどうかを指定する事ができます。\n" +"スレッドの終了を待たずに終了させたい場合は、このフラグを明示的に設定してくだ" +"さい。\n" +"デフォルトは :const:`False` で、Pythonは :class:`ThreadingMixIn` クラスが起動" +"した全てのスレッドが終了するまで実行し続けます。" #: ../../library/socketserver.rst:75 msgid "" diff --git a/library/sqlite3.po b/library/sqlite3.po index eb3a76cc0..481e7f2a6 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -133,17 +133,17 @@ msgstr "" "(`cursors`_)やトランザクション(`transactions`_)を含むデータベースの基本概念を" "理解していることを前提としています。" -#: ../../library/sqlite3.rst:75 msgid "" "First, we need to create a new database and open a database connection to " "allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to " "create a connection to the database :file:`tutorial.db` in the current " "working directory, implicitly creating it if it does not exist:" msgstr "" -"最初に、新しいデータベースを作成し、データベース接続(connection)を開いて :" -"mod:`!sqlite3` が動作できるようにする必要があります。 :func:`sqlite3." -"connect` を呼び出して、データベース :file:`tutorial.db` への接続を現在の作業" -"ディレクトリに作成します。存在しない場合は暗黙的に作成します。" +"まず、新しいデータベースを作り、:mod:`!sqlite3` から扱えるように接続を開きま" +"す。\n" +":func:`sqlite3.connect` を呼び出して、現在の作業ディレクトリにあるデータベー" +"ス :file:`tutorial.db` に接続します。\n" +"このファイルが存在しなければ、暗黙に作成されます。" #: ../../library/sqlite3.rst:81 msgid "" @@ -230,14 +230,13 @@ msgid "" "True" msgstr "" -#: ../../library/sqlite3.rst:138 msgid "" "Now, add two rows of data supplied as SQL literals by executing an " "``INSERT`` statement, once again by calling :meth:`cur.execute(...) `:" msgstr "" -"ここで、 INSERT 文を実行して SQL のリテラルとして提供された 2 行のデータを追" -"加し、 再度 :meth:`cur.execute(...) ` を呼び出して追加します:" +"再び :meth:`cur.execute(...) ` を呼び出して ``INSERT`` 文を実" +"行し、SQL リテラルで指定した 2 行のデータを追加します。" #: ../../library/sqlite3.rst:142 msgid "" @@ -284,12 +283,11 @@ msgid "" "[(8.2,), (7.5,)]" msgstr "" -#: ../../library/sqlite3.rst:172 msgid "" "The result is a :class:`list` of two :class:`!tuple`\\s, one per row, each " "containing that row's ``score`` value." msgstr "" -"結果は、2 つの :class:`!タプル` の :class:`リスト ` で、 それぞれのタプ" +"結果は、2 つの :class:`!tuple` の :class:`リスト ` で、 それぞれのタプ" "ルにその行の ``score`` 値が含まれています。" #: ../../library/sqlite3.rst:175 @@ -610,7 +608,6 @@ msgstr "" "実際の使用例については、 :source:`Lib/sqlite3/__main__.py` の :func:`!" "runsource` を参照してください。" -#: ../../library/sqlite3.rst:387 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -618,11 +615,14 @@ msgid "" "*flag* set to ``True``. Afterwards, you will get tracebacks from callbacks " "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -"コールバックのトレースバックを有効または無効にします。 デフォルトでは、ユー" -"ザー定義関数や集計関数や変換関数や authorizer コールバックなどではトレース" -"バックを取得しません。それらをデバッグしたい場合は、 *flag* を ``True`` に設" -"定してこの関数を呼び出し。その後、 :data:`sys.stderr` のコールバックからト" -"レースバックを取得します。 機能を再び無効にするには ``False`` を使用します。" +"コールバックのトレースバックを有効または無効にします。\n" +"デフォルトでは、ユーザー定義関数や集計関数や変換関数や authorizer コールバッ" +"クなどではトレースバックを取得しません。\n" +"それらをデバッグしたい場合は、 *flag* を ``True`` に設定してこの関数を呼び出" +"します。\n" +"その後は、コールバック内の例外のトレースバックが :data:`sys.stderr` に出力さ" +"れます。\n" +"機能を再び無効にするには ``False`` を使用します。" #: ../../library/sqlite3.rst:396 msgid "" @@ -1067,7 +1067,6 @@ msgstr "" "のメソッドによってロールバックされた場合、新しいトランザクションが暗黙に開か" "れます。" -#: ../../library/sqlite3.rst:676 msgid "" "Close the database connection. If :attr:`autocommit` is ``False``, any " "pending transaction is implicitly rolled back. If :attr:`!autocommit` is " @@ -1075,11 +1074,13 @@ msgid "" "control is executed. Make sure to :meth:`commit` before closing to avoid " "losing pending changes." msgstr "" -"データベース接続を閉じます。 :attr:`autocommit` が ``False`` の場合、保留中の" -"トランザクションは暗黙にロールバックされます。 :attr:`!autocommit` が " -"``True`` または :data:`LEGACY_TRANSACTION_CONTROL` の場合、暗黙のトランザク" -"ション制御は実行されませんので、保留中の変更が失われないように、データベース" -"接続を閉じる前に必ず :meth:`commit` を行ってください。" +"データベース接続を閉じます。\n" +":attr:`autocommit` が ``False`` の場合、保留中のトランザクションは暗黙にロー" +"ルバックされます。\n" +":attr:`!autocommit` が ``True`` または :data:`LEGACY_TRANSACTION_CONTROL` の" +"場合、暗黙のトランザクション制御は実行されません。\n" +"保留中の変更が失われないように、データベース接続を閉じる前に必ず :meth:" +"`commit` を行ってください。" #: ../../library/sqlite3.rst:686 msgid "" @@ -1943,13 +1944,12 @@ msgstr "" "このメソッドは、 背後の SQLite ライブラリに脱直列化 API がある場合にのみ使用" "できます。" -#: ../../library/sqlite3.rst:1349 msgid "" "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" "autocommit` has three allowed values:" msgstr "" -"この属性は、 :pep:`249` 対応のトランザクションの振る舞いを制御します。 :attr:" -"`!auto​​commit` には以下の 3 つの値が指定できます:" +"この属性は、 :pep:`249` 対応のトランザクションの振る舞いを制御します。\n" +":attr:`!autocommit` には以下の 3 つの値が指定できます:" #: ../../library/sqlite3.rst:1352 msgid "" @@ -1962,9 +1962,8 @@ msgstr "" "します。トランザクションを閉じるには、 :meth:`commit` や :meth:`rollback` を" "使用します。" -#: ../../library/sqlite3.rst:1356 msgid "This is the recommended value of :attr:`!autocommit`." -msgstr "これが :attr:`!auto​​commit` の推奨値です。" +msgstr "これが :attr:`!autocommit` の推奨値です。" #: ../../library/sqlite3.rst:1358 msgid "" @@ -1983,16 +1982,14 @@ msgstr "" "ランザクション制御。 詳細については :attr:`isolation_level` を参照してくださ" "い。" -#: ../../library/sqlite3.rst:1365 msgid "This is currently the default value of :attr:`!autocommit`." -msgstr "これが、今のところは、 :attr:`!auto​​commit` のデフォルト値です。" +msgstr "これが、今のところは、 :attr:`!autocommit` のデフォルト値です。" -#: ../../library/sqlite3.rst:1367 msgid "" "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " "changing it to ``True`` will commit any pending transaction." msgstr "" -":attr:`!auto​​commit` を ``False`` に変更すると新しいトランザクションが開き、 " +":attr:`!autocommit` を ``False`` に変更すると新しいトランザクションが開き、 " "``True`` に変更すると保留中のトランザクションがコミットされます。" #: ../../library/sqlite3.rst:1370 @@ -2287,16 +2284,15 @@ msgid "" "\"\"\")" msgstr "" -#: ../../library/sqlite3.rst:1598 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -":attr:`~Cursor.row_factory` が ``None`` の場合、 次の行のクエリ結果セットを :" -"class:`タプル ` として返します。それ以外の場合は、 それを行工場(row " -"factory)に渡し、 その結果を返します。 これ以上データが無い場合は ``None`` を" -"返します。" +":attr:`~Cursor.row_factory` が ``None`` の場合、 クエリ結果セットの次の 1 行" +"を :class:`タプル ` として返します。\n" +"それ以外の場合は、 それを行工場(row factory)に渡し、 その結果を返します。\n" +"これ以上データが無い場合は ``None`` を返します。" #: ../../library/sqlite3.rst:1606 msgid "" @@ -2449,7 +2445,6 @@ msgstr "" "て、 SQL文(statement)実行の完了後に更新されます。 なぜなら :attr:`!rowcount` " "を更新するためには、結果の行を取得(fetch)しなければならないからです。" -#: ../../library/sqlite3.rst:1704 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -2457,22 +2452,22 @@ msgid "" "arguments, a :class:`Cursor` object and the :class:`!tuple` of row values, " "and returns a custom object representing an SQLite row." msgstr "" -"この :class:`!カーソル` から取得された行の表現方法を制御します。 ``None`` の" -"場合、行は :class:`タプル ` として表されます。 :class:`sqlite3.Row` に" -"設定することもできます。 そしてまた、 :class:`Cursor` オブジェクトと、 行の値" -"の :class:`!タプル` の、 2 つの引数を受け取り、 SQLite の行(row)を表すカスタ" -"ム・オブジェクトを返す、 :term:`呼び出し可能オブジェクト ` に設定す" -"ることもできます。" +"この :class:`!Cursor` から取得された行の表現方法を制御します。\n" +"``None`` の場合、行は :class:`タプル ` として表されます。\n" +":class:`sqlite3.Row` に設定することもできます。\n" +"そしてまた、 :class:`Cursor` オブジェクトと、 行の値の :class:`!tuple` の、 " +"2 つの引数を受け取り、 SQLite の行(row)を表すカスタム・オブジェクトを返す、 :" +"term:`呼び出し可能オブジェクト ` に設定することもできます。" -#: ../../library/sqlite3.rst:1711 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -":class:`!カーソル・オブジェクト` の作成時に :attr:`Connection.row_factory` の" -"値をこの属性のデフォルト値として設定します。この属性に割り当てても、親接続" -"(parent connection)の :attr:`Connection.row_factory` には影響しません。" +":class:`!Cursor` オブジェクト の作成時に :attr:`Connection.row_factory` の値" +"をこの属性のデフォルト値として設定します。\n" +"この属性に割り当てても、親接続(parent connection)の :attr:`Connection." +"row_factory` には影響しません。" #: ../../library/sqlite3.rst:1730 msgid "Row objects" @@ -2499,15 +2494,14 @@ msgstr "" "列名(column names)と値(values)が全く同一である 2 つの :class:`!Row` オブジェ" "クトを比較すると、等しいと見なされます。" -#: ../../library/sqlite3.rst:1746 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -"列名(column names)の :class:`リスト ` を :class:`文字列 ` として返" -"します。 クエリの直後であれば、それは :attr:`Cursor.description` の各タプルの" -"最初のメンバーです。" +":class:`文字列 ` で表した列名の :class:`リスト ` を返します。\n" +"クエリの直後では、列名は :attr:`Cursor.description` の各タプルの最初の要素で" +"す。" #: ../../library/sqlite3.rst:1750 msgid "Added support of slicing." @@ -3186,15 +3180,15 @@ msgid "" " return Point(x, y)" msgstr "" -#: ../../library/sqlite3.rst:2228 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -"与えられた SQLite 値をどの時点で変換すべきかを :mod:`!sqlite3` に伝える必要が" -"あります。これは、 :func:`connect` の *detect_types* パラメータを使用して、" -"データベースに接続する際に行います。 以下の 3 つの選択肢があります:" +"どの SQLite 値を変換すべきかを :mod:`!sqlite3` に伝える必要があります。\n" +"これは、 :func:`connect` の *detect_types* パラメータを使用して、データベース" +"に接続する際に行います。\n" +"以下の 3 つの選択肢があります:" #: ../../library/sqlite3.rst:2232 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" @@ -3485,16 +3479,15 @@ msgstr "" msgid "How to create and use row factories" msgstr "行工場(row factories)の作成方法と使用方法" -#: ../../library/sqlite3.rst:2501 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" "デフォルトでは、 :mod:`!sqlite3` は各行(row)を :class:`タプル ` として" -"表します。 :class:`!タプル` があなたのニーズと合わない場合は、 :class:" -"`sqlite3.Row` クラスまたはカスタム :attr:`~Cursor.row_factory` を使用できま" -"す。" +"表します。\n" +":class:`!tuple` があなたのニーズと合わない場合は、 :class:`sqlite3.Row` クラ" +"スまたはカスタム :attr:`~Cursor.row_factory` を使用できます。" #: ../../library/sqlite3.rst:2506 msgid "" @@ -3508,18 +3501,17 @@ msgstr "" "行工場(row factory)を使用するようにするために、 :class:`Connection." "row_factory` を設定することをお勧めします。" -#: ../../library/sqlite3.rst:2511 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " "To use :class:`!Row` as a row factory, assign it to the :attr:`!row_factory` " "attribute:" msgstr "" -":class:`!Row` は、 :class:`!タプル` に対してメモリ・オーバーヘッドとパフォー" -"マンスへの影響を最小限に抑えながら、列(row)へのインデックスによるアクセスと、" -"列への(大文字と小文字を区別しない)名前によるアクセスを提供します。 :class:`!" -"Row` を行工場(row factory)として使用するには、 :attr:`!row_factory` 属性に割" -"り当てます:" +":class:`!Row` は、 :class:`!tuple` に対してメモリ・オーバーヘッドとパフォーマ" +"ンスへの影響を最小限に抑えながら、列へのインデックスによるアクセスと、列への" +"(大文字と小文字を区別しない)名前によるアクセスを提供します。\n" +":class:`!Row` を行工場(row factory)として使用するには、 :attr:`!row_factory` " +"属性に割り当てます:" #: ../../library/sqlite3.rst:2516 msgid "" @@ -3571,12 +3563,11 @@ msgid "" " return {key: value for key, value in zip(fields, row)}" msgstr "" -#: ../../library/sqlite3.rst:2553 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -"これを使うと、クエリは :class:`!タプル` の代わりに :class:`!dict` を返すよう" -"になります:" +"これを使うと、クエリは :class:`!tuple` の代わりに :class:`!dict` を返すように" +"なります:" #: ../../library/sqlite3.rst:2555 msgid "" @@ -3687,17 +3678,17 @@ msgstr "説明" msgid "Transaction control" msgstr "トランザクション制御" -#: ../../library/sqlite3.rst:2648 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" "control-autocommit` is recommended, while :ref:`sqlite3-transaction-control-" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -":mod:`!sqlite3` は、データベース・トランザクションを開くかどうか、いつ、どの" -"ように開くかを制御する複数の方法を提供します。 :ref:`sqlite3-transaction-" -"control-autocommit` が推奨されますが、:ref:`sqlite3-transaction-control-" -"isolation-level` は Python 3.12 より前の動作を保持します。" +":mod:`!sqlite3` は、データベース・トランザクションを開閉するかどうか、いつ、" +"どのように開閉するかを制御する複数の方法を提供します。\n" +":ref:`sqlite3-transaction-control-autocommit` が推奨されますが、:ref:" +"`sqlite3-transaction-control-isolation-level` は Python 3.12 より前の動作を保" +"持します。" #: ../../library/sqlite3.rst:2657 msgid "Transaction control via the ``autocommit`` attribute" @@ -3721,7 +3712,6 @@ msgstr "" "*autocommit* を ``False`` に設定することをお勧めします。そうすると :pep:" "`249` 対応のトランザクション制御を行います。これは以下のことを意味します:" -#: ../../library/sqlite3.rst:2668 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -3729,11 +3719,12 @@ msgid "" "one, for the latter two). :mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements " "when opening transactions." msgstr "" -":mod:`!sqlite3` はトランザクションが常に開いていることを保証します。そのた" -"め、 :func:`connect` や :meth:`Connection.commit` や :meth:`Connection." -"rollback` は暗黙に新しいトランザクションを開きます(1つ目については保留中のト" -"ランザクションを閉じた直後で、後の2つについてはその直後に、です)。 :mod:`!" -"sqlite3` はトランザクションを開くときに ``BEGIN DEFERRED`` 文を使用します。" +":mod:`!sqlite3` はトランザクションが常に開いていることを保証します。\n" +"そのため、 :func:`connect` や :meth:`Connection.commit` や :meth:`Connection." +"rollback` は暗黙に新しいトランザクションを開きます(後者 2 つでは、保留中のト" +"ランザクションを閉じた直後に開きます)。\n" +":mod:`!sqlite3` はトランザクションを開くときに ``BEGIN DEFERRED`` 文を使用し" +"ます。" #: ../../library/sqlite3.rst:2673 msgid "Transactions should be committed explicitly using :meth:`!commit`." @@ -3747,13 +3738,12 @@ msgstr "" "トランザクションは、 :meth:`!rollback` を使用して明示的にロールバックする必要" "があります。" -#: ../../library/sqlite3.rst:2675 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -"データベースの保留中に行った変更は :meth:`~Connection.close` された場合、暗黙" -"のロールバックが実行されます。" +"未コミットの変更がある状態でデータベース接続を :meth:`~Connection.close` する" +"と、暗黙のロールバックが実行されます。" #: ../../library/sqlite3.rst:2678 msgid "" diff --git a/library/ssl.po b/library/ssl.po index f847d5186..ca0a90fff 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -427,16 +427,14 @@ msgstr "" "socket ` によって送出される :exc:`SSLError` サブクラス例外で" "す。" -#: ../../library/ssl.rst:286 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " "sent on the underlying TCP transport before the request can be fulfilled." msgstr "" -"読み出しあるいは書き込みを試みようとした際に、リクエストが遂行される前に下層" -"の TCP 転送が送信する必要があるデータが不足した場合に :ref:`non-blocking SSL " -"socket ` によって送出される :exc:`SSLError` サブクラス例外で" -"す。" +"読み出しや書き込みを試みた際に、リクエストを完了するために下層の TCP 転送でさ" +"らにデータを送信する必要がある場合に、:ref:`non-blocking SSL socket ` が送出する :exc:`SSLError` のサブクラスです。" #: ../../library/ssl.rst:295 msgid "" @@ -1518,14 +1516,13 @@ msgstr "" "``bytes`` インスタンスで返します。 *buffer* を指定すると、結果は代わりに " "buffer に読み込まれ、読み込んだバイト数を返します。" -#: ../../library/ssl.rst:1147 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the read would block." msgstr "" -"ソケットが :ref:`non-blocking ` で読み出しがブロックする" -"と、 :exc:`SSLWantReadError` もしくは :exc:`SSLWantWriteError` が送出されま" -"す。" +"ソケットが :ref:`ノンブロッキング ` で、読み出しに待機が必要" +"な場合は、:exc:`SSLWantReadError` もしくは :exc:`SSLWantWriteError` が送出さ" +"れます。" #: ../../library/ssl.rst:1150 msgid "" @@ -1557,14 +1554,13 @@ msgid "" "*data* argument must be an object supporting the buffer interface." msgstr "" -#: ../../library/ssl.rst:1166 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the write would block." msgstr "" -"ソケットが :ref:`non-blocking ` で書き込みがブロックする" -"と、 :exc:`SSLWantReadError` もしくは :exc:`SSLWantWriteError` が送出されま" -"す。" +"ソケットが :ref:`ノンブロッキング ` で、書き込みに待機が必要" +"な場合は、:exc:`SSLWantReadError` もしくは :exc:`SSLWantWriteError` が送出さ" +"れます。" #: ../../library/ssl.rst:1169 msgid "" @@ -2209,7 +2205,6 @@ msgstr "" "取得されます。 *certfile* への証明書の格納についての詳細は、 :ref:`ssl-" "certificates` の議論を参照してください。" -#: ../../library/ssl.rst:1578 msgid "" "The *password* argument may be a function to call to get the password for " "decrypting the private key. It will only be called if the private key is " @@ -2221,12 +2216,15 @@ msgid "" "encrypted and no password is needed." msgstr "" "*password* 引数に、秘密鍵を復号するためのパスワードを返す関数を与えることがで" -"きます。その関数は秘密鍵が暗号化されていて、なおかつパスワードが必要な場合に" -"のみ呼び出されます。その関数は引数なしで呼び出され、string, bytes, または " -"bytearray を返さなければなりません。戻り値が string の場合は鍵を復号化するの" -"に使う前に UTF-8 でエンコードされます。string の代わりに bytes や bytearray " -"を返した場合は *password* 引数に直接供給されます。秘密鍵が暗号化されていな" -"かったりパスワードを必要としない場合は、指定は無視されます。" +"きます。\n" +"その関数は秘密鍵が暗号化されていて、なおかつパスワードが必要な場合にのみ呼び" +"出されます。\n" +"その関数は引数なしで呼び出され、文字列、``bytes``、または ``bytearray`` を返" +"さなければなりません。\n" +"戻り値が文字列の場合は、鍵の復号に使う前に UTF-8 でエンコードされます。\n" +"関数の代わりに、文字列、``bytes``、または ``bytearray`` の値を *password* 引" +"数に直接指定することもできます。\n" +"秘密鍵が暗号化されておらず、パスワードが不要な場合は、指定は無視されます。" #: ../../library/ssl.rst:1587 msgid "" @@ -3689,7 +3687,6 @@ msgstr "" "振る舞いをします。ですのでノンブロッキングソケットとともに使う場合、いくつか" "気をつけなければならない事項があります:" -#: ../../library/ssl.rst:2622 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " @@ -3700,14 +3697,15 @@ msgid "" "underlying socket first, and attempts to *read* from the SSL socket may " "require a prior *write* to the underlying socket." msgstr "" -"ほとんどの :class:`SSLSocket` のメソッドは I/O 操作がブロックすると :exc:" +"ほとんどの :class:`SSLSocket` のメソッドは、I/O 操作に待機が必要な場合、:exc:" "`BlockingIOError` ではなく :exc:`SSLWantWriteError` か :exc:" -"`SSLWantReadError` のどちらかを送出します。 :exc:`SSLWantReadError` は下層の" -"ソケットで読み出しが必要な場合に送出され、 :exc:`SSLWantWriteError` は下層の" -"ソケットで書き込みが必要な場合に送出されます。SSL ソケットに対して *書き込み" -"* を試みると下層のソケットから最初に *読み出す* 必要があるかもしれず、SSL ソ" -"ケットに対して *読み出し* を試みると下層のソケットに先に *書き込む* 必要があ" -"るかもしれないことに注意してください。" +"`SSLWantReadError` のどちらかを送出します。\n" +":exc:`SSLWantReadError` は下層のソケットで読み出しが必要な場合に送出され、:" +"exc:`SSLWantWriteError` は下層のソケットで書き込みが必要な場合に送出されま" +"す。\n" +"SSL ソケットに対して *書き込み* を試みると下層のソケットから最初に *読み出す" +"* 必要がある場合があり、SSL ソケットに対して *読み出し* を試みると下層のソ" +"ケットに先に *書き込む* 必要がある場合もあることに注意してください。" #: ../../library/ssl.rst:2634 msgid "" diff --git a/library/statistics.po b/library/statistics.po index e3ce60e9c..616750a62 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -1079,16 +1079,15 @@ msgid "" "Fraction(67, 108)" msgstr "" -#: ../../library/statistics.rst:648 msgid "" "This is the sample variance s² with Bessel's correction, also known as " "variance with N-1 degrees of freedom. Provided that the data points are " "representative (e.g. independent and identically distributed), the result " "should be an unbiased estimate of the true population variance." msgstr "" -"Bessel 補正済みの標本分散 s²、すなわち自由度 N-1 の分散です。与えられたデータ" -"点が代表的 (たとえば独立で均等に分布) な場合、戻り値は母分散の不偏推定量にな" -"ります。" +"Bessel 補正済みの標本分散 s²、すなわち自由度 N-1 の分散です。\n" +"データ点が母集団を代表している場合 (たとえば独立で同一の分布に従う場合)、戻り" +"値は真の母分散の不偏推定量となります。" #: ../../library/statistics.rst:653 msgid "" diff --git a/library/textwrap.po b/library/textwrap.po index 48cbfb9ac..95761ec32 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -438,7 +438,6 @@ msgstr "" "ん。 (:attr:`width` を超える分を最小にするために、長い語は単独で一行に置かれ" "るでしょう。)" -#: ../../library/textwrap.rst:270 msgid "" "(default: ``True``) If true, wrapping will occur preferably on whitespaces " "and right after hyphens in compound words, as it is customary in English. If " @@ -447,11 +446,12 @@ msgid "" "want truly insecable words. Default behaviour in previous versions was to " "always allow breaking hyphenated words." msgstr "" -"(デフォルト: ``True``) 真の場合、英語で一般的なように、ラップ処理は空白か合成" -"語に含まれるハイフンの直後で行われます。偽の場合、空白だけが改行に適した位置" -"として判断されます。ただし、本当に語の途中で改行が行われないようにするために" -"は、 :attr:`break_long_words` 属性を真に設定する必要があります。過去のバー" -"ジョンでのデフォルトの振る舞いは、常にハイフンの直後での改行を許していまし" +"(デフォルト: ``True``) 真の場合、英語で一般的なように、ラップ処理はなるべく空" +"白か合成語に含まれるハイフンの直後で行われます。\n" +"偽の場合、空白だけが改行に適した位置として判断されます。\n" +"ただし、語の途中でまったく改行しないようにするには、:attr:`break_long_words` " +"属性も偽に設定する必要があります。\n" +"過去のバージョンでは、デフォルトで常にハイフンの直後での改行を許していまし" "た。" #: ../../library/textwrap.rst:280 diff --git a/library/threading.po b/library/threading.po index 0a1ab2efe..49c1baa62 100644 --- a/library/threading.po +++ b/library/threading.po @@ -412,16 +412,15 @@ msgstr "" msgid "This module also defines the following constant:" msgstr "このモジュールでは以下の定数も定義しています:" -#: ../../library/threading.rst:305 msgid "" "The maximum value allowed for the *timeout* parameter of blocking functions " "(:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.). " "Specifying a timeout greater than this value will raise an :exc:" "`OverflowError`." msgstr "" -"ブロックする関数 (:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:" -"`Condition.wait` など) の *timeout* 引数に許される最大値。これ以上の値を " -"timeout に指定すると :exc:`OverflowError` が発生します。" +"ブロックする関数 (:meth:`Lock.acquire`、:meth:`RLock.acquire`、:meth:" +"`Condition.wait` など) の *timeout* 引数に指定できる最大値です。\n" +"この値を超えるタイムアウトを指定すると :exc:`OverflowError` が送出されます。" #: ../../library/threading.rst:313 msgid "" @@ -1815,7 +1814,6 @@ msgstr "" "セマフォは :ref:`コンテキストマネージメントプロトコル ` もサポー" "トします。" -#: ../../library/threading.rst:1124 msgid "" "This class implements semaphore objects. A semaphore manages an atomic " "counter representing the number of :meth:`release` calls minus the number " @@ -1823,10 +1821,11 @@ msgid "" "blocks if necessary until it can return without making the counter negative. " "If not given, *value* defaults to 1." msgstr "" -"このクラスはセマフォ (semaphore) オブジェクトを実装します。セマフォは、 :" -"meth:`release` を呼び出した数から :meth:`acquire` を呼び出した数を引き、初期" -"値を足した値を表す極小のカウンタを管理します。 :meth:`acquire` メソッドは、カ" -"ウンタの値を負にせずに処理を戻せるまで必要ならば処理をブロックします。 " +"このクラスはセマフォ (semaphore) オブジェクトを実装します。\n" +"セマフォは、:meth:`release` を呼び出した回数から :meth:`acquire` を呼び出した" +"回数を引き、初期値を足した値を表すアトミックなカウンタを管理します。\n" +":meth:`acquire` メソッドは、カウンタの値を負にせずに処理を戻せるまで、必要に" +"応じてブロックします。\n" "*value* を指定しない場合、デフォルトの値は 1 になります。" #: ../../library/threading.rst:1130 diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index db43b7433..b0416094e 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -2134,13 +2134,12 @@ msgstr "" msgid "Ensure that *item* is visible." msgstr "*item* を見える状態にします。" -#: ../../library/tkinter.ttk.rst:1231 msgid "" "Sets all of *item*'s ancestors open option to ``True``, and scrolls the " "widget if necessary so that *item* is within the visible portion of the tree." msgstr "" -"*item* の全ての子孫の open オプションを ``True`` にし、必要であれば *item* が" -"ツリーの見える範囲に来るようにウィジェットをスクロールさせます。" +"*item* の全ての祖先の ``open`` オプションを ``True`` にし、必要であれば " +"*item* がツリーの見える範囲に来るようにウィジェットをスクロールさせます。" #: ../../library/tkinter.ttk.rst:1238 msgid "Returns a tuple of selected items." diff --git a/library/unittest.po b/library/unittest.po index 7ba87fe20..a8fb707b9 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -458,15 +458,15 @@ msgstr "" msgid "Stop the test run on the first error or failure." msgstr "初回のエラーもしくは失敗の時にテストを停止します。" -#: ../../library/unittest.rst:226 msgid "" "Only run test methods and classes that match the pattern or substring. This " "option may be used multiple times, in which case all test cases that match " "any of the given patterns are included." msgstr "" -"パターンや部分文字列にマッチするテストメソッドとテストクラスのみ実行します。" -"このオプションは複数回使うことができ、その場合はすべてのパターンにマッチする" -"テストケースが実行対象に含まれます。" +"パターンや部分文字列にマッチするテストメソッドとテストクラスのみ実行しま" +"す。\n" +"このオプションは複数回使うことができ、その場合は指定したパターンのいずれかに" +"マッチするすべてのテストケースが実行対象に含まれます。" #: ../../library/unittest.rst:230 msgid "" @@ -2275,13 +2275,12 @@ msgstr "" "行われます。これらのメソッドは (:func:`round` と同様に) *小数位* を指定するの" "であって、*有効桁数* を指定するのではないことに注意してください。" -#: ../../library/unittest.rst:1282 msgid "" "If *delta* is supplied instead of *places* then the difference between " "*first* and *second* must be less or equal to (or greater than) *delta*." msgstr "" "*places* の代わりに *delta* が渡された場合には、*first* と *second* の差分が " -"*delta* 以下 (以上) であることをテストします。" +"*delta* 以下 (または *delta* より大きい) であることをテストします。" #: ../../library/unittest.rst:1285 msgid "Supplying both *delta* and *places* raises a :exc:`TypeError`." diff --git a/library/urllib.error.po b/library/urllib.error.po index a4f27a7e4..553d8c563 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -56,25 +56,24 @@ msgid "" "instance." msgstr "このエラーの理由。メッセージ文字列あるいは他の例外インスタンスです。" -#: ../../library/urllib.error.rst:26 msgid "" ":exc:`URLError` used to be a subtype of :exc:`IOError`, which is now an " "alias of :exc:`OSError`." msgstr "" -":exc:`URLError` は以前は :exc:`IOError` のサブタイプでしたが、 :exc:" -"`OSError` のエイリアスになりました。" +":exc:`URLError` は以前は :exc:`IOError` のサブタイプでした。\n" +"現在では、``IOError`` は :exc:`OSError` のエイリアスです。" -#: ../../library/urllib.error.rst:33 msgid "" "Though being an exception (a subclass of :exc:`URLError`), an :exc:" "`HTTPError` can also function as a non-exceptional file-like return value " "(the same thing that :func:`~urllib.request.urlopen` returns). This is " "useful when handling exotic HTTP errors, such as requests for authentication." msgstr "" -":exc:`HTTPError` は例外 (:exc:`URLError` のサブクラス) ですが、同時に例外では" -"ない file-like な戻り値を返す関数でもあります (:func:`~urllib.request." -"urlopen` の戻り値と同じです)。これは、例えばサーバからの認証リクエストのよう" -"に、変わった HTTP エラーを処理するのに役立ちます。" +":exc:`HTTPError` は例外 (:exc:`URLError` のサブクラス) ですが、通常のファイル" +"のような戻り値 (:func:`~urllib.request.urlopen` が返すものと同じもの) として" +"も機能します。\n" +"これは、例えば認証の要求のような、特殊な HTTP エラーを処理する際に役立ちま" +"す。" #: ../../library/urllib.error.rst:41 msgid "Contains the request URL. An alias for *filename* attribute." diff --git a/library/urllib.request.po b/library/urllib.request.po index 5409f407f..d06702940 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -1152,17 +1152,18 @@ msgstr "" ":meth:`!_request` 形式のメソッドを持つすべてのハンドラーに対してそ" "のメソッドを呼び出し、リクエストのプリプロセスを行います。" -#: ../../library/urllib.request.rst:733 msgid "" "Handlers with a method named like :meth:`!_open` are called to " "handle the request. This stage ends when a handler either returns a non-\\ :" "const:`None` value (ie. a response), or raises an exception (usually :exc:" "`~urllib.error.URLError`). Exceptions are allowed to propagate." msgstr "" -":meth:`!_open` のようなメソッドでハンドラーが呼び出され、リクエスト" -"を処理します。このステージではハンドラーが非-\\ :const:`None` 値 (例: レスポ" -"ンス) か例外 (通常は :exc:`~urllib.error.URLError`) を返した時点で終了しま" -"す。例外は伝搬できます。" +":meth:`!_open` のような名前のメソッドを持つハンドラーが呼び出され、" +"リクエストを処理します。\n" +"このステージは、ハンドラーが :const:`None` 以外の値 (つまりレスポンス) を返す" +"か、\n" +"例外 (通常は :exc:`~urllib.error.URLError`) を送出すると終了します。\n" +"例外はそのまま伝播します。" #: ../../library/urllib.request.rst:738 msgid "" @@ -1448,7 +1449,6 @@ msgstr "" "の URL ではないリダイレクトされた URL が存在した場合、:exc:`~urllib.error." "HTTPError` 例外が送出されます。" -#: ../../library/urllib.request.rst:900 msgid "" "Return a :class:`Request` or ``None`` in response to a redirect. This is " "called by the default implementations of the :meth:`!http_error_30\\*` " @@ -1458,13 +1458,16 @@ msgid "" "exc:`~urllib.error.HTTPError` if no other handler should try to handle this " "URL, or return ``None`` if you can't but another handler might." msgstr "" -"リダイレクトへのレスポンスの :class:`Request` または ``None`` を返します。こ" -"れはサーバーからリダイレクションを受信した時に :meth:`!http_error_30\\*` メ" -"ソッドのデフォルトの実装によって呼び出されます。リダイレクションを行わなけれ" -"ばならない場合、*newurl* へのリダイレクトを実行するための :meth:`!" -"http_error_30\\*` を許可する新しい :class:`Request` を返します。その他の場" -"合、この URL を扱うその他のハンドラーがない場合は :exc:`~urllib.error." -"HTTPError` を、他のハンドラーでできそうな場合は ``None`` を返します。" +"リダイレクトに応じて :class:`Request` または ``None`` を返します。\n" +"サーバーからリダイレクトを受信すると、:meth:`!http_error_30\\*` メソッドのデ" +"フォルトの実装がこのメソッドを呼び出します。\n" +"リダイレクトを行う場合は、:meth:`!http_error_30\\*` が *newurl* へのリダイレ" +"クトを実行できるように、\n" +"新しい :class:`Request` を返します。\n" +"それ以外の場合、この URL をほかのハンドラーに処理させるべきでなければ :exc:" +"`~urllib.error.HTTPError` を送出し、\n" +"このハンドラーでは処理できなくてもほかのハンドラーなら処理できる可能性があれ" +"ば ``None`` を返します。" #: ../../library/urllib.request.rst:910 msgid "" diff --git a/library/weakref.po b/library/weakref.po index ce96411d5..5f7b4f257 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -182,7 +182,6 @@ msgid "" "documentation ` for details." msgstr "" -#: ../../library/weakref.rst:95 msgid "" "Return a weak reference to *object*. The original object can be retrieved " "by calling the reference object if the referent is still alive; if the " @@ -193,12 +192,16 @@ msgid "" "passed as the only parameter to the callback; the referent will no longer be " "available." msgstr "" -"*object* への弱参照を返します。リファレントがまだ生きているならば、元のオブ" -"ジェクトは参照オブジェクトの呼び出しで取り出せす。リファレントがもはや生きて" -"いないならば、参照オブジェクトを呼び出したときに :const:`None` を返します。 " -"*callback* に :const:`None` 以外の値を与えた場合、オブジェクトをまさに後始末" -"処理しようとするときに呼び出します。このとき弱参照オブジェクトは *callback* " -"の唯一のパラメタとして渡されます。リファレントはもはや利用できません。" +"*object* への弱参照を返します。\n" +"リファレントがまだ生きていれば、参照オブジェクトを呼び出すことで元のオブジェ" +"クトを取り出せます。\n" +"リファレントが生きていなければ、参照オブジェクトを呼び出すと :const:`None` が" +"返ります。\n" +"*callback* に :const:`None` 以外の値が指定され、返された弱参照オブジェクトが" +"まだ生きている場合、リファレントの後始末処理の直前にコールバックが呼び出され" +"ます。\n" +"コールバックには弱参照オブジェクトが唯一の引数として渡されますが、その時点で" +"リファレントは利用できません。" #: ../../library/weakref.rst:103 msgid "" @@ -242,9 +245,8 @@ msgstr "" "ントと同じ等価関係を持ちます。リファレントのどちらか一方が削除された場合、参" "照オブジェクトが同一である場合に限り、その参照は等価です。" -#: ../../library/weakref.rst:121 msgid "This is a subclassable type rather than a factory function." -msgstr "これはサブクラス化可能な型というよりファクトリ関数です。" +msgstr "これはファクトリ関数ではなく、サブクラス化可能な型です。" #: ../../library/weakref.rst:123 msgid "" @@ -369,7 +371,6 @@ msgstr "" ":pep:`584` で規定されている ``|`` 演算子と ``|=`` 演算子のサポートを追加しま" "した。" -#: ../../library/weakref.rst:200 msgid "" ":class:`WeakKeyDictionary` objects have an additional method that exposes " "the internal references directly. The references are not guaranteed to be " @@ -378,11 +379,11 @@ msgid "" "references that will cause the garbage collector to keep the keys around " "longer than needed." msgstr "" -":class:`WeakKeyDictionary` オブジェクトは、追加のメソッドを持ちます。このメ" -"ソッドは、内部の参照を直接公開します。その参照は、利用される時に生存している" -"とは限りません。なので、参照を利用する前に、その参照をチェックする必要があり" -"ます。これにより、必要なくなったキーの参照が残っているために、ガベージコレク" -"タがそのキーを削除できなくなる事態を避ける事ができます。" +":class:`WeakKeyDictionary` オブジェクトには、内部の弱参照を直接公開する追加の" +"メソッドがあります。\n" +"その参照先が利用時にも生きている保証はないため、弱参照を呼び出した結果を確認" +"してから使用する必要があります。\n" +"このメソッドを使うと、キーを必要以上に長く生存させる参照を作らずに済みます。" #: ../../library/weakref.rst:210 msgid "Return an iterable of the weak references to the keys." @@ -414,7 +415,6 @@ msgstr "" "要素への弱参照を持つ集合型。要素への強参照が無くなったときに、その要素は削除" "されます。" -#: ../../library/weakref.rst:238 msgid "" "A custom :class:`ref` subclass which simulates a weak reference to a bound " "method (i.e., a method defined on a class and looked up on an instance). " @@ -422,11 +422,11 @@ msgid "" "hold of it. :class:`WeakMethod` has special code to recreate the bound " "method until either the object or the original function dies::" msgstr "" -"拡張された :class:`ref` のサブクラスで、束縛されたメソッドへの弱参照をシミュ" -"レートします (つまり、クラスで定義され、インスタンスにあるメソッド)。\n" -"束縛されたメソッドは短命なので、標準の弱参照では保持し続けられません。\n" -":class:`WeakMethod` には、オブジェクトと元々の関数が死ぬまで束縛されたメソッ" -"ドを再作成する特別なコードがあります::" +"束縛されたメソッド (クラスで定義され、インスタンスから取得されるメソッド) へ" +"の弱参照をシミュレートする、:class:`ref` のカスタムサブクラスです。\n" +"束縛されたメソッドは短命なので、通常の弱参照では保持し続けられません。\n" +":class:`WeakMethod` には、オブジェクトまたは元の関数のどちらか一方が破棄され" +"るまで、束縛されたメソッドを再作成するための特別なコードがあります。 ::" #: ../../library/weakref.rst:244 msgid "" @@ -680,17 +680,17 @@ msgstr "" msgid "Example" msgstr "使用例" -#: ../../library/weakref.rst:439 msgid "" "This simple example shows how an application can use object IDs to retrieve " "objects that it has seen before. The IDs of the objects can then be used in " "other data structures without forcing the objects to remain alive, but the " "objects can still be retrieved by ID if they do." msgstr "" -"この簡単な例では、アプリケーションが以前に参照したオブジェクトを取り出すため" -"にオブジェクトIDを利用する方法を示します。オブジェクトに生きたままであること" -"を強制することなく、オブジェクトの IDを他のデータ構造の中で使うことができ、必" -"要に応じてIDからオブジェクトを取り出せます。" +"この簡単な例では、アプリケーションが以前に参照したオブジェクトを、オブジェク" +"ト ID を使って取り出す方法を示します。\n" +"オブジェクトを生存させ続けることなく、その ID を他のデータ構造で使用できま" +"す。\n" +"オブジェクトがまだ生きていれば、ID から取り出すこともできます。" #: ../../library/weakref.rst:448 msgid "" diff --git a/library/xml.dom.po b/library/xml.dom.po index 3da712603..191c8c104 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -466,7 +466,6 @@ msgstr "" "機能名 *feature* とバージョン番号 *version* で識別される機能(feature)が実装" "されていれば ``True`` を返します。" -#: ../../library/xml.dom.rst:218 msgid "" "Return a new :class:`Document` object (the root of the DOM), with a child :" "class:`Element` object having the given *namespaceUri* and *qualifiedName*. " @@ -475,13 +474,13 @@ msgid "" "arguments can also be ``None`` in order to indicate that no :class:`Element` " "child is to be created." msgstr "" -"新たな(DOMのスーパークラスである) :class:`Document` クラスのオブジェクトを返" -"します。このクラスは *namespaceUri* と *qualifiedName* が設定された子クラス :" -"class:`Element` のオブジェクトを所有しています。 *doctype* は :meth:" -"`createDocumentType` によって生成された :class:`DocumentType` クラスのオブ" -"ジェクト、または ``None`` である必要があります。 Python DOM APIでは、子クラス" -"である :class:`Element` を作成しないことを示すために、はじめの2つの引数を " -"``None`` に設定することができます。" +"指定された *namespaceUri* と *qualifiedName* を持つ :class:`Element` オブジェ" +"クトを子ノードとして含む、新しい :class:`Document` オブジェクト (DOM のルー" +"ト) を返します。\n" +"*doctype* は :meth:`createDocumentType` で作成した :class:`DocumentType` オブ" +"ジェクトか、``None`` でなければなりません。\n" +"Python DOM API では、:class:`Element` の子ノードを作成しないことを示すため" +"に、最初の 2 つの引数を ``None`` にすることもできます。" #: ../../library/xml.dom.rst:228 msgid "" diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index 1a396c3e1..a9196ce3d 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -221,29 +221,29 @@ msgstr "" msgid "Return the current :class:`~xml.sax.handler.DTDHandler`." msgstr "現在の :class:`~xml.sax.handler.DTDHandler` を返します。" -#: ../../library/xml.sax.reader.rst:133 msgid "" "Set the current :class:`~xml.sax.handler.DTDHandler`. If no :class:`~xml." "sax.handler.DTDHandler` is set, DTD events will be discarded." msgstr "" -"現在の :class:`~xml.sax.handler.DTDHandler` を返します。 :class:`~xml.sax." -"handler.DTDHandler` が設定されていな場合、DTD イベントは破棄されます。" +"現在の :class:`~xml.sax.handler.DTDHandler` を設定します。\n" +":class:`~xml.sax.handler.DTDHandler` が設定されていない場合、DTD イベントは破" +"棄されます。" #: ../../library/xml.sax.reader.rst:140 msgid "Return the current :class:`~xml.sax.handler.EntityResolver`." msgstr "現在の :class:`~xml.sax.handler.EntityResolver` を返します。" -#: ../../library/xml.sax.reader.rst:145 msgid "" "Set the current :class:`~xml.sax.handler.EntityResolver`. If no :class:" "`~xml.sax.handler.EntityResolver` is set, attempts to resolve an external " "entity will result in opening the system identifier for the entity, and fail " "if it is not available." msgstr "" -"現在の :class:`~xml.sax.handler.EntityResolver` を返します。 :class:`~xml." -"sax.handler.EntityResolver` が設定されていない場合、外部エンティティの解決を" -"試行することでエンティティのシステム識別子が開かれます。利用できない場合は失" -"敗します。" +"現在の :class:`~xml.sax.handler.EntityResolver` を設定します。\n" +":class:`~xml.sax.handler.EntityResolver` が設定されていない場合、外部エンティ" +"ティの解決を試みると、\n" +"エンティティのシステム識別子が開かれます。\n" +"利用できない場合は失敗します。" #: ../../library/xml.sax.reader.rst:153 msgid "Return the current :class:`~xml.sax.handler.ErrorHandler`." diff --git a/library/zipfile.po b/library/zipfile.po index 06a322415..b074fc70d 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -237,7 +237,6 @@ msgstr "" "ZIP ファイルを開きます。 *file* はファイルのパス (文字列) か、ファイルライク" "オブジェクト、 :term:`path-like object` のいずれかです。" -#: ../../library/zipfile.rst:186 msgid "" "The *mode* parameter should be ``'r'`` to read an existing file, ``'w'`` to " "truncate and write a new file, ``'a'`` to append to an existing file, or " @@ -250,16 +249,16 @@ msgid "" "``'a'`` and the file does not exist at all, it is created. If *mode* is " "``'r'`` or ``'a'``, the file should be seekable." msgstr "" -"*mode* パラメータには、既存のファイルを読み込む場合は ``'r'`` 、内容を消去し" -"て新しいファイルに書き込む場合は ``'w'`` 、既存のファイルの末尾に追加する場" -"合は ``'a'`` 、ファイルが存在しない場合にのみファイルを作成して書き込む場合" -"は ``'x'`` を指定します。\n" -"*mode* が ``'x'`` で *file* が既存のファイルを指している場合、 :exc:" -"`FileExistsError` が発生します。\n" -"*mode* が ``'a'`` で *file* が既存の ZIP ファイルを指している場合、新しい " -"ZIP アーカイブがそのファイルに追加されます。\n" -"*file* が ZIP ファイルでない場合は、ファイルの末尾にあたらしい ZIP アーカイブ" -"が追加されます。\n" +"*mode* 引数には、既存のファイルを読み込む場合は ``'r'``、内容を消去して新しい" +"ファイルとして書き込む場合は ``'w'``、既存のファイルの末尾に追加する場合は " +"``'a'``、ファイルが存在しない場合にのみファイルを作成して書き込む場合は " +"``'x'`` を指定します。\n" +"*mode* が ``'x'`` で *file* が既存のファイルを指している場合、:exc:" +"`FileExistsError` が送出されます。\n" +"*mode* が ``'a'`` で *file* が既存の ZIP ファイルを指している場合、その ZIP " +"ファイルにファイルが追加されます。\n" +"*file* が ZIP ファイルでない場合は、ファイルの末尾に新しい ZIP アーカイブが追" +"加されます。\n" "これは、既存のファイル (例えば :file:`python.exe`) に ZIP アーカイブを付け加" "える用途を想定したものです。\n" "*mode* が ``'a'`` で *file* が存在しない場合は、ファイルが作成されます。\n" diff --git a/library/zlib.po b/library/zlib.po index 884c4db2a..1fab1178d 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -375,17 +375,17 @@ msgstr "パラメータに *zdict* を追加しました。" msgid "Compression objects support the following methods:" msgstr "圧縮オブジェクトは以下のメソッドをサポートしています:" -#: ../../library/zlib.rst:236 msgid "" "Compress *data*, returning a bytes object containing compressed data for at " "least part of the data in *data*. This data should be concatenated to the " "output produced by any preceding calls to the :meth:`compress` method. Some " "input may be kept in internal buffers for later processing." msgstr "" -"*data* を圧縮し、圧縮されたデータを含むバイト列オブジェクトを返します。この文" -"字列は少なくとも *data* の一部分のデータに対する圧縮データを含みます。この" -"データは以前に呼んだ :meth:`compress` が返した出力と結合することができます。" -"入力の一部は以後の処理のために内部バッファに保存されることもあります。" +"*data* を圧縮し、その少なくとも一部に対応する圧縮データを含むバイト列オブジェ" +"クトを返します。\n" +"返されたデータは、以前の :meth:`compress` メソッドの呼び出しで得た出力に連結" +"する必要があります。\n" +"入力の一部は、後で処理するために内部バッファに保持されることがあります。" #: ../../library/zlib.rst:244 msgid "" From dfc54fc2ac6f86e9687be1287211c78a4985afe0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 26 Oct 2026 08:26:58 +0000 Subject: [PATCH 16/21] Merge 3.15 into 3.14 --- library/ssl.po | 96 +++++++++++++-------------- library/stat.po | 22 +++---- library/statistics.po | 13 ++-- library/string.po | 67 +++++++++---------- library/stringprep.po | 5 +- library/struct.po | 26 ++++---- library/subprocess.po | 109 ++++++++++++++++--------------- library/sys.po | 51 +++++++-------- library/sys_path_init.po | 8 +-- library/sysconfig.po | 12 ++-- library/syslog.po | 3 +- library/tarfile.po | 43 ++++++------ library/termios.po | 8 +-- library/test.po | 45 +++++++------ library/textwrap.po | 5 +- library/threading.po | 44 ++++++------- library/time.po | 38 +++++------ library/timeit.po | 22 +++---- library/tkinter.po | 17 ++--- library/tkinter.ttk.po | 39 +++++------ library/trace.po | 21 +++--- library/traceback.po | 29 ++++---- library/types.po | 7 +- library/typing.po | 21 +++--- library/unittest.mock.po | 64 +++++++++--------- library/unittest.po | 99 +++++++++++++--------------- library/urllib.parse.po | 42 ++++++------ library/urllib.request.po | 72 +++++++++----------- library/uuid.po | 34 +++++----- library/venv.po | 3 +- library/wave.po | 12 ++-- library/weakref.po | 10 +-- library/winreg.po | 35 +++++----- library/wsgiref.po | 21 +++--- library/xml.dom.po | 30 ++++----- library/xml.etree.elementtree.po | 68 +++++++++---------- library/xml.po | 3 +- library/xml.sax.handler.po | 17 ++--- library/xml.sax.po | 16 ++--- library/xml.sax.reader.po | 25 +++---- library/xml.sax.utils.po | 14 ++-- library/xmlrpc.client.po | 34 +++++----- library/xmlrpc.server.po | 5 +- library/zipapp.po | 98 ++++++++++++--------------- library/zipfile.po | 39 ++++++----- library/zlib.po | 10 +-- library/zoneinfo.po | 8 +-- 47 files changed, 716 insertions(+), 794 deletions(-) diff --git a/library/ssl.po b/library/ssl.po index ca0a90fff..02861e6b4 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -54,15 +54,14 @@ msgid "" "version 1.1.1." msgstr "" -#: ../../library/ssl.rst:30 msgid "" "Don't use this module without reading the :ref:`ssl-security`. Doing so may " "lead to a false sense of security, as the default settings of the ssl module " "are not necessarily appropriate for your application." msgstr "" -":ref:`ssl-security` を読まずにこのモジュールを使用しないでください。SSL のデ" -"フォルト設定はアプリケーションに十分ではないので、読まない場合はセキュリティ" -"に誤った意識を持ってしまうかもしれません。" +":ref:`ssl-security` を読まずにこのモジュールを使用しないでください。\n" +"ssl モジュールのデフォルト設定がアプリケーションに適しているとは限らないた" +"め、読まずに使うと安全だと思い込んでしまうおそれがあります。" msgid "Availability" msgstr "利用可能な環境" @@ -481,7 +480,6 @@ msgstr "例外は :exc:`SSLCertVerificationError` の別名になりました。 msgid "Random generation" msgstr "乱数生成" -#: ../../library/ssl.rst:337 msgid "" "Return *num* cryptographically strong pseudo-random bytes. Raises an :class:" "`SSLError` if the PRNG has not been seeded with enough data or if the " @@ -489,10 +487,10 @@ msgid "" "can be used to check the status of the PRNG and :func:`RAND_add` can be used " "to seed the PRNG." msgstr "" -"暗号学的に強固な擬似乱数の *num* バイトを返します。擬似乱数生成器に十分なデー" -"タでシードが与えられていない場合や、現在の RANDOM メソッドに操作がサポートさ" -"れていない場合は :class:`SSLError` を送出します。 :func:`RAND_status` を使っ" -"て擬似乱数生成器の状態をチェックできます。\n" +"暗号学的に強固な擬似乱数の *num* バイトを返します。\n" +"擬似乱数生成器に十分なデータでシードが与えられていない場合や、現在の RAND メ" +"ソッドに操作がサポートされていない場合は :class:`SSLError` を送出します。\n" +":func:`RAND_status` を使って擬似乱数生成器の状態をチェックできます。\n" ":func:`RAND_add` を使って擬似乱数生成器にシードを与えることができます。" #: ../../library/ssl.rst:343 @@ -566,15 +564,15 @@ msgstr "" "\"notBefore\" や \"notAfter\" の日付には GMT を使わなければなりません(:rfc:" "`5280`)。" -#: ../../library/ssl.rst:396 msgid "" "Interpret the input time as a time in UTC as specified by 'GMT' timezone in " "the input string. Local timezone was used previously. Return an integer (no " "fractions of a second in the input format)" msgstr "" -"入力文字列に指定された 'GMT' タイムゾーンを UTC として解釈するようになりまし" -"た。以前はローカルタイムで解釈していました。また、整数を返すようになりました" -"(入力に含まれる秒の端数を含まない)。" +"入力文字列の 'GMT' タイムゾーン指定に従い、入力時刻を UTC として解釈するよう" +"になりました。\n" +"以前はローカルタイムゾーンで解釈していました。\n" +"整数を返します (入力形式には秒の小数部分がありません)。" #: ../../library/ssl.rst:405 msgid "" @@ -648,21 +646,19 @@ msgstr "" ":attr:`capath` - capath の解決済みパス、またはディレクトリが存在しない場合は " "``None``" -#: ../../library/ssl.rst:445 msgid "" ":attr:`openssl_cafile_env` - OpenSSL's environment key that points to a " "cafile," -msgstr ":attr:`openssl_cafile_env` - cafile を指す OpenSSL の環境変数" +msgstr ":attr:`openssl_cafile_env` - cafile を指す OpenSSL の環境変数名" #: ../../library/ssl.rst:446 msgid ":attr:`openssl_cafile` - hard coded path to a cafile," msgstr ":attr:`openssl_cafile` - OpenSSL にハードコードされた cafile のパス" -#: ../../library/ssl.rst:447 msgid "" ":attr:`openssl_capath_env` - OpenSSL's environment key that points to a " "capath," -msgstr ":attr:`openssl_capath_env` - capath を指す OpenSSL の環境変数" +msgstr ":attr:`openssl_capath_env` - capath を指す OpenSSL の環境変数名" #: ../../library/ssl.rst:448 msgid ":attr:`openssl_capath` - hard coded path to a capath directory" @@ -811,7 +807,6 @@ msgstr "" "スト(CRLs)はチェックされません。デフォルトでは OpenSSL は CRLs を必要ともしま" "せんし検証にも使いません。" -#: ../../library/ssl.rst:562 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " "peer cert is checked but none of the intermediate CA certificates. The mode " @@ -819,11 +814,12 @@ msgid "" "ancestor CA). If no proper CRL has been loaded with :attr:`SSLContext." "load_verify_locations`, validation will fail." msgstr "" -":attr:`SSLContext.verify_flags` に渡せる値です。このモードでは、接続先の証明" -"書のみがチェックされ、仲介の CA 証明書はチェックされません。接続先証明書の発" -"行者(その CA の直接の祖先)によって署名された妥当な CRL が必要です。 :attr:" -"`SSLContext.load_verify_locations` で相応しい CRL をロードしていなければ、検" -"証は失敗します。" +":attr:`SSLContext.verify_flags` に指定できる値です。\n" +"このモードでは接続先の証明書だけを検証し、中間 CA 証明書は検証しません。\n" +"接続先証明書の発行者 (その証明書の直接の上位 CA) が署名した有効な CRL が必要" +"です。\n" +":attr:`SSLContext.load_verify_locations` で適切な CRL をロードしていない場" +"合、検証に失敗します。" #: ../../library/ssl.rst:572 msgid "" @@ -958,15 +954,15 @@ msgstr "" "チャンネル暗号化プロトコルとしてTLSバージョン 1.2 を選択します。 openssl " "version 1.0.1+ のみで利用可能です。" -#: ../../library/ssl.rst:704 msgid "" "Enables workarounds for various bugs present in other SSL implementations. " "This option is set by default. It does not necessarily set the same flags " "as OpenSSL's ``SSL_OP_ALL`` constant." msgstr "" "相手にする SSL 実装のさまざまなバグを回避するためのワークアラウンドを有効にし" -"ます。このオプションはデフォルトで有効です。これを有効にする場合 OpenSSL 用の" -"同じ意味のフラグ ``SSL_OP_ALL`` をセットする必要はありません。" +"ます。\n" +"このオプションはデフォルトで有効です。\n" +"OpenSSL の ``SSL_OP_ALL`` 定数と同じフラグを設定するとは限りません。" #: ../../library/ssl.rst:712 msgid "" @@ -1582,7 +1578,6 @@ msgstr "" ":meth:`~SSLSocket.write` の代わりに :meth:`~SSLSocket.send` を使用してくださ" "い。" -#: ../../library/ssl.rst:1181 msgid "" "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-" "level methods that read and write unencrypted, application-level data and " @@ -1590,11 +1585,11 @@ msgid "" "active SSL connection, i.e. the handshake was completed and :meth:`SSLSocket." "unwrap` was not called." msgstr "" -":meth:`~SSLSocket.read`, :meth:`~SSLSocket.write` メソッドは下位レベルのメ" -"ソッドであり、暗号化されていないアプリケーションレベルのデータを読み書きし、" -"それを復号/暗号化して暗号化された書き込みレベルのデータにします。これらのメ" -"ソッドはアクティブな SSL 接続つまり、ハンドシェイクが完了していて、 :meth:" -"`SSLSocket.unwrap` が呼ばれていないことを必要とします。" +":meth:`~SSLSocket.read` と :meth:`~SSLSocket.write` は低水準のメソッドで、暗" +"号化されていないアプリケーションレベルのデータを読み書きし、通信路上の暗号化" +"されたデータとの間で復号・暗号化を行います。\n" +"これらのメソッドにはアクティブな SSL 接続、つまりハンドシェイクが完了し、:" +"meth:`SSLSocket.unwrap` が呼ばれていない接続が必要です。" #: ../../library/ssl.rst:1187 msgid "" @@ -1941,13 +1936,11 @@ msgstr "" "``\"TLSv1.1\"``, ``\"TLSv1.2\"`` などが返ります。最新の OpenSSL はもっと色々" "な値を定義しているかもしれません。" -#: ../../library/ssl.rst:1422 msgid "" "Returns the number of already decrypted bytes available for read, pending on " "the connection." msgstr "" -"接続において既に復号済みで読み出し可能で保留になっているバイト列の数を返しま" -"す。" +"接続上に保留されている、復号済みで読み出し可能なデータのバイト数を返します。" #: ../../library/ssl.rst:1427 msgid "The :class:`SSLContext` object this SSL socket is tied to." @@ -2169,14 +2162,13 @@ msgstr "" msgid ":class:`SSLContext` objects have the following methods and attributes:" msgstr ":class:`SSLContext` オブジェクトは以下のメソッドと属性を持っています:" -#: ../../library/ssl.rst:1555 msgid "" "Get statistics about quantities of loaded X.509 certificates, count of X.509 " "certificates flagged as CA certificates and certificate revocation lists as " "dictionary." msgstr "" -"ロードされた X.509 証明書の数、CA 証明書で活性の X.509 証明書の数、証明書失効" -"リストの数、についての統計情報を辞書として取得します。" +"ロードされた X.509 証明書の数、CA 証明書としてフラグが設定された X.509 証明書" +"の数、証明書失効リストの数を辞書として取得します。" #: ../../library/ssl.rst:1559 msgid "Example for a context with one CA cert and one other cert::" @@ -2522,7 +2514,6 @@ msgstr "" "このメソッドは :data:`HAS_ALPN` が ``False`` の場合 :exc:" "`NotImplementedError` を送出します。" -#: ../../library/ssl.rst:1809 msgid "" "Specify which protocols the socket should advertise during the SSL/TLS " "handshake. It should be a list of strings, like ``['http/1.1', 'spdy/2']``, " @@ -2533,12 +2524,14 @@ msgid "" "`SSLSocket.selected_npn_protocol` method will return the agreed-upon " "protocol." msgstr "" -"SSL/TLS ハンドシェイク時にソケットが提示すべきプロトコルを指定します。 " +"SSL/TLS ハンドシェイク時にソケットが提示すべきプロトコルを指定します。\n" "``['http/1.1', 'spdy/2']`` のような推奨順に並べた文字列のリストでなければなり" -"ません。プロトコルの選択は `Application Layer Protocol Negotiation `_ に従いハンド" -"シェイク中に行われます。ハンドシェイクが正常に終了した後、 :meth:`SSLSocket." -"selected_alpn_protocol` メソッドは合意されたプロトコルを返します。" +"ません。\n" +"プロトコルの選択は `Application Layer Protocol Negotiation `_ に従いハンドシェ" +"イク中に行われます。\n" +"ハンドシェイクが正常に終了した後、 :meth:`SSLSocket.selected_npn_protocol` メ" +"ソッドは合意されたプロトコルを返します。" #: ../../library/ssl.rst:1817 msgid "" @@ -2665,7 +2658,6 @@ msgid "" "message to the client." msgstr "" -#: ../../library/ssl.rst:1901 msgid "" "Load the key generation parameters for Diffie-Hellman (DH) key exchange. " "Using DH key exchange improves forward secrecy at the expense of " @@ -2673,10 +2665,11 @@ msgid "" "parameter should be the path to a file containing DH parameters in PEM " "format." msgstr "" -"ディフィー・ヘルマン(DH)鍵交換のための鍵生成パラメータをロードします。DH 鍵交" -"換を用いることは、(サーバ、クライアントともに)計算機リソースに高い処理負荷を" -"かけますがセキュリティを向上させます。 *dhfile* パラメータは PEM フォーマット" -"の DH パラメータを含んだファイルへのパスでなければなりません。" +"ディフィー・ヘルマン(DH)鍵交換のための鍵生成パラメータをロードします。\n" +"DH 鍵交換を用いることは、(サーバ、クライアントともに)計算機リソースに高い処理" +"負荷をかけますが前方秘匿性を向上させます。\n" +"*dhfile* パラメータは PEM フォーマットの DH パラメータを含んだファイルへのパ" +"スでなければなりません。" #: ../../library/ssl.rst:1907 msgid "" @@ -4065,13 +4058,12 @@ msgid "" "position." msgstr "メモリ BIOが現在ファイルの末尾にあるかを表す真偽値です。" -#: ../../library/ssl.rst:2799 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -"メモリバッファから最大 *n* 読み取ります。*n* が指定されていないか、負値の場" -"合、すべてのバイトが返されます。" +"メモリバッファから最大 *n* バイト読み取ります。\n" +"*n* が指定されていないか負の場合は、すべてのバイトを返します。" #: ../../library/ssl.rst:2804 msgid "" diff --git a/library/stat.po b/library/stat.po index 7765910ba..b9ecf68fd 100644 --- a/library/stat.po +++ b/library/stat.po @@ -323,11 +323,9 @@ msgid "" "chmod`:" msgstr "以下のフラグは、 :func:`os.chmod` の *mode* 引数に使うこともできます:" -#: ../../library/stat.rst:264 msgid "Set UID bit." -msgstr "UID ビットを設定する。" +msgstr "set-user-ID ビット。" -#: ../../library/stat.rst:268 msgid "" "Set-group-ID bit. This bit has several special uses. For a directory it " "indicates that BSD semantics is to be used for that directory: files created " @@ -337,14 +335,16 @@ msgid "" "execution bit (:data:`S_IXGRP`) set, the set-group-ID bit indicates " "mandatory file/record locking (see also :data:`S_ENFMT`)." msgstr "" -"グループIDビットを設定する。このビットには幾つかの特殊ケースがあります。ディ" -"レクトリに対して設定されていた場合、 BSD のセマンティクスが利用される事を示し" -"ています。すなわち、そこに作成されるファイルは、作成したプロセスの有効グルー" -"プID (effective group ID) ではなくそのディレクトリのグループIDを継承し、そこ" -"に作成されるディレクトリにも :data:`S_ISGID` ビットが設定されます。グループ実" -"行ビット (:data:`S_IXGRP`) が設定されていないファイルに対してこのビットが設定" -"されていた場合、強制ファイル/レコードロックを意味します (:data:`S_ENFMT` も参" -"照してください)。" +"set-group-ID ビット。\n" +"このビットには幾つかの特殊ケースがあります。\n" +"ディレクトリに対して設定されていた場合、 BSD のセマンティクスが利用される事を" +"示しています。\n" +"すなわち、そこに作成されるファイルは、作成したプロセスの有効グループID " +"(effective group ID) ではなくそのディレクトリのグループIDを継承し、そこに作成" +"されるディレクトリにも :data:`S_ISGID` ビットが設定されます。\n" +"グループ実行ビット (:data:`S_IXGRP`) が設定されていないファイルに対してこの" +"ビットが設定されていた場合、強制ファイル/レコードロックを意味します (:data:" +"`S_ENFMT` も参照してください)。" #: ../../library/stat.rst:279 msgid "" diff --git a/library/statistics.po b/library/statistics.po index 616750a62..9c783859a 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -262,9 +262,8 @@ msgstr "データの標本標準偏差。" msgid ":func:`variance`" msgstr ":func:`variance`" -#: ../../library/statistics.rst:97 msgid "Sample variance of data." -msgstr "データの標本標準分散。" +msgstr "データの標本分散。" #: ../../library/statistics.rst:101 msgid "Statistics for relations between two inputs" @@ -656,15 +655,13 @@ msgid "" msgstr "" "データが離散的で、中央値がデータ点にない値でも構わない場合に適しています。" -#: ../../library/statistics.rst:362 msgid "" "If the data is ordinal (supports order operations) but not numeric (doesn't " "support addition), consider using :func:`median_low` or :func:`median_high` " "instead." msgstr "" -"もしあなたのデータが(注文操作をサポートする)序数で、(追加操作をサポートし" -"ない)数値でないならば、代わりに :func:`median_low` または :func:" -"`median_high` の使用を検討してください。" +"データの順序は比較できても、数値ではなく加算できない場合は、代わりに :func:" +"`median_low` または :func:`median_high` の使用を検討してください。" #: ../../library/statistics.rst:368 msgid "" @@ -1030,9 +1027,9 @@ msgstr "" "データが母集団の標本であるときに用いてください。母集団全体から分散を計算する" "には :func:`pvariance` を参照してください。" -#: ../../library/statistics.rst:611 msgid "Raises :exc:`StatisticsError` if *data* has fewer than two values." -msgstr "*data* の値が2より少ない場合 :exc:`StatisticsError` を送出します。" +msgstr "" +"*data* に含まれる値が 2 個未満の場合は :exc:`StatisticsError` を送出します。" #: ../../library/statistics.rst:615 msgid "" diff --git a/library/string.po b/library/string.po index 4dd75c915..e5f4af54f 100644 --- a/library/string.po +++ b/library/string.po @@ -272,13 +272,12 @@ msgstr "" "`check_unused_args` は、確認の結果が偽である場合に例外を送出するものとみなさ" "れます。" -#: ../../library/string.rst:182 msgid "" ":meth:`format_field` simply calls the global :func:`format` built-in. The " "method is provided so that subclasses can override it." msgstr "" -":meth:`format_field` は単純に組み込みのグローバル関数 :func:`format` を呼び出" -"します。このメソッドは、サブクラスをオーバーライドするために提供されます。" +":meth:`format_field` は組み込み関数 :func:`format` を呼び出すだけです。\n" +"サブクラスでこのメソッドをオーバーライドできるように用意されています。" #: ../../library/string.rst:187 msgid "" @@ -446,16 +445,16 @@ msgstr "" "\"Bring out the holy {name!r}\" # Calls repr() on the argument first\n" "\"More {!a}\" # Calls ascii() on the argument first" -#: ../../library/string.rst:287 msgid "" "The *format_spec* field contains a specification of how the value should be " "presented, including such details as field width, alignment, padding, " "decimal precision and so on. Each value type can define its own " "\"formatting mini-language\" or interpretation of the *format_spec*." msgstr "" -"*format_spec* フィールドは、フィールド幅、文字揃え、埋め方、精度などの、値を" -"表現する仕様を含みます。それぞれの値の型は、 \"formatting mini-language\" 、" -"または、 *format_spec* の実装で定義されます。" +"*format_spec* フィールドは、フィールド幅、文字揃え、埋め文字、10 進数の精度な" +"ど、値の表示方法を指定します。\n" +"それぞれの値の型は、独自の「書式指定ミニ言語」、つまり *format_spec* の解釈を" +"定義できます。" #: ../../library/string.rst:292 msgid "" @@ -571,13 +570,10 @@ msgstr "" msgid "``'>'``" msgstr "``'>'``" -#: ../../library/string.rst:364 msgid "" "Forces the field to be right-aligned within the available space (this is the " "default for numbers)." -msgstr "" -"利用可能なスペースにおいて、右詰めを強制します (いくつかのオブジェクトにおい" -"てのデフォルト)。" +msgstr "利用可能なスペース内で右詰めにします (数値のデフォルトです)。" #: ../../library/string.rst:367 msgid "``'='``" @@ -976,7 +972,6 @@ msgstr "" "``p`` に丸めた上で、数値の大きさに応じて固定小数点表記または科学的表記で表し" "ます。精度 ``0`` は精度 ``1`` と同じものと取り扱われます。" -#: ../../library/string.rst:582 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -989,15 +984,16 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" "正確なルールは次の通りです: 書式 ``'e'`` 型および精度 ``p-1`` 桁で数値を" -"フォーマットした結果、指数部が ``exp`` になったと仮定します。このとき ``m <= " -"exp < p`` ならば、数値は書式 ``'f'`` 型および精度 ``p-1-exp`` 桁でフォーマッ" -"トされます。ただし ``m`` は浮動小数点数では -4 であり、 :class:`Decimals " -"` に対しては -6 です。それ以外の場合、数値は書式 ``'e'`` 型" -"および精度 ``p-1`` 桁でフォーマットされます。どちらの場合でも、仮数部の有効で" -"ない末尾のゼロは取り除かれます。また小数点以下に表示する桁が無い場合、 " -"``'#'`` オプションが使われた場合をのぞき、小数点は除去されます。" +"フォーマットした結果、指数部が ``exp`` になったと仮定します。\n" +"このとき ``m <= exp < p`` ならば、数値は書式 ``'f'`` 型および精度 ``p-1-" +"exp`` 桁でフォーマットされます。\n" +"ただし ``m`` は浮動小数点数では -4 であり、 :class:`Decimals ` に対しては -6 です。\n" +"それ以外の場合、数値は書式 ``'e'`` 型および精度 ``p-1`` 桁でフォーマットされ" +"ます。\n" +"どちらの場合も、``'#'`` オプションが使われていなければ、仮数部の有効でない末" +"尾のゼロを取り除き、小数点以下に桁が残らなければ小数点も取り除きます。" -#: ../../library/string.rst:595 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -1006,11 +1002,12 @@ msgid "" "place value of the least significant digit is larger than 1, and fixed-point " "notation is used otherwise." msgstr "" -"精度が指定されない場合、 :class:`float` に対しては有効桁数として ``6`` 桁を適" -"用します。 :class:`~decimal.Decimal` では、フォーマット結果の係数部は実際の" -"値の桁数によって決まります; 絶対値が ``1e-6`` より小さい値や、最下位桁の値が1" -"より大きい値では科学的表記が使われます。それ以外の場合は固定小数点表記が使わ" -"れます。" +"精度が指定されていない場合、:class:`float` には有効桁数 ``6`` 桁を使用しま" +"す。\n" +":class:`~decimal.Decimal` では、元の値の係数の各桁から結果の係数を構成しま" +"す。\n" +"絶対値が ``1e-6`` より小さい値や、最下位桁が十の位以上にある値には科学的表記" +"を使用し、それ以外には固定小数点表記を使用します。" #: ../../library/string.rst:604 msgid "" @@ -1608,7 +1605,6 @@ msgstr "" "の書式、区切り文字、テンプレート文字列の解釈に使われている正規表現全体をカス" "タマイズできます。こうした作業には、以下のクラス属性をオーバライドします:" -#: ../../library/string.rst:934 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1617,13 +1613,13 @@ msgid "" "delimiter after class creation (i.e. a different delimiter must be set in " "the subclass's class namespace)." msgstr "" -"*delimiter* -- プレースホルダの開始を示すリテラル文字列です。\n" -"デフォルトの値は ``$`` です。\n" -"実装系はこの文字列に対して必要に応じて :meth:`re.escape` を呼び出すので、正規" -"表現になってしまうような文字列にしては *なりません* 。\n" -"さらにクラスを作成した後に delimiter を変更できない (つまり、別の delimiter " -"を設定したいのであれば、サブクラスの名前空間で行わなければならない) ことに注" -"意してください。" +"*delimiter* -- プレースホルダーの開始を示すリテラル文字列です。\n" +"デフォルト値は ``$`` です。\n" +"実装は必要に応じてこの文字列に :meth:`re.escape` を適用するので、正規表現とし" +"て指定しては *なりません* 。\n" +"クラスの作成後に区切り文字を変更することはできません。\n" +"別の区切り文字を使うには、サブクラスのクラス名前空間で設定する必要がありま" +"す。" #: ../../library/string.rst:941 msgid "" @@ -1706,13 +1702,12 @@ msgstr "" "*named* -- このグループは波括弧でくくらないプレースホルダ名に対応します; キャ" "プチャグループに区切り文字を含めてはなりません。" -#: ../../library/string.rst:985 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." msgstr "" -"*braced* -- このグループは波括弧でくくったプレースホルダ名に対応します; キャ" -"プチャグループに区切り文字を含めてはなりません。" +"*braced* -- このグループは波括弧で囲んだプレースホルダー名に対応します。\n" +"キャプチャグループには区切り文字も波括弧も含めてはなりません。" #: ../../library/string.rst:988 msgid "" diff --git a/library/stringprep.po b/library/stringprep.po index a5c20e054..39ebeca0f 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -91,11 +91,10 @@ msgstr "" "*code* がテーブル A.1 (Unicode 3.2 における未割り当てコードポイント: " "unassigned code point) かどうか判定します。" -#: ../../library/stringprep.rst:46 msgid "Determine whether *code* is in tableB.1 (Commonly mapped to nothing)." msgstr "" -"*code* がテーブル B.1 (一般には何にも対応付けられていない: commonly mapped " -"to nothing) かどうか判定します。" +"*code* がテーブル B.1 (通常、空文字列に対応付けて削除する文字) に含まれるかど" +"うかを判定します。" #: ../../library/stringprep.rst:51 msgid "" diff --git a/library/struct.po b/library/struct.po index cc48ae042..acf105cca 100644 --- a/library/struct.po +++ b/library/struct.po @@ -360,7 +360,6 @@ msgstr "" msgid "Format Characters" msgstr "書式指定文字" -#: ../../library/struct.rst:218 msgid "" "Format characters have the following meaning; the conversion between C and " "Python values should be obvious given their types. The 'Standard size' " @@ -369,12 +368,13 @@ msgid "" "``'!'`` or ``'='``. When using native size, the size of the packed value is " "platform-dependent." msgstr "" -"フォーマット文字 (format character) は以下の意味を持っています; C と Python " -"の間の変換では、値は正確に以下に指定された型でなくてはなりません: 「標準のサ" -"イズ」列は standard サイズ使用時にパックされた値が何バイトかを示します。つま" -"り、フォーマット文字列が ``'<'``, ``'>'``, ``'!'``, ``'='`` のいずれかで始" -"まっている場合のものです。native サイズ使用時にはパックされた値の大きさはプ" -"ラットフォーム依存です。" +"書式指定文字には以下の意味があります。\n" +"C と Python の値の変換関係は、表に示すそれぞれの型から分かります。\n" +"「標準のサイズ」列は standard サイズ使用時にパックされた値が何バイトかを示し" +"ます。\n" +"つまり、フォーマット文字列が ``'<'``, ``'>'``, ``'!'``, ``'='`` のいずれかで" +"始まっている場合のものです。\n" +"native サイズ使用時にはパックされた値の大きさはプラットフォーム依存です。" #: ../../library/struct.rst:226 msgid "Format" @@ -747,7 +747,6 @@ msgstr "" "binary16(``'e'`` の場合) フォーマットが、プラットフォームにおける浮動小数点数" "のフォーマットに関係なく使われます。" -#: ../../library/struct.rst:326 msgid "" "The ``'P'`` format character is only available for the native byte ordering " "(selected as the default or with the ``'@'`` byte order character). The byte " @@ -756,9 +755,9 @@ msgid "" "ordering, so the ``'P'`` format is not available." msgstr "" "``'P'`` フォーマット文字はネイティブバイトオーダでのみ利用可能です (デフォル" -"トのネットワークバイトオーダに設定するか、``'@'`` バイトオーダ指定文字を指定" -"しなければなりません)。``'='`` を指定した場合、ホスト計算機のバイトオーダに基" -"づいてリトルエンディアンとビッグエンディアンのどちらを使うかを決めます。" +"トの設定を使うか、``'@'`` バイトオーダ指定文字を指定しなければなりません)。\n" +"``'='`` を指定した場合、ホスト計算機のバイトオーダに基づいてリトルエンディア" +"ンとビッグエンディアンのどちらを使うかを決めます。\n" "struct モジュールはこの設定をネイティブのオーダ設定として解釈しないので、" "``'P'`` を使うことはできません。" @@ -852,13 +851,12 @@ msgstr "" "き ``x`` がフォーマットの適切な値の範囲に無い場合、 :exc:`struct.error` が送" "出されます。" -#: ../../library/struct.rst:400 msgid "" "Previously, some of the integer formats wrapped out-of-range values and " "raised :exc:`DeprecationWarning` instead of :exc:`struct.error`." msgstr "" -"以前は、いくつかの整数フォーマットが適切な範囲にない値を覆い隠して、 :exc:" -"`struct.error` の代わりに :exc:`DeprecationWarning` を送出していました。" +"以前は、一部の整数フォーマットでは範囲外の値を範囲内に折り返し、:exc:`struct." +"error` の代わりに :exc:`DeprecationWarning` を送出していました。" #: ../../library/struct.rst:406 msgid "" diff --git a/library/subprocess.po b/library/subprocess.po index 3a610a741..53fa5687e 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -71,15 +71,15 @@ msgstr "" msgid "Using the :mod:`!subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:30 msgid "" "The recommended approach to invoking subprocesses is to use the :func:`run` " "function for all use cases it can handle. For more advanced use cases, the " "underlying :class:`Popen` interface can be used directly." msgstr "" -"サブプロセスを起動するために推奨される方法は、すべての用法を扱える :func:" -"`run` 関数を使用することです。より高度な用法では下層の :class:`Popen` イン" -"ターフェースを直接使用することもできます。" +"サブプロセスの起動には、:func:`run` 関数で対応できる用途であればこの関数を使" +"うことを推奨します。\n" +"より高度な用途では、下層の :class:`Popen` インターフェースを直接使用できま" +"す。" #: ../../library/subprocess.rst:40 msgid "" @@ -89,7 +89,6 @@ msgstr "" "*args* で指定されたコマンドを実行します。コマンドの完了を待って、:class:" "`CompletedProcess` インスタンスを返します。" -#: ../../library/subprocess.rst:43 msgid "" "The arguments shown above are merely the most common ones, described below " "in :ref:`frequently-used-arguments` (hence the use of keyword-only notation " @@ -100,10 +99,12 @@ msgid "" msgstr "" "上記の引数は、もっともよく使われるものだけ示しており、後述の :ref:" "`frequently-used-arguments` で説明されています (そのためここではキーワード専" -"用引数の表記に省略されています)。関数の完全な使用法を説明しても大部分が :" -"class:`Popen` コンストラクターの内容と同じになります - この関数のほとんどの引" -"数は ``Popen`` インターフェイスに渡されます。(*timeout*、*input* および " -"*check* は除く。)" +"用引数の表記に省略されています)。\n" +"関数の完全な使用法を説明しても大部分が :class:`Popen` コンストラクターの内容" +"と同じになります - この関数のほとんどの引数は ``Popen`` インターフェイスに渡" +"されます。\n" +"(*timeout*、*input*、*check*、*capture_output* は除きます。\n" +")" #: ../../library/subprocess.rst:50 msgid "" @@ -163,7 +164,6 @@ msgstr "" "れています。そうでない場合、デフォルトでこれらのファイルオブジェクトはバイナ" "リモードでオープンされます。" -#: ../../library/subprocess.rst:85 msgid "" "If *env* is not ``None``, it must be a mapping that defines the environment " "variables for the new process; these are used instead of the default " @@ -172,11 +172,15 @@ msgid "" "or bytes to bytes on POSIX platforms much like :data:`os.environ` or :data:" "`os.environb`." msgstr "" -"*env* が ``None`` 以外の場合、これは新しいプロセスでの環境変数を定義します。" -"デフォルトでは、子プロセスは現在のプロセスの環境変数を引き継ぎます。 :class:" -"`Popen` に直接渡されます。あらゆるプラットフォームで :data:`os.environ` のよ" -"うに文字列から文字列へ、またPOSIX プラットフォームにおいては :data:`os." -"environb` のようにバイトからバイトへも、定義すること出来ます。" +"*env* が ``None`` でない場合は、新しいプロセスの環境変数を定義するマッピング" +"を指定します。\n" +"現在のプロセスの環境を継承するデフォルトの動作に代わり、このマッピングが使用" +"されます。\n" +":class:`Popen` に直接渡されます。\n" +":data:`os.environ` と同様に、どのプラットフォームでも文字列から文字列へのマッ" +"ピングを使用できます。\n" +"POSIX では :data:`os.environb` と同様に、バイト列からバイト列へのマッピングも" +"使用できます。" #: ../../library/subprocess.rst:92 msgid "Examples::" @@ -198,9 +202,8 @@ msgid "" "stdout=b'crw-rw-rw- 1 root root 1, 3 Jan 23 16:23 /dev/null\\n', stderr=b'')" msgstr "" -#: ../../library/subprocess.rst:110 msgid "Added *encoding* and *errors* parameters" -msgstr "*encoding* と *error* が引数に追加されました。" +msgstr "*encoding* と *errors* が引数に追加されました。" #: ../../library/subprocess.rst:114 msgid "" @@ -252,15 +255,15 @@ msgstr "" "負の値 ``-N`` は子プロセスがシグナル ``N`` により中止させられたことを示しま" "す (POSIX のみ)。" -#: ../../library/subprocess.rst:143 msgid "" "Captured stdout from the child process. A bytes sequence, or a string if :" "func:`run` was called with an encoding, errors, or text=True. ``None`` if " "stdout was not captured." msgstr "" -"子プロセスから補足された標準出力です。バイト列、もしくは :func:`run` でエン" -"コーディングが指定された場合、エラーの場合、text=True が指定された場合は文字" -"列です。標準出力が補足できなかったら ``None`` になります。" +"子プロセスから捕捉した標準出力です。\n" +"通常はバイト列ですが、:func:`run` に ``encoding`` または ``errors`` を指定し" +"た場合や、``text=True`` で呼び出した場合は文字列になります。\n" +"標準出力を捕捉していない場合は ``None`` です。" #: ../../library/subprocess.rst:147 msgid "" @@ -271,15 +274,15 @@ msgstr "" "ラー出力が混合されたものがこの属性に格納され、:attr:`stderr` は ``None`` にな" "ります。" -#: ../../library/subprocess.rst:153 msgid "" "Captured stderr from the child process. A bytes sequence, or a string if :" "func:`run` was called with an encoding, errors, or text=True. ``None`` if " "stderr was not captured." msgstr "" -"子プロセスから補足された標準エラー出力です。バイト列、もしくは :func:`run` で" -"エンコーディングが指定された場合、エラーの場合、text=True が指定された場合は" -"文字列です。標準エラー出力が補足できなかったら ``None`` になります。" +"子プロセスから捕捉した標準エラー出力です。\n" +"通常はバイト列ですが、:func:`run` に ``encoding`` または ``errors`` を指定し" +"た場合や、``text=True`` で呼び出した場合は文字列になります。\n" +"標準エラー出力を捕捉していない場合は ``None`` です。" #: ../../library/subprocess.rst:159 msgid "If :attr:`returncode` is non-zero, raise a :exc:`CalledProcessError`." @@ -795,13 +798,12 @@ msgstr "" "*executable* 引数が POSIX で :term:`path-like object` を受け付けるようになり" "ました。" -#: ../../library/subprocess.rst:497 msgid "" "*executable* parameter accepts a bytes and :term:`path-like object` on " "Windows." msgstr "" -"*executable* 引数が Windows で :term:`path-like object` を受け付けるようにな" -"りました。" +"Windows で *executable* 引数がバイト列と :term:`path-like object` を受け付け" +"るようになりました。" #: ../../library/subprocess.rst:509 msgid "" @@ -919,16 +921,15 @@ msgid "*cwd* parameter accepts a bytes object on Windows." msgstr "" "*cwd* 引数が Windows で bytes オブジェクトを受け付けるようになりました。" -#: ../../library/subprocess.rst:584 msgid "" "If *restore_signals* is true (the default) all signals that Python has set " "to SIG_IGN are restored to SIG_DFL in the child process before the exec. " "Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. (POSIX only)" msgstr "" -"*restore_signals* が真の場合 (デフォルト)、Python が SIG_IGN に設定したすべて" -"のシグナルは子プロセスが exec される前に子プロセスの SIG_DFL に格納されます。" -"現在これには SIGPIPE, SIGXFZ および SIGXFSZ シグナルが含まれています。(POSIX " -"のみ)" +"*restore_signals* が真の場合 (デフォルト)、Python が ``SIG_IGN`` に設定したす" +"べてのシグナルの処理を、子プロセスで exec を実行する前に ``SIG_DFL`` に戻しま" +"す。\n" +"現在の対象は ``SIGPIPE``、``SIGXFZ``、``SIGXFSZ`` です (POSIX のみ)。" #: ../../library/subprocess.rst:589 msgid "*restore_signals* was added." @@ -995,7 +996,6 @@ msgid "" "child process prior to the execution of the subprocess." msgstr "" -#: ../../library/subprocess.rst:645 msgid "" "If *env* is not ``None``, it must be a mapping that defines the environment " "variables for the new process; these are used instead of the default " @@ -1003,11 +1003,14 @@ msgid "" "str to str on any platform or bytes to bytes on POSIX platforms much like :" "data:`os.environ` or :data:`os.environb`." msgstr "" -"*env* が ``None`` 以外の場合、これは新しいプロセスでの環境変数を定義します。" -"デフォルトでは、子プロセスは現在のプロセスの環境変数を引き継ぎます。あらゆる" -"プラットフォームで :data:`os.environ` のように文字列から文字列へ、またPOSIX " -"プラットフォームにおいては :data:`os.environb` のようにバイトからバイトへも、" -"定義すること出来ます。" +"*env* が ``None`` でない場合は、新しいプロセスの環境変数を定義するマッピング" +"を指定します。\n" +"現在のプロセスの環境を継承するデフォルトの動作に代わり、このマッピングが使用" +"されます。\n" +":data:`os.environ` と同様に、どのプラットフォームでも文字列から文字列へのマッ" +"ピングを使用できます。\n" +"POSIX では :data:`os.environb` と同様に、バイト列からバイト列へのマッピングも" +"使用できます。" #: ../../library/subprocess.rst:653 msgid "" @@ -1552,37 +1555,36 @@ msgid "" "STARTF_USESHOWWINDOW" msgstr "" -#: ../../library/subprocess.rst:1006 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" ":attr:`dwFlags` が :data:`STARTF_USESTDHANDLES` を指定すれば、この属性がプロ" -"セスの標準入力処理です。:data:`STARTF_USESTDHANDLES` が指定されなければ、標準" -"入力のデフォルトはキーボードバッファーです。" +"セスの標準入力ハンドルです。\n" +":data:`STARTF_USESTDHANDLES` が指定されなければ、標準入力のデフォルトはキー" +"ボードバッファーです。" -#: ../../library/subprocess.rst:1013 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" ":attr:`dwFlags` が :data:`STARTF_USESTDHANDLES` を指定すれば、この属性がプロ" -"セスの標準出力処理です。そうでなければ、この属性は無視され、標準出力のデフォ" -"ルトはコンソールウィンドウのバッファーです。" +"セスの標準出力ハンドルです。\n" +"そうでなければ、この属性は無視され、標準出力のデフォルトはコンソールウィンド" +"ウのバッファーです。" -#: ../../library/subprocess.rst:1020 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" ":attr:`dwFlags` が :data:`STARTF_USESTDHANDLES` を指定すれば、この属性がプロ" -"セスの標準エラー処理です。そうでなければ、この属性は無視され、標準エラー出力" -"のデフォルトはコンソールウィンドウのバッファーです。" +"セスの標準エラーハンドルです。\n" +"そうでなければ、この属性は無視され、標準エラー出力のデフォルトはコンソール" +"ウィンドウのバッファーです。" -#: ../../library/subprocess.rst:1026 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1593,7 +1595,8 @@ msgstr "" ":attr:`dwFlags` が :data:`STARTF_USESHOWWINDOW` を指定すれば、この属性は " "`ShowWindow `__ 関数の ``nCmdShow`` 引数で指定された値なら、 ``SW_SHOWDEFAULT`` 以外" -"の任意のものにできます。しかし、この属性は無視されます。" +"の任意のものにできます。\n" +"それ以外の場合、この属性は無視されます。" #: ../../library/subprocess.rst:1033 msgid "" @@ -2013,13 +2016,13 @@ msgid "" "output = p2.communicate()[0]" msgstr "" -#: ../../library/subprocess.rst:1401 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -"p2 を開始した後の ``p1.stdout.close()`` の呼び出しは、p1 が p2 の前に存在した" -"場合に、p1 が SIGPIPE を受け取るために重要です。" +"``p2`` の開始後に ``p1.stdout.close()`` を呼び出すことが重要です。\n" +"これにより、``p2`` が ``p1`` より先に終了したとき、``p1`` が ``SIGPIPE`` を受" +"け取れるようになります。" #: ../../library/subprocess.rst:1404 msgid "" diff --git a/library/sys.po b/library/sys.po index 306ba95a6..018ddb97a 100644 --- a/library/sys.po +++ b/library/sys.po @@ -496,7 +496,6 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "Python DLLのハンドルを示す整数です。" -#: ../../library/sys.rst:348 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -505,10 +504,11 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" "*value* が ``None`` 以外の時、``repr(value)`` を ``sys.stdout`` に出力し、" -"``builtins._`` に保存します。``repr(value)`` がエラーハンドラを ``sys.stdout." -"errors`` (おそらく ``'strict'``) として ``sys.stdout.encoding`` にエンコード" -"できない場合、エラーハンドラを ``'backslashreplace'`` として ``sys.stdout." -"encoding`` にエンコードします。" +"*value* を ``builtins._`` に保存します。\n" +"``repr(value)`` がエラーハンドラを ``sys.stdout.errors`` (おそらく " +"``'strict'``) として ``sys.stdout.encoding`` にエンコードできない場合、エラー" +"ハンドラを ``'backslashreplace'`` として ``sys.stdout.encoding`` にエンコード" +"します。" #: ../../library/sys.rst:354 msgid "" @@ -546,11 +546,10 @@ msgid "" " builtins._ = value" msgstr "" -#: ../../library/sys.rst:378 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -":exc:`UnicodeEncodeError` には ``'backslashreplace'`` エラーハンドラを指定し" -"てください。" +":exc:`UnicodeEncodeError` が発生した場合は ``'backslashreplace'`` エラーハン" +"ドラを使用するようになりました。" #: ../../library/sys.rst:384 msgid "" @@ -788,15 +787,14 @@ msgid "" "exit attempt at an outer level." msgstr "" -#: ../../library/sys.rst:575 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -"Python インタープリタが (バッファされたデータを標準ストリームに吐き出すときの" -"エラーなどの) :exc:`SystemExit` を捕捉した後の後始末でエラーが起きた場合、終" -"了ステータスは 120 に変更されます。" +"Python インタープリタが :exc:`SystemExit` を捕捉した後の後始末でエラーが起き" +"た場合、終了ステータスは 120 に変更されます。\n" +"標準ストリームのバッファにあるデータを書き出す際のエラーなどが該当します。" #: ../../library/sys.rst:583 msgid "" @@ -1381,15 +1379,14 @@ msgstr "" "オブジェクトがサイズを取得する手段を提供していない時は *default* が返されま" "す。*default* が指定されていない場合は :exc:`TypeError` が送出されます。" -#: ../../library/sys.rst:983 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -":func:`getsizeof` は *object* の ``__sizeof__`` メソッドを呼び出し、そのオブ" -"ジェクトがガベージコレクタに管理されていた場合はガベージコレクタのオーバー" -"ヘッドを増やします。" +":func:`getsizeof` はオブジェクトの ``__sizeof__`` メソッドを呼び出します。\n" +"オブジェクトがガベージコレクタに管理されている場合は、ガベージコレクタの管理" +"に必要な追加のメモリ量を結果に加算します。" #: ../../library/sys.rst:987 msgid "" @@ -1687,16 +1684,16 @@ msgstr "" msgid "Added *algorithm*, *hash_bits*, *seed_bits*, and *cutoff*." msgstr "" -#: ../../library/sys.rst:1218 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " "releases. For example, to test that the Python interpreter is at least " "version 1.5.2, use::" msgstr "" -"単精度整数にエンコードされたバージョン番号。この値は新バージョン(正規リリース" -"以外であっても)ごとにかならず増加します。例えば、Python 1.5.2 以降でのみ動作" -"するプログラムでは、以下のようなチェックを行います。 ::" +"一つの整数にエンコードされたバージョン番号。\n" +"この値は新バージョン(正規リリース以外であっても)ごとにかならず増加します。\n" +"例えば、Python 1.5.2 以降でのみ動作するプログラムでは、以下のようなチェックを" +"行います。 ::" #: ../../library/sys.rst:1222 msgid "" @@ -1708,16 +1705,16 @@ msgid "" " ..." msgstr "" -#: ../../library/sys.rst:1229 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " "The :term:`named tuple` :data:`sys.version_info` may be used for a more " "human-friendly encoding of the same information." msgstr "" -"``hexversion`` は :func:`hex` 関数を使って 16 進数に変換しなければ値の意味を" -"持ちません。より読みやすいバージョン番号が必要な場合には :term:`named " -"tuple` :data:`sys.version_info` を使用してください。" +"組み込み関数 :func:`hex` に渡した結果として表示すると意味が分かるため、" +"``hexversion`` と呼ばれています。\n" +"同じ情報をより人間に読みやすい形式で取得するには、:term:`named tuple` の :" +"data:`sys.version_info` を使用できます。" #: ../../library/sys.rst:1234 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." @@ -3158,7 +3155,6 @@ msgstr "" "のファイルを復元するために利用することもできます。しかし、明示的に置き換え前" "のストリームを保存しておき、そのオブジェクトを復元する事を推奨します。" -#: ../../library/sys.rst:2237 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -3167,8 +3163,9 @@ msgid "" msgstr "" "一部の条件下では、``stdin``, ``stdout``, ``stderr`` も、オリジナルの " "``__stdin__``, ``__stdout__``, ``__stderr__`` も ``None`` になることがありま" -"す。これはコンソールに接続しない Windows GUI アプリケーションであり、かつ :" -"program:`pythonw` で起動された Python アプリケーションが該当します。" +"す。\n" +"これはコンソールに接続しない Windows GUI アプリケーションや、:program:" +"`pythonw` で起動された Python アプリケーションでよく見られます。" #: ../../library/sys.rst:2245 msgid "" diff --git a/library/sys_path_init.po b/library/sys_path_init.po index f0e79eb00..bdbd7d5c4 100644 --- a/library/sys_path_init.po +++ b/library/sys_path_init.po @@ -188,7 +188,6 @@ msgid "" "allows paths to be restricted for any program loading the runtime if desired." msgstr "" -#: ../../library/sys_path_init.rst:121 msgid "" "When the file exists, all registry and environment variables are ignored, " "isolated mode is enabled, and :mod:`site` is not imported unless one line in " @@ -198,10 +197,11 @@ msgid "" "arbitrary code cannot be specified." msgstr "" "ファイルが存在したときは、全てのレジストリと環境変数は無視され、隔離モードに" -"なり、そのファイルに ``import site`` と指定していない限りは :mod:`site` がイ" -"ンポートできなくなります。\n" +"なり、そのファイルに ``import site`` と指定していない限りは :mod:`site` はイ" +"ンポートされません。\n" "空行と ``#`` で始まる行は無視されます。\n" -"それぞれのパスはファイルの場所を指す絶対パスあるいは相対パスです。\n" +"それぞれのパスには絶対パスか、このファイルの場所を基準とした相対パスを指定で" +"きます。\n" "``site`` 以外のインポート文は許可されておらず、任意のコードも書けません。" #: ../../library/sys_path_init.rst:128 diff --git a/library/sysconfig.po b/library/sysconfig.po index 14b9028f6..618590c7b 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -175,10 +175,9 @@ msgid "" "on the platform Python runs on." msgstr "" -#: ../../library/sysconfig.rst:90 msgid "*osx_framework_user*: scheme for macOS, when the *user* option is used." msgstr "" -"*osx_framework_user* オプションが利用された場合の、macOS 用のスキームです。" +"*osx_framework_user*: *user* オプションを使う場合の macOS 用スキームです。" #: ../../library/sysconfig.rst:92 msgid "" @@ -748,16 +747,15 @@ msgstr "" "その他の非 POSIX プラットフォームでは、現在のところ単に :data:`sys.platform` " "を返します。" -#: ../../library/sysconfig.rst:404 msgid "" "Return ``True`` if the running Python interpreter was built from source and " "is being run from its built location, and not from a location resulting from " "e.g. running ``make install`` or installing via a binary installer." msgstr "" -"実行中の Python インタプリタがソースからビルドされ、かつそのビルドされた場所" -"から実行されている場合に ``True`` を返します。\n" -"``make install`` を実行した場所からの実行やバイナリインストーラによるインス" -"トールではいけません。" +"実行中の Python インタープリタがソースからビルドされ、そのビルド場所から実行" +"されている場合は ``True`` を返します。\n" +"``make install`` やバイナリインストーラによるインストール先から実行されている" +"場合は該当しません。" #: ../../library/sysconfig.rst:411 msgid "Parse a :file:`config.h`\\-style file." diff --git a/library/syslog.po b/library/syslog.po index c05bc26da..b17f4cbf5 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -187,12 +187,11 @@ msgstr "" "*pri* に対する優先度マスクを計算します。関数 ``LOG_UPTO(pri)`` は優先度 " "*pri* までの全ての優先度を含むようなマスクを計算します。" -#: ../../library/syslog.rst:105 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." msgstr "" -"引数 ``maskpri`` を指定して :ref:`監査イベント ` ``socket." +"引数 ``maskpri`` を指定して :ref:`監査イベント ` ``syslog." "setlogmask`` を送出します。" #: ../../library/syslog.rst:107 diff --git a/library/tarfile.po b/library/tarfile.po index f4c013ece..1b6b58d19 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -150,9 +150,8 @@ msgstr "圧縮方法に関して透過的に、読み込み用にオープンし msgid "``'r:'``" msgstr "``'r:'``" -#: ../../library/tarfile.rst:74 msgid "Open for reading exclusively without compression." -msgstr "非圧縮で読み込み用に排他的にオープンします。" +msgstr "非圧縮のアーカイブだけを読み込み用に開きます。" #: ../../library/tarfile.rst:77 msgid "``'r:gz'``" @@ -855,17 +854,16 @@ msgid "" "corresponding attribute `." msgstr "" -#: ../../library/tarfile.rst:469 msgid "" "The *encoding* and *errors* arguments define the character encoding to be " "used for reading or writing the archive and how conversion errors are going " "to be handled. The default settings will work for most users. See section :" "ref:`tar-unicode` for in-depth information." msgstr "" -"引数 *encoding* および *errors* にはアーカイブの読み書きやエラー文字列の変換" -"に使用する文字エンコーディングを指定します。ほとんどのユーザーはデフォルト設" -"定のままで動作します。詳細に関しては :ref:`tar-unicode` 節を参照してくださ" -"い。" +"*encoding* 引数はアーカイブの読み書きに使う文字エンコーディングを、*errors* " +"引数は文字変換エラーの処理方法を指定します。\n" +"ほとんどのユーザーはデフォルト設定のまま利用できます。\n" +"詳細は :ref:`tar-unicode` 節を参照してください。" #: ../../library/tarfile.rst:474 msgid "" @@ -905,13 +903,12 @@ msgstr "" "メンバー *name* に対する :class:`TarInfo` オブジェクトを返します。*name* が" "アーカイブに見つからなければ、:exc:`KeyError` が送出されます。" -#: ../../library/tarfile.rst:505 msgid "" "If a member occurs more than once in the archive, its last occurrence is " "assumed to be the most up-to-date version." msgstr "" -"アーカイブ内にメンバーが複数ある場合は、最後に出現するものが最新のバージョン" -"とみなされます。" +"アーカイブ内に同じメンバーが複数回現れる場合は、最後に現れるものを最新のバー" +"ジョンとみなします。" #: ../../library/tarfile.rst:511 msgid "" @@ -1197,7 +1194,6 @@ msgstr "" msgid "*fileobj* must be given for non-zero-sized regular files." msgstr "" -#: ../../library/tarfile.rst:717 msgid "" "Create a :class:`TarInfo` object from the result of :func:`os.stat` or " "equivalent on an existing file. The file is either named by *name*, or " @@ -1207,13 +1203,15 @@ msgid "" "from *fileobj*’s :attr:`~io.FileIO.name` attribute, or the *name* argument. " "The name should be a text string." msgstr "" -":func:`os.stat` の結果か、既存のファイルに相当するものから、:class:`TarInfo` " -"オブジェクトを作成します。このファイルは、*name* で名付けられるか、ファイル記" -"述子を持つ :term:`file object` *fileobj* として指定されます。*name* は :term:" -"`path-like object` でも構いません。 *arcname* が与えられた場合、アーカイブ内" -"のファイルに対して代替名を指定します。与えられない場合、名前は *fileobj* の :" -"attr:`~io.FileIO.name` 属性 *name* 属性から取られます。名前はテキスト文字列に" -"してください。" +"既存のファイルに対する :func:`os.stat` または同等の処理の結果から :class:" +"`TarInfo` オブジェクトを作成します。\n" +"ファイルは *name* で指定するか、ファイル記述子を持つ :term:`file object` を " +"*fileobj* に渡して指定します。\n" +"*name* には :term:`path-like object` も指定できます。\n" +"*arcname* を指定すると、アーカイブ内ではその名前を使用します。\n" +"指定しない場合は、*fileobj* の :attr:`~io.FileIO.name` 属性または *name* 引数" +"から名前を取得します。\n" +"名前はテキスト文字列にしてください。" #: ../../library/tarfile.rst:726 msgid "" @@ -1953,13 +1951,12 @@ msgid "" "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:1306 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -"tar アーカイブを新規に作成したい場合、:option:`-c` オプションの後にまとめたい" -"ファイル名のリストを指定してください:" +"新しい tar アーカイブを作成するには、:option:`-c` オプションの直後にアーカイ" +"ブ名を指定し、その後に格納するファイル名を並べます。" #: ../../library/tarfile.rst:1309 msgid "$ python -m tarfile -c monty.tar spam.txt eggs.txt" @@ -2083,12 +2080,12 @@ msgid "" "tar.close()" msgstr "" -#: ../../library/tarfile.rst:1404 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -"gzip 圧縮 tar アーカイブを作成してメンバー情報のいくつかを表示する方法::" +"gzip 圧縮された tar アーカイブを読み取り、メンバーの情報の一部を表示する方" +"法。 ::" #: ../../library/tarfile.rst:1406 msgid "" diff --git a/library/termios.po b/library/termios.po index b882dd6d5..4239743dd 100644 --- a/library/termios.po +++ b/library/termios.po @@ -114,15 +114,15 @@ msgid "" "Wait until all output written to file descriptor *fd* has been transmitted." msgstr "ファイル記述子 *fd* に書き込まれた全ての出力が転送されるまで待ちます。" -#: ../../library/termios.rst:76 msgid "" "Discard queued data on file descriptor *fd*. The *queue* selector specifies " "which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for " "the output queue, or :const:`TCIOFLUSH` for both queues." msgstr "" -"ファイル記述子 *fd* にキューされたデータを無視します。どのキューかは *queue* " -"セレクタで指定します: :const:`TCIFLUSH` は入力キュー、 :const:`TCOFLUSH` は出" -"力キュー、 :const:`TCIOFLUSH` は両方のキューです。" +"ファイル記述子 *fd* にキューに入っているデータを破棄します。\n" +"どのキューかは *queue* セレクタで指定します: :const:`TCIFLUSH` は入力" +"キュー、 :const:`TCOFLUSH` は出力キュー、 :const:`TCIOFLUSH` は両方のキューで" +"す。" #: ../../library/termios.rst:83 msgid "" diff --git a/library/test.po b/library/test.po index 0fd49106a..8260bd468 100644 --- a/library/test.po +++ b/library/test.po @@ -72,7 +72,6 @@ msgstr "ドキュメンテーション文字列に埋め込まれたテスト。 msgid "Writing Unit Tests for the :mod:`!test` package" msgstr "" -#: ../../library/test.rst:42 msgid "" "It is preferred that tests that use the :mod:`unittest` module follow a few " "guidelines. One is to name the test module by starting it with ``test_`` and " @@ -86,15 +85,19 @@ msgid "" "exist and thus what test is being run is not stated." msgstr "" ":mod:`unittest` モジュールを使ってテストを書く場合、幾つかのガイドラインに従" -"うことが推奨されます。 1つは、テストモジュールの名前を、 ``test_`` で始め、テ" -"スト対象となるモジュール名で終えることです。テストモジュール中のテストメソッ" -"ドは名前を ``test_`` で始めて、そのメソッドが何をテストしているかという説明で" -"終えます。これはテスト実行プログラムが、そのメソッドをテストメソッドとして認" -"識するために必要です。また、テストメソッドにはドキュメンテーション文字列を入" -"れるべきではありません。コメント(例えば ``# True あるいは False だけを返すテ" -"スト関数`` )を使用して、テストメソッドのドキュメントを記述してください。これ" -"は、ドキュメンテーション文字列が存在する場合はその内容が出力されてしまうた" -"め、どのテストを実行しているのかをいちいち表示したくないからです。" +"うことが推奨されます。\n" +"1つは、テストモジュールの名前を、 ``test_`` で始め、テスト対象となるモジュー" +"ル名で終えることです。\n" +"テストモジュール中のテストメソッドは名前を ``test_`` で始めて、そのメソッドが" +"何をテストしているかという説明で終えます。\n" +"これはテスト実行プログラムが、そのメソッドをテストメソッドとして認識するため" +"に必要です。\n" +"また、テストメソッドにはドキュメンテーション文字列を入れるべきではありませ" +"ん。\n" +"コメント(例えば ``# 関数が True または False だけを返すことをテストする`` )" +"を使用して、テストメソッドのドキュメントを記述してください。\n" +"ドキュメンテーション文字列があると、その内容が出力され、どのテストを実行して" +"いるかが表示されなくなるためです。" #: ../../library/test.rst:53 msgid "A basic boilerplate is often used::" @@ -145,13 +148,12 @@ msgstr "" "プトとして自分自身を起動したり、 ``python -m unittest`` というコマンドライン" "インターフェースを通して起動したりできます。" -#: ../../library/test.rst:90 msgid "" "The goal for regression testing is to try to break code. This leads to a few " "guidelines to be followed:" msgstr "" -"回帰テストの目的はコードを解き明かすことです。そのためには以下のいくつかのガ" -"イドラインに従ってください:" +"回帰テストの目的は、コードが正しく動作しないケースを見つけることです。\n" +"そのため、以下のガイドラインに従ってください。" #: ../../library/test.rst:93 msgid "" @@ -552,23 +554,21 @@ msgstr "テストパッケージ内の ``data`` ディレクトリを設定し msgid "Set to :data:`sys.maxsize` for big memory tests." msgstr "大量のメモリを使うテストのための :data:`sys.maxsize` を設定します。" -#: ../../library/test.rst:386 msgid "" "Set by :func:`set_memlimit` as the memory limit for big memory tests. " "Limited by :data:`MAX_Py_ssize_t`." msgstr "" -"大量のメモリを使うテストのためのメモリ上限となる :func:`set_memlimit` を設定" -"します。\n" -":data:`MAX_Py_ssize_t` が設定上限です。" +"大量のメモリを使うテストのメモリ上限として、:func:`set_memlimit` によって設定" +"されます。\n" +"上限は :data:`MAX_Py_ssize_t` です。" -#: ../../library/test.rst:392 msgid "" "Set by :func:`set_memlimit` as the memory limit for big memory tests. Not " "limited by :data:`MAX_Py_ssize_t`." msgstr "" -"大量のメモリを使うテストのためのメモリ上限となる :func:`set_memlimit` を設定" -"します。\n" -":data:`MAX_Py_ssize_t` の設定上限はありません。" +"大量のメモリを使うテストのメモリ上限として、:func:`set_memlimit` によって設定" +"されます。\n" +":data:`MAX_Py_ssize_t` による上限はありません。" #: ../../library/test.rst:398 msgid "" @@ -2286,12 +2286,11 @@ msgid "" " warnings.warn(UserWarning(\"Hide me!\"))" msgstr "" -#: ../../library/test.rst:1892 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -"この場合、どちらの警告も発生しなかった場合や、それ以外の警告が発生した場合" +"この場合、いずれかの警告が発生しなかった場合や、それ以外の警告が発生した場合" "は、 :func:`check_warnings` はエラーを発生させます。" #: ../../library/test.rst:1895 diff --git a/library/textwrap.po b/library/textwrap.po index 95761ec32..b46dcc9e6 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -454,13 +454,12 @@ msgstr "" "過去のバージョンでは、デフォルトで常にハイフンの直後での改行を許していまし" "た。" -#: ../../library/textwrap.rst:280 msgid "" "(default: ``None``) If not ``None``, then the output will contain at most " "*max_lines* lines, with *placeholder* appearing at the end of the output." msgstr "" -"(デフォルト ``None``) ``None`` 以外の場合、出力は行数 *max_lines* を超えない" -"ようにされ、切り詰める際には出力の最後の行を *placeholder* に置き換えます。" +"(デフォルト: ``None``) ``None`` でない場合、出力は最大 *max_lines* 行になり、" +"切り詰めた場合は出力の末尾に *placeholder* が付きます。" #: ../../library/textwrap.rst:290 msgid "" diff --git a/library/threading.po b/library/threading.po index 49c1baa62..38502e0f3 100644 --- a/library/threading.po +++ b/library/threading.po @@ -674,15 +674,15 @@ msgid "" "``__init__()`` and :meth:`~Thread.run` methods of this class." msgstr "" -#: ../../library/threading.rst:469 msgid "" "Once a thread object is created, its activity must be started by calling the " "thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` " "method in a separate thread of control." msgstr "" "ひとたびスレッドオブジェクトを生成すると、スレッドの :meth:`~Thread.start` メ" -"ソッドを呼び出して活動を開始しなければなりません。 ``start()`` メソッド はそ" -"れぞれのスレッドの :meth:`~Thread.run` メソッドを起動します。" +"ソッドを呼び出して活動を開始しなければなりません。\n" +"これにより、別のスレッドでそのオブジェクトの :meth:`~Thread.run` メソッドが呼" +"び出されます。" #: ../../library/threading.rst:473 msgid "" @@ -1733,15 +1733,13 @@ msgstr "" "のスレッドがロックを獲得していないときにこのメソッドを呼び出すと :exc:" "`RuntimeError` が送出されます。" -#: ../../library/threading.rst:1081 msgid "" "This method wakes up at most *n* of the threads waiting for the condition " "variable; it is a no-op if no threads are waiting." msgstr "" -"何らかの待機中スレッドがある場合、そのうち *n* スレッドを起こします。待機中の" -"スレッドがなければ何もしません。" +"この条件変数を待っているスレッドを最大 *n* 個起こします。\n" +"待機中のスレッドがなければ何もしません。" -#: ../../library/threading.rst:1084 msgid "" "The current implementation wakes up exactly *n* threads, if at least *n* " "threads are waiting. However, it's not safe to rely on this behavior. A " @@ -1749,8 +1747,10 @@ msgid "" "threads." msgstr "" "現在の実装では、少なくとも *n* スレッドが待機中であれば、ちょうど *n* スレッ" -"ドを起こします。とはいえ、この挙動に依存するのは安全ではありません。将来、実" -"装の最適化によって、複数のスレッドを起こすようになるかもしれないからです。" +"ドを起こします。\n" +"とはいえ、この挙動に依存するのは安全ではありません。\n" +"将来、実装の最適化によって、*n* 個を超えるスレッドを起こすことがあるかもしれ" +"ないからです。" #: ../../library/threading.rst:1089 msgid "" @@ -1897,7 +1897,6 @@ msgstr "" msgid "Added the *n* parameter to release multiple waiting threads at once." msgstr "複数の待機中のスレッドを一度に解放する *n* パラメータを追加しました。" -#: ../../library/threading.rst:1177 msgid "" "Class implementing bounded semaphore objects. A bounded semaphore checks to " "make sure its current value doesn't exceed its initial value. If it does, :" @@ -1905,12 +1904,13 @@ msgid "" "resources with limited capacity. If the semaphore is released too many " "times it's a sign of a bug. If not given, *value* defaults to 1." msgstr "" -"有限セマフォ (bounded semaphore) オブジェクトを実装しているクラスです。有限セ" -"マフォは、現在の値が初期値を超過しないようチェックを行います。超過を起こした" -"場合、 :exc:`ValueError` を送出します。たいていの場合、セマフォは限られた容量" -"のリソースを保護するために使われるものです。従って、あまりにも頻繁なセマフォ" -"の解放はバグが生じているしるしです。 *value* を指定しない場合、デフォルトの値" -"は 1 になります。" +"有限セマフォ (bounded semaphore) オブジェクトを実装しているクラスです。\n" +"有限セマフォは、現在の値が初期値を超過しないようチェックを行います。\n" +"超過を起こした場合、 :exc:`ValueError` を送出します。\n" +"たいていの場合、セマフォは限られた容量のリソースを保護するために使われるもの" +"です。\n" +"従って、セマフォを必要以上の回数解放することはバグが生じているしるしです。\n" +"*value* を指定しない場合、デフォルトの値は 1 になります。" #: ../../library/threading.rst:1190 msgid ":class:`Semaphore` example" @@ -1985,18 +1985,18 @@ msgstr "" "セットします。 :meth:`~Event.wait` メソッドはフラグが true になるまでブロック" "します。" -#: ../../library/threading.rst:1230 msgid "" "Class implementing event objects. An event manages a flag that can be set " "to true with the :meth:`~Event.set` method and reset to false with the :meth:" "`clear` method. The :meth:`wait` method blocks until the flag is true. The " "flag is initially false." msgstr "" -"イベントオブジェクトを実装しているクラスです。イベントは :meth:`~Event.set` " -"メソッドを使うと ``True`` に、 :meth:`clear` メソッドを使うと ``False`` に" -"セットされるようなフラグを管理します。 :meth:`wait` メソッドは、全てのフラグ" -"が true になるまでブロックするようになっています。フラグの初期値は false で" -"す。" +"イベントオブジェクトを実装しているクラスです。\n" +"イベントは :meth:`~Event.set` メソッドを使うと ``True`` に、 :meth:`clear` メ" +"ソッドを使うと ``False`` にセットされるようなフラグを管理します。\n" +":meth:`wait` メソッドは、そのフラグが true になるまでブロックするようになって" +"います。\n" +"フラグの初期値は false です。" #: ../../library/threading.rst:1240 msgid "Return ``True`` if and only if the internal flag is true." diff --git a/library/time.po b/library/time.po index ddd30a8fa..4790da2a4 100644 --- a/library/time.po +++ b/library/time.po @@ -70,16 +70,16 @@ msgstr "" "ん。\n" "全ての POSIX 互換のプラットフォームで、うるう秒はこの総秒数には含まれません。" -#: ../../library/time.rst:38 msgid "" "The functions in this module may not handle dates and times before the " "epoch_ or far in the future. The cut-off point in the future is determined " "by the C library; for 32-bit systems, it is typically in 2038." msgstr "" "このモジュールの中の関数は、エポック (epoch_) 以前あるいは遠い未来の日付や時" -"刻を扱うことができません。将来カットオフ(関数が正しく日付や時刻を扱えなくな" -"る)が起きる時点は、C ライブラリによって決まります。32-bit システムではカット" -"オフは通常 2038 年です。" +"刻を扱えない場合があります。\n" +"将来カットオフ(関数が正しく日付や時刻を扱えなくなる)が起きる時点は、C ライ" +"ブラリによって決まります。\n" +"32-bit システムではカットオフは通常 2038 年です。" #: ../../library/time.rst:45 msgid "" @@ -820,15 +820,15 @@ msgstr "\\(3)" msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:513 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" "年の初めから何週目か (日曜を週の始まりとします) を表す 10 進数になります " -"[00,53]。年が明けてから最初の日曜日までのすべての曜日は 0 週目に属すると見な" -"されます。" +"[00,53]。\n" +"年が明けてから最初の日曜日の前日までのすべての曜日は 0 週目に属すると見なされ" +"ます。" #: ../../library/time.rst:513 ../../library/time.rst:527 msgid "\\(4)" @@ -854,15 +854,15 @@ msgstr "曜日の 10 進表記になります [0 (日曜日),6]。" msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:527 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" "年の初めから何週目か (月曜を週の始まりとします) を表す 10 進数になります " -"[00,53]。年が明けてから最初の月曜日までの全ての曜日は 0 週目に属すると見なさ" -"れます。" +"[00,53]。\n" +"年が明けてから最初の月曜日の前日までの全ての曜日は 0 週目に属すると見なされま" +"す。" #: ../../library/time.rst:535 msgid "``%x``" @@ -1334,15 +1334,14 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:802 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" -"多くの場合、環境変数 :envvar:`TZ` を変更すると、 :func:`tzset` を呼ばない限" -"り :func:`localtime` のような関数の出力に影響を及ぼすため、値が信頼できなく" -"なってしまいます。" +"多くの場合、:envvar:`TZ` 環境変数を変更すると :func:`tzset` を呼び出さなくて" +"も :func:`localtime` などの関数の出力が変わりますが、この動作を当てにしてはい" +"けません。" #: ../../library/time.rst:806 msgid "The :envvar:`TZ` environment variable should contain no whitespace." @@ -1624,17 +1623,18 @@ msgstr "" msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:1027 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " "Western Europe, including the UK). Only use this if ``daylight`` is " "nonzero. See note below." msgstr "" -"ローカルの夏時間タイムゾーンにおける UTC からの時刻オフセットで、西に行くほど" -"増加する、秒で表した値です (ほとんどの西ヨーロッパでは負になり、アメリカでは" -"正、イギリスではゼロになります)。``daylight`` がゼロでないときのみ使用してく" -"ださい。以下の注釈を参照してください。" +"ローカルの夏時間タイムゾーンが定義されている場合、その UTC から西向きのオフ" +"セットを秒単位で表します。\n" +"英国を含む西ヨーロッパのように夏時間タイムゾーンが UTC より東側にある場合、こ" +"の値は負になります。\n" +"``daylight`` がゼロでない場合にのみ使用してください。\n" +"以下の注釈を参照してください。" #: ../../library/time.rst:1033 msgid "Nonzero if a DST timezone is defined. See note below." diff --git a/library/timeit.po b/library/timeit.po index 2c013a54f..b88065530 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -126,33 +126,32 @@ msgstr "" msgid "The module defines three convenience functions and a public class:" msgstr "このモジュールは 3 つの有用な関数と 1 つの公開クラスを持っています:" -#: ../../library/timeit.rst:67 msgid "" "Create a :class:`Timer` instance with the given statement, *setup* code and " "*timer* function and run its :meth:`.timeit` method with *number* " "executions. The optional *globals* argument specifies a namespace in which " "to execute the code." msgstr "" -"与えられた文、*setup* コードおよび *timer* 関数で :class:`Timer` インスタンス" -"を作成し、その :meth:`.timeit` メソッドを *number* 回実行します。\n" -"任意の *globals* 引数はコードを実行する名前空間を指定します。" +"指定された文、*setup* コード、*timer* 関数で :class:`Timer` インスタンスを作" +"成し、:meth:`.timeit` メソッドでその文を *number* 回実行する時間を計測しま" +"す。\n" +"オプションの *globals* 引数には、コードを実行する名前空間を指定します。" #: ../../library/timeit.rst:72 ../../library/timeit.rst:83 #: ../../library/timeit.rst:122 msgid "The optional *globals* parameter was added." msgstr "任意の *globals* 引数が追加されました。" -#: ../../library/timeit.rst:78 msgid "" "Create a :class:`Timer` instance with the given statement, *setup* code and " "*timer* function and run its :meth:`.repeat` method with the given *repeat* " "count and *number* executions. The optional *globals* argument specifies a " "namespace in which to execute the code." msgstr "" -"与えられた文、*setup* コードおよび *timer* 関数で :class:`Timer` インスタンス" -"を作成し、その :meth:`.repeat` メソッドを *repeat* 回繰り返すのを *number* 回" -"実行します。\n" -"任意の *globals* 引数はコードを実行する名前空間を指定します。" +"指定された文、*setup* コード、*timer* 関数で :class:`Timer` インスタンスを作" +"成し、:meth:`.repeat` メソッドを実行します。\n" +"文を *number* 回実行する計測を *repeat* 回繰り返します。\n" +"オプションの *globals* 引数には、コードを実行する名前空間を指定します。" #: ../../library/timeit.rst:86 ../../library/timeit.rst:186 msgid "Default value of *repeat* changed from 3 to 5." @@ -397,9 +396,10 @@ msgid "" "many seconds (default: 0.2)" msgstr "" -#: ../../library/timeit.rst:254 msgid "print raw timing results; repeat for more digits precision" -msgstr "時間計測の結果をそのまま詳細な数値でくり返し表示する" +msgstr "" +"計測結果の生の値を表示します。\n" +"このオプションを繰り返し指定すると表示の桁数が増えます。" #: ../../library/timeit.rst:258 msgid "print a short usage message and exit" diff --git a/library/tkinter.po b/library/tkinter.po index 2e12f44ab..983ba082b 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -1500,13 +1500,12 @@ msgstr "" msgid "scrollcommand" msgstr "scrollcommand" -#: ../../library/tkinter.rst:899 msgid "" "This is almost always the :meth:`!set` method of some scrollbar widget, but " "can be any widget method that takes a single argument." msgstr "" "これはほとんどの場合スクロールバーウィジェットの :meth:`!set` メソッドです" -"が、1 個の引数を取るあらゆるウィジェットにもなりえます。" +"が、1 個の引数を取る任意のウィジェットのメソッドも指定できます。" #: ../../library/tkinter.rst:902 ../../library/tkinter.rst:972 msgid "state" @@ -1644,9 +1643,8 @@ msgstr "char" msgid "%h" msgstr "%h" -#: ../../library/tkinter.rst:968 msgid "height" -msgstr "高さ" +msgstr "``height``" #: ../../library/tkinter.rst:968 msgid "%E" @@ -1704,9 +1702,8 @@ msgstr "type" msgid "%w" msgstr "%w" -#: ../../library/tkinter.rst:976 msgid "width" -msgstr "幅" +msgstr "``width``" #: ../../library/tkinter.rst:976 msgid "%W" @@ -1909,14 +1906,14 @@ msgid "" "system;" msgstr "" -#: ../../library/tkinter.rst:1057 msgid "" "the string ``\"none\"``, which indicates no menu entry at all, most often " "used with menu.activate() to deactivate all entries, and finally," msgstr "" -"文字列 ``\"none\"``。どんなメニューエントリもまったく指しておらず、ほとんどの" -"場合、すべてのエントリの動作を停止させるために menu.activate() と一緒に使われ" -"ます。そして、最後に、" +"文字列 ``\"none\"`` は、どのメニュー項目も指さないことを示します。\n" +"通常、すべての項目のアクティブ状態を解除するために ``menu.activate()`` ととも" +"に使用します。\n" +"最後に、" #: ../../library/tkinter.rst:1060 msgid "" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index b0416094e..8db603f14 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -402,10 +402,8 @@ msgid "none: the default. display the image if present, otherwise the text." msgstr "" "none: デフォルト。もしあれば画像を表示し、そうでなければテキストを表示する。" -#: ../../library/tkinter.ttk.rst:211 ../../library/tkinter.ttk.rst:363 -#: ../../library/tkinter.ttk.rst:520 msgid "width" -msgstr "幅" +msgstr "``width``" #: ../../library/tkinter.ttk.rst:211 msgid "" @@ -654,10 +652,8 @@ msgstr "" "ウィジェットの中でテキストをどう配置するかを指定します。 \"left\", " "\"center\", \"right\" のうちのどれか 1 つです。" -#: ../../library/tkinter.ttk.rst:342 ../../library/tkinter.ttk.rst:510 -#: ../../library/tkinter.ttk.rst:858 msgid "height" -msgstr "高さ" +msgstr "``height``" #: ../../library/tkinter.ttk.rst:342 msgid "Specifies the height of the pop-down listbox, in rows." @@ -878,15 +874,14 @@ msgstr "" "表示します。それぞれの子ウィンドウはタブの関連付けられていて、ユーザはそれを" "選択して表示されているウィンドウを切り替えます。" -#: ../../library/tkinter.ttk.rst:510 msgid "" "If present and greater than zero, specifies the desired height of the pane " "area (not including internal padding or tabs). Otherwise, the maximum height " "of all panes is used." msgstr "" "0 より大きな値が設定されている場合、 (内部のパディングやタブを含まない) ペイ" -"ン領域に必要な高さを指定します。設定されていない場合、全てのペインの高さの最" -"大値が使われます。" +"ン領域に必要な高さを指定します。\n" +"それ以外の場合、全てのペインの高さの最大値が使われます。" #: ../../library/tkinter.ttk.rst:514 ../../library/tkinter.ttk.rst:547 #: ../../library/tkinter.ttk.rst:862 @@ -904,15 +899,14 @@ msgstr "" "の長さ指定のリストです: 左、上、右、下の順で指定します。4 個より少ない場合、" "デフォルトで下は上と、右は左と、上は左と同じ値が、それぞれ使われます。" -#: ../../library/tkinter.ttk.rst:520 msgid "" "If present and greater than zero, specified the desired width of the pane " "area (not including internal padding). Otherwise, the maximum width of all " "panes is used." msgstr "" "0 より大きな値が指定されている場合、(内部のパディングを含まない) ペイン領域に" -"必要な幅を指定します。設定されていない場合、全てのペインの幅の最大値が使われ" -"ます。" +"必要な幅を指定します。\n" +"それ以外の場合、全てのペインの幅の最大値が使われます。" #: ../../library/tkinter.ttk.rst:527 msgid "Tab options" @@ -1236,17 +1230,17 @@ msgstr "最大値を数値で指定します。デフォルトは 100 です。" msgid "value" msgstr "value" -#: ../../library/tkinter.ttk.rst:718 msgid "" "The current value of the progress bar. In \"determinate\" mode, this " "represents the amount of work completed. In \"indeterminate\" mode, it is " "interpreted as modulo *maximum*; that is, the progress bar completes one " "\"cycle\" when its value increases by *maximum*." msgstr "" -"プログレスバーの現在値です。決定的 (\"determinate\") モードでは、完了した処理" -"の量を表します。非決定的 (\"indeterminate\") モードでは、 *maximum* を法とし" -"て解釈され、値が *maximum* に達したときにプログレスバーは 1 \"サイクル\" を完" -"了したことになります。" +"プログレスバーの現在値です。\n" +"決定的 (\"determinate\") モードでは、完了した処理の量を表します。\n" +"非決定的 (\"indeterminate\") モードでは、 *maximum* を法として解釈され、値が " +"*maximum* だけ増えるとプログレスバーは 1 \"サイクル\" を完了したことになりま" +"す。" #: ../../library/tkinter.ttk.rst:724 msgid "variable" @@ -2540,7 +2534,6 @@ msgid "" " border=(2, 4), sticky='we')" msgstr "" -#: ../../library/tkinter.ttk.rst:1503 msgid "" "If \"from\" is used as the value of *etype*, :meth:`element_create` will " "clone an existing element. *args* is expected to contain a themename, from " @@ -2548,10 +2541,12 @@ msgid "" "If this element to clone from is not specified, an empty element will be " "used. *kw* is discarded." msgstr "" -"*etype* の値として \"from\" が使われた場合は、 :meth:`element_create` が現在" -"の要素を複製します。 *args* は要素の複製元のテーマの名前と、オプションで複製" -"する要素を含んでいる必要があります。複製元の要素が指定されていなかった場合、" -"空要素が使用され、 *kw* は破棄されます。" +"*etype* に \"from\" を指定すると、:meth:`element_create` は既存の要素を複製し" +"ます。\n" +"*args* には複製元のテーマ名を指定し、必要に応じてその後に複製元の要素を指定し" +"ます。\n" +"複製元の要素を省略すると空の要素が使われます。\n" +"*kw* は破棄されます。" #: ../../library/tkinter.ttk.rst:1512 msgid "" diff --git a/library/trace.po b/library/trace.po index 119ee3d11..ced447d0d 100644 --- a/library/trace.po +++ b/library/trace.po @@ -210,7 +210,6 @@ msgstr "" msgid "Programmatic Interface" msgstr "プログラミングインターフェース" -#: ../../library/trace.rst:145 msgid "" "Create an object to trace execution of a single statement or expression. " "All parameters are optional. *count* enables counting of line numbers. " @@ -224,14 +223,18 @@ msgid "" "was started to be displayed." msgstr "" "文 (statement) や式 (expression) の実行をトレースするオブジェクトを作成しま" -"す。引数は全てオプションです。*count* は行数を数えます。*trace* は行実行のト" -"レースを行います。*countfuncs* は実行中に呼ばれた関数を列挙します。" -"*countcallers* は呼び出しの関係を追跡します。*ignoremods* は無視するモジュー" -"ルやパッケージのリストです。*ignoredirs* は無視するパッケージやモジュールを含" -"むディレクトリのリストです。*infile* は保存された集計 (count) 情報を読むファ" -"イルの名前です。*outfile* は更新された集計 (count) 情報を書き出すファイルの名" -"前です。*timing* は、タイムスタンプをトレース開始時点からの相対秒数で表示しま" -"す。" +"す。\n" +"引数は全てオプションです。\n" +"*count* は各行の実行回数の集計を有効にします。\n" +"*trace* は行実行のトレースを行います。\n" +"*countfuncs* は実行中に呼ばれた関数を列挙します。\n" +"*countcallers* は呼び出しの関係を追跡します。\n" +"*ignoremods* は無視するモジュールやパッケージのリストです。\n" +"*ignoredirs* は無視するパッケージやモジュールを含むディレクトリのリストで" +"す。\n" +"*infile* は保存された集計 (count) 情報を読むファイルの名前です。\n" +"*outfile* は更新された集計 (count) 情報を書き出すファイルの名前です。\n" +"*timing* は、タイムスタンプをトレース開始時点からの相対秒数で表示します。" #: ../../library/trace.rst:158 msgid "" diff --git a/library/traceback.po b/library/traceback.po index 763936550..ba03501a6 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -201,7 +201,6 @@ msgstr "" "一般に、例外が対話的なプロンプトに達した後にのみ機能します (:data:`sys." "last_exc` 参照)。" -#: ../../library/traceback.rst:131 msgid "" "Print up to *limit* stack trace entries (starting from the invocation point) " "if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. " @@ -210,12 +209,14 @@ msgid "" "objects>` to start. The optional *file* argument has the same meaning as " "for :func:`print_tb`." msgstr "" -"*limit* が正の場合、最大 *limit* 個のスタックトレース項目 (呼び出し地点から開" -"始) を出力します。 そうでない場合、最新の ``abs(limit)`` 個を出力します。 " -"*limit* が省略されるか ``None`` の場合、すべての項目が出力されます。オプショ" -"ンの *f* 引数は、開始する :ref:`スタックフレーム ` を指定する" -"ために用いることができます。オプションの *file* 引数は :func:`print_tb` の " -"*file* 引数と同様の意味を持っています。" +"*limit* が正の場合、呼び出し地点からさかのぼった最大 *limit* 個のスタックト" +"レース項目を出力します。\n" +"0 以下の場合は、スタックをさかのぼった末尾側の ``abs(limit)`` 個、つまり最も" +"古い側の項目を出力します。\n" +"*limit* が省略されるか ``None`` の場合は、すべての項目を出力します。\n" +"オプションの *f* 引数で、開始する :ref:`スタックフレーム ` を" +"指定できます。\n" +"オプションの *file* 引数は :func:`print_tb` の場合と同じ意味です。" #: ../../library/traceback.rst:145 msgid "" @@ -246,7 +247,6 @@ msgid "" "``None``, the output is written to :data:`sys.stderr`." msgstr "" -#: ../../library/traceback.rst:171 msgid "" "Given a list of tuples or :class:`FrameSummary` objects as returned by :func:" "`extract_tb` or :func:`extract_stack`, return a list of strings ready for " @@ -255,12 +255,13 @@ msgid "" "strings may contain internal newlines as well, for those items whose source " "text line is not ``None``." msgstr "" -":func:`extract_tb` または :func:`extract_stack` が返すタプルのリストまたは :" -"class:`FrameSummary` オブジェクトが与えられると、出力の準備を整えた文字列のリ" -"ストを返します。結果として生じるリストの中の各文字列は、引数リストの中の同じ" -"インデックスの要素に対応します。各文字列は末尾に改行が付いています。さらに、" -"ソーステキスト行が ``None`` でないそれらの要素に対しては、文字列は内部に改行" -"を含んでいるかもしれません。" +":func:`extract_tb` または :func:`extract_stack` が返すような、タプルまたは :" +"class:`FrameSummary` オブジェクトからなるリストを受け取り、表示用に整えた文字" +"列のリストを返します。\n" +"戻り値の各文字列は、引数のリストの同じインデックスにある要素に対応します。\n" +"各文字列の末尾には改行が付きます。\n" +"ソースコード行が ``None`` でない要素については、文字列の途中にも改行が含まれ" +"ることがあります。" #: ../../library/traceback.rst:181 msgid "" diff --git a/library/types.po b/library/types.po index 772a23d20..d8263b631 100644 --- a/library/types.po +++ b/library/types.po @@ -276,13 +276,12 @@ msgstr "" "ジェネレータ関数によって生成された :term:`ジェネレータ ` イテレー" "タオブジェクトの型です。" -#: ../../library/types.rst:173 msgid "" "The type of :term:`coroutine` objects, created by :keyword:`async def` " "functions." msgstr "" ":keyword:`async def` 関数に生成される :term:`コルーチン ` オブジェ" -"クトです。" +"クトの型です。" #: ../../library/types.rst:181 msgid "" @@ -745,9 +744,9 @@ msgstr "" "ブジェクトかつ :term:`awaitable` であるとみなされます。ただし、必ずしも :" "meth:`~object.__await__` メソッドを実装する必要はありません。" -#: ../../library/types.rst:545 msgid "If *gen_func* is a generator function, it will be modified in-place." -msgstr "*gen_func* はジェネレータ関数で、インプレースに変更されます。" +msgstr "" +"*gen_func* がジェネレータ関数の場合、その関数をインプレースに変更します。" #: ../../library/types.rst:547 msgid "" diff --git a/library/typing.po b/library/typing.po index 4700d25aa..0abbe21af 100644 --- a/library/typing.po +++ b/library/typing.po @@ -529,7 +529,6 @@ msgstr "" "しかし、:class:`Protocol` クラスとその :meth:`~object.__call__` メソッドを定" "義すれば表現することができます:" -#: ../../library/typing.rst:258 msgid "" "from collections.abc import Iterable\n" "from typing import Protocol\n" @@ -569,8 +568,9 @@ msgstr "" " ...\n" "\n" "batch_proc([], good_cb) # OK\n" -"batch_proc([], bad_cb) # エラー! 第二実引数の名前と(引数としての)種類が\n" -" # 一致しません" +"batch_proc([], bad_cb) # エラー! コールバックのパラメータ名と種類が異なるた" +"め、\n" +" # 第2引数の型が適合しない" #: ../../library/typing.rst:279 msgid "" @@ -1296,13 +1296,12 @@ msgid "" "every type." msgstr "" -#: ../../library/typing.rst:725 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -"これは、 :data:`Any` 型の値では、任意の演算やメソッドの呼び出しが行えることを" -"意味します::" +"これは、:data:`Any` 型の値に対して任意の演算やメソッド呼び出しを行え、どの変" +"数にも代入できることを意味します。 ::" #: ../../library/typing.rst:728 msgid "" @@ -1408,14 +1407,12 @@ msgid "" "hash_b(\"foo\")" msgstr "" -#: ../../library/typing.rst:792 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -":class:`object` は、ある値が型安全な方法で任意の型として使えることを示すため" -"に使用します。 :data:`Any` はある値が動的に型付けられることを示すために使用し" -"ます。" +"値がどの型でもよいことを型安全に表すには :class:`object` を使います。\n" +"値が動的に型付けされることを示すには :data:`Any` を使います。" #: ../../library/typing.rst:797 msgid "Nominal vs structural subtyping" @@ -2173,9 +2170,9 @@ msgid "" " damage: int = 10 # instance variable" msgstr "" -#: ../../library/typing.rst:1293 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." -msgstr ":data:`ClassVar` は型のみを受け入れ、それ以外は受け付けられません。" +msgstr "" +":data:`ClassVar` は型だけを受け入れ、さらに添字付けすることはできません。" #: ../../library/typing.rst:1295 msgid "" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index a437c7667..4fc214430 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -546,14 +546,13 @@ msgstr "" msgid "Added two keyword-only arguments to the reset_mock function." msgstr "2つのキーワード専用引数が reset_mock 関数に追加されました。" -#: ../../library/unittest.mock.rst:451 msgid "" "Add a spec to a mock. *spec* can either be an object or a list of strings. " "Only attributes on the *spec* can be fetched as attributes from the mock." msgstr "" -"モックに仕様を追加します。 *spec* にはオブジェクトもしくは文字列のリストを指" -"定してください。 *spec* で設定した属性は、モックの属性としてのみアクセスでき" -"ます。" +"モックに仕様を追加します。\n" +"*spec* にはオブジェクトまたは文字列のリストを指定できます。\n" +"モックの属性として取得できるのは、*spec* にある属性だけです。" #: ../../library/unittest.mock.rst:455 msgid "If *spec_set* is true then only attributes on the spec can be set." @@ -610,15 +609,15 @@ msgstr "" "このフィルタが何をしていて、どのように停止させるかは、 :data:`FILTER_DIR` を" "参照してください。" -#: ../../library/unittest.mock.rst:512 msgid "" "Create the child mocks for attributes and return value. By default child " "mocks will be the same type as the parent. Subclasses of Mock may want to " "override this to customize the way child mocks are made." msgstr "" -"子のモックを作成し、その値を返すようにしてください。デフォルトでは親と同じタ" -"イプで作成されます。サブクラスで子モックの作成される方法をカスタマイズしたい" -"場合には、このメソッドをオーバーライドします。" +"属性用と戻り値用の子モックを作成します。\n" +"デフォルトでは、子モックは親と同じ型になります。\n" +"Mock のサブクラスで子モックの作成方法をカスタマイズしたい場合は、このメソッド" +"をオーバーライドできます。" #: ../../library/unittest.mock.rst:517 msgid "" @@ -672,17 +671,16 @@ msgstr "" "りはその関数の戻り値が返されます。関数が :data:`DEFAULT` を返した場合は ( :" "attr:`return_value` によって) モックの通常の値を返します。" -#: ../../library/unittest.mock.rst:582 msgid "" "If you pass in an iterable, it is used to retrieve an iterator which must " "yield a value on every call. This value can either be an exception instance " "to be raised, or a value to be returned from the call to the mock (:data:" "`DEFAULT` handling is identical to the function case)." msgstr "" -"iterable が渡された場合、その値はイテレータを取り出すために使用されます。イテ" -"レータは毎回の呼び出しにおいて値を yield しなければなりません。この値は、送出" -"される例外インスタンスか、呼び出しからモックに返される値のいずれかです (:" -"data:`DEFAULT` の処理は関数の場合と同一です)。" +"iterable が渡された場合、その値はイテレータを取り出すために使用されます。\n" +"イテレータは毎回の呼び出しにおいて値を yield しなければなりません。\n" +"この値は、送出される例外インスタンスか、モックの呼び出しから返される値のいず" +"れかです (:data:`DEFAULT` の処理は関数の場合と同一です)。" #: ../../library/unittest.mock.rst:587 msgid "" @@ -722,18 +720,17 @@ msgid "" "property, is any keyword arguments (or an empty dictionary)." msgstr "" -#: ../../library/unittest.mock.rst:671 msgid "" ":attr:`call_args`, along with members of the lists :attr:`call_args_list`, :" "attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These " "are tuples, so they can be unpacked to get at the individual arguments and " "make more complex assertions. See :ref:`calls as tuples `." msgstr "" -":attr:`call_args` は、 :attr:`call_args_list` や :attr:`method_calls` 、 :" -"attr:`mock_calls` と同様、 :data:`call` オブジェクトです。これらはタプルとし" -"てアンパックすることで個別に取り出すことができます。そして、より複雑なアサー" -"ションを行うことができます。 :ref:`calls as tuples ` を参照" -"してください。" +":attr:`call_args` と、:attr:`call_args_list`、:attr:`method_calls`、:attr:" +"`mock_calls` の各リストの要素は :data:`call` オブジェクトです。\n" +"これらはタプルなので、アンパックして個々の引数を取り出し、より複雑なアサー" +"ションを行えます。\n" +":ref:`calls as tuples ` を参照してください。" #: ../../library/unittest.mock.rst:677 msgid "Added ``args`` and ``kwargs`` properties." @@ -1277,13 +1274,12 @@ msgid "" "convenient." msgstr "" -#: ../../library/unittest.mock.rst:1313 msgid "" "You \"block\" attributes by deleting them. Once deleted, accessing an " "attribute will raise an :exc:`AttributeError`." msgstr "" -"属性を削除することで, :exc:`AttributeError` を発生させ,アクセスを \"妨げる" -"\" ようになります." +"属性を削除すると、その属性へのアクセスを禁止できます。\n" +"削除後にその属性にアクセスすると :exc:`AttributeError` が発生します。" #: ../../library/unittest.mock.rst:1330 msgid "Mock names and the name attribute" @@ -1343,13 +1339,13 @@ msgstr "" "を設定する際に有用です。また、親に対して設定したすべての子の呼び出しを記録す" "るため、それらの間の順番を確認する際にも有用です:" -#: ../../library/unittest.mock.rst:1369 msgid "" "The exception to this is if the mock has a name. This allows you to prevent " "the \"parenting\" if for some reason you don't want it to happen." msgstr "" -"モックが名前をもつ場合は、例外的に扱われます。何らかの理由で \"子守り\" が発" -"生してほしくないときに、それを防ぐことができます。" +"例外はモックに名前が付いている場合です。\n" +"何らかの理由で親子関係を設定したくない場合は、名前を付けることで設定を防げま" +"す。" #: ../../library/unittest.mock.rst:1380 msgid "" @@ -1396,16 +1392,16 @@ msgstr "" msgid "The patchers" msgstr "patcher" -#: ../../library/unittest.mock.rst:1409 msgid "" "The patch decorators are used for patching objects only within the scope of " "the function they decorate. They automatically handle the unpatching for " "you, even if exceptions are raised. All of these functions can also be used " "in with statements or as class decorators." msgstr "" -"patch デコレータは、その関数のスコープ内でパッチを適用するオブジェクトに対し" -"て使用されます。たとえ例外が発生したとしても、パッチは自動的に解除されます。" -"これらすべての機能は文やクラスのデコレータとしても使用できます。" +"patch デコレータは、デコレートした関数の実行中だけオブジェクトを置き換えるた" +"めに使います。\n" +"例外が発生しても自動的にパッチを解除します。\n" +"これらの関数はすべて with 文やクラスデコレータとしても使用できます。" #: ../../library/unittest.mock.rst:1416 msgid "patch" @@ -3455,7 +3451,6 @@ msgid "" "AttributeError: Mock object has no attribute 'a'" msgstr "" -#: ../../library/unittest.mock.rst:2745 msgid "" "There are a few different ways of resolving this problem. The easiest, but " "not necessarily the least annoying, way is to simply set the required " @@ -3463,10 +3458,11 @@ msgid "" "you to fetch attributes that don't exist on the spec it doesn't prevent you " "setting them::" msgstr "" -"この問題を解決するためにいくつかの方法があります。一番簡単な、ただし一番面倒" -"でないとは限らない方法は、必要とされる属性を mock が生成された後に設定するこ" -"とです。 *autospec* は属性を参照することを禁止しますが、設定することは禁止し" -"ていません::" +"この問題を解決するためにいくつかの方法があります。\n" +"一番簡単な、ただし一番面倒でないとは限らない方法は、必要とされる属性を mock " +"が生成された後に設定することです。\n" +"*autospec* は spec に存在しない属性の取得を禁止しますが、その属性の設定は禁止" +"しません::" #: ../../library/unittest.mock.rst:2751 msgid "" diff --git a/library/unittest.po b/library/unittest.po index a8fb707b9..6f5dcee65 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -532,7 +532,6 @@ msgstr "" msgid "Test Discovery" msgstr "テストディスカバリ" -#: ../../library/unittest.rst:270 msgid "" "Unittest supports simple test discovery. In order to be compatible with test " "discovery, all of the test files must be :ref:`modules ` or :" @@ -540,12 +539,11 @@ msgid "" "project (this means that their filenames must be valid :ref:`identifiers " "`)." msgstr "" -"unittest はシンプルなテストディスカバリをサポートします。このテストディスカバ" -"リに対応するために、テストが定義された全ファイルは :ref:`modules ` もしくは :ref:`packages ` としてプロジェクトの最上位" -"のディスカバリでインポート可能である必要があります (つまり、これらのファイル" -"は :ref:`identifiers ` として有効である必要があるということで" -"す)。" +"unittest はシンプルなテストディスカバリをサポートします。\n" +"テストディスカバリを利用するには、すべてのテストファイルがプロジェクトの最上" +"位ディレクトリからインポート可能な :ref:`モジュール ` または :" +"ref:`パッケージ ` でなければなりません。\n" +"つまり、ファイル名は有効な :ref:`識別子 ` である必要があります。" #: ../../library/unittest.rst:276 msgid "" @@ -899,9 +897,8 @@ msgid "" "Test code should be modified much less frequently than the code it tests." msgstr "テストコードは、テスト対象コードほど頻繁に変更されない。" -#: ../../library/unittest.rst:473 msgid "Tested code can be refactored more easily." -msgstr "テストコードをより簡単にリファクタリングすることができる。" +msgstr "テスト対象のコードをより簡単にリファクタリングできる。" #: ../../library/unittest.rst:475 msgid "" @@ -1057,9 +1054,8 @@ msgid "" "OK (skipped=4)" msgstr "" -#: ../../library/unittest.rst:574 msgid "Classes can be skipped just like methods::" -msgstr "テストクラスは以下のようにメソッドをスキップすることができます::" +msgstr "メソッドと同じように、クラス全体もスキップできます。 ::" #: ../../library/unittest.rst:576 msgid "" @@ -1069,13 +1065,12 @@ msgid "" " pass" msgstr "" -#: ../../library/unittest.rst:581 msgid "" ":meth:`TestCase.setUp` can also skip the test. This is useful when a " "resource that needs to be set up is not available." msgstr "" -":meth:`TestCase.setUp` もスキップすることができます。この機能はセットアップの" -"対象のリソースが使用不可能な時に便利です。" +":meth:`TestCase.setUp` からもテストをスキップできます。\n" +"準備が必要なリソースを利用できない場合に便利です。" #: ../../library/unittest.rst:584 msgid "Expected failures use the :deco:`expectedFailure` decorator. ::" @@ -1409,24 +1404,23 @@ msgstr "" "以前のバージョンの ``run`` は結果オブジェクトを返しませんでした。また " "``TestCase`` インスタンスを呼び出した場合も同様でした。" -#: ../../library/unittest.rst:809 msgid "" "Calling this during a test method or :meth:`setUp` skips the current test. " "See :ref:`unittest-skipping` for more information." msgstr "" -"テストメソッドや :meth:`setUp` が現在のテストをスキップする間に呼ばれます。詳" -"細については、 :ref:`unittest-skipping` を参照してください。" +"テストメソッドや :meth:`setUp` の中で呼び出すと、現在のテストをスキップしま" +"す。\n" +"詳しくは :ref:`unittest-skipping` を参照してください。" -#: ../../library/unittest.rst:817 msgid "" "Return a context manager which executes the enclosed code block as a " "subtest. *msg* and *params* are optional, arbitrary values which are " "displayed whenever a subtest fails, allowing you to identify them clearly." msgstr "" -"このメソッドを囲っているブロックをサブテストとして実行するコンテキストマネー" -"ジャを返します。\n" -"*msg* と *params* はサブテストが失敗したときに表示されるオプションの任意の値" -"で、どんな値が使われたかを明確にするものです。" +"with ブロック内のコードをサブテストとして実行するコンテキストマネージャを返し" +"ます。\n" +"*msg* と *params* は省略可能な任意の値で、サブテストが失敗すると表示されるた" +"め、サブテストを明確に識別できます。" #: ../../library/unittest.rst:822 msgid "" @@ -1842,14 +1836,14 @@ msgstr "" "コンテキストマネージャとして使われたときは、 :meth:`assertRaises` は加えて " "*msg* キーワード引数も受け付けます。" -#: ../../library/unittest.rst:1020 msgid "" "The context manager will store the caught exception object in its :attr:`!" "exception` attribute. This can be useful if the intention is to perform " "additional checks on the exception raised::" msgstr "" -"このコンテキストマネージャは :attr:`!exception` で指定されたオブジェクトを格" -"納します。これにより、例外発生時の詳細な確認をおこなうことができます::" +"コンテキストマネージャは捕捉した例外オブジェクトを :attr:`!exception` 属性に" +"格納します。\n" +"発生した例外をさらに検査したい場合に便利です。 ::" #: ../../library/unittest.rst:1024 msgid "" @@ -2353,17 +2347,17 @@ msgstr "" "の順序はテスト結果に影響しません。要素が含まれていない場合には、シーケンスの" "差分がエラーメッセージとして表示されます。" -#: ../../library/unittest.rst:1331 msgid "" "Duplicate elements are *not* ignored when comparing *first* and *second*. It " "verifies whether each element has the same count in both sequences. " "Equivalent to: ``assertEqual(Counter(list(first)), Counter(list(second)))`` " "but works with sequences of unhashable objects as well." msgstr "" -"*first* と *second* の比較では、重複した要素は無視 *されません*。両者に同じ数" -"の要素が含まれていることを検証します。このメソッドは " -"``assertEqual(Counter(list(first)), Counter(list(second)))`` と同等に振る舞う" -"ことに加えて、ハッシュ化できないオブジェクトのシーケンスでも動作します。" +"*first* と *second* の比較では、重複した要素は無視 *されません*。\n" +"各要素の出現回数が両方のシーケンスで等しいことを検証します。\n" +"このメソッドは ``assertEqual(Counter(list(first)), Counter(list(second)))`` " +"と同等に振る舞うことに加えて、ハッシュ化できないオブジェクトのシーケンスでも" +"動作します。" #: ../../library/unittest.rst:1343 msgid "" @@ -2506,17 +2500,17 @@ msgstr "" "このメソッドは直接 :meth:`assertEqual` からは呼ばれませんが、 :meth:" "`assertListEqual` と :meth:`assertTupleEqual` の実装で使われています。" -#: ../../library/unittest.rst:1443 msgid "" "Tests that two lists or tuples are equal. If not, an error message is " "constructed that shows only the differences between the two. An error is " "also raised if either of the parameters are of the wrong type. These methods " "are used by default when comparing lists or tuples with :meth:`assertEqual`." msgstr "" -"2つのリストまたはタプルが等しいかどうかをテストします。等しくない場合には、両" -"者の差分を表示します。2つのパラメータの型が異なる場合にはテストがエラーになり" -"ます。このメソッドは、デフォルトで、 :meth:`assertEqual` が list または " -"tuple を比較するときに自動的に使用します。" +"2つのリストまたはタプルが等しいかどうかをテストします。\n" +"等しくない場合には、両者の差分を表示します。\n" +"どちらかの引数が要求される型でない場合にもエラーになります。\n" +"このメソッドは、デフォルトで、 :meth:`assertEqual` が list または tuple を比" +"較するときに自動的に使用します。" #: ../../library/unittest.rst:1454 msgid "" @@ -2947,16 +2941,14 @@ msgstr "" "を備えています。 :class:`TestSuite` インスタンスを実行することはスイートをイ" "テレートして得られる個々のテストを実行することと同じです。" -#: ../../library/unittest.rst:1770 msgid "" "If *tests* is given, it must be an iterable of individual test cases or " "other test suites that will be used to build the suite initially. Additional " "methods are provided to add test cases and suites to the collection later on." msgstr "" -"引数 *tests* が指定された場合、それはテストケースに亘る繰り返し可能オブジェク" -"トまたは内部でスイートを組み立てるための他のテストスイートでなければなりませ" -"ん。後からテストケースやスイートをコレクションに付け加えるためのメソッドも提" -"供されています。" +"*tests* を指定する場合は、スイートを最初に構築するための個々のテストケースや" +"他のテストスイートを要素とするイテラブルでなければなりません。\n" +"後からテストケースやスイートを追加するためのメソッドも用意されています。" #: ../../library/unittest.rst:1774 msgid "" @@ -3095,7 +3087,6 @@ msgstr "" msgid ":class:`TestLoader` objects have the following attributes:" msgstr ":class:`TestLoader` オブジェクトには以下の属性があります:" -#: ../../library/unittest.rst:1859 msgid "" "A list of the non-fatal errors encountered while loading tests. Not reset by " "the loader at any point. Fatal errors are signalled by the relevant method " @@ -3105,7 +3096,8 @@ msgstr "" "テストの読み込み中に起きた致命的でないエラーのリストです。\n" "どの時点でもローダーからリセットされることはありません。\n" "致命的なエラーは適切なメソッドが例外を送出して、呼び出し元に通知します。\n" -"致命的でないエラーも、実行したときのエラーを総合テストが通知してくれます。" +"致命的でないエラーについても、実行すると元のエラーを送出するテストが生成さ" +"れ、エラーが通知されます。" #: ../../library/unittest.rst:1868 msgid ":class:`TestLoader` objects have the following methods:" @@ -3311,14 +3303,13 @@ msgstr "" "テストの検索の実行では、たとえ load_tests 関数自身が ``loader.discover`` を呼" "んだとしても、パッケージのチェックは1回のみとなることが保証されています。" -#: ../../library/unittest.rst:1983 msgid "" "If ``load_tests`` exists then discovery does *not* recurse into the package, " "``load_tests`` is responsible for loading all tests in the package." msgstr "" -"``load_tests`` が存在して、ディスカバリがパッケージ内を再帰的な検索を続けてい" -"る途中で *ない* 場合、``load_tests`` はそのパッケージ内の全てのテストをロード" -"する責務を担います。" +"``load_tests`` が存在する場合、ディスカバリはそのパッケージ内を再帰的に検索し" +"ません。\n" +"パッケージ内のすべてのテストの読み込みは ``load_tests`` が担当します。" #: ../../library/unittest.rst:1987 msgid "" @@ -3537,16 +3528,16 @@ msgid "" "elapsed time of each test which was run." msgstr "" -#: ../../library/unittest.rst:2124 msgid "" "Set to ``True`` when the execution of tests should stop by :meth:`stop`." -msgstr "``True`` が設定されると :meth:`stop` によりテストの実行が停止します。" +msgstr "" +":meth:`stop` によってテストの実行を停止すべき状態になると、``True`` に設定さ" +"れます。" #: ../../library/unittest.rst:2128 msgid "The total number of tests run so far." msgstr "これまでに実行したテストの総数です。" -#: ../../library/unittest.rst:2132 msgid "" "If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in " "between :meth:`startTest` and :meth:`stopTest` being called. Collected " @@ -3555,10 +3546,11 @@ msgid "" "error message." msgstr "" "``True`` が設定されると、 ``sys.stdout`` と ``sys.stderr`` は、 :meth:" -"`startTest` から :meth:`stopTest` が呼ばれるまでの間バッファリングされます。" +"`startTest` から :meth:`stopTest` が呼ばれるまでの間バッファリングされま" +"す。\n" "実際に、結果が ``sys.stdout`` と ``sys.stderr`` に出力されるのは、テストが失" -"敗するかエラーが発生した時になります。表示の際には、全ての失敗 / エラーメッ" -"セージが表示されます。" +"敗するかエラーが発生した時になります。\n" +"出力は失敗やエラーのメッセージにも添付されます。" #: ../../library/unittest.rst:2141 msgid "" @@ -3967,7 +3959,6 @@ msgstr "" "*failfast*, *catchbreak*, *buffer* は、`コマンドラインオプション`_ にある同名" "のオプションと同じ効果のあるパラメータです。" -#: ../../library/unittest.rst:2397 msgid "" "The *warnings* argument specifies the :ref:`warning filter ` " "that should be used while running the tests. If it's not specified, it will " @@ -3978,7 +3969,7 @@ msgstr "" "*warnings* 引数では、テストの実行中に使うべき :ref:`警告フィルタ ` を指定します。\n" "この引数が指定されない場合には、 :option:`!-W` オプションが :program:" -"`python` に渡されていなければ ``None`` のまま (:ref:`警告の制御 ` を参照してください) で、そうでなければ ``'default'`` が設定されま" "す。" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index b94138d90..0ce2b02c2 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -788,7 +788,6 @@ msgstr "" "た :class:`str` を渡した場合、:exc:`TypeError` が、非 ASCII バイト値が渡され" "た場合 :exc:`UnicodeDecodeError` が送出されます。" -#: ../../library/urllib.parse.rst:512 msgid "" "To support easier conversion of result objects between :class:`str` and :" "class:`bytes`, all return values from URL parsing functions provide either " @@ -800,14 +799,15 @@ msgid "" "contains either :class:`bytes` data (for :meth:`encode` methods) or :class:" "`str` data (for :meth:`decode` methods)." msgstr "" -":class:`str` と :class:`bytes` 間で容易に変換を行えるよう、すべての URL 解析" -"関数は :meth:`encode` メソッド (結果に :class:`str` データが含まれる時用) " -"か :meth:`decode` メソッド (結果に :class:`bytes` データが含まれる時用) のど" -"ちらかを提供しています。これらメソッドの動作は対応する :class:`str` と :" -"class:`bytes` メソッドが持つものと同じです (ただしデフォルトのエンコーディン" -"グは ``'utf-8'`` ではなく ``'ascii'`` になります)。それぞれは :meth:`encode` " -"メソッドを持つ :class:`bytes` データか :meth:`decode` メソッドを持つ :class:" -"`str` データのどちらかに対応した型を生成します。" +"結果オブジェクトを :class:`str` と :class:`bytes` の間で変換しやすくするた" +"め、URL 解析関数のすべての戻り値には、:class:`str` データを含む場合は :meth:" +"`encode` メソッド、:class:`bytes` データを含む場合は :meth:`decode` メソッド" +"があります。\n" +"これらのメソッドのシグネチャは、対応する :class:`str` および :class:`bytes` " +"のメソッドと同じです (ただし、デフォルトのエンコーディングは ``'utf-8'`` では" +"なく ``'ascii'`` です)。\n" +":meth:`encode` は :class:`bytes` データを含む対応する型の値を生成し、:meth:" +"`decode` は :class:`str` データを含む対応する型の値を生成します。" #: ../../library/urllib.parse.rst:523 msgid "" @@ -867,11 +867,12 @@ msgstr "" "func:`urlsplit` および :func:`urlparse` の戻り値では、このメソッドが返す URL " "には説明されているすべての変更が加えられます。" -#: ../../library/urllib.parse.rst:559 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" -msgstr "加えた解析関数を逆に行えばこのメソッドの戻り値は元の URL になります:" +msgstr "" +"このメソッドの結果を元の解析関数で再び解析しても、このメソッドの結果は変わり" +"ません。" #: ../../library/urllib.parse.rst:575 msgid "" @@ -954,7 +955,6 @@ msgstr "" "ます。これらは上述の URL 解析関数でカバーされていない URL 構成要素からオリジ" "ナルデータの再作成もサポートしています。" -#: ../../library/urllib.parse.rst:638 msgid "" "Replace special characters in *string* using the :samp:`%{xx}` escape. " "Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " @@ -962,10 +962,13 @@ msgid "" "optional *safe* parameter specifies additional ASCII characters that should " "not be quoted --- its default value is ``'/'``." msgstr "" -"*string* 内の特殊文字を :samp:`%{xx}` を使用してエスケープします。文字、数" -"字、および ``'_.-~'`` はクオートされません。デフォルトでは、この関数は URL の" -"パス部分のクオートのために用意されています。任意のパラメータ *safe* を指定す" -"ると、指定した ASCII 文字もクオートされません。デフォルトは ``'/'`` です。" +"*string* 内の特殊文字を :samp:`%{xx}` を使用してエスケープします。\n" +"英字、数字、および ``'_.-~'`` はクオートされません。\n" +"デフォルトでは、この関数は URL のパス部分のクオートのために用意されていま" +"す。\n" +"任意のパラメータ *safe* を指定すると、指定した ASCII 文字もクオートされませ" +"ん。\n" +"デフォルトは ``'/'`` です。" #: ../../library/urllib.parse.rst:644 ../../library/urllib.parse.rst:691 #: ../../library/urllib.parse.rst:720 @@ -1148,15 +1151,14 @@ msgstr "" "エンコードされた文字列内のパラメーターの順序はシーケンス内のパラメータータプ" "ルの順序と一致します。" -#: ../../library/urllib.parse.rst:756 msgid "" "The *safe*, *encoding*, and *errors* parameters are passed down to " "*quote_via* (the *encoding* and *errors* parameters are only passed when a " "query element is a :class:`str`)." msgstr "" -"*safe*, *encoding*, および *errors* パラメータは *quote_via* にそのまま渡され" -"ます (クエリ要素が :class:`str` の場合は、 *encoding* と *errors* パラメータ" -"だけが渡されます)。" +"*safe*、*encoding*、*errors* パラメータは *quote_via* に渡されます。\n" +"ただし、*encoding* と *errors* が渡されるのはクエリの要素が :class:`str` の場" +"合だけです。" #: ../../library/urllib.parse.rst:760 msgid "" diff --git a/library/urllib.request.po b/library/urllib.request.po index d06702940..dd9346071 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -248,7 +248,6 @@ msgstr "" "どうかはチェックしません。適切なインターフェースを持った任意のクラスを利用す" "ることができます。" -#: ../../library/urllib.request.rst:128 msgid "" "Return an :class:`OpenerDirector` instance, which chains the handlers in the " "order given. *handler*\\s can be either instances of :class:`BaseHandler`, " @@ -262,15 +261,16 @@ msgid "" "`HTTPErrorProcessor`." msgstr "" "与えられた順番に URL ハンドラを連鎖させる :class:`OpenerDirector` のインスタ" -"ンスを返します。 *handler* は :class:`BaseHandler` または :class:" -"`BaseHandler` のサブクラスのインスタンスのどちらかです (どちらの場合も、コン" -"ストラクトは引数無しで呼び出せるようになっていなければなりません) 。クラス :" -"class:`ProxyHandler` (proxy 設定が検出された場合), :class:`UnknownHandler`, :" -"class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :class:" -"`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :class:" -"`HTTPErrorProcessor` については、そのクラスのインスタンスか、そのサブクラスの" -"インスタンスが *handler* に含まれていない限り、 *handler* よりも先に連鎖しま" -"す。" +"ンスを返します。\n" +"*handler* には :class:`BaseHandler` のインスタンスか、:class:`BaseHandler` の" +"サブクラスを指定できます (サブクラスの場合、引数なしでコンストラクタを呼び出" +"せる必要があります)。\n" +"クラス :class:`ProxyHandler` (proxy 設定が検出された場合), :class:" +"`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :" +"class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :" +"class:`HTTPErrorProcessor` については、そのクラスのインスタンスか、そのサブク" +"ラスのインスタンスが *handler* に含まれていない限り、 *handler* よりも先に連" +"鎖します。" #: ../../library/urllib.request.rst:138 msgid "" @@ -958,13 +958,12 @@ msgstr "" msgid "Add a header that will not be added to a redirected request." msgstr "リダイレクトされたリクエストには追加されないヘッダーを追加します。" -#: ../../library/urllib.request.rst:613 msgid "" "Return whether the instance has the named header (checks both regular and " "unredirected)." msgstr "" -"インスタンスが名前つきヘッダーであるかどうかを (通常のヘッダーと非リダイレク" -"トヘッダの両方を調べて) 返します。" +"インスタンスが指定された名前のヘッダーを持つかどうかを返します (通常のヘッ" +"ダーと非リダイレクトヘッダーの両方を調べます)。" #: ../../library/urllib.request.rst:619 msgid "" @@ -1080,12 +1079,11 @@ msgstr "" msgid "See |protocol_request|_ for more information." msgstr "詳細は、 |protocol_request|_ を参照してください。" -#: ../../library/urllib.request.rst:693 msgid "" ":meth:`!_response` --- signal that the handler knows how to post-" "process *protocol* responses." msgstr "" -":meth:`!_response` --- ハンドラーが *protocol* リクエストのポストプ" +":meth:`!_response` --- ハンドラーが *protocol* レスポンスのポストプ" "ロセス方法を知っていることを示すシグナルです。" #: ../../library/urllib.request.rst:696 @@ -1179,23 +1177,21 @@ msgstr "" "試します。メソッドがすべて :const:`None` を返すと、さらに同じアルゴリズムを繰" "り返して :meth:`~BaseHandler.unknown_open` を呼び出します。" -#: ../../library/urllib.request.rst:744 msgid "" "Note that the implementation of these methods may involve calls of the " "parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :" "meth:`~OpenerDirector.error` methods." msgstr "" "これらのメソッドの実装には、親となる :class:`OpenerDirector` インスタンスの :" -"meth:`~OpenDirector.open` や :meth:`~OpenDirector.error` といったメソッド呼び" -"出しが入る場合があるので注意してください。" +"meth:`~OpenerDirector.open` や :meth:`~OpenerDirector.error` といったメソッド" +"呼び出しが入る場合があるので注意してください。" -#: ../../library/urllib.request.rst:748 msgid "" "Every handler with a method named like :meth:`!_response` has that " "method called to post-process the response." msgstr "" ":meth:`!_response` 形式のメソッドを持つすべてのハンドラーに対してそ" -"のメソッドを呼び出し、リクエストのポストプロセスを行います。" +"のメソッドを呼び出し、レスポンスのポストプロセスを行います。" #: ../../library/urllib.request.rst:755 msgid "BaseHandler Objects" @@ -1253,7 +1249,6 @@ msgstr "" "このメソッドは :class:`BaseHandler` では定義されて *いません* 。しかし、全て" "の URL をキャッチさせたいなら、サブクラスで定義する 必要があります。" -#: ../../library/urllib.request.rst:792 msgid "" "This method, if implemented, will be called by the parent :class:" "`OpenerDirector`. It should return a file-like object as described in the " @@ -1262,12 +1257,13 @@ msgid "" "URLError`, unless a truly exceptional thing happens (for example, :exc:" "`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`)." msgstr "" -"このメソッドが実装されていれば、:class:`OpenerDirector` の親クラスによって呼" -"び出されます。これは :class:`OpenerDirector` の :meth:`~OpenerDirector.open` " -"の戻り値で表されるファイルライクオブジェクトか、または ``None`` を返さなけれ" -"ばならず、真に想定外の事態が発生した場合を除き、:exc:`~urllib.error." -"URLError` を送出しなければなりません (例えば、:exc:`MemoryError` は :exc:" -"`~urllib.error.URLError` にマップしてはなりません)。" +"このメソッドが実装されていれば、親となる :class:`OpenerDirector` によって呼び" +"出されます。\n" +"これは :class:`OpenerDirector` の :meth:`~OpenerDirector.open` の戻り値で表さ" +"れるファイルライクオブジェクトか、または ``None`` を返さなければならず、真に" +"想定外の事態が発生した場合を除き、:exc:`~urllib.error.URLError` を送出しなけ" +"ればなりません (例えば、:exc:`MemoryError` は :exc:`~urllib.error.URLError` " +"にマップしてはなりません)。" #: ../../library/urllib.request.rst:799 msgid "This method will be called before any protocol-specific open method." @@ -1401,13 +1397,12 @@ msgstr "" "れます。その際、 *req* は :class:`Request` オブジェクトになります。戻り値は :" "class:`Request` オブジェクトでなければなりません。" -#: ../../library/urllib.request.rst:872 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to post-process responses of the given protocol." msgstr "" "このメソッドは :class:`BaseHandler` では *定義されていません* が、サブクラス" -"で特定のプロトコルのリクエストのポストプロセスを行いたい場合には定義する必要" +"で特定のプロトコルのレスポンスのポストプロセスを行いたい場合には定義する必要" "があります。" #: ../../library/urllib.request.rst:875 @@ -1428,16 +1423,15 @@ msgstr "" msgid "HTTPRedirectHandler Objects" msgstr "HTTPRedirectHandler オブジェクト" -#: ../../library/urllib.request.rst:889 msgid "" "Some HTTP redirections require action from this module's client code. If " "this is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` " "for details of the precise meanings of the various redirection codes." msgstr "" -"一部の HTTP リクエストはこのモジュールのクライアントモードからの操作を要求し" -"ます。その場合、:exc:`~urllib.error.HTTPError` が送出されます。さまざまなリダ" -"イレクションコードの正確な意味についての詳細は :rfc:`2616` を参照してくださ" -"い。" +"HTTP リダイレクトの中には、このモジュールを利用するコードでの対応が必要なもの" +"があります。\n" +"その場合は :exc:`~urllib.error.HTTPError` が送出されます。\n" +"各リダイレクトコードの正確な意味については :rfc:`2616` を参照してください。" #: ../../library/urllib.request.rst:893 msgid "" @@ -1604,15 +1598,13 @@ msgstr "" msgid "HTTPPasswordMgrWithPriorAuth Objects" msgstr "HTTPPasswordMgrWithPriorAuth オブジェクト" -#: ../../library/urllib.request.rst:1014 msgid "" "This password manager extends :class:`HTTPPasswordMgrWithDefaultRealm` to " "support tracking URIs for which authentication credentials should always be " "sent." msgstr "" "このパスワードマネージャは :class:`HTTPPasswordMgrWithDefaultRealm` を継承し" -"て、認証の証明書を常に送らないといけない URI を追跡する機能をサポートしていま" -"す。" +"て、認証情報を常に送らないといけない URI を追跡する機能をサポートしています。" #: ../../library/urllib.request.rst:1021 msgid "" @@ -1633,11 +1625,10 @@ msgstr "" ":class:`HTTPPasswordMgrWithDefaultRealm` オブジェクトに対する同名のメソッドと" "同じです。" -#: ../../library/urllib.request.rst:1035 msgid "" "Update the ``is_authenticated`` flag for the given *uri* or list of URIs." msgstr "" -"与えられた *url* や URI のリストの ``is_authenticated`` フラグを更新します。" +"与えられた *uri* や URI のリストの ``is_authenticated`` フラグを更新します。" #: ../../library/urllib.request.rst:1041 msgid "" @@ -1890,13 +1881,12 @@ msgstr "" "できないためです。一般に、返された bytes オブジェクトを文字列にデコードするた" "めのエンコーディングの決定あるいは推測はプログラム側が行います。" -#: ../../library/urllib.request.rst:1278 msgid "" "The following HTML spec document, https://html.spec.whatwg.org/#charset, " "lists the various ways in which an HTML or an XML document could have " "specified its encoding information." msgstr "" -"以下の HTML の仕様ドキュメント ttps://html.spec.whatwg.org/#charset には " +"以下の HTML の仕様ドキュメント https://html.spec.whatwg.org/#charset には " "HTML や XML ドキュメントでそのエンコーディング情報を指定するさまざまな方法の" "一覧があります。" diff --git a/library/uuid.po b/library/uuid.po index e7518efd4..d675bdb3a 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -63,13 +63,12 @@ msgid "" "enumeration:" msgstr "" -#: ../../library/uuid.rst:34 msgid "The UUID was generated by the platform in a multiprocessing-safe way." -msgstr "UUID は並列処理に対して安全なプラットフォームで生成された" +msgstr "" +"プラットフォームが複数プロセスでの利用に対して安全な方法で UUID を生成した。" -#: ../../library/uuid.rst:38 msgid "The UUID was not generated in a multiprocessing-safe way." -msgstr "UUID は並列処理に対して安全なプラットフォームで生成されなかった" +msgstr "UUID は複数プロセスでの利用に対して安全な方法では生成されなかった。" #: ../../library/uuid.rst:42 msgid "" @@ -219,19 +218,17 @@ msgstr "" msgid "Added UUID versions 6, 7 and 8." msgstr "" -#: ../../library/uuid.rst:165 msgid "" "An enumeration of :class:`SafeUUID` which indicates whether the platform " "generated the UUID in a multiprocessing-safe way." msgstr "" -":class:`SafeUUID` の列挙で、UUID は並列処理に対して安全なプラットフォームで生" -"成されたかを示す。" +"プラットフォームが複数プロセスでの利用に対して安全な方法で UUID を生成したか" +"どうかを示す :class:`SafeUUID` の列挙値。" #: ../../library/uuid.rst:170 msgid "The :mod:`!uuid` module defines the following functions:" msgstr "" -#: ../../library/uuid.rst:175 msgid "" "Get the hardware address as a 48-bit positive integer. The first time this " "runs, it may launch a separate program, which could be quite slow. If all " @@ -243,15 +240,18 @@ msgid "" "least significant bit of the first octet is *unset*) will be preferred over " "locally administered MAC addresses, but with no other ordering guarantees." msgstr "" -"48 ビットの正の整数としてハードウェアアドレスを取得します。最初にこれを起動す" -"ると、別個のプログラムが立ち上がって非常に遅くなることがあります。もしハード" -"ウェアを取得する試みが全て失敗すると、ランダムな 48 ビットを、:rfc:`4122` で" -"推奨されているように、マルチキャストビット (最初のオクテットの最下位ビット) " -"を 1 に設定して使います。\"ハードウェアアドレス\" とはネットワークインター" -"フェースの MAC アドレスを指します。複数のネットワークインターフェースを持つマ" -"シンの場合、全域管理されたMACアドレス (最初のオクテットの下位より2番目のビッ" -"トが *設定されていない* MACアドレス) が、他の個別管理アドレスよりも優先的に使" -"用されます。この優先順序は保証されません。" +"48 ビットの正の整数としてハードウェアアドレスを取得します。\n" +"最初にこれを起動すると、別個のプログラムが立ち上がって非常に遅くなることがあ" +"ります。\n" +"もしハードウェアを取得する試みが全て失敗すると、ランダムな 48 ビットを、:rfc:" +"`4122` で推奨されているように、マルチキャストビット (最初のオクテットの最下位" +"ビット) を 1 に設定して使います。\n" +"\"ハードウェアアドレス\" とはネットワークインターフェースの MAC アドレスを指" +"します。\n" +"複数のネットワークインターフェースを持つマシンの場合、全域管理されたMACアドレ" +"ス (最初のオクテットの下位より2番目のビットが *設定されていない* MACアドレ" +"ス) が、他の個別管理アドレスよりも優先的に使用されます。\n" +"それ以外の順序は保証されません。" #: ../../library/uuid.rst:185 msgid "" diff --git a/library/venv.po b/library/venv.po index e7196c048..76dc166ad 100644 --- a/library/venv.po +++ b/library/venv.po @@ -931,7 +931,6 @@ msgstr "" "3.7.2 でのみ、ソース群でビルドを実行しているのでなければ :meth:" "`setup_python` だけは何もしません。" -#: ../../library/venv.rst:511 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " @@ -940,7 +939,7 @@ msgstr "" "Windows では、 :meth:`setup_scripts` の代わりに :meth:`setup_python` の一部と" "してリダイレクトを行うスクリプトをコピーします。\n" "これは 3.7.2 には当てはまりません。\n" -"シンボリックリンクを使ったときは、オリジナルの実行ファイルをコピーします。" +"シンボリックリンクを使ったときは、元の実行ファイルへのリンクを作成します。" #: ../../library/venv.rst:516 msgid "There is also a module-level convenience function:" diff --git a/library/wave.po b/library/wave.po index 92ff538a7..acd3d2e22 100644 --- a/library/wave.po +++ b/library/wave.po @@ -220,13 +220,12 @@ msgstr "" msgid "Rewind the file pointer to the beginning of the audio stream." msgstr "ファイルのポインタをオーディオストリームの先頭に戻します。" -#: ../../library/wave.rst:159 msgid "" "The following two methods define a term \"position\" which is compatible " "between them, and is otherwise implementation dependent." msgstr "" -"以下の2つのメソッドは共通の\"位置\"を定義しています。\"位置\"は他の関数とは独" -"立して実装されています。" +"以下の 2 つのメソッドが扱う「位置」は互いに互換性がありますが、それ以外の点で" +"は実装依存です。" #: ../../library/wave.rst:165 msgid "Set the file pointer to the specified position." @@ -398,16 +397,15 @@ msgstr "*nframes* の修正なしにオーディオフレームを書き込み msgid "Any :term:`bytes-like object` is now accepted." msgstr "どのような :term:`bytes-like object` も使用できるようになりました。" -#: ../../library/wave.rst:327 msgid "" "Write audio frames and make sure *nframes* is correct. It will raise an " "error if the output stream is not seekable and the total number of frames " "that have been written after *data* has been written does not match the " "previously set value for *nframes*." msgstr "" -"出力ストリームが seek 不可能で、 *data* が書き込まれた後でそれ以前に " -"*nframes* に設定された値と書き込まれた全フレーム数が一致しなければ、エラーを" -"送出します。" +"オーディオフレームを書き込み、*nframes* が正しい値になるようにします。\n" +"出力ストリームがシーク不能で、*data* の書き込み後の総フレーム数が事前に設定し" +"た *nframes* と一致しない場合は、エラーを送出します。" #: ../../library/wave.rst:335 msgid "" diff --git a/library/weakref.po b/library/weakref.po index 5f7b4f257..46ebe7596 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -232,7 +232,6 @@ msgstr "" "*object* が削除されてから初めて :func:`hash` が呼び出された場合に、その呼び出" "しは :exc:`TypeError` を発生させます。" -#: ../../library/weakref.rst:116 msgid "" "Weak references support tests for equality, but not ordering. If the " "referents are still alive, two references have the same equality " @@ -240,10 +239,11 @@ msgid "" "referent has been deleted, the references are equal only if the reference " "objects are the same object." msgstr "" -"弱参照は等価性のテストをサポートしていますが、順序をサポートしていません。参" -"照がまだ生きているならば、 *callback* に関係なく二つの参照はそれらのリファレ" -"ントと同じ等価関係を持ちます。リファレントのどちらか一方が削除された場合、参" -"照オブジェクトが同一である場合に限り、その参照は等価です。" +"弱参照は等価性のテストをサポートしていますが、順序をサポートしていません。\n" +"リファレントがまだ生きているならば、 *callback* に関係なく二つの参照はそれら" +"のリファレントと同じ等価関係を持ちます。\n" +"リファレントのどちらか一方が削除された場合、参照オブジェクトが同一である場合" +"に限り、その参照は等価です。" msgid "This is a subclassable type rather than a factory function." msgstr "これはファクトリ関数ではなく、サブクラス化可能な型です。" diff --git a/library/winreg.po b/library/winreg.po index 58eb75705..830e9f343 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -197,15 +197,14 @@ msgstr "" msgid "Deletes the specified key." msgstr "指定されたキーを削除します。" -#: ../../library/winreg.rst:130 msgid "" "*sub_key* is a string that must be a subkey of the key identified by the " "*key* parameter. This value must not be ``None``, and the key may not have " "subkeys." msgstr "" -"*sub_key* は文字列で、*key* 引数によって指定されたキーのサブキーでなければな" -"りません。この値は ``None`` であってはならず、キーはサブキーを持っていなくて" -"もかまいません。" +"*sub_key* は、*key* 引数で指定されたキーのサブキー名を表す文字列です。\n" +"この値は ``None`` であってはならず、削除対象のキーはサブキーを持っていてはな" +"りません。" #: ../../library/winreg.rst:133 ../../library/winreg.rst:162 msgid "*This method can not delete keys with subkeys.*" @@ -225,15 +224,14 @@ msgid "" "arguments ``key``, ``sub_key``, ``access``." msgstr "" -#: ../../library/winreg.rst:151 msgid "" "*sub_key* is a string that must be a subkey of the key identified by the " "*key* parameter. This value must not be ``None``, and the key may not have " "subkeys." msgstr "" -"*sub_key* は *key* 引数によって指定された key の subkey でなければなりませ" -"ん。この値は ``None`` であってはなりません。また、key は subkey を持たないか" -"もしれません。" +"*sub_key* は、*key* 引数で指定されたキーのサブキー名を表す文字列です。\n" +"この値は ``None`` であってはならず、削除対象のキーはサブキーを持っていてはな" +"りません。" #: ../../library/winreg.rst:157 msgid "" @@ -634,16 +632,16 @@ msgstr "" msgid "Saves the specified key, and all its subkeys to the specified file." msgstr "指定されたキーと、そのサブキー全てを指定したファイルに保存します。" -#: ../../library/winreg.rst:429 msgid "" "*file_name* is the name of the file to save registry data to. This file " "cannot already exist. If this filename includes an extension, it cannot be " "used on file allocation table (FAT) file systems by the :meth:`LoadKey` " "method." msgstr "" -"*file_name* はレジストリデータを保存するファイルの名前です、このファイルはす" -"でに存在していてはいけません。このファイル名が拡張子を含んでいる場合、 :meth:" -"`LoadKey` メソッドは、FAT ファイルシステムを使うことができません。" +"*file_name* はレジストリデータの保存先ファイル名です。\n" +"このファイルは既に存在していてはなりません。\n" +"ファイル名に拡張子が含まれている場合、FAT ファイルシステム上では :meth:" +"`LoadKey` メソッドでそのファイルを使用できません。" #: ../../library/winreg.rst:434 msgid "" @@ -914,32 +912,29 @@ msgstr "" "microsoft.com/en-us/library/ms724878%28v=VS.85%29.aspx>`__ を参照してくださ" "い。" -#: ../../library/winreg.rst:619 msgid "" "Combines the STANDARD_RIGHTS_REQUIRED, :const:`KEY_QUERY_VALUE`, :const:" "`KEY_SET_VALUE`, :const:`KEY_CREATE_SUB_KEY`, :const:" "`KEY_ENUMERATE_SUB_KEYS`, :const:`KEY_NOTIFY`, and :const:`KEY_CREATE_LINK` " "access rights." msgstr "" -"STANDARD_RIGHTS_REQUIRED (:const:`KEY_QUERY_VALUE`, :const:`KEY_SET_VALUE`, :" +"STANDARD_RIGHTS_REQUIRED、:const:`KEY_QUERY_VALUE`, :const:`KEY_SET_VALUE`, :" "const:`KEY_CREATE_SUB_KEY`, :const:`KEY_ENUMERATE_SUB_KEYS`, :const:" -"`KEY_NOTIFY`, :const:`KEY_CREATE_LINK`) アクセス権限の組み合わせ。" +"`KEY_NOTIFY`, :const:`KEY_CREATE_LINK` のアクセス権限の組み合わせ。" -#: ../../library/winreg.rst:626 msgid "" "Combines the STANDARD_RIGHTS_WRITE, :const:`KEY_SET_VALUE`, and :const:" "`KEY_CREATE_SUB_KEY` access rights." msgstr "" -"STANDARD_RIGHTS_WRITE (:const:`KEY_SET_VALUE`, :const:`KEY_CREATE_SUB_KEY`) " +"STANDARD_RIGHTS_WRITE、:const:`KEY_SET_VALUE`, :const:`KEY_CREATE_SUB_KEY` の" "アクセス権限の組み合わせ。" -#: ../../library/winreg.rst:631 msgid "" "Combines the STANDARD_RIGHTS_READ, :const:`KEY_QUERY_VALUE`, :const:" "`KEY_ENUMERATE_SUB_KEYS`, and :const:`KEY_NOTIFY` values." msgstr "" -"STANDARD_RIGHTS_READ (:const:`KEY_QUERY_VALUE`, :const:" -"`KEY_ENUMERATE_SUB_KEYS`, :const:`KEY_NOTIFY`) アクセス権限の組み合わせ。" +"STANDARD_RIGHTS_READ、:const:`KEY_QUERY_VALUE`, :const:" +"`KEY_ENUMERATE_SUB_KEYS`, :const:`KEY_NOTIFY` のアクセス権限の組み合わせ。" #: ../../library/winreg.rst:636 msgid "Equivalent to :const:`KEY_READ`." diff --git a/library/wsgiref.po b/library/wsgiref.po index 8f6a029f1..1ac80444a 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -428,7 +428,6 @@ msgstr "" "(複数の値を持つ可能性のある) ヘッダを、キーワード引数を通じて指定するオプショ" "ンの MIME パラメータと共に追加します。" -#: ../../library/wsgiref.rst:254 msgid "" "*name* is the header field to add. Keyword arguments can be used to set " "MIME parameters for the header field. Each parameter must be a string or " @@ -439,14 +438,18 @@ msgid "" "only the parameter name is added. (This is used for MIME parameters without " "a value.) Example usage::" msgstr "" -"*name* は追加するヘッダフィールドです。このヘッダフィールドに MIME パラメータ" -"を設定するためにキーワード引数を使うことができます。それぞれのパラメータは文" -"字列か ``None`` でなければいけません。パラメータ中のアンダースコアはダッシュ " -"(-) に変換されます。これは、ダッシュが Python の識別子としては不正なのです" -"が、多くの MIME パラメータはダッシュを含むためです。パラメータ値が文字列の場" -"合、これはヘッダ値のパラメータに ``name=\"value\"`` の形で追加されます。この" -"値がもし ``None`` の場合、パラメータ名だけが追加されます。(これは値なしの " -"MIME パラメータの場合に使われます。)使い方の例は::" +"*name* は追加するヘッダフィールドです。\n" +"このヘッダフィールドに MIME パラメータを設定するためにキーワード引数を使うこ" +"とができます。\n" +"それぞれのパラメータは文字列か ``None`` でなければいけません。\n" +"パラメータ名中のアンダースコアはダッシュ (-) に変換されます。\n" +"これは、ダッシュが Python の識別子としては不正なのですが、多くの MIME パラ" +"メータはダッシュを含むためです。\n" +"パラメータ値が文字列の場合、これはヘッダ値のパラメータに ``name=\"value\"`` " +"の形で追加されます。\n" +"この値がもし ``None`` の場合、パラメータ名だけが追加されます。\n" +"(これは値なしの MIME パラメータの場合に使われます。\n" +")使い方の例は::" #: ../../library/wsgiref.rst:262 msgid "h.add_header('content-disposition', 'attachment', filename='bud.gif')" diff --git a/library/xml.dom.po b/library/xml.dom.po index 191c8c104..42ea9346a 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -46,7 +46,6 @@ msgstr "" "す。さらに、前述の構造に対して、よく知られたインターフェースをもつ一連のオブ" "ジェクトを通したアクセス手段も提供します。" -#: ../../library/xml.dom.rst:17 msgid "" "The DOM is extremely useful for random-access applications. SAX only allows " "you a view of one bit of the document at a time. If you are looking at one " @@ -56,25 +55,27 @@ msgid "" "document somewhere in your own code. SAX does not do it for you. Also, if " "you need to look ahead in the XML document, you are just out of luck." msgstr "" -"DOM はランダムアクセスを行うアプリケーションで非常に有用です。SAX では、一度" -"に閲覧することができるのはドキュメントのほんの一部分です。ある SAX 要素に注目" -"している際には、別の要素をアクセスすることはできません。またテキストノードに" -"注目しているときには、その中に入っている要素をアクセスすることができません。" +"DOM はランダムアクセスを行うアプリケーションで非常に有用です。\n" +"SAX では、一度に閲覧することができるのはドキュメントのほんの一部分です。\n" +"ある SAX 要素に注目している際には、別の要素をアクセスすることはできません。\n" +"またテキストノードに注目しているときには、そのテキストノードを含む要素にアク" +"セスすることができません。\n" "SAX によるアプリケーションを書くときには、プログラムがドキュメント内のどこを" -"処理しているのかを追跡するよう、コードのどこかに記述する必要があります。SAX " -"自体がその作業を行ってくれることはありません。さらに、XML ドキュメントに対す" -"る先読み (look ahead) が必要だとすると不運なことになります。" +"処理しているのかを追跡するよう、コードのどこかに記述する必要があります。\n" +"SAX 自体がその作業を行ってくれることはありません。\n" +"さらに、XML ドキュメントに対する先読み (look ahead) が必要だとすると不運なこ" +"とになります。" -#: ../../library/xml.dom.rst:25 msgid "" "Some applications are simply impossible in an event driven model with no " "access to a tree. Of course you could build some sort of tree yourself in " "SAX events, but the DOM allows you to avoid writing that code. The DOM is a " "standard tree representation for XML data." msgstr "" -"アプリケーションによっては、ツリーにアクセスできなければイベント駆動モデルを" -"実現できません。もちろん、何らかのツリーを SAX イベントに応じて自分で構築する" -"こともできるでしょうが、DOM ではそのようなコードを書かなくてもよくなります。" +"ツリーにアクセスできないイベント駆動モデルでは実現できないアプリケーションも" +"あります。\n" +"もちろん、何らかのツリーを SAX イベントに応じて自分で構築することもできるで" +"しょうが、DOM ではそのようなコードを書かなくてもよくなります。\n" "DOM は XML データに対する標準的なツリー表現なのです。" #: ../../library/xml.dom.rst:30 @@ -1288,12 +1289,11 @@ msgid "" "`~Node.nextSibling` are always ``None``." msgstr "" -#: ../../library/xml.dom.rst:887 msgid "" "The attribute name. In a namespace-using document it may include a colon." msgstr "" -"要素型名です。名前空間使用の文書では、要素型名中にコロンが含まれるかもしれま" -"せん。" +"属性名です。\n" +"名前空間を使用する文書では、コロンを含むことがあります。" #: ../../library/xml.dom.rst:893 msgid "" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 504c8d705..eca4be454 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -842,25 +842,23 @@ msgstr "" msgid "``[.='text']``" msgstr "``[.='text']``" -#: ../../library/xml.etree.elementtree.rst:492 msgid "" "Selects all elements whose complete text content, including descendants, " "equals the given ``text``." msgstr "" -"子孫のうち、与えられた ``text`` とテキスト全体が等しい全ての要素を選択しま" -"す。" +"子孫のテキストも含めたテキスト全体が、指定された ``text`` と等しいすべての要" +"素を選択します。" #: ../../library/xml.etree.elementtree.rst:497 msgid "``[.!='text']``" msgstr "``[.!='text']``" -#: ../../library/xml.etree.elementtree.rst:497 msgid "" "Selects all elements whose complete text content, including descendants, " "does not equal the given ``text``." msgstr "" -"子孫のうち、与えられた ``text`` とテキスト全体が等しくない全ての要素を選択し" -"ます。" +"子孫のテキストも含めたテキスト全体が、指定された ``text`` と等しくないすべて" +"の要素を選択します。" #: ../../library/xml.etree.elementtree.rst:503 msgid "``[tag='text']``" @@ -1244,7 +1242,6 @@ msgstr "" msgid "*parent* and *tag* are now positional-only parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:748 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -1255,14 +1252,16 @@ msgid "" "*short_empty_elements* has the same meaning as in :meth:`ElementTree.write`. " "Returns an (optionally) encoded string containing the XML data." msgstr "" -"XML 要素を全ての子要素を含めて表現する文字列を生成します。 *element* は :" -"class:`Element` のインスタンスです。 *encoding* [1]_ は出力エンコーディング" -"(デフォルトは US-ASCII)です。Unicode 文字列を生成するには、" -"``encoding=\"unicode\"`` を使用してください。 *method* は ``\"xml\"``, " -"``\"html\"``, ``\"text\"`` のいずれか(デフォルトは ``\"xml\"``) です。 " +"XML 要素を全ての子要素を含めて表現する文字列を生成します。\n" +"*element* は :class:`Element` のインスタンスです。\n" +"*encoding* [1]_ は出力エンコーディング(デフォルトは US-ASCII)です。\n" +"Unicode 文字列を生成するには ``encoding=\"unicode\"`` を使用してください。\n" +"それ以外の場合はバイト列を生成します。\n" +"*method* は ``\"xml\"``, ``\"html\"``, ``\"text\"`` のいずれか(デフォルトは " +"``\"xml\"``) です。\n" "*xml_declaration*, *default_namespace*, *short_empty_elements* は、 :meth:" -"`ElementTree.write` での意味と同じ意味を持ちます。 XML データを含んだ (オプ" -"ションで) エンコードされた文字列を返します。" +"`ElementTree.write` での意味と同じ意味を持ちます。\n" +"XML データを含んだ (オプションで) エンコードされた文字列を返します。" #: ../../library/xml.etree.elementtree.rst:757 #: ../../library/xml.etree.elementtree.rst:784 @@ -1281,7 +1280,6 @@ msgid "" "the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:772 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -1294,16 +1292,19 @@ msgid "" "does not guarantee any specific sequence, except that ``b\"\"." "join(tostringlist(element)) == tostring(element)``." msgstr "" -"XML 要素を全ての子要素を含めて表現する文字列を生成します。 *element* は :" -"class:`Element` のインスタンスです。 *encoding* [1]_ は出力エンコーディング" -"(デフォルトは US-ASCII)です。Unicode 文字列を生成するには、" -"``encoding=\"unicode\"`` を使用してください。 *method* は ``\"xml\"``, " -"``\"html\"``, ``\"text\"`` のいずれか(デフォルトは ``\"xml\"``) です。 " -"xml_declaration*, *default_namespace*, *short_empty_elements* は、 :meth:" -"`ElementTree.write` での意味と同じ意味を持ちます。 XML データを含んだ (オプ" -"ションで) エンコードされた文字列のリストを返します。``b\"\"." -"join(tostringlist(element)) == tostring(element)`` となること以外、特定の順序" -"になる保証はありません。" +"XML 要素を全ての子要素を含めて表現する文字列を生成します。\n" +"*element* は :class:`Element` のインスタンスです。\n" +"*encoding* [1]_ は出力エンコーディング(デフォルトは US-ASCII)です。\n" +"Unicode 文字列を生成するには ``encoding=\"unicode\"`` を使用してください。\n" +"それ以外の場合はバイト列を生成します。\n" +"*method* は ``\"xml\"``, ``\"html\"``, ``\"text\"`` のいずれか(デフォルトは " +"``\"xml\"``) です。\n" +"*xml_declaration*, *default_namespace*, *short_empty_elements* は、 :meth:" +"`ElementTree.write` での意味と同じ意味を持ちます。\n" +"XML データを含んだ (オプションで) エンコードされた文字列のリストを返しま" +"す。\n" +"``b\"\".join(tostringlist(element)) == tostring(element)`` となること以外、特" +"定の順序になる保証はありません。" #: ../../library/xml.etree.elementtree.rst:790 msgid "" @@ -1853,7 +1854,6 @@ msgstr "" "インスタンスを指定します。パーザが指定されない場合、標準の :class:" "`XMLParser` パーザが使用されます。断片の根要素を返します。" -#: ../../library/xml.etree.elementtree.rst:1232 msgid "" "Writes the element tree to a file, as XML. *file* is a file name, or a :" "term:`file object` opened for writing. *encoding* [1]_ is the output " @@ -1868,7 +1868,7 @@ msgid "" "are emitted as a pair of start/end tags." msgstr "" "要素の木をファイルに XML として書き込みます。\n" -"*file* は、書き込み用に開かれたファイル名または :term:`ファイルオブジェクト " +"*file* は、ファイル名または書き込み用に開かれた :term:`ファイルオブジェクト " "` です。\n" "*encoding* [1]_ は出力エンコーディング(デフォルトは US-ASCII)です。\n" "*xml_declaration* は、 XML 宣言がファイルに書かれるかどうかを制御します。\n" @@ -1879,10 +1879,10 @@ msgstr "" "す。\n" "*method* は ``\"xml\"``, ``\"html\"``, ``\"text\"`` のいずれかです (デフォル" "トは ``\"xml\"`` です)。\n" -"キーワード専用の *short_empty_elements* 引数は、内容がない属性のフォーマット" +"キーワード専用の *short_empty_elements* 引数は、内容がない要素のフォーマット" "を制御します。\n" "``True`` (既定) の場合、単一の空要素タグとして書かれ、``False`` の場合、開始" -"タグと終了タグのペアとしてかかれます。" +"タグと終了タグのペアとして書かれます。" #: ../../library/xml.etree.elementtree.rst:1246 msgid "" @@ -2280,7 +2280,6 @@ msgstr "" "消費されるため、:meth:`read_events` から取得されたイテレータに対して複数の読" "み出しを並行して反復的に行うと、予期せぬ結果が引き起こされます。" -#: ../../library/xml.etree.elementtree.rst:1571 msgid "" ":class:`XMLPullParser` only guarantees that it has seen the \">\" character " "of a starting tag when it emits a \"start\" event, so the attributes are " @@ -2288,10 +2287,11 @@ msgid "" "that point. The same applies to the element children; they may or may not " "be present." msgstr "" -":class:`XMLPullParser` は \"start\" イベントを発行した時に開始タグの文字 " -"\">\" が現れたことだけを保証します。そのため、属性は定義されますが、その時点" -"ではテキストの内容も tail 属性も定義されていません。子要素にもそれが存在す" -"る、しないにかかわらず同じ物が適用されます。" +":class:`XMLPullParser` が \"start\" イベントを発行した時点では、開始タグの " +"\">\" を読み取ったことだけが保証されます。\n" +"そのため属性は定義されていますが、text 属性と tail 属性の内容はまだ未定義で" +"す。\n" +"子要素も同様に、その時点では存在する場合と存在しない場合があります。" #: ../../library/xml.etree.elementtree.rst:1586 msgid "Exceptions" diff --git a/library/xml.po b/library/xml.po index a48d0a35e..d814cb4cc 100644 --- a/library/xml.po +++ b/library/xml.po @@ -203,7 +203,6 @@ msgstr "" msgid "decompression bomb" msgstr "decompression bomb" -#: ../../library/xml.rst:116 msgid "" "Decompression bombs (aka `ZIP bomb`_) apply to all XML libraries that can " "parse compressed XML streams such as gzipped HTTP streams or LZMA-compressed " @@ -213,7 +212,7 @@ msgstr "" "解凍爆弾 (あるいは `ZIP 爆弾 `_) は、gzip 圧縮 HTTP ストリームや " "LZMA 圧縮ファイルなどの圧縮された XML ストリームをパースできる全ての XML ライ" "ブラリに対し行われます。\n" -"攻撃者は送信データ量を1/3以下に減らすことができます。" +"攻撃者は送信データ量を1,000 分の 1 以下に減らすことができます。" #: ../../library/xml.rst:122 msgid "large tokens" diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index a9b29f953..37fe27ee3 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -103,13 +103,12 @@ msgstr "値: ``\"http://xml.org/sax/features/namespaces\"``" msgid "true: Perform Namespace processing." msgstr "真: 名前空間を処理します。" -#: ../../library/xml.sax.handler.rst:62 msgid "" "false: Optionally do not perform Namespace processing (implies namespace-" "prefixes; default)." msgstr "" -"偽: オプションで名前空間を処理しません (暗黙に名前空間接頭辞も無効にします; " -"デフォルト)。" +"偽: 名前空間処理を行わないことを許可します (namespace-prefixes が有効であるこ" +"とを意味します; デフォルト)。" #: ../../library/xml.sax.handler.rst:63 ../../library/xml.sax.handler.rst:73 #: ../../library/xml.sax.handler.rst:85 ../../library/xml.sax.handler.rst:94 @@ -164,13 +163,12 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/validation\"``" msgstr "値: ``\"http://xml.org/sax/features/validation\"``" -#: ../../library/xml.sax.handler.rst:92 msgid "" "true: Report all validation errors (implies external-general-entities and " "external-parameter-entities)." msgstr "" -"真: 全ての妥当性検査エラーを報告します (外部一般エンティティと外部変数エン" -"ティティが暗示されます)。" +"真: すべての妥当性検査エラーを報告します (external-general-entities と " +"external-parameter-entities が有効であることを意味します)。" #: ../../library/xml.sax.handler.rst:93 msgid "false: Do not report validation errors." @@ -667,15 +665,14 @@ msgstr "未パースのエンティティ宣言イベントの通知を扱いま msgid "EntityResolver Objects" msgstr "EntityResolver オブジェクト" -#: ../../library/xml.sax.handler.rst:417 msgid "" "Resolve the system identifier of an entity and return either the system " "identifier to read from as a string, or an InputSource to read from. The " "default implementation returns *systemId*." msgstr "" -"エンティティのシステム識別子を解決し、文字列として読み込んだシステム識別子あ" -"るいは InputSource オブジェクトのいずれかを返します。デフォルトの実装では " -"*systemId* を返します。" +"エンティティのシステム識別子を解決し、読み込み先のシステム識別子を文字列とし" +"て返すか、読み込み元の InputSource を返します。\n" +"デフォルトの実装では *systemId* を返します。" #: ../../library/xml.sax.handler.rst:425 msgid "ErrorHandler Objects" diff --git a/library/xml.sax.po b/library/xml.sax.po index 8e32ae170..c394ef51e 100644 --- a/library/xml.sax.po +++ b/library/xml.sax.po @@ -44,7 +44,6 @@ msgid "" "security`." msgstr "" -#: ../../library/xml.sax.rst:24 msgid "" "The SAX parser no longer processes general external entities by default to " "increase security. Before, the parser created network connections to fetch " @@ -53,13 +52,14 @@ msgid "" "xmlreader.XMLReader.setFeature` on the parser object and argument :data:" "`~xml.sax.handler.feature_external_ges`." msgstr "" -"SAXパーサーは、セキュリティーを向上させるために、デフォルトで一般的な外部エン" -"ティティーを処理しなくなりました。以前は、パーサーは、DTDおよびエンティティ用" -"にファイルシステムからリモートファイルまたはロードされたローカルファイルを" -"フェッチするためのネットワーク接続を作成していました。この機能は parser オブ" -"ジェクトと(実) 引数 :data:`~xml.sax.handler.feature_external_ges` の :meth:" -"`~xml.sax.xmlreader.XMLReader.setFeature` メソッドで再度有効にすることができ" -"ます。" +"セキュリティを向上させるため、SAX パーサーはデフォルトでは外部一般エンティ" +"ティを処理しなくなりました。\n" +"以前は DTD やエンティティを処理するために、ネットワークに接続してリモートファ" +"イルを取得したり、ファイルシステムからローカルファイルを読み込んだりしていま" +"した。\n" +"この機能を再び有効にするには、パーサーオブジェクトの :meth:`~xml.sax." +"xmlreader.XMLReader.setFeature` メソッドに :data:`~xml.sax.handler." +"feature_external_ges` を引数として渡します。" #: ../../library/xml.sax.rst:31 msgid "The convenience functions and data are:" diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index a9196ce3d..be61e2bd2 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -73,13 +73,12 @@ msgstr "" "パーサがフィードからまたはパースメソッドを使用して新しいデータを受け入れられ" "るように、reset メソッドが呼び出される必要があります。" -#: ../../library/xml.sax.reader.rst:35 msgid "" "Note that these methods must *not* be called during parsing, that is, after " "parse has been called and before it returns." msgstr "" -"これらのメソッドをパース処理の途中で呼び出すことはできません。つまり、パース" -"が実行された後で、パーサから return する前に呼び出す必要があるのです。" +"これらのメソッドはパース処理中、つまり ``parse()`` を呼び出してから戻るまでの" +"間に呼び出しては *いけません*。" #: ../../library/xml.sax.reader.rst:38 msgid "" @@ -156,7 +155,6 @@ msgstr "" "ス化されなければなりません。*attrs* は属性名と属性値の対応付けを含む辞書風オ" "ブジェクトでなければなりません。" -#: ../../library/xml.sax.reader.rst:82 msgid "" "Namespace-aware variant of :class:`AttributesImpl`, which will be passed to :" "meth:`startElementNS`. It is derived from :class:`AttributesImpl`, but " @@ -166,11 +164,13 @@ msgid "" "`AttributesNS` interface (see section :ref:`attributes-ns-objects`)." msgstr "" ":class:`AttributesImpl` を名前空間認識型に改良したクラスで、 :meth:" -"`startElementNS` に渡されます。 :class:`AttributesImpl` の派生クラスですが、 " -"*namespaceURI* と *localname* の2要素のタプルを解釈します。さらに、元の文書に" -"出てくる修飾名を返す多くのメソッドを提供します。このクラスは :class:" -"`AttributesNS` インターフェース (:ref:`attributes-ns-objects` 参照) の実装で" -"す。" +"`startElementNS` に渡されます。\n" +":class:`AttributesImpl` の派生クラスですが、 *namespaceURI* と *localname* の" +"2要素のタプルを解釈します。\n" +"さらに、元の文書に出てくる修飾名を引数として受け取る多くのメソッドを提供しま" +"す。\n" +"このクラスは :class:`AttributesNS` インターフェース (:ref:`attributes-ns-" +"objects` 参照) の実装です。" #: ../../library/xml.sax.reader.rst:93 msgid "XMLReader Objects" @@ -429,14 +429,15 @@ msgstr "この InputSource の文字エンコーディングを取得します msgid "Set the byte stream (a :term:`binary file`) for this input source." msgstr "この入力ソースのバイトストリーム (:term:`binary file`) を設定します。" -#: ../../library/xml.sax.reader.rst:309 msgid "" "The SAX parser will ignore this if there is also a character stream " "specified, but it will use a byte stream in preference to opening a URI " "connection itself." msgstr "" -"文字ストリームも指定されている場合、SAX パーサはこのバイトストリームを無視し" -"ますが、URI 接続自体を開くときには優先してバイトストリームを使います。" +"文字ストリームも指定されている場合、SAX パーサーはこのバイトストリームを無視" +"します。\n" +"それ以外の場合は、自ら URI への接続を開くよりも、指定されたバイトストリームを" +"優先して使います。" #: ../../library/xml.sax.reader.rst:312 msgid "" diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po index 83e0d150f..82331bd92 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -77,7 +77,6 @@ msgid "" "provided." msgstr "" -#: ../../library/xml.sax.utils.rst:43 msgid "" "Similar to :func:`escape`, but also prepares *data* to be used as an " "attribute value. The return value is a quoted version of *data* with any " @@ -88,12 +87,13 @@ msgid "" "*data* will be wrapped in double-quotes. The resulting string can be used " "directly as an attribute value::" msgstr "" -":func:`escape` に似ていますが、 *data* は属性値の作成に使われます。戻り値は" -"クォート済みの *data* で、置換する文字の追加も可能です。 :func:`quoteattr` は" -"クォートすべき文字を *data* の文脈から判断し、クォートすべき文字を残さないよ" -"うに文字列をエンコードします。 *data* の中にシングル・クォート、ダブル・" -"クォートがあれば、両方ともエンコードし、全体をダブルクォートで囲みます。戻り" -"値の文字列はそのままで属性値として利用できます::" +":func:`escape` と似ていますが、*data* を属性値として使える形にします。\n" +"必要な置換を加え、引用符で囲んだ *data* を返します。\n" +":func:`quoteattr` は *data* の内容に応じて、文字列内の引用符をなるべくエン" +"コードしなくて済むように、外側を囲む引用符を選びます。\n" +"*data* にシングルクォートとダブルクォートの両方が含まれている場合は、ダブル" +"クォートをエンコードし、全体をダブルクォートで囲みます。\n" +"結果の文字列はそのまま属性値として使用できます。 ::" #: ../../library/xml.sax.utils.rst:52 msgid "" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 3810f4483..814cd42ca 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -212,15 +212,15 @@ msgstr "" msgid "``struct``" msgstr "``struct``" -#: ../../library/xmlrpc.client.rst:110 msgid "" ":class:`dict`. Keys must be strings, values may be any conformable type. " "Objects of user-defined classes can be passed in; only their :attr:`~object." "__dict__` attribute is transmitted." msgstr "" -":class:`dict` 。キーは文字列のみ。全ての値は変換可能でなくてはならない。ユー" -"ザー定義型を渡すこともできます。 :attr:`~object.__dict__` の属性のみ転送され" -"ます。" +":class:`dict`。\n" +"キーは文字列でなければならず、値には変換可能な任意の型を使用できます。\n" +"ユーザー定義クラスのインスタンスも渡せますが、転送されるのは :attr:`~object." +"__dict__` 属性だけです。" #: ../../library/xmlrpc.client.rst:115 msgid "``dateTime.iso8601``" @@ -263,7 +263,6 @@ msgstr "``bigdecimal``" msgid ":class:`decimal.Decimal`. Returned type only." msgstr "" -#: ../../library/xmlrpc.client.rst:129 msgid "" "This is the full set of data types supported by XML-RPC. Method calls may " "also raise a special :exc:`Fault` instance, used to signal XML-RPC server " @@ -272,12 +271,14 @@ msgid "" "base class called :exc:`Error`. Note that the xmlrpc client module " "currently does not marshal instances of subclasses of built-in types." msgstr "" -"上記のXML-RPCでサポートする全データ型を使用することができます。メソッド呼び出" -"し時、XML- RPCサーバエラーが発生すると :exc:`Fault` インスタンスを送出し、" -"HTTP/HTTPSトランスポート層でエラーが発生した場合には :exc:`ProtocolError` を" -"送出します。 :exc:`Error` をベースとする :exc:`Fault` と :exc:" -"`ProtocolError` の両方が発生します。現在のところxmlrpclibでは組み込み型のサブ" -"クラスのインスタンスをマーシャルすることはできません。" +"以上が XML-RPC でサポートされるデータ型のすべてです。\n" +"メソッド呼び出しでは、XML-RPC サーバーのエラーを表す :exc:`Fault` インスタン" +"スや、HTTP/HTTPS トランスポート層のエラーを表す :exc:`ProtocolError` が送出さ" +"れることもあります。\n" +":exc:`Fault` と :exc:`ProtocolError` は、どちらも :exc:`Error` という基底クラ" +"スから派生しています。\n" +"現在の xmlrpc クライアントモジュールは、組み込み型のサブクラスのインスタンス" +"をマーシャルできないことに注意してください。" #: ../../library/xmlrpc.client.rst:136 msgid "" @@ -474,7 +475,6 @@ msgstr "" msgid "DateTime Objects" msgstr "DateTime オブジェクト" -#: ../../library/xmlrpc.client.rst:253 msgid "" "This class may be initialized with seconds since the epoch, a time tuple, an " "ISO 8601 time/date string, or a :class:`datetime.datetime` instance. It has " @@ -482,9 +482,10 @@ msgid "" "unmarshalling code:" msgstr "" "このクラスは、エポックからの秒数、タプルで表現された時刻、ISO 8601形式の時間/" -"日付文字列、 :class:`datetime.datetime`, のインスタンスのいずれかで初期化する" -"ことができます。このクラスには以下のメソッドがあり、主にコードをマーシャル/ア" -"ンマーシャルするための内部処理を行います:" +"日付文字列、 :class:`datetime.datetime` のインスタンスのいずれかで初期化する" +"ことができます。\n" +"このクラスには以下のメソッドがあり、主にマーシャル/アンマーシャルを行うコード" +"から内部的に使用されます:" #: ../../library/xmlrpc.client.rst:261 msgid "Accept a string as the instance's new time value." @@ -712,11 +713,10 @@ msgstr "エラーコード。" msgid "The error message or diagnostic string." msgstr "エラーメッセージまたは診断文字列。" -#: ../../library/xmlrpc.client.rst:441 msgid "" "A dict containing the headers of the HTTP/HTTPS request that triggered the " "error." -msgstr "エラーの原因となったHTTP/HTTPSリクエストを含む辞書。" +msgstr "エラーの原因となった HTTP/HTTPS リクエストのヘッダーを含む辞書。" #: ../../library/xmlrpc.client.rst:444 msgid "" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index 30d7e0968..f05d67afd 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -447,7 +447,6 @@ msgstr "" ":class:`CGIXMLRPCRequestHandler` クラスは、Python の CGI スクリプトに送られ" "た XML-RPC リクエストを処理するときに使用できます。" -#: ../../library/xmlrpc.server.rst:311 msgid "" "Register an object which is used to expose method names which have not been " "registered using :meth:`register_function`. If instance contains a :meth:" @@ -469,8 +468,8 @@ msgstr "" "返り値は結果としてクライアントに返されます。\n" "*instance* に ``_dispatch()`` メソッドがなかった場合、リクエストされたメソッ" "ド名にマッチする属性を検索します。\n" -"リクエストされたメソッド名がピリオドを含む場合、モジュール名の各要素が個々に" -"検索され、簡単な階層的検索が実行されます。\n" +"リクエストされたメソッド名がピリオドを含む場合、メソッド名の各要素が個々に検" +"索され、簡単な階層的検索が実行されます。\n" "その検索で発見された値をリクエストの引数で呼び出し、クライアントに返り値を返" "します。" diff --git a/library/zipapp.po b/library/zipapp.po index d666ca282..331a69734 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -80,18 +80,16 @@ msgstr "" msgid "$ python -m zipapp source [options]" msgstr "" -#: ../../library/zipapp.rst:48 msgid "" "If *source* is a directory, this will create an archive from the contents of " "*source*. If *source* is a file, it should be an archive, and it will be " "copied to the target archive (or the contents of its shebang line will be " "displayed if the --info option is specified)." msgstr "" -"*source* がディレクトリである場合、 *source* ディレクトリの内容からアーカイブ" -"を作成します。\n" -"*source* がファイルである場合、 *source* ファイル自身をアーカイブ化し、保存先" -"アーカイブへコピーします。(または --info オプションが指定されている場合はファ" -"イルのシェバン行が表示されます。)" +"*source* がディレクトリの場合、その内容からアーカイブを作成します。\n" +"*source* がファイルの場合は既存のアーカイブでなければならず、出力先のアーカイ" +"ブへコピーされます (``--info`` オプションが指定されている場合は、代わりにシェ" +"バン行の内容が表示されます)。" #: ../../library/zipapp.rst:53 msgid "The following options are understood:" @@ -130,19 +128,17 @@ msgstr "" "また、POSIX では書庫を実行可能にします。\n" "デフォルトでは ``#!`` 行を書かず、ファイルを実行可能にはしません。" -#: ../../library/zipapp.rst:75 msgid "" "Write a ``__main__.py`` file to the archive that executes *mainfn*. The " "*mainfn* argument should have the form \"pkg.mod:fn\", where \"pkg.mod\" is " "a package/module in the archive, and \"fn\" is a callable in the given " "module. The ``__main__.py`` file will execute that callable." msgstr "" -"*mainfn* を実行するアーカイブへ ``__main__.py`` ファイルを書込んでくださ" -"い。\n" +"*mainfn* を実行する ``__main__.py`` ファイルをアーカイブに書き込みます。\n" "*mainfn* 引数は \"pkg.mod:fn\" の形式で指定します。\n" -"\"pkg.mod\" の場所はアーカイブ内の package/module です。\n" -"\"fn\" は指定した module から呼出すことのできる関数です。\n" -"``__main__.py`` ファイルが module から呼出すことのできる関数を実行します。" +"\"pkg.mod\" はアーカイブ内のパッケージまたはモジュールで、\"fn\" はそのモ" +"ジュール内の呼び出し可能オブジェクトです。\n" +"``__main__.py`` ファイルはそのオブジェクトを呼び出します。" #: ../../library/zipapp.rst:80 msgid ":option:`--main` cannot be specified when copying an archive." @@ -188,38 +184,35 @@ msgstr "" "*source* からアプリケーション書庫を作成します。\n" "ソースは以下のいずれかです:" -#: ../../library/zipapp.rst:115 msgid "" "The name of a directory, or a :term:`path-like object` referring to a " "directory, in which case a new application archive will be created from the " "content of that directory." msgstr "" -"ディレクトリ名、または\n" -"新しいアプリケーションアーカイブがディレクトリのコンテンツから作成される場合" -"に\n" -":term:`path-like object` オブジェクトが参照するディレクトリ。" +"ディレクトリ名、またはディレクトリを指す :term:`path-like object`。\n" +"この場合、そのディレクトリの内容から新しいアプリケーションアーカイブを作成し" +"ます。" -#: ../../library/zipapp.rst:118 msgid "" "The name of an existing application archive file, or a :term:`path-like " "object` referring to such a file, in which case the file is copied to the " "target (modifying it to reflect the value given for the *interpreter* " "argument). The file name should include the ``.pyz`` extension, if required." msgstr "" -"既存のアプリケーションアーカイブファイルの名前、\n" -"または(*interpreter* 引数に指定した値を反映し、修正する)アーカイブへ\n" -"ファイルがコピーされる場合に :term:`path-like object` オブジェクトが参照する" -"ファイル。" +"既存のアプリケーションアーカイブのファイル名、またはそのファイルを指す :term:" +"`path-like object`。\n" +"この場合、*interpreter* 引数の値を反映するよう変更して、ファイルを出力先へコ" +"ピーします。\n" +"必要に応じて、ファイル名には ``.pyz`` 拡張子を含めてください。" -#: ../../library/zipapp.rst:122 msgid "" "A file object open for reading in bytes mode. The content of the file " "should be an application archive, and the file object is assumed to be " "positioned at the start of the archive." msgstr "" -"バイトモードの読込みで開くファイルオブジェクト。\n" -"ファイルの内容がアプリケーションアーカイブとなり、\n" -"ファイルオブジェクトがアーカイブの起点となります。" +"バイナリモードで読み込み用に開かれたファイルオブジェクト。\n" +"ファイルの内容はアプリケーションアーカイブでなければならず、ファイル位置は" +"アーカイブの先頭にあるものとします。" #: ../../library/zipapp.rst:126 msgid "" @@ -252,7 +245,6 @@ msgstr "" "ればならず、target は source のファイル名に ``.pyz`` 拡張子を付与したファイル" "名となります。" -#: ../../library/zipapp.rst:137 msgid "" "The *interpreter* argument specifies the name of the Python interpreter with " "which the archive will be executed. It is written as a \"shebang\" line at " @@ -267,11 +259,10 @@ msgstr "" "インタープリタ名は \"シェバン\" 行としてアーカイブの起点に書込まれます。\n" "POSIX では OS によってシェバンが解釈され、\n" "Windows では Python ランチャーによって扱われます。\n" -"シェバン行が書込まれていない場合は *interpreter* の結果を無視します。\n" +"*interpreter* を省略すると、シェバン行は書き込まれません。\n" "interpreter が指定されており、 target がファイル名である場合、\n" "target ファイルの実行可能ビットが設定されます。" -#: ../../library/zipapp.rst:145 msgid "" "The *main* argument specifies the name of a callable which will be used as " "the main program for the archive. It can only be specified if the source is " @@ -282,16 +273,16 @@ msgid "" "a directory and does not contain a ``__main__.py`` file, as otherwise the " "resulting archive would not be executable." msgstr "" -"*main* 引数はアーカイブのメインプログラムとして使用する callable の名前を指定" -"します。\n" -"*main* 引数は source がディレクトリであり、 source が既に ``__main__.py`` " -"ファイルを保持していない場合に限り、指定することができます。\n" -"*main* 引数は \"pkg.module:callable\" の形式を取り、\n" -"アーカイブは \"pkg.module\" をインポートして実行され、\n" -"指定した callable を引数なしで実行します。\n" -"source がディレクトリであり、 ``__main__.py`` が含まれていない場合、\n" -"*main* は無視すべきエラーとなり、\n" -"作成されたアーカイブには実行可能ビットが設定されません。" +"*main* 引数は、アーカイブのメインプログラムとして使う呼び出し可能オブジェクト" +"の名前を指定します。\n" +"``source`` がディレクトリで、そこに ``__main__.py`` がまだない場合にのみ指定" +"できます。\n" +"*main* 引数は \"pkg.module:callable\" の形式で指定します。\n" +"アーカイブの実行時には \"pkg.module\" をインポートし、指定された呼び出し可能" +"オブジェクトを引数なしで呼び出します。\n" +"``source`` がディレクトリで ``__main__.py`` がない場合、*main* を省略するとエ" +"ラーになります。\n" +"省略を許すと、作成されるアーカイブを実行できないためです。" #: ../../library/zipapp.rst:155 msgid "" @@ -316,36 +307,34 @@ msgstr "" "*source* または *target* へファイルオブジェクトを指定した場合、\n" "caller が create_archive の呼出し後にオブジェクトを閉じます。" -#: ../../library/zipapp.rst:168 msgid "" "When copying an existing archive, file objects supplied only need ``read`` " "and ``readline``, or ``write`` methods. When creating an archive from a " "directory, if the target is a file object it will be passed to the ``zipfile." "ZipFile`` class, and must supply the methods needed by that class." msgstr "" -"既存のアーカイブをコピーする際、ファイルオブジェクトは ``read`` , " -"``readline`` , ``write`` メソッドのみを提供します。\n" -"アーカイブをディレクトリから作成する際、 target がファイルオブジェクトである" -"場合は、\n" -"``zipfile.ZipFile`` クラスへ渡されます。必ずクラスが必要とするメソッドを提供" -"してください。" +"既存のアーカイブをコピーする場合、渡すファイルオブジェクトに必要なのは、読み" +"込み元なら ``read()`` と ``readline()``、書き込み先なら ``write()`` メソッド" +"だけです。\n" +"ディレクトリからアーカイブを作成する場合、``target`` がファイルオブジェクトな" +"ら ``zipfile.ZipFile`` クラスに渡されるため、そのクラスが必要とするメソッドを" +"備えていなければなりません。" #: ../../library/zipapp.rst:174 msgid "Added the *filter* and *compressed* parameters." msgstr "" -#: ../../library/zipapp.rst:179 msgid "" "Return the interpreter specified in the ``#!`` line at the start of the " "archive. If there is no ``#!`` line, return :const:`None`. The *archive* " "argument can be a filename or a file-like object open for reading in bytes " "mode. It is assumed to be at the start of the archive." msgstr "" -"アーカイブの最初の行の ``#!`` に指定されたインタープリタを返します。\n" -"``#!`` が無い場合は :const:`None` を返します。\n" -"*archive* 引数は、ファイル名またはバイトモードの読込みで開いた\n" -"ファイルに準じるオブジェクトを指定することができ、アーカイブの起点で決定され" -"ます。" +"アーカイブの先頭の ``#!`` 行で指定されたインタープリタを返します。\n" +"``#!`` 行がない場合は :const:`None` を返します。\n" +"*archive* 引数には、ファイル名またはバイナリモードで読み込み用に開かれたファ" +"イルライクオブジェクトを指定できます。\n" +"ファイル位置はアーカイブの先頭にあるものとします。" #: ../../library/zipapp.rst:188 msgid "Examples" @@ -402,7 +391,6 @@ msgid "" "python3')" msgstr "" -#: ../../library/zipapp.rst:218 msgid "" "To update the file in place, do the replacement in memory using a :class:" "`~io.BytesIO` object, and then overwrite the source afterwards. Note that " @@ -411,8 +399,8 @@ msgid "" "errors, but production code should do so. Also, this method will only work " "if the archive fits in memory::" msgstr "" -"アーカイブ内のファイルを更新するには :class:`~io.BytesIO` オブジェクトを使用" -"してメモリーへ格納し、\n" +"アーカイブファイル自体を上書き更新するには :class:`~io.BytesIO` オブジェクト" +"を使用してメモリーへ格納し、\n" "元のファイルを上書きして置換してください。\n" "ファイルを上書きする際にエラーが発生し、元のファイルが失われる危険性があるこ" "とに注意してください。\n" diff --git a/library/zipfile.po b/library/zipfile.po index b074fc70d..042587361 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -539,7 +539,6 @@ msgstr "" msgid "Returns the normalized path created (a directory or new file)." msgstr "作成された (ディレクトリか新ファイルの) 正規化されたパスを返します。" -#: ../../library/zipfile.rst:388 msgid "" "If a member filename is an absolute path, a drive/UNC sharepoint and leading " "(back)slashes will be stripped, e.g.: ``///foo/bar`` becomes ``foo/bar`` on " @@ -550,12 +549,14 @@ msgid "" "(``_``)." msgstr "" "メンバのファイル名が絶対パスなら、ドライブ/UNC sharepoint および先頭の (バッ" -"ク) スラッシュは取り除かれます。例えば、Unix で ``///foo/bar`` は ``foo/" -"bar`` となり、Window で ``C:\\foo\\bar`` は ``foo\\bar`` となります。また、メ" -"ンバのファイル名に含まれる全ての ``\"..\"`` は取り除かれます。例えば、" -"``../../foo../../ba..r`` は ``foo../ba..r`` となります。Windows では、不正な" -"文字 (``:``, ``<``, ``>``, ``|``, ``\"``, ``?``, および ``*``) はアンダースコ" -"ア (``_``) で置き換えられます。" +"ク) スラッシュは取り除かれます。\n" +"例えば、Unix で ``///foo/bar`` は ``foo/bar`` となり、Windows で ``C:" +"\\foo\\bar`` は ``foo\\bar`` となります。\n" +"また、メンバのファイル名に含まれる ``\"..\"`` というパス要素はすべて取り除か" +"れます。\n" +"例えば、``../../foo../../ba..r`` は ``foo../ba..r`` となります。\n" +"Windows では、不正な文字 (``:``, ``<``, ``>``, ``|``, ``\"``, ``?``, および " +"``*``) はアンダースコア (``_``) で置き換えられます。" #: ../../library/zipfile.rst:396 msgid "" @@ -949,12 +950,11 @@ msgstr "" "インスタンスは :class:`ZipFile` オブジェクトのメソッドの他に、追加のメソッド" "を 1 個持ちます:" -#: ../../library/zipfile.rst:731 msgid "" "Search for files :file:`\\*.py` and add the corresponding file to the " "archive." msgstr "" -":file:`\\*.py` ファイルを探し、一致するファイルをアーカイブに追加します。" +":file:`\\*.py` ファイルを探し、対応するファイルをアーカイブに追加します。" #: ../../library/zipfile.rst:734 msgid "" @@ -992,7 +992,6 @@ msgstr "" msgid "*basename* is intended for internal use only." msgstr "*basename* は内部が使用するためだけのものです。" -#: ../../library/zipfile.rst:753 msgid "" "*filterfunc*, if given, must be a function taking a single string argument. " "It will be passed each path (including each individual full file path) " @@ -1002,11 +1001,13 @@ msgid "" "directories or start with the string ``test_``, we can use a *filterfunc* to " "exclude them::" msgstr "" -"*filterfunc* を与える場合、単一の文字列引数を取る関数を渡してください。これに" -"は(個々のフルパスを含む)それぞれのパスがアーカイブに加えられる前に渡されま" -"す。 *filterfunc* が偽を返せば、そのパスはアーカイブに追加されず、ディレクト" -"リだった場合はその中身が無視されます。例として、私たちのテストファイルが全て " -"``test`` ディレクトリの中にあるか、 ``test`` 文字列で始まるとしましょう。 " +"*filterfunc* を与える場合、単一の文字列引数を取る関数を渡してください。\n" +"これには(個々のフルパスを含む)それぞれのパスがアーカイブに加えられる前に渡さ" +"れます。\n" +"*filterfunc* が偽を返せば、そのパスはアーカイブに追加されず、ディレクトリだっ" +"た場合はその中身が無視されます。\n" +"例として、私たちのテストファイルが全て ``test`` ディレクトリの中にあるか、 " +"``test_`` 文字列で始まるとしましょう。\n" "*filterfunc* を使ってそれらを除外出来ます::" #: ../../library/zipfile.rst:761 @@ -1209,9 +1210,8 @@ msgstr "" "拡張フィールドデータ。この :class:`bytes` オブジェクトに含まれているデータの" "内部構成については、`PKZIP Application Note`_ でコメントされています。" -#: ../../library/zipfile.rst:898 msgid "System which created ZIP archive." -msgstr "ZIP アーカイブを作成したシステムを記述する文字列。" +msgstr "ZIP アーカイブを作成したシステム。" #: ../../library/zipfile.rst:903 msgid "PKZIP version which created ZIP archive." @@ -1267,13 +1267,12 @@ msgid "" "interact with ZIP archives." msgstr "" -#: ../../library/zipfile.rst:965 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -"ZIP アーカイブを新規に作成したい場合、:option:`-c` オプションの後にまとめたい" -"ファイルを列挙してください:" +"新しい ZIP アーカイブを作成するには、:option:`-c` オプションの直後にアーカイ" +"ブ名を指定し、その後に含めるファイル名を列挙します。" #: ../../library/zipfile.rst:968 msgid "$ python -m zipfile -c monty.zip spam.txt eggs.txt" diff --git a/library/zlib.po b/library/zlib.po index 1fab1178d..5b83a1a4f 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -494,17 +494,17 @@ msgstr "" msgid "*max_length* can be used as a keyword argument." msgstr "" -#: ../../library/zlib.rst:323 msgid "" "All pending input is processed, and a bytes object containing the remaining " "uncompressed output is returned. After calling :meth:`flush`, the :meth:" "`decompress` method cannot be called again; the only realistic action is to " "delete the object." msgstr "" -"未処理の入力データをすべて処理し、最終的に圧縮されなかった残りの出力バイト列" -"オブジェクトを返します。:meth:`flush` を呼んだ後、:meth:`decompress` を再度呼" -"ぶべきではありません。このときできる唯一の現実的な操作はオブジェクトの削除だ" -"けです。" +"未処理の入力をすべて処理し、残りの展開済みデータを含むバイト列オブジェクトを" +"返します。\n" +":meth:`flush` を呼び出した後は :meth:`decompress` を再度呼び出すことはできま" +"せん。\n" +"その後にできる現実的な操作は、オブジェクトを削除することだけです。" #: ../../library/zlib.rst:328 msgid "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 74a41cfaf..6048250ba 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -316,15 +316,15 @@ msgstr "" msgid "The ``ZoneInfo`` class has two alternate constructors:" msgstr "``ZoneInfo`` クラスには2つの別のコンストラクターがあります:" -#: ../../library/zoneinfo.rst:196 msgid "" "Constructs a ``ZoneInfo`` object from a file-like object returning bytes (e." "g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike " "the primary constructor, this always constructs a new object." msgstr "" -"file-like オブジェクトが返すbytes(バイナリーモードで開いたファイルや :class:" -"`io.BytesIO` オブジェクト)から ``ZoneInfo`` オブジェクトを構築します。一次" -"コンストラクタと異なり、常に新規オブジェクトを構築します。" +"バイト列を返すファイルライクオブジェクト (バイナリモードで開かれたファイル" +"や :class:`io.BytesIO` オブジェクトなど) から ``ZoneInfo`` オブジェクトを構築" +"します。\n" +"通常のコンストラクタとは異なり、常に新しいオブジェクトを構築します。" #: ../../library/zoneinfo.rst:200 msgid "" From 500154531ac1891cd9dcecd6b90bfd8532ffccb8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 26 Oct 2026 10:14:27 +0000 Subject: [PATCH 17/21] Merge 3.15 into 3.14 --- c-api/dict.po | 9 +- c-api/typeobj.po | 12 +- faq/design.po | 143 +- faq/extending.po | 81 +- faq/general.po | 116 +- faq/gui.po | 8 +- faq/installed.po | 7 +- faq/library.po | 34 +- faq/programming.po | 787 +++-- faq/windows.po | 72 +- howto/a-conceptual-overview-of-asyncio.po | 527 +++- howto/annotations.po | 57 +- howto/argparse-optparse.po | 31 +- howto/argparse.po | 573 +++- howto/cporting.po | 5 +- howto/curses.po | 383 ++- howto/descriptor.po | 904 +++++- howto/enum.po | 1044 +++++-- howto/free-threading-extensions.po | 446 ++- howto/free-threading-python.po | 292 +- howto/functional.po | 460 ++- howto/gdb_helpers.po | 553 +++- howto/index.po | 85 +- howto/instrumentation.po | 364 ++- howto/ipaddress.po | 186 +- howto/isolating-extensions.po | 547 +++- howto/logging-cookbook.po | 3343 +++++++++++++++++---- howto/logging.po | 396 ++- howto/mro.po | 601 +++- howto/perf_profiling.po | 325 +- howto/pyporting.po | 38 +- howto/regex.po | 631 ++-- howto/remote_debugging.po | 677 +++-- howto/sockets.po | 145 +- howto/sorting.po | 239 +- howto/timerfd.po | 155 +- howto/unicode.po | 392 ++- howto/urllib2.po | 330 +- library/asyncio-eventloop.po | 3 +- library/concurrent.interpreters.po | 3 +- library/enum.po | 12 +- library/re.po | 6 +- library/sqlite3.po | 3 +- library/sys.po | 3 +- library/tkinter.po | 3 +- reference/compound_stmts.po | 3 +- reference/expressions.po | 3 +- whatsnew/2.2.po | 4 +- whatsnew/2.5.po | 3 +- whatsnew/3.13.po | 7 +- whatsnew/3.9.po | 3 +- 51 files changed, 11448 insertions(+), 3606 deletions(-) diff --git a/c-api/dict.po b/c-api/dict.po index e63cda5f3..750a98a75 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -827,17 +827,14 @@ msgstr "" msgid "``PyDict``" msgstr "" -#: ../../c-api/dict.rst:781 msgid ":c:func:`PyDict_GetItem`" -msgstr "" +msgstr ":c:func:`PyDict_GetItem`" -#: ../../c-api/dict.rst:783 msgid ":c:func:`PyDict_GetItemWithError`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemWithError`" -#: ../../c-api/dict.rst:785 msgid ":c:func:`PyDict_GetItemString`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemString`" #: ../../c-api/dict.rst:787 msgid ":c:func:`PyDict_Contains`" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index a844998b5..9f4cea485 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -1317,9 +1317,8 @@ msgid "" "the :c:member:`~PyVarObject.ob_size` field." msgstr "" -#: ../../c-api/typeobj.rst:495 msgid ":c:member:`PyObject.ob_refcnt`" -msgstr "" +msgstr ":c:member:`PyObject.ob_refcnt`" #: ../../c-api/typeobj.rst:497 msgid "" @@ -1372,9 +1371,8 @@ msgstr "**継承:**" msgid "This field is not inherited by subtypes." msgstr "サブタイプはこのフィールドを継承しません。" -#: ../../c-api/typeobj.rst:509 msgid ":c:member:`PyObject.ob_type`" -msgstr "" +msgstr ":c:member:`PyObject.ob_type`" #: ../../c-api/typeobj.rst:511 msgid "" @@ -1420,9 +1418,8 @@ msgstr "サブタイプはこのフィールドを継承します。" msgid "PyVarObject Slots" msgstr "PyVarObject スロット" -#: ../../c-api/typeobj.rst:535 msgid ":c:member:`PyVarObject.ob_size`" -msgstr "" +msgstr ":c:member:`PyVarObject.ob_size`" #: ../../c-api/typeobj.rst:537 msgid "" @@ -4134,9 +4131,8 @@ msgid "" "types must be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2588 msgid "Heap Types" -msgstr "" +msgstr "ヒープ型" #: ../../c-api/typeobj.rst:2590 msgid "" diff --git a/faq/design.po b/faq/design.po index 29e95b8b7..b2a67796d 100644 --- a/faq/design.po +++ b/faq/design.po @@ -293,7 +293,6 @@ msgstr "" "基底クラスにある同じ名前のメソッドを拡張するために、基底クラスのメソッドをど" "うにかして呼び出したい時にも便利です。" -#: ../../faq/design.rst:136 msgid "" "Finally, for instance variables it solves a syntactic problem with " "assignment: since local variables in Python are (by definition!) those " @@ -310,18 +309,20 @@ msgid "" "instance variables live in two different namespaces, and you need to tell " "Python which namespace to use." msgstr "" -"最後に、インスタンス変数に対する、代入の構文の問題を解決できます。Python の" -"ローカル変数は、関数の中で (global が明示的に宣言されることなく) 値が代入され" -"た変数 (と定義されています!) です。なので、ある代入が意図するのが、ローカル" -"変数へではなくインスタンス変数への代入であると、インタプリタが判断する手段が" -"必要です。そしてそれは構文を見るだけで分かる方が (効率が) 良いのです。C++ で" -"はその区別を宣言時に行いますが、Python では宣言がないので、この方法でしか区別" -"できなかったら残念です。 ``self.var`` を明示すればうまく解決できます。同様" -"に、インスタンス変数を使うのにも ``self.var`` と書かなければならないので、メ" -"ソッドの中の self が付いていない名前への参照は、そのインスタンスのディレクト" -"リを検索するまでもなくローカル変数とわかります。別の言い方をすれば、ローカル" -"変数とインスタンス変数は二つの異なる名前空間に存在し、Python にどちらの名前空" -"間を使うかを伝えなくてはならないのです。" +"最後に、インスタンス変数に対する、代入の構文の問題を解決できます。\n" +"Python のローカル変数は、関数の中で (global が明示的に宣言されることなく) 値" +"が代入された変数 (と定義されています!) です。\n" +"なので、ある代入が意図するのが、ローカル変数へではなくインスタンス変数への代" +"入であると、インタプリタが判断する手段が必要です。\n" +"そしてそれは構文を見るだけで分かる方が (効率が) 良いのです。\n" +"C++ ではその区別を宣言時に行いますが、Python には宣言がなく、この目的だけのた" +"めに導入しなければならないのは残念です。\n" +"``self.var`` を明示すればうまく解決できます。\n" +"同様に、インスタンス変数を使うのにも ``self.var`` と書かなければならないの" +"で、メソッド内の修飾のない名前を参照する際に、そのインスタンスの属性を検索す" +"る必要がなくなります。\n" +"別の言い方をすれば、ローカル変数とインスタンス変数は二つの異なる名前空間に存" +"在し、Python にどちらの名前空間を使うかを伝えなくてはならないのです。" #: ../../faq/design.rst:154 msgid "Why can't I use an assignment in an expression?" @@ -447,17 +448,18 @@ msgstr "" "値に過ぎないというのが答えです。文字列に束縛された名前にメソッドが許されるな" "ら、リテラルに使えないようにする論理的な理由はないでしょう。" -#: ../../faq/design.rst:215 msgid "" "The second objection is typically cast as: \"I am really telling a sequence " "to join its members together with a string constant\". Sadly, you aren't. " "For some reason there seems to be much less difficulty with having :meth:" "`~str.split` as a string method, since in that case it is easy to see that ::" msgstr "" -"二つ目の反対理由は、典型的には「私は実際、要素を文字列定数とともに結合させる" -"よう、シーケンスに命じているのだ」というものです。残念ながら、そうではないの" -"です。いくつかの理由から :meth:`~str.split` を文字列のメソッドとしておいた方" -"がはるかに簡単です。これを見ると分かりやすいでしょう ::" +"二つ目の反論は、よく「シーケンスに対して、文字列定数を使って要素を結合するよ" +"うに指示しているのだ」と表現されます。\n" +"残念ながら、そうではありません。\n" +"なぜか :meth:`~str.split` が文字列のメソッドであることには、はるかに抵抗が少" +"ないようです。\n" +"次の例では、何を指示しているかが分かりやすいからでしょう。 ::" #: ../../faq/design.rst:220 msgid "\"1, 2, 4, 8, 16\".split(\", \")" @@ -547,7 +549,6 @@ msgstr "" msgid "Why isn't there a switch or case statement in Python?" msgstr "Python に switch や case 文がないのはなぜですか?" -#: ../../faq/design.rst:262 msgid "" "In general, structured switch statements execute one block of code when an " "expression has a particular value or set of values. Since Python 3.10 one " @@ -557,6 +558,14 @@ msgid "" "statements. An older alternative is a sequence of ``if... elif... elif... " "else``." msgstr "" +"一般に、構造化された switch 文は、式が特定の値または値の集合のいずれかに一致" +"するときに、一つのコードブロックを実行します。\n" +"Python 3.10 以降では ``match ... case`` 文を使い、リテラル値や名前空間内の定" +"数と簡単に照合できます。\n" +":keyword:`match` 文について詳しくは、:ref:`仕様 ` と :ref:`チュートリ" +"アル ` を参照してください。\n" +"以前から使える方法として、``if... elif... elif... else`` を並べる方法もありま" +"す。" #: ../../faq/design.rst:270 msgid "" @@ -692,9 +701,8 @@ msgstr "" "る必要が無いことだけです -- しかし、(ラムダ式が生み出すオブジェクトと厳密に同" "じ型の) 関数オブジェクトが代入される先はただのローカル変数です!" -#: ../../faq/design.rst:330 msgid "Can Python be compiled to machine code, C or some other language?" -msgstr "Python は C やその他の言語のように機械語にコンパイルできますか?" +msgstr "Python を機械語、C、または他の言語にコンパイルできますか?" #: ../../faq/design.rst:332 msgid "" @@ -832,7 +840,6 @@ msgid "Why isn't all memory freed when CPython exits?" msgstr "" "なぜ CPython の終了時にすべてのメモリが解放されるわけではないのですか?" -#: ../../faq/design.rst:396 msgid "" "Objects referenced from the global namespaces of Python modules are not " "always deallocated when Python exits. This may happen if there are circular " @@ -841,20 +848,20 @@ msgid "" "about these). Python is, however, aggressive about cleaning up memory on " "exit and does try to destroy every single object." msgstr "" -"Python モジュールのグローバルな名前空間から参照されるオブジェクトは、Python " -"の終了時にメモリの割り当てを解除されるとは限りません。これは、循環参照がある" -"ときに起こりえます。解放できない C ライブラリ (例えば、Purify のようなツール" -"などが当てはまります) によって割り当てられたいくらかのメモリも含まれます。し" -"かし、Python は終了時にメモリをクリーンアップすることには積極的で、全ての単一" -"のオブジェクトを破棄しようとします。" +"Python モジュールのグローバル名前空間から参照されているオブジェクトは、" +"Python の終了時に必ずしも解放されるとは限りません。\n" +"循環参照があると、このようなことが起こる場合があります。\n" +"また、C ライブラリが割り当てたメモリの一部には解放できないものもあります (例" +"えば Purify のようなツールはこれを報告します)。\n" +"それでも Python は終了時のメモリの後始末を積極的に行い、すべてのオブジェクト" +"を破棄しようとします。" -#: ../../faq/design.rst:403 msgid "" "If you want to force Python to delete certain things on deallocation use " "the :mod:`atexit` module to run a function that will force those deletions." msgstr "" -"再割り当て時に Python が特定のものを削除するように強制したいときは、 :mod:" -"`atexit` モジュールを使って削除を強制する関数を実行してください。" +"解放時に特定のものを Python に確実に削除させたい場合は、:mod:`atexit` モ" +"ジュールを使い、それらを削除する関数を実行してください。" #: ../../faq/design.rst:408 msgid "Why are there separate tuple and list data types?" @@ -910,16 +917,15 @@ msgstr "" msgid "How are lists implemented in CPython?" msgstr "CPythonでリストはどのように実装されているのですか?" -#: ../../faq/design.rst:438 msgid "" "CPython's lists are really variable-length arrays, not Lisp-style linked " "lists. The implementation uses a contiguous array of references to other " "objects, and keeps a pointer to this array and the array's length in a list " "head structure." msgstr "" -"CPythonのリストは実際に変数分の長さの配列で、Lispスタイルの連結リストではあり" -"ません。この実装は他のオブジェクトへの参照の連続した配列を使用していて、この" -"配列へのポインタおよび配列長はリストの先頭の構造体に保存されています。" +"CPython のリストは可変長配列で、Lispスタイルの連結リストではありません。\n" +"この実装は他のオブジェクトへの参照の連続した配列を使用していて、この配列への" +"ポインタおよび配列長はリストの先頭の構造体に保存されています。" #: ../../faq/design.rst:442 msgid "" @@ -941,10 +947,11 @@ msgstr "" "くなるとき、次の何回かは実際に大きさを変更する必要がないように、いくらかの追" "加の領域が割り当てられます。" -#: ../../faq/design.rst:450 msgid "" "See :ref:`time-complexity` for the costs of the various list operations." msgstr "" +"リストの各種操作の計算コストについては、:ref:`time-complexity` を参照してくだ" +"さい。" #: ../../faq/design.rst:456 msgid "How are dictionaries implemented in CPython?" @@ -982,17 +989,17 @@ msgstr "" "なるとすれば、一定の時間 − Big-O 記法では *O*\\ (1) − でキーを検索できること" "になります。" -#: ../../faq/design.rst:471 msgid "" "See :ref:`time-complexity` for the costs of the various dictionary " "operations." msgstr "" +"辞書の各種操作の計算コストについては、:ref:`time-complexity` を参照してくださ" +"い。" #: ../../faq/design.rst:475 msgid "Why must dictionary keys be immutable?" msgstr "なぜ辞書のキーはイミュータブルでなくてはならないのですか?" -#: ../../faq/design.rst:477 msgid "" "The hash table implementation of dictionaries uses a hash value calculated " "from the key value to find the key. If the key were a mutable object, its " @@ -1005,13 +1012,15 @@ msgid "" "would be different." msgstr "" "辞書のハッシュテーブルの実装は、キーを見つけるために、キー値から計算された" -"ハッシュ値を使います。もしキーがミュータブルなオブジェクトだったら、その値は" -"変えられ、それによりハッシュ値も変わってしまいます。しかし、キーオブジェクト" -"を変更したのが何者であれ、値が辞書のキーとして使われていたと気付けないので、" -"辞書の中のエントリを適切な場所に動かせません。そして、同じオブジェクトを探そ" -"うとしても、ハッシュ値が違うため見つかりません。古い値を探そうとしても、その" -"ハッシュバイナリから見つかるオブジェクトの値は異なるでしょうから、これも見つ" -"かりません。" +"ハッシュ値を使います。\n" +"もしキーがミュータブルなオブジェクトだったら、その値は変えられ、それにより" +"ハッシュ値も変わってしまいます。\n" +"しかし、キーオブジェクトを変更したのが何者であれ、値が辞書のキーとして使われ" +"ていたと気付けないので、辞書の中のエントリを適切な場所に動かせません。\n" +"そして、同じオブジェクトを探そうとしても、ハッシュ値が違うため見つかりませ" +"ん。\n" +"古い値を探そうとしても、そのハッシュ値に対応する格納場所で見つかるオブジェク" +"トの値は異なるでしょうから、これも見つかりません。" #: ../../faq/design.rst:486 msgid "" @@ -1028,13 +1037,14 @@ msgstr "" msgid "Some unacceptable solutions that have been proposed:" msgstr "いくつかの受け入れられなかった提案:" -#: ../../faq/design.rst:492 msgid "" "Hash lists by their address (object ID). This doesn't work because if you " "construct a new list with the same value it won't be found; e.g.::" msgstr "" -"アドレス (オブジェクト ID) のハッシュリスト。これは、同じ値の新しいリストを" -"作っても見つからないので駄目です。例えば::" +"リストのアドレス (オブジェクト ID) を使ってハッシュ値を計算する。\n" +"同じ値を持つ新しいリストを作っても見つからないため、この方法はうまくいきませ" +"ん。\n" +"例えば次のコードです。 ::" #: ../../faq/design.rst:495 msgid "" @@ -1055,15 +1065,16 @@ msgstr "" "外を送出するでしょう。言い換えれば、辞書のキーは ``==`` を使って比較されるべ" "きであり、 :keyword:`is` ではないということです。" -#: ../../faq/design.rst:502 msgid "" "Make a copy when using a list as a key. This doesn't work because the list, " "being a mutable object, could contain a reference to itself, and then the " "copying code would run into an infinite loop." msgstr "" -"リストをキーとして使うときにコピーを作る。リストはミュータブルなので、自分自" -"身への参照を含むことができ、コードをコピーするときに無限ループにハマる可能性" -"があるので、これは駄目です。" +"リストをキーとして使う際にコピーを作る。\n" +"リストはミュータブルなオブジェクトなので、自分自身への参照を含む場合がありま" +"す。\n" +"その場合、コピーを行うコードが無限ループに陥るため、この方法はうまくいきませ" +"ん。" #: ../../faq/design.rst:506 msgid "" @@ -1217,21 +1228,20 @@ msgstr "" "for key in sorted(mydict):\n" " ... # mydict[key] を使って何でもできる ..." -#: ../../faq/design.rst:576 msgid "How do you specify and enforce an interface spec in Python?" -msgstr "Python ではどのようにインターフェース仕様を特定し適用するのですか?" +msgstr "" +"Python ではインターフェース仕様をどのように定義し、遵守させるのですか?" -#: ../../faq/design.rst:578 msgid "" "An interface specification for a module as provided by languages such as C++ " "and Java describes the prototypes for the methods and functions of the " "module. Many feel that compile-time enforcement of interface specifications " "helps in the construction of large programs." msgstr "" -"C++ や Java のような言語が提供するような、モジュールに対するインターフェース" -"仕様の特定は、モジュールのメソッドや関数の原型を表現します。インターフェース" -"の特定がコンパイル時に適用されることが、大きなプログラムの構成に役立つと、広" -"く感じられています。" +"C++ や Java などの言語が提供するモジュールのインターフェース仕様は、そのモ" +"ジュールのメソッドや関数のプロトタイプを記述します。\n" +"コンパイル時にインターフェース仕様への適合を強制することが、大規模なプログラ" +"ムの構築に役立つと考える人は多くいます。" #: ../../faq/design.rst:583 msgid "" @@ -1460,16 +1470,16 @@ msgstr "" msgid "In Python, such a construct would be ambiguous." msgstr "Python では、このような構造は曖昧になるでしょう。" -#: ../../faq/design.rst:685 msgid "" "Other languages, such as Object Pascal, Delphi, and C++, use static types, " "so it's possible to know, in an unambiguous way, what member is being " "assigned to. This is the main point of static typing -- the compiler " "*always* knows the scope of every variable at compile time." msgstr "" -"Object Pascal、Delphi、C++のような他の言語では、静的な型を使うので、曖昧な方" -"法でも、どのメンバに代入されているのか分かります。これが静的型付けの要点です " -"-- コンパイラは *いつでも* コンパイル時にすべての変数のスコープを知るのです。" +"Object Pascal、Delphi、C++のような他の言語では、静的な型を使うので、どのメン" +"バに代入されているのかを曖昧さなく判断できます。\n" +"これが静的型付けの要点です -- コンパイラは *いつでも* コンパイル時にすべての" +"変数のスコープを知るのです。" #: ../../faq/design.rst:690 msgid "" @@ -1616,14 +1626,15 @@ msgstr "" "if a == b:\n" " print(a)" -#: ../../faq/design.rst:755 msgid "" "Notice how the second one is slightly easier to read. Notice further how a " "colon sets off the example in this FAQ answer; it's a standard usage in " "English." msgstr "" -"を考えれば、後者のほうが少し読みやすいでしょう。さらに言えば、この FAQ の解答" -"例は次のようになるでしょう。これは、英語の標準的な用法です。" +"後者のほうが少し読みやすいことに注目してください。\n" +"この FAQ の回答でも、原文ではコロンを使って例を区切っていることにも注目してく" +"ださい。\n" +"これは英語では標準的な用法です。" #: ../../faq/design.rst:758 msgid "" diff --git a/faq/extending.po b/faq/extending.po index 35cdb2068..0134a5eb5 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -51,29 +51,32 @@ msgstr "ほとんどの中級から上級の Python 本もこの話題を扱っ msgid "Can I create my own functions in C++?" msgstr "C++ で独自の関数を作ることはできますか?" -#: ../../faq/extending.rst:28 msgid "" "Yes, using the C compatibility features found in C++. Place ``extern " "\"C\" { ... }`` around the Python include files and put ``extern \"C\"`` " "before each function that is going to be called by the Python interpreter. " "Global or static C++ objects with constructors are probably not a good idea." msgstr "" -"はい。C++ 内にある C 互換機能を使ってできます。 ``extern \"C\" { ... }`` で " -"Python のインクルードファイルを囲み、 ``extern \"C\"`` を Python インタプリタ" -"から呼ぶ各関数の前に置いてください。グローバルや静的な C++ オブジェクトの構造" -"体を持つものは良くないでしょう。" +"はい。\n" +"C++ 内にある C 互換機能を使ってできます。\n" +"``extern \"C\" { ... }`` で Python のインクルードファイルを囲み、 ``extern " +"\"C\"`` を Python インタプリタから呼ぶ各関数の前に置いてください。\n" +"コンストラクタを持つグローバルな C++ オブジェクトや静的な C++ オブジェクトを" +"使うのは、おそらく望ましくありません。" #: ../../faq/extending.rst:37 msgid "Writing C is hard; are there any alternatives?" msgstr "C を書くのは大変です。他の方法はありませんか?" -#: ../../faq/extending.rst:39 msgid "" "There are a number of alternatives to writing your own C extensions, " "depending on what you're trying to do. :ref:`Recommended third party tools " "` offer both simpler and more sophisticated approaches to " "creating C and C++ extensions for Python." msgstr "" +"何をしたいかに応じて、C 拡張を自分で書く以外にもいくつかの方法があります。\n" +":ref:`推奨されるサードパーティツール ` には、Python の C/C++ 拡" +"張をより簡単に作るものや、より高度な方法を提供するものがあります。" #: ../../faq/extending.rst:46 msgid "How can I execute arbitrary Python statements from C?" @@ -185,22 +188,23 @@ msgstr "" "す。パラメタは、オブジェクト、呼び出すメソッドの名前、 :c:func:" "`Py_BuildValue` で使われるようなフォーマット文字列、そして引数です::" -#: ../../faq/extending.rst:102 msgid "" "PyObject *\n" "PyObject_CallMethod(PyObject *object, const char *method_name,\n" " const char *arg_format, ...);" msgstr "" +"PyObject *\n" +"PyObject_CallMethod(PyObject *object, const char *method_name,\n" +" const char *arg_format, ...);" -#: ../../faq/extending.rst:106 msgid "" "This works for any object that has methods -- whether built-in or user-" "defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the " "return value." msgstr "" -"これはメソッドを持ついかなるオブジェクトにも有効で、組み込みかユーザ定義かは" -"関係ありません。返り値に対して :c:func:`Py_DECREF` する必要があることもありま" -"す。" +"これは、組み込みかユーザー定義かを問わず、メソッドを持つ任意のオブジェクトに" +"使えます。\n" +"返り値を使い終わったら、呼び出し側で :c:func:`Py_DECREF` する責任があります。" #: ../../faq/extending.rst:109 msgid "" @@ -210,7 +214,6 @@ msgstr "" "例えば、あるファイルオブジェクトの \"seek\" メソッドを 10, 0 を引数として呼ぶ" "とき (ファイルオブジェクトのポインタを \"f\" とします)::" -#: ../../faq/extending.rst:112 msgid "" "res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n" "if (res == NULL) {\n" @@ -220,8 +223,14 @@ msgid "" " Py_DECREF(res);\n" "}" msgstr "" +"res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n" +"if (res == NULL) {\n" +" ... 例外が発生した場合の処理 ...\n" +"}\n" +"else {\n" +" Py_DECREF(res);\n" +"}" -#: ../../faq/extending.rst:120 msgid "" "Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the " "argument list, to call a function without arguments, pass \"()\" for the " @@ -229,8 +238,9 @@ msgid "" "parentheses, e.g. \"(i)\"." msgstr "" "なお、 :c:func:`PyObject_CallObject` の引数リストには *常に* タプルが必要で" -"す。関数を引数なしで呼び出すには、フォーマットに \"()\" を渡し、関数を一つの" -"引数で呼び出すには、関数を括弧でくくって例えば \"(i)\" としてください。" +"す。\n" +"関数を引数なしで呼び出すには、フォーマットに \"()\" を渡し、関数を一つの引数" +"で呼び出すには、引数の書式を括弧で囲んで例えば \"(i)\" としてください。" #: ../../faq/extending.rst:127 msgid "" @@ -256,7 +266,6 @@ msgstr "" msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" msgstr "最も簡単な方法は、 :class:`io.StringIO` クラスを使うことです:" -#: ../../faq/extending.rst:136 msgid "" ">>> import io, sys\n" ">>> sys.stdout = io.StringIO()\n" @@ -266,12 +275,18 @@ msgid "" "foo\n" "hello world!" msgstr "" +">>> import io, sys\n" +">>> sys.stdout = io.StringIO()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(sys.stdout.getvalue())\n" +"foo\n" +"hello world!" #: ../../faq/extending.rst:146 msgid "A custom object to do the same would look like this:" msgstr "これと同じことをするカスタムオブジェクトは次のようになるでしょう:" -#: ../../faq/extending.rst:148 msgid "" ">>> import io, sys\n" ">>> class StdoutCatcher(io.TextIOBase):\n" @@ -288,6 +303,20 @@ msgid "" "foo\n" "hello world!" msgstr "" +">>> import io, sys\n" +">>> class StdoutCatcher(io.TextIOBase):\n" +"... def __init__(self):\n" +"... self.data = []\n" +"... def write(self, stuff):\n" +"... self.data.append(stuff)\n" +"...\n" +">>> import sys\n" +">>> sys.stdout = StdoutCatcher()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(''.join(sys.stdout.data))\n" +"foo\n" +"hello world!" #: ../../faq/extending.rst:167 msgid "How do I access a module written in Python from C?" @@ -297,9 +326,8 @@ msgstr "C から Python で書かれたモジュールにアクセスするに msgid "You can get a pointer to the module object as follows::" msgstr "以下のようにモジュールオブジェクトへのポインタを得られます::" -#: ../../faq/extending.rst:171 msgid "module = PyImport_ImportModule(\"\");" -msgstr "" +msgstr "module = PyImport_ImportModule(\"\");" #: ../../faq/extending.rst:173 msgid "" @@ -323,9 +351,8 @@ msgstr "" "これで、モジュールの属性 (つまり、モジュールで定義された任意の名前) に以下の" "ようにアクセスできるようになります::" -#: ../../faq/extending.rst:182 msgid "attr = PyObject_GetAttrString(module, \"\");" -msgstr "" +msgstr "attr = PyObject_GetAttrString(module, \"\");" #: ../../faq/extending.rst:184 msgid "" @@ -379,13 +406,12 @@ msgstr "" msgid "How do I debug an extension?" msgstr "拡張をデバッグするにはどうしますか?" -#: ../../faq/extending.rst:211 msgid "" "When using GDB with dynamically loaded extensions, you can't set a " "breakpoint in your extension until your extension is loaded." msgstr "" "動的にロードされた拡張に GDB を使うとき、拡張がロードされるまでブレークポイン" -"トを設定してはいけません。" +"トを設定できません。" #: ../../faq/extending.rst:214 msgid "In your ``.gdbinit`` file (or interactively), add the command:" @@ -417,19 +443,20 @@ msgstr "" "Linux システムで Python モジュールをコンパイルしたいのですが、見つからない" "ファイルがあります。なぜですか?" -#: ../../faq/extending.rst:234 msgid "" "Most packaged versions of Python omit some files required for compiling " "Python extensions." msgstr "" +"パッケージとして配布されている Python の多くでは、Python 拡張のコンパイルに必" +"要なファイルの一部が省かれています。" -#: ../../faq/extending.rst:237 msgid "For Red Hat, install the python3-devel RPM to get the necessary files." msgstr "" +"Red Hat では、必要なファイルを入手するために python3-devel RPM をインストール" +"してください。" -#: ../../faq/extending.rst:239 msgid "For Debian, run ``apt-get install python3-dev``." -msgstr "" +msgstr "Debian では ``apt-get install python3-dev`` を実行してください。" #: ../../faq/extending.rst:242 msgid "How do I tell \"incomplete input\" from \"invalid input\"?" diff --git a/faq/general.po b/faq/general.po index 92a0b7e65..4bcac7473 100644 --- a/faq/general.po +++ b/faq/general.po @@ -105,7 +105,6 @@ msgstr "" msgid "Are there copyright restrictions on the use of Python?" msgstr "Python を使うのに著作権の制限はありますか?" -#: ../../faq/general.rst:50 msgid "" "You can do anything you want with the source, as long as you leave the " "copyrights in and display those copyrights in any documentation about Python " @@ -115,12 +114,13 @@ msgid "" "some form. We would still like to know about all commercial use of Python, " "of course." msgstr "" -"あなたが作成する Python に関するドキュメントのすべてに著作権を残し、それらの" -"著作権を表示する限り、ソースコードをどのように扱ってもかまいません。この著作" -"権規則を尊重する限り、商用に Python を利用しても、ソースあるいはバイナリ形式" -"で(変更の有無にかかわらず) Python のコピーを販売しても、Python が何らかの形で" -"組み込まれた製品を販売してかまいません。もちろん、Python のあらゆる商業用途に" -"ついても同様です。" +"ソースに著作権表示を残し、作成する Python 関連のドキュメントにもその表示を載" +"せる限り、ソースを自由に扱えます。\n" +"著作権に関する規則を守れば、Python を商用利用したり、ソースやバイナリのコピー" +"を変更の有無にかかわらず販売したり、Python を何らかの形で組み込んだ製品を販売" +"したりしても構いません。\n" +"もちろん、Python がどのように商用利用されているかは、ぜひ知らせていただきたい" +"と思っています。" #: ../../faq/general.rst:57 msgid "" @@ -197,18 +197,17 @@ msgstr "" "理の方法が必要でした。Amoeba のエラー処理の経験から、プログラミング言語の機能" "としての例外の重要さを強く意識するようになりました。" -#: ../../faq/general.rst:93 msgid "" "It occurred to me that a scripting language with a syntax like ABC but with " "access to the Amoeba system calls would fill the need. I realized that it " "would be foolish to write an Amoeba-specific language, so I decided that I " "needed a language that was generally extensible." msgstr "" -"ABC のような構文と Amoeba のようなシステムコールを合わせ持ったスクリプト言語" -"が必要だろうと思いつきました。Amoeba 専用の言語を書くのは愚かであるだろうと気" -"づき、一般に拡張できるような言語を求めることに決めました。" +"ABC のような構文と Amoeba のシステムコールへのアクセスを合わせ持ったスクリプ" +"ト言語が必要だろうと思いつきました。\n" +"Amoeba 専用の言語を書くのは愚かであるだろうと気づき、一般に拡張できるような言" +"語を求めることに決めました。" -#: ../../faq/general.rst:98 msgid "" "During the 1989 Christmas holidays, I had a lot of time on my hand, so I " "decided to give it a try. During the next year, while still mostly working " @@ -216,18 +215,18 @@ msgid "" "success, and the feedback from colleagues made me add many early " "improvements." msgstr "" -"1989 年のクリスマス休暇の間、自由な時間がたくさんできたので、その言語を実際に" -"作ってみることにしました。翌年の間、勤務時間以外はほとんどその開発に費やし、" -"Python は Amoeba プロジェクトのなかで成果を重ね、同僚からのフィードバックは私" -"の開発を大いに加速させてくれました。" +"1989 年のクリスマス休暇には時間がたくさんあったので、試しに作ってみることにし" +"ました。\n" +"翌年も主に自分の時間を使って開発を続ける一方、Python は Amoeba プロジェクトで" +"使われ、ますます成果を上げていました。\n" +"同僚からのフィードバックを受けて、初期の改良を数多く加えました。" -#: ../../faq/general.rst:104 msgid "" "In February 1991, after just over a year of development, I decided to post " "to USENET. The rest is in the ``Misc/HISTORY`` file." msgstr "" -"1991 年 2 月、1 年間と少しの開発を経て、USENET に投稿することにしました。それ" -"は ``Misc/HISTORY`` ファイルに残っています。" +"1991 年 2 月、1 年間と少しの開発を経て、USENET に投稿することにしました。\n" +"その後の歴史は ``Misc/HISTORY`` ファイルに記されています。" #: ../../faq/general.rst:109 msgid "What is Python good for?" @@ -341,7 +340,6 @@ msgstr "" "つまり、 *2.0aN* と付けられたバージョンはすべて *2.0bN* に先立ち、 *2.0bN* " "は *2.0rcN* に先立ち、そして *これら* は 2.0 に先立ちます。" -#: ../../faq/general.rst:155 msgid "" "You may also find version numbers with a \"+dev\" suffix, such as " "\"3.15.0b3+dev\". These are unreleased versions, built directly from the " @@ -349,6 +347,12 @@ msgid "" "version is incremented to the next feature version, which becomes the \"a0\" " "version, such as \"3.16.0a0\"." msgstr "" +"\"3.15.0b3+dev\" のように、\"+dev\" という接尾辞の付いたバージョン番号を見か" +"けることもあります。\n" +"これらは CPython の開発リポジトリから直接ビルドされた未リリースのバージョンで" +"す。\n" +"最初のベータ版をリリースした後、バージョン番号は次の機能リリースに進" +"み、\"3.16.0a0\" のような \"a0\" バージョンになります。" #: ../../faq/general.rst:161 msgid "" @@ -452,7 +456,6 @@ msgstr "" msgid "Is there a newsgroup or mailing list devoted to Python?" msgstr "Python のためのニュースグループやメーリングリストはありますか?" -#: ../../faq/general.rst:211 msgid "" "There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, " "`python-list `_. The " @@ -462,13 +465,13 @@ msgid "" "Usenet readers are often more able to cope with this volume." msgstr "" "ニュースグループ :newsgroup:`comp.lang.python` やメーリングリスト `python-" -"list `_ があります。" +"list `_ があります。\n" "ニュースグループとメーリングリストは互いに接続されていて、ニュースを購読すれ" -"ばメーリングリストに参加する必要はありません。 :newsgroup:`comp.lang.python` " -"は一日に数百のポスティングを受ける高いトラフィックで、USENET 読者は多くの場" -"合、このボリュームに応えることができます。" +"ばメーリングリストに参加する必要はありません。\n" +":newsgroup:`comp.lang.python` は一日に数百のポスティングを受ける高いトラ" +"フィックで、Usenet 閲覧ソフトのほうが、この量の投稿を扱いやすいことがよくあり" +"ます。" -#: ../../faq/general.rst:218 msgid "" "Announcements of new software releases and events can be found in comp.lang." "python.announce, a low-traffic moderated list that receives about five " @@ -476,9 +479,11 @@ msgid "" "`_." msgstr "" "新しいソフトウェアリリースとイベントの告知は comp.lang.python.announce で見つ" -"けられます。これは一日に 5 ポスティング程度を受ける低トラフィックの手頃なメー" -"リングリストです。`the python-announce mailing list `_ から利用可能です。" +"けられます。\n" +"これは一日に 5 ポスティング程度を受ける投稿が承認制になっている低トラフィック" +"のリストです。\n" +"`the python-announce mailing list `_ から利用可能です。" #: ../../faq/general.rst:223 msgid "" @@ -562,13 +567,13 @@ msgstr "" msgid "Are there any books on Python?" msgstr "Python の本はありますか?" -#: ../../faq/general.rst:265 msgid "" "Yes, there are many, and more are being published. See the python.org wiki " "at https://wiki.python.org/moin/PythonBooks for a list." msgstr "" -"はい、たくさんあり、そのほとんどは現在も出版されています。リストは python." -"org wiki https://wiki.python.org/moin/PythonBooks にあります。" +"はい、たくさんあり、さらに新しい本が出版されています。\n" +"リストは python.org wiki https://wiki.python.org/moin/PythonBooks にありま" +"す。" #: ../../faq/general.rst:268 msgid "" @@ -754,7 +759,6 @@ msgstr "" msgid "Is it reasonable to propose incompatible changes to Python?" msgstr "Python の互換性を無くすような提案をしてもいいのですか?" -#: ../../faq/general.rst:363 msgid "" "In general, no. There are already millions of lines of Python code around " "the world, so any change in the language that invalidates more than a very " @@ -763,22 +767,23 @@ msgid "" "documentation; many books have been written about Python, and we don't want " "to invalidate them all at a single stroke." msgstr "" -"一般的には、してはいけません。世界中にすでに何百万行もの Python コードがある" -"ので、既存のプログラムのどんなに僅かな部分でも無効にしてしまうような言語仕様" -"の変更も認められてはなりません。コンバートするプログラムが出来てさえ、すべて" -"のドキュメントをアップデートしなければならないという問題があります。 Python " -"に関する多くの本が出版されているので、それらを一発で不適切にするようなことは" -"したくないです。" +"一般的には、してはいけません。\n" +"世界中にすでに何百万行もの Python コードがあるので、既存プログラムのごく僅か" +"な割合を超えて動かなくしてしまう言語の変更は、好ましくないと考えられます。\n" +"コンバートするプログラムが出来てさえ、すべてのドキュメントをアップデートしな" +"ければならないという問題があります。\n" +"Python に関する多くの本が出版されているので、それらを一発で不適切にするような" +"ことはしたくないです。" -#: ../../faq/general.rst:370 msgid "" "Providing a gradual upgrade path is necessary if a feature has to be " "changed. :pep:`5` describes the procedure followed for introducing backward-" "incompatible changes while minimizing disruption for users." msgstr "" "仕様を変えなければならないのなら、緩やかなアップグレード計画が組まれなくては" -"なりません。 :pep:`5` で、ユーザーの受ける分裂を最小限にしながら後方互換性の" -"ない変更を行うために従うべき手順について説明しています。" +"なりません。\n" +":pep:`5` で、ユーザーに生じる混乱を最小限にしながら後方互換性のない変更を行う" +"ために従うべき手順について説明しています。" #: ../../faq/general.rst:376 msgid "Is Python a good language for beginning programmers?" @@ -827,7 +832,6 @@ msgstr "" "見れば静的型付け言語を学ぶことは重要ですが、それが最初のプログラミングの授業" "で学ぶべき最高の話題とは限りません。" -#: ../../faq/general.rst:398 msgid "" "Many other aspects of Python make it a good first language. Like Java, " "Python has a large standard library so that students can be assigned " @@ -839,16 +843,17 @@ msgid "" "students about code reuse. Third-party modules such as PyGame are also " "helpful in extending the students' reach." msgstr "" -"Python の良いところは他にもたくさんあります。Python には、Java のように大きな" -"標準ライブラリがあり、生徒が何かを *する* 段階で非常に早くプログラミングプロ" -"ジェクトに参加できるようになります。宿題は標準の四則演算機や平均を求めるプロ" -"グラムに限定されません。標準ライブラリを使用することで、生徒はプログラミング" -"の原理を学びながら現実的なアプリケーションに取り組む満足感を得ることができま" -"す。また、標準ライブラリの使用からコードの再利用を学ぶことができます。 " -"PyGame などのサードパーティモジュールもまた手が届く範囲を広げるのに役立ちま" -"す。" +"ほかにも、Python を最初に学ぶ言語として適したものにする特徴は数多くありま" +"す。\n" +"Java と同様に大規模な標準ライブラリを備えているため、授業の早い段階から、実際" +"に何かを *行う* プログラムを課題にできます。\n" +"課題は定番の四則演算電卓や小切手帳の残高確認プログラムに限られません。\n" +"標準ライブラリを使えば、生徒はプログラミングの基礎を学びながら、実用的なアプ" +"リケーションに取り組む満足感を得られます。\n" +"標準ライブラリの利用を通じて、コードの再利用も学べます。\n" +"PyGame などのサードパーティモジュールも、生徒が取り組める範囲を広げるのに役立" +"ちます。" -#: ../../faq/general.rst:407 msgid "" "Python's interactive interpreter enables students to test language features " "while they're programming. They can keep a window with the interpreter " @@ -856,9 +861,10 @@ msgid "" "can't remember the methods for a list, they can do something like this::" msgstr "" "Python のインタラクティブインタプリタによって、プログラミングをしながら、言語" -"機能を確認することができます。別のウィンドウでプログラムのソースに入っている" -"間、ウィンドウでインタプリタを起動させたままにしておくことができます。リスト" -"のメソッドを思い出せないときは、例えばこのようにできます::" +"機能を確認することができます。\n" +"一つのウィンドウでインタープリタを動かしたまま、別のウィンドウでプログラムの" +"ソースを入力できます。\n" +"リストのメソッドを思い出せないときは、例えばこのようにできます::" #: ../../faq/general.rst:412 msgid "" diff --git a/faq/gui.po b/faq/gui.po index f577854e6..3109174a0 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -98,17 +98,15 @@ msgstr "" "envvar:`!TCL_LIBRARY` と :envvar:`!TK_LIBRARY` でランタイムに指定することで" "す。" -#: ../../faq/gui.rst:49 msgid "" "Various third-party freeze libraries such as py2exe and cx_Freeze have " "handling for Tkinter applications built-in." msgstr "" -"py2exe や cx_Freeze など いくつかのサードパーティ製凍結ライブラリは、 " -"Tkinter アプリケーション組み込みの機能を持ちます。" +"py2exe や cx_Freeze など、さまざまなサードパーティの凍結ライブラリには、" +"Tkinter アプリケーションを扱う機能が組み込まれています。" -#: ../../faq/gui.rst:54 msgid "Can I have Tk events handled while waiting for I/O?" -msgstr "I/O を待つ間に扱われる Tk イベントを作れますか?" +msgstr "I/O を待っている間も Tk イベントを処理できますか?" #: ../../faq/gui.rst:56 msgid "" diff --git a/faq/installed.po b/faq/installed.po index 094827014..f4f0b6226 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -114,14 +114,13 @@ msgstr "Python を削除してもいいですか?" msgid "That depends on where Python came from." msgstr "Python をどこから手に入れたかによります。" -#: ../../faq/installed.rst:42 msgid "" "If someone installed it deliberately, you can remove it without hurting " "anything. On Windows, use the Add/Remove Programs icon in the Control Panel." msgstr "" -"誰かが Python を意図してダウンロードしたのであれば、何の問題もなく削除するこ" -"とができます。Windows では、コントロールパネルのプログラムの追加と削除を使っ" -"てください。" +"誰かが Python を意図してインストールしたのであれば、何の問題もなく削除するこ" +"とができます。\n" +"Windows では、コントロールパネルのプログラムの追加と削除を使ってください。" #: ../../faq/installed.rst:45 msgid "" diff --git a/faq/library.po b/faq/library.po index e8660c465..d5c818afe 100644 --- a/faq/library.po +++ b/faq/library.po @@ -247,13 +247,12 @@ msgstr "" msgid "Is there an equivalent to C's onexit() in Python?" msgstr "Python には C の onexit() に相当するものはありますか?" -#: ../../faq/library.rst:113 msgid "" "The :mod:`atexit` module provides a register function that is similar to " "C's :c:func:`!onexit`." msgstr "" -":mod:`atexit` モジュールは、 C の :c:func:`!onexit` と同じような関数登録を提" -"供します。" +":mod:`atexit` モジュールには、C の :c:func:`!onexit` に似た ``register()`` 関" +"数があります。" #: ../../faq/library.rst:118 msgid "Why don't my signal handlers work?" @@ -301,13 +300,12 @@ msgstr "" "ルは、モジュールの docstring から使用例を見つけてそれらを実行し、出力を " "docstring によって与えられた望まれる出力と比較します。" -#: ../../faq/library.rst:141 msgid "" "The :mod:`unittest` module is a fancier testing framework modelled on Java " "and Smalltalk testing frameworks." msgstr "" -":mod:`unittest` モジュールは、Java や Smalltalk のテストフレームワークを模し" -"た装飾されたテストフレームワークです。" +":mod:`unittest` モジュールは、Java や Smalltalk のテストフレームワークをモデ" +"ルにした、より高機能なテストフレームワークです。" #: ../../faq/library.rst:144 msgid "" @@ -566,7 +564,6 @@ msgstr "" msgid "Here's a trivial example::" msgstr "ここにちょっとした例があります::" -#: ../../faq/library.rst:304 msgid "" "import threading, queue, time\n" "\n" @@ -627,7 +624,7 @@ msgstr "" "# キュー作成\n" "q = queue.Queue()\n" "\n" -"# 5つのワーカープールをスタート\n" +"# 5 個のワーカーからなるプールを開始\n" "for i in range(5):\n" " t = threading.Thread(target=worker, name='worker %i' % (i+1))\n" " t.start()\n" @@ -1006,15 +1003,15 @@ msgstr "" " s = f.read(8)\n" " x, y, z = struct.unpack(\">hhl\", s)" -#: ../../faq/library.rst:518 msgid "" "The '>' in the format string forces big-endian data; the letter 'h' reads " "one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " "bytes) from the string." msgstr "" -"フォーマット中の '>' はデータを強制的にビッグエンディアンにします。ファイルか" -"ら、文字 'h' は一つの\"整数\"(2 バイト)を読み込み、文字 'l' は一つの\"long 整" -"数\"を読み込みます。" +"書式文字列の \">\" は、データをビッグエンディアンとして解釈するよう指定しま" +"す。\n" +"\"h\" は文字列から一つの short 整数 (2 バイト) を読み取り、\"l\" は一つの " +"long 整数 (4 バイト) を読み取ります。" #: ../../faq/library.rst:522 msgid "" @@ -1037,11 +1034,10 @@ msgstr "" "read()`` は :class:`bytes` オブジェクトではなく :class:`str` オブジェクトを返" "します。" -#: ../../faq/library.rst:535 msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" msgstr "" -"os.popen() によって作られたパイプで os.read() が使われていないようです。なぜ" -"ですか?" +"os.popen() で作成したパイプに os.read() を使えないようです。\n" +"なぜですか?" #: ../../faq/library.rst:537 msgid "" @@ -1315,16 +1311,16 @@ msgstr "" "``errno.EISCONN`` は接続されたことを表します -- または、このソケットを :meth:" "`select.select` に渡して書き込み可能か調べることができます。" -#: ../../faq/library.rst:675 msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " "network code. The third-party `Twisted `_ library is a " "popular and feature-rich alternative." msgstr "" -":mod:`asyncio` モジュールは、ノンブロッキングのネットワークコードを書く作業の" -"ためにフレームワークのような方法を提供します。その他の選択肢として、`Twisted " -"`_ は多機能で著名なサードパーティのライブラリです。" +":mod:`asyncio` モジュールは、シングルスレッドで並行処理を行う汎用の非同期ライ" +"ブラリを提供し、ノンブロッキングのネットワークコードを書くのに使えます。\n" +"サードパーティの `Twisted `_ ライブラリも、広く使われて" +"いる多機能な選択肢です。" #: ../../faq/library.rst:683 msgid "Databases" diff --git a/faq/programming.po b/faq/programming.po index 9ab3de75e..ba15f54c1 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -596,15 +596,14 @@ msgstr "" msgid "locally developed modules" msgstr "自前で開発したモジュール" -#: ../../faq/programming.rst:307 msgid "" "It is sometimes necessary to move imports to a function or class to avoid " "problems with circular imports. Gordon McMillan says:" msgstr "" -"循環参照の問題を避けるために、インポートを関数やクラスに移すことが必要なとき" -"もあります。Gordon McMillan によれば:" +"循環インポートの問題を避けるために、インポートを関数やクラスに移すことが必要" +"なときもあります。\n" +"Gordon McMillan によれば:" -#: ../../faq/programming.rst:310 msgid "" "Circular imports are fine where both modules use the \"import \" " "form of import. They fail when the 2nd module wants to grab a name out of " @@ -612,9 +611,10 @@ msgid "" "That's because names in the 1st are not yet available, because the first " "module is busy importing the 2nd." msgstr "" -"循環参照は両方のモジュールが \"import \" 形式のインポートを使っていれ" -"ば大丈夫です。二つ目のモジュールが最初のモジュールから名前を確保しようとして " -"(\"from module import name\")、そのインポートがトップレベルにあると駄目です。" +"循環インポートは両方のモジュールが \"import \" 形式のインポートを使っ" +"ていれば大丈夫です。\n" +"二つ目のモジュールが最初のモジュールから名前を確保しようとして (\"from " +"module import name\")、そのインポートがトップレベルにあると駄目です。\n" "最初のモジュールが二つ目のモジュールをインポートするのに忙しくて、最初のモ" "ジュールの名前が利用可能になっていないからです。" @@ -643,7 +643,6 @@ msgstr "" "ポートすることさえできないかもしれません。この場合は、対応するプラットフォー" "ムに合わせたコードで正しいモジュールをインポートすることを選ぶと良いです。" -#: ../../faq/programming.rst:326 msgid "" "Only move imports into a local scope, such as inside a function definition, " "if it's necessary to solve a problem such as avoiding a circular import or " @@ -656,15 +655,19 @@ msgid "" "only a couple of dictionary lookups. Even if the module name has gone out " "of scope, the module is probably available in :data:`sys.modules`." msgstr "" -"循環参照の問題を避けたりモジュールの初期化にかかる時間を減らしたりしたいな" -"ら、単にインポートを関数定義の中などのローカルなスコープに移してください。こ" -"の手法は多くのインポートがプログラムがどのように実行されるかに依存しなくてよ" -"いときに特に有効です。ある関数の中でのみモジュールが使われるのなら、インポー" -"トをその関数の中に移すことを考えてもいいでしょう。なお、モジュールを読み込む" -"最初の回はモジュールの初期化の時間のために高価になりえますが、複数回目にモ" -"ジュールを読み込むのは事実上無料、辞書探索の数回のコストだけで済みます。モ" -"ジュール名がスコープから外れてさえ、そのモジュールはおそらく :data:`sys." -"modules` から利用できるでしょう。" +"インポートを関数定義内などのローカルスコープへ移すのは、循環インポートを避け" +"るといった問題の解決に必要な場合や、モジュールの初期化時間を短くしたい場合だ" +"けにしてください。\n" +"この手法は、プログラムの実行のされ方によって多くのインポートが不要になる場合" +"に特に有効です。\n" +"モジュールをある関数の中でしか使わない場合も、インポートをその関数内へ移すと" +"よいでしょう。\n" +"初回の読み込みにはモジュールの初期化が伴うため、時間がかかることがありま" +"す。\n" +"一方、繰り返し読み込むときのコストは辞書を数回検索する程度で、ほぼ無視できま" +"す。\n" +"モジュール名がスコープから外れても、モジュール自体はおそらく :data:`sys." +"modules` に残っています。" #: ../../faq/programming.rst:339 msgid "Why are default values shared between objects?" @@ -713,15 +716,15 @@ msgstr "" "に一度だけ生成されます。この例の辞書のように、そのオブジェクトが変更されたと" "き、その後の関数の呼び出しは変更後のオブジェクトを参照します。" -#: ../../faq/programming.rst:357 msgid "" "By definition, immutable objects such as numbers, strings, tuples, and " "``None``, are safe from change. Changes to mutable objects such as " "dictionaries, lists, and class instances can lead to confusion." msgstr "" -"定義の時に、数、文字列、タプル、``None`` など、イミュータブルなオブジェクトを" -"使うと変更される危険がありません。辞書、リスト、クラスインスタンスなどの" -"ミュータブルなオブジェクトは混乱のもとです。" +"数値、文字列、タプル、``None`` などのイミュータブルなオブジェクトは、定義上、" +"変更されることがありません。\n" +"辞書、リスト、クラスインスタンスなどのミュータブルなオブジェクトを変更する" +"と、混乱を招く場合があります。" #: ../../faq/programming.rst:361 msgid "" @@ -839,7 +842,6 @@ msgstr "" msgid "What is the difference between arguments and parameters?" msgstr "実引数と仮引数の違いは何ですか?" -#: ../../faq/programming.rst:418 msgid "" ":term:`Parameters ` are defined by the names that appear in a " "function definition, whereas :term:`arguments ` are the values " @@ -849,8 +851,10 @@ msgid "" msgstr "" ":term:`仮引数 (parameter) ` は関数定義に表れる名前で定義されるのに" "対し、 :term:`実引数 (argument) ` は関数を呼び出すときに実際に渡す" -"値のことです。仮引数は関数が受け取ることの出来る :term:`実引数の型 " -"` を定義します。例えば、以下のような関数定義があったとして::" +"値のことです。\n" +"仮引数は関数が受け取ることの出来る :term:`実引数の種類 ` を定義し" +"ます。\n" +"例えば、以下のような関数定義があったとして::" #: ../../faq/programming.rst:424 msgid "" @@ -1459,9 +1463,8 @@ msgstr "" "……そして、その猫が沢山の名前で知られていたり、逆に全く名前が無かったりしても" "驚かないでください!" -#: ../../faq/programming.rst:702 msgid "What's up with the comma operator's precedence?" -msgstr "カンマ演算子はなぜ優先されるのですか?" +msgstr "カンマ演算子の優先順位はどうなっていますか?" #: ../../faq/programming.rst:704 msgid "Comma is not an operator in Python. Consider this session::" @@ -1745,14 +1748,14 @@ msgstr "" msgid "i == (i // j) * j + (i % j)" msgstr "i == (i // j) * j + (i % j)" -#: ../../faq/programming.rst:837 msgid "" "then integer division has to return the floor. C also requires that " "identity to hold, and then compilers that truncate ``i // j`` need to make " "``i % j`` have the same sign as ``i``." msgstr "" -"整数除算は床を返すことになります。C にも C の一貫性があって、``i % j`` が " -"``i`` と同じ符号を持つように ``i // j`` を丸めています。" +"整数除算は床、つまり商以下の最大の整数を返す必要があります。\n" +"C でもこの等式を満たす必要があり、商をゼロ方向に切り捨てるコンパイラでは、" +"``i % j`` の符号を ``i`` と同じにする必要があります。" #: ../../faq/programming.rst:841 msgid "" @@ -2091,15 +2094,13 @@ msgstr "" "これは典型的に一度に一行ずつテキストを読みたい時にのみ使われるので、``S." "rstrip()`` をこの方法で使うとうまくいきます。" -#: ../../faq/programming.rst:1010 msgid "Is there a ``scanf()`` or ``sscanf()`` equivalent?" -msgstr "" +msgstr "``scanf()`` や ``sscanf()`` に相当するものはありますか?" #: ../../faq/programming.rst:1012 msgid "Not as such." msgstr "そのようなものはありません。" -#: ../../faq/programming.rst:1014 msgid "" "For simple input parsing, the easiest approach is usually to split the line " "into whitespace-delimited words using the :meth:`~str.split` method of " @@ -2108,6 +2109,11 @@ msgid "" "parameter which is useful if the line uses something other than whitespace " "as a separator." msgstr "" +"単純な入力を解析するには、通常、文字列オブジェクトの :meth:`~str.split` メ" +"ソッドで行を空白区切りの単語に分割し、:func:`int` や :func:`float` で十進数の" +"文字列を数値に変換するのが最も簡単です。\n" +":meth:`!split` には省略可能な ``sep`` 引数があり、空白以外の区切り文字を使っ" +"た行を扱うのに便利です。" #: ../../faq/programming.rst:1020 msgid "" @@ -2117,9 +2123,8 @@ msgstr "" "もっと複雑な入力解析をしたいなら、C の ``sscanf`` よりも正規表現の方が便利で" "すし、この処理に向いています。" -#: ../../faq/programming.rst:1025 msgid "What does ``UnicodeDecodeError`` or ``UnicodeEncodeError`` error mean?" -msgstr "" +msgstr "``UnicodeDecodeError`` や ``UnicodeEncodeError`` は何を意味しますか?" #: ../../faq/programming.rst:1027 msgid "See the :ref:`unicode-howto`." @@ -2137,7 +2142,6 @@ msgstr "" "奇数個のバックスラッシュで終わる raw string は文字列のクォートをエスケープし" "ます::" -#: ../../faq/programming.rst:1037 msgid "" ">>> r'C:\\this\\will\\not\\work\\'\n" " File \"\", line 1\n" @@ -2145,6 +2149,11 @@ msgid "" " ^\n" "SyntaxError: unterminated string literal (detected at line 1)" msgstr "" +">>> r'C:\\this\\will\\not\\work\\'\n" +" File \"\", line 1\n" +" r'C:\\this\\will\\not\\work\\'\n" +" ^\n" +"SyntaxError: unterminated string literal (detected at line 1)" #: ../../faq/programming.rst:1043 msgid "" @@ -2154,11 +2163,12 @@ msgstr "" "これにはいくつかの回避策があります。ひとつは通常文字列と二重バックスラッシュ" "を使うことです::" -#: ../../faq/programming.rst:1046 msgid "" ">>> 'C:\\\\this\\\\will\\\\work\\\\'\n" "'C:\\\\this\\\\will\\\\work\\\\'" msgstr "" +">>> 'C:\\\\this\\\\will\\\\work\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" #: ../../faq/programming.rst:1049 msgid "" @@ -2168,11 +2178,12 @@ msgstr "" "もうひとつは、エスケープされたバックスラッシュを含む通常の文字列を、 raw " "string に連結します::" -#: ../../faq/programming.rst:1052 msgid "" ">>> r'C:\\this\\will\\work' '\\\\'\n" "'C:\\\\this\\\\will\\\\work\\\\'" msgstr "" +">>> r'C:\\this\\will\\work' '\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" #: ../../faq/programming.rst:1055 msgid "" @@ -2182,11 +2193,12 @@ msgstr "" "Windowsでは、 :func:`os.path.join` を使ってバックスラッシュを追加することもで" "きます::" -#: ../../faq/programming.rst:1057 msgid "" ">>> os.path.join(r'C:\\this\\will\\work', '')\n" "'C:\\\\this\\\\will\\\\work\\\\'" msgstr "" +">>> os.path.join(r'C:\\this\\will\\work', '')\n" +"'C:\\\\this\\\\will\\\\work\\\\'" #: ../../faq/programming.rst:1060 msgid "" @@ -2199,11 +2211,12 @@ msgstr "" "ますが、 raw string の値を解釈する際にはエスケープが生じません。つまり、バッ" "クスラッシュは raw string 値の中に残ったままになります::" -#: ../../faq/programming.rst:1065 msgid "" ">>> r'backslash\\'preserved'\n" "\"backslash\\\\'preserved\"" msgstr "" +">>> r'backslash\\'preserved'\n" +"\"backslash\\\\'preserved\"" #: ../../faq/programming.rst:1068 msgid "Also see the specification in the :ref:`language reference `." @@ -2217,11 +2230,12 @@ msgstr "性能" msgid "My program is too slow. How do I speed it up?" msgstr "プログラムが遅すぎます。どうしたら速くなりますか?" -#: ../../faq/programming.rst:1077 msgid "" "That's a tough one, in general. First, here is a list of things to remember " "before diving further:" msgstr "" +"一般には難しい問題です。\n" +"詳しく検討する前に、まず次の点を覚えておいてください。" #: ../../faq/programming.rst:1080 msgid "" @@ -2264,14 +2278,13 @@ msgstr "" "洗練された最適化に隠れたリグレッションの可能性を生む前に、(ユニットテストやそ" "の他の技法で) コードカバレッジを上げることを強く推奨します。" -#: ../../faq/programming.rst:1092 msgid "" "That being said, there are many tricks to speed up Python code. Here are " "some general principles which go a long way towards reaching acceptable " "performance levels:" msgstr "" -"とは言っても、Python コードを高速化する技法はたくさんあります。ここでは、満足" -"な性能のレベルにたどり着くまでの長い道のりを進む、一般的な方針を示します:" +"とはいえ、Python コードを高速化する方法はたくさんあります。\n" +"満足できる性能を得るうえで大いに役立つ一般的な方針を紹介します。" #: ../../faq/programming.rst:1096 msgid "" @@ -2307,7 +2320,6 @@ msgstr "" "`sorted` 関数を使ってください (また、中程度に高度な例は、 :ref:" "`sortinghowto` を参照してください)。" -#: ../../faq/programming.rst:1111 msgid "" "Abstractions tend to create indirections and force the interpreter to work " "more. If the levels of indirection outweigh the amount of useful work done, " @@ -2315,12 +2327,11 @@ msgid "" "especially under the form of tiny functions or methods (which are also often " "detrimental to readability)." msgstr "" -"抽象化は、遠回りにしがちで、インタプリタの作業を増やすことになります。この遠" -"回りさが、なされる作業の量より重大になると、プログラムが遅くなってしまいま" -"す。過度な抽象化、特に細かい関数やメソッドの形で現れるもの (これは読みにくさ" -"も落とします) は防ぐべきです。" +"抽象化によって処理が間接的になると、インタープリタの仕事が増えがちです。\n" +"間接的な処理の負担が本来の処理の量を上回ると、プログラムが遅くなります。\n" +"過度な抽象化、特に細かすぎる関数やメソッドは避けるべきです。\n" +"こうした関数やメソッドは、読みやすさを損なうこともよくあります。" -#: ../../faq/programming.rst:1117 msgid "" "If you have reached the limit of what pure Python can allow, there are tools " "to take you further away. For example, `Cython `_ can " @@ -2331,12 +2342,14 @@ msgid "" "skills, you can also :ref:`write a C extension module ` " "yourself." msgstr "" -"pure Python にできる限界に達したなら、更に進むためのツールがあります。例え" -"ば、`Cython `_ は、Python コードのわずかに変形した版を C " -"拡張にコンパイルし、多種のプラットフォームで使えます。Cython は、コンパイル " -"(と任意の型アノテーション) を利用し、コードの解釈を大幅に速くします。C プログ" -"ラミングに自信があるなら、自分で :ref:`write a C extension module ` こともできます。" +"Python だけで書いたコードの限界に達したら、さらに性能を上げるためのツールがあ" +"ります。\n" +"例えば `Cython `_ は、Python コードに少し手を加えたもの" +"を C 拡張にコンパイルでき、多くのプラットフォームで使えます。\n" +"Cython はコンパイルと、省略可能な型アノテーションを活用することで、インタープ" +"リタによる実行よりもコードを大幅に高速化できます。\n" +"C のプログラミングに自信があれば、自分で :ref:`C 拡張モジュールを書く " +"` こともできます。" #: ../../faq/programming.rst:1127 msgid "" @@ -2350,7 +2363,6 @@ msgstr "" msgid "What is the most efficient way to concatenate many strings together?" msgstr "多くの文字列を結合するのに最も効率的な方法は何ですか?" -#: ../../faq/programming.rst:1136 msgid "" ":class:`str` and :class:`bytes` objects are immutable, therefore " "concatenating many strings together is inefficient as each concatenation " @@ -2358,6 +2370,10 @@ msgid "" "quadratic in the total string length. See :ref:`time-complexity` for more " "information." msgstr "" +":class:`str` と :class:`bytes` のオブジェクトはイミュータブルなので、多数の文" +"字列を連結すると、そのたびに新しいオブジェクトが作られて非効率になります。\n" +"一般には、実行時間は文字列の全長の二乗に比例します。\n" +"詳しくは :ref:`time-complexity` を参照してください。" #: ../../faq/programming.rst:1141 msgid "" @@ -2367,17 +2383,19 @@ msgstr "" "多くの :class:`str` オブジェクトを累積するのにおすすめのイディオムは、すべて" "をリストに配置してから最後に :meth:`str.join` を呼び出すことです::" -#: ../../faq/programming.rst:1144 msgid "" "chunks = []\n" "for s in my_strings:\n" " chunks.append(s)\n" "result = ''.join(chunks)" msgstr "" +"chunks = []\n" +"for s in my_strings:\n" +" chunks.append(s)\n" +"result = ''.join(chunks)" -#: ../../faq/programming.rst:1149 msgid "(Another reasonably efficient idiom is to use :class:`io.StringIO`.)" -msgstr "" +msgstr "(:class:`io.StringIO` を使うのも、ある程度効率のよい方法です。)" #: ../../faq/programming.rst:1151 msgid "" @@ -2389,16 +2407,17 @@ msgstr "" "class:`bytearray` オブジェクトをインプレース結合 (``+=`` 演算子) で拡張するこ" "とです::" -#: ../../faq/programming.rst:1154 msgid "" "result = bytearray()\n" "for b in my_bytes_objects:\n" " result += b" msgstr "" +"result = bytearray()\n" +"for b in my_bytes_objects:\n" +" result += b" -#: ../../faq/programming.rst:1160 msgid "Sequences (tuples/lists)" -msgstr "" +msgstr "シーケンス (タプルとリスト)" #: ../../faq/programming.rst:1163 msgid "How do I convert between tuples and lists?" @@ -2470,11 +2489,12 @@ msgstr "シーケンスを逆順にイテレートするにはどうしたらい msgid "Use the :func:`reversed` built-in function::" msgstr "組み込み関数 :func:`reversed` を使ってください。" -#: ../../faq/programming.rst:1197 msgid "" "for x in reversed(sequence):\n" " ... # do something with x ..." msgstr "" +"for x in reversed(sequence):\n" +" ... # x を使った処理 ..." #: ../../faq/programming.rst:1200 msgid "" @@ -2496,15 +2516,13 @@ msgstr "Python Cookbook の長い議論に多くの方法があるので参照 msgid "https://code.activestate.com/recipes/52560/" msgstr "https://code.activestate.com/recipes/52560/" -#: ../../faq/programming.rst:1211 msgid "" "If you don't mind reordering the list, sort it and then scan from the end of " "the list, deleting duplicates as you go::" msgstr "" -"リストを並び替えて構わないのなら、ソートした上でリストの最初から最後までを調" -"べ、次のように重複を削除してください::" +"リストの順序を変えてもよければ、ソートしてから末尾から順に調べ、重複を削除し" +"てください。 ::" -#: ../../faq/programming.rst:1214 msgid "" "if mylist:\n" " mylist.sort()\n" @@ -2515,16 +2533,24 @@ msgid "" " else:\n" " last = mylist[i]" msgstr "" +"if mylist:\n" +" mylist.sort()\n" +" last = mylist[-1]\n" +" for i in range(len(mylist)-2, -1, -1):\n" +" if last == mylist[i]:\n" +" del mylist[i]\n" +" else:\n" +" last = mylist[i]" -#: ../../faq/programming.rst:1223 msgid "" "If all elements of the list may be used as set keys (that is, they are all :" "term:`hashable`) this is often faster::" msgstr "" +"リストのすべての要素を集合に格納できる場合 (つまり、すべてが :term:" +"`hashable` な場合) は、次の方法のほうが速いことがよくあります。 ::" -#: ../../faq/programming.rst:1226 msgid "mylist = list(set(mylist))" -msgstr "" +msgstr "mylist = list(set(mylist))" #: ../../faq/programming.rst:1228 msgid "" @@ -2534,24 +2560,29 @@ msgstr "" "リストを集合に変換するときに重複は取り除かれるので、それをリストに戻せばいい" "のです。" -#: ../../faq/programming.rst:1233 msgid "How do you remove multiple items from a list?" -msgstr "" +msgstr "リストから複数の要素を取り除くにはどうしますか?" -#: ../../faq/programming.rst:1235 msgid "" "As with removing duplicates, explicitly iterating in reverse with a delete " "condition is one possibility. However, it is easier and faster to use slice " "replacement with an implicit or explicit forward iteration. Here are three " "variations::" msgstr "" +"重複を取り除く場合と同じように、逆順にイテレートし、条件に合う要素を削除する" +"方法があります。\n" +"ただし、暗黙的または明示的に順方向へイテレートし、スライスを置き換えるほうが" +"簡単で高速です。\n" +"次の 3 通りの書き方があります。 ::" -#: ../../faq/programming.rst:1240 msgid "" "mylist[:] = filter(keep_function, mylist)\n" "mylist[:] = (x for x in mylist if keep_condition)\n" "mylist[:] = [x for x in mylist if keep_condition]" msgstr "" +"mylist[:] = filter(keep_function, mylist)\n" +"mylist[:] = (x for x in mylist if keep_condition)\n" +"mylist[:] = [x for x in mylist if keep_condition]" #: ../../faq/programming.rst:1244 msgid "The list comprehension may be fastest." @@ -2565,9 +2596,8 @@ msgstr "Python で配列を作るにはどうしますか?" msgid "Use a list::" msgstr "リストを使ってください::" -#: ../../faq/programming.rst:1252 msgid "[\"this\", 1, \"is\", \"an\", \"array\"]" -msgstr "" +msgstr "[\"this\", 1, \"is\", \"an\", \"array\"]" #: ../../faq/programming.rst:1254 msgid "" @@ -2578,13 +2608,16 @@ msgstr "" "リストの時間計算量は C や Pascal の配列と同じです。大きな違いは、Python のリ" "ストは多くの異なる型のオブジェクトを含めることです。" -#: ../../faq/programming.rst:1257 msgid "" "The ``array`` module also provides methods for creating arrays of fixed " "types with compact representations, but they are slower to index than " "lists. Also note that `NumPy `_ and other third-party " "packages define array-like structures with various characteristics as well." msgstr "" +"``array`` モジュールにも、型を固定した配列をコンパクトな表現で作るためのメ" +"ソッドがありますが、インデックスによるアクセスはリストより遅くなります。\n" +"また、`NumPy `_ などのサードパーティーパッケージも、さま" +"ざまな特性を持つ配列に似た構造を定義しています。" #: ../../faq/programming.rst:1263 msgid "" @@ -2593,9 +2626,8 @@ msgstr "" "Lisp 方式の連結リストを得るのに、タプルを使って *cons cells* をエミュレートで" "きます::" -#: ../../faq/programming.rst:1265 msgid "lisp_list = (\"like\", (\"this\", (\"example\", None) ) )" -msgstr "" +msgstr "lisp_list = (\"like\", (\"this\", (\"example\", None) ) )" #: ../../faq/programming.rst:1267 msgid "" @@ -2617,42 +2649,44 @@ msgstr "多次元のリストを作るにはどうしますか?" msgid "You probably tried to make a multidimensional array like this::" msgstr "このようにして多次元の配列を作ろうとしてしまったことがあるでしょう::" -#: ../../faq/programming.rst:1280 msgid ">>> A = [[None] * 2] * 3" -msgstr "" +msgstr ">>> A = [[None] * 2] * 3" #: ../../faq/programming.rst:1282 msgid "This looks correct if you print it:" msgstr "これを表示したときには問題なさそうに見えます:" -#: ../../faq/programming.rst:1288 msgid "" ">>> A\n" "[[None, None], [None, None], [None, None]]" msgstr "" +">>> A\n" +"[[None, None], [None, None], [None, None]]" #: ../../faq/programming.rst:1293 msgid "But when you assign a value, it shows up in multiple places:" msgstr "しかし値を代入すると、その値が複数の場所に現れてしまいます:" -#: ../../faq/programming.rst:1299 msgid "" ">>> A[0][0] = 5\n" ">>> A\n" "[[5, None], [5, None], [5, None]]" msgstr "" +">>> A[0][0] = 5\n" +">>> A\n" +"[[5, None], [5, None], [5, None]]" -#: ../../faq/programming.rst:1305 msgid "" "The reason is that replicating a list with ``*`` doesn't create copies, it " "only creates references to the existing objects. The ``*3`` creates a list " "containing 3 references to the same list of length two. Changes to one row " "will show in all rows, which is almost certainly not what you want." msgstr "" -"これは、``*`` を使ったリストの複製がコピーを作らず、存在するオブジェクトへの" -"参照を作るだけだからです。この ``*3`` は長さ 2 の同じリストへの参照を含むリス" -"トを作ります。一つの列に対する変更はすべての列に現れますが、これが望んだ結果" -"であることはまずないでしょう。" +"``*`` によるリストの繰り返しは、要素のコピーではなく既存のオブジェクトへの参" +"照を作るためです。\n" +"``*3`` は、長さ 2 の同じリストへの参照を 3 つ含むリストを作ります。\n" +"1 つの行を変更するとすべての行に反映されますが、これが意図した結果であること" +"はまずないでしょう。" #: ../../faq/programming.rst:1310 msgid "" @@ -2662,12 +2696,14 @@ msgstr "" "おすすめの方法は、最初に望んだ長さのリストを作り、それから新しく作ったリスト" "でそれぞれの要素を埋めていくことです::" -#: ../../faq/programming.rst:1313 msgid "" "A = [None] * 3\n" "for i in range(3):\n" " A[i] = [None] * 2" msgstr "" +"A = [None] * 3\n" +"for i in range(3):\n" +" A[i] = [None] * 2" #: ../../faq/programming.rst:1317 msgid "" @@ -2677,11 +2713,12 @@ msgstr "" "これは長さ 2 の異なるリスト 3 つを含むリストを生成します。リスト内包表記も使" "えます::" -#: ../../faq/programming.rst:1320 msgid "" "w, h = 2, 3\n" "A = [[None] * w for i in range(h)]" msgstr "" +"w, h = 2, 3\n" +"A = [[None] * w for i in range(h)]" #: ../../faq/programming.rst:1323 msgid "" @@ -2695,18 +2732,21 @@ msgstr "" msgid "How do I apply a method or function to a sequence of objects?" msgstr "オブジェクトのシーケンスにメソッドや関数を適用するにはどうしますか?" -#: ../../faq/programming.rst:1330 msgid "" "To call a method or function and accumulate the return values in a list, a :" "term:`list comprehension` is an elegant solution::" msgstr "" +"メソッドや関数を呼び出し、その戻り値をリストにまとめるには、:term:`list " +"comprehension` を使うと簡潔に書けます。 ::" -#: ../../faq/programming.rst:1333 msgid "" "result = [obj.method() for obj in mylist]\n" "\n" "result = [function(obj) for obj in mylist]" msgstr "" +"result = [obj.method() for obj in mylist]\n" +"\n" +"result = [function(obj) for obj in mylist]" #: ../../faq/programming.rst:1337 msgid "" @@ -2716,7 +2756,6 @@ msgstr "" "戻り値を保存せずにメソッドや関数を実行するだけなら、ただの :keyword:`for` " "ループで十分です::" -#: ../../faq/programming.rst:1340 msgid "" "for obj in mylist:\n" " obj.method()\n" @@ -2724,6 +2763,11 @@ msgid "" "for obj in mylist:\n" " function(obj)" msgstr "" +"for obj in mylist:\n" +" obj.method()\n" +"\n" +"for obj in mylist:\n" +" function(obj)" #: ../../faq/programming.rst:1350 msgid "" @@ -2752,7 +2796,6 @@ msgstr "" msgid "If you wrote::" msgstr "次のように書いたとします::" -#: ../../faq/programming.rst:1362 msgid "" ">>> a_tuple = (1, 2)\n" ">>> a_tuple[0] += 1\n" @@ -2760,8 +2803,12 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> a_tuple = (1, 2)\n" +">>> a_tuple[0] += 1\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" -#: ../../faq/programming.rst:1368 msgid "" "The reason for the exception should be immediately clear: ``1`` is added to " "the object ``a_tuple[0]`` points to (``1``), producing the result object, " @@ -2769,10 +2816,12 @@ msgid "" "to element ``0`` of the tuple, we get an error because we can't change what " "an element of a tuple points to." msgstr "" -"例外が送出された理由は明らかです: ``1`` が (``1``) を指すオブジェクト " -"``a_tuple[0]`` に加えられ、結果のオブジェクト ``2`` が生成されますが、計算結" -"果 ``2`` をタプルの第 ``0`` 要素に代入しようとしたときに、エラーが発生しま" -"す。なぜならば、タプルの要素が何を指すかは変えられないからです。" +"例外の理由は明らかでしょう。\n" +"``a_tuple[0]`` が指すオブジェクト (``1``) に ``1`` を加えると、結果のオブジェ" +"クト ``2`` が作られます。\n" +"しかし、計算結果の ``2`` をタプルのインデックス ``0`` の要素に代入しようとす" +"るとエラーになります。\n" +"タプルの要素が指すオブジェクトは変更できないためです。" #: ../../faq/programming.rst:1374 msgid "" @@ -2780,7 +2829,6 @@ msgid "" "approximately this::" msgstr "このような裏事情の元、累算代入文はだいたい次のようなことをしています::" -#: ../../faq/programming.rst:1377 msgid "" ">>> result = a_tuple[0] + 1\n" ">>> a_tuple[0] = result\n" @@ -2788,6 +2836,11 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> result = a_tuple[0] + 1\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" #: ../../faq/programming.rst:1383 msgid "" @@ -2799,7 +2852,6 @@ msgstr "タプルは不変なので、例外を生み出しているのは操作 msgid "When you write something like::" msgstr "次のように書いたとします::" -#: ../../faq/programming.rst:1388 msgid "" ">>> a_tuple = (['foo'], 'bar')\n" ">>> a_tuple[0] += ['item']\n" @@ -2807,6 +2859,11 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> a_tuple = (['foo'], 'bar')\n" +">>> a_tuple[0] += ['item']\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" #: ../../faq/programming.rst:1394 msgid "" @@ -2816,13 +2873,13 @@ msgstr "" "この例外にはちょっと驚きますが、もっと驚くべきことは、エラーがあったとしても" "追記はきちんと動いている、という事実です::" -#: ../../faq/programming.rst:1397 msgid "" ">>> a_tuple[0]\n" "['foo', 'item']" msgstr "" +">>> a_tuple[0]\n" +"['foo', 'item']" -#: ../../faq/programming.rst:1400 msgid "" "To see why this happens, you need to know that (a) if an object implements " "an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` " @@ -2832,24 +2889,35 @@ msgid "" "That's why we say that for lists, ``+=`` is a \"shorthand\" for :meth:`list." "extend`::" msgstr "" +"この理由を理解するには、次の 2 点を知る必要があります。\n" +"(a) オブジェクトに :meth:`~object.__iadd__` 特殊メソッドが実装されていると、" +"``+=`` による累算代入の実行時にそのメソッドが呼ばれ、戻り値が代入に使われま" +"す。\n" +"(b) リストの :meth:`!__iadd__` は、そのリストの :meth:`~sequence.extend` を呼" +"び出してからリストを返すのと同じです。\n" +"このため、リストの ``+=`` は :meth:`list.extend` の「短縮形」といえます。 ::" -#: ../../faq/programming.rst:1408 msgid "" ">>> a_list = []\n" ">>> a_list += [1]\n" ">>> a_list\n" "[1]" msgstr "" +">>> a_list = []\n" +">>> a_list += [1]\n" +">>> a_list\n" +"[1]" #: ../../faq/programming.rst:1413 msgid "This is equivalent to::" msgstr "これは次と等価です::" -#: ../../faq/programming.rst:1415 msgid "" ">>> result = a_list.__iadd__([1])\n" ">>> a_list = result" msgstr "" +">>> result = a_list.__iadd__([1])\n" +">>> a_list = result" #: ../../faq/programming.rst:1418 msgid "" @@ -2867,7 +2935,6 @@ msgstr "" msgid "Thus, in our tuple example what is happening is equivalent to::" msgstr "従って、今のタプルの例では、次のと同じことが起きています::" -#: ../../faq/programming.rst:1425 msgid "" ">>> result = a_tuple[0].__iadd__(['item'])\n" ">>> a_tuple[0] = result\n" @@ -2875,6 +2942,11 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> result = a_tuple[0].__iadd__(['item'])\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" #: ../../faq/programming.rst:1431 msgid "" @@ -2905,21 +2977,23 @@ msgstr "" "ます。Python では、 :meth:`list.sort` メソッドに ``key`` 引数を使ってくださ" "い::" -#: ../../faq/programming.rst:1443 msgid "" "Isorted = L[:]\n" "Isorted.sort(key=lambda s: int(s[10:15]))" msgstr "" +"Isorted = L[:]\n" +"Isorted.sort(key=lambda s: int(s[10:15]))" #: ../../faq/programming.rst:1448 msgid "How can I sort one list by values from another list?" msgstr "リストを別のリストの値によってソートするにはどうしますか?" -#: ../../faq/programming.rst:1450 msgid "" "Merge them into an iterator of tuples, sort the resulting list, and then " "pick out the element you want." msgstr "" +"2 つのリストをタプルのイテレータにまとめ、その結果から得られるリストをソート" +"して、必要な要素を取り出してください。" #: ../../faq/programming.rst:1465 msgid "Objects" @@ -2929,17 +3003,17 @@ msgstr "オブジェクト" msgid "What is a class?" msgstr "クラスとは何ですか?" -#: ../../faq/programming.rst:1470 msgid "" "A class is the particular object type created by executing a class " "statement. Class objects are used as templates to create instance objects, " "which embody both the data (attributes) and code (methods) specific to a " "datatype." msgstr "" -"クラスは、class 文の実行で生成される特殊なオブジェクトです。クラスオブジェク" -"トはインスタンスオブジェクトを生成するためのテンプレートとして使われ、ある" -"データ型に特有のデータ (attribute/属性) とコード (メソッド) の両方を内蔵して" -"います。" +"クラスは class 文の実行によって作られる、特定の種類のオブジェクトです。\n" +"クラスオブジェクトはインスタンスオブジェクトを作るためのテンプレートとして使" +"われます。\n" +"インスタンスオブジェクトは、そのデータ型に固有のデータ (属性) とコード (メ" +"ソッド) の両方を備えています。" #: ../../faq/programming.rst:1474 msgid "" @@ -2970,12 +3044,14 @@ msgstr "" "メソッドは、オブジェクト ``x`` が持つ関数で、通常 ``x.name(arguments...)`` と" "して呼び出されるものです。メソッドはクラス定義の中で関数として定義されます::" -#: ../../faq/programming.rst:1489 msgid "" "class C:\n" " def meth(self, arg):\n" " return arg * 2 + self.attribute" msgstr "" +"class C:\n" +" def meth(self, arg):\n" +" return arg * 2 + self.attribute" #: ../../faq/programming.rst:1495 msgid "What is self?" @@ -3005,7 +3081,6 @@ msgstr "" "あるオブジェクトが、与えられたクラスやそのサブクラスのインスタンスであるかを" "調べるにはどうしますか?" -#: ../../faq/programming.rst:1508 msgid "" "Use the built-in function :func:`isinstance(obj, cls) `. You " "can check if an object is an instance of any of a number of classes by " @@ -3014,8 +3089,13 @@ msgid "" "Python's built-in types, for example, ``isinstance(obj, str)`` or " "``isinstance(obj, (int, float, complex))``." msgstr "" +"組み込み関数 :func:`isinstance(obj, cls) ` を使ってください。\n" +"``isinstance(obj, (class1, class2, ...))`` のように、クラスを 1 つ渡す代わり" +"にタプルを渡すと、複数のクラスのいずれかのインスタンスであるかを調べられま" +"す。\n" +"また、``isinstance(obj, str)`` や ``isinstance(obj, (int, float, complex))`` " +"のように、Python の組み込み型のインスタンスであるかも調べられます。" -#: ../../faq/programming.rst:1515 msgid "" "Note that :func:`isinstance` also checks for virtual inheritance from an :" "term:`abstract base class`. So, the test will return ``True`` for a " @@ -3023,8 +3103,13 @@ msgid "" "To test for \"true inheritance\", scan the :term:`method resolution order` " "(MRO) of the class:" msgstr "" +":func:`isinstance` は :term:`abstract base class` の仮想的な継承も調べま" +"す。\n" +"そのため、抽象基底クラスに登録されたクラスであれば、直接または間接的に継承し" +"ていなくても ``True`` を返します。\n" +"「実際の継承」を調べるには、そのクラスの :term:`method resolution order` " +"(MRO) を確認します。" -#: ../../faq/programming.rst:1521 msgid "" "from collections.abc import Mapping\n" "\n" @@ -3036,8 +3121,16 @@ msgid "" "\n" "Mapping.register(P)" msgstr "" +"from collections.abc import Mapping\n" +"\n" +"class P:\n" +" pass\n" +"\n" +"class C(P):\n" +" pass\n" +"\n" +"Mapping.register(P)" -#: ../../faq/programming.rst:1533 msgid "" ">>> c = C()\n" ">>> isinstance(c, C) # direct\n" @@ -3055,8 +3148,22 @@ msgid "" ">>> Mapping in type(c).__mro__\n" "False" msgstr "" +">>> c = C()\n" +">>> isinstance(c, C) # 直接\n" +"True\n" +">>> isinstance(c, P) # 間接\n" +"True\n" +">>> isinstance(c, Mapping) # 仮想\n" +"True\n" +"\n" +"# 実際の継承関係\n" +">>> type(c).__mro__\n" +"(, , )\n" +"\n" +"# 「実際の継承」を調べる\n" +">>> Mapping in type(c).__mro__\n" +"False" -#: ../../faq/programming.rst:1551 msgid "" "Note that most programs do not use :func:`isinstance` on user-defined " "classes very often. If you are developing the classes yourself, a more " @@ -3065,13 +3172,13 @@ msgid "" "and doing a different thing based on what class it is. For example, if you " "have a function that does something::" msgstr "" -"なお、大部分のプログラムでは、 :func:`isinstance` をユーザー定義のクラスに何" -"度も使うべきではありません。クラスを自分で開発するときに、適切なオブジェクト" -"指向スタイルは、特定の振る舞いをカプセル化するクラスのメソッドを定義するもの" -"であって、オブジェクトのクラスを調べてそのクラスに応じて違うことをするもので" -"はありません。例えば、何かをする関数があったとして::" +"なお、ほとんどのプログラムでは、ユーザー定義のクラスに対して :func:" +"`isinstance` を頻繁には使いません。\n" +"自分でクラスを開発するなら、オブジェクトのクラスを調べて処理を分岐させるより" +"も、各クラスに特定の振る舞いをカプセル化するメソッドを定義するほうが、オブ" +"ジェクト指向に適した書き方です。\n" +"例えば、次のような関数があるとします。 ::" -#: ../../faq/programming.rst:1558 msgid "" "def search(obj):\n" " if isinstance(obj, Mailbox):\n" @@ -3080,6 +3187,12 @@ msgid "" " ... # code to search a document\n" " elif ..." msgstr "" +"def search(obj):\n" +" if isinstance(obj, Mailbox):\n" +" ... # メールボックスを検索するコード\n" +" elif isinstance(obj, Document):\n" +" ... # 文書を検索するコード\n" +" elif ..." #: ../../faq/programming.rst:1565 msgid "" @@ -3089,7 +3202,6 @@ msgstr "" "よりよいアプローチは、``search()`` メソッドをすべてのクラスに定義して、それを" "ただ呼び出すことです::" -#: ../../faq/programming.rst:1568 msgid "" "class Mailbox:\n" " def search(self):\n" @@ -3101,12 +3213,20 @@ msgid "" "\n" "obj.search()" msgstr "" +"class Mailbox:\n" +" def search(self):\n" +" ... # メールボックスを検索するコード\n" +"\n" +"class Document:\n" +" def search(self):\n" +" ... # 文書を検索するコード\n" +"\n" +"obj.search()" #: ../../faq/programming.rst:1580 msgid "What is delegation?" msgstr "委譲とは何ですか?" -#: ../../faq/programming.rst:1582 msgid "" "Delegation is an object-oriented technique (also called a design pattern). " "Let's say you have an object ``x`` and want to change the behaviour of just " @@ -3114,17 +3234,21 @@ msgid "" "implementation of the method you're interested in changing and delegates all " "other methods to the corresponding method of ``x``." msgstr "" +"委譲はオブジェクト指向の技法 (デザインパターンとも呼ばれます) の 1 つです。\n" +"オブジェクト ``x`` があり、そのメソッドのうち 1 つだけ振る舞いを変えたいとし" +"ます。\n" +"そのメソッドの新しい実装を持ち、ほかのすべてのメソッドの処理を ``x`` の対応す" +"るメソッドに委ねるクラスを作れます。" -#: ../../faq/programming.rst:1588 msgid "" "Python programmers can easily implement delegation. For example, the " "following class implements a class that behaves like a file but converts all " "written data to uppercase::" msgstr "" -"Python プログラマは簡単に委譲を実装できます。例えば、以下のクラスは、ファイル" -"のように振る舞いながらすべての文字を大文字に変換するクラスを実装します::" +"Python では委譲を簡単に実装できます。\n" +"例えば、次のクラスはファイルのように振る舞いますが、書き込まれるデータをすべ" +"て大文字に変換します。 ::" -#: ../../faq/programming.rst:1592 msgid "" "class UpperOut:\n" "\n" @@ -3137,6 +3261,16 @@ msgid "" " def __getattr__(self, name):\n" " return getattr(self._outfile, name)" msgstr "" +"class UpperOut:\n" +"\n" +" def __init__(self, outfile):\n" +" self._outfile = outfile\n" +"\n" +" def write(self, s):\n" +" self._outfile.write(s.upper())\n" +"\n" +" def __getattr__(self, name):\n" +" return getattr(self._outfile, name)" #: ../../faq/programming.rst:1603 msgid "" @@ -3154,7 +3288,6 @@ msgstr "" "されます。属性の制御の詳細は :ref:`言語リファレンス ` を参" "照してください。" -#: ../../faq/programming.rst:1610 msgid "" "Note that for more general cases delegation can get trickier. When " "attributes must be set as well as retrieved, the class must define a :meth:" @@ -3162,12 +3295,11 @@ msgid "" "implementation of :meth:`!__setattr__` is roughly equivalent to the " "following::" msgstr "" -"なお、一般的に委譲はトリッキーになりがちです。属性が設定される時には読み出さ" -"れる時と同様に、そのクラスに :meth:`~object.__setattr__` メソッドを定義する必" -"要があり、それには細心の注意が必要です。 :meth:`!__setattr__` の基本的な実装" -"はおおよそ以下のようになります::" +"より一般的な場合には、委譲が複雑になることがあります。\n" +"属性の取得だけでなく設定も扱うには、クラスに :meth:`~object.__setattr__` メ" +"ソッドも定義する必要があり、その実装には注意が必要です。\n" +":meth:`!__setattr__` の基本的な実装は、おおよそ次と同じです。 ::" -#: ../../faq/programming.rst:1615 msgid "" "class X:\n" " ...\n" @@ -3175,26 +3307,36 @@ msgid "" " self.__dict__[name] = value\n" " ..." msgstr "" +"class X:\n" +" ...\n" +" def __setattr__(self, name, value):\n" +" self.__dict__[name] = value\n" +" ..." -#: ../../faq/programming.rst:1621 msgid "" "Many :meth:`~object.__setattr__` implementations call :meth:`!object." "__setattr__` to set an attribute on self without causing infinite recursion::" msgstr "" +":meth:`~object.__setattr__` の多くの実装では、無限再帰を起こさずに ``self`` " +"の属性を設定するため、:meth:`!object.__setattr__` を呼び出します。 ::" -#: ../../faq/programming.rst:1624 msgid "" "class X:\n" " def __setattr__(self, name, value):\n" " # Custom logic here...\n" " object.__setattr__(self, name, value)" msgstr "" +"class X:\n" +" def __setattr__(self, name, value):\n" +" # ここに独自の処理を書く...\n" +" object.__setattr__(self, name, value)" -#: ../../faq/programming.rst:1629 msgid "" "Alternatively, it is possible to set attributes by inserting entries into :" "attr:`self.__dict__ ` directly." msgstr "" +":attr:`self.__dict__ ` に直接エントリーを追加して属性を設定" +"することもできます。" #: ../../faq/programming.rst:1634 msgid "" @@ -3208,14 +3350,15 @@ msgstr "" msgid "Use the built-in :func:`super` function::" msgstr "組み込みの :func:`super` 関数を使ってください::" -#: ../../faq/programming.rst:1638 msgid "" "class Derived(Base):\n" " def meth(self):\n" " super().meth() # calls Base.meth" msgstr "" +"class Derived(Base):\n" +" def meth(self):\n" +" super().meth() # Base.meth を呼び出す" -#: ../../faq/programming.rst:1642 msgid "" "In the example, :func:`super` will automatically determine the instance from " "which it was called (the ``self`` value), look up the :term:`method " @@ -3224,21 +3367,22 @@ msgid "" msgstr "" "この例では、 :func:`super` は呼ばれたインスタンス (``self`` の値) を自動判断" "し、 ``type(self).__mro__`` で :term:`method resolution order` (MRO メソッド" -"解決順) を検索し、そしてMRO内で ``Derived`` の次行を返します: ``Base`` 。" +"解決順) を検索し、MRO で ``Derived`` の次にある ``Base`` を返します。" -#: ../../faq/programming.rst:1649 msgid "How can I organize my code to make it easier to change the base class?" -msgstr "基底クラスの名前を変えやすいコードを書くにはどうしますか?" +msgstr "基底クラスを変更しやすいようにコードを構成するにはどうしますか?" -#: ../../faq/programming.rst:1651 msgid "" "You could assign the base class to an alias and derive from the alias. Then " "all you have to change is the value assigned to the alias. Incidentally, " "this trick is also handy if you want to decide dynamically (such as " "depending on availability of resources) which base class to use. Example::" msgstr "" +"基底クラスを別名に代入し、その別名を使って継承できます。\n" +"こうすれば、別名に代入する値だけを変更すれば済みます。\n" +"この方法は、例えばリソースが利用できるかどうかに応じて、使う基底クラスを動的" +"に決めたい場合にも便利です。 ::" -#: ../../faq/programming.rst:1656 msgid "" "class Base:\n" " ...\n" @@ -3248,6 +3392,13 @@ msgid "" "class Derived(BaseAlias):\n" " ..." msgstr "" +"class Base:\n" +" ...\n" +"\n" +"BaseAlias = Base\n" +"\n" +"class Derived(BaseAlias):\n" +" ..." #: ../../faq/programming.rst:1666 msgid "How do I create static class data and static class methods?" @@ -3269,7 +3420,6 @@ msgstr "" "静的なデータを作るには、単純にクラス属性を定義してください。その属性に新しい" "値を代入するには、代入するクラス名を明示する必要があります::" -#: ../../faq/programming.rst:1674 msgid "" "class C:\n" " count = 0 # number of times C.__init__ called\n" @@ -3280,6 +3430,14 @@ msgid "" " def getcount(self):\n" " return C.count # or return self.count" msgstr "" +"class C:\n" +" count = 0 # C.__init__ が呼び出された回数\n" +"\n" +" def __init__(self):\n" +" C.count = C.count + 1\n" +"\n" +" def getcount(self):\n" +" return C.count # または return self.count" #: ../../faq/programming.rst:1683 msgid "" @@ -3303,15 +3461,13 @@ msgstr "" "静的なデータの再束縛には、メソッド内であるか否かにかかわらず、いつもクラスを" "指定しなければなりません::" -#: ../../faq/programming.rst:1692 msgid "C.count = 314" -msgstr "" +msgstr "C.count = 314" #: ../../faq/programming.rst:1694 msgid "Static methods are possible::" msgstr "静的メソッドが使えます::" -#: ../../faq/programming.rst:1696 msgid "" "class C:\n" " @staticmethod\n" @@ -3319,6 +3475,11 @@ msgid "" " # No 'self' parameter!\n" " ..." msgstr "" +"class C:\n" +" @staticmethod\n" +" def static(arg1, arg2, arg3):\n" +" # 'self' 仮引数はない!\n" +" ..." #: ../../faq/programming.rst:1702 msgid "" @@ -3328,20 +3489,19 @@ msgstr "" "しかし、静的メソッドの効果を得るもっと簡単な方法は、単にモジュールレベル関数" "を使うことです::" -#: ../../faq/programming.rst:1705 msgid "" "def getcount():\n" " return C.count" msgstr "" +"def getcount():\n" +" return C.count" -#: ../../faq/programming.rst:1708 msgid "" "If your code is structured so as to define one class (or tightly related " "class hierarchy) per module, this supplies the desired encapsulation." msgstr "" -"モジュールあたりに一つのクラスを定義するように (あるいはクラス組織を厳密に関" -"連させるように) コードが構成されているなら、これで必要なカプセル化ができま" -"す。" +"モジュールごとに 1 つのクラス、または密接に関連するクラス階層を定義する構成な" +"ら、この方法で必要なカプセル化を実現できます。" #: ../../faq/programming.rst:1713 msgid "How can I overload constructors (or methods) in Python?" @@ -3349,25 +3509,26 @@ msgstr "" "Python でコンストラクタ(やメソッド)をオーバーロードするにはどうしたらいいです" "か?" -#: ../../faq/programming.rst:1715 msgid "" "This answer actually applies to all methods, but the question usually comes " "up first in the context of constructors." msgstr "" -"この質問の答えはすべてのメソッドについて言えることですが、この質問はだいたい" -"以下の構造の文脈から出てきます。" +"この回答は実際にはすべてのメソッドに当てはまりますが、通常、この疑問が最初に" +"生じるのはコンストラクタについてです。" -#: ../../faq/programming.rst:1718 msgid "In C++ you'd write:" -msgstr "" +msgstr "C++ では次のように書くでしょう。" -#: ../../faq/programming.rst:1720 msgid "" "class C {\n" " C() { cout << \"No arguments\\n\"; }\n" " C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" "}" msgstr "" +"class C {\n" +" C() { cout << \"No arguments\\n\"; }\n" +" C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" +"}" #: ../../faq/programming.rst:1727 msgid "" @@ -3377,7 +3538,6 @@ msgstr "" "Python では、一つのコンストラクタでデフォルトの引数を使ってすべての場合に対応" "するように書かなければなりません。例えば::" -#: ../../faq/programming.rst:1730 msgid "" "class C:\n" " def __init__(self, i=None):\n" @@ -3386,28 +3546,33 @@ msgid "" " else:\n" " print(\"Argument is\", i)" msgstr "" +"class C:\n" +" def __init__(self, i=None):\n" +" if i is None:\n" +" print(\"No arguments\")\n" +" else:\n" +" print(\"Argument is\", i)" #: ../../faq/programming.rst:1737 msgid "This is not entirely equivalent, but close enough in practice." msgstr "これで完全に等価とは言えませんが、実用上は十分に近いです。" -#: ../../faq/programming.rst:1739 msgid "You could also try a variable-length argument list, for example::" -msgstr "" +msgstr "可変長の引数リストを使う方法もあります。 ::" -#: ../../faq/programming.rst:1741 msgid "" "def __init__(self, *args):\n" " ..." msgstr "" +"def __init__(self, *args):\n" +" ..." #: ../../faq/programming.rst:1744 msgid "The same approach works for all method definitions." msgstr "これと同じやり方がすべてのメソッド定義で使えます。" -#: ../../faq/programming.rst:1748 msgid "I try to use __spam and I get an error about _SomeClassName__spam." -msgstr "__spam を使おうとしたら _SomeClassName__spam からエラーがでました。" +msgstr "__spam を使おうとすると、_SomeClassName__spam に関するエラーが出ます。" #: ../../faq/programming.rst:1750 msgid "" @@ -3424,13 +3589,13 @@ msgstr "" "子は、``classname`` が先頭のアンダースコアをすべて削除した現在のクラス名とす" "れば、``_classname__spam`` のように文字上で置換えられます。" -#: ../../faq/programming.rst:1756 msgid "" "The identifier can be used unchanged within the class, but to access it " "outside the class, the mangled name must be used:" msgstr "" +"クラス内では識別子をそのまま使えますが、クラス外からアクセスするにはマングル" +"化された名前を使う必要があります。" -#: ../../faq/programming.rst:1759 msgid "" "class A:\n" " def __one(self):\n" @@ -3444,13 +3609,26 @@ msgid "" "\n" "four = 4 * A()._A__one()" msgstr "" +"class A:\n" +" def __one(self):\n" +" return 1\n" +" def two(self):\n" +" return 2 * self.__one()\n" +"\n" +"class B(A):\n" +" def three(self):\n" +" return 3 * self._A__one()\n" +"\n" +"four = 4 * A()._A__one()" -#: ../../faq/programming.rst:1773 msgid "" "In particular, this does not guarantee privacy since an outside user can " "still deliberately access the private attribute; many Python programmers " "never bother to use private variable names at all." msgstr "" +"特に、この仕組みはプライバシーを保証するものではありません。\n" +"外部の利用者が意図的にプライベート属性にアクセスすることは可能です。\n" +"Python プログラマの多くは、プライベートな変数名をあえて使うことはしません。" #: ../../faq/programming.rst:1779 msgid "" @@ -3480,7 +3658,6 @@ msgstr "" "-- これは単純にオブジェクトの参照カウントを減らすもので、カウントがゼロになっ" "たときに :meth:`!__del__` が呼び出されます。" -#: ../../faq/programming.rst:1792 msgid "" "If your data structures contain circular links (for example, a tree where " "each child has a parent reference and each parent has a list of children) " @@ -3493,8 +3670,19 @@ msgid "" "You can run :func:`gc.collect` to force a collection, but there *are* " "pathological cases where objects will never be collected." msgstr "" +"データ構造に循環参照があると、参照カウントはゼロに戻りません。\n" +"例えば、各子が親への参照を持ち、各親が子のリストを持つツリーがこれに当たりま" +"す。\n" +"Python はこうした循環を検出するアルゴリズムを時折実行しますが、データ構造への" +"最後の参照がなくなってからガベージコレクタが動くまでには、時間がかかる場合が" +"あります。\n" +"そのため、:meth:`!__del__` メソッドが都合の悪い、予測できないタイミングで呼ば" +"れることがあります。\n" +"これは問題を再現しようとするときに不便です。\n" +"さらに、オブジェクトの :meth:`!__del__` メソッドの実行順序は任意です。\n" +":func:`gc.collect` を実行して回収を強制できますが、オブジェクトが決して回収さ" +"れない特殊な場合も *あります*。" -#: ../../faq/programming.rst:1803 msgid "" "Despite the cycle collector, it's still a good idea to define an explicit " "``close()`` method on objects to be called whenever you're done with them. " @@ -3503,13 +3691,12 @@ msgid "" "``close()`` and ``close()`` should make sure that it can be called more than " "once for the same object." msgstr "" -"循環参照コレクタがあるとはいえ、オブジェクトに ``close()`` メソッドを明示的に" -"定義し、使い終わったらいつでも呼び出せるようにするのはいいことです。\n" -"``close()`` メソッドを使うと、サブオブジェクトを参照している属性を取り除けま" -"す。\n" -":meth:`!__del__` を直接呼び出さないでください -- :meth:`!__del__` は " -"``close()`` を呼び出すでしょうし、 ``close()`` なら同じオブジェクトに対して複" -"数回呼ばれてもいいことが保証されているでしょう。" +"循環参照を回収する仕組みがあっても、オブジェクトには明示的な ``close()`` メ" +"ソッドを定義し、使い終わったときに呼び出すようにするとよいでしょう。\n" +"``close()`` メソッドでは、下位のオブジェクトを参照する属性を削除できます。\n" +":meth:`!__del__` を直接呼び出さないでください。\n" +":meth:`!__del__` から ``close()`` を呼び出し、``close()`` は同じオブジェクト" +"に対して複数回呼び出せるように実装してください。" #: ../../faq/programming.rst:1810 msgid "" @@ -3562,16 +3749,16 @@ msgstr "" "はメモリの同じ場所にメモリ領域を確保されていることが、しばしば起きます。この" "現象を次の例で示しましょう:" -#: ../../faq/programming.rst:1849 msgid "" "The two ids belong to different integer objects that are created before, and " "deleted immediately after execution of the ``id()`` call. To be sure that " "objects whose id you want to examine are still alive, create another " "reference to the object:" msgstr "" -"2 つの同じ値を持つ id は ``id()`` の実行の前に作られてすぐさま削除された異な" -"る整数オブジェクトによるものです。id を調べたいオブジェクトがまだ生きてること" -"を保証したいなら、オブジェクトへの別の参照を作ってください:" +"この 2 つの id は、それぞれ ``id()`` の呼び出し前に作られ、呼び出しの実行直後" +"に削除された、異なる整数オブジェクトのものです。\n" +"id を調べるオブジェクトがまだ生存していることを保証するには、そのオブジェクト" +"への別の参照を作ってください。" #: ../../faq/programming.rst:1864 msgid "When can I rely on identity tests with the *is* operator?" @@ -3607,25 +3794,30 @@ msgstr "" "保証されている場合 *のみ* です。 一般的に、同一性が保証される状況は3つありま" "す:" -#: ../../faq/programming.rst:1878 msgid "" "Assignments create new names but do not change object identity. After the " "assignment ``new = old``, it is guaranteed that ``new is old``." msgstr "" +"代入は新しい名前を作りますが、オブジェクトの同一性は変えません。\n" +"``new = old`` と代入した後は、``new is old`` が保証されます。" -#: ../../faq/programming.rst:1881 msgid "" "Putting an object in a container that stores object references does not " "change object identity. After the list assignment ``s[0] = x``, it is " "guaranteed that ``s[0] is x``." msgstr "" +"オブジェクトへの参照を格納するコンテナにオブジェクトを入れても、その同一性は" +"変わりません。\n" +"リストへの代入 ``s[0] = x`` の後は、``s[0] is x`` が保証されます。" -#: ../../faq/programming.rst:1885 msgid "" "If an object is a singleton, it means that only one instance of that object " "can exist. After the assignments ``a = None`` and ``b = None``, it is " "guaranteed that ``a is b`` because ``None`` is a singleton." msgstr "" +"シングルトンのオブジェクトは、インスタンスが 1 つしか存在できません。\n" +"``None`` はシングルトンなので、``a = None`` と ``b = None`` を代入した後は、" +"``a is b`` が保証されます。" #: ../../faq/programming.rst:1889 msgid "" @@ -3638,7 +3830,6 @@ msgstr "" "特に、シングルトンであることが保証されていない :class:`int` や :class:`str` " "などの定数をチェックするために同一性テストを使わないでください。" -#: ../../faq/programming.rst:1894 msgid "" ">>> a = 10_000_000\n" ">>> b = 5_000_000\n" @@ -3652,19 +3843,33 @@ msgid "" ">>> a is c\n" "False" msgstr "" +">>> a = 10_000_000\n" +">>> b = 5_000_000\n" +">>> c = b + 5_000_000\n" +">>> a is c\n" +"False\n" +"\n" +">>> a = 'Python'\n" +">>> b = 'Py'\n" +">>> c = b + 'thon'\n" +">>> a is c\n" +"False" #: ../../faq/programming.rst:1906 msgid "Likewise, new instances of mutable containers are never identical::" msgstr "" "同様に、ミュータブルなコンテナの新しいインスタンスは同一ではありません::" -#: ../../faq/programming.rst:1908 msgid "" ">>> a = []\n" ">>> b = []\n" ">>> a is b\n" "False" msgstr "" +">>> a = []\n" +">>> b = []\n" +">>> a is b\n" +"False" #: ../../faq/programming.rst:1913 msgid "" @@ -3674,14 +3879,15 @@ msgstr "" "標準ライブラリのコードには、同一性テストを正しく使うための一般的なパターンが" "あります:" -#: ../../faq/programming.rst:1916 msgid "" "As recommended by :pep:`8`, an identity test is the preferred way to check " "for ``None``. This reads like plain English in code and avoids confusion " "with other objects that may have boolean values that evaluate to false." msgstr "" -":pep:`8` で推奨されているとおり、同一性テストは ``None`` をチェックする際に望" -"ましい方法です。これはコードの中で自然な英語に読むことができ、また" +":pep:`8` が推奨するとおり、``None`` かどうかを調べるには同一性テストを使うの" +"が望ましい方法です。\n" +"コードを自然な英語として読めるうえ、真偽値が偽と評価されるほかのオブジェクト" +"との混同も避けられます。" #: ../../faq/programming.rst:1920 msgid "" @@ -3695,7 +3901,6 @@ msgstr "" "オブジェクト( singleton sentinel object )を作ることで対策できます。例え" "ば、 :meth:`dict.pop` のように振る舞うメソッドを実装する方法を示します:" -#: ../../faq/programming.rst:1925 msgid "" "_sentinel = sentinel('_sentinel')\n" "\n" @@ -3708,6 +3913,16 @@ msgid "" " raise KeyError(key)\n" " return default" msgstr "" +"_sentinel = sentinel('_sentinel')\n" +"\n" +"def pop(self, key, default=_sentinel):\n" +" if key in self:\n" +" value = self[key]\n" +" del self[key]\n" +" return value\n" +" if default is _sentinel:\n" +" raise KeyError(key)\n" +" return default" #: ../../faq/programming.rst:1938 msgid "" @@ -3719,14 +3934,13 @@ msgstr "" "ます。これは、 ``float('NaN')`` のような自分自身と等しくないオブジェクトに" "よってコードが混乱するのを防ぎます。" -#: ../../faq/programming.rst:1942 msgid "" "For example, here is the implementation of :meth:`!collections.abc.Sequence." "__contains__`::" msgstr "" -"例えば、これは :meth:`!collections.abc.Sequence.__contains__`: の実装です:" +"例えば、:meth:`!collections.abc.Sequence.__contains__` の実装は次のとおりで" +"す。 ::" -#: ../../faq/programming.rst:1945 msgid "" "def __contains__(self, value):\n" " for v in self:\n" @@ -3734,6 +3948,11 @@ msgid "" " return True\n" " return False" msgstr "" +"def __contains__(self, value):\n" +" for v in self:\n" +" if v is value or v == value:\n" +" return True\n" +" return False" #: ../../faq/programming.rst:1953 msgid "" @@ -3742,17 +3961,16 @@ msgstr "" "どうすればサブクラスはイミュータブルなインスタンスに格納されたデータを制御で" "きますか?" -#: ../../faq/programming.rst:1955 msgid "" "When subclassing an immutable type, override the :meth:`~object.__new__` " "method instead of the :meth:`~object.__init__` method. The latter only runs " "*after* an instance is created, which is too late to alter data in an " "immutable instance." msgstr "" -"イミュータブル型をサブクラス化する場合、 :meth:`~object.__init__` ではなく :" -"meth:`~object.__new__` メソッドを継承します。 前者はインスタンスが生成され" -"た *後* に動くため、イミュータブルなインスタンスのデータを変えるには遅すぎま" -"す。" +"イミュータブルな型のサブクラスを作る場合は、:meth:`~object.__init__` ではな" +"く :meth:`~object.__new__` メソッドをオーバーライドしてください。\n" +"``__init__()`` が実行されるのはインスタンスが作られた *後* なので、イミュータ" +"ブルなインスタンスのデータを変更するには遅すぎます。" #: ../../faq/programming.rst:1960 msgid "" @@ -3761,7 +3979,6 @@ msgid "" msgstr "" "これらのイミュータブルクラスはすべて、親クラスと異なるシグネチャを持ちます:" -#: ../../faq/programming.rst:1963 msgid "" "import datetime as dt\n" "\n" @@ -3784,12 +4001,31 @@ msgid "" " s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" " return super().__new__(cls, s)" msgstr "" +"import datetime as dt\n" +"\n" +"class FirstOfMonthDate(dt.date):\n" +" \"常にその月の初日を選ぶ\"\n" +" def __new__(cls, year, month, day):\n" +" return super().__new__(cls, year, month, 1)\n" +"\n" +"class NamedInt(int):\n" +" \"一部の数値を文字列の名前で指定できるようにする\"\n" +" xlat = {'zero': 0, 'one': 1, 'ten': 10}\n" +" def __new__(cls, value):\n" +" value = cls.xlat.get(value, value)\n" +" return super().__new__(cls, value)\n" +"\n" +"class TitleStr(str):\n" +" \"文字列を URL パスに適した名前に変換する\"\n" +" def __new__(cls, s):\n" +" s = s.lower().replace(' ', '-')\n" +" s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" +" return super().__new__(cls, s)" #: ../../faq/programming.rst:1986 msgid "The classes can be used like this:" msgstr "クラスはこのように使えます:" -#: ../../faq/programming.rst:1988 msgid "" ">>> FirstOfMonthDate(2012, 2, 14)\n" "FirstOfMonthDate(2012, 2, 1)\n" @@ -3800,24 +4036,37 @@ msgid "" ">>> TitleStr('Blog: Why Python Rocks')\n" "'blog-why-python-rocks'" msgstr "" +">>> FirstOfMonthDate(2012, 2, 14)\n" +"FirstOfMonthDate(2012, 2, 1)\n" +">>> NamedInt('ten')\n" +"10\n" +">>> NamedInt(20)\n" +"20\n" +">>> TitleStr('Blog: Why Python Rocks')\n" +"'blog-why-python-rocks'" #: ../../faq/programming.rst:2003 msgid "How do I cache method calls?" msgstr "メソッド呼び出しをキャッシュするには どうしたらいいですか?" -#: ../../faq/programming.rst:2005 msgid "" "The two principal tools for caching methods are :deco:`functools." "cached_property` and :deco:`functools.lru_cache`. The former stores results " "at the instance level and the latter at the class level." msgstr "" +"メソッドのキャッシュに使う主なツールは :deco:`functools.cached_property` と :" +"deco:`functools.lru_cache` です。\n" +"前者はインスタンス単位で、後者はクラス単位で結果を保存します。" -#: ../../faq/programming.rst:2010 msgid "" "The ``cached_property`` approach only works with methods that do not take " "any arguments. It does not create a reference to the instance. The cached " "method result will be kept only as long as the instance is alive." msgstr "" +"``cached_property`` は、引数を受け取らないメソッドにだけ使えます。\n" +"インスタンスへの参照は作りません。\n" +"キャッシュされたメソッドの結果は、インスタンスが生存している間だけ保持されま" +"す。" #: ../../faq/programming.rst:2014 msgid "" @@ -3830,29 +4079,28 @@ msgstr "" "すぐに解放されることです。欠点は、インスタンスが溜まると、溜められたメソッド" "の結果も増えてしまうことです。それらは際限なく増える恐れがあります。" -#: ../../faq/programming.rst:2019 msgid "" "The ``lru_cache`` approach works with methods that have :term:`hashable` " "arguments. It creates a reference to the instance unless special efforts " "are made to pass in weak references." msgstr "" +"``lru_cache`` は、引数が :term:`hashable` なメソッドに使えます。\n" +"弱参照を渡すように特別な工夫をしない限り、インスタンスへの参照を作ります。" -#: ../../faq/programming.rst:2023 msgid "" "The advantage of the least recently used algorithm is that the cache is " "bounded by the specified *maxsize*. The disadvantage is that instances are " "kept alive until they age out of the cache or until the cache is cleared." msgstr "" -"least recently used アルゴリズム(訳注:LRU 直近に使われたものを残す)の利点" -"は、キャッシュが指定された *maxsize* で制限されることです。欠点は、キャッシュ" -"から期限切れで追い出されるかクリアされるまで、インスタンスが生き続けることで" -"す。" +"LRU (最も長く使われていないものから削除する) アルゴリズムの利点は、指定され" +"た *maxsize* でキャッシュの大きさを制限できることです。\n" +"欠点は、長く使われずにキャッシュから追い出されるか、キャッシュが消去されるま" +"で、インスタンスが生存し続けることです。" #: ../../faq/programming.rst:2028 msgid "This example shows the various techniques::" msgstr "この例は各種テクニックを示します::" -#: ../../faq/programming.rst:2030 msgid "" "class Weather:\n" " \"Lookup weather information on a government website\"\n" @@ -3876,13 +4124,36 @@ msgid "" " \"Rainfall on a given date\"\n" " # Depends on the station_id, date, and units." msgstr "" +"class Weather:\n" +" \"政府のウェブサイトで気象情報を調べる\"\n" +"\n" +" def __init__(self, station_id):\n" +" self._station_id = station_id\n" +" # _station_id はプライベートで変更されない\n" +"\n" +" def current_temperature(self):\n" +" \"1 時間ごとの観測の最新値\"\n" +" # 古い結果は現在の状況を反映しないことがあるので、\n" +" # キャッシュしない。\n" +"\n" +" @cached_property\n" +" def location(self):\n" +" \"観測所の経度・緯度を返す\"\n" +" # 結果は station_id だけに依存する\n" +"\n" +" @lru_cache(maxsize=20)\n" +" def historic_rainfall(self, date, units='mm'):\n" +" \"指定した日の降水量\"\n" +" # station_id、date、units に依存する。" -#: ../../faq/programming.rst:2052 msgid "" "The above example assumes that the *station_id* never changes. If the " "relevant instance attributes are mutable, the ``cached_property`` approach " "can't be made to work because it cannot detect changes to the attributes." msgstr "" +"上の例は *station_id* が変わらないことを前提としています。\n" +"関係するインスタンス属性が変更される場合、``cached_property`` は属性の変更を" +"検出できないため、この方法は使えません。" #: ../../faq/programming.rst:2057 msgid "" @@ -3953,7 +4224,6 @@ msgstr "" "ば、ウェブサーバーでテストを行っているときのような、開発者のユーザと実行者の" "ユーザが別な場合に、起こり得ます。" -#: ../../faq/programming.rst:2101 msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " "creation of a .pyc file is automatic if you're importing a module and Python " @@ -3961,8 +4231,11 @@ msgid "" "``__pycache__`` subdirectory and write the compiled module to that " "subdirectory." msgstr "" +":envvar:`PYTHONDONTWRITEBYTECODE` 環境変数が設定されておらず、Python が " +"``__pycache__`` サブディレクトリを作成してコンパイル済みモジュールを書き込め" +"るだけの権限や空き容量などを持っていれば、モジュールをインポートすると .pyc " +"ファイルは自動的に作られます。" -#: ../../faq/programming.rst:2106 msgid "" "Running Python on a top-level script is not considered an import and no ``." "pyc`` will be created. For example, if you have a top-level module ``foo." @@ -3971,6 +4244,13 @@ msgid "" "``xyz`` because ``xyz`` is imported, but no ``.pyc`` file will be created " "for ``foo`` since ``foo.py`` isn't being imported." msgstr "" +"Python で最上位のスクリプトを実行することはインポートとはみなされず、``." +"pyc`` は作られません。\n" +"例えば、最上位のモジュール ``foo.py`` が別のモジュール ``xyz.py`` をインポー" +"トするとします。\n" +"シェルで ``python foo.py`` と入力して ``foo`` を実行すると、``xyz`` はイン" +"ポートされるため ``.pyc`` が作られますが、``foo.py`` はインポートされないた" +"め ``foo`` の ``.pyc`` は作られません。" #: ../../faq/programming.rst:2113 msgid "" @@ -3991,18 +4271,21 @@ msgstr "" "り方の一つは、このモジュールの ``compile()`` 関数をインタラクティブに実行する" "ことです::" -#: ../../faq/programming.rst:2120 msgid "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py')" msgstr "" +">>> import py_compile\n" +">>> py_compile.compile('foo.py')" -#: ../../faq/programming.rst:2123 msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " "location as ``foo.py`` (or you can override that with the optional parameter " "*cfile*)." msgstr "" +"これにより、``foo.py`` と同じ場所にある ``__pycache__`` サブディレクトリに " +"``.pyc`` が書き込まれます。\n" +"保存先は省略可能な引数 *cfile* で変更できます。" #: ../../faq/programming.rst:2127 msgid "" @@ -4015,15 +4298,13 @@ msgstr "" "のファイルをコンパイルできます。シェルプロンプトから ``compileall.py`` を起動" "して、コンパイルしたいファイルを含むディレクトリのパスを指定してください::" -#: ../../faq/programming.rst:2132 msgid "python -m compileall ." -msgstr "" +msgstr "python -m compileall ." #: ../../faq/programming.rst:2136 msgid "How do I find the current module name?" msgstr "現在のモジュール名を知るにはどうしますか?" -#: ../../faq/programming.rst:2138 msgid "" "A module can find out its own module name by looking at the predefined " "global variable ``__name__``. If this has the value ``'__main__'``, the " @@ -4031,13 +4312,14 @@ msgid "" "importing them also provide a command-line interface or a self-test, and " "only execute this code after checking ``__name__``::" msgstr "" -"モジュールは前もって定義されたグローバル変数 ``__name__`` を検索することで自" -"身の名前を決定できます。この値が ``'__main__'`` であるとき、そのプログラムは" -"スクリプトとして実行されています。インポートされることによって使われる大抵の" -"モジュールはコマンドラインインターフェースや自己テストも提供していて、" -"``__name__`` をチェックしてからそのコードだけを実行します::" +"モジュールは、あらかじめ定義されたグローバル変数 ``__name__`` を調べることで" +"自分の名前を知ることができます。\n" +"値が ``'__main__'`` なら、そのプログラムはスクリプトとして実行されていま" +"す。\n" +"通常はインポートして使うモジュールの多くは、コマンドラインインターフェースや" +"自己テストも提供しています。\n" +"そのコードは ``__name__`` を確認した場合にだけ実行します。 ::" -#: ../../faq/programming.rst:2144 msgid "" "def main():\n" " print('Running test...')\n" @@ -4046,6 +4328,12 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"def main():\n" +" print('Running test...')\n" +" ...\n" +"\n" +"if __name__ == '__main__':\n" +" main()" #: ../../faq/programming.rst:2153 msgid "How can I have modules that mutually import each other?" @@ -4059,21 +4347,23 @@ msgstr "以下のモジュールがあったとしましょう:" msgid ":file:`foo.py`::" msgstr ":file:`foo.py`::" -#: ../../faq/programming.rst:2159 msgid "" "from bar import bar_var\n" "foo_var = 1" msgstr "" +"from bar import bar_var\n" +"foo_var = 1" #: ../../faq/programming.rst:2162 msgid ":file:`bar.py`::" msgstr ":file:`bar.py`::" -#: ../../faq/programming.rst:2164 msgid "" "from foo import foo_var\n" "bar_var = 2" msgstr "" +"from foo import foo_var\n" +"bar_var = 2" #: ../../faq/programming.rst:2167 msgid "The problem is that the interpreter will perform the following steps:" @@ -4139,7 +4429,6 @@ msgstr "" msgid "There are (at least) three possible workarounds for this problem." msgstr "この問題には (少なくとも) 三つの解決策があります。" -#: ../../faq/programming.rst:2186 msgid "" "Guido van Rossum recommends avoiding all uses of ``from import ..." "``, and placing all code inside functions. Initializations of global " @@ -4147,10 +4436,11 @@ msgid "" "only. This means everything from an imported module is referenced as " "``.``." msgstr "" -"Guido van Rossum は ``from import ...`` を全く使わないで、すべての" -"コードを関数の中に入れることを勧めています。グローバル変数とクラス変数の初期" -"化は定数とビルトイン関数のみで行われるべきです。これでインポートされたすべて" -"のモジュールは ``.`` として参照されることになります。" +"Guido van Rossum は ``from import ...`` を一切使わず、すべてのコード" +"を関数内に置くことを勧めています。\n" +"グローバル変数やクラス変数の初期化には、定数か組み込み関数だけを使います。\n" +"つまり、インポートしたモジュール内のものはすべて ``.`` として参" +"照します。" #: ../../faq/programming.rst:2191 msgid "" @@ -4211,9 +4501,8 @@ msgstr "" ":mod:`importlib` に :func:`~importlib.import_module` という便利な関数があるの" "で、代わりにそちらを使用することを検討してください。" -#: ../../faq/programming.rst:2213 msgid "z = importlib.import_module('x.y.z')" -msgstr "" +msgstr "z = importlib.import_module('x.y.z')" #: ../../faq/programming.rst:2217 msgid "" @@ -4237,22 +4526,24 @@ msgstr "" "その基本モジュールの解析と再解析が繰り返されることになります。変更されさたモ" "ジュールの再読込を強制するには、こうしてください::" -#: ../../faq/programming.rst:2225 msgid "" "import importlib\n" "import modname\n" "importlib.reload(modname)" msgstr "" +"import importlib\n" +"import modname\n" +"importlib.reload(modname)" -#: ../../faq/programming.rst:2229 msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like::" msgstr "" +"注意: この方法は万全ではありません。\n" +"特に、" -#: ../../faq/programming.rst:2232 msgid "from modname import some_objects" -msgstr "" +msgstr "from modname import some_objects" #: ../../faq/programming.rst:2234 msgid "" @@ -4266,7 +4557,6 @@ msgstr "" "スタンスは新しいクラス定義を使うようにアップデート *されません*。これによって" "以下の矛盾した振舞いがなされえます::" -#: ../../faq/programming.rst:2239 msgid "" ">>> import importlib\n" ">>> import cls\n" @@ -4276,22 +4566,31 @@ msgid "" ">>> isinstance(c, cls.C) # isinstance is false?!?\n" "False" msgstr "" +">>> import importlib\n" +">>> import cls\n" +">>> c = cls.C() # C のインスタンスを作る\n" +">>> importlib.reload(cls)\n" +"\n" +">>> isinstance(c, cls.C) # isinstance が偽になる!\n" +"False" -#: ../../faq/programming.rst:2247 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" msgstr "" -"この問題の本質は、クラスオブジェクトの \"固有値\" を印字することで明らかにな" -"ります::" +"クラスオブジェクトの「識別値」を表示すると、この問題の原因がはっきりしま" +"す。 ::" -#: ../../faq/programming.rst:2250 msgid "" ">>> hex(id(c.__class__))\n" "'0x7352a0'\n" ">>> hex(id(cls.C))\n" "'0x4198d0'" msgstr "" +">>> hex(id(c.__class__))\n" +"'0x7352a0'\n" +">>> hex(id(cls.C))\n" +"'0x4198d0'" #: ../../faq/programming.rst:409 msgid "argument" diff --git a/faq/windows.po b/faq/windows.po index 57be11c1e..93a4c5d62 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -184,7 +184,6 @@ msgstr "" "ドウは閉じます; Windows は 1 つの \"python\" コマンドをウィンドウで実行してい" "て、インタプリタを終了させたときに、そのウィンドウを閉じます。" -#: ../../faq/windows.rst:97 msgid "" "Now that we know the ``py`` command is recognized, you can give your Python " "script to it. You'll have to give either an absolute or a relative path to " @@ -196,8 +195,9 @@ msgstr "" "られるようになりました。\n" "そのためには Python スクリプトの絶対パスあるいは相対パスを与える必要がありま" "す。\n" -"Python スクリプトがデスクトップにあり、 ``hellp.py`` という名前で、ちょうど良" -"いことにコマンドプロンプトがホームディレクトリを開いていると仮定しましょう。" +"Python スクリプトがデスクトップにあり、 ``hello.py`` という名前で、ちょうど良" +"いことにコマンドプロンプトがホームディレクトリを開いていると仮定しましょ" +"う。\n" "そうすると次のような表示が見られます::" #: ../../faq/windows.rst:104 @@ -256,7 +256,6 @@ msgstr "" "トアップに時間がかかるようになったというバグレポートがあります。更に複雑なこ" "とに、Python は同様に設定された他の Windows システムではきちんと動くのです。" -#: ../../faq/windows.rst:131 msgid "" "The problem may be caused by a misconfiguration of virus checking software " "on the problem machine. Some virus scanners have been known to introduce " @@ -266,11 +265,13 @@ msgid "" "configured identically. McAfee, when configured to scan all file system read " "activity, is a particular offender." msgstr "" -"この問題はそのマシンのウイルス対策ソフトウェアの設定ミスによって起こされるこ" -"とがあります。ウイルススキャナの中には、ファイルシステムからの全ての読み込み" -"を監視するように設定した場合に、二桁のスタートアップオーバーヘッドを引き起す" -"ことが知られているものがあります。あなたのシステムのウイルススキャンソフト" -"ウェアの設定を確かめて、本当に同様に設定されていることを確実にしてください。" +"問題が起きるマシンのウイルス対策ソフトウェアの設定が原因かもしれません。\n" +"ファイルシステムからの読み取りをすべて監視するように設定すると、起動時のオー" +"バーヘッドが 100 倍程度になるウイルススキャナがあることが知られています。\n" +"各システムのウイルス対策ソフトウェアが本当に同じ設定になっているか確認してく" +"ださい。\n" +"特に McAfee は、ファイルシステムの読み取りをすべてスキャンする設定にすると、" +"この問題を起こします。" #: ../../faq/windows.rst:141 msgid "How do I make an executable from a Python script?" @@ -288,7 +289,6 @@ msgstr "" msgid "Is a ``*.pyd`` file the same as a DLL?" msgstr "``*.pyd`` ファイルは DLL と同じですか?" -#: ../../faq/windows.rst:150 msgid "" "Yes, .pyd files are dll's, but there are a few differences. If you have a " "DLL named ``foo.pyd``, then it must have a function ``PyInit_foo()``. You " @@ -297,12 +297,12 @@ msgid "" "``PyInit_foo()`` to initialize it. You do not link your .exe with foo.lib, " "as that would cause Windows to require the DLL to be present." msgstr "" -"はい、.pyd ファイルは dll と同じようなものですが、少し違いがあります。``foo." -"pyd`` という名前の DLL があったとしたら、それには関数 ``PyInit_foo()`` が含ま" -"れていなければなりません。そうすれば Python で \"import foo\" を書けて、" -"Python は foo.pyd (や foo.py、foo.pyc) を探して、あれば、``PyInit_foo()`` を" -"呼び出して初期化しようとします。Windows が DLL の存在を必要とするのと違い、." -"exe ファイルを foo.lib にリンクするわけではありません。" +"はい、.pyd ファイルは DLL ですが、いくつか違いがあります。\n" +"``foo.pyd`` という DLL には ``PyInit_foo()`` 関数が必要です。\n" +"Python で ``import foo`` と書くと、Python は foo.py や foo.pyc に加えて foo." +"pyd を探し、見つかれば ``PyInit_foo()`` を呼び出して初期化しようとします。\n" +".exe を foo.lib にリンクする必要はありません。\n" +"リンクすると、Windows がその DLL の存在を必須とするようになるためです。" #: ../../faq/windows.rst:157 msgid "" @@ -361,7 +361,6 @@ msgstr "" "`python{NN}.lib` は :file:`python{NN}.dll` に対するいわゆる \"インポートライ" "ブラリ\" です。これは単にリンカに対するシンボルを定義します。)" -#: ../../faq/windows.rst:182 msgid "" "Run-time linking greatly simplifies link options; everything happens at run " "time. Your code must load :file:`python{NN}.dll` using the Windows " @@ -371,13 +370,15 @@ msgid "" "these pointers transparent to any C code that calls routines in Python's C " "API." msgstr "" -"run-time なリンクは、リンクの選択を大いに単純化します。全ては実行時に行われま" -"す。コードは Windows の ``LoadLibraryEx()`` ルーチンで :file:`python{NN}." -"dll` をロードしなければなりません。コードはまた、Windows の " -"``GetProcAddress()`` ルーチンで得られるポインタで、 :file:`python{NN}.dll` " -"(すなわち、Python の C API)のルーチンとデータへアクセスしていなければなりませ" -"ん。マクロによって、このポインタを Python の C API のルーチンを呼び出す任意" -"の C コードに通して使えます。" +"実行時のリンクではすべての処理が実行時に行われるため、リンクオプションを大幅" +"に簡略化できます。\n" +"コードでは Windows の ``LoadLibraryEx()`` で :file:`python{NN}.dll` を読み込" +"む必要があります。\n" +"また、Windows の ``GetProcAddress()`` で得たポインタを使って、:file:" +"`python{NN}.dll` 内のルーチンやデータ (Python の C API) にアクセスする必要が" +"あります。\n" +"マクロを使えば、Python の C API を呼び出す C コード側でこれらのポインタを意識" +"せずに済むようにできます。" #: ../../faq/windows.rst:191 msgid "" @@ -473,28 +474,29 @@ msgstr "" "_resultobj = Py_None;\n" "return _resultobj;" -#: ../../faq/windows.rst:235 msgid "" "Alas, Py_None is a macro that expands to a reference to a complex data " "structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will " "fail in a mult-compiler environment. Replace such code by:" msgstr "" -"ああ、Py_none は pythonNN.dll 内の _Py_NoneStruct という複雑なデータ構造に展" -"開するマクロです。また、このコードは他コンパイラ環境では失敗します。このコー" -"ドを次のように置き換えてください:" +"ああ、Py_None は pythonNN.dll 内の _Py_NoneStruct という複雑なデータ構造への" +"参照に展開するマクロです。\n" +"また、このコードは他コンパイラ環境では失敗します。\n" +"このコードを次のように置き換えてください:" #: ../../faq/windows.rst:239 msgid "return Py_BuildValue(\"\");" msgstr "return Py_BuildValue(\"\");" -#: ../../faq/windows.rst:243 msgid "" "It may be possible to use SWIG's ``%typemap`` command to make the change " "automatically, though I have not been able to get this to work (I'm a " "complete SWIG newbie)." msgstr "" -"これで、SWIG をまだ仕事に使えない (私は SWIG の完全な初心者です) 私でも、" -"SWIG の ``%typemap`` コマンドを使って自動的に変更できるようになります。" +"SWIG の ``%typemap`` コマンドを使えば、この変更を自動化できるかもしれませ" +"ん。\n" +"ただし、私はこれを動作させられていません (SWIG についてはまったくの初心者で" +"す)。" #: ../../faq/windows.rst:247 msgid "" @@ -560,15 +562,15 @@ msgstr "" msgid "How do I check for a keypress without blocking?" msgstr "ブロックすることなく押鍵を検出するにはどうしますか?" -#: ../../faq/windows.rst:276 msgid "" "Use the :mod:`msvcrt` module. This is a standard Windows-specific extension " "module. It defines a function ``kbhit()`` which checks whether a keyboard " "hit is present, and ``getch()`` which gets one character without echoing it." msgstr "" -":mod:`msvcrt` モジュールを使ってください。これは標準の Windows 専用拡張モ" -"ジュールです。これはキーボードが打たれているかを調べる関数 ``kbhit()`` と、反" -"響することなく一文字を得る ``getch()`` を定義します。" +":mod:`msvcrt` モジュールを使ってください。\n" +"これは Windows 専用の標準拡張モジュールです。\n" +"キー入力があるかを調べる ``kbhit()`` と、入力された文字を表示せずに 1 文字取" +"得する ``getch()`` が定義されています。" #: ../../faq/windows.rst:281 msgid "How do I solve the missing api-ms-win-crt-runtime-l1-1-0.dll error?" diff --git a/howto/a-conceptual-overview-of-asyncio.po b/howto/a-conceptual-overview-of-asyncio.po index 9f04abad8..e8bab6b00 100644 --- a/howto/a-conceptual-overview-of-asyncio.po +++ b/howto/a-conceptual-overview-of-asyncio.po @@ -22,76 +22,85 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:5 msgid "A conceptual overview of :mod:`!asyncio`" -msgstr "" +msgstr ":mod:`!asyncio` の概念を理解する" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:7 msgid "" "This :ref:`HOWTO ` article seeks to help you build a sturdy mental " "model of how :mod:`asyncio` fundamentally works, helping you understand the " "how and why behind the recommended patterns." msgstr "" +"この :ref:`HOWTO ` では、:mod:`asyncio` の基本的な仕組みをしっかり理" +"解できるように説明します。\n" +"推奨される書き方がどのように動き、なぜ推奨されるのかを理解する助けになるで" +"しょう。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:11 msgid "" "You might be curious about some key :mod:`!asyncio` concepts. By the end of " "this article, you'll be able to comfortably answer these questions:" msgstr "" +":mod:`!asyncio` の主要な概念について、疑問を持っているかもしれません。\n" +"この記事を読み終えるころには、次の問いに無理なく答えられるようになるでしょ" +"う。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:14 msgid "What's happening behind the scenes when an object is awaited?" -msgstr "" +msgstr "オブジェクトを await すると、その裏側では何が起きるのでしょうか?" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:15 msgid "" "How does :mod:`!asyncio` differentiate between a task which doesn't need CPU " "time (such as a network request or file read) as opposed to a task that does " "(such as computing n-factorial)?" msgstr "" +":mod:`!asyncio` は、ネットワーク要求やファイルの読み取りのように CPU 時間を必" +"要としないタスクと、n の階乗を計算するように CPU 時間が必要なタスクを、どのよ" +"うに区別するのでしょうか?" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:18 msgid "" "How to write an asynchronous variant of an operation, such as an async sleep " "or database request." msgstr "" +"非同期のスリープやデータベースへの要求など、ある操作の非同期版はどのように書" +"けばよいのでしょうか?" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:23 msgid "" "The `guide `_ that inspired this HOWTO article, by Alexander Nordin." msgstr "" +"この HOWTO のもとになった、Alexander Nordin による `ガイド `_。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:25 msgid "" "This in-depth `YouTube tutorial series `_ on ``asyncio`` " "created by Python core team member, Łukasz Langa." msgstr "" +"Python コアチームのメンバー Łukasz Langa による、``asyncio`` の詳しい " +"`YouTube チュートリアルシリーズ `_。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:28 msgid "" "`500 Lines or Less: A Web Crawler With asyncio Coroutines `_ by A. Jesse Jiryu " "Davis and Guido van Rossum." msgstr "" +"A. Jesse Jiryu Davis と Guido van Rossum による `500 Lines or Less: A Web " +"Crawler With asyncio Coroutines `_。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:34 msgid "A conceptual overview part 1: the high-level" -msgstr "" +msgstr "概念の説明、第 1 部: 全体像" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:36 msgid "" "In part 1, we'll cover the main, high-level building blocks of :mod:`!" "asyncio`: the event loop, coroutine functions, coroutine objects, tasks, and " "``await``." msgstr "" +"第 1 部では、:mod:`!asyncio` の主要な高水準の構成要素であるイベントループ、コ" +"ルーチン関数、コルーチンオブジェクト、タスク、``await`` を取り上げます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:41 msgid "Event loop" -msgstr "" +msgstr "イベントループ" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:43 msgid "" "Everything in :mod:`!asyncio` happens relative to the event loop. It's the " "star of the show, but prefers to work behind the scenes, managing and " @@ -99,8 +108,13 @@ msgid "" "explicitly granted to it, but a lot of its ability to get things done comes " "from the respect and cooperation of its band members." msgstr "" +":mod:`!asyncio` では、すべてがイベントループを中心に動きます。\n" +"イベントループは主役ですが、表に立つよりも裏方としてリソースを管理し、調整す" +"る役割を担います。\n" +"オーケストラの指揮者のようなものです。\n" +"明示的に与えられた権限もありますが、仕事を進める力の多くは、楽団員が指示に従" +"い協力することから生まれます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:50 msgid "" "In more technical terms, the event loop contains a collection of jobs to be " "run. Some jobs are added directly by you, and some indirectly by :mod:`!" @@ -116,15 +130,32 @@ msgid "" "there's more work to be done, such as when I/O operations complete or timers " "expire." msgstr "" +"もう少し技術的にいうと、イベントループは実行すべきジョブの集合を持っていま" +"す。\n" +"ジョブには、自分で直接追加するものも、:mod:`!asyncio` が間接的に追加するもの" +"もあります。\n" +"イベントループは待機中のジョブを 1 つ選び、関数を呼び出すのと同じように起動し" +"ます (つまり「制御を渡します」)。\n" +"ジョブは実行を始め、中断または完了するとイベントループに制御を戻します。\n" +"するとイベントループは別のジョブを選んで起動します。\n" +"このジョブの集合は、*おおまかには* キューと考えられます。\n" +"ジョブは追加された後、通常は順番に (ただし、常にそうとは限りません) 1 つずつ" +"処理されます。\n" +"イベントループはこの処理を繰り返し続けます。\n" +"実行待ちのジョブがなくなると、CPU 時間を無駄にしないよう休止します。\n" +"I/O 操作の完了やタイマーの期限到来などによって新たな仕事ができると、また動き" +"始めます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:64 msgid "" "Effective execution relies on jobs sharing well and cooperating; a greedy " "job could hog control and leave the other jobs to starve, rendering the " "overall event loop approach rather useless." msgstr "" +"効率よく実行するには、ジョブ同士が処理の機会を分け合い、協力する必要がありま" +"す。\n" +"欲張りなジョブが制御を独占すると、ほかのジョブが実行できなくなり、イベント" +"ループという仕組み全体がほとんど役に立たなくなってしまいます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:70 msgid "" "import asyncio\n" "\n" @@ -133,16 +164,19 @@ msgid "" "event_loop = asyncio.new_event_loop()\n" "event_loop.run_forever()" msgstr "" +"import asyncio\n" +"\n" +"# イベントループを作り、そのジョブの集合を\n" +"# 繰り返し処理し続ける。\n" +"event_loop = asyncio.new_event_loop()\n" +"event_loop.run_forever()" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:79 msgid "Asynchronous functions and coroutines" -msgstr "" +msgstr "非同期関数とコルーチン" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:81 msgid "This is a basic, boring Python function::" -msgstr "" +msgstr "これはごく普通の Python 関数です。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:83 msgid "" "def hello_printer():\n" " print(\n" @@ -151,26 +185,35 @@ msgid "" " \"partner in crime.\"\n" " )" msgstr "" +"def hello_printer():\n" +" print(\n" +" \"Hi, I am a lowly, simple printer, though I have all I \"\n" +" \"need in life -- \\nfresh paper and my dearly beloved octopus \"\n" +" \"partner in crime.\"\n" +" )" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:90 msgid "Calling a regular function invokes its logic or body::" -msgstr "" +msgstr "通常の関数を呼び出すと、その本体の処理が実行されます。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:92 msgid "" ">>> hello_printer()\n" "Hi, I am a lowly, simple printer, though I have all I need in life --\n" "fresh paper and my dearly beloved octopus partner in crime." msgstr "" +">>> hello_printer()\n" +"Hi, I am a lowly, simple printer, though I have all I need in life --\n" +"fresh paper and my dearly beloved octopus partner in crime." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:96 msgid "" "The :ref:`async def `, as opposed to just a plain ``def``, makes " "this an asynchronous function (or \"coroutine function\"). Calling it " "creates and returns a :ref:`coroutine ` object." msgstr "" +"単なる ``def`` の代わりに :ref:`async def ` を使うと、非同期関数 " +"(「コルーチン関数」) になります。\n" +"これを呼び出すと、:ref:`コルーチン ` オブジェクトが作られて返され" +"ます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:102 msgid "" "async def loudmouth_penguin(magic_number: int):\n" " print(\n" @@ -179,20 +222,27 @@ msgid "" " f\"By the way, my lucky number is: {magic_number}.\"\n" " )" msgstr "" +"async def loudmouth_penguin(magic_number: int):\n" +" print(\n" +" \"I am a super special talking penguin. Far cooler than that printer. " +"\"\n" +" f\"By the way, my lucky number is: {magic_number}.\"\n" +" )" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:108 msgid "" "Calling the async function, ``loudmouth_penguin``, does not execute the " "print statement; instead, it creates a coroutine object::" msgstr "" +"非同期関数 ``loudmouth_penguin`` を呼び出しても、print 文は実行されません。\n" +"代わりに、コルーチンオブジェクトが作られます。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:111 msgid "" ">>> loudmouth_penguin(magic_number=3)\n" "" msgstr "" +">>> loudmouth_penguin(magic_number=3)\n" +"" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:114 msgid "" "The terms \"coroutine function\" and \"coroutine object\" are often " "conflated as coroutine. That can be confusing! In this article, coroutine " @@ -201,8 +251,14 @@ msgid "" "also exist as instances of :class:`collections.abc.Coroutine` -- a " "distinction that matters for type checking." msgstr "" +"「コルーチン関数」と「コルーチンオブジェクト」は、どちらも単にコルーチンと呼" +"ばれることがあり、混乱を招きます。\n" +"この記事では、コルーチンはコルーチンオブジェクト、より正確には :class:`types." +"CoroutineType` のインスタンス (ネイティブコルーチン) を指します。\n" +"コルーチンは :class:`collections.abc.Coroutine` のインスタンスとして存在する" +"こともあります。\n" +"この違いは型チェックで重要になります。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:123 msgid "" "A coroutine represents the function's body or logic. A coroutine has to be " "explicitly started; again, merely creating the coroutine does not start it. " @@ -210,16 +266,22 @@ msgid "" "the function's body. That pausing and resuming ability is what allows for " "asynchronous behavior!" msgstr "" +"コルーチンは関数の本体、つまり処理内容を表します。\n" +"コルーチンは明示的に開始する必要があり、繰り返しになりますが、作成しただけで" +"は実行されません。\n" +"特に重要なのは、関数本体のさまざまな位置で実行を中断し、再開できる点です。\n" +"この中断と再開の能力が、非同期の振る舞いを可能にします。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:130 msgid "" "Coroutines and coroutine functions were built by leveraging the " "functionality of :term:`generators ` and :term:" "`generator functions `. Recall, a generator function is a " "function that :keyword:`yield`\\s, like this one::" msgstr "" +"コルーチンとコルーチン関数は、:term:`ジェネレータ ` と :" +"term:`ジェネレータ関数 ` の機能を活用して作られました。\n" +"ジェネレータ関数とは、次のように :keyword:`yield` を使う関数です。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:136 msgid "" "def get_random_number():\n" " # This would be a bad random number generator!\n" @@ -231,27 +293,41 @@ msgid "" " yield 4\n" " ..." msgstr "" +"def get_random_number():\n" +" # これでは乱数生成器としては役に立たない!\n" +" print(\"Hi\")\n" +" yield 1\n" +" print(\"Hello\")\n" +" yield 7\n" +" print(\"Howdy\")\n" +" yield 4\n" +" ..." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:146 msgid "" "Similar to a coroutine function, calling a generator function does not run " "it. Instead, it creates a generator object::" msgstr "" +"コルーチン関数と同様に、ジェネレータ関数を呼び出しても本体は実行されませ" +"ん。\n" +"代わりに、ジェネレータオブジェクトが作られます。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:149 msgid "" ">>> get_random_number()\n" "" msgstr "" +">>> get_random_number()\n" +"" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:152 msgid "" "You can proceed to the next ``yield`` of a generator by using the built-in " "function :func:`next`. In other words, the generator runs, then pauses. For " "example::" msgstr "" +"組み込み関数 :func:`next` を使うと、ジェネレータを次の ``yield`` まで進められ" +"ます。\n" +"つまり、ジェネレータは実行されてから中断します。\n" +"例えば、次のようになります。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:157 msgid "" ">>> generator = get_random_number()\n" ">>> next(generator)\n" @@ -261,28 +337,40 @@ msgid "" "Hello\n" "7" msgstr "" +">>> generator = get_random_number()\n" +">>> next(generator)\n" +"Hi\n" +"1\n" +">>> next(generator)\n" +"Hello\n" +"7" #: ../../howto/a-conceptual-overview-of-asyncio.rst:167 msgid "Tasks" msgstr "Task" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:169 msgid "" "Roughly speaking, :ref:`tasks ` are coroutines (not " "coroutine functions) tied to an event loop. A task also maintains a list of " "callback functions whose importance will become clear in a moment when we " "discuss :keyword:`await`." msgstr "" +"おおまかにいうと、:ref:`タスク ` はイベントループに結び付け" +"られたコルーチンです (コルーチン関数ではありません)。\n" +"タスクはコールバック関数のリストも保持しています。\n" +"この重要性は、後で :keyword:`await` を説明するときに明らかになります。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:174 msgid "" "Creating a task automatically schedules it for execution (by adding a " "callback to run it in the event loop's to-do list, that is, collection of " "jobs). The recommended way to create tasks is via :func:`asyncio." "create_task`." msgstr "" +"タスクを作ると、実行のために自動的にスケジュールされます。\n" +"具体的には、タスクを実行するコールバックが、イベントループの処理待ちリスト、" +"つまりジョブの集合に追加されます。\n" +"タスクの作成には :func:`asyncio.create_task` を使うことが推奨されます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:178 msgid "" ":mod:`!asyncio` automatically associates tasks with the event loop for you. " "This automatic association was purposely designed into :mod:`!asyncio` for " @@ -290,16 +378,22 @@ msgid "" "loop object and pass it to any coroutine function that wants to create " "tasks, adding redundant clutter to your code." msgstr "" +":mod:`!asyncio` はタスクとイベントループを自動的に関連付けます。\n" +"この自動的な関連付けは、簡単に使えるようにするための意図的な設計です。\n" +"これがなければ、イベントループオブジェクトを自分で管理し、タスクを作るすべて" +"のコルーチン関数に渡す必要があり、:mod:`!asyncio` を使うコードが冗長で煩雑に" +"なります。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:187 msgid "" "coroutine = loudmouth_penguin(magic_number=5)\n" "# This creates a Task object and schedules its execution via the event " "loop.\n" "task = asyncio.create_task(coroutine)" msgstr "" +"coroutine = loudmouth_penguin(magic_number=5)\n" +"# Task オブジェクトを作り、イベントループで実行するようにスケジュールする。\n" +"task = asyncio.create_task(coroutine)" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:191 msgid "" "Earlier, we manually created the event loop and set it to run forever. In " "practice, it's recommended to use (and common to see) :func:`asyncio.run`, " @@ -307,8 +401,12 @@ msgid "" "coroutine finishes before advancing. For example, many async programs follow " "this setup::" msgstr "" +"先ほどはイベントループを手動で作り、実行し続けるようにしました。\n" +"実際には :func:`asyncio.run` を使うことが推奨され、よく使われています。\n" +"この関数はイベントループを管理し、渡したコルーチンが完了してから次の処理に進" +"むようにします。\n" +"例えば、多くの非同期プログラムは次のような構成になっています。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:197 msgid "" "import asyncio\n" "\n" @@ -322,6 +420,17 @@ msgid "" " # coroutine main() finishes.\n" " print(\"coroutine main() is done!\")" msgstr "" +"import asyncio\n" +"\n" +"async def main():\n" +" # さまざまな非同期処理を行う...\n" +" ...\n" +"\n" +"if __name__ == \"__main__\":\n" +" asyncio.run(main())\n" +" # main() コルーチンが完了するまで、\n" +" # 次の print 文には進まない。\n" +" print(\"coroutine main() is done!\")" #: ../../howto/a-conceptual-overview-of-asyncio.rst:209 msgid "" @@ -331,7 +440,6 @@ msgid "" "example, consider this program:" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:215 msgid "" "async def hello():\n" " print(\"hello!\")\n" @@ -344,6 +452,16 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def hello():\n" +" print(\"hello!\")\n" +"\n" +"async def main():\n" +" asyncio.create_task(hello())\n" +" # しばらく実行した後にイベントループへ制御を渡す、\n" +" # ほかの非同期処理...\n" +" ...\n" +"\n" +"asyncio.run(main())" #: ../../howto/a-conceptual-overview-of-asyncio.rst:229 msgid "" @@ -359,31 +477,32 @@ msgid "" "doesn't happen. But that's no reason to be reckless!" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:245 msgid "await" -msgstr "" +msgstr "await" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:247 msgid "" ":keyword:`await` is a Python keyword that's commonly used in one of two " "different ways::" msgstr "" +":keyword:`await` は Python のキーワードで、一般に次の 2 通りの使い方がありま" +"す。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:250 msgid "" "await task\n" "await coroutine" msgstr "" +"await task\n" +"await coroutine" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:253 msgid "" "In a crucial way, the behavior of ``await`` depends on the type of object " "being awaited." msgstr "" +"``await`` の動作は、待機する対象のオブジェクトの型によって、重要な点で異なり" +"ます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:258 msgid "Awaiting tasks" -msgstr "" +msgstr "タスクの待機" #: ../../howto/a-conceptual-overview-of-asyncio.rst:260 msgid "" @@ -392,7 +511,6 @@ msgid "" "happen. We'll use the following code example to illustrate::" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:265 msgid "" "async def plant_a_tree():\n" " dig_the_hole_task = asyncio.create_task(dig_the_hole())\n" @@ -401,8 +519,13 @@ msgid "" " # Other instructions associated with planting a tree.\n" " ..." msgstr "" +"async def plant_a_tree():\n" +" dig_the_hole_task = asyncio.create_task(dig_the_hole())\n" +" await dig_the_hole_task\n" +"\n" +" # 木を植えるためのその他の処理。\n" +" ..." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:272 msgid "" "In this example, imagine the event loop has passed control to the start of " "the coroutine ``plant_a_tree()``. As seen above, the coroutine creates a " @@ -414,24 +537,39 @@ msgid "" "the task finishes, it will add its various callbacks to the event loop, in " "this case, a call to resume ``plant_a_tree()``." msgstr "" +"この例では、イベントループからコルーチン ``plant_a_tree()`` の先頭へ制御が" +"渡ったと考えてください。\n" +"コルーチンは上記のとおりタスクを作り、それを await します。\n" +"``await dig_the_hole_task`` は、``plant_a_tree()`` を再開するためのコールバッ" +"クを、``dig_the_hole_task`` オブジェクトのコールバックのリストに追加しま" +"す。\n" +"その後、イベントループに制御を渡します。\n" +"しばらくすると、イベントループは ``dig_the_hole_task`` に制御を渡し、タスクは" +"必要な処理を終えます。\n" +"タスクが完了すると、登録されているコールバックがイベントループに追加されま" +"す。\n" +"この場合は、``plant_a_tree()`` を再開する呼び出しです。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:283 msgid "" "Generally speaking, when the awaited task finishes (``dig_the_hole_task``), " "the original task or coroutine (``plant_a_tree()``) is added back to the " "event loop's to-do list to be resumed." msgstr "" +"一般に、待機していたタスク (``dig_the_hole_task``) が完了すると、もとのタスク" +"やコルーチン (``plant_a_tree()``) がイベントループの処理待ちリストに戻され、" +"再開されます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:287 msgid "" "This is a basic, yet reliable mental model. In practice, the control " "handoffs are slightly more complex, but not by much. In part 2, we'll walk " "through the details that make this possible." msgstr "" +"これは基本的ですが、頼りになる考え方です。\n" +"実際の制御の受け渡しはもう少し複雑ですが、大きくは違いません。\n" +"第 2 部では、これを可能にする仕組みを詳しく説明します。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:293 msgid "Awaiting coroutines" -msgstr "" +msgstr "コルーチンの待機" #: ../../howto/a-conceptual-overview-of-asyncio.rst:295 msgid "" @@ -441,7 +579,6 @@ msgid "" "invoking a regular, synchronous Python function. Consider this program::" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:303 msgid "" "import asyncio\n" "\n" @@ -460,8 +597,23 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def coro_a():\n" +" print(\"I am coro_a(). Hi!\")\n" +"\n" +"async def coro_b():\n" +" print(\"I am coro_b(). I sure hope no one hogs the event loop...\")\n" +"\n" +"async def main():\n" +" task_b = asyncio.create_task(coro_b())\n" +" num_repeats = 3\n" +" for _ in range(num_repeats):\n" +" await coro_a()\n" +" await task_b\n" +"\n" +"asyncio.run(main())" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:320 msgid "" "The first statement in the coroutine ``main()`` creates ``task_b`` and " "schedules it for execution via the event loop. Then, ``coro_a()`` is " @@ -469,16 +621,23 @@ msgid "" "see the output of all three ``coro_a()`` invocations before ``coro_b()``'s " "output:" msgstr "" +"コルーチン ``main()`` の最初の文は ``task_b`` を作り、イベントループで実行さ" +"れるようにスケジュールします。\n" +"その後、``coro_a()`` が繰り返し await されます。\n" +"この間はイベントループに制御が戻らないため、``coro_a()`` の 3 回分の出力がす" +"べて表示された後に、``coro_b()`` の出力が表示されます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:326 msgid "" "I am coro_a(). Hi!\n" "I am coro_a(). Hi!\n" "I am coro_a(). Hi!\n" "I am coro_b(). I sure hope no one hogs the event loop..." msgstr "" +"I am coro_a(). Hi!\n" +"I am coro_a(). Hi!\n" +"I am coro_a(). Hi!\n" +"I am coro_b(). I sure hope no one hogs the event loop..." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:333 msgid "" "If we change ``await coro_a()`` to ``await asyncio.create_task(coro_a())``, " "the behavior changes. The coroutine ``main()`` cedes control to the event " @@ -486,16 +645,23 @@ msgid "" "of work, calling ``task_b`` and then the task which wraps ``coro_a()`` " "before resuming the coroutine ``main()``." msgstr "" +"``await coro_a()`` を ``await asyncio.create_task(coro_a())`` に変えると、動" +"作が変わります。\n" +"コルーチン ``main()`` はこの文でイベントループに制御を渡します。\n" +"イベントループは待機中の処理を進め、``task_b``、次に ``coro_a()`` を包むタス" +"クを呼び出してから、コルーチン ``main()`` を再開します。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:340 msgid "" "I am coro_b(). I sure hope no one hogs the event loop...\n" "I am coro_a(). Hi!\n" "I am coro_a(). Hi!\n" "I am coro_a(). Hi!" msgstr "" +"I am coro_b(). I sure hope no one hogs the event loop...\n" +"I am coro_a(). Hi!\n" +"I am coro_a(). Hi!\n" +"I am coro_a(). Hi!" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:347 msgid "" "This behavior of ``await coroutine`` can trip a lot of people up! That " "example highlights how using only ``await coroutine`` could unintentionally " @@ -505,6 +671,13 @@ msgid "" "things, it will log any coroutines that monopolize execution for 100ms or " "longer." msgstr "" +"この ``await coroutine`` の動作でつまずく人は少なくありません。\n" +"この例が示すように、``await coroutine`` だけを使っていると、意図せずほかのタ" +"スクから制御を奪い、実質的にイベントループを止めてしまうことがあります。\n" +":func:`asyncio.run` の ``debug=True`` を指定して :ref:`デバッグモード " +"` を有効にすると、こうした問題の検出に役立ちます。\n" +"このモードでは、ほかの情報に加え、100 ミリ秒以上実行を独占するコルーチンがロ" +"グに記録されます。" #: ../../howto/a-conceptual-overview-of-asyncio.rst:357 msgid "" @@ -517,28 +690,29 @@ msgid "" "negligible performance drag." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:368 msgid "A conceptual overview part 2: the nuts and bolts" -msgstr "" +msgstr "概念の説明、第 2 部: 内部の仕組み" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:370 msgid "" "Part 2 goes into detail on the mechanisms :mod:`!asyncio` uses to manage " "control flow. This is where the magic happens. You'll come away from this " "section knowing what ``await`` does behind the scenes and how to make your " "own asynchronous operators." msgstr "" +"第 2 部では、:mod:`!asyncio` が制御の流れを管理する仕組みを詳しく説明しま" +"す。\n" +"ここに仕掛けの核心があります。\n" +"この節を読むと、``await`` の裏側で何が起きるか、独自の非同期操作をどう作るか" +"が分かるでしょう。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:378 msgid "The inner workings of coroutines" -msgstr "" +msgstr "コルーチンの内部動作" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:380 msgid "" ":mod:`!asyncio` leverages four components of Python to pass around control." msgstr "" +":mod:`!asyncio` は Python の 4 つの構成要素を使って制御を受け渡します。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:383 msgid "" ":meth:`coroutine.send(arg) ` is the method used to start or " "resume a coroutine. If the coroutine was paused and is now being resumed, " @@ -546,8 +720,13 @@ msgid "" "statement which originally paused it. If the coroutine is being used for the " "first time (as opposed to being resumed), ``arg`` must be ``None``." msgstr "" +":meth:`coroutine.send(arg) ` は、コルーチンを開始または再開す" +"るメソッドです。\n" +"中断していたコルーチンを再開する場合、引数 ``arg`` は、中断した位置の " +"``yield`` 文の戻り値として渡されます。\n" +"再開ではなく初めてコルーチンを動かす場合は、``arg`` は ``None`` でなければな" +"りません。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:391 msgid "" "class Rock:\n" " def __await__(self):\n" @@ -575,8 +754,32 @@ msgid "" " returned_value = e.value\n" "print(f\"Coroutine main() finished and provided value: {returned_value}.\")" msgstr "" +"class Rock:\n" +" def __await__(self):\n" +" value_sent_in = yield 7\n" +" print(f\"Rock.__await__ resuming with value: {value_sent_in}.\")\n" +" return value_sent_in\n" +"\n" +"async def main():\n" +" print(\"Beginning coroutine main().\")\n" +" rock = Rock()\n" +" print(\"Awaiting rock...\")\n" +" value_from_rock = await rock\n" +" print(f\"Coroutine received value: {value_from_rock} from rock.\")\n" +" return 23\n" +"\n" +"coroutine = main()\n" +"intermediate_result = coroutine.send(None)\n" +"print(f\"Coroutine paused and returned intermediate value: " +"{intermediate_result}.\")\n" +"\n" +"print(f\"Resuming coroutine and sending in value: 42.\")\n" +"try:\n" +" coroutine.send(42)\n" +"except StopIteration as e:\n" +" returned_value = e.value\n" +"print(f\"Coroutine main() finished and provided value: {returned_value}.\")" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:419 msgid "" ":ref:`yield `, as usual, pauses execution and returns control to " "the caller. In the example above, the ``yield``, on line 3, is called by " @@ -586,8 +789,17 @@ msgid "" "s it receives up the call chain. In this case, that's back to ``... = " "coroutine.send(None)`` on line 16." msgstr "" +":ref:`yield ` は通常どおり実行を中断し、呼び出し元に制御を戻しま" +"す。\n" +"上の例では、11 行目の ``... = await rock`` によって 3 行目の ``yield`` が呼ば" +"れます。\n" +"より一般的にいうと、``await`` は与えられたオブジェクトの :meth:`~object." +"__await__` メソッドを呼び出します。\n" +"``await`` には、もう 1 つ特別な役割があります。\n" +"受け取った ``yield`` を呼び出しの連鎖をさかのぼって伝播させる (「受け渡す」) " +"のです。\n" +"この場合は、16 行目の ``... = coroutine.send(None)`` に戻ります。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:429 msgid "" "The coroutine is resumed via the ``coroutine.send(42)`` call on line 21. The " "coroutine picks back up from where it ``yield``\\ ed (or paused) on line 3 " @@ -595,12 +807,15 @@ msgid "" "finishes, it raises a :exc:`StopIteration` exception with the return value " "attached in the :attr:`~StopIteration.value` attribute." msgstr "" +"21 行目の ``coroutine.send(42)`` を呼び出すと、コルーチンが再開されます。\n" +"コルーチンは 3 行目の ``yield`` で中断した位置から動き始め、本体の残りの文を" +"実行します。\n" +"コルーチンが完了すると、戻り値を :attr:`~StopIteration.value` 属性に持つ :" +"exc:`StopIteration` 例外が送出されます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:435 msgid "That snippet produces this output:" -msgstr "" +msgstr "このコードは次の出力を生成します。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:437 msgid "" "Beginning coroutine main().\n" "Awaiting rock...\n" @@ -610,29 +825,42 @@ msgid "" "Coroutine received value: 42 from rock.\n" "Coroutine main() finished and provided value: 23." msgstr "" +"Beginning coroutine main().\n" +"Awaiting rock...\n" +"Coroutine paused and returned intermediate value: 7.\n" +"Resuming coroutine and sending in value: 42.\n" +"Rock.__await__ resuming with value: 42.\n" +"Coroutine received value: 42 from rock.\n" +"Coroutine main() finished and provided value: 23." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:447 msgid "" "It's worth pausing for a moment here and making sure you followed the " "various ways that control flow and values were passed. A lot of important " "ideas were covered and it's worth ensuring your understanding is firm." msgstr "" +"ここで少し立ち止まり、制御や値がどのように受け渡されたかを追えているか確認し" +"てください。\n" +"重要な考え方をいくつも取り上げたので、確実に理解しておくとよいでしょう。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:451 msgid "" "The only way to yield (or effectively cede control) from a coroutine is to " "``await`` an object that ``yield``\\ s in its ``__await__`` method. That " "might sound odd to you. You might be thinking:" msgstr "" +"コルーチンから yield する (実質的に制御を渡す) 唯一の方法は、``__await__`` メ" +"ソッド内で ``yield`` するオブジェクトを ``await`` することです。\n" +"奇妙に思えるかもしれません。\n" +"次のような疑問を持ったのではないでしょうか。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:455 msgid "" "1. What about a ``yield`` directly within the coroutine function? The " "coroutine function becomes an :ref:`async generator function `, a different beast entirely." msgstr "" +"1. コルーチン関数の中に直接 ``yield`` を書いたらどうなるのでしょうか?\n" +" その関数は :ref:`非同期ジェネレータ関数 ` になり、まったく別のものになります。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:460 msgid "" "2. What about a :ref:`yield from ` within the coroutine function " "to a (plain) generator? That causes the error: ``SyntaxError: yield from not " @@ -642,20 +870,31 @@ msgid "" "``yield`` was barred as well, but was re-accepted to allow for async " "generators." msgstr "" +"2. コルーチン関数内で、通常のジェネレータに対して :ref:`yield from " +"` を使ったらどうなるのでしょうか?\n" +" ``SyntaxError: yield from not allowed in a coroutine.`` というエラーになり" +"ます。\n" +" これはコルーチンの使い方を 1 つに絞り、単純にするための意図的な設計で" +"す。\n" +" とはいえ、``yield from`` と ``await`` は実質的に同じことをします。\n" +" 当初は ``yield`` も禁止されていましたが、非同期ジェネレータを実現するため" +"に再び認められました。" #: ../../howto/a-conceptual-overview-of-asyncio.rst:471 msgid "Futures" msgstr "Future" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:473 msgid "" "A :ref:`future ` is an object meant to represent a " "computation's status and result. The term is a nod to the idea of something " "still to come or not yet happened, and the object is a way to keep an eye on " "that something." msgstr "" +":ref:`Future ` は、計算の状態と結果を表すためのオブジェク" +"トです。\n" +"この名前は、これから起こること、まだ起きていないことを指しています。\n" +"Future オブジェクトは、その状況を把握する手段です。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:478 msgid "" "A future has a few important attributes. One is its state, which can be " "either \"pending\", \"cancelled\", or \"done\". Another is its result, which " @@ -664,43 +903,60 @@ msgid "" "status and result of that computation, kind of like a status light (red, " "yellow, or green) or indicator." msgstr "" +"Future には重要な属性がいくつかあります。\n" +"1 つは状態で、「待機中」「キャンセル済み」「完了」のいずれかになります。\n" +"もう 1 つは結果で、状態が完了に変わるときに設定されます。\n" +"コルーチンと異なり、Future は実行する計算そのものを表しません。\n" +"赤・黄・緑の状態ランプや表示器のように、その計算の状態と結果を表します。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:485 msgid "" ":class:`asyncio.Task` subclasses :class:`asyncio.Future` in order to gain " "these various capabilities. The prior section said tasks store a list of " "callbacks, which wasn't entirely accurate. It's actually the ``Future`` " "class that implements this logic, which ``Task`` inherits." msgstr "" +":class:`asyncio.Task` は、これらの機能を得るために :class:`asyncio.Future` を" +"継承しています。\n" +"前の節ではタスクがコールバックのリストを保持すると説明しましたが、厳密には正" +"確ではありません。\n" +"実際にこの処理を実装するのは ``Future`` クラスで、``Task`` はそれを継承してい" +"ます。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:492 msgid "" "Futures may also be used directly (not via tasks). Tasks mark themselves as " "done when their coroutine is complete. Futures are much more versatile and " "will be marked as done when you say so. In this way, they're the flexible " "interface for you to make your own conditions for waiting and resuming." msgstr "" +"Future はタスクを介さずに直接使うこともできます。\n" +"タスクは自身のコルーチンが完了すると、自分の状態を完了にします。\n" +"Future はもっと柔軟で、指定したタイミングで完了にできます。\n" +"そのため、待機や再開の条件を独自に定めるための柔軟なインターフェースになりま" +"す。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:500 msgid "A homemade asyncio.sleep" -msgstr "" +msgstr "asyncio.sleep を自作する" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:502 msgid "" "We'll go through an example of how you could leverage a future to create " "your own variant of asynchronous sleep (``async_sleep``) which mimics :func:" "`asyncio.sleep`." msgstr "" +"Future を使い、:func:`asyncio.sleep` をまねた独自の非同期スリープ " +"``async_sleep`` を作る例を見ていきましょう。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:506 msgid "" "This snippet registers a few tasks with the event loop and then awaits the " "task created by ``asyncio.create_task``, which wraps the ``async_sleep(3)`` " "coroutine. We want that task to finish only after three seconds have " "elapsed, but without preventing other tasks from running." msgstr "" +"次のコードはイベントループにいくつかのタスクを登録してから、" +"``async_sleep(3)`` コルーチンを包む、``asyncio.create_task`` で作ったタスク" +"を await します。\n" +"ほかのタスクの実行を妨げずに、3 秒経過してからこのタスクを完了させたいと考え" +"ています。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:513 msgid "" "async def other_work():\n" " print(\"I like work. Work work.\")\n" @@ -725,8 +981,29 @@ msgid "" " # asyncio.gather effectively awaits each task in the collection.\n" " await asyncio.gather(*work_tasks)" msgstr "" +"async def other_work():\n" +" print(\"I like work. Work work.\")\n" +"\n" +"async def main():\n" +" # 非同期でスリープしている間に実行する処理があるように、\n" +" # イベントループにほかのタスクをいくつか追加する。\n" +" work_tasks = [\n" +" asyncio.create_task(other_work()),\n" +" asyncio.create_task(other_work()),\n" +" asyncio.create_task(other_work())\n" +" ]\n" +" print(\n" +" \"Beginning asynchronous sleep at time: \"\n" +" f\"{datetime.datetime.now().strftime(\"%H:%M:%S\")}.\"\n" +" )\n" +" await asyncio.create_task(async_sleep(3))\n" +" print(\n" +" \"Done asynchronous sleep at time: \"\n" +" f\"{datetime.datetime.now().strftime(\"%H:%M:%S\")}.\"\n" +" )\n" +" # asyncio.gather は実質的に集合内の各タスクを await する。\n" +" await asyncio.gather(*work_tasks)" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:537 msgid "" "Below, we use a future to enable custom control over when that task will be " "marked as done. If :meth:`future.set_result() ` " @@ -735,8 +1012,13 @@ msgid "" "task, which we'll see in a moment, that will monitor how much time has " "elapsed and, accordingly, call ``future.set_result()``." msgstr "" +"以下では、Future を使ってタスクが完了するタイミングを独自に制御します。\n" +"Future を完了させるメソッド :meth:`future.set_result() ` が呼ばれなければ、このタスクはいつまでも完了しません。\n" +"また、経過時間を監視して、適切なタイミングで ``future.set_result()`` を呼び出" +"す別のタスクも使います。\n" +"そのタスクは後で紹介します。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:548 msgid "" "async def async_sleep(seconds: float):\n" " future = asyncio.Future()\n" @@ -747,8 +1029,15 @@ msgid "" " # Block until the future is marked as done.\n" " await future" msgstr "" +"async def async_sleep(seconds: float):\n" +" future = asyncio.Future()\n" +" time_to_wake = time.time() + seconds\n" +" # 監視タスクをイベントループに追加する。\n" +" watcher_task = asyncio.create_task(_sleep_watcher(future, " +"time_to_wake))\n" +" # Future が完了するまで待機する。\n" +" await future" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:556 msgid "" "Below, we use a rather bare ``YieldToEventLoop()`` object to ``yield`` from " "its ``__await__`` method, ceding control to the event loop. This is " @@ -756,6 +1045,13 @@ msgid "" "offers more clarity, not to mention it's somewhat cheating to use ``asyncio." "sleep`` when showcasing how to implement it!" msgstr "" +"以下では、ごく簡単な ``YieldToEventLoop()`` オブジェクトを使います。\n" +"このオブジェクトは ``__await__`` メソッド内で ``yield`` し、イベントループに" +"制御を渡します。\n" +"これは実質的には ``asyncio.sleep(0)`` を呼ぶのと同じですが、この方法のほうが" +"仕組みがはっきりします。\n" +"それに、``asyncio.sleep`` の実装方法を示すのに ``asyncio.sleep`` 自体を使うの" +"は、少しずるいでしょう。" #: ../../howto/a-conceptual-overview-of-asyncio.rst:562 msgid "" @@ -772,7 +1068,6 @@ msgid "" "true of ``asyncio.sleep``." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:578 msgid "" "class YieldToEventLoop:\n" " def __await__(self):\n" @@ -787,12 +1082,22 @@ msgid "" " else:\n" " await YieldToEventLoop()" msgstr "" +"class YieldToEventLoop:\n" +" def __await__(self):\n" +" yield\n" +"\n" +"async def _sleep_watcher(future, time_to_wake):\n" +" while True:\n" +" if time.time() >= time_to_wake:\n" +" # Future を完了させる。\n" +" future.set_result(None)\n" +" break\n" +" else:\n" +" await YieldToEventLoop()" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:591 msgid "Here is the full program's output:" -msgstr "" +msgstr "プログラム全体の出力は次のとおりです。" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:593 msgid "" "$ python custom-async-sleep.py\n" "Beginning asynchronous sleep at time: 14:52:22.\n" @@ -801,8 +1106,13 @@ msgid "" "I like work. Work work.\n" "Done asynchronous sleep at time: 14:52:25." msgstr "" +"$ python custom-async-sleep.py\n" +"Beginning asynchronous sleep at time: 14:52:22.\n" +"I like work. Work work.\n" +"I like work. Work work.\n" +"I like work. Work work.\n" +"Done asynchronous sleep at time: 14:52:25." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:602 msgid "" "You might feel this implementation of asynchronous sleep was unnecessarily " "convoluted. And, well, it was. The example was meant to showcase the " @@ -810,8 +1120,12 @@ msgid "" "complex needs. For reference, you could implement it without futures, like " "so::" msgstr "" +"この非同期スリープの実装は、必要以上に複雑だと感じたかもしれません。\n" +"確かにそのとおりです。\n" +"この例の目的は、より複雑な要件にも応用できる単純な例で、Future の柔軟さを示す" +"ことでした。\n" +"参考までに、Future を使わずに次のように実装することもできます。 ::" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:609 msgid "" "async def simpler_async_sleep(seconds):\n" " time_to_wake = time.time() + seconds\n" @@ -821,10 +1135,19 @@ msgid "" " else:\n" " await YieldToEventLoop()" msgstr "" +"async def simpler_async_sleep(seconds):\n" +" time_to_wake = time.time() + seconds\n" +" while True:\n" +" if time.time() >= time_to_wake:\n" +" return\n" +" else:\n" +" await YieldToEventLoop()" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:617 msgid "" "But that's all for now. Hopefully you're ready to more confidently dive into " "some async programming or check out advanced topics in the :mod:`rest of the " "documentation `." msgstr "" +"今回はここまでです。\n" +"自信を持って非同期プログラミングに取り組んだり、:mod:`ほかのドキュメント " +"` で高度な話題を調べたりする準備ができていれば幸いです。" diff --git a/howto/annotations.po b/howto/annotations.po index 9bbf7a6b0..b26c6e252 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -71,7 +71,6 @@ msgstr "" msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer" msgstr "オブジェクトのアノテーション辞書へのアクセス (Python 3.10 以降)" -#: ../../howto/annotations.rst:33 msgid "" "Python 3.10 adds a new function to the standard library: :func:`inspect." "get_annotations`. In Python versions 3.10 through 3.13, calling this " @@ -79,10 +78,11 @@ msgid "" "object that supports annotations. This function can also \"un-stringize\" " "stringized annotations for you." msgstr "" -"Python 3.10 で標準ライブラリに :func:`inspect.get_annotations` 関数が新たに追" -"加されました。Python 3.10 から 3.13 までは、アノテーションに対応しているオブ" -"ジェクトのアノテーション辞書にアクセスするには、この関数を使うのが一番良いで" -"す。文字列で指定されたアノテーションも自動的に文字列でない値に解決してくれま" +"Python 3.10 で標準ライブラリに :func:`inspect.get_annotations` が追加されまし" +"た。\n" +"Python 3.10 から 3.13 では、アノテーションに対応するオブジェクトのアノテー" +"ション辞書を取得するには、この関数を呼び出すのが推奨される方法です。\n" +"この関数では、文字列化されたアノテーションを評価して元の値に戻すこともできま" "す。" #: ../../howto/annotations.rst:40 @@ -311,13 +311,16 @@ msgstr "" "``o`` がクラスならば、 ``sys.modules[o.__module__].__dict__`` を ``globals`` " "とし、 ``dict(vars(o))`` を ``locals`` として :func:`eval` を呼ぶ。" -#: ../../howto/annotations.rst:154 msgid "" "If ``o`` is a wrapped callable using :func:`functools.update_wrapper`, :deco:" "`functools.wraps`, or :func:`functools.partial`, iteratively unwrap it by " "accessing either ``o.__wrapped__`` or ``o.func`` as appropriate, until you " "have found the root unwrapped function." msgstr "" +"``o`` が :func:`functools.update_wrapper`、:deco:`functools.wraps`、または :" +"func:`functools.partial` でラップされた呼び出し可能オブジェクトなら、適切なほ" +"うの ``o.__wrapped__`` または ``o.func`` を繰り返し参照し、ラップされていない" +"元の関数までたどります。" #: ../../howto/annotations.rst:158 msgid "" @@ -435,7 +438,6 @@ msgid "" "in Python 3.10 and newer." msgstr "" -#: ../../howto/annotations.rst:220 msgid "" "In all versions of Python 3, you can set ``__annotations__`` on a function " "object to ``None``. However, subsequently accessing the annotations on that " @@ -445,30 +447,46 @@ msgid "" "``__annotations__`` to any Python value, and will retain whatever value is " "set." msgstr "" +"Python 3 のすべてのバージョンで、関数オブジェクトの ``__annotations__`` に " +"``None`` を設定できます。\n" +"ただし、その後 ``fn.__annotations__`` でアクセスすると、この節の最初の段落で" +"述べたとおり、空の辞書が遅延作成されます。\n" +"これは、どの Python バージョンでもモジュールやクラスには *当てはまりません" +"*。\n" +"これらのオブジェクトでは、``__annotations__`` に任意の Python の値を設定で" +"き、設定した値がそのまま保持されます。" -#: ../../howto/annotations.rst:228 msgid "" "If Python stringizes your annotations for you (using ``from __future__ " "import annotations``), and you specify a string as an annotation, the string " "will itself be quoted. In effect the annotation is quoted *twice.* For " "example::" msgstr "" +"``from __future__ import annotations`` を使って Python にアノテーションを文字" +"列化させる場合に、アノテーションとして文字列を指定すると、その文字列自体が引" +"用符で囲まれます。\n" +"つまり、アノテーションが *二重に* 引用されます。\n" +"例えば、次のようになります。 ::" -#: ../../howto/annotations.rst:234 msgid "" "from __future__ import annotations\n" "def foo(a: \"str\"): pass\n" "\n" "print(foo.__annotations__)" msgstr "" +"from __future__ import annotations\n" +"def foo(a: \"str\"): pass\n" +"\n" +"print(foo.__annotations__)" -#: ../../howto/annotations.rst:239 msgid "" "This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " "\"quirk\"; it's mentioned here simply because it might be surprising." msgstr "" +"これは ``{'a': \"'str'\"}`` を表示します。\n" +"本来は「癖」と呼ぶような動作ではありませんが、意外に感じるかもしれないため、" +"ここで紹介しています。" -#: ../../howto/annotations.rst:242 msgid "" "If you use a class with a custom metaclass and access ``__annotations__`` on " "the class, you may observe unexpected behavior; see :pep:`749 <749#pep749-" @@ -478,8 +496,16 @@ msgid "" "avoid these bugs by accessing the annotations from the class's :attr:`~type." "__dict__` (for example, ``cls.__dict__.get('__annotations__', None)``)." msgstr "" +"独自のメタクラスを使うクラスの ``__annotations__`` にアクセスすると、予期しな" +"い動作になる場合があります。\n" +"例は :pep:`749 <749#pep749-metaclasses>` を参照してください。\n" +"Python 3.14 以降では :func:`annotationlib.get_annotations`、Python 3.10 以降" +"では :func:`inspect.get_annotations` を使うことで、こうした動作を避けられま" +"す。\n" +"それ以前の Python では、``cls.__dict__.get('__annotations__', None)`` のよう" +"に、クラスの :attr:`~type.__dict__` からアノテーションを取得することで、この" +"問題を回避できます。" -#: ../../howto/annotations.rst:251 msgid "" "In some versions of Python, instances of classes may have an " "``__annotations__`` attribute. However, this is not supported functionality. " @@ -487,3 +513,10 @@ msgid "" "access its class (for example, ``annotationlib." "get_annotations(type(myinstance))`` on Python 3.14+)." msgstr "" +"一部の Python バージョンでは、クラスのインスタンスが ``__annotations__`` 属性" +"を持つことがあります。\n" +"ただし、これはサポートされている機能ではありません。\n" +"インスタンスのアノテーションが必要なら、:func:`type` でそのクラスを取得できま" +"す。\n" +"例えば、Python 3.14 以降では ``annotationlib." +"get_annotations(type(myinstance))`` を使えます。" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po index fb5bcd1f7..68132decf 100644 --- a/howto/argparse-optparse.po +++ b/howto/argparse-optparse.po @@ -22,23 +22,22 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/argparse-optparse.rst:8 msgid "Migrating ``optparse`` code to ``argparse``" -msgstr "" +msgstr "``optparse`` を使うコードを ``argparse`` に移行する" -#: ../../howto/argparse-optparse.rst:10 msgid "" "The :mod:`argparse` module offers several higher level features not natively " "provided by the :mod:`optparse` module, including:" msgstr "" +":mod:`argparse` モジュールは、:mod:`optparse` モジュールに標準では備わってい" +"ない、次のような高水準の機能を提供します。" #: ../../howto/argparse-optparse.rst:13 msgid "Handling positional arguments." msgstr "位置引数を扱う" -#: ../../howto/argparse-optparse.rst:14 msgid "Supporting subcommands." -msgstr "" +msgstr "サブコマンドのサポート。" #: ../../howto/argparse-optparse.rst:15 msgid "Allowing alternative option prefixes like ``+`` and ``/``." @@ -58,7 +57,6 @@ msgstr "" "カスタム ``type``, カスタム ``action`` のために遥かに簡単なインターフェイスを" "提供する" -#: ../../howto/argparse-optparse.rst:20 msgid "" "Originally, the :mod:`argparse` module attempted to maintain compatibility " "with :mod:`optparse`. However, the fundamental design differences between " @@ -67,26 +65,36 @@ msgid "" "named options and positional arguments in the declarative interface mean " "that the API has diverged from that of ``optparse`` over time." msgstr "" +":mod:`argparse` モジュールは、当初 :mod:`optparse` との互換性を保とうとしてい" +"ました。\n" +"しかし、位置引数の処理をアプリケーション側に任せてコマンドラインオプションを" +"宣言的に処理する設計と、名前付きオプションと位置引数の両方を宣言的なインター" +"フェースで扱う設計には、根本的な違いがあります。\n" +"そのため、API は時間とともに ``optparse`` から離れていきました。" -#: ../../howto/argparse-optparse.rst:27 msgid "" "As described in :ref:`choosing-an-argument-parser`, applications that are " "currently using :mod:`optparse` and are happy with the way it works can just " "continue to use ``optparse``." msgstr "" +":ref:`choosing-an-argument-parser` で説明しているように、現在 :mod:" +"`optparse` を使っていて、その動作に満足しているアプリケーションは、そのまま " +"``optparse`` を使い続けて構いません。" -#: ../../howto/argparse-optparse.rst:31 msgid "" "Application developers that are considering migrating should also review the " "list of intrinsic behavioural differences described in that section before " "deciding whether or not migration is desirable." msgstr "" +"移行を検討しているアプリケーションの開発者は、移行が望ましいか判断する前に、" +"その節にある本質的な動作の違いの一覧も確認してください。" -#: ../../howto/argparse-optparse.rst:35 msgid "" "For applications that do choose to migrate from :mod:`optparse` to :mod:" "`argparse`, the following suggestions should be helpful:" msgstr "" +":mod:`optparse` から :mod:`argparse` への移行を選んだアプリケーションには、次" +"の指針が役立つでしょう。" #: ../../howto/argparse-optparse.rst:38 msgid "" @@ -126,13 +134,12 @@ msgstr "" "コールバック・アクションと ``callback_*`` キーワード引数を ``type`` や " "``action`` 引数に置き換える。" -#: ../../howto/argparse-optparse.rst:53 msgid "" "Replace string names for ``type`` keyword arguments with the corresponding " "type objects (e.g. int, float, complex, etc)." msgstr "" -"``type`` キーワード引数に渡していた文字列の名前を、それに応じたオブジェクト " -"(例: int, float, complex, ...) に置き換える。" +"``type`` キーワード引数に渡す型名の文字列を、対応する型オブジェクト (例えば " +"``int``、``float``、``complex`` など) に置き換えてください。" #: ../../howto/argparse-optparse.rst:56 msgid "" diff --git a/howto/argparse.po b/howto/argparse.po index 20ea0140a..95f380d31 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -35,7 +35,6 @@ msgstr "" "は、Python 標準ライブラリの一部であり、おすすめのコマンドライン引数の解析モ" "ジュールです。" -#: ../../howto/argparse.rst:14 msgid "" "The standard library includes two other libraries directly related to " "command-line parameter processing: the lower level :mod:`optparse` module " @@ -48,6 +47,16 @@ msgid "" "``optparse``, so some aspects of this tutorial will also be relevant to " "``optparse`` users." msgstr "" +"標準ライブラリには、コマンドライン引数の処理に直接関係するライブラリが、ほか" +"に 2 つあります。\n" +"より低水準の :mod:`optparse` モジュールは、アプリケーションに合わせた設定に多" +"くのコードが必要な場合もありますが、``argparse`` がサポートしない動作を指定で" +"きます。\n" +"さらに低水準の :mod:`getopt` は、C プログラマが使う :c:func:`!getopt` 系の関" +"数に相当するものです。\n" +"このガイドでは、これらのモジュールを直接は取り上げません。\n" +"ただし、``argparse`` の主要な概念の多くは ``optparse`` に由来するため、この" +"チュートリアルの一部は ``optparse`` の利用者にも役立ちます。" #: ../../howto/argparse.rst:27 msgid "Concepts" @@ -61,7 +70,6 @@ msgstr "" ":command:`ls` コマンドを使って、このチュートリアルで私たちが学ぶ機能をいくつ" "か見てみましょう:" -#: ../../howto/argparse.rst:32 msgid "" "$ ls\n" "cpython devguide prog.py pypy rm-unused-function.patch\n" @@ -80,6 +88,22 @@ msgid "" "Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" "..." msgstr "" +"$ ls\n" +"cpython devguide prog.py pypy rm-unused-function.patch\n" +"$ ls pypy\n" +"ctypes_configure demo dotviewer include lib_pypy lib-python ...\n" +"$ ls -l\n" +"total 20\n" +"drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython\n" +"drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide\n" +"-rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py\n" +"drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy\n" +"-rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch\n" +"$ ls --help\n" +"Usage: ls [OPTION]... [FILE]...\n" +"List information about the FILEs (the current directory by default).\n" +"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" +"..." #: ../../howto/argparse.rst:51 msgid "A few concepts we can learn from the four commands:" @@ -93,7 +117,6 @@ msgstr "" ":command:`ls` コマンドは、まったくオプションを指定せずに実行したとしても役に" "立ちます。デフォルトの動作は、カレントディレクトリの内容を表示することです。" -#: ../../howto/argparse.rst:56 msgid "" "If we want beyond what it provides by default, we tell it a bit more. In " "this case, we want it to display a different directory, ``pypy``. What we " @@ -104,14 +127,14 @@ msgid "" "position is *what you want copied,* and the second position is *where you " "want it copied to*." msgstr "" -"デフォルトの動作で提供される以上のことをしたい場合、すこしだけオプションを指" -"定する必要があります。別のディレクトリ ``pypy`` を表示したい場合、私たちがし" -"たことは、位置引数として知られる引数を指定することです。これは、引数がコマン" -"ドラインのどの位置に現れたかということだけを基に、プログラムがその値について" -"何をするのか分かるべきなので、このように名づけられています。このコンセプト" -"は :command:`cp` のようなコマンドで重要な意味があります。 :command:`cp` コマ" -"ンドのもっとも基本的な使い方は、 ``cp SRC DEST`` です。最初の引数は *何をコ" -"ピーしたいか* であり、二つ目の引数は *どこにコピーしたいか* を意味します。" +"デフォルト以外の動作をさせるには、追加の情報を渡します。\n" +"この例では、別のディレクトリ ``pypy`` の内容を表示させるために、位置引数と呼" +"ばれるものを指定しました。\n" +"コマンドライン上の位置だけで、プログラムがその値の用途を判断できることから、" +"この名前が付いています。\n" +"この考え方は :command:`cp` のようなコマンドではさらに重要です。\n" +"最も基本的な使い方は ``cp SRC DEST`` で、最初の位置は *コピーしたいもの*、2 " +"番目の位置は *コピー先* を表します。" #: ../../howto/argparse.rst:65 msgid "" @@ -141,19 +164,20 @@ msgstr "基礎" msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "(ほとんど)何もしない、とても簡単な例から始めましょう::" -#: ../../howto/argparse.rst:79 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" "parser.parse_args()" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.parse_args()" #: ../../howto/argparse.rst:83 ../../howto/argparse.rst:191 #: ../../howto/argparse.rst:212 msgid "Following is a result of running the code:" msgstr "下記がこのコードを実行した結果です:" -#: ../../howto/argparse.rst:85 msgid "" "$ python prog.py\n" "$ python prog.py --help\n" @@ -168,6 +192,18 @@ msgid "" "usage: prog.py [-h]\n" "prog.py: error: unrecognized arguments: foo" msgstr "" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py --verbose\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: --verbose\n" +"$ python prog.py foo\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: foo" #: ../../howto/argparse.rst:100 ../../howto/argparse.rst:257 #: ../../howto/argparse.rst:301 @@ -190,17 +226,16 @@ msgstr "" "二つ目の実行結果から :mod:`argparse` モジュールの有用性がわかります。ほとんど" "何もしていないのに、すてきなヘルプメッセージが手に入りました。" -#: ../../howto/argparse.rst:108 msgid "" "The ``--help`` option, which can also be shortened to ``-h``, is the only " "option we get for free (i.e. no need to specify it). Specifying anything " "else results in an error. But even then, we do get a useful usage message, " "also for free." msgstr "" -"``--help`` (これは ``-h`` と短縮できます)だけが無料のオプションです(つまり" -"プログラムで指示する必要はありません)。他のオプションを指定するとエラーにな" -"ります。エラー時の有用な用法メッセージも、プログラムで指示することなく出力で" -"きます。" +"``--help`` (短く ``-h`` とも書けます) は、こちらで定義せずに使える唯一のオプ" +"ションです。\n" +"それ以外を指定するとエラーになりますが、その場合も追加の実装なしで役立つ使用" +"方法のメッセージが表示されます。" #: ../../howto/argparse.rst:115 msgid "Introducing Positional arguments" @@ -210,7 +245,6 @@ msgstr "位置引数の入門" msgid "An example::" msgstr "以下に例を示します::" -#: ../../howto/argparse.rst:119 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -218,12 +252,16 @@ msgid "" "args = parser.parse_args()\n" "print(args.echo)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" #: ../../howto/argparse.rst:125 msgid "And running the code:" msgstr "このコードを実行してみましょう:" -#: ../../howto/argparse.rst:127 msgid "" "$ python prog.py\n" "usage: prog.py [-h] echo\n" @@ -239,6 +277,19 @@ msgid "" "$ python prog.py foo\n" "foo" msgstr "" +"$ python prog.py\n" +"usage: prog.py [-h] echo\n" +"prog.py: error: the following arguments are required: echo\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py foo\n" +"foo" #: ../../howto/argparse.rst:143 msgid "Here is what's happening:" @@ -259,13 +310,13 @@ msgstr "" msgid "Calling our program now requires us to specify an option." msgstr "プログラムを実行すると、オプションを指定するように要求されます。" -#: ../../howto/argparse.rst:151 msgid "" "The :meth:`~ArgumentParser.parse_args` method actually returns some data " "from the options specified, in this case, ``echo``." msgstr "" -":meth:`~ArgumentParser.parse_args` メソッドは指定されたオプションを、この場合" -"は ``echo`` として、返します。" +":meth:`~ArgumentParser.parse_args` メソッドは、指定されたオプションから得た" +"データを返します。\n" +"この例では ``echo`` に指定された値です。" #: ../../howto/argparse.rst:154 msgid "" @@ -291,7 +342,6 @@ msgstr "" "ためには推測するかソースコードを見なけれなりません。もうすこしヘルプメッセー" "ジ分かりやすくしてみましょう::" -#: ../../howto/argparse.rst:164 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -299,12 +349,16 @@ msgid "" "args = parser.parse_args()\n" "print(args.echo)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\", help=\"echo the string you use here\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" #: ../../howto/argparse.rst:170 msgid "And we get:" msgstr "修正した結果は以下のようになります:" -#: ../../howto/argparse.rst:172 msgid "" "$ python prog.py -h\n" "usage: prog.py [-h] echo\n" @@ -315,12 +369,19 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +"$ python prog.py -h\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo echo the string you use here\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" #: ../../howto/argparse.rst:183 msgid "Now, how about doing something even more useful::" msgstr "次は、もっと有益なことをしてみませんか?::" -#: ../../howto/argparse.rst:185 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -329,8 +390,13 @@ msgid "" "args = parser.parse_args()\n" "print(args.square**2)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given " +"number\")\n" +"args = parser.parse_args()\n" +"print(args.square**2)" -#: ../../howto/argparse.rst:193 msgid "" "$ python prog.py 4\n" "Traceback (most recent call last):\n" @@ -338,6 +404,11 @@ msgid "" " print(args.square**2)\n" "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" msgstr "" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 5, in \n" +" print(args.square**2)\n" +"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" #: ../../howto/argparse.rst:201 msgid "" @@ -349,7 +420,6 @@ msgstr "" "ションを文字列として扱います。 :mod:`argparse` にオプションの値を整数として扱" "うように伝えましょう::" -#: ../../howto/argparse.rst:205 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -359,8 +429,14 @@ msgid "" "args = parser.parse_args()\n" "print(args.square**2)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given " +"number\",\n" +" type=int)\n" +"args = parser.parse_args()\n" +"print(args.square**2)" -#: ../../howto/argparse.rst:214 msgid "" "$ python prog.py 4\n" "16\n" @@ -368,6 +444,11 @@ msgid "" "usage: prog.py [-h] square\n" "prog.py: error: argument square: invalid int value: 'four'" msgstr "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py four\n" +"usage: prog.py [-h] square\n" +"prog.py: error: argument square: invalid int value: 'four'" #: ../../howto/argparse.rst:222 msgid "" @@ -389,7 +470,6 @@ msgstr "" "ここまで位置引数を扱ってきました。optional引数を追加する方法についても見てい" "きましょう::" -#: ../../howto/argparse.rst:232 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -398,13 +478,18 @@ msgid "" "if args.verbosity:\n" " print(\"verbosity turned on\")" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbosity\", help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"if args.verbosity:\n" +" print(\"verbosity turned on\")" #: ../../howto/argparse.rst:239 ../../howto/argparse.rst:285 #: ../../howto/argparse.rst:401 ../../howto/argparse.rst:435 msgid "And the output:" msgstr "実行してみましょう:" -#: ../../howto/argparse.rst:241 msgid "" "$ python prog.py --verbosity 1\n" "verbosity turned on\n" @@ -420,6 +505,19 @@ msgid "" "usage: prog.py [-h] [--verbosity VERBOSITY]\n" "prog.py: error: argument --verbosity: expected one argument" msgstr "" +"$ python prog.py --verbosity 1\n" +"verbosity turned on\n" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbosity VERBOSITY\n" +" increase output verbosity\n" +"$ python prog.py --verbosity\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"prog.py: error: argument --verbosity: expected one argument" #: ../../howto/argparse.rst:259 msgid "" @@ -465,7 +563,6 @@ msgstr "" "は、実際には ``True`` または ``False`` の二つの値だけが有効です。そうなるよう" "にコードを修正してみましょう::" -#: ../../howto/argparse.rst:277 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -475,8 +572,14 @@ msgid "" "if args.verbose:\n" " print(\"verbosity turned on\")" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbose\", help=\"increase output verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" -#: ../../howto/argparse.rst:287 msgid "" "$ python prog.py --verbose\n" "verbosity turned on\n" @@ -490,6 +593,17 @@ msgid "" " -h, --help show this help message and exit\n" " --verbose increase output verbosity" msgstr "" +"$ python prog.py --verbose\n" +"verbosity turned on\n" +"$ python prog.py --verbose 1\n" +"usage: prog.py [-h] [--verbose]\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbose]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbose increase output verbosity" #: ../../howto/argparse.rst:303 msgid "" @@ -531,7 +645,6 @@ msgstr "" "コマンドラインになれていれば、オプションの短いバージョンの話題に触れていない" "ことに気付いたでしょう。それはとても簡単です::" -#: ../../howto/argparse.rst:323 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -542,12 +655,19 @@ msgid "" "if args.verbose:\n" " print(\"verbosity turned on\")" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"-v\", \"--verbose\", help=\"increase output " +"verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" #: ../../howto/argparse.rst:331 msgid "And here goes:" msgstr "上記のプログラムを実行するとこうなります:" -#: ../../howto/argparse.rst:333 msgid "" "$ python prog.py -v\n" "verbosity turned on\n" @@ -558,6 +678,14 @@ msgid "" " -h, --help show this help message and exit\n" " -v, --verbose increase output verbosity" msgstr "" +"$ python prog.py -v\n" +"verbosity turned on\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [-v]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose increase output verbosity" #: ../../howto/argparse.rst:344 msgid "Note that the new ability is also reflected in the help text." @@ -571,7 +699,6 @@ msgstr "位置引数とOptional引数の併用" msgid "Our program keeps growing in complexity::" msgstr "プログラムが複雑になってきました::" -#: ../../howto/argparse.rst:352 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -586,12 +713,23 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbose\", action=\"store_true\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbose:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"else:\n" +" print(answer)" #: ../../howto/argparse.rst:365 msgid "And now the output:" msgstr "出力は以下のようになります:" -#: ../../howto/argparse.rst:367 msgid "" "$ python prog.py\n" "usage: prog.py [-h] [-v] square\n" @@ -603,14 +741,22 @@ msgid "" "$ python prog.py --verbose 4\n" "the square of 4 equals 16" msgstr "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: the following arguments are required: square\n" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 --verbose\n" +"the square of 4 equals 16\n" +"$ python prog.py --verbose 4\n" +"the square of 4 equals 16" #: ../../howto/argparse.rst:379 msgid "We've brought back a positional argument, hence the complaint." msgstr "位置引数を元に戻したので、引数を指定しないとエラーになりました。" -#: ../../howto/argparse.rst:381 msgid "Note that the order does not matter." -msgstr "2つのオプションの順序を考慮しないことに注意してください。" +msgstr "指定する順序は関係ありません。" #: ../../howto/argparse.rst:383 msgid "" @@ -620,7 +766,6 @@ msgstr "" "複数の詳細レベルを値にとれるようにプログラムを元に戻して、指定された値を使っ" "てみましょう::" -#: ../../howto/argparse.rst:386 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -637,8 +782,21 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" -#: ../../howto/argparse.rst:403 msgid "" "$ python prog.py 4\n" "16\n" @@ -652,6 +810,17 @@ msgid "" "$ python prog.py 4 -v 3\n" "16" msgstr "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"usage: prog.py [-h] [-v VERBOSITY] square\n" +"prog.py: error: argument -v/--verbosity: expected one argument\n" +"$ python prog.py 4 -v 1\n" +"4^2 == 16\n" +"$ python prog.py 4 -v 2\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 3\n" +"16" #: ../../howto/argparse.rst:417 msgid "" @@ -662,7 +831,6 @@ msgstr "" "プログラムのバグである最後の結果を除いて、上手く行っているようです。このバグ" "を、``--verbosity`` オプションが取れる値を制限することで修正しましょう::" -#: ../../howto/argparse.rst:420 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -679,8 +847,21 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int, choices=[0, 1, 2],\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" -#: ../../howto/argparse.rst:437 msgid "" "$ python prog.py 4 -v 3\n" "usage: prog.py [-h] [-v {0,1,2}] square\n" @@ -697,6 +878,20 @@ msgid "" " -v, --verbosity {0,1,2}\n" " increase output verbosity" msgstr "" +"$ python prog.py 4 -v 3\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, " +"1, 2)\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity {0,1,2}\n" +" increase output verbosity" #: ../../howto/argparse.rst:453 msgid "" @@ -716,7 +911,6 @@ msgstr "" "ファイルがその詳細レベル引数を扱う方法と同じです。( ``python --help`` の出力" "を確認してください)::" -#: ../../howto/argparse.rst:460 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -733,6 +927,20 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display the square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" #: ../../howto/argparse.rst:475 msgid "" @@ -742,7 +950,6 @@ msgstr "" "もう一つの action である \"count\" を紹介します。これは指定されたオプションの" "出現回数を数えます:" -#: ../../howto/argparse.rst:479 msgid "" "$ python prog.py 4\n" "16\n" @@ -767,6 +974,28 @@ msgid "" "$ python prog.py 4 -vvv\n" "16" msgstr "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 -vv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 --verbosity --verbosity\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 1\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity increase output verbosity\n" +"$ python prog.py 4 -vvv\n" +"16" #: ../../howto/argparse.rst:504 msgid "" @@ -819,7 +1048,6 @@ msgstr "最後の出力はプログラムにバグがあることを示します msgid "Let's fix::" msgstr "修正しましょう::" -#: ../../howto/argparse.rst:527 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -838,12 +1066,27 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"\n" +"# バグ修正: == を >= に置き換える\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" #: ../../howto/argparse.rst:544 msgid "And this is what it gives:" msgstr "これが結果です:" -#: ../../howto/argparse.rst:546 msgid "" "$ python prog.py 4 -vvv\n" "the square of 4 equals 16\n" @@ -855,14 +1098,22 @@ msgid "" " if args.verbosity >= 2:\n" "TypeError: '>=' not supported between instances of 'NoneType' and 'int'" msgstr "" +"$ python prog.py 4 -vvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -vvvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 11, in \n" +" if args.verbosity >= 2:\n" +"TypeError: '>=' not supported between instances of 'NoneType' and 'int'" -#: ../../howto/argparse.rst:559 msgid "" "First output went well, and fixes the bug we had before. That is, we want " "any value >= 2 to be as verbose as possible." msgstr "" -"最初の出力は上手くいっていますし、以前のバグが修正されています。最も詳細な出" -"力を得るには、2 以上の値が必要です。" +"最初の出力はうまくいき、先ほどのバグが直りました。\n" +"2 以上ならどの値でも最も詳しい出力にしたかったので、この動作で正解です。" #: ../../howto/argparse.rst:562 msgid "Third output not so good." @@ -872,7 +1123,6 @@ msgstr "三番目の結果は、よくありません。" msgid "Let's fix that bug::" msgstr "このバグを修正しましょう::" -#: ../../howto/argparse.rst:566 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -889,6 +1139,20 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" #: ../../howto/argparse.rst:581 msgid "" @@ -907,11 +1171,12 @@ msgstr "" msgid "And:" msgstr "こうなりました:" -#: ../../howto/argparse.rst:590 msgid "" "$ python prog.py 4\n" "16" msgstr "" +"$ python prog.py 4\n" +"16" #: ../../howto/argparse.rst:595 msgid "" @@ -935,7 +1200,6 @@ msgstr "" "もし、この小さなプログラムを二乗以外の累乗が行えるように拡張するとどうなるで" "しょうか::" -#: ../../howto/argparse.rst:607 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -951,13 +1215,25 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == {answer}\")\n" +"else:\n" +" print(answer)" #: ../../howto/argparse.rst:621 ../../howto/argparse.rst:659 #: ../../howto/argparse.rst:875 msgid "Output:" msgstr "出力:" -#: ../../howto/argparse.rst:623 msgid "" "$ python prog.py\n" "usage: prog.py [-h] [-v] x y\n" @@ -975,6 +1251,21 @@ msgid "" "$ python prog.py 4 2 -v\n" "4^2 == 16" msgstr "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] x y\n" +"prog.py: error: the following arguments are required: x, y\n" +"$ python prog.py -h\n" +"usage: prog.py [-h] [-v] x y\n" +"\n" +"positional arguments:\n" +" x the base\n" +" y the exponent\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16" #: ../../howto/argparse.rst:642 msgid "" @@ -985,7 +1276,6 @@ msgstr "" "これまで、出力されるテキストを *変更する* ために詳細レベルを使ってきました。" "かわりに下記の例では、*追加の* テキストを出力するのに詳細レベルを使用します::" -#: ../../howto/argparse.rst:646 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -1000,8 +1290,19 @@ msgid "" " print(f\"{args.x}^{args.y} == \", end=\"\")\n" "print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"Running '{__file__}'\")\n" +"if args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == \", end=\"\")\n" +"print(answer)" -#: ../../howto/argparse.rst:661 msgid "" "$ python prog.py 4 2\n" "16\n" @@ -1011,6 +1312,13 @@ msgid "" "Running 'prog.py'\n" "4^2 == 16" msgstr "" +"$ python prog.py 4 2\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -vv\n" +"Running 'prog.py'\n" +"4^2 == 16" #: ../../howto/argparse.rst:675 msgid "Specifying ambiguous arguments" @@ -1026,7 +1334,6 @@ msgstr "" "いまいさがあるときは、 ``--`` を使うことで :meth:`~ArgumentParser." "parse_args` に対してこれ以降は位置引数であることを伝えることができます::" -#: ../../howto/argparse.rst:681 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-n', nargs='+')\n" @@ -1047,12 +1354,29 @@ msgid "" ">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" "Namespace(args=['2', '3'], n=['1'])" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-n', nargs='+')\n" +">>> parser.add_argument('args', nargs='*')\n" +"\n" +">>> # 曖昧なので、parse_args はオプションと解釈する\n" +">>> parser.parse_args(['-f'])\n" +"usage: PROG [-h] [-n N [N ...]] [args ...]\n" +"PROG: error: unrecognized arguments: -f\n" +"\n" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(args=['-f'], n=None)\n" +"\n" +">>> # 曖昧なので、-n オプションは引数を取れるだけ取る\n" +">>> parser.parse_args(['-n', '1', '2', '3'])\n" +"Namespace(args=[], n=['1', '2', '3'])\n" +"\n" +">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" +"Namespace(args=['2', '3'], n=['1'])" #: ../../howto/argparse.rst:702 msgid "Conflicting options" msgstr "競合するオプション" -#: ../../howto/argparse.rst:704 msgid "" "So far, we have been working with two methods of an :class:`argparse." "ArgumentParser` instance. Let's introduce a third one, :meth:" @@ -1061,14 +1385,14 @@ msgid "" "program so that the new functionality makes more sense: we'll introduce the " "``--quiet`` option, which will be the opposite of the ``--verbose`` one::" msgstr "" -"これまでのところ、 :class:`argparse.ArgumentParser` インスタンスの2つのメソッ" -"ドについて学んできました。ここで3つめのメソッドとして :meth:`~ArgumentParser." -"add_mutually_exclusive_group` を導入しましょう。このメソッドは互いに対立する" -"引数の指定を可能にします。また、新しい機能として理解しやすいように、プログラ" -"ムの残りの部分を変更しましょう: 以下では ``--quiet`` オプションを ``--" -"verbose`` と反対のオプションとして導入します::" +"これまで :class:`argparse.ArgumentParser` インスタンスの 2 つのメソッドを使っ" +"てきました。\n" +"3 つ目の :meth:`~ArgumentParser.add_mutually_exclusive_group` を紹介しましょ" +"う。\n" +"このメソッドでは、互いに同時指定できないオプションを定義できます。\n" +"新しい機能の意味が伝わるよう、プログラムのほかの部分も変更し、``--verbose`` " +"と反対の働きをする ``--quiet`` オプションを導入します。 ::" -#: ../../howto/argparse.rst:712 msgid "" "import argparse\n" "\n" @@ -1088,16 +1412,31 @@ msgid "" "else:\n" " print(f\"{args.x}^{args.y} == {answer}\")" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" -#: ../../howto/argparse.rst:730 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " "of demonstration. Anyways, here's the output:" msgstr "" -"プログラムはより簡潔になりましたが、デモのための機能が失われました。ともかく" -"下記が実行結果です:" +"プログラムは簡単になり、説明のためにいくつかの機能を省きました。\n" +"出力を見てみましょう。" -#: ../../howto/argparse.rst:733 msgid "" "$ python prog.py 4 2\n" "4^2 == 16\n" @@ -1112,6 +1451,18 @@ msgid "" "usage: prog.py [-h] [-v | -q] x y\n" "prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" msgstr "" +"$ python prog.py 4 2\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -q\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4 to the power 2 equals 16\n" +"$ python prog.py 4 2 -vq\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose\n" +"$ python prog.py 4 2 -v --quiet\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" #: ../../howto/argparse.rst:748 msgid "" @@ -1131,7 +1482,6 @@ msgstr "" "結びの前に、恐らくあなたはプログラムの主な目的をユーザに伝えたいでしょう。万" "が一、彼らがそれを知らないときに備えて::" -#: ../../howto/argparse.rst:755 msgid "" "import argparse\n" "\n" @@ -1152,6 +1502,24 @@ msgid "" "else:\n" " print(f\"{args.x}^{args.y} == {answer}\")" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(description=\"calculate X to the power of " +"Y\")\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" #: ../../howto/argparse.rst:773 msgid "" @@ -1162,7 +1530,6 @@ msgstr "" "使用方法のテキストが少し変化しました。``[-v | -q]`` は ``-v`` または ``-q`` " "のどちらかを使用できるが、同時に両方を使用できないことを意味します:" -#: ../../howto/argparse.rst:777 ../../howto/argparse.rst:804 msgid "" "$ python prog.py --help\n" "usage: prog.py [-h] [-v | -q] x y\n" @@ -1178,6 +1545,19 @@ msgid "" " -v, --verbose\n" " -q, --quiet" msgstr "" +"$ python prog.py --help\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"\n" +"calculate X to the power of Y\n" +"\n" +"positional arguments:\n" +" x the base\n" +" y the exponent\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose\n" +" -q, --quiet" #: ../../howto/argparse.rst:795 msgid "How to translate the argparse output" @@ -1217,9 +1597,8 @@ msgstr "" "す。たとえば、 `Babel `__ を使い、次のコマンドを実" "行します。" -#: ../../howto/argparse.rst:827 msgid "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" -msgstr "" +msgstr "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" #: ../../howto/argparse.rst:831 msgid "" @@ -1239,11 +1618,12 @@ msgstr "" "システム上の :mod:`argparse` モジュールの場所は、次のスクリプトで調べられま" "す::" -#: ../../howto/argparse.rst:838 msgid "" "import argparse\n" "print(argparse.__file__)" msgstr "" +"import argparse\n" +"print(argparse.__file__)" #: ../../howto/argparse.rst:841 msgid "" @@ -1263,33 +1643,39 @@ msgstr "" ":mod:`argparse` 出力内のあなたの文字列を翻訳するには、 :mod:`gettext` を使い" "ます。" -#: ../../howto/argparse.rst:848 msgid "Custom type converters" -msgstr "" +msgstr "独自の型変換" -#: ../../howto/argparse.rst:850 msgid "" "The :mod:`argparse` module allows you to specify custom type converters for " "your command-line arguments. This allows you to modify user input before " "it's stored in the :class:`argparse.Namespace`. This can be useful when you " "need to pre-process the input before it is used in your program." msgstr "" +":mod:`argparse` モジュールでは、コマンドライン引数に独自の型変換処理を指定で" +"きます。\n" +"これにより、利用者の入力を :class:`argparse.Namespace` に格納する前に変換でき" +"ます。\n" +"プログラムで入力を使う前に前処理が必要な場合に役立ちます。" -#: ../../howto/argparse.rst:855 msgid "" "When using a custom type converter, you can use any callable that takes a " "single string argument (the argument value) and returns the converted value. " "However, if you need to handle more complex scenarios, you can use a custom " "action class with the **action** parameter instead." msgstr "" +"独自の型変換処理には、引数の値を表す文字列を 1 つ受け取り、変換した値を返す任" +"意の呼び出し可能オブジェクトを使えます。\n" +"もっと複雑な処理が必要な場合は、代わりに **action** 引数で独自のアクションク" +"ラスを指定できます。" -#: ../../howto/argparse.rst:860 msgid "" "For example, let's say you want to handle arguments with different prefixes " "and process them accordingly::" msgstr "" +"例えば、異なるプレフィクスの引数を受け取り、それぞれに応じて処理したいとしま" +"す。 ::" -#: ../../howto/argparse.rst:863 msgid "" "import argparse\n" "\n" @@ -1303,37 +1689,52 @@ msgid "" "args = parser.parse_args()\n" "print(args)" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(prefix_chars='-+')\n" +"\n" +"parser.add_argument('-a', metavar='', action='append',\n" +" type=lambda x: ('-', x))\n" +"parser.add_argument('+a', metavar='', action='append',\n" +" type=lambda x: ('+', x))\n" +"\n" +"args = parser.parse_args()\n" +"print(args)" -#: ../../howto/argparse.rst:877 msgid "" "$ python prog.py -a value1 +a value2\n" "Namespace(a=[('-', 'value1'), ('+', 'value2')])" msgstr "" +"$ python prog.py -a value1 +a value2\n" +"Namespace(a=[('-', 'value1'), ('+', 'value2')])" -#: ../../howto/argparse.rst:882 msgid "In this example, we:" -msgstr "" +msgstr "この例では、次のことを行っています。" -#: ../../howto/argparse.rst:884 msgid "" "Created a parser with custom prefix characters using the ``prefix_chars`` " "parameter." msgstr "" +"``prefix_chars`` 引数を使い、独自のプレフィクス文字を持つパーサを作りました。" -#: ../../howto/argparse.rst:887 msgid "" "Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " "to create custom type converters to store the value in a tuple with the " "prefix." msgstr "" +"``-a`` と ``+a`` という 2 つの引数を定義しました。\n" +"それぞれの ``type`` 引数で独自の型変換処理を指定し、値をプレフィクスと一緒に" +"タプルに格納するようにしました。" -#: ../../howto/argparse.rst:890 msgid "" "Without the custom type converters, the arguments would have treated the ``-" "a`` and ``+a`` as the same argument, which would have been undesirable. By " "using custom type converters, we were able to differentiate between the two " "arguments." msgstr "" +"独自の型変換処理がなければ、``-a`` と ``+a`` は同じ引数として扱われ、望ましく" +"ない結果になります。\n" +"型変換処理を使うことで、2 つの引数を区別できました。" #: ../../howto/argparse.rst:895 msgid "Conclusion" diff --git a/howto/cporting.po b/howto/cporting.po index 228048a6e..6c3803bd9 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -50,10 +50,13 @@ msgstr "" "`Porting guide`_ は *py3c* プロジェクトにより提供される、補助コード付きの見解" "提案です。" -#: ../../howto/cporting.rst:17 msgid "" ":ref:`Recommended third party tools ` offer abstractions over " "the Python's C API. Extensions generally need to be re-written to use one of " "them, but the library then handles differences between various Python " "versions and implementations." msgstr "" +":ref:`推奨されるサードパーティーツール ` は、Python の C API を" +"抽象化した機能を提供します。\n" +"これらを使うには通常、拡張を書き直す必要がありますが、その後はライブラリが " +"Python のバージョンや実装の違いを扱ってくれます。" diff --git a/howto/curses.po b/howto/curses.po index 1707288b5..5e71b4d67 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -75,7 +75,6 @@ msgstr "" "みのUnixです。ほかにも、OSのインストーラや、カーネル設定などのツールで、これ" "らはグラフィカルサポートが利用可能になる前に動作する必要があります。" -#: ../../howto/curses.rst:35 msgid "" "The curses library provides fairly basic functionality, providing the " "programmer with an abstraction of a display containing multiple non-" @@ -86,6 +85,17 @@ msgid "" "interface concepts such as buttons, checkboxes, or dialogs; if you need such " "features, consider a user interface library such as :pypi:`Urwid`." msgstr "" +"curses ライブラリが提供するのは比較的基本的な機能です。\n" +"画面を、互いに重ならない複数のテキストウィンドウとして扱う仕組みを提供しま" +"す。\n" +"ウィンドウの内容は、テキストの追加や削除、見た目の変更など、さまざまな方法で" +"変更できます。\n" +"curses ライブラリは、意図した表示にするために端末へ送る制御コードを判断しま" +"す。\n" +"ボタン、チェックボックス、ダイアログなどのユーザーインターフェース部品の多く" +"は提供しません。\n" +"そのような機能が必要なら、:pypi:`Urwid` などのユーザーインターフェースライブ" +"ラリを検討してください。" #: ../../howto/curses.rst:45 msgid "" @@ -108,18 +118,19 @@ msgstr "" "述べる全ての関数が利用できるはずです。しかし、古いバージョンの curses を持つ" "いくつかのプロプライエタリ Unix は全てには対応していないでしょう。" -#: ../../howto/curses.rst:55 msgid "" "The Windows version of Python doesn't include the :mod:`curses` module. The " "third-party :pypi:`windows-curses` package provides the same interface on " "Windows." msgstr "" +"Windows 版の Python には :mod:`curses` モジュールが含まれていません。\n" +"サードパーティーの :pypi:`windows-curses` パッケージが、Windows で同じイン" +"ターフェースを提供します。" #: ../../howto/curses.rst:60 msgid "The Python curses module" msgstr "Python の curses module" -#: ../../howto/curses.rst:62 msgid "" "The Python module is a fairly simple wrapper over the C functions provided " "by curses; if you're already familiar with curses programming in C, it's " @@ -129,6 +140,13 @@ msgid "" "mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see " "this covered in more detail later." msgstr "" +"Python のモジュールは、curses が提供する C 関数の比較的単純なラッパです。\n" +"C での curses プログラミングに慣れていれば、その知識を Python でも簡単に生か" +"せます。\n" +"最大の違いは、Python のインターフェースでは :c:func:`!addstr`、:c:func:`!" +"mvaddstr`、:c:func:`!mvwaddstr` のような別々の C 関数を 1 つの :meth:" +"`~curses.window.addstr` メソッドにまとめ、扱いやすくしていることです。\n" +"詳しくは後で説明します。" #: ../../howto/curses.rst:70 msgid "" @@ -147,7 +165,6 @@ msgstr "" msgid "Starting and ending a curses application" msgstr "curses アプリケーションの起動と終了" -#: ../../howto/curses.rst:79 msgid "" "Before doing anything, curses must be initialized. This is done by calling " "the :func:`~curses.initscr` function, which will determine the terminal " @@ -156,23 +173,31 @@ msgid "" "object representing the entire screen; this is usually called ``stdscr`` " "after the name of the corresponding C variable. ::" msgstr "" +"何をするにしても、まず curses を初期化する必要があります。\n" +":func:`~curses.initscr` 関数を呼び出すと、端末の種類を判定し、必要な設定コー" +"ドを端末へ送り、内部の各種データ構造を作成します。\n" +"成功すると、:func:`!initscr` は画面全体を表すウィンドウオブジェクトを返しま" +"す。\n" +"これは対応する C の変数名にちなんで、通常 ``stdscr`` と呼ばれます。 ::" -#: ../../howto/curses.rst:87 msgid "" "import curses\n" "stdscr = curses.initscr()" msgstr "" +"import curses\n" +"stdscr = curses.initscr()" -#: ../../howto/curses.rst:90 msgid "" "Usually curses applications turn off automatic echoing of keys to the " "screen, in order to be able to read keys and only display them under certain " "circumstances. This requires calling the :func:`~curses.noecho` function. ::" msgstr "" +"通常、curses アプリケーションではキー入力を自動的に画面へ表示する機能 (エ" +"コー) を無効にし、キーを読み取った後、必要な場合にだけ表示します。\n" +"そのためには :func:`~curses.noecho` 関数を呼び出します。 ::" -#: ../../howto/curses.rst:95 msgid "curses.noecho()" -msgstr "" +msgstr "curses.noecho()" #: ../../howto/curses.rst:97 msgid "" @@ -184,11 +209,9 @@ msgstr "" "する必要があります; これは cbreak モードと呼ばれ、通常の入力がバッファされる" "モードと逆に動作します。 ::" -#: ../../howto/curses.rst:101 msgid "curses.cbreak()" -msgstr "" +msgstr "curses.cbreak()" -#: ../../howto/curses.rst:103 msgid "" "Terminals usually return special keys, such as the cursor keys or navigation " "keys such as Page Up and Home, as a multibyte escape sequence. While you " @@ -197,15 +220,14 @@ msgid "" "const:`curses.KEY_LEFT`. To get curses to do the job, you'll have to enable " "keypad mode. ::" msgstr "" -"端末は通常、カーソルキーや Page Up や Home といった操作キーなどの特別なキーを" -"マルチバイトエスケープシーケンスとして返します。それらのシーケンスを想定して" -"対応する処理を行うアプリケーションを書けるように、 curses はそれを :const:" -"`curses.KEY_LEFT` のような特別な値を返して行ってくれます。 curses にその仕事" -"をさせるには、キーパッドモードを有効にする必要があります。 ::" +"端末は通常、カーソルキーや Page Up、Home などの特殊キーを、複数バイトのエス" +"ケープシーケンスとして返します。\n" +"これらのシーケンスを自分で処理することもできますが、curses に任せると :const:" +"`curses.KEY_LEFT` のような特別な値として受け取れます。\n" +"そのためには、キーパッドモードを有効にします。 ::" -#: ../../howto/curses.rst:110 msgid "stdscr.keypad(True)" -msgstr "" +msgstr "stdscr.keypad(True)" #: ../../howto/curses.rst:112 msgid "" @@ -215,12 +237,14 @@ msgstr "" "curses アプリケーションを終了させるのは起動よりも簡単です。 以下を呼び出す必" "要があります::" -#: ../../howto/curses.rst:115 msgid "" "curses.nocbreak()\n" "stdscr.keypad(False)\n" "curses.echo()" msgstr "" +"curses.nocbreak()\n" +"stdscr.keypad(False)\n" +"curses.echo()" #: ../../howto/curses.rst:119 msgid "" @@ -231,11 +255,9 @@ msgstr "" "cursesに親和性の高い設定をもとに戻します。そして、:func:`~curses.endwin` 関数" "を呼び出し、端末を通常の操作モードに復旧します。 ::" -#: ../../howto/curses.rst:123 msgid "curses.endwin()" -msgstr "" +msgstr "curses.endwin()" -#: ../../howto/curses.rst:125 msgid "" "A common problem when debugging a curses application is to get your terminal " "messed up when the application dies without restoring the terminal to its " @@ -243,11 +265,11 @@ msgid "" "raises an uncaught exception. Keys are no longer echoed to the screen when " "you type them, for example, which makes using the shell difficult." msgstr "" -"curses アプリケーションをデバッグするときの一般的な問題は、アプリケーションが" -"端末を以前の状態に復旧することなく異常終了したときに端末がめちゃめちゃになる" -"ことです。Python ではこの問題はコードにバグがあって、捕捉できない例外が発生し" -"たときによく起きます。タイプしたキーはもはやエコーされません、例えば、シェル" -"を使うのが難しくなります。" +"curses アプリケーションのデバッグでよくある問題は、端末の状態を復元する前にア" +"プリケーションが終了し、端末がおかしな状態のままになることです。\n" +"Python では、コードのバグで例外が発生し、それが捕捉されなかった場合によく起こ" +"ります。\n" +"例えば、入力したキーが画面に表示されなくなり、シェルを使いにくくなります。" #: ../../howto/curses.rst:131 msgid "" @@ -257,7 +279,6 @@ msgstr "" "Pythonでは、これらの複雑さを避けデバッグをより容易にするために、 :func:" "`curses.wrapper` 関数をインポートして、このように使います::" -#: ../../howto/curses.rst:134 msgid "" "from curses import wrapper\n" "\n" @@ -275,8 +296,22 @@ msgid "" "\n" "wrapper(main)" msgstr "" +"from curses import wrapper\n" +"\n" +"def main(stdscr):\n" +" # 画面を消去する\n" +" stdscr.clear()\n" +"\n" +" # i == 10 のとき ZeroDivisionError が発生する。\n" +" for i in range(0, 11):\n" +" v = i-10\n" +" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n" +"\n" +" stdscr.refresh()\n" +" stdscr.getkey()\n" +"\n" +"wrapper(main)" -#: ../../howto/curses.rst:150 msgid "" "The :func:`~curses.wrapper` function takes a callable object and does the " "initializations described above, also initializing colors if color support " @@ -288,19 +323,29 @@ msgid "" "funny state on exception and you'll be able to read the exception's message " "and traceback." msgstr "" +":func:`~curses.wrapper` 関数は呼び出し可能オブジェクトを受け取り、上記の初期" +"化を行います。\n" +"色がサポートされていれば、色の初期化も行います。\n" +"その後、:func:`!wrapper` は渡された呼び出し可能オブジェクトを実行します。\n" +"その呼び出しから戻ると、:func:`!wrapper` は端末をもとの状態に戻します。\n" +"呼び出しは :keyword:`try`...\\ :keyword:`except` の中で行われ、例外が発生する" +"と、それを捕捉して端末の状態を復元してから再送出します。\n" +"そのため、例外が発生しても端末が異常な状態のままにならず、例外のメッセージや" +"トレースバックを読めます。" #: ../../howto/curses.rst:164 msgid "Windows and Pads" msgstr "ウィンドウとパッド" -#: ../../howto/curses.rst:166 msgid "" "Windows are the basic abstraction in curses. A window object represents a " "rectangular area of the screen, and supports methods to display text, erase " "it, allow the user to input strings, and so forth." msgstr "" +"curses の基本となる抽象化はウィンドウです。\n" +"ウィンドウオブジェクトは画面上の長方形の領域を表し、テキストの表示や消去、利" +"用者による文字列の入力などのメソッドを備えています。" -#: ../../howto/curses.rst:170 msgid "" "The ``stdscr`` object returned by the :func:`~curses.initscr` function is a " "window object that covers the entire screen. Many programs may need only " @@ -309,15 +354,22 @@ msgid "" "newwin` function creates a new window of a given size, returning the new " "window object. ::" msgstr "" +":func:`~curses.initscr` 関数が返す ``stdscr`` オブジェクトは、画面全体を覆う" +"ウィンドウオブジェクトです。\n" +"多くのプログラムはこのウィンドウだけで十分ですが、個別に再描画や消去を行うた" +"めに、画面を小さなウィンドウに分けたい場合もあるでしょう。\n" +":func:`~curses.newwin` 関数は、指定されたサイズの新しいウィンドウを作り、その" +"ウィンドウオブジェクトを返します。 ::" -#: ../../howto/curses.rst:177 msgid "" "begin_x = 20; begin_y = 7\n" "height = 5; width = 40\n" "win = curses.newwin(height, width, begin_y, begin_x)" msgstr "" +"begin_x = 20; begin_y = 7\n" +"height = 5; width = 40\n" +"win = curses.newwin(height, width, begin_y, begin_x)" -#: ../../howto/curses.rst:181 msgid "" "Note that the coordinate system used in curses is unusual. Coordinates are " "always passed in the order *y,x*, and the top-left corner of a window is " @@ -326,23 +378,33 @@ msgid "" "difference from most other computer applications, but it's been part of " "curses since it was first written, and it's too late to change things now." msgstr "" +"curses の座標系は独特なので注意してください。\n" +"座標は常に *y,x* の順に渡し、ウィンドウの左上隅が (0,0) です。\n" +"これは *x* 座標を先にする通常の慣習と異なります。\n" +"ほかの多くのアプリケーションと違うのは残念ですが、curses の最初の実装からこの" +"方式なので、今から変更するには遅すぎます。" -#: ../../howto/curses.rst:189 msgid "" "Your application can determine the size of the screen by using the :data:" "`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* " "sizes. Legal coordinates will then extend from ``(0,0)`` to ``(curses.LINES " "- 1, curses.COLS - 1)``." msgstr "" +"画面のサイズは、:data:`curses.LINES` と :data:`curses.COLS` 変数からそれぞれ " +"*y* 方向と *x* 方向の大きさを取得して調べられます。\n" +"有効な座標の範囲は ``(0,0)`` から ``(curses.LINES - 1, curses.COLS - 1)`` ま" +"でです。" -#: ../../howto/curses.rst:194 msgid "" "When you call a method to display or erase text, the effect doesn't " "immediately show up on the display. Instead you must call the :meth:" "`~curses.window.refresh` method of window objects to update the screen." msgstr "" +"テキストを表示または消去するメソッドを呼び出しても、その結果はすぐには画面に" +"現れません。\n" +"画面を更新するには、ウィンドウオブジェクトの :meth:`~curses.window.refresh` " +"メソッドを呼び出す必要があります。" -#: ../../howto/curses.rst:199 msgid "" "This is because curses was originally written with slow 300-baud terminal " "connections in mind; with these terminals, minimizing the time required to " @@ -352,8 +414,15 @@ msgid "" "window and then clears the window, there's no need to send the original text " "because they're never visible." msgstr "" +"これは、curses が当初、300 ボーという低速な端末接続を想定して書かれたためで" +"す。\n" +"そのような端末では、画面の再描画にかかる時間を最小限にすることが非常に重要で" +"した。\n" +"そこで curses は画面への変更を蓄積し、:meth:`!refresh` が呼ばれたときに最も効" +"率的な方法で表示します。\n" +"例えば、プログラムがウィンドウにテキストを表示してからそのウィンドウを消去し" +"た場合、テキストは実際には表示されないので、端末へ送る必要がありません。" -#: ../../howto/curses.rst:208 msgid "" "In practice, explicitly telling curses to redraw a window doesn't really " "complicate programming with curses much. Most programs go into a flurry of " @@ -362,8 +431,13 @@ msgid "" "redrawn before pausing to wait for user input, by first calling :meth:`!" "stdscr.refresh` or the :meth:`!refresh` method of some other relevant window." msgstr "" +"実際には、ウィンドウの再描画を明示的に指示しても、curses のプログラミングはそ" +"れほど複雑になりません。\n" +"多くのプログラムは一連の処理を行った後、キー入力などの利用者の操作を待って休" +"止します。\n" +"入力待ちに入る前に :meth:`!stdscr.refresh` または必要なほかのウィンドウの :" +"meth:`!refresh` を呼び出し、画面を再描画しておけばよいのです。" -#: ../../howto/curses.rst:216 msgid "" "A pad is a special case of a window; it can be larger than the actual " "display screen, and only a portion of the pad displayed at a time. Creating " @@ -371,8 +445,11 @@ msgid "" "giving the coordinates of the on-screen area where a subsection of the pad " "will be displayed. ::" msgstr "" +"パッドは特殊なウィンドウです。\n" +"実際の画面より大きくでき、一度に表示するのはその一部だけです。\n" +"作成時にはパッドの高さと幅を指定し、更新時にはパッドの一部を表示する画面上の" +"領域の座標を指定します。 ::" -#: ../../howto/curses.rst:222 msgid "" "pad = curses.newpad(100, 100)\n" "# These loops fill the pad with letters; addch() is\n" @@ -389,8 +466,21 @@ msgid "" "# : filled with pad content.\n" "pad.refresh( 0,0, 5,5, 20,75)" msgstr "" +"pad = curses.newpad(100, 100)\n" +"# このループでパッドを文字で埋める。addch() は\n" +"# 次の節で説明する。\n" +"for y in range(0, 99):\n" +" for x in range(0, 99):\n" +" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n" +"\n" +"# 画面中央にパッドの一部を表示する。\n" +"# (0,0) : 表示するパッド領域の左上隅の座標。\n" +"# (5,5) : パッドの内容を表示するウィンドウ領域の\n" +"# 左上隅の座標。\n" +"# (20, 75) : パッドの内容を表示するウィンドウ領域の\n" +"# : 右下隅の座標。\n" +"pad.refresh( 0,0, 5,5, 20,75)" -#: ../../howto/curses.rst:237 msgid "" "The :meth:`!refresh` call displays a section of the pad in the rectangle " "extending from coordinate (5,5) to coordinate (20,75) on the screen; the " @@ -398,13 +488,20 @@ msgid "" "Beyond that difference, pads are exactly like ordinary windows and support " "the same methods." msgstr "" +":meth:`!refresh` の呼び出しは、画面上の座標 (5,5) から (20,75) までの長方形" +"に、パッドの一部を表示します。\n" +"表示する部分の左上隅は、パッド上の座標 (0,0) です。\n" +"この点以外は、パッドは通常のウィンドウとまったく同じで、同じメソッドを使えま" +"す。" -#: ../../howto/curses.rst:243 msgid "" "If you have multiple windows and pads on screen there is a more efficient " "way to update the screen and prevent annoying screen flicker as each part of " "the screen gets updated. :meth:`!refresh` actually does two things:" msgstr "" +"画面上に複数のウィンドウやパッドがある場合は、各部分の更新に伴うちらつきを防" +"ぎ、画面をより効率的に更新する方法があります。\n" +":meth:`!refresh` は実際には次の 2 つの処理を行っています。" msgid "" "Calls the :meth:`~curses.window.noutrefresh` method of each window to update " @@ -421,17 +518,17 @@ msgstr "" ":func:`~curses.doupdate` 関数を呼び出して、データ構造に記録された望ましい状態" "に合致するように、物理スクリーンを更新します。" -#: ../../howto/curses.rst:254 msgid "" "Instead you can call :meth:`!noutrefresh` on a number of windows to update " "the data structure, and then call :func:`!doupdate` to update the screen." msgstr "" +"代わりに、複数のウィンドウで :meth:`!noutrefresh` を呼んでデータ構造を更新" +"し、その後 :func:`!doupdate` を呼んで画面を更新できます。" #: ../../howto/curses.rst:260 msgid "Displaying Text" msgstr "テキストの表示" -#: ../../howto/curses.rst:262 msgid "" "From a C programmer's point of view, curses may sometimes look like a twisty " "maze of functions, all subtly different. For example, :c:func:`!addstr` " @@ -442,6 +539,14 @@ msgid "" "default. :c:func:`!mvwaddstr` allows specifying both a window and a " "coordinate." msgstr "" +"C プログラマから見ると、curses は少しずつ異なる関数が入り組んだ迷路のように見" +"えることがあります。\n" +"例えば、:c:func:`!addstr` は ``stdscr`` ウィンドウの現在のカーソル位置に文字" +"列を表示し、:c:func:`!mvaddstr` は先に指定された y,x 座標へ移動してから表示し" +"ます。\n" +":c:func:`!waddstr` は :c:func:`!addstr` と同様ですが、デフォルトの " +"``stdscr`` の代わりに、使うウィンドウを指定できます。\n" +":c:func:`!mvwaddstr` ではウィンドウと座標の両方を指定できます。" #: ../../howto/curses.rst:271 msgid "" @@ -511,7 +616,6 @@ msgstr "" "属性によって表示するテキストをハイライトすることができます、ボールド体、アン" "ダーライン、反転、カラーなど。より詳しくは次の小節で説明します。" -#: ../../howto/curses.rst:298 msgid "" "The :meth:`~curses.window.addstr` method takes a Python string or bytestring " "as the value to be displayed. The contents of bytestrings are sent to the " @@ -520,22 +624,32 @@ msgid "" "this defaults to the default system encoding as returned by :func:`locale." "getencoding`." msgstr "" +":meth:`~curses.window.addstr` メソッドは、表示する値として Python の文字列ま" +"たはバイト列を受け取ります。\n" +"バイト列の内容はそのまま端末へ送られます。\n" +"ワイド文字に対応していないビルドでは、文字列はウィンドウの :attr:`~window." +"encoding` 属性の値でエンコードされます。\n" +"この属性のデフォルト値は、:func:`locale.getencoding` が返すシステムのデフォル" +"トエンコーディングです。" -#: ../../howto/curses.rst:306 msgid "" "The :meth:`~curses.window.addch` methods take a character, which can be " "either a string of length 1, a bytestring of length 1, or an integer." msgstr "" +":meth:`~curses.window.addch` メソッドは文字を受け取ります。\n" +"文字は、長さ 1 の文字列、長さ 1 のバイト列、または整数で指定できます。" -#: ../../howto/curses.rst:309 msgid "" "Constants are provided for the characters of the terminal's alternate " "character set. For example, :const:`ACS_PLMINUS` is a +/- symbol, and :const:" "`ACS_ULCORNER` is the upper left corner of a box (handy for drawing " "borders). You can also use the appropriate Unicode character." msgstr "" +"端末の代替文字集合の文字に対応する定数が用意されています。\n" +"例えば、:const:`ACS_PLMINUS` は +/- 記号、:const:`ACS_ULCORNER` は枠の左上隅" +"で、罫線を描くのに便利です。\n" +"対応する Unicode 文字を使うこともできます。" -#: ../../howto/curses.rst:316 msgid "" "Windows remember where the cursor was left after the last operation, so if " "you leave out the *y,x* coordinates, the string or character will be " @@ -545,14 +659,13 @@ msgid "" "some location where it won't be distracting; it can be confusing to have the " "cursor blinking at some apparently random location." msgstr "" -"ウィンドウは最後の操作の後のカーソル位置を覚えているため、 *y,x* 座標をうっか" -"り忘れてしまっても、文字列や文字は最後の操作位置に表示されます。 ``move(y," -"x)`` メソッドでカーソルを移動させることもできます。常に点滅するカーソルを表示" -"する端末もあるため、カーソルが特定の位置にいることを保証して注意が反れないよ" -"うにしたいと思うかもしれません; ランダムに見える位置でカーソルが点滅すると面" -"を食らってしまいます。" +"ウィンドウは最後の操作後のカーソル位置を覚えているので、*y,x* 座標を省略する" +"と、文字列や文字は直前の操作でカーソルが残った位置に表示されます。\n" +"``move(y,x)`` メソッドでカーソルを移動することもできます。\n" +"常に点滅するカーソルを表示する端末もあるので、邪魔にならない位置にカーソルを" +"置くとよいでしょう。\n" +"無関係に見える場所でカーソルが点滅すると、混乱を招くことがあります。" -#: ../../howto/curses.rst:324 msgid "" "If your application doesn't need a blinking cursor at all, you can call " "``curs_set(False)`` to make it invisible. The window method :meth:`~curses." @@ -560,18 +673,27 @@ msgid "" "leaves the cursor wherever the last update put it, instead of moving it back " "to the window's cursor position." msgstr "" +"アプリケーションで点滅するカーソルがまったく必要なければ、" +"``curs_set(False)`` を呼んで非表示にできます。\n" +"ウィンドウの :meth:`~curses.window.leaveok` メソッドは、それとは異なる働きを" +"します。\n" +"引数が真の場合、curses はカーソルをウィンドウのカーソル位置に戻さず、最後の更" +"新で移動した位置に残します。" #: ../../howto/curses.rst:333 msgid "Attributes and Color" msgstr "属性とカラー" -#: ../../howto/curses.rst:335 msgid "" "Characters can be displayed in different ways. Status lines in a text-based " "application are commonly shown in reverse video, or a text viewer may need " "to highlight certain words. curses supports this by allowing you to specify " "an attribute for each cell on the screen." msgstr "" +"文字にはさまざまな表示方法があります。\n" +"テキストベースのアプリケーションではステータス行を反転表示することが多く、テ" +"キストビューアでは特定の単語を強調表示したい場合があります。\n" +"curses では画面上の各セルに属性を指定して、これらを実現できます。" #: ../../howto/curses.rst:340 msgid "" @@ -648,12 +770,14 @@ msgstr "" "つまり、反転するステータスラインを画面の最上部に表示するには、コードをこうし" "ます::" -#: ../../howto/curses.rst:366 msgid "" "stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n" " curses.A_REVERSE)\n" "stdscr.refresh()" msgstr "" +"stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n" +" curses.A_REVERSE)\n" +"stdscr.refresh()" #: ../../howto/curses.rst:370 msgid "" @@ -665,7 +789,6 @@ msgstr "" "す。そんな端末の中で最も一般的なものは Linux コンソールで、color xterm もそれ" "に続きます。" -#: ../../howto/curses.rst:374 msgid "" "To use color, you must call the :func:`~curses.start_color` function soon " "after calling :func:`~curses.initscr`, to initialize the default color set " @@ -676,8 +799,16 @@ msgid "" "to the British spelling, you'll have to resign yourself to misspelling it " "for the sake of these functions.)" msgstr "" +"色を使うには、:func:`~curses.initscr` の直後に :func:`~curses.start_color` を" +"呼び出し、デフォルトの色を初期化する必要があります (:func:`curses.wrapper` は" +"これを自動的に行います)。\n" +"初期化後、使用中の端末が実際にカラー表示に対応していれば、:func:`~curses." +"has_colors` は真を返します。\n" +"なお、curses はカナダやイギリスの綴り colour ではなく、アメリカの綴り color " +"を使います。\n" +"イギリス式の綴りに慣れている方も、これらの関数では「綴り間違い」を我慢してく" +"ださい。" -#: ../../howto/curses.rst:384 msgid "" "The curses library maintains a finite number of color pairs, containing a " "foreground (or text) color and a background color. You can get the " @@ -686,16 +817,23 @@ msgid "" "as :const:`A_REVERSE`, but again, such combinations are not guaranteed to " "work on all terminals." msgstr "" +"curses ライブラリは、前景色 (文字の色) と背景色からなる有限個のカラーペアを管" +"理します。\n" +":func:`~curses.color_pair` 関数で、カラーペアに対応する属性値を取得できま" +"す。\n" +"この値は :const:`A_REVERSE` などのほかの属性とビット単位の OR で組み合わせら" +"れますが、その組み合わせがすべての端末で動くとは限りません。" #: ../../howto/curses.rst:391 msgid "An example, which displays a line of text using color pair 1::" msgstr "例として、テキスト行をカラーペア 1 を使って表示します::" -#: ../../howto/curses.rst:393 msgid "" "stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n" "stdscr.refresh()" msgstr "" +"stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n" +"stdscr.refresh()" #: ../../howto/curses.rst:396 msgid "" @@ -705,7 +843,6 @@ msgid "" "hard-wired to white on black, and cannot be changed." msgstr "" -#: ../../howto/curses.rst:401 msgid "" "Colors are numbered, and :func:`start_color` initializes 8 basic colors when " "it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:" @@ -713,6 +850,12 @@ msgid "" "named constants for each of these colors: :const:`curses.COLOR_BLACK`, :" "const:`curses.COLOR_RED`, and so forth." msgstr "" +"色には番号が付いており、:func:`start_color` はカラーモードを有効にするときに " +"8 つの基本色を初期化します。\n" +"0 は黒、1 は赤、2 は緑、3 は黄、4 は青、5 はマゼンタ、6 はシアン、7 は白で" +"す。\n" +":mod:`curses` モジュールは各色に :const:`curses.COLOR_BLACK`、:const:`curses." +"COLOR_RED` などの定数を定義しています。" #: ../../howto/curses.rst:407 msgid "" @@ -722,22 +865,20 @@ msgstr "" "やってみましょう。カラー 1 を白背景に赤に変更してみましょう、こうして呼び出し" "ます::" -#: ../../howto/curses.rst:410 msgid "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)" -msgstr "" +msgstr "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)" -#: ../../howto/curses.rst:412 msgid "" "When you change a color pair, any text already displayed using that color " "pair will change to the new colors. You can also display new text in this " "color with::" msgstr "" -"カラーペアを変更するときには、既に表示された任意のテキストが利用するカラーペ" -"アを新しい色に変更します。新しいテキストをこの色で使うこともできます::" +"カラーペアを変更すると、そのペアを使って既に表示されているテキストも新しい色" +"になります。\n" +"次のように、その色で新たなテキストを表示することもできます。 ::" -#: ../../howto/curses.rst:416 msgid "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))" -msgstr "" +msgstr "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))" #: ../../howto/curses.rst:418 msgid "" @@ -755,41 +896,51 @@ msgstr "" msgid "User Input" msgstr "ユーザ入力" -#: ../../howto/curses.rst:431 msgid "" "The C curses library offers only very simple input mechanisms. Python's :mod:" "`curses` module adds a basic text-input widget. (Other libraries such as :" "pypi:`Urwid` have more extensive collections of widgets.)" msgstr "" +"C の curses ライブラリが提供する入力機能は、ごく単純なものだけです。\n" +"Python の :mod:`curses` モジュールは、基本的なテキスト入力ウィジェットを追加" +"しています。\n" +"(:pypi:`Urwid` などのほかのライブラリには、より豊富なウィジェットがありま" +"す。)" -#: ../../howto/curses.rst:435 msgid "There are three methods for getting input from a window:" -msgstr "" +msgstr "ウィンドウから入力を取得するメソッドは 3 つあります。" -#: ../../howto/curses.rst:437 msgid "" ":meth:`~curses.window.get_wch` refreshes the screen and then waits for the " "user to hit a key, displaying the key if :func:`~curses.echo` has been " "called earlier. You can optionally specify a coordinate to which the cursor " "should be moved before pausing." msgstr "" +":meth:`~curses.window.get_wch` は画面を更新してから、利用者のキー入力を待ちま" +"す。\n" +"事前に :func:`~curses.echo` が呼ばれていれば、入力されたキーを表示します。\n" +"待機する前にカーソルを移動する座標を指定することもできます。" -#: ../../howto/curses.rst:442 msgid "" ":meth:`~curses.window.getch` does the same thing but returns the code of the " "key instead of a character. With ncurses this is a single byte of the key's " "encoding in the current locale, so a character encoded with several bytes " "takes several calls, one byte per call." msgstr "" +":meth:`~curses.window.getch` は同じ処理をしますが、文字の代わりにキーのコード" +"を返します。\n" +"ncurses では、これは現在のロケールでエンコードされたキーの 1 バイトなので、複" +"数バイトの文字を読むには、1 回に 1 バイトずつ複数回呼び出す必要があります。" -#: ../../howto/curses.rst:448 msgid "" ":meth:`~curses.window.getkey` does the same as :meth:`!getch` but returns a " "string: an ordinary key as a 1-character string, and a special key as its " "name, such as ``KEY_UP``." msgstr "" +":meth:`~curses.window.getkey` は :meth:`!getch` と同じ処理をしますが、文字列" +"を返します。\n" +"通常のキーは 1 文字の文字列、特殊キーは ``KEY_UP`` のような名前になります。" -#: ../../howto/curses.rst:453 msgid "" "It's possible to not wait for the user using the :meth:`~curses.window." "nodelay` window method. After ``nodelay(True)``, the reads for the window " @@ -800,6 +951,16 @@ msgid "" "specified delay (measured in tenths of a second), the read fails the same " "way." msgstr "" +"ウィンドウの :meth:`~curses.window.nodelay` メソッドを使うと、利用者の入力を" +"待たずに済むようにできます。\n" +"``nodelay(True)`` の後は、そのウィンドウの読み取りはノンブロッキングになりま" +"す。\n" +"入力がない場合、:meth:`!get_wch` と :meth:`!getkey` は例外を送出し、:meth:`!" +"getch` は ``-1`` を返します。\n" +"また、:func:`~curses.halfdelay` を使うと、実質的に各読み取りにタイマーを設定" +"できます。\n" +"指定した待ち時間 (0.1 秒単位) 内に入力がなければ、読み取りは同じように失敗し" +"ます。" #: ../../howto/curses.rst:464 msgid "" @@ -810,7 +971,6 @@ msgid "" "KEY_LEFT`. The main loop of your program may look something like this::" msgstr "" -#: ../../howto/curses.rst:472 msgid "" "while True:\n" " c = stdscr.get_wch()\n" @@ -821,8 +981,15 @@ msgid "" " elif c == curses.KEY_HOME:\n" " x = y = 0" msgstr "" +"while True:\n" +" c = stdscr.get_wch()\n" +" if c == 'p':\n" +" PrintDocument()\n" +" elif c == 'q':\n" +" break # while ループを抜ける\n" +" elif c == curses.KEY_HOME:\n" +" x = y = 0" -#: ../../howto/curses.rst:481 msgid "" "The :mod:`curses.ascii` module supplies ASCII class membership functions " "that take either integer or 1-character string arguments; these may be " @@ -831,8 +998,12 @@ msgid "" "arguments and return the same type. For example, :func:`curses.ascii.ctrl` " "returns the control character corresponding to its argument." msgstr "" +":mod:`curses.ascii` モジュールには、整数または 1 文字の文字列を受け取り、" +"ASCII の文字分類を判定する関数があります。\n" +"こうしたループの条件判定を読みやすく書くのに役立つでしょう。\n" +"また、整数または 1 文字の文字列を受け取り、同じ型を返す変換関数もあります。\n" +"例えば、:func:`curses.ascii.ctrl` は引数に対応する制御文字を返します。" -#: ../../howto/curses.rst:488 msgid "" "There's also a method to retrieve an entire line, :meth:`~curses.window." "getstr`. It isn't used very often, because its functionality is quite " @@ -840,24 +1011,35 @@ msgid "" "and the Enter key, which terminates the line. It returns a bytes object, and " "can optionally be limited to a fixed number of bytes. ::" msgstr "" +"1 行全体を取得する :meth:`~curses.window.getstr` メソッドもあります。\n" +"機能がかなり限られるため、あまり使われません。\n" +"編集に使えるのは文字消去文字、行消去文字と、行を確定する Enter キーだけで" +"す。\n" +"バイト列オブジェクトを返し、取得するバイト数に上限を設けることもできます。 ::" -#: ../../howto/curses.rst:495 msgid "" "curses.echo() # Enable echoing of characters\n" "\n" "# Get a line of at most 15 bytes, with the cursor on the top line\n" "s = stdscr.getstr(0,0, 15)" msgstr "" +"curses.echo() # 入力文字の表示を有効にする\n" +"\n" +"# カーソルを最上行に置き、最大 15 バイトの行を取得する\n" +"s = stdscr.getstr(0,0, 15)" -#: ../../howto/curses.rst:500 msgid "" "The :mod:`curses.textpad` module supplies a text box that supports an Emacs-" "like set of keybindings. Various methods of the :class:`~curses.textpad." "Textbox` class support editing with input validation and gathering the edit " "results either with or without trailing spaces. Here's an example::" msgstr "" +":mod:`curses.textpad` モジュールは、Emacs に似たキーバインドを使えるテキスト" +"ボックスを提供します。\n" +":class:`~curses.textpad.Textbox` の各種メソッドでは、入力を検証しながら編集し" +"たり、末尾の空白を残すか取り除くかを選んで編集結果を取得したりできます。\n" +"次に例を示します。 ::" -#: ../../howto/curses.rst:506 msgid "" "import curses\n" "from curses.textpad import Textbox, rectangle\n" @@ -877,6 +1059,23 @@ msgid "" " # Get resulting contents\n" " message = box.gather()" msgstr "" +"import curses\n" +"from curses.textpad import Textbox, rectangle\n" +"\n" +"def main(stdscr):\n" +" stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n" +"\n" +" editwin = curses.newwin(5,30, 2,1)\n" +" rectangle(stdscr, 1,0, 1+5+1, 1+30+1)\n" +" stdscr.refresh()\n" +"\n" +" box = Textbox(editwin)\n" +"\n" +" # Ctrl-G が押されるまで、利用者に編集させる。\n" +" box.edit()\n" +"\n" +" # 編集結果を取得する\n" +" message = box.gather()" #: ../../howto/curses.rst:524 msgid "" @@ -901,7 +1100,6 @@ msgstr "" "Python の :mod:`curses` モジュールのライブラリページはいまやかなり充実してい" "ます。次はこれを見るべきです。" -#: ../../howto/curses.rst:535 msgid "" "If you're in doubt about the detailed behavior of the curses functions, " "consult the manual pages for your curses implementation, whether it's " @@ -909,8 +1107,12 @@ msgid "" "quirks, and provide complete lists of all the functions, attributes, and :" "ref:`ACS_\\* ` characters available to you." msgstr "" +"curses 関数の詳しい動作に疑問があれば、使用している実装が ncurses であって" +"も、プロプライエタリな Unix ベンダーのものであっても、その実装のマニュアル" +"ページを参照してください。\n" +"特有の動作に加え、利用可能なすべての関数、属性、:ref:`ACS_\\* ` 文字の一覧が記載されています。" -#: ../../howto/curses.rst:542 msgid "" "Because the curses API is so large, some functions aren't supported in the " "Python interface. Often this isn't because they're difficult to implement, " @@ -919,21 +1121,30 @@ msgid "" "would be welcome; see `the Python Developer's Guide `_ to learn more about submitting patches to Python." msgstr "" +"curses の API は非常に大きいため、Python のインターフェースではサポートしてい" +"ない関数もあります。\n" +"多くの場合、実装が難しいからではなく、まだ誰も必要としていないためです。\n" +"また、Python はまだ ncurses に付属するメニューライブラリにも対応していませ" +"ん。\n" +"これらへの対応を追加するパッチを歓迎します。\n" +"Python へのパッチの提出方法については、`Python Developer's Guide `_ を参照してください。" -#: ../../howto/curses.rst:550 msgid "" "`Writing Programs with NCURSES `_: a lengthy tutorial for C programmers." msgstr "" +"`Writing Programs with NCURSES `_: C プログラマ向けの詳しいチュートリアル。" #: ../../howto/curses.rst:552 msgid "`The ncurses man page `_" msgstr "`The ncurses man page `_" -#: ../../howto/curses.rst:553 msgid "" "`The ncurses FAQ `_" msgstr "" +"`ncurses の FAQ `_" #: ../../howto/curses.rst:554 msgid "" @@ -945,9 +1156,11 @@ msgstr "" "v=eN1eZtjLEnU>`_: curses または Urwid を使って端末を制御する PyCon 2013 講演" "ビデオです。" -#: ../../howto/curses.rst:556 msgid "" "`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk demonstrating some " "applications written using Urwid." msgstr "" +"`\"Console Applications with Urwid\" `_: Urwid で書かれたいくつかのアプリケーションを紹介" +"する PyCon CA 2012 の講演動画。" diff --git a/howto/descriptor.po b/howto/descriptor.po index e0155a342..131113675 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -69,13 +69,17 @@ msgstr "" "なメカニズムで動作しているのかを紹介します。多くの人はこのレベルの理解は不要" "でしょう。" -#: ../../howto/descriptor.rst:25 msgid "" "The last section has pure Python equivalents for built-in descriptors that " "are written in C. Read this if you're curious about how functions turn into " "bound methods or about the implementation of common tools like :deco:" "`classmethod`, :deco:`staticmethod`, :deco:`property`, and :term:`__slots__`." msgstr "" +"最後の節では、C で書かれた組み込みデスクリプタに相当する処理を、Python だけで" +"実装しています。\n" +"関数が束縛メソッドになる仕組みや、:deco:`classmethod`、:deco:" +"`staticmethod`、:deco:`property`、:term:`__slots__` といったよく使う機能の実" +"装に興味があれば、読んでみてください。" #: ../../howto/descriptor.rst:33 msgid "Primer" @@ -93,18 +97,21 @@ msgstr "" msgid "Simple example: A descriptor that returns a constant" msgstr "シンプルな例: 定数を返すデスクリプタ" -#: ../../howto/descriptor.rst:42 msgid "" "The :class:`!Ten` class is a descriptor whose :meth:`~object.__get__` method " "always returns the constant ``10``:" msgstr "" +":class:`!Ten` クラスは、:meth:`~object.__get__` メソッドが常に定数 ``10`` を" +"返すデスクリプタです。" -#: ../../howto/descriptor.rst:45 msgid "" "class Ten:\n" " def __get__(self, obj, objtype=None):\n" " return 10" msgstr "" +"class Ten:\n" +" def __get__(self, obj, objtype=None):\n" +" return 10" #: ../../howto/descriptor.rst:51 msgid "" @@ -112,12 +119,14 @@ msgid "" "class:" msgstr "このデスクリプタを使うには他のクラスのクラス変数として保存します:" -#: ../../howto/descriptor.rst:53 msgid "" "class A:\n" " x = 5 # Regular class attribute\n" " y = Ten() # Descriptor instance" msgstr "" +"class A:\n" +" x = 5 # 通常のクラス属性\n" +" y = Ten() # デスクリプタのインスタンス" #: ../../howto/descriptor.rst:59 msgid "" @@ -127,7 +136,6 @@ msgstr "" "インタラクティブセッションを使って、通常の属性ルックアップと、デスクリプタの" "ルックアップの違いを見てみましょう。" -#: ../../howto/descriptor.rst:62 msgid "" ">>> a = A() # Make an instance of class A\n" ">>> a.x # Normal attribute lookup\n" @@ -135,6 +143,11 @@ msgid "" ">>> a.y # Descriptor lookup\n" "10" msgstr "" +">>> a = A() # クラス A のインスタンスを作る\n" +">>> a.x # 通常の属性検索\n" +"5\n" +">>> a.y # デスクリプタによる属性検索\n" +"10" #: ../../howto/descriptor.rst:70 msgid "" @@ -181,7 +194,6 @@ msgid "" msgstr "" "単に定数を返すよりも、なにか処理を実行するデスクリプタの方が面白いでしょう。" -#: ../../howto/descriptor.rst:90 msgid "" "import os\n" "\n" @@ -197,16 +209,27 @@ msgid "" " def __init__(self, dirname):\n" " self.dirname = dirname # Regular instance attribute" msgstr "" +"import os\n" +"\n" +"class DirectorySize:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return len(os.listdir(obj.dirname))\n" +"\n" +"class Directory:\n" +"\n" +" size = DirectorySize() # デスクリプタのインスタンス\n" +"\n" +" def __init__(self, dirname):\n" +" self.dirname = dirname # 通常のインスタンス属性" -#: ../../howto/descriptor.rst:106 msgid "" "An interactive session shows that the lookup is dynamic — it computes " "different, updated answers each time::" msgstr "" -"インタラクティブセッションで見たように、この探索は動的です。実行ごとに異なる" -"計算を行い、毎回答えが更新されます。" +"対話セッションを見ると、属性の検索が動的に行われ、毎回、その時点の状態に応じ" +"た結果が計算されることが分かります。 ::" -#: ../../howto/descriptor.rst:109 msgid "" ">>> s = Directory('songs')\n" ">>> g = Directory('games')\n" @@ -221,8 +244,18 @@ msgid "" "updated\n" "2" msgstr "" +">>> s = Directory('songs')\n" +">>> g = Directory('games')\n" +">>> s.size # songs ディレクトリには 20 個のファ" +"イルがある\n" +"20\n" +">>> g.size # games ディレクトリには 3 個のファイ" +"ルがある\n" +"3\n" +">>> os.remove('games/chess') # ゲームを 1 つ削除する\n" +">>> g.size # ファイル数は自動的に更新される\n" +"2" -#: ../../howto/descriptor.rst:119 msgid "" "Besides showing how descriptors can run computations, this example also " "reveals the purpose of the parameters to :meth:`~object.__get__`. The " @@ -231,12 +264,18 @@ msgid "" "parameter that lets the :meth:`~object.__get__` method learn the target " "directory. The *objtype* parameter is the class *Directory*." msgstr "" +"この例は、デスクリプタが計算を実行できることに加え、:meth:`~object.__get__` " +"の仮引数の役割も示しています。\n" +"*self* は *DirectorySize* のインスタンスである *size* です。\n" +"*obj* は *Directory* のインスタンスである *g* または *s* です。\n" +":meth:`~object.__get__` は、この *obj* 引数から対象のディレクトリを知ることが" +"できます。\n" +"*objtype* はクラス *Directory* です。" #: ../../howto/descriptor.rst:128 msgid "Managed attributes" msgstr "管理された属性" -#: ../../howto/descriptor.rst:130 msgid "" "A popular use for descriptors is managing access to instance data. The " "descriptor is assigned to a public attribute in the class dictionary while " @@ -244,6 +283,11 @@ msgid "" "dictionary. The descriptor's :meth:`~object.__get__` and :meth:`~object." "__set__` methods are triggered when the public attribute is accessed." msgstr "" +"デスクリプタのよくある用途は、インスタンスデータへのアクセスの管理です。\n" +"デスクリプタはクラス辞書内の公開属性に代入し、実際のデータはインスタンス辞書" +"内のプライベート属性に保存します。\n" +"公開属性にアクセスすると、デスクリプタの :meth:`~object.__get__` や :meth:" +"`~object.__set__` が呼び出されます。" #: ../../howto/descriptor.rst:136 msgid "" @@ -255,7 +299,6 @@ msgstr "" "す。パブリックな属性がアクセスされると、デスクリプタはルックアップや更新のロ" "グ出力をします。" -#: ../../howto/descriptor.rst:140 msgid "" "import logging\n" "\n" @@ -283,6 +326,31 @@ msgid "" " def birthday(self):\n" " self.age += 1 # Calls both __get__() and __set__()" msgstr "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAgeAccess:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = obj._age\n" +" logging.info('Accessing %r giving %r', 'age', value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', 'age', value)\n" +" obj._age = value\n" +"\n" +"class Person:\n" +"\n" +" age = LoggedAgeAccess() # デスクリプタのインスタンス\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # 通常のインスタンス属性\n" +" self.age = age # __set__() を呼ぶ\n" +"\n" +" def birthday(self):\n" +" self.age += 1 # __get__() と __set__() の両方を呼ぶ" #: ../../howto/descriptor.rst:169 msgid "" @@ -292,7 +360,6 @@ msgstr "" "インタラクティブセッションの結果で見てわかるように、管理された属性の *age* の" "ログ出力が行われますが、通常の属性の *name* はログ出力されません。" -#: ../../howto/descriptor.rst:178 msgid "" ">>> mary = Person('Mary M', 30) # The initial age update is logged\n" "INFO:root:Updating 'age' to 30\n" @@ -321,6 +388,30 @@ msgid "" "INFO:root:Accessing 'age' giving 40\n" "40" msgstr "" +">>> mary = Person('Mary M', 30) # 年齢の初期設定がログに記録される\n" +"INFO:root:Updating 'age' to 30\n" +">>> dave = Person('David D', 40)\n" +"INFO:root:Updating 'age' to 40\n" +"\n" +">>> vars(mary) # 実際のデータはプライベート属性にあ" +"る\n" +"{'name': 'Mary M', '_age': 30}\n" +">>> vars(dave)\n" +"{'name': 'David D', '_age': 40}\n" +"\n" +">>> mary.age # データを取得し、そのアクセスを記録" +"する\n" +"INFO:root:Accessing 'age' giving 30\n" +"30\n" +">>> mary.birthday() # 更新もログに記録される\n" +"INFO:root:Accessing 'age' giving 30\n" +"INFO:root:Updating 'age' to 31\n" +"\n" +">>> dave.name # 通常の属性の検索は記録されない\n" +"'David D'\n" +">>> dave.age # 管理された属性だけが記録される\n" +"INFO:root:Accessing 'age' giving 40\n" +"40" #: ../../howto/descriptor.rst:203 msgid "" @@ -346,7 +437,6 @@ msgstr "" "クラスがデスクリプタを使うときに、クラスはそれぞれのデスクリプタにどのような" "変数名を使うかを通知します。" -#: ../../howto/descriptor.rst:215 msgid "" "In this example, the :class:`!Person` class has two descriptor instances, " "*name* and *age*. When the :class:`!Person` class is defined, it makes a " @@ -354,8 +444,13 @@ msgid "" "names can be recorded, giving each descriptor its own *public_name* and " "*private_name*:" msgstr "" +"この例では、:class:`!Person` クラスが *name* と *age* という 2 つのデスクリプ" +"タインスタンスを持ちます。\n" +":class:`!Person` の定義時に *LoggedAccess* の :meth:`~object.__set_name__` が" +"呼び出され、フィールド名が記録されます。\n" +"これにより、各デスクリプタが固有の *public_name* と *private_name* を持つよう" +"になります。" -#: ../../howto/descriptor.rst:220 msgid "" "import logging\n" "\n" @@ -388,27 +483,63 @@ msgid "" " def birthday(self):\n" " self.age += 1" msgstr "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAccess:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.public_name = name\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = getattr(obj, self.private_name)\n" +" logging.info('Accessing %r giving %r', self.public_name, value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', self.public_name, value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +"class Person:\n" +"\n" +" name = LoggedAccess() # 1 つ目のデスクリプタのインスタン" +"ス\n" +" age = LoggedAccess() # 2 つ目のデスクリプタのインスタン" +"ス\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # 1 つ目のデスクリプタを呼ぶ\n" +" self.age = age # 2 つ目のデスクリプタを呼ぶ\n" +"\n" +" def birthday(self):\n" +" self.age += 1" -#: ../../howto/descriptor.rst:253 msgid "" "An interactive session shows that the :class:`!Person` class has called :" "meth:`~object.__set_name__` so that the field names would be recorded. Here " "we call :func:`vars` to look up the descriptor without triggering it:" msgstr "" +"対話セッションを見ると、:class:`!Person` クラスが :meth:`~object." +"__set_name__` を呼び出し、フィールド名が記録されたことが分かります。\n" +"ここでは、デスクリプタを呼び出さずに取得するため、:func:`vars` を使います。" -#: ../../howto/descriptor.rst:257 msgid "" ">>> vars(vars(Person)['name'])\n" "{'public_name': 'name', 'private_name': '_name'}\n" ">>> vars(vars(Person)['age'])\n" "{'public_name': 'age', 'private_name': '_age'}" msgstr "" +">>> vars(vars(Person)['name'])\n" +"{'public_name': 'name', 'private_name': '_name'}\n" +">>> vars(vars(Person)['age'])\n" +"{'public_name': 'age', 'private_name': '_age'}" #: ../../howto/descriptor.rst:264 msgid "The new class now logs access to both *name* and *age*:" msgstr "新しいクラスは *name* と *age* の両方でログを出力します。" -#: ../../howto/descriptor.rst:272 msgid "" ">>> pete = Person('Peter P', 10)\n" "INFO:root:Updating 'name' to 'Peter P'\n" @@ -417,36 +548,50 @@ msgid "" "INFO:root:Updating 'name' to 'Catherine C'\n" "INFO:root:Updating 'age' to 20" msgstr "" +">>> pete = Person('Peter P', 10)\n" +"INFO:root:Updating 'name' to 'Peter P'\n" +"INFO:root:Updating 'age' to 10\n" +">>> kate = Person('Catherine C', 20)\n" +"INFO:root:Updating 'name' to 'Catherine C'\n" +"INFO:root:Updating 'age' to 20" #: ../../howto/descriptor.rst:281 msgid "The two *Person* instances contain only the private names:" msgstr "2つの *Person* のインスタンスは、プライベート名しか保持していません。" -#: ../../howto/descriptor.rst:283 msgid "" ">>> vars(pete)\n" "{'_name': 'Peter P', '_age': 10}\n" ">>> vars(kate)\n" "{'_name': 'Catherine C', '_age': 20}" msgstr "" +">>> vars(pete)\n" +"{'_name': 'Peter P', '_age': 10}\n" +">>> vars(kate)\n" +"{'_name': 'Catherine C', '_age': 20}" #: ../../howto/descriptor.rst:292 msgid "Closing thoughts" msgstr "まとめ" -#: ../../howto/descriptor.rst:294 msgid "" "A :term:`descriptor` is what we call any object that defines :meth:`~object." "__get__`, :meth:`~object.__set__`, or :meth:`~object.__delete__`." msgstr "" +":meth:`~object.__get__`、:meth:`~object.__set__`、:meth:`~object.__delete__` " +"のいずれかを定義するオブジェクトを :term:`descriptor` と呼びます。" -#: ../../howto/descriptor.rst:297 msgid "" "Optionally, descriptors can have a :meth:`~object.__set_name__` method. " "This is only used in cases where a descriptor needs to know either the class " "where it was created or the name of class variable it was assigned to. " "(This method, if present, is called even if the class is not a descriptor.)" msgstr "" +"デスクリプタには、必要に応じて :meth:`~object.__set_name__` メソッドを定義で" +"きます。\n" +"これは、デスクリプタが、自身が定義されたクラスや代入先のクラス変数名を知る必" +"要がある場合に使います。\n" +"(このメソッドがあれば、そのクラスがデスクリプタでなくても呼び出されます。)" #: ../../howto/descriptor.rst:302 msgid "" @@ -486,13 +631,17 @@ msgstr "" "したが、デスクリプタはその関係を逆転させ、検索されているデータが問題に介入で" "きるようにします。" -#: ../../howto/descriptor.rst:316 msgid "" "Descriptors are used throughout the language. It is how functions turn into " "bound methods. Common tools like :deco:`classmethod`, :deco:" "`staticmethod`, :deco:`property`, and :deco:`functools.cached_property` are " "all implemented as descriptors." msgstr "" +"デスクリプタは Python の至る所で使われています。\n" +"関数が束縛メソッドになるのも、この仕組みによるものです。\n" +":deco:`classmethod`、:deco:`staticmethod`、:deco:`property`、:deco:" +"`functools.cached_property` といったよく使う機能は、すべてデスクリプタとして" +"実装されています。" #: ../../howto/descriptor.rst:323 msgid "Complete Practical Example" @@ -522,13 +671,13 @@ msgstr "" "す。もし制限に合わなければ、例外を送出し、データが不正な状態になるのを防ぎま" "す。" -#: ../../howto/descriptor.rst:337 msgid "" "This :class:`!Validator` class is both an :term:`abstract base class` and a " "managed attribute descriptor:" msgstr "" +"この :class:`!Validator` クラスは、:term:`abstract base class` であると同時" +"に、属性へのアクセスを管理するデスクリプタでもあります。" -#: ../../howto/descriptor.rst:340 msgid "" "from abc import ABC, abstractmethod\n" "\n" @@ -548,12 +697,30 @@ msgid "" " def validate(self, value):\n" " pass" msgstr "" +"from abc import ABC, abstractmethod\n" +"\n" +"class Validator(ABC):\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return getattr(obj, self.private_name)\n" +"\n" +" def __set__(self, obj, value):\n" +" self.validate(value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +" @abstractmethod\n" +" def validate(self, value):\n" +" pass" -#: ../../howto/descriptor.rst:360 msgid "" "Custom validators need to inherit from :class:`!Validator` and must supply " "a :meth:`!validate` method to test various restrictions as needed." msgstr "" +"独自のバリデータは :class:`!Validator` を継承し、必要な制約を検査する :meth:" +"`!validate` メソッドを実装しなければなりません。" #: ../../howto/descriptor.rst:365 msgid "Custom validators" @@ -564,27 +731,31 @@ msgid "Here are three practical data validation utilities:" msgstr "" "ここでは3つの実践的なバリデーションのユーティリティのサンプルを紹介します。" -#: ../../howto/descriptor.rst:369 msgid "" ":class:`!OneOf` verifies that a value is one of a restricted set of options." msgstr "" +":class:`!OneOf` は、値が指定された選択肢のいずれかであることを検証します。" -#: ../../howto/descriptor.rst:371 msgid "" ":class:`!Number` verifies that a value is either an :class:`int` or :class:" "`float`. Optionally, it verifies that a value is between a given minimum or " "maximum." msgstr "" +":class:`!Number` は、値が :class:`int` または :class:`float` であることを検証" +"します。\n" +"必要に応じて、指定された最小値以上、最大値以下であることも検証します。" -#: ../../howto/descriptor.rst:375 msgid "" ":class:`!String` verifies that a value is a :class:`str`. Optionally, it " "validates a given minimum or maximum length. It can validate a user-defined " "`predicate `_ " "as well." msgstr "" +":class:`!String` は、値が :class:`str` であることを検証します。\n" +"必要に応じて、指定された最小長や最大長の条件も検証します。\n" +"利用者が定義した `述語 `_ による検証もできます。" -#: ../../howto/descriptor.rst:380 msgid "" "class OneOf(Validator):\n" "\n" @@ -639,6 +810,58 @@ msgid "" " f'Expected {self.predicate} to be true for {value!r}'\n" " )" msgstr "" +"class OneOf(Validator):\n" +"\n" +" def __init__(self, *options):\n" +" self.options = set(options)\n" +"\n" +" def validate(self, value):\n" +" if value not in self.options:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be one of {self.options!r}'\n" +" )\n" +"\n" +"class Number(Validator):\n" +"\n" +" def __init__(self, minvalue=None, maxvalue=None):\n" +" self.minvalue = minvalue\n" +" self.maxvalue = maxvalue\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, (int, float)):\n" +" raise TypeError(f'Expected {value!r} to be an int or float')\n" +" if self.minvalue is not None and value < self.minvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be at least {self.minvalue!r}'\n" +" )\n" +" if self.maxvalue is not None and value > self.maxvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no more than {self.maxvalue!r}'\n" +" )\n" +"\n" +"class String(Validator):\n" +"\n" +" def __init__(self, minsize=None, maxsize=None, predicate=None):\n" +" self.minsize = minsize\n" +" self.maxsize = maxsize\n" +" self.predicate = predicate\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, str):\n" +" raise TypeError(f'Expected {value!r} to be a str')\n" +" if self.minsize is not None and len(value) < self.minsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no smaller than {self.minsize!" +"r}'\n" +" )\n" +" if self.maxsize is not None and len(value) > self.maxsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no bigger than {self.maxsize!r}'\n" +" )\n" +" if self.predicate is not None and not self.predicate(value):\n" +" raise ValueError(\n" +" f'Expected {self.predicate} to be true for {value!r}'\n" +" )" #: ../../howto/descriptor.rst:436 msgid "Practical application" @@ -648,7 +871,6 @@ msgstr "実践的なアプリケーション" msgid "Here's how the data validators can be used in a real class:" msgstr "次のコードは実際のクラスでデータバリデータを使う方法のサンプルです。" -#: ../../howto/descriptor.rst:440 msgid "" "class Component:\n" "\n" @@ -661,12 +883,21 @@ msgid "" " self.kind = kind\n" " self.quantity = quantity" msgstr "" +"class Component:\n" +"\n" +" name = String(minsize=3, maxsize=10, predicate=str.isupper)\n" +" kind = OneOf('wood', 'metal', 'plastic')\n" +" quantity = Number(minvalue=0)\n" +"\n" +" def __init__(self, name, kind, quantity):\n" +" self.name = name\n" +" self.kind = kind\n" +" self.quantity = quantity" #: ../../howto/descriptor.rst:453 msgid "The descriptors prevent invalid instances from being created:" msgstr "これらのデスクリプタは、不正インスタンスが作成されるのを防ぎます。" -#: ../../howto/descriptor.rst:455 msgid "" ">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all " "uppercase\n" @@ -692,6 +923,29 @@ msgid "" "\n" ">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" msgstr "" +">>> Component('Widget', 'metal', 5) # 拒否: 'Widget' はすべて大文字では" +"ない\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected to be true for " +"'Widget'\n" +"\n" +">>> Component('WIDGET', 'metle', 5) # 拒否: 'metle' は綴りが違う\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected 'metle' to be one of {'metal', 'plastic', 'wood'}\n" +"\n" +">>> Component('WIDGET', 'metal', -5) # 拒否: -5 は負数\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected -5 to be at least 0\n" +"\n" +">>> Component('WIDGET', 'metal', 'V') # 拒否: 'V' は数値ではない\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: Expected 'V' to be an int or float\n" +"\n" +">>> c = Component('WIDGET', 'metal', 5) # 許可: 入力は有効" #: ../../howto/descriptor.rst:481 msgid "Technical Tutorial" @@ -729,13 +983,17 @@ msgstr "" msgid "Definition and introduction" msgstr "定義と導入" -#: ../../howto/descriptor.rst:500 msgid "" "In general, a descriptor is an attribute value that has one of the methods " "in the descriptor protocol. Those methods are :meth:`~object.__get__`, :" "meth:`~object.__set__`, and :meth:`~object.__delete__`. If any of those " "methods are defined for an attribute, it is said to be a :term:`descriptor`." msgstr "" +"一般に、デスクリプタとは、デスクリプタプロトコルのメソッドのいずれかを持つ属" +"性値です。\n" +"そのメソッドは :meth:`~object.__get__`、:meth:`~object.__set__`、:meth:" +"`~object.__delete__` です。\n" +"これらのいずれかが定義された属性を :term:`descriptor` と呼びます。" #: ../../howto/descriptor.rst:505 msgid "" @@ -756,7 +1014,6 @@ msgstr "" "デスクリプタメソッドを呼び出します。これがどの連鎖順位で行われるかは、どのデ" "スクリプタメソッドが定義されているかに依ります。" -#: ../../howto/descriptor.rst:514 msgid "" "Descriptors are a powerful, general purpose protocol. They are the " "mechanism behind properties, methods, static methods, class methods, and :" @@ -764,6 +1021,11 @@ msgid "" "the underlying C code and offer a flexible set of new tools for everyday " "Python programs." msgstr "" +"デスクリプタは強力で汎用的なプロトコルです。\n" +"プロパティ、メソッド、静的メソッド、クラスメソッド、:func:`super` を支える仕" +"組みであり、Python 自身の至る所で使われています。\n" +"デスクリプタは内部の C コードを簡潔にし、日常的な Python プログラムにも柔軟な" +"道具を提供します。" #: ../../howto/descriptor.rst:522 msgid "Descriptor protocol" @@ -791,13 +1053,16 @@ msgstr "" "リプタとみなされ、探索された際のデフォルトの振る舞いをオーバーライドできま" "す。" -#: ../../howto/descriptor.rst:534 msgid "" "If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, " "it is considered a data descriptor. Descriptors that only define :meth:" "`~object.__get__` are called non-data descriptors (they are often used for " "methods but other uses are possible)." msgstr "" +":meth:`~object.__set__` または :meth:`~object.__delete__` を定義するオブジェ" +"クトは、データデスクリプタとみなされます。\n" +":meth:`~object.__get__` だけを定義するものは非データデスクリプタと呼ばれ、メ" +"ソッドによく使われますが、ほかの用途にも使えます。" #: ../../howto/descriptor.rst:539 msgid "" @@ -813,13 +1078,17 @@ msgstr "" "ます。インスタンスの辞書に、非データデスクリプタと同名の項目があれば、辞書の" "項目の方が優先されます。" -#: ../../howto/descriptor.rst:545 msgid "" "To make a read-only data descriptor, define both :meth:`~object.__get__` " "and :meth:`~object.__set__` with the :meth:`~object.__set__` raising an :exc:" "`AttributeError` when called. Defining the :meth:`~object.__set__` method " "with an exception raising placeholder is enough to make it a data descriptor." msgstr "" +"読み取り専用のデータデスクリプタを作るには、:meth:`~object.__get__` と :meth:" +"`~object.__set__` の両方を定義し、:meth:`~object.__set__` が呼ばれたら :exc:" +"`AttributeError` を送出するようにします。\n" +"例外を送出するだけの :meth:`~object.__set__` を定義すれば、データデスクリプタ" +"になります。" #: ../../howto/descriptor.rst:552 msgid "Overview of descriptor invocation" @@ -841,13 +1110,15 @@ msgstr "" "しかし、属性アクセスの際に自動的に呼び出されるのが、一般的なデスクリプタの呼" "び出し方法です。" -#: ../../howto/descriptor.rst:560 msgid "" "The expression ``obj.x`` looks up the attribute ``x`` in the chain of " "namespaces for ``obj``. If the search finds a descriptor outside of the " "instance :attr:`~object.__dict__`, its :meth:`~object.__get__` method is " "invoked according to the precedence rules listed below." msgstr "" +"式 ``obj.x`` は、``obj`` の名前空間の連鎖から属性 ``x`` を探します。\n" +"インスタンスの :attr:`~object.__dict__` 以外でデスクリプタが見つかると、以下" +"の優先順位に従って :meth:`~object.__get__` が呼び出されます。" #: ../../howto/descriptor.rst:565 msgid "" @@ -861,13 +1132,16 @@ msgstr "" msgid "Invocation from an instance" msgstr "インスタンスからの呼び出し" -#: ../../howto/descriptor.rst:572 msgid "" "Instance lookup scans through a chain of namespaces giving data descriptors " "the highest priority, followed by instance variables, then non-data " "descriptors, then class variables, and lastly :meth:`~object.__getattr__` if " "it is provided." msgstr "" +"インスタンスの属性検索は名前空間の連鎖をたどり、データデスクリプタを最優先に" +"します。\n" +"次にインスタンス変数、非データデスクリプタ、クラス変数を調べ、最後に、定義さ" +"れていれば :meth:`~object.__getattr__` を呼び出します。" #: ../../howto/descriptor.rst:577 msgid "" @@ -885,7 +1159,6 @@ msgstr "" "ドットによるルックアップのロジックは\\ :meth:`object.__getattribute__` の中で" "行われます。ピュアPythonで表した等価なロジックは次の通りです。" -#: ../../howto/descriptor.rst:583 msgid "" "def find_name_in_mro(cls, name, default):\n" " \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n" @@ -913,24 +1186,56 @@ msgid "" " return cls_var # class variable\n" " raise AttributeError(name)" msgstr "" +"def find_name_in_mro(cls, name, default):\n" +" \"Objects/typeobject.c の _PyType_Lookup() を模擬する\"\n" +" for base in cls.__mro__:\n" +" if name in vars(base):\n" +" return vars(base)[name]\n" +" return default\n" +"\n" +"def object_getattribute(obj, name):\n" +" \"Objects/object.c の PyObject_GenericGetAttr() を模擬する\"\n" +" null = sentinel('null')\n" +" objtype = type(obj)\n" +" cls_var = find_name_in_mro(objtype, name, null)\n" +" descr_get = getattr(type(cls_var), '__get__', null)\n" +" if descr_get is not null:\n" +" if (hasattr(type(cls_var), '__set__')\n" +" or hasattr(type(cls_var), '__delete__')):\n" +" return descr_get(cls_var, obj, objtype) # データデスクリプ" +"タ\n" +" if hasattr(obj, '__dict__') and name in vars(obj):\n" +" return vars(obj)[name] # インスタンス変数\n" +" if descr_get is not null:\n" +" return descr_get(cls_var, obj, objtype) # 非データデスクリプ" +"タ\n" +" if cls_var is not null:\n" +" return cls_var # クラス変数\n" +" raise AttributeError(name)" -#: ../../howto/descriptor.rst:719 msgid "" "Note, there is no :meth:`~object.__getattr__` hook in the :meth:`~object." "__getattribute__` code. That is why calling :meth:`~object." "__getattribute__` directly or with ``super().__getattribute__`` will bypass :" "meth:`~object.__getattr__` entirely." msgstr "" +":meth:`~object.__getattribute__` のコード内には :meth:`~object.__getattr__` " +"フックがないことに注意してください。\n" +"そのため、:meth:`~object.__getattribute__` を直接呼んだり ``super()." +"__getattribute__`` で呼んだりすると、:meth:`~object.__getattr__` はまったく呼" +"ばれません。" -#: ../../howto/descriptor.rst:723 msgid "" "Instead, it is the dot operator and the :func:`getattr` function that are " "responsible for invoking :meth:`~object.__getattr__` whenever :meth:`~object." "__getattribute__` raises an :exc:`AttributeError`. Their logic is " "encapsulated in a helper function:" msgstr "" +"代わりに、:meth:`~object.__getattribute__` が :exc:`AttributeError` を送出し" +"たときに :meth:`~object.__getattr__` を呼び出すのは、ドット演算子と :func:" +"`getattr` 関数です。\n" +"その処理は、次の補助関数にまとめられます。" -#: ../../howto/descriptor.rst:728 msgid "" "def getattr_hook(obj, name):\n" " \"Emulate slot_tp_getattr_hook() in Objects/typeobject.c\"\n" @@ -941,41 +1246,52 @@ msgid "" " raise\n" " return type(obj).__getattr__(obj, name) # __getattr__" msgstr "" +"def getattr_hook(obj, name):\n" +" \"Objects/typeobject.c の slot_tp_getattr_hook() を模擬する\"\n" +" try:\n" +" return obj.__getattribute__(name)\n" +" except AttributeError:\n" +" if not hasattr(type(obj), '__getattr__'):\n" +" raise\n" +" return type(obj).__getattr__(obj, name) # __getattr__" #: ../../howto/descriptor.rst:773 msgid "Invocation from a class" msgstr "クラスからの呼び出し" -#: ../../howto/descriptor.rst:775 msgid "" "The logic for a dotted lookup such as ``A.x`` is in :meth:`!type." "__getattribute__`. The steps are similar to those for :meth:`!object." "__getattribute__` but the instance dictionary lookup is replaced by a search " "through the class's :term:`method resolution order`." msgstr "" +"``A.x`` のようなドット記法による検索の処理は、:meth:`!type.__getattribute__` " +"にあります。\n" +"手順は :meth:`!object.__getattribute__` と似ていますが、インスタンス辞書の検" +"索が、そのクラスの :term:`method resolution order` に従う検索に置き換わりま" +"す。" -#: ../../howto/descriptor.rst:780 msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." msgstr "" -"``a.x`` に対するデスクリプタが見つかった場合、 ``desc.__get__(None, A)`` とい" -"う形式で呼び出されます。" +"デスクリプタが見つかると、``desc.__get__(None, A)`` として呼び出されます。" msgid "" "The full C implementation can be found in :c:func:`!type_getattro` and :c:" "func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." msgstr "" -"完全な C での実装は :source:`Objects/typeobject.c` の中の :c:func:`!" -"type_getattro` と :c :func:`!_PyType_Lookup` を参照してください。" +"完全な C 実装は、:source:`Objects/typeobject.c` の :c:func:`!type_getattro` " +"と :c:func:`!_PyType_Lookup` にあります。" #: ../../howto/descriptor.rst:787 msgid "Invocation from super" msgstr "superからの呼び出し" -#: ../../howto/descriptor.rst:789 msgid "" "The logic for super's dotted lookup is in the :meth:`~object." "__getattribute__` method for object returned by :func:`super`." msgstr "" +"``super`` のドット記法による検索の処理は、:func:`super` が返すオブジェクト" +"の :meth:`~object.__getattribute__` メソッドにあります。" msgid "" "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." @@ -1004,20 +1320,21 @@ msgstr "" msgid "Summary of invocation logic" msgstr "呼び出しロジックのまとめ" -#: ../../howto/descriptor.rst:806 msgid "" "The mechanism for descriptors is embedded in the :meth:`~object." "__getattribute__` methods for :class:`object`, :class:`type`, and :func:" "`super`." msgstr "" +"デスクリプタの仕組みは、:class:`object`、:class:`type`、:func:`super` の :" +"meth:`~object.__getattribute__` メソッドに組み込まれています。" #: ../../howto/descriptor.rst:809 msgid "The important points to remember are:" msgstr "憶えておくべき重要な点は:" -#: ../../howto/descriptor.rst:811 msgid "Descriptors are invoked by the :meth:`~object.__getattribute__` method." msgstr "" +"デスクリプタは :meth:`~object.__getattribute__` メソッドから呼び出されます。" #: ../../howto/descriptor.rst:813 msgid "" @@ -1053,7 +1370,6 @@ msgstr "" msgid "Automatic name notification" msgstr "名前の自動通知" -#: ../../howto/descriptor.rst:832 msgid "" "Sometimes it is desirable for a descriptor to know what class variable name " "it was assigned to. When a new class is created, the :class:`type` " @@ -1062,6 +1378,13 @@ msgid "" "called with two arguments. The *owner* is the class where the descriptor is " "used, and the *name* is the class variable the descriptor was assigned to." msgstr "" +"デスクリプタが、代入先のクラス変数名を知りたい場合があります。\n" +"新しいクラスが作られると、メタクラス :class:`type` はそのクラスの辞書を調べま" +"す。\n" +"デスクリプタであるエントリーに :meth:`~object.__set_name__` が定義されていれ" +"ば、2 つの引数を渡して呼び出します。\n" +"*owner* はデスクリプタを使っているクラス、*name* はデスクリプタが代入されたク" +"ラス変数の名前です。" #: ../../howto/descriptor.rst:839 msgid "" @@ -1071,12 +1394,15 @@ msgstr "" "実装の詳細は :source:`Objects/typeobject.c` の中の :c:func:`!type_new` と :c:" "func:`!set_names` を参照してください。" -#: ../../howto/descriptor.rst:842 msgid "" "Since the update logic is in :meth:`!type.__new__`, notifications only take " "place at the time of class creation. If descriptors are added to the class " "afterwards, :meth:`~object.__set_name__` will need to be called manually." msgstr "" +"この更新処理は :meth:`!type.__new__` にあるため、通知はクラスの作成時にだけ行" +"われます。\n" +"後からクラスにデスクリプタを追加した場合は、:meth:`~object.__set_name__` を手" +"動で呼び出す必要があります。" #: ../../howto/descriptor.rst:848 msgid "ORM example" @@ -1102,7 +1428,6 @@ msgstr "" "タンスは、データベースのテーブルへのキーのみを保持します。デスクリプタがルッ" "クアップや更新をします。" -#: ../../howto/descriptor.rst:858 msgid "" "class Field:\n" "\n" @@ -1119,15 +1444,29 @@ msgid "" " conn.execute(self.store, [value, obj.key])\n" " conn.commit()" msgstr "" +"class Field:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.fetch = f'SELECT {name} FROM {owner.table} WHERE {owner.key}" +"=?;'\n" +" self.store = f'UPDATE {owner.table} SET {name}=? WHERE {owner.key}" +"=?;'\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return conn.execute(self.fetch, [obj.key]).fetchone()[0]\n" +"\n" +" def __set__(self, obj, value):\n" +" conn.execute(self.store, [value, obj.key])\n" +" conn.commit()" -#: ../../howto/descriptor.rst:873 msgid "" "We can use the :class:`!Field` class to define `models `_ that describe the schema for each table in a " "database:" msgstr "" +":class:`!Field` クラスを使うと、データベースの各テーブルのスキーマを表す `モ" +"デル `_ を定義できます。" -#: ../../howto/descriptor.rst:877 msgid "" "class Movie:\n" " table = 'Movies' # Table name\n" @@ -1148,16 +1487,35 @@ msgid "" " def __init__(self, key):\n" " self.key = key" msgstr "" +"class Movie:\n" +" table = 'Movies' # テーブル名\n" +" key = 'title' # 主キー\n" +" director = Field()\n" +" year = Field()\n" +"\n" +" def __init__(self, key):\n" +" self.key = key\n" +"\n" +"class Song:\n" +" table = 'Music'\n" +" key = 'title'\n" +" artist = Field()\n" +" year = Field()\n" +" genre = Field()\n" +"\n" +" def __init__(self, key):\n" +" self.key = key" #: ../../howto/descriptor.rst:898 msgid "To use the models, first connect to the database::" msgstr "モデルを使用するにはまずデータベースに接続します::" -#: ../../howto/descriptor.rst:900 msgid "" ">>> import sqlite3\n" ">>> conn = sqlite3.connect('entertainment.db')" msgstr "" +">>> import sqlite3\n" +">>> conn = sqlite3.connect('entertainment.db')" #: ../../howto/descriptor.rst:903 msgid "" @@ -1167,7 +1525,6 @@ msgstr "" "次のインタラクティブセッションでは、データベースからのデータの取得と、更新方" "法を示しています。" -#: ../../howto/descriptor.rst:931 msgid "" ">>> Movie('Star Wars').director\n" "'George Lucas'\n" @@ -1182,8 +1539,20 @@ msgid "" ">>> Movie('Star Wars').director\n" "'J.J. Abrams'" msgstr "" - -#: ../../howto/descriptor.rst:952 +">>> Movie('Star Wars').director\n" +"'George Lucas'\n" +">>> jaws = Movie('Jaws')\n" +">>> f'Released in {jaws.year} by {jaws.director}'\n" +"'Released in 1975 by Steven Spielberg'\n" +"\n" +">>> Song('Country Roads').artist\n" +"'John Denver'\n" +"\n" +">>> Movie('Star Wars').director = 'J.J. Abrams'\n" +">>> Movie('Star Wars').director\n" +"'J.J. Abrams'" + +#: ../../howto/descriptor.rst:952 msgid "Pure Python Equivalents" msgstr "ピュアPythonの等価実装" @@ -1212,9 +1581,8 @@ msgstr "" ":func:`property` を呼び出すことで、属性へアクセスすると関数の呼び出しを引き起" "こす、データデスクリプタを簡潔に組み立てられます。シグネチャはこうです::" -#: ../../howto/descriptor.rst:966 msgid "property(fget=None, fset=None, fdel=None, doc=None) -> property" -msgstr "" +msgstr "property(fget=None, fset=None, fdel=None, doc=None) -> property" #: ../../howto/descriptor.rst:968 msgid "" @@ -1223,7 +1591,6 @@ msgstr "" "このドキュメントでは、管理された属性 ``x`` を定義する典型的な使用法を示しま" "す:" -#: ../../howto/descriptor.rst:970 msgid "" "class C:\n" " def getx(self): return self.__x\n" @@ -1231,15 +1598,20 @@ msgid "" " def delx(self): del self.__x\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" msgstr "" +"class C:\n" +" def getx(self): return self.__x\n" +" def setx(self, value): self.__x = value\n" +" def delx(self): del self.__x\n" +" x = property(getx, setx, delx, \"I'm the 'x' property.\")" -#: ../../howto/descriptor.rst:992 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent that implements most of the core " "functionality:" msgstr "" +":func:`property` がデスクリプタプロトコルでどのように実装されているかを見るた" +"め、主要な機能の大部分を Python だけで実装した等価なコードを示します。" -#: ../../howto/descriptor.rst:995 msgid "" "class Property:\n" " \"Emulate PyProperty_Type() in Objects/descrobject.c\"\n" @@ -1281,15 +1653,54 @@ msgid "" " def deleter(self, fdel):\n" " return type(self)(self.fget, self.fset, fdel, self.__doc__)" msgstr "" +"class Property:\n" +" \"Objects/descrobject.c の PyProperty_Type() を模擬する\"\n" +"\n" +" def __init__(self, fget=None, fset=None, fdel=None, doc=None):\n" +" self.fget = fget\n" +" self.fset = fset\n" +" self.fdel = fdel\n" +" if doc is None and fget is not None:\n" +" doc = fget.__doc__\n" +" self.__doc__ = doc\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.__name__ = name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" if obj is None:\n" +" return self\n" +" if self.fget is None:\n" +" raise AttributeError\n" +" return self.fget(obj)\n" +"\n" +" def __set__(self, obj, value):\n" +" if self.fset is None:\n" +" raise AttributeError\n" +" self.fset(obj, value)\n" +"\n" +" def __delete__(self, obj):\n" +" if self.fdel is None:\n" +" raise AttributeError\n" +" self.fdel(obj)\n" +"\n" +" def getter(self, fget):\n" +" return type(self)(fget, self.fset, self.fdel, self.__doc__)\n" +"\n" +" def setter(self, fset):\n" +" return type(self)(self.fget, fset, self.fdel, self.__doc__)\n" +"\n" +" def deleter(self, fdel):\n" +" return type(self)(self.fget, self.fset, fdel, self.__doc__)" -#: ../../howto/descriptor.rst:1119 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -"組み込みの :func:`property` 関数は、ユーザインターフェースへの属性アクセスが" -"与えられ、続く変更がメソッドの介入を要求するときに役立ちます。" +"組み込みの :func:`property` は、利用者向けのインターフェースで属性への直接ア" +"クセスを提供していたものの、後の変更でメソッドによる処理を挟む必要が生じた場" +"合に役立ちます。" #: ../../howto/descriptor.rst:1123 msgid "" @@ -1306,7 +1717,6 @@ msgstr "" "ントコードに影響を与えたくありません。この解決策は、property データデスクリプ" "タ内に値属性へのアクセスをラップすることです:" -#: ../../howto/descriptor.rst:1129 msgid "" "class Cell:\n" " ...\n" @@ -1317,12 +1727,21 @@ msgid "" " self.recalc()\n" " return self._value" msgstr "" +"class Cell:\n" +" ...\n" +"\n" +" @property\n" +" def value(self):\n" +" \"値を返す前にセルを再計算する\"\n" +" self.recalc()\n" +" return self._value" -#: ../../howto/descriptor.rst:1140 msgid "" "Either the built-in :func:`property` or our :func:`!Property` equivalent " "would work in this example." msgstr "" +"この例では、組み込みの :func:`property` でも、それに相当する自作の :func:`!" +"Property` でも動作します。" #: ../../howto/descriptor.rst:1145 msgid "Functions and methods" @@ -1336,17 +1755,17 @@ msgstr "" "Python のオブジェクト指向機能は、関数に基づく環境の上に構築されています。非" "データデスクリプタを使って、この 2 つはシームレスに組み合わされています。" -#: ../../howto/descriptor.rst:1150 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " "prepended to the other arguments. By convention, the instance is called " "*self* but could be called *this* or any other variable name." msgstr "" -"クラス辞書に格納された関数は、実行時にメソッドに変換されます。メソッドと通常" -"の関数はオブジェクトのインスタンスが他の引数よりも前に渡される点だけが異なり" -"ます。監修ではインスタンスは *self* という名前が使われますが、 *this* や他の" -"変数名も使えます。" +"クラス辞書に格納された関数は、呼び出されるときにメソッドに変換されます。\n" +"通常の関数との違いは、ほかの引数より前にオブジェクトのインスタンスが渡される" +"ことだけです。\n" +"慣習上、このインスタンスの引数名は *self* ですが、*this* などの別の名前でも構" +"いません。" #: ../../howto/descriptor.rst:1155 msgid "" @@ -1356,7 +1775,6 @@ msgstr "" "メソッドは、ほぼ次のコードと同等な :class:`types.MethodType` を使えば手動で作" "れます。" -#: ../../howto/descriptor.rst:1158 msgid "" "class MethodType:\n" " \"Emulate PyMethod_Type in Objects/classobject.c\"\n" @@ -1384,16 +1802,44 @@ msgid "" " \"Emulate method_descr_get() in Objects/classobject.c\"\n" " return self" msgstr "" +"class MethodType:\n" +" \"Objects/classobject.c の PyMethod_Type を模擬する\"\n" +"\n" +" def __init__(self, func, obj):\n" +" self.__func__ = func\n" +" self.__self__ = obj\n" +"\n" +" def __call__(self, *args, **kwargs):\n" +" func = self.__func__\n" +" obj = self.__self__\n" +" return func(obj, *args, **kwargs)\n" +"\n" +" def __getattribute__(self, name):\n" +" \"Objects/classobject.c の method_getset() を模擬する\"\n" +" if name == '__doc__':\n" +" return self.__func__.__doc__\n" +" return object.__getattribute__(self, name)\n" +"\n" +" def __getattr__(self, name):\n" +" \"Objects/classobject.c の method_getattro() を模擬する\"\n" +" return getattr(self.__func__, name)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Objects/classobject.c の method_descr_get() を模擬する\"\n" +" return self" -#: ../../howto/descriptor.rst:1186 msgid "" "To support automatic creation of methods, functions include the :meth:" "`~object.__get__` method for binding methods during attribute access. This " "means that functions are non-data descriptors that return bound methods " "during dotted lookup from an instance. Here's how it works:" msgstr "" +"関数には、属性アクセス時にメソッドを束縛する :meth:`~object.__get__` があり、" +"メソッドを自動的に作れるようになっています。\n" +"つまり、関数は非データデスクリプタであり、インスタンスからドット記法で検索す" +"ると束縛メソッドを返します。\n" +"その仕組みは次のとおりです。" -#: ../../howto/descriptor.rst:1191 msgid "" "class Function:\n" " ...\n" @@ -1404,16 +1850,22 @@ msgid "" " return self\n" " return MethodType(self, obj)" msgstr "" +"class Function:\n" +" ...\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Objects/funcobject.c の func_descr_get() を模擬する\"\n" +" if obj is None:\n" +" return self\n" +" return MethodType(self, obj)" -#: ../../howto/descriptor.rst:1202 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -"次のクラスをインタプリタを起動すると、この関数デスクリプタが実際にどう働くか" -"を見られます::" +"次のクラスをインタープリタで実行すると、関数デスクリプタが実際にどう動くかを" +"確認できます。" -#: ../../howto/descriptor.rst:1205 msgid "" "class D:\n" " def f(self):\n" @@ -1422,6 +1874,12 @@ msgid "" "class D2:\n" " pass" msgstr "" +"class D:\n" +" def f(self):\n" +" return self\n" +"\n" +"class D2:\n" +" pass" #: ../../howto/descriptor.rst:1223 msgid "" @@ -1430,49 +1888,60 @@ msgstr "" "この関数はイントロスペクションをサポートするために :term:`qualified name` も" "持っています。" -#: ../../howto/descriptor.rst:1225 msgid "" ">>> D.f.__qualname__\n" "'D.f'" msgstr "" +">>> D.f.__qualname__\n" +"'D.f'" -#: ../../howto/descriptor.rst:1230 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`~object.__get__`. Instead, it just returns the underlying function object::" msgstr "" +"クラス辞書から関数にアクセスしても、:meth:`~object.__get__` は呼び出されませ" +"ん。\n" +"格納されている関数オブジェクトがそのまま返されます。 ::" -#: ../../howto/descriptor.rst:1233 msgid "" ">>> D.__dict__['f']\n" "" msgstr "" +">>> D.__dict__['f']\n" +"" -#: ../../howto/descriptor.rst:1236 msgid "" "Dotted access from a class calls :meth:`~object.__get__` which just returns " "the underlying function unchanged::" msgstr "" +"クラスからドット記法でアクセスすると :meth:`~object.__get__` が呼ばれますが、" +"これは元の関数をそのまま返すだけです。 ::" -#: ../../howto/descriptor.rst:1239 msgid "" ">>> D.f\n" "" msgstr "" +">>> D.f\n" +"" -#: ../../howto/descriptor.rst:1242 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`~object.__get__` which returns a bound method " "object::" msgstr "" +"興味深い動作が起きるのは、インスタンスからドット記法でアクセスしたときで" +"す。\n" +"この検索では :meth:`~object.__get__` が呼ばれ、束縛メソッドオブジェクトが返さ" +"れます。 ::" -#: ../../howto/descriptor.rst:1245 msgid "" ">>> d = D()\n" ">>> d.f\n" ">" msgstr "" +">>> d = D()\n" +">>> d.f\n" +">" #: ../../howto/descriptor.rst:1249 msgid "" @@ -1482,7 +1951,6 @@ msgstr "" "内部では、束縛メソッドはオリジナルの関数と束縛されたインスタンスを保持してい" "ます。" -#: ../../howto/descriptor.rst:1252 msgid "" ">>> d.f.__func__\n" "\n" @@ -1490,6 +1958,11 @@ msgid "" ">>> d.f.__self__\n" "<__main__.D object at 0x00B18C90>" msgstr "" +">>> d.f.__func__\n" +"\n" +"\n" +">>> d.f.__self__\n" +"<__main__.D object at 0x00B18C90>" #: ../../howto/descriptor.rst:1258 msgid "" @@ -1511,13 +1984,17 @@ msgstr "" "非データデスクリプタは、関数をメソッドに束縛する、各種の一般的なパターンに、" "単純な機構を提供します。" -#: ../../howto/descriptor.rst:1268 msgid "" "To recap, functions have a :meth:`~object.__get__` method so that they can " "be converted to a method when accessed as attributes. The non-data " "descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. " "Calling ``cls.f(*args)`` becomes ``f(*args)``." msgstr "" +"ここまでを振り返ると、関数は :meth:`~object.__get__` メソッドを持ち、属性とし" +"てアクセスされたときにメソッドに変換できます。\n" +"この非データデスクリプタは ``obj.f(*args)`` という呼び出しを ``f(obj, " +"*args)`` に変換します。\n" +"``cls.f(*args)`` は ``f(*args)`` になります。" #: ../../howto/descriptor.rst:1273 msgid "This chart summarizes the binding and its two most useful variants:" @@ -1606,29 +2083,35 @@ msgid "" msgstr "" "静的メソッドは下にある関数をそのまま返すので、呼び出しの例は面白くありません:" -#: ../../howto/descriptor.rst:1311 msgid "" "class E:\n" " @staticmethod\n" " def f(x):\n" " return x * 10" msgstr "" +"class E:\n" +" @staticmethod\n" +" def f(x):\n" +" return x * 10" -#: ../../howto/descriptor.rst:1318 msgid "" ">>> E.f(3)\n" "30\n" ">>> E().f(3)\n" "30" msgstr "" +">>> E.f(3)\n" +"30\n" +">>> E().f(3)\n" +"30" -#: ../../howto/descriptor.rst:1325 msgid "" "Using the non-data descriptor protocol, a pure Python version of :deco:" "`staticmethod` would look like this:" msgstr "" +"非データデスクリプタプロトコルを使い、:deco:`staticmethod` を Python だけで実" +"装すると、次のようになります。" -#: ../../howto/descriptor.rst:1328 msgid "" "import functools\n" "\n" @@ -1649,8 +2132,25 @@ msgid "" " def __annotations__(self):\n" " return self.f.__annotations__" msgstr "" +"import functools\n" +"\n" +"class StaticMethod:\n" +" \"Objects/funcobject.c の PyStaticMethod_Type() を模擬する\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return self.f\n" +"\n" +" def __call__(self, *args, **kwds):\n" +" return self.f(*args, **kwds)\n" +"\n" +" @property\n" +" def __annotations__(self):\n" +" return self.f.__annotations__" -#: ../../howto/descriptor.rst:1349 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " "that refers to the underlying function. Also it carries forward the " @@ -1658,6 +2158,11 @@ msgid "" "including :attr:`~function.__name__`, :attr:`~function.__qualname__`, and :" "attr:`~function.__doc__`." msgstr "" +":func:`functools.update_wrapper` を呼び出すと、元の関数を参照する " +"``__wrapped__`` 属性が追加されます。\n" +"また、ラッパをラップ対象の関数と同じように見せるため、:attr:`~function." +"__name__`、:attr:`~function.__qualname__`、:attr:`~function.__doc__` などの必" +"要な属性が引き継がれます。" #: ../../howto/descriptor.rst:1418 msgid "Class methods" @@ -1673,21 +2178,27 @@ msgstr "" "ストの先頭に加えます。このフォーマットは、呼び出し元がオブジェクトでもクラス" "でも同じです:" -#: ../../howto/descriptor.rst:1424 msgid "" "class F:\n" " @classmethod\n" " def f(cls, x):\n" " return cls.__name__, x" msgstr "" +"class F:\n" +" @classmethod\n" +" def f(cls, x):\n" +" return cls.__name__, x" -#: ../../howto/descriptor.rst:1431 msgid "" ">>> F.f(3)\n" "('F', 3)\n" ">>> F().f(3)\n" "('F', 3)" msgstr "" +">>> F.f(3)\n" +"('F', 3)\n" +">>> F().f(3)\n" +"('F', 3)" #: ../../howto/descriptor.rst:1438 msgid "" @@ -1702,7 +2213,6 @@ msgstr "" "クラスコンストラクタを作ることです。例えば、クラスメソッド :func:`dict." "fromkeys` は新しい辞書をキーのリストから生成します。等価な pure Python 版は:" -#: ../../howto/descriptor.rst:1444 msgid "" "class Dict(dict):\n" " @classmethod\n" @@ -1713,12 +2223,19 @@ msgid "" " d[key] = value\n" " return d" msgstr "" +"class Dict(dict):\n" +" @classmethod\n" +" def fromkeys(cls, iterable, value=None):\n" +" \"Objects/dictobject.c の dict_fromkeys() を模擬する\"\n" +" d = cls()\n" +" for key in iterable:\n" +" d[key] = value\n" +" return d" #: ../../howto/descriptor.rst:1455 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "これで一意なキーを持つ新しい辞書が以下のように構成できます:" -#: ../../howto/descriptor.rst:1457 msgid "" ">>> d = Dict.fromkeys('abracadabra')\n" ">>> type(d) is Dict\n" @@ -1726,14 +2243,19 @@ msgid "" ">>> d\n" "{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" msgstr "" +">>> d = Dict.fromkeys('abracadabra')\n" +">>> type(d) is Dict\n" +"True\n" +">>> d\n" +"{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" -#: ../../howto/descriptor.rst:1465 msgid "" "Using the non-data descriptor protocol, a pure Python version of :deco:" "`classmethod` would look like this:" msgstr "" +"非データデスクリプタプロトコルを使い、:deco:`classmethod` を Python だけで実" +"装すると、次のようになります。" -#: ../../howto/descriptor.rst:1468 msgid "" "import functools\n" "\n" @@ -1749,6 +2271,19 @@ msgid "" " cls = type(obj)\n" " return MethodType(self.f, cls)" msgstr "" +"import functools\n" +"\n" +"class ClassMethod:\n" +" \"Objects/funcobject.c の PyClassMethod_Type() を模擬する\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, cls=None):\n" +" if cls is None:\n" +" cls = type(obj)\n" +" return MethodType(self.f, cls)" #: ../../howto/descriptor.rst:1530 msgid "" @@ -1795,7 +2330,6 @@ msgstr "" "class Vehicle:\n" " __slots__ = ('id_number', 'make', 'model')" -#: ../../howto/descriptor.rst:1553 msgid "" ">>> auto = Vehicle()\n" ">>> auto.id_nubmer = 'VYE483814LQEX'\n" @@ -1803,6 +2337,11 @@ msgid "" " ...\n" "AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" msgstr "" +">>> auto = Vehicle()\n" +">>> auto.id_nubmer = 'VYE483814LQEX'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" #: ../../howto/descriptor.rst:1561 msgid "" @@ -1812,7 +2351,6 @@ msgstr "" "2. デスクリプタが ``__slots__`` に格納されたプライベートな属性へのアクセスを" "制御するような、イミュータブルオブジェクトが作りやすくなる。" -#: ../../howto/descriptor.rst:1564 msgid "" "class Immutable:\n" "\n" @@ -1831,8 +2369,22 @@ msgid "" " def name(self): # Read-only descriptor\n" " return self._name" msgstr "" +"class Immutable:\n" +"\n" +" __slots__ = ('_dept', '_name') # インスタンス辞書を置き換える\n" +"\n" +" def __init__(self, dept, name):\n" +" self._dept = dept # プライベート属性に格納する\n" +" self._name = name # プライベート属性に格納する\n" +"\n" +" @property # 読み取り専用のデスクリプタ\n" +" def dept(self):\n" +" return self._dept\n" +"\n" +" @property\n" +" def name(self): # 読み取り専用のデスクリプタ\n" +" return self._name" -#: ../../howto/descriptor.rst:1582 msgid "" ">>> mark = Immutable('Botany', 'Mark Watney')\n" ">>> mark.dept\n" @@ -1846,6 +2398,17 @@ msgid "" " ...\n" "AttributeError: 'Immutable' object has no attribute 'location'" msgstr "" +">>> mark = Immutable('Botany', 'Mark Watney')\n" +">>> mark.dept\n" +"'Botany'\n" +">>> mark.dept = 'Space Pirate'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: property 'dept' of 'Immutable' object has no setter\n" +">>> mark.location = 'Mars'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Immutable' object has no attribute 'location'" #: ../../howto/descriptor.rst:1596 msgid "" @@ -1868,13 +2431,13 @@ msgstr "" "4. 速度の改善。 ``__slots__`` を使うとインスタンス変数の読み込み速度が35%早く" "なります(Apple M1プロセッサで動作させたPython 3.10で測定)" -#: ../../howto/descriptor.rst:1604 msgid "" "5. Blocks tools like :deco:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" +"5. 正しく動作するためにインスタンス辞書を必要とする :deco:`functools." +"cached_property` などの機能が使えなくなります。" -#: ../../howto/descriptor.rst:1607 msgid "" "from functools import cached_property\n" "\n" @@ -1886,16 +2449,27 @@ msgid "" " return 4 * sum((-1.0)**n / (2.0*n + 1.0)\n" " for n in reversed(range(100_000)))" msgstr "" +"from functools import cached_property\n" +"\n" +"class CP:\n" +" __slots__ = () # インスタンス辞書をなくす\n" +"\n" +" @cached_property # インスタンス辞書が必要\n" +" def pi(self):\n" +" return 4 * sum((-1.0)**n / (2.0*n + 1.0)\n" +" for n in reversed(range(100_000)))" -#: ../../howto/descriptor.rst:1619 msgid "" ">>> CP().pi\n" "Traceback (most recent call last):\n" " ...\n" "TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." msgstr "" +">>> CP().pi\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." -#: ../../howto/descriptor.rst:1626 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1904,13 +2478,13 @@ msgid "" "``_slotvalues`` list. Reads and writes to that private structure are " "managed by member descriptors:" msgstr "" -"``__slots__`` はC構造体に直接アクセスし、オブジェクトのメモリ確保を制御する必" -"要があるため、ピュアPythonバージョンを作成することはできません。しかし、プラ" -"イベートの ``__slotvalues`` リストを使ってC構造体のスロットをほぼ忠実にエミュ" -"レートすることはできます。そのプライベートな構造体への読み書きはメンバーのデ" -"スクリプタによって管理されます。" +"``__slots__`` は C 構造体への直接アクセスとオブジェクトのメモリ割り当ての制御" +"を必要とするため、完全に置き換え可能な実装を Python だけで作ることはできませ" +"ん。\n" +"ただし、スロット用の C 構造体をプライベートな ``_slotvalues`` リストで模擬す" +"ることで、ほぼ忠実に再現できます。\n" +"このプライベートな構造への読み書きは、メンバーデスクリプタが管理します。" -#: ../../howto/descriptor.rst:1633 msgid "" "null = sentinel('null')\n" "\n" @@ -1948,12 +2522,48 @@ msgid "" " 'Emulate member_repr() in Objects/descrobject.c'\n" " return f''" msgstr "" +"null = sentinel('null')\n" +"\n" +"class Member:\n" +"\n" +" def __init__(self, name, clsname, offset):\n" +" 'Include/descrobject.h の PyMemberDef を模擬する'\n" +" # Objects/descrobject.c の descr_new() も参照\n" +" self.name = name\n" +" self.clsname = clsname\n" +" self.offset = offset\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" 'Objects/descrobject.c の member_get() を模擬する'\n" +" # Python/structmember.c の PyMember_GetOne() も参照\n" +" if obj is None:\n" +" return self\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" 'Objects/descrobject.c の member_set() を模擬する'\n" +" obj._slotvalues[self.offset] = value\n" +"\n" +" def __delete__(self, obj):\n" +" 'Objects/descrobject.c の member_delete() を模擬する'\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" obj._slotvalues[self.offset] = null\n" +"\n" +" def __repr__(self):\n" +" 'Objects/descrobject.c の member_repr() を模擬する'\n" +" return f''" -#: ../../howto/descriptor.rst:1671 msgid "" "The :meth:`!type.__new__` method takes care of adding member objects to " "class variables:" msgstr "" +":meth:`!type.__new__` メソッドが、クラス変数にメンバーオブジェクトを追加しま" +"す。" #: ../../howto/descriptor.rst:1674 msgid "" @@ -1979,7 +2589,6 @@ msgstr "" "スタンスの作成の処理をします。おおざっぱにピュアPythonでのシミュレーションし" "たコードがこちらです。" -#: ../../howto/descriptor.rst:1691 msgid "" "class Object:\n" " 'Simulate how object.__new__() allocates memory for __slots__'\n" @@ -2010,14 +2619,42 @@ msgid "" " )\n" " super().__delattr__(name)" msgstr "" +"class Object:\n" +" 'object.__new__() が __slots__ 用のメモリを確保する仕組みを模擬する'\n" +"\n" +" def __new__(cls, *args, **kwargs):\n" +" 'Objects/typeobject.c の object_new() を模擬する'\n" +" inst = super().__new__(cls)\n" +" if hasattr(cls, 'slot_names'):\n" +" empty_slots = [null] * len(cls.slot_names)\n" +" object.__setattr__(inst, '_slotvalues', empty_slots)\n" +" return inst\n" +"\n" +" def __setattr__(self, name, value):\n" +" 'Objects/object.c の _PyObject_GenericSetAttrWithDict() を模擬する'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__setattr__(name, value)\n" +"\n" +" def __delattr__(self, name):\n" +" 'Objects/object.c の _PyObject_GenericSetAttrWithDict() を模擬する'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__delattr__(name)" -#: ../../howto/descriptor.rst:1722 msgid "" "To use the simulation in a real class, just inherit from :class:`!Object` " "and set the :term:`metaclass` to :class:`Type`:" msgstr "" +"この模擬実装を実際のクラスで使うには、:class:`!Object` を継承し、:term:" +"`metaclass` を :class:`Type` にするだけです。" -#: ../../howto/descriptor.rst:1725 msgid "" "class H(Object, metaclass=Type):\n" " 'Instance variables stored in slots'\n" @@ -2028,6 +2665,14 @@ msgid "" " self.x = x\n" " self.y = y" msgstr "" +"class H(Object, metaclass=Type):\n" +" 'インスタンス変数をスロットに格納する'\n" +"\n" +" slot_names = ['x', 'y']\n" +"\n" +" def __init__(self, x, y):\n" +" self.x = x\n" +" self.y = y" #: ../../howto/descriptor.rst:1736 msgid "" @@ -2035,7 +2680,6 @@ msgid "" msgstr "" "この時点ではメタクラスは *x* と *y* のメンバーオブジェクトをロードします。" -#: ../../howto/descriptor.rst:1738 msgid "" ">>> from pprint import pp\n" ">>> pp(dict(vars(H)))\n" @@ -2046,6 +2690,14 @@ msgid "" " 'x': ,\n" " 'y': }" msgstr "" +">>> from pprint import pp\n" +">>> pp(dict(vars(H)))\n" +"{'__module__': '__main__',\n" +" '__doc__': 'インスタンス変数をスロットに格納する',\n" +" 'slot_names': ['x', 'y'],\n" +" '__init__': ,\n" +" 'x': ,\n" +" 'y': }" #: ../../howto/descriptor.rst:1757 msgid "" @@ -2055,7 +2707,6 @@ msgstr "" "インスタンスが作成されると、属性が保持される ``slot_values`` のリストをイン" "スタンスが保持します:" -#: ../../howto/descriptor.rst:1760 msgid "" ">>> h = H(10, 20)\n" ">>> vars(h)\n" @@ -2064,15 +2715,24 @@ msgid "" ">>> vars(h)\n" "{'_slotvalues': [55, 20]}" msgstr "" +">>> h = H(10, 20)\n" +">>> vars(h)\n" +"{'_slotvalues': [10, 20]}\n" +">>> h.x = 55\n" +">>> vars(h)\n" +"{'_slotvalues': [55, 20]}" #: ../../howto/descriptor.rst:1769 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "スペルミスや、未アサインの属性は例外を送出します。" -#: ../../howto/descriptor.rst:1771 msgid "" ">>> h.xz\n" "Traceback (most recent call last):\n" " ...\n" "AttributeError: 'H' object has no attribute 'xz'" msgstr "" +">>> h.xz\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'H' object has no attribute 'xz'" diff --git a/howto/enum.po b/howto/enum.po index c5946a243..10eacfd43 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -44,7 +44,6 @@ msgstr "" "これらは、限られた選択肢の値の一つを取る変数がある場合に便利です。例えば、曜" "日情報があります:" -#: ../../howto/enum.rst:18 msgid "" ">>> from enum import Enum\n" ">>> class Weekday(Enum):\n" @@ -56,12 +55,20 @@ msgid "" "... SATURDAY = 6\n" "... SUNDAY = 7" msgstr "" +">>> from enum import Enum\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7" #: ../../howto/enum.rst:28 msgid "Or perhaps the RGB primary colors::" msgstr "あるいは、RGB三原色でも構いません::" -#: ../../howto/enum.rst:30 msgid "" ">>> from enum import Enum\n" ">>> class Color(Enum):\n" @@ -69,6 +76,11 @@ msgid "" "... GREEN = 2\n" "... BLUE = 3" msgstr "" +">>> from enum import Enum\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3" #: ../../howto/enum.rst:36 msgid "" @@ -102,11 +114,12 @@ msgstr "" "列挙型の性質によって、メンバの値は重要な場合とそうでない場合がありますが、い" "ずれの場合でも、その値は対応するメンバを取得するのに使えます::" -#: ../../howto/enum.rst:50 msgid "" ">>> Weekday(3)\n" "" msgstr "" +">>> Weekday(3)\n" +"" #: ../../howto/enum.rst:53 msgid "" @@ -117,45 +130,50 @@ msgstr "" "ご覧の通り、メンバの ``repr()`` は列挙型の名前、メンバの名前、そして値を表示" "します。メンバの ``str()`` は列挙型の名前とメンバの名前のみを表示します。" -#: ../../howto/enum.rst:57 msgid "" ">>> print(Weekday.THURSDAY)\n" "Weekday.THURSDAY" msgstr "" +">>> print(Weekday.THURSDAY)\n" +"Weekday.THURSDAY" #: ../../howto/enum.rst:60 msgid "The *type* of an enumeration member is the enum it belongs to::" msgstr "列挙型のメンバの型はそのメンバの属する列挙型です::" -#: ../../howto/enum.rst:62 msgid "" ">>> type(Weekday.MONDAY)\n" "\n" ">>> isinstance(Weekday.FRIDAY, Weekday)\n" "True" msgstr "" +">>> type(Weekday.MONDAY)\n" +"\n" +">>> isinstance(Weekday.FRIDAY, Weekday)\n" +"True" -#: ../../howto/enum.rst:67 msgid "Enum members have an attribute that contains just their :attr:`!name`::" msgstr "" +"列挙型のメンバーには、その名前だけを保持する :attr:`!name` 属性がありま" +"す。 ::" -#: ../../howto/enum.rst:69 msgid "" ">>> print(Weekday.TUESDAY.name)\n" "TUESDAY" msgstr "" +">>> print(Weekday.TUESDAY.name)\n" +"TUESDAY" -#: ../../howto/enum.rst:72 msgid "Likewise, they have an attribute for their :attr:`!value`::" -msgstr "" +msgstr "同様に、値を保持する :attr:`!value` 属性もあります。 ::" -#: ../../howto/enum.rst:75 msgid "" ">>> Weekday.WEDNESDAY.value\n" "3" msgstr "" +">>> Weekday.WEDNESDAY.value\n" +"3" -#: ../../howto/enum.rst:78 msgid "" "Unlike many languages that treat enumerations solely as name/value pairs, " "Python Enums can have behavior added. For example, :class:`datetime.date` " @@ -166,19 +184,27 @@ msgid "" "day from the :class:`~datetime.date` instance and return the matching enum " "member::" msgstr "" +"多くの言語では列挙型を名前と値の組だけとして扱いますが、Python の列挙型には動" +"作を追加できます。\n" +"例えば、:class:`datetime.date` には曜日を返す :meth:`~datetime.date.weekday` " +"と :meth:`~datetime.date.isoweekday` という 2 つのメソッドがあります。\n" +"違いは、一方が 0~6、もう一方が 1~7 で数えることです。\n" +"この違いを自分で管理する代わりに、:class:`!Weekday` 列挙型にメソッドを追加" +"し、:class:`~datetime.date` インスタンスから曜日を取り出して、対応する列挙型" +"メンバーを返すようにできます。 ::" -#: ../../howto/enum.rst:87 msgid "" "@classmethod\n" "def from_date(cls, date):\n" " return cls(date.isoweekday())" msgstr "" +"@classmethod\n" +"def from_date(cls, date):\n" +" return cls(date.isoweekday())" -#: ../../howto/enum.rst:91 msgid "The complete :class:`!Weekday` enum now looks like this::" -msgstr "" +msgstr ":class:`!Weekday` 列挙型全体は次のようになります。 ::" -#: ../../howto/enum.rst:93 msgid "" ">>> class Weekday(Enum):\n" "... MONDAY = 1\n" @@ -193,17 +219,31 @@ msgid "" "... def from_date(cls, date):\n" "... return cls(date.isoweekday())" msgstr "" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... #\n" +"... @classmethod\n" +"... def from_date(cls, date):\n" +"... return cls(date.isoweekday())" #: ../../howto/enum.rst:106 msgid "Now we can find out what today is! Observe::" msgstr "さて、これで今日が何曜日か調べることができます! 見てみましょう::" -#: ../../howto/enum.rst:108 msgid "" ">>> import datetime as dt\n" ">>> Weekday.from_date(dt.date.today())\n" "" msgstr "" +">>> import datetime as dt\n" +">>> Weekday.from_date(dt.date.today())\n" +"" #: ../../howto/enum.rst:112 msgid "" @@ -213,15 +253,18 @@ msgstr "" "もちろん、あなたがこれを読んでいるのが他の曜日ならば、その曜日が代わりに表示" "されます。" -#: ../../howto/enum.rst:114 msgid "" "This :class:`!Weekday` enum is great if our variable only needs one day, but " "what if we need several? Maybe we're writing a function to plot chores " "during a week, and don't want to use a :class:`list` -- we could use a " "different type of :class:`Enum`::" msgstr "" +"この :class:`!Weekday` 列挙型は、変数が 1 つの曜日だけを表せばよい場合には便" +"利ですが、複数の曜日が必要ならどうでしょうか?\n" +"例えば、1 週間の家事を割り当てる関数を書いていて、:class:`list` は使いたくな" +"いとします。\n" +"別の種類の :class:`Enum` を使う方法があります。 ::" -#: ../../howto/enum.rst:119 msgid "" ">>> from enum import Flag\n" ">>> class Weekday(Flag):\n" @@ -233,6 +276,15 @@ msgid "" "... SATURDAY = 32\n" "... SUNDAY = 64" msgstr "" +">>> from enum import Flag\n" +">>> class Weekday(Flag):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 4\n" +"... THURSDAY = 8\n" +"... FRIDAY = 16\n" +"... SATURDAY = 32\n" +"... SUNDAY = 64" #: ../../howto/enum.rst:129 msgid "" @@ -242,18 +294,20 @@ msgstr "" "ここでは2つの変更が行われています。:class:`Flag` を継承している点と、値がすべ" "て2の累乗である点です。" -#: ../../howto/enum.rst:132 msgid "" "Just like the original :class:`!Weekday` enum above, we can have a single " "selection::" msgstr "" +"先ほどの :class:`!Weekday` 列挙型と同じように、1 つの曜日を選べます。 ::" -#: ../../howto/enum.rst:134 msgid "" ">>> first_week_day = Weekday.MONDAY\n" ">>> first_week_day\n" "" msgstr "" +">>> first_week_day = Weekday.MONDAY\n" +">>> first_week_day\n" +"" #: ../../howto/enum.rst:138 msgid "" @@ -263,30 +317,34 @@ msgstr "" "ただし、:class:`Flag` は複数のメンバーをひとつの変数にまとめることもできま" "す::" -#: ../../howto/enum.rst:141 msgid "" ">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" ">>> weekend\n" "" msgstr "" +">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" +">>> weekend\n" +"" #: ../../howto/enum.rst:145 msgid "You can even iterate over a :class:`Flag` variable::" msgstr ":class:`Flag` 変数は反復することもできます::" -#: ../../howto/enum.rst:147 msgid "" ">>> for day in weekend:\n" "... print(day)\n" "Weekday.SATURDAY\n" "Weekday.SUNDAY" msgstr "" +">>> for day in weekend:\n" +"... print(day)\n" +"Weekday.SATURDAY\n" +"Weekday.SUNDAY" #: ../../howto/enum.rst:152 msgid "Okay, let's get some chores set up::" msgstr "さて、いくつかの家事を設定してみましょう::" -#: ../../howto/enum.rst:154 msgid "" ">>> chores_for_ethan = {\n" "... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." @@ -295,12 +353,17 @@ msgid "" "... 'answer SO questions': Weekday.SATURDAY,\n" "... }" msgstr "" +">>> chores_for_ethan = {\n" +"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." +"FRIDAY,\n" +"... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,\n" +"... 'answer SO questions': Weekday.SATURDAY,\n" +"... }" #: ../../howto/enum.rst:160 msgid "And a function to display the chores for a given day::" msgstr "指定された日の家事を表示する関数も作成します::" -#: ../../howto/enum.rst:162 msgid "" ">>> def show_chores(chores, day):\n" "... for chore, days in chores.items():\n" @@ -310,6 +373,13 @@ msgid "" ">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" "answer SO questions" msgstr "" +">>> def show_chores(chores, day):\n" +"... for chore, days in chores.items():\n" +"... if day in days:\n" +"... print(chore)\n" +"...\n" +">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" +"answer SO questions" #: ../../howto/enum.rst:170 msgid "" @@ -319,7 +389,6 @@ msgstr "" "メンバーの実際の値が重要でない場合は、:func:`auto` を使用することで手間を省く" "ことができます::" -#: ../../howto/enum.rst:173 msgid "" ">>> from enum import auto\n" ">>> class Weekday(Flag):\n" @@ -332,28 +401,42 @@ msgid "" "... SUNDAY = auto()\n" "... WEEKEND = SATURDAY | SUNDAY" msgstr "" +">>> from enum import auto\n" +">>> class Weekday(Flag):\n" +"... MONDAY = auto()\n" +"... TUESDAY = auto()\n" +"... WEDNESDAY = auto()\n" +"... THURSDAY = auto()\n" +"... FRIDAY = auto()\n" +"... SATURDAY = auto()\n" +"... SUNDAY = auto()\n" +"... WEEKEND = SATURDAY | SUNDAY" #: ../../howto/enum.rst:189 msgid "Programmatic access to enumeration members and their attributes" msgstr "列挙型メンバーおよびそれらの属性へのプログラム的アクセス" -#: ../../howto/enum.rst:191 msgid "" "Sometimes it's useful to access members in enumerations programmatically (i." "e. situations where ``Color.RED`` won't do because the exact color is not " "known at program-writing time). ``Enum`` allows such access::" msgstr "" -"プログラム的にメンバーに番号でアクセスしたほうが便利な場合があります (すなわ" -"ち、プログラムを書いている時点で正確な色がまだわからなく、``Color.RED`` と書" -"くのが無理な場合など)。 ``Enum`` ではそのようなアクセスも可能です::" +"列挙型のメンバーに、プログラムで決めた値を使ってアクセスしたい場合がありま" +"す。\n" +"例えば、プログラムを書く時点では具体的な色が決まっておらず、``Color.RED`` と" +"書けない場合です。\n" +"``Enum`` はそのようなアクセスもできます。 ::" -#: ../../howto/enum.rst:195 msgid "" ">>> Color(1)\n" "\n" ">>> Color(3)\n" "" msgstr "" +">>> Color(1)\n" +"\n" +">>> Color(3)\n" +"" #: ../../howto/enum.rst:200 msgid "If you want to access enum members by *name*, use item access::" @@ -361,20 +444,23 @@ msgstr "" "列挙型メンバーに *名前* でアクセスしたい場合はアイテムとしてアクセスできま" "す::" -#: ../../howto/enum.rst:202 msgid "" ">>> Color['RED']\n" "\n" ">>> Color['GREEN']\n" "" msgstr "" +">>> Color['RED']\n" +"\n" +">>> Color['GREEN']\n" +"" -#: ../../howto/enum.rst:207 msgid "" "If you have an enum member and need its :attr:`!name` or :attr:`!value`::" msgstr "" +"列挙型メンバーから :attr:`!name` や :attr:`!value` を取得するには、次のように" +"します。 ::" -#: ../../howto/enum.rst:209 msgid "" ">>> member = Color.RED\n" ">>> member.name\n" @@ -382,6 +468,11 @@ msgid "" ">>> member.value\n" "1" msgstr "" +">>> member = Color.RED\n" +">>> member.name\n" +"'RED'\n" +">>> member.value\n" +"1" #: ../../howto/enum.rst:217 msgid "Duplicating enum members and values" @@ -391,7 +482,6 @@ msgstr "列挙型メンバーと値の重複" msgid "Having two enum members with the same name is invalid::" msgstr "同じ名前の列挙型メンバーを複数持つことはできません::" -#: ../../howto/enum.rst:221 msgid "" ">>> class Shape(Enum):\n" "... SQUARE = 2\n" @@ -401,6 +491,13 @@ msgid "" "...\n" "TypeError: 'SQUARE' already defined as 2" msgstr "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... SQUARE = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: 'SQUARE' already defined as 2" msgid "" "However, an enum member can have other names associated with it. Given two " @@ -415,7 +512,6 @@ msgstr "" "は、メンバー ``A`` が返されます。 ``A`` の名前での検索ではメンバー ``A`` を" "返します。``B`` の名前での検索も、メンバー ``A`` を返します::" -#: ../../howto/enum.rst:235 msgid "" ">>> class Shape(Enum):\n" "... SQUARE = 2\n" @@ -430,6 +526,18 @@ msgid "" ">>> Shape(2)\n" "" msgstr "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... DIAMOND = 1\n" +"... CIRCLE = 3\n" +"... ALIAS_FOR_SQUARE = 2\n" +"...\n" +">>> Shape.SQUARE\n" +"\n" +">>> Shape.ALIAS_FOR_SQUARE\n" +"\n" +">>> Shape(2)\n" +"" #: ../../howto/enum.rst:250 msgid "" @@ -440,17 +548,16 @@ msgstr "" "すでに定義されている属性と同じ名前のメンバー (一方がメンバーでもう一方がメ" "ソッド、など) の作成、あるいはメンバーと同じ名前の属性の作成はできません。" -#: ../../howto/enum.rst:256 msgid "Ensuring unique enumeration values" -msgstr "番号付けの値が一意であることの確認" +msgstr "列挙型の値が一意であることを保証する" -#: ../../howto/enum.rst:258 msgid "" "By default, enumerations allow multiple names as aliases for the same value. " "When this behavior isn't desired, you can use the :deco:`unique` decorator::" msgstr "" +"デフォルトでは、列挙型は同じ値に対する別名として複数の名前を許容します。\n" +"この動作が望ましくない場合は、:deco:`unique` デコレータを使えます。 ::" -#: ../../howto/enum.rst:261 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -464,6 +571,17 @@ msgid "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" msgstr "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" #: ../../howto/enum.rst:275 msgid "Using automatic values" @@ -473,7 +591,6 @@ msgstr "値の自動設定を使う" msgid "If the exact value is unimportant you can use :class:`auto`::" msgstr "正確な値が重要でない場合、 :class:`auto` が使えます::" -#: ../../howto/enum.rst:279 msgid "" ">>> from enum import Enum, auto\n" ">>> class Color(Enum):\n" @@ -484,14 +601,22 @@ msgid "" ">>> [member.value for member in Color]\n" "[1, 2, 3]" msgstr "" +">>> from enum import Enum, auto\n" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> [member.value for member in Color]\n" +"[1, 2, 3]" -#: ../../howto/enum.rst:288 msgid "" "The values are chosen by :func:`~Enum._generate_next_value_`, which can be " "overridden::" msgstr "" +"値は :func:`~Enum._generate_next_value_` によって選ばれます。\n" +"この関数はオーバーライドできます。 ::" -#: ../../howto/enum.rst:291 msgid "" ">>> class AutoName(Enum):\n" "... @staticmethod\n" @@ -507,12 +632,26 @@ msgid "" ">>> [member.value for member in Ordinal]\n" "['NORTH', 'SOUTH', 'EAST', 'WEST']" msgstr "" +">>> class AutoName(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return name\n" +"...\n" +">>> class Ordinal(AutoName):\n" +"... NORTH = auto()\n" +"... SOUTH = auto()\n" +"... EAST = auto()\n" +"... WEST = auto()\n" +"...\n" +">>> [member.value for member in Ordinal]\n" +"['NORTH', 'SOUTH', 'EAST', 'WEST']" -#: ../../howto/enum.rst:307 msgid "" "The :meth:`~Enum._generate_next_value_` method must be defined before any " "members." msgstr "" +":meth:`~Enum._generate_next_value_` メソッドは、すべてのメンバーより前に定義" +"しなければなりません。" #: ../../howto/enum.rst:310 msgid "Iteration" @@ -522,7 +661,6 @@ msgstr "イテレーション" msgid "Iterating over the members of an enum does not provide the aliases::" msgstr "列挙型のメンバーのイテレートは別名をサポートしていません::" -#: ../../howto/enum.rst:314 msgid "" ">>> list(Shape)\n" "[, , ]\n" @@ -531,6 +669,12 @@ msgid "" "THURSDAY: 8>, , , ]" msgstr "" +">>> list(Shape)\n" +"[, , ]\n" +">>> list(Weekday)\n" +"[, , , , , , ]" msgid "" "Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " @@ -549,7 +693,6 @@ msgstr "" "型メンバーのマッピングです。これには別名も含め、列挙されたすべての名前が入っ" "ています。" -#: ../../howto/enum.rst:325 msgid "" ">>> for name, member in Shape.__members__.items():\n" "... name, member\n" @@ -559,6 +702,13 @@ msgid "" "('CIRCLE', )\n" "('ALIAS_FOR_SQUARE', )" msgstr "" +">>> for name, member in Shape.__members__.items():\n" +"... name, member\n" +"...\n" +"('SQUARE', )\n" +"('DIAMOND', )\n" +"('CIRCLE', )\n" +"('ALIAS_FOR_SQUARE', )" #: ../../howto/enum.rst:333 msgid "" @@ -568,12 +718,14 @@ msgstr "" "属性 ``__members__`` は列挙型メンバーへの詳細なアクセスに使用できます。以下は" "すべての別名を探す例です::" -#: ../../howto/enum.rst:336 msgid "" ">>> [name for name, member in Shape.__members__.items() if member.name != " "name]\n" "['ALIAS_FOR_SQUARE']" msgstr "" +">>> [name for name, member in Shape.__members__.items() if member.name != " +"name]\n" +"['ALIAS_FOR_SQUARE']" #: ../../howto/enum.rst:341 msgid "" @@ -591,7 +743,6 @@ msgstr "比較" msgid "Enumeration members are compared by identity::" msgstr "列挙型メンバーは同一性を比較できます::" -#: ../../howto/enum.rst:350 msgid "" ">>> Color.RED is Color.RED\n" "True\n" @@ -600,6 +751,12 @@ msgid "" ">>> Color.RED is not Color.BLUE\n" "True" msgstr "" +">>> Color.RED is Color.RED\n" +"True\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED is not Color.BLUE\n" +"True" #: ../../howto/enum.rst:357 msgid "" @@ -609,19 +766,21 @@ msgstr "" "列挙型の値の順序の比較はサポートされて *いません*。Enum メンバーは整数ではあ" "りません (`IntEnum`_ を参照してください)::" -#: ../../howto/enum.rst:360 msgid "" ">>> Color.RED < Color.BLUE\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "TypeError: '<' not supported between instances of 'Color' and 'Color'" msgstr "" +">>> Color.RED < Color.BLUE\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: '<' not supported between instances of 'Color' and 'Color'" #: ../../howto/enum.rst:365 msgid "Equality comparisons are defined though::" msgstr "ただし等価の比較は定義されています::" -#: ../../howto/enum.rst:367 msgid "" ">>> Color.BLUE == Color.RED\n" "False\n" @@ -630,19 +789,28 @@ msgid "" ">>> Color.BLUE == Color.BLUE\n" "True" msgstr "" +">>> Color.BLUE == Color.RED\n" +"False\n" +">>> Color.BLUE != Color.RED\n" +"True\n" +">>> Color.BLUE == Color.BLUE\n" +"True" -#: ../../howto/enum.rst:374 msgid "" "Equality comparisons against non-enumeration values will always return " "``False`` (again, :class:`IntEnum` was explicitly designed to behave " "differently, see below)::" msgstr "" +"列挙型でない値との等価比較は、常に ``False`` を返します。\n" +"ただし、:class:`IntEnum` は明示的に異なる動作をするよう設計されています。\n" +"詳しくは後で説明します。 ::" -#: ../../howto/enum.rst:378 msgid "" ">>> Color.BLUE == 2\n" "False" msgstr "" +">>> Color.BLUE == 2\n" +"False" #: ../../howto/enum.rst:383 msgid "" @@ -680,7 +848,6 @@ msgstr "" "列挙型は Python のクラスであり、通常どおりメソッドや特殊メソッドを持つことが" "できます::" -#: ../../howto/enum.rst:399 msgid "" ">>> class Mood(Enum):\n" "... FUNKY = 1\n" @@ -699,12 +866,27 @@ msgid "" "... return cls.HAPPY\n" "..." msgstr "" +">>> class Mood(Enum):\n" +"... FUNKY = 1\n" +"... HAPPY = 3\n" +"...\n" +"... def describe(self):\n" +"... # ここでは self はメンバー\n" +"... return self.name, self.value\n" +"...\n" +"... def __str__(self):\n" +"... return 'my custom str! {0}'.format(self.value)\n" +"...\n" +"... @classmethod\n" +"... def favorite_mood(cls):\n" +"... # ここでは cls は列挙型\n" +"... return cls.HAPPY\n" +"..." #: ../../howto/enum.rst:416 msgid "Then::" msgstr "上記の結果が以下のようになります::" -#: ../../howto/enum.rst:418 msgid "" ">>> Mood.favorite_mood()\n" "\n" @@ -713,8 +895,13 @@ msgid "" ">>> str(Mood.FUNKY)\n" "'my custom str! 1'" msgstr "" +">>> Mood.favorite_mood()\n" +"\n" +">>> Mood.HAPPY.describe()\n" +"('HAPPY', 3)\n" +">>> str(Mood.FUNKY)\n" +"'my custom str! 1'" -#: ../../howto/enum.rst:425 msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " @@ -723,41 +910,55 @@ msgid "" "__str__`, :meth:`~object.__add__`, etc.), descriptors (methods are also " "descriptors), and variable names listed in :attr:`~Enum._ignore_`." msgstr "" +"使用できるものの規則は次のとおりです。\n" +"先頭と末尾がそれぞれ 1 つのアンダースコアである名前は enum が予約しているため" +"使えません。\n" +"それ以外の、列挙型の中で定義した属性はすべて列挙型のメンバーになります。\n" +"ただし、:meth:`~object.__str__` や :meth:`~object.__add__` などの特殊メソッ" +"ド、デスクリプタ (メソッドもデスクリプタです)、:attr:`~Enum._ignore_` に列挙" +"した変数名は例外です。" -#: ../../howto/enum.rst:432 msgid "" "Note: if your enumeration defines :meth:`~object.__new__` and/or :meth:" "`~object.__init__`, any value(s) given to the enum member will be passed " "into those methods. See `Planet`_ for an example." msgstr "" +"注意: 列挙型に :meth:`~object.__new__` や :meth:`~object.__init__` を定義する" +"と、メンバーに指定した値がそれらのメソッドに渡されます。\n" +"例は `Planet`_ を参照してください。" -#: ../../howto/enum.rst:438 msgid "" "The :meth:`~object.__new__` method, if defined, is used during creation of " "the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " "which is used after class creation for lookup of existing members. See :ref:" "`new-vs-init` for more details." msgstr "" +":meth:`~object.__new__` を定義した場合、そのメソッドは Enum メンバーの作成時" +"に使われます。\n" +"その後は Enum の :meth:`~object.__new__` に置き換えられ、クラス作成後の既存メ" +"ンバーの検索に使われます。\n" +"詳しくは :ref:`new-vs-init` を参照してください。" #: ../../howto/enum.rst:445 msgid "Restricted Enum subclassing" msgstr "Enumのサブクラス化の制限" -#: ../../howto/enum.rst:447 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -"新しい :class:`Enum` クラスは、ベースの enum クラスを1つ、具象データ型を1つ、" -"複数の :class:`object` ベースのミックスインクラスが許容されます。これらのベー" -"スクラスの順序は次の通りです::" +"新しい :class:`Enum` クラスには、基底となる列挙型クラスが 1 つ必要です。\n" +"加えて、具象データ型を最大 1 つ、:class:`object` を基底とするミックスインクラ" +"スを必要なだけ指定できます。\n" +"これらの基底クラスは次の順に並べます。 ::" -#: ../../howto/enum.rst:451 msgid "" "class EnumName([mix-in, ...,] [data-type,] base-enum):\n" " pass" msgstr "" +"class EnumName([mix-in, ...,] [data-type,] base-enum):\n" +" pass" #: ../../howto/enum.rst:454 msgid "" @@ -767,7 +968,6 @@ msgstr "" "列挙型のサブクラスの作成はその列挙型にメンバーが一つも定義されていない場合の" "み行なえます。従って以下は許されません::" -#: ../../howto/enum.rst:457 msgid "" ">>> class MoreColor(Color):\n" "... PINK = 17\n" @@ -776,12 +976,17 @@ msgid "" "...\n" "TypeError: cannot extend " msgstr "" +">>> class MoreColor(Color):\n" +"... PINK = 17\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: cannot extend " #: ../../howto/enum.rst:464 msgid "But this is allowed::" msgstr "以下のような場合は許されます::" -#: ../../howto/enum.rst:466 msgid "" ">>> class Foo(Enum):\n" "... def some_behavior(self):\n" @@ -792,18 +997,26 @@ msgid "" "... SAD = 2\n" "..." msgstr "" +">>> class Foo(Enum):\n" +"... def some_behavior(self):\n" +"... pass\n" +"...\n" +">>> class Bar(Foo):\n" +"... HAPPY = 1\n" +"... SAD = 2\n" +"..." -#: ../../howto/enum.rst:475 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " "makes sense to allow sharing some common behavior between a group of " "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -"メンバーが定義された列挙型のサブクラス化を許可すると、いくつかのデータ型およ" -"びインスタンスの重要な不変条件の違反を引き起こします。とはいえ、それが許可さ" -"れると、列挙型のグループ間での共通の挙動を共有するという利点もあります。 " -"(`OrderedEnum`_ の例を参照してください。)" +"メンバーを定義した列挙型のサブクラス化を許すと、型やインスタンスに関する重要" +"な不変条件が破られます。\n" +"一方、複数の列挙型で共通の動作を共有できるようにすることには意味がありま" +"す。\n" +"例は `OrderedEnum`_ を参照してください。" #: ../../howto/enum.rst:484 msgid "Dataclass support" @@ -817,7 +1030,6 @@ msgstr "" ":class:`~dataclasses.dataclass` を継承する場合、 :meth:`~Enum.__repr__` は継" "承するクラス名を省略します。 例えば::" -#: ../../howto/enum.rst:489 msgid "" ">>> from dataclasses import dataclass, field\n" ">>> @dataclass\n" @@ -833,6 +1045,19 @@ msgid "" ">>> Creature.DOG\n" "" msgstr "" +">>> from dataclasses import dataclass, field\n" +">>> @dataclass\n" +"... class CreatureDataMixin:\n" +"... size: str\n" +"... legs: int\n" +"... tail: bool = field(repr=False, default=True)\n" +"...\n" +">>> class Creature(CreatureDataMixin, Enum):\n" +"... BEETLE = 'small', 6\n" +"... DOG = 'medium', 4\n" +"...\n" +">>> Creature.DOG\n" +"" #: ../../howto/enum.rst:503 msgid "" @@ -850,15 +1075,17 @@ msgstr "" "dataclass のフィールドだけが値の領域に表示され、dataclassの名前は表示されなく" "なりました" -#: ../../howto/enum.rst:512 msgid "" "Adding :deco:`~dataclasses.dataclass` decorator to :class:`Enum` and its " "subclasses is not supported. It will not raise any errors, but it will " "produce very strange results at runtime, such as members being equal to each " "other::" msgstr "" +":class:`Enum` やそのサブクラスへの :deco:`~dataclasses.dataclass` デコレータ" +"の適用はサポートされていません。\n" +"エラーは発生しませんが、異なるメンバーが等しいと判定されるなど、実行時に非常" +"に奇妙な結果になります。 ::" -#: ../../howto/enum.rst:517 msgid "" ">>> @dataclass # don't do this: it does not make any sense\n" "... class Color(Enum):\n" @@ -870,6 +1097,16 @@ msgid "" ">>> Color.RED == Color.BLUE # problem is here: they should not be equal\n" "True" msgstr "" +">>> @dataclass # 意味のない操作なので、このようにしてはいけな" +"い\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... BLUE = 2\n" +"...\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED == Color.BLUE # ここが問題: 等しくなるべきではない\n" +"True" #: ../../howto/enum.rst:529 msgid "Pickling" @@ -879,23 +1116,25 @@ msgstr "Pickle 化" msgid "Enumerations can be pickled and unpickled::" msgstr "列挙型は pickle 化と unpickle 化が行えます::" -#: ../../howto/enum.rst:533 msgid "" ">>> from test.test_enum import Fruit\n" ">>> from pickle import dumps, loads\n" ">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" "True" msgstr "" +">>> from test.test_enum import Fruit\n" +">>> from pickle import dumps, loads\n" +">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" +"True" -#: ../../howto/enum.rst:538 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -"通常の pickle 化の制限事項が適用されます: pickle 可能な列挙型はモジュールの" -"トップレベルで定義されていなくてはならず、unpickle 化はモジュールからインポー" -"ト可能でなければなりません。" +"通常の pickle 化の制約が適用されます。\n" +"unpickle 化の際にモジュールから列挙型をインポートできる必要があるため、" +"pickle 化する列挙型はモジュールのトップレベルで定義しなければなりません。" #: ../../howto/enum.rst:544 msgid "" @@ -905,19 +1144,24 @@ msgstr "" "pickle プロトコルバージョン 4 では他のクラスで入れ子になった列挙型の pickle " "化も容易です。" -#: ../../howto/enum.rst:547 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`~object.__reduce_ex__` in the enumeration class. The default method " "is by-value, but enums with complicated values may want to use by-name::" msgstr "" +"列挙型クラスに :meth:`~object.__reduce_ex__` を定義すると、メンバーの pickle " +"化・unpickle 化の方法を変更できます。\n" +"デフォルトでは値を使いますが、値が複雑な列挙型では名前を使う方法が適している" +"場合があります。 ::" -#: ../../howto/enum.rst:551 msgid "" ">>> import enum\n" ">>> class MyEnum(enum.Enum):\n" "... __reduce_ex__ = enum.pickle_by_enum_name" msgstr "" +">>> import enum\n" +">>> class MyEnum(enum.Enum):\n" +"... __reduce_ex__ = enum.pickle_by_enum_name" #: ../../howto/enum.rst:557 msgid "" @@ -937,7 +1181,6 @@ msgid "" msgstr "" ":class:`Enum` クラスは呼び出し可能で、以下の関数 API を提供しています::" -#: ../../howto/enum.rst:566 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" ">>> Animal\n" @@ -947,16 +1190,22 @@ msgid "" ">>> list(Animal)\n" "[, , , ]" msgstr "" - -#: ../../howto/enum.rst:574 -msgid "" -"The semantics of this API resemble :class:`~collections.namedtuple`. The " -"first argument of the call to :class:`Enum` is the name of the enumeration." +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" +">>> Animal\n" +"\n" +">>> Animal.ANT\n" +"\n" +">>> list(Animal)\n" +"[, , , ]" + +#: ../../howto/enum.rst:574 +msgid "" +"The semantics of this API resemble :class:`~collections.namedtuple`. The " +"first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" "この API の動作は :class:`~collections.namedtuple` と似ています。:class:" "`Enum` 呼び出しの第 1 引数は列挙型の名前です。" -#: ../../howto/enum.rst:577 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -967,8 +1216,15 @@ msgid "" "class derived from :class:`Enum` is returned. In other words, the above " "assignment to :class:`!Animal` is equivalent to::" msgstr "" +"第 2 引数は列挙型メンバーの名前の *もと* になるものです。\n" +"空白区切りの名前の文字列、名前のシーケンス、キーと値のペアを表す 2 要素タプル" +"のシーケンス、名前を値に対応付ける辞書などのマッピングを指定できます。\n" +"後の 2 つでは、列挙型に任意の値を割り当てられます。\n" +"それ以外では 1 から始まる整数が順に自動で割り当てられます (開始値は " +"``start`` 引数で変更できます)。\n" +":class:`Enum` を継承する新しいクラスが返されます。\n" +"つまり、上記の :class:`!Animal` への代入は次と同じです。 ::" -#: ../../howto/enum.rst:586 msgid "" ">>> class Animal(Enum):\n" "... ANT = 1\n" @@ -977,6 +1233,12 @@ msgid "" "... DOG = 4\n" "..." msgstr "" +">>> class Animal(Enum):\n" +"... ANT = 1\n" +"... BEE = 2\n" +"... CAT = 3\n" +"... DOG = 4\n" +"..." msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " @@ -987,7 +1249,6 @@ msgstr "" "は ``False`` であり、デフォルトの列挙メンバーはすべて ``True`` 評価されるよう" "にするためである。" -#: ../../howto/enum.rst:597 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -995,44 +1256,45 @@ msgid "" "function in a separate module, and also may not work on IronPython or " "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -"機能 API による Enum の pickle 化は、その列挙型がどのモジュールで作成されたか" -"を見つけ出すためにフレームスタックの実装の詳細が使われるので、トリッキーにな" -"ることがあります (例えば別のモジュールのユーティリティ関数を使うと失敗します" -"し、IronPython や Jython ではうまくいきません)。解決策は、以下のようにモ" -"ジュール名を明示的に指定することです::" +"関数 API で作った列挙型の pickle 化は、注意が必要な場合があります。\n" +"列挙型が作られたモジュールを特定するために、フレームスタックの実装の詳細を使" +"うためです。\n" +"例えば、別モジュールのユーティリティ関数で作ると失敗し、IronPython や Jython " +"でも動かない可能性があります。\n" +"解決策は、次のようにモジュール名を明示的に指定することです。 ::" -#: ../../howto/enum.rst:603 msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" -msgstr "" +msgstr ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" -#: ../../howto/enum.rst:607 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -"``module`` が与えられない場合、Enum はそれがなにか決定できないため、新しい " -"Enum メンバーは unpickle 化できなくなります; エラーをソースの近いところで発生" -"させるため、pickle 化は無効になります。" +"``module`` が指定されず、Enum 自身もモジュールを特定できない場合、新しい " +"Enum メンバーは unpickle 化できません。\n" +"問題の発生源に近いところでエラーを出すため、pickle 化も無効になります。" -#: ../../howto/enum.rst:611 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~type.__qualname__` being set to the location where pickle will be able to " "find the class. For example, if the class was made available in class " "SomeData in the global scope::" msgstr "" +"新しい pickle プロトコル 4 も、場合によっては、pickle がクラスを見つけられる" +"場所を :attr:`~type.__qualname__` に設定しておく必要があります。\n" +"例えば、グローバルスコープのクラス SomeData の中から、このクラスにアクセスで" +"きる場合は次のようにします。 ::" -#: ../../howto/enum.rst:616 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" msgstr "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" #: ../../howto/enum.rst:618 msgid "The complete signature is::" msgstr "完全な構文は以下のようになります::" -#: ../../howto/enum.rst:620 msgid "" "Enum(\n" " value='NewEnumName',\n" @@ -1044,10 +1306,18 @@ msgid "" " start=1,\n" " )" msgstr "" +"Enum(\n" +" value='NewEnumName',\n" +" names=<...>,\n" +" *,\n" +" module='...',\n" +" qualname='...',\n" +" type=,\n" +" start=1,\n" +" )" -#: ../../howto/enum.rst:630 msgid "*value*: What the new enum class will record as its name." -msgstr "" +msgstr "*value*: 新しい列挙型クラスの名前として記録する値。" #: ../../howto/enum.rst:632 msgid "" @@ -1057,41 +1327,36 @@ msgstr "" "*names*: enumのメンバー。 空白またはカンマで区切られた文字列 (値は特に指定が" "ない限り1から始まります)::" -#: ../../howto/enum.rst:635 msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" -msgstr "" +msgstr "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" #: ../../howto/enum.rst:637 msgid "or an iterator of names::" msgstr "または名前のイテレータで指定もできます::" -#: ../../howto/enum.rst:639 msgid "['RED', 'GREEN', 'BLUE']" -msgstr "" +msgstr "['RED', 'GREEN', 'BLUE']" #: ../../howto/enum.rst:641 msgid "or an iterator of (name, value) pairs::" msgstr "または (名前, 値) のペアのイテレータでも指定できます::" -#: ../../howto/enum.rst:643 msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" -msgstr "" +msgstr "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" #: ../../howto/enum.rst:645 msgid "or a mapping::" msgstr "またはマッピングでも指定できます::" -#: ../../howto/enum.rst:647 msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" -msgstr "" +msgstr "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" #: ../../howto/enum.rst:649 msgid "*module*: name of module where new enum class can be found." msgstr "*module*: 新しい enum クラスが属するモジュールの名前です。" -#: ../../howto/enum.rst:651 msgid "*qualname*: where in module new enum class can be found." -msgstr "*qualname*: 新しい enum クラスが属するモジュールの場所です。" +msgstr "*qualname*: モジュール内で新しい列挙型クラスを見つけられる場所。" #: ../../howto/enum.rst:653 msgid "*type*: type to mix in to new enum class." @@ -1125,7 +1390,6 @@ msgstr "" ":class:`IntEnum` のメンバーは整数と比較できます;\n" "さらに言うと、異なる整数列挙型どうしでも比較できます::" -#: ../../howto/enum.rst:672 msgid "" ">>> from enum import IntEnum\n" ">>> class Shape(IntEnum):\n" @@ -1143,6 +1407,21 @@ msgid "" ">>> Shape.CIRCLE == Request.POST\n" "True" msgstr "" +">>> from enum import IntEnum\n" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Request(IntEnum):\n" +"... POST = 1\n" +"... GET = 2\n" +"...\n" +">>> Shape == 1\n" +"False\n" +">>> Shape.CIRCLE == 1\n" +"True\n" +">>> Shape.CIRCLE == Request.POST\n" +"True" #: ../../howto/enum.rst:688 msgid "" @@ -1150,7 +1429,6 @@ msgid "" "enumerations::" msgstr "ただし、これらも標準の :class:`Enum` 列挙型とは比較できません::" -#: ../../howto/enum.rst:690 msgid "" ">>> class Shape(IntEnum):\n" "... CIRCLE = 1\n" @@ -1163,13 +1441,22 @@ msgid "" ">>> Shape.CIRCLE == Color.RED\n" "False" msgstr "" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"...\n" +">>> Shape.CIRCLE == Color.RED\n" +"False" #: ../../howto/enum.rst:701 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr ":class:`IntEnum` の値は他の用途では整数のように振る舞います::" -#: ../../howto/enum.rst:703 msgid "" ">>> int(Shape.CIRCLE)\n" "1\n" @@ -1178,6 +1465,12 @@ msgid "" ">>> [i for i in range(Shape.SQUARE)]\n" "[0, 1]" msgstr "" +">>> int(Shape.CIRCLE)\n" +"1\n" +">>> ['a', 'b', 'c'][Shape.CIRCLE]\n" +"'b'\n" +">>> [i for i in range(Shape.SQUARE)]\n" +"[0, 1]" #: ../../howto/enum.rst:712 msgid "StrEnum" @@ -1198,7 +1491,6 @@ msgstr "" msgid "IntFlag" msgstr "IntFlag" -#: ../../howto/enum.rst:725 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -1207,12 +1499,12 @@ msgid "" "`IntFlag` members are also integers and can be used wherever an :class:`int` " "is used." msgstr "" -"次の :class:`Enum` の派生型 :class:`IntFlag` も、:class:`int` を基底クラスと" -"しています。\n" -"違いは、 :class:`IntFlag` のメンバーをビット演算子 (&, \\|, ^, ~) を使っ" -"て組み合わせられ、その結果も :class:`IntFlag` メンバーになることです。 :" -"class:`IntEnum` と同様、:class:`IntFlag` のメンバーも整数であり、:class:" -"`int` が使用されるところであればどこでも使えます。" +"次の :class:`Enum` の派生型 :class:`IntFlag` も、:class:`int` を基底としてい" +"ます。\n" +"違いは、:class:`IntFlag` のメンバーをビット演算子 (&, \\|, ^, ~) で組み合わせ" +"ることができ、可能であれば結果も :class:`IntFlag` のメンバーになる点です。\n" +":class:`IntEnum` と同様に、:class:`IntFlag` のメンバーも整数なので、:class:" +"`int` を使える場所ならどこでも使えます。" #: ../../howto/enum.rst:733 msgid "" @@ -1235,7 +1527,6 @@ msgstr "" msgid "Sample :class:`IntFlag` class::" msgstr ":class:`IntFlag` クラスの例::" -#: ../../howto/enum.rst:745 msgid "" ">>> from enum import IntFlag\n" ">>> class Perm(IntFlag):\n" @@ -1251,12 +1542,24 @@ msgid "" ">>> Perm.R in RW\n" "True" msgstr "" +">>> from enum import IntFlag\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> Perm.R | Perm.W\n" +"\n" +">>> Perm.R + Perm.W\n" +"6\n" +">>> RW = Perm.R | Perm.W\n" +">>> Perm.R in RW\n" +"True" #: ../../howto/enum.rst:759 msgid "It is also possible to name the combinations::" msgstr "組み合わせにも名前を付けられます::" -#: ../../howto/enum.rst:761 msgid "" ">>> class Perm(IntFlag):\n" "... R = 4\n" @@ -1271,6 +1574,18 @@ msgid "" ">>> Perm(7)\n" "" msgstr "" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"... RWX = 7\n" +"...\n" +">>> Perm.RWX\n" +"\n" +">>> ~Perm.RWX\n" +"\n" +">>> Perm(7)\n" +"" #: ../../howto/enum.rst:776 msgid "" @@ -1290,13 +1605,16 @@ msgstr "" "ていない (値が0である) 場合、その真偽値としての評価は :data:`False` になるこ" "とです::" -#: ../../howto/enum.rst:784 msgid "" ">>> Perm.R & Perm.X\n" "\n" ">>> bool(Perm.R & Perm.X)\n" "False" msgstr "" +">>> Perm.R & Perm.X\n" +"\n" +">>> bool(Perm.R & Perm.X)\n" +"False" #: ../../howto/enum.rst:789 msgid "" @@ -1307,7 +1625,6 @@ msgstr "" "合わせることができます(ただし、 :class:`IntFlag` 型ではなくなる可能性があり" "ます)::" -#: ../../howto/enum.rst:792 msgid "" ">>> Perm.X | 4\n" "\n" @@ -1315,6 +1632,11 @@ msgid "" ">>> Perm.X + 8\n" "9" msgstr "" +">>> Perm.X | 4\n" +"\n" +"\n" +">>> Perm.X + 8\n" +"9" #: ../../howto/enum.rst:800 msgid "" @@ -1323,21 +1645,23 @@ msgid "" msgstr "" "否定の演算子 ``~`` は、常に正の値を持つ :class:`IntFlag` メンバー を返す::" -#: ../../howto/enum.rst:803 msgid "" ">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" "True" msgstr "" +">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" +"True" #: ../../howto/enum.rst:806 msgid ":class:`IntFlag` members can also be iterated over::" msgstr ":class:`IntFlag` メンバーは反復処理することもできます::" -#: ../../howto/enum.rst:808 msgid "" ">>> list(RW)\n" "[, ]" msgstr "" +">>> list(RW)\n" +"[, ]" #: ../../howto/enum.rst:815 msgid "Flag" @@ -1369,7 +1693,6 @@ msgstr "" "設定されていない状態になった場合、その真偽値としての評価は :data:`False` とな" "ります::" -#: ../../howto/enum.rst:829 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1382,6 +1705,16 @@ msgid "" ">>> bool(Color.RED & Color.GREEN)\n" "False" msgstr "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.RED & Color.GREEN\n" +"\n" +">>> bool(Color.RED & Color.GREEN)\n" +"False" #: ../../howto/enum.rst:840 msgid "" @@ -1391,7 +1724,6 @@ msgstr "" "個別のフラグは 2 のべき乗 (1, 2, 4, 8, ...) の値を持つべきですが、フラグの組" "み合わせはそうはなりません::" -#: ../../howto/enum.rst:843 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -1402,6 +1734,14 @@ msgid "" ">>> Color.WHITE\n" "" msgstr "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"... WHITE = RED | BLUE | GREEN\n" +"...\n" +">>> Color.WHITE\n" +"" #: ../../howto/enum.rst:852 msgid "" @@ -1410,7 +1750,6 @@ msgid "" msgstr "" "\"フラグが設定されていない\" 状態に名前を付けても、その真偽値は変わりません::" -#: ../../howto/enum.rst:855 msgid "" ">>> class Color(Flag):\n" "... BLACK = 0\n" @@ -1423,17 +1762,29 @@ msgid "" ">>> bool(Color.BLACK)\n" "False" msgstr "" +">>> class Color(Flag):\n" +"... BLACK = 0\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.BLACK\n" +"\n" +">>> bool(Color.BLACK)\n" +"False" #: ../../howto/enum.rst:866 msgid ":class:`Flag` members can also be iterated over::" msgstr ":class:`Flag` メンバーは反復処理することもできます::" -#: ../../howto/enum.rst:868 msgid "" ">>> purple = Color.RED | Color.BLUE\n" ">>> list(purple)\n" "[, ]" msgstr "" +">>> purple = Color.RED | Color.BLUE\n" +">>> list(purple)\n" +"[, ]" #: ../../howto/enum.rst:876 msgid "" @@ -1467,22 +1818,24 @@ msgstr "" ":class:`IntEnum` は :mod:`enum` モジュールの一部ですが、単独での実装もとても" "簡単に行なえます::" -#: ../../howto/enum.rst:891 msgid "" "class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" " pass" msgstr "" +"class IntEnum(int, ReprEnum): # ReprEnum の代わりに Enum でもよい\n" +" pass" -#: ../../howto/enum.rst:894 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" +"このようにして、同様の派生列挙型を定義できます。\n" +"例えば、:class:`int` の代わりに :class:`float` をミックスインする :class:`!" +"FloatEnum` も作れます。" -#: ../../howto/enum.rst:897 msgid "Some rules:" -msgstr "いくつかのルール:" +msgstr "Some rules:" #: ../../howto/enum.rst:899 msgid "" @@ -1516,18 +1869,21 @@ msgstr "" "データ型でなければならなくなります。この制限は、メソッドの追加するだけの、他" "のデータ型を指定しない複合には適用されません。" -#: ../../howto/enum.rst:909 msgid "" "When another data type is mixed in, the :attr:`~Enum.value` attribute is " "*not the same* as the enum member itself, although it is equivalent and will " "compare equal." msgstr "" +"別のデータ型をミックスインした場合、:attr:`~Enum.value` 属性は列挙型メンバー" +"自身とは *同一ではありません*。\n" +"ただし、同等の値であり、等価比較では等しいと判定されます。" -#: ../../howto/enum.rst:912 msgid "" "A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" +"ここでいう ``データ型`` は、:meth:`~object.__new__` を定義するミックスイン、" +"または :class:`~dataclasses.dataclass` です。" #: ../../howto/enum.rst:914 msgid "" @@ -1537,31 +1893,36 @@ msgid "" "type." msgstr "" -#: ../../howto/enum.rst:917 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`~object.__str__` method." msgstr "" +":ref:`フォーマット済み文字列リテラル `、:meth:`str.format`、:func:" +"`format` は、列挙型の :meth:`~object.__str__` メソッドを使います。" -#: ../../howto/enum.rst:922 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`~object.__str__` method has been reset to their data types' :meth:`~object." "__str__` method." msgstr "" +":class:`IntEnum`、:class:`IntFlag`、:class:`StrEnum` は既存の定数をそのまま置" +"き換えられるように設計されているため、:meth:`~object.__str__` メソッドは、そ" +"れぞれのデータ型の :meth:`~object.__str__` に設定し直されています。" -#: ../../howto/enum.rst:930 msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`" -msgstr "" +msgstr ":meth:`~object.__new__` と :meth:`~object.__init__` の使い分け" -#: ../../howto/enum.rst:932 msgid "" ":meth:`~object.__new__` must be used whenever you want to customize the " "actual value of the :class:`Enum` member. Any other modifications may go in " "either :meth:`~object.__new__` or :meth:`~object.__init__`, with :meth:" "`~object.__init__` being preferred." msgstr "" +":class:`Enum` メンバーの実際の値をカスタマイズする場合は、:meth:`~object." +"__new__` を使わなければなりません。\n" +"それ以外の変更は :meth:`~object.__new__` と :meth:`~object.__init__` のどちら" +"でも行えますが、:meth:`~object.__init__` を使うほうが望ましいです。" #: ../../howto/enum.rst:936 msgid "" @@ -1571,7 +1932,6 @@ msgstr "" "例えば、複数の値をコンストラクタに渡すが、その中の1つだけを値として使いたい場" "合は次のようにします:" -#: ../../howto/enum.rst:939 msgid "" ">>> class Coordinate(bytes, Enum):\n" "... \"\"\"\n" @@ -1595,26 +1955,49 @@ msgid "" ">>> print(Coordinate(3))\n" "Coordinate.VY" msgstr "" +">>> class Coordinate(bytes, Enum):\n" +"... \"\"\"\n" +"... 整数のコードで検索できる、バイナリコード付きの座標。\n" +"... \"\"\"\n" +"... def __new__(cls, value, label, unit):\n" +"... obj = bytes.__new__(cls, [value])\n" +"... obj._value_ = value\n" +"... obj.label = label\n" +"... obj.unit = unit\n" +"... return obj\n" +"... PX = (0, 'P.X', 'km')\n" +"... PY = (1, 'P.Y', 'km')\n" +"... VX = (2, 'V.X', 'km/s')\n" +"... VY = (3, 'V.Y', 'km/s')\n" +"...\n" +"\n" +">>> print(Coordinate['PY'])\n" +"Coordinate.PY\n" +"\n" +">>> print(Coordinate(3))\n" +"Coordinate.VY" -#: ../../howto/enum.rst:963 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly." msgstr "" +"``super().__new__()`` は *呼び出さないでください*。\n" +"検索専用の ``__new__`` が見つかるためです。\n" +"代わりに、データ型を直接使ってください。" #: ../../howto/enum.rst:968 msgid "Finer Points" msgstr "細かい点" -#: ../../howto/enum.rst:971 msgid "Supported ``__dunder__`` and ``_sunder_`` names" -msgstr "" +msgstr "サポートされる ``__dunder__`` 名と ``_sunder_`` 名" -#: ../../howto/enum.rst:973 msgid "" "The supported ``__dunder__`` and ``_sunder_`` names can be found in the :ref:" "`Enum API documentation `." msgstr "" +"サポートされる ``__dunder__`` 名と ``_sunder_`` 名は、:ref:`Enum の API ド" +"キュメント ` に記載されています。" #: ../../howto/enum.rst:977 msgid "_Private__names" @@ -1632,7 +2015,6 @@ msgstr "" msgid "``Enum`` member type" msgstr "``Enum`` メンバー型" -#: ../../howto/enum.rst:988 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -1641,14 +2023,15 @@ msgid "" "names and attributes/methods from mixed-in classes, upper-case names are " "strongly recommended." msgstr "" -"列挙型メンバーはその列挙型クラスのインスタンスであり、通常は ``EnumClass." -"member`` としてアクセスされます。 振る舞い メンバー しかし、メンバー の名前" -"と、属性/methodsが混在しているクラスとの名前の衝突を避けるために、大文字の名" -"前を使うことを強く推奨します。" +"列挙型のメンバーは、その列挙型クラスのインスタンスであり、通常は ``EnumClass." +"member`` としてアクセスします。\n" +"列挙型の独自の動作を書く場合などには、あるメンバーから別のメンバーへ直接アク" +"セスできると便利であり、この使い方もサポートされています。\n" +"ただし、メンバー名とミックスインしたクラスの属性やメソッド名との衝突を避ける" +"ため、メンバー名には大文字を使うことを強く推奨します。" -#: ../../howto/enum.rst:999 msgid "Creating members that are mixed with other data types" -msgstr "" +msgstr "ほかのデータ型と組み合わせたメンバーを作る" msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " @@ -1659,7 +2042,6 @@ msgstr "" "では、 ``=`` 以降の値はすべて、そのデータ型のコンストラクタに渡される。 例え" "ば::" -#: ../../howto/enum.rst:1005 msgid "" ">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" "... example = '11', 16 # so x='11' and base=16\n" @@ -1667,6 +2049,11 @@ msgid "" ">>> MyEnum.example.value # and hex(11) is...\n" "17" msgstr "" +">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" +"... example = '11', 16 # つまり x='11'、base=16\n" +"...\n" +">>> MyEnum.example.value # 16 進数の 11 は...\n" +"17" #: ../../howto/enum.rst:1013 msgid "Boolean value of ``Enum`` classes and members" @@ -1686,11 +2073,12 @@ msgstr "" "メンバーの値に依存する独自の enum の真偽値評価を行うには、クラスに次のコード" "を追加してください::" -#: ../../howto/enum.rst:1021 msgid "" "def __bool__(self):\n" " return bool(self.value)" msgstr "" +"def __bool__(self):\n" +" return bool(self.value)" #: ../../howto/enum.rst:1024 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." @@ -1710,7 +2098,6 @@ msgstr "" "に、そのメソッドはメンバーの :func:`dir` に表示されますが、クラスの " "``dir()`` には表示されません::" -#: ../../howto/enum.rst:1034 msgid "" ">>> dir(Planet)\n" "['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " @@ -1719,18 +2106,24 @@ msgid "" "['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " "'surface_gravity', 'value']" msgstr "" +">>> dir(Planet)\n" +"['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " +"'VENUS', '__class__', '__doc__', '__members__', '__module__']\n" +">>> dir(Planet.EARTH)\n" +"['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " +"'surface_gravity', 'value']" #: ../../howto/enum.rst:1041 msgid "Combining members of ``Flag``" msgstr "``Flag`` のメンバーの組み合わせ" -#: ../../howto/enum.rst:1043 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" +":class:`Flag` メンバーの組み合わせをイテレートすると、単一ビットで構成される" +"メンバーだけが返されます。 ::" -#: ../../howto/enum.rst:1046 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -1745,16 +2138,26 @@ msgid "" ">>> Color(7) # not named combination\n" "" msgstr "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"... MAGENTA = RED | BLUE\n" +"... YELLOW = RED | GREEN\n" +"... CYAN = GREEN | BLUE\n" +"...\n" +">>> Color(3) # 名前付きの組み合わせ\n" +"\n" +">>> Color(7) # 名前のない組み合わせ\n" +"" -#: ../../howto/enum.rst:1061 msgid "``Flag`` and ``IntFlag`` minutia" -msgstr "" +msgstr "``Flag`` と ``IntFlag`` の細部" #: ../../howto/enum.rst:1063 msgid "Using the following snippet for our examples::" msgstr "例として以下のスニペットを使用します::" -#: ../../howto/enum.rst:1065 msgid "" ">>> class Color(IntFlag):\n" "... BLACK = 0\n" @@ -1765,10 +2168,17 @@ msgid "" "... WHITE = RED | GREEN | BLUE\n" "..." msgstr "" +">>> class Color(IntFlag):\n" +"... BLACK = 0\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... PURPLE = RED | BLUE\n" +"... WHITE = RED | GREEN | BLUE\n" +"..." -#: ../../howto/enum.rst:1074 msgid "the following are true:" -msgstr "" +msgstr "次のことが成り立ちます。" #: ../../howto/enum.rst:1076 msgid "single-bit flags are canonical" @@ -1782,11 +2192,12 @@ msgstr "複数ビットや0ビットのフラグはエイリアスです" msgid "only canonical flags are returned during iteration::" msgstr "反復処理では正規形のフラグのみ返却されます::" -#: ../../howto/enum.rst:1080 msgid "" ">>> list(Color.WHITE)\n" "[, , ]" msgstr "" +">>> list(Color.WHITE)\n" +"[, , ]" #: ../../howto/enum.rst:1083 msgid "" @@ -1794,7 +2205,6 @@ msgid "" "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1086 msgid "" ">>> Color.BLUE\n" "\n" @@ -1802,12 +2212,16 @@ msgid "" ">>> ~Color.BLUE\n" "" msgstr "" +">>> Color.BLUE\n" +"\n" +"\n" +">>> ~Color.BLUE\n" +"" #: ../../howto/enum.rst:1092 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "名前のないフラグについては、そのメンバーの名前から名前が生成されます::" -#: ../../howto/enum.rst:1094 msgid "" ">>> (Color.RED | Color.GREEN).name\n" "'RED|GREEN'\n" @@ -1820,12 +2234,21 @@ msgid "" ">>> (Perm.R & Perm.W).name is None # effectively Perm(0)\n" "True" msgstr "" +">>> (Color.RED | Color.GREEN).name\n" +"'RED|GREEN'\n" +"\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> (Perm.R & Perm.W).name is None # 実質的には Perm(0)\n" +"True" -#: ../../howto/enum.rst:1105 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" +"演算の結果として、複数ビットのフラグ、つまり別名が返されることもあります。 ::" -#: ../../howto/enum.rst:1107 msgid "" ">>> Color.RED | Color.BLUE\n" "\n" @@ -1836,6 +2259,14 @@ msgid "" ">>> Color(0)\n" "" msgstr "" +">>> Color.RED | Color.BLUE\n" +"\n" +"\n" +">>> Color(7) # または Color(-1)\n" +"\n" +"\n" +">>> Color(0)\n" +"" #: ../../howto/enum.rst:1116 msgid "" @@ -1845,11 +2276,12 @@ msgstr "" "メンバーシップ/包含 のチェックでは、値が0のフラグは常に含まれるものとして扱わ" "れます::" -#: ../../howto/enum.rst:1119 msgid "" ">>> Color.BLACK in Color.WHITE\n" "True" msgstr "" +">>> Color.BLACK in Color.WHITE\n" +"True" #: ../../howto/enum.rst:1122 msgid "" @@ -1859,7 +2291,6 @@ msgstr "" "それ以外では、一方のフラグの全ビットが他方のフラグに含まれる場合のみ、Trueが" "返されます::" -#: ../../howto/enum.rst:1125 msgid "" ">>> Color.PURPLE in Color.WHITE\n" "True\n" @@ -1867,12 +2298,19 @@ msgid "" ">>> Color.GREEN in Color.PURPLE\n" "False" msgstr "" +">>> Color.PURPLE in Color.WHITE\n" +"True\n" +"\n" +">>> Color.GREEN in Color.PURPLE\n" +"False" -#: ../../howto/enum.rst:1131 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" +"範囲外のビットや無効なビットをどう扱うかを制御する、新しい境界の仕組みがあり" +"ます。\n" +"``STRICT``、``CONFORM``、``EJECT``、``KEEP`` の 4 つです。" #: ../../howto/enum.rst:1134 msgid "STRICT --> raises an exception when presented with invalid values" @@ -1887,21 +2325,17 @@ msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" "EJECT --> フラグのステータスを失い、指定された値を持つ通常の int となります。" -#: ../../howto/enum.rst:1137 msgid "KEEP --> keep the extra bits" -msgstr "" +msgstr "KEEP --> 余分なビットを保持する" -#: ../../howto/enum.rst:1139 msgid "keeps Flag status and extra bits" -msgstr "" +msgstr "Flag としての型と余分なビットを保持します。" -#: ../../howto/enum.rst:1140 msgid "extra bits do not show up in iteration" -msgstr "" +msgstr "余分なビットはイテレーションには現れません。" -#: ../../howto/enum.rst:1141 msgid "extra bits do show up in repr() and str()" -msgstr "" +msgstr "余分なビットは repr() と str() の結果には現れます。" #: ../../howto/enum.rst:1143 msgid "" @@ -1926,7 +2360,6 @@ msgstr "" msgid "Enum Classes" msgstr "Enum クラス" -#: ../../howto/enum.rst:1160 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " @@ -1937,12 +2370,18 @@ msgid "" "__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` and :meth:" "`~object.__repr__`)." msgstr "" +"メタクラス :class:`EnumType` は、:meth:`~object.__contains__`、:meth:" +"`~object.__dir__`、:meth:`~object.__iter__` などのメソッドを提供します。\n" +"これにより、通常のクラスでは失敗する ``list(Color)`` や ``some_enum_var in " +"Color`` のような操作を、:class:`Enum` クラスで行えるようになります。\n" +":class:`EnumType` はまた、作成される :class:`Enum` クラスの :meth:`~object." +"__new__`、:meth:`~object.__getnewargs__`、:meth:`~object.__str__`、:meth:" +"`~object.__repr__` などの各メソッドが適切なものになるようにします。" #: ../../howto/enum.rst:1169 msgid "Flag Classes" msgstr "Flag クラス" -#: ../../howto/enum.rst:1171 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1950,12 +2389,17 @@ msgid "" "a. ``0``) or with more than one power-of-two value (e.g. ``3``) is " "considered an alias." msgstr "" +"フラグでは、別名の意味が拡張されています。\n" +"正規のフラグであるには、値が 2 の累乗であり、ほかのメンバーの別名でないことが" +"必要です。\n" +"そのため、:class:`Enum` で別名となるものに加えて、値を持たないフラグ (つまり " +"``0``) や、複数の 2 の累乗の値を組み合わせたフラグ (例えば ``3``) も別名とみ" +"なされます。" #: ../../howto/enum.rst:1177 msgid "Enum Members (aka instances)" msgstr "Enum メンバー (インスタンス)" -#: ../../howto/enum.rst:1179 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1963,6 +2407,11 @@ msgid "" "that no new ones are ever instantiated by returning only the existing member " "instances." msgstr "" +"列挙型メンバーの最も興味深い点は、シングルトンであることです。\n" +":class:`EnumType` は列挙型クラスそのものを作る際に、すべてのメンバーを作りま" +"す。\n" +"その後、既存のメンバーインスタンスだけを返す独自の :meth:`~object.__new__` を" +"設定し、新しいインスタンスが作られないようにします。" #: ../../howto/enum.rst:1185 msgid "Flag Members" @@ -1976,11 +2425,12 @@ msgstr "" "フラグのメンバーは、:class:`Flag` クラスと同様に反復処理することができ、正規" "のメンバーのみが返されます。 例えば::" -#: ../../howto/enum.rst:1190 msgid "" ">>> list(Color)\n" "[, , ]" msgstr "" +">>> list(Color)\n" +"[, , ]" #: ../../howto/enum.rst:1193 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" @@ -1993,11 +2443,12 @@ msgid "" msgstr "" "フラグのメンバーを反転させると、負の値ではなく、対応する正の値が返されます::" -#: ../../howto/enum.rst:1198 msgid "" ">>> ~Color.RED\n" "" msgstr "" +">>> ~Color.RED\n" +"" #: ../../howto/enum.rst:1201 msgid "" @@ -2007,11 +2458,12 @@ msgstr "" "フラグのメンバーは、それが含む2のべき乗の値の数に対応するlengthを持ちます。 " "例えば::" -#: ../../howto/enum.rst:1204 msgid "" ">>> len(Color.PURPLE)\n" "2" msgstr "" +">>> len(Color.PURPLE)\n" +"2" #: ../../howto/enum.rst:1211 msgid "Enum Cookbook" @@ -2053,11 +2505,12 @@ msgstr "値として :class:`object` インスタンスを使用する" msgid "use a descriptive string as the value" msgstr "値として解説文字列を使用する" -#: ../../howto/enum.rst:1229 msgid "" "use a tuple as the value and a custom :meth:`~object.__new__` to replace the " "tuple with an :class:`int` value" msgstr "" +"値にタプルを使い、独自の :meth:`~object.__new__` でタプルを :class:`int` の値" +"に置き換える" #: ../../howto/enum.rst:1232 msgid "" @@ -2077,7 +2530,6 @@ msgstr ":class:`auto` を使う" msgid "Using :class:`auto` would look like::" msgstr ":class:`auto` を使うと次のようになります::" -#: ../../howto/enum.rst:1242 msgid "" ">>> class Color(Enum):\n" "... RED = auto()\n" @@ -2087,6 +2539,13 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.GREEN\n" +"" #: ../../howto/enum.rst:1252 msgid "Using :class:`object`" @@ -2096,7 +2555,6 @@ msgstr ":class:`object` を使う" msgid "Using :class:`object` would look like::" msgstr ":class:`object` を使うと次のようになります::" -#: ../../howto/enum.rst:1256 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -2106,14 +2564,21 @@ msgid "" ">>> Color.GREEN\n" ">" msgstr "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"...\n" +">>> Color.GREEN\n" +">" -#: ../../howto/enum.rst:1264 msgid "" "This is also a good example of why you might want to write your own :meth:" "`~object.__repr__`::" msgstr "" +"この例は、独自の :meth:`~object.__repr__` を書きたくなる理由もよく示していま" +"す。 ::" -#: ../../howto/enum.rst:1267 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -2125,6 +2590,15 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"... def __repr__(self):\n" +"... return \"<%s.%s>\" % (self.__class__.__name__, self._name_)\n" +"...\n" +">>> Color.GREEN\n" +"" #: ../../howto/enum.rst:1280 msgid "Using a descriptive string" @@ -2134,7 +2608,6 @@ msgstr "解説文字列を使う" msgid "Using a string as the value would look like::" msgstr "値として文字列を使うと次のようになります::" -#: ../../howto/enum.rst:1284 msgid "" ">>> class Color(Enum):\n" "... RED = 'stop'\n" @@ -2144,16 +2617,20 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class Color(Enum):\n" +"... RED = 'stop'\n" +"... GREEN = 'go'\n" +"... BLUE = 'too fast!'\n" +"...\n" +">>> Color.GREEN\n" +"" -#: ../../howto/enum.rst:1294 msgid "Using a custom :meth:`~object.__new__`" -msgstr "" +msgstr "独自の :meth:`~object.__new__` を使う" -#: ../../howto/enum.rst:1296 msgid "Using an auto-numbering :meth:`~object.__new__` would look like::" -msgstr "" +msgstr "自動採番する :meth:`~object.__new__` を使うと、次のようになります。 ::" -#: ../../howto/enum.rst:1298 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls):\n" @@ -2170,6 +2647,20 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls):\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"...\n" +">>> class Color(AutoNumber):\n" +"... RED = ()\n" +"... GREEN = ()\n" +"... BLUE = ()\n" +"...\n" +">>> Color.GREEN\n" +"" #: ../../howto/enum.rst:1313 msgid "" @@ -2179,7 +2670,6 @@ msgstr "" "``AutoNumber`` をより広い用途で使うには、シグニチャに ``*args`` を追加しま" "す::" -#: ../../howto/enum.rst:1315 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls, *args): # this is the only change from above\n" @@ -2189,6 +2679,13 @@ msgid "" "... return obj\n" "..." msgstr "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls, *args): # 上の例からの変更はここだけ\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"..." #: ../../howto/enum.rst:1323 msgid "" @@ -2198,7 +2695,6 @@ msgstr "" "``AutoNumber`` を継承すると、追加の引数を取り扱える独自の ``__init__`` が書け" "ます。" -#: ../../howto/enum.rst:1326 msgid "" ">>> class Swatch(AutoNumber):\n" "... def __init__(self, pantone='unknown'):\n" @@ -2214,23 +2710,40 @@ msgid "" ">>> Swatch.BLEACHED_CORAL.pantone\n" "'unknown'" msgstr "" +">>> class Swatch(AutoNumber):\n" +"... def __init__(self, pantone='unknown'):\n" +"... self.pantone = pantone\n" +"... AUBURN = '3497'\n" +"... SEA_GREEN = '1246'\n" +"... BLEACHED_CORAL = () # 新色なので、まだ Pantone コードはない!\n" +"...\n" +">>> Swatch.SEA_GREEN\n" +"\n" +">>> Swatch.SEA_GREEN.pantone\n" +"'1246'\n" +">>> Swatch.BLEACHED_CORAL.pantone\n" +"'unknown'" -#: ../../howto/enum.rst:1342 msgid "" "The :meth:`~object.__new__` method, if defined, is used during creation of " "the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " "which is used after class creation for lookup of existing members." msgstr "" +":meth:`~object.__new__` を定義した場合、そのメソッドは Enum メンバーの作成時" +"に使われます。\n" +"その後は Enum の :meth:`~object.__new__` に置き換えられ、クラス作成後の既存メ" +"ンバーの検索に使われます。" -#: ../../howto/enum.rst:1348 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" +"``super().__new__()`` は *呼び出さないでください*。\n" +"検索専用の ``__new__`` が見つかるためです。\n" +"代わりに、例えば次のようにデータ型を直接使ってください。 ::" -#: ../../howto/enum.rst:1351 msgid "obj = int.__new__(cls, value)" -msgstr "" +msgstr "obj = int.__new__(cls, value)" #: ../../howto/enum.rst:1355 msgid "OrderedEnum" @@ -2245,7 +2758,6 @@ msgstr "" ":class:`IntEnum` をベースとしないため、通常の :class:`Enum` の不変条件 (他の" "列挙型と比較できないなど) のままで、メンバーを順序付けできる列挙型です::" -#: ../../howto/enum.rst:1361 msgid "" ">>> class OrderedEnum(Enum):\n" "... def __ge__(self, other):\n" @@ -2275,6 +2787,33 @@ msgid "" ">>> Grade.C < Grade.A\n" "True" msgstr "" +">>> class OrderedEnum(Enum):\n" +"... def __ge__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value >= other.value\n" +"... return NotImplemented\n" +"... def __gt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value > other.value\n" +"... return NotImplemented\n" +"... def __le__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value <= other.value\n" +"... return NotImplemented\n" +"... def __lt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value < other.value\n" +"... return NotImplemented\n" +"...\n" +">>> class Grade(OrderedEnum):\n" +"... A = 5\n" +"... B = 4\n" +"... C = 3\n" +"... D = 2\n" +"... F = 1\n" +"...\n" +">>> Grade.C < Grade.A\n" +"True" #: ../../howto/enum.rst:1391 msgid "DuplicateFreeEnum" @@ -2288,7 +2827,6 @@ msgstr "" "値が重複するメンバーがある場合に、エイリアスを作成するのではなくエラーを発生" "させます::" -#: ../../howto/enum.rst:1396 msgid "" ">>> class DuplicateFreeEnum(Enum):\n" "... def __init__(self, *args):\n" @@ -2311,6 +2849,26 @@ msgid "" " ...\n" "ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" msgstr "" +">>> class DuplicateFreeEnum(Enum):\n" +"... def __init__(self, *args):\n" +"... cls = self.__class__\n" +"... if any(self.value == e.value for e in cls):\n" +"... a = self.name\n" +"... e = cls(self.value).name\n" +"... raise ValueError(\n" +"... \"aliases not allowed in DuplicateFreeEnum: %r --> " +"%r\"\n" +"... % (a, e))\n" +"...\n" +">>> class Color(DuplicateFreeEnum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... GRENE = 2\n" +"...\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" #: ../../howto/enum.rst:1418 msgid "" @@ -2322,15 +2880,12 @@ msgstr "" "サブクラス化に役立つ例です。単に別名を無効にしたいだけなら、 :func:`unique` " "デコレーターを使用して行えます。" -#: ../../howto/enum.rst:1425 msgid "MultiValueEnum" -msgstr "" +msgstr "MultiValueEnum" -#: ../../howto/enum.rst:1427 msgid "Supports having more than one value per member::" -msgstr "" +msgstr "1 つのメンバーに複数の値を持たせられます。 ::" -#: ../../howto/enum.rst:1429 msgid "" ">>> class MultiValueEnum(Enum):\n" "... def __new__(cls, value, *values):\n" @@ -2349,18 +2904,34 @@ msgid "" ">>> DType(9)\n" "" msgstr "" +">>> class MultiValueEnum(Enum):\n" +"... def __new__(cls, value, *values):\n" +"... self = object.__new__(cls)\n" +"... self._value_ = value\n" +"... for v in values:\n" +"... self._add_value_alias_(v)\n" +"... return self\n" +"...\n" +">>> class DType(MultiValueEnum):\n" +"... float32 = 'f', 8\n" +"... double64 = 'd', 9\n" +"...\n" +">>> DType('f')\n" +"\n" +">>> DType(9)\n" +"" #: ../../howto/enum.rst:1448 msgid "Planet" msgstr "Planet" -#: ../../howto/enum.rst:1450 msgid "" "If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value " "of the enum member will be passed to those methods::" msgstr "" +":meth:`~object.__new__` や :meth:`~object.__init__` を定義すると、列挙型メン" +"バーの値がこれらのメソッドに渡されます。 ::" -#: ../../howto/enum.rst:1453 msgid "" ">>> class Planet(Enum):\n" "... MERCURY = (3.303e+23, 2.4397e6)\n" @@ -2385,16 +2956,36 @@ msgid "" ">>> Planet.EARTH.surface_gravity\n" "9.802652743337129" msgstr "" +">>> class Planet(Enum):\n" +"... MERCURY = (3.303e+23, 2.4397e6)\n" +"... VENUS = (4.869e+24, 6.0518e6)\n" +"... EARTH = (5.976e+24, 6.37814e6)\n" +"... MARS = (6.421e+23, 3.3972e6)\n" +"... JUPITER = (1.9e+27, 7.1492e7)\n" +"... SATURN = (5.688e+26, 6.0268e7)\n" +"... URANUS = (8.686e+25, 2.5559e7)\n" +"... NEPTUNE = (1.024e+26, 2.4746e7)\n" +"... def __init__(self, mass, radius):\n" +"... self.mass = mass # 単位はキログラム\n" +"... self.radius = radius # 単位はメートル\n" +"... @property\n" +"... def surface_gravity(self):\n" +"... # 万有引力定数 (m3 kg-1 s-2)\n" +"... G = 6.67300E-11\n" +"... return G * self.mass / (self.radius * self.radius)\n" +"...\n" +">>> Planet.EARTH.value\n" +"(5.976e+24, 6378140.0)\n" +">>> Planet.EARTH.surface_gravity\n" +"9.802652743337129" #: ../../howto/enum.rst:1479 msgid "TimePeriod" msgstr "TimePeriod" -#: ../../howto/enum.rst:1481 msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::" -msgstr "" +msgstr ":attr:`~Enum._ignore_` 属性の使用例です。 ::" -#: ../../howto/enum.rst:1483 msgid "" ">>> import datetime as dt\n" ">>> class Period(dt.timedelta, Enum):\n" @@ -2411,14 +3002,31 @@ msgid "" "[, ]" msgstr "" +">>> import datetime as dt\n" +">>> class Period(dt.timedelta, Enum):\n" +"... \"さまざまな長さの時間\"\n" +"... _ignore_ = 'Period i'\n" +"... Period = vars()\n" +"... for i in range(367):\n" +"... Period['day_%d' % i] = i\n" +"...\n" +">>> list(Period)[:2]\n" +"[, ]\n" +">>> list(Period)[-2:]\n" +"[, ]" #: ../../howto/enum.rst:1500 msgid "Subclassing EnumType" msgstr "EnumType のサブクラスを作る" -#: ../../howto/enum.rst:1502 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " "subclassed to provide a different Enum experience." msgstr "" +"列挙型に関する要件の多くは、クラスデコレータや独自の関数で :class:`Enum` のサ" +"ブクラスをカスタマイズすれば満たせます。\n" +"一方、:class:`EnumType` のサブクラスを作れば、Enum 自体の使い方を変えることも" +"できます。" diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po index c251b2c0d..266744da5 100644 --- a/howto/free-threading-extensions.po +++ b/howto/free-threading-extensions.po @@ -22,68 +22,77 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/free-threading-extensions.rst:7 msgid "C API Extension Support for Free Threading" -msgstr "" +msgstr "C API 拡張のフリースレッド対応" -#: ../../howto/free-threading-extensions.rst:9 msgid "" "Starting with the 3.13 release, CPython has support for running with the :" "term:`global interpreter lock` (GIL) disabled in a configuration called :" "term:`free threading`. This document describes how to adapt C API " "extensions to support free threading." msgstr "" +"CPython 3.13 から、:term:`global interpreter lock` (GIL) を無効にして実行す" +"る :term:`free threading` という構成がサポートされています。\n" +"このドキュメントでは、C API を使う拡張をフリースレッドに対応させる方法を説明" +"します。" -#: ../../howto/free-threading-extensions.rst:16 msgid "Identifying the Free-Threaded Build in C" -msgstr "" +msgstr "C からフリースレッドビルドを識別する" -#: ../../howto/free-threading-extensions.rst:18 msgid "" "The CPython C API exposes the ``Py_GIL_DISABLED`` macro: in the free-" "threaded build it's defined to ``1``, and in the regular build it's not " "defined. You can use it to enable code that only runs under the free-" "threaded build::" msgstr "" +"CPython の C API は ``Py_GIL_DISABLED`` マクロを公開しています。\n" +"フリースレッドビルドでは ``1`` に定義され、通常のビルドでは定義されません。\n" +"これを使って、フリースレッドビルドでだけ実行するコードを有効にできます。 ::" -#: ../../howto/free-threading-extensions.rst:22 msgid "" "#ifdef Py_GIL_DISABLED\n" "/* code that only runs in the free-threaded build */\n" "#endif" msgstr "" +"#ifdef Py_GIL_DISABLED\n" +"/* フリースレッドビルドでだけ実行するコード */\n" +"#endif" -#: ../../howto/free-threading-extensions.rst:28 msgid "" "On Windows, this macro is not defined automatically, but must be specified " "to the compiler when building. The :func:`sysconfig.get_config_var` function " "can be used to determine whether the current running interpreter had the " "macro defined." msgstr "" +"Windows ではこのマクロは自動的には定義されないため、ビルド時にコンパイラへ指" +"定する必要があります。\n" +"実行中のインタープリタでこのマクロが定義されていたかは、:func:`sysconfig." +"get_config_var` 関数で確認できます。" -#: ../../howto/free-threading-extensions.rst:35 msgid "Module Initialization" -msgstr "" +msgstr "モジュールの初期化" -#: ../../howto/free-threading-extensions.rst:37 msgid "" "Extension modules need to explicitly indicate that they support running with " "the GIL disabled; otherwise importing the extension will raise a warning and " "enable the GIL at runtime." msgstr "" +"拡張モジュールは、GIL を無効にした実行に対応していることを明示する必要があり" +"ます。\n" +"そうしなければ、拡張のインポート時に警告が出され、実行時に GIL が有効になりま" +"す。" -#: ../../howto/free-threading-extensions.rst:41 msgid "" "There are two ways to indicate that an extension module supports running " "with the GIL disabled depending on whether the extension uses multi-phase or " "single-phase initialization." msgstr "" +"GIL を無効にした実行に対応していることを示す方法は、拡張が複数フェーズ初期化" +"と単一フェーズ初期化のどちらを使うかによって、2 通りあります。" -#: ../../howto/free-threading-extensions.rst:46 msgid "Multi-Phase Initialization" -msgstr "" +msgstr "複数フェーズ初期化" -#: ../../howto/free-threading-extensions.rst:48 msgid "" "Extensions that use :ref:`multi-phase initialization ` (functions like :c:func:`PyModuleDef_Init`, :c:func:" @@ -92,8 +101,13 @@ msgid "" "module definition. If your extension supports older versions of CPython, you " "should guard the slot with a :c:data:`PY_VERSION_HEX` check." msgstr "" +":ref:`複数フェーズ初期化 ` (:c:func:" +"`PyModuleDef_Init`、:c:func:`PyModExport_* ` エクス" +"ポートフック、:c:func:`PyModule_FromSlotsAndSpec` など) を使う拡張では、モ" +"ジュール定義に :c:data:`Py_mod_gil` スロットを追加してください。\n" +"古い CPython バージョンにも対応する場合は、:c:data:`PY_VERSION_HEX` を確認" +"し、対応するバージョンでだけこのスロットを追加してください。" -#: ../../howto/free-threading-extensions.rst:58 msgid "" "static struct PyModuleDef_Slot module_slots[] = {\n" " ...\n" @@ -103,12 +117,17 @@ msgid "" " {0, NULL}\n" "};" msgstr "" +"static struct PyModuleDef_Slot module_slots[] = {\n" +" ...\n" +"#if PY_VERSION_HEX >= 0x030D0000\n" +" {Py_mod_gil, Py_MOD_GIL_NOT_USED},\n" +"#endif\n" +" {0, NULL}\n" +"};" -#: ../../howto/free-threading-extensions.rst:68 msgid "Single-Phase Initialization" -msgstr "" +msgstr "単一フェーズ初期化" -#: ../../howto/free-threading-extensions.rst:70 msgid "" "Extensions that use legacy :ref:`single-phase initialization ` (that is, :c:func:`PyModule_Create`) should call :c:func:" @@ -117,8 +136,13 @@ msgid "" "you should guard the call with ``#ifdef Py_GIL_DISABLED`` to avoid " "compilation errors in the regular build." msgstr "" +"従来の :ref:`単一フェーズ初期化 ` (つまり :c:" +"func:`PyModule_Create`) を使う拡張では、:c:func:`PyUnstable_Module_SetGIL` を" +"呼び出して、GIL を無効にした実行に対応していることを示してください。\n" +"この関数はフリースレッドビルドでのみ定義されるため、通常のビルドでのコンパイ" +"ルエラーを避けるには、呼び出しを ``#ifdef Py_GIL_DISABLED`` で囲んでくださ" +"い。" -#: ../../howto/free-threading-extensions.rst:78 msgid "" "static struct PyModuleDef moduledef = {\n" " PyModuleDef_HEAD_INIT,\n" @@ -138,22 +162,38 @@ msgid "" " return m;\n" "}" msgstr "" +"static struct PyModuleDef moduledef = {\n" +" PyModuleDef_HEAD_INIT,\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_mymodule(void)\n" +"{\n" +" PyObject *m = PyModule_Create(&moduledef);\n" +" if (m == NULL) {\n" +" return NULL;\n" +" }\n" +"#ifdef Py_GIL_DISABLED\n" +" PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);\n" +"#endif\n" +" return m;\n" +"}" -#: ../../howto/free-threading-extensions.rst:98 msgid "General API Guidelines" -msgstr "" +msgstr "API 全般の指針" -#: ../../howto/free-threading-extensions.rst:100 msgid "Most of the C API is thread-safe, but there are some exceptions." -msgstr "" +msgstr "C API の大部分はスレッドセーフですが、例外もあります。" -#: ../../howto/free-threading-extensions.rst:102 msgid "" "**Struct Fields**: Accessing fields in Python C API objects or structs " "directly is not thread-safe if the field may be concurrently modified." msgstr "" +"**構造体のフィールド**: Python C API のオブジェクトや構造体のフィールドが並行" +"して変更される可能性がある場合、そのフィールドへの直接アクセスはスレッドセー" +"フではありません。" -#: ../../howto/free-threading-extensions.rst:104 msgid "" "**Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM`, :c:macro:" "`PyList_SET_ITEM`, and macros like :c:macro:`PySequence_Fast_GET_SIZE` that " @@ -161,40 +201,50 @@ msgid "" "error checking or locking. These macros are not thread-safe if the container " "object may be modified concurrently." msgstr "" +"**マクロ**: :c:macro:`PyList_GET_ITEM`、:c:macro:`PyList_SET_ITEM` などのアク" +"セス用マクロや、:c:func:`PySequence_Fast` が返すオブジェクトを使う :c:macro:" +"`PySequence_Fast_GET_SIZE` などのマクロは、エラーチェックもロックも行いませ" +"ん。\n" +"コンテナオブジェクトが並行して変更される可能性がある場合、これらのマクロはス" +"レッドセーフではありません。" -#: ../../howto/free-threading-extensions.rst:110 msgid "" "**Borrowed References**: C API functions that return :term:`borrowed " "references ` may not be thread-safe if the containing " "object is modified concurrently. See the section on :ref:`borrowed " "references ` for more information." msgstr "" +"**借用参照**: :term:`借用参照 ` を返す C API 関数は、参照" +"先を保持するオブジェクトが並行して変更される場合、スレッドセーフでないことが" +"あります。\n" +"詳しくは :ref:`借用参照の節 ` を参照してください。" -#: ../../howto/free-threading-extensions.rst:117 msgid "Container Thread Safety" -msgstr "" +msgstr "コンテナのスレッド安全性" -#: ../../howto/free-threading-extensions.rst:119 msgid "" "Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, and :c:" "struct:`PySetObject` perform internal locking in the free-threaded build. " "For example, the :c:func:`PyList_Append` will lock the list before appending " "an item." msgstr "" +":c:struct:`PyListObject`、:c:struct:`PyDictObject`、:c:struct:`PySetObject` " +"などのコンテナは、フリースレッドビルドでは内部でロックを使います。\n" +"例えば、:c:func:`PyList_Append` は要素を追加する前にリストをロックします。" -#: ../../howto/free-threading-extensions.rst:127 msgid "``PyDict_Next``" -msgstr "" +msgstr "``PyDict_Next``" -#: ../../howto/free-threading-extensions.rst:129 msgid "" "A notable exception is :c:func:`PyDict_Next`, which does not lock the " "dictionary. You should use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to protect " "the dictionary while iterating over it if the dictionary may be concurrently " "modified::" msgstr "" +"注意すべき例外は :c:func:`PyDict_Next` で、この関数は辞書をロックしません。\n" +"辞書が並行して変更される可能性がある場合は、:c:macro:" +"`Py_BEGIN_CRITICAL_SECTION` を使い、イテレート中の辞書を保護してください。 ::" -#: ../../howto/free-threading-extensions.rst:134 msgid "" "Py_BEGIN_CRITICAL_SECTION(dict);\n" "PyObject *key, *value;\n" @@ -204,113 +254,99 @@ msgid "" "}\n" "Py_END_CRITICAL_SECTION();" msgstr "" +"Py_BEGIN_CRITICAL_SECTION(dict);\n" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"while (PyDict_Next(dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" -#: ../../howto/free-threading-extensions.rst:144 msgid "Borrowed References" -msgstr "" +msgstr "借用参照" -#: ../../howto/free-threading-extensions.rst:148 msgid "" "Some C API functions return :term:`borrowed references `. These APIs are not thread-safe if the containing object is " "modified concurrently. For example, it's not safe to use :c:func:" "`PyList_GetItem` if the list may be modified concurrently." msgstr "" +"一部の C API 関数は :term:`借用参照 ` を返します。\n" +"参照先を保持するオブジェクトが並行して変更される場合、これらの API はスレッド" +"セーフではありません。\n" +"例えば、リストが並行して変更される可能性がある状況で :c:func:" +"`PyList_GetItem` を使うのは安全ではありません。" -#: ../../howto/free-threading-extensions.rst:153 msgid "" "The following table lists some borrowed reference APIs and their " "replacements that return :term:`strong references `." msgstr "" +"次の表は、借用参照を返す API の一部と、代わりに使える :term:`強参照 ` を返す API を示します。" -#: ../../howto/free-threading-extensions.rst:157 msgid "Borrowed reference API" -msgstr "" +msgstr "借用参照を返す API" -#: ../../howto/free-threading-extensions.rst:157 msgid "Strong reference API" -msgstr "" +msgstr "強参照を返す API" -#: ../../howto/free-threading-extensions.rst:159 msgid ":c:func:`PyList_GetItem`" -msgstr "" +msgstr ":c:func:`PyList_GetItem`" -#: ../../howto/free-threading-extensions.rst:159 -#: ../../howto/free-threading-extensions.rst:161 msgid ":c:func:`PyList_GetItemRef`" -msgstr "" +msgstr ":c:func:`PyList_GetItemRef`" -#: ../../howto/free-threading-extensions.rst:161 msgid ":c:func:`PyList_GET_ITEM`" -msgstr "" +msgstr ":c:func:`PyList_GET_ITEM`" -#: ../../howto/free-threading-extensions.rst:163 msgid ":c:func:`PyDict_GetItem`" -msgstr "" +msgstr ":c:func:`PyDict_GetItem`" -#: ../../howto/free-threading-extensions.rst:163 -#: ../../howto/free-threading-extensions.rst:165 msgid ":c:func:`PyDict_GetItemRef`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemRef`" -#: ../../howto/free-threading-extensions.rst:165 msgid ":c:func:`PyDict_GetItemWithError`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemWithError`" -#: ../../howto/free-threading-extensions.rst:167 msgid ":c:func:`PyDict_GetItemString`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemString`" -#: ../../howto/free-threading-extensions.rst:167 msgid ":c:func:`PyDict_GetItemStringRef`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemStringRef`" -#: ../../howto/free-threading-extensions.rst:169 msgid ":c:func:`PyDict_SetDefault`" -msgstr "" +msgstr ":c:func:`PyDict_SetDefault`" -#: ../../howto/free-threading-extensions.rst:169 msgid ":c:func:`PyDict_SetDefaultRef`" -msgstr "" +msgstr ":c:func:`PyDict_SetDefaultRef`" -#: ../../howto/free-threading-extensions.rst:171 msgid ":c:func:`PyDict_Next`" -msgstr "" +msgstr ":c:func:`PyDict_Next`" -#: ../../howto/free-threading-extensions.rst:171 msgid "none (see :ref:`PyDict_Next`)" -msgstr "" +msgstr "なし (:ref:`PyDict_Next` を参照)" -#: ../../howto/free-threading-extensions.rst:173 msgid ":c:func:`!PyWeakref_GetObject`" -msgstr "" +msgstr ":c:func:`!PyWeakref_GetObject`" -#: ../../howto/free-threading-extensions.rst:173 -#: ../../howto/free-threading-extensions.rst:175 msgid ":c:func:`PyWeakref_GetRef`" -msgstr "" +msgstr ":c:func:`PyWeakref_GetRef`" -#: ../../howto/free-threading-extensions.rst:175 msgid ":c:func:`!PyWeakref_GET_OBJECT`" -msgstr "" +msgstr ":c:func:`!PyWeakref_GET_OBJECT`" -#: ../../howto/free-threading-extensions.rst:177 msgid ":c:func:`PyImport_AddModule`" -msgstr "" +msgstr ":c:func:`PyImport_AddModule`" -#: ../../howto/free-threading-extensions.rst:177 msgid ":c:func:`PyImport_AddModuleRef`" -msgstr "" +msgstr ":c:func:`PyImport_AddModuleRef`" -#: ../../howto/free-threading-extensions.rst:179 msgid ":c:func:`PyCell_GET`" -msgstr "" +msgstr ":c:func:`PyCell_GET`" -#: ../../howto/free-threading-extensions.rst:179 msgid ":c:func:`PyCell_Get`" -msgstr "" +msgstr ":c:func:`PyCell_Get`" -#: ../../howto/free-threading-extensions.rst:182 msgid "" "Not all APIs that return borrowed references are problematic. For example, :" "c:func:`PyTuple_GetItem` is safe because tuples are immutable. Similarly, " @@ -320,19 +356,26 @@ msgid "" "(not accessible by other threads), so using borrowed references in that " "context is safe." msgstr "" +"借用参照を返すすべての API が問題になるわけではありません。\n" +"例えば、タプルはイミュータブルなので :c:func:`PyTuple_GetItem` は安全です。\n" +"また、上記 API の使い方がすべて問題になるわけでもありません。\n" +"例えば、:c:func:`PyDict_GetItem` は関数呼び出しのキーワード引数辞書の解析によ" +"く使われます。\n" +"この辞書は実質的にプライベートで、ほかのスレッドからアクセスできないため、そ" +"の状況で借用参照を使うのは安全です。" -#: ../../howto/free-threading-extensions.rst:190 msgid "" "Some of these functions were added in Python 3.13. You can use the " "`pythoncapi-compat `_ package " "to provide implementations of these functions for older Python versions." msgstr "" +"これらの関数の一部は Python 3.13 で追加されました。\n" +"古い Python バージョン向けには、`pythoncapi-compat `_ パッケージでこれらの関数の実装を利用できます。" -#: ../../howto/free-threading-extensions.rst:198 msgid "Memory Allocation APIs" -msgstr "" +msgstr "メモリ割り当て API" -#: ../../howto/free-threading-extensions.rst:200 msgid "" "Python's memory management C API provides functions in three different :ref:" "`allocation domains `: \"raw\", \"mem\", and \"object\". " @@ -341,43 +384,49 @@ msgid "" "allocated using that domain. This differs from the prior Python versions, " "where this was only a best practice and not a hard requirement." msgstr "" +"Python のメモリ管理 C API は、raw、mem、object という 3 つの :ref:`割り当てド" +"メイン ` の関数を提供します。\n" +"フリースレッドビルドではスレッド安全性のため、object ドメインで割り当てるの" +"は Python オブジェクトだけでなければならず、すべての Python オブジェクトをこ" +"のドメインで割り当てる必要があります。\n" +"以前の Python では、これは推奨事項にすぎず、必須条件ではありませんでした。" -#: ../../howto/free-threading-extensions.rst:209 msgid "" "Search for uses of :c:func:`PyObject_Malloc` in your extension and check " "that the allocated memory is used for Python objects. Use :c:func:" "`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`." msgstr "" +"拡張内の :c:func:`PyObject_Malloc` の使用箇所を探し、割り当てたメモリを " +"Python オブジェクトに使っているか確認してください。\n" +"バッファの割り当てには、:c:func:`PyObject_Malloc` ではなく :c:func:" +"`PyMem_Malloc` を使ってください。" -#: ../../howto/free-threading-extensions.rst:216 msgid "Thread State and GIL APIs" -msgstr "" +msgstr "スレッド状態と GIL の API" -#: ../../howto/free-threading-extensions.rst:218 msgid "" "Python provides a set of functions and macros to manage thread state and the " "GIL, such as:" msgstr "" +"Python は、スレッド状態と GIL を管理するために、次のような関数やマクロを提供" +"しています。" -#: ../../howto/free-threading-extensions.rst:221 msgid "" ":c:func:`PyThreadState_Ensure`, :c:func:`PyThreadState_EnsureFromView`, and :" "c:func:`PyThreadState_Release`" msgstr "" +":c:func:`PyThreadState_Ensure`、:c:func:`PyThreadState_EnsureFromView`、:c:" +"func:`PyThreadState_Release`" -#: ../../howto/free-threading-extensions.rst:223 msgid ":c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`" -msgstr "" +msgstr ":c:func:`PyGILState_Ensure` と :c:func:`PyGILState_Release`" -#: ../../howto/free-threading-extensions.rst:224 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`" -msgstr "" +msgstr ":c:func:`PyEval_SaveThread` と :c:func:`PyEval_RestoreThread`" -#: ../../howto/free-threading-extensions.rst:225 msgid ":c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS`" -msgstr "" +msgstr ":c:macro:`Py_BEGIN_ALLOW_THREADS` と :c:macro:`Py_END_ALLOW_THREADS`" -#: ../../howto/free-threading-extensions.rst:227 msgid "" "These functions should still be used in the free-threaded build to manage " "thread state even when the :term:`GIL` is disabled. For example, if you " @@ -385,46 +434,60 @@ msgid "" "`PyThreadState_Ensure` before calling into the Python API to ensure that the " "thread has a valid Python thread state." msgstr "" +"フリースレッドビルドで :term:`GIL` が無効な場合も、スレッド状態の管理にはこれ" +"らの関数を引き続き使う必要があります。\n" +"例えば、Python の外部で作成したスレッドから Python API を呼び出す場合は、先" +"に :c:func:`PyThreadState_Ensure` を呼び出し、有効な Python スレッド状態を持" +"つことを保証しなければなりません。" -#: ../../howto/free-threading-extensions.rst:233 msgid "" "You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:" "`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock " "acquisitions, to allow other threads to run the :term:`cyclic garbage " "collector `." msgstr "" +"I/O やロック取得などのブロッキング操作の前後では、引き続き :c:func:" +"`PyEval_SaveThread` や :c:macro:`Py_BEGIN_ALLOW_THREADS` を使ってください。\n" +"これにより、ほかのスレッドが :term:`循環ガベージコレクタ ` を実行できるようになります。" -#: ../../howto/free-threading-extensions.rst:240 msgid "Protecting Internal Extension State" -msgstr "" +msgstr "拡張の内部状態の保護" -#: ../../howto/free-threading-extensions.rst:242 msgid "" "Your extension may have internal state that was previously protected by the " "GIL. You may need to add locking to protect this state. The approach will " "depend on your extension, but some common patterns include:" msgstr "" +"拡張には、以前は GIL によって保護されていた内部状態があるかもしれません。\n" +"その状態を保護するためにロックを追加する必要がある場合があります。\n" +"方法は拡張によりますが、よくあるパターンには次のものがあります。" -#: ../../howto/free-threading-extensions.rst:246 msgid "" "**Caches**: global caches are a common source of shared state. Consider " "using a lock to protect the cache or disabling it in the free-threaded build " "if the cache is not critical for performance." msgstr "" +"**キャッシュ**: グローバルなキャッシュは、共有状態が生まれる典型的な場所で" +"す。\n" +"ロックでキャッシュを保護するか、性能上不可欠でなければ、フリースレッドビルド" +"ではキャッシュを無効にすることを検討してください。" -#: ../../howto/free-threading-extensions.rst:249 msgid "" "**Global State**: global state may need to be protected by a lock or moved " "to thread local storage. C11 and C++11 provide the ``thread_local`` or " "``_Thread_local`` for `thread-local storage `_." msgstr "" +"**グローバルな状態**: グローバルな状態には、ロックによる保護やスレッドローカ" +"ルストレージへの移動が必要な場合があります。\n" +"C11 と C++11 は、`スレッドローカルストレージ `_ のために ``thread_local`` または " +"``_Thread_local`` を提供しています。" -#: ../../howto/free-threading-extensions.rst:256 msgid "Critical Sections" -msgstr "" +msgstr "クリティカルセクション" -#: ../../howto/free-threading-extensions.rst:260 msgid "" "In the free-threaded build, CPython provides a mechanism called \"critical " "sections\" to protect data that would otherwise be protected by the GIL. " @@ -432,12 +495,14 @@ msgid "" "implementation directly, understanding their behavior is crucial when using " "certain C API functions or managing shared state in the free-threaded build." msgstr "" +"CPython のフリースレッドビルドには、通常なら GIL が保護するデータを保護する" +"「クリティカルセクション」という仕組みがあります。\n" +"拡張の開発者がその内部実装を直接扱うことはなくても、特定の C API 関数を使うと" +"きや共有状態を管理するときには、動作を理解しておくことが重要です。" -#: ../../howto/free-threading-extensions.rst:267 msgid "What Are Critical Sections?" -msgstr "" +msgstr "クリティカルセクションとは" -#: ../../howto/free-threading-extensions.rst:269 msgid "" "Conceptually, critical sections act as a deadlock avoidance layer built on " "top of simple mutexes. Each thread maintains a stack of active critical " @@ -446,42 +511,55 @@ msgid "" "func:`PyDict_SetItem`, or explicitly using macros), it attempts to acquire " "the underlying mutex." msgstr "" +"概念的には、クリティカルセクションは単純なミューテックスの上に設けられた、" +"デッドロックを回避するための層です。\n" +"各スレッドは、有効なクリティカルセクションのスタックを保持します。\n" +"スレッドがクリティカルセクションのロックを取得する必要があると、その基盤とな" +"るミューテックスの取得を試みます。\n" +"これは、:c:func:`PyDict_SetItem` のようなスレッドセーフな C API 関数の呼び出" +"しで暗黙に行われる場合も、マクロで明示的に行われる場合もあります。" -#: ../../howto/free-threading-extensions.rst:277 msgid "Using Critical Sections" -msgstr "" +msgstr "クリティカルセクションの使い方" -#: ../../howto/free-threading-extensions.rst:279 msgid "The primary APIs for using critical sections are:" -msgstr "" +msgstr "クリティカルセクションを使う主な API は次のとおりです。" -#: ../../howto/free-threading-extensions.rst:281 msgid "" ":c:macro:`Py_BEGIN_CRITICAL_SECTION` and :c:macro:`Py_END_CRITICAL_SECTION` " "- For locking a single object" msgstr "" +":c:macro:`Py_BEGIN_CRITICAL_SECTION` と :c:macro:`Py_END_CRITICAL_SECTION` — " +"1 つのオブジェクトをロックします。" -#: ../../howto/free-threading-extensions.rst:284 msgid "" ":c:macro:`Py_BEGIN_CRITICAL_SECTION2` and :c:macro:" "`Py_END_CRITICAL_SECTION2` - For locking two objects simultaneously" msgstr "" +":c:macro:`Py_BEGIN_CRITICAL_SECTION2` と :c:macro:`Py_END_CRITICAL_SECTION2` " +"— 2 つのオブジェクトを同時にロックします。" -#: ../../howto/free-threading-extensions.rst:287 msgid "" "These macros must be used in matching pairs and must appear in the same C " "scope, since they establish a new local scope. These macros are no-ops in " "non-free-threaded builds, so they can be safely added to code that needs to " "support both build types." msgstr "" +"これらのマクロは新しいローカルスコープを作るため、必ず対応する組で使い、同じ " +"C のスコープに置く必要があります。\n" +"非フリースレッドビルドでは何もしないので、両方のビルドに対応するコードにも安" +"全に追加できます。" -#: ../../howto/free-threading-extensions.rst:292 msgid "" "A common use of a critical section would be to lock an object while " "accessing an internal attribute of it. For example, if an extension type " "has an internal count field, you could use a critical section while reading " "or writing that field::" msgstr "" +"クリティカルセクションのよくある用途は、オブジェクトの内部属性へのアクセス中" +"に、そのオブジェクトをロックすることです。\n" +"例えば、拡張型に内部的なカウントのフィールドがあれば、その読み書きにクリティ" +"カルセクションを使えます。 ::" #: ../../howto/free-threading-extensions.rst:297 msgid "" @@ -498,11 +576,9 @@ msgid "" "Py_END_CRITICAL_SECTION();" msgstr "" -#: ../../howto/free-threading-extensions.rst:311 msgid "How Critical Sections Work" -msgstr "" +msgstr "クリティカルセクションの仕組み" -#: ../../howto/free-threading-extensions.rst:313 msgid "" "Unlike traditional locks, critical sections do not guarantee exclusive " "access throughout their entire duration. If a thread would block while " @@ -510,60 +586,75 @@ msgid "" "O), the critical section is temporarily suspended—all locks are released—and " "then resumed when the blocking operation completes." msgstr "" +"通常のロックとは異なり、クリティカルセクションはその期間全体にわたる排他的ア" +"クセスを保証しません。\n" +"クリティカルセクション内で別のロックの取得や I/O などによってスレッドがブロッ" +"クする場合、クリティカルセクションは一時的に中断され、すべてのロックが解放さ" +"れます。\n" +"ブロッキング操作が完了すると再開されます。" -#: ../../howto/free-threading-extensions.rst:319 msgid "" "This behavior is similar to what happens with the GIL when a thread makes a " "blocking call. The key differences are:" msgstr "" +"これは、スレッドがブロッキング呼び出しを行うときの GIL の動作に似ています。\n" +"主な違いは次のとおりです。" -#: ../../howto/free-threading-extensions.rst:322 msgid "Critical sections operate on a per-object basis rather than globally" msgstr "" +"クリティカルセクションは全体で 1 つではなく、オブジェクト単位で動作します。" -#: ../../howto/free-threading-extensions.rst:324 msgid "" "Critical sections follow a stack discipline within each thread (the " "\"begin\" and \"end\" macros enforce this since they must be paired and " "within the same scope)" msgstr "" +"クリティカルセクションは各スレッド内でスタックの順序に従います。\n" +"開始マクロと終了マクロは同じスコープ内で対にする必要があるため、この順序が強" +"制されます。" -#: ../../howto/free-threading-extensions.rst:327 msgid "" "Critical sections automatically release and reacquire locks around potential " "blocking operations" msgstr "" +"クリティカルセクションは、ブロックする可能性のある操作の前後で、自動的にロッ" +"クを解放して再取得します。" -#: ../../howto/free-threading-extensions.rst:331 msgid "Deadlock Avoidance" -msgstr "" +msgstr "デッドロックの回避" -#: ../../howto/free-threading-extensions.rst:333 msgid "Critical sections help avoid deadlocks in two ways:" msgstr "" +"クリティカルセクションは、次の 2 つの方法でデッドロックの回避を助けます。" -#: ../../howto/free-threading-extensions.rst:335 msgid "" "If a thread tries to acquire a lock that's already held by another thread, " "it first suspends all of its active critical sections, temporarily releasing " "their locks" msgstr "" +"スレッドが別のスレッドに保持されているロックを取得しようとすると、まず自身の" +"有効なクリティカルセクションをすべて中断し、それらのロックを一時的に解放しま" +"す。" -#: ../../howto/free-threading-extensions.rst:339 msgid "" "When the blocking operation completes, only the top-most critical section is " "reacquired first" msgstr "" +"ブロッキング操作が完了すると、最初に最上位のクリティカルセクションだけが再取" +"得されます。" -#: ../../howto/free-threading-extensions.rst:342 msgid "" "This means you cannot rely on nested critical sections to lock multiple " "objects at once, as the inner critical section may suspend the outer ones. " "Instead, use :c:macro:`Py_BEGIN_CRITICAL_SECTION2` to lock two objects " "simultaneously." msgstr "" +"このため、複数のオブジェクトを同時にロックする目的で、クリティカルセクション" +"の入れ子を使うことはできません。\n" +"内側のクリティカルセクションが外側を中断する可能性があるためです。\n" +"2 つのオブジェクトを同時にロックするには、代わりに :c:macro:" +"`Py_BEGIN_CRITICAL_SECTION2` を使ってください。" -#: ../../howto/free-threading-extensions.rst:346 msgid "" "Note that the locks described above are only :c:type:`PyMutex` based locks. " "The critical section implementation does not know about or affect other " @@ -573,19 +664,28 @@ msgid "" "released. If :c:type:`PyMutex` is used without a critical section, it will " "not be released and therefore does not get the same deadlock avoidance." msgstr "" +"ここで説明したロックは、:c:type:`PyMutex` に基づくロックだけです。\n" +"クリティカルセクションの実装は、POSIX ミューテックスなどのほかのロック機構を" +"認識せず、影響も与えません。\n" +"また、どの :c:type:`PyMutex` でブロックしてもクリティカルセクションは中断され" +"ますが、解放されるのはクリティカルセクションの一部であるミューテックスだけで" +"す。\n" +"クリティカルセクションを使わずに取得した :c:type:`PyMutex` は解放されないた" +"め、同じデッドロック回避の効果は得られません。" -#: ../../howto/free-threading-extensions.rst:355 msgid "Important Considerations" -msgstr "" +msgstr "重要な注意点" -#: ../../howto/free-threading-extensions.rst:357 msgid "" "Critical sections may temporarily release their locks, allowing other " "threads to modify the protected data. Be careful about making assumptions " "about the state of the data after operations that might block." msgstr "" +"クリティカルセクションは一時的にロックを解放することがあるため、ほかのスレッ" +"ドが保護対象のデータを変更できます。\n" +"ブロックする可能性のある操作の後で、データの状態を仮定する際には注意してくだ" +"さい。" -#: ../../howto/free-threading-extensions.rst:361 msgid "" "Because locks can be temporarily released (suspended), entering a critical " "section does not guarantee exclusive access to the protected resource " @@ -594,35 +694,49 @@ msgid "" "I/O), all locks held by the thread via critical sections will be released. " "This is similar to how the GIL can be released during blocking calls." msgstr "" +"ロックが一時的に解放 (中断) される可能性があるため、クリティカルセクションに" +"入っても、その期間全体にわたって保護対象のリソースへ排他的にアクセスできると" +"は限りません。\n" +"クリティカルセクション内で、別のロックの取得やブロッキング I/O などを行う関数" +"を呼び、その処理がブロックすると、そのスレッドがクリティカルセクションを通じ" +"て保持するロックはすべて解放されます。\n" +"これは、ブロッキング呼び出し中に GIL が解放されることがあるのと同様です。" -#: ../../howto/free-threading-extensions.rst:368 msgid "" "Only the lock(s) associated with the most recently entered (top-most) " "critical section are guaranteed to be held at any given time. Locks for " "outer, nested critical sections might have been suspended." msgstr "" +"ある時点で保持が保証されるのは、最後に入った最上位のクリティカルセクションの" +"ロックだけです。\n" +"入れ子になった外側のクリティカルセクションのロックは、中断されている可能性が" +"あります。" -#: ../../howto/free-threading-extensions.rst:372 msgid "" "You can lock at most two objects simultaneously with these APIs. If you need " "to lock more objects, you'll need to restructure your code." msgstr "" +"これらの API で同時にロックできるオブジェクトは最大 2 つです。\n" +"それ以上をロックする必要があれば、コードの構成を見直す必要があります。" -#: ../../howto/free-threading-extensions.rst:375 msgid "" "While critical sections will not deadlock if you attempt to lock the same " "object twice, they are less efficient than purpose-built reentrant locks for " "this use case." msgstr "" +"クリティカルセクションで同じオブジェクトを 2 回ロックしようとしてもデッドロッ" +"クにはなりませんが、この用途に特化した再入可能ロックほど効率的ではありませ" +"ん。" -#: ../../howto/free-threading-extensions.rst:379 msgid "" "When using :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, the order of the objects " "doesn't affect correctness (the implementation handles deadlock avoidance), " "but it's good practice to always lock objects in a consistent order." msgstr "" +":c:macro:`Py_BEGIN_CRITICAL_SECTION2` では、実装がデッドロックを回避するた" +"め、オブジェクトの順序は正しさに影響しません。\n" +"ただし、常に一貫した順序でロックするのがよい習慣です。" -#: ../../howto/free-threading-extensions.rst:383 msgid "" "Remember that the critical section macros are primarily for protecting " "access to *Python objects* that might be involved in internal CPython " @@ -630,44 +744,58 @@ msgid "" "protecting purely internal extension state, standard mutexes or other " "synchronization primitives might be more appropriate." msgstr "" +"クリティカルセクションのマクロは主に、上述のようなデッドロックが起こり得る " +"CPython 内部の操作に関与する *Python オブジェクト* へのアクセスを保護するもの" +"です。\n" +"拡張だけが使う内部状態の保護には、標準のミューテックスなどの同期プリミティブ" +"のほうが適している場合があります。" -#: ../../howto/free-threading-extensions.rst:392 msgid "Per-Object Locks (``ob_mutex``)" -msgstr "" +msgstr "オブジェクトごとのロック (``ob_mutex``)" -#: ../../howto/free-threading-extensions.rst:394 msgid "" "In the free-threaded build, each Python object contains a :c:member:" "`~PyObject.ob_mutex` field of type :c:type:`PyMutex`. This mutex is " "**reserved for use by the critical section API** (:c:macro:" "`Py_BEGIN_CRITICAL_SECTION` / :c:macro:`Py_END_CRITICAL_SECTION`)." msgstr "" +"フリースレッドビルドでは、各 Python オブジェクトに :c:type:`PyMutex` 型の :c:" +"member:`~PyObject.ob_mutex` フィールドがあります。\n" +"このミューテックスは **クリティカルセクション API 専用** です (:c:macro:" +"`Py_BEGIN_CRITICAL_SECTION` / :c:macro:`Py_END_CRITICAL_SECTION`)。" -#: ../../howto/free-threading-extensions.rst:401 msgid "" "Do **not** lock ``ob_mutex`` directly with ``PyMutex_Lock(&obj->ob_mutex)``. " "Mixing direct ``PyMutex_Lock`` calls with the critical section API on the " "same mutex can cause deadlocks." msgstr "" +"``PyMutex_Lock(&obj->ob_mutex)`` で ``ob_mutex`` を直接ロック **しないでくだ" +"さい**。\n" +"同じミューテックスに対して、``PyMutex_Lock`` の直接呼び出しとクリティカルセク" +"ション API を混在させると、デッドロックが起こる可能性があります。" -#: ../../howto/free-threading-extensions.rst:405 msgid "" "Even if your own code never uses critical sections on a particular object " "type, **CPython internals may use the critical section API on any Python " "object**." msgstr "" +"自分のコードでは特定の型のオブジェクトにクリティカルセクションを使っていなく" +"ても、**CPython 内部ではどの Python オブジェクトにもクリティカルセクション " +"API を使う可能性があります**。" -#: ../../howto/free-threading-extensions.rst:408 msgid "" "If your extension type needs its own lock, add a separate :c:type:`PyMutex` " "field (or another synchronization primitive) to your object struct. :c:type:" "`PyMutex` is very lightweight, so there is negligible cost to having an " "additional one." msgstr "" +"拡張型に独自のロックが必要な場合は、オブジェクトの構造体に別の :c:type:" +"`PyMutex` フィールド、またはほかの同期プリミティブを追加してください。\n" +":c:type:`PyMutex` は非常に軽量なので、追加で 1 つ持ってもコストはほぼ無視でき" +"ます。" -#: ../../howto/free-threading-extensions.rst:415 msgid "Building Extensions for the Free-Threaded Build" -msgstr "" +msgstr "フリースレッドビルド向けの拡張のビルド" #: ../../howto/free-threading-extensions.rst:417 msgid "" @@ -675,21 +803,22 @@ msgid "" "The wheels, shared libraries, and binaries are indicated by a ``t`` suffix." msgstr "" -#: ../../howto/free-threading-extensions.rst:420 msgid "" "`pypa/manylinux `_ supports the free-" "threaded build, with the ``t`` suffix, such as ``python3.14t``." msgstr "" +"`pypa/manylinux `_ は、``python3.14t`` の" +"ように ``t`` サフィックスを付けたフリースレッドビルドに対応しています。" -#: ../../howto/free-threading-extensions.rst:422 msgid "" "`pypa/cibuildwheel `_ supports " "building wheels for the free-threaded build of Python 3.14 and newer." msgstr "" +"`pypa/cibuildwheel `_ は、Python 3.14 " +"以降のフリースレッドビルド向け wheel の作成に対応しています。" -#: ../../howto/free-threading-extensions.rst:426 msgid "Limited C API and Stable ABI" -msgstr "" +msgstr "Limited C API と Stable ABI" #: ../../howto/free-threading-extensions.rst:428 msgid "" @@ -712,15 +841,18 @@ msgstr "" msgid "Windows" msgstr "Windows" -#: ../../howto/free-threading-extensions.rst:444 msgid "" "Due to a limitation of the official Windows installer, you will need to " "manually define ``Py_GIL_DISABLED=1`` when building extensions from source." msgstr "" +"公式 Windows インストーラの制限により、ソースから拡張をビルドする際は、" +"``Py_GIL_DISABLED=1`` を手動で定義する必要があります。" -#: ../../howto/free-threading-extensions.rst:449 msgid "" "`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " "extension authors." msgstr "" +"`Porting Extension Modules to Support Free-Threading `_: 拡張の開発者向けにコミュニティが保守している" +"移植ガイド。" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index 3d61f4f61..6a855f216 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -22,11 +22,9 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/free-threading-python.rst:5 msgid "Python support for free threading" -msgstr "" +msgstr "Python のフリースレッド対応" -#: ../../howto/free-threading-python.rst:7 msgid "" "Starting with the 3.13 release, CPython has support for a build of Python " "called :term:`free threading` where the :term:`global interpreter lock` " @@ -36,107 +34,131 @@ msgid "" "programs designed with threading in mind will run faster on multi-core " "hardware." msgstr "" +"CPython 3.13 から、:term:`global interpreter lock` (GIL) を無効にした :term:" +"`free threading` という Python のビルドがサポートされています。\n" +"フリースレッド実行では、利用可能な CPU コアでスレッドを並列に動かし、処理能力" +"を十分に活用できます。\n" +"すべてのソフトウェアが自動的に恩恵を受けるわけではありませんが、スレッドの利" +"用を考慮して設計されたプログラムは、マルチコアのハードウェア上でより速く動作" +"します。" -#: ../../howto/free-threading-python.rst:14 msgid "" "Some third-party packages, in particular ones with an :term:`extension " "module`, may not be ready for use in a free-threaded build, and will re-" "enable the :term:`GIL`." msgstr "" +"一部のサードパーティーパッケージ、特に :term:`extension module` を含むもの" +"は、フリースレッドビルドへの対応ができておらず、:term:`GIL` を再び有効にする" +"場合があります。" -#: ../../howto/free-threading-python.rst:18 msgid "" "This document describes the implications of free threading for Python code. " "See :ref:`freethreading-extensions-howto` for information on how to write C " "extensions that support the free-threaded build." msgstr "" +"このドキュメントでは、フリースレッドが Python コードに与える影響を説明しま" +"す。\n" +"フリースレッドビルドに対応した C 拡張の書き方は、:ref:`freethreading-" +"extensions-howto` を参照してください。" -#: ../../howto/free-threading-python.rst:24 msgid "" ":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an " "overall description of free-threaded Python." msgstr "" +"フリースレッドの Python の全体的な説明は、:pep:`703` — Making the Global " +"Interpreter Lock Optional in CPython を参照してください。" msgid "Installation" msgstr "インストール" -#: ../../howto/free-threading-python.rst:31 msgid "" "Starting with Python 3.13, the official macOS and Windows installers " "optionally support installing free-threaded Python binaries. The installers " "are available at https://www.python.org/downloads/." msgstr "" +"Python 3.13 から、macOS と Windows の公式インストーラでは、フリースレッド版 " +"Python のバイナリを追加でインストールできます。\n" +"インストーラは https://www.python.org/downloads/ から入手できます。" -#: ../../howto/free-threading-python.rst:35 msgid "" "For information on other platforms, see the `Installing a Free-Threaded " "Python `_, a " "community-maintained installation guide for installing free-threaded Python." msgstr "" +"ほかのプラットフォームについては、コミュニティが保守しているフリースレッド版 " +"Python のインストールガイド、`Installing a Free-Threaded Python `_ を参照してください。" -#: ../../howto/free-threading-python.rst:39 msgid "" "When building CPython from source, the :option:`--disable-gil` configure " "option should be used to build a free-threaded Python interpreter." msgstr "" +"CPython をソースからビルドする場合、フリースレッドの Python インタープリタを" +"作るには configure の :option:`--disable-gil` オプションを使います。" -#: ../../howto/free-threading-python.rst:44 msgid "Identifying free-threaded Python" -msgstr "" +msgstr "フリースレッド版 Python の識別" -#: ../../howto/free-threading-python.rst:46 msgid "" "To check if the current interpreter supports free-threading, :option:`python " "-VV <-V>` and :data:`sys.version` contain \"free-threading build\". The new :" "func:`sys._is_gil_enabled` function can be used to check whether the GIL is " "actually disabled in the running process." msgstr "" +"実行中のインタープリタがフリースレッドに対応しているかは、:option:`python -" +"VV <-V>` の出力や :data:`sys.version` に \"free-threading build\" が含まれる" +"かで確認できます。\n" +"新しい :func:`sys._is_gil_enabled` 関数では、実行中のプロセスで GIL が実際に" +"無効になっているかを確認できます。" -#: ../../howto/free-threading-python.rst:51 msgid "" "The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration variable " "can be used to determine whether the build supports free threading. If the " "variable is set to ``1``, then the build supports free threading. This is " "the recommended mechanism for decisions related to the build configuration." msgstr "" +"``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` 設定変数でも、ビルドがフ" +"リースレッドに対応しているかを確認できます。\n" +"値が ``1`` なら対応しています。\n" +"ビルド構成に関する判断には、この方法を使うことが推奨されます。" -#: ../../howto/free-threading-python.rst:58 msgid "The global interpreter lock in free-threaded Python" -msgstr "" +msgstr "フリースレッド版 Python のグローバルインタープリタロック" -#: ../../howto/free-threading-python.rst:60 msgid "" "Free-threaded builds of CPython support optionally running with the GIL " "enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or " "the command-line option :option:`-X gil`." msgstr "" +"CPython のフリースレッドビルドでは、:envvar:`PYTHON_GIL` 環境変数または :" +"option:`-X gil` コマンドラインオプションを使い、実行時に GIL を有効にすること" +"もできます。" -#: ../../howto/free-threading-python.rst:64 msgid "" "The GIL may also automatically be enabled when importing a C-API extension " "module that is not explicitly marked as supporting free threading. A " "warning will be printed in this case." msgstr "" +"フリースレッド対応が明示されていない C API 拡張モジュールをインポートすると、" +"GIL が自動的に有効になることもあります。\n" +"この場合は警告が表示されます。" -#: ../../howto/free-threading-python.rst:68 msgid "" "In addition to individual package documentation, the following websites " "track the status of popular packages support for free threading:" msgstr "" +"個々のパッケージのドキュメントに加え、次のウェブサイトでも、よく使われるパッ" +"ケージのフリースレッド対応状況を確認できます。" -#: ../../howto/free-threading-python.rst:71 msgid "https://py-free-threading.github.io/tracking/" -msgstr "" +msgstr "https://py-free-threading.github.io/tracking/" -#: ../../howto/free-threading-python.rst:72 msgid "https://hugovk.github.io/free-threaded-wheels/" -msgstr "" +msgstr "https://hugovk.github.io/free-threaded-wheels/" -#: ../../howto/free-threading-python.rst:76 msgid "Thread safety" -msgstr "" +msgstr "スレッド安全性" -#: ../../howto/free-threading-python.rst:78 msgid "" "The free-threaded build of CPython aims to provide similar thread-safety " "behavior at the Python level to the default GIL-enabled build. Built-in " @@ -145,76 +167,84 @@ msgid "" "the GIL. See :ref:`threadsafety` for the guarantees provided by built-in " "types." msgstr "" +"CPython のフリースレッドビルドは、Python レベルでは、デフォルトの GIL が有効" +"なビルドと同様のスレッド安全性を提供することを目指しています。\n" +":class:`dict`、:class:`list`、:class:`set` などの組み込み型は内部ロックを使" +"い、GIL と似た動作で並行する変更から保護します。\n" +"組み込み型が提供する保証については、:ref:`threadsafety` を参照してください。" -#: ../../howto/free-threading-python.rst:86 msgid "" "It's recommended to use the :class:`threading.Lock` or other synchronization " "primitives instead of relying on the internal locks of built-in types, when " "possible." msgstr "" +"可能であれば、組み込み型の内部ロックに頼る代わりに、:class:`threading.Lock` " +"などの同期プリミティブを使うことが推奨されます。" -#: ../../howto/free-threading-python.rst:92 msgid "Known limitations" -msgstr "" +msgstr "既知の制限" -#: ../../howto/free-threading-python.rst:94 msgid "" "This section describes known limitations of the free-threaded CPython build." -msgstr "" +msgstr "この節では、CPython のフリースレッドビルドの既知の制限を説明します。" -#: ../../howto/free-threading-python.rst:97 msgid "Immortalization" -msgstr "" +msgstr "不死化" -#: ../../howto/free-threading-python.rst:99 msgid "" "In the free-threaded build, some objects are :term:`immortal`. Immortal " "objects are not deallocated and have reference counts that are never " "modified. This is done to avoid reference count contention that would " "prevent efficient multi-threaded scaling." msgstr "" +"フリースレッドビルドでは、一部のオブジェクトが :term:`immortal` になりま" +"す。\n" +"不死のオブジェクトは解放されず、参照カウントも変更されません。\n" +"これは、効率的なマルチスレッドでの性能向上を妨げる、参照カウントの競合を避け" +"るためです。" -#: ../../howto/free-threading-python.rst:104 msgid "As of the 3.14 release, immortalization is limited to:" -msgstr "" +msgstr "3.14 リリース時点では、不死化されるものは次に限られます。" -#: ../../howto/free-threading-python.rst:106 msgid "" "Code constants: numeric literals, string literals, and tuple literals " "composed of other constants." msgstr "" +"コード内の定数: 数値リテラル、文字列リテラル、ほかの定数からなるタプルリテラ" +"ル。" -#: ../../howto/free-threading-python.rst:108 msgid "Strings interned by :func:`sys.intern`." -msgstr "" +msgstr ":func:`sys.intern` でインターンされた文字列。" #: ../../howto/free-threading-python.rst:112 msgid "Frame objects" msgstr "フレーム (frame) オブジェクト" -#: ../../howto/free-threading-python.rst:114 msgid "" "It is not safe to access :attr:`frame.f_locals` from a :ref:`frame ` object if that frame is currently executing in another thread, and " "doing so may crash the interpreter." msgstr "" +"別のスレッドで実行中の :ref:`フレーム ` オブジェクトの :attr:" +"`frame.f_locals` にアクセスするのは安全ではなく、インタープリタがクラッシュす" +"る可能性があります。" #: ../../howto/free-threading-python.rst:120 msgid "Iterators" msgstr "イテレータ (iterator)" -#: ../../howto/free-threading-python.rst:122 msgid "" "It is generally not thread-safe to access the same iterator object from " "multiple threads concurrently, and threads may see duplicate or missing " "elements." msgstr "" +"一般に、同じイテレータオブジェクトに複数のスレッドから並行してアクセスするこ" +"とは、スレッドセーフではありません。\n" +"要素が重複して取得されたり、取得できない要素が出たりする可能性があります。" -#: ../../howto/free-threading-python.rst:128 msgid "Single-threaded performance" -msgstr "" +msgstr "シングルスレッドの性能" -#: ../../howto/free-threading-python.rst:130 msgid "" "The free-threaded build has additional overhead when executing Python code " "compared to the default GIL-enabled build. The amount of overhead depends " @@ -222,22 +252,24 @@ msgid "" "average overhead ranges from about 1% on macOS aarch64 to 8% on x86-64 Linux " "systems." msgstr "" +"フリースレッドビルドは、デフォルトの GIL が有効なビルドに比べ、Python コード" +"の実行に追加のオーバーヘッドがあります。\n" +"その大きさはワークロードとハードウェアに依存します。\n" +"pyperformance ベンチマークスイートでは、平均のオーバーヘッドは macOS aarch64 " +"の約 1% から x86-64 Linux の約 8% までの範囲です。" -#: ../../howto/free-threading-python.rst:138 msgid "Behavioral changes" -msgstr "" +msgstr "動作の違い" -#: ../../howto/free-threading-python.rst:140 msgid "" "This section describes CPython behavioural changes with the free-threaded " "build." msgstr "" +"この節では、フリースレッドビルドによる CPython の動作の違いを説明します。" -#: ../../howto/free-threading-python.rst:145 msgid "Context variables" -msgstr "" +msgstr "コンテキスト変数" -#: ../../howto/free-threading-python.rst:147 msgid "" "In the free-threaded build, the flag :data:`~sys.flags." "thread_inherit_context` is set to true by default which causes threads " @@ -246,12 +278,17 @@ msgid "" "In the default GIL-enabled build, the flag defaults to false so threads " "start with an empty :class:`~contextvars.Context()`." msgstr "" +"フリースレッドビルドでは、:data:`~sys.flags.thread_inherit_context` フラグは" +"デフォルトで真です。\n" +"そのため、:class:`threading.Thread` で作られたスレッドは、:meth:`~threading." +"Thread.start` の呼び出し元の :class:`~contextvars.Context()` のコピーを持って" +"開始します。\n" +"デフォルトの GIL が有効なビルドでは、このフラグはデフォルトで偽なので、スレッ" +"ドは空の :class:`~contextvars.Context()` で開始します。" -#: ../../howto/free-threading-python.rst:157 msgid "Warning filters" -msgstr "" +msgstr "警告フィルタ" -#: ../../howto/free-threading-python.rst:159 msgid "" "In the free-threaded build, the flag :data:`~sys.flags." "context_aware_warnings` is set to true by default. In the default GIL-" @@ -261,23 +298,30 @@ msgid "" "catch_warnings` modifies the global filters list, which is not thread-safe. " "See the :mod:`warnings` module for more details." msgstr "" +"フリースレッドビルドでは、:data:`~sys.flags.context_aware_warnings` フラグは" +"デフォルトで真です。\n" +"デフォルトの GIL が有効なビルドでは、偽になっています。\n" +"真の場合、:class:`warnings.catch_warnings` コンテキストマネージャは、警告フィ" +"ルタにコンテキスト変数を使います。\n" +"偽の場合、:class:`~warnings.catch_warnings` はグローバルなフィルタのリストを" +"変更するため、スレッドセーフではありません。\n" +"詳しくは :mod:`warnings` モジュールを参照してください。" -#: ../../howto/free-threading-python.rst:168 msgid "Increased memory usage" -msgstr "" +msgstr "メモリ使用量の増加" -#: ../../howto/free-threading-python.rst:170 msgid "" "The free-threaded build will typically use more memory compared to the " "default build. There are multiple reasons for this, mostly due to design " "decisions." msgstr "" +"フリースレッドビルドは、通常、デフォルトのビルドより多くのメモリを使いま" +"す。\n" +"理由はいくつかあり、その多くは設計上の判断によるものです。" -#: ../../howto/free-threading-python.rst:175 msgid "All interned strings are immortal" -msgstr "" +msgstr "インターンされた文字列はすべて不死になる" -#: ../../howto/free-threading-python.rst:177 msgid "" "For modern Python versions (since version 2.3), interning a string (e.g. " "with :func:`sys.intern`) does not cause it to become immortal. Instead, if " @@ -286,12 +330,16 @@ msgid "" "any interned string will become immortal, surviving until interpreter " "shutdown." msgstr "" +"Python 2.3 以降では、:func:`sys.intern` などで文字列をインターンしても、不死" +"にはなりません。\n" +"その文字列への最後の参照がなくなると、インターン済み文字列のテーブルから削除" +"されます。\n" +"フリースレッドビルドではこれとは異なり、インターンされた文字列はすべて不死に" +"なり、インタープリタの終了まで生存します。" -#: ../../howto/free-threading-python.rst:185 msgid "Non-GC objects have a larger object header" -msgstr "" +msgstr "GC の対象でないオブジェクトのヘッダが大きくなる" -#: ../../howto/free-threading-python.rst:187 msgid "" "The free-threaded build uses a different :c:type:`PyObject` structure. " "Instead of having the GC related information allocated before the :c:type:" @@ -301,12 +349,17 @@ msgid "" "GC objects (such as dicts and lists) are the same size for both builds since " "the free-threaded build does not use additional space for the GC info." msgstr "" +"フリースレッドビルドは、異なる :c:type:`PyObject` 構造体を使います。\n" +"デフォルトのビルドのように GC 関連の情報を :c:type:`PyObject` 構造体の前に配" +"置するのではなく、通常のオブジェクトヘッダの一部にしています。\n" +"例えば AMD64 プラットフォームでは、``None`` はフリースレッドビルドで 32 バイ" +"ト、デフォルトのビルドでは 16 バイトを使います。\n" +"辞書やリストなど、GC 対象のオブジェクトのサイズは両ビルドで同じです。\n" +"フリースレッドビルドでは、GC 情報のために別の領域を使わないためです。" -#: ../../howto/free-threading-python.rst:197 msgid "QSBR can delay freeing of memory" -msgstr "" +msgstr "QSBR によってメモリの解放が遅れることがある" -#: ../../howto/free-threading-python.rst:199 msgid "" "In order to safely implement lock-free data structures, a safe memory " "reclamation (SMR) scheme is used, known as quiescent state-based reclamation " @@ -320,12 +373,21 @@ msgid "" "the underlying memory allocator may not immediately return that memory to " "the OS and so the resident set size (RSS) of the process might not decrease." msgstr "" +"ロックを使わないデータ構造を安全に実装するため、quiescent state-based " +"reclamation (QSBR) という安全なメモリ回収 (SMR) の方式を使います。\n" +"ロックなしのアクセスを許すデータ構造の領域には QSBR が使われ、メモリはすぐに" +"は解放されず、解放が遅延されます。\n" +"例として、リストオブジェクトや辞書のキーオブジェクトがあります。\n" +"QSBR の実装の詳細は、CPython ソースツリーの ``InternalDocs/qsbr.md`` を参照し" +"てください。\n" +":func:`gc.collect` を実行すると、QSBR によって保持されているメモリはすべて解" +"放されるはずです。\n" +"ただし、QSBR がメモリを解放しても、下位のメモリアロケータがすぐに OS へ返すと" +"は限らず、プロセスの常駐メモリ量 (RSS) が減らない場合があります。" -#: ../../howto/free-threading-python.rst:213 msgid "mimalloc allocator vs pymalloc" -msgstr "" +msgstr "mimalloc と pymalloc の比較" -#: ../../howto/free-threading-python.rst:215 msgid "" "The default build will normally use the \"pymalloc\" memory allocator for " "small allocations (512 bytes or smaller). The free-threaded build does not " @@ -336,8 +398,16 @@ msgid "" "system. The mimalloc allocator does quite well in these respects as well " "but can have some more overhead." msgstr "" +"デフォルトのビルドは通常、512 バイト以下の小さな割り当てに pymalloc メモリア" +"ロケータを使います。\n" +"フリースレッドビルドは pymalloc を使わず、すべての Python オブジェクトを " +"mimalloc で割り当てます。\n" +"pymalloc には、割り当てブロックごとのオーバーヘッドが小さい、メモリの断片化を" +"効果的に防ぐ、未使用メモリを速やかに OS へ返すといった、メモリ使用量を抑える" +"特性があります。\n" +"mimalloc もこれらの点で優れていますが、オーバーヘッドがやや大きい場合がありま" +"す。" -#: ../../howto/free-threading-python.rst:224 msgid "" "In the free-threaded build, mimalloc manages memory in a number of separate " "heaps (currently four). For example, all GC supporting objects are " @@ -349,20 +419,30 @@ msgid "" "blocks for a page being freed and the memory page being released, either for " "new allocations or back to the OS." msgstr "" +"フリースレッドビルドでは、mimalloc は複数の独立したヒープ (現在は 4 つ) でメ" +"モリを管理します。\n" +"例えば、GC に対応するオブジェクトはすべて専用のヒープから割り当てられます。\n" +"ヒープを分けると、あるヒープの空きメモリを別のヒープからの割り当てに使うこと" +"はできません。\n" +"また、一部のヒープでは、ヒープの基盤となるメモリ領域 (mimalloc の用語で「ペー" +"ジ」) の解放に QSBR (quiescent-state based reclamation) を使います。\n" +"そのため、ページ内の全メモリブロックが解放されてから、そのページが新しい割り" +"当てに使えるようになるか OS へ返されるまでに、遅延が生じます。" -#: ../../howto/free-threading-python.rst:234 msgid "" "The mimalloc allocator also defers returning freed memory back to the OS. " "You can reduce that delay by setting the environment variable :envvar:`!" "MIMALLOC_PURGE_DELAY` to ``0``. Note that this will likely reduce the " "performance of the allocator." msgstr "" +"mimalloc も、解放されたメモリを OS に返すまでに遅延を設けています。\n" +":envvar:`!MIMALLOC_PURGE_DELAY` 環境変数を ``0`` に設定すると、この遅延を短く" +"できます。\n" +"ただし、アロケータの性能が低下する可能性が高いことに注意してください。" -#: ../../howto/free-threading-python.rst:241 msgid "Free-threaded reference counting can cause objects to live longer" -msgstr "" +msgstr "フリースレッドの参照カウントではオブジェクトの寿命が延びることがある" -#: ../../howto/free-threading-python.rst:243 msgid "" "In the default build, when an object's reference count reaches zero, it is " "normally deallocated. The free-threaded build uses \"biased reference " @@ -372,36 +452,40 @@ msgid "" "can be deferred. The queued state is cleared from the \"eval breaker\" " "section of the bytecode evaluator." msgstr "" +"デフォルトのビルドでは、通常、参照カウントがゼロになるとオブジェクトが解放さ" +"れます。\n" +"フリースレッドビルドは「バイアス参照カウント」を使い、現在のスレッドが「所有" +"する」オブジェクトには高速な処理経路、それ以外には低速な経路を使います。\n" +"詳しくは :pep:`703` を参照してください。\n" +"参照カウントが queued (キュー待ち) 状態になると、解放が遅延することがありま" +"す。\n" +"キュー待ち状態は、バイトコード評価器の eval breaker 部分で解除されます。" -#: ../../howto/free-threading-python.rst:251 msgid "" "The free-threaded build also allows a different mode of reference counting, " "known as \"deferred reference counting\". This mode is enabled by setting a " "flag on a per-object basis. Deferred reference counting is enabled for the " "following types:" msgstr "" +"フリースレッドビルドでは、「遅延参照カウント」という別の方式も使えます。\n" +"これはオブジェクトごとにフラグを設定して有効にします。\n" +"次の型で遅延参照カウントが有効になっています。" -#: ../../howto/free-threading-python.rst:256 msgid "module objects" -msgstr "" +msgstr "モジュールオブジェクト" -#: ../../howto/free-threading-python.rst:257 msgid "module top-level functions" -msgstr "" +msgstr "モジュールのトップレベルの関数" -#: ../../howto/free-threading-python.rst:258 msgid "class methods defined in the class scope" -msgstr "" +msgstr "クラススコープで定義されたメソッド" -#: ../../howto/free-threading-python.rst:259 msgid "descriptor objects" -msgstr "" +msgstr "デスクリプタオブジェクト" -#: ../../howto/free-threading-python.rst:260 msgid "thread-local objects, created by :class:`threading.local`" -msgstr "" +msgstr ":class:`threading.local` で作られたスレッドローカルオブジェクト" -#: ../../howto/free-threading-python.rst:262 msgid "" "When deferred reference counting is enabled, references from Python function " "stacks are not added to the reference count. This scheme reduces the " @@ -413,12 +497,19 @@ msgid "" "objects are freed by the GC and not when their reference count goes to zero, " "as is typical." msgstr "" +"遅延参照カウントを有効にすると、Python 関数のスタックからの参照は参照カウント" +"に加算されません。\n" +"この方式は、特に複数のスレッドから使われるオブジェクトについて、参照カウント" +"のオーバーヘッドを減らします。\n" +"スタックからの参照を数えないため、内部の参照カウントがゼロになっても、オブ" +"ジェクトはすぐには解放されません。\n" +"代わりに、次回の GC で調べられ、スタックからの参照がなければ解放されます。\n" +"つまり、通常のように参照カウントがゼロになった時点ではなく、GC によって解放さ" +"れます。" -#: ../../howto/free-threading-python.rst:273 msgid "Per-thread reference counting can delay freeing objects" -msgstr "" +msgstr "スレッドごとの参照カウントによってオブジェクトの解放が遅れることがある" -#: ../../howto/free-threading-python.rst:275 msgid "" "To avoid contention on the reference count fields of frequently shared " "objects, the free-threaded build also uses \"per-thread reference counting\" " @@ -428,20 +519,25 @@ msgid "" "only computed by summing the per-thread counts when the object's local count " "drops to zero. Per-thread reference counting is currently used for:" msgstr "" +"頻繁に共有されるオブジェクトの参照カウントフィールドでの競合を避けるため、フ" +"リースレッドビルドは、選ばれた少数の型に「スレッドごとの参照カウント」も使い" +"ます。\n" +"単一の共有参照カウントを更新する代わりに、各スレッドがローカルな参照カウント" +"の配列を持ち、オブジェクトに割り当てられた一意の ID をインデックスとして使い" +"ます。\n" +"実際の参照カウントを計算するのは、オブジェクトのローカルカウントがゼロになっ" +"たときだけで、その際に各スレッドのカウントを合計します。\n" +"現在、この方式を使うのは次のものです。" -#: ../../howto/free-threading-python.rst:283 msgid "heap type objects (classes created in Python)" -msgstr "" +msgstr "ヒープ型オブジェクト (Python で作成したクラス)" -#: ../../howto/free-threading-python.rst:284 msgid "code objects" -msgstr "" +msgstr "コードオブジェクト" -#: ../../howto/free-threading-python.rst:285 msgid "the ``__dict__`` of module objects" -msgstr "" +msgstr "モジュールオブジェクトの ``__dict__``" -#: ../../howto/free-threading-python.rst:287 msgid "" "Because the per-thread counts must be merged back to the object before it " "can be deallocated, objects using per-thread reference counting are " @@ -451,3 +547,11 @@ msgid "" "section of the bytecode evaluator) or exits. Running :func:`gc.collect` " "will merge the per-thread counts and allow these objects to be freed." msgstr "" +"スレッドごとのカウントをオブジェクトに集約してからでなければ解放できないた" +"め、この方式を使うオブジェクトは、通常、デフォルトのビルドより遅く解放されま" +"す。\n" +"特に、そのオブジェクトを参照したスレッドが、バイトコード評価器の eval " +"breaker などの安全な地点に到達するか、終了するまでは、通常は解放されませ" +"ん。\n" +":func:`gc.collect` を実行すると、スレッドごとのカウントが集約され、これらのオ" +"ブジェクトを解放できるようになります。" diff --git a/howto/functional.po b/howto/functional.po index 2efc40d6c..245e288ae 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -256,7 +256,6 @@ msgstr "" "そうだ」と言うのとも別の話です; 目指すのは、出現しうる入力すべてに対してプロ" "グラムが正しい結果を出すことの厳密な証明なのです。" -#: ../../howto/functional.rst:110 msgid "" "The technique used to prove programs correct is to write down " "**invariants**, properties of the input data and of the program's variables " @@ -266,12 +265,12 @@ msgid "" "This continues until you reach the end of the program, at which point the " "invariants should match the desired conditions on the program's output." msgstr "" -"プログラムを証明するために使われているのは **不変式** を書き出していくという" -"テクニックで、不変式とは入力データやプログラム変数のうち常に真である性質のこ" -"とです。コードの一行一行で、 **実行前** の不変式 X と Y が真なら **実行後に" -"** ちょっと違う不変式 X' と Y' が真になることを示していき、これをプログラムの" -"終わりまで続けるわけです。すると最終的な不変式はプログラムの出力に合った条件" -"になっているはずです。" +"プログラムの正しさを証明する手法では、入力データやプログラム変数について常に" +"真である性質、つまり **不変条件** を書き出します。\n" +"コードの各行について、**実行前** に不変条件 X と Y が成り立つなら、**実行後" +"** には少し異なる不変条件 X' と Y' が成り立つことを示します。\n" +"これをプログラムの終わりまで続け、最後の不変条件が、出力に求める条件と一致す" +"ることを確認します。" #: ../../howto/functional.rst:118 msgid "" @@ -446,7 +445,6 @@ msgstr "" "るいは :func:`iter` でイテレータを作れるオブジェクトである必要があります。次" "の二つは同じ意味になります::" -#: ../../howto/functional.rst:221 msgid "" "for i in iter(obj):\n" " print(i)\n" @@ -454,6 +452,11 @@ msgid "" "for i in obj:\n" " print(i)" msgstr "" +"for i in iter(obj):\n" +" print(i)\n" +"\n" +"for i in obj:\n" +" print(i)" #: ../../howto/functional.rst:227 msgid "" @@ -528,7 +531,6 @@ msgstr "" "辞書に対して :func:`iter` すると、辞書のキーでループを回すイテレータが返され" "ます::" -#: ../../howto/functional.rst:272 msgid "" ">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" "... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}\n" @@ -547,6 +549,22 @@ msgid "" "Nov 11\n" "Dec 12" msgstr "" +">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" +"... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}\n" +">>> for key in m:\n" +"... print(key, m[key])\n" +"Jan 1\n" +"Feb 2\n" +"Mar 3\n" +"Apr 4\n" +"May 5\n" +"Jun 6\n" +"Jul 7\n" +"Aug 8\n" +"Sep 9\n" +"Oct 10\n" +"Nov 11\n" +"Dec 12" #: ../../howto/functional.rst:289 msgid "" @@ -589,12 +607,14 @@ msgstr "" "ことでイテレータ化に対応しています。つまりこうやってファイルの各行を読んでい" "くことができるわけです::" -#: ../../howto/functional.rst:310 msgid "" "for line in file:\n" " # do something for each line\n" " ..." msgstr "" +"for line in file:\n" +" # 各行について処理する\n" +" ..." #: ../../howto/functional.rst:314 msgid "" @@ -604,7 +624,6 @@ msgstr "" "セットはイテラブルを受け取れますし、そのセットの要素でイテレートすることもで" "きます::" -#: ../../howto/functional.rst:317 msgid "" ">>> S = {2, 3, 5, 7, 11, 13}\n" ">>> for i in S:\n" @@ -616,12 +635,20 @@ msgid "" "11\n" "13" msgstr "" +">>> S = {2, 3, 5, 7, 11, 13}\n" +">>> for i in S:\n" +"... print(i)\n" +"2\n" +"3\n" +"5\n" +"7\n" +"11\n" +"13" #: ../../howto/functional.rst:330 msgid "Generator expressions and list comprehensions" msgstr "ジェネレータ式とリスト内包表記" -#: ../../howto/functional.rst:332 msgid "" "Two common operations on an iterator's output are 1) performing some " "operation for every element, 2) selecting a subset of elements that meet " @@ -629,10 +656,10 @@ msgid "" "strip off trailing whitespace from each line or extract all the strings " "containing a given substring." msgstr "" -"イテレータの出力に対してよく使う操作トップ 2 は、(1) ひとつずつ全要素に操作を" -"実行する、および (2) 条件に合う要素でサブセットを作る、です。たとえば文字列の" -"リストなら、各行のうしろに付いた邪魔なホワイトスペースを削りたいとか、特定の" -"文字列を含む部分をピックアップしたいなどと思うかもしれません。" +"イテレータの出力に対するよくある操作は、1) 各要素に何らかの処理を行うこと、" +"2) 条件に合う要素だけを選ぶことです。\n" +"例えば、文字列のリストがあれば、各行の末尾の空白を取り除いたり、指定した部分" +"文字列を含む文字列をすべて取り出したりする場合があります。" #: ../../howto/functional.rst:338 msgid "" @@ -646,7 +673,6 @@ msgstr "" "(https://www.haskell.org/) にインスパイアされました。文字列のストリームからホ" "ワイトスペースをすべて削るのは次のコードでできます::" -#: ../../howto/functional.rst:343 msgid "" ">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" "\n" @@ -656,17 +682,25 @@ msgid "" ">>> # List comprehension -- returns list\n" ">>> stripped_list = [line.strip() for line in line_list]" msgstr "" +">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" +"\n" +">>> # ジェネレータ式 -- イテレータを返す\n" +">>> stripped_iter = (line.strip() for line in line_list)\n" +"\n" +">>> # リスト内包表記 -- リストを返す\n" +">>> stripped_list = [line.strip() for line in line_list]" #: ../../howto/functional.rst:351 msgid "" "You can select only certain elements by adding an ``\"if\"`` condition::" msgstr "特定の要素だけを選び出すのは ``\"if\"`` 条件式を付けることで可能です::" -#: ../../howto/functional.rst:353 msgid "" ">>> stripped_list = [line.strip() for line in line_list\n" "... if line != \"\"]" msgstr "" +">>> stripped_list = [line.strip() for line in line_list\n" +"... if line != \"\"]" #: ../../howto/functional.rst:356 msgid "" @@ -694,7 +728,6 @@ msgstr "" "ジェネレータ式は丸括弧 \"()\" で囲まれ、リスト内包表記は角括弧 \"[]\" で囲ま" "れます。ジェネレータ式の形式は次のとおりです::" -#: ../../howto/functional.rst:367 msgid "" "( expression for expr in sequence1\n" " if condition1\n" @@ -706,6 +739,15 @@ msgid "" " for exprN in sequenceN\n" " if conditionN )" msgstr "" +"( expression for expr in sequence1\n" +" if condition1\n" +" for expr2 in sequence2\n" +" if condition2\n" +" for expr3 in sequence3\n" +" if condition3\n" +" ...\n" +" for exprN in sequenceN\n" +" if conditionN )" #: ../../howto/functional.rst:377 msgid "" @@ -736,9 +778,8 @@ msgstr "" "なっている括弧でも大丈夫です。関数にすぐ渡すイテレータを作りたければこう書け" "るのです::" -#: ../../howto/functional.rst:388 msgid "obj_total = sum(obj.count for obj in list_all_objects())" -msgstr "" +msgstr "obj_total = sum(obj.count for obj in list_all_objects())" #: ../../howto/functional.rst:390 msgid "" @@ -764,7 +805,6 @@ msgstr "" "別の書き方をすると、リスト内包表記やジェネレータ式は次の Python コードと同じ" "意味になります::" -#: ../../howto/functional.rst:399 msgid "" "for expr1 in sequence1:\n" " if not (condition1):\n" @@ -780,6 +820,19 @@ msgid "" " # Output the value of\n" " # the expression." msgstr "" +"for expr1 in sequence1:\n" +" if not (condition1):\n" +" continue # この要素を読み飛ばす\n" +" for expr2 in sequence2:\n" +" if not (condition2):\n" +" continue # この要素を読み飛ばす\n" +" ...\n" +" for exprN in sequenceN:\n" +" if not (conditionN):\n" +" continue # この要素を読み飛ばす\n" +"\n" +" # 式の値を\n" +" # 出力する。" #: ../../howto/functional.rst:413 msgid "" @@ -802,13 +855,16 @@ msgstr "" "ら括弧で囲わなくてはなりません。下にあるリスト内包表記で、最初のは構文エラー" "ですが、二番目は有効です::" -#: ../../howto/functional.rst:429 msgid "" "# Syntax error\n" "[x, y for x in seq1 for y in seq2]\n" "# Correct\n" "[(x, y) for x in seq1 for y in seq2]" msgstr "" +"# 構文エラー\n" +"[x, y for x in seq1 for y in seq2]\n" +"# 正しい書き方\n" +"[(x, y) for x in seq1 for y in seq2]" #: ../../howto/functional.rst:436 msgid "Generators" @@ -859,7 +915,6 @@ msgstr "" "の :term:`bytecode` コンパイラがこれを検出して、特別な方法でコンパイルしてく" "れるのです。" -#: ../../howto/functional.rst:461 msgid "" "When you call a generator function, it doesn't return a single value; " "instead it returns a generator object that supports the iterator protocol. " @@ -870,12 +925,14 @@ msgid "" "preserved. On the next call to the generator's :meth:`~generator.__next__` " "method, the function will resume executing." msgstr "" -"ジェネレータ関数は、呼ばれたときに一回だけ値を返すのではなく、イテレータ プロ" -"トコルに対応したオブジェクトを返します。上の例で ``yield`` を実行したとき、 " -"ジェネレータは ``return`` 文のようにして ``i`` の値を出力します。 ``yield`` " -"と ``return`` 文の大きな違いは、 ``yield`` に到達した段階でジェネレータの実行" -"状態が一時停止になって、ローカル変数が保存される点です。 次回そのジェネレータ" -"の :meth:`~generator.__next__` を呼ぶと、そこから関数が実行を再開します。" +"ジェネレータ関数を呼ぶと、計算結果の値ではなく、イテレータプロトコルに対応す" +"るジェネレータオブジェクトが返されます。\n" +"ジェネレータが ``yield`` 式を実行すると、``return`` 文と同じように ``i`` の値" +"を出力します。\n" +"大きな違いは、``yield`` に到達すると実行が中断され、ローカル変数が保持される" +"点です。\n" +"次にジェネレータの :meth:`~generator.__next__` メソッドを呼ぶと、関数の実行が" +"再開されます。" #: ../../howto/functional.rst:470 msgid "Here's a sample usage of the ``generate_ints()`` generator:" @@ -982,9 +1039,8 @@ msgstr "" "Python 2.5 で、ジェネレータに値を渡す簡単な手段ができました。 :keyword:" "`yield` が、変数に代入したり演算したりできる値を返す式になったのです::" -#: ../../howto/functional.rst:540 msgid "val = (yield i)" -msgstr "" +msgstr "val = (yield i)" #: ../../howto/functional.rst:542 msgid "" @@ -1030,7 +1086,6 @@ msgstr "" "下にあるのは 1 ずつ増える単純なカウンタですが、内部カウンタの値を変更すること" "ができるようになっています。" -#: ../../howto/functional.rst:561 msgid "" "def counter(maximum):\n" " i = 0\n" @@ -1042,6 +1097,15 @@ msgid "" " else:\n" " i += 1" msgstr "" +"def counter(maximum):\n" +" i = 0\n" +" while i < maximum:\n" +" val = (yield i)\n" +" # 値が渡されたら、カウンタを変更する\n" +" if val is not None:\n" +" i = val\n" +" else:\n" +" i += 1" #: ../../howto/functional.rst:573 msgid "And here's an example of changing the counter:" @@ -1087,15 +1151,14 @@ msgid "" "collected." msgstr "" -#: ../../howto/functional.rst:610 msgid "" "If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I " "suggest using a ``try: ... finally:`` suite instead of catching :exc:" "`GeneratorExit`." msgstr "" -":exc:`GeneratorExit` が起こったときにクリーンアップ作業をする必要があるな" -"ら、 :exc:`GeneratorExit` を捕捉するのではなく ``try: ... finaly:`` するよう" -"お勧めします。" +":exc:`GeneratorExit` が発生したときに後片付けを行う必要がある場合は、:exc:" +"`GeneratorExit` を捕捉するのではなく、``try: ... finally:`` を使うことを勧め" +"ます。" #: ../../howto/functional.rst:613 msgid "" @@ -1181,7 +1244,6 @@ msgstr "" "振っていき、(*start* から数え始めたときの) 番号とそれぞれの要素を含む 2 タプ" "ルを返します。" -#: ../../howto/functional.rst:666 msgid "" ">>> for item in enumerate(['subject', 'verb', 'object']):\n" "... print(item)\n" @@ -1189,22 +1251,29 @@ msgid "" "(1, 'verb')\n" "(2, 'object')" msgstr "" +">>> for item in enumerate(['subject', 'verb', 'object']):\n" +"... print(item)\n" +"(0, 'subject')\n" +"(1, 'verb')\n" +"(2, 'object')" -#: ../../howto/functional.rst:672 msgid "" ":func:`enumerate` is often used when looping through a list and recording " "the indexes at which certain conditions are met::" msgstr "" -":func:`enumerate` はよく、リストに対してループさせて、条件に合う所に印を付け" -"ていくときに使われます::" +":func:`enumerate` は、リストをループで処理し、条件を満たす位置のインデックス" +"を記録するときによく使われます。 ::" -#: ../../howto/functional.rst:675 msgid "" "f = open('data.txt', 'r')\n" "for i, line in enumerate(f):\n" " if line.strip() == '':\n" " print('Blank line at line #%i' % i)" msgstr "" +"f = open('data.txt', 'r')\n" +"for i, line in enumerate(f):\n" +" if line.strip() == '':\n" +" print('Blank line at line #%i' % i)" #: ../../howto/functional.rst:680 msgid "" @@ -1217,7 +1286,6 @@ msgstr "" "をすべて集めたリストを作り、ソートして返します。 引数 *key* および *reverse* " "は、リストの :meth:`~list.sort` メソッドにそのまま渡されます。 ::" -#: ../../howto/functional.rst:685 msgid "" ">>> import random\n" ">>> # Generate 8 random numbers between [0, 10000)\n" @@ -1229,6 +1297,15 @@ msgid "" ">>> sorted(rand_list, reverse=True)\n" "[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" msgstr "" +">>> import random\n" +">>> # 0 以上 10000 未満の乱数を 8 個生成する\n" +">>> rand_list = random.sample(range(10000), 8)\n" +">>> rand_list\n" +"[769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]\n" +">>> sorted(rand_list)\n" +"[769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]\n" +">>> sorted(rand_list, reverse=True)\n" +"[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" #: ../../howto/functional.rst:695 msgid "" @@ -1254,19 +1331,24 @@ msgstr "" ":func:`zip(iterA, iterB, ...) ` はそれぞれの iterable から1つの要素を取" "り、それらをタプルに入れて返します::" -#: ../../howto/functional.rst:720 msgid "" "zip(['a', 'b', 'c'], (1, 2, 3)) =>\n" " ('a', 1), ('b', 2), ('c', 3)" msgstr "" +"zip(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2), ('c', 3)" -#: ../../howto/functional.rst:723 msgid "" "It doesn't construct an in-memory list and :term:`exhaust ` all " "the input iterators before returning; instead tuples are constructed and " "returned only if they're requested. (The technical term for this behaviour " "is `lazy evaluation `__.)" msgstr "" +"メモリ上にリストを作り、すべての入力イテレータを :term:`使い切って " +"` から戻るのではありません。\n" +"タプルは要求されたときにだけ作られて返されます。\n" +"この動作は専門用語で `遅延評価 `__ と呼ばれます。" #: ../../howto/functional.rst:729 msgid "" @@ -1278,11 +1360,12 @@ msgstr "" "違っていれば、出力されるストリームは一番短いイテラブルと同じ長さになりま" "す。 ::" -#: ../../howto/functional.rst:733 msgid "" "zip(['a', 'b'], (1, 2, 3)) =>\n" " ('a', 1), ('b', 2)" msgstr "" +"zip(['a', 'b'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2)" #: ../../howto/functional.rst:736 msgid "" @@ -1345,7 +1428,6 @@ msgstr "" "オプションで開始する数 (デフォルトは 0) や数どうしの間隔 (デフォルトは 1) を" "与えられます::" -#: ../../howto/functional.rst:762 msgid "" "itertools.count() =>\n" " 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" @@ -1354,6 +1436,12 @@ msgid "" "itertools.count(10, 5) =>\n" " 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, ..." msgstr "" +"itertools.count() =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"itertools.count(10) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"itertools.count(10, 5) =>\n" +" 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, ..." #: ../../howto/functional.rst:769 msgid "" @@ -1366,11 +1454,12 @@ msgstr "" "をコピーして、 その要素を最初から最後まで無限に繰り返していくイテレータを返し" "ます。 ::" -#: ../../howto/functional.rst:773 msgid "" "itertools.cycle([1, 2, 3, 4, 5]) =>\n" " 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ..." msgstr "" +"itertools.cycle([1, 2, 3, 4, 5]) =>\n" +" 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ..." #: ../../howto/functional.rst:776 msgid "" @@ -1381,27 +1470,34 @@ msgstr "" ":func:`itertools.repeat(elem, [n]) ` は、与えられた要素を " "*n* 回返しますが、 *n* がなければ永遠に返し続けます。 ::" -#: ../../howto/functional.rst:779 msgid "" "itertools.repeat('abc') =>\n" " abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...\n" "itertools.repeat('abc', 5) =>\n" " abc, abc, abc, abc, abc" msgstr "" +"itertools.repeat('abc') =>\n" +" abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...\n" +"itertools.repeat('abc', 5) =>\n" +" abc, abc, abc, abc, abc" -#: ../../howto/functional.rst:784 msgid "" ":func:`itertools.chain(iterA, iterB, ...) ` takes an " "arbitrary number of iterables as input, and returns all the elements of the " "first iterator, then all the elements of the second, and so on, until all of " "the iterables have been :term:`exhausted`. ::" msgstr "" +":func:`itertools.chain(iterA, iterB, ...) ` は任意の数のイテ" +"ラブルを受け取ります。\n" +"最初のイテレータの全要素、次に 2 番目のイテレータの全要素という順で、すべての" +"イテラブルが :term:`exhausted` になるまで返します。 ::" -#: ../../howto/functional.rst:789 msgid "" "itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>\n" " a, b, c, 1, 2, 3" msgstr "" +"itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" a, b, c, 1, 2, 3" #: ../../howto/functional.rst:792 msgid "" @@ -1420,7 +1516,6 @@ msgstr "" "トのスライスとは違って、マイナスの値は *start*, *stop*, *step* に使えませ" "ん。 ::" -#: ../../howto/functional.rst:799 msgid "" "itertools.islice(range(10), 8) =>\n" " 0, 1, 2, 3, 4, 5, 6, 7\n" @@ -1429,6 +1524,12 @@ msgid "" "itertools.islice(range(10), 2, 8, 2) =>\n" " 2, 4, 6" msgstr "" +"itertools.islice(range(10), 8) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8) =>\n" +" 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8, 2) =>\n" +" 2, 4, 6" #: ../../howto/functional.rst:806 msgid "" @@ -1446,7 +1547,6 @@ msgstr "" "たうちの一つが他よりも進んでいってしまうと、大量のメモリを消費することがあり" "ます。 ::" -#: ../../howto/functional.rst:814 msgid "" "itertools.tee( itertools.count() ) =>\n" " iterA, iterB\n" @@ -1457,6 +1557,14 @@ msgid "" "and iterB ->\n" " 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..." msgstr "" +"itertools.tee( itertools.count() ) =>\n" +" iterA, iterB\n" +"\n" +"ここで iterA ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"\n" +"また iterB ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..." #: ../../howto/functional.rst:825 msgid "Calling functions on elements" @@ -1486,7 +1594,6 @@ msgstr "" "プルのストリームを返すとみなして、 そのタプルを引数に使って *func* を呼びま" "す::" -#: ../../howto/functional.rst:837 msgid "" "itertools.starmap(os.path.join,\n" " [('/bin', 'python'), ('/usr', 'bin', 'java'),\n" @@ -1494,6 +1601,11 @@ msgid "" "=>\n" " /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby" msgstr "" +"itertools.starmap(os.path.join,\n" +" [('/bin', 'python'), ('/usr', 'bin', 'java'),\n" +" ('/usr', 'bin', 'perl'), ('/usr', 'bin', 'ruby')])\n" +"=>\n" +" /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby" #: ../../howto/functional.rst:845 msgid "Selecting elements" @@ -1516,11 +1628,12 @@ msgstr "" ":func:`itertools.filterfalse(predicate, iter) ` は :" "func:`filter` とは反対に、 述語が偽を返す要素をすべて返します::" -#: ../../howto/functional.rst:854 msgid "" "itertools.filterfalse(is_even, itertools.count()) =>\n" " 1, 3, 5, 7, 9, 11, 13, 15, ..." msgstr "" +"itertools.filterfalse(is_even, itertools.count()) =>\n" +" 1, 3, 5, 7, 9, 11, 13, 15, ..." #: ../../howto/functional.rst:857 msgid "" @@ -1532,7 +1645,6 @@ msgstr "" "を返している間だけ要素を返します。一度でも述語が偽を返すと、イテレータは出力" "終了の合図をします。 ::" -#: ../../howto/functional.rst:861 msgid "" "def less_than_10(x):\n" " return x < 10\n" @@ -1543,6 +1655,14 @@ msgid "" "itertools.takewhile(is_even, itertools.count()) =>\n" " 0" msgstr "" +"def less_than_10(x):\n" +" return x < 10\n" +"\n" +"itertools.takewhile(less_than_10, itertools.count()) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n" +"\n" +"itertools.takewhile(is_even, itertools.count()) =>\n" +" 0" #: ../../howto/functional.rst:870 msgid "" @@ -1554,7 +1674,6 @@ msgstr "" "真を返しているうちは要素を無視し、偽になってから残りの出力をすべて返しま" "す。 ::" -#: ../../howto/functional.rst:874 msgid "" "itertools.dropwhile(less_than_10, itertools.count()) =>\n" " 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" @@ -1562,36 +1681,43 @@ msgid "" "itertools.dropwhile(is_even, itertools.count()) =>\n" " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..." msgstr "" +"itertools.dropwhile(less_than_10, itertools.count()) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"\n" +"itertools.dropwhile(is_even, itertools.count()) =>\n" +" 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..." -#: ../../howto/functional.rst:880 msgid "" ":func:`itertools.compress(data, selectors) ` takes two " "iterators and returns only those elements of *data* for which the " "corresponding element of *selectors* is true, stopping whenever either one " "is :term:`exhausted`::" msgstr "" +":func:`itertools.compress(data, selectors) ` は 2 つのイ" +"テレータを受け取り、*selectors* の対応する要素が真になる *data* の要素だけを" +"返します。\n" +"どちらか一方が :term:`exhausted` になると終了します。 ::" -#: ../../howto/functional.rst:884 msgid "" "itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>\n" " 1, 2, 5" msgstr "" +"itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>\n" +" 1, 2, 5" #: ../../howto/functional.rst:889 msgid "Combinatoric functions" msgstr "組合せ関数" -#: ../../howto/functional.rst:891 msgid "" "The :func:`itertools.combinations(iterable, r) ` " "returns an iterator giving all possible *r*-tuple combinations of the " "elements contained in *iterable*. ::" msgstr "" -":func:`itertools.combinations(iterable, r) ` は、 " -"*iterable* から *r*-tuple 選択する全ての組み合わせを提供するイテレータを返し" -"ます ::" +":func:`itertools.combinations(iterable, r) ` は、" +"*iterable* 内の要素から *r* 個を選ぶすべての組み合わせを、タプルとして返すイ" +"テレータを作ります。 ::" -#: ../../howto/functional.rst:895 msgid "" "itertools.combinations([1, 2, 3, 4, 5], 2) =>\n" " (1, 2), (1, 3), (1, 4), (1, 5),\n" @@ -1604,6 +1730,16 @@ msgid "" " (2, 3, 4), (2, 3, 5), (2, 4, 5),\n" " (3, 4, 5)" msgstr "" +"itertools.combinations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 3), (2, 4), (2, 5),\n" +" (3, 4), (3, 5),\n" +" (4, 5)\n" +"\n" +"itertools.combinations([1, 2, 3, 4, 5], 3) =>\n" +" (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, 3, 5), (1, 4, 5),\n" +" (2, 3, 4), (2, 3, 5), (2, 4, 5),\n" +" (3, 4, 5)" #: ../../howto/functional.rst:906 msgid "" @@ -1619,7 +1755,6 @@ msgstr "" "permutations>` があり、こちらはこの順序についての制約がなく、 *r* 個選択する" "全ての順列を返します。" -#: ../../howto/functional.rst:913 msgid "" "itertools.permutations([1, 2, 3, 4, 5], 2) =>\n" " (1, 2), (1, 3), (1, 4), (1, 5),\n" @@ -1633,6 +1768,17 @@ msgid "" " ...\n" " (5, 4, 3, 2, 1)" msgstr "" +"itertools.permutations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 1), (2, 3), (2, 4), (2, 5),\n" +" (3, 1), (3, 2), (3, 4), (3, 5),\n" +" (4, 1), (4, 2), (4, 3), (4, 5),\n" +" (5, 1), (5, 2), (5, 3), (5, 4)\n" +"\n" +"itertools.permutations([1, 2, 3, 4, 5]) =>\n" +" (1, 2, 3, 4, 5), (1, 2, 3, 5, 4), (1, 2, 4, 3, 5),\n" +" ...\n" +" (5, 4, 3, 2, 1)" #: ../../howto/functional.rst:925 msgid "" @@ -1650,12 +1796,14 @@ msgstr "" "これらの関数が生成する組み合わせは、位置が基準ですので、 *iterable* の内容が" "一意でなくとも良いことに注目してください::" -#: ../../howto/functional.rst:931 msgid "" "itertools.permutations('aba', 3) =>\n" " ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),\n" " ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')" msgstr "" +"itertools.permutations('aba', 3) =>\n" +" ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),\n" +" ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')" #: ../../howto/functional.rst:935 msgid "" @@ -1665,7 +1813,6 @@ msgstr "" "全く同じタプル ``('a', 'a', 'b')`` が 2度現れていますが、これは 2つの 'a' が" "別の位置からのものだからです。" -#: ../../howto/functional.rst:938 msgid "" "The :func:`itertools.combinations_with_replacement(iterable, r) ` function relaxes a different constraint: " @@ -1674,11 +1821,11 @@ msgid "" "the second element is selected. ::" msgstr "" ":func:`itertools.combinations_with_replacement(iterable, r) ` 関数は別の制約を取り払います: 一回の選択で同" -"じ要素を繰り返し選んでも良い。概念的には、それぞれのタプルの最初のものとして" -"一つ要素が選ばれ、続いて 2つ目の選択のかわりにそれで置き換わります ::" +"combinations_with_replacement>` は、別の制約を緩めます。\n" +"同じタプル内で要素の重複を許すのです。\n" +"概念的には、タプルの最初の位置に入れる要素を 1 つ選び、それを選択元に戻してか" +"ら 2 つ目を選びます。 ::" -#: ../../howto/functional.rst:944 msgid "" "itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>\n" " (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),\n" @@ -1687,6 +1834,12 @@ msgid "" " (4, 4), (4, 5),\n" " (5, 5)" msgstr "" +"itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>\n" +" (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 2), (2, 3), (2, 4), (2, 5),\n" +" (3, 3), (3, 4), (3, 5),\n" +" (4, 4), (4, 5),\n" +" (5, 5)" #: ../../howto/functional.rst:953 msgid "Grouping elements" @@ -1715,7 +1868,6 @@ msgstr "" "要素を集めて、キー値とそのキーに対応する要素のイテレータの 2-タプルのストリー" "ムを返します。" -#: ../../howto/functional.rst:966 msgid "" "city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),\n" " ('Anchorage', 'AK'), ('Nome', 'AK'),\n" @@ -1739,6 +1891,27 @@ msgid "" "iterator-3 =>\n" " ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')" msgstr "" +"city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),\n" +" ('Anchorage', 'AK'), ('Nome', 'AK'),\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'),\n" +" ...\n" +" ]\n" +"\n" +"def get_state(city_state):\n" +" return city_state[1]\n" +"\n" +"itertools.groupby(city_list, get_state) =>\n" +" ('AL', iterator-1),\n" +" ('AK', iterator-2),\n" +" ('AZ', iterator-3), ...\n" +"\n" +"ここで\n" +"iterator-1 =>\n" +" ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL')\n" +"iterator-2 =>\n" +" ('Anchorage', 'AK'), ('Nome', 'AK')\n" +"iterator-3 =>\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')" #: ../../howto/functional.rst:988 msgid "" @@ -1798,7 +1971,6 @@ msgstr "" msgid "Here's a small but realistic example::" msgstr "以下にあるのは、小さいけれども現実的な一つの例です::" -#: ../../howto/functional.rst:1015 msgid "" "import functools\n" "\n" @@ -1810,8 +1982,16 @@ msgid "" "server_log = functools.partial(log, subsystem='server')\n" "server_log('Unable to open socket')" msgstr "" +"import functools\n" +"\n" +"def log(message, subsystem):\n" +" \"\"\"'message' の内容を指定されたサブシステムに書き込む。\"\"\"\n" +" print('%s: %s' % (subsystem, message))\n" +" ...\n" +"\n" +"server_log = functools.partial(log, subsystem='server')\n" +"server_log('Unable to open socket')" -#: ../../howto/functional.rst:1025 msgid "" ":func:`functools.reduce(func, iter, [initial_value]) ` " "cumulatively performs an operation on all the iterable's elements and, " @@ -1825,8 +2005,20 @@ msgid "" "raised. If the initial value is supplied, it's used as a starting point and " "``func(initial_value, A)`` is the first calculation. ::" msgstr "" +":func:`functools.reduce(func, iter, [initial_value]) ` は、" +"イテラブルの全要素に累積的に演算を適用するため、無限のイテラブルには使えませ" +"ん。\n" +"*func* は 2 つの要素を受け取り、1 つの値を返す関数でなければなりません。\n" +":func:`functools.reduce` は、イテレータが返す最初の 2 要素 A と B から " +"``func(A, B)`` を計算します。\n" +"次に 3 番目の要素 C を取得して ``func(func(A, B), C)`` を計算し、その結果と " +"4 番目の要素に演算を適用するという処理を、イテラブルが :term:`exhausted` にな" +"るまで続けます。\n" +"初期値がなく、イテラブルが何も値を返さない場合は、:exc:`TypeError` が送出され" +"ます。\n" +"初期値を指定した場合は、それを出発点にして、最初に ``func(initial_value, " +"A)`` を計算します。 ::" -#: ../../howto/functional.rst:1037 msgid "" ">>> import operator, functools\n" ">>> functools.reduce(operator.concat, ['A', 'BB', 'C'])\n" @@ -1840,6 +2032,17 @@ msgid "" ">>> functools.reduce(operator.mul, [], 1)\n" "1" msgstr "" +">>> import operator, functools\n" +">>> functools.reduce(operator.concat, ['A', 'BB', 'C'])\n" +"'ABBC'\n" +">>> functools.reduce(operator.concat, [])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: reduce() of empty iterable with no initial value\n" +">>> functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"6\n" +">>> functools.reduce(operator.mul, [], 1)\n" +"1" #: ../../howto/functional.rst:1049 msgid "" @@ -1859,7 +2062,6 @@ msgstr "" "とはいえ、多くの場合 :func:`functools.reduce` を使うよりは、単に :keyword:" "`for` ループを書いたほうがわかりやすくなります::" -#: ../../howto/functional.rst:1064 msgid "" "import functools\n" "# Instead of:\n" @@ -1870,20 +2072,26 @@ msgid "" "for i in [1, 2, 3]:\n" " product *= i" msgstr "" +"import functools\n" +"# 次の代わりに:\n" +"product = functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"\n" +"# こう書ける:\n" +"product = 1\n" +"for i in [1, 2, 3]:\n" +" product *= i" -#: ../../howto/functional.rst:1073 msgid "" "A related function is :func:`itertools.accumulate(iterable, func=operator." "add) `. It performs the same calculation, but instead " "of returning only the final result, :func:`~itertools.accumulate` returns an " "iterator that also yields each partial result::" msgstr "" -"関連する関数は :func:`itertools.accumulate(iterable, func=operator.add) " -"` です。この関数は同じ計算をしますが、最終結果を返すの" -"ではなく、 :func:`~itertools.accumulate` はそれぞれの中間結果を生成するイテ" -"レータが返り値となります。" +"関連する関数に :func:`itertools.accumulate(iterable, func=operator.add) " +"` があります。\n" +"同じ計算を行いますが、:func:`~itertools.accumulate` は最終結果だけを返すので" +"はなく、途中の結果も順に生成するイテレータを返します。 ::" -#: ../../howto/functional.rst:1078 msgid "" "itertools.accumulate([1, 2, 3, 4, 5]) =>\n" " 1, 3, 6, 10, 15\n" @@ -1891,6 +2099,11 @@ msgid "" "itertools.accumulate([1, 2, 3, 4, 5], operator.mul) =>\n" " 1, 2, 6, 24, 120" msgstr "" +"itertools.accumulate([1, 2, 3, 4, 5]) =>\n" +" 1, 3, 6, 10, 15\n" +"\n" +"itertools.accumulate([1, 2, 3, 4, 5], operator.mul) =>\n" +" 1, 2, 6, 24, 120" #: ../../howto/functional.rst:1086 msgid "The operator module" @@ -1959,11 +2172,12 @@ msgstr "" "ちょうど良い関数がビルトインやモジュールで存在していれば、新しい関数を定義す" "る必要はまったくありません::" -#: ../../howto/functional.rst:1113 msgid "" "stripped_lines = [line.strip() for line in lines]\n" "existing_files = filter(os.path.exists, file_list)" msgstr "" +"stripped_lines = [line.strip() for line in lines]\n" +"existing_files = filter(os.path.exists, file_list)" #: ../../howto/functional.rst:1116 msgid "" @@ -1977,12 +2191,14 @@ msgstr "" "の 一つが :keyword:`lambda` 式です。 ``lambda`` は引数として複数のパラメータ" "と それをつなぐ式を取り、その式の値を返す無名の関数を作ります::" -#: ../../howto/functional.rst:1121 msgid "" "adder = lambda x, y: x+y\n" "\n" "print_assign = lambda name, value: name + '=' + str(value)" msgstr "" +"adder = lambda x, y: x+y\n" +"\n" +"print_assign = lambda name, value: name + '=' + str(value)" #: ../../howto/functional.rst:1125 msgid "" @@ -1990,7 +2206,6 @@ msgid "" "the usual way::" msgstr "もう一つの選択肢は、ふつうに ``def`` 文で関数を定義するだけです::" -#: ../../howto/functional.rst:1128 msgid "" "def adder(x, y):\n" " return x + y\n" @@ -1998,6 +2213,11 @@ msgid "" "def print_assign(name, value):\n" " return name + '=' + str(value)" msgstr "" +"def adder(x, y):\n" +" return x + y\n" +"\n" +"def print_assign(name, value):\n" +" return name + '=' + str(value)" #: ../../howto/functional.rst:1134 msgid "" @@ -2023,11 +2243,12 @@ msgstr "" "ちゃして読みにくい式になってしまいます。さて、次のコードは何をしているでしょ" "うか、素早くお答えください! ::" -#: ../../howto/functional.rst:1144 msgid "" "import functools\n" "total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]" msgstr "" +"import functools\n" +"total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]" #: ../../howto/functional.rst:1147 msgid "" @@ -2038,7 +2259,6 @@ msgstr "" "わかるにはわかるでしょうが、何がどうなっているのか紐解いていくには時間がかか" "るはずです。短い ``def`` 文で入れ子にすると、少し見通しが良くなりますが::" -#: ../../howto/functional.rst:1151 msgid "" "import functools\n" "def combine(a, b):\n" @@ -2046,25 +2266,31 @@ msgid "" "\n" "total = functools.reduce(combine, items)[1]" msgstr "" +"import functools\n" +"def combine(a, b):\n" +" return 0, a[1] + b[1]\n" +"\n" +"total = functools.reduce(combine, items)[1]" #: ../../howto/functional.rst:1157 msgid "But it would be best of all if I had simply used a ``for`` loop::" msgstr "でも単純に ``for`` ループにすれば良かったのです::" -#: ../../howto/functional.rst:1159 msgid "" "total = 0\n" "for a, b in items:\n" " total += b" msgstr "" +"total = 0\n" +"for a, b in items:\n" +" total += b" #: ../../howto/functional.rst:1163 msgid "Or the :func:`sum` built-in and a generator expression::" msgstr "あるいは :func:`sum` ビルトインとジェネレータ式でも良いですね::" -#: ../../howto/functional.rst:1165 msgid "total = sum(b for a, b in items)" -msgstr "" +msgstr "total = sum(b for a, b in items)" #: ../../howto/functional.rst:1167 msgid "" @@ -2116,7 +2342,6 @@ msgstr "" msgid "Revision History and Acknowledgements" msgstr "更新履歴と謝辞" -#: ../../howto/functional.rst:1186 msgid "" "This HOWTO was originally written by A. M. Kuchling. The author would like " "to thank the following people for offering suggestions, corrections and " @@ -2124,36 +2349,38 @@ msgid "" "Nick Efford, Raymond Hettinger, Jim Jewett, Mike Krell, Leandro Lameiro, " "Jussi Salmela, Collin Winter, Blake Winton." msgstr "" +"この HOWTO は、もともと A. M. Kuchling が執筆しました。\n" +"著者は、さまざまな草稿に提案、訂正、協力を寄せてくださった次の方々に感謝しま" +"す: Ian Bicking、Nick Coghlan、Nick Efford、Raymond Hettinger、Jim Jewett、" +"Mike Krell、Leandro Lameiro、Jussi Salmela、Collin Winter、Blake Winton。" -#: ../../howto/functional.rst:1192 msgid "Version 0.1: posted June 30 2006." -msgstr "Version 0.1: posted June 30 2006." +msgstr "バージョン 0.1: 2006 年 6 月 30 日公開。" -#: ../../howto/functional.rst:1194 msgid "Version 0.11: posted July 1 2006. Typo fixes." -msgstr "Version 0.11: posted July 1 2006. Typo fixes." +msgstr "" +"バージョン 0.11: 2006 年 7 月 1 日公開。\n" +"誤記を修正。" -#: ../../howto/functional.rst:1196 msgid "" "Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into " "one. Typo fixes." msgstr "" -"Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into " -"one. Typo fixes." +"バージョン 0.2: 2006 年 7 月 10 日公開。\n" +"ジェネレータ式とリスト内包表記の節を統合。\n" +"誤記を修正。" -#: ../../howto/functional.rst:1199 msgid "" "Version 0.21: Added more references suggested on the tutor mailing list." -msgstr "" -"Version 0.21: Added more references suggested on the tutor mailing list." +msgstr "バージョン 0.21: tutor メーリングリストで提案された参考資料を追加。" -#: ../../howto/functional.rst:1201 msgid "" "Version 0.30: Adds a section on the ``functional`` module written by Collin " "Winter; adds short section on the operator module; a few other edits." msgstr "" -"Version 0.30: Adds a section on the ``functional`` module written by Collin " -"Winter; adds short section on the operator module; a few other edits." +"バージョン 0.30: Collin Winter による ``functional`` モジュールの節を追加。\n" +"operator モジュールの短い節を追加。\n" +"ほかにもいくつか修正。" #: ../../howto/functional.rst:1206 msgid "References" @@ -2180,12 +2407,13 @@ msgstr "" "使っていますが、これらの章で説明されている設計アプローチの多くは、関数型スタ" "イルの Python コードにも適用できます。" -#: ../../howto/functional.rst:1219 msgid "" "https://defmacro.org/2006/06/19/fp.html: A general introduction to " "functional programming that uses Java examples and has a lengthy historical " "introduction." msgstr "" +"https://defmacro.org/2006/06/19/fp.html: Java の例を使った関数型プログラミン" +"グの入門記事で、歴史的背景も詳しく紹介しています。" #: ../../howto/functional.rst:1222 msgid "" @@ -2216,19 +2444,17 @@ msgstr "https://en.wikipedia.org/wiki/Currying: カリー化の概念に関す msgid "Python-specific" msgstr "Python 特有の話" -#: ../../howto/functional.rst:1234 msgid "" "https://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-" "reference:`Text Processing in Python` discusses functional programming for " "text processing, in the section titled \"Utilizing Higher-Order Functions in " "Text Processing\"." msgstr "" -"https://gnosis.cx/TPiP/: David Mertz's の本の最初の章 :title-reference:`Text " -"Processing in Python` では文書処理のための関数プログラミングについて議論して" -"います、この議論の節には \"Utilizing Higher-Order Functions in Text " -"Processing\" というタイトルがついています。" +"https://gnosis.cx/TPiP/: David Mertz 著 :title-reference:`Text Processing in " +"Python` の第 1 章では、\"Utilizing Higher-Order Functions in Text " +"Processing\" という節で、テキスト処理のための関数型プログラミングを扱っていま" +"す。" -#: ../../howto/functional.rst:1239 msgid "" "Mertz also wrote a 3-part series of articles on functional programming for " "IBM's DeveloperWorks site; see `part 1 `__, and `part 3 `__." msgstr "" +"Mertz は IBM の DeveloperWorks サイト向けに、関数型プログラミングの全 3 回の" +"記事も書いています。\n" +"`第 1 回 `__、`第 2 回 `__、`第 3 " +"回 `__ を参照してください。" #: ../../howto/functional.rst:1247 msgid "Python documentation" @@ -2258,10 +2491,9 @@ msgstr ":mod:`operator` モジュールの文書。" msgid ":pep:`289`: \"Generator Expressions\"" msgstr ":pep:`289`: \"Generator Expressions\"" -#: ../../howto/functional.rst:1257 msgid "" ":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new " "generator features in Python 2.5." msgstr "" -":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new " -"generator features in Python 2.5." +":pep:`342`: \"Coroutines via Enhanced Generators\" は、Python 2.5 の新しい" +"ジェネレータ機能を説明しています。" diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po index 90b9f4b89..a25b26d58 100644 --- a/howto/gdb_helpers.po +++ b/howto/gdb_helpers.po @@ -22,165 +22,180 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/gdb_helpers.rst:5 msgid "Debugging C API extensions and CPython Internals with GDB" -msgstr "" +msgstr "GDB による C API 拡張と CPython 内部のデバッグ" -#: ../../howto/gdb_helpers.rst:9 msgid "" "This document explains how the Python GDB extension, ``python-gdb.py``, can " "be used with the GDB debugger to debug CPython extensions and the CPython " "interpreter itself." msgstr "" +"このドキュメントでは、Python の GDB 拡張 ``python-gdb.py`` を GDB デバッガと" +"組み合わせて、CPython 拡張や CPython インタープリタ自体をデバッグする方法を説" +"明します。" -#: ../../howto/gdb_helpers.rst:13 msgid "" "When debugging low-level problems such as crashes or deadlocks, a low-level " "debugger, such as GDB, is useful to diagnose and correct the issue. By " "default, GDB (or any of its front-ends) doesn't support high-level " "information specific to the CPython interpreter." msgstr "" +"クラッシュやデッドロックなどの低レベルの問題を調べて修正するには、GDB などの" +"低レベルのデバッガが役立ちます。\n" +"デフォルトでは GDB (およびそのフロントエンド) は CPython インタープリタ固有の" +"高レベルの情報に対応していません。" -#: ../../howto/gdb_helpers.rst:18 msgid "" "The ``python-gdb.py`` extension adds CPython interpreter information to GDB. " "The extension helps introspect the stack of currently executing Python " "functions. Given a Python object represented by a :c:expr:`PyObject *` " "pointer, the extension surfaces the type and value of the object." msgstr "" +"``python-gdb.py`` 拡張は CPython インタープリタの情報を GDB に追加します。\n" +"実行中の Python 関数のスタックを調べるのに役立ちます。\n" +":c:expr:`PyObject *` ポインタで表された Python オブジェクトについて、型と値を" +"表示できます。" -#: ../../howto/gdb_helpers.rst:23 msgid "" "Developers who are working on CPython extensions or tinkering with parts of " "CPython that are written in C can use this document to learn how to use the " "``python-gdb.py`` extension with GDB." msgstr "" +"このドキュメントは、CPython 拡張の開発者や CPython の C で書かれた部分を扱う" +"開発者が、GDB で ``python-gdb.py`` 拡張を使う方法を学ぶためのものです。" -#: ../../howto/gdb_helpers.rst:29 msgid "" "This document assumes that you are familiar with the basics of GDB and the " "CPython C API. It consolidates guidance from the `devguide `_ and the `Python wiki `_." msgstr "" +"このドキュメントは GDB と CPython C API の基礎を理解していることを前提として" +"います。\n" +"`開発者ガイド `_ と `Python wiki `_ の説明をまとめたものです。" -#: ../../howto/gdb_helpers.rst:36 msgid "Prerequisites" -msgstr "" +msgstr "前提条件" -#: ../../howto/gdb_helpers.rst:38 msgid "You need to have:" -msgstr "" +msgstr "次のものが必要です:" -#: ../../howto/gdb_helpers.rst:40 msgid "" "GDB 7 or later. (For earlier versions of GDB, see ``Misc/gdbinit`` in the " "sources of Python 3.11 or earlier.)" msgstr "" +"GDB 7 以降。(それ以前の GDB については、Python 3.11 以前のソースにある " +"``Misc/gdbinit`` を参照してください。)" -#: ../../howto/gdb_helpers.rst:42 msgid "" "GDB-compatible debugging information for Python and any extension you are " "debugging." -msgstr "" +msgstr "Python およびデバッグ対象の拡張の、GDB に対応したデバッグ情報。" -#: ../../howto/gdb_helpers.rst:44 msgid "The ``python-gdb.py`` extension." -msgstr "" +msgstr "``python-gdb.py`` 拡張。" -#: ../../howto/gdb_helpers.rst:46 msgid "" "The extension is built with Python, but might be distributed separately or " "not at all. Below, we include tips for a few common systems as examples. " "Note that even if the instructions match your system, they might be outdated." msgstr "" +"この拡張は Python と一緒にビルドされますが、別途配布されていることも、配布さ" +"れていないこともあります。\n" +"以下では一般的なシステムをいくつか例に挙げて説明します。\n" +"お使いのシステムに該当する手順でも、情報が古くなっている可能性に注意してくだ" +"さい。" -#: ../../howto/gdb_helpers.rst:52 msgid "Setup with Python built from source" -msgstr "" +msgstr "ソースからビルドした Python での設定" -#: ../../howto/gdb_helpers.rst:54 msgid "" "When you build CPython from source, debugging information should be " "available, and the build should add a ``python-gdb.py`` file to the root " "directory of your repository." msgstr "" +"CPython をソースからビルドすると、通常はデバッグ情報が利用でき、リポジトリの" +"ルートディレクトリに ``python-gdb.py`` ファイルが追加されます。" -#: ../../howto/gdb_helpers.rst:58 msgid "" "To activate support, you must add the directory containing ``python-gdb.py`` " "to GDB's \"auto-load-safe-path\". If you haven't done this, recent versions " "of GDB will print out a warning with instructions on how to do this." msgstr "" +"サポートを有効にするには、``python-gdb.py`` のあるディレクトリを GDB の " +"\"auto-load-safe-path\" に追加する必要があります。\n" +"追加していない場合、最近の GDB は追加方法を示す警告を表示します。" -#: ../../howto/gdb_helpers.rst:65 msgid "" "If you do not see instructions for your version of GDB, put this in your " "configuration file (``~/.gdbinit`` or ``~/.config/gdb/gdbinit``)::" msgstr "" +"お使いの GDB で手順が表示されない場合は、設定ファイル (``~/.gdbinit`` または " +"``~/.config/gdb/gdbinit``) に次を記述してください。 ::" -#: ../../howto/gdb_helpers.rst:68 msgid "add-auto-load-safe-path /path/to/cpython" -msgstr "" +msgstr "add-auto-load-safe-path /path/to/cpython" -#: ../../howto/gdb_helpers.rst:70 msgid "You can also add multiple paths, separated by ``:``." -msgstr "" +msgstr "``:`` で区切って複数のパスを追加することもできます。" -#: ../../howto/gdb_helpers.rst:74 msgid "Setup for Python from a Linux distro" -msgstr "" +msgstr "Linux ディストリビューションの Python での設定" -#: ../../howto/gdb_helpers.rst:76 msgid "" "Most Linux systems provide debug information for the system Python in a " "package called ``python-debuginfo``, ``python-dbg`` or similar. For example:" msgstr "" +"多くの Linux システムでは、システムの Python のデバッグ情報を ``python-" +"debuginfo`` や ``python-dbg`` などの名前のパッケージで提供しています。\n" +"例えば:" -#: ../../howto/gdb_helpers.rst:80 msgid "Fedora:" -msgstr "" +msgstr "Fedora:" -#: ../../howto/gdb_helpers.rst:82 msgid "" "sudo dnf install gdb\n" "sudo dnf debuginfo-install python3" msgstr "" +"sudo dnf install gdb\n" +"sudo dnf debuginfo-install python3" -#: ../../howto/gdb_helpers.rst:87 msgid "Ubuntu:" -msgstr "" +msgstr "Ubuntu:" -#: ../../howto/gdb_helpers.rst:89 msgid "sudo apt install gdb python3-dbg" -msgstr "" +msgstr "sudo apt install gdb python3-dbg" -#: ../../howto/gdb_helpers.rst:93 msgid "" "On several recent Linux systems, GDB can download debugging symbols " "automatically using *debuginfod*. However, this will not install the " "``python-gdb.py`` extension; you generally do need to install the debug info " "package separately." msgstr "" +"最近の Linux システムの一部では、GDB が *debuginfod* を使ってデバッグシンボル" +"を自動的にダウンロードできます。\n" +"ただし、これでは ``python-gdb.py`` 拡張はインストールされません。\n" +"通常はデバッグ情報のパッケージを別途インストールする必要があります。" -#: ../../howto/gdb_helpers.rst:100 msgid "Using the Debug build and Development mode" -msgstr "" +msgstr "デバッグビルドと開発モードの利用" -#: ../../howto/gdb_helpers.rst:102 msgid "For easier debugging, you might want to:" -msgstr "" +msgstr "デバッグを容易にするため、次の方法も検討してください:" -#: ../../howto/gdb_helpers.rst:104 msgid "" "Use a :ref:`debug build ` of Python. (When building from " "source, use ``configure --with-pydebug``. On Linux distros, install and run " "a package like ``python-debug`` or ``python-dbg``, if available.)" msgstr "" +"Python の :ref:`デバッグビルド ` を使う。(ソースからビルドする場" +"合は ``configure --with-pydebug`` を使います。Linux ディストリビューションで" +"は、``python-debug`` や ``python-dbg`` などのパッケージがあればインストールし" +"て実行します。)" -#: ../../howto/gdb_helpers.rst:107 msgid "Use the runtime :ref:`development mode ` (``-X dev``)." -msgstr "" +msgstr "実行時の :ref:`開発モード ` (``-X dev``) を使う。" #: ../../howto/gdb_helpers.rst:109 msgid "" @@ -189,27 +204,26 @@ msgid "" "process easier." msgstr "" -#: ../../howto/gdb_helpers.rst:115 msgid "Using the ``python-gdb`` extension" -msgstr "" +msgstr "``python-gdb`` 拡張の利用" -#: ../../howto/gdb_helpers.rst:117 msgid "" "When the extension is loaded, it provides two main features: pretty printers " "for Python values, and additional commands." msgstr "" +"この拡張を読み込むと、主に二つの機能が利用できます。\n" +"Python の値を整形して表示するプリティプリンタと、追加のコマンドです。" -#: ../../howto/gdb_helpers.rst:121 msgid "Pretty-printers" -msgstr "" +msgstr "プリティプリンタ" -#: ../../howto/gdb_helpers.rst:123 msgid "" "This is what a GDB backtrace looks like (truncated) when this extension is " "enabled::" msgstr "" +"この拡張を有効にすると、GDB のバックトレースは次のようになります (一部省" +"略)。 ::" -#: ../../howto/gdb_helpers.rst:126 msgid "" "#0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at " "address 0x7fffff7fefe8\n" @@ -239,22 +253,52 @@ msgid "" "'__doc__': None}, key=\n" " 0x5c2b8d \"__lltrace__\") at Objects/dictobject.c:2171" msgstr "" +"#0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at " +"address 0x7fffff7fefe8\n" +") at Objects/obmalloc.c:748\n" +"#1 0x000000000041b7c0 in _PyObject_DebugMallocApi (id=111 'o', nbytes=24) " +"at Objects/obmalloc.c:1445\n" +"#2 0x000000000041b717 in _PyObject_DebugMalloc (nbytes=24) at Objects/" +"obmalloc.c:1412\n" +"#3 0x000000000044060a in _PyUnicode_New (length=11) at Objects/" +"unicodeobject.c:346\n" +"#4 0x00000000004466aa in PyUnicodeUCS2_DecodeUTF8Stateful (s=0x5c2b8d " +"\"__lltrace__\", size=11, errors=0x0, consumed=\n" +" 0x0) at Objects/unicodeobject.c:2531\n" +"#5 0x0000000000446647 in PyUnicodeUCS2_DecodeUTF8 (s=0x5c2b8d " +"\"__lltrace__\", size=11, errors=0x0)\n" +" at Objects/unicodeobject.c:2495\n" +"#6 0x0000000000440d1b in PyUnicodeUCS2_FromStringAndSize (u=0x5c2b8d " +"\"__lltrace__\", size=11)\n" +" at Objects/unicodeobject.c:551\n" +"#7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d " +"\"__lltrace__\") at Objects/unicodeobject.c:569\n" +"#8 0x0000000000584abd in PyDict_GetItemString (v=\n" +" {'Yuck': , '__builtins__': , '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', " +"'__package__': None, 'y': , 'dict': {0: 0, 1: " +"1, 2: 2, 3: 3}, '__name__': '__main__', 'z': , " +"'__doc__': None}, key=\n" +" 0x5c2b8d \"__lltrace__\") at Objects/dictobject.c:2171" -#: ../../howto/gdb_helpers.rst:142 msgid "" "Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed " "as its ``repr()``, rather than an opaque ``PyObject *`` pointer." msgstr "" +"``PyDict_GetItemString`` の引数の辞書が、内部の分からない ``PyObject *`` ポイ" +"ンタではなく ``repr()`` の結果として表示されている点に注目してください。" -#: ../../howto/gdb_helpers.rst:145 msgid "" "The extension works by supplying a custom printing routine for values of " "type ``PyObject *``. If you need to access lower-level details of an " "object, then cast the value to a pointer of the appropriate type. For " "example::" msgstr "" +"この拡張は ``PyObject *`` 型の値に専用の表示処理を提供します。\n" +"オブジェクトの低レベルの詳細を調べるには、適切な型のポインタにキャストしてく" +"ださい。\n" +"例えば次のようにします。 ::" -#: ../../howto/gdb_helpers.rst:149 msgid "" "(gdb) p globals\n" "$1 = {'__builtins__': , '__name__':\n" @@ -275,14 +319,32 @@ msgid "" "{me_hash = 0, me_key = 0x0, me_value = 0x0}, {\n" " me_hash = 6614918939584953775, me_key = '__package__', me_value = None}}}" msgstr "" +"(gdb) p globals\n" +"$1 = {'__builtins__': , '__name__':\n" +"'__main__', 'ctypes': , '__doc__': None,\n" +"'__package__': None}\n" +"\n" +"(gdb) p *(PyDictObject*)globals\n" +"$2 = {ob_refcnt = 3, ob_type = 0x3dbdf85820, ma_fill = 5, ma_used = 5,\n" +"ma_mask = 7, ma_table = 0x63d0f8, ma_lookup = 0x3dbdc7ea70\n" +", ma_smalltable = {{me_hash = 7065186196740147912,\n" +"me_key = '__builtins__', me_value = },\n" +"{me_hash = -368181376027291943, me_key = '__name__',\n" +"me_value ='__main__'}, {me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = -9177857982131165996, me_key = 'ctypes',\n" +"me_value = },\n" +"{me_hash = -8518757509529533123, me_key = '__doc__', me_value = None},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0}, {\n" +" me_hash = 6614918939584953775, me_key = '__package__', me_value = None}}}" -#: ../../howto/gdb_helpers.rst:168 msgid "" "Note that the pretty-printers do not actually call ``repr()``. For basic " "types, they try to match its result closely." msgstr "" +"プリティプリンタは実際に ``repr()`` を呼び出すわけではありません。\n" +"基本的な型では、その結果にできるだけ近い表示を行います。" -#: ../../howto/gdb_helpers.rst:171 msgid "" "An area that can be confusing is that the custom printer for some types look " "a lot like GDB's built-in printer for standard types. For example, the " @@ -290,8 +352,11 @@ msgid "" "representation that is not distinguishable from one of a regular machine-" "level integer::" msgstr "" +"一部の型の専用の表示処理は、標準の型に対する GDB 組み込みの表示処理とよく似て" +"いるため、混同しやすいことがあります。\n" +"例えば Python の ``int`` (:c:expr:`PyLongObject *`) のプリティプリンタによる" +"表示は、通常の機械レベルの整数の表示と区別がつきません。 ::" -#: ../../howto/gdb_helpers.rst:177 msgid "" "(gdb) p some_machine_integer\n" "$3 = 42\n" @@ -299,71 +364,88 @@ msgid "" "(gdb) p some_python_integer\n" "$4 = 42" msgstr "" +"(gdb) p some_machine_integer\n" +"$3 = 42\n" +"\n" +"(gdb) p some_python_integer\n" +"$4 = 42" -#: ../../howto/gdb_helpers.rst:183 msgid "" "The internal structure can be revealed with a cast to :c:expr:`PyLongObject " "*`::" -msgstr "" +msgstr ":c:expr:`PyLongObject *` にキャストすると内部構造を確認できます。 ::" -#: ../../howto/gdb_helpers.rst:185 msgid "" "(gdb) p *(PyLongObject*)some_python_integer\n" "$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size " "= 1},\n" "ob_digit = {42}}" msgstr "" +"(gdb) p *(PyLongObject*)some_python_integer\n" +"$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size " +"= 1},\n" +"ob_digit = {42}}" -#: ../../howto/gdb_helpers.rst:189 msgid "" "A similar confusion can arise with the ``str`` type, where the output looks " "a lot like gdb's built-in printer for ``char *``::" msgstr "" +"``str`` 型でも、GDB 組み込みの ``char *`` の表示とよく似ているため、同様に混" +"同しやすいことがあります。 ::" -#: ../../howto/gdb_helpers.rst:192 msgid "" "(gdb) p ptr_to_python_str\n" "$6 = '__builtins__'" msgstr "" +"(gdb) p ptr_to_python_str\n" +"$6 = '__builtins__'" -#: ../../howto/gdb_helpers.rst:195 msgid "" "The pretty-printer for ``str`` instances defaults to using single-quotes (as " "does Python's ``repr`` for strings) whereas the standard printer for ``char " "*`` values uses double-quotes and contains a hexadecimal address::" msgstr "" +"``str`` インスタンスのプリティプリンタは、デフォルトでシングルクォートを使い" +"ます (Python の文字列の ``repr`` と同様です)。\n" +"一方、``char *`` の標準の表示はダブルクォートを使い、16 進数のアドレスも含み" +"ます。 ::" -#: ../../howto/gdb_helpers.rst:199 msgid "" "(gdb) p ptr_to_char_star\n" "$7 = 0x6d72c0 \"hello world\"" msgstr "" +"(gdb) p ptr_to_char_star\n" +"$7 = 0x6d72c0 \"hello world\"" -#: ../../howto/gdb_helpers.rst:202 msgid "" "Again, the implementation details can be revealed with a cast to :c:expr:" "`PyUnicodeObject *`::" msgstr "" +"この場合も :c:expr:`PyUnicodeObject *` にキャストすると実装の詳細を確認できま" +"す。 ::" -#: ../../howto/gdb_helpers.rst:205 msgid "" "(gdb) p *(PyUnicodeObject*)$6\n" "$8 = {ob_base = {ob_refcnt = 33, ob_type = 0x3dad3a95a0}, length = 12,\n" "str = 0x7ffff2128500, hash = 7065186196740147912, state = 1, defenc = 0x0}" msgstr "" +"(gdb) p *(PyUnicodeObject*)$6\n" +"$8 = {ob_base = {ob_refcnt = 33, ob_type = 0x3dad3a95a0}, length = 12,\n" +"str = 0x7ffff2128500, hash = 7065186196740147912, state = 1, defenc = 0x0}" -#: ../../howto/gdb_helpers.rst:210 msgid "``py-list``" -msgstr "" +msgstr "``py-list``" -#: ../../howto/gdb_helpers.rst:212 msgid "" "The extension adds a ``py-list`` command, which lists the Python source code " "(if any) for the current frame in the selected thread. The current line is " "marked with a \">\"::" msgstr "" +"この拡張は ``py-list`` コマンドを追加します。\n" +"このコマンドは選択中のスレッドの現在のフレームに対応する Python ソースコード" +"があれば、それを表示します。\n" +"現在の行には \">\" が付きます。 ::" -#: ../../howto/gdb_helpers.rst:216 msgid "" "(gdb) py-list\n" " 901 if options.profile:\n" @@ -378,24 +460,37 @@ msgid "" " 910 except KeyboardInterrupt:\n" " 911 # properly quit on a keyboard interrupt..." msgstr "" +"(gdb) py-list\n" +" 901 if options.profile:\n" +" 902 options.profile = False\n" +" 903 profile_me()\n" +" 904 return\n" +" 905\n" +">906 u = UI()\n" +" 907 if not u.quit:\n" +" 908 try:\n" +" 909 gtk.main()\n" +" 910 except KeyboardInterrupt:\n" +" 911 # properly quit on a keyboard interrupt..." -#: ../../howto/gdb_helpers.rst:229 msgid "" "Use ``py-list START`` to list at a different line number within the Python " "source, and ``py-list START,END`` to list a specific range of lines within " "the Python source." msgstr "" +"Python ソース内の別の行から表示するには ``py-list START`` を、特定の行範囲を" +"表示するには ``py-list START,END`` を使います。" -#: ../../howto/gdb_helpers.rst:234 msgid "``py-up`` and ``py-down``" -msgstr "" +msgstr "``py-up`` と ``py-down``" -#: ../../howto/gdb_helpers.rst:236 msgid "" "The ``py-up`` and ``py-down`` commands are analogous to GDB's regular ``up`` " "and ``down`` commands, but try to move at the level of CPython frames, " "rather than C frames." msgstr "" +"``py-up`` と ``py-down`` は GDB の通常の ``up`` と ``down`` に相当するコマン" +"ドですが、C のフレームではなく CPython のフレーム単位で移動しようとします。" #: ../../howto/gdb_helpers.rst:240 msgid "" @@ -406,15 +501,13 @@ msgid "" "look up the value of the related ``PyFrameObject *``." msgstr "" -#: ../../howto/gdb_helpers.rst:246 msgid "They emit the frame number (at the C level) within the thread." -msgstr "" +msgstr "これらのコマンドはスレッド内の (C レベルの) フレーム番号を表示します。" #: ../../howto/gdb_helpers.rst:248 ../../howto/gdb_helpers.rst:320 msgid "For example::" msgstr "例えば::" -#: ../../howto/gdb_helpers.rst:250 msgid "" "(gdb) py-up\n" "#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/\n" @@ -428,23 +521,33 @@ msgid "" "(gdb) py-up\n" "Unable to find an older python frame" msgstr "" +"(gdb) py-up\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-up\n" +"#40 Frame 0x948e82c, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/gnome_sudoku.py, line 22, in start_game(main=)\n" +" main.start_game()\n" +"(gdb) py-up\n" +"Unable to find an older python frame" -#: ../../howto/gdb_helpers.rst:261 msgid "so we're at the top of the Python stack." -msgstr "" +msgstr "これで Python スタックの先頭に到達しました。" -#: ../../howto/gdb_helpers.rst:263 msgid "" "The frame numbers correspond to those displayed by GDB's standard " "``backtrace`` command. The command skips C frames which are not executing " "Python code." msgstr "" +"フレーム番号は GDB の標準の ``backtrace`` コマンドで表示されるものと対応しま" +"す。\n" +"Python コードを実行していない C のフレームはスキップされます。" -#: ../../howto/gdb_helpers.rst:267 msgid "Going back down::" -msgstr "" +msgstr "逆向きに戻ると次のようになります。 ::" -#: ../../howto/gdb_helpers.rst:269 msgid "" "(gdb) py-down\n" "#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" @@ -484,19 +587,58 @@ msgid "" "(gdb) py-down\n" "Unable to find a newer python frame" msgstr "" +"(gdb) py-down\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-down\n" +"#34 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#23 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#19 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"game_selector.py, line 201, in run_swallowed_dialog " +"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " +"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " +"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " +"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " +"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " +"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " +"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=, main_page=0) " +"at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"(gdb) py-down\n" +"#8 (unable to read python frame information)\n" +"(gdb) py-down\n" +"Unable to find a newer python frame" -#: ../../howto/gdb_helpers.rst:289 msgid "and we're at the bottom of the Python stack." -msgstr "" +msgstr "これで Python スタックの末尾に到達しました。" -#: ../../howto/gdb_helpers.rst:291 msgid "" "Note that in Python 3.12 and newer, the same C stack frame can be used for " "multiple Python stack frames. This means that ``py-up`` and ``py-down`` may " "move multiple Python frames at once. For example::" msgstr "" +"Python 3.12 以降では、複数の Python スタックフレームが同じ C スタックフレーム" +"を使うことがあります。\n" +"このため ``py-up`` と ``py-down`` は複数の Python フレームを一度に移動する場" +"合があります。\n" +"例えば次のようになります。 ::" -#: ../../howto/gdb_helpers.rst:295 msgid "" "(gdb) py-up\n" "#6 Frame 0x7ffff7fb62b0, for file /tmp/rec.py, line 5, in recursive_function " @@ -522,18 +664,40 @@ msgid "" "(gdb) py-up\n" "Unable to find an older python frame" msgstr "" +"(gdb) py-up\n" +"#6 Frame 0x7ffff7fb62b0, for file /tmp/rec.py, line 5, in recursive_function " +"(n=0)\n" +" time.sleep(5)\n" +"#6 Frame 0x7ffff7fb6240, for file /tmp/rec.py, line 7, in recursive_function " +"(n=1)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb61d0, for file /tmp/rec.py, line 7, in recursive_function " +"(n=2)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6160, for file /tmp/rec.py, line 7, in recursive_function " +"(n=3)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb60f0, for file /tmp/rec.py, line 7, in recursive_function " +"(n=4)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6080, for file /tmp/rec.py, line 7, in recursive_function " +"(n=5)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6020, for file /tmp/rec.py, line 9, in ()\n" +" recursive_function(5)\n" +"(gdb) py-up\n" +"Unable to find an older python frame" -#: ../../howto/gdb_helpers.rst:315 msgid "``py-bt``" -msgstr "" +msgstr "``py-bt``" -#: ../../howto/gdb_helpers.rst:317 msgid "" "The ``py-bt`` command attempts to display a Python-level backtrace of the " "current thread." msgstr "" +"``py-bt`` コマンドは現在のスレッドの Python レベルのバックトレースを表示しよ" +"うとします。" -#: ../../howto/gdb_helpers.rst:322 msgid "" "(gdb) py-bt\n" "#8 (unable to read python frame information)\n" @@ -569,25 +733,59 @@ msgid "" "0xb771b7f4>)\n" " main.start_game()" msgstr "" +"(gdb) py-bt\n" +"#8 (unable to read python frame information)\n" +"#11 Frame 0x9aead74, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"dialog_swallower.py, line 48, in run_dialog " +"(self=, main_page=0) " +"at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"game_selector.py, line 201, in run_swallowed_dialog " +"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " +"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " +"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " +"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " +"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " +"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " +"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=)\n" +" main.start_game()" -#: ../../howto/gdb_helpers.rst:336 msgid "" "The frame numbers correspond to those displayed by GDB's standard " "``backtrace`` command." msgstr "" +"フレーム番号は GDB の標準の ``backtrace`` コマンドで表示されるものと対応しま" +"す。" -#: ../../howto/gdb_helpers.rst:340 msgid "``py-print``" -msgstr "" +msgstr "``py-print``" -#: ../../howto/gdb_helpers.rst:342 msgid "" "The ``py-print`` command looks up a Python name and tries to print it. It " "looks in locals within the current thread, then globals, then finally " "builtins::" msgstr "" +"``py-print`` コマンドは Python の名前を検索し、その値を表示しようとします。\n" +"現在のスレッドのローカル変数、グローバル変数、組み込みの名前の順に検索しま" +"す。 ::" -#: ../../howto/gdb_helpers.rst:346 msgid "" "(gdb) py-print self\n" "local 'self' = ,\n" @@ -599,38 +797,51 @@ msgid "" "(gdb) py-print scarlet_pimpernel\n" "'scarlet_pimpernel' not found" msgstr "" +"(gdb) py-print self\n" +"local 'self' = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"(gdb) py-print __name__\n" +"global '__name__' = 'gnome_sudoku.dialog_swallower'\n" +"(gdb) py-print len\n" +"builtin 'len' = \n" +"(gdb) py-print scarlet_pimpernel\n" +"'scarlet_pimpernel' not found" -#: ../../howto/gdb_helpers.rst:356 msgid "" "If the current C frame corresponds to multiple Python frames, ``py-print`` " "only considers the first one." msgstr "" +"現在の C フレームが複数の Python フレームに対応する場合、``py-print`` は最初" +"のものだけを対象にします。" -#: ../../howto/gdb_helpers.rst:360 msgid "``py-locals``" -msgstr "" +msgstr "``py-locals``" -#: ../../howto/gdb_helpers.rst:362 msgid "" "The ``py-locals`` command looks up all Python locals within the current " "Python frame in the selected thread, and prints their representations::" msgstr "" +"``py-locals`` コマンドは、選択中のスレッドの現在の Python フレームにあるすべ" +"てのローカル変数を調べ、それぞれの値の表現を表示します。 ::" -#: ../../howto/gdb_helpers.rst:365 msgid "" "(gdb) py-locals\n" "self = ,\n" "main_page=0) at remote 0x98fa6e4>\n" "d = " msgstr "" +"(gdb) py-locals\n" +"self = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"d = " -#: ../../howto/gdb_helpers.rst:370 msgid "" "If the current C frame corresponds to multiple Python frames, locals from " "all of them will be shown::" msgstr "" +"現在の C フレームが複数の Python フレームに対応する場合、すべてのフレームの" +"ローカル変数が表示されます。 ::" -#: ../../howto/gdb_helpers.rst:373 msgid "" "(gdb) py-locals\n" "Locals for recursive_function\n" @@ -647,19 +858,33 @@ msgid "" "n = 5\n" "Locals for " msgstr "" +"(gdb) py-locals\n" +"Locals for recursive_function\n" +"n = 0\n" +"Locals for recursive_function\n" +"n = 1\n" +"Locals for recursive_function\n" +"n = 2\n" +"Locals for recursive_function\n" +"n = 3\n" +"Locals for recursive_function\n" +"n = 4\n" +"Locals for recursive_function\n" +"n = 5\n" +"Locals for " -#: ../../howto/gdb_helpers.rst:390 msgid "Use with GDB commands" -msgstr "" +msgstr "GDB コマンドとの併用" -#: ../../howto/gdb_helpers.rst:392 msgid "" "The extension commands complement GDB's built-in commands. For example, you " "can use a frame numbers shown by ``py-bt`` with the ``frame`` command to go " "a specific frame within the selected thread, like this::" msgstr "" +"拡張のコマンドは GDB 組み込みのコマンドを補完します。\n" +"例えば、``py-bt`` が表示するフレーム番号を ``frame`` コマンドに渡すと、選択中" +"のスレッドの特定のフレームに移動できます。 ::" -#: ../../howto/gdb_helpers.rst:396 msgid "" "(gdb) py-bt\n" "(output snipped)\n" @@ -682,14 +907,34 @@ msgid "" "1547 with test_support.temp_cwd(TESTCWD, quiet=True):\n" ">1548 main()" msgstr "" +"(gdb) py-bt\n" +"(output snipped)\n" +"#68 Frame 0xaa4560, for file Lib/test/regrtest.py, line 1548, in " +"()\n" +" main()\n" +"(gdb) frame 68\n" +"#68 0x00000000004cd1e6 in PyEval_EvalFrameEx (f=Frame 0xaa4560, for file Lib/" +"test/regrtest.py, line 1548, in (), throwflag=0) at Python/ceval." +"c:2665\n" +"2665 x = call_function(&sp, oparg);\n" +"(gdb) py-list\n" +"1543 # Run the tests in a context manager that temporary changes the " +"CWD to a\n" +"1544 # temporary and writable directory. If it's not possible to " +"create or\n" +"1545 # change the CWD, the original CWD will be used. The original " +"CWD is\n" +"1546 # available from test_support.SAVEDCWD.\n" +"1547 with test_support.temp_cwd(TESTCWD, quiet=True):\n" +">1548 main()" -#: ../../howto/gdb_helpers.rst:411 msgid "" "The ``info threads`` command will give you a list of the threads within the " "process, and you can use the ``thread`` command to select a different one::" msgstr "" +"``info threads`` コマンドはプロセス内のスレッドの一覧を表示します。\n" +"``thread`` コマンドを使うと別のスレッドを選択できます。 ::" -#: ../../howto/gdb_helpers.rst:414 msgid "" "(gdb) info threads\n" " 105 Thread 0x7fffefa18710 (LWP 10260) sem_wait () at ../nptl/sysdeps/unix/" @@ -699,15 +944,24 @@ msgid "" "* 1 Thread 0x7ffff7fe2700 (LWP 10145) 0x00000038e46d73e3 in select () at ../" "sysdeps/unix/syscall-template.S:82" msgstr "" +"(gdb) info threads\n" +" 105 Thread 0x7fffefa18710 (LWP 10260) sem_wait () at ../nptl/sysdeps/unix/" +"sysv/linux/x86_64/sem_wait.S:86\n" +" 104 Thread 0x7fffdf5fe710 (LWP 10259) sem_wait () at ../nptl/sysdeps/unix/" +"sysv/linux/x86_64/sem_wait.S:86\n" +"* 1 Thread 0x7ffff7fe2700 (LWP 10145) 0x00000038e46d73e3 in select () at ../" +"sysdeps/unix/syscall-template.S:82" -#: ../../howto/gdb_helpers.rst:419 msgid "" "You can use ``thread apply all COMMAND`` or (``t a a COMMAND`` for short) to " "run a command on all threads. With ``py-bt``, this lets you see what every " "thread is doing at the Python level::" msgstr "" +"``thread apply all COMMAND`` (省略形は ``t a a COMMAND``) を使うと、すべての" +"スレッドでコマンドを実行できます。\n" +"``py-bt`` と組み合わせると、各スレッドが Python レベルで何を実行しているか確" +"認できます。 ::" -#: ../../howto/gdb_helpers.rst:423 msgid "" "(gdb) t a a py-bt\n" "\n" @@ -787,3 +1041,80 @@ msgid "" ", , _RLock__count=1) at remote " +"0xd7ff40>, count_owner=(1, 140737213728528), count=1, " +"owner=140737213728528)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffac001640, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 269, in wait " +"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " +"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " +"_release_save=, release=, _acquire_restore=, " +"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " +"timeout=None, waiter=, saved_state=(1, " +"140737213728528))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffb8001a10, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffb8001c40, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 37, in task (tid=140737213728528)\n" +" f()\n" +"\n" +"Thread 104 (Thread 0x7fffdf5fe710 (LWP 10259)):\n" +"#5 Frame 0x7fffe4001580, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 155, in _acquire_restore " +"(self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, " +"_RLock__block=, _RLock__count=1) at remote " +"0xd7ff40>, count_owner=(1, 140736940992272), count=1, " +"owner=140736940992272)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffc8002090, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 269, in wait " +"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " +"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " +"_release_save=, release=, _acquire_restore=, " +"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " +"timeout=None, waiter=, saved_state=(1, " +"140736940992272))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffac001c90, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffac0011c0, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 37, in task (tid=140736940992272)\n" +" f()\n" +"\n" +"Thread 1 (Thread 0x7ffff7fe2700 (LWP 10145)):\n" +"#5 Frame 0xcb5380, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 16, in _wait ()\n" +" time.sleep(0.01)\n" +"#8 Frame 0x7fffd00024a0, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 378, in _check_notify " +"(self=, skipped=[], _mirrorOutput=False, testsRun=39, " +"buffer=False, _original_stderr=, " +"_stdout_buffer=, " +"_stderr_buffer=, " +"_moduleSetUpFailed=False, expectedFailures=[], errors=[], " +"_previousTestClass=, unexpectedSuccesses=[], " +"failures=[], shouldStop=False, failfast=False) at remote 0xc185a0>, " +"_threads=(0,), _後片付けs=[], _type_equality_funcs={: , : " +", : " +", : " +", `:" msgstr "" +"続いて :option:`--with-dtrace オプションで CPython を構成 <--with-dtrace>` す" +"る必要があります:" -#: ../../howto/instrumentation.rst:49 msgid "checking for --with-dtrace... yes" -msgstr "" +msgstr "checking for --with-dtrace... yes" -#: ../../howto/instrumentation.rst:53 msgid "" "On macOS, you can list available DTrace probes by running a Python process " "in the background and listing all probes made available by the Python " "provider::" msgstr "" +"macOS では Python プロセスをバックグラウンドで実行し、Python プロバイダが提供" +"するすべてのプローブを列挙すると、利用可能な DTrace プローブを確認できま" +"す。 ::" -#: ../../howto/instrumentation.rst:57 msgid "" "$ python3.6 -q &\n" "$ sudo dtrace -l -P python$! # or: dtrace -l -m python3.6\n" @@ -141,37 +140,60 @@ msgid "" "29570 python18035 python3.6 _PyEval_EvalFrameDefault line\n" "29571 python18035 python3.6 maybe_dtrace_line line" msgstr "" +"$ python3.6 -q &\n" +"$ sudo dtrace -l -P python$! # or: dtrace -l -m python3.6\n" +"\n" +" ID PROVIDER MODULE FUNCTION NAME\n" +"29564 python18035 python3.6 _PyEval_EvalFrameDefault " +"function-entry\n" +"29565 python18035 python3.6 dtrace_function_entry " +"function-entry\n" +"29566 python18035 python3.6 _PyEval_EvalFrameDefault " +"function-return\n" +"29567 python18035 python3.6 dtrace_function_return " +"function-return\n" +"29568 python18035 python3.6 collect gc-" +"done\n" +"29569 python18035 python3.6 collect gc-" +"start\n" +"29570 python18035 python3.6 _PyEval_EvalFrameDefault line\n" +"29571 python18035 python3.6 maybe_dtrace_line line" -#: ../../howto/instrumentation.rst:70 msgid "" "On Linux, you can verify if the SystemTap static markers are present in the " "built binary by seeing if it contains a \".note.stapsdt\" section." msgstr "" +"Linux では、ビルドしたバイナリに \".note.stapsdt\" セクションが含まれているか" +"調べると、SystemTap の静的マーカーの有無を確認できます。" -#: ../../howto/instrumentation.rst:75 msgid "" "$ readelf -S ./python | grep .note.stapsdt\n" "[30] .note.stapsdt NOTE 0000000000000000 00308d78" msgstr "" +"$ readelf -S ./python | grep .note.stapsdt\n" +"[30] .note.stapsdt NOTE 0000000000000000 00308d78" -#: ../../howto/instrumentation.rst:78 msgid "" "If you've built Python as a shared library (with the :option:`--enable-" "shared` configure option), you need to look instead within the shared " "library. For example::" msgstr "" +"Python を共有ライブラリとしてビルドした場合 (configure オプション :option:`--" +"enable-shared` を指定した場合) は、共有ライブラリの中を調べる必要がありま" +"す。\n" +"例えば次のようにします。 ::" -#: ../../howto/instrumentation.rst:82 msgid "" "$ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt\n" "[29] .note.stapsdt NOTE 0000000000000000 00365b68" msgstr "" +"$ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt\n" +"[29] .note.stapsdt NOTE 0000000000000000 00365b68" #: ../../howto/instrumentation.rst:85 msgid "Sufficiently modern readelf can print the metadata::" msgstr "十分に新しい readelf ではメタデータを出力できます::" -#: ../../howto/instrumentation.rst:87 msgid "" "$ readelf -n ./python\n" "\n" @@ -218,27 +240,75 @@ msgid "" "0x00000000008d6bea\n" " Arguments: 8@%rbp 8@%r12 -4@%eax" msgstr "" +"$ readelf -n ./python\n" +"\n" +"Displaying notes found at file offset 0x00000254 with length 0x00000020:\n" +" Owner Data size Description\n" +" GNU 0x00000010 NT_GNU_ABI_TAG (ABI version " +"tag)\n" +" OS: Linux, ABI: 2.6.32\n" +"\n" +"Displaying notes found at file offset 0x00000274 with length 0x00000024:\n" +" Owner Data size Description\n" +" GNU 0x00000014 NT_GNU_BUILD_ID (unique build " +"ID bitstring)\n" +" Build ID: df924a2b08a7e89f6e11251d4602022977af2670\n" +"\n" +"Displaying notes found at file offset 0x002d6c30 with length 0x00000144:\n" +" Owner Data size Description\n" +" stapsdt 0x00000031 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: gc__start\n" +" Location: 0x00000000004371c3, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bf6\n" +" Arguments: -4@%ebx\n" +" stapsdt 0x00000030 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: gc__done\n" +" Location: 0x00000000004374e1, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bf8\n" +" Arguments: -8@%rax\n" +" stapsdt 0x00000045 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: function__entry\n" +" Location: 0x000000000053db6c, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6be8\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax\n" +" stapsdt 0x00000046 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: function__return\n" +" Location: 0x000000000053dba8, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bea\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax" -#: ../../howto/instrumentation.rst:122 msgid "" "The above metadata contains information for SystemTap describing how it can " "patch strategically placed machine code instructions to enable the tracing " "hooks used by a SystemTap script." msgstr "" +"上記のメタデータには、SystemTap が適所に配置された機械語命令を書き換え、" +"SystemTap スクリプトで使うトレースフックを有効にするための情報が含まれていま" +"す。" #: ../../howto/instrumentation.rst:128 msgid "Static DTrace probes" msgstr "静的 DTrace プローブ" -#: ../../howto/instrumentation.rst:130 msgid "" "The following example DTrace script can be used to show the call/return " "hierarchy of a Python script, only tracing within the invocation of a " "function called \"start\". In other words, import-time function invocations " "are not going to be listed:" msgstr "" +"次の DTrace スクリプトの例は、Python スクリプトの呼び出しと復帰の階層を表示し" +"ます。\n" +"\"start\" という関数の呼び出し中だけをトレースするため、インポート時の関数呼" +"び出しは表示されません:" -#: ../../howto/instrumentation.rst:135 msgid "" "self int indent;\n" "\n" @@ -274,20 +344,51 @@ msgid "" " self->trace = 0;\n" "}" msgstr "" +"self int indent;\n" +"\n" +"python$target:::function-entry\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 1;\n" +"}\n" +"\n" +"python$target:::function-entry\n" +"/self->trace/\n" +"{\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " +"arg2);\n" +" self->indent++;\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/self->trace/\n" +"{\n" +" self->indent--;\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " +"arg2);\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 0;\n" +"}" #: ../../howto/instrumentation.rst:169 ../../howto/instrumentation.rst:227 msgid "It can be invoked like this::" msgstr "この例は次のように実行できます::" -#: ../../howto/instrumentation.rst:171 msgid "$ sudo dtrace -q -s call_stack.d -c \"python3.6 script.py\"" -msgstr "" +msgstr "$ sudo dtrace -q -s call_stack.d -c \"python3.6 script.py\"" #: ../../howto/instrumentation.rst:173 ../../howto/instrumentation.rst:233 msgid "The output looks like this:" msgstr "出力はこのようになります:" -#: ../../howto/instrumentation.rst:175 msgid "" "156641360502280 function-entry:call_stack.py:start:23\n" "156641360518804 function-entry: call_stack.py:function_1:1\n" @@ -308,17 +409,36 @@ msgid "" "156641360732567 function-return: call_stack.py:function_5:21\n" "156641360747370 function-return:call_stack.py:start:28" msgstr "" +"156641360502280 function-entry:call_stack.py:start:23\n" +"156641360518804 function-entry: call_stack.py:function_1:1\n" +"156641360532797 function-entry: call_stack.py:function_3:9\n" +"156641360546807 function-return: call_stack.py:function_3:10\n" +"156641360563367 function-return: call_stack.py:function_1:2\n" +"156641360578365 function-entry: call_stack.py:function_2:5\n" +"156641360591757 function-entry: call_stack.py:function_1:1\n" +"156641360605556 function-entry: call_stack.py:function_3:9\n" +"156641360617482 function-return: call_stack.py:function_3:10\n" +"156641360629814 function-return: call_stack.py:function_1:2\n" +"156641360642285 function-return: call_stack.py:function_2:6\n" +"156641360656770 function-entry: call_stack.py:function_3:9\n" +"156641360669707 function-return: call_stack.py:function_3:10\n" +"156641360687853 function-entry: call_stack.py:function_4:13\n" +"156641360700719 function-return: call_stack.py:function_4:14\n" +"156641360719640 function-entry: call_stack.py:function_5:18\n" +"156641360732567 function-return: call_stack.py:function_5:21\n" +"156641360747370 function-return:call_stack.py:start:28" #: ../../howto/instrumentation.rst:198 msgid "Static SystemTap markers" msgstr "静的 SystemTap マーカー" -#: ../../howto/instrumentation.rst:200 msgid "" "The low-level way to use the SystemTap integration is to use the static " "markers directly. This requires you to explicitly state the binary file " "containing them." msgstr "" +"SystemTap との連携を低レベルで行う方法は、静的マーカーを直接使うことです。\n" +"この場合、マーカーを含むバイナリファイルを明示する必要があります。" #: ../../howto/instrumentation.rst:204 msgid "" @@ -328,7 +448,6 @@ msgstr "" "例えば、この SystemTap スクリプトは Python の呼び出し/返却 (call/return) 階層" "を表示するのに使えます:" -#: ../../howto/instrumentation.rst:207 msgid "" "probe process(\"python\").mark(\"function__entry\") {\n" " filename = user_string($arg1);\n" @@ -348,15 +467,33 @@ msgid "" " thread_indent(-1), funcname, filename, lineno);\n" "}" msgstr "" +"probe process(\"python\").mark(\"function__entry\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s => %s in %s:%d\\\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe process(\"python\").mark(\"function__return\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s <= %s in %s:%d\\\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" -#: ../../howto/instrumentation.rst:229 msgid "" "$ stap \\\n" " show-call-hierarchy.stp \\\n" " -c \"./python test.py\"" msgstr "" +"$ stap \\\n" +" show-call-hierarchy.stp \\\n" +" -c \"./python test.py\"" -#: ../../howto/instrumentation.rst:235 msgid "" "11408 python(8274): => __contains__ in Lib/_abcoll.py:362\n" "11414 python(8274): => __getitem__ in Lib/os.py:425\n" @@ -365,6 +502,12 @@ msgid "" "11428 python(8274): <= __getitem__ in Lib/os.py:426\n" "11433 python(8274): <= __contains__ in Lib/_abcoll.py:366" msgstr "" +"11408 python(8274): => __contains__ in Lib/_abcoll.py:362\n" +"11414 python(8274): => __getitem__ in Lib/os.py:425\n" +"11418 python(8274): => encode in Lib/os.py:490\n" +"11424 python(8274): <= encode in Lib/os.py:493\n" +"11428 python(8274): <= __getitem__ in Lib/os.py:426\n" +"11433 python(8274): <= __contains__ in Lib/_abcoll.py:366" #: ../../howto/instrumentation.rst:244 msgid "where the columns are:" @@ -389,30 +532,31 @@ msgstr "" "そして、残りの部分はスクリプトが実行していた呼び出し/返却階層を表示していま" "す。" -#: ../../howto/instrumentation.rst:252 msgid "" "For a :option:`--enable-shared` build of CPython, the markers are contained " "within the libpython shared library, and the probe's dotted path needs to " "reflect this. For example, this line from the above example:" msgstr "" +":option:`--enable-shared` を指定した CPython のビルドでは、マーカーは " +"libpython 共有ライブラリに含まれるため、プローブのドットで区切ったパスにもそ" +"れを反映する必要があります。\n" +"例えば、上の例の次の行は:" -#: ../../howto/instrumentation.rst:256 msgid "probe process(\"python\").mark(\"function__entry\") {" -msgstr "" +msgstr "probe process(\"python\").mark(\"function__entry\") {" -#: ../../howto/instrumentation.rst:260 msgid "should instead read:" -msgstr "" +msgstr "次のように書き換えます:" -#: ../../howto/instrumentation.rst:262 msgid "" "probe process(\"python\").library(\"libpython3.6dm.so.1.0\")." "mark(\"function__entry\") {" msgstr "" +"probe process(\"python\").library(\"libpython3.6dm.so.1.0\")." +"mark(\"function__entry\") {" -#: ../../howto/instrumentation.rst:266 msgid "(assuming a :ref:`debug build ` of CPython 3.6)" -msgstr "" +msgstr "(CPython 3.6 の :ref:`デバッグビルド ` を想定しています)" #: ../../howto/instrumentation.rst:272 msgid "Available static markers" @@ -426,14 +570,13 @@ msgstr "" "このマーカーは Python の関数の実行が開始されたことを示しています。\n" "このマーカーは、ピュア Python (バイトコード) の関数でしか起動されません。" -#: ../../howto/instrumentation.rst:279 msgid "" "The filename, function name, and line number are provided back to the " "tracing script as positional arguments, which must be accessed using " "``$arg1``, ``$arg2``, ``$arg3``:" msgstr "" -"トレーススクリプトには位置引数として、ファイル名、関数名、行番号が渡され、必" -"ず ``$arg1``, ``$arg2``, ``$arg3`` で渡されます:" +"ファイル名、関数名、行番号が位置引数としてトレーススクリプトに渡されます。\n" +"それぞれ ``$arg1``、``$arg2``、``$arg3`` を使ってアクセスしてください:" #: ../../howto/instrumentation.rst:283 msgid "" @@ -455,16 +598,18 @@ msgstr "" msgid "``$arg3`` : ``int`` line number" msgstr "``$arg3`` : ``int`` 行番号" -#: ../../howto/instrumentation.rst:292 msgid "" "This marker is the converse of :c:func:`!function__entry`, and indicates " "that execution of a Python function has ended (either via ``return``, or via " "an exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" +"このマーカーは :c:func:`!function__entry` と対をなし、Python 関数の実行が終了" +"したことを示します (``return`` による終了と例外による終了の両方を含みま" +"す)。\n" +"ピュア Python (バイトコード) の関数でのみ発火します。" -#: ../../howto/instrumentation.rst:296 msgid "The arguments are the same as for :c:func:`!function__entry`" -msgstr "" +msgstr "引数は :c:func:`!function__entry` と同じです。" #: ../../howto/instrumentation.rst:300 msgid "" @@ -476,157 +621,152 @@ msgstr "" "これは Python プロファイラによる行ごとのトレースと同等です。\n" "このマーカーは C 関数の内部では起動されません。" -#: ../../howto/instrumentation.rst:304 msgid "The arguments are the same as for :c:func:`!function__entry`." -msgstr "" +msgstr "引数は :c:func:`!function__entry` と同じです。" -#: ../../howto/instrumentation.rst:308 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " "``arg0`` is the generation to scan, like :func:`gc.collect`." msgstr "" +"Python インタプリタがガベージコレクションのサイクルを開始したときに発火しま" +"す。\n" +"``arg0`` は :func:`gc.collect` と同様に、走査する世代を指定します。" -#: ../../howto/instrumentation.rst:313 msgid "" "Fires when the Python interpreter finishes a garbage collection cycle. " "``arg0`` is the number of collected objects." msgstr "" -"Python インタプリタによる循環参照のガベージコレクションが完了したときに発火し" -"ます。\n" +"Python インタプリタがガベージコレクションのサイクルを終了したときに発火しま" +"す。\n" "``arg0`` は回収したオブジェクトの数です。" -#: ../../howto/instrumentation.rst:318 msgid "" "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " "is the module name." msgstr "" +":mod:`importlib` がモジュールの検索と読み込みを試みる前に発火します。\n" +"``arg0`` はモジュール名です。" -#: ../../howto/instrumentation.rst:325 msgid "" "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " "the module name, ``arg1`` indicates if module was successfully loaded." msgstr "" +":mod:`importlib` の find_and_load 関数が呼び出された後に発火します。\n" +"``arg0`` はモジュール名で、``arg1`` はモジュールの読み込みが成功したかどうか" +"を示します。" -#: ../../howto/instrumentation.rst:334 msgid "" "Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is " "the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " "tuple object." msgstr "" +":func:`sys.audit` または :c:func:`PySys_Audit` が呼び出されたときに発火しま" +"す。\n" +"``arg0`` は C 文字列のイベント名、``arg1`` はタプルオブジェクトへの :c:type:" +"`PyObject` ポインタです。" -#: ../../howto/instrumentation.rst:342 msgid "C Entry Points" -msgstr "" +msgstr "C エントリーポイント" -#: ../../howto/instrumentation.rst:344 msgid "" "To simplify triggering of DTrace markers, Python's C API comes with a number " "of helper functions that mirror each static marker. On builds of Python " "without DTrace enabled, these do nothing." msgstr "" +"DTrace マーカーを簡単に発火させられるように、Python の C API は各静的マーカー" +"に対応するヘルパー関数を提供しています。\n" +"DTrace を有効にせずにビルドした Python では、これらの関数は何もしません。" -#: ../../howto/instrumentation.rst:348 msgid "" "In general, it is not necessary to call these yourself, as Python will do it " "for you." -msgstr "" +msgstr "通常は Python が呼び出すため、自分で呼び出す必要はありません。" -#: ../../howto/instrumentation.rst:355 msgid "C API Function" -msgstr "" +msgstr "C API 関数" -#: ../../howto/instrumentation.rst:356 msgid "Static Marker" -msgstr "" +msgstr "静的マーカー" #: ../../howto/instrumentation.rst:357 msgid "Notes" msgstr "注釈" -#: ../../howto/instrumentation.rst:359 msgid ":c:func:`!line`" -msgstr "" +msgstr ":c:func:`!line`" -#: ../../howto/instrumentation.rst:362 msgid ":c:func:`!function__entry`" -msgstr "" +msgstr ":c:func:`!function__entry`" -#: ../../howto/instrumentation.rst:365 msgid ":c:func:`!function__return`" -msgstr "" +msgstr ":c:func:`!function__return`" -#: ../../howto/instrumentation.rst:368 msgid ":c:func:`!gc__start`" -msgstr "" +msgstr ":c:func:`!gc__start`" -#: ../../howto/instrumentation.rst:371 msgid ":c:func:`!gc__done`" -msgstr "" +msgstr ":c:func:`!gc__done`" -#: ../../howto/instrumentation.rst:374 msgid ":c:func:`!instance__new__start`" -msgstr "" +msgstr ":c:func:`!instance__new__start`" -#: ../../howto/instrumentation.rst:375 ../../howto/instrumentation.rst:378 -#: ../../howto/instrumentation.rst:381 ../../howto/instrumentation.rst:384 msgid "Not used by Python" -msgstr "" +msgstr "Python では未使用" -#: ../../howto/instrumentation.rst:377 msgid ":c:func:`!instance__new__done`" -msgstr "" +msgstr ":c:func:`!instance__new__done`" -#: ../../howto/instrumentation.rst:380 msgid ":c:func:`!instance__delete__start`" -msgstr "" +msgstr ":c:func:`!instance__delete__start`" -#: ../../howto/instrumentation.rst:383 msgid ":c:func:`!instance__delete__done`" -msgstr "" +msgstr ":c:func:`!instance__delete__done`" -#: ../../howto/instrumentation.rst:386 msgid ":c:func:`!import__find__load__start`" -msgstr "" +msgstr ":c:func:`!import__find__load__start`" -#: ../../howto/instrumentation.rst:389 msgid ":c:func:`!import__find__load__done`" -msgstr "" +msgstr ":c:func:`!import__find__load__done`" -#: ../../howto/instrumentation.rst:392 msgid ":c:func:`!audit`" -msgstr "" +msgstr ":c:func:`!audit`" -#: ../../howto/instrumentation.rst:397 msgid "C Probing Checks" -msgstr "" +msgstr "C でのプローブの有効性確認" -#: ../../howto/instrumentation.rst:412 msgid "" "All calls to ``PyDTrace`` functions must be guarded by a call to one of " "these functions. This allows Python to minimize performance impact when " "probing is disabled." msgstr "" +"``PyDTrace`` 関数の呼び出しはすべて、これらの関数のいずれかを呼び出して有効性" +"を確認してから行う必要があります。\n" +"これにより、プローブが無効なときの性能への影響を最小限に抑えられます。" -#: ../../howto/instrumentation.rst:416 msgid "" "On builds without DTrace enabled, these functions do nothing and return " "``0``." msgstr "" +"DTrace を有効にせずにビルドした場合、これらの関数は何もせず ``0`` を返しま" +"す。" #: ../../howto/instrumentation.rst:420 msgid "SystemTap Tapsets" msgstr "SystemTap Tapset" -#: ../../howto/instrumentation.rst:422 msgid "" "The higher-level way to use the SystemTap integration is to use a " "\"tapset\": SystemTap's equivalent of a library, which hides some of the " "lower-level details of the static markers." msgstr "" +"SystemTap との連携を高レベルで行う方法は、\"tapset\" を使うことです。\n" +"これは SystemTap のライブラリに相当し、静的マーカーの低レベルの詳細の一部を隠" +"します。" -#: ../../howto/instrumentation.rst:426 msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "" +"共有ライブラリを使わない CPython のビルドを対象とする tapset ファイルの例を示" +"します:" #: ../../howto/instrumentation.rst:428 msgid "" @@ -651,17 +791,19 @@ msgid "" "}" msgstr "" -#: ../../howto/instrumentation.rst:449 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" "systemtap/tapset``), then these additional probepoints become available:" msgstr "" +"このファイルを SystemTap の tapset ディレクトリ (例えば ``/usr/share/" +"systemtap/tapset``) にインストールすると、次のプローブポイントが利用できます:" -#: ../../howto/instrumentation.rst:455 msgid "" "This probe point indicates that execution of a Python function has begun. It " "is only triggered for pure-Python (bytecode) functions." msgstr "" +"このプローブポイントは Python 関数の実行が開始されたことを示します。\n" +"ピュア Python (バイトコード) の関数でのみ発火します。" #: ../../howto/instrumentation.rst:460 msgid "" @@ -675,14 +817,15 @@ msgstr "" msgid "Examples" msgstr "使用例" -#: ../../howto/instrumentation.rst:468 msgid "" "This SystemTap script uses the tapset above to more cleanly implement the " "example given above of tracing the Python function-call hierarchy, without " "needing to directly name the static markers:" msgstr "" +"次の SystemTap スクリプトは上の tapset を使い、先ほどの Python 関数の呼び出し" +"階層をトレースする例を簡潔に実装しています。\n" +"静的マーカーの名前を直接指定する必要がありません:" -#: ../../howto/instrumentation.rst:472 msgid "" "probe python.function.entry\n" "{\n" @@ -696,15 +839,28 @@ msgid "" " thread_indent(-1), funcname, filename, lineno);\n" "}" msgstr "" +"probe python.function.entry\n" +"{\n" +" printf(\"%s => %s in %s:%d\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe python.function.return\n" +"{\n" +" printf(\"%s <= %s in %s:%d\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" -#: ../../howto/instrumentation.rst:487 msgid "" "The following script uses the tapset above to provide a top-like view of all " "running CPython code, showing the top 20 most frequently entered bytecode " "frames, each second, across the whole system:" msgstr "" +"次のスクリプトは上の tapset を使い、実行中の CPython コード全体を top のよう" +"に表示します。\n" +"システム全体で最も頻繁に実行が開始されたバイトコードフレームの上位 20 件を毎" +"秒表示します:" -#: ../../howto/instrumentation.rst:491 msgid "" "global fn_calls;\n" "\n" @@ -725,3 +881,21 @@ msgid "" " delete fn_calls;\n" "}" msgstr "" +"global fn_calls;\n" +"\n" +"probe python.function.entry\n" +"{\n" +" fn_calls[pid(), filename, funcname, lineno] += 1;\n" +"}\n" +"\n" +"probe timer.ms(1000) {\n" +" printf(\"\\033[2J\\033[1;1H\") /* clear screen \\*/\n" +" printf(\"%6s %80s %6s %30s %6s\\n\",\n" +" \"PID\", \"FILENAME\", \"LINE\", \"FUNCTION\", \"CALLS\")\n" +" foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {\n" +" printf(\"%6d %80s %6d %30s %6d\\n\",\n" +" pid, filename, lineno, funcname,\n" +" fn_calls[pid, filename, funcname, lineno]);\n" +" }\n" +" delete fn_calls;\n" +"}" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index eb673e5d9..0f2afd8e1 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -114,13 +114,16 @@ msgstr "" "アドレスは整数から直接作成することも可能です。32ビットに収まる値はIPv4アドレ" "スであるとみなされます::" -#: ../../howto/ipaddress.rst:61 msgid "" ">>> ipaddress.ip_address(3221225985)\n" "IPv4Address('192.0.2.1')\n" ">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n" "IPv6Address('2001:db8::1')" msgstr "" +">>> ipaddress.ip_address(3221225985)\n" +"IPv4Address('192.0.2.1')\n" +">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n" +"IPv6Address('2001:db8::1')" #: ../../howto/ipaddress.rst:66 msgid "" @@ -131,7 +134,6 @@ msgstr "" "IPv4またはIPv6アドレスの使用を強制するには、適切なクラスを直接呼び出す必要が" "あります。これは特にIPv6アドレスを小さな整数で作成する場合に役立ちます::" -#: ../../howto/ipaddress.rst:70 msgid "" ">>> ipaddress.ip_address(1)\n" "IPv4Address('0.0.0.1')\n" @@ -140,12 +142,17 @@ msgid "" ">>> ipaddress.IPv6Address(1)\n" "IPv6Address('::1')" msgstr "" +">>> ipaddress.ip_address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv4Address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv6Address(1)\n" +"IPv6Address('::1')" #: ../../howto/ipaddress.rst:79 msgid "Defining Networks" msgstr "ネットワークを定義する" -#: ../../howto/ipaddress.rst:81 msgid "" "Host addresses are usually grouped together into IP networks, so :mod:" "`ipaddress` provides a way to create, inspect and manipulate network " @@ -156,29 +163,34 @@ msgid "" "whether or not an address is part of the network and the network address " "defines the expected value of those bits." msgstr "" -"ホストアドレスは通常IPネットワークへ統合され、 :mod:`ipaddress` はネットワー" -"ク定義の作成、検査、操作の手段を提供します。IPネットワークオブジェクトはネッ" -"トワークの一部であるホストアドレスの範囲を定義する文字列から生成されます。こ" -"の情報の最も単純な形式は「ネットワークアドレス/ネットワークプレフィックス」の" -"ペアであり、プレフィックスは先頭のビット数として定義され、アドレスがネット" -"ワークの一部であるかどうか、それらのビットに期待される値がネットワークアドレ" -"スに定義されているかを判断するために比較されます。" +"ホストアドレスは通常 IP ネットワークにまとめられます。\n" +"そのため :mod:`ipaddress` はネットワーク定義を作成、検査、操作する方法を提供" +"しています。\n" +"IP ネットワークオブジェクトは、そのネットワークに属するホストアドレスの範囲を" +"定義する文字列から作成します。\n" +"最も単純な形式は「ネットワークアドレス/ネットワークプレフィックス」の組で" +"す。\n" +"プレフィックスは、アドレスがネットワークに属するかを判定するために比較する、" +"先頭からのビット数を定義します。\n" +"ネットワークアドレスは、そのビット列に期待する値を定義します。" -#: ../../howto/ipaddress.rst:90 msgid "" "As for addresses, a factory function is provided that determines the correct " "IP version automatically::" msgstr "" -"アドレスについては、正しいIPバージョンを自動的に判断するファクトリー関数が提" -"供されます::" +"アドレスと同様に、適切な IP バージョンを自動的に判定するファクトリー関数が用" +"意されています。 ::" -#: ../../howto/ipaddress.rst:93 msgid "" ">>> ipaddress.ip_network('192.0.2.0/24')\n" "IPv4Network('192.0.2.0/24')\n" ">>> ipaddress.ip_network('2001:db8::0/96')\n" "IPv6Network('2001:db8::/96')" msgstr "" +">>> ipaddress.ip_network('192.0.2.0/24')\n" +"IPv4Network('192.0.2.0/24')\n" +">>> ipaddress.ip_network('2001:db8::0/96')\n" +"IPv6Network('2001:db8::/96')" #: ../../howto/ipaddress.rst:98 msgid "" @@ -194,19 +206,17 @@ msgstr "" "トワーク上のネットワークインターフェースを表すのに使用されるため、このような" "定義はインターフェースオブジェクトと呼ばれます。" -#: ../../howto/ipaddress.rst:104 msgid "" "By default, attempting to create a network object with host bits set will " "result in :exc:`ValueError` being raised. To request that the additional " "bits instead be coerced to zero, the flag ``strict=False`` can be passed to " "the constructor::" msgstr "" -"デフォルトでは、ホストビットセットの指定でネットワークオブジェクトを作成しよ" -"うとすると :exc:`ValueError` が発生する結果となります。 ``strict=False`` フラ" -"グをコンストラクタに渡すと、追加分のビットをゼロとして強制的に処理するように" -"要求できます::" +"デフォルトでは、ホスト部のビットに 1 が含まれるネットワークオブジェクトを作成" +"しようとすると :exc:`ValueError` が送出されます。\n" +"コンストラクタに ``strict=False`` を渡すと、代わりにそのビットをゼロにできま" +"す。 ::" -#: ../../howto/ipaddress.rst:109 msgid "" ">>> ipaddress.ip_network('192.0.2.1/24')\n" "Traceback (most recent call last):\n" @@ -215,6 +225,12 @@ msgid "" ">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n" "IPv4Network('192.0.2.0/24')" msgstr "" +">>> ipaddress.ip_network('192.0.2.1/24')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: 192.0.2.1/24 has host bits set\n" +">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n" +"IPv4Network('192.0.2.0/24')" #: ../../howto/ipaddress.rst:116 msgid "" @@ -228,21 +244,23 @@ msgstr "" "特定できる単一のアドレスのみを含むものとして処理され、ネットワークプレフィッ" "クスはネットワークアドレスの全体を含みます::" -#: ../../howto/ipaddress.rst:121 msgid "" ">>> ipaddress.ip_network(3221225984)\n" "IPv4Network('192.0.2.0/32')\n" ">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n" "IPv6Network('2001:db8::/128')" msgstr "" +">>> ipaddress.ip_network(3221225984)\n" +"IPv4Network('192.0.2.0/32')\n" +">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n" +"IPv6Network('2001:db8::/128')" -#: ../../howto/ipaddress.rst:126 msgid "" "As with addresses, creation of a particular kind of network can be forced by " "calling the class constructor directly instead of using the factory function." msgstr "" -"アドレスについては、ファクトリー関数を呼ぶ代わりにクラスコンストラクタを直接" -"呼ぶことで、作成対象のネットワークを特定の種類に強制することができます。" +"アドレスと同様に、ファクトリー関数の代わりにクラスのコンストラクタを直接呼び" +"出すと、作成するネットワークの種類を指定できます。" #: ../../howto/ipaddress.rst:132 msgid "Host Interfaces" @@ -277,9 +295,8 @@ msgstr "" "整数入力は(ネットワークと同様に)受け入れられ、適切なコンストラクタを直接呼び" "出すことで特定のIPバージョンの使用を強制できます。" -#: ../../howto/ipaddress.rst:154 msgid "Inspecting Address/Network/Interface Objects" -msgstr "アドレス/ネットワーク/インターフェースオブジェクト" +msgstr "アドレス/ネットワーク/インターフェースオブジェクトの情報を調べる" #: ../../howto/ipaddress.rst:156 msgid "" @@ -295,7 +312,6 @@ msgstr "" msgid "Extracting the IP version::" msgstr "IPバージョンを抽出する::" -#: ../../howto/ipaddress.rst:162 msgid "" ">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" ">>> addr6 = ipaddress.ip_address('2001:db8::1')\n" @@ -304,12 +320,17 @@ msgid "" ">>> addr4.version\n" "4" msgstr "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr6 = ipaddress.ip_address('2001:db8::1')\n" +">>> addr6.version\n" +"6\n" +">>> addr4.version\n" +"4" #: ../../howto/ipaddress.rst:169 msgid "Obtaining the network from an interface::" msgstr "インターフェースからネットワークを取得する::" -#: ../../howto/ipaddress.rst:171 msgid "" ">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n" ">>> host4.network\n" @@ -318,12 +339,17 @@ msgid "" ">>> host6.network\n" "IPv6Network('2001:db8::/96')" msgstr "" +">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n" +">>> host4.network\n" +"IPv4Network('192.0.2.0/24')\n" +">>> host6 = ipaddress.ip_interface('2001:db8::1/96')\n" +">>> host6.network\n" +"IPv6Network('2001:db8::/96')" #: ../../howto/ipaddress.rst:178 msgid "Finding out how many individual addresses are in a network::" msgstr "個別なアドレスがいくつネットワークに存在するかを調べる::" -#: ../../howto/ipaddress.rst:180 msgid "" ">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" ">>> net4.num_addresses\n" @@ -332,12 +358,17 @@ msgid "" ">>> net6.num_addresses\n" "4294967296" msgstr "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> net4.num_addresses\n" +"256\n" +">>> net6 = ipaddress.ip_network('2001:db8::0/96')\n" +">>> net6.num_addresses\n" +"4294967296" #: ../../howto/ipaddress.rst:187 msgid "Iterating through the \"usable\" addresses on a network::" msgstr "「使用可能」なネットワーク上のアドレスを順番にたどる::" -#: ../../howto/ipaddress.rst:189 msgid "" ">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" ">>> for x in net4.hosts():\n" @@ -351,20 +382,29 @@ msgid "" "192.0.2.253\n" "192.0.2.254" msgstr "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> for x in net4.hosts():\n" +"... print(x)\n" +"192.0.2.1\n" +"192.0.2.2\n" +"192.0.2.3\n" +"192.0.2.4\n" +"...\n" +"192.0.2.252\n" +"192.0.2.253\n" +"192.0.2.254" -#: ../../howto/ipaddress.rst:202 msgid "" "Obtaining the netmask (i.e. set bits corresponding to the network prefix) or " "the hostmask (any bits that are not part of the netmask):" msgstr "" -"ネットマスクを取得(例: ネットワークプレフィックスに応じてビットを設定)したり" -"ホストマスク(ネットマスクの一部ではない任意のビット)を取得する:" +"ネットマスク (ネットワークプレフィックスに対応するビットが 1 のマスク) やホス" +"トマスク (ネットマスクに含まれないビットが 1 のマスク) を取得する:" #: ../../howto/ipaddress.rst:217 msgid "Exploding or compressing the address::" msgstr "アドレスを展開したり圧縮したりする::" -#: ../../howto/ipaddress.rst:219 msgid "" ">>> addr6.exploded\n" "'2001:0db8:0000:0000:0000:0000:0000:0001'\n" @@ -375,6 +415,14 @@ msgid "" ">>> net6.compressed\n" "'2001:db8::/96'" msgstr "" +">>> addr6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0001'\n" +">>> addr6.compressed\n" +"'2001:db8::1'\n" +">>> net6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0000/96'\n" +">>> net6.compressed\n" +"'2001:db8::/96'" #: ../../howto/ipaddress.rst:228 msgid "" @@ -400,7 +448,6 @@ msgstr "" "ネットワークをリストとして扱うと便利な場合があります。これは、ネットワークを" "次のようにインデックス付けすることが可能なことを意味します::" -#: ../../howto/ipaddress.rst:240 msgid "" ">>> net4[1]\n" "IPv4Address('192.0.2.1')\n" @@ -411,6 +458,14 @@ msgid "" ">>> net6[-1]\n" "IPv6Address('2001:db8::ffff:ffff')" msgstr "" +">>> net4[1]\n" +"IPv4Address('192.0.2.1')\n" +">>> net4[-1]\n" +"IPv4Address('192.0.2.255')\n" +">>> net6[1]\n" +"IPv6Address('2001:db8::1')\n" +">>> net6[-1]\n" +"IPv6Address('2001:db8::ffff:ffff')" #: ../../howto/ipaddress.rst:250 msgid "" @@ -420,11 +475,12 @@ msgstr "" "以下のようなリストのメンバーシップの判定用文法が使用可能なように、ネットワー" "クオブジェクト自身が適応します::" -#: ../../howto/ipaddress.rst:253 msgid "" "if address in network:\n" " # do something" msgstr "" +"if address in network:\n" +" # 何らかの処理をする" #: ../../howto/ipaddress.rst:256 msgid "Containment testing is done efficiently based on the network prefix::" @@ -432,7 +488,6 @@ msgstr "" "ネットワークプレフィックスに基づき、所属しているかどうかの判定が効果的にでき" "ます::" -#: ../../howto/ipaddress.rst:258 msgid "" ">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" ">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n" @@ -440,24 +495,29 @@ msgid "" ">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n" "False" msgstr "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n" +"True\n" +">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n" +"False" #: ../../howto/ipaddress.rst:266 msgid "Comparisons" msgstr "比較" -#: ../../howto/ipaddress.rst:268 msgid "" ":mod:`ipaddress` provides some simple, hopefully intuitive ways to compare " "objects, where it makes sense::" msgstr "" -":mod:`ipaddress` はオブジェクトの比較をするための単純で、かつ願わくば直観的な" -"方法を意味が通じるように提供します::" +":mod:`ipaddress` は、比較に意味がある場合にオブジェクトを比較する、単純で直感" +"的な方法を提供しています。 ::" -#: ../../howto/ipaddress.rst:271 msgid "" ">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n" "True" msgstr "" +">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n" +"True" #: ../../howto/ipaddress.rst:274 msgid "" @@ -481,7 +541,6 @@ msgstr "" "らオブジェクトを直接受け付けません。直接渡すのではなく、他のモジュールが受け" "付ける整数や文字列に強制的に変換する必要があります::" -#: ../../howto/ipaddress.rst:285 msgid "" ">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" ">>> str(addr4)\n" @@ -489,12 +548,16 @@ msgid "" ">>> int(addr4)\n" "3221225985" msgstr "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> str(addr4)\n" +"'192.0.2.1'\n" +">>> int(addr4)\n" +"3221225985" #: ../../howto/ipaddress.rst:293 msgid "Getting more detail when instance creation fails" msgstr "インスタンスの生成に失敗した場合にさらに詳細を取得する" -#: ../../howto/ipaddress.rst:295 msgid "" "When creating address/network/interface objects using the version-agnostic " "factory functions, any errors will be reported as :exc:`ValueError` with a " @@ -503,12 +566,13 @@ msgid "" "because it's necessary to know whether the value is *supposed* to be IPv4 or " "IPv6 in order to provide more detail on why it has been rejected." msgstr "" -"上述したバージョンに関知しないファクトリー関数を使用してアドレス/ネットワー" -"ク/インターフェースオブジェクトを作成する場合、渡された値がそのタイプのオブ" -"ジェクトとして認識されなかったと単純に通知する汎用的なメッセージとともに、ど" -"のエラーでも :exc:`ValueError` として報告されます。特定のエラーが提供されない" -"のは、拒否された理由をより詳細に提供するために、値がIPv4またはIPv6である *は" -"ず* かどうかを知る必要があるためです。" +"IP バージョンを自動判定するファクトリー関数でアドレス、ネットワーク、インター" +"フェースのオブジェクトを作成すると、エラーはすべて :exc:`ValueError` として報" +"告されます。\n" +"メッセージは、渡された値をその種類のオブジェクトとして認識できなかったという" +"一般的なものです。\n" +"値が拒否された理由を詳しく説明するには、入力が IPv4 と IPv6 の *どちらを意図" +"しているか* を知る必要があるためです。" #: ../../howto/ipaddress.rst:302 msgid "" @@ -531,7 +595,6 @@ msgstr "" "クラスコンストラクタを直接使用する場合にはこれらのエラーメッセージはさらに非" "常に詳細になっています。例えば::" -#: ../../howto/ipaddress.rst:311 msgid "" ">>> ipaddress.ip_address(\"192.168.0.256\")\n" "Traceback (most recent call last):\n" @@ -552,6 +615,24 @@ msgid "" " ...\n" "ipaddress.NetmaskValueError: '64' is not a valid netmask" msgstr "" +">>> ipaddress.ip_address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.256' does not appear to be an IPv4 or IPv6 address\n" +">>> ipaddress.IPv4Address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.AddressValueError: Octet 256 (> 255) not permitted in " +"'192.168.0.256'\n" +"\n" +">>> ipaddress.ip_network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.1/64' does not appear to be an IPv4 or IPv6 network\n" +">>> ipaddress.IPv4Network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.NetmaskValueError: '64' is not a valid netmask" #: ../../howto/ipaddress.rst:329 msgid "" @@ -563,10 +644,13 @@ msgstr "" "スとして持ち、エラーの特定のタイプに興味がない場合でも、以下のようにコードを" "記述できます::" -#: ../../howto/ipaddress.rst:333 msgid "" "try:\n" " network = ipaddress.IPv4Network(address)\n" "except ValueError:\n" " print('address/netmask is invalid for IPv4:', address)" msgstr "" +"try:\n" +" network = ipaddress.IPv4Network(address)\n" +"except ValueError:\n" +" print('address/netmask is invalid for IPv4:', address)" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 741da489e..6f4f01a1b 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -31,70 +31,85 @@ msgstr "拡張モジュールを分離する" msgid "Abstract" msgstr "概要" -#: ../../howto/isolating-extensions.rst:11 msgid "" "Traditionally, state belonging to Python extension modules was kept in C " "``static`` variables, which have process-wide scope. This document describes " "problems of such per-process state and shows a safer way: per-module state." msgstr "" +"従来、Python 拡張モジュールの状態は、プロセス全体をスコープとする C の " +"``static`` 変数に保持されていました。\n" +"このドキュメントでは、プロセスごとの状態が抱える問題と、より安全な方法である" +"モジュールごとの状態について説明します。" -#: ../../howto/isolating-extensions.rst:16 msgid "" "The document also describes how to switch to per-module state where " "possible. This transition involves allocating space for that state, " "potentially switching from static types to heap types, and—perhaps most " "importantly—accessing per-module state from code." msgstr "" +"また、可能な場合にモジュールごとの状態へ移行する方法も説明します。\n" +"移行には状態の領域の割り当て、必要に応じた静的な型からヒープ型への切り替え、" +"そして特に重要な、コードからモジュールごとの状態へのアクセスが伴います。" -#: ../../howto/isolating-extensions.rst:23 msgid "Who should read this" -msgstr "" +msgstr "対象読者" -#: ../../howto/isolating-extensions.rst:25 msgid "" "This guide is written for maintainers of :ref:`C-API ` " "extensions who would like to make that extension safer to use in " "applications where Python itself is used as a library." msgstr "" +"このガイドは、Python 自体をライブラリとして使うアプリケーションでも安全に利用" +"できる拡張にしたいと考えている、:ref:`C API ` 拡張の保守担当者を" +"対象としています。" #: ../../howto/isolating-extensions.rst:31 msgid "Background" msgstr "背景" -#: ../../howto/isolating-extensions.rst:33 msgid "" "An *interpreter* is the context in which Python code runs. It contains " "configuration (e.g. the import path) and runtime state (e.g. the set of " "imported modules)." msgstr "" +"*インタープリタ* は Python コードが実行されるコンテキストです。\n" +"インポートパスなどの設定と、インポート済みモジュールの集合などの実行時の状態" +"を含みます。" -#: ../../howto/isolating-extensions.rst:37 msgid "" "Python supports running multiple interpreters in one process. There are two " "cases to think about—users may run interpreters:" msgstr "" +"Python は一つのプロセス内で複数のインタープリタを実行できます。\n" +"次の二つの場合を考える必要があります:" -#: ../../howto/isolating-extensions.rst:40 msgid "" "in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` " "cycles, and" msgstr "" +":c:func:`Py_InitializeEx` と :c:func:`Py_FinalizeEx` のサイクルを繰り返し、順" +"番に実行する場合。" -#: ../../howto/isolating-extensions.rst:42 msgid "" "in parallel, managing \"sub-interpreters\" using :c:func:" "`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." msgstr "" +":c:func:`Py_NewInterpreter` と :c:func:`Py_EndInterpreter` で「サブインタープ" +"リタ」を管理し、並列に実行する場合。" -#: ../../howto/isolating-extensions.rst:45 msgid "" "Both cases (and combinations of them) would be most useful when embedding " "Python within a library. Libraries generally shouldn't make assumptions " "about the application that uses them, which include assuming a process-wide " "\"main Python interpreter\"." msgstr "" +"どちらも (また両者の組み合わせも)、Python をライブラリに埋め込む場合に特に役" +"立ちます。\n" +"一般にライブラリは、それを使うアプリケーションについて仮定を置くべきではあり" +"ません。\n" +"プロセス全体に一つの「メインの Python インタープリタ」があるという仮定も同様" +"です。" -#: ../../howto/isolating-extensions.rst:50 msgid "" "Historically, Python extension modules don't handle this use case well. Many " "extension modules (and even some stdlib modules) use *per-process* global " @@ -104,19 +119,28 @@ msgid "" "introduce edge cases that lead to crashes when a module is loaded in more " "than one interpreter in the same process." msgstr "" +"歴史的に、Python 拡張モジュールはこの用途にうまく対応していません。\n" +"C の ``static`` 変数が非常に手軽に使えるため、多くの拡張モジュール (標準ライ" +"ブラリの一部も含みます) は *プロセスごと* のグローバルな状態を使っていま" +"す。\n" +"その結果、インタープリタ固有であるべきデータがインタープリタ間で共有されてし" +"まいます。\n" +"拡張の開発者が注意しないと、同じプロセスの複数のインタープリタにモジュールを" +"読み込んだ場合に、特殊な条件でクラッシュする問題を簡単に持ち込んでしまいま" +"す。" -#: ../../howto/isolating-extensions.rst:58 msgid "" "Unfortunately, *per-interpreter* state is not easy to achieve. Extension " "authors tend to not keep multiple interpreters in mind when developing, and " "it is currently cumbersome to test the behavior." msgstr "" +"残念ながら、*インタープリタごと* の状態を実現するのは簡単ではありません。\n" +"拡張の開発者は複数のインタープリタを考慮せずに開発しがちで、現在はその動作の" +"テストにも手間がかかります。" -#: ../../howto/isolating-extensions.rst:63 msgid "Enter Per-Module State" -msgstr "" +msgstr "モジュールごとの状態の導入" -#: ../../howto/isolating-extensions.rst:65 msgid "" "Instead of focusing on per-interpreter state, Python's C API is evolving to " "better support the more granular *per-module* state. This means that C-level " @@ -125,8 +149,14 @@ msgid "" "multiple module objects corresponding to a single extension can even be " "loaded in a single interpreter." msgstr "" +"Python の C API はインタープリタごとの状態よりも、さらに細かい単位の *モ" +"ジュールごと* の状態を扱いやすくする方向へ進化しています。\n" +"つまり、C レベルのデータは *モジュールオブジェクト* に結び付けるべきです。\n" +"各インタープリタが独自のモジュールオブジェクトを作成することで、データを分離" +"します。\n" +"分離をテストするために、一つの拡張に対応する複数のモジュールオブジェクトを、" +"一つのインタープリタに読み込むこともできます。" -#: ../../howto/isolating-extensions.rst:72 msgid "" "Per-module state provides an easy way to think about lifetime and resource " "ownership: the extension module will initialize when a module object is " @@ -134,8 +164,14 @@ msgid "" "any other :c:expr:`PyObject *`; there are no \"on interpreter shutdown\" " "hooks to think—or forget—about." msgstr "" +"モジュールごとの状態を使うと、寿命とリソースの所有関係を簡単に考えられま" +"す。\n" +"モジュールオブジェクトの作成時に拡張モジュールを初期化し、解放時に後始末をし" +"ます。\n" +"この点ではモジュールは他の :c:expr:`PyObject *` と同じです。\n" +"「インタープリタ終了時」のフックを考慮する必要も、それを忘れる心配もありませ" +"ん。" -#: ../../howto/isolating-extensions.rst:78 msgid "" "Note that there are use cases for different kinds of \"globals\": per-" "process, per-interpreter, per-thread or per-task state. With per-module " @@ -143,17 +179,24 @@ msgid "" "exceptional cases: if you need them, you should give them additional care " "and testing. (Note that this guide does not cover them.)" msgstr "" +"プロセスごと、インタープリタごと、スレッドごと、タスクごとの状態など、異なる" +"種類の「グローバル」な状態にも用途があります。\n" +"モジュールごとの状態を基本としても、これらを使うことはできます。\n" +"ただし例外的な場合として扱い、必要なら追加の注意とテストを行ってください。\n" +"このガイドではこれらは扱いません。" #: ../../howto/isolating-extensions.rst:87 msgid "Isolated Module Objects" msgstr "分離されたモジュールオブジェクト" -#: ../../howto/isolating-extensions.rst:89 msgid "" "The key point to keep in mind when developing an extension module is that " "several module objects can be created from a single shared library. For " "example:" msgstr "" +"拡張モジュールの開発で押さえるべき点は、一つの共有ライブラリから複数のモ" +"ジュールオブジェクトが作成され得るということです。\n" +"例えば:" #: ../../howto/isolating-extensions.rst:93 msgid "" @@ -173,7 +216,6 @@ msgstr "" ">>> old_binascii == binascii\n" "False" -#: ../../howto/isolating-extensions.rst:103 msgid "" "As a rule of thumb, the two modules should be completely independent. All " "objects and state specific to the module should be encapsulated within the " @@ -182,19 +224,26 @@ msgid "" "are possible (see `Managing Global State`_), but they will need more thought " "and attention to edge cases." msgstr "" +"原則として、二つのモジュールは完全に独立しているべきです。\n" +"モジュール固有のすべてのオブジェクトと状態をモジュールオブジェクト内にカプセ" +"ル化し、他のモジュールオブジェクトと共有せず、モジュールオブジェクトの解放時" +"に後始末してください。\n" +"これはあくまで原則なので例外はあります (`グローバルな状態の管理 `_ を参照)。\n" +"ただし、例外的な扱いにはより慎重な検討と特殊な条件への注意が必要です。" -#: ../../howto/isolating-extensions.rst:111 msgid "" "While some modules could do with less stringent restrictions, isolated " "modules make it easier to set clear expectations and guidelines that work " "across a variety of use cases." msgstr "" +"一部のモジュールでは制約を緩められるかもしれません。\n" +"それでもモジュールを分離すると、さまざまな用途に通用する明確な期待動作や指針" +"を定めやすくなります。" -#: ../../howto/isolating-extensions.rst:117 msgid "Surprising Edge Cases" -msgstr "" +msgstr "意外な動作が生じる場合" -#: ../../howto/isolating-extensions.rst:119 msgid "" "Note that isolated modules do create some surprising edge cases. Most " "notably, each module object will typically not share its classes and " @@ -203,8 +252,13 @@ msgid "" "``binascii.Error`` are separate objects. In the following code, the " "exception is *not* caught:" msgstr "" +"モジュールを分離すると、一部の場合に意外な動作が生じます。\n" +"特に、通常は各モジュールオブジェクトがクラスや例外を同種の別のモジュールと共" +"有しません。\n" +"`先ほどの例 `__ の続きでは、``old_binascii.Error`` " +"と ``binascii.Error`` は別のオブジェクトです。\n" +"次のコードでは例外は捕捉 *されません*:" -#: ../../howto/isolating-extensions.rst:126 msgid "" ">>> old_binascii.Error == binascii.Error\n" "False\n" @@ -217,44 +271,57 @@ msgid "" " File \"\", line 2, in \n" "binascii.Error: Non-hexadecimal digit found" msgstr "" +">>> old_binascii.Error == binascii.Error\n" +"False\n" +">>> try:\n" +"... old_binascii.unhexlify(b'qwertyuiop')\n" +"... except binascii.Error:\n" +"... print('boo')\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +"binascii.Error: Non-hexadecimal digit found" -#: ../../howto/isolating-extensions.rst:139 msgid "" "This is expected. Notice that pure-Python modules behave the same way: it is " "a part of how Python works." msgstr "" +"これは想定された動作です。\n" +"ピュア Python のモジュールも同じように動作します。\n" +"これは Python の仕組みの一部です。" -#: ../../howto/isolating-extensions.rst:142 msgid "" "The goal is to make extension modules safe at the C level, not to make hacks " "behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." msgstr "" +"目標は拡張モジュールを C レベルで安全にすることであり、特殊な操作を直感的に動" +"作させることではありません。\n" +"``sys.modules`` を「手作業で」変更するのは、そうした特殊な操作に当たります。" -#: ../../howto/isolating-extensions.rst:148 msgid "Making Modules Safe with Multiple Interpreters" -msgstr "" +msgstr "複数のインタープリタでも安全なモジュールにする" -#: ../../howto/isolating-extensions.rst:152 msgid "Managing Global State" -msgstr "" +msgstr "グローバルな状態の管理" -#: ../../howto/isolating-extensions.rst:154 msgid "" "Sometimes, the state associated with a Python module is not specific to that " "module, but to the entire process (or something else \"more global\" than a " "module). For example:" msgstr "" +"Python モジュールに関連する状態が、そのモジュール固有ではなく、プロセス全体 " +"(またはモジュールより「広域」のもの) に属する場合もあります。\n" +"例えば:" -#: ../../howto/isolating-extensions.rst:158 msgid "The ``readline`` module manages *the* terminal." -msgstr "" +msgstr "``readline`` モジュールは、そのプロセスの *端末* を管理します。" -#: ../../howto/isolating-extensions.rst:159 msgid "" "A module running on a circuit board wants to control *the* on-board LED." msgstr "" +"回路基板で動作するモジュールは、その *基板上の LED* を制御したいかもしれませ" +"ん。" -#: ../../howto/isolating-extensions.rst:162 msgid "" "In these cases, the Python module should provide *access* to the global " "state, rather than *own* it. If possible, write the module so that multiple " @@ -262,27 +329,36 @@ msgid "" "whether for Python or other languages). If that is not possible, consider " "explicit locking." msgstr "" +"このような場合、Python モジュールはグローバルな状態を *所有* するのではなく、" +"その状態への *アクセス* を提供するべきです。\n" +"可能なら、モジュールの複数のコピーが独立して状態にアクセスできるようにしてく" +"ださい (Python や他の言語用の別のライブラリも同時にアクセスすることがありま" +"す)。\n" +"それが不可能なら、明示的なロックを検討してください。" -#: ../../howto/isolating-extensions.rst:168 msgid "" "If it is necessary to use process-global state, the simplest way to avoid " "issues with multiple interpreters is to explicitly prevent a module from " "being loaded more than once per process—see :ref:`isolating-extensions-" "optout`." msgstr "" +"プロセス全体の状態を使う必要がある場合、複数のインタープリタに起因する問題を" +"避ける最も簡単な方法は、一つのプロセスでモジュールを複数回読み込めないよう明" +"示的に制限することです。\n" +":ref:`isolating-extensions-optout` を参照してください。" -#: ../../howto/isolating-extensions.rst:175 msgid "Managing Per-Module State" -msgstr "" +msgstr "モジュールごとの状態の管理" -#: ../../howto/isolating-extensions.rst:177 msgid "" "To use per-module state, use :ref:`multi-phase extension module " "initialization `. This signals that your module " "supports multiple interpreters correctly." msgstr "" +"モジュールごとの状態を使うには、:ref:`拡張モジュールの複数フェーズ初期化 " +"` を使います。\n" +"これはモジュールが複数のインタープリタを正しくサポートすることを示します。" -#: ../../howto/isolating-extensions.rst:181 msgid "" "Set ``PyModuleDef.m_size`` to a positive number to request that many bytes " "of storage local to the module. Usually, this will be set to the size of " @@ -292,22 +368,33 @@ msgid "" "``csv``'s :py:data:`~csv.field_size_limit`) which the C code needs to " "function." msgstr "" +"``PyModuleDef.m_size`` に正の数を設定すると、そのバイト数のモジュール専用の記" +"憶領域を確保できます。\n" +"通常は、モジュールの C レベルの状態をすべて格納する、モジュール固有の " +"``struct`` のサイズを指定します。\n" +"特に、C コードの動作に必要なクラスへのポインタ (例外を含み、静的な型を除きま" +"す) や、``csv`` の :py:data:`~csv.field_size_limit` などの設定は、ここに格納" +"してください。" -#: ../../howto/isolating-extensions.rst:190 msgid "" "Another option is to store state in the module's ``__dict__``, but you must " "avoid crashing when users modify ``__dict__`` from Python code. This usually " "means error- and type-checking at the C level, which is easy to get wrong " "and hard to test sufficiently." msgstr "" +"状態をモジュールの ``__dict__`` に格納する方法もありますが、ユーザーが " +"Python コードで ``__dict__`` を変更してもクラッシュしないようにする必要があり" +"ます。\n" +"通常は C レベルでエラーや型を検査することになりますが、これは間違えやすく、十" +"分なテストも困難です。" -#: ../../howto/isolating-extensions.rst:195 msgid "" "However, if module state is not needed in C code, storing it in ``__dict__`` " "only is a good idea." msgstr "" +"ただし、C コードでモジュールの状態を使わないなら、``__dict__`` だけに格納する" +"のがよい方法です。" -#: ../../howto/isolating-extensions.rst:198 msgid "" "If the module state includes ``PyObject`` pointers, the module object must " "hold references to those objects and implement the module-level hooks " @@ -316,27 +403,38 @@ msgid "" "and make the code longer; this is the price for modules which can be " "unloaded cleanly." msgstr "" +"モジュールの状態に ``PyObject`` ポインタが含まれる場合、モジュールオブジェク" +"トはそのオブジェクトへの参照を保持し、モジュールレベルのフック " +"``m_traverse``、``m_clear``、``m_free`` を実装する必要があります。\n" +"これらはクラスの ``tp_traverse``、``tp_clear``、``tp_free`` のように働きま" +"す。\n" +"フックの追加には手間がかかり、コードも長くなります。\n" +"これはモジュールをきれいに解放できるようにするための代償です。" -#: ../../howto/isolating-extensions.rst:205 msgid "" "An example of a module with per-module state is currently available as " "`xxlimited `__; example module initialization shown at the bottom of the file." msgstr "" +"モジュールごとの状態を使うモジュールの例として、`xxlimited `__ があります。\n" +"モジュールの初期化の例はファイルの末尾にあります。" -#: ../../howto/isolating-extensions.rst:213 msgid "Opt-Out: Limiting to One Module Object per Process" -msgstr "" +msgstr "対応しない場合: プロセスごとに一つのモジュールオブジェクトに制限する" -#: ../../howto/isolating-extensions.rst:215 msgid "" "A non-negative ``PyModuleDef.m_size`` signals that a module supports " "multiple interpreters correctly. If this is not yet the case for your " "module, you can explicitly make your module loadable only once per process. " "For example::" msgstr "" +"``PyModuleDef.m_size`` が非負であることは、モジュールが複数のインタープリタを" +"正しくサポートすることを示します。\n" +"まだ対応していない場合は、プロセスごとに一度だけ読み込めるよう明示的に制限で" +"きます。\n" +"例えば次のようにします。 ::" -#: ../../howto/isolating-extensions.rst:220 msgid "" "// A process-wide flag\n" "static int loaded = 0;\n" @@ -359,8 +457,28 @@ msgid "" " // ... rest of initialization\n" "}" msgstr "" +"// プロセス全体で共有するフラグ\n" +"static int loaded = 0;\n" +"\n" +"// スレッド安全性を確保するミューテックス (フリースレッド版 Python でのみ必" +"要)\n" +"static PyMutex modinit_mutex = {0};\n" +"\n" +"static int\n" +"exec_module(PyObject* module)\n" +"{\n" +" PyMutex_Lock(&modinit_mutex);\n" +" if (loaded) {\n" +" PyMutex_Unlock(&modinit_mutex);\n" +" PyErr_SetString(PyExc_ImportError,\n" +" \"cannot load module more than once per process\");\n" +" return -1;\n" +" }\n" +" loaded = 1;\n" +" PyMutex_Unlock(&modinit_mutex);\n" +" // ... 残りの初期化処理\n" +"}" -#: ../../howto/isolating-extensions.rst:242 msgid "" "If your module's :c:member:`PyModuleDef.m_clear` function is able to prepare " "for future re-initialization, it should clear the ``loaded`` flag. In this " @@ -368,19 +486,24 @@ msgid "" "but it will, for example, support being loaded after Python runtime shutdown " "(:c:func:`Py_FinalizeEx`) and re-initialization (:c:func:`Py_Initialize`)." msgstr "" +"モジュールの :c:member:`PyModuleDef.m_clear` 関数で将来の再初期化に備えられる" +"場合は、そこで ``loaded`` フラグをクリアしてください。\n" +"この場合、複数のインスタンスの *同時* 存在はサポートしませんが、例えば " +"Python ランタイムを終了 (:c:func:`Py_FinalizeEx`) してから再初期化 (:c:func:" +"`Py_Initialize`) した後で、モジュールを読み込むことはできます。" -#: ../../howto/isolating-extensions.rst:251 msgid "Module State Access from Functions" -msgstr "" +msgstr "関数からモジュールの状態にアクセスする" -#: ../../howto/isolating-extensions.rst:253 msgid "" "Accessing the state from module-level functions is straightforward. " "Functions get the module object as their first argument; for extracting the " "state, you can use ``PyModule_GetState``::" msgstr "" +"モジュールレベルの関数から状態にアクセスするのは簡単です。\n" +"関数の最初の引数にはモジュールオブジェクトが渡されます。\n" +"``PyModule_GetState`` を使うと状態を取得できます。 ::" -#: ../../howto/isolating-extensions.rst:257 msgid "" "static PyObject *\n" "func(PyObject *module, PyObject *args)\n" @@ -392,32 +515,48 @@ msgid "" " // ... rest of logic\n" "}" msgstr "" +"static PyObject *\n" +"func(PyObject *module, PyObject *args)\n" +"{\n" +" my_struct *state = (my_struct*)PyModule_GetState(module);\n" +" if (state == NULL) {\n" +" return NULL;\n" +" }\n" +" // ... 残りの処理\n" +"}" -#: ../../howto/isolating-extensions.rst:268 msgid "" "``PyModule_GetState`` may return ``NULL`` without setting an exception if " "there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own " "module, you're in control of ``m_size``, so this is easy to prevent." msgstr "" +"モジュールの状態がない場合、つまり ``PyModuleDef.m_size`` がゼロの場合、" +"``PyModule_GetState`` は例外を設定せずに ``NULL`` を返すことがあります。\n" +"自分のモジュールでは ``m_size`` を管理できるので、これは簡単に防げます。" -#: ../../howto/isolating-extensions.rst:275 msgid "Heap Types" -msgstr "" +msgstr "ヒープ型" -#: ../../howto/isolating-extensions.rst:277 msgid "" "Traditionally, types defined in C code are *static*; that is, ``static " "PyTypeObject`` structures defined directly in code and initialized using " "``PyType_Ready()``." msgstr "" +"従来、C コードで定義する型は *静的* なものです。\n" +"つまり、コード内に ``static PyTypeObject`` 構造体を直接定義し、" +"``PyType_Ready()`` で初期化します。" -#: ../../howto/isolating-extensions.rst:281 msgid "" "Such types are necessarily shared across the process. Sharing them between " "module objects requires paying attention to any state they own or access. To " "limit the possible issues, static types are immutable at the Python level: " "for example, you can't set ``str.myattribute = 123``." msgstr "" +"このような型は必然的にプロセス全体で共有されます。\n" +"モジュールオブジェクト間で共有するには、その型が所有したりアクセスしたりする" +"状態に注意が必要です。\n" +"問題を抑えるため、静的な型は Python レベルでは不変になっています。\n" +"例えば ``str.myattribute = 123`` は設定できません。" #: ../../howto/isolating-extensions.rst:287 msgid "" @@ -429,7 +568,6 @@ msgid "" "process-wide GIL." msgstr "" -#: ../../howto/isolating-extensions.rst:294 msgid "" "Because they are immutable and process-global, static types cannot access " "\"their\" module state. If any method of such a type requires access to " @@ -437,16 +575,18 @@ msgid "" "*heap type* for short. These correspond more closely to classes created by " "Python's ``class`` statement." msgstr "" +"静的な型は不変で、プロセス全体に属するため、「自分の」モジュールの状態にアク" +"セスできません。\n" +"その型のメソッドがモジュールの状態にアクセスする必要がある場合、*ヒープに割り" +"当てる型*、略して *ヒープ型* に変換しなければなりません。\n" +"ヒープ型は Python の ``class`` 文で作成するクラスにより近いものです。" -#: ../../howto/isolating-extensions.rst:301 msgid "For new modules, using heap types by default is a good rule of thumb." -msgstr "" +msgstr "新しいモジュールでは、基本的にヒープ型を使うのがよい方針です。" -#: ../../howto/isolating-extensions.rst:305 msgid "Changing Static Types to Heap Types" -msgstr "" +msgstr "静的な型をヒープ型に変更する" -#: ../../howto/isolating-extensions.rst:307 msgid "" "Static types can be converted to heap types, but note that the heap type API " "was not designed for \"lossless\" conversion from static types—that is, " @@ -455,102 +595,122 @@ msgid "" "unintentionally change a few details (e.g. pickleability or inherited " "slots). Always test the details that are important to you." msgstr "" +"静的な型はヒープ型に変換できます。\n" +"ただし、ヒープ型の API は「完全に同じ動作を保つ」変換、つまり元の静的な型と" +"まったく同じ動作をする型の作成を目的に設計されたものではありません。\n" +"新しい API でクラス定義を書き直すと、pickle 化の可否や継承するスロットなど、" +"一部の詳細が意図せず変わることがあります。\n" +"重要な点は必ずテストしてください。" -#: ../../howto/isolating-extensions.rst:316 msgid "" "Watch out for the following two points in particular (but note that this is " "not a comprehensive list):" -msgstr "" +msgstr "特に次の二点に注意してください (ただし、これですべてではありません):" -#: ../../howto/isolating-extensions.rst:319 msgid "" "Unlike static types, heap type objects are mutable by default. Use the :c:" "macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." msgstr "" +"静的な型とは異なり、ヒープ型のオブジェクトはデフォルトで可変です。\n" +"変更を禁止するには :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` フラグを使ってくださ" +"い。" -#: ../../howto/isolating-extensions.rst:321 msgid "" "Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " "become possible to instantiate them from Python code. You can prevent this " "with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." msgstr "" +"ヒープ型はデフォルトで :c:member:`~PyTypeObject.tp_new` を継承するため、" +"Python コードからインスタンスを作成できるようになる場合があります。\n" +":c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` フラグでこれを防げます。" -#: ../../howto/isolating-extensions.rst:327 msgid "Defining Heap Types" -msgstr "" +msgstr "ヒープ型の定義" -#: ../../howto/isolating-extensions.rst:329 msgid "" "Heap types can be created by filling a :c:struct:`PyType_Spec` structure, a " "description or \"blueprint\" of a class, and calling :c:func:" "`PyType_FromModuleAndSpec` to construct a new class object." msgstr "" +"ヒープ型は、クラスの説明や「設計図」に当たる :c:struct:`PyType_Spec` 構造体に" +"値を設定し、:c:func:`PyType_FromModuleAndSpec` を呼び出して新しいクラスオブ" +"ジェクトを構築することで作成できます。" -#: ../../howto/isolating-extensions.rst:334 msgid "" "Other functions, like :c:func:`PyType_FromSpec`, can also create heap types, " "but :c:func:`PyType_FromModuleAndSpec` associates the module with the class, " "allowing access to the module state from methods." msgstr "" +":c:func:`PyType_FromSpec` などの他の関数でもヒープ型を作成できますが、:c:" +"func:`PyType_FromModuleAndSpec` はクラスにモジュールを関連付けるため、メソッ" +"ドからモジュールの状態にアクセスできます。" -#: ../../howto/isolating-extensions.rst:338 msgid "" "The class should generally be stored in *both* the module state (for safe " "access from C) and the module's ``__dict__`` (for access from Python code)." msgstr "" +"一般にクラスは、C から安全にアクセスするためのモジュールの状態と、Python コー" +"ドからアクセスするためのモジュールの ``__dict__`` の *両方* に格納してくださ" +"い。" -#: ../../howto/isolating-extensions.rst:344 msgid "Garbage-Collection Protocol" -msgstr "" +msgstr "ガベージコレクションのプロトコル" -#: ../../howto/isolating-extensions.rst:346 msgid "" "Instances of heap types hold a reference to their type. This ensures that " "the type isn't destroyed before all its instances are, but may result in " "reference cycles that need to be broken by the garbage collector." msgstr "" +"ヒープ型のインスタンスは自分の型への参照を保持します。\n" +"これにより、すべてのインスタンスが破棄されるまで型は破棄されません。\n" +"ただし、ガベージコレクタで解消する必要のある循環参照が生じる場合があります。" -#: ../../howto/isolating-extensions.rst:351 msgid "" "To avoid memory leaks, instances of heap types must implement the garbage " "collection protocol. That is, heap types should:" msgstr "" +"メモリリークを防ぐには、ヒープ型のインスタンスでガベージコレクションのプロト" +"コルを実装する必要があります。\n" +"具体的には、ヒープ型で次を行います:" -#: ../../howto/isolating-extensions.rst:355 msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_GC` フラグを設定する。" -#: ../../howto/isolating-extensions.rst:356 msgid "" "Define a traverse function using :c:data:`Py_tp_traverse`, which visits the " "type (e.g. using ``Py_VISIT(Py_TYPE(self))``)." msgstr "" +":c:data:`Py_tp_traverse` で走査関数を定義し、例えば " +"``Py_VISIT(Py_TYPE(self))`` を使って型を訪問する。" -#: ../../howto/isolating-extensions.rst:359 msgid "" "Please refer to the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :c:" "member:`~PyTypeObject.tp_traverse` for additional considerations." msgstr "" +"その他の注意点は :c:macro:`Py_TPFLAGS_HAVE_GC` と :c:member:`~PyTypeObject." +"tp_traverse` のドキュメントを参照してください。" -#: ../../howto/isolating-extensions.rst:363 msgid "" "The API for defining heap types grew organically, leaving it somewhat " "awkward to use in its current state. The following sections will guide you " "through common issues." msgstr "" +"ヒープ型を定義する API は必要に応じて拡張されてきたため、現在の形には多少使い" +"づらいところがあります。\n" +"以降の節では、よくある問題を説明します。" -#: ../../howto/isolating-extensions.rst:369 msgid "``tp_traverse`` in Python 3.8 and lower" -msgstr "" +msgstr "Python 3.8 以前の ``tp_traverse``" -#: ../../howto/isolating-extensions.rst:371 msgid "" "The requirement to visit the type from ``tp_traverse`` was added in Python " "3.9. If you support Python 3.8 and lower, the traverse function must *not* " "visit the type, so it must be more complicated::" msgstr "" +"``tp_traverse`` から型を訪問するという要件は Python 3.9 で追加されました。\n" +"Python 3.8 以前をサポートする場合、走査関数は型を訪問しては *ならない* ため、" +"少し複雑になります。 ::" -#: ../../howto/isolating-extensions.rst:375 msgid "" "static int my_traverse(PyObject *self, visitproc visit, void *arg)\n" "{\n" @@ -560,48 +720,54 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int my_traverse(PyObject *self, visitproc visit, void *arg)\n" +"{\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +" return 0;\n" +"}" -#: ../../howto/isolating-extensions.rst:383 msgid "" "Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a " "replacement, use:" msgstr "" +"残念ながら :c:data:`Py_Version` が追加されたのは Python 3.11 です。\n" +"代わりに次を使ってください:" -#: ../../howto/isolating-extensions.rst:386 msgid ":c:macro:`PY_VERSION_HEX`, if not using the stable ABI, or" -msgstr "" +msgstr "Stable ABI を使わない場合は :c:macro:`PY_VERSION_HEX`。" -#: ../../howto/isolating-extensions.rst:387 msgid "" ":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` and :c:func:" "`PyArg_ParseTuple`)." msgstr "" +"それ以外は :py:data:`sys.version_info` (:c:func:`PySys_GetObject` と :c:func:" +"`PyArg_ParseTuple` を介して取得)。" -#: ../../howto/isolating-extensions.rst:392 msgid "Delegating ``tp_traverse``" -msgstr "" +msgstr "``tp_traverse`` の委譲" -#: ../../howto/isolating-extensions.rst:394 msgid "" "If your traverse function delegates to the :c:member:`~PyTypeObject." "tp_traverse` of its base class (or another type), ensure that " "``Py_TYPE(self)`` is visited only once. Note that only heap type are " "expected to visit the type in ``tp_traverse``." msgstr "" +"走査関数が基底クラス (または他の型) の :c:member:`~PyTypeObject.tp_traverse` " +"に処理を委譲する場合、``Py_TYPE(self)`` を訪問するのが一度だけになるようにし" +"てください。\n" +"``tp_traverse`` で型を訪問するのはヒープ型だけです。" -#: ../../howto/isolating-extensions.rst:399 msgid "For example, if your traverse function includes::" -msgstr "" +msgstr "例えば、走査関数に次が含まれ、 ::" -#: ../../howto/isolating-extensions.rst:401 msgid "base->tp_traverse(self, visit, arg)" -msgstr "" +msgstr "base->tp_traverse(self, visit, arg)" -#: ../../howto/isolating-extensions.rst:403 msgid "...and ``base`` may be a static type, then it should also include::" -msgstr "" +msgstr "``base`` が静的な型の場合もあるなら、次も追加してください。 ::" -#: ../../howto/isolating-extensions.rst:405 msgid "" "if (base->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" " // a heap type's tp_traverse already visited Py_TYPE(self)\n" @@ -611,39 +777,48 @@ msgid "" " }\n" "}" msgstr "" +"if (base->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" +" // ヒープ型の tp_traverse はすでに Py_TYPE(self) を訪問している\n" +"} else {\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +"}" -#: ../../howto/isolating-extensions.rst:413 msgid "" "It is not necessary to handle the type's reference count in :c:member:" "`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_clear`." msgstr "" +":c:member:`~PyTypeObject.tp_new` と :c:member:`~PyTypeObject.tp_clear` で型の" +"参照カウントを操作する必要はありません。" -#: ../../howto/isolating-extensions.rst:418 msgid "Defining ``tp_dealloc``" -msgstr "" +msgstr "``tp_dealloc`` の定義" -#: ../../howto/isolating-extensions.rst:420 msgid "" "If your type has a custom :c:member:`~PyTypeObject.tp_dealloc` function, it " "needs to:" msgstr "" +"型に独自の :c:member:`~PyTypeObject.tp_dealloc` 関数がある場合、次の処理が必" +"要です:" -#: ../../howto/isolating-extensions.rst:423 msgid "" "call :c:func:`PyObject_GC_UnTrack` before any fields are invalidated, and" msgstr "" +"いずれかのフィールドを無効にする前に :c:func:`PyObject_GC_UnTrack` を呼び出" +"す。" -#: ../../howto/isolating-extensions.rst:424 msgid "decrement the reference count of the type." -msgstr "" +msgstr "型の参照カウントを減らす。" -#: ../../howto/isolating-extensions.rst:426 msgid "" "To keep the type valid while ``tp_free`` is called, the type's refcount " "needs to be decremented *after* the instance is deallocated. For example::" msgstr "" +"``tp_free`` の呼び出し中も型を有効に保つため、型の参照カウントはインスタンス" +"を解放した *後* に減らす必要があります。\n" +"例えば次のようにします。 ::" -#: ../../howto/isolating-extensions.rst:429 msgid "" "static void my_dealloc(PyObject *self)\n" "{\n" @@ -654,122 +829,149 @@ msgid "" " Py_DECREF(type);\n" "}" msgstr "" +"static void my_dealloc(PyObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" ...\n" +" PyTypeObject *type = Py_TYPE(self);\n" +" type->tp_free(self);\n" +" Py_DECREF(type);\n" +"}" -#: ../../howto/isolating-extensions.rst:438 msgid "" "The default ``tp_dealloc`` function does this, so if your type does *not* " "override ``tp_dealloc`` you don't need to add it." msgstr "" +"デフォルトの ``tp_dealloc`` 関数はこの処理を行うため、``tp_dealloc`` をオー" +"バーライド *しない* 型では追加する必要はありません。" -#: ../../howto/isolating-extensions.rst:444 msgid "Not overriding ``tp_free``" -msgstr "" +msgstr "``tp_free`` をオーバーライドしない" -#: ../../howto/isolating-extensions.rst:446 msgid "" "The :c:member:`~PyTypeObject.tp_free` slot of a heap type must be set to :c:" "func:`PyObject_GC_Del`. This is the default; do not override it." msgstr "" +"ヒープ型の :c:member:`~PyTypeObject.tp_free` スロットは :c:func:" +"`PyObject_GC_Del` に設定する必要があります。\n" +"これがデフォルトなので、オーバーライドしないでください。" -#: ../../howto/isolating-extensions.rst:452 msgid "Avoiding ``PyObject_New``" -msgstr "" +msgstr "``PyObject_New`` を避ける" -#: ../../howto/isolating-extensions.rst:454 msgid "GC-tracked objects need to be allocated using GC-aware functions." msgstr "" +"GC が追跡するオブジェクトは、GC に対応した関数で割り当てる必要があります。" -#: ../../howto/isolating-extensions.rst:456 msgid "If you use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:" -msgstr "" +msgstr ":c:func:`PyObject_New` や :c:func:`PyObject_NewVar` を使っている場合:" -#: ../../howto/isolating-extensions.rst:458 msgid "" "Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible. " "That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::" msgstr "" +"可能なら、型の :c:member:`~PyTypeObject.tp_alloc` スロットを取得して呼び出し" +"てください。\n" +"つまり ``TYPE *o = PyObject_New(TYPE, typeobj)`` を次に置き換えます。 ::" -#: ../../howto/isolating-extensions.rst:461 msgid "TYPE *o = typeobj->tp_alloc(typeobj, 0);" -msgstr "" +msgstr "TYPE *o = typeobj->tp_alloc(typeobj, 0);" -#: ../../howto/isolating-extensions.rst:463 msgid "" "Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use " "size instead of the 0." msgstr "" +"``o = PyObject_NewVar(TYPE, typeobj, size)`` も同様に置き換えますが、0 の代わ" +"りに ``size`` を使います。" -#: ../../howto/isolating-extensions.rst:466 msgid "" "If the above is not possible (e.g. inside a custom ``tp_alloc``), call :c:" "func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`::" msgstr "" +"それができない場合 (例えば独自の ``tp_alloc`` の内部) は、:c:func:" +"`PyObject_GC_New` または :c:func:`PyObject_GC_NewVar` を呼び出してくださ" +"い。 ::" -#: ../../howto/isolating-extensions.rst:469 msgid "" "TYPE *o = PyObject_GC_New(TYPE, typeobj);\n" "\n" "TYPE *o = PyObject_GC_NewVar(TYPE, typeobj, size);" msgstr "" +"TYPE *o = PyObject_GC_New(TYPE, typeobj);\n" +"\n" +"TYPE *o = PyObject_GC_NewVar(TYPE, typeobj, size);" -#: ../../howto/isolating-extensions.rst:475 msgid "Module State Access from Classes" -msgstr "" +msgstr "クラスからモジュールの状態にアクセスする" -#: ../../howto/isolating-extensions.rst:477 msgid "" "If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, " "you can call :c:func:`PyType_GetModule` to get the associated module, and " "then :c:func:`PyModule_GetState` to get the module's state." msgstr "" +":c:func:`PyType_FromModuleAndSpec` で定義した型オブジェクトがあれば、:c:func:" +"`PyType_GetModule` で関連付けられたモジュールを取得し、:c:func:" +"`PyModule_GetState` でその状態を取得できます。" -#: ../../howto/isolating-extensions.rst:481 msgid "" "To save a some tedious error-handling boilerplate code, you can combine " "these two steps with :c:func:`PyType_GetModuleState`, resulting in::" msgstr "" +"エラー処理の定型コードを省くには、:c:func:`PyType_GetModuleState` でこの二つ" +"の手順をまとめられます。 ::" -#: ../../howto/isolating-extensions.rst:484 msgid "" "my_struct *state = (my_struct*)PyType_GetModuleState(type);\n" "if (state == NULL) {\n" " return NULL;\n" "}" msgstr "" +"my_struct *state = (my_struct*)PyType_GetModuleState(type);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" -#: ../../howto/isolating-extensions.rst:491 msgid "Module State Access from Regular Methods" -msgstr "" +msgstr "通常のメソッドからモジュールの状態にアクセスする" -#: ../../howto/isolating-extensions.rst:493 msgid "" "Accessing the module-level state from methods of a class is somewhat more " "complicated, but is possible thanks to API introduced in Python 3.9. To get " "the state, you need to first get the *defining class*, and then get the " "module state from it." msgstr "" +"クラスのメソッドからモジュールレベルの状態にアクセスするのは少し複雑ですが、" +"Python 3.9 で導入された API により可能になりました。\n" +"まず *メソッドを定義したクラス* を取得し、そのクラスからモジュールの状態を取" +"得します。" -#: ../../howto/isolating-extensions.rst:498 msgid "" "The largest roadblock is getting *the class a method was defined in*, or " "that method's \"defining class\" for short. The defining class can have a " "reference to the module it is part of." msgstr "" +"最大の難所は、*メソッドが定義されたクラス*、略して「定義クラス」を取得するこ" +"とです。\n" +"定義クラスは、そのクラスが属するモジュールへの参照を保持できます。" -#: ../../howto/isolating-extensions.rst:502 msgid "" "Do not confuse the defining class with ``Py_TYPE(self)``. If the method is " "called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that " "subclass, which may be defined in different module than yours." msgstr "" +"定義クラスと ``Py_TYPE(self)`` を混同しないでください。\n" +"型の *サブクラス* のインスタンスでメソッドが呼び出された場合、" +"``Py_TYPE(self)`` はそのサブクラスを指します。\n" +"そのサブクラスは別のモジュールで定義されているかもしれません。" -#: ../../howto/isolating-extensions.rst:507 msgid "" "The following Python code can illustrate the concept. ``Base." "get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" msgstr "" +"次の Python コードでこの考え方を示します。\n" +"``Base.get_defining_class`` は ``type(self) == Sub`` の場合でも ``Base`` を返" +"します:" -#: ../../howto/isolating-extensions.rst:511 msgid "" "class Base:\n" " def get_type_of_self(self):\n" @@ -781,14 +983,26 @@ msgid "" "class Sub(Base):\n" " pass" msgstr "" +"class Base:\n" +" def get_type_of_self(self):\n" +" return type(self)\n" +"\n" +" def get_defining_class(self):\n" +" return __class__\n" +"\n" +"class Sub(Base):\n" +" pass" -#: ../../howto/isolating-extensions.rst:523 msgid "" "For a method to get its \"defining class\", it must use the :ref:" "`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`calling convention ` and the " "corresponding :c:type:`PyCMethod` signature::" msgstr "" +"メソッドが「定義クラス」を取得するには、:ref:`METH_METHOD | METH_FASTCALL | " +"METH_KEYWORDS ` :c:type:`呼び出し規" +"約 ` と、それに対応する :c:type:`PyCMethod` シグネチャを使う必要" +"があります。 ::" #: ../../howto/isolating-extensions.rst:528 msgid "" @@ -800,11 +1014,12 @@ msgid "" " PyObject *kwnames) // NULL, or dict of keyword arguments" msgstr "" -#: ../../howto/isolating-extensions.rst:535 msgid "" "Once you have the defining class, call :c:func:`PyType_GetModuleState` to " "get the state of its associated module." msgstr "" +"定義クラスを取得したら、:c:func:`PyType_GetModuleState` を呼び出して、関連付" +"けられたモジュールの状態を取得します。" #: ../../howto/isolating-extensions.rst:538 msgid "For example::" @@ -837,15 +1052,13 @@ msgid "" "}" msgstr "" -#: ../../howto/isolating-extensions.rst:566 msgid "Module State Access from Slot Methods, Getters and Setters" -msgstr "" +msgstr "スロットメソッド、ゲッター、セッターからモジュールの状態にアクセスする" #: ../../howto/isolating-extensions.rst:570 msgid "This is new in Python 3.11." msgstr "これは Python 3.11 の新機能です。" -#: ../../howto/isolating-extensions.rst:578 msgid "" "Slot methods—the fast C equivalents for special methods, such as :c:member:" "`~PyNumberMethods.nb_add` for :py:attr:`~object.__add__` or :c:member:" @@ -854,15 +1067,23 @@ msgid "" "`PyCMethod`. The same goes for getters and setters defined with :c:type:" "`PyGetSetDef`." msgstr "" +"スロットメソッドは、特殊メソッドに相当する高速な C の処理です。\n" +"例えば :py:attr:`~object.__add__` に対応する :c:member:`~PyNumberMethods." +"nb_add` や、初期化に使う :c:member:`~PyTypeObject.tp_new` があります。\n" +"これらの API は非常に単純で、:c:type:`PyCMethod` とは異なり定義クラスを渡せま" +"せん。\n" +":c:type:`PyGetSetDef` で定義するゲッターやセッターも同様です。" -#: ../../howto/isolating-extensions.rst:585 msgid "" "To access the module state in these cases, use the :c:func:" "`PyType_GetModuleByDef` function, and pass in the module definition. Once " "you have the module, call :c:func:`PyModule_GetState` to get the state::" msgstr "" +"このような場合にモジュールの状態にアクセスするには、:c:func:" +"`PyType_GetModuleByDef` 関数にモジュール定義を渡します。\n" +"モジュールを取得したら、:c:func:`PyModule_GetState` を呼び出して状態を取得し" +"ます。 ::" -#: ../../howto/isolating-extensions.rst:590 msgid "" "PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &module_def);\n" "my_struct *state = (my_struct*)PyModule_GetState(module);\n" @@ -870,34 +1091,46 @@ msgid "" " return NULL;\n" "}" msgstr "" +"PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &module_def);\n" +"my_struct *state = (my_struct*)PyModule_GetState(module);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" -#: ../../howto/isolating-extensions.rst:596 msgid "" ":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method " "resolution order` (i.e. all superclasses) for the first superclass that has " "a corresponding module." msgstr "" +":c:func:`!PyType_GetModuleByDef` は :term:`method resolution order` (すべての" +"スーパークラス) を検索し、対応するモジュールを持つ最初のスーパークラスを探し" +"ます。" -#: ../../howto/isolating-extensions.rst:602 msgid "" "In very exotic cases (inheritance chains spanning multiple modules created " "from the same definition), :c:func:`!PyType_GetModuleByDef` might not return " "the module of the true defining class. However, it will always return a " "module with the same definition, ensuring a compatible C memory layout." msgstr "" +"非常に特殊な場合 (同じ定義から作成された複数のモジュールに継承関係がまたがる" +"場合)、:c:func:`!PyType_GetModuleByDef` は本来の定義クラスのモジュールを返さ" +"ないことがあります。\n" +"ただし、必ず同じ定義のモジュールを返すため、C のメモリレイアウトの互換性は保" +"証されます。" -#: ../../howto/isolating-extensions.rst:610 msgid "Lifetime of the Module State" -msgstr "" +msgstr "モジュールの状態の寿命" -#: ../../howto/isolating-extensions.rst:612 msgid "" "When a module object is garbage-collected, its module state is freed. For " "each pointer to (a part of) the module state, you must hold a reference to " "the module object." msgstr "" +"モジュールオブジェクトがガベージコレクションで回収されると、モジュールの状態" +"も解放されます。\n" +"モジュールの状態 (またはその一部) へのポインタを保持する間は、それぞれモ" +"ジュールオブジェクトへの参照を保持しなければなりません。" -#: ../../howto/isolating-extensions.rst:616 msgid "" "Usually this is not an issue, because types created with :c:func:" "`PyType_FromModuleAndSpec`, and their instances, hold a reference to the " @@ -905,20 +1138,25 @@ msgid "" "reference module state from other places, such as callbacks for external " "libraries." msgstr "" +":c:func:`PyType_FromModuleAndSpec` で作成した型とそのインスタンスはモジュール" +"への参照を保持するため、通常これは問題になりません。\n" +"ただし、外部ライブラリのコールバックなど、他の場所からモジュールの状態を参照" +"する場合は、参照カウントに注意する必要があります。" #: ../../howto/isolating-extensions.rst:625 msgid "Open Issues" msgstr "取り掛かり中の問題" -#: ../../howto/isolating-extensions.rst:627 msgid "Several issues around per-module state and heap types are still open." msgstr "" +"モジュールごとの状態とヒープ型には、まだ未解決の問題がいくつかあります。" -#: ../../howto/isolating-extensions.rst:629 msgid "" "Discussions about improving the situation are best held on the `discuss " "forum under c-api tag `__." msgstr "" +"改善について議論するには、`discuss フォーラムの c-api カテゴリ `__ が適しています。" #: ../../howto/isolating-extensions.rst:633 msgid "Per-Class Scope" @@ -932,12 +1170,13 @@ msgid "" "per-class scope)." msgstr "" -#: ../../howto/isolating-extensions.rst:642 msgid "Lossless Conversion to Heap Types" -msgstr "" +msgstr "動作を完全に保ったヒープ型への変換" -#: ../../howto/isolating-extensions.rst:644 msgid "" "The heap type API was not designed for \"lossless\" conversion from static " "types; that is, creating a type that works exactly like a given static type." msgstr "" +"ヒープ型の API は、静的な型から動作を完全に保ったまま変換すること、つまり元の" +"静的な型とまったく同じ動作をする型の作成を目的に設計されたものではありませ" +"ん。" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 7e641ae5d..4aff29d08 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -59,7 +59,6 @@ msgstr "" "ない) ことが可能で、すべての子 logger への呼び出しは親にまで渡されます。まず" "はメインのモジュールです::" -#: ../../howto/logging-cookbook.rst:24 msgid "" "import logging\n" "import auxiliary_module\n" @@ -92,12 +91,41 @@ msgid "" "auxiliary_module.some_function()\n" "logger.info('done with auxiliary_module.some_function()')" msgstr "" +"import logging\n" +"import auxiliary_module\n" +"\n" +"# 'spam_application' という名前のロガーを作成する\n" +"logger = logging.getLogger('spam_application')\n" +"logger.setLevel(logging.DEBUG)\n" +"# デバッグメッセージも記録するファイルハンドラーを作成する\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# より高いログレベルのコンソールハンドラーを作成する\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# フォーマッターを作成してハンドラーに設定する\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"fh.setFormatter(formatter)\n" +"ch.setFormatter(formatter)\n" +"# ロガーにハンドラーを追加する\n" +"logger.addHandler(fh)\n" +"logger.addHandler(ch)\n" +"\n" +"logger.info('creating an instance of auxiliary_module.Auxiliary')\n" +"a = auxiliary_module.Auxiliary()\n" +"logger.info('created an instance of auxiliary_module.Auxiliary')\n" +"logger.info('calling auxiliary_module.Auxiliary.do_something')\n" +"a.do_something()\n" +"logger.info('finished auxiliary_module.Auxiliary.do_something')\n" +"logger.info('calling auxiliary_module.some_function()')\n" +"auxiliary_module.some_function()\n" +"logger.info('done with auxiliary_module.some_function()')" #: ../../howto/logging-cookbook.rst:54 msgid "Here is the auxiliary module::" msgstr "そして補助モジュール (auxiliary module) がこちらです::" -#: ../../howto/logging-cookbook.rst:56 msgid "" "import logging\n" "\n" @@ -118,12 +146,29 @@ msgid "" "def some_function():\n" " module_logger.info('received a call to \"some_function\"')" msgstr "" +"import logging\n" +"\n" +"# ロガーを作成する\n" +"module_logger = logging.getLogger('spam_application.auxiliary')\n" +"\n" +"class Auxiliary:\n" +" def __init__(self):\n" +" self.logger = logging.getLogger('spam_application.auxiliary." +"Auxiliary')\n" +" self.logger.info('creating an instance of Auxiliary')\n" +"\n" +" def do_something(self):\n" +" self.logger.info('doing something')\n" +" a = 1 + 1\n" +" self.logger.info('done doing something')\n" +"\n" +"def some_function():\n" +" module_logger.info('received a call to \"some_function\"')" #: ../../howto/logging-cookbook.rst:74 msgid "The output looks like this:" msgstr "出力はこのようになります:" -#: ../../howto/logging-cookbook.rst:76 msgid "" "2005-03-23 23:47:11,663 - spam_application - INFO -\n" " creating an instance of auxiliary_module.Auxiliary\n" @@ -146,6 +191,26 @@ msgid "" "2005-03-23 23:47:11,673 - spam_application - INFO -\n" " done with auxiliary_module.some_function()" msgstr "" +"2005-03-23 23:47:11,663 - spam_application - INFO -\n" +" creating an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -\n" +" creating an instance of Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application - INFO -\n" +" created an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,668 - spam_application - INFO -\n" +" calling auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -\n" +" doing something\n" +"2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -\n" +" done doing something\n" +"2005-03-23 23:47:11,670 - spam_application - INFO -\n" +" finished auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,671 - spam_application - INFO -\n" +" calling auxiliary_module.some_function()\n" +"2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -\n" +" received a call to 'some_function'\n" +"2005-03-23 23:47:11,673 - spam_application - INFO -\n" +" done with auxiliary_module.some_function()" #: ../../howto/logging-cookbook.rst:100 msgid "Logging from multiple threads" @@ -159,7 +224,6 @@ msgstr "" "複数スレッドからのロギングでは特別に何かをする必要はありません。\n" "次の例はmain (初期) スレッドとそれ以外のスレッドからのロギングの例です::" -#: ../../howto/logging-cookbook.rst:105 msgid "" "import logging\n" "import threading\n" @@ -188,12 +252,37 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import logging\n" +"import threading\n" +"import time\n" +"\n" +"def worker(arg):\n" +" while not arg['stop']:\n" +" logging.debug('Hi from myfunc')\n" +" time.sleep(0.5)\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d " +"%(threadName)s %(message)s')\n" +" info = {'stop': False}\n" +" thread = threading.Thread(target=worker, args=(info,))\n" +" thread.start()\n" +" while True:\n" +" try:\n" +" logging.debug('Hello from main')\n" +" time.sleep(0.75)\n" +" except KeyboardInterrupt:\n" +" info['stop'] = True\n" +" break\n" +" thread.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" #: ../../howto/logging-cookbook.rst:131 msgid "When run, the script should print something like the following:" msgstr "実行すると、出力は以下のようになるはずです:" -#: ../../howto/logging-cookbook.rst:133 msgid "" " 0 Thread-1 Hi from myfunc\n" " 3 MainThread Hello from main\n" @@ -213,6 +302,23 @@ msgid "" "4513 MainThread Hello from main\n" "4518 Thread-1 Hi from myfunc" msgstr "" +" 0 Thread-1 Hi from myfunc\n" +" 3 MainThread Hello from main\n" +" 505 Thread-1 Hi from myfunc\n" +" 755 MainThread Hello from main\n" +"1007 Thread-1 Hi from myfunc\n" +"1507 MainThread Hello from main\n" +"1508 Thread-1 Hi from myfunc\n" +"2010 Thread-1 Hi from myfunc\n" +"2258 MainThread Hello from main\n" +"2512 Thread-1 Hi from myfunc\n" +"3009 MainThread Hello from main\n" +"3013 Thread-1 Hi from myfunc\n" +"3515 Thread-1 Hi from myfunc\n" +"3761 MainThread Hello from main\n" +"4017 Thread-1 Hi from myfunc\n" +"4513 MainThread Hello from main\n" +"4518 Thread-1 Hi from myfunc" #: ../../howto/logging-cookbook.rst:153 msgid "" @@ -245,7 +351,6 @@ msgstr "" "コードの中のログ記録の呼び出しは変更されずに残ります。少し前に取り上げた単純" "なモジュール式の例を少し変えるとこうなります::" -#: ../../howto/logging-cookbook.rst:167 msgid "" "import logging\n" "\n" @@ -273,6 +378,31 @@ msgid "" "logger.error('error message')\n" "logger.critical('critical message')" msgstr "" +"import logging\n" +"\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"# デバッグメッセージも記録するファイルハンドラーを作成する\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# より高いログレベルのコンソールハンドラーを作成する\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# フォーマッターを作成してハンドラーに設定する\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"ch.setFormatter(formatter)\n" +"fh.setFormatter(formatter)\n" +"# ロガーにハンドラーを追加する\n" +"logger.addHandler(ch)\n" +"logger.addHandler(fh)\n" +"\n" +"# 「アプリケーション」のコード\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" #: ../../howto/logging-cookbook.rst:192 msgid "" @@ -307,7 +437,6 @@ msgstr "" msgid "Logging to multiple destinations" msgstr "複数の出力先にログを出力する" -#: ../../howto/logging-cookbook.rst:208 msgid "" "Let's say you want to log to console and file with different message formats " "and in differing circumstances. Say you want to log messages with levels of " @@ -315,13 +444,14 @@ msgid "" "console. Let's also assume that the file should contain timestamps, but the " "console messages should not. Here's how you can achieve this::" msgstr "" -"コンソールとファイルに、別々のメッセージ書式で、別々の状況に応じたログ出力を" -"行わせたいとしましょう。例えば DEBUG よりも高いレベルのメッセージはファイルに" -"記録し、INFO 以上のレベルのメッセージはコンソールに出力したいという場合です。" -"また、ファイルにはタイムスタンプを記録し、コンソールには出力しないとします。" -"以下のようにすれば、こうした挙動を実現できます::" +"コンソールとファイルに、それぞれ異なる書式や条件でログを出力したいとしま" +"す。\n" +"例えば DEBUG 以上のレベルのメッセージをファイルに、INFO 以上のメッセージをコ" +"ンソールに出力するとします。\n" +"また、ファイルにはタイムスタンプを含め、コンソールには含めないものとしま" +"す。\n" +"次のように実現できます。 ::" -#: ../../howto/logging-cookbook.rst:214 msgid "" "import logging\n" "\n" @@ -357,24 +487,58 @@ msgid "" "logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" "logger2.error('The five boxing wizards jump quickly.')" msgstr "" +"import logging\n" +"\n" +"# ファイルへのログ出力を設定する。詳細は前の節を参照\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)s %(name)-12s %(levelname)-8s " +"%(message)s',\n" +" datefmt='%m-%d %H:%M',\n" +" filename='/tmp/myapp.log',\n" +" filemode='w')\n" +"# INFO 以上のメッセージを sys.stderr に出力するハンドラーを定義する\n" +"console = logging.StreamHandler()\n" +"console.setLevel(logging.INFO)\n" +"# コンソール用のより単純な書式を設定する\n" +"formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')\n" +"# ハンドラーにこの書式を設定する\n" +"console.setFormatter(formatter)\n" +"# ルートロガーにハンドラーを追加する\n" +"logging.getLogger().addHandler(console)\n" +"\n" +"# これでルートロガーや他のロガーに記録できる。まずルートロガーを使う。\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# 次に、アプリケーションの各部分を表すような\n" +"# 他のロガーをいくつか定義する。\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" #: ../../howto/logging-cookbook.rst:246 msgid "When you run this, on the console you will see" msgstr "これを実行すると、コンソールには以下のように出力されます:" -#: ../../howto/logging-cookbook.rst:248 msgid "" "root : INFO Jackdaws love my big sphinx of quartz.\n" "myapp.area1 : INFO How quickly daft jumping zebras vex.\n" "myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.\n" "myapp.area2 : ERROR The five boxing wizards jump quickly." msgstr "" +"root : INFO Jackdaws love my big sphinx of quartz.\n" +"myapp.area1 : INFO How quickly daft jumping zebras vex.\n" +"myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.\n" +"myapp.area2 : ERROR The five boxing wizards jump quickly." #: ../../howto/logging-cookbook.rst:255 msgid "and in the file you will see something like" msgstr "そして、ファイルには以下のように出力されるはずです:" -#: ../../howto/logging-cookbook.rst:257 msgid "" "10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.\n" "10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" @@ -383,6 +547,12 @@ msgid "" "quack.\n" "10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly." msgstr "" +"10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.\n" +"10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +"10-22 22:19 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +"10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from " +"quack.\n" +"10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly." #: ../../howto/logging-cookbook.rst:265 msgid "" @@ -400,7 +570,6 @@ msgstr "" "この例ではコンソールとファイルのハンドラだけを使っていますが、実際には任意の" "数のハンドラや組み合わせを使えます。" -#: ../../howto/logging-cookbook.rst:271 msgid "" "Note that the above choice of log filename ``/tmp/myapp.log`` implies use of " "a standard location for temporary files on POSIX systems. On Windows, you " @@ -408,11 +577,11 @@ msgid "" "the directory exists and that you have the permissions to create and update " "files in it." msgstr "" -"ここでファイル名として ``/tmp/myapp.log`` を選んだということは、一時ファイル" -"の標準的な場所として POSIX システムを想定していることに注意してください。 " -"Windows の場合、ディレクトリが存在し、そのディレクトリに対してファイルを更新" -"するための適切な権限を有することを保証するために、ログファイル向けのディレク" -"トリ名として異なる選択を取る必要があるでしょう。" +"上のログファイル名 ``/tmp/myapp.log`` は、POSIX システムの一時ファイルの標準" +"的な場所を使っています。\n" +"Windows では、別のディレクトリを選ぶ必要があるかもしれません。\n" +"いずれの場合も、ディレクトリが存在し、その中でファイルを作成・更新する権限が" +"あることを確認してください。" #: ../../howto/logging-cookbook.rst:280 msgid "Custom handling of levels" @@ -446,7 +615,6 @@ msgstr "深刻度 ``DEBUG`` 以上のメッセージをファイル ``app.log`` msgid "Suppose you configure logging with the following JSON:" msgstr "logging モジュールを下記の JSON によって構成したとしましょう:" -#: ../../howto/logging-cookbook.rst:293 msgid "" "{\n" " \"version\": 1,\n" @@ -486,6 +654,43 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\"\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}" #: ../../howto/logging-cookbook.rst:333 msgid "" @@ -497,7 +702,6 @@ msgid "" "section parallel to ``formatters`` and ``handlers``:" msgstr "" -#: ../../howto/logging-cookbook.rst:339 msgid "" "{\n" " \"filters\": {\n" @@ -508,13 +712,20 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" }\n" +"}" #: ../../howto/logging-cookbook.rst:350 msgid "and changing the section on the ``stdout`` handler to add it:" msgstr "" "そして ``stdout`` のハンドラに関するセクションにフィルターを追加します:" -#: ../../howto/logging-cookbook.rst:352 msgid "" "{\n" " \"stdout\": {\n" @@ -526,6 +737,15 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" }\n" +"}" #: ../../howto/logging-cookbook.rst:364 msgid "" @@ -535,7 +755,6 @@ msgstr "" "フィルターは単なる関数なので、 ``filter_maker`` (ファクトリ関数) は以下のよう" "に定義することができます:" -#: ../../howto/logging-cookbook.rst:367 msgid "" "def filter_maker(level):\n" " level = getattr(logging, level)\n" @@ -545,6 +764,13 @@ msgid "" "\n" " return filter" msgstr "" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter" #: ../../howto/logging-cookbook.rst:377 msgid "" @@ -570,7 +796,6 @@ msgstr "" "フィルターを追加した ``main.py`` の全体像は以下のようになり、これで実行できる" "状態になりました:" -#: ../../howto/logging-cookbook.rst:387 msgid "" "import json\n" "import logging\n" @@ -638,51 +863,132 @@ msgid "" "logging.error('An ERROR message')\n" "logging.critical('A CRITICAL message')" msgstr "" - -#: ../../howto/logging-cookbook.rst:455 -msgid "And after running it like this:" -msgstr "これを以下のように実行します:" - -#: ../../howto/logging-cookbook.rst:457 -msgid "python main.py 2>stderr.log >stdout.log" -msgstr "" - -#: ../../howto/logging-cookbook.rst:461 -msgid "We can see the results are as expected:" -msgstr "すると期待通りの結果を得ることができます:" - -#: ../../howto/logging-cookbook.rst:463 -msgid "" -"$ more *.log\n" -"::::::::::::::\n" -"app.log\n" -"::::::::::::::\n" -"DEBUG - A DEBUG message\n" -"INFO - An INFO message\n" -"WARNING - A WARNING message\n" -"ERROR - An ERROR message\n" -"CRITICAL - A CRITICAL message\n" -"::::::::::::::\n" -"stderr.log\n" -"::::::::::::::\n" -"ERROR - An ERROR message\n" -"CRITICAL - A CRITICAL message\n" -"::::::::::::::\n" -"stdout.log\n" -"::::::::::::::\n" -"INFO - An INFO message\n" -"WARNING - A WARNING message" -msgstr "" - -#: ../../howto/logging-cookbook.rst:487 -msgid "Configuration server example" +"import json\n" +"import logging\n" +"import logging.config\n" +"\n" +"CONFIG = '''\n" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}\n" +"'''\n" +"\n" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter\n" +"\n" +"logging.config.dictConfig(json.loads(CONFIG))\n" +"logging.debug('A DEBUG message')\n" +"logging.info('An INFO message')\n" +"logging.warning('A WARNING message')\n" +"logging.error('An ERROR message')\n" +"logging.critical('A CRITICAL message')" + +#: ../../howto/logging-cookbook.rst:455 +msgid "And after running it like this:" +msgstr "これを以下のように実行します:" + +msgid "python main.py 2>stderr.log >stdout.log" +msgstr "python main.py 2>stderr.log >stdout.log" + +#: ../../howto/logging-cookbook.rst:461 +msgid "We can see the results are as expected:" +msgstr "すると期待通りの結果を得ることができます:" + +msgid "" +"$ more *.log\n" +"::::::::::::::\n" +"app.log\n" +"::::::::::::::\n" +"DEBUG - A DEBUG message\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stderr.log\n" +"::::::::::::::\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stdout.log\n" +"::::::::::::::\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message" +msgstr "" +"$ more *.log\n" +"::::::::::::::\n" +"app.log\n" +"::::::::::::::\n" +"DEBUG - A DEBUG message\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stderr.log\n" +"::::::::::::::\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stdout.log\n" +"::::::::::::::\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message" + +#: ../../howto/logging-cookbook.rst:487 +msgid "Configuration server example" msgstr "設定サーバの例" #: ../../howto/logging-cookbook.rst:489 msgid "Here is an example of a module using the logging configuration server::" msgstr "ログ記録設定サーバを使うモジュールの例です::" -#: ../../howto/logging-cookbook.rst:491 msgid "" "import logging\n" "import logging.config\n" @@ -713,18 +1019,44 @@ msgid "" " logging.config.stopListening()\n" " t.join()" msgstr "" +"import logging\n" +"import logging.config\n" +"import time\n" +"import os\n" +"\n" +"# 初期設定ファイルを読む\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# 9999 番ポートでリスナーを作成して開始する\n" +"t = logging.config.listen(9999)\n" +"t.start()\n" +"\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"try:\n" +" # Ctrl+C が押されるまでログの呼び出しを繰り返し、\n" +" # 新しい設定による違いを確認する\n" +" while True:\n" +" logger.debug('debug message')\n" +" logger.info('info message')\n" +" logger.warning('warn message')\n" +" logger.error('error message')\n" +" logger.critical('critical message')\n" +" time.sleep(5)\n" +"except KeyboardInterrupt:\n" +" # 後片付け\n" +" logging.config.stopListening()\n" +" t.join()" -#: ../../howto/logging-cookbook.rst:520 msgid "" "And here is a script that takes a filename and sends that file to the " "server, properly preceded with the binary-encoded length, as the new logging " "configuration::" msgstr "" -"そしてファイル名を受け取ってそのファイルをサーバに送るスクリプトですが、それ" -"に先だってバイナリエンコード長を新しいログ記録の設定として先に送っておきま" -"す::" +"次は、ファイル名を受け取り、そのファイルを新しいロギング設定としてサーバーに" +"送るスクリプトです。\n" +"ファイルの内容の前に、バイナリ形式で表したデータ長を送ります。 ::" -#: ../../howto/logging-cookbook.rst:524 msgid "" "#!/usr/bin/env python\n" "import socket, sys, struct\n" @@ -743,6 +1075,22 @@ msgid "" "s.close()\n" "print('complete')" msgstr "" +"#!/usr/bin/env python\n" +"import socket, sys, struct\n" +"\n" +"with open(sys.argv[1], 'rb') as f:\n" +" data_to_send = f.read()\n" +"\n" +"HOST = 'localhost'\n" +"PORT = 9999\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"print('connecting...')\n" +"s.connect((HOST, PORT))\n" +"print('sending config...')\n" +"s.send(struct.pack('>L', len(data_to_send)))\n" +"s.send(data_to_send)\n" +"s.close()\n" +"print('complete')" #: ../../howto/logging-cookbook.rst:545 msgid "Dealing with handlers that block" @@ -831,7 +1179,6 @@ msgstr "" msgid "An example of using these two classes follows (imports omitted)::" msgstr "この2つのクラスを利用する例です (import は省略)::" -#: ../../howto/logging-cookbook.rst:587 msgid "" "que = queue.Queue(-1) # no limit on size\n" "queue_handler = QueueHandler(que)\n" @@ -849,16 +1196,28 @@ msgid "" "root.warning('Look out!')\n" "listener.stop()" msgstr "" +"que = queue.Queue(-1) # サイズの上限なし\n" +"queue_handler = QueueHandler(que)\n" +"handler = logging.StreamHandler()\n" +"listener = QueueListener(que, handler)\n" +"root = logging.getLogger()\n" +"root.addHandler(queue_handler)\n" +"formatter = logging.Formatter('%(threadName)s: %(message)s')\n" +"handler.setFormatter(formatter)\n" +"listener.start()\n" +"# ログ出力には、内部キューを監視する内部スレッドではなく、\n" +"# イベントを生成したスレッド (メインスレッド) が表示される。\n" +"# これが期待する動作。\n" +"root.warning('Look out!')\n" +"listener.stop()" #: ../../howto/logging-cookbook.rst:603 msgid "which, when run, will produce:" msgstr "実行すると次のように出力します:" -#: ../../howto/logging-cookbook.rst:605 msgid "MainThread: Look out!" -msgstr "" +msgstr "MainThread: Look out!" -#: ../../howto/logging-cookbook.rst:609 msgid "" "Although the earlier discussion wasn't specifically talking about async " "code, but rather about slow logging handlers, it should be noted that when " @@ -868,16 +1227,16 @@ msgid "" "application, to use the above approach for logging, so that any blocking " "code runs only in the ``QueueListener`` thread." msgstr "" -"上述の議論は特に同期コードにについてのものではなく、むしろ遅いロギングハンド" -"ラについてでしたが、非同期コードやネットワーク、あるいはファイルハンドラから" -"のロギングでさえも (イベントループをブロックしてしまう) 問題につながる可能性" -"があることには注意すべきでしょう。これはいくつかのロギングが :mod:`asyncio` " -"内部で行われることが理由です。何らかの非同期コードがアプリケーションの中で使" -"われている場合、ロギングには上記のアプローチを使っていかなるブロッキングコー" -"ドも ``QueueListener`` スレッド内だけで実行されるようにしておくことが最も良い" -"でしょう。" +"ここまでは特に非同期コードを対象とせず、処理の遅いロギングハンドラについて説" +"明しました。\n" +"ただし、非同期コードからログを出力する場合、ネットワークハンドラだけでなく" +"ファイルハンドラも、イベントループをブロックして問題を起こす可能性がありま" +"す。\n" +":mod:`asyncio` の内部でもログが出力されるためです。\n" +"アプリケーションで非同期コードを使う場合は、ブロックする処理が " +"``QueueListener`` スレッド内だけで実行されるよう、上記の方法を使うのがよいで" +"しょう。" -#: ../../howto/logging-cookbook.rst:617 msgid "" "Prior to Python 3.5, the :class:`QueueListener` always passed every message " "received from the queue to every handler it was initialized with. (This was " @@ -888,22 +1247,22 @@ msgid "" "of each message with the handler's level, and only passes a message to a " "handler if it's appropriate to do so." msgstr "" -"Python 3.5 以前は、 :class:`QueueListener` クラスは常にキューから受け取った" -"メッセージを、初期化元となっているそれぞれのハンドラーに受け渡していました。 " -"( というのも、レベルフィルターリングは別サイド、つまり、キューが満たされてい" -"る場所で処理されるということが想定されているからです) Python 3.5以降では、" -"キーワードとなる引数 ``respect_handler_level=True`` をリスナーのコントラク" -"ターに受け渡すことで、この挙動を変更することができるようになっています。これ" -"が行われると、各メッセージのレベルをハンドラーのレベルと比較して、そうするこ" -"とが適切な場合のみ、メッセージをハンドラーに渡します。" +"Python 3.5 より前の :class:`QueueListener` は、キューから受け取ったすべての" +"メッセージを、初期化時に渡されたすべてのハンドラに渡していました。\n" +"レベルによるフィルタリングは、キューへ書き込む側ですべて行うと想定していたた" +"めです。\n" +"3.5 以降では、リスナーのコンストラクタにキーワード引数 " +"``respect_handler_level=True`` を渡すと、この動作を変更できます。\n" +"この場合、リスナーは各メッセージのレベルとハンドラのレベルを比較し、条件を満" +"たすメッセージだけをハンドラに渡します。" -#: ../../howto/logging-cookbook.rst:627 msgid "" "The :class:`QueueListener` can be started (and stopped) via the :keyword:" "`with` statement. For example:" msgstr "" +":class:`QueueListener` は :keyword:`with` 文で開始 (および停止) できます。\n" +"例えば:" -#: ../../howto/logging-cookbook.rst:631 msgid "" "with QueueListener(que, handler) as listener:\n" " # The queue listener automatically starts\n" @@ -912,6 +1271,12 @@ msgid "" "# The queue listener automatically stops once\n" "# the 'with' block is exited." msgstr "" +"with QueueListener(que, handler) as listener:\n" +" # with ブロックに入ると、\n" +" # キューリスナーが自動的に開始する。\n" +" pass\n" +"# with ブロックを抜けると、\n" +"# キューリスナーが自動的に停止する。" #: ../../howto/logging-cookbook.rst:643 msgid "Sending and receiving logging events across a network" @@ -927,7 +1292,6 @@ msgstr "" "う。 :class:`SocketHandler` インスタンスを送信端の root logger にアタッチすれ" "ば、簡単に実現できます::" -#: ../../howto/logging-cookbook.rst:649 msgid "" "import logging, logging.handlers\n" "\n" @@ -954,6 +1318,29 @@ msgid "" "logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" "logger2.error('The five boxing wizards jump quickly.')" msgstr "" +"import logging, logging.handlers\n" +"\n" +"rootLogger = logging.getLogger()\n" +"rootLogger.setLevel(logging.DEBUG)\n" +"socketHandler = logging.handlers.SocketHandler('localhost',\n" +" logging.handlers.DEFAULT_TCP_LOGGING_PORT)\n" +"# ソケットハンドラーは書式化前のイベントを pickle で送るため、\n" +"# フォーマッターは設定しない\n" +"rootLogger.addHandler(socketHandler)\n" +"\n" +"# これでルートロガーや他のロガーに記録できる。まずルートロガーを使う。\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# 次に、アプリケーションの各部分を表すような\n" +"# 他のロガーをいくつか定義する。\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" #: ../../howto/logging-cookbook.rst:673 msgid "" @@ -963,7 +1350,6 @@ msgstr "" "受信端では :mod:`socketserver` モジュールを使って受信プログラムを作成しておき" "ます。簡単な実用プログラムを以下に示します::" -#: ../../howto/logging-cookbook.rst:676 msgid "" "import pickle\n" "import logging\n" @@ -1053,80 +1439,170 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" - -#: ../../howto/logging-cookbook.rst:761 -msgid "" -"First run the server, and then the client. On the client side, nothing is " -"printed on the console; on the server side, you should see something like:" -msgstr "" -"先にサーバを起動しておき、次にクライアントを起動します。クライアント側では、" -"コンソールには何も出力されません; サーバ側では以下のようなメッセージを目にす" -"るはずです::" - -#: ../../howto/logging-cookbook.rst:764 -msgid "" -"About to start TCP server...\n" -" 59 root INFO Jackdaws love my big sphinx of quartz.\n" -" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" -" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" -" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" -" 69 myapp.area2 ERROR The five boxing wizards jump quickly." -msgstr "" - -#: ../../howto/logging-cookbook.rst:773 -msgid "" -"Note that there are some security issues with pickle in some scenarios. If " -"these affect you, you can use an alternative serialization scheme by " -"overriding the :meth:`~SocketHandler.makePickle` method and implementing " -"your alternative there, as well as adapting the above script to use your " -"alternative serialization." -msgstr "" -"注意: pickle にはいくつかのシナリオでセキュリティ上の問題があります。これら" -"が影響する場合は、 :meth:`~SocketHandler.makePickle` メソッドをオーバーライド" -"し代替シリアライズ手法を実装して、それを使うように上記のスクリプトを修正する" -"こともできます。" - -#: ../../howto/logging-cookbook.rst:781 -msgid "Running a logging socket listener in production" -msgstr "作成中のロギングソケットのリスナーを実行する" - -#: ../../howto/logging-cookbook.rst:785 -msgid "" -"To run a logging listener in production, you may need to use a process-" -"management tool such as `Supervisor `_. `Here is a " -"Gist `__ which provides the bare-bones files to run " -"the above functionality using Supervisor. It consists of the following files:" -msgstr "" -"作成中のロギングリスナーを実行するためには、 `Supervisor `_ のようなプロセス管理ツールを使う必要があるかもしれません。 `こちらの " -"Gist `__ は Supervisor を使って上記の機能を実行するた" -"めの必要最低限のファイルを提供しています。以下のファイルが必要になります:" - -#: ../../howto/logging-cookbook.rst:792 -msgid "File" -msgstr "ファイル" - -#: ../../howto/logging-cookbook.rst:792 -msgid "Purpose" -msgstr "目的" - -#: ../../howto/logging-cookbook.rst:794 -msgid ":file:`prepare.sh`" -msgstr ":file:`prepare.sh`" - -#: ../../howto/logging-cookbook.rst:794 -msgid "A Bash script to prepare the environment for testing" -msgstr "試験用の環境を準備する Bash スクリプト" - -#: ../../howto/logging-cookbook.rst:797 -msgid ":file:`supervisor.conf`" -msgstr ":file:`supervisor.conf`" - -#: ../../howto/logging-cookbook.rst:797 -msgid "" -"The Supervisor configuration file, which has entries for the listener and a " -"multi-process web application" -msgstr "" +"import pickle\n" +"import logging\n" +"import logging.handlers\n" +"import socketserver\n" +"import struct\n" +"\n" +"\n" +"class LogRecordStreamHandler(socketserver.StreamRequestHandler):\n" +" \"\"\"ストリームで届くログ要求のハンドラー。\n" +"\n" +" This basically logs the record using whatever logging policy is\n" +" configured locally.\n" +" \"\"\"\n" +"\n" +" def handle(self):\n" +" \"\"\"\n" +" Handle multiple requests - each expected to be a 4-byte length,\n" +" followed by the LogRecord in pickle format. Logs the record\n" +" according to whatever policy is configured locally.\n" +" \"\"\"\n" +" while True:\n" +" chunk = self.connection.recv(4)\n" +" if len(chunk) < 4:\n" +" break\n" +" slen = struct.unpack('>L', chunk)[0]\n" +" chunk = self.connection.recv(slen)\n" +" while len(chunk) < slen:\n" +" chunk = chunk + self.connection.recv(slen - len(chunk))\n" +" obj = self.unPickle(chunk)\n" +" record = logging.makeLogRecord(obj)\n" +" self.handleLogRecord(record)\n" +"\n" +" def unPickle(self, data):\n" +" return pickle.loads(data)\n" +"\n" +" def handleLogRecord(self, record):\n" +" # 名前が指定されていれば、レコードが示すロガーではなく\n" +" # その名前のロガーを使う。\n" +" if self.server.logname is not None:\n" +" name = self.server.logname\n" +" else:\n" +" name = record.name\n" +" logger = logging.getLogger(name)\n" +" # 注意: すべてのレコードが記録される。Logger.handle は通常、\n" +" # ロガーのレベルによるフィルタリングの後で呼ばれるため。\n" +" # 処理時間とネットワーク帯域を無駄にしないよう、\n" +" # フィルタリングはクライアント側で行う。\n" +" logger.handle(record)\n" +"\n" +"class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):\n" +" \"\"\"\n" +" Simple TCP socket-based logging receiver suitable for testing.\n" +" \"\"\"\n" +"\n" +" allow_reuse_address = True\n" +"\n" +" def __init__(self, host='localhost',\n" +" port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,\n" +" handler=LogRecordStreamHandler):\n" +" socketserver.ThreadingTCPServer.__init__(self, (host, port), " +"handler)\n" +" self.abort = 0\n" +" self.timeout = 1\n" +" self.logname = None\n" +"\n" +" def serve_until_stopped(self):\n" +" import select\n" +" abort = 0\n" +" while not abort:\n" +" rd, wr, ex = select.select([self.socket.fileno()],\n" +" [], [],\n" +" self.timeout)\n" +" if rd:\n" +" self.handle_request()\n" +" abort = self.abort\n" +"\n" +"def main():\n" +" logging.basicConfig(\n" +" format='%(relativeCreated)5d %(name)-15s %(levelname)-8s " +"%(message)s')\n" +" tcpserver = LogRecordSocketReceiver()\n" +" print('About to start TCP server...')\n" +" tcpserver.serve_until_stopped()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" + +#: ../../howto/logging-cookbook.rst:761 +msgid "" +"First run the server, and then the client. On the client side, nothing is " +"printed on the console; on the server side, you should see something like:" +msgstr "" +"先にサーバを起動しておき、次にクライアントを起動します。クライアント側では、" +"コンソールには何も出力されません; サーバ側では以下のようなメッセージを目にす" +"るはずです::" + +msgid "" +"About to start TCP server...\n" +" 59 root INFO Jackdaws love my big sphinx of quartz.\n" +" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" +" 69 myapp.area2 ERROR The five boxing wizards jump quickly." +msgstr "" +"About to start TCP server...\n" +" 59 root INFO Jackdaws love my big sphinx of quartz.\n" +" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" +" 69 myapp.area2 ERROR The five boxing wizards jump quickly." + +#: ../../howto/logging-cookbook.rst:773 +msgid "" +"Note that there are some security issues with pickle in some scenarios. If " +"these affect you, you can use an alternative serialization scheme by " +"overriding the :meth:`~SocketHandler.makePickle` method and implementing " +"your alternative there, as well as adapting the above script to use your " +"alternative serialization." +msgstr "" +"注意: pickle にはいくつかのシナリオでセキュリティ上の問題があります。これら" +"が影響する場合は、 :meth:`~SocketHandler.makePickle` メソッドをオーバーライド" +"し代替シリアライズ手法を実装して、それを使うように上記のスクリプトを修正する" +"こともできます。" + +msgid "Running a logging socket listener in production" +msgstr "本番環境でロギングソケットのリスナーを実行する" + +msgid "" +"To run a logging listener in production, you may need to use a process-" +"management tool such as `Supervisor `_. `Here is a " +"Gist `__ which provides the bare-bones files to run " +"the above functionality using Supervisor. It consists of the following files:" +msgstr "" +"本番環境でロギングリスナーを実行するには、`Supervisor `_ などのプロセス管理ツールが必要になる場合があります。\n" +"`こちらの Gist `__ には、上記の機能を Supervisor で実" +"行するための最小限のファイルが含まれています。\n" +"構成は次のとおりです:" + +#: ../../howto/logging-cookbook.rst:792 +msgid "File" +msgstr "ファイル" + +#: ../../howto/logging-cookbook.rst:792 +msgid "Purpose" +msgstr "目的" + +#: ../../howto/logging-cookbook.rst:794 +msgid ":file:`prepare.sh`" +msgstr ":file:`prepare.sh`" + +#: ../../howto/logging-cookbook.rst:794 +msgid "A Bash script to prepare the environment for testing" +msgstr "試験用の環境を準備する Bash スクリプト" + +#: ../../howto/logging-cookbook.rst:797 +msgid ":file:`supervisor.conf`" +msgstr ":file:`supervisor.conf`" + +#: ../../howto/logging-cookbook.rst:797 +msgid "" +"The Supervisor configuration file, which has entries for the listener and a " +"multi-process web application" +msgstr "" "リスナーとマルチプロセスの web アプリケーションのための設定を含む Supervisor " "の設定ファイル" @@ -1175,9 +1651,8 @@ msgstr "web アプリケーションのための JSON 設定ファイル" msgid ":file:`client.py`" msgstr ":file:`client.py`" -#: ../../howto/logging-cookbook.rst:812 msgid "A Python script to exercise the web application" -msgstr "web アプリケーションを起動するための Python スクリプト" +msgstr "Web アプリケーションの動作を試す Python スクリプト" #: ../../howto/logging-cookbook.rst:815 msgid "" @@ -1231,13 +1706,13 @@ msgstr "" "``bash ensure_app.sh`` を実行して Supervisor が上記の設定で実行されていること" "を確認してください。" -#: ../../howto/logging-cookbook.rst:835 msgid "" "Run ``venv/bin/python client.py`` to exercise the web application, which " "will lead to records being written to the log." msgstr "" -"``venv/bin/python client.py`` を実行して web アプリケーションを起動してくださ" -"い。これによりログにレコードが書き込まれるはずです。" +"``venv/bin/python client.py`` を実行して Web アプリケーションの動作を試してく" +"ださい。\n" +"これによりログにレコードが書き込まれます。" #: ../../howto/logging-cookbook.rst:838 msgid "" @@ -1267,32 +1742,36 @@ msgstr "" "ありそうもないことですが、テスト環境で設定したポートが別の設定と衝突してし" "まった場合、設定ファイルを修正する必要があるかもしれません。" -#: ../../howto/logging-cookbook.rst:849 msgid "" "The default configuration uses a TCP socket on port 9020. You can use a Unix " "Domain socket instead of a TCP socket by doing the following:" msgstr "" +"デフォルトの設定はポート 9020 の TCP ソケットを使います。\n" +"次の変更で、TCP ソケットの代わりに Unix ドメインソケットを使えます:" -#: ../../howto/logging-cookbook.rst:852 msgid "" "In :file:`listener.json`, add a ``socket`` key with the path to the domain " "socket you want to use. If this key is present, the listener listens on the " "corresponding domain socket and not on a TCP socket (the ``port`` key is " "ignored)." msgstr "" +":file:`listener.json` に ``socket`` キーを追加し、使うドメインソケットのパス" +"を指定します。\n" +"このキーがある場合、リスナーは TCP ソケットではなく、指定されたドメインソケッ" +"トで待ち受けます (``port`` キーは無視されます)。" -#: ../../howto/logging-cookbook.rst:857 msgid "" "In :file:`webapp.json`, change the socket handler configuration dictionary " "so that the ``host`` value is the path to the domain socket, and set the " "``port`` value to ``null``." msgstr "" +":file:`webapp.json` のソケットハンドラの設定辞書で、``host`` の値をドメインソ" +"ケットのパスに、``port`` の値を ``null`` に変更します。" #: ../../howto/logging-cookbook.rst:867 msgid "Adding contextual information to your logging output" msgstr "コンテキスト情報をログ記録出力に付加する" -#: ../../howto/logging-cookbook.rst:869 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -1307,17 +1786,18 @@ msgid "" "logging an application, it could be hard to manage if the number of :class:" "`Logger` instances becomes effectively unbounded." msgstr "" -"時にはログ記録出力にログ関数の呼び出し時に渡されたパラメータに加えてコンテキ" -"スト情報を含めたいこともあるでしょう。たとえば、ネットワークアプリケーション" -"で、クライアント固有の情報 (例: リモートクライアントの名前、 IP アドレス) も" -"ログ記録に残しておきたいと思ったとしましょう。 *extra* パラメータをこの目的に" -"使うこともできますが、いつでもこの方法で情報を渡すのが便利なやり方とも限りま" -"せん。また接続ごとに :class:`Logger` インスタンスを生成する誘惑に駆られるかも" -"しれませんが、生成した ``Logger`` インスタンスはガーベジコレクションで回収さ" -"れないので、これは良いアイデアとは言えません。この例は現実的な問題ではないか" -"もしれませんが、 :class:`Logger` インスタンスの個数がアプリケーションの中でロ" -"グ記録が行われるレベルの粒度に依存する場合、 :class:`Logger` インスタンスの個" -"数が事実上無制限にならないと、管理が難しくなります。" +"ログ呼び出しに渡す引数に加えて、コンテキスト情報もログに含めたい場合がありま" +"す。\n" +"例えばネットワークアプリケーションで、リモートクライアントのユーザー名や IP " +"アドレスなど、クライアント固有の情報を記録したい場合です。\n" +"*extra* パラメータで実現できますが、この方法で毎回情報を渡すのは便利とは限り" +"ません。\n" +"接続ごとに :class:`Logger` インスタンスを作りたくなるかもしれませんが、これら" +"はガベージコレクションで回収されないため、よい方法ではありません。\n" +":class:`Logger` インスタンスの数がアプリケーションのログ記録の粒度で決まるな" +"ら、実用上は問題ありません。\n" +"しかし :class:`Logger` インスタンスの数が事実上無制限になると、管理が難しくな" +"る可能性があります。" #: ../../howto/logging-cookbook.rst:884 msgid "Using LoggerAdapters to impart contextual information" @@ -1358,7 +1838,6 @@ msgstr "" "スト情報をその委譲された呼び出しに埋め込みます。 :class:`LoggerAdapter` の" "コードから少し抜き出してみます::" -#: ../../howto/logging-cookbook.rst:902 msgid "" "def debug(self, msg, /, *args, **kwargs):\n" " \"\"\"\n" @@ -1368,6 +1847,13 @@ msgid "" " msg, kwargs = self.process(msg, kwargs)\n" " self.logger.debug(msg, *args, **kwargs)" msgstr "" +"def debug(self, msg, /, *args, **kwargs):\n" +" \"\"\"\n" +" Delegate a debug call to the underlying logger, after adding\n" +" contextual information from this adapter instance.\n" +" \"\"\"\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.debug(msg, *args, **kwargs)" #: ../../howto/logging-cookbook.rst:910 msgid "" @@ -1408,7 +1894,6 @@ msgstr "" "要なだけです。次に挙げるのはこのクラスを使った例で、コンストラクタで使われる" "「辞書風」オブジェクトにどの振る舞いが必要なのかも示しています::" -#: ../../howto/logging-cookbook.rst:927 msgid "" "class CustomAdapter(logging.LoggerAdapter):\n" " \"\"\"\n" @@ -1418,16 +1903,24 @@ msgid "" " def process(self, msg, kwargs):\n" " return '[%s] %s' % (self.extra['connid'], msg), kwargs" msgstr "" +"class CustomAdapter(logging.LoggerAdapter):\n" +" \"\"\"\n" +" This example adapter expects the passed in dict-like object to have a\n" +" 'connid' key, whose value in brackets is prepended to the log message.\n" +" \"\"\"\n" +" def process(self, msg, kwargs):\n" +" return '[%s] %s' % (self.extra['connid'], msg), kwargs" #: ../../howto/logging-cookbook.rst:935 msgid "which you can use like this::" msgstr "これを次のように使うことができます::" -#: ../../howto/logging-cookbook.rst:937 msgid "" "logger = logging.getLogger(__name__)\n" "adapter = CustomAdapter(logger, {'connid': some_conn_id})" msgstr "" +"logger = logging.getLogger(__name__)\n" +"adapter = CustomAdapter(logger, {'connid': some_conn_id})" #: ../../howto/logging-cookbook.rst:940 msgid "" @@ -1490,7 +1983,6 @@ msgstr "" "といったようにです。その場合、同じフォーマット文字列を使って以下に示すように" "似たような出力を得られます。これはスクリプトの例です::" -#: ../../howto/logging-cookbook.rst:971 msgid "" "import logging\n" "from random import choice\n" @@ -1532,12 +2024,50 @@ msgid "" " a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, " "'parameters')" msgstr "" +"import logging\n" +"from random import choice\n" +"\n" +"class ContextFilter(logging.Filter):\n" +" \"\"\"\n" +" This is a filter which injects contextual information into the log.\n" +"\n" +" Rather than use actual contextual information, we just use random\n" +" data in this demo.\n" +" \"\"\"\n" +"\n" +" USERS = ['jim', 'fred', 'sheila']\n" +" IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']\n" +"\n" +" def filter(self, record):\n" +"\n" +" record.ip = choice(ContextFilter.IPS)\n" +" record.user = choice(ContextFilter.USERS)\n" +" return True\n" +"\n" +"if __name__ == '__main__':\n" +" levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, " +"logging.CRITICAL)\n" +" logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)-15s %(name)-5s %(levelname)-8s " +"IP: %(ip)-15s User: %(user)-8s %(message)s')\n" +" a1 = logging.getLogger('a.b.c')\n" +" a2 = logging.getLogger('d.e.f')\n" +"\n" +" f = ContextFilter()\n" +" a1.addFilter(f)\n" +" a2.addFilter(f)\n" +" a1.debug('A debug message')\n" +" a1.info('An info message with %s', 'some parameters')\n" +" for x in range(10):\n" +" lvl = choice(levels)\n" +" lvlname = logging.getLevelName(lvl)\n" +" a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, " +"'parameters')" #: ../../howto/logging-cookbook.rst:1008 msgid "which, when run, produces something like:" msgstr "実行すると、以下のようになります:" -#: ../../howto/logging-cookbook.rst:1010 msgid "" "2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A " "debug message\n" @@ -1564,12 +2094,35 @@ msgid "" "2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A " "message at INFO level with 2 parameters" msgstr "" +"2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A " +"debug message\n" +"2010-09-06 22:38:15,300 a.b.c INFO IP: 192.168.0.1 User: sheila An " +"info message with some parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 127.0.0.1 User: jim A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 127.0.0.1 User: sheila A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 123.231.231.123 User: fred A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1 User: jim A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 192.168.0.1 User: jim A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f ERROR IP: 127.0.0.1 User: sheila A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A " +"message at INFO level with 2 parameters" #: ../../howto/logging-cookbook.rst:1026 msgid "Use of ``contextvars``" msgstr "``contextvars`` の利用" -#: ../../howto/logging-cookbook.rst:1028 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -1578,12 +2131,11 @@ msgid "" "logs can populated with contextual information such as, for example, request " "attributes handled by web applications." msgstr "" -"Python 3.7 以降、 :mod:`contextvars` モジュールは :mod:`threading` と :mod:" -"`asyncio` の両方の処理上のニーズを満たすコンテキストローカルな変数を提供して" -"います。このタイプの変数はスレッドローカルな変数に適しています。以下の例は、" -"マルチスレッド環境において、 いかにして web アプリケーションによって処理され" -"るリクエスト属性のような処理の文脈上の情報とともにログを投入できるかを示しま" -"す。" +"Python 3.7 以降の :mod:`contextvars` モジュールは、:mod:`threading` と :mod:" +"`asyncio` の両方で使えるコンテキストローカルな記憶領域を提供します。\n" +"このため、一般にスレッドローカルな記憶領域より適している場合があります。\n" +"次の例では、マルチスレッド環境で Web アプリケーションが処理するリクエストの属" +"性など、コンテキスト情報をログに追加する方法を示します。" #: ../../howto/logging-cookbook.rst:1034 msgid "" @@ -1606,7 +2158,6 @@ msgstr "" msgid "Let's assume that the library can be simulated by the following code:" msgstr "ここで、ライブラリは以下のコードで模することができるとします:" -#: ../../howto/logging-cookbook.rst:1043 msgid "" "# webapplib.py\n" "import logging\n" @@ -1620,6 +2171,17 @@ msgid "" " # Just sleep for a bit so other threads get to run\n" " time.sleep(0.01)" msgstr "" +"# webapplib.py\n" +"import logging\n" +"import time\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def useful():\n" +" # ライブラリから記録する代表的なイベント\n" +" logger.debug('Hello from webapplib!')\n" +" # 他のスレッドが実行されるよう少し待つ\n" +" time.sleep(0.01)" #: ../../howto/logging-cookbook.rst:1057 msgid "" @@ -1787,7 +2349,6 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:1201 msgid "" "If you run the above, you should find that roughly half the requests go " "into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " @@ -1797,15 +2358,15 @@ msgid "" "dummy request will always appear together in a log line). This is " "illustrated by the following shell output:" msgstr "" -"上記のコードを実行すると、およそ半分のリクエストが :file:`app1.log` に、残り" -"半分が :file:`app2.log` にそれぞれ記録され、同時に全てのリクエストが :file:" -"`app.log` に記録されることがわかるでしょう。それぞれの web アプリケーション固" -"有のログはそれぞれのアプリケーションからのログエントリだけを含み、リクエスト" -"情報が矛盾なくログに表示されている (すなわち、各ダミーリクエストの情報は常に" -"ログの行とともに現れる) はずです。このことは以下のシェルコマンドの出力により" -"例示されています:" +"上のコードを実行すると、リクエストのおよそ半分が :file:`app1.log` に、残り" +"が :file:`app2.log` に記録され、すべてのリクエストが :file:`app.log` にも記録" +"されます。\n" +"各 Web アプリケーション専用のログには、そのアプリケーションのログエントリだけ" +"が含まれます。\n" +"また、リクエストの情報は一貫して表示されます。\n" +"つまり、各ダミーリクエストの情報は常に同じログ行にまとまって現れます。\n" +"次のシェル出力で確認できます:" -#: ../../howto/logging-cookbook.rst:1208 msgid "" "~/logging-contextual-webapp$ python main.py\n" "app1 processed 51 requests\n" @@ -1859,24 +2420,74 @@ msgid "" "~/logging-contextual-webapp$ grep app2 app.log | wc -l\n" "147" msgstr "" - -#: ../../howto/logging-cookbook.rst:1248 -msgid "Imparting contextual information in handlers" -msgstr "ハンドラ内でのコンテキスト情報の付与" - -#: ../../howto/logging-cookbook.rst:1250 -msgid "" -"Each :class:`~Handler` has its own chain of filters. If you want to add " -"contextual information to a :class:`LogRecord` without leaking it to other " -"handlers, you can use a filter that returns a new :class:`~LogRecord` " -"instead of modifying it in-place, as shown in the following script::" -msgstr "" -":class:`~Handler` はそれぞれ一連のフィルタを独自に持っています。コンテキスト" -"情報を、他のハンドラに漏らすことなく :class:`LogRecord` に付加したい場合、以" -"下に示すスクリプトのように、直接レコードを編集する代わりに新しい :class:" +"~/logging-contextual-webapp$ python main.py\n" +"app1 processed 51 requests\n" +"app2 processed 49 requests\n" +"~/logging-contextual-webapp$ wc -l *.log\n" +" 153 app1.log\n" +" 147 app2.log\n" +" 300 app.log\n" +" 600 total\n" +"~/logging-contextual-webapp$ head -3 app1.log\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " +"from webapplib!\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"~/logging-contextual-webapp$ head -3 app2.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " +"processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " +"from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " +"processing started\n" +"~/logging-contextual-webapp$ head app.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " +"processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " +"from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " +"processing started\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-2 (process_request) app2 webapplib jim 192.168.2.20 GET Hello " +"from webapplib!\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " +"from webapplib!\n" +"Thread-4 (process_request) app2 __main__ fred 192.168.2.22 GET Request " +"processing started\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-4 (process_request) app2 webapplib fred 192.168.2.22 GET Hello " +"from webapplib!\n" +"Thread-6 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"~/logging-contextual-webapp$ grep app1 app1.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app2.log | wc -l\n" +"147\n" +"~/logging-contextual-webapp$ grep app1 app.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app.log | wc -l\n" +"147" + +#: ../../howto/logging-cookbook.rst:1248 +msgid "Imparting contextual information in handlers" +msgstr "ハンドラ内でのコンテキスト情報の付与" + +#: ../../howto/logging-cookbook.rst:1250 +msgid "" +"Each :class:`~Handler` has its own chain of filters. If you want to add " +"contextual information to a :class:`LogRecord` without leaking it to other " +"handlers, you can use a filter that returns a new :class:`~LogRecord` " +"instead of modifying it in-place, as shown in the following script::" +msgstr "" +":class:`~Handler` はそれぞれ一連のフィルタを独自に持っています。コンテキスト" +"情報を、他のハンドラに漏らすことなく :class:`LogRecord` に付加したい場合、以" +"下に示すスクリプトのように、直接レコードを編集する代わりに新しい :class:" "`~LogRecord` を返すフィルタを使うことができます::" -#: ../../howto/logging-cookbook.rst:1255 msgid "" "import copy\n" "import logging\n" @@ -1897,12 +2508,29 @@ msgid "" "\n" " logger.info('A log message')" msgstr "" +"import copy\n" +"import logging\n" +"\n" +"def filter(record: logging.LogRecord):\n" +" record = copy.copy(record)\n" +" record.user = 'jim'\n" +" return record\n" +"\n" +"if __name__ == '__main__':\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.INFO)\n" +" handler = logging.StreamHandler()\n" +" formatter = logging.Formatter('%(message)s from %(user)-8s')\n" +" handler.setFormatter(formatter)\n" +" handler.addFilter(filter)\n" +" logger.addHandler(handler)\n" +"\n" +" logger.info('A log message')" #: ../../howto/logging-cookbook.rst:1277 msgid "Logging to a single file from multiple processes" msgstr "複数のプロセスからの単一ファイルへのログ記録" -#: ../../howto/logging-cookbook.rst:1279 msgid "" "Although logging is thread-safe, and logging to a single file from multiple " "threads in a single process *is* supported, logging to a single file from " @@ -1917,26 +2545,31 @@ msgid "" "includes a working socket receiver which can be used as a starting point for " "you to adapt in your own applications." msgstr "" -"ログ記録はスレッドセーフであり、単一プロセスの複数のスレッドからの単一ファイ" -"ルへのログ記録はサポート *されています* が、 *複数プロセス* からの単一ファイ" -"ルへのログ記録はサポート *されません* 。なぜなら、複数のプロセスをまたいで単" -"一のファイルへのアクセスを直列化する標準の方法が Python には存在しないからで" -"す。複数のプロセスから単一ファイルへログ記録しなければならないなら、最も良い" -"方法は、すべてのプロセスが :class:`~handlers.SocketHandler` に対してログ記録" -"を行い、独立したプロセスとしてソケットサーバを動かすことです。ソケットサーバ" -"はソケットから読み取ってファイルにログを書き出します。 (この機能を実行するた" -"めに、既存のプロセスの 1 つのスレッドを割り当てることもできます) :ref:`この" -"節 ` では、このアプローチをさらに詳細に文書化しています。動" -"作するソケット受信プログラムが含まれているので、アプリケーションに組み込むた" -"めの出発点として使用できるでしょう。" - -#: ../../howto/logging-cookbook.rst:1292 +"logging はスレッドセーフで、一つのプロセスの複数のスレッドから単一のファイル" +"にログを記録することはサポート *されています*。\n" +"一方、*複数のプロセス* から単一のファイルに記録することはサポート *されません" +"*。\n" +"Python には、複数のプロセスによる単一ファイルへのアクセスを直列化する標準的な" +"方法がないためです。\n" +"必要な場合は、すべてのプロセスで :class:`~handlers.SocketHandler` にログを送" +"り、別のプロセスにソケットサーバーを実装して、受信したログをファイルに書き込" +"む方法があります。\n" +"既存のプロセスの一つのスレッドを、この処理専用にすることもできます。\n" +":ref:`この節 ` ではこの方法を詳しく説明し、動作するソケット" +"受信プログラムも示しています。\n" +"自分のアプリケーションに合わせて変更する際の出発点として使えます。" + msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " "serialize access to the file from your processes. The stdlib :class:" "`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." msgstr "" +":mod:`multiprocessing` モジュールの :class:`~multiprocessing.Lock` クラスを使" +"い、複数のプロセスからファイルへのアクセスを直列化する独自のハンドラを作るこ" +"ともできます。\n" +"標準ライブラリの :class:`FileHandler` とそのサブクラスは :mod:" +"`multiprocessing` を使っていません。" #: ../../howto/logging-cookbook.rst:1299 msgid "" @@ -1961,7 +2594,6 @@ msgstr "" "listener とアプリケーション内の他のプロセスで完全に異なる設定を使う例になって" "いるので、各自の要求に応じたコードを書く叩き台になるでしょう::" -#: ../../howto/logging-cookbook.rst:1310 msgid "" "# You'll need these imports in your own code\n" "import logging\n" @@ -2080,6 +2712,114 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"# 自分のコードでもこれらのインポートが必要\n" +"import logging\n" +"import logging.handlers\n" +"import multiprocessing\n" +"\n" +"# 次の 2 行のインポートはこの実演用\n" +"from random import choice, random\n" +"import time\n" +"\n" +"#\n" +"# リスナーとワーカーのログ設定を定義できるよう、両プロセスの関数は\n" +"# そのプロセスのログを設定する呼び出し可能オブジェクトを\n" +"# configurer パラメーターで受け取る。これらの関数には、\n" +"# 通信に使うキューも渡す。\n" +"#\n" +"# 実際にはリスナーを自由に設定できるが、この単純な例では、\n" +"# リスナーは受信したレコードにレベルやフィルターの処理を適用しない。\n" +"# 通常は、除外されるイベントをプロセス間で送らないよう、\n" +"# ワーカープロセス側でこれらの処理を行うとよい。\n" +"#\n" +"# 結果を確認しやすいよう、ローテーションするファイルのサイズを小さくする。\n" +"def listener_configurer():\n" +" root = logging.getLogger()\n" +" h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)\n" +" f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s " +"%(levelname)-8s %(message)s')\n" +" h.setFormatter(f)\n" +" root.addHandler(h)\n" +"\n" +"# リスナープロセスの最上位のループ。キューからログイベント\n" +"# (LogRecord) を待ち受けて処理し、\n" +"# LogRecord の代わりに None を受け取ったら終了する。\n" +"def listener_process(queue, configurer):\n" +" configurer()\n" +" while True:\n" +" try:\n" +" record = queue.get()\n" +" if record is None: # 終了を伝える番兵としてリスナーに送る。\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record) # レベルやフィルターの処理を適用せず、その" +"まま記録する。\n" +" except Exception:\n" +" import sys, traceback\n" +" print('Whoops! Problem:', file=sys.stderr)\n" +" traceback.print_exc(file=sys.stderr)\n" +"\n" +"# この実演でランダムに選択するための配列\n" +"\n" +"LEVELS = [logging.DEBUG, logging.INFO, logging.WARNING,\n" +" logging.ERROR, logging.CRITICAL]\n" +"\n" +"LOGGERS = ['a.b.c', 'd.e.f']\n" +"\n" +"MESSAGES = [\n" +" 'Random message #1',\n" +" 'Random message #2',\n" +" 'Random message #3',\n" +"]\n" +"\n" +"# ワーカーの設定は、ワーカープロセスの実行開始時に行う。\n" +"# Windows では fork の動作に頼れないため、\n" +"# 各プロセスが開始時にログ設定のコードを実行する。\n" +"def worker_configurer(queue):\n" +" h = logging.handlers.QueueHandler(queue) # 必要なハンドラーはこの一つだ" +"け\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # 実演のためすべてのメッセージを送り、他のレベルやフィルターの処理は適用" +"しない。\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"# ワーカープロセスの最上位のループ。ランダムな間隔を空けて\n" +"# 10 個のイベントを記録してから終了する。\n" +"# print のメッセージは、何か動作していることを確認するためだけのもの。\n" +"def worker_process(queue, configurer):\n" +" configurer(queue)\n" +" name = multiprocessing.current_process().name\n" +" print('Worker started: %s' % name)\n" +" for i in range(10):\n" +" time.sleep(random())\n" +" logger = logging.getLogger(choice(LOGGERS))\n" +" level = choice(LEVELS)\n" +" message = choice(MESSAGES)\n" +" logger.log(level, message)\n" +" print('Worker finished: %s' % name)\n" +"\n" +"# 実演全体を制御する。キューを作成し、リスナーを作成して開始する。\n" +"# 10 個のワーカーを作成して開始し、終了を待つ。\n" +"# 最後にキューに None を送り、リスナーに終了を伝える。\n" +"def main():\n" +" queue = multiprocessing.Queue(-1)\n" +" listener = multiprocessing.Process(target=listener_process,\n" +" args=(queue, listener_configurer))\n" +" listener.start()\n" +" workers = []\n" +" for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +" for w in workers:\n" +" w.join()\n" +" queue.put_nowait(None)\n" +" listener.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" #: ../../howto/logging-cookbook.rst:1415 msgid "" @@ -2087,7 +2827,6 @@ msgid "" "separate thread::" msgstr "上のスクリプトの亜種で、logging をメインプロセスの別スレッドで行う例::" -#: ../../howto/logging-cookbook.rst:1418 msgid "" "import logging\n" "import logging.config\n" @@ -2183,6 +2922,99 @@ msgid "" " q.put(None)\n" " lp.join()" msgstr "" +"import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue\n" +"import random\n" +"import threading\n" +"import time\n" +"\n" +"def logger_thread(q):\n" +" while True:\n" +" record = q.get()\n" +" if record is None:\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record)\n" +"\n" +"\n" +"def worker_process(q):\n" +" qh = logging.handlers.QueueHandler(q)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(qh)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" +"\n" +"if __name__ == '__main__':\n" +" q = Queue()\n" +" d = {\n" +" 'version': 1,\n" +" 'formatters': {\n" +" 'detailed': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " +"%(processName)-10s %(message)s'\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'level': 'INFO',\n" +" },\n" +" 'file': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'foofile': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-foo.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'errors': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-errors.log',\n" +" 'mode': 'w',\n" +" 'level': 'ERROR',\n" +" 'formatter': 'detailed',\n" +" },\n" +" },\n" +" 'loggers': {\n" +" 'foo': {\n" +" 'handlers': ['foofile']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console', 'file', 'errors']\n" +" },\n" +" }\n" +" workers = []\n" +" for i in range(5):\n" +" wp = Process(target=worker_process, name='worker %d' % (i + 1), " +"args=(q,))\n" +" workers.append(wp)\n" +" wp.start()\n" +" logging.config.dictConfig(d)\n" +" lp = threading.Thread(target=logger_thread, args=(q,))\n" +" lp.start()\n" +" # この時点で、メインプロセスは独自の仕事を行える\n" +" # それが終わったら、ワーカーの終了を待てる。\n" +" for wp in workers:\n" +" wp.join()\n" +" # ログ用のスレッドにも終了を伝える\n" +" q.put(None)\n" +" lp.join()" #: ../../howto/logging-cookbook.rst:1510 msgid "" @@ -2213,25 +3045,24 @@ msgstr "" "ProcessPoolExecutor` を使いたいのであれば、少し違う方法でキューを作る必要があ" "ります。次のような方法の代わりに" -#: ../../howto/logging-cookbook.rst:1523 msgid "queue = multiprocessing.Queue(-1)" -msgstr "" +msgstr "queue = multiprocessing.Queue(-1)" #: ../../howto/logging-cookbook.rst:1527 msgid "you should use" msgstr "次のコードを利用する必要があります" -#: ../../howto/logging-cookbook.rst:1529 msgid "" "queue = multiprocessing.Manager().Queue(-1) # also works with the examples " "above" msgstr "" +"queue = multiprocessing.Manager().Queue(-1) # also works with the examples " +"above" #: ../../howto/logging-cookbook.rst:1533 msgid "and you can then replace the worker creation from this::" msgstr "そして、次のようなワーカー作成コードがあったとすると::" -#: ../../howto/logging-cookbook.rst:1535 msgid "" "workers = []\n" "for i in range(10):\n" @@ -2242,25 +3073,33 @@ msgid "" "for w in workers:\n" " w.join()" msgstr "" - +"workers = []\n" +"for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +"for w in workers:\n" +" w.join()" + #: ../../howto/logging-cookbook.rst:1544 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" "次のように変更します(最初に :mod:`concurrent.futures` をインポートするのを忘" "れないようにしましょう)::" -#: ../../howto/logging-cookbook.rst:1546 msgid "" "with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" " for i in range(10):\n" " executor.submit(worker_process, queue, worker_configurer)" msgstr "" +"with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" +" for i in range(10):\n" +" executor.submit(worker_process, queue, worker_configurer)" -#: ../../howto/logging-cookbook.rst:1551 msgid "Deploying web applications using Gunicorn and uWSGI" -msgstr "" +msgstr "Gunicorn や uWSGI を使った Web アプリケーションのデプロイ" -#: ../../howto/logging-cookbook.rst:1553 msgid "" "When deploying web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -2271,6 +3110,17 @@ msgid "" "process management tool such as Supervisor - see `Running a logging socket " "listener in production`_ for more details." msgstr "" +"`Gunicorn `_ や `uWSGI `_ などで Web アプリケーションをデプロイすると、ク" +"ライアントのリクエストを処理するために複数のワーカープロセスが作成されま" +"す。\n" +"このような環境では、Web アプリケーション内でファイルに書き込むハンドラを直接" +"作成することは避けてください。\n" +"代わりに :class:`SocketHandler` を使い、Web アプリケーションから別のプロセス" +"のリスナーにログを送ります。\n" +"Supervisor などのプロセス管理ツールで構成できます。\n" +"詳細は `本番環境でロギングソケットのリスナーを実行する `_ を参照してください。" #: ../../howto/logging-cookbook.rst:1563 msgid "Using file rotation" @@ -2290,7 +3140,6 @@ msgstr "" "利用パターンのために、 logging パッケージは :class:`RotatingFileHandler` を提" "供しています::" -#: ../../howto/logging-cookbook.rst:1571 msgid "" "import glob\n" "import logging\n" @@ -2318,6 +3167,31 @@ msgid "" "for filename in logfiles:\n" " print(filename)" msgstr "" +"import glob\n" +"import logging\n" +"import logging.handlers\n" +"\n" +"LOG_FILENAME = 'logging_rotatingfile_example.out'\n" +"\n" +"# 目的の出力レベルを持つロガーを設定する\n" +"my_logger = logging.getLogger('MyLogger')\n" +"my_logger.setLevel(logging.DEBUG)\n" +"\n" +"# ログメッセージのハンドラーをロガーに追加する\n" +"handler = logging.handlers.RotatingFileHandler(\n" +" LOG_FILENAME, maxBytes=20, backupCount=5)\n" +"\n" +"my_logger.addHandler(handler)\n" +"\n" +"# メッセージを記録する\n" +"for i in range(20):\n" +" my_logger.debug('i = %d' % i)\n" +"\n" +"# 作成されたファイルを確認する\n" +"logfiles = glob.glob('%s*' % LOG_FILENAME)\n" +"\n" +"for filename in logfiles:\n" +" print(filename)" #: ../../howto/logging-cookbook.rst:1597 msgid "" @@ -2327,7 +3201,6 @@ msgstr "" "この結果として、アプリケーションのログ履歴の一部である、6 つに別れたファイル" "が得られます:" -#: ../../howto/logging-cookbook.rst:1600 msgid "" "logging_rotatingfile_example.out\n" "logging_rotatingfile_example.out.1\n" @@ -2336,6 +3209,12 @@ msgid "" "logging_rotatingfile_example.out.4\n" "logging_rotatingfile_example.out.5" msgstr "" +"logging_rotatingfile_example.out\n" +"logging_rotatingfile_example.out.1\n" +"logging_rotatingfile_example.out.2\n" +"logging_rotatingfile_example.out.3\n" +"logging_rotatingfile_example.out.4\n" +"logging_rotatingfile_example.out.5" #: ../../howto/logging-cookbook.rst:1609 msgid "" @@ -2394,7 +3273,6 @@ msgstr "" "で、 :meth:`str.format` か :class:`string.Template` を使った format を指定す" "る事ができます。次の例はこの機能を使ってみています:" -#: ../../howto/logging-cookbook.rst:1640 msgid "" ">>> import logging\n" ">>> root = logging.getLogger()\n" @@ -2418,6 +3296,27 @@ msgid "" "2010-10-28 15:13:11,494 foo.bar CRITICAL This is a CRITICAL message\n" ">>>" msgstr "" +">>> import logging\n" +">>> root = logging.getLogger()\n" +">>> root.setLevel(logging.DEBUG)\n" +">>> handler = logging.StreamHandler()\n" +">>> bf = logging.Formatter('{asctime} {name} {levelname:8s} {message}',\n" +"... style='{')\n" +">>> handler.setFormatter(bf)\n" +">>> root.addHandler(handler)\n" +">>> logger = logging.getLogger('foo.bar')\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:11:55,341 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:12:11,526 foo.bar CRITICAL This is a CRITICAL message\n" +">>> df = logging.Formatter('$asctime $name ${levelname} $message',\n" +"... style='$')\n" +">>> handler.setFormatter(df)\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:13:06,924 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:13:11,494 foo.bar CRITICAL This is a CRITICAL message\n" +">>>" #: ../../howto/logging-cookbook.rst:1664 msgid "" @@ -2429,12 +3328,14 @@ msgstr "" "全に独立していることに注意してください。次の例でわかるように、メッセージを生" "成する部分では % を使い続けています::" -#: ../../howto/logging-cookbook.rst:1668 msgid "" ">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" "2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" ">>>" msgstr "" +">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" +"2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" +">>>" #: ../../howto/logging-cookbook.rst:1672 msgid "" @@ -2474,7 +3375,6 @@ msgstr "" "logging パッケージはそのオブジェクトに対して ``str()`` を使って実際の format " "文字列を生成します。次の2つのクラスを見てください::" -#: ../../howto/logging-cookbook.rst:1691 ../../howto/logging-cookbook.rst:2779 msgid "" "class BraceMessage:\n" " def __init__(self, fmt, /, *args, **kwargs):\n" @@ -2494,6 +3394,23 @@ msgid "" " from string import Template\n" " return Template(self.fmt).substitute(**self.kwargs)" msgstr "" +"class BraceMessage:\n" +" def __init__(self, fmt, /, *args, **kwargs):\n" +" self.fmt = fmt\n" +" self.args = args\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args, **self.kwargs)\n" +"\n" +"class DollarMessage:\n" +" def __init__(self, fmt, /, **kwargs):\n" +" self.fmt = fmt\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" from string import Template\n" +" return Template(self.fmt).substitute(**self.kwargs)" #: ../../howto/logging-cookbook.rst:1709 msgid "" @@ -2522,7 +3439,6 @@ msgstr "" "です。これらは次の例のようにして利用できます。(上のクラスが ``wherever`` とい" "うモジュールで定義されていると仮定します):" -#: ../../howto/logging-cookbook.rst:1721 msgid "" ">>> from wherever import BraceMessage as __\n" ">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" @@ -2540,6 +3456,21 @@ msgid "" "Message with 2 placeholders\n" ">>>" msgstr "" +">>> from wherever import BraceMessage as __\n" +">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})',\n" +"... point=p))\n" +"Message with coordinates: (0.50, 0.50)\n" +">>> from wherever import DollarMessage as __\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" #: ../../howto/logging-cookbook.rst:1739 msgid "" @@ -2576,7 +3507,6 @@ msgstr "" "次の例のように、 :class:`LoggerAdapter` を利用して上と似たような効果を実現す" "る方法もあります::" -#: ../../howto/logging-cookbook.rst:1754 msgid "" "import logging\n" "\n" @@ -2604,6 +3534,31 @@ msgid "" " logging.basicConfig(level=logging.DEBUG)\n" " main()" msgstr "" +"import logging\n" +"\n" +"class Message:\n" +" def __init__(self, fmt, args):\n" +" self.fmt = fmt\n" +" self.args = args\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args)\n" +"\n" +"class StyleAdapter(logging.LoggerAdapter):\n" +" def log(self, level, msg, /, *args, stacklevel=1, **kwargs):\n" +" if self.isEnabledFor(level):\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.log(level, Message(msg, args), **kwargs,\n" +" stacklevel=stacklevel+1)\n" +"\n" +"logger = StyleAdapter(logging.getLogger(__name__))\n" +"\n" +"def main():\n" +" logger.debug('Hello, {}', 'world!')\n" +"\n" +"if __name__ == '__main__':\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" main()" #: ../../howto/logging-cookbook.rst:1780 msgid "" @@ -2617,7 +3572,6 @@ msgstr "" msgid "Customizing ``LogRecord``" msgstr "``LogRecord`` のカスタマイズ" -#: ../../howto/logging-cookbook.rst:1791 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -2627,19 +3581,20 @@ msgid "" "disabled). Before Python 3.2, there were only two places where this creation " "was done:" msgstr "" -"全ての logging イベントは :class:`LogRecord` のインスタンスとして表現されま" -"す。イベントのログが取られて logger のレベルでフィルタされなかった場合、イベ" -"ントの情報を含む :class:`LogRecord` が生成され、その logger (と、 propagate " -"が無効になるまでの上位 logger) の handler に渡されます。 Python 3.2 までは、" -"この生成が行われているのは2箇所だけでした:" +"すべてのログイベントは :class:`LogRecord` インスタンスで表されます。\n" +"ログ呼び出しが行われ、ロガーのレベルで除外されなければ、イベントの情報を格納" +"した :class:`LogRecord` が作成されます。\n" +"これはそのロガーのハンドラと、階層の上方向への伝播が無効になっているロガーま" +"での、祖先ロガーのハンドラに渡されます (伝播が無効なロガー自身も含みます)。\n" +"Python 3.2 より前では、レコードを作成する箇所は次の二つだけでした:" -#: ../../howto/logging-cookbook.rst:1798 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -":meth:`Logger.makeRecord`: 通常のイベント logging プロセスで呼ばれます。これ" -"は :class:`LogRecord` を直接読んでインスタンスを生成します。" +":meth:`Logger.makeRecord` は、通常のログイベントの処理中に呼び出されます。\n" +"このメソッドは :class:`LogRecord` を直接呼び出してインスタンスを作成していま" +"した。" #: ../../howto/logging-cookbook.rst:1801 msgid "" @@ -2662,15 +3617,14 @@ msgstr "" "そのために :class:`LogRecord` で何か特別なことをしたい場合は、次のどちらかを" "しなければなりません。" -#: ../../howto/logging-cookbook.rst:1810 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -":meth:`Logger.makeRecord` をオーバーライドした独自の :class:`Logger` のサブク" -"ラスを作り、利用したい logger のどれかがインスタンス化される前に、それを :" -"func:`~logging.setLoggerClass` を使って登録する。" +":meth:`Logger.makeRecord` をオーバーライドする独自の :class:`Logger` サブクラ" +"スを作り、対象とするロガーが一つでもインスタンス化される前に、:func:" +"`~logging.setLoggerClass` で登録する。" #: ../../howto/logging-cookbook.rst:1813 msgid "" @@ -2706,9 +3660,8 @@ msgstr "" "れずに設定しないといけなくなります。 (新しいパッケージやモジュールを追加し、" "モジュールレベルで次の式を実行することで、新しい logger が作られます) ::" -#: ../../howto/logging-cookbook.rst:1828 msgid "logger = logging.getLogger(__name__)" -msgstr "" +msgstr "logger = logging.getLogger(__name__)" #: ../../howto/logging-cookbook.rst:1830 msgid "" @@ -2787,13 +3740,11 @@ msgstr "" "しての実行時のオーバーヘッドになることを念頭に置き、このテクニックは :class:" "`Filter` を利用するだけでは望む結果が得られない場合にのみ使うべきです。" -#: ../../howto/logging-cookbook.rst:1868 msgid "Subclassing QueueHandler and QueueListener- a ZeroMQ example" -msgstr "" +msgstr "QueueHandler と QueueListener のサブクラス化: ZeroMQ の例" -#: ../../howto/logging-cookbook.rst:1871 ../../howto/logging-cookbook.rst:2004 msgid "Subclass ``QueueHandler``" -msgstr "" +msgstr "``QueueHandler`` のサブクラス化" #: ../../howto/logging-cookbook.rst:1873 msgid "" @@ -2805,7 +3756,6 @@ msgstr "" "ZeroMQ の 'publish' ソケットに送信することができます。下の例では、ソケットを" "別に作ってそれを handler に ('queue' として) 渡します::" -#: ../../howto/logging-cookbook.rst:1877 msgid "" "import zmq # using pyzmq, the Python binding for ZeroMQ\n" "import json # for serializing records portably\n" @@ -2821,6 +3771,19 @@ msgid "" "\n" "handler = ZeroMQSocketHandler(sock)" msgstr "" +"import zmq # using pyzmq, the Python binding for ZeroMQ\n" +"import json # for serializing records portably\n" +"\n" +"ctx = zmq.Context()\n" +"sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value\n" +"sock.bind('tcp://*:5556') # or wherever\n" +"\n" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +"\n" +"handler = ZeroMQSocketHandler(sock)" #: ../../howto/logging-cookbook.rst:1892 msgid "" @@ -2830,7 +3793,6 @@ msgstr "" "もちろん同じことを別の設計でもできます。socket を作るのに必要な情報を " "handler に渡す例です::" -#: ../../howto/logging-cookbook.rst:1895 msgid "" "class ZeroMQSocketHandler(QueueHandler):\n" " def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" @@ -2845,10 +3807,21 @@ msgid "" " def close(self):\n" " self.queue.close()" msgstr "" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" +" self.ctx = ctx or zmq.Context()\n" +" socket = zmq.Socket(self.ctx, socktype)\n" +" socket.bind(uri)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +" def close(self):\n" +" self.queue.close()" -#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:1940 msgid "Subclass ``QueueListener``" -msgstr "" +msgstr "``QueueListener`` のサブクラス化" #: ../../howto/logging-cookbook.rst:1912 msgid "" @@ -2874,11 +3847,9 @@ msgid "" " return logging.makeLogRecord(msg)" msgstr "" -#: ../../howto/logging-cookbook.rst:1930 msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" -msgstr "" +msgstr "QueueHandler と QueueListener のサブクラス化: ``pynng`` の例" -#: ../../howto/logging-cookbook.rst:1932 msgid "" "In a similar way to the above section, we can implement a listener and " "handler using :pypi:`pynng`, which is a Python binding to `NNG `_ の Python バインディングです。\n" +"以下のコードは ``pynng`` をインストールした環境で試せます。\n" +"今回は順序を変えて、リスナーから示します。" -#: ../../howto/logging-cookbook.rst:1942 msgid "" "# listener.py\n" "import json\n" @@ -2948,8 +3924,65 @@ msgid "" "finally:\n" " listener.stop()" msgstr "" +"# listener.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"interrupted = False\n" +"\n" +"class NNGSocketListener(logging.handlers.QueueListener):\n" +"\n" +" def __init__(self, uri, /, *handlers, **kwargs):\n" +" # 中断できるようタイムアウトを設定し、\n" +" # 購読用のソケットを開く\n" +" socket = pynng.Sub0(listen=uri, recv_timeout=500)\n" +" # b'' の購読設定はすべてのトピックに一致する\n" +" topics = kwargs.pop('topics', None) or b''\n" +" socket.subscribe(topics)\n" +" # ソケットをキューとして扱う\n" +" super().__init__(socket, *handlers, **kwargs)\n" +"\n" +" def dequeue(self, block):\n" +" data = None\n" +" # 中断されず、ソケットからデータを受信していない間は\n" +" # ループを続ける\n" +" while not interrupted:\n" +" try:\n" +" data = self.queue.recv(block=block)\n" +" break\n" +" except pynng.Timeout:\n" +" pass\n" +" except pynng.Closed: # Ctrl-C を押すと起こることがある\n" +" break\n" +" if data is None:\n" +" return None\n" +" # 発行者から送られたログイベントを取得する\n" +" event = json.loads(data.decode('utf-8'))\n" +" return logging.makeLogRecord(event)\n" +"\n" +" def enqueue_sentinel(self):\n" +" # ソケットは実際にはキューではないため、\n" +" # この実装では使わない\n" +" pass\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"listener = NNGSocketListener(DEFAULT_ADDR, logging.StreamHandler(), " +"topics=b'')\n" +"listener.start()\n" +"print('Press Ctrl-C to stop.')\n" +"try:\n" +" while True:\n" +" pass\n" +"except KeyboardInterrupt:\n" +" interrupted = True\n" +"finally:\n" +" listener.stop()" -#: ../../howto/logging-cookbook.rst:2008 msgid "" "# sender.py\n" "import json\n" @@ -2997,15 +4030,62 @@ msgid "" " delay = random.random() * 2 + 0.5\n" " time.sleep(delay)" msgstr "" +"# sender.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"import time\n" +"import random\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"class NNGSocketHandler(logging.handlers.QueueHandler):\n" +"\n" +" def __init__(self, uri):\n" +" socket = pynng.Pub0(dial=uri, send_timeout=500)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" # レコードを UTF-8 でエンコードした JSON として送る\n" +" d = dict(record.__dict__)\n" +" data = json.dumps(d)\n" +" self.queue.send(data.encode('utf-8'))\n" +"\n" +" def close(self):\n" +" self.queue.close()\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"handler = NNGSocketHandler(DEFAULT_ADDR)\n" +"# 出力にプロセス ID を含める\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" handlers=[logging.StreamHandler(), handler],\n" +" format='%(levelname)-8s %(name)10s %(process)6s " +"%(message)s')\n" +"levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"logger_names = ('myapp', 'myapp.lib1', 'myapp.lib2')\n" +"msgno = 1\n" +"while True:\n" +" # ロガーとレベルをランダムに選んで記録する\n" +" level = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(logger_names))\n" +" logger.log(level, 'Message no. %5d' % msgno)\n" +" msgno += 1\n" +" delay = random.random() * 2 + 0.5\n" +" time.sleep(delay)" -#: ../../howto/logging-cookbook.rst:2055 msgid "" "You can run the above two snippets in separate command shells. If we run the " "listener in one shell and run the sender in two separate shells, we should " "see something like the following. In the first sender shell:" msgstr "" +"上の二つのコードは別々のシェルで実行できます。\n" +"一つのシェルでリスナーを、別の二つのシェルで送信側を実行すると、次のような出" +"力になります。\n" +"一つ目の送信側のシェルでは:" -#: ../../howto/logging-cookbook.rst:2059 msgid "" "$ python sender.py\n" "DEBUG myapp 613 Message no. 1\n" @@ -3018,12 +4098,20 @@ msgid "" "INFO myapp.lib1 613 Message no. 8\n" "(and so on)" msgstr "" +"$ python sender.py\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"(and so on)" -#: ../../howto/logging-cookbook.rst:2072 msgid "In the second sender shell:" -msgstr "" +msgstr "二つ目の送信側のシェルでは:" -#: ../../howto/logging-cookbook.rst:2074 msgid "" "$ python sender.py\n" "INFO myapp.lib2 657 Message no. 1\n" @@ -3036,12 +4124,20 @@ msgid "" "DEBUG myapp.lib1 657 Message no. 8\n" "(and so on)" msgstr "" - -#: ../../howto/logging-cookbook.rst:2087 -msgid "In the listener shell:" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2089 +"$ python sender.py\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(and so on)" + +msgid "In the listener shell:" +msgstr "リスナーのシェルでは:" + msgid "" "$ python listener.py\n" "Press Ctrl-C to stop.\n" @@ -3063,12 +4159,31 @@ msgid "" "DEBUG myapp.lib1 657 Message no. 8\n" "(and so on)" msgstr "" +"$ python listener.py\n" +"Press Ctrl-C to stop.\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(and so on)" -#: ../../howto/logging-cookbook.rst:2111 msgid "" "As you can see, the logging from the two sender processes is interleaved in " "the listener's output." msgstr "" +"このように、リスナーの出力には二つの送信プロセスのログが入り交じっています。" #: ../../howto/logging-cookbook.rst:2116 msgid "An example dictionary-based configuration" @@ -3086,7 +4201,6 @@ msgstr "" "#configuring-logging>`_ から持ってきました。この辞書を :func:`~config." "dictConfig` に渡して設定を有効にします::" -#: ../../howto/logging-cookbook.rst:2122 msgid "" "LOGGING = {\n" " 'version': 1,\n" @@ -3138,6 +4252,55 @@ msgid "" " }\n" "}" msgstr "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'verbose': {\n" +" 'format': '{levelname} {asctime} {module} {process:d} {thread:d} " +"{message}',\n" +" 'style': '{',\n" +" },\n" +" 'simple': {\n" +" 'format': '{levelname} {message}',\n" +" 'style': '{',\n" +" },\n" +" },\n" +" 'filters': {\n" +" 'special': {\n" +" '()': 'project.logging.SpecialFilter',\n" +" 'foo': 'bar',\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'level': 'INFO',\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'simple',\n" +" },\n" +" 'mail_admins': {\n" +" 'level': 'ERROR',\n" +" 'class': 'django.utils.log.AdminEmailHandler',\n" +" 'filters': ['special']\n" +" }\n" +" },\n" +" 'loggers': {\n" +" 'django': {\n" +" 'handlers': ['console'],\n" +" 'propagate': True,\n" +" },\n" +" 'django.request': {\n" +" 'handlers': ['mail_admins'],\n" +" 'level': 'ERROR',\n" +" 'propagate': False,\n" +" },\n" +" 'myproject.custom': {\n" +" 'handlers': ['console', 'mail_admins'],\n" +" 'level': 'INFO',\n" +" 'filters': ['special']\n" +" }\n" +" }\n" +"}" #: ../../howto/logging-cookbook.rst:2171 msgid "" @@ -3161,7 +4324,6 @@ msgstr "" "namer と rotator を定義する方法の例は以下の実行可能なスクリプトに示されていま" "す。ここではログファイルを gzip により圧縮する例を示しています::" -#: ../../howto/logging-cookbook.rst:2183 msgid "" "import gzip\n" "import logging\n" @@ -3192,6 +4354,34 @@ msgid "" "for i in range(1000):\n" " root.info(f'Message no. {i + 1}')" msgstr "" +"import gzip\n" +"import logging\n" +"import logging.handlers\n" +"import os\n" +"import shutil\n" +"\n" +"def namer(name):\n" +" return name + \".gz\"\n" +"\n" +"def rotator(source, dest):\n" +" with open(source, 'rb') as f_in:\n" +" with gzip.open(dest, 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)\n" +" os.remove(source)\n" +"\n" +"\n" +"rh = logging.handlers.RotatingFileHandler('rotated.log', maxBytes=128, " +"backupCount=5)\n" +"rh.rotator = rotator\n" +"rh.namer = namer\n" +"\n" +"root = logging.getLogger()\n" +"root.setLevel(logging.INFO)\n" +"root.addHandler(rh)\n" +"f = logging.Formatter('%(asctime)s %(message)s')\n" +"rh.setFormatter(f)\n" +"for i in range(1000):\n" +" root.info(f'Message no. {i + 1}')" #: ../../howto/logging-cookbook.rst:2211 msgid "" @@ -3200,7 +4390,6 @@ msgstr "" "このスクリプトを実行すると、6つの新しいファイルが生成され、そのうち5つは圧縮" "されています:" -#: ../../howto/logging-cookbook.rst:2213 msgid "" "$ ls rotated.log*\n" "rotated.log rotated.log.2.gz rotated.log.4.gz\n" @@ -3210,6 +4399,13 @@ msgid "" "2023-01-20 02:28:17,767 Message no. 997\n" "2023-01-20 02:28:17,767 Message no. 998" msgstr "" +"$ ls rotated.log*\n" +"rotated.log rotated.log.2.gz rotated.log.4.gz\n" +"rotated.log.1.gz rotated.log.3.gz rotated.log.5.gz\n" +"$ zcat rotated.log.1.gz\n" +"2023-01-20 02:28:17,767 Message no. 996\n" +"2023-01-20 02:28:17,767 Message no. 997\n" +"2023-01-20 02:28:17,767 Message no. 998" #: ../../howto/logging-cookbook.rst:2224 msgid "A more elaborate multiprocessing example" @@ -3526,9 +4722,8 @@ msgstr "" ":class:`~logging.handlers.SysLogHandler` のインスタンスに、次のような format " "文字列を持った :class:`~logging.Formatter` インスタンスをアタッチする::" -#: ../../howto/logging-cookbook.rst:2477 msgid "'ASCII section\\ufeffUnicode section'" -msgstr "" +msgstr "'ASCII section\\ufeffUnicode section'" #: ../../howto/logging-cookbook.rst:2479 msgid "" @@ -3595,7 +4790,6 @@ msgstr "" "実現する方法は幾つもありますが、次の例は JSON を使ってイベントを、機械でパー" "スできる形にシリアライズする単純な方法です::" -#: ../../howto/logging-cookbook.rst:2507 msgid "" "import json\n" "import logging\n" @@ -3613,16 +4807,32 @@ msgid "" "logging.basicConfig(level=logging.INFO, format='%(message)s')\n" "logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" msgstr "" +"import json\n" +"import logging\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return '%s >>> %s' % (self.message, json.dumps(self.kwargs))\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +"logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" #: ../../howto/logging-cookbook.rst:2523 msgid "If the above script is run, it prints:" msgstr "上のスクリプトを実行すると次のように出力されます:" -#: ../../howto/logging-cookbook.rst:2525 msgid "" "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " "\"bar\"}" msgstr "" +"message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " +"\"bar\"}" #: ../../howto/logging-cookbook.rst:2529 ../../howto/logging-cookbook.rst:2571 msgid "" @@ -3638,7 +4848,6 @@ msgstr "" "より特殊な処理が必要な場合、次の例のように、カスタムの JSON エンコーダを作る" "ことができます::" -#: ../../howto/logging-cookbook.rst:2535 msgid "" "import json\n" "import logging\n" @@ -3670,20 +4879,47 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import json\n" +"import logging\n" +"\n" +"\n" +"class Encoder(json.JSONEncoder):\n" +" def default(self, o):\n" +" if isinstance(o, set):\n" +" return tuple(o)\n" +" elif isinstance(o, str):\n" +" return o.encode('unicode_escape').decode('ascii')\n" +" return super().default(o)\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" s = Encoder().encode(self.kwargs)\n" +" return '%s >>> %s' % (self.message, s)\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +" logging.info(_('message 1', set_value={1, 2, 3}, snowman='\\u2603'))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" #: ../../howto/logging-cookbook.rst:2565 msgid "When the above script is run, it prints:" msgstr "上のスクリプトを実行すると次のように出力されます:" -#: ../../howto/logging-cookbook.rst:2567 msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" -msgstr "" +msgstr "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" #: ../../howto/logging-cookbook.rst:2580 msgid "Customizing handlers with :func:`dictConfig`" msgstr "handler を :func:`dictConfig` を使ってカスタマイズする" -#: ../../howto/logging-cookbook.rst:2582 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -3692,14 +4928,13 @@ msgid "" "the file handlers in the stdlib don't offer built-in support. You can " "customize handler creation using a plain function such as::" msgstr "" -"logging handler に特定のカスタマイズを何度もしたい場合で、 :func:" -"`dictConfig` を使っているなら、サブクラスを作らなくてもカスタマイズが可能で" -"す。例えば、ログファイルの owner を設定したいとします。これは POSIX 環境で" -"は :func:`shutil.chown` を使って簡単に実現できますが、標準ライブラリの file " -"handler はこの機能を組み込みでサポートしていません。 handler の生成を通常の関" -"数を使ってカスタマイズすることができます::" +"ロギングハンドラを特定の方法でカスタマイズしたい場合、:func:`dictConfig` を使" +"えばサブクラスを作らずに実現できることがあります。\n" +"例えば、ログファイルの所有者を設定したいとします。\n" +"POSIX では :func:`shutil.chown` で簡単に設定できますが、標準ライブラリのファ" +"イルハンドラにはその機能が組み込まれていません。\n" +"次のような通常の関数で、ハンドラの作成をカスタマイズできます。 ::" -#: ../../howto/logging-cookbook.rst:2589 msgid "" "def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" " if owner:\n" @@ -3708,6 +4943,12 @@ msgid "" " shutil.chown(filename, *owner)\n" " return logging.FileHandler(filename, mode, encoding)" msgstr "" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)" #: ../../howto/logging-cookbook.rst:2596 msgid "" @@ -3717,7 +4958,6 @@ msgstr "" "そして、 :func:`dictConfig` に渡される構成設定の中で、この関数を使って " "logging handler を生成するように指定することができます::" -#: ../../howto/logging-cookbook.rst:2599 msgid "" "LOGGING = {\n" " 'version': 1,\n" @@ -3749,6 +4989,35 @@ msgid "" " },\n" "}" msgstr "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # 以下の値はこの辞書から取り出して削除し、\n" +" # ハンドラーの作成、レベルの設定、\n" +" # フォーマッターの設定に使う。\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # 以下の値は、ハンドラーを作成する呼び出し可能オブジェクトに\n" +" # キーワード引数として渡す。\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}" #: ../../howto/logging-cookbook.rst:2629 msgid "" @@ -3759,7 +5028,6 @@ msgstr "" "この例は説明用のものですが、owner の user と group を ``pulse`` に設定してい" "ます。これを動くスクリプトに ``chowntest.py`` に組み込んでみます::" -#: ../../howto/logging-cookbook.rst:2633 msgid "" "import logging, logging.config, os, shutil\n" "\n" @@ -3804,12 +5072,53 @@ msgid "" "logger = logging.getLogger('mylogger')\n" "logger.debug('A debug message')" msgstr "" +"import logging, logging.config, os, shutil\n" +"\n" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # 以下の値はこの辞書から取り出して削除し、\n" +" # ハンドラーの作成、レベルの設定、\n" +" # フォーマッターの設定に使う。\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # 以下の値は、ハンドラーを作成する呼び出し可能オブジェクトに\n" +" # キーワード引数として渡す。\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}\n" +"\n" +"logging.config.dictConfig(LOGGING)\n" +"logger = logging.getLogger('mylogger')\n" +"logger.debug('A debug message')" #: ../../howto/logging-cookbook.rst:2676 msgid "To run this, you will probably need to run as ``root``:" msgstr "これを実行するには、 ``root`` 権限で実行する必要があるかもしれません:" -#: ../../howto/logging-cookbook.rst:2678 msgid "" "$ sudo python3.3 chowntest.py\n" "$ cat chowntest.log\n" @@ -3817,8 +5126,12 @@ msgid "" "$ ls -l chowntest.log\n" "-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" msgstr "" +"$ sudo python3.3 chowntest.py\n" +"$ cat chowntest.log\n" +"2013-11-05 09:34:51,128 DEBUG mylogger A debug message\n" +"$ ls -l chowntest.log\n" +"-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" -#: ../../howto/logging-cookbook.rst:2686 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -3826,11 +5139,12 @@ msgid "" "With pre-3.3 versions, you would need to implement the actual ownership " "change using e.g. :func:`os.chown`." msgstr "" -":func:`shutil.chown` が追加されたのが Python 3.3 からなので、この例は Python " -"3.3 を使っています。このアプローチ自体は :func:`dictConfig` をサポートした全" -"ての Python バージョン - Python 2.7, 3.2 以降 - で利用できます。 3.3 以前の" -"バージョンでは、オーナーを変更するのに :func:`os.chown` を利用する必要がある" -"でしょう。" +"この例で Python 3.3 を使っているのは、:func:`shutil.chown` が追加されたバー" +"ジョンだからです。\n" +"この方法は :func:`dictConfig` をサポートする Python 2.7、3.2 以降で使えま" +"す。\n" +"3.3 より前では、例えば :func:`os.chown` を使って所有者の変更処理を実装する必" +"要があります。" #: ../../howto/logging-cookbook.rst:2692 msgid "" @@ -3840,17 +5154,15 @@ msgstr "" "実際には、handler を生成する関数はプロジェクト内のどこかにあるユーティリティ" "モジュールに置くことになるでしょう。設定の中で直接関数を参照する代わりに::" -#: ../../howto/logging-cookbook.rst:2695 msgid "'()': owned_file_handler," -msgstr "" +msgstr "'()': owned_file_handler," #: ../../howto/logging-cookbook.rst:2697 msgid "you could use e.g.::" msgstr "次のように書くこともできます::" -#: ../../howto/logging-cookbook.rst:2699 msgid "'()': 'ext://project.util.owned_file_handler'," -msgstr "" +msgstr "'()': 'ext://project.util.owned_file_handler'," #: ../../howto/logging-cookbook.rst:2701 msgid "" @@ -4033,7 +5345,6 @@ msgstr "" "このアプローチによる例をお見せします。最初は :meth:`str.format` を使って" "フォーマットする例です::" -#: ../../howto/logging-cookbook.rst:2808 msgid "" ">>> __ = BraceMessage\n" ">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" @@ -4047,18 +5358,32 @@ msgid "" "point=p))\n" "Message with coordinates: (0.50, 0.50)" msgstr "" +">>> __ = BraceMessage\n" +">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})', " +"point=p))\n" +"Message with coordinates: (0.50, 0.50)" #: ../../howto/logging-cookbook.rst:2819 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "2つめは :class:`string.Template` でフォーマットする例です::" -#: ../../howto/logging-cookbook.rst:2821 msgid "" ">>> __ = DollarMessage\n" ">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" "Message with 2 placeholders\n" ">>>" msgstr "" +">>> __ = DollarMessage\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" #: ../../howto/logging-cookbook.rst:2826 msgid "" @@ -4083,7 +5408,6 @@ msgstr "" msgid "Configuring filters with :func:`dictConfig`" msgstr "filter を :func:`dictConfig` を使ってカスタマイズする" -#: ../../howto/logging-cookbook.rst:2842 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -4097,18 +5421,19 @@ msgid "" "callable which returns a :class:`~logging.Filter` instance). Here is a " "complete example::" msgstr "" -":func:`~logging.config.dictConfig` によってフィルタを設定 *出来ます* が、どう" -"やってそれを行うのかが初見では明快とは言えないでしょう(そのためのこのレシピで" -"す)。 :class:`~logging.Filter` のみが唯一標準ライブラリに含まれているだけです" -"し、それは何の要求にも応えてはくれません(ただの基底クラスですから)ので、典型" -"的には :meth:`~logging.Filter.filter` メソッドをオーバライドした :class:" -"`~logging.Filter` のサブクラスをあなた自身で定義する必要があります。これをす" -"るには、設定辞書内のフィルタ指定部分に、 ``()`` キーでそのフィルタを作るのに" -"使われる callable を指定してください(クラスを指定するのが最もわかりやすいです" -"が、 :class:`~logging.Filter` インスタンスを返却する callable を提供すること" -"でも出来ます)。以下に完全な例を示します::" +":func:`~logging.config.dictConfig` でフィルタを設定 *できます*。\n" +"ただし、一見しただけでは方法が分かりにくいため、このレシピで説明します。\n" +"標準ライブラリに含まれるフィルタクラスは :class:`~logging.Filter` だけで、基" +"底クラスとして用意されているため、多くの要件にはそのまま対応できないでしょ" +"う。\n" +"通常は :class:`~logging.Filter` のサブクラスを定義し、:meth:`~logging.Filter." +"filter` をオーバーライドします。\n" +"設定辞書のフィルタの項目では ``()`` キーに、フィルタを作成する呼び出し可能オ" +"ブジェクトを指定します。\n" +"クラスを指定するのが分かりやすい方法ですが、:class:`~logging.Filter` インスタ" +"ンスを返すものであれば指定できます。\n" +"完全な例を示します。 ::" -#: ../../howto/logging-cookbook.rst:2853 msgid "" "import logging\n" "import logging.config\n" @@ -4152,20 +5477,59 @@ msgid "" " logging.debug('hello')\n" " logging.debug('hello - noshow')" msgstr "" - -#: ../../howto/logging-cookbook.rst:2895 -msgid "" -"This example shows how you can pass configuration data to the callable which " +"import logging\n" +"import logging.config\n" +"import sys\n" +"\n" +"class MyFilter(logging.Filter):\n" +" def __init__(self, param=None):\n" +" self.param = param\n" +"\n" +" def filter(self, record):\n" +" if self.param is None:\n" +" allow = True\n" +" else:\n" +" allow = self.param not in record.msg\n" +" if allow:\n" +" record.msg = 'changed: ' + record.msg\n" +" return allow\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'filters': {\n" +" 'myfilter': {\n" +" '()': MyFilter,\n" +" 'param': 'noshow',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'filters': ['myfilter']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console']\n" +" },\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.debug('hello')\n" +" logging.debug('hello - noshow')" + +msgid "" +"This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -"どのようにして設定データとして、そのインスタンスを構築する callable をキー" -"ワードパラメータの形で渡すのか、をこの例は教えてくれます。上記スクリプトは実" -"行すると、このような出力をします:" +"この例は、インスタンスを構築する呼び出し可能オブジェクトに、設定データをキー" +"ワード引数として渡す方法を示しています。\n" +"上のスクリプトを実行すると、次のように表示されます:" -#: ../../howto/logging-cookbook.rst:2899 msgid "changed: hello" -msgstr "" +msgstr "changed: hello" #: ../../howto/logging-cookbook.rst:2903 msgid "which shows that the filter is working as configured." @@ -4219,7 +5583,6 @@ msgstr "" "外情報がある場合でもログイベントごとに一行に収まることを死守したいと望むとし" "ましょう。フォーマッタのクラスをカスタマイズして、このように出来ます::" -#: ../../howto/logging-cookbook.rst:2930 msgid "" "import logging\n" "\n" @@ -4257,18 +5620,56 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import logging\n" +"\n" +"class OneLineExceptionFormatter(logging.Formatter):\n" +" def formatException(self, exc_info):\n" +" \"\"\"\n" +" Format an exception so that it prints on a single line.\n" +" \"\"\"\n" +" result = super().formatException(exc_info)\n" +" return repr(result) # or format into one line however you want to\n" +"\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" if record.exc_text:\n" +" s = s.replace('\\n', '') + '|'\n" +" return s\n" +"\n" +"def configure_logging():\n" +" fh = logging.FileHandler('output.txt', 'w')\n" +" f = OneLineExceptionFormatter('%(asctime)s|%(levelname)s|%(message)s|',\n" +" '%d/%m/%Y %H:%M:%S')\n" +" fh.setFormatter(f)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(fh)\n" +"\n" +"def main():\n" +" configure_logging()\n" +" logging.info('Sample message')\n" +" try:\n" +" x = 1 / 0\n" +" except ZeroDivisionError as e:\n" +" logging.exception('ZeroDivisionError: %s', e)\n" +"\n" +"if __name__ == '__main__':\n" +" main()" #: ../../howto/logging-cookbook.rst:2966 msgid "When run, this produces a file with exactly two lines:" msgstr "実行してみましょう。このように正確に2行の出力を生成します:" -#: ../../howto/logging-cookbook.rst:2968 msgid "" "28/01/2015 07:21:23|INFO|Sample message|\n" "28/01/2015 07:21:23|ERROR|ZeroDivisionError: division by zero|'Traceback " "(most recent call last):\\n File \"logtest7.py\", line 30, in main\\n x " "= 1 / 0\\nZeroDivisionError: division by zero'|" msgstr "" +"28/01/2015 07:21:23|INFO|Sample message|\n" +"28/01/2015 07:21:23|ERROR|ZeroDivisionError: division by zero|'Traceback " +"(most recent call last):\\n File \"logtest7.py\", line 30, in main\\n x " +"= 1 / 0\\nZeroDivisionError: division by zero'|" #: ../../howto/logging-cookbook.rst:2973 msgid "" @@ -4284,7 +5685,6 @@ msgstr "" msgid "Speaking logging messages" msgstr "ロギングメッセージを喋る" -#: ../../howto/logging-cookbook.rst:2982 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -4300,20 +5700,19 @@ msgid "" "other handlers to be kept waiting. Here is a short example showing the " "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -"ロギングメッセージを目で見る形式ではなく音で聴く形式として出力したい、という" -"状況があるかもしれません。これはあなたのシステムで text- to-speech (TTS) 機能" -"が利用可能であれば、容易です。それが Python バインディングを持っていなくと" -"も、です。ほとんどの TTS システムはあなたが実行出来るコマンドラインプログラム" -"を持っていて、このことで、 :mod:`subprocess` を使うことでハンドラが呼び出せま" -"す。ここでは、TTS コマンドラインプログラムはユーザとの対話を期待せず、完了に" -"は時間がかかり、そしてログメッセージの頻度はユーザをメッセージで圧倒してしま" -"うほどには高くはなく、そして並列で喋るよりはメッセージ一つにつき一回喋ること" -"が受け容れられる、としておきます。ここでお見せする実装例では、次が処理される" -"前に一つのメッセージを喋り終わるまで待ち、結果としてほかのハンドラを待たせる" -"ことになります。 ``espeak`` TTS パッケージが手許にあるとして、このアプローチ" -"による短い例はこのようなものです::" - -#: ../../howto/logging-cookbook.rst:2995 +"ログメッセージを画面ではなく音声で出力したい場合もあります。\n" +"システムで音声合成 (TTS) が使えれば、Python バインディングがなくても簡単に実" +"現できます。\n" +"多くの TTS システムにはコマンドラインプログラムがあり、ハンドラから :mod:" +"`subprocess` で呼び出せます。\n" +"ここでは、TTS プログラムがユーザーとの対話を必要とせず、完了に長い時間がかか" +"らないことを前提とします。\n" +"また、ログの頻度がユーザーを圧倒するほど高くなく、メッセージを同時にではなく" +"一つずつ読み上げてもよいものとします。\n" +"次の実装例は、一つのメッセージを読み上げ終わるまで次を処理しないため、他のハ" +"ンドラを待たせる可能性があります。\n" +"``espeak`` TTS パッケージが利用できる場合の短い例を示します。 ::" + msgid "" "import logging\n" "import subprocess\n" @@ -4344,6 +5743,34 @@ msgid "" " configure_logging()\n" " sys.exit(main())" msgstr "" +"import logging\n" +"import subprocess\n" +"import sys\n" +"\n" +"class TTSHandler(logging.Handler):\n" +" def emit(self, record):\n" +" msg = self.format(record)\n" +" # 英語の女性の声でゆっくり話す\n" +" cmd = ['espeak', '-s150', '-ven+f3', msg]\n" +" p = subprocess.Popen(cmd, stdout=subprocess.PIPE,\n" +" stderr=subprocess.STDOUT)\n" +" # プログラムの終了を待つ\n" +" p.communicate()\n" +"\n" +"def configure_logging():\n" +" h = TTSHandler()\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # デフォルトのフォーマッターはメッセージをそのまま返す\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"def main():\n" +" logging.info('Hello')\n" +" logging.debug('Goodbye')\n" +"\n" +"if __name__ == '__main__':\n" +" configure_logging()\n" +" sys.exit(main())" #: ../../howto/logging-cookbook.rst:3024 msgid "" @@ -4365,7 +5792,6 @@ msgstr "" msgid "Buffering logging messages and outputting them conditionally" msgstr "ロギングメッセージをバッファリングし、条件に従って出力する" -#: ../../howto/logging-cookbook.rst:3036 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -4374,11 +5800,12 @@ msgid "" "collected debug information, but if there is an error, you want all the " "debug information to be output as well as the error." msgstr "" -"メッセージを一次領域に記録し、ある種の特定の状況になった場合にだけ出力した" -"い、ということがあるかもしれません。たとえばある関数内でのデバッグのためのロ" -"グ出力をしたくても、エラーなしで終了する限りにおいては収集されたデバッグ情報" -"による混雑は喰らいたくはなく、エラーがあった場合にだけエラー出力とともにデ" -"バッグ情報を見たいのだ、のようなことがあるでしょう。" +"ログメッセージを一時的な領域に記録し、特定の条件が成立した場合にだけ出力した" +"いことがあります。\n" +"例えば、関数内でデバッグイベントの記録を開始し、エラーなく終了した場合は、収" +"集した情報でログを埋めたくないとします。\n" +"一方、エラーが起きた場合は、エラーとともにデバッグ情報をすべて出力したいとし" +"ます。" #: ../../howto/logging-cookbook.rst:3043 msgid "" @@ -4401,7 +5828,6 @@ msgstr "" "ラッシュされます。何か特別なフラッシュの振る舞いをしたければ、このレシピはさ" "らに特殊化した ``MemoryHandler`` とともに利用出来ます。" -#: ../../howto/logging-cookbook.rst:3053 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -4409,10 +5835,11 @@ msgid "" "pass a parameter to ``foo`` which, if true, will log at ERROR and CRITICAL " "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -"スクリプト例では、 ``foo`` という、単に全てのログレベルについて、 ``sys." -"stderr`` にもどのレベルを出力したのかについて書き出しながら実際のログ出力も行" -"う、という単純な関数を使っています。 ``foo`` に真を与えると ERROR と " -"CRITICAL の出力をし、そうでなければ DEBUG, INFO, WARNING だけを出力します。" +"スクリプトの例には、ログレベルを順にたどる単純な関数 ``foo`` があります。\n" +"これから記録するレベルを ``sys.stderr`` に表示してから、そのレベルで実際にロ" +"グを記録します。\n" +"``foo`` の引数に真を渡すと ERROR と CRITICAL のレベルでも記録し、それ以外で" +"は DEBUG、INFO、WARNING だけを記録します。" #: ../../howto/logging-cookbook.rst:3059 msgid "" @@ -4437,7 +5864,6 @@ msgstr "" msgid "Here's the script::" msgstr "スクリプトはこれです::" -#: ../../howto/logging-cookbook.rst:3069 msgid "" "import logging\n" "from logging.handlers import MemoryHandler\n" @@ -4502,12 +5928,73 @@ msgid "" " write_line('Calling decorated foo with True')\n" " assert decorated_foo(True)" msgstr "" +"import logging\n" +"from logging.handlers import MemoryHandler\n" +"import sys\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"logger.addHandler(logging.NullHandler())\n" +"\n" +"def log_if_errors(logger, target_handler=None, flush_level=None, " +"capacity=None):\n" +" if target_handler is None:\n" +" target_handler = logging.StreamHandler()\n" +" if flush_level is None:\n" +" flush_level = logging.ERROR\n" +" if capacity is None:\n" +" capacity = 100\n" +" handler = MemoryHandler(capacity, flushLevel=flush_level, " +"target=target_handler)\n" +"\n" +" def decorator(fn):\n" +" def wrapper(*args, **kwargs):\n" +" logger.addHandler(handler)\n" +" try:\n" +" return fn(*args, **kwargs)\n" +" except Exception:\n" +" logger.exception('call failed')\n" +" raise\n" +" finally:\n" +" super(MemoryHandler, handler).flush()\n" +" logger.removeHandler(handler)\n" +" return wrapper\n" +"\n" +" return decorator\n" +"\n" +"def write_line(s):\n" +" sys.stderr.write('%s\\n' % s)\n" +"\n" +"def foo(fail=False):\n" +" write_line('about to log at DEBUG ...')\n" +" logger.debug('Actually logged at DEBUG')\n" +" write_line('about to log at INFO ...')\n" +" logger.info('Actually logged at INFO')\n" +" write_line('about to log at WARNING ...')\n" +" logger.warning('Actually logged at WARNING')\n" +" if fail:\n" +" write_line('about to log at ERROR ...')\n" +" logger.error('Actually logged at ERROR')\n" +" write_line('about to log at CRITICAL ...')\n" +" logger.critical('Actually logged at CRITICAL')\n" +" return fail\n" +"\n" +"decorated_foo = log_if_errors(logger)(foo)\n" +"\n" +"if __name__ == '__main__':\n" +" logger.setLevel(logging.DEBUG)\n" +" write_line('Calling undecorated foo with False')\n" +" assert not foo(False)\n" +" write_line('Calling undecorated foo with True')\n" +" assert foo(True)\n" +" write_line('Calling decorated foo with False')\n" +" assert not decorated_foo(False)\n" +" write_line('Calling decorated foo with True')\n" +" assert decorated_foo(True)" #: ../../howto/logging-cookbook.rst:3130 msgid "When this script is run, the following output should be observed:" msgstr "実行すればこのような出力になるはずです:" -#: ../../howto/logging-cookbook.rst:3132 msgid "" "Calling undecorated foo with False\n" "about to log at DEBUG ...\n" @@ -4535,6 +6022,31 @@ msgid "" "about to log at CRITICAL ...\n" "Actually logged at CRITICAL" msgstr "" +"Calling undecorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling undecorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"about to log at CRITICAL ...\n" +"Calling decorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling decorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"Actually logged at DEBUG\n" +"Actually logged at INFO\n" +"Actually logged at WARNING\n" +"Actually logged at ERROR\n" +"about to log at CRITICAL ...\n" +"Actually logged at CRITICAL" #: ../../howto/logging-cookbook.rst:3160 msgid "" @@ -4550,12 +6062,14 @@ msgstr "" msgid "You can of course use the conventional means of decoration::" msgstr "当然のことですが、デコレーションはいつものやり方でどうぞ::" -#: ../../howto/logging-cookbook.rst:3166 msgid "" "@log_if_errors(logger)\n" "def foo(fail=False):\n" " ..." msgstr "" +"@log_if_errors(logger)\n" +"def foo(fail=False):\n" +" ..." #: ../../howto/logging-cookbook.rst:3174 msgid "Sending logging messages to email, with buffering" @@ -4579,7 +6093,6 @@ msgstr "" "見るためには、ダウンロードしたスクリプトを ``-h`` 引数をつけて実行してくださ" "い)。" -#: ../../howto/logging-cookbook.rst:3184 msgid "" "import logging\n" "import logging.handlers\n" @@ -4646,64 +6159,131 @@ msgid "" " h.flush()\n" " h.close()" msgstr "" - -#: ../../howto/logging-cookbook.rst:3248 -msgid "" -"If you run this script and your SMTP server is correctly set up, you should " -"find that it sends eleven emails to the addressee you specify. The first ten " -"emails will each have ten log messages, and the eleventh will have two " -"messages. That makes up 102 messages as specified in the script." -msgstr "" -"SMTP サーバーを正しく設定した上でスクリプトを実行すると、指定したアドレス宛て" -"に11通のメールを受け取るでしょう。最初の10通のメールはそれぞれ10個のログメッ" -"セージを含み、11通目のメールは2つのログメッセージを含むはずです。これらのログ" -"メッセージはスクリプト内で指定された102個のログメッセージから構成されていま" -"す。" - -#: ../../howto/logging-cookbook.rst:3256 -msgid "Formatting times using UTC (GMT) via configuration" -msgstr "設定によって時刻を UTC(GMT) で書式化する" - -#: ../../howto/logging-cookbook.rst:3258 -msgid "" -"Sometimes you want to format times using UTC, which can be done using a " -"class such as ``UTCFormatter``, shown below::" -msgstr "" -"時刻を UTC でフォーマットしたい場合もあるでしょう。以下に示すように、そのよう" -"なフォーマット処理は ``UTCFormatter`` のようなクラスを使って行うことができま" -"す::" - -#: ../../howto/logging-cookbook.rst:3261 -msgid "" -"import logging\n" -"import time\n" -"\n" -"class UTCFormatter(logging.Formatter):\n" -" converter = time.gmtime" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3267 -msgid "" -"and you can then use the ``UTCFormatter`` in your code instead of :class:" -"`~logging.Formatter`. If you want to do that via configuration, you can use " -"the :func:`~logging.config.dictConfig` API with an approach illustrated by " -"the following complete example::" -msgstr "" -"そしてコード中で ``UTCFormatter`` を :class:`~logging.Formatter` の代わりに使" -"えます。これを設定を通して行いたい場合、 :func:`~logging.config.dictConfig` " -"API を以下の完全な例で示すようなアプローチで使うことが出来ます::" - -#: ../../howto/logging-cookbook.rst:3272 -msgid "" "import logging\n" -"import logging.config\n" -"import time\n" -"\n" -"class UTCFormatter(logging.Formatter):\n" -" converter = time.gmtime\n" +"import logging.handlers\n" +"import smtplib\n" "\n" -"LOGGING = {\n" -" 'version': 1,\n" +"class BufferingSMTPHandler(logging.handlers.BufferingHandler):\n" +" def __init__(self, mailhost, port, username, password, fromaddr, " +"toaddrs,\n" +" subject, capacity):\n" +" logging.handlers.BufferingHandler.__init__(self, capacity)\n" +" self.mailhost = mailhost\n" +" self.mailport = port\n" +" self.username = username\n" +" self.password = password\n" +" self.fromaddr = fromaddr\n" +" if isinstance(toaddrs, str):\n" +" toaddrs = [toaddrs]\n" +" self.toaddrs = toaddrs\n" +" self.subject = subject\n" +" self.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)-5s " +"%(message)s\"))\n" +"\n" +" def flush(self):\n" +" if len(self.buffer) > 0:\n" +" try:\n" +" smtp = smtplib.SMTP(self.mailhost, self.mailport)\n" +" smtp.starttls()\n" +" smtp.login(self.username, self.password)\n" +" msg = \"From: %s\\r\\nTo: %s\\r\\nSubject: %s\\r\\n\\r\\n\" " +"% (self.fromaddr, ','.join(self.toaddrs), self.subject)\n" +" for record in self.buffer:\n" +" s = self.format(record)\n" +" msg = msg + s + \"\\r\\n\"\n" +" smtp.sendmail(self.fromaddr, self.toaddrs, msg)\n" +" smtp.quit()\n" +" except Exception:\n" +" if logging.raiseExceptions:\n" +" raise\n" +" self.buffer = []\n" +"\n" +"if __name__ == '__main__':\n" +" import argparse\n" +"\n" +" ap = argparse.ArgumentParser()\n" +" aa = ap.add_argument\n" +" aa('host', metavar='HOST', help='SMTP server')\n" +" aa('--port', '-p', type=int, default=587, help='SMTP port')\n" +" aa('user', metavar='USER', help='SMTP username')\n" +" aa('password', metavar='PASSWORD', help='SMTP password')\n" +" aa('to', metavar='TO', help='Addressee for emails')\n" +" aa('sender', metavar='SENDER', help='Sender email address')\n" +" aa('--subject', '-s',\n" +" default='Test Logging email from Python logging module (buffering)',\n" +" help='Subject of email')\n" +" options = ap.parse_args()\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.DEBUG)\n" +" h = BufferingSMTPHandler(options.host, options.port, options.user,\n" +" options.password, options.sender,\n" +" options.to, options.subject, 10)\n" +" logger.addHandler(h)\n" +" for i in range(102):\n" +" logger.info(\"Info index = %d\", i)\n" +" h.flush()\n" +" h.close()" + +#: ../../howto/logging-cookbook.rst:3248 +msgid "" +"If you run this script and your SMTP server is correctly set up, you should " +"find that it sends eleven emails to the addressee you specify. The first ten " +"emails will each have ten log messages, and the eleventh will have two " +"messages. That makes up 102 messages as specified in the script." +msgstr "" +"SMTP サーバーを正しく設定した上でスクリプトを実行すると、指定したアドレス宛て" +"に11通のメールを受け取るでしょう。最初の10通のメールはそれぞれ10個のログメッ" +"セージを含み、11通目のメールは2つのログメッセージを含むはずです。これらのログ" +"メッセージはスクリプト内で指定された102個のログメッセージから構成されていま" +"す。" + +#: ../../howto/logging-cookbook.rst:3256 +msgid "Formatting times using UTC (GMT) via configuration" +msgstr "設定によって時刻を UTC(GMT) で書式化する" + +#: ../../howto/logging-cookbook.rst:3258 +msgid "" +"Sometimes you want to format times using UTC, which can be done using a " +"class such as ``UTCFormatter``, shown below::" +msgstr "" +"時刻を UTC でフォーマットしたい場合もあるでしょう。以下に示すように、そのよう" +"なフォーマット処理は ``UTCFormatter`` のようなクラスを使って行うことができま" +"す::" + +msgid "" +"import logging\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime" +msgstr "" +"import logging\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime" + +#: ../../howto/logging-cookbook.rst:3267 +msgid "" +"and you can then use the ``UTCFormatter`` in your code instead of :class:" +"`~logging.Formatter`. If you want to do that via configuration, you can use " +"the :func:`~logging.config.dictConfig` API with an approach illustrated by " +"the following complete example::" +msgstr "" +"そしてコード中で ``UTCFormatter`` を :class:`~logging.Formatter` の代わりに使" +"えます。これを設定を通して行いたい場合、 :func:`~logging.config.dictConfig` " +"API を以下の完全な例で示すようなアプローチで使うことが出来ます::" + +msgid "" +"import logging\n" +"import logging.config\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" " 'disable_existing_loggers': False,\n" " 'formatters': {\n" " 'utc': {\n" @@ -4733,16 +6313,54 @@ msgid "" " logging.config.dictConfig(LOGGING)\n" " logging.warning('The local time is %s', time.asctime())" msgstr "" +"import logging\n" +"import logging.config\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'utc': {\n" +" '()': UTCFormatter,\n" +" 'format': '%(asctime)s %(message)s',\n" +" },\n" +" 'local': {\n" +" 'format': '%(asctime)s %(message)s',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console1': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'utc',\n" +" },\n" +" 'console2': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'local',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console1', 'console2'],\n" +" }\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.warning('The local time is %s', time.asctime())" #: ../../howto/logging-cookbook.rst:3310 msgid "When this script is run, it should print something like:" msgstr "実行すれば、このような出力になるはずです:" -#: ../../howto/logging-cookbook.rst:3312 msgid "" "2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" "2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" msgstr "" +"2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" +"2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" #: ../../howto/logging-cookbook.rst:3317 msgid "" @@ -4756,7 +6374,6 @@ msgstr "" msgid "Using a context manager for selective logging" msgstr "ロギングの選択にコンテキストマネージャを使う" -#: ../../howto/logging-cookbook.rst:3326 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -4765,15 +6382,12 @@ msgid "" "optionally change the logging level and add a logging handler purely in the " "scope of the context manager::" msgstr "" -"一時的にロギングの設定を変えて、作業をした後に設定を戻せると便利なときがあり" -"ます。\n" -"こういうときの、ロギングコンテキストの保存と復元をする方法ではコンテキストマ" -"ネージャを使うのが一番です。\n" -"以下にあるのがそのためのコンテキストマネージャの簡単な例で、これを使うと、任" -"意にロギングレベルを変更し、コンテキストマネージャのスコープ内で他に影響を及" -"ぼさずロギングハンドラを追加できるようになります::" +"ロギングの設定を一時的に変更し、処理後に元に戻せると便利な場合があります。\n" +"設定を保存・復元するにはコンテキストマネージャが分かりやすい方法です。\n" +"次の簡単な例では、必要に応じてロギングレベルを変更したり、ハンドラを追加した" +"りできます。\n" +"変更はコンテキストマネージャの有効期間だけ適用されます。 ::" -#: ../../howto/logging-cookbook.rst:3333 msgid "" "import logging\n" "import sys\n" @@ -4801,6 +6415,31 @@ msgid "" " self.handler.close()\n" " # implicit return of None => don't swallow exceptions" msgstr "" +"import logging\n" +"import sys\n" +"\n" +"class LoggingContext:\n" +" def __init__(self, logger, level=None, handler=None, close=True):\n" +" self.logger = logger\n" +" self.level = level\n" +" self.handler = handler\n" +" self.close = close\n" +"\n" +" def __enter__(self):\n" +" if self.level is not None:\n" +" self.old_level = self.logger.level\n" +" self.logger.setLevel(self.level)\n" +" if self.handler:\n" +" self.logger.addHandler(self.handler)\n" +"\n" +" def __exit__(self, et, ev, tb):\n" +" if self.level is not None:\n" +" self.logger.setLevel(self.old_level)\n" +" if self.handler:\n" +" self.logger.removeHandler(self.handler)\n" +" if self.handler and self.close:\n" +" self.handler.close()\n" +" # 暗黙に None を返すので、例外を握りつぶさない" #: ../../howto/logging-cookbook.rst:3359 msgid "" @@ -4826,7 +6465,6 @@ msgstr "" "どのように動作するのかを示すためには、次のコード群を上のコードに付け加えると" "よいです::" -#: ../../howto/logging-cookbook.rst:3368 msgid "" "if __name__ == '__main__':\n" " logger = logging.getLogger('foo')\n" @@ -4845,6 +6483,22 @@ msgid "" " logger.info('6. This should appear just once on stderr.')\n" " logger.debug('7. This should not appear.')" msgstr "" +"if __name__ == '__main__':\n" +" logger = logging.getLogger('foo')\n" +" logger.addHandler(logging.StreamHandler())\n" +" logger.setLevel(logging.INFO)\n" +" logger.info('1. This should appear just once on stderr.')\n" +" logger.debug('2. This should not appear.')\n" +" with LoggingContext(logger, level=logging.DEBUG):\n" +" logger.debug('3. This should appear once on stderr.')\n" +" logger.debug('4. This should not appear.')\n" +" h = logging.StreamHandler(sys.stdout)\n" +" with LoggingContext(logger, level=logging.DEBUG, handler=h, " +"close=True):\n" +" logger.debug('5. This should appear twice - once on stderr and once " +"on stdout.')\n" +" logger.info('6. This should appear just once on stderr.')\n" +" logger.debug('7. This should not appear.')" #: ../../howto/logging-cookbook.rst:3383 msgid "" @@ -4875,7 +6529,6 @@ msgstr "" msgid "If we run the resulting script, the result is as follows:" msgstr "出来上がったスクリプトを実行すると、結果は次のようになります::" -#: ../../howto/logging-cookbook.rst:3395 msgid "" "$ python logctx.py\n" "1. This should appear just once on stderr.\n" @@ -4884,6 +6537,12 @@ msgid "" "5. This should appear twice - once on stderr and once on stdout.\n" "6. This should appear just once on stderr." msgstr "" +"$ python logctx.py\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." #: ../../howto/logging-cookbook.rst:3404 msgid "" @@ -4893,11 +6552,12 @@ msgstr "" "``stderr`` を ``/dev/null`` へパイプした状態でもう一度実行すると、次のように" "なり、これは ``stdout`` の方に書かれたメッセージだけが現れています:" -#: ../../howto/logging-cookbook.rst:3407 msgid "" "$ python logctx.py 2>/dev/null\n" "5. This should appear twice - once on stderr and once on stdout." msgstr "" +"$ python logctx.py 2>/dev/null\n" +"5. This should appear twice - once on stderr and once on stdout." #: ../../howto/logging-cookbook.rst:3412 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" @@ -4905,7 +6565,6 @@ msgstr "" "``stdout`` を ``/dev/null`` へパイプした状態でさらにもう一度実行すると、こう" "なります:" -#: ../../howto/logging-cookbook.rst:3414 msgid "" "$ python logctx.py >/dev/null\n" "1. This should appear just once on stderr.\n" @@ -4913,6 +6572,11 @@ msgid "" "5. This should appear twice - once on stderr and once on stdout.\n" "6. This should appear just once on stderr." msgstr "" +"$ python logctx.py >/dev/null\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." #: ../../howto/logging-cookbook.rst:3422 msgid "" @@ -4973,7 +6637,6 @@ msgstr "" "ライン引数を使ってアプリケーションのログの冗長性を制御したいとします。 ``app." "py`` は次のコードのようになるでしょう::" -#: ../../howto/logging-cookbook.rst:3449 msgid "" "import argparse\n" "import importlib\n" @@ -5019,6 +6682,48 @@ msgid "" "if __name__ == '__main__':\n" " sys.exit(main())" msgstr "" +"import argparse\n" +"import importlib\n" +"import logging\n" +"import os\n" +"import sys\n" +"\n" +"def main(args=None):\n" +" scriptname = os.path.basename(__file__)\n" +" parser = argparse.ArgumentParser(scriptname)\n" +" levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')\n" +" parser.add_argument('--log-level', default='INFO', choices=levels)\n" +" subparsers = parser.add_subparsers(dest='command',\n" +" help='Available commands:')\n" +" start_cmd = subparsers.add_parser('start', help='Start a service')\n" +" start_cmd.add_argument('name', metavar='NAME',\n" +" help='Name of service to start')\n" +" stop_cmd = subparsers.add_parser('stop',\n" +" help='Stop one or more services')\n" +" stop_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to stop')\n" +" restart_cmd = subparsers.add_parser('restart',\n" +" help='Restart one or more " +"services')\n" +" restart_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to restart')\n" +" options = parser.parse_args()\n" +" # コマンドを振り分けるコードをすべてこのファイルに置くこともできるが、\n" +" # ここでは説明のため、各コマンドを別のモジュールに実装する。\n" +" try:\n" +" mod = importlib.import_module(options.command)\n" +" cmd = getattr(mod, 'command')\n" +" except (ImportError, AttributeError):\n" +" print('Unable to find the code for command \\'%s\\'' % options." +"command)\n" +" return 1\n" +" # ここを工夫して、ファイルや辞書から設定を読み込んでもよい\n" +" logging.basicConfig(level=options.log_level,\n" +" format='%(levelname)s %(name)s %(message)s')\n" +" cmd(options)\n" +"\n" +"if __name__ == '__main__':\n" +" sys.exit(main())" #: ../../howto/logging-cookbook.rst:3490 msgid "" @@ -5028,7 +6733,6 @@ msgstr "" "``start`` 、 ``stop`` 、 ``restart`` コマンドは個別のモジュールとして実装され" "ます。次は起動コマンドのソースです::" -#: ../../howto/logging-cookbook.rst:3493 msgid "" "# start.py\n" "import logging\n" @@ -5040,12 +6744,20 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Started the \\'%s\\' service.', options.name)" msgstr "" +"# start.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" logger.debug('About to start %s', options.name)\n" +" # ここで実際のコマンド処理を行う ...\n" +" logger.info('Started the \\'%s\\' service.', options.name)" + +#: ../../howto/logging-cookbook.rst:3503 +msgid "and thus for stopping::" +msgstr "停止コマンドのソースは次の通りです::" -#: ../../howto/logging-cookbook.rst:3503 -msgid "and thus for stopping::" -msgstr "停止コマンドのソースは次の通りです::" - -#: ../../howto/logging-cookbook.rst:3505 msgid "" "# stop.py\n" "import logging\n" @@ -5066,12 +6778,29 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Stopped the %s service%s.', services, plural)" msgstr "" +"# stop.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to stop %s', services)\n" +" # ここで実際のコマンド処理を行う ...\n" +" logger.info('Stopped the %s service%s.', services, plural)" #: ../../howto/logging-cookbook.rst:3524 msgid "and similarly for restarting::" msgstr "同様に、再起動のコマンドは次の通りです::" -#: ../../howto/logging-cookbook.rst:3526 msgid "" "# restart.py\n" "import logging\n" @@ -5092,6 +6821,24 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Restarted the %s service%s.', services, plural)" msgstr "" +"# restart.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to restart %s', services)\n" +" # ここで実際のコマンド処理を行う ...\n" +" logger.info('Restarted the %s service%s.', services, plural)" #: ../../howto/logging-cookbook.rst:3545 msgid "" @@ -5101,7 +6848,6 @@ msgstr "" "このアプリケーションをデフォルトのログレベルで実行すると、次のような出力が得" "られます:" -#: ../../howto/logging-cookbook.rst:3547 msgid "" "$ python app.py start foo\n" "INFO start Started the 'foo' service.\n" @@ -5112,6 +6858,14 @@ msgid "" "$ python app.py restart foo bar baz\n" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" +"$ python app.py start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py stop foo bar\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py restart foo bar baz\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." #: ../../howto/logging-cookbook.rst:3558 msgid "" @@ -5129,7 +6883,6 @@ msgstr "" "ログレベルを変更し、ログに出力する情報を変更できるようにしましょう。もし、よ" "り詳細な情報が必要だとしましょう:" -#: ../../howto/logging-cookbook.rst:3564 msgid "" "$ python app.py --log-level DEBUG start foo\n" "DEBUG start About to start foo\n" @@ -5143,35 +6896,52 @@ msgid "" "DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" +"$ python app.py --log-level DEBUG start foo\n" +"DEBUG start About to start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py --log-level DEBUG stop foo bar\n" +"DEBUG stop About to stop 'foo' and 'bar'\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py --log-level DEBUG restart foo bar baz\n" +"DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." #: ../../howto/logging-cookbook.rst:3578 msgid "And if we want less:" msgstr "あるいは情報を減らしたい場合もあるでしょう:" -#: ../../howto/logging-cookbook.rst:3580 msgid "" "$ python app.py --log-level WARNING start foo\n" "$ python app.py --log-level WARNING stop foo bar\n" "$ python app.py --log-level WARNING restart foo bar baz" msgstr "" +"$ python app.py --log-level WARNING start foo\n" +"$ python app.py --log-level WARNING stop foo bar\n" +"$ python app.py --log-level WARNING restart foo bar baz" -#: ../../howto/logging-cookbook.rst:3586 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." -msgstr "この場合、コマンドはコンソールに何も出力しなくなります。" +msgstr "" +"この場合、コマンドは ``WARNING`` 以上のレベルのログを記録しないため、コンソー" +"ルには何も表示されません。" #: ../../howto/logging-cookbook.rst:3592 msgid "A Qt GUI for logging" msgstr "Qt GUIのログ出力" -#: ../../howto/logging-cookbook.rst:3594 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" "platform UI framework with Python bindings using :pypi:`PySide2` or :pypi:" "`PyQt5` libraries." msgstr "" +"GUI アプリケーションにログを表示する方法は、ときどき寄せられる質問です。\n" +"`Qt `_ は広く使われているクロスプラットフォームの UI フ" +"レームワークで、:pypi:`PySide2` や :pypi:`PyQt5` ライブラリによる Python バイ" +"ンディングがあります。" #: ../../howto/logging-cookbook.rst:3599 msgid "" @@ -5189,25 +6959,27 @@ msgstr "" "ンドのタスクを行うワーカースレッドからログ出力を行います(ここではランダムな" "期間にランダムなレベルでメッセージを出しています)。" -#: ../../howto/logging-cookbook.rst:3606 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -"ワーカースレッドは :mod:`threading` モジュールではなく、Qtの ``QThread`` クラ" -"スを使っています。これは他の ``Qt`` コンポーネントとうまく統合できるように、 " -"``QThread`` を使う必要があるからです。" +"ワーカースレッドは :mod:`threading` モジュールではなく Qt の ``QThread`` クラ" +"スで実装しています。\n" +"他の ``Qt`` コンポーネントとの連携に優れた ``QThread`` を使う必要がある場合も" +"あるためです。" -#: ../../howto/logging-cookbook.rst:3610 msgid "" "The code should work with recent releases of any of ``PySide6``, ``PyQt6``, " "``PySide2`` or ``PyQt5``. You should be able to adapt the approach to " "earlier versions of Qt. Please refer to the comments in the code snippet for " "more detailed information." msgstr "" +"このコードは ``PySide6``、``PyQt6``、``PySide2``、``PyQt5`` のいずれも最近の" +"リリースで動作するはずです。\n" +"以前の Qt に合わせて変更することもできるでしょう。\n" +"詳しくはコード内のコメントを参照してください。" -#: ../../howto/logging-cookbook.rst:3615 msgid "" "import logging\n" "import random\n" @@ -5283,28 +7055,262 @@ msgid "" "\n" "\n" "#\n" -"# Used to generate random levels for logging.\n" +"# Used to generate random levels for logging.\n" +"#\n" +"LEVELS = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"\n" +"#\n" +"# This worker class represents work that is done in a thread separate to " +"the\n" +"# main thread. The way the thread is kicked off to do work is via a button " +"press\n" +"# that connects to a slot in the worker.\n" +"#\n" +"# Because the default threadName value in the LogRecord isn't much use, we " +"add\n" +"# a qThreadName which contains the QThread name as computed above, and pass " +"that\n" +"# value in an \"extra\" dictionary which is used to update the LogRecord " +"with the\n" +"# QThread name.\n" +"#\n" +"# This example worker just outputs messages sequentially, interspersed with\n" +"# random delays of the order of a few seconds.\n" +"#\n" +"class Worker(QtCore.QObject):\n" +" @Slot()\n" +" def start(self):\n" +" extra = {'qThreadName': ctname() }\n" +" logger.debug('Started work', extra=extra)\n" +" i = 1\n" +" # Let the thread run until interrupted. This allows reasonably " +"clean\n" +" # thread termination.\n" +" while not QtCore.QThread.currentThread().isInterruptionRequested():\n" +" delay = 0.5 + random.random() * 2\n" +" time.sleep(delay)\n" +" try:\n" +" if random.random() < 0.1:\n" +" raise ValueError('Exception raised: %d' % i)\n" +" else:\n" +" level = random.choice(LEVELS)\n" +" logger.log(level, 'Message after delay of %3.1f: %d', " +"delay, i, extra=extra)\n" +" except ValueError as e:\n" +" logger.exception('Failed: %s', e, extra=extra)\n" +" i += 1\n" +"\n" +"#\n" +"# Implement a simple UI for this cookbook example. This contains:\n" +"#\n" +"# * A read-only text edit window which holds formatted log messages\n" +"# * A button to start work and log stuff in a separate thread\n" +"# * A button to log something from the main thread\n" +"# * A button to clear the log window\n" +"#\n" +"class Window(QtWidgets.QWidget):\n" +"\n" +" COLORS = {\n" +" logging.DEBUG: 'black',\n" +" logging.INFO: 'blue',\n" +" logging.WARNING: 'orange',\n" +" logging.ERROR: 'red',\n" +" logging.CRITICAL: 'purple',\n" +" }\n" +"\n" +" def __init__(self, app):\n" +" super().__init__()\n" +" self.app = app\n" +" self.textedit = te = QtWidgets.QPlainTextEdit(self)\n" +" # Set whatever the default monospace font is for the platform\n" +" f = QtGui.QFont('nosuchfont')\n" +" if hasattr(f, 'Monospace'):\n" +" f.setStyleHint(f.Monospace)\n" +" else:\n" +" f.setStyleHint(f.StyleHint.Monospace) # for Qt6\n" +" te.setFont(f)\n" +" te.setReadOnly(True)\n" +" PB = QtWidgets.QPushButton\n" +" self.work_button = PB('Start background work', self)\n" +" self.log_button = PB('Log a message at a random level', self)\n" +" self.clear_button = PB('Clear log window', self)\n" +" self.handler = h = QtHandler(self.update_status)\n" +" # Remember to use qThreadName rather than threadName in the format " +"string.\n" +" fs = '%(asctime)s %(qThreadName)-12s %(levelname)-8s %(message)s'\n" +" formatter = logging.Formatter(fs)\n" +" h.setFormatter(formatter)\n" +" logger.addHandler(h)\n" +" # Set up to terminate the QThread when we exit\n" +" app.aboutToQuit.connect(self.force_quit)\n" +"\n" +" # Lay out all the widgets\n" +" layout = QtWidgets.QVBoxLayout(self)\n" +" layout.addWidget(te)\n" +" layout.addWidget(self.work_button)\n" +" layout.addWidget(self.log_button)\n" +" layout.addWidget(self.clear_button)\n" +" self.setFixedSize(900, 400)\n" +"\n" +" # Connect the non-worker slots and signals\n" +" self.log_button.clicked.connect(self.manual_update)\n" +" self.clear_button.clicked.connect(self.clear_display)\n" +"\n" +" # Start a new worker thread and connect the slots for the worker\n" +" self.start_thread()\n" +" self.work_button.clicked.connect(self.worker.start)\n" +" # Once started, the button should be disabled\n" +" self.work_button.clicked.connect(lambda : self.work_button." +"setEnabled(False))\n" +"\n" +" def start_thread(self):\n" +" self.worker = Worker()\n" +" self.worker_thread = QtCore.QThread()\n" +" self.worker.setObjectName('Worker')\n" +" self.worker_thread.setObjectName('WorkerThread') # for qThreadName\n" +" self.worker.moveToThread(self.worker_thread)\n" +" # This will start an event loop in the worker thread\n" +" self.worker_thread.start()\n" +"\n" +" def kill_thread(self):\n" +" # Just tell the worker to stop, then tell it to quit and wait for " +"that\n" +" # to happen\n" +" self.worker_thread.requestInterruption()\n" +" if self.worker_thread.isRunning():\n" +" self.worker_thread.quit()\n" +" self.worker_thread.wait()\n" +" else:\n" +" print('worker has already exited.')\n" +"\n" +" def force_quit(self):\n" +" # For use when the window is closed\n" +" if self.worker_thread.isRunning():\n" +" self.kill_thread()\n" +"\n" +" # The functions below update the UI and run in the main thread because\n" +" # that's where the slots are set up\n" +"\n" +" @Slot(str, logging.LogRecord)\n" +" def update_status(self, status, record):\n" +" color = self.COLORS.get(record.levelno, 'black')\n" +" s = '
%s
' % (color, status)\n" +" self.textedit.appendHtml(s)\n" +"\n" +" @Slot()\n" +" def manual_update(self):\n" +" # This function uses the formatted message passed in, but also uses\n" +" # information from the record to format the message in an " +"appropriate\n" +" # color according to its severity (level).\n" +" level = random.choice(LEVELS)\n" +" extra = {'qThreadName': ctname() }\n" +" logger.log(level, 'Manually logged!', extra=extra)\n" +"\n" +" @Slot()\n" +" def clear_display(self):\n" +" self.textedit.clear()\n" +"\n" +"\n" +"def main():\n" +" QtCore.QThread.currentThread().setObjectName('MainThread')\n" +" logging.getLogger().setLevel(logging.DEBUG)\n" +" app = QtWidgets.QApplication(sys.argv)\n" +" example = Window(app)\n" +" example.show()\n" +" if hasattr(app, 'exec'):\n" +" rc = app.exec()\n" +" else:\n" +" rc = app.exec_()\n" +" sys.exit(rc)\n" +"\n" +"if __name__=='__main__':\n" +" main()" +msgstr "" +"import logging\n" +"import random\n" +"import sys\n" +"import time\n" +"\n" +"# Qt パッケージ間の細かな違いに対応する\n" +"try:\n" +" from PySide6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +"except ImportError:\n" +" try:\n" +" from PyQt6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +" except ImportError:\n" +" try:\n" +" from PySide2 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +" except ImportError:\n" +" from PyQt5 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"\n" +"#\n" +"# シグナルを正しく初期化するには、QObject またはそのサブクラスの中に\n" +"# 定義する必要がある。\n" +"#\n" +"class Signaller(QtCore.QObject):\n" +" signal = Signal(str, logging.LogRecord)\n" +"\n" +"#\n" +"# Qt GUI への出力はメインスレッドでのみ行う。\n" +"# そのため、このハンドラーはメインスレッドで実行するよう設定した\n" +"# スロット関数を受け取る設計になっている。この例の関数は、\n" +"# 書式化済みのログメッセージ文字列と、その生成元のログレコードを受け取る。\n" +"# 書式化済みの文字列は便宜上渡しているだけで、\n" +"# スロット関数の中で自由に出力文字列を書式化してもよい。\n" +"#\n" +"# 目的の GUI 更新を行うスロット関数を指定する。\n" +"# ハンドラーは具体的な UI 要素を知らず、意識する必要もない。\n" +"#\n" +"class QtHandler(logging.Handler):\n" +" def __init__(self, slotfunc, *args, **kwargs):\n" +" super().__init__(*args, **kwargs)\n" +" self.signaller = Signaller()\n" +" self.signaller.signal.connect(slotfunc)\n" +"\n" +" def emit(self, record):\n" +" s = self.format(record)\n" +" self.signaller.signal.emit(s, record)\n" +"\n" +"#\n" +"# この例は QThread を使うため、Python 側のスレッド名は\n" +"# \"Dummy-1\" のようになる。以下の関数は、\n" +"# 現在のスレッドの Qt 側の名前を取得する。\n" +"#\n" +"def ctname():\n" +" return QtCore.QThread.currentThread().objectName()\n" +"\n" +"\n" +"#\n" +"# ランダムなログレベルの生成に使う。\n" "#\n" "LEVELS = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" " logging.CRITICAL)\n" "\n" "#\n" -"# This worker class represents work that is done in a thread separate to " -"the\n" -"# main thread. The way the thread is kicked off to do work is via a button " -"press\n" -"# that connects to a slot in the worker.\n" +"# このワーカークラスは、メインスレッドとは別のスレッドで行う仕事を表す。\n" +"# ボタンを押すと、接続先のワーカーのスロットを介して\n" +"# スレッドに仕事を開始させる。\n" "#\n" -"# Because the default threadName value in the LogRecord isn't much use, we " -"add\n" -"# a qThreadName which contains the QThread name as computed above, and pass " -"that\n" -"# value in an \"extra\" dictionary which is used to update the LogRecord " -"with the\n" -"# QThread name.\n" +"# LogRecord のデフォルトの threadName はあまり役立たないため、\n" +"# 上の方法で取得した QThread 名を qThreadName として追加する。\n" +"# この値を \"extra\" 辞書に入れて渡し、\n" +"# LogRecord に QThread 名を設定する。\n" "#\n" -"# This example worker just outputs messages sequentially, interspersed with\n" -"# random delays of the order of a few seconds.\n" +"# この例のワーカーは、数秒程度のランダムな間隔を空けて\n" +"# メッセージを順番に出力するだけ。\n" "#\n" "class Worker(QtCore.QObject):\n" " @Slot()\n" @@ -5312,9 +7318,8 @@ msgid "" " extra = {'qThreadName': ctname() }\n" " logger.debug('Started work', extra=extra)\n" " i = 1\n" -" # Let the thread run until interrupted. This allows reasonably " -"clean\n" -" # thread termination.\n" +" # 中断されるまでスレッドを実行する。\n" +" # これにより、スレッドを比較的きれいに終了できる。\n" " while not QtCore.QThread.currentThread().isInterruptionRequested():\n" " delay = 0.5 + random.random() * 2\n" " time.sleep(delay)\n" @@ -5330,12 +7335,13 @@ msgid "" " i += 1\n" "\n" "#\n" -"# Implement a simple UI for this cookbook example. This contains:\n" +"# このクックブックの例のための、次の要素を持つ単純な UI を実装する。\n" "#\n" -"# * A read-only text edit window which holds formatted log messages\n" -"# * A button to start work and log stuff in a separate thread\n" -"# * A button to log something from the main thread\n" -"# * A button to clear the log window\n" +"# * 書式化済みログメッセージを表示する、読み取り専用のテキスト編集ウィンド" +"ウ\n" +"# * 別のスレッドで仕事とログ出力を開始するボタン\n" +"# * メインスレッドからログを出力するボタン\n" +"# * ログウィンドウを消去するボタン\n" "#\n" "class Window(QtWidgets.QWidget):\n" "\n" @@ -5351,12 +7357,12 @@ msgid "" " super().__init__()\n" " self.app = app\n" " self.textedit = te = QtWidgets.QPlainTextEdit(self)\n" -" # Set whatever the default monospace font is for the platform\n" +" # プラットフォームのデフォルトの等幅フォントを設定する\n" " f = QtGui.QFont('nosuchfont')\n" " if hasattr(f, 'Monospace'):\n" " f.setStyleHint(f.Monospace)\n" " else:\n" -" f.setStyleHint(f.StyleHint.Monospace) # for Qt6\n" +" f.setStyleHint(f.StyleHint.Monospace) # Qt6 用\n" " te.setFont(f)\n" " te.setReadOnly(True)\n" " PB = QtWidgets.QPushButton\n" @@ -5364,16 +7370,15 @@ msgid "" " self.log_button = PB('Log a message at a random level', self)\n" " self.clear_button = PB('Clear log window', self)\n" " self.handler = h = QtHandler(self.update_status)\n" -" # Remember to use qThreadName rather than threadName in the format " -"string.\n" +" # 書式文字列では threadName ではなく qThreadName を使う。\n" " fs = '%(asctime)s %(qThreadName)-12s %(levelname)-8s %(message)s'\n" " formatter = logging.Formatter(fs)\n" " h.setFormatter(formatter)\n" " logger.addHandler(h)\n" -" # Set up to terminate the QThread when we exit\n" +" # 終了時に QThread も終了するよう設定する\n" " app.aboutToQuit.connect(self.force_quit)\n" "\n" -" # Lay out all the widgets\n" +" # すべてのウィジェットを配置する\n" " layout = QtWidgets.QVBoxLayout(self)\n" " layout.addWidget(te)\n" " layout.addWidget(self.work_button)\n" @@ -5381,14 +7386,14 @@ msgid "" " layout.addWidget(self.clear_button)\n" " self.setFixedSize(900, 400)\n" "\n" -" # Connect the non-worker slots and signals\n" +" # ワーカー以外のスロットとシグナルを接続する\n" " self.log_button.clicked.connect(self.manual_update)\n" " self.clear_button.clicked.connect(self.clear_display)\n" "\n" -" # Start a new worker thread and connect the slots for the worker\n" +" # 新しいワーカースレッドを開始し、ワーカー用のスロットを接続する\n" " self.start_thread()\n" " self.work_button.clicked.connect(self.worker.start)\n" -" # Once started, the button should be disabled\n" +" # 開始後はボタンを無効にする\n" " self.work_button.clicked.connect(lambda : self.work_button." "setEnabled(False))\n" "\n" @@ -5396,15 +7401,14 @@ msgid "" " self.worker = Worker()\n" " self.worker_thread = QtCore.QThread()\n" " self.worker.setObjectName('Worker')\n" -" self.worker_thread.setObjectName('WorkerThread') # for qThreadName\n" +" self.worker_thread.setObjectName('WorkerThread') # qThreadName 用\n" " self.worker.moveToThread(self.worker_thread)\n" -" # This will start an event loop in the worker thread\n" +" # ワーカースレッドでイベントループを開始する\n" " self.worker_thread.start()\n" "\n" " def kill_thread(self):\n" -" # Just tell the worker to stop, then tell it to quit and wait for " -"that\n" -" # to happen\n" +" # ワーカーに停止を伝え、次に終了を指示して、\n" +" # 終了するまで待つ\n" " self.worker_thread.requestInterruption()\n" " if self.worker_thread.isRunning():\n" " self.worker_thread.quit()\n" @@ -5413,12 +7417,13 @@ msgid "" " print('worker has already exited.')\n" "\n" " def force_quit(self):\n" -" # For use when the window is closed\n" +" # ウィンドウが閉じられたときに使う\n" " if self.worker_thread.isRunning():\n" " self.kill_thread()\n" "\n" -" # The functions below update the UI and run in the main thread because\n" -" # that's where the slots are set up\n" +" # 以下の関数は UI を更新する。スロットがメインスレッドに設定されているた" +"め、\n" +" # そこで実行される\n" "\n" " @Slot(str, logging.LogRecord)\n" " def update_status(self, status, record):\n" @@ -5428,10 +7433,9 @@ msgid "" "\n" " @Slot()\n" " def manual_update(self):\n" -" # This function uses the formatted message passed in, but also uses\n" -" # information from the record to format the message in an " -"appropriate\n" -" # color according to its severity (level).\n" +" # この関数は、渡された書式化済みメッセージに加え、\n" +" # レコード内の情報も使い、重要度 (レベル) に応じた\n" +" # 適切な色でメッセージを表示する。\n" " level = random.choice(LEVELS)\n" " extra = {'qThreadName': ctname() }\n" " logger.log(level, 'Manually logged!', extra=extra)\n" @@ -5455,13 +7459,11 @@ msgid "" "\n" "if __name__=='__main__':\n" " main()" -msgstr "" #: ../../howto/logging-cookbook.rst:3846 msgid "Logging to syslog with RFC5424 support" msgstr "RFC5424 をサポートする syslog へのロギング" -#: ../../howto/logging-cookbook.rst:3848 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -5470,6 +7472,12 @@ msgid "" "been widespread deployment of it in syslog servers, the :class:`~logging." "handlers.SysLogHandler` functionality has not been updated." msgstr "" +":rfc:`5424` は 2009 年に公開されましたが、多くの syslog サーバーはデフォルト" +"で 2001 年の古い :rfc:`3164` を使う設定になっています。\n" +"2003 年に ``logging`` が Python に追加された時点では、当時唯一のプロトコルで" +"あった古い方に対応していました。\n" +"RFC 5424 の公開後も syslog サーバーへの普及が進まなかったため、:class:" +"`~logging.handlers.SysLogHandler` の機能は更新されていません。" #: ../../howto/logging-cookbook.rst:3855 msgid "" @@ -5481,7 +7489,6 @@ msgstr "" "の機能をサポートする syslog サーバーへのロギングを可能にする必要がある場合、" "以下のような派生ハンドラクラスを使うことで実現することができます::" -#: ../../howto/logging-cookbook.rst:3859 msgid "" "import datetime as dt\n" "import logging.handlers\n" @@ -5549,8 +7556,68 @@ msgid "" " return f'{version} {asctime} {hostname} {appname} {procid} {msgid} " "{sdata} {msg}'" msgstr "" +"import datetime as dt\n" +"import logging.handlers\n" +"import re\n" +"import socket\n" +"import time\n" +"\n" +"class SysLogHandler5424(logging.handlers.SysLogHandler):\n" +"\n" +" tz_offset = re.compile(r'([+-]\\d{2})(\\d{2})$')\n" +" escaped = re.compile(r'([\\]\"\\\\])')\n" +"\n" +" def __init__(self, *args, **kwargs):\n" +" self.msgid = kwargs.pop('msgid', None)\n" +" self.appname = kwargs.pop('appname', None)\n" +" super().__init__(*args, **kwargs)\n" +"\n" +" def format(self, record):\n" +" version = 1\n" +" asctime = dt.datetime.fromtimestamp(record.created).isoformat()\n" +" m = self.tz_offset.prefixmatch(time.strftime('%z'))\n" +" has_offset = False\n" +" if m and time.timezone:\n" +" hrs, mins = m.groups()\n" +" if int(hrs) or int(mins):\n" +" has_offset = True\n" +" if not has_offset:\n" +" asctime += 'Z'\n" +" else:\n" +" asctime += f'{hrs}:{mins}'\n" +" try:\n" +" hostname = socket.gethostname()\n" +" except Exception:\n" +" hostname = '-'\n" +" appname = self.appname or '-'\n" +" procid = record.process\n" +" msgid = '-'\n" +" msg = super().format(record)\n" +" sdata = '-'\n" +" if hasattr(record, 'structured_data'):\n" +" sd = record.structured_data\n" +" # キーが SD-ID、値が PARAM-NAME から PARAM-VALUE への辞書となる\n" +" # 辞書を指定する (これらの意味は RFC を参照)。\n" +" # ここでは説明のためエラーチェックを省略している。\n" +" # 本番環境で使う際は適切に変更できる\n" +" parts = []\n" +"\n" +" def replacer(m):\n" +" g = m.groups()\n" +" return '\\\\' + g[0]\n" +"\n" +" for sdid, dv in sd.items():\n" +" part = f'[{sdid}'\n" +" for k, v in dv.items():\n" +" s = str(v)\n" +" s = self.escaped.sub(replacer, s)\n" +" part += f' {k}=\"{s}\"'\n" +" part += ']'\n" +" parts.append(part)\n" +" sdata = ''.join(parts)\n" +" return f'{version} {asctime} {hostname} {appname} {procid} {msgid} " +"{sdata} {msg}'" -#: ../../howto/logging-cookbook.rst:3921 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -5558,8 +7625,11 @@ msgid "" "your specific needs. With the above handler, you'd pass structured data " "using something like this::" msgstr "" +"上のコードを完全に理解するには RFC 5424 の知識が必要です。\n" +"構造化データをログに渡す方法など、要件が多少異なる場合もあるでしょう。\n" +"それでも、個別の要件に合わせて変更できるはずです。\n" +"このハンドラには、例えば次のように構造化データを渡します。 ::" -#: ../../howto/logging-cookbook.rst:3926 msgid "" "sd = {\n" " 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" @@ -5569,6 +7639,13 @@ msgid "" "i = 1\n" "logger.debug('Message %d', i, extra=extra)" msgstr "" +"sd = {\n" +" 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" +" 'foo@54321': {'rab': 'baz', 'zab': 'bozz', 'zzif': r'buzz'}\n" +"}\n" +"extra = {'structured_data': sd}\n" +"i = 1\n" +"logger.debug('Message %d', i, extra=extra)" #: ../../howto/logging-cookbook.rst:3935 msgid "How to treat a logger like an output stream" @@ -5586,7 +7663,6 @@ msgstr "" "きあります。これは file-like な API でロガーをラップするクラスを使うことで実" "現できます。以下はそのようなクラスを例解する短いスクリプトです:" -#: ../../howto/logging-cookbook.rst:3942 msgid "" "import logging\n" "\n" @@ -5623,16 +7699,51 @@ msgid "" "if __name__ == \"__main__\":\n" " main()" msgstr "" +"import logging\n" +"\n" +"class LoggerWriter:\n" +" def __init__(self, logger, level):\n" +" self.logger = logger\n" +" self.level = level\n" +"\n" +" def write(self, message):\n" +" if message != '\\n': # 必要なら、改行だけの出力を避ける\n" +" self.logger.log(self.level, message)\n" +"\n" +" def flush(self):\n" +" # 実際には何もしないが、ファイルライクオブジェクトに期待される場合が" +"ある。\n" +" # 必要に応じて実装する\n" +" pass\n" +"\n" +" def close(self):\n" +" # 実際には何もしないが、ファイルライクオブジェクトに期待される場合が" +"ある。\n" +" # 必要に応じて実装する。フラグを設定し、\n" +" # 以降の write の呼び出しで例外を送出するようにしてもよい\n" +" pass\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" logger = logging.getLogger('demo')\n" +" info_fp = LoggerWriter(logger, logging.INFO)\n" +" debug_fp = LoggerWriter(logger, logging.DEBUG)\n" +" print('An INFO message', file=info_fp)\n" +" print('A DEBUG message', file=debug_fp)\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" #: ../../howto/logging-cookbook.rst:3977 msgid "When this script is run, it prints" msgstr "このスクリプトを実行すると、次のように出力されます。" -#: ../../howto/logging-cookbook.rst:3979 msgid "" "INFO:demo:An INFO message\n" "DEBUG:demo:A DEBUG message" msgstr "" +"INFO:demo:An INFO message\n" +"DEBUG:demo:A DEBUG message" #: ../../howto/logging-cookbook.rst:3984 msgid "" @@ -5642,13 +7753,16 @@ msgstr "" "また、 ``sys.stdout`` や ``sys.stderr`` をリダイレクトするには " "``LoggerWriter`` を使って以下のようにします:" -#: ../../howto/logging-cookbook.rst:3987 msgid "" "import sys\n" "\n" "sys.stdout = LoggerWriter(logger, logging.INFO)\n" "sys.stderr = LoggerWriter(logger, logging.WARNING)" msgstr "" +"import sys\n" +"\n" +"sys.stdout = LoggerWriter(logger, logging.INFO)\n" +"sys.stderr = LoggerWriter(logger, logging.WARNING)" #: ../../howto/logging-cookbook.rst:3994 msgid "" @@ -5662,7 +7776,6 @@ msgstr "" "で上書きされる *前の* ``sys.stderr`` を使って) 設定を行います。そして、以下の" "ような結果を得るでしょう:" -#: ../../howto/logging-cookbook.rst:3999 msgid "" ">>> print('Foo')\n" "INFO:demo:Foo\n" @@ -5670,6 +7783,11 @@ msgid "" "WARNING:demo:Bar\n" ">>>" msgstr "" +">>> print('Foo')\n" +"INFO:demo:Foo\n" +">>> print('Bar', file=sys.stderr)\n" +"WARNING:demo:Bar\n" +">>>" #: ../../howto/logging-cookbook.rst:4007 msgid "" @@ -5691,17 +7809,17 @@ msgstr "" "いてはなすがままになっています。たとえば、上記の ``LoggerWriter`` の定義で、" "次のようなコードの断片があったとします。" -#: ../../howto/logging-cookbook.rst:4015 msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)\n" "1 / 0" msgstr "" +"sys.stderr = LoggerWriter(logger, logging.WARNING)\n" +"1 / 0" #: ../../howto/logging-cookbook.rst:4020 msgid "then running the script results in" msgstr "このスクリプトを実行すると以下のような結果が得られます。" -#: ../../howto/logging-cookbook.rst:4022 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "\n" @@ -5719,8 +7837,22 @@ msgid "" "WARNING:demo::\n" "WARNING:demo:division by zero" msgstr "" +"WARNING:demo:Traceback (most recent call last):\n" +"\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 53, " +"in \n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 49, " +"in main\n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:1 / 0\n" +"WARNING:demo:ZeroDivisionError\n" +"WARNING:demo::\n" +"WARNING:demo:division by zero" -#: ../../howto/logging-cookbook.rst:4038 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -5729,8 +7861,13 @@ msgid "" "when newlines are seen. Let's use a slightly better implementation of " "``LoggerWriter``:" msgstr "" +"この出力は望ましいものではありません。\n" +"内部のコードが ``sys.stderr`` に複数回の書き込みを行い、そのたびに別のログ行" +"になるためです (例えば上の最後の三行)。\n" +"この問題を避けるには、書き込まれた内容をバッファにため、改行が現れたときだけ" +"ログ行を出力します。\n" +"``LoggerWriter`` を少し改善してみましょう:" -#: ../../howto/logging-cookbook.rst:4044 msgid "" "class BufferingLoggerWriter(LoggerWriter):\n" " def __init__(self, logger, level):\n" @@ -5749,6 +7886,22 @@ msgid "" " for part in parts:\n" " self.logger.log(self.level, part)" msgstr "" +"class BufferingLoggerWriter(LoggerWriter):\n" +" def __init__(self, logger, level):\n" +" super().__init__(logger, level)\n" +" self.buffer = ''\n" +"\n" +" def write(self, message):\n" +" if '\\n' not in message:\n" +" self.buffer += message\n" +" else:\n" +" parts = message.split('\\n')\n" +" if self.buffer:\n" +" s = self.buffer + parts.pop(0)\n" +" self.logger.log(self.level, s)\n" +" self.buffer = parts.pop()\n" +" for part in parts:\n" +" self.logger.log(self.level, part)" #: ../../howto/logging-cookbook.rst:4063 msgid "" @@ -5758,7 +7911,6 @@ msgstr "" "この実装は改行があらわれるまでログをバッファリングし、行全体をログに出力する" "だけです。このアプローチにより、より適切な出力が得られます:" -#: ../../howto/logging-cookbook.rst:4066 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " @@ -5769,10 +7921,17 @@ msgid "" "WARNING:demo: 1/0\n" "WARNING:demo:ZeroDivisionError: division by zero" msgstr "" +"WARNING:demo:Traceback (most recent call last):\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " +"in \n" +"WARNING:demo: main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 52, " +"in main\n" +"WARNING:demo: 1/0\n" +"WARNING:demo:ZeroDivisionError: division by zero" -#: ../../howto/logging-cookbook.rst:4076 msgid "How to uniformly handle newlines in logging output" -msgstr "" +msgstr "ログ出力の改行を統一的に扱う方法" #: ../../howto/logging-cookbook.rst:4078 msgid "" @@ -5785,7 +7944,6 @@ msgid "" "handler mixin, as in the following snippet:" msgstr "" -#: ../../howto/logging-cookbook.rst:4086 msgid "" "# Assume this is in a module mymixins.py\n" "import copy\n" @@ -5803,12 +7961,25 @@ msgid "" " rec.msg = line\n" " super().emit(rec)" msgstr "" +"# mymixins.py モジュールにあるとする\n" +"import copy\n" +"\n" +"class MultilineMixin:\n" +" def emit(self, record):\n" +" s = record.getMessage()\n" +" if '\\n' not in s:\n" +" super().emit(record)\n" +" else:\n" +" lines = s.splitlines()\n" +" rec = copy.copy(record)\n" +" rec.args = None\n" +" for line in lines:\n" +" rec.msg = line\n" +" super().emit(rec)" -#: ../../howto/logging-cookbook.rst:4104 msgid "You can use the mixin as in the following script:" -msgstr "" +msgstr "このミックスインは次のように使えます:" -#: ../../howto/logging-cookbook.rst:4106 msgid "" "import logging\n" "\n" @@ -5829,12 +8000,28 @@ msgid "" " logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " "again')" msgstr "" +"import logging\n" +"\n" +"from mymixins import MultilineMixin\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class StreamHandler(MultilineMixin, logging.StreamHandler):\n" +" pass\n" +"\n" +"if __name__ == '__main__':\n" +" logging.basicConfig(level=logging.DEBUG, format='%(asctime)s " +"%(levelname)-9s %(message)s',\n" +" handlers = [StreamHandler()])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " +"again')" -#: ../../howto/logging-cookbook.rst:4125 msgid "The script, when run, prints something like:" -msgstr "" +msgstr "実行すると、次のように表示されます:" -#: ../../howto/logging-cookbook.rst:4127 msgid "" "2025-07-02 13:54:47,234 DEBUG Single line\n" "2025-07-02 13:54:47,234 DEBUG Multiple lines:\n" @@ -5844,15 +8031,23 @@ msgid "" "2025-07-02 13:54:47,234 DEBUG fool me ...\n" "2025-07-02 13:54:47,234 DEBUG can't get fooled again" msgstr "" +"2025-07-02 13:54:47,234 DEBUG Single line\n" +"2025-07-02 13:54:47,234 DEBUG Multiple lines:\n" +"2025-07-02 13:54:47,234 DEBUG fool me once ...\n" +"2025-07-02 13:54:47,234 DEBUG Another single line\n" +"2025-07-02 13:54:47,234 DEBUG Multiple lines:\n" +"2025-07-02 13:54:47,234 DEBUG fool me ...\n" +"2025-07-02 13:54:47,234 DEBUG can't get fooled again" -#: ../../howto/logging-cookbook.rst:4137 msgid "" "If, on the other hand, you are concerned about `log injection `_, you can use a formatter which " "escapes newlines, as per the following example:" msgstr "" +"一方、`ログインジェクション `_ が気になる場合は、次の例のように改行をエスケープするフォー" +"マッタを使えます:" -#: ../../howto/logging-cookbook.rst:4141 msgid "" "import logging\n" "\n" @@ -5874,14 +8069,33 @@ msgid "" " logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " "again')" msgstr "" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class EscapingFormatter(logging.Formatter):\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" return s.replace('\\n', r'\\n')\n" +"\n" +"if __name__ == '__main__':\n" +" h = logging.StreamHandler()\n" +" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s " +"%(message)s'))\n" +" logging.basicConfig(level=logging.DEBUG, handlers = [h])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " +"again')" -#: ../../howto/logging-cookbook.rst:4161 msgid "" "You can, of course, use whatever escaping scheme makes the most sense for " "you. The script, when run, should produce output like this:" msgstr "" +"もちろん、用途に合ったエスケープ方法を使えます。\n" +"このスクリプトを実行すると、次のように表示されます:" -#: ../../howto/logging-cookbook.rst:4164 msgid "" "2025-07-09 06:47:33,783 DEBUG Single line\n" "2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me once ...\n" @@ -5889,12 +8103,18 @@ msgid "" "2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get " "fooled again" msgstr "" +"2025-07-09 06:47:33,783 DEBUG Single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me once ...\n" +"2025-07-09 06:47:33,783 DEBUG Another single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get " +"fooled again" -#: ../../howto/logging-cookbook.rst:4171 msgid "" "Escaping behaviour can't be the stdlib default , as it would break backwards " "compatibility." msgstr "" +"このエスケープ処理は後方互換性を損なうため、標準ライブラリのデフォルトにはで" +"きません。" #: ../../howto/logging-cookbook.rst:4177 msgid "Patterns to avoid" @@ -5928,13 +8148,12 @@ msgstr "" "ではエラーがおきることなく、同じファイルを何度も開けます。これは次のように間" "違って使われる可能性があります。" -#: ../../howto/logging-cookbook.rst:4192 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -"同じファイルを指すファイルハンドラを1度以上追加する(例えばコピー&ペーストし" -"て書き換え忘れによるエラー)。" +"同じファイルを参照するファイルハンドラを複数回追加する (例えばコピー&ペース" +"ト後の変更忘れによって)。" #: ../../howto/logging-cookbook.rst:4195 msgid "" @@ -5962,7 +8181,6 @@ msgstr "" "ファイルを複数回開くことは、 *一見* 動作しているように見えますが、さまざまな" "問題を引き起こす可能性があります:" -#: ../../howto/logging-cookbook.rst:4205 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -5970,11 +8188,12 @@ msgid "" "if concurrent writes are attempted by two different threads using two " "different handler instances which happen to point to the same file." msgstr "" -"複数のスレッドが同一ファイルに書き出そうとすると、ログ出力が文字化けする可能" -"性があります。ログモジュールは同じハンドラーのインスタンスに対して並列で利用" -"しても正しく動くようになっていますが、同じファイルを参照する2つの異なるハンド" -"ラーのインスタンスに対し、2つのスレッドから同時に書き込みをした場合にはそのよ" -"うな保護は働きません。" +"複数のスレッドやプロセスが同じファイルに書き込もうとすると、ログ出力が混ざっ" +"て壊れる可能性があります。\n" +"logging は複数のスレッドによる同じハンドラインスタンスの同時使用を保護しま" +"す。\n" +"しかし、同じファイルを指す別々のハンドラインスタンスを使い、二つのスレッドが" +"同時に書き込む場合には、そのような保護はありません。" #: ../../howto/logging-cookbook.rst:4211 msgid "" @@ -6030,17 +8249,17 @@ msgstr "" "ライブラリ内でロガーに :class:`~logging.NullHandler` 以外のハンドラーを追加す" "る" -#: ../../howto/logging-cookbook.rst:4235 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " "you are maintaining a library, ensure that you don't add handlers to any of " "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -"ハンドラーやフォーマッター、フィルターを追加してログ出力をカスタマイズするの" -"はライブラリ開発者ではなく、アプリケーション開発者の責務です。もしあなたがラ" -"イブラリのメンテナンスをしているのであれば、 :class:`~logging.NullHandler` イ" -"ンスタンス以外のロガーを追加してはいけない、ということを意味します。" +"ハンドラ、フォーマッタ、フィルタを追加してロギングを設定するのは、アプリケー" +"ション開発者の責任です。\n" +"ライブラリ開発者の責任ではありません。\n" +"ライブラリを保守している場合、そのロガーに追加するハンドラは :class:" +"`~logging.NullHandler` インスタンスだけにしてください。" #: ../../howto/logging-cookbook.rst:4241 msgid "Creating a lot of loggers" diff --git a/howto/logging.po b/howto/logging.po index bc484376a..ba204b6ab 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -59,7 +59,6 @@ msgstr "" msgid "When to use logging" msgstr "logging を使うとき" -#: ../../howto/logging.rst:28 msgid "" "You can access logging functionality by creating a logger via ``logger = " "logging.getLogger(__name__)``, and then calling the logger's :meth:`~Logger." @@ -68,6 +67,13 @@ msgid "" "to see which logger methods to use when, see the table below. It states, for " "each of a set of common tasks, the best tool to use for that task." msgstr "" +"``logger = logging.getLogger(__name__)`` でロガーを作成し、:meth:`~Logger." +"debug`、:meth:`~Logger.info`、:meth:`~Logger.warning`、:meth:`~Logger." +"error`、:meth:`~Logger.critical` メソッドを呼び出すと、ロギング機能を利用でき" +"ます。\n" +"いつロギングを使い、どのメソッドを選べばよいかは、次の表を参照してくださ" +"い。\n" +"一般的なタスクごとに、最適な手段を示しています。" #: ../../howto/logging.rst:36 msgid "Task you want to perform" @@ -94,29 +100,30 @@ msgstr "" "プログラムの通常の操作中に発生したイベントの報告 (例えば、状態の監視や障害の" "分析)" -#: ../../howto/logging.rst:42 msgid "" "A logger's :meth:`~Logger.info` (or :meth:`~Logger.debug` method for very " "detailed output for diagnostic purposes)" msgstr "" +"ロガーの :meth:`~Logger.info` (診断用の非常に詳しい出力には :meth:`~Logger." +"debug`) メソッド" #: ../../howto/logging.rst:47 msgid "Issue a warning regarding a particular runtime event" msgstr "特定のランタイムイベントに関わる警告の発行" -#: ../../howto/logging.rst:47 msgid "" ":func:`warnings.warn` in library code if the issue is avoidable and the " "client application should be modified to eliminate the warning" msgstr "" -"その発行が避けられるもので、クライアントアプリケーションを修正してその警告を" -"排除するべきなら :func:`warnings.warn`" +"問題を回避でき、クライアントアプリケーションを修正して警告の原因を取り除くべ" +"き場合は、ライブラリのコードで :func:`warnings.warn` を使う" -#: ../../howto/logging.rst:52 msgid "" "A logger's :meth:`~Logger.warning` method if there is nothing the client " "application can do about the situation, but the event should still be noted" msgstr "" +"クライアントアプリケーションでは対処できなくても、そのイベントを記録すべき場" +"合はロガーの :meth:`~Logger.warning` メソッド" #: ../../howto/logging.rst:58 msgid "Report an error regarding a particular runtime event" @@ -126,27 +133,28 @@ msgstr "特定のランタイムイベントに関わるエラーの報告" msgid "Raise an exception" msgstr "例外の送出" -#: ../../howto/logging.rst:61 msgid "" "Report suppression of an error without raising an exception (e.g. error " "handler in a long-running server process)" msgstr "" -"例外の送出をしないエラーの抑制 (例えば、長期のサーバプロセス中のエラーハンド" -"ラ)" +"例外を送出せずに処理したエラーの報告 (例えば、長時間稼働するサーバープロセス" +"のエラーハンドラ)" -#: ../../howto/logging.rst:61 msgid "" "A logger's :meth:`~Logger.error`, :meth:`~Logger.exception` or :meth:" "`~Logger.critical` method as appropriate for the specific error and " "application domain" msgstr "" +"エラーやアプリケーションの分野に応じて、ロガーの :meth:`~Logger.error`、:" +"meth:`~Logger.exception`、:meth:`~Logger.critical` メソッド" -#: ../../howto/logging.rst:68 msgid "" "The logger methods are named after the level or severity of the events they " "are used to track. The standard levels and their applicability are described " "below (in increasing order of severity):" msgstr "" +"ロガーのメソッド名は、追跡するイベントのレベルや重大度に対応しています。\n" +"標準のレベルとその用途を、重大度の低い順に示します:" #: ../../howto/logging.rst:75 ../../howto/logging.rst:873 msgid "Level" @@ -177,14 +185,14 @@ msgstr "想定された通りのことが起こったことの確認。" msgid "``WARNING``" msgstr "``WARNING``" -#: ../../howto/logging.rst:83 msgid "" "An indication that something unexpected happened, or indicative of some " "problem in the near future (e.g. 'disk space low'). The software is still " "working as expected." msgstr "" -"想定外のことが起こった、または問題が近く起こりそうである (例えば、'disk " -"space low') ことの表示。" +"想定外のことが起こった、または近い将来の問題を示す情報 (例えば「ディスク容量" +"が少ない」)。\n" +"ソフトウェアは引き続き想定どおり動作しています。" #: ../../howto/logging.rst:88 ../../howto/logging.rst:877 msgid "``ERROR``" @@ -206,12 +214,13 @@ msgid "" "continue running." msgstr "プログラム自体が実行を続けられないことを表す、重大なエラー。" -#: ../../howto/logging.rst:95 msgid "" "The default level is ``WARNING``, which means that only events of this " "severity and higher will be tracked, unless the logging package is " "configured to do otherwise." msgstr "" +"デフォルトのレベルは ``WARNING`` です。\n" +"そのため、別の設定をしない限り、この重大度以上のイベントだけが追跡されます。" #: ../../howto/logging.rst:98 msgid "" @@ -231,12 +240,14 @@ msgstr "簡単な例" msgid "A very simple example is::" msgstr "ごく簡単な例は::" -#: ../../howto/logging.rst:110 msgid "" "import logging\n" "logging.warning('Watch out!') # will print a message to the console\n" "logging.info('I told you so') # will not print anything" msgstr "" +"import logging\n" +"logging.warning('Watch out!') # will print a message to the console\n" +"logging.info('I told you so') # will not print anything" #: ../../howto/logging.rst:114 msgid "If you type these lines into a script and run it, you'll see:" @@ -244,11 +255,9 @@ msgstr "" "これらの行をスクリプトにタイプして実行すると、次のようにコンソールに出力され" "ます:" -#: ../../howto/logging.rst:116 msgid "WARNING:root:Watch out!" -msgstr "" +msgstr "WARNING:root:Watch out!" -#: ../../howto/logging.rst:120 msgid "" "printed out on the console. The ``INFO`` message doesn't appear because the " "default level is ``WARNING``. The printed message includes the indication of " @@ -256,8 +265,14 @@ msgid "" "e. 'Watch out!'. The actual output can be formatted quite flexibly if you " "need that; formatting options will also be explained later." msgstr "" +"これがコンソールに表示されます。\n" +"デフォルトのレベルが ``WARNING`` なので、``INFO`` のメッセージは表示されませ" +"ん。\n" +"表示されるメッセージには、レベルとログ呼び出しで指定したイベントの説明、つま" +"り 'Watch out!' が含まれます。\n" +"必要なら出力の書式を柔軟に設定できます。\n" +"書式設定のオプションは後で説明します。" -#: ../../howto/logging.rst:126 msgid "" "Notice that in this example, we use functions directly on the ``logging`` " "module, like ``logging.debug``, rather than creating a logger and calling " @@ -268,6 +283,13 @@ msgid "" "reason as well as others, it's better to create loggers and call their " "methods." msgstr "" +"この例ではロガーを作成してメソッドを呼ぶ代わりに、``logging.debug`` など " +"``logging`` モジュールの関数を直接使っています。\n" +"これらはルートロガーを操作する関数ですが、この例のように設定がまだ行われてい" +"ない場合は :func:`~logging.basicConfig` を自動的に呼び出すため便利です。\n" +"ただし、大きなプログラムでは通常、ロギングの設定を明示的に制御したくなるで" +"しょう。\n" +"この点などを考えると、ロガーを作成してそのメソッドを呼ぶ方が適しています。" #: ../../howto/logging.rst:135 msgid "Logging to a file" @@ -284,7 +306,6 @@ msgstr "" "を見て行きましょう。以下のサンプルを試すときは Python インタプリタを新しく起" "動して、上のセッションの続きにならないようにしてください::" -#: ../../howto/logging.rst:141 msgid "" "import logging\n" "logger = logging.getLogger(__name__)\n" @@ -295,6 +316,14 @@ msgid "" "logger.warning('And this, too')\n" "logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" msgstr "" +"import logging\n" +"logger = logging.getLogger(__name__)\n" +"logging.basicConfig(filename='example.log', encoding='utf-8', level=logging." +"DEBUG)\n" +"logger.debug('This message should go to the log file')\n" +"logger.info('So should this')\n" +"logger.warning('And this, too')\n" +"logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" #: ../../howto/logging.rst:149 msgid "" @@ -316,13 +345,16 @@ msgid "" "messages:" msgstr "そして、ファイルの中身を確認すると、ログメッセージが確認できます:" -#: ../../howto/logging.rst:159 msgid "" "DEBUG:__main__:This message should go to the log file\n" "INFO:__main__:So should this\n" "WARNING:__main__:And this, too\n" "ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö" msgstr "" +"DEBUG:__main__:This message should go to the log file\n" +"INFO:__main__:So should this\n" +"WARNING:__main__:And this, too\n" +"ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö" #: ../../howto/logging.rst:166 msgid "" @@ -339,20 +371,16 @@ msgid "" "If you want to set the logging level from a command-line option such as:" msgstr "次のようなコマンドラインオプションでログレベルを設定したいと考え:" -#: ../../howto/logging.rst:172 msgid "--log=INFO" -msgstr "" +msgstr "--log=INFO" -#: ../../howto/logging.rst:176 msgid "" "and you have the value of the parameter passed for ``--log`` in some " "variable *loglevel*, you can use::" -msgstr "" -"``--log`` に渡されたパラメータの値を変数 *loglevel* に保存しているとしたら、" +msgstr "``--log`` に渡された値を変数 *loglevel* に保存しているなら、 ::" -#: ../../howto/logging.rst:179 msgid "getattr(logging, loglevel.upper())" -msgstr "" +msgstr "getattr(logging, loglevel.upper())" #: ../../howto/logging.rst:181 msgid "" @@ -364,7 +392,6 @@ msgstr "" "ます。ユーザの入力値をすべてエラーチェックしたくなり、次の例のように実装する" "こともあるでしょう::" -#: ../../howto/logging.rst:185 msgid "" "# assuming loglevel is bound to the string value obtained from the\n" "# command line argument. Convert to upper case to allow the user to\n" @@ -374,13 +401,22 @@ msgid "" " raise ValueError('Invalid log level: %s' % loglevel)\n" "logging.basicConfig(level=numeric_level, ...)" msgstr "" +"# loglevel はコマンドライン引数から取得した文字列とする。\n" +"# --log=DEBUG と --log=debug のどちらでも指定できるよう、\n" +"# 大文字に変換する\n" +"numeric_level = getattr(logging, loglevel.upper(), None)\n" +"if not isinstance(numeric_level, int):\n" +" raise ValueError('Invalid log level: %s' % loglevel)\n" +"logging.basicConfig(level=numeric_level, ...)" -#: ../../howto/logging.rst:193 msgid "" "The call to :func:`basicConfig` should come *before* any calls to a logger's " "methods such as :meth:`~Logger.debug`, :meth:`~Logger.info`, etc. Otherwise, " "that logging event may not be handled in the desired manner." msgstr "" +":func:`basicConfig` は、ロガーの :meth:`~Logger.debug` や :meth:`~Logger." +"info` などのメソッドを呼ぶ *前* に呼び出してください。\n" +"そうしないと、ログイベントが意図した方法で処理されない可能性があります。" #: ../../howto/logging.rst:197 msgid "" @@ -394,11 +430,12 @@ msgstr "" "に新たに始めたいなら、上記の例での呼び出しを次のように変え、*filemode* 引数を" "指定する方法がとれます::" -#: ../../howto/logging.rst:202 msgid "" "logging.basicConfig(filename='example.log', filemode='w', level=logging." "DEBUG)" msgstr "" +"logging.basicConfig(filename='example.log', filemode='w', level=logging." +"DEBUG)" #: ../../howto/logging.rst:204 msgid "" @@ -420,19 +457,19 @@ msgstr "" "変数データのログを取るには、イベント記述メッセージにフォーマット文字列を使" "い、引数に変数データを加えてください。例えば::" -#: ../../howto/logging.rst:214 msgid "" "import logging\n" "logging.warning('%s before you %s', 'Look', 'leap!')" msgstr "" +"import logging\n" +"logging.warning('%s before you %s', 'Look', 'leap!')" #: ../../howto/logging.rst:217 msgid "will display:" msgstr "により、次のように表示されます:" -#: ../../howto/logging.rst:219 msgid "WARNING:root:Look before you leap!" -msgstr "" +msgstr "WARNING:root:Look before you leap!" #: ../../howto/logging.rst:223 msgid "" @@ -462,7 +499,6 @@ msgstr "" "メッセージを表示するのに使われるフォーマットを変更するには、使いたいフォー" "マットを指定する必要があります::" -#: ../../howto/logging.rst:237 msgid "" "import logging\n" "logging.basicConfig(format='%(levelname)s:%(message)s', level=logging." @@ -471,17 +507,25 @@ msgid "" "logging.info('So should this')\n" "logging.warning('And this, too')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(levelname)s:%(message)s', level=logging." +"DEBUG)\n" +"logging.debug('This message should appear on the console')\n" +"logging.info('So should this')\n" +"logging.warning('And this, too')" #: ../../howto/logging.rst:243 msgid "which would print:" msgstr "により、次のように表示されます:" -#: ../../howto/logging.rst:245 msgid "" "DEBUG:This message should appear on the console\n" "INFO:So should this\n" "WARNING:And this, too" msgstr "" +"DEBUG:This message should appear on the console\n" +"INFO:So should this\n" +"WARNING:And this, too" #: ../../howto/logging.rst:251 msgid "" @@ -510,20 +554,21 @@ msgstr "" "イベントの日付と時刻を表示するには、フォーマット文字列に '%(asctime)s' を置い" "てください::" -#: ../../howto/logging.rst:265 msgid "" "import logging\n" "logging.basicConfig(format='%(asctime)s %(message)s')\n" "logging.warning('is when this event was logged.')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s')\n" +"logging.warning('is when this event was logged.')" #: ../../howto/logging.rst:269 msgid "which should print something like this:" msgstr "これは以下の様なフォーマットで表示されます:" -#: ../../howto/logging.rst:271 msgid "2010-12-12 11:41:42,612 is when this event was logged." -msgstr "" +msgstr "2010-12-12 11:41:42,612 is when this event was logged." #: ../../howto/logging.rst:275 msgid "" @@ -535,21 +580,23 @@ msgstr "" "`3339` に似ています。日付と時間のフォーマットをより詳細に制御する必要があるな" "ら、以下の例の様に、 ``basicConfig`` に *datefmt* 引数を指定してください::" -#: ../../howto/logging.rst:279 msgid "" "import logging\n" "logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" "%M:%S %p')\n" "logging.warning('is when this event was logged.')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" +"%M:%S %p')\n" +"logging.warning('is when this event was logged.')" #: ../../howto/logging.rst:283 msgid "which would display something like this:" msgstr "これは次のように表示されます:" -#: ../../howto/logging.rst:285 msgid "12/12/2010 11:46:36 AM is when this event was logged." -msgstr "" +msgstr "12/12/2010 11:46:36 AM is when this event was logged." #: ../../howto/logging.rst:289 msgid "" @@ -576,7 +623,6 @@ msgstr "" "を使いこなすためには、もうちょっと時間をかけて、以下のセクションを読む必要が" "あります。その用意ができたら、好きな飲み物を持って、次に進みましょう。" -#: ../../howto/logging.rst:302 msgid "" "If your logging needs are simple, then use the above examples to incorporate " "logging into your own scripts, and if you run into problems or don't " @@ -584,6 +630,11 @@ msgid "" "`Python discussion forum `_ and you " "should receive help before too long." msgstr "" +"単純なロギングで十分なら、上の例を使って自分のスクリプトに組み込んでくださ" +"い。\n" +"問題や分からないことがあれば、`Python ディスカッションフォーラム `_ の Help カテゴリに質問を投稿すると、ほどなく助" +"けが得られるでしょう。" #: ../../howto/logging.rst:308 msgid "" @@ -662,9 +713,8 @@ msgstr "" "ロガーに名前をつけるときの良い習慣は、ロギングを使う各モジュールに、以下のよ" "うに名付けられた、モジュールレベルロガーを使うことです::" -#: ../../howto/logging.rst:341 msgid "logger = logging.getLogger(__name__)" -msgstr "" +msgstr "logger = logging.getLogger(__name__)" #: ../../howto/logging.rst:343 msgid "" @@ -688,7 +738,6 @@ msgstr "" "の同名のメソッドを呼び出します。これらの関数とメソッドは、同じ署名をもってい" "ます。ルートロガーの名前は、ログ出力では 'root' と表示されます。" -#: ../../howto/logging.rst:352 msgid "" "It is, of course, possible to log messages to different destinations. " "Support is included in the package for writing log messages to files, HTTP " @@ -698,12 +747,13 @@ msgid "" "destination class if you have special requirements not met by any of the " "built-in handler classes." msgstr "" -"もちろん、メッセージを異なる送信先に記録することも出来ます。このパッケージで" -"は、ファイルへ、 HTTP GET/POST 先へ、 SMTP 経由で電子メールへ、汎用のソケット" -"へ、キューへ、または Windows NT イベントログのような OS 毎のログ記録機構へ" -"の、ログメッセージの書きこみがサポートされています。送信先は、 :dfn:" -"`handler` クラスによって取り扱われます。組み込みのハンドラクラスでは満たせな" -"いような、特殊な要件があるなら、独自のログ送信先を生成できます。" +"ログメッセージはさまざまな出力先に送れます。\n" +"このパッケージは、ファイル、HTTP GET/POST の送信先、SMTP によるメール、汎用ソ" +"ケット、キュー、syslog や Windows NT イベントログなどの OS 固有のロギング機構" +"に対応しています。\n" +"出力先は :dfn:`ハンドラ` クラスが扱います。\n" +"組み込みのハンドラクラスでは満たせない要件があれば、独自のログ出力先クラスを" +"作成できます。" #: ../../howto/logging.rst:359 msgid "" @@ -730,9 +780,8 @@ msgstr "" ":func:`basicConfig` が設定するデフォルトのメッセージのフォーマットは次のよう" "になります:" -#: ../../howto/logging.rst:369 msgid "severity:logger name:message" -msgstr "" +msgstr "重大度:ロガー名:メッセージ" #: ../../howto/logging.rst:373 msgid "" @@ -744,9 +793,8 @@ msgstr "" "で、これを変更できます。フォーマット文字列を構成するためのすべてのオプション" "は、 :ref:`formatter-objects` を参照してください。" -#: ../../howto/logging.rst:378 msgid "Logging Flow" -msgstr "Logging Flow" +msgstr "ログ処理の流れ" #: ../../howto/logging.rst:380 msgid "" @@ -1038,28 +1086,25 @@ msgstr "" "す。コンストラクタは三つのオプション引数を取ります -- メッセージのフォーマッ" "ト文字列、日付のフォーマット文字列、スタイル標識です。" -#: ../../howto/logging.rst:559 msgid "" "If there is no message format string, the default is to use the raw " "message. If there is no date format string, the default date format is:" msgstr "" -"フォーマット文字列に何も渡さない場合は、デフォルトで行メッセージが利用されま" -"す。また、日付フォーマットに何も渡さない場合は、デフォルトで以下のフォーマッ" -"トが利用されます:" +"メッセージの書式文字列を指定しなければ、デフォルトではメッセージをそのまま使" +"います。\n" +"日付の書式文字列を指定しなければ、デフォルトの書式は次のとおりです:" -#: ../../howto/logging.rst:562 msgid "%Y-%m-%d %H:%M:%S" -msgstr "" +msgstr "%Y-%m-%d %H:%M:%S" -#: ../../howto/logging.rst:566 msgid "" "with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " "``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " "used." msgstr "" -"時刻の末尾にはミリ秒が付きます。 ``style`` は ``'%'``, ``'{'``, または " -"``'{TX-PL-LABEL}#x27;`` のいずれかです。特に指定がなければ ``'%'`` が使われま" -"す。" +"末尾にはミリ秒が付きます。\n" +"``style`` には ``'%'``、``'{'``、``'$'`` のいずれかを指定します。\n" +"省略すると ``'%'`` が使われます。" #: ../../howto/logging.rst:569 msgid "" @@ -1090,11 +1135,9 @@ msgstr "" "次のメッセージフォーマット文字列は、人が読みやすい形式の時刻、メッセージの深" "刻度、およびメッセージの内容を、順番に出力します::" -#: ../../howto/logging.rst:583 msgid "'%(asctime)s - %(levelname)s - %(message)s'" -msgstr "" +msgstr "'%(asctime)s - %(levelname)s - %(message)s'" -#: ../../howto/logging.rst:585 msgid "" "Formatters use a user-configurable function to convert the creation time of " "a record to a tuple. By default, :func:`time.localtime` is used; to change " @@ -1104,13 +1147,16 @@ msgid "" "want all logging times to be shown in GMT, set the ``converter`` attribute " "in the Formatter class (to ``time.gmtime`` for GMT display)." msgstr "" -"フォーマッタは、ユーザが設定できる関数を使って、生成時刻をタプルに記録しま" -"す。デフォルトでは、 :func:`time.localtime` が使われます。特定のフォーマッタ" -"インスタンスに対してこれを変更するには、インスタンスの ``converter`` 属性を :" -"func:`time.localtime` や :func:`time.gmtime` と同じ署名をもつ関数に設定してく" -"ださい。すべてのフォーマッタインスタンスに対してこれを変更するには、例えば全" -"てのロギング時刻を GMT で表示するには、フォーマッタクラスの ``converter`` 属" -"性を (GMT 表示の ``time.gmtime`` に) 設定してください。" +"フォーマッタは設定可能な関数を使って、レコードの作成時刻をタプルに変換しま" +"す。\n" +"デフォルトでは :func:`time.localtime` が使われます。\n" +"特定のフォーマッタインスタンスで変更するには、その ``converter`` 属性を :" +"func:`time.localtime` または :func:`time.gmtime` と同じシグネチャの関数に設定" +"します。\n" +"すべてのフォーマッタで変更するには、Formatter クラスの ``converter`` 属性を設" +"定します。\n" +"例えば、すべてのログの時刻を GMT で表示するには ``time.gmtime`` に設定しま" +"す。" #: ../../howto/logging.rst:595 msgid "Configuring Logging" @@ -1151,7 +1197,6 @@ msgstr "" "下の例では、Python コードを使って、とても簡単なロガー、コンソールハンドラ、そ" "して簡単なフォーマッタを設定しています::" -#: ../../howto/logging.rst:612 msgid "" "import logging\n" "\n" @@ -1180,6 +1225,32 @@ msgid "" "logger.error('error message')\n" "logger.critical('critical message')" msgstr "" +"import logging\n" +"\n" +"# ロガーを作成する\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"\n" +"# コンソールハンドラーを作成し、レベルを debug に設定する\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.DEBUG)\n" +"\n" +"# フォーマッターを作成する\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"\n" +"# ch にフォーマッターを設定する\n" +"ch.setFormatter(formatter)\n" +"\n" +"# ロガーに ch を追加する\n" +"logger.addHandler(ch)\n" +"\n" +"# 「アプリケーション」のコード\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" #: ../../howto/logging.rst:638 msgid "" @@ -1187,7 +1258,6 @@ msgid "" msgstr "" "このモジュールを実行すると、コマンドラインによって以下の出力がなされます:" -#: ../../howto/logging.rst:640 msgid "" "$ python simple_logging_module.py\n" "2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message\n" @@ -1196,6 +1266,12 @@ msgid "" "2005-03-19 15:10:26,697 - simple_example - ERROR - error message\n" "2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" msgstr "" +"$ python simple_logging_module.py\n" +"2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message\n" +"2005-03-19 15:10:26,620 - simple_example - INFO - info message\n" +"2005-03-19 15:10:26,695 - simple_example - WARNING - warn message\n" +"2005-03-19 15:10:26,697 - simple_example - ERROR - error message\n" +"2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" #: ../../howto/logging.rst:649 msgid "" @@ -1206,7 +1282,6 @@ msgstr "" "以下の Python モジュールは、ロガー、ハンドラ、フォーマッタをほとんど上述の例" "と同じように生成していますが、オブジェクト名だけが異なります::" -#: ../../howto/logging.rst:653 msgid "" "import logging\n" "import logging.config\n" @@ -1223,12 +1298,25 @@ msgid "" "logger.error('error message')\n" "logger.critical('critical message')" msgstr "" +"import logging\n" +"import logging.config\n" +"\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# ロガーを作成する\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"# 「アプリケーション」のコード\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" #: ../../howto/logging.rst:668 msgid "Here is the logging.conf file:" msgstr "これが logging.conf ファイルです:" -#: ../../howto/logging.rst:670 msgid "" "[loggers]\n" "keys=root,simpleExample\n" @@ -1258,13 +1346,38 @@ msgid "" "[formatter_simpleFormatter]\n" "format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" msgstr "" +"[loggers]\n" +"keys=root,simpleExample\n" +"\n" +"[handlers]\n" +"keys=consoleHandler\n" +"\n" +"[formatters]\n" +"keys=simpleFormatter\n" +"\n" +"[logger_root]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"\n" +"[logger_simpleExample]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"qualname=simpleExample\n" +"propagate=0\n" +"\n" +"[handler_consoleHandler]\n" +"class=StreamHandler\n" +"level=DEBUG\n" +"formatter=simpleFormatter\n" +"args=(sys.stdout,)\n" +"\n" +"[formatter_simpleFormatter]\n" +"format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" -#: ../../howto/logging.rst:700 msgid "" "The output is nearly identical to that of the non-config-file-based example:" -msgstr "出力は、設定ファイルに基づく例とだいたい同じです:" +msgstr "出力は、設定ファイルを使わない例とほぼ同じです:" -#: ../../howto/logging.rst:702 msgid "" "$ python simple_logging_config.py\n" "2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message\n" @@ -1273,6 +1386,12 @@ msgid "" "2005-03-19 15:38:56,055 - simpleExample - ERROR - error message\n" "2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" msgstr "" +"$ python simple_logging_config.py\n" +"2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message\n" +"2005-03-19 15:38:55,979 - simpleExample - INFO - info message\n" +"2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message\n" +"2005-03-19 15:38:56,055 - simpleExample - ERROR - error message\n" +"2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" #: ../../howto/logging.rst:711 msgid "" @@ -1284,7 +1403,6 @@ msgstr "" "プロパティを変えやすくなるという点で、Python コードの方法より少し優れていま" "す。" -#: ../../howto/logging.rst:715 msgid "" "The :func:`fileConfig` function takes a default parameter, " "``disable_existing_loggers``, which defaults to ``True`` for reasons of " @@ -1294,14 +1412,14 @@ msgid "" "configuration. Please refer to the reference documentation for more " "information, and specify ``False`` for this parameter if you wish." msgstr "" -":func:`fileConfig` 関数はデフォルト引数 ``disable_existing_loggers`` を取り、" -"後方互換性のためにデフォルト値は ``True`` になっています。\n" -"これはあなたの望むものかもしれませんし、そうでないかもしれません。というの" -"は、設定で明示的に指定したクラス (もしくはその親クラス) を除いて、 :func:" -"`fileConfig` が呼び出される前に存在した非ルートロガーを無効化してしまうからで" +":func:`fileConfig` 関数の ``disable_existing_loggers`` パラメータは、後方互換" +"性のためデフォルトで ``True`` です。\n" +"この設定が望ましいとは限りません。\n" +"そのロガー自身または祖先ロガーの名前が設定に明記されていない限り、:func:" +"`fileConfig` の呼び出し前から存在するルート以外のロガーが無効になるためで" "す。\n" -"より詳細なことはリファレンスを参照し、望むならこの引数に ``False`` を指定して" -"ください。" +"詳しくはリファレンスを参照し、必要に応じてこのパラメータを ``False`` にしてく" +"ださい。" #: ../../howto/logging.rst:723 msgid "" @@ -1334,7 +1452,6 @@ msgstr "" "るとき、パッケージ ``mypackage`` のモジュール ``mymodule`` で定義されたクラス" "に) ``mypackage.mymodule.MyHandler`` のどちらかが使えます。" -#: ../../howto/logging.rst:741 msgid "" "In Python 3.2, a new means of configuring logging has been introduced, using " "dictionaries to hold configuration information. This provides a superset of " @@ -1348,14 +1465,16 @@ msgid "" "can construct the dictionary in Python code, receive it in pickled form over " "a socket, or use whatever approach makes sense for your application." msgstr "" -"Python 3.2 では、ロギングを設定するのに新しく、辞書に設定情報を持たせる手段が" -"導入されました。これは、上で概説した設定ファイルに基づく方法による機能の上位" -"版を提供し、新しいアプリケーションやデプロイにはこのメソッドが推奨されます。" -"Python の辞書を使って設定情報を保持し、辞書は他の用途にも使えるので、設定の選" -"択肢が広がります。例えば、JSON フォーマットの設定ファイルや、YAML 処理機能が" -"使えれば YAML フォーマットのファイルを使って、設定辞書を構成できます。また、" -"もちろん、Python コードで辞書を構成し、ソケットを通して pickle 化された形式を" -"受け取るなど、アプリケーションで意味があるいかなるやり方でも使えます。" +"Python 3.2 では、設定情報を辞書に保持する新しいロギング設定方法が導入されまし" +"た。\n" +"これは上述の設定ファイル方式の機能をすべて含み、新しいアプリケーションやデプ" +"ロイに推奨される方法です。\n" +"設定を保持する Python の辞書にはさまざまな方法でデータを入れられるため、選択" +"肢が広がります。\n" +"例えば JSON 形式の設定ファイルや、YAML を処理できる環境なら YAML 形式のファイ" +"ルから設定辞書を構築できます。\n" +"Python コードで辞書を作ったり、ソケットで pickle 形式のデータを受け取ったりす" +"るなど、アプリケーションに適した方法を使えます。" #: ../../howto/logging.rst:753 msgid "" @@ -1364,7 +1483,6 @@ msgid "" msgstr "" "以下は、上記と同じ設定を辞書ベースの新しい手法で記載した YAML 形式の例です:" -#: ../../howto/logging.rst:756 msgid "" "version: 1\n" "formatters:\n" @@ -1385,6 +1503,24 @@ msgid "" " level: DEBUG\n" " handlers: [console]" msgstr "" +"version: 1\n" +"formatters:\n" +" simple:\n" +" format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'\n" +"handlers:\n" +" console:\n" +" class: logging.StreamHandler\n" +" level: DEBUG\n" +" formatter: simple\n" +" stream: ext://sys.stdout\n" +"loggers:\n" +" simpleExample:\n" +" level: DEBUG\n" +" handlers: [console]\n" +" propagate: no\n" +"root:\n" +" level: DEBUG\n" +" handlers: [console]" #: ../../howto/logging.rst:777 msgid "" @@ -1511,11 +1647,12 @@ msgstr "" "ます。ライブラリ *foo* によるすべてのロギングが、 'foo.x', 'foo.x.y' その他に" "該当する名前のロガーによってなされるなら::" -#: ../../howto/logging.rst:839 msgid "" "import logging\n" "logging.getLogger('foo').addHandler(logging.NullHandler())" msgstr "" +"import logging\n" +"logging.getLogger('foo').addHandler(logging.NullHandler())" #: ../../howto/logging.rst:842 msgid "" @@ -1542,7 +1679,6 @@ msgstr "" "するアプリケーション開発者が、ロギングの詳細度 (verbosity) やハンドラを望みの" "とおりに設定することを困難にしたり、不可能にしてしまいます。" -#: ../../howto/logging.rst:853 msgid "" "It is strongly advised that you *do not add any handlers other than* :class:" "`~logging.NullHandler` *to your library's loggers*. This is because the " @@ -1552,12 +1688,14 @@ msgid "" "handlers 'under the hood', you might well interfere with their ability to " "carry out unit tests and deliver logs which suit their requirements." msgstr "" -"*ライブラリのロガーには、* :class:`~logging.NullHandler` *以外のハンドラを追" -"加しない* ことを強く推奨します。これは、ハンドラの設定が、あなたのライブラリ" -"を使うアプリケーション開発者にも伝播するからです。アプリケーション開発者は、" -"対象となる聴衆と、そのアプリケーションにどのハンドラが最も適しているかを知っ" -"ています。ハンドラを 'ボンネットの中で' 加えてしまうと、ユニットテストをして" -"必要に応じたログを送達する能力に干渉しかねません。" +"*ライブラリのロガーには* :class:`~logging.NullHandler` *以外のハンドラを追加" +"しない* ことを強く推奨します。\n" +"ハンドラの設定は、そのライブラリを使うアプリケーション開発者が決めるものだか" +"らです。\n" +"アプリケーション開発者はログの読者や、アプリケーションに最適なハンドラを把握" +"しています。\n" +"ライブラリが内部で勝手にハンドラを追加すると、ユニットテストや、要件に合うロ" +"グの出力を妨げる可能性があります。" #: ../../howto/logging.rst:864 msgid "Logging Levels" @@ -1683,7 +1821,6 @@ msgstr "" msgid "Custom Levels" msgstr "カスタムレベル" -#: ../../howto/logging.rst:924 msgid "" "Defining your own levels is possible, but should not be necessary, as the " "existing levels have been chosen on the basis of practical experience. " @@ -1695,12 +1832,14 @@ msgid "" "difficult for the using developer to control and/or interpret, because a " "given numeric value might mean different things for different libraries." msgstr "" -"独自のレベルを定義することは可能ですが、必須ではなく、実経験上は既存のレベル" -"が選ばれます。しかし、カスタムレベルが必要だと確信するなら、レベルの定義には" -"多大な注意を払うべきで、*ライブラリの開発の際、カスタムレベルを定義することは" -"とても悪いアイデア* になり得ます。これは、複数のライブラリの作者がみな独自の" -"カスタムレベルを定義すると、与えられた数値が異なるライブラリで異なる意味にな" -"りえるため、開発者がこれを制御または解釈するのが難しくなるからです。" +"独自のレベルを定義することはできますが、既存のレベルは実際の経験に基づいて選" +"ばれているため、通常は必要ないはずです。\n" +"それでも必要だと確信する場合は、十分に注意してください。\n" +"特に *ライブラリで独自のレベルを定義するのは、非常によくない考え* かもしれま" +"せん。\n" +"複数のライブラリが独自のレベルを定義すると、同じ数値がライブラリごとに異なる" +"意味を持ち、併用する開発者がログを制御したり解釈したりするのが難しくなる可能" +"性があるためです。" #: ../../howto/logging.rst:937 msgid "Useful Handlers" @@ -1739,13 +1878,12 @@ msgstr "" "ん。代わりに、 :class:`~handlers.RotatingFileHandler` や :class:`~handlers." "TimedRotatingFileHandler` を使用してください。" -#: ../../howto/logging.rst:952 msgid "" ":class:`~handlers.RotatingFileHandler` instances send messages to disk " "files, with support for maximum log file sizes and log file rotation." msgstr "" -":class:`~handlers.RotatingFileHandler` インスタンスは、メッセージをディスク" -"ファイルに送り、最大ログファイル数とログファイル循環をサポートします。" +":class:`~handlers.RotatingFileHandler` インスタンスはメッセージをディスク上の" +"ファイルに送り、ログファイルの最大サイズとローテーションをサポートします。" #: ../../howto/logging.rst:955 msgid "" @@ -1940,7 +2078,6 @@ msgstr "" "ん。 :class:`Handler` サブクラスの :meth:`~Handler.emit` メソッドの間に起こる" "他の例外は、 :meth:`~Handler.handleError` メソッドに渡されます。" -#: ../../howto/logging.rst:1040 msgid "" "The default implementation of :meth:`~Handler.handleError` in :class:" "`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " @@ -1948,9 +2085,8 @@ msgid "" "the exception is swallowed." msgstr "" ":class:`Handler` の :meth:`~Handler.handleError` のデフォルト実装は、モジュー" -"ルレベル変数 :data:`raiseExceptions` が設定されているかどうかチェックします。" -"設定されているなら、トレースバックが :data:`sys.stderr` に出力されます。設定" -"されていないなら、例外は飲み込まれます。" +"ルレベルの変数 :data:`raiseExceptions` の値を調べます。\n" +"真ならトレースバックを :data:`sys.stderr` に表示し、偽なら例外を無視します。" #: ../../howto/logging.rst:1046 msgid "" @@ -2008,12 +2144,14 @@ msgstr "" "のメソッドは引数にレベルを取って、そのレベルの呼び出しに対して Logger がイベ" "ントを生成するなら true を返します。このようにコードを書くことができます::" -#: ../../howto/logging.rst:1079 msgid "" "if logger.isEnabledFor(logging.DEBUG):\n" " logger.debug('Message with %s, %s', expensive_func1(),\n" " expensive_func2())" msgstr "" +"if logger.isEnabledFor(logging.DEBUG):\n" +" logger.debug('Message with %s, %s', expensive_func1(),\n" +" expensive_func2())" #: ../../howto/logging.rst:1083 msgid "" @@ -2066,15 +2204,15 @@ msgstr "それを避ける方法" msgid "Information about where calls were made from." msgstr "呼び出しがどこから行われたかに関する情報。" -#: ../../howto/logging.rst:1103 msgid "" "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." "_getframe`, which may help to speed up your code in environments like PyPy " "(which can't speed up code that uses :func:`sys._getframe`)." msgstr "" -"``logging._srcfile`` を ``None`` にする。このことにより :func:`sys." -"_getframe` 呼び出しを避けることが出来、PyPy のような環境(:func:`sys." -"_getframe` の高速化が出来ない)において高速化の役に立ちます。" +"``logging._srcfile`` を ``None`` にする。\n" +":func:`sys._getframe` の呼び出しを避けられるため、それを使うコードを高速化で" +"きない PyPy などの環境で、高速化に役立つ可能性があります (:func:`sys." +"_getframe` を使うコードが対象です)。" #: ../../howto/logging.rst:1109 msgid "Threading information." diff --git a/howto/mro.po b/howto/mro.po index 29f41c1e7..c0d569110 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -22,26 +22,25 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/mro.rst:4 msgid "The Python 2.3 Method Resolution Order" -msgstr "" +msgstr "Python 2.3 のメソッド解決順序" -#: ../../howto/mro.rst:8 msgid "" "This is a historical document, provided as an appendix to the official " "documentation. The Method Resolution Order discussed here was *introduced* " "in Python 2.3, but it is still used in later versions -- including Python 3." msgstr "" +"これは公式ドキュメントの付録として提供する歴史的な文書です。\n" +"ここで説明するメソッド解決順序は Python 2.3 で *導入* されましたが、Python 3 " +"を含む後のバージョンでも使われています。" -#: ../../howto/mro.rst:13 msgid "By `Michele Simionato `__." -msgstr "" +msgstr "著者: `Michele Simionato `__。" #: ../../howto/mro.rst:0 msgid "Abstract" msgstr "概要" -#: ../../howto/mro.rst:17 msgid "" "*This document is intended for Python programmers who want to understand the " "C3 Method Resolution Order used in Python 2.3. Although it is not intended " @@ -49,24 +48,30 @@ msgid "" "not aware of other publicly available documents with the same scope, " "therefore it should be useful.*" msgstr "" +"*この文書は、Python 2.3 で使われる C3 メソッド解決順序を理解したい Python プ" +"ログラマ向けです。\n" +"初心者向けではありませんが、詳しく解説した例を多数交えて学べるようにしていま" +"す。\n" +"同じ範囲を扱う公開文書を他に知らないので、役に立つはずです。*" -#: ../../howto/mro.rst:23 msgid "Disclaimer:" -msgstr "" +msgstr "免責事項:" -#: ../../howto/mro.rst:25 msgid "" "*I donate this document to the Python Software Foundation, under the Python " "2.3 license. As usual in these circumstances, I warn the reader that what " "follows* should *be correct, but I don't give any warranty. Use it at your " "own risk and peril!*" msgstr "" +"*この文書を Python 2.3 ライセンスの下で Python Software Foundation に寄贈しま" +"す。\n" +"このような場合の通例どおり、以下の内容は正しい* はず *ですが、保証はしないこ" +"とをお断りします。\n" +"ご自身の責任でご利用ください。*" -#: ../../howto/mro.rst:30 msgid "Acknowledgments:" -msgstr "" +msgstr "謝辞:" -#: ../../howto/mro.rst:32 msgid "" "*All the people of the Python mailing list who sent me their support. Paul " "Foley who pointed out various imprecisions and made me to add the part on " @@ -75,16 +80,20 @@ msgid "" "Rossum who enthusiastically added this document to the official Python 2.3 " "home-page.*" msgstr "" +"*Python メーリングリストで応援してくださった皆さんに感謝します。\n" +"Paul Foley は不正確な点を指摘し、局所優先順位についての説明を追加するきっかけ" +"をくれました。\n" +"David Goodger は reStructuredText での整形を、David Mertz は編集を手伝ってく" +"れました。\n" +"最後に、Guido van Rossum はこの文書を熱心に公式の Python 2.3 ホームページに加" +"えてくれました。*" -#: ../../howto/mro.rst:40 msgid "The beginning" -msgstr "" +msgstr "はじめに" -#: ../../howto/mro.rst:42 msgid "*Felix qui potuit rerum cognoscere causas* -- Virgilius" -msgstr "" +msgstr "*物事の原因を知ることができた者は幸いである* ― ウェルギリウス" -#: ../../howto/mro.rst:44 msgid "" "Everything started with a post by Samuele Pedroni to the Python development " "mailing list [#]_. In his post, Samuele showed that the Python 2.2 method " @@ -96,8 +105,16 @@ msgid "" "readable discussion of the C3 algorithm for Pythonistas who want to " "understand the reasons for the change." msgstr "" +"すべては Samuele Pedroni による Python 開発メーリングリストへの投稿 [#]_ から" +"始まりました。\n" +"Samuele は Python 2.2 のメソッド解決順序が単調でないことを示し、C3 メソッド解" +"決順序への置き換えを提案しました。\n" +"Guido が賛成したため、Python 2.3 は C3 を使っています。\n" +"C3 自体は Python とは無関係で、Dylan の開発者によって考案され、Lisp 利用者向" +"けの論文 [#]_ に記述されています。\n" +"この文書では、変更の理由を知りたい Python 利用者に向けて、C3 アルゴリズムをで" +"きるだけ読みやすく説明します。" -#: ../../howto/mro.rst:55 msgid "" "First of all, let me point out that what I am going to say only applies to " "the *new style classes* introduced in Python 2.2: *classic classes* " @@ -108,12 +125,20 @@ msgid "" "differs from the Python 2.2 method resolution order are so rare that no real " "breaking of code is expected. Therefore:" msgstr "" +"まず、これからの説明は Python 2.2 で導入された *新スタイルクラス* だけに当て" +"はまります。\n" +"*旧スタイルクラス* は、深さ優先で左から右に調べる従来のメソッド解決順序を維持" +"します。\n" +"したがって、旧スタイルクラスを使う既存のコードは壊れません。\n" +"Python 2.2 の新スタイルクラスを使うコードは、理屈の上では壊れる可能性がありま" +"す。\n" +"しかし、C3 と Python 2.2 のメソッド解決順序が異なる場合は極めてまれなので、実" +"際にコードが壊れることはないと考えられます。\n" +"つまり:" -#: ../../howto/mro.rst:64 msgid "*Don't be scared!*" -msgstr "" +msgstr "*怖がらなくて大丈夫です!*" -#: ../../howto/mro.rst:66 msgid "" "Moreover, unless you make strong use of multiple inheritance and you have " "non-trivial hierarchies, you don't need to understand the C3 algorithm, and " @@ -121,33 +146,40 @@ msgid "" "know how multiple inheritance works, then this paper is for you. The good " "news is that things are not as complicated as you might expect." msgstr "" +"また、多重継承を多用して複雑な階層を作っているのでなければ、C3 アルゴリズムを" +"理解する必要はなく、この文書は読み飛ばして構いません。\n" +"一方、多重継承の仕組みを本当に知りたいなら、この文書はあなたのためのもので" +"す。\n" +"うれしいことに、予想するほど複雑ではありません。" -#: ../../howto/mro.rst:73 msgid "Let me begin with some basic definitions." -msgstr "" +msgstr "まず、基本的な定義から始めます。" -#: ../../howto/mro.rst:75 msgid "" "Given a class C in a complicated multiple inheritance hierarchy, it is a non-" "trivial task to specify the order in which methods are overridden, i.e. to " "specify the order of the ancestors of C." msgstr "" +"複雑な多重継承の階層にあるクラス C について、メソッドのオーバーライドの順序、" +"つまり C の祖先の順序を定めるのは簡単ではありません。" -#: ../../howto/mro.rst:79 msgid "" "The list of the ancestors of a class C, including the class itself, ordered " "from the nearest ancestor to the furthest, is called the class precedence " "list or the *linearization* of C." msgstr "" +"クラス C 自身を含む祖先を、近いものから遠いものへ並べたリストを、クラス優先順" +"位リスト、または C の *線形化* と呼びます。" -#: ../../howto/mro.rst:83 msgid "" "The *Method Resolution Order* (MRO) is the set of rules that construct the " "linearization. In the Python literature, the idiom \"the MRO of C\" is also " "used as a synonymous for the linearization of the class C." msgstr "" +"*メソッド解決順序* (MRO) は、線形化を構築する規則の集まりです。\n" +"Python の文献では「C の MRO」という表現を、クラス C の線形化と同じ意味でも使" +"います。" -#: ../../howto/mro.rst:88 msgid "" "For instance, in the case of single inheritance hierarchy, if C is a " "subclass of C1, and C1 is a subclass of C2, then the linearization of C is " @@ -156,8 +188,11 @@ msgid "" "it is more difficult to construct a linearization that respects *local " "precedence ordering* and *monotonicity*." msgstr "" +"例えば単一継承で、C が C1 のサブクラス、C1 が C2 のサブクラスであれば、C の線" +"形化は単に [C, C1, C2] です。\n" +"しかし多重継承では、*局所優先順位* と *単調性* を満たす線形化の構築が難しくな" +"ります。" -#: ../../howto/mro.rst:96 msgid "" "I will discuss the local precedence ordering later, but I can give the " "definition of monotonicity here. A MRO is monotonic when the following is " @@ -167,26 +202,36 @@ msgid "" "potentially introducing very subtle bugs. Examples where this happens will " "be shown later." msgstr "" +"局所優先順位は後で説明しますが、単調性はここで定義できます。\n" +"次が成り立つ MRO は単調です。\n" +"*C の線形化で C1 が C2 より前にあれば、C のどのサブクラスの線形化でも C1 が " +"C2 より前にある。*\n" +"そうでなければ、新しいクラスを派生させるだけでメソッドの解決順序が変わり、非" +"常に分かりにくいバグを持ち込む可能性があります。\n" +"後でその例を示します。" -#: ../../howto/mro.rst:104 msgid "" "Not all classes admit a linearization. There are cases, in complicated " "hierarchies, where it is not possible to derive a class such that its " "linearization respects all the desired properties." msgstr "" +"すべてのクラスに線形化が存在するわけではありません。\n" +"複雑な階層では、必要な性質をすべて満たす線形化を持つクラスを派生できない場合" +"があります。" -#: ../../howto/mro.rst:108 msgid "Here I give an example of this situation. Consider the hierarchy" msgstr "" +"その例を示します。\n" +"次の階層を考えてください:" -#: ../../howto/mro.rst:116 msgid "" "which can be represented with the following inheritance graph, where I have " "denoted with O the ``object`` class, which is the beginning of any hierarchy " "for new style classes:" msgstr "" +"この階層は次の継承図で表せます。\n" +"O は、新スタイルクラスの階層の起点である ``object`` クラスを表します:" -#: ../../howto/mro.rst:120 msgid "" " -----------\n" "| |\n" @@ -199,110 +244,112 @@ msgid "" " \\ /\n" " ?" msgstr "" +" -----------\n" +"| |\n" +"| O |\n" +"| / \\ |\n" +" - X Y /\n" +" | / | /\n" +" | / |/\n" +" A B\n" +" \\ /\n" +" ?" -#: ../../howto/mro.rst:133 msgid "" "In this case, it is not possible to derive a new class C from A and B, since " "X precedes Y in A, but Y precedes X in B, therefore the method resolution " "order would be ambiguous in C." msgstr "" +"この場合、A と B から新しいクラス C を派生させることはできません。\n" +"A では X が Y に先行するのに、B では Y が X に先行するため、C のメソッド解決" +"順序が曖昧になるからです。" -#: ../../howto/mro.rst:137 msgid "" "Python 2.3 raises an exception in this situation (TypeError: MRO conflict " "among bases Y, X) forbidding the naive programmer from creating ambiguous " "hierarchies. Python 2.2 instead does not raise an exception, but chooses an " "*ad hoc* ordering (CABXYO in this case)." msgstr "" +"Python 2.3 はこの場合に例外 (TypeError: MRO conflict among bases Y, X) を送出" +"し、プログラマがうっかり曖昧な階層を作るのを防ぎます。\n" +"対して Python 2.2 は例外を送出せず、その場限りの順序 (この場合は CABXYO) を選" +"びます。" -#: ../../howto/mro.rst:143 msgid "The C3 Method Resolution Order" -msgstr "" +msgstr "C3 メソッド解決順序" -#: ../../howto/mro.rst:145 msgid "" "Let me introduce a few simple notations which will be useful for the " "following discussion. I will use the shortcut notation::" msgstr "" +"以降の説明に使う簡単な記法を導入します。\n" +"次の省略記法で、 ::" -#: ../../howto/mro.rst:148 msgid "C1 C2 ... CN" -msgstr "" +msgstr "C1 C2 ... CN" -#: ../../howto/mro.rst:150 msgid "to indicate the list of classes [C1, C2, ... , CN]." -msgstr "" +msgstr "クラスのリスト [C1, C2, ... , CN] を表します。" -#: ../../howto/mro.rst:152 msgid "The *head* of the list is its first element::" -msgstr "" +msgstr "リストの *head* は最初の要素です。 ::" -#: ../../howto/mro.rst:154 msgid "head = C1" -msgstr "" +msgstr "head = C1" -#: ../../howto/mro.rst:156 msgid "whereas the *tail* is the rest of the list::" -msgstr "" +msgstr "一方、*tail* はリストの残りの部分です。 ::" -#: ../../howto/mro.rst:158 msgid "tail = C2 ... CN." -msgstr "" +msgstr "tail = C2 ... CN." -#: ../../howto/mro.rst:160 msgid "I shall also use the notation::" -msgstr "" +msgstr "また、次の記法で、 ::" -#: ../../howto/mro.rst:162 msgid "C + (C1 C2 ... CN) = C C1 C2 ... CN" -msgstr "" +msgstr "C + (C1 C2 ... CN) = C C1 C2 ... CN" -#: ../../howto/mro.rst:164 msgid "to denote the sum of the lists [C] + [C1, C2, ... ,CN]." -msgstr "" +msgstr "リストの連結 [C] + [C1, C2, ... , CN] を表します。" -#: ../../howto/mro.rst:166 msgid "Now I can explain how the MRO works in Python 2.3." -msgstr "" +msgstr "これで Python 2.3 の MRO の仕組みを説明する準備ができました。" -#: ../../howto/mro.rst:168 msgid "" "Consider a class C in a multiple inheritance hierarchy, with C inheriting " "from the base classes B1, B2, ... , BN. We want to compute the " "linearization L[C] of the class C. The rule is the following:" msgstr "" +"多重継承の階層で、基底クラス B1、B2、...、BN を継承するクラス C を考えま" +"す。\n" +"クラス C の線形化 L[C] を求める規則は次のとおりです:" -#: ../../howto/mro.rst:173 msgid "" "*the linearization of C is the sum of C plus the merge of the linearizations " "of the parents and the list of the parents.*" msgstr "" +"*C の線形化は、C に、各親クラスの線形化と親クラスのリストをマージしたものを連" +"結して求めます。*" -#: ../../howto/mro.rst:176 msgid "In symbolic notation::" -msgstr "" +msgstr "記号で表すと次のとおりです。 ::" -#: ../../howto/mro.rst:178 msgid "L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1 ... BN)" -msgstr "" +msgstr "L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1 ... BN)" -#: ../../howto/mro.rst:180 msgid "" "In particular, if C is the ``object`` class, which has no parents, the " "linearization is trivial::" -msgstr "" +msgstr "特に C が親を持たない ``object`` クラスなら、線形化は単純です。 ::" -#: ../../howto/mro.rst:183 msgid "L[object] = object." -msgstr "" +msgstr "L[object] = object." -#: ../../howto/mro.rst:185 msgid "" "However, in general one has to compute the merge according to the following " "prescription:" -msgstr "" +msgstr "ただし、一般の場合は次の手順でマージを計算する必要があります:" -#: ../../howto/mro.rst:188 msgid "" "*take the head of the first list, i.e L[B1][0]; if this head is not in the " "tail of any of the other lists, then add it to the linearization of C and " @@ -312,44 +359,53 @@ msgid "" "In this case, it is impossible to construct the merge, Python 2.3 will " "refuse to create the class C and will raise an exception.*" msgstr "" +"*最初のリストの先頭、つまり L[B1][0] を取り出します。\n" +"この要素が他のどのリストの tail にも含まれていなければ、C の線形化に追加し、" +"マージ対象の各リストから取り除きます。\n" +"そうでなければ次のリストの先頭を調べ、条件を満たすならそれを選びます。\n" +"すべてのクラスを取り除くか、条件を満たす先頭要素が見つからなくなるまで繰り返" +"します。\n" +"後者の場合はマージを構築できないため、Python 2.3 はクラス C の作成を拒否して" +"例外を送出します。*" -#: ../../howto/mro.rst:197 msgid "" "This prescription ensures that the merge operation *preserves* the ordering, " "if the ordering can be preserved. On the other hand, if the order cannot be " "preserved (as in the example of serious order disagreement discussed above) " "then the merge cannot be computed." msgstr "" +"この手順は、順序を維持できる場合にマージ処理がその順序を *維持する* ことを保" +"証します。\n" +"逆に、先ほどの順序が矛盾する例のように維持できない場合は、マージを計算できま" +"せん。" -#: ../../howto/mro.rst:202 msgid "" "The computation of the merge is trivial if C has only one parent (single " "inheritance); in this case::" -msgstr "" +msgstr "C の親が一つだけ (単一継承) なら、マージの計算は単純です。 ::" -#: ../../howto/mro.rst:205 msgid "L[C(B)] = C + merge(L[B],B) = C + L[B]" -msgstr "" +msgstr "L[C(B)] = C + merge(L[B],B) = C + L[B]" -#: ../../howto/mro.rst:207 msgid "" "However, in the case of multiple inheritance things are more cumbersome and " "I don't expect you can understand the rule without a couple of examples ;-)" msgstr "" +"多重継承ではもう少し複雑です。\n" +"例をいくつか見ないと、この規則は理解しにくいでしょう ;-)" #: ../../howto/mro.rst:212 msgid "Examples" msgstr "使用例" -#: ../../howto/mro.rst:214 msgid "First example. Consider the following hierarchy:" msgstr "" +"最初の例です。\n" +"次の階層を考えます:" -#: ../../howto/mro.rst:224 msgid "In this case the inheritance graph can be drawn as:" -msgstr "" +msgstr "この場合、継承図は次のように描けます:" -#: ../../howto/mro.rst:226 msgid "" " 6\n" " ---\n" @@ -373,28 +429,48 @@ msgid "" "Level 0 0 | A | (more specialized)\n" " ---" msgstr "" +" 6\n" +" ---\n" +"Level 3 | O | (more general)\n" +" / --- \\\n" +" / | \\ |\n" +" / | \\ |\n" +" / | \\ |\n" +" --- --- --- |\n" +"Level 2 3 | D | 4| E | | F | 5 |\n" +" --- --- --- |\n" +" \\ \\ _ / | |\n" +" \\ / \\ _ | |\n" +" \\ / \\ | |\n" +" --- --- |\n" +"Level 1 1 | B | | C | 2 |\n" +" --- --- |\n" +" \\ / |\n" +" \\ / \\ /\n" +" ---\n" +"Level 0 0 | A | (more specialized)\n" +" ---" -#: ../../howto/mro.rst:251 msgid "The linearizations of O,D,E and F are trivial::" -msgstr "" +msgstr "O、D、E、F の線形化は単純です。 ::" -#: ../../howto/mro.rst:253 msgid "" "L[O] = O\n" "L[D] = D O\n" "L[E] = E O\n" "L[F] = F O" msgstr "" +"L[O] = O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[F] = F O" -#: ../../howto/mro.rst:258 msgid "The linearization of B can be computed as::" -msgstr "" +msgstr "B の線形化は次のように計算できます。 ::" -#: ../../howto/mro.rst:260 msgid "L[B] = B + merge(DO, EO, DE)" -msgstr "" +msgstr "L[B] = B + merge(DO, EO, DE)" -#: ../../howto/mro.rst:262 msgid "" "We see that D is a good head, therefore we take it and we are reduced to " "compute ``merge(O,EO,E)``. Now O is not a good head, since it is in the " @@ -402,28 +478,32 @@ msgid "" "the next sequence. Then we see that E is a good head; we take it and we are " "reduced to compute ``merge(O,O)`` which gives O. Therefore::" msgstr "" +"D は先頭要素の条件を満たすので選び、残りは ``merge(O,EO,E)`` になります。\n" +"次の O は列 EO の tail に含まれるため、条件を満たしません。\n" +"この場合は次の列を調べます。\n" +"E は条件を満たすので選び、残りの ``merge(O,O)`` から O が得られます。\n" +"したがって次のようになります。 ::" -#: ../../howto/mro.rst:268 msgid "L[B] = B D E O" -msgstr "" +msgstr "L[B] = B D E O" -#: ../../howto/mro.rst:270 msgid "Using the same procedure one finds::" -msgstr "" +msgstr "同じ手順で次が求まります。 ::" -#: ../../howto/mro.rst:272 msgid "" "L[C] = C + merge(DO,FO,DF)\n" " = C + D + merge(O,FO,F)\n" " = C + D + F + merge(O,O)\n" " = C D F O" msgstr "" +"L[C] = C + merge(DO,FO,DF)\n" +" = C + D + merge(O,FO,F)\n" +" = C + D + F + merge(O,O)\n" +" = C D F O" -#: ../../howto/mro.rst:277 msgid "Now we can compute::" -msgstr "" +msgstr "これで次を計算できます。 ::" -#: ../../howto/mro.rst:279 msgid "" "L[A] = A + merge(BDEO,CDFO,BC)\n" " = A + B + merge(DEO,CDFO,C)\n" @@ -433,29 +513,37 @@ msgid "" " = A + B + C + D + E + F + merge(O,O)\n" " = A B C D E F O" msgstr "" +"L[A] = A + merge(BDEO,CDFO,BC)\n" +" = A + B + merge(DEO,CDFO,C)\n" +" = A + B + C + merge(DEO,DFO)\n" +" = A + B + C + D + merge(EO,FO)\n" +" = A + B + C + D + E + merge(O,FO)\n" +" = A + B + C + D + E + F + merge(O,O)\n" +" = A B C D E F O" -#: ../../howto/mro.rst:287 msgid "" "In this example, the linearization is ordered in a pretty nice way according " "to the inheritance level, in the sense that lower levels (i.e. more " "specialized classes) have higher precedence (see the inheritance graph). " "However, this is not the general case." msgstr "" +"この例の線形化は、継承の階層にきれいに沿っています。\n" +"低い階層、つまり特化したクラスほど優先されるという意味です (継承図を参照)。\n" +"ただし、常にそうなるわけではありません。" -#: ../../howto/mro.rst:292 msgid "" "I leave as an exercise for the reader to compute the linearization for my " "second example:" -msgstr "" +msgstr "二つ目の例の線形化は、読者の練習問題とします:" -#: ../../howto/mro.rst:303 msgid "" "The only difference with the previous example is the change B(D,E) --> B(E," "D); however even such a little modification completely changes the ordering " "of the hierarchy:" msgstr "" +"前の例との違いは B(D,E) を B(E,D) に変えただけです。\n" +"しかし、この小さな変更でも階層の順序は大きく変わります:" -#: ../../howto/mro.rst:307 msgid "" " 6\n" " ---\n" @@ -479,27 +567,53 @@ msgid "" "Level 0 0 | A |\n" " ---" msgstr "" +" 6\n" +" ---\n" +"Level 3 | O |\n" +" / --- \\\n" +" / | \\\n" +" / | \\\n" +" / | \\\n" +" --- --- ---\n" +"Level 2 2 | E | 4 | D | | F | 5\n" +" --- --- ---\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" --- ---\n" +"Level 1 1 | B | | C | 3\n" +" --- ---\n" +" \\ /\n" +" \\ /\n" +" ---\n" +"Level 0 0 | A |\n" +" ---" -#: ../../howto/mro.rst:332 msgid "" "Notice that the class E, which is in the second level of the hierarchy, " "precedes the class C, which is in the first level of the hierarchy, i.e. E " "is more specialized than C, even if it is in a higher level." msgstr "" +"階層のレベル 2 にある E が、レベル 1 にある C より先行することに注目してくだ" +"さい。\n" +"つまり、E は高い階層にあるのに、C より特化したものとして扱われます。" -#: ../../howto/mro.rst:336 msgid "" "A lazy programmer can obtain the MRO directly from Python 2.2, since in this " "case it coincides with the Python 2.3 linearization. It is enough to invoke " "the :meth:`~type.mro` method of class A:" msgstr "" +"計算を省きたいプログラマは、Python 2.2 で MRO を直接取得できます。\n" +"この場合は Python 2.3 の線形化と一致するためです。\n" +"クラス A の :meth:`~type.mro` メソッドを呼び出すだけです:" -#: ../../howto/mro.rst:345 msgid "" "Finally, let me consider the example discussed in the first section, " "involving a serious order disagreement. In this case, it is straightforward " "to compute the linearizations of O, X, Y, A and B:" msgstr "" +"最後に、最初の節で扱った、順序に重大な矛盾がある例を考えます。\n" +"O、X、Y、A、B の線形化は簡単に計算できます:" #: ../../howto/mro.rst:349 msgid "" @@ -510,50 +624,56 @@ msgid "" "L[B] = B Y X O" msgstr "" -#: ../../howto/mro.rst:357 msgid "" "However, it is impossible to compute the linearization for a class C that " "inherits from A and B::" -msgstr "" +msgstr "しかし A と B を継承するクラス C の線形化は計算できません。 ::" -#: ../../howto/mro.rst:360 msgid "" "L[C] = C + merge(AXYO, BYXO, AB)\n" " = C + A + merge(XYO, BYXO, B)\n" " = C + A + B + merge(XYO, YXO)" msgstr "" +"L[C] = C + merge(AXYO, BYXO, AB)\n" +" = C + A + merge(XYO, BYXO, B)\n" +" = C + A + B + merge(XYO, YXO)" -#: ../../howto/mro.rst:364 msgid "" "At this point we cannot merge the lists XYO and YXO, since X is in the tail " "of YXO whereas Y is in the tail of XYO: therefore there are no good heads " "and the C3 algorithm stops. Python 2.3 raises an error and refuses to " "create the class C." msgstr "" +"この段階で XYO と YXO をマージすることはできません。\n" +"X は YXO の tail にあり、Y は XYO の tail にあるため、条件を満たす先頭要素が" +"ないからです。\n" +"C3 アルゴリズムはここで停止し、Python 2.3 はエラーを送出してクラス C の作成を" +"拒否します。" -#: ../../howto/mro.rst:370 msgid "Bad Method Resolution Orders" -msgstr "" +msgstr "問題のあるメソッド解決順序" -#: ../../howto/mro.rst:372 msgid "" "A MRO is *bad* when it breaks such fundamental properties as local " "precedence ordering and monotonicity. In this section, I will show that " "both the MRO for classic classes and the MRO for new style classes in Python " "2.2 are bad." msgstr "" +"局所優先順位や単調性といった基本的な性質を満たさない MRO は、*問題がある* と" +"いえます。\n" +"この節では、旧スタイルクラスの MRO と Python 2.2 の新スタイルクラスの MRO " +"が、どちらも問題を持つことを示します。" -#: ../../howto/mro.rst:377 msgid "" "It is easier to start with the local precedence ordering. Consider the " "following example:" msgstr "" +"まずは簡単な局所優先順位から始めます。\n" +"次の例を考えてください:" -#: ../../howto/mro.rst:384 msgid "with inheritance diagram" -msgstr "" +msgstr "継承図は次のとおりです:" -#: ../../howto/mro.rst:386 msgid "" " O\n" " |\n" @@ -565,26 +685,38 @@ msgid "" "\n" " (buy eggs or spam ?)" msgstr "" +" O\n" +" |\n" +"(buy spam) F\n" +" | \\\n" +" | E (buy eggs)\n" +" | /\n" +" G\n" +"\n" +" (buy eggs or spam ?)" -#: ../../howto/mro.rst:399 msgid "" "We see that class G inherits from F and E, with F *before* E: therefore we " "would expect the attribute *G.remember2buy* to be inherited by *F." "remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" msgstr "" +"G は F、E の順に継承し、F が E より *前* にあります。\n" +"したがって *G.remember2buy* は *E.remember2buy* ではなく *F.remember2buy* を" +"継承すると期待するでしょう。\n" +"しかし Python 2.2 の結果は次のとおりです:" -#: ../../howto/mro.rst:407 msgid "" "This is a breaking of local precedence ordering since the order in the local " "precedence list, i.e. the list of the parents of G, is not preserved in the " "Python 2.2 linearization of G::" msgstr "" +"これは局所優先順位に反しています。\n" +"局所優先順位リスト、つまり G の親のリストの順序が、Python 2.2 による G の線形" +"化では維持されていません。 ::" -#: ../../howto/mro.rst:411 msgid "L[G,P22]= G E F object # F *follows* E" -msgstr "" +msgstr "L[G,P22]= G E F object # F *follows* E" -#: ../../howto/mro.rst:413 msgid "" "One could argue that the reason why F follows E in the Python 2.2 " "linearization is that F is less specialized than E, since F is the " @@ -592,13 +724,15 @@ msgid "" "quite non-intuitive and error prone. This is particularly true since it is " "a different from old style classes:" msgstr "" +"Python 2.2 の線形化で F が E の後になるのは、F が E のスーパークラスで、E よ" +"り特化していないからだという説明はできるでしょう。\n" +"それでも局所優先順位が崩れるのは直感に反し、間違いを招きやすくなります。\n" +"旧スタイルクラスとは動作が異なるため、なおさらです:" -#: ../../howto/mro.rst:425 msgid "" "In this case the MRO is GFEF and the local precedence ordering is preserved." -msgstr "" +msgstr "この場合の MRO は GFEF で、局所優先順位は維持されます。" -#: ../../howto/mro.rst:428 msgid "" "As a general rule, hierarchies such as the previous one should be avoided, " "since it is unclear if F should override E or vice-versa. Python 2.3 solves " @@ -606,16 +740,19 @@ msgid "" "effectively stopping the programmer from generating ambiguous hierarchies. " "The reason for that is that the C3 algorithm fails when the merge::" msgstr "" +"一般に、前のような階層は避けるべきです。\n" +"F が E をオーバーライドすべきか、その逆なのかが不明確だからです。\n" +"Python 2.3 はクラス G の作成時に例外を送出することで、この曖昧さを解消し、曖" +"昧な階層の生成を防ぎます。\n" +"C3 アルゴリズムが失敗するのは、次のマージを計算できないためです。 ::" -#: ../../howto/mro.rst:435 msgid "merge(FO,EFO,FE)" -msgstr "" +msgstr "merge(FO,EFO,FE)" -#: ../../howto/mro.rst:437 msgid "" "cannot be computed, because F is in the tail of EFO and E is in the tail of " "FE." -msgstr "" +msgstr "F は EFO の tail にあり、E は FE の tail にあるので、計算できません。" #: ../../howto/mro.rst:440 msgid "" @@ -624,7 +761,6 @@ msgid "" "the MRO is GEF without any doubt." msgstr "" -#: ../../howto/mro.rst:444 msgid "" " O\n" " |\n" @@ -635,57 +771,67 @@ msgid "" " G\n" " (eggs, no doubt)" msgstr "" +" O\n" +" |\n" +" F (spam)\n" +" / |\n" +"(eggs) E |\n" +" \\ |\n" +" G\n" +" (eggs, no doubt)" -#: ../../howto/mro.rst:456 msgid "" "Python 2.3 forces the programmer to write good hierarchies (or, at least, " "less error-prone ones)." msgstr "" +"Python 2.3 は、プログラマがよい階層、少なくとも間違いを招きにくい階層を書くよ" +"うに促します。" -#: ../../howto/mro.rst:459 msgid "" "On a related note, let me point out that the Python 2.3 algorithm is smart " "enough to recognize obvious mistakes, as the duplication of classes in the " "list of parents:" msgstr "" +"関連する点として、Python 2.3 のアルゴリズムは、親のリストに同じクラスを重複し" +"て指定するような明らかな間違いも検出します:" -#: ../../howto/mro.rst:469 msgid "" "Python 2.2 (both for classic classes and new style classes) in this " "situation, would not raise any exception." msgstr "" +"Python 2.2 では、旧スタイルクラスでも新スタイルクラスでも、この場合に例外は送" +"出されません。" -#: ../../howto/mro.rst:472 msgid "" "Finally, I would like to point out two lessons we have learned from this " "example:" -msgstr "" +msgstr "最後に、この例から分かる二つの点を挙げます:" -#: ../../howto/mro.rst:475 msgid "" "despite the name, the MRO determines the resolution order of attributes, not " "only of methods;" -msgstr "" +msgstr "名前とは裏腹に、MRO はメソッドだけでなく属性の解決順序も決めます。" -#: ../../howto/mro.rst:478 msgid "" "the default food for Pythonistas is spam ! (but you already knew that ;-)" -msgstr "" +msgstr "Python 利用者の定番の食べ物はスパムです! (これはご存じでしたね ;-)" -#: ../../howto/mro.rst:481 msgid "" "Having discussed the issue of local precedence ordering, let me now consider " "the issue of monotonicity. My goal is to show that neither the MRO for " "classic classes nor that for Python 2.2 new style classes is monotonic." msgstr "" +"局所優先順位に続いて、単調性を考えましょう。\n" +"旧スタイルクラスの MRO も Python 2.2 の新スタイルクラスの MRO も単調でないこ" +"とを示します。" -#: ../../howto/mro.rst:486 msgid "" "To prove that the MRO for classic classes is non-monotonic is rather " "trivial, it is enough to look at the diamond diagram:" msgstr "" +"旧スタイルクラスの MRO が単調でないことは、次のダイヤモンド型の継承図を見れば" +"簡単に分かります:" -#: ../../howto/mro.rst:489 msgid "" " C\n" " / \\\n" @@ -695,50 +841,63 @@ msgid "" " \\ /\n" " D" msgstr "" +" C\n" +" / \\\n" +" / \\\n" +"A B\n" +" \\ /\n" +" \\ /\n" +" D" -#: ../../howto/mro.rst:500 msgid "One easily discerns the inconsistency::" -msgstr "" +msgstr "不整合はすぐに見つかります。 ::" -#: ../../howto/mro.rst:502 msgid "" "L[B,P21] = B C # B precedes C : B's methods win\n" "L[D,P21] = D A C B C # B follows C : C's methods win!" msgstr "" +"L[B,P21] = B C # B precedes C : B's methods win\n" +"L[D,P21] = D A C B C # B follows C : C's methods win!" -#: ../../howto/mro.rst:505 msgid "" "On the other hand, there are no problems with the Python 2.2 and 2.3 MROs, " "they give both::" msgstr "" +"一方、Python 2.2 と 2.3 の MRO にはこの問題はなく、どちらも次の結果になりま" +"す。 ::" -#: ../../howto/mro.rst:508 msgid "L[D] = D A B C" -msgstr "" +msgstr "L[D] = D A B C" -#: ../../howto/mro.rst:510 msgid "" "Guido points out in his essay [#]_ that the classic MRO is not so bad in " "practice, since one can typically avoids diamonds for classic classes. But " "all new style classes inherit from ``object``, therefore diamonds are " "unavoidable and inconsistencies shows up in every multiple inheritance graph." msgstr "" +"Guido は論考 [#]_ で、旧スタイルクラスでは通常ダイヤモンド型の継承を避けられ" +"るため、その MRO は実際にはそれほど悪くないと指摘しています。\n" +"しかし、新スタイルクラスはすべて ``object`` を継承するため、ダイヤモンドを避" +"けられず、どの多重継承の図にも不整合が現れます。" -#: ../../howto/mro.rst:516 msgid "" "The MRO of Python 2.2 makes breaking monotonicity difficult, but not " "impossible. The following example, originally provided by Samuele Pedroni, " "shows that the MRO of Python 2.2 is non-monotonic:" msgstr "" +"Python 2.2 の MRO は単調性を破りにくくしていますが、不可能にしたわけではあり" +"ません。\n" +"Samuele Pedroni が最初に示した次の例は、Python 2.2 の MRO が単調でないことを" +"示します:" -#: ../../howto/mro.rst:530 msgid "" "Here are the linearizations according to the C3 MRO (the reader should " "verify these linearizations as an exercise and draw the inheritance " "diagram ;-) ::" msgstr "" +"C3 MRO による線形化は次のとおりです。\n" +"練習として結果を確かめ、継承図を描いてみてください ;-) ::" -#: ../../howto/mro.rst:534 msgid "" "L[A] = A O\n" "L[B] = B O\n" @@ -750,18 +909,26 @@ msgid "" "L[K3]= K3 D A O\n" "L[Z] = Z K1 K2 K3 D A B C E O" msgstr "" +"L[A] = A O\n" +"L[B] = B O\n" +"L[C] = C O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[K1]= K1 A B C O\n" +"L[K2]= K2 D B E O\n" +"L[K3]= K3 D A O\n" +"L[Z] = Z K1 K2 K3 D A B C E O" -#: ../../howto/mro.rst:544 msgid "" "Python 2.2 gives exactly the same linearizations for A, B, C, D, E, K1, K2 " "and K3, but a different linearization for Z::" msgstr "" +"Python 2.2 は A、B、C、D、E、K1、K2、K3 について同じ線形化を返しますが、Z だ" +"けは異なります。 ::" -#: ../../howto/mro.rst:547 msgid "L[Z,P22] = Z K1 K3 A K2 D B C E O" -msgstr "" +msgstr "L[Z,P22] = Z K1 K3 A K2 D B C E O" -#: ../../howto/mro.rst:549 msgid "" "It is clear that this linearization is *wrong*, since A comes before D " "whereas in the linearization of K3 A comes *after* D. In other words, in K3 " @@ -773,12 +940,20 @@ msgid "" "the linearization of Z K2 *follows* K3. These problems explain why the 2.2 " "rule has been dismissed in favor of the C3 rule." msgstr "" +"この線形化は明らかに *間違っています*。\n" +"K3 の線形化では A が D の *後* にあるのに、ここでは A が D より前だからで" +"す。\n" +"つまり K3 では D から継承したメソッドが A のものをオーバーライドするのに、K3 " +"のサブクラスである Z では A のメソッドが D のものをオーバーライドします。\n" +"これは単調性への違反です。\n" +"さらに Python 2.2 による Z の線形化は、局所優先順位にも反します。\n" +"Z の局所優先順位リストは [K1, K2, K3] で K2 が K3 より前なのに、線形化では " +"K2 が K3 の *後* にあるからです。\n" +"こうした問題のため、2.2 の規則は C3 に置き換えられました。" -#: ../../howto/mro.rst:561 msgid "The end" -msgstr "" +msgstr "おわりに" -#: ../../howto/mro.rst:563 msgid "" "This section is for the impatient reader, who skipped all the previous " "sections and jumped immediately to the end. This section is for the lazy " @@ -791,8 +966,18 @@ msgid "" "the last line to play with the various examples I have discussed in this " "paper.::" msgstr "" +"この節は、前の節をすべて飛ばしてすぐ最後に来た、せっかちな読者のためのもので" +"す。\n" +"また、頭を働かせたくなかった怠け者のプログラマのためでもあります。\n" +"そして多少の傲慢さを持つプログラマのためでもあります。\n" +"そうでなければ、多重継承の階層における C3 メソッド解決順序の文書など読まない" +"でしょう ;-)\n" +"この三つの美徳をすべて兼ね備えていれば (別々では *だめです*)、ご褒美に値しま" +"す。\n" +"ご褒美は、頭を悩ませずに 2.3 の MRO を計算できる、短い Python 2.2 スクリプト" +"です。\n" +"最後の行を変えるだけで、この文書のさまざまな例を試せます。 ::" -#: ../../howto/mro.rst:574 msgid "" "#\n" "\n" @@ -877,34 +1062,116 @@ msgid "" "\n" "#" msgstr "" +"#\n" +"\n" +"\"\"\"Samuele Pedroni による C3 アルゴリズム (筆者が読みやすく変更)。\"\"\"\n" +"\n" +"class __metaclass__(type):\n" +" \"All classes are metamagically modified to be nicely printed\"\n" +" __repr__ = lambda cls: cls.__name__\n" +"\n" +"class ex_2:\n" +" \"Serious order disagreement\" #From Guido\n" +" class O: pass\n" +" class X(O): pass\n" +" class Y(O): pass\n" +" class A(X,Y): pass\n" +" class B(Y,X): pass\n" +" try:\n" +" class Z(A,B): pass #creates Z(A,B) in Python 2.2\n" +" except TypeError:\n" +" pass # Z(A,B) cannot be created in Python 2.3\n" +"\n" +"class ex_5:\n" +" \"My first example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(D,E): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_6:\n" +" \"My second example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(E,D): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_9:\n" +" \"Difference between Python 2.2 MRO and C3\" #From Samuele\n" +" class O: pass\n" +" class A(O): pass\n" +" class B(O): pass\n" +" class C(O): pass\n" +" class D(O): pass\n" +" class E(O): pass\n" +" class K1(A,B,C): pass\n" +" class K2(D,B,E): pass\n" +" class K3(D,A): pass\n" +" class Z(K1,K2,K3): pass\n" +"\n" +"def merge(seqs):\n" +" print '\\n\\nCPL[%s]=%s' % (seqs[0][0],seqs),\n" +" res = []; i=0\n" +" while 1:\n" +" nonemptyseqs=[seq for seq in seqs if seq]\n" +" if not nonemptyseqs: return res\n" +" i+=1; print '\\n',i,'round: candidates...',\n" +" for seq in nonemptyseqs: # find merge candidates among seq heads\n" +" cand = seq[0]; print ' ',cand,\n" +" nothead=[s for s in nonemptyseqs if cand in s[1:]]\n" +" if nothead: cand=None #reject candidate\n" +" else: break\n" +" if not cand: raise \"Inconsistent hierarchy\"\n" +" res.append(cand)\n" +" for seq in nonemptyseqs: # remove cand\n" +" if seq[0] == cand: del seq[0]\n" +"\n" +"def mro(C):\n" +" \"Compute the class precedence list (mro) according to C3\"\n" +" return merge([[C]]+map(mro,C.__bases__)+[list(C.__bases__)])\n" +"\n" +"def print_mro(C):\n" +" print '\\nMRO[%s]=%s' % (C,mro(C))\n" +" print '\\nP22 MRO[%s]=%s' % (C,C.mro())\n" +"\n" +"print_mro(ex_9.Z)\n" +"\n" +"#" -#: ../../howto/mro.rst:656 msgid "That's all folks," -msgstr "" +msgstr "これでおしまいです。" -#: ../../howto/mro.rst:658 msgid "enjoy !" -msgstr "" +msgstr "楽しんでください!" -#: ../../howto/mro.rst:662 msgid "Resources" -msgstr "" +msgstr "参考資料" -#: ../../howto/mro.rst:664 msgid "" "The thread on python-dev started by Samuele Pedroni: https://mail.python.org/" "pipermail/python-dev/2002-October/029035.html" msgstr "" +"Samuele Pedroni が始めた python-dev のスレッド: https://mail.python.org/" +"pipermail/python-dev/2002-October/029035.html" -#: ../../howto/mro.rst:667 msgid "" "The paper *A Monotonic Superclass Linearization for Dylan*: https://doi." "org/10.1145/236337.236343" msgstr "" +"論文 *A Monotonic Superclass Linearization for Dylan*: https://doi." +"org/10.1145/236337.236343" -#: ../../howto/mro.rst:670 msgid "" "Guido van Rossum's essay, *Unifying types and classes in Python 2.2*: " "https://web.archive.org/web/20140210194412/http://www.python.org/download/" "releases/2.2.2/descrintro" msgstr "" +"Guido van Rossum の論考 *Unifying types and classes in Python 2.2*: https://" +"web.archive.org/web/20140210194412/http://www.python.org/download/" +"releases/2.2.2/descrintro" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index 9f0b5af27..e66eec66b 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -18,11 +18,9 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/perf_profiling.rst:7 msgid "Python support for the ``perf map`` compatible profilers" -msgstr "" +msgstr "``perf map`` 対応プロファイラのための Python のサポート" -#: ../../howto/perf_profiling.rst:9 msgid "" "`The Linux perf profiler `_ and `samply " "`_ are powerful tools that allow you to " @@ -30,8 +28,11 @@ msgid "" "Both tools have vibrant ecosystems that aid with the analysis of the data " "they produce." msgstr "" +"`Linux の perf プロファイラ `_ と `samply " +"`_ は、アプリケーションをプロファイリング" +"して性能の情報を得るための強力なツールです。\n" +"どちらも、生成したデータの分析を助けるツール群が活発に開発されています。" -#: ../../howto/perf_profiling.rst:14 msgid "" "The main problem with using these profilers with Python applications is that " "they only get information about native symbols, that is, the names of " @@ -39,8 +40,10 @@ msgid "" "names of Python functions in your code will not appear in the profiler " "output." msgstr "" +"これらを Python アプリケーションに使う際の主な問題は、C で書かれた関数や手続" +"きの名前、つまりネイティブシンボルの情報しか取得できないことです。\n" +"そのため、Python コードの関数名やファイル名がプロファイラの出力に現れません。" -#: ../../howto/perf_profiling.rst:19 msgid "" "Since Python 3.12, the interpreter can run in a special mode that allows " "Python functions to appear in the output of compatible profilers. When this " @@ -49,8 +52,13 @@ msgid "" "will teach the profiler the relationship between this piece of code and the " "associated Python function using :doc:`perf map files <../c-api/perfmaps>`." msgstr "" +"Python 3.12 以降では、対応するプロファイラの出力に Python 関数を表示するため" +"の特別なモードでインタープリタを実行できます。\n" +"このモードでは、各 Python 関数の実行前に、その場でコンパイルした小さなコード" +"片を挿入します。\n" +"そして :doc:`perf map ファイル <../c-api/perfmaps>` を使い、そのコード片と " +"Python 関数の対応をプロファイラに伝えます。" -#: ../../howto/perf_profiling.rst:28 msgid "" "Support for profiling is available on Linux and macOS on select " "architectures. Perf is available on Linux, while samply can be used on both " @@ -59,12 +67,17 @@ msgid "" "of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to see if your system " "is supported." msgstr "" +"このプロファイリング機能は、Linux と macOS の一部のアーキテクチャで利用できま" +"す。\n" +"perf は Linux で、samply は Linux と macOS の両方で使えます。\n" +"macOS での samply 対応は Python 3.15 からです。\n" +"お使いのシステムが対応しているかは、ビルド時の ``configure`` の出力、または " +"``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` の出力で確認してくださ" +"い。" -#: ../../howto/perf_profiling.rst:35 msgid "For example, consider the following script:" -msgstr "" +msgstr "例えば、次のスクリプトを考えます:" -#: ../../howto/perf_profiling.rst:37 msgid "" "def foo(n):\n" " result = 0\n" @@ -81,20 +94,32 @@ msgid "" "if __name__ == \"__main__\":\n" " baz(1000000)" msgstr "" +"def foo(n):\n" +" result = 0\n" +" for _ in range(n):\n" +" result += 1\n" +" return result\n" +"\n" +"def bar(n):\n" +" foo(n)\n" +"\n" +"def baz(n):\n" +" bar(n)\n" +"\n" +"if __name__ == \"__main__\":\n" +" baz(1000000)" -#: ../../howto/perf_profiling.rst:54 msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::" msgstr "" +"``perf`` を実行して、CPU のスタックトレースを 9999 Hz でサンプリングできま" +"す。 ::" -#: ../../howto/perf_profiling.rst:56 msgid "$ perf record -F 9999 -g -o perf.data python my_script.py" -msgstr "" +msgstr "$ perf record -F 9999 -g -o perf.data python my_script.py" -#: ../../howto/perf_profiling.rst:58 msgid "Then we can use ``perf report`` to analyze the data:" -msgstr "" +msgstr "続いて ``perf report`` でデータを分析します:" -#: ../../howto/perf_profiling.rst:60 msgid "" "$ perf report --stdio -n -g\n" "\n" @@ -149,8 +174,59 @@ msgid "" "| | |--2.97%--_PyObject_Malloc\n" "..." msgstr "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. ..........................................\n" +"#\n" +" 91.08% 0.00% 0 python.exe python.exe [.] " +"_start\n" +" |\n" +" ---_start\n" +" |\n" +" --90.71%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--56.88%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--56.13%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--55.02%--run_mod\n" +" | | | |\n" +" | | | --54.65%--" +"PyEval_EvalCode\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | |\n" +" | | | " +"|--51.67%--_PyEval_EvalFrameDefault\n" +" | | | " +"| |\n" +" | | | " +"| |--11.52%--_PyCompactLong_Add\n" +" | | | " +"| | |\n" +" | | | " +"| | |--2.97%--_PyObject_Malloc\n" +"..." -#: ../../howto/perf_profiling.rst:99 msgid "" "As you can see, the Python functions are not shown in the output, only " "``_PyEval_EvalFrameDefault`` (the function that evaluates the Python " @@ -158,13 +234,16 @@ msgid "" "functions use the same C function to evaluate bytecode so we cannot know " "which Python function corresponds to which bytecode-evaluating function." msgstr "" +"このように、Python 関数は出力に現れず、Python バイトコードを評価する関数 " +"``_PyEval_EvalFrameDefault`` だけが表示されます。\n" +"すべての Python 関数が同じ C 関数でバイトコードを評価するため、これだけではど" +"の Python 関数に対応する評価処理か分からず、あまり役に立ちません。" -#: ../../howto/perf_profiling.rst:104 msgid "" "Instead, if we run the same experiment with ``perf`` support enabled we get:" msgstr "" +"一方、``perf`` サポートを有効にして同じ実験を行うと、次のようになります:" -#: ../../howto/perf_profiling.rst:106 msgid "" "$ perf report --stdio -n -g\n" "\n" @@ -226,38 +305,100 @@ msgid "" " | | | " "| | |--3.26%--_PyObject_Malloc" msgstr "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. .....................................................................\n" +"#\n" +" 90.58% 0.36% 1 python.exe python.exe [.] " +"_start\n" +" |\n" +" ---_start\n" +" |\n" +" --89.86%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--55.43%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--54.71%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--53.62%--run_mod\n" +" | | | |\n" +" | | | --53.26%--" +"PyEval_EvalCode\n" +" | | | py::" +":/src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::baz:/" +"src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::bar:/" +"src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::foo:/" +"src/script.py\n" +" | | | |\n" +" | | | " +"|--51.81%--_PyEval_EvalFrameDefault\n" +" | | | " +"| |\n" +" | | | " +"| |--13.77%--_PyCompactLong_Add\n" +" | | | " +"| | |\n" +" | | | " +"| | |--3.26%--_PyObject_Malloc" -#: ../../howto/perf_profiling.rst:151 msgid "Using the samply profiler" -msgstr "" +msgstr "samply プロファイラの利用" -#: ../../howto/perf_profiling.rst:153 msgid "" "samply is a modern profiler that can be used as an alternative to perf. It " "uses the same perf map files that Python generates, making it compatible " "with Python's profiling support. samply is particularly useful on macOS " "where perf is not available." msgstr "" +"samply は perf の代わりに使えるモダンなプロファイラです。\n" +"Python が生成する perf map ファイルを使うため、Python のプロファイリング機能" +"に対応しています。\n" +"perf が使えない macOS では特に便利です。" -#: ../../howto/perf_profiling.rst:158 msgid "" "To use samply with Python, first install it following the instructions at " "https://github.com/mstange/samply, then run::" msgstr "" +"Python で samply を使うには、まず https://github.com/mstange/samply の手順で" +"インストールし、次を実行します。 ::" -#: ../../howto/perf_profiling.rst:161 msgid "$ samply record PYTHONPERFSUPPORT=1 python my_script.py" -msgstr "" +msgstr "$ samply record PYTHONPERFSUPPORT=1 python my_script.py" -#: ../../howto/perf_profiling.rst:163 msgid "" "This will open a web interface where you can analyze the profiling data " "interactively. The advantage of samply is that it provides a modern web-" "based interface for analyzing profiling data and works on both Linux and " "macOS." msgstr "" +"Web インターフェースが開き、プロファイリングデータを対話的に分析できます。\n" +"samply の利点は、分析用のモダンな Web インターフェースを備え、Linux と macOS " +"の両方で動作することです。" -#: ../../howto/perf_profiling.rst:168 msgid "" "On macOS, samply support requires Python 3.15 or later. Also on macOS, " "samply can't profile signed Python executables due to restrictions by macOS. " @@ -266,51 +407,60 @@ msgid "" "order to attach to running processes on macOS, run ``samply setup`` once " "(and every time samply is updated) to self-sign the samply binary." msgstr "" +"macOS で samply を使うには Python 3.15 以降が必要です。\n" +"また、macOS の制限により、署名された Python 実行ファイルはプロファイリングで" +"きません。\n" +"自分でコンパイルしたものや、未署名またはローカル署名されたもの (Homebrew でイ" +"ンストールしたものなど) を使ってください。\n" +"macOS で実行中のプロセスにアタッチするには、最初に一度、また samply を更新す" +"るたびに ``samply setup`` を実行し、samply バイナリを自己署名してください。" -#: ../../howto/perf_profiling.rst:176 msgid "How to enable ``perf`` profiling support" -msgstr "" +msgstr "``perf`` プロファイリングサポートを有効にする方法" -#: ../../howto/perf_profiling.rst:178 msgid "" "``perf`` profiling support can be enabled either from the start using the " "environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-" "X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :" "func:`sys.deactivate_stack_trampoline`." msgstr "" +"``perf`` プロファイリングサポートは、環境変数 :envvar:`PYTHONPERFSUPPORT` ま" +"たは :option:`-X perf <-X>` オプションで起動時から有効にできます。\n" +":func:`sys.activate_stack_trampoline` と :func:`sys." +"deactivate_stack_trampoline` で動的に切り替えることもできます。" -#: ../../howto/perf_profiling.rst:184 msgid "" "The :mod:`!sys` functions take precedence over the :option:`!-X` option, " "the :option:`!-X` option takes precedence over the environment variable." msgstr "" +":mod:`!sys` の関数は :option:`!-X` オプションより優先され、:option:`!-X` オプ" +"ションは環境変数より優先されます。" -#: ../../howto/perf_profiling.rst:187 msgid "Example, using the environment variable::" -msgstr "" +msgstr "環境変数を使う例です。 ::" -#: ../../howto/perf_profiling.rst:189 msgid "" "$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script." "py\n" "$ perf report -g -i perf.data" msgstr "" +"$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script." +"py\n" +"$ perf report -g -i perf.data" -#: ../../howto/perf_profiling.rst:192 msgid "Example, using the :option:`!-X` option::" -msgstr "" +msgstr ":option:`!-X` オプションを使う例です。 ::" -#: ../../howto/perf_profiling.rst:194 msgid "" "$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n" "$ perf report -g -i perf.data" msgstr "" +"$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n" +"$ perf report -g -i perf.data" -#: ../../howto/perf_profiling.rst:197 msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" -msgstr "" +msgstr ":file:`example.py` で :mod:`sys` API を使う例です:" -#: ../../howto/perf_profiling.rst:199 msgid "" "import sys\n" "\n" @@ -320,22 +470,27 @@ msgid "" "\n" "non_profiled_stuff()" msgstr "" +"import sys\n" +"\n" +"sys.activate_stack_trampoline(\"perf\")\n" +"do_profiled_stuff()\n" +"sys.deactivate_stack_trampoline()\n" +"\n" +"non_profiled_stuff()" -#: ../../howto/perf_profiling.rst:209 msgid "...then::" -msgstr "" +msgstr "続いて次を実行します。 ::" -#: ../../howto/perf_profiling.rst:211 msgid "" "$ perf record -F 9999 -g -o perf.data python ./example.py\n" "$ perf report -g -i perf.data" msgstr "" +"$ perf record -F 9999 -g -o perf.data python ./example.py\n" +"$ perf report -g -i perf.data" -#: ../../howto/perf_profiling.rst:216 msgid "How to obtain the best results" -msgstr "" +msgstr "最良の結果を得る方法" -#: ../../howto/perf_profiling.rst:218 msgid "" "For best results, keep frame pointers enabled. On supported GCC-compatible " "toolchains, CPython builds itself with ``-fno-omit-frame-pointer`` and " @@ -345,28 +500,35 @@ msgid "" "allow ``perf`` support is dynamically generated it doesn't have any DWARF " "debugging information available." msgstr "" +"最良の結果を得るには、フレームポインタを有効にしてください。\n" +"対応する GCC 互換ツールチェーンでは、CPython は ``-fno-omit-frame-pointer`` " +"などのフラグを使ってビルドされます (詳細は :option:`--without-frame-" +"pointers` を参照)。\n" +"これにより、プロファイラは DWARF デバッグ情報ではなくフレームポインタだけでス" +"タックをたどれます。\n" +"``perf`` 対応のために挿入するコードは動的に生成され、DWARF デバッグ情報を持た" +"ないためです。" -#: ../../howto/perf_profiling.rst:226 msgid "" "You can check if your system has been compiled with this flag by running::" msgstr "" +"このフラグを使ってコンパイルされたかどうかは、次を実行して確認できます。 ::" -#: ../../howto/perf_profiling.rst:228 msgid "$ python -m sysconfig | grep 'no-omit-frame-pointer'" -msgstr "" +msgstr "$ python -m sysconfig | grep 'no-omit-frame-pointer'" -#: ../../howto/perf_profiling.rst:230 msgid "" "If you don't see any output it means that your interpreter has not been " "compiled with frame pointers and therefore it may not be able to show Python " "functions in the output of ``perf``." msgstr "" +"何も表示されなければ、インタープリタはフレームポインタなしでコンパイルされて" +"います。\n" +"その場合、``perf`` の出力に Python 関数を表示できない可能性があります。" -#: ../../howto/perf_profiling.rst:236 msgid "How to work without frame pointers" -msgstr "" +msgstr "フレームポインタなしで使う方法" -#: ../../howto/perf_profiling.rst:238 msgid "" "If you are working with a Python interpreter that has been compiled without " "frame pointers, you can still use the ``perf`` profiler, but the overhead " @@ -375,47 +537,62 @@ msgid "" "more time to process the data because it will need to use the DWARF " "debugging information to unwind the stack and this is a slow process." msgstr "" +"フレームポインタなしでコンパイルした Python インタープリタでも ``perf`` は使" +"えますが、オーバーヘッドは少し大きくなります。\n" +"Python 関数の呼び出しごとに、スタックをたどるための情報をその場で生成する必要" +"があるためです。\n" +"さらに ``perf`` は DWARF デバッグ情報を使ってスタックをたどる必要があり、この" +"処理は遅いため、データの処理にも時間がかかります。" -#: ../../howto/perf_profiling.rst:245 msgid "" "To enable this mode, you can use the environment variable :envvar:" "`PYTHON_PERF_JIT_SUPPORT` or the :option:`-X perf_jit <-X>` option, which " "will enable the JIT mode for the ``perf`` profiler." msgstr "" +"このモードを有効にするには、環境変数 :envvar:`PYTHON_PERF_JIT_SUPPORT` また" +"は :option:`-X perf_jit <-X>` オプションを使います。\n" +"これにより ``perf`` プロファイラ用の JIT モードが有効になります。" -#: ../../howto/perf_profiling.rst:251 msgid "" "Due to a bug in the ``perf`` tool, only ``perf`` versions higher than v6.8 " "will work with the JIT mode. The fix was also backported to the v6.7.2 " "version of the tool." msgstr "" +"``perf`` ツールのバグのため、JIT モードで動作するのは v6.8 より後のバージョン" +"だけです。\n" +"修正は v6.7.2 にもバックポートされています。" -#: ../../howto/perf_profiling.rst:255 msgid "" "Note that when checking the version of the ``perf`` tool (which can be done " "by running ``perf version``) you must take into account that some distros " "add some custom version numbers including a ``-`` character. This means " "that ``perf 6.7-3`` is not necessarily ``perf 6.7.3``." msgstr "" +"``perf version`` でバージョンを確認するときは、一部のディストリビューション" +"が ``-`` を含む独自のバージョン番号を追加する点に注意してください。\n" +"``perf 6.7-3`` は必ずしも ``perf 6.7.3`` を意味しません。" -#: ../../howto/perf_profiling.rst:260 msgid "" "When using the perf JIT mode, you need an extra step before you can run " "``perf report``. You need to call the ``perf inject`` command to inject the " "JIT information into the ``perf.data`` file.::" msgstr "" +"perf の JIT モードでは、``perf report`` の前に一つ手順が必要です。\n" +"``perf inject`` で JIT 情報を ``perf.data`` ファイルに組み込みます。 ::" -#: ../../howto/perf_profiling.rst:264 msgid "" "$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -" "Xperf_jit my_script.py\n" "$ perf inject -i perf.data --jit --output perf.jit.data\n" "$ perf report -g -i perf.jit.data" msgstr "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -" +"Xperf_jit my_script.py\n" +"$ perf inject -i perf.data --jit --output perf.jit.data\n" +"$ perf report -g -i perf.jit.data" -#: ../../howto/perf_profiling.rst:268 msgid "or using the environment variable::" -msgstr "" +msgstr "環境変数を使う場合は次のようになります。 ::" #: ../../howto/perf_profiling.rst:270 msgid "" @@ -435,7 +612,6 @@ msgid "" "by Python." msgstr "" -#: ../../howto/perf_profiling.rst:282 msgid "" "When using ``--call-graph dwarf``, the ``perf`` tool will take snapshots of " "the stack of the process being profiled and save the information in the " @@ -443,8 +619,11 @@ msgid "" "but you can change the size by passing it after a comma like ``--call-graph " "dwarf,16384``." msgstr "" +"``--call-graph dwarf`` を指定すると、``perf`` は対象プロセスのスタックのス" +"ナップショットを取得し、``perf.data`` に保存します。\n" +"スタックダンプのサイズはデフォルトで 8192 バイトですが、``--call-graph " +"dwarf,16384`` のようにカンマの後に指定すると変更できます。" -#: ../../howto/perf_profiling.rst:288 msgid "" "The size of the stack dump is important because if the size is too small " "``perf`` will not be able to unwind the stack and the output will be " @@ -452,8 +631,11 @@ msgid "" "be able to sample the process as frequently as it would like as the overhead " "will be higher." msgstr "" +"スタックダンプのサイズは重要です。\n" +"小さすぎると ``perf`` がスタックをたどれず、出力が不完全になります。\n" +"大きすぎるとオーバーヘッドが増え、希望する頻度でサンプリングできなくなりま" +"す。" -#: ../../howto/perf_profiling.rst:294 msgid "" "The stack size is particularly important when profiling Python code compiled " "with low optimization levels (like ``-O0``), as these builds tend to have " @@ -461,30 +643,37 @@ msgid "" "Python functions in your profiling output, try increasing the stack dump " "size to 65528 bytes (the maximum)::" msgstr "" +"``-O0`` のような低い最適化レベルでコンパイルした Python をプロファイリングす" +"る場合は、スタックフレームが大きくなりやすいため、特にサイズが重要です。\n" +"``-O0`` でコンパイルした Python の関数が出力に現れない場合は、スタックダンプ" +"のサイズを最大の 65528 バイトに増やしてみてください。 ::" -#: ../../howto/perf_profiling.rst:300 msgid "" "$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -" "Xperf_jit my_script.py" msgstr "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -" +"Xperf_jit my_script.py" -#: ../../howto/perf_profiling.rst:302 msgid "Different compilation flags can significantly impact stack sizes:" -msgstr "" +msgstr "コンパイルフラグはスタックのサイズに大きく影響することがあります:" -#: ../../howto/perf_profiling.rst:304 msgid "" "Builds with ``-O0`` typically have much larger stack frames than those with " "``-O1`` or higher" msgstr "" +"通常、``-O0`` のビルドは ``-O1`` 以上のビルドよりも、スタックフレームがはるか" +"に大きくなります。" -#: ../../howto/perf_profiling.rst:305 msgid "" "Adding optimizations (``-O1``, ``-O2``, etc.) typically reduces stack size" msgstr "" +"通常、最適化 (``-O1``、``-O2`` など) を有効にするとスタックのサイズが小さくな" +"ります。" -#: ../../howto/perf_profiling.rst:306 msgid "" "Frame pointers (``-fno-omit-frame-pointer``) generally provide more reliable " "stack unwinding" msgstr "" +"フレームポインタ (``-fno-omit-frame-pointer``) を使うと、一般にスタックをより" +"確実にたどれます。" diff --git a/howto/pyporting.po b/howto/pyporting.po index c94a56419..5688cb12a 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -22,62 +22,66 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/pyporting.rst:7 msgid "How to port Python 2 Code to Python 3" -msgstr "" +msgstr "Python 2 のコードを Python 3 に移植する方法" -#: ../../howto/pyporting.rst:9 msgid "" "Python 2 reached its official end-of-life at the start of 2020. This means " "that no new bug reports, fixes, or changes will be made to Python 2 - it's " "no longer supported: see :pep:`373` and `status of Python versions `_." msgstr "" +"Python 2 の公式サポートは 2020 年の初めに終了しました。\n" +"Python 2 に対する新しいバグ報告の受け付け、修正、変更は行われず、サポートされ" +"ていません。\n" +":pep:`373` と `Python 各バージョンの状況 `_ を参照してください。" -#: ../../howto/pyporting.rst:14 msgid "" "If you are looking to port an extension module instead of pure Python code, " "please see :ref:`cporting-howto`." msgstr "" -"もしあなたが標準 Python ライブラリではなく拡張ライブラリでの移植手段を探して" -"いるならば :ref:`cporting-howto` を参照してください。" +"Python だけで書かれたコードではなく、拡張モジュールを移植する場合は :ref:" +"`cporting-howto` を参照してください。" -#: ../../howto/pyporting.rst:17 msgid "" "The archived python-porting_ mailing list may contain some useful guidance." msgstr "" +"アーカイブされた python-porting_ メーリングリストにも、役立つ情報があるかもし" +"れません。" -#: ../../howto/pyporting.rst:19 msgid "" "Since Python 3.11 the original porting guide was discontinued. You can find " "the old guide in the `archive `_." msgstr "" +"従来の移植ガイドは Python 3.11 から廃止されました。\n" +"以前のガイドは `アーカイブ `_ で読めます。" -#: ../../howto/pyporting.rst:25 msgid "Third-party guides" -msgstr "" +msgstr "サードパーティのガイド" -#: ../../howto/pyporting.rst:27 msgid "There are also multiple third-party guides that might be useful:" -msgstr "" +msgstr "次のようなサードパーティのガイドも参考になります:" -#: ../../howto/pyporting.rst:29 msgid "`Guide by Fedora `_" -msgstr "" +msgstr "`Fedora のガイド `_" -#: ../../howto/pyporting.rst:30 msgid "`PyCon 2020 tutorial `_" msgstr "" +"`PyCon 2020 のチュートリアル `_" -#: ../../howto/pyporting.rst:31 msgid "" "`Guide by DigitalOcean `_" msgstr "" +"`DigitalOcean のガイド `_" -#: ../../howto/pyporting.rst:32 msgid "" "`Guide by ActiveState `_" msgstr "" +"`ActiveState のガイド `_" diff --git a/howto/regex.po b/howto/regex.po index c389779c6..84fe4b384 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/regex.rst:5 msgid "Regular expression HOWTO" -msgstr "" +msgstr "正規表現 HOWTO" #: ../../howto/regex.rst-1 msgid "Abstract" @@ -100,9 +99,8 @@ msgstr "" "Python コードは工夫を凝らした正規表現より遅くなりますが、おそらく理解しやすく" "なるでしょう。" -#: ../../howto/regex.rst:49 msgid "Simple patterns" -msgstr "" +msgstr "単純なパターン" #: ../../howto/regex.rst:51 msgid "" @@ -124,9 +122,8 @@ msgstr "" "ついては, コンパイラ作成に関するテキストブックをどれでもいいので参照して下さ" "い。" -#: ../../howto/regex.rst:61 msgid "Matching characters" -msgstr "" +msgstr "文字のマッチング" #: ../../howto/regex.rst:63 msgid "" @@ -163,9 +160,8 @@ msgstr "" "ここに特殊文字の完全な一覧があります; これらの意味はこの HOWTO の残りの部分で" "説明します。" -#: ../../howto/regex.rst:77 msgid ". ^ $ * + ? { } [ ] \\ | ( )" -msgstr "" +msgstr ". ^ $ * + ? { } [ ] \\ | ( )" #: ../../howto/regex.rst:81 msgid "" @@ -198,7 +194,6 @@ msgstr "" "``'$'`` は通常は特殊文字ですが、文字クラスの内部ではその特別な意味を失いま" "す。" -#: ../../howto/regex.rst:95 msgid "" "You can match the characters not listed within the class by :dfn:" "`complementing` the set. This is indicated by including a ``'^'`` as the " @@ -207,12 +202,11 @@ msgid "" "does not have special meaning. For example: ``[5^]`` will match either a " "``'5'`` or a ``'^'``." msgstr "" -":dfn:`補集合を取る` ことで、文字クラス内のリストにない文字に対してマッチさせ" -"られます。\n" -"補集合は、クラスの最初の文字として ``'^'`` を含めることで表せます。\n" -"例えば、 ``[^5]`` は ``'5'`` 以外の文字にマッチします。\n" -"キャレットが文字クラス以外の場所に現れた場合は、特別な意味は持ちません。\n" -"例えば、 ``[5^]`` は ``'5'`` や ``'^'`` にマッチします。" +":dfn:`補集合を取る` と、文字クラスに挙げていない文字にマッチさせられます。\n" +"文字クラスの最初に ``'^'`` を置いて表します。\n" +"例えば ``[^5]`` は ``'5'`` 以外の文字にマッチします。\n" +"キャレットが文字クラス内の先頭以外の位置にあれば、特別な意味はありません。\n" +"例えば ``[5^]`` は ``'5'`` または ``'^'`` にマッチします。" #: ../../howto/regex.rst:101 msgid "" @@ -274,9 +268,10 @@ msgstr "" msgid "``\\d``" msgstr "``\\d``" -#: ../../howto/regex.rst:129 msgid "Matches any decimal digit; this is equivalent to the class ``[0-9]``." -msgstr "任意の十進数とマッチします; これは集合 ``[0-9]`` と同じ意味です。" +msgstr "" +"任意の十進数字にマッチします。\n" +"文字クラス ``[0-9]`` と同じです。" #: ../../howto/regex.rst:131 msgid "``\\D``" @@ -355,9 +350,8 @@ msgstr "" "る代替モード (:const:`re.DOTALL`) があります。\n" "``.`` は「任意の文字」にマッチさせたい場合に利用されます。" -#: ../../howto/regex.rst:161 msgid "Repeating things" -msgstr "" +msgstr "繰り返し" #: ../../howto/regex.rst:163 msgid "" @@ -586,11 +580,13 @@ msgstr "" "的な値が仮定されます。\n" "*m* の省略は下限は 0 と解釈され、*n* の省略は上限は無限として解釈されます。" -#: ../../howto/regex.rst:246 msgid "" "The simplest case ``{m}`` matches the preceding item exactly *m* times. For " "example, ``a/{2}b`` will only match ``'a//b'``." msgstr "" +"最も単純な ``{m}`` は、直前の要素のちょうど *m* 回の繰り返しにマッチしま" +"す。\n" +"例えば ``a/{2}b`` は ``'a//b'`` だけにマッチします。" #: ../../howto/regex.rst:249 msgid "" @@ -605,9 +601,8 @@ msgstr "" "価です。また ``{0,1}`` は ``?`` と同じです。とはいえ、簡潔さと読みやすさの観" "点から、可能であれば ``*``, ``+``, ``?`` を使う方が望ましいです。" -#: ../../howto/regex.rst:257 msgid "Using regular expressions" -msgstr "" +msgstr "正規表現を使う" #: ../../howto/regex.rst:259 msgid "" @@ -621,9 +616,8 @@ msgstr "" "ンターフェースを提供していて、それらを使うことで正規表現をオブジェクトにコン" "パイルし、マッチを実行することができます。" -#: ../../howto/regex.rst:266 msgid "Compiling regular expressions" -msgstr "" +msgstr "正規表現のコンパイル" #: ../../howto/regex.rst:268 msgid "" @@ -635,27 +629,28 @@ msgstr "" "くの操作、パターンマッチの検索や文字列の置換の実行などのメソッドを持っていま" "す。 ::" -#: ../../howto/regex.rst:272 msgid "" ">>> import re\n" ">>> p = re.compile('ab*')\n" ">>> p\n" "re.compile('ab*')" msgstr "" +">>> import re\n" +">>> p = re.compile('ab*')\n" +">>> p\n" +"re.compile('ab*')" -#: ../../howto/regex.rst:277 msgid "" ":func:`re.compile` also accepts an optional *flags* argument, used to enable " "various special features and syntax variations. We'll go over the available " "settings later, but for now a single example will do::" msgstr "" -":func:`re.compile` はいくつかの *flags* 引数を受け付けることができます、この" -"引数はさまざまな特別な機能を有効にしたり、構文を変化させたりします。利用でき" -"る設定に何があるかは後に飛ばすことにして、簡単な例をやることにしましょう::" +":func:`re.compile` は省略可能な *flags* 引数も受け取ります。\n" +"さまざまな機能や構文上の違いを有効にするための引数です。\n" +"利用できる設定は後で説明しますが、まずは一つ例を見てみましょう。 ::" -#: ../../howto/regex.rst:281 msgid ">>> p = re.compile('ab*', re.IGNORECASE)" -msgstr "" +msgstr ">>> p = re.compile('ab*', re.IGNORECASE)" #: ../../howto/regex.rst:283 msgid "" @@ -683,9 +678,8 @@ msgstr "" "正規表現を文字列としておくことで Python 言語はより簡素に保たれていますが、そ" "のため1つの欠点があります、これについては次の節で話題とします。" -#: ../../howto/regex.rst:297 msgid "The backslash plague" -msgstr "" +msgstr "バックスラッシュの悩み" #: ../../howto/regex.rst:299 msgid "" @@ -780,7 +774,6 @@ msgstr "" "ります。多くの場合 Python コードの中の正規表現はこの raw string 記法を使って" "書かれます。" -#: ../../howto/regex.rst:334 msgid "" "In addition, special escape sequences that are valid in regular expressions, " "but not valid as Python string literals, now result in a :exc:" @@ -788,14 +781,18 @@ msgid "" "the sequences will be invalid if raw string notation or escaping the " "backslashes isn't used." msgstr "" +"また、正規表現としては有効でも Python の文字列リテラルでは有効でない特殊なエ" +"スケープシーケンスは、現在は :exc:`SyntaxWarning` を発生させ、将来は :exc:" +"`SyntaxError` になります。\n" +"つまり、raw string 記法を使うかバックスラッシュをエスケープしなければ、これら" +"のシーケンスは無効になります。" #: ../../howto/regex.rst:342 msgid "Regular String" msgstr "通常の文字列" -#: ../../howto/regex.rst:342 msgid "Raw string" -msgstr "Raw string" +msgstr "raw 文字列" #: ../../howto/regex.rst:344 msgid "``\"ab*\"``" @@ -817,9 +814,8 @@ msgstr "``\"\\\\w+\\\\s+\\\\1\"``" msgid "``r\"\\w+\\s+\\1\"``" msgstr "``r\"\\w+\\s+\\1\"``" -#: ../../howto/regex.rst:353 msgid "Performing matches" -msgstr "" +msgstr "マッチングの実行" #: ../../howto/regex.rst:355 msgid "" @@ -851,47 +847,50 @@ msgstr "``search()``" msgid "Scan through a string, looking for any location where this RE matches." msgstr "文字列を先頭から走査して、正規表現がどこにマッチするか調べます。" -#: ../../howto/regex.rst:366 msgid "``prefixmatch()``" -msgstr "" +msgstr "``prefixmatch()``" -#: ../../howto/regex.rst:366 msgid "" "Determine if the RE matches at the beginning of the string. Previously " "named :ref:`match() `." msgstr "" +"正規表現が文字列の先頭にマッチするかを調べます。\n" +"以前の名前は :ref:`match() ` です。" #: ../../howto/regex.rst:370 msgid "``findall()``" msgstr "``findall()``" -#: ../../howto/regex.rst:370 msgid "Find all substrings where the RE matches, and return them as a list." -msgstr "" +msgstr "正規表現にマッチする部分文字列をすべて見つけ、リストで返します。" #: ../../howto/regex.rst:373 msgid "``finditer()``" msgstr "``finditer()``" -#: ../../howto/regex.rst:373 msgid "" "Find all substrings where the RE matches, and return them as an :term:" "`iterator`." msgstr "" +"正規表現にマッチする部分文字列をすべて見つけ、:term:`iterator` として返しま" +"す。" -#: ../../howto/regex.rst:377 msgid "" ":meth:`~re.Pattern.search` and :meth:`~re.Pattern.prefixmatch` return " "``None`` if no match can be found. If they're successful, a :ref:`match " "object ` instance is returned, containing information about " "the match: where it starts and ends, the substring it matched, and more." msgstr "" +":meth:`~re.Pattern.search` と :meth:`~re.Pattern.prefixmatch` は、マッチが見" +"つからなければ ``None`` を返します。\n" +"見つかれば :ref:`マッチオブジェクト ` を返します。\n" +"このオブジェクトには、開始位置、終了位置、マッチした部分文字列などの情報が含" +"まれます。" -#: ../../howto/regex.rst:382 msgid "" "You can learn about this by interactively experimenting with the :mod:`re` " "module." -msgstr "" +msgstr ":mod:`re` モジュールを対話的に試すと理解が深まります。" #: ../../howto/regex.rst:385 msgid "" @@ -902,15 +901,17 @@ msgstr "" "ンタプリタを起動して、 :mod:`re` モジュールをインポートし、正規表現をコンパイ" "ルします::" -#: ../../howto/regex.rst:388 msgid "" ">>> import re\n" ">>> p = re.compile('[a-z]+')\n" ">>> p\n" "re.compile('[a-z]+')" msgstr "" +">>> import re\n" +">>> p = re.compile('[a-z]+')\n" +">>> p\n" +"re.compile('[a-z]+')" -#: ../../howto/regex.rst:393 msgid "" "Now, you can try matching various strings against the RE ``[a-z]+``. An " "empty string shouldn't match at all, since ``+`` means 'one or more " @@ -918,28 +919,39 @@ msgid "" "case, which will cause the interpreter to print no output. You can " "explicitly print the result of :meth:`!search` to make this clear. ::" msgstr "" +"正規表現 ``[a-z]+`` でさまざまな文字列を試してみましょう。\n" +"``+`` は「1 回以上の繰り返し」なので、空文字列にはマッチしません。\n" +"この場合 :meth:`~re.Pattern.search` は ``None`` を返し、インタープリタには何" +"も表示されません。\n" +":meth:`!search` の結果を明示的に表示すると確認できます。 ::" -#: ../../howto/regex.rst:399 msgid "" ">>> p.search(\"\")\n" ">>> print(p.search(\"\"))\n" "None" msgstr "" +">>> p.search(\"\")\n" +">>> print(p.search(\"\"))\n" +"None" -#: ../../howto/regex.rst:403 msgid "" "Now, let's try it on a string that it should match, such as ``tempo``. In " "this case, :meth:`~re.Pattern.search` will return a :ref:`match object " "`, so you should store the result in a variable for later " "use. ::" msgstr "" +"今度は ``tempo`` など、マッチするはずの文字列を試しましょう。\n" +"この場合 :meth:`~re.Pattern.search` は :ref:`マッチオブジェクト ` を返すので、後で使えるように変数に保存しておきます。 ::" -#: ../../howto/regex.rst:407 msgid "" ">>> m = p.search('tempo')\n" ">>> m\n" "" msgstr "" +">>> m = p.search('tempo')\n" +">>> m\n" +"" #: ../../howto/regex.rst:411 msgid "" @@ -988,7 +1000,6 @@ msgstr "マッチの位置 (start, end) を含むタプルを返す" msgid "Trying these methods will soon clarify their meaning::" msgstr "これらのメソッドを試せば、その意味はすぐに理解できます::" -#: ../../howto/regex.rst:430 msgid "" ">>> m.group()\n" "'tempo'\n" @@ -997,8 +1008,13 @@ msgid "" ">>> m.span()\n" "(0, 5)" msgstr "" +">>> m.group()\n" +"'tempo'\n" +">>> m.start(), m.end()\n" +"(0, 5)\n" +">>> m.span()\n" +"(0, 5)" -#: ../../howto/regex.rst:437 msgid "" ":meth:`~re.Match.group` returns the substring that was matched by the RE. :" "meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " @@ -1008,8 +1024,15 @@ msgid "" "meth:`~re.Pattern.prefixmatch` method only checks if the RE matches at the " "start of a string, so :meth:`!start` will always be zero in that case. ::" msgstr "" +":meth:`~re.Match.group` は正規表現にマッチした部分文字列を返します。\n" +":meth:`~re.Match.start` と :meth:`~re.Match.end` は、開始と終了のインデックス" +"を返します。\n" +":meth:`~re.Match.span` は両方のインデックスを一つのタプルで返します。\n" +"パターンの :meth:`~re.Pattern.search` は文字列を走査するので、マッチは必ずし" +"もゼロから始まりません。\n" +"一方 :meth:`~re.Pattern.prefixmatch` は文字列の先頭だけを調べるので、その場" +"合 :meth:`!start` は常にゼロになります。 ::" -#: ../../howto/regex.rst:446 msgid "" ">>> m = p.search('::: message'); print(m)\n" "\n" @@ -1020,6 +1043,14 @@ msgid "" ">>> print(p.prefixmatch('::: message'))\n" "None" msgstr "" +">>> m = p.search('::: message'); print(m)\n" +"\n" +">>> m.group()\n" +"'message'\n" +">>> m.span()\n" +"(4, 11)\n" +">>> print(p.prefixmatch('::: message'))\n" +"None" #: ../../howto/regex.rst:455 msgid "" @@ -1031,7 +1062,6 @@ msgstr "" "ておき, その次に ``None`` なのか調べるのが一般的なスタイルです。普通このよう" "にします::" -#: ../../howto/regex.rst:459 msgid "" "p = re.compile( ... )\n" "m = p.search( 'string goes here' )\n" @@ -1040,6 +1070,12 @@ msgid "" "else:\n" " print('No match')" msgstr "" +"p = re.compile( ... )\n" +"m = p.search( 'string goes here' )\n" +"if m:\n" +" print('Match found: ', m.group())\n" +"else:\n" +" print('No match')" #: ../../howto/regex.rst:466 msgid "" @@ -1050,14 +1086,15 @@ msgstr "" "ります。\n" ":meth:`~re.Pattern.findall` はマッチした文字列のリストを返します::" -#: ../../howto/regex.rst:469 msgid "" ">>> p = re.compile(r'\\d+')\n" ">>> p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping')\n" "['12', '11', '10']" msgstr "" +">>> p = re.compile(r'\\d+')\n" +">>> p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping')\n" +"['12', '11', '10']" -#: ../../howto/regex.rst:473 msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " "example because escape sequences in a normal \"cooked\" string literal that " @@ -1065,6 +1102,11 @@ msgid "" "in a :exc:`SyntaxWarning` and will eventually become a :exc:`SyntaxError`. " "See :ref:`the-backslash-plague`." msgstr "" +"この例では、リテラルを raw string にする接頭辞 ``r`` が必要です。\n" +"正規表現では認識されても Python が認識しないエスケープシーケンスを通常の文字" +"列リテラルに書くと、現在は :exc:`SyntaxWarning` が発生し、将来は :exc:" +"`SyntaxError` になるためです。\n" +":ref:`the-backslash-plague` を参照してください。" #: ../../howto/regex.rst:479 msgid "" @@ -1078,7 +1120,6 @@ msgstr "" "ト ` インスタンスのシーケンスを :term:`iterator` として返しま" "す::" -#: ../../howto/regex.rst:483 msgid "" ">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" ">>> iterator\n" @@ -1090,10 +1131,18 @@ msgid "" "(22, 24)\n" "(29, 31)" msgstr "" +">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" +">>> iterator\n" +"\n" +">>> for match in iterator:\n" +"... print(match.span())\n" +"...\n" +"(0, 2)\n" +"(22, 24)\n" +"(29, 31)" -#: ../../howto/regex.rst:495 msgid "Module-level functions" -msgstr "" +msgstr "モジュールレベルの関数" #: ../../howto/regex.rst:497 msgid "" @@ -1105,13 +1154,16 @@ msgid "" "``None`` or a :ref:`match object ` instance. ::" msgstr "" -#: ../../howto/regex.rst:504 msgid "" ">>> print(re.prefixmatch(r'From\\s+', 'Fromage amk'))\n" "None\n" ">>> re.prefixmatch(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n" "" msgstr "" +">>> print(re.prefixmatch(r'From\\s+', 'Fromage amk'))\n" +"None\n" +">>> re.prefixmatch(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n" +"" #: ../../howto/regex.rst:509 msgid "" @@ -1137,9 +1189,8 @@ msgstr "" "イルは関数呼び出しを減らします。ループの外側であれば、内部キャッシュのおかげ" "で、どちらでも大差ありません。" -#: ../../howto/regex.rst:522 msgid "Compilation flags" -msgstr "" +msgstr "コンパイルフラグ" #: ../../howto/regex.rst:526 msgid "" @@ -1232,7 +1283,6 @@ msgstr "" "冗長な正規表現を利用できるようにして、よりきれいで理解しやすくまとめることが" "できます。" -#: ../../howto/regex.rst:563 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -1248,17 +1298,19 @@ msgid "" "also set the :const:`LOCALE` flag." msgstr "" "大文字と小文字を区別しないマッチングを実行します; 文字クラスと文字列リテラル" -"は大文字か小文字かに関係なくパターンにマッチします。例えば、 ``[A-Z]`` は小文" -"字のアルファベットにもマッチします。 :const:`ASCII` フラグによって非 ASCII 文" -"字のマッチングが無効化されていなければ、完全なユニコードのマッチングも可能で" -"す。ユニコードで ``[a-z]`` または ``[A-Z]`` が :const:`IGNORECASE` フラグとと" -"もに使われると、 52個の ASCII 文字に加えて 次の4つの 非 ASCII 文字にマッチし" -"ます: 'İ' (U+0130, ラテン語の大文字 I で、上部に点がついたもの), " -"'ı' (U+0131, ラテン語の小文字 i で上部に点がない), 'ſ' (U+017F, ラテン語の小" -"文字 s), 'K' (U+212A, ケルビン記号)。 ``Spam`` は ``'Spam'``, ``'spam'``, " -"``'spAM'``, そして ``'ſpam'`` にマッチします (ただし最後の文字列はユニコード" -"モードの場合のみマッチします)。この「小文字化」は現在のロケールを考慮しませ" -"ん; ただし :const:`LOCALE` フラグをセットした場合はロケールを考慮します。" +"は大文字か小文字かに関係なくパターンにマッチします。\n" +"例えば、 ``[A-Z]`` は小文字のアルファベットにもマッチします。\n" +":const:`ASCII` フラグによって非 ASCII 文字のマッチングが無効化されていなけれ" +"ば、完全なユニコードのマッチングも可能です。\n" +"ユニコードで ``[a-z]`` または ``[A-Z]`` が :const:`IGNORECASE` フラグとともに" +"使われると、 52個の ASCII 文字に加えて 次の4つの 非 ASCII 文字にマッチしま" +"す: 'İ' (U+0130, ラテン語の大文字 I で、上部に点がついたもの), 'ı' (U+0131, " +"ラテン語の小文字 i で上部に点がない), 'ſ' (U+017F, ラテン文字の小文字の長い " +"s), 'K' (U+212A, ケルビン記号)。\n" +"``Spam`` は ``'Spam'``, ``'spam'``, ``'spAM'``, そして ``'ſpam'`` にマッチし" +"ます (ただし最後の文字列はユニコードモードの場合のみマッチします)。\n" +"この「小文字化」は現在のロケールを考慮しません; ただし :const:`LOCALE` フラグ" +"をセットした場合はロケールを考慮します。" #: ../../howto/regex.rst:581 msgid "" @@ -1343,7 +1395,6 @@ msgstr "" "チングではなく、ASCII のみのマッチングをするようにします。これは Unicode パ" "ターンにのみ意味があり、byte パターンには無視されます。" -#: ../../howto/regex.rst:639 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -1354,6 +1405,13 @@ msgid "" "comments are marked by a ``'#'`` that's neither in a character class nor " "preceded by an unescaped backslash." msgstr "" +"このフラグを使うと、正規表現の整形方法の自由度が増し、読みやすく書けます。\n" +"正規表現内の空白は、文字クラス内にある場合や、エスケープされていないバックス" +"ラッシュが直前にある場合を除き、無視されます。\n" +"そのため、正規表現を整理してインデントできます。\n" +"また、エンジンが無視するコメントも書けます。\n" +"文字クラス内ではなく、直前にエスケープされていないバックスラッシュもない " +"``'#'`` からコメントが始まります。" #: ../../howto/regex.rst:648 msgid "" @@ -1363,7 +1421,6 @@ msgstr "" "例えば、ここに :const:`re.VERBOSE` を利用した正規表現があります; 読み易いと思" "いませんか? ::" -#: ../../howto/regex.rst:651 msgid "" "charref = re.compile(r\"\"\"\n" " &[#] # Start of a numeric entity reference\n" @@ -1375,17 +1432,28 @@ msgid "" " ; # Trailing semicolon\n" "\"\"\", re.VERBOSE)" msgstr "" +"charref = re.compile(r\"\"\"\n" +" &[#] # Start of a numeric entity reference\n" +" (\n" +" 0[0-7]+ # Octal form\n" +" | [0-9]+ # Decimal form\n" +" | x[0-9a-fA-F]+ # Hexadecimal form\n" +" )\n" +" ; # Trailing semicolon\n" +"\"\"\", re.VERBOSE)" #: ../../howto/regex.rst:661 msgid "Without the verbose setting, the RE would look like this::" msgstr "冗長な表現を利用しない設定の場合、正規表現はこうなります::" -#: ../../howto/regex.rst:663 msgid "" "charref = re.compile(\"&#(0[0-7]+\"\n" " \"|[0-9]+\"\n" " \"|x[0-9a-fA-F]+);\")" msgstr "" +"charref = re.compile(\"&#(0[0-7]+\"\n" +" \"|[0-9]+\"\n" +" \"|x[0-9a-fA-F]+);\")" #: ../../howto/regex.rst:667 msgid "" @@ -1397,9 +1465,8 @@ msgstr "" "割しています、それでも :const:`re.VERBOSE` を使った場合に比べるとまだ難しく" "なっています。" -#: ../../howto/regex.rst:673 msgid "More pattern power" -msgstr "" +msgstr "パターンのさらなる機能" #: ../../howto/regex.rst:675 msgid "" @@ -1411,9 +1478,8 @@ msgstr "" "くつかの特殊文字とグループを使ってマッチしたテキストの一部をどう取得するかに" "ついて扱います。" -#: ../../howto/regex.rst:683 msgid "More metacharacters" -msgstr "" +msgstr "その他の特殊文字" #: ../../howto/regex.rst:685 msgid "" @@ -1423,7 +1489,6 @@ msgstr "" "これまでで、まだ扱っていない特殊文字がいくつかありました。そのほとんどをこの" "節で扱っていきます。" -#: ../../howto/regex.rst:688 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1434,12 +1499,12 @@ msgid "" "once at a given location, they can obviously be matched an infinite number " "of times." msgstr "" -"残りの特殊文字の内いくつかは :dfn:`ゼロ幅アサーション zero-width-assertions` " -"に関するものです。これらは文字列に対してエンジンを進めません; 文字列を全く利" -"用しない代わりに、単純に成功か失敗かを利用します。例えば、 ``\\b`` は現在位置" -"が単語の境界であることを示します; ``\\b`` によってエンジンの読んでいる位置は" -"全く変化しません。つまり、これはゼロ幅アサーションは繰り返し使うことがありま" -"せん、一度ある位置でマッチしたら、明らかに無限回マッチできます。" +"残りの特殊文字には :dfn:`ゼロ幅アサーション` があります。\n" +"これは文字を一つも消費せず、成功か失敗かを判定するだけなので、エンジンが文字" +"列内を進むことはありません。\n" +"例えば ``\\b`` は現在位置が単語の境界であることを判定し、位置を変えません。\n" +"ゼロ幅アサーションは繰り返すべきではありません。\n" +"ある位置で一度マッチすれば、そこで何度でもマッチできてしまうためです。" #: ../../howto/regex.rst:696 msgid "``|``" @@ -1492,13 +1557,16 @@ msgstr "" "例えば、行の先頭の ``From`` にのみマッチさせたい場合には ``^From`` 正規表現を" "利用します。 ::" -#: ../../howto/regex.rst:714 msgid "" ">>> print(re.search('^From', 'From Here to Eternity'))\n" "\n" ">>> print(re.search('^From', 'Reciting From Memory'))\n" "None" msgstr "" +">>> print(re.search('^From', 'From Here to Eternity'))\n" +"\n" +">>> print(re.search('^From', 'Reciting From Memory'))\n" +"None" #: ../../howto/regex.rst:719 msgid "To match a literal ``'^'``, use ``\\^``." @@ -1516,7 +1584,6 @@ msgstr "" "行の末尾にマッチします、行の末尾は文字列の末尾と改行文字の直前として定義され" "ます。 ::" -#: ../../howto/regex.rst:725 msgid "" ">>> print(re.search('}$', '{block}'))\n" "\n" @@ -1525,6 +1592,12 @@ msgid "" ">>> print(re.search('}$', '{block}\\n'))\n" "" msgstr "" +">>> print(re.search('}$', '{block}'))\n" +"\n" +">>> print(re.search('}$', '{block} '))\n" +"None\n" +">>> print(re.search('}$', '{block}\\n'))\n" +"" #: ../../howto/regex.rst:732 msgid "" @@ -1551,9 +1624,8 @@ msgstr "" "いは: ``\\A`` は依然として文字列の先頭にのみマッチしますが、 ``^`` は文字列内" "に改行文字に続く部分があればそこにマッチすることです。" -#: ../../howto/regex.rst:741 msgid "``\\z``" -msgstr "" +msgstr "``\\z``" #: ../../howto/regex.rst:742 msgid "Matches only at the end of the string." @@ -1563,9 +1635,10 @@ msgstr "文字列の末尾でのみマッチします。" msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:745 msgid "The same as ``\\z``. For compatibility with old Python versions." msgstr "" +"``\\z`` と同じです。\n" +"古い Python バージョンとの互換性のためにあります。" #: ../../howto/regex.rst:747 msgid "``\\b``" @@ -1590,7 +1663,6 @@ msgstr "" "以下の例では ``class`` がそのものの単語のときのみマッチします; 別の単語内に含" "まれている場合はマッチしません。 ::" -#: ../../howto/regex.rst:756 msgid "" ">>> p = re.compile(r'\\bclass\\b')\n" ">>> print(p.search('no class at all'))\n" @@ -1600,6 +1672,13 @@ msgid "" ">>> print(p.search('one subclass is'))\n" "None" msgstr "" +">>> p = re.compile(r'\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"\n" +">>> print(p.search('the declassified algorithm'))\n" +"None\n" +">>> print(p.search('one subclass is'))\n" +"None" #: ../../howto/regex.rst:764 msgid "" @@ -1619,7 +1698,6 @@ msgstr "" "じ正規表現のように見えますが、正規表現文字列の前の ``'r'`` が省略されていま" "す。 ::" -#: ../../howto/regex.rst:772 msgid "" ">>> p = re.compile('\\bclass\\b')\n" ">>> print(p.search('no class at all'))\n" @@ -1627,6 +1705,11 @@ msgid "" ">>> print(p.search('\\b' + 'class' + '\\b'))\n" "" msgstr "" +">>> p = re.compile('\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"None\n" +">>> print(p.search('\\b' + 'class' + '\\b'))\n" +"" #: ../../howto/regex.rst:778 msgid "" @@ -1667,13 +1750,16 @@ msgstr "" "て興味ある部分にマッチするようにして、文字列を分割するのに使われます。例え" "ば、RFC-822 ヘッダ行は ``':'`` を挟んでこのようにヘッダ名と値に分割されます:" -#: ../../howto/regex.rst:796 msgid "" "From: author@example.com\n" "User-Agent: Thunderbird 1.5.0.9 (X11/20061227)\n" "MIME-Version: 1.0\n" "To: editor@example.com" msgstr "" +"From: author@example.com\n" +"User-Agent: Thunderbird 1.5.0.9 (X11/20061227)\n" +"MIME-Version: 1.0\n" +"To: editor@example.com" #: ../../howto/regex.rst:803 msgid "" @@ -1699,12 +1785,14 @@ msgstr "" "子を使った繰り返しを表現することもできます。例えば、 ``(ab)*`` は ``ab`` の0" "回以上の繰り返しにマッチします。 ::" -#: ../../howto/regex.rst:814 msgid "" ">>> p = re.compile('(ab)*')\n" ">>> print(p.search('ababababab').span())\n" "(0, 10)" msgstr "" +">>> p = re.compile('(ab)*')\n" +">>> print(p.search('ababababab').span())\n" +"(0, 10)" #: ../../howto/regex.rst:818 msgid "" @@ -1725,7 +1813,6 @@ msgstr "" "デフォルト引数にしています。マッチするテキストの範囲をキャプチャしないグルー" "プの書き方はのちほど見ることにします。 ::" -#: ../../howto/regex.rst:827 msgid "" ">>> p = re.compile('(a)b')\n" ">>> m = p.search('ab')\n" @@ -1734,6 +1821,12 @@ msgid "" ">>> m.group(0)\n" "'ab'" msgstr "" +">>> p = re.compile('(a)b')\n" +">>> m = p.search('ab')\n" +">>> m.group()\n" +"'ab'\n" +">>> m.group(0)\n" +"'ab'" #: ../../howto/regex.rst:834 msgid "" @@ -1744,7 +1837,6 @@ msgstr "" "サブグループは左から右へ1づつ番号付けされます。グループはネストしてもかまいま" "せん; 番号を決めるには、単に開き括弧を左から右へ数え上げます。 ::" -#: ../../howto/regex.rst:838 msgid "" ">>> p = re.compile('(a(b)c)d')\n" ">>> m = p.search('abcd')\n" @@ -1755,6 +1847,14 @@ msgid "" ">>> m.group(2)\n" "'b'" msgstr "" +">>> p = re.compile('(a(b)c)d')\n" +">>> m = p.search('abcd')\n" +">>> m.group(0)\n" +"'abcd'\n" +">>> m.group(1)\n" +"'abc'\n" +">>> m.group(2)\n" +"'b'" #: ../../howto/regex.rst:847 msgid "" @@ -1765,11 +1865,12 @@ msgstr "" ":meth:`~re.Match.group` には一回に複数の引数を渡してもかまいません、その場合" "にはそれらのグループに対応する値を含むタプルを返します。 ::" -#: ../../howto/regex.rst:850 msgid "" ">>> m.group(2,1,2)\n" "('b', 'abc', 'b')" msgstr "" +">>> m.group(2,1,2)\n" +"('b', 'abc', 'b')" #: ../../howto/regex.rst:853 msgid "" @@ -1779,11 +1880,12 @@ msgstr "" ":meth:`~re.Match.groups` メソッドは 1 から全てのサブグループの文字列を含むタ" "プルを返します。::" -#: ../../howto/regex.rst:856 msgid "" ">>> m.groups()\n" "('abc', 'b')" msgstr "" +">>> m.groups()\n" +"('abc', 'b')" #: ../../howto/regex.rst:859 msgid "" @@ -1806,12 +1908,14 @@ msgstr "" msgid "For example, the following RE detects doubled words in a string. ::" msgstr "例えば、以下の正規表現は二重になった単語を検出します。 ::" -#: ../../howto/regex.rst:869 msgid "" ">>> p = re.compile(r'\\b(\\w+)\\s+\\1\\b')\n" ">>> p.search('Paris in the the spring').group()\n" "'the the'" msgstr "" +">>> p = re.compile(r'\\b(\\w+)\\s+\\1\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" #: ../../howto/regex.rst:873 msgid "" @@ -1824,9 +1928,8 @@ msgstr "" "ん。--- このように繰り返されるテキストフォーマットは少数です。--- しかし、文" "字列の置換をする場合には *とても* 有効であることに気づくでしょう。" -#: ../../howto/regex.rst:879 msgid "Non-capturing and named groups" -msgstr "" +msgstr "取り込まないグループと名前付きグループ" #: ../../howto/regex.rst:881 msgid "" @@ -1842,7 +1945,6 @@ msgstr "" "なっていきます。この問題の解決を助ける二つの機能があります。その両方が正規表" "現を拡張するための一般的な構文を利用します、まずはそれらをみてみましょう。" -#: ../../howto/regex.rst:887 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " @@ -1852,13 +1954,12 @@ msgid "" "expressions would be assuming that ``&`` was a regular character and " "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -"Perl 5 は標準正規表現にパワフルな拡張を加えたことでよく知られています。それら" -"の新しい機能のために Perl 開発者たちは、Perl正規表現と標準正規表現との混乱を" -"招く違いなしには、新たな一文字メタキャラクタも ``\\`` ではじまる新たな特殊" -"シーケンスもどちらも選択出来ませんでした。たとえば彼らがもし ``&`` を新たなメ" -"タキャラクタとして選んでいたら、 ``&`` が通常文字とみなされていた古い正規表現" -"は ``\\&`` や ``[&]`` のように書くことでエスケープされなければならなかったで" -"しょう。" +"Perl 5 は、標準的な正規表現への強力な拡張でよく知られています。\n" +"新機能のために一文字のメタ文字や ``\\`` で始まる特殊シーケンスを追加すると、" +"標準的な正規表現との違いが混乱を招くため、Perl の開発者はそれらを選べませんで" +"した。\n" +"例えば ``&`` を新しいメタ文字にしたとすると、従来の式では ``&`` を通常の文字" +"として扱っているため、``\\&`` や ``[&]`` としてエスケープしていないはずです。" #: ../../howto/regex.rst:894 msgid "" @@ -1907,7 +2008,6 @@ msgstr "" "出さないグループ: ``(?:...)`` を使います。 ``...`` 部分は任意の正規表現で" "す。 ::" -#: ../../howto/regex.rst:915 msgid "" ">>> m = re.search(\"([abc])+\", \"abc\")\n" ">>> m.groups()\n" @@ -1916,8 +2016,13 @@ msgid "" ">>> m.groups()\n" "()" msgstr "" +">>> m = re.search(\"([abc])+\", \"abc\")\n" +">>> m.groups()\n" +"('c',)\n" +">>> m = re.search(\"(?:[abc])+\", \"abc\")\n" +">>> m.groups()\n" +"()" -#: ../../howto/regex.rst:922 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1929,14 +2034,14 @@ msgid "" "performance difference in searching between capturing and non-capturing " "groups; neither form is any faster than the other." msgstr "" -"マッチしたグループの内容を取得しないということを除けば、取り込まないグループ" -"は厳密に取り込むグループと同様に振る舞います; この中に何を入れてもかまいませ" -"ん、 ``*`` のような繰り返しの特殊文字で繰り返したり、他のグループ (取り込むま" -"たは取り込まない) の入れ子にすることもでいます。 ``(?:...)`` は特に、既にある" -"パターンを変更する際に便利です、なぜなら他の番号づけ新しいグループを変更する" -"ことなく新しいグループを追加することができます。取り込むグループと取り込まな" -"いグループで検索のパフォーマンスに差がないことにも触れておくべきことです; ど" -"ちらも同じ速度で動作します。" +"取り込まないグループは、マッチした内容を取得できない点以外は、取り込むグルー" +"プと同じように動作します。\n" +"中に任意の正規表現を置いたり、``*`` などの特殊文字で繰り返したり、他のグルー" +"プ (取り込むものも取り込まないものも) の中に入れ子にしたりできます。\n" +"``(?:...)`` は既存のパターンを変更するときに特に便利です。\n" +"他のグループの番号を変えずに、新しいグループを追加できます。\n" +"なお、検索時の性能はどちらのグループでも変わらず、片方が速いということはあり" +"ません。" #: ../../howto/regex.rst:931 msgid "" @@ -1965,7 +2070,6 @@ msgstr "" "容しています。名前つきグループにも番号が振られますので、グループについての情" "報を、2つの方法で取り出せます::" -#: ../../howto/regex.rst:942 msgid "" ">>> p = re.compile(r'(?P\\b\\w+\\b)')\n" ">>> m = p.search( '(((( Lots of punctuation )))' )\n" @@ -1974,6 +2078,12 @@ msgid "" ">>> m.group(1)\n" "'Lots'" msgstr "" +">>> p = re.compile(r'(?P\\b\\w+\\b)')\n" +">>> m = p.search( '(((( Lots of punctuation )))' )\n" +">>> m.group('word')\n" +"'Lots'\n" +">>> m.group(1)\n" +"'Lots'" #: ../../howto/regex.rst:949 msgid "" @@ -1983,12 +2093,14 @@ msgstr "" "さらに、名前付きのグループを :meth:`~re.Match.groupdict` を使って辞書として取" "り出すこともできます::" -#: ../../howto/regex.rst:952 msgid "" ">>> m = re.search(r'(?P\\w+) (?P\\w+)', 'Jane Doe')\n" ">>> m.groupdict()\n" "{'first': 'Jane', 'last': 'Doe'}" msgstr "" +">>> m = re.search(r'(?P\\w+) (?P\\w+)', 'Jane Doe')\n" +">>> m.groupdict()\n" +"{'first': 'Jane', 'last': 'Doe'}" #: ../../howto/regex.rst:956 msgid "" @@ -2000,7 +2112,6 @@ msgstr "" "め、便利です。以下は :mod:`imaplib` モジュールで使われている正規表現の例で" "す::" -#: ../../howto/regex.rst:960 msgid "" "InternalDate = re.compile(r'INTERNALDATE \"'\n" " r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-'\n" @@ -2009,6 +2120,12 @@ msgid "" " r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'\n" " r'\"')" msgstr "" +"InternalDate = re.compile(r'INTERNALDATE \"'\n" +" r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-'\n" +" r'(?P[0-9][0-9][0-9][0-9])'\n" +" r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])'\n" +" r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'\n" +" r'\"')" #: ../../howto/regex.rst:967 msgid "" @@ -2035,16 +2152,17 @@ msgstr "" "同じ単語が2つ連なっているのを見つける正規表現 ``\\b(\\w+)\\s+\\1\\b`` は " "``\\b(?P\\w+)\\s+(?P=word)\\b`` のように書けます::" -#: ../../howto/regex.rst:977 msgid "" ">>> p = re.compile(r'\\b(?P\\w+)\\s+(?P=word)\\b')\n" ">>> p.search('Paris in the the spring').group()\n" "'the the'" msgstr "" +">>> p = re.compile(r'\\b(?P\\w+)\\s+(?P=word)\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" -#: ../../howto/regex.rst:983 msgid "Lookahead assertions" -msgstr "" +msgstr "先読みアサーション" #: ../../howto/regex.rst:985 msgid "" @@ -2059,7 +2177,6 @@ msgstr "" msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:989 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -2067,9 +2184,11 @@ msgid "" "tried, the matching engine doesn't advance at all; the rest of the pattern " "is tried right where the assertion started." msgstr "" -"肯定先読みアサーション。 ``...`` で表わす正規表現が現在位置でマッチすれば成功" -"し、それ以外の場合失敗します。しかし、表現が試行された場合でもエンジンは先に" -"進みません; パターンの残りの部分はアサーションの開始時点から右に試行します。" +"肯定先読みアサーションです。\n" +"ここで ``...`` と表している内部の正規表現が現在位置でマッチすれば成功し、それ" +"以外は失敗します。\n" +"内部の正規表現を試してもマッチングエンジンの位置は進みません。\n" +"残りのパターンは、アサーションを開始したのとまったく同じ位置から試されます。" #: ../../howto/regex.rst:995 msgid "``(?!...)``" @@ -2127,22 +2246,22 @@ msgstr "" "さて、問題を少し複雑にしてみましょう; 拡張子が ``bat`` でないファイル名にマッ" "チしたい場合はどうでしょう?間違った試み:" -#: ../../howto/regex.rst:1019 msgid "``.*[.][^b].*$``" -msgstr "" +msgstr "``.*[.][^b].*$``" -#: ../../howto/regex.rst:1021 msgid "" "The first attempt above tries to exclude ``bat`` by requiring that the first " "character of the extension is not a ``b``. This is wrong, because the " "pattern also doesn't match ``foo.bar``." msgstr "" +"最初の試みでは、拡張子の先頭が ``b`` でないことを条件にして ``bat`` を除外し" +"ようとしています。\n" +"しかし、これでは ``foo.bar`` にもマッチしないため、正しくありません。" #: ../../howto/regex.rst:1025 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1027 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -2152,12 +2271,13 @@ msgid "" "with a two-letter extension such as ``sendmail.cf``. We'll complicate the " "pattern again in an effort to fix it." msgstr "" -"正規表現が混乱してきました。最初の解決策を取り繕って、以下の場合に合わせるこ" -"とを要求しています: 拡張子の最初の文字は ``b`` でなく; 二番目の文字は ``a`` " -"でなく; 三番目の文字は ``t`` でない。これは ``foo.bar`` を受け付けますが、 " -"``autoexec.bat`` は拒否します。しかし、三文字の拡張子を要求し、 ``sendmail." -"cf`` のような二文字の拡張子を受け付けません。これを修正するのにパターンを再び" -"複雑にすることになります。" +"最初の試みを修正し、拡張子の最初の文字が ``b`` でない、二文字目が ``a`` でな" +"い、三文字目が ``t`` でない、のいずれかを満たすようにすると、正規表現は複雑に" +"なります。\n" +"これなら ``foo.bar`` を受け入れ、``autoexec.bat`` を除外できます。\n" +"しかし拡張子が三文字であることを要求するため、``sendmail.cf`` のような二文字" +"の拡張子は受け入れられません。\n" +"これを修正すると、パターンはさらに複雑になります。" #: ../../howto/regex.rst:1035 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" @@ -2187,9 +2307,8 @@ msgstr "" msgid "A negative lookahead cuts through all this confusion:" msgstr "否定先読みはこの混乱全てを取り除きます:" -#: ../../howto/regex.rst:1048 msgid "``.*[.](?!bat$)[^.]*$``" -msgstr "" +msgstr "``.*[.](?!bat$)[^.]*$``" #: ../../howto/regex.rst:1050 msgid "" @@ -2215,9 +2334,8 @@ msgstr "" msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1065 msgid "Modifying strings" -msgstr "" +msgstr "文字列の変更" #: ../../howto/regex.rst:1067 msgid "" @@ -2258,11 +2376,9 @@ msgid "" msgstr "" ":meth:`!sub` と同じことをしますが、新しい文字列と置き換えの回数を返します" -#: ../../howto/regex.rst:1087 msgid "Splitting strings" -msgstr "" +msgstr "文字列の分割" -#: ../../howto/regex.rst:1089 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -2271,11 +2387,12 @@ msgid "" "splitting by whitespace or by a fixed string. As you'd expect, there's a " "module-level :func:`re.split` function, too." msgstr "" -":meth:`~re.Match.split` メソッドは文字列を正規表現にマッチした場所で分割し、" -"リストで返却します。文字列の :meth:`~str.split` メソッドに似てはいますが、" -"もっとずっと一般化したデリミタで分割出来ます; 文字列の :meth:`!split` メソッ" -"ドは単に空白文字か固定文字列で分割出来るだけです。ご想像通り、モジュールレベ" -"ルの :func:`re.split` 関数もあります。" +"パターンの :meth:`~re.Pattern.split` メソッドは、正規表現がマッチする箇所で文" +"字列を分割し、各部分のリストを返します。\n" +"文字列の :meth:`~str.split` に似ていますが、区切りの指定にはずっと自由度があ" +"ります。\n" +"文字列の :meth:`!split` は空白か固定文字列でしか分割できません。\n" +"モジュールレベルの :func:`re.split` 関数もあります。" #: ../../howto/regex.rst:1100 msgid "" @@ -2288,7 +2405,6 @@ msgstr "" "されている場合、その内容も結果のリストの一部として返されます。 *maxsplit* が" "非ゼロの場合、最大で *maxsplit* の分割が実行されます。" -#: ../../howto/regex.rst:1105 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -2296,12 +2412,11 @@ msgid "" "the following example, the delimiter is any sequence of non-alphanumeric " "characters. ::" msgstr "" -"*maxsplit* に値を渡すことで、分割される回数を制限することができます。 " -"*maxsplit* が非ゼロの場合、最大で *maxsplit* の分割が行なわれ、文字列の残りが" -"リストの最終要素として返されます。以下の例では、デリミタは任意の英数文字の" -"シーケンスです。 ::" +"*maxsplit* に値を渡すと、分割回数を制限できます。\n" +"*maxsplit* がゼロでなければ最大でその回数だけ分割し、残りの文字列をリストの最" +"後の要素として返します。\n" +"次の例では、英数字以外の文字が連続する部分が区切りになります。 ::" -#: ../../howto/regex.rst:1111 msgid "" ">>> p = re.compile(r'\\W+')\n" ">>> p.split('This is a test, short and sweet, of split().')\n" @@ -2309,6 +2424,11 @@ msgid "" ">>> p.split('This is a test, short and sweet, of split().', 3)\n" "['This', 'is', 'a', 'test, short and sweet, of split().']" msgstr "" +">>> p = re.compile(r'\\W+')\n" +">>> p.split('This is a test, short and sweet, of split().')\n" +"['This', 'is', 'a', 'test', 'short', 'and', 'sweet', 'of', 'split', '']\n" +">>> p.split('This is a test, short and sweet, of split().', 3)\n" +"['This', 'is', 'a', 'test, short and sweet, of split().']" #: ../../howto/regex.rst:1117 msgid "" @@ -2321,7 +2441,6 @@ msgstr "" "知りたい場合はよくあります。取りこみ用の括弧を正規表現に使った場合、その値も" "リストの一部として返されます。以下の呼び出しを比較してみましょう::" -#: ../../howto/regex.rst:1122 msgid "" ">>> p = re.compile(r'\\W+')\n" ">>> p2 = re.compile(r'(\\W+)')\n" @@ -2330,6 +2449,12 @@ msgid "" ">>> p2.split('This... is a test.')\n" "['This', '... ', 'is', ' ', 'a', ' ', 'test', '.', '']" msgstr "" +">>> p = re.compile(r'\\W+')\n" +">>> p2 = re.compile(r'(\\W+)')\n" +">>> p.split('This... is a test.')\n" +"['This', 'is', 'a', 'test', '']\n" +">>> p2.split('This... is a test.')\n" +"['This', '... ', 'is', ' ', 'a', ' ', 'test', '.', '']" #: ../../howto/regex.rst:1129 msgid "" @@ -2339,7 +2464,6 @@ msgstr "" "モジュールレベル関数 :func:`re.split` は最初の引数に利用する正規表現を追加し" "ますが、それ以外は同じです。 ::" -#: ../../howto/regex.rst:1132 msgid "" ">>> re.split(r'[\\W]+', 'Words, words, words.')\n" "['Words', 'words', 'words', '']\n" @@ -2348,32 +2472,35 @@ msgid "" ">>> re.split(r'[\\W]+', 'Words, words, words.', 1)\n" "['Words', 'words, words.']" msgstr "" +">>> re.split(r'[\\W]+', 'Words, words, words.')\n" +"['Words', 'words', 'words', '']\n" +">>> re.split(r'([\\W]+)', 'Words, words, words.')\n" +"['Words', ', ', 'words', ', ', 'words', '.', '']\n" +">>> re.split(r'[\\W]+', 'Words, words, words.', 1)\n" +"['Words', 'words, words.']" -#: ../../howto/regex.rst:1141 msgid "Search and replace" -msgstr "" +msgstr "検索と置換" -#: ../../howto/regex.rst:1143 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " "replacement value, which can be either a string or a function, and the " "string to be processed." msgstr "" -"もう一つのよくある作業は、パターンにマッチする全ての文字列を探し、異なる文字" -"列に置換します。\n" -":meth:`~re.Pattern.sub` メソッドは置換する値をとります、文字列と関数の両方を" -"とることができ、文字列を処理します。" +"パターンにマッチする部分をすべて探し、別の文字列に置き換えることもよくある作" +"業です。\n" +":meth:`~re.Pattern.sub` は、置換する値 (文字列または関数) と、処理対象の文字" +"列を受け取ります。" -#: ../../howto/regex.rst:1150 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -"*string* 内で最も長く、他の部分と重複するところがない正規表現を " -"*replacement* に置換した文字列を返します。パターンが見つからなかった場合 " -"*string* は変更されずに返されます。" +"*string* 内で正規表現にマッチする、互いに重ならない部分を左から順に " +"*replacement* に置き換えた文字列を返します。\n" +"パターンが見つからなければ *string* をそのまま返します。" #: ../../howto/regex.rst:1154 msgid "" @@ -2393,7 +2520,6 @@ msgstr "" "ここに :meth:`~re.Pattern.sub` メソッドを使った単純な例があります。これは色の" "名前を ``colour`` に置換します::" -#: ../../howto/regex.rst:1161 msgid "" ">>> p = re.compile('(blue|white|red)')\n" ">>> p.sub('colour', 'blue socks and red shoes')\n" @@ -2401,6 +2527,11 @@ msgid "" ">>> p.sub('colour', 'blue socks and red shoes', count=1)\n" "'colour socks and red shoes'" msgstr "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.sub('colour', 'blue socks and red shoes')\n" +"'colour socks and colour shoes'\n" +">>> p.sub('colour', 'blue socks and red shoes', count=1)\n" +"'colour socks and red shoes'" #: ../../howto/regex.rst:1167 msgid "" @@ -2411,7 +2542,6 @@ msgstr "" ":meth:`~re.Pattern.subn` メソッドも同じ働きをしますが、新しい文字列と置換の実" "行回数を含む 2-タプルを返します::" -#: ../../howto/regex.rst:1170 msgid "" ">>> p = re.compile('(blue|white|red)')\n" ">>> p.subn('colour', 'blue socks and red shoes')\n" @@ -2419,6 +2549,11 @@ msgid "" ">>> p.subn('colour', 'no colours at all')\n" "('no colours at all', 0)" msgstr "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.subn('colour', 'blue socks and red shoes')\n" +"('colour socks and colour shoes', 2)\n" +">>> p.subn('colour', 'no colours at all')\n" +"('no colours at all', 0)" #: ../../howto/regex.rst:1176 msgid "" @@ -2428,12 +2563,14 @@ msgstr "" "空文字列とのマッチは、直前の空文字列とマッチした部分と隣接していない場合にの" "み置換されます。 ::" -#: ../../howto/regex.rst:1179 msgid "" ">>> p = re.compile('x*')\n" ">>> p.sub('-', 'abxd')\n" "'-a-b--d-'" msgstr "" +">>> p = re.compile('x*')\n" +">>> p.sub('-', 'abxd')\n" +"'-a-b--d-'" #: ../../howto/regex.rst:1183 msgid "" @@ -2460,14 +2597,15 @@ msgstr "" "この例は単語 ``section`` に続く ``{`` と ``}`` で閉じられた文字列にマッチ" "し、 ``section`` を ``subsection`` に変更します::" -#: ../../howto/regex.rst:1193 msgid "" ">>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)\n" ">>> p.sub(r'subsection{\\1}','section{First} section{second}')\n" "'subsection{First} subsection{second}'" msgstr "" +">>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First} section{second}')\n" +"'subsection{First} subsection{second}'" -#: ../../howto/regex.rst:1197 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -2478,15 +2616,15 @@ msgid "" "literal character ``'0'``.) The following substitutions are all equivalent, " "but use all three variations of the replacement string. ::" msgstr "" -"``(?P...)`` 構文で定義された名前つきグループを参照するための構文もあり" -"ます。 ``\\g`` は ``name`` で名前づけされたグループにマッチする文字列を" -"利用し、 ``\\g`` は対応するグループ番号を利用します。つまり " -"``\\g<2>`` は ``\\2`` と等価ですが、 ``\\g<2>0`` のような置換文字列に対しては" -"明確に異なります。 (``\\20`` はグループ番号20への参照と解釈され、グループ2の" -"後にリテラル文字 ``'0'`` が続くとは解釈されません。) 以下に示す置換は全て等価" -"ですが、これらは文字列置換に全部で3種の変種を利用しています。 ::" +"``(?P...)`` で定義した名前付きグループを参照する構文もあります。\n" +"``\\g`` は ``name`` というグループにマッチした部分文字列を使い、" +"``\\g`` はグループ番号で指定します。\n" +"``\\g<2>`` は ``\\2`` と同じですが、``\\g<2>0`` のような置換文字列でも曖昧に" +"なりません。\n" +"``\\20`` は、グループ 2 に文字 ``'0'`` を続けたものではなく、グループ 20 への" +"参照と解釈されます。\n" +"次の三つの置換は、それぞれ異なる書き方で同じ結果を得ます。 ::" -#: ../../howto/regex.rst:1206 msgid "" ">>> p = re.compile('section{ (?P [^}]* ) }', re.VERBOSE)\n" ">>> p.sub(r'subsection{\\1}','section{First}')\n" @@ -2496,6 +2634,13 @@ msgid "" ">>> p.sub(r'subsection{\\g}','section{First}')\n" "'subsection{First}'" msgstr "" +">>> p = re.compile('section{ (?P [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g<1>}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g}','section{First}')\n" +"'subsection{First}'" #: ../../howto/regex.rst:1214 msgid "" @@ -2517,7 +2662,6 @@ msgid "" "hexadecimal::" msgstr "続く例では、置換関数は十進数文字列を十六進数文字列に変換しています::" -#: ../../howto/regex.rst:1223 msgid "" ">>> def hexrepl(match):\n" "... \"Return the hex string for a decimal number\"\n" @@ -2528,6 +2672,14 @@ msgid "" ">>> p.sub(hexrepl, 'Call 65490 for printing, 49152 for user code.')\n" "'Call 0xffd2 for printing, 0xc000 for user code.'" msgstr "" +">>> def hexrepl(match):\n" +"... \"Return the hex string for a decimal number\"\n" +"... value = int(match.group())\n" +"... return hex(value)\n" +"...\n" +">>> p = re.compile(r'\\d+')\n" +">>> p.sub(hexrepl, 'Call 65490 for printing, 49152 for user code.')\n" +"'Call 0xffd2 for printing, 0xc000 for user code.'" #: ../../howto/regex.rst:1232 msgid "" @@ -2544,9 +2696,8 @@ msgstr "" "埋め込んだパターン文字列を使うかしなければいけません、例えば ``sub(\"(?i)b+" "\", \"x\", \"bbbb BBBB\")`` は ``'x x'`` を返します。" -#: ../../howto/regex.rst:1240 msgid "Common problems" -msgstr "" +msgstr "よくある問題" #: ../../howto/regex.rst:1242 msgid "" @@ -2559,11 +2710,9 @@ msgstr "" "振る舞いは直感的ではなく、期待通りに振る舞わないことがあります。この節では最" "もよくある落とし穴を指摘します。" -#: ../../howto/regex.rst:1248 msgid "Use string methods" -msgstr "" +msgstr "文字列メソッドを使う" -#: ../../howto/regex.rst:1250 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -2574,12 +2723,14 @@ msgid "" "for the purpose, instead of the large, more generalized regular expression " "engine." msgstr "" -"いくつかの場合 :mod:`re` モジュールを利用することは間違いである場合がありま" -"す。固定文字列や単一の文字クラスにマッチさせる場合や、 :const:`~re." -"IGNORECASE` フラグのような :mod:`re` の機能を利用しない場合、正規表現の全ての" -"能力は必要とされていなでしょう。文字列は固定文字列に対する操作を実行するメ" -"ソッドを持っていて、大きな汎用化された正規表現エンジンではなく、目的のために" -"最適化された単一の小さな C loop で実装されているため、大抵の場合高速です." +":mod:`re` モジュールを使わない方がよい場合もあります。\n" +"固定文字列や単一の文字クラスに一致するか調べるだけで、:const:`~re." +"IGNORECASE` フラグなどの :mod:`re` の機能を使わないなら、正規表現の機能は必要" +"ないかもしれません。\n" +"文字列には固定文字列を扱うメソッドがいくつかあり、通常はこちらの方がはるかに" +"高速です。\n" +"大きく汎用的な正規表現エンジンではなく、その目的に最適化された、小さな一つの " +"C のループで実装されているためです。" #: ../../howto/regex.rst:1258 msgid "" @@ -2603,7 +2754,6 @@ msgstr "" "``\\bword\\b`` として、 ``word`` の両側に単語の境界が要求されるようにします。" "これは :meth:`!replace` の能力を越えた作業です。)" -#: ../../howto/regex.rst:1267 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -2611,10 +2761,10 @@ msgid "" "capable of doing both tasks and will be faster than any regular expression " "operation can be." msgstr "" -"別のよくある作業は、文字列の中に出現する文字を全て削除することと、別の文字で" -"置換することです。この作業を ``re.sub('\\n', ' ', S)`` のようにして行うかもし" -"れませんが、 :meth:`~str.translate` は削除と置換の両方の作業をこなし、正規表" -"現操作よりも高速に行うことができます。" +"よくある作業には、文字列中の特定の一文字をすべて削除したり、別の一文字に置換" +"したりすることもあります。\n" +"``re.sub('\\n', ' ', S)`` のように書くこともできますが、:meth:`~str." +"translate` は両方の作業ができ、どの正規表現による操作よりも高速です。" #: ../../howto/regex.rst:1273 msgid "" @@ -2624,56 +2774,67 @@ msgstr "" "要は、 :mod:`re` モジュールに向う前に問題が高速で単純な文字列メソッドで解決で" "きるか考えましょうということです。" -#: ../../howto/regex.rst:1280 msgid "prefixmatch() (aka match) versus search()" -msgstr "" +msgstr "prefixmatch() (別名 match) と search() の違い" -#: ../../howto/regex.rst:1282 msgid "" ":func:`~re.prefixmatch` was added in Python 3.15 as the :ref:`preferred name " "` for :func:`~re.match`. Before this, it was only " "known as :func:`!match` and the distinction with :func:`~re.search` was " "often misunderstood." msgstr "" +":func:`~re.prefixmatch` は Python 3.15 で、:func:`~re.match` の :ref:`推奨さ" +"れる名前 ` として追加されました。\n" +"それ以前は :func:`!match` という名前だけだったため、:func:`~re.search` との違" +"いがよく誤解されていました。" -#: ../../howto/regex.rst:1287 msgid "" ":func:`!prefixmatch` aka :func:`!match` only checks if the RE matches at the " "beginning of the string while :func:`!search` scans forward through the " "string for a match. ::" msgstr "" +":func:`!prefixmatch` (別名 :func:`!match`) は文字列の先頭にマッチするかだけを" +"調べます。\n" +"一方 :func:`!search` は文字列を前から走査してマッチを探します。 ::" -#: ../../howto/regex.rst:1291 msgid "" ">>> print(re.prefixmatch('super', 'superstition').span())\n" "(0, 5)\n" ">>> print(re.prefixmatch('super', 'insuperable'))\n" "None" msgstr "" +">>> print(re.prefixmatch('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.prefixmatch('super', 'insuperable'))\n" +"None" -#: ../../howto/regex.rst:1296 msgid "" "On the other hand, :func:`~re.search` scans forward through the string, " "reporting the first match it finds. ::" msgstr "" +"一方 :func:`~re.search` は文字列を前から走査し、最初に見つけたマッチを返しま" +"す。 ::" -#: ../../howto/regex.rst:1299 msgid "" ">>> print(re.search('super', 'superstition').span())\n" "(0, 5)\n" ">>> print(re.search('super', 'insuperable').span())\n" "(2, 7)" msgstr "" +">>> print(re.search('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.search('super', 'insuperable').span())\n" +"(2, 7)" -#: ../../howto/regex.rst:1304 msgid "" "This distinction is important to remember when using the old :func:`~re." "match` name in code requiring compatibility with older Python versions." msgstr "" +"古い Python バージョンとの互換性のために :func:`~re.match` という名前を使う" +"コードでは、この違いを覚えておくことが重要です。" -#: ../../howto/regex.rst:1309 msgid "Greedy versus non-greedy" -msgstr "" +msgstr "貪欲と非貪欲" #: ../../howto/regex.rst:1311 msgid "" @@ -2689,7 +2850,6 @@ msgstr "" "す。単一の HTML タグにマッチする素朴な正規表現はうまく動作しません、なぜなら" "ば ``.*`` は貪欲に動作するからです。 ::" -#: ../../howto/regex.rst:1317 msgid "" ">>> s = 'Title'\n" ">>> len(s)\n" @@ -2699,6 +2859,13 @@ msgid "" ">>> print(re.prefixmatch('<.*>', s).group())\n" "Title" msgstr "" +">>> s = 'Title'\n" +">>> len(s)\n" +"32\n" +">>> print(re.prefixmatch('<.*>', s).span())\n" +"(0, 32)\n" +">>> print(re.prefixmatch('<.*>', s).group())\n" +"Title" #: ../../howto/regex.rst:1325 msgid "" @@ -2732,13 +2899,13 @@ msgstr "" "ら、各ステップで ``'>'`` のマッチを試みます。この動作は正しい結果を生成しま" "す::" -#: ../../howto/regex.rst:1338 msgid "" ">>> print(re.prefixmatch('<.*?>', s).group())\n" "" msgstr "" +">>> print(re.prefixmatch('<.*?>', s).group())\n" +"" -#: ../../howto/regex.rst:1341 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -2747,11 +2914,11 @@ msgid "" "patterns will be *very* complicated. Use an HTML or XML parser module for " "such tasks.)" msgstr "" -"(HTML や XML を正規表現でパースすることは苦痛を伴うものであることは記憶に留め" -"ておいて下さい。素早く、汚いパターンは大抵の場合うまく動作しますが、HTML と " -"XML は正規表現が破綻する特別な例です; 全ての可能な場合にうまく動作する正規表" -"現を書き上げたときには、パターンは *非常に* 複雑なものになります。そのような" -"作業をする場合には HTML や XML パーサを利用しましょう。)" +"HTML や XML を正規表現で解析するのは大変です。\n" +"間に合わせのパターンでも一般的な場合は扱えますが、HTML や XML には、単純な正" +"規表現では対応できない特殊な場合があります。\n" +"すべての場合を扱おうとすると、パターンは *非常に* 複雑になります。\n" +"このような作業には HTML や XML のパーサモジュールを使ってください。" #: ../../howto/regex.rst:1349 msgid "Using re.VERBOSE" @@ -2797,7 +2964,6 @@ msgstr "" "す。三重クォートを利用することで、正規表現をきちんとフォーマットすることがで" "きます::" -#: ../../howto/regex.rst:1368 msgid "" "pat = re.compile(r\"\"\"\n" " \\s* # Skip leading whitespace\n" @@ -2808,26 +2974,37 @@ msgid "" " \\s*$ # Trailing whitespace to end-of-line\n" "\"\"\", re.VERBOSE)" msgstr "" +"pat = re.compile(r\"\"\"\n" +" \\s* # 先頭の空白を読み飛ばす\n" +" (?P
[^:]+) # ヘッダー名\n" +" \\s* : # 空白とコロン\n" +" (?P.*?) # ヘッダーの値。*? を使って\n" +" # 後ろに続く空白を除去する\n" +" \\s*$ # 行末までの空白\n" +"\"\"\", re.VERBOSE)" #: ../../howto/regex.rst:1377 msgid "This is far more readable than::" msgstr "これは下よりはるかに読みやすいです::" -#: ../../howto/regex.rst:1379 msgid "pat = re.compile(r\"\\s*(?P
[^:]+)\\s*:(?P.*?)\\s*$\")" -msgstr "" +msgstr "pat = re.compile(r\"\\s*(?P
[^:]+)\\s*:(?P.*?)\\s*$\")" #: ../../howto/regex.rst:1383 msgid "Feedback" msgstr "フィードバック" -#: ../../howto/regex.rst:1385 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or problems you " "encountered that weren't covered here? If so, please send suggestions for " "improvements to the :ref:`issue tracker `." msgstr "" +"正規表現は複雑な話題です。\n" +"この文書は理解の助けになりましたか?\n" +"不明な点や、ここで扱っていない問題に出会いましたか?\n" +"その場合は :ref:`課題追跡システム ` に改善案をお寄せくださ" +"い。" #: ../../howto/regex.rst:1390 msgid "" diff --git a/howto/remote_debugging.po b/howto/remote_debugging.po index 774ebe39d..5380df35a 100644 --- a/howto/remote_debugging.po +++ b/howto/remote_debugging.po @@ -22,60 +22,61 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/remote_debugging.rst:4 msgid "Remote debugging attachment protocol" -msgstr "" +msgstr "リモートデバッグのアタッチプロトコル" -#: ../../howto/remote_debugging.rst:6 msgid "" "This protocol enables external tools to attach to a running CPython process " "and execute Python code remotely." msgstr "" +"このプロトコルを使うと、外部ツールから実行中の CPython プロセスにアタッチし、" +"Python コードをリモートで実行できます。" -#: ../../howto/remote_debugging.rst:9 msgid "" "Attaching to another Python process may require additional permissions or " "configuration, depending on the platform." msgstr "" +"別の Python プロセスへのアタッチには、プラットフォームによって追加の権限や設" +"定が必要な場合があります。" -#: ../../howto/remote_debugging.rst:13 msgid "Disabling remote debugging" -msgstr "" +msgstr "リモートデバッグの無効化" -#: ../../howto/remote_debugging.rst:15 msgid "To disable remote debugging support, use any of the following:" -msgstr "" +msgstr "リモートデバッグのサポートを無効にするには、次のいずれかを使います。" -#: ../../howto/remote_debugging.rst:17 msgid "" "Set the :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` environment variable to ``1`` " "before starting the interpreter." msgstr "" +"インタープリタを起動する前に、環境変数 :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` " +"を ``1`` に設定します。" -#: ../../howto/remote_debugging.rst:19 msgid "Use the :option:`-X disable-remote-debug` command-line option." msgstr "" +"コマンドラインオプション :option:`-X disable-remote-debug` を使います。" -#: ../../howto/remote_debugging.rst:20 msgid "Compile Python with the :option:`--without-remote-debug` build flag." msgstr "" +"ビルドフラグ :option:`--without-remote-debug` を指定して Python をコンパイル" +"します。" -#: ../../howto/remote_debugging.rst:25 msgid "Permission requirements" -msgstr "" +msgstr "必要な権限" -#: ../../howto/remote_debugging.rst:27 msgid "" "Attaching to a running Python process for remote debugging requires special " "configuration on most platforms. The specific requirements and " "troubleshooting steps depend on your operating system:" msgstr "" +"リモートデバッグのために実行中の Python プロセスにアタッチするには、ほとんど" +"のプラットフォームで特別な設定が必要です。\n" +"具体的な要件と問題の解決手順は、オペレーティングシステムによって異なります。" #: ../../howto/remote_debugging.rst:32 msgid "Linux" msgstr "Linux" -#: ../../howto/remote_debugging.rst:33 msgid "" "In general, you can debug your own processes, but there are several common " "configurations that may disable this. Some Linux distributions enable " @@ -83,32 +84,36 @@ msgid "" "versions of the ``setpriv`` command (util-linux 2.41, released June 2025) " "let you loosen ptrace restrictions on a per-process basis:" msgstr "" +"通常は自分のプロセスをデバッグできますが、よく使われる設定の中にはそれを無効" +"にするものがあります。\n" +"一部の Linux ディストリビューションでは、システムのセキュリティを強化するため" +"に **ptrace の制限** (別名「Yama」) を有効にしています。\n" +"最近の ``setpriv`` コマンド (2025 年 6 月リリースの util-linux 2.41) を使う" +"と、プロセスごとに ptrace の制限を緩められます。" -#: ../../howto/remote_debugging.rst:39 msgid "``setpriv --ptracer any python3``" -msgstr "" +msgstr "``setpriv --ptracer any python3``" -#: ../../howto/remote_debugging.rst:41 msgid "" "(This is configured on the process *being debugged*.) You can also turn off " "ptrace restrictions for all processes until reboot with:" msgstr "" +"(この設定は *デバッグ対象の* プロセスに対して行います。) 次のコマンドで、再起" +"動するまで全プロセスの ptrace の制限を無効にすることもできます。" -#: ../../howto/remote_debugging.rst:44 msgid "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``" -msgstr "" +msgstr "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``" -#: ../../howto/remote_debugging.rst:46 msgid "This can also be configured persistently, usually in ``/etc/sysctl.d``." -msgstr "" +msgstr "通常は ``/etc/sysctl.d`` で、この設定を永続化することもできます。" -#: ../../howto/remote_debugging.rst:50 msgid "" "Disabling ``ptrace_scope`` reduces system hardening and should only be done " "in low-security environments." msgstr "" +"``ptrace_scope`` を無効にするとシステムのセキュリティが弱まるため、安全性の要" +"求が低い環境でのみ行ってください。" -#: ../../howto/remote_debugging.rst:53 msgid "" "It is also possible that the ``ptrace`` system call is disabled because of a " "security filter. In particular, this was common with older versions of some " @@ -120,8 +125,18 @@ msgid "" "disable the system call security filter for that container. This weakens the " "container's isolation and should only be done in low-security environments." msgstr "" +"セキュリティフィルターによって ``ptrace`` システムコールが無効になっている場" +"合もあります。\n" +"特に、一部のコンテナーソフトウェアの古いバージョンではよくあることでした。\n" +"Docker 19.03 以降 (2019 年リリース) と containerd 1.6.7 以降 (2022 年リリー" +"ス) は、Linux カーネル 4.8 以降で実行すると、コンテナー内での ``ptrace`` シス" +"テムコールの使用を自動的に許可します。\n" +"これらのバージョンに更新できない場合は、``--security-opt " +"seccomp=unconfined`` のようなオプションを指定してコンテナーを作成し、そのコン" +"テナーのシステムコール用セキュリティフィルターを無効にできます。\n" +"ただし、コンテナーの隔離が弱まるため、安全性の要求が低い環境でのみ行ってくだ" +"さい。" -#: ../../howto/remote_debugging.rst:63 msgid "" "If you need to trace a process that you *do not* own, you will need " "superuser access or equivalent. This also applies to processes that have " @@ -129,8 +144,12 @@ msgid "" "processes (though this is unusual for Python). Try running the debugging " "command with ``sudo -E``." msgstr "" +"自分が所有して *いない* プロセスをトレースするには、スーパーユーザーまたは同" +"等の権限が必要です。\n" +"これは、set-user-ID や set-group-ID のプロセスなど、セキュリティ資格情報を変" +"更したプロセスにも当てはまります (Python ではまれです)。\n" +"``sudo -E`` を付けてデバッグコマンドを実行してみてください。" -#: ../../howto/remote_debugging.rst:70 msgid "" "The ``CAP_SYS_PTRACE`` capability is equivalent to superuser access, in that " "it allows debugging *any* process, not just your own. You may see advice on " @@ -139,24 +158,32 @@ msgid "" "gives the debugging process much more access than it needs and should only " "be done in low-security environments." msgstr "" +"``CAP_SYS_PTRACE`` ケーパビリティは、自分のプロセスだけでなく *あらゆる* プロ" +"セスをデバッグできる点で、スーパーユーザー権限と同等です。\n" +"インターネット上では、ptrace の制限やシステムコールフィルターを回避するために" +"このケーパビリティを使うよう勧める情報を見かけるかもしれません。\n" +"``sudo`` と同様に実際に機能する場合もありますが、デバッグする側のプロセスに必" +"要以上のアクセス権を与えるため、安全性の要求が低い環境でのみ行ってください。" -#: ../../howto/remote_debugging.rst:77 msgid "" "Finally, note that a process can only have one tracer at a time. If you have " "already attached to a Python process under ``strace``, ``gdb``, etc., you " "won't be able to simultaneously use remote debugging. (Superuser access " "cannot get around this restriction.)" msgstr "" +"最後に、一つのプロセスを同時にトレースできるのは一つのトレーサーだけです。\n" +"``strace`` や ``gdb`` などですでに Python プロセスにアタッチしている場合、同" +"時にリモートデバッグは使えません。\n" +"(スーパーユーザー権限でもこの制限は回避できません。)" #: ../../howto/remote_debugging.rst:83 msgid "macOS" msgstr "macOS" -#: ../../howto/remote_debugging.rst:84 msgid "By default, macOS disables the ability to debug other processes." msgstr "" +"デフォルトでは、macOS は他のプロセスをデバッグする機能を無効にしています。" -#: ../../howto/remote_debugging.rst:86 msgid "" "You can modify your Python binary to opt in to being debugged by giving it " "an **ad-hoc code signature** with an **entitlement** enabling it to be " @@ -164,19 +191,27 @@ msgid "" "actual cryptographic signature or a need for a certificate or anything else " "such as an Apple developer program membership.)" msgstr "" +"Python のバイナリに、デバッグを許可する **エンタイトルメント** を含む **アド" +"ホックコード署名** を付けることで、そのバイナリをデバッグ可能にできます。\n" +"(アドホック「署名」は単なる設定です。\n" +"実際の暗号署名は含まず、証明書や Apple Developer Program への加入なども必要あ" +"りません。)" -#: ../../howto/remote_debugging.rst:92 msgid "" "The following commands will create a file ``get-task-allow.plist`` with the " "necessary entitlement and add it to the Python binary:" msgstr "" +"次のコマンドは、必要なエンタイトルメントを含む ``get-task-allow.plist`` ファ" +"イルを作成し、Python のバイナリに追加します。" -#: ../../howto/remote_debugging.rst:95 msgid "" "echo '{\"com.apple.security.get-task-allow\": true}' | plutil -convert xml1 -" "o get-task-allow.plist -\n" "codesign --sign - --entitlements get-task-allow.plist path/to/bin/python3" msgstr "" +"echo '{\"com.apple.security.get-task-allow\": true}' | plutil -convert xml1 -" +"o get-task-allow.plist -\n" +"codesign --sign - --entitlements get-task-allow.plist path/to/bin/python3" #: ../../howto/remote_debugging.rst:100 msgid "" @@ -187,78 +222,84 @@ msgid "" "differently.)" msgstr "" -#: ../../howto/remote_debugging.rst:105 msgid "" "You should then be able to debug your own Python processes started with that " "binary." msgstr "" +"その後は、そのバイナリで起動した自分の Python プロセスをデバッグできるはずで" +"す。" -#: ../../howto/remote_debugging.rst:108 msgid "" "Alternatively, much as with Linux, processes with superuser privileges e.g. " "``sudo`` are not subject to this check and can debug any user's process on " "the system (though there are additional checks on specific binaries, such as " "OS-provided commands, due to System Integrity Protection)." msgstr "" +"また、Linux と同様に、``sudo`` などのスーパーユーザー権限を持つプロセスはこの" +"検査の対象にならず、システム上のどのユーザーのプロセスもデバッグできます。\n" +"ただし、OS が提供するコマンドなどの特定のバイナリには、システム整合性保護によ" +"る追加の検査があります。" #: ../../howto/remote_debugging.rst:114 msgid "Windows" msgstr "Windows" -#: ../../howto/remote_debugging.rst:115 msgid "" "To attach to another process, you usually need to run your debugging tool " "with administrative privileges. Start the command prompt or terminal as " "Administrator." msgstr "" +"別のプロセスにアタッチするには、通常、管理者権限でデバッグツールを実行する必" +"要があります。\n" +"コマンドプロンプトまたはターミナルを管理者として起動してください。" -#: ../../howto/remote_debugging.rst:119 msgid "" "Some processes may still be inaccessible even with Administrator rights, " "unless you have the ``SeDebugPrivilege`` privilege enabled." msgstr "" +"管理者権限があっても、``SeDebugPrivilege`` 特権を有効にしないとアクセスできな" +"いプロセスもあります。" -#: ../../howto/remote_debugging.rst:122 msgid "" "To resolve file or folder access issues, adjust the security permissions:" msgstr "" +"ファイルやフォルダーへのアクセスの問題を解決するには、セキュリティのアクセス" +"許可を調整します。" -#: ../../howto/remote_debugging.rst:124 msgid "Right-click the file or folder and select **Properties**." -msgstr "" +msgstr "ファイルまたはフォルダーを右クリックし、**プロパティ** を選択します。" -#: ../../howto/remote_debugging.rst:125 msgid "Go to the **Security** tab to view users and groups with access." msgstr "" +"**セキュリティ** タブで、アクセスできるユーザーとグループを確認します。" -#: ../../howto/remote_debugging.rst:126 msgid "Click **Edit** to modify permissions." -msgstr "" +msgstr "**編集** をクリックしてアクセス許可を変更します。" -#: ../../howto/remote_debugging.rst:127 msgid "Select your user account." -msgstr "" +msgstr "自分のユーザーアカウントを選択します。" -#: ../../howto/remote_debugging.rst:128 msgid "In **Permissions**, check **Read** or **Full control** as needed." msgstr "" +"**アクセス許可** で、必要に応じて **読み取り** または **フル コントロール** " +"にチェックを入れます。" -#: ../../howto/remote_debugging.rst:129 msgid "Click **Apply**, then **OK** to confirm." -msgstr "" +msgstr "**適用**、**OK** の順にクリックして確定します。" -#: ../../howto/remote_debugging.rst:134 msgid "" "Ensure you've satisfied all :ref:`permission-requirements` before proceeding." msgstr "" +"先に進む前に、:ref:`permission-requirements` をすべて満たしていることを確認し" +"てください。" -#: ../../howto/remote_debugging.rst:136 msgid "" "This section describes the low-level protocol that enables external tools to " "inject and execute a Python script within a running CPython process." msgstr "" +"この節では、外部ツールから実行中の CPython プロセスに Python スクリプトを注入" +"し、実行するための低水準のプロトコルを説明します。" -#: ../../howto/remote_debugging.rst:139 msgid "" "This mechanism forms the basis of the :func:`sys.remote_exec` function, " "which instructs a remote Python process to execute a ``.py`` file. However, " @@ -268,23 +309,34 @@ msgid "" "file to be executed. This information supports independent reimplementation " "of the protocol, regardless of programming language." msgstr "" +"この仕組みは、リモートの Python プロセスに ``.py`` ファイルの実行を指示する :" +"func:`sys.remote_exec` 関数の基盤です。\n" +"ただし、この節はその関数の使い方を説明するものではありません。\n" +"対象の Python プロセスの ``pid`` と実行する Python ソースファイルのパスを入力" +"として受け取る、基盤となるプロトコルを詳しく説明します。\n" +"ここで説明する情報を使えば、プログラミング言語にかかわらず、このプロトコルを" +"独自に実装できます。" -#: ../../howto/remote_debugging.rst:149 msgid "" "The execution of the injected script depends on the interpreter reaching a " "safe evaluation point. As a result, execution may be delayed depending on " "the runtime state of the target process." msgstr "" +"注入したスクリプトは、インタープリタが安全に評価できる地点に到達してから実行" +"されます。\n" +"そのため、対象プロセスの実行状態によっては、実行が遅れることがあります。" -#: ../../howto/remote_debugging.rst:153 msgid "" "Once injected, the script is executed by the interpreter within the target " "process the next time a safe evaluation point is reached. This approach " "enables remote execution capabilities without modifying the behavior or " "structure of the running Python application." msgstr "" +"スクリプトを注入すると、対象プロセスのインタープリタが次に安全に評価できる地" +"点に到達したときに、そのスクリプトを実行します。\n" +"これにより、実行中の Python アプリケーションの動作や構造を変更せずに、リモー" +"ト実行機能を提供できます。" -#: ../../howto/remote_debugging.rst:158 msgid "" "Subsequent sections provide a step-by-step description of the protocol, " "including techniques for locating interpreter structures in memory, safely " @@ -292,12 +344,15 @@ msgid "" "variations are noted where applicable, and example implementations are " "included to clarify each operation." msgstr "" +"以降の節では、メモリ内でインタープリタの構造体を見つける方法、内部フィールド" +"に安全にアクセスする方法、コードの実行を開始させる方法など、プロトコルの手順" +"を説明します。\n" +"プラットフォームによる違いは該当箇所に記し、各操作を明確にするための実装例も" +"示します。" -#: ../../howto/remote_debugging.rst:165 msgid "Locating the PyRuntime structure" -msgstr "" +msgstr "PyRuntime 構造体の位置の特定" -#: ../../howto/remote_debugging.rst:167 msgid "" "CPython places the ``PyRuntime`` structure in a dedicated binary section to " "help external tools find it at runtime. The name and format of this section " @@ -305,13 +360,22 @@ msgid "" "``__DATA,__PyRuntime`` is used on macOS. Tools can find the offset of this " "structure by examining the binary on disk." msgstr "" +"外部ツールが実行時に見つけやすいように、CPython は ``PyRuntime`` 構造体をバイ" +"ナリ内の専用セクションに配置します。\n" +"このセクションの名前と形式はプラットフォームによって異なります。\n" +"例えば、ELF システムでは ``.PyRuntime``、macOS では ``__DATA,__PyRuntime`` を" +"使います。\n" +"ツールはディスク上のバイナリを調べることで、この構造体のオフセットを見つけら" +"れます。" -#: ../../howto/remote_debugging.rst:173 msgid "" "The ``PyRuntime`` structure contains CPython’s global interpreter state and " "provides access to other internal data, including the list of interpreters, " "thread states, and debugger support fields." msgstr "" +"``PyRuntime`` 構造体には CPython のグローバルなインタープリタの状態が格納され" +"ており、インタープリタのリスト、スレッド状態、デバッガーを支援するフィールド" +"などの内部データにアクセスできます。" #: ../../howto/remote_debugging.rst:177 msgid "" @@ -321,64 +385,67 @@ msgid "" "where the operating system loaded the binary." msgstr "" -#: ../../howto/remote_debugging.rst:182 msgid "" "The method for finding ``PyRuntime`` depends on the platform, but the steps " "are the same in general:" msgstr "" +"``PyRuntime`` の位置を特定する方法はプラットフォームによって異なりますが、大" +"まかな手順は共通です。" -#: ../../howto/remote_debugging.rst:185 msgid "" "Find the base address where the Python binary or shared library was loaded " "in the target process." msgstr "" +"対象プロセスで Python のバイナリまたは共有ライブラリがロードされたベースアド" +"レスを調べます。" -#: ../../howto/remote_debugging.rst:187 msgid "" "Use the on-disk binary to locate the offset of the ``.PyRuntime`` section." msgstr "" +"ディスク上のバイナリを使って ``.PyRuntime`` セクションのオフセットを調べま" +"す。" -#: ../../howto/remote_debugging.rst:188 msgid "" "Add the section offset to the base address to compute the address in memory." msgstr "" +"ベースアドレスにセクションのオフセットを加え、メモリ内のアドレスを求めます。" -#: ../../howto/remote_debugging.rst:190 msgid "" "The sections below explain how to do this on each supported platform and " "include example code." msgstr "" +"以下の節では、サポートされる各プラットフォームでの方法とコード例を示します。" -#: ../../howto/remote_debugging.rst:194 msgid "Linux (ELF)" -msgstr "" +msgstr "Linux (ELF)" -#: ../../howto/remote_debugging.rst:195 msgid "To find the ``PyRuntime`` structure on Linux:" msgstr "" +"Linux で ``PyRuntime`` 構造体の位置を特定するには、次の手順を実行します。" -#: ../../howto/remote_debugging.rst:197 msgid "" "Read the process’s memory map (for example, ``/proc//maps``) to find " "the address where the Python executable or ``libpython`` was loaded." msgstr "" +"プロセスのメモリマップ (例えば ``/proc//maps``) を読み、Python の実行" +"ファイルまたは ``libpython`` がロードされたアドレスを調べます。" -#: ../../howto/remote_debugging.rst:199 msgid "" "Parse the ELF section headers in the binary to get the offset of the ``." "PyRuntime`` section." msgstr "" +"バイナリの ELF セクションヘッダーを解析し、``.PyRuntime`` セクションのオフ" +"セットを取得します。" -#: ../../howto/remote_debugging.rst:201 msgid "" "Add that offset to the base address from step 1 to get the memory address of " "``PyRuntime``." msgstr "" +"手順 1 のベースアドレスにそのオフセットを加え、``PyRuntime`` のメモリアドレス" +"を求めます。" -#: ../../howto/remote_debugging.rst:204 ../../howto/remote_debugging.rst:266 -#: ../../howto/remote_debugging.rst:336 ../../howto/remote_debugging.rst:605 msgid "The following is an example implementation::" -msgstr "" +msgstr "実装例を示します。 ::" #: ../../howto/remote_debugging.rst:206 msgid "" @@ -403,7 +470,6 @@ msgid "" " return base_address + section_offset" msgstr "" -#: ../../howto/remote_debugging.rst:227 msgid "" "On Linux systems, there are two main approaches to read memory from another " "process. The first is through the ``/proc`` filesystem, specifically by " @@ -416,6 +482,16 @@ msgid "" "significantly slower as it only reads one word at a time and requires " "multiple context switches between the tracer and tracee processes." msgstr "" +"Linux では、別のプロセスのメモリを読む主な方法が二つあります。\n" +"一つは ``/proc`` ファイルシステムを使う方法で、具体的にはプロセスのメモリに直" +"接アクセスできる ``/proc/[pid]/mem`` を読みます。\n" +"これには、対象プロセスと同じユーザーであるか root 権限を持つなど、適切な権限" +"が必要です。\n" +"もう一つは、プロセス間でより効率的にメモリをコピーできる " +"``process_vm_readv()`` システムコールを使う方法です。\n" +"ptrace の ``PTRACE_PEEKTEXT`` 操作でもメモリを読めますが、一度に 1 ワードしか" +"読めず、トレースする側とされる側のプロセス間で複数回のコンテキスト切り替えが" +"必要なため、はるかに低速です。" #: ../../howto/remote_debugging.rst:238 msgid "" @@ -430,32 +506,36 @@ msgid "" "memory." msgstr "" -#: ../../howto/remote_debugging.rst:247 msgid "" "You can read more about the ELF file format in the `ELF specification " "`_." msgstr "" +"ELF ファイル形式の詳細は `ELF の仕様 `_ を参照してください。" -#: ../../howto/remote_debugging.rst:252 msgid "macOS (Mach-O)" -msgstr "" +msgstr "macOS (Mach-O)" -#: ../../howto/remote_debugging.rst:253 msgid "To find the ``PyRuntime`` structure on macOS:" msgstr "" +"macOS で ``PyRuntime`` 構造体の位置を特定するには、次の手順を実行します。" -#: ../../howto/remote_debugging.rst:255 msgid "" "Call ``task_for_pid()`` to get the ``mach_port_t`` task port for the target " "process. This handle is needed to read memory using APIs like " "``mach_vm_read_overwrite`` and ``mach_vm_region``." msgstr "" +"``task_for_pid()`` を呼び出し、対象プロセスの ``mach_port_t`` タスクポートを" +"取得します。\n" +"このハンドルは、``mach_vm_read_overwrite`` や ``mach_vm_region`` などの API " +"でメモリを読むために必要です。" -#: ../../howto/remote_debugging.rst:258 msgid "" "Scan the memory regions to find the one containing the Python executable or " "``libpython``." msgstr "" +"メモリ領域を調べ、Python の実行ファイルまたは ``libpython`` を含む領域を探し" +"ます。" #: ../../howto/remote_debugging.rst:260 msgid "" @@ -492,7 +572,6 @@ msgid "" " return base_address + section_offset" msgstr "" -#: ../../howto/remote_debugging.rst:291 msgid "" "On macOS, accessing another process's memory requires using Mach-O specific " "APIs and file formats. The first step is obtaining a ``task_port`` handle " @@ -500,8 +579,13 @@ msgid "" "space. This handle enables memory operations through APIs like " "``mach_vm_read_overwrite()``." msgstr "" +"macOS で別のプロセスのメモリにアクセスするには、Mach-O 固有の API とファイル" +"形式を使います。\n" +"まず、``task_for_pid()`` で ``task_port`` ハンドルを取得し、対象プロセスのメ" +"モリ空間にアクセスできるようにします。\n" +"このハンドルを使うと、``mach_vm_read_overwrite()`` などの API でメモリを操作" +"できます。" -#: ../../howto/remote_debugging.rst:297 msgid "" "The process memory can be examined using ``mach_vm_region()`` to scan " "through the virtual memory space, while ``proc_regionfilename()`` helps " @@ -509,8 +593,13 @@ msgid "" "Python binary or library is found, its Mach-O headers need to be parsed to " "locate the ``PyRuntime`` structure." msgstr "" +"``mach_vm_region()`` で仮想メモリ空間を走査すると、プロセスのメモリを調べられ" +"ます。\n" +"``proc_regionfilename()`` は、各メモリ領域にロードされたバイナリファイルの特" +"定に役立ちます。\n" +"Python のバイナリまたはライブラリを見つけたら、その Mach-O ヘッダーを解析し" +"て ``PyRuntime`` 構造体の位置を特定します。" -#: ../../howto/remote_debugging.rst:302 msgid "" "The Mach-O format organizes code and data into segments and sections. The " "``PyRuntime`` structure lives in a section named ``__PyRuntime`` within the " @@ -520,23 +609,31 @@ msgid "" "address is computed by combining the base address with the appropriate " "section offsets from the Mach-O headers." msgstr "" +"Mach-O 形式では、コードとデータをセグメントとセクションに分けて格納します。\n" +"``PyRuntime`` 構造体は、``__DATA`` セグメント内の ``__PyRuntime`` というセク" +"ションにあります。\n" +"実行時のアドレスを求めるには、バイナリのベースアドレスとなる ``__TEXT`` セグ" +"メントを見つけ、続いて目的のセクションを含む ``__DATA`` セグメントを探しま" +"す。\n" +"ベースアドレスと Mach-O ヘッダーの適切なセクションオフセットを組み合わせて、" +"最終的なアドレスを求めます。" -#: ../../howto/remote_debugging.rst:310 msgid "" "Note that accessing another process's memory on macOS typically requires " "elevated privileges - either root access or special security entitlements " "granted to the debugging process." msgstr "" +"macOS で別のプロセスのメモリにアクセスするには、通常、root 権限やデバッグする" +"側のプロセスに付与された特別なセキュリティエンタイトルメントなど、昇格された" +"権限が必要です。" -#: ../../howto/remote_debugging.rst:316 msgid "Windows (PE)" -msgstr "" +msgstr "Windows (PE)" -#: ../../howto/remote_debugging.rst:317 msgid "To find the ``PyRuntime`` structure on Windows:" msgstr "" +"Windows で ``PyRuntime`` 構造体の位置を特定するには、次の手順を実行します。" -#: ../../howto/remote_debugging.rst:319 msgid "" "Use the ToolHelp API to enumerate all modules loaded in the target process. " "This is done using functions such as `CreateToolhelp32Snapshot `_." msgstr "" +"ToolHelp API を使い、対象プロセスにロードされたすべてのモジュールを列挙しま" +"す。\n" +"これには `CreateToolhelp32Snapshot `_、" +"`Module32First `_、`Module32Next `_ などの関数を使いま" +"す。" -#: ../../howto/remote_debugging.rst:326 msgid "" "Identify the module corresponding to :file:`python.exe` or :file:`python{XY}." "dll`, where ``X`` and ``Y`` are the major and minor version numbers of the " "Python version, and record its base address." msgstr "" +":file:`python.exe` または :file:`python{XY}.dll` に対応するモジュールを特定" +"し、ベースアドレスを記録します。\n" +"``X`` と ``Y`` は Python のメジャーバージョン番号とマイナーバージョン番号で" +"す。" -#: ../../howto/remote_debugging.rst:329 msgid "" "Locate the ``PyRuntim`` section. Due to the PE format's 8-character limit on " "section names (defined as ``IMAGE_SIZEOF_SHORT_NAME``), the original name " "``PyRuntime`` is truncated. This section contains the ``PyRuntime`` " "structure." msgstr "" +"``PyRuntim`` セクションを探します。\n" +"PE 形式のセクション名には 8 文字の制限 (``IMAGE_SIZEOF_SHORT_NAME`` として定" +"義) があるため、元の名前 ``PyRuntime`` は切り詰められます。\n" +"このセクションに ``PyRuntime`` 構造体があります。" -#: ../../howto/remote_debugging.rst:333 msgid "" "Retrieve the section’s relative virtual address (RVA) and add it to the base " "address of the module." msgstr "" +"セクションの相対仮想アドレス (RVA) を取得し、モジュールのベースアドレスに加え" +"ます。" #: ../../howto/remote_debugging.rst:338 msgid "" @@ -592,7 +704,6 @@ msgid "" " return base_address + section_rva" msgstr "" -#: ../../howto/remote_debugging.rst:360 msgid "" "On Windows, accessing another process's memory requires using the Windows " "API functions like ``CreateToolhelp32Snapshot()`` and ``Module32First()/" @@ -600,15 +711,22 @@ msgid "" "provides a handle to access the target process's memory space, enabling " "memory operations through ``ReadProcessMemory()``." msgstr "" +"Windows で別のプロセスのメモリにアクセスするには、" +"``CreateToolhelp32Snapshot()`` や ``Module32First()/Module32Next()`` などの " +"Windows API 関数で、ロードされたモジュールを列挙します。\n" +"``OpenProcess()`` 関数は対象プロセスのメモリ空間にアクセスするためのハンドル" +"を返し、``ReadProcessMemory()`` でメモリを操作できるようにします。" -#: ../../howto/remote_debugging.rst:366 msgid "" "The process memory can be examined by enumerating loaded modules to find the " "Python binary or DLL. When found, its PE headers need to be parsed to locate " "the ``PyRuntime`` structure." msgstr "" +"ロードされたモジュールを列挙して Python のバイナリまたは DLL を探すことで、プ" +"ロセスのメモリを調べられます。\n" +"見つかったら、その PE ヘッダーを解析して ``PyRuntime`` 構造体の位置を特定しま" +"す。" -#: ../../howto/remote_debugging.rst:370 msgid "" "The PE format organizes code and data into sections. The ``PyRuntime`` " "structure lives in a section named \"PyRuntim\" (truncated from " @@ -618,38 +736,48 @@ msgid "" "address is computed by combining the base address with the section's virtual " "address from the PE section headers." msgstr "" +"PE 形式では、コードとデータをセクションに分けて格納します。\n" +"``PyRuntime`` 構造体は「PyRuntim」というセクションにあります (PE の名前の長さ" +"制限が 8 文字なので、「PyRuntime」から切り詰められています)。\n" +"実行時のアドレスを求めるには、モジュールエントリーからモジュールのベースアド" +"レスを調べ、PE ヘッダーで目的のセクションを探します。\n" +"ベースアドレスと PE セクションヘッダーのセクション仮想アドレスを組み合わせ" +"て、最終的なアドレスを求めます。" -#: ../../howto/remote_debugging.rst:377 msgid "" "Note that accessing another process's memory on Windows typically requires " "appropriate privileges - either administrative access or the " "``SeDebugPrivilege`` privilege granted to the debugging process." msgstr "" +"Windows で別のプロセスのメモリにアクセスするには、通常、管理者権限やデバッグ" +"する側のプロセスに付与された ``SeDebugPrivilege`` 特権など、適切な権限が必要" +"です。" -#: ../../howto/remote_debugging.rst:383 msgid "Reading _Py_DebugOffsets" -msgstr "" +msgstr "_Py_DebugOffsets の読み取り" -#: ../../howto/remote_debugging.rst:385 msgid "" "Once the address of the ``PyRuntime`` structure has been determined, the " "next step is to read the ``_Py_DebugOffsets`` structure located at the " "beginning of the ``PyRuntime`` block." msgstr "" +"``PyRuntime`` 構造体のアドレスを特定したら、次は ``PyRuntime`` ブロックの先頭" +"にある ``_Py_DebugOffsets`` 構造体を読み取ります。" -#: ../../howto/remote_debugging.rst:389 msgid "" "This structure provides version-specific field offsets that are needed to " "safely read interpreter and thread state memory. These offsets vary between " "CPython versions and must be checked before use to ensure they are " "compatible." msgstr "" +"この構造体は、インタープリタやスレッド状態のメモリを安全に読み取るために必要" +"な、バージョンごとのフィールドオフセットを提供します。\n" +"オフセットは CPython のバージョンによって異なるため、使用前に互換性を確認する" +"必要があります。" -#: ../../howto/remote_debugging.rst:393 msgid "To read and check the debug offsets, follow these steps:" -msgstr "" +msgstr "デバッグ用オフセットを読み取って検査するには、次の手順を実行します。" -#: ../../howto/remote_debugging.rst:395 msgid "" "Read memory from the target process starting at the ``PyRuntime`` address, " "covering the same number of bytes as the ``_Py_DebugOffsets`` structure. " @@ -657,48 +785,58 @@ msgid "" "block. Its layout is defined in CPython’s internal headers and stays the " "same within a given minor version, but may change in major versions." msgstr "" +"対象プロセスの ``PyRuntime`` アドレスから、``_Py_DebugOffsets`` 構造体のサイ" +"ズと同じバイト数のメモリを読み取ります。\n" +"この構造体は ``PyRuntime`` メモリブロックの先頭にあります。\n" +"そのレイアウトは CPython の内部ヘッダーで定義され、同じマイナーバージョン内で" +"は変わりませんが、メジャーバージョンが変わると変更される可能性があります。" -#: ../../howto/remote_debugging.rst:401 msgid "Check that the structure contains valid data:" -msgstr "" +msgstr "構造体に有効なデータが含まれているか確認します。" -#: ../../howto/remote_debugging.rst:403 msgid "The ``cookie`` field must match the expected debug marker." msgstr "" +"``cookie`` フィールドは、想定するデバッグ用マーカーと一致しなければなりませ" +"ん。" -#: ../../howto/remote_debugging.rst:404 msgid "" "The ``version`` field must match the version of the Python interpreter used " "by the debugger." msgstr "" +"``version`` フィールドは、デバッガーが使う Python インタープリタのバージョン" +"と一致しなければなりません。" -#: ../../howto/remote_debugging.rst:406 msgid "" "If either the debugger or the target process is using a pre-release version " "(for example, an alpha, beta, or release candidate), the versions must match " "exactly." msgstr "" +"デバッガーか対象プロセスのいずれかがプレリリース版 (アルファ版、ベータ版、リ" +"リース候補版など) を使っている場合は、バージョンが完全に一致しなければなりま" +"せん。" -#: ../../howto/remote_debugging.rst:409 msgid "" "The ``free_threaded`` field must have the same value in both the debugger " "and the target process." msgstr "" +"``free_threaded`` フィールドは、デバッガーと対象プロセスの両方で同じ値でなけ" +"ればなりません。" -#: ../../howto/remote_debugging.rst:412 msgid "" "If the structure is valid, the offsets it contains can be used to locate " "fields in memory. If any check fails, the debugger should stop the operation " "to avoid reading memory in the wrong format." msgstr "" +"構造体が有効なら、格納されたオフセットを使ってメモリ内のフィールドの位置を特" +"定できます。\n" +"いずれかの検査に失敗した場合は、誤った形式でメモリを読まないように、デバッ" +"ガーは操作を中止するべきです。" -#: ../../howto/remote_debugging.rst:416 msgid "" "The following is an example implementation that reads and checks " "``_Py_DebugOffsets``::" -msgstr "" +msgstr "``_Py_DebugOffsets`` を読み取って検査する実装例を示します。 ::" -#: ../../howto/remote_debugging.rst:419 msgid "" "def read_debug_offsets(pid: int, py_runtime_addr: int) -> DebugOffsets:\n" " # Step 1: Read memory from the target process at the PyRuntime address\n" @@ -721,12 +859,30 @@ msgid "" "\n" " return debug_offsets" msgstr "" +"def read_debug_offsets(pid: int, py_runtime_addr: int) -> DebugOffsets:\n" +" # 手順 1: 対象プロセスの PyRuntime アドレスからメモリを読む\n" +" data = read_process_memory(\n" +" pid, address=py_runtime_addr, size=DEBUG_OFFSETS_SIZE\n" +" )\n" +"\n" +" # 手順 2: バイト列を _Py_DebugOffsets 構造体に復元する\n" +" debug_offsets = parse_debug_offsets(data)\n" +"\n" +" # 手順 3: 構造体の内容を検証する\n" +" if debug_offsets.cookie != EXPECTED_COOKIE:\n" +" raise RuntimeError(\"Invalid or missing debug cookie\")\n" +" if debug_offsets.version != LOCAL_PYTHON_VERSION:\n" +" raise RuntimeError(\n" +" \"Mismatch between caller and target Python versions\"\n" +" )\n" +" if debug_offsets.free_threaded != LOCAL_FREE_THREADED:\n" +" raise RuntimeError(\"Mismatch in free-threaded configuration\")\n" +"\n" +" return debug_offsets" -#: ../../howto/remote_debugging.rst:444 msgid "**Process suspension recommended**" -msgstr "" +msgstr "**プロセスの一時停止を推奨**" -#: ../../howto/remote_debugging.rst:446 msgid "" "To avoid race conditions and ensure memory consistency, it is strongly " "recommended that the target process be suspended before performing any " @@ -735,15 +891,21 @@ msgid "" "destroying threads—during normal execution. This can result in invalid " "memory reads or writes." msgstr "" +"競合状態を避けてメモリの一貫性を確保するため、インタープリタの内部状態を読み" +"書きする前に、対象プロセスを一時停止することを強く推奨します。\n" +"Python ランタイムは通常の実行中に、スレッドの作成や破棄など、インタープリタの" +"データ構造の変更を並行して行うことがあります。\n" +"その結果、無効なメモリの読み書きが発生する可能性があります。" -#: ../../howto/remote_debugging.rst:453 msgid "" "A debugger may suspend execution by attaching to the process with ``ptrace`` " "or by sending a ``SIGSTOP`` signal. Execution should only be resumed after " "debugger-side memory operations are complete." msgstr "" +"デバッガーは、``ptrace`` でプロセスにアタッチするか、``SIGSTOP`` シグナルを送" +"ることで実行を一時停止できます。\n" +"デバッガー側のメモリ操作が完了してから実行を再開するべきです。" -#: ../../howto/remote_debugging.rst:459 msgid "" "Some tools, such as profilers or sampling-based debuggers, may operate on a " "running process without suspension. In such cases, tools must be explicitly " @@ -751,12 +913,16 @@ msgid "" "debugger implementations, suspending the process remains the safest and most " "robust approach." msgstr "" +"プロファイラーやサンプリング方式のデバッガーなど、一部のツールはプロセスを停" +"止せずに動作する場合があります。\n" +"その場合、更新途中のメモリや一貫性のないメモリを扱えるように、明示的に設計し" +"なければなりません。\n" +"ほとんどのデバッガー実装では、プロセスを一時停止するのが最も安全で堅牢な方法" +"です。" -#: ../../howto/remote_debugging.rst:467 msgid "Locating the interpreter and thread state" -msgstr "" +msgstr "インタープリタとスレッド状態の位置の特定" -#: ../../howto/remote_debugging.rst:469 msgid "" "Before code can be injected and executed in a remote Python process, the " "debugger must choose a thread in which to schedule execution. This is " @@ -765,8 +931,13 @@ msgid "" "in a ``PyThreadState`` object. These fields are modified by the debugger to " "request execution of injected scripts." msgstr "" +"リモートの Python プロセスにコードを注入して実行する前に、デバッガーは実行を" +"予約するスレッドを選ぶ必要があります。\n" +"リモートコードの注入を制御するフィールドが、``PyThreadState`` オブジェクトに" +"埋め込まれた ``_PyRemoteDebuggerSupport`` 構造体にあるためです。\n" +"デバッガーはこれらのフィールドを変更して、注入したスクリプトの実行を要求しま" +"す。" -#: ../../howto/remote_debugging.rst:476 msgid "" "The ``PyThreadState`` structure represents a thread running inside a Python " "interpreter. It maintains the thread’s evaluation context and contains the " @@ -774,73 +945,93 @@ msgid "" "``PyThreadState`` is therefore a key prerequisite for triggering execution " "remotely." msgstr "" +"``PyThreadState`` 構造体は、Python インタープリタ内で実行するスレッドを表しま" +"す。\n" +"スレッドの評価コンテキストを保持し、デバッガーと協調するためのフィールドを含" +"みます。\n" +"そのため、有効な ``PyThreadState`` の位置を特定することが、リモート実行を開始" +"させるための重要な前提条件です。" -#: ../../howto/remote_debugging.rst:481 msgid "" "A thread is typically selected based on its role or ID. In most cases, the " "main thread is used, but some tools may target a specific thread by its " "native thread ID. Once the target thread is chosen, the debugger must locate " "both the interpreter and the associated thread state structures in memory." msgstr "" +"通常は役割や ID に基づいてスレッドを選びます。\n" +"ほとんどの場合はメインスレッドを使いますが、ネイティブスレッド ID で特定のス" +"レッドを指定するツールもあります。\n" +"対象のスレッドを選んだら、デバッガーはインタープリタと対応するスレッド状態の" +"構造体をメモリ内で探さなければなりません。" -#: ../../howto/remote_debugging.rst:486 msgid "The relevant internal structures are defined as follows:" -msgstr "" +msgstr "関連する内部構造体の定義は次のとおりです。" -#: ../../howto/remote_debugging.rst:488 msgid "" "``PyInterpreterState`` represents an isolated Python interpreter instance. " "Each interpreter maintains its own set of imported modules, built-in state, " "and thread state list. Although most Python applications use a single " "interpreter, CPython supports multiple interpreters in the same process." msgstr "" +"``PyInterpreterState`` は、隔離された Python インタープリタのインスタンスを表" +"します。\n" +"各インタープリタは、インポート済みモジュール、組み込みの状態、スレッド状態の" +"リストをそれぞれ保持します。\n" +"ほとんどの Python アプリケーションは一つのインタープリタを使いますが、" +"CPython は同じプロセス内での複数のインタープリタをサポートします。" -#: ../../howto/remote_debugging.rst:493 msgid "" "``PyThreadState`` represents a thread running within an interpreter. It " "contains execution state and the control fields used by the debugger." msgstr "" +"``PyThreadState`` は、インタープリタ内で実行するスレッドを表します。\n" +"実行状態と、デバッガーが使う制御用フィールドを含みます。" -#: ../../howto/remote_debugging.rst:496 msgid "To locate a thread:" -msgstr "" +msgstr "スレッドの位置を特定するには、次の手順を実行します。" -#: ../../howto/remote_debugging.rst:498 msgid "" "Use the offset ``runtime_state.interpreters_head`` to obtain the address of " "the first interpreter in the ``PyRuntime`` structure. This is the entry " "point to the linked list of active interpreters." msgstr "" +"オフセット ``runtime_state.interpreters_head`` を使い、``PyRuntime`` 構造体か" +"ら最初のインタープリタのアドレスを取得します。\n" +"ここが、動作中のインタープリタの連結リストの先頭です。" -#: ../../howto/remote_debugging.rst:502 msgid "" "Use the offset ``interpreter_state.threads_main`` to access the main thread " "state associated with the selected interpreter. This is typically the most " "reliable thread to target." msgstr "" +"オフセット ``interpreter_state.threads_main`` を使い、選んだインタープリタに" +"対応するメインスレッドの状態にアクセスします。\n" +"通常、最も確実に対象にできるのはこのスレッドです。" -#: ../../howto/remote_debugging.rst:506 msgid "" "Optionally, use the offset ``interpreter_state.threads_head`` to iterate " "through the linked list of all thread states. Each ``PyThreadState`` " "structure contains a ``native_thread_id`` field, which may be compared to a " "target thread ID to find a specific thread." msgstr "" +"必要に応じて、オフセット ``interpreter_state.threads_head`` を使って全スレッ" +"ド状態の連結リストをたどります。\n" +"各 ``PyThreadState`` 構造体には ``native_thread_id`` フィールドがあり、目的の" +"スレッド ID と比較して特定のスレッドを探せます。" -#: ../../howto/remote_debugging.rst:511 msgid "" "Once a valid ``PyThreadState`` has been found, its address can be used in " "later steps of the protocol, such as writing debugger control fields and " "scheduling execution." msgstr "" +"有効な ``PyThreadState`` が見つかったら、そのアドレスを、デバッガーの制御用" +"フィールドへの書き込みや実行の予約など、プロトコルの後続の手順で使えます。" -#: ../../howto/remote_debugging.rst:515 msgid "" "The following is an example implementation that locates the main thread " "state::" -msgstr "" +msgstr "メインスレッドの状態の位置を特定する実装例を示します。 ::" -#: ../../howto/remote_debugging.rst:517 msgid "" "def find_main_thread_state(\n" " pid: int, py_runtime_addr: int, debug_offsets: DebugOffsets,\n" @@ -863,14 +1054,32 @@ msgid "" "\n" " return thread_state_addr" msgstr "" +"def find_main_thread_state(\n" +" pid: int, py_runtime_addr: int, debug_offsets: DebugOffsets,\n" +") -> int:\n" +" # 手順 1: PyRuntime から interpreters_head を読む\n" +" interp_head_ptr = (\n" +" py_runtime_addr + debug_offsets.runtime_state.interpreters_head\n" +" )\n" +" interp_addr = read_pointer(pid, interp_head_ptr)\n" +" if interp_addr == 0:\n" +" raise RuntimeError(\"No interpreter found in the target process\")\n" +"\n" +" # 手順 2: インタープリタから threads_main ポインターを読む\n" +" threads_main_ptr = (\n" +" interp_addr + debug_offsets.interpreter_state.threads_main\n" +" )\n" +" thread_state_addr = read_pointer(pid, threads_main_ptr)\n" +" if thread_state_addr == 0:\n" +" raise RuntimeError(\"Main thread state is not available\")\n" +"\n" +" return thread_state_addr" -#: ../../howto/remote_debugging.rst:538 msgid "" "The following example demonstrates how to locate a thread by its native " "thread ID::" -msgstr "" +msgstr "次の例は、ネイティブスレッド ID でスレッドを探す方法を示します。 ::" -#: ../../howto/remote_debugging.rst:541 msgid "" "def find_thread_by_id(\n" " pid: int,\n" @@ -898,19 +1107,43 @@ msgid "" "\n" " raise RuntimeError(\"Thread with the given ID was not found\")" msgstr "" +"def find_thread_by_id(\n" +" pid: int,\n" +" interp_addr: int,\n" +" debug_offsets: DebugOffsets,\n" +" target_tid: int,\n" +") -> int:\n" +" # threads_head から連結リストをたどる\n" +" thread_ptr = read_pointer(\n" +" pid,\n" +" interp_addr + debug_offsets.interpreter_state.threads_head\n" +" )\n" +"\n" +" while thread_ptr:\n" +" native_tid_ptr = (\n" +" thread_ptr + debug_offsets.thread_state.native_thread_id\n" +" )\n" +" native_tid = read_int(pid, native_tid_ptr)\n" +" if native_tid == target_tid:\n" +" return thread_ptr\n" +" thread_ptr = read_pointer(\n" +" pid,\n" +" thread_ptr + debug_offsets.thread_state.next\n" +" )\n" +"\n" +" raise RuntimeError(\"Thread with the given ID was not found\")" -#: ../../howto/remote_debugging.rst:568 msgid "" "Once a valid thread state has been located, the debugger can proceed with " "modifying its control fields and scheduling execution, as described in the " "next section." msgstr "" +"有効なスレッド状態の位置を特定したら、デバッガーは次の節で説明するように、制" +"御用フィールドを変更して実行を予約できます。" -#: ../../howto/remote_debugging.rst:573 msgid "Writing control information" -msgstr "" +msgstr "制御情報の書き込み" -#: ../../howto/remote_debugging.rst:575 msgid "" "Once a valid ``PyThreadState`` structure has been identified, the debugger " "may modify control fields within it to schedule the execution of a specified " @@ -918,56 +1151,69 @@ msgid "" "interpreter, and when set correctly, they trigger the execution of remote " "code at a safe point in the evaluation loop." msgstr "" +"有効な ``PyThreadState`` 構造体を特定したら、デバッガーは内部の制御用フィール" +"ドを変更して、指定した Python スクリプトの実行を予約できます。\n" +"インタープリタはこれらのフィールドを定期的に検査し、正しく設定されていれば、" +"評価ループの安全な地点でリモートコードの実行を開始します。" -#: ../../howto/remote_debugging.rst:581 msgid "" "Each ``PyThreadState`` contains a ``_PyRemoteDebuggerSupport`` structure " "used for communication between the debugger and the interpreter. The " "locations of its fields are defined by the ``_Py_DebugOffsets`` structure " "and include the following:" msgstr "" +"各 ``PyThreadState`` には、デバッガーとインタープリタの通信に使う " +"``_PyRemoteDebuggerSupport`` 構造体があります。\n" +"フィールドの位置は ``_Py_DebugOffsets`` 構造体で定義されており、次のものを含" +"みます。" -#: ../../howto/remote_debugging.rst:586 msgid "" "``debugger_script_path``: A fixed-size buffer that holds the full path to a " "Python source file (``.py``). This file must be accessible and readable by " "the target process when execution is triggered." msgstr "" +"``debugger_script_path``: Python ソースファイル (``.py``) の完全なパスを保持" +"する固定長バッファー。\n" +"実行を開始するとき、対象プロセスがこのファイルにアクセスして読み取れる必要が" +"あります。" -#: ../../howto/remote_debugging.rst:590 msgid "" "``debugger_pending_call``: An integer flag. Setting this to ``1`` tells the " "interpreter that a script is ready to be executed." msgstr "" +"``debugger_pending_call``: 整数のフラグ。\n" +"``1`` に設定すると、スクリプトを実行する準備ができたことをインタープリタに伝" +"えます。" -#: ../../howto/remote_debugging.rst:593 msgid "" "``eval_breaker``: A field checked by the interpreter during execution. " "Setting bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``, value ``1U << 5``) in this " "field causes the interpreter to pause and check for debugger activity." msgstr "" +"``eval_breaker``: 実行中にインタープリタが検査するフィールド。\n" +"このフィールドのビット 5 (``_PY_EVAL_PLEASE_STOP_BIT``、値は ``1U << 5``) を" +"立てると、インタープリタは処理を中断してデバッガーからの操作を確認します。" -#: ../../howto/remote_debugging.rst:597 msgid "" "To complete the injection, the debugger must perform the following steps:" -msgstr "" +msgstr "注入を完了するには、デバッガーは次の手順を実行しなければなりません。" -#: ../../howto/remote_debugging.rst:599 msgid "Write the full script path into the ``debugger_script_path`` buffer." msgstr "" +"スクリプトの完全なパスを ``debugger_script_path`` バッファーに書き込みます。" -#: ../../howto/remote_debugging.rst:600 msgid "Set ``debugger_pending_call`` to ``1``." -msgstr "" +msgstr "``debugger_pending_call`` を ``1`` に設定します。" -#: ../../howto/remote_debugging.rst:601 msgid "" "Read the current value of ``eval_breaker``, set bit 5 " "(``_PY_EVAL_PLEASE_STOP_BIT``), and write the updated value back. This " "signals the interpreter to check for debugger activity." msgstr "" +"``eval_breaker`` の現在の値を読み取り、ビット 5 " +"(``_PY_EVAL_PLEASE_STOP_BIT``) を立て、更新した値を書き戻します。\n" +"これにより、デバッガーからの操作を確認するようインタープリタに通知します。" -#: ../../howto/remote_debugging.rst:607 msgid "" "def inject_script(\n" " pid: int,\n" @@ -1005,21 +1251,59 @@ msgid "" " breaker |= (1 << 5)\n" " write_int(pid, eval_breaker_ptr, breaker)" msgstr "" +"def inject_script(\n" +" pid: int,\n" +" thread_state_addr: int,\n" +" debug_offsets: DebugOffsets,\n" +" script_path: str\n" +") -> None:\n" +" # _PyRemoteDebuggerSupport の先頭のオフセットを求める\n" +" support_base = (\n" +" thread_state_addr +\n" +" debug_offsets.debugger_support.remote_debugger_support\n" +" )\n" +"\n" +" # 手順 1: debugger_script_path にスクリプトのパスを書く\n" +" script_path_ptr = (\n" +" support_base +\n" +" debug_offsets.debugger_support.debugger_script_path\n" +" )\n" +" write_string(pid, script_path_ptr, script_path)\n" +"\n" +" # 手順 2: debugger_pending_call を 1 に設定する\n" +" pending_ptr = (\n" +" support_base +\n" +" debug_offsets.debugger_support.debugger_pending_call\n" +" )\n" +" write_int(pid, pending_ptr, 1)\n" +"\n" +" # 手順 3: eval_breaker の _PY_EVAL_PLEASE_STOP_BIT\n" +" # (ビット 5、値は 1 << 5) を立てる\n" +" eval_breaker_ptr = (\n" +" thread_state_addr +\n" +" debug_offsets.debugger_support.eval_breaker\n" +" )\n" +" breaker = read_int(pid, eval_breaker_ptr)\n" +" breaker |= (1 << 5)\n" +" write_int(pid, eval_breaker_ptr, breaker)" -#: ../../howto/remote_debugging.rst:644 msgid "" "Once these fields are set, the debugger may resume the process (if it was " "suspended). The interpreter will process the request at the next safe " "evaluation point, load the script from disk, and execute it." msgstr "" +"これらのフィールドを設定したら、デバッガーは (プロセスを一時停止していた場合" +"は) 実行を再開できます。\n" +"インタープリタは次に安全に評価できる地点で要求を処理し、ディスクからスクリプ" +"トを読み込んで実行します。" -#: ../../howto/remote_debugging.rst:648 msgid "" "It is the responsibility of the debugger to ensure that the script file " "remains present and accessible to the target process during execution." msgstr "" +"実行中、スクリプトファイルが存在し、対象プロセスからアクセスできる状態を保つ" +"責任はデバッガーにあります。" -#: ../../howto/remote_debugging.rst:653 msgid "" "Script execution is asynchronous. The script file cannot be deleted " "immediately after injection. The debugger should wait until the injected " @@ -1029,52 +1313,55 @@ msgid "" "removing the script. Once such an effect is observed, it is safe to assume " "the file is no longer needed." msgstr "" +"スクリプトは非同期に実行されます。\n" +"注入の直後にスクリプトファイルを削除してはいけません。\n" +"デバッガーは、注入したスクリプトによる作用を観測してからファイルを削除するべ" +"きです。\n" +"何を観測するかは、スクリプトの目的によります。\n" +"例えば、リモートプロセスからソケットへの接続があるまで待ってから、スクリプト" +"を削除する方法があります。\n" +"そのような作用を観測できたら、ファイルは不要になったと判断できます。" -#: ../../howto/remote_debugging.rst:662 msgid "Summary" -msgstr "" +msgstr "まとめ" -#: ../../howto/remote_debugging.rst:664 msgid "To inject and execute a Python script in a remote process:" msgstr "" +"リモートプロセスに Python スクリプトを注入して実行する手順は次のとおりです。" -#: ../../howto/remote_debugging.rst:666 msgid "Locate the ``PyRuntime`` structure in the target process’s memory." -msgstr "" +msgstr "対象プロセスのメモリ内で ``PyRuntime`` 構造体の位置を特定します。" -#: ../../howto/remote_debugging.rst:667 msgid "" "Read and validate the ``_Py_DebugOffsets`` structure at the beginning of " "``PyRuntime``." msgstr "" +"``PyRuntime`` の先頭にある ``_Py_DebugOffsets`` 構造体を読み取り、検証しま" +"す。" -#: ../../howto/remote_debugging.rst:669 msgid "Use the offsets to locate a valid ``PyThreadState``." -msgstr "" +msgstr "オフセットを使って、有効な ``PyThreadState`` の位置を特定します。" -#: ../../howto/remote_debugging.rst:670 msgid "Write the path to a Python script into ``debugger_script_path``." -msgstr "" +msgstr "Python スクリプトのパスを ``debugger_script_path`` に書き込みます。" -#: ../../howto/remote_debugging.rst:671 msgid "Set the ``debugger_pending_call`` flag to ``1``." -msgstr "" +msgstr "``debugger_pending_call`` フラグを ``1`` に設定します。" -#: ../../howto/remote_debugging.rst:672 msgid "Set ``_PY_EVAL_PLEASE_STOP_BIT`` in the ``eval_breaker`` field." msgstr "" +"``eval_breaker`` フィールドの ``_PY_EVAL_PLEASE_STOP_BIT`` を立てます。" -#: ../../howto/remote_debugging.rst:673 msgid "" "Resume the process (if suspended). The script will execute at the next safe " "evaluation point." msgstr "" +"一時停止していた場合はプロセスの実行を再開します。\n" +"スクリプトは、次に安全に評価できる地点で実行されます。" -#: ../../howto/remote_debugging.rst:679 msgid "Security and threat model" -msgstr "" +msgstr "セキュリティと脅威モデル" -#: ../../howto/remote_debugging.rst:681 msgid "" "The remote debugging protocol relies on the same operating system primitives " "used by native debuggers such as GDB and LLDB. Attaching to a process " @@ -1085,16 +1372,24 @@ msgid "" "needed to attach to a process, they could equally use GDB to read memory or " "inject code." msgstr "" +"リモートデバッグのプロトコルは、GDB や LLDB などのネイティブデバッガーと同じ " +"OS の基本機能を使います。\n" +"プロセスへのアタッチには、Linux の ``ptrace`` / Yama LSM、macOS の " +"``task_for_pid``、Windows の ``SeDebugPrivilege`` など、それらのデバッガーと " +"**同じ権限** が必要です。\n" +"Python が新たな権限昇格の経路を導入するわけではありません。\n" +"攻撃者がプロセスへのアタッチに必要な権限をすでに持つ場合、GDB を使ってメモリ" +"を読んだりコードを注入したりすることもできます。" -#: ../../howto/remote_debugging.rst:690 msgid "" "The following principles define what is, and is not, considered a security " "vulnerability in this feature:" msgstr "" +"この機能で何をセキュリティ上の脆弱性とみなすか、また、みなさないかは、次の原" +"則で定義されます。" -#: ../../howto/remote_debugging.rst:693 msgid "Attaching requires OS-level privileges" -msgstr "" +msgstr "アタッチには OS レベルの権限が必要" #: ../../howto/remote_debugging.rst:694 msgid "" @@ -1105,13 +1400,12 @@ msgid "" "OS security boundary was already crossed." msgstr "" -#: ../../howto/remote_debugging.rst:700 msgid "" "Crashes or memory errors when reading a compromised process are not " "vulnerabilities" msgstr "" +"侵害されたプロセスを読み取る際のクラッシュやメモリエラーは脆弱性ではない" -#: ../../howto/remote_debugging.rst:701 msgid "" "A tool that reads internal interpreter state from a target process must " "trust that memory to be well-formed. If the target process has been " @@ -1122,24 +1416,34 @@ msgid "" "reading corrupted state) are **not** treated as security issues, though " "fixes that improve robustness are welcome." msgstr "" +"対象プロセスからインタープリタの内部状態を読むツールは、そのメモリの形式が正" +"しいと信頼する必要があります。\n" +"対象プロセスが破損しているか、攻撃者に制御されている場合、デバッガーやプロ" +"ファイラーがクラッシュしたり、無意味な出力を生成したり、予測できない動作をし" +"たりする可能性があります。\n" +"これは、``ptrace`` に基づくすべてのデバッガーが受け入れているのと同じリスクで" +"す。\n" +"この種類のバグ (破損した状態の読み取りによるバッファーオーバーフロー、セグメ" +"ンテーション違反、未定義動作) は、セキュリティの問題とは **みなしません** " +"が、堅牢性を高める修正は歓迎します。" -#: ../../howto/remote_debugging.rst:710 msgid "Vulnerabilities in the target process are not in scope" -msgstr "" +msgstr "対象プロセスの脆弱性は対象外" -#: ../../howto/remote_debugging.rst:711 msgid "" "If the Python process being debugged has already been compromised, the " "attacker already controls execution in that process. Demonstrating further " "impact from that starting point does not constitute a vulnerability in the " "remote debugging protocol." msgstr "" +"デバッグ対象の Python プロセスがすでに侵害されている場合、攻撃者はそのプロセ" +"ス内の実行をすでに制御しています。\n" +"その状態からさらに影響を与えられることを示しても、リモートデバッグのプロトコ" +"ルの脆弱性にはなりません。" -#: ../../howto/remote_debugging.rst:717 msgid "When to use ``PYTHON_DISABLE_REMOTE_DEBUG``" -msgstr "" +msgstr "``PYTHON_DISABLE_REMOTE_DEBUG`` を使う場面" -#: ../../howto/remote_debugging.rst:719 msgid "" "The environment variable :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` (and the " "equivalent :option:`-X disable-remote-debug` flag) allows operators to " @@ -1149,10 +1453,19 @@ msgid "" "reducing attack surface is a priority, even though the OS-level privilege " "checks already prevent unprivileged access." msgstr "" +"環境変数 :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` (および同等のフラグ :option:`-" +"X disable-remote-debug`) を使うと、運用者は **多層防御** の対策として、プロト" +"コルのプロセス内で動く部分を無効にできます。\n" +"OS レベルの権限検査ですでに権限のないアクセスを防いでいても、プロセスのデバッ" +"グやプロファイリングを想定せず、攻撃対象となる機能を減らすことを優先する環境" +"では役立つことがあります。\n" +"例えば、セキュリティを強化した環境やサンドボックス内への配置が該当します。" -#: ../../howto/remote_debugging.rst:727 msgid "" "Setting this variable does **not** affect other OS-level debugging " "interfaces (``ptrace``, ``/proc``, ``task_for_pid``, etc.), which remain " "available according to their own permission models." msgstr "" +"この変数を設定しても、OS レベルの他のデバッグインターフェース (``ptrace``、" +"``/proc``、``task_for_pid`` など) には影響 **しません**。\n" +"それぞれの権限モデルに従って引き続き利用できます。" diff --git a/howto/sockets.po b/howto/sockets.po index 5b0a8916d..98c528b63 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -69,7 +69,6 @@ msgstr "" "提示しよう。だが、まずはブロッキングソケットから始めることにする。ノンブロッ" "キングを扱うより先に、ブロッキングの仕組みを知っておかなくてはならないのだ。" -#: ../../howto/sockets.rst:28 msgid "" "Part of the trouble with understanding these things is that \"socket\" can " "mean a number of subtly different things, depending on context. So first, " @@ -80,26 +79,27 @@ msgid "" "sockets and \"client\" sockets." msgstr "" "話を理解しにくくしている要因として、「ソケット」という言葉が文脈によって微妙" -"に違うものを指すことが挙げられる。そこでまず、「クライアント」ソケット - 対話" -"の両端 - と「サーバ」ソケット - 電話交換手みたいなもの - の区別を付けておこ" -"う。クライアントアプリケーション (たとえばブラウザ) は「クライアント」ソケッ" -"トだけを使うが、話し相手のウェブサーバは「サーバ」ソケットと「クライアント」" -"ソケットの両方を使う。" +"に違うものを指すことが挙げられる。\n" +"そこでまず、「クライアント」ソケット - 対話の一方の端 - と「サーバ」ソケット " +"- 電話交換手みたいなもの - の区別を付けておこう。\n" +"クライアントアプリケーション (たとえばブラウザ) は「クライアント」ソケットだ" +"けを使うが、話し相手のウェブサーバは「サーバ」ソケットと「クライアント」ソ" +"ケットの両方を使う。" #: ../../howto/sockets.rst:37 msgid "History" msgstr "歴史" -#: ../../howto/sockets.rst:39 msgid "" "Of the various forms of :abbr:`IPC (Inter Process Communication)`, sockets " "are by far the most popular. On any given platform, there are likely to be " "other forms of IPC that are faster, but for cross-platform communication, " "sockets are about the only game in town." msgstr "" -"各種 :abbr:`IPC (Inter Process Communication` (プロセス間通信) の中でも、ソ" -"ケットは群を抜いて人気がある。どのプラットフォームにも、ソケットより速い IPC " -"はあるだろう。だが、プラットフォームをまたぐ通信はソケットの独擅場だ。" +"各種 :abbr:`IPC (Inter Process Communication)` (プロセス間通信) の中でも、ソ" +"ケットは群を抜いて人気がある。\n" +"どのプラットフォームにも、ソケットより速い IPC はあるだろう。\n" +"だが、プラットフォームをまたぐ通信はソケットの独擅場だ。" #: ../../howto/sockets.rst:44 msgid "" @@ -125,13 +125,16 @@ msgstr "" "あなたがリンクをクリックしてこのページに来たとき、ブラウザは大雑把に言って次" "のようなことをしたのである::" -#: ../../howto/sockets.rst:56 msgid "" "# create an INET, STREAMing socket\n" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "# now connect to the web server on port 80 - the normal http port\n" "s.connect((\"www.python.org\", 80))" msgstr "" +"# INET の STREAM ソケットを作る\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# HTTP の通常のポートである 80 番でウェブサーバーに接続する\n" +"s.connect((\"www.python.org\", 80))" #: ../../howto/sockets.rst:61 msgid "" @@ -152,7 +155,6 @@ msgid "" msgstr "" "ウェブサーバで起こる事柄はもう少し複雑だ。まず「サーバソケット」を作る::" -#: ../../howto/sockets.rst:70 msgid "" "# create an INET, STREAMing socket\n" "serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" @@ -161,6 +163,12 @@ msgid "" "# become a server socket\n" "serversocket.listen(5)" msgstr "" +"# INET の STREAM ソケットを作る\n" +"serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# 外部から接続できるホストとウェルノウンポートにソケットをバインドする\n" +"serversocket.bind((socket.gethostname(), 80))\n" +"# サーバーソケットにする\n" +"serversocket.listen(5)" #: ../../howto/sockets.rst:77 msgid "" @@ -206,7 +214,6 @@ msgstr "" "よし、「サーバーソケット」ができて、80 番ポートで耳を澄ましているところまで来" "た。では、ウェブサーバのメインループに入ろう::" -#: ../../howto/sockets.rst:95 msgid "" "while True:\n" " # accept connections from outside\n" @@ -216,6 +223,13 @@ msgid "" " ct = make_client_thread(clientsocket)\n" " ct.start()" msgstr "" +"while True:\n" +" # 外部からの接続を受け付ける\n" +" (clientsocket, address) = serversocket.accept()\n" +" # clientsocket を使って処理する\n" +" # ここではスレッドを使うサーバーだとする\n" +" ct = make_client_thread(clientsocket)\n" +" ct.start()" #: ../../howto/sockets.rst:103 msgid "" @@ -274,7 +288,6 @@ msgstr "" msgid "Using a Socket" msgstr "ソケットの利用" -#: ../../howto/sockets.rst:133 msgid "" "The first thing to note, is that the web browser's \"client\" socket and the " "web server's \"client\" socket are identical beasts. That is, this is a " @@ -285,11 +298,13 @@ msgid "" "rule of sockets." msgstr "" "はじめに憶えておくべきなのは、ウェブブラウザの「クライアント」ソケットとウェ" -"ブサーバの「クライアント」ソケットがまったく同じ種族だということだ。つまり、" -"これは「ピア・トゥ・ピア」(1 対 1) の会話である。別の言い方をすると、 *設計者" -"として自分で会話のエチケット規則を決めなくてはいけない* ということでもある。" -"通常は、 ``connect`` してくるソケットが要求あるいは宣言をして会話を始める。だ" -"が、それはそう設計しただけのことだ - ソケットの規則ではない。" +"ブサーバの「クライアント」ソケットがまったく同じ種族だということだ。\n" +"つまり、これは「ピア・トゥ・ピア」(対等な相手同士) の会話である。\n" +"別の言い方をすると、 *設計者として自分で会話のエチケット規則を決めなくてはい" +"けない* ということでもある。\n" +"通常は、 ``connect`` してくるソケットが要求やログイン情報を送って会話を始め" +"る。\n" +"だが、それはそう設計しただけのことだ - ソケットの規則ではない。" #: ../../howto/sockets.rst:140 msgid "" @@ -382,7 +397,6 @@ msgstr "" "毎回接続を終わらせるのはイヤだとして、最も単純な解決策は固定長メッセージだろ" "う::" -#: ../../howto/sockets.rst:180 msgid "" "class MySocket:\n" " \"\"\"demonstration class only\n" @@ -418,6 +432,39 @@ msgid "" " bytes_recd = bytes_recd + len(chunk)\n" " return b''.join(chunks)" msgstr "" +"class MySocket:\n" +" \"\"\"説明用のクラス\n" +" - 効率よりも分かりやすさを優先したコード\n" +" \"\"\"\n" +"\n" +" def __init__(self, sock=None):\n" +" if sock is None:\n" +" self.sock = socket.socket(\n" +" socket.AF_INET, socket.SOCK_STREAM)\n" +" else:\n" +" self.sock = sock\n" +"\n" +" def connect(self, host, port):\n" +" self.sock.connect((host, port))\n" +"\n" +" def mysend(self, msg):\n" +" totalsent = 0\n" +" while totalsent < MSGLEN:\n" +" sent = self.sock.send(msg[totalsent:])\n" +" if sent == 0:\n" +" raise RuntimeError(\"socket connection broken\")\n" +" totalsent = totalsent + sent\n" +"\n" +" def myreceive(self):\n" +" chunks = []\n" +" bytes_recd = 0\n" +" while bytes_recd < MSGLEN:\n" +" chunk = self.sock.recv(min(MSGLEN - bytes_recd, 2048))\n" +" if chunk == b'':\n" +" raise RuntimeError(\"socket connection broken\")\n" +" chunks.append(chunk)\n" +" bytes_recd = bytes_recd + len(chunk)\n" +" return b''.join(chunks)" #: ../../howto/sockets.rst:214 msgid "" @@ -497,7 +544,6 @@ msgstr "" msgid "Binary Data" msgstr "バイナリデータ" -#: ../../howto/sockets.rst:251 msgid "" "It is perfectly possible to send binary data over a socket. The major " "problem is that not all machines use the same formats for binary data. For " @@ -508,8 +554,15 @@ msgid "" "little-endian, with the least significant byte first - that same ``1`` would " "be ``01 00``." msgstr "" +"ソケットでバイナリデータを送ることはもちろん可能だ。\n" +"大きな問題は、すべてのマシンが同じバイナリデータ形式を使うわけではないこと" +"だ。\n" +"例えば、`ネットワークバイトオーダー `_ は最上位バイトを先頭に置くビッグエンディアンなので、" +"値が ``1`` の 16 ビット整数は 16 進数で ``00 01`` という 2 バイトになる。\n" +"一方、一般的なプロセッサーのほとんど (x86/AMD64、ARM、RISC-V) は最下位バイト" +"を先頭に置くリトルエンディアンで、同じ ``1`` が ``01 00`` になる。" -#: ../../howto/sockets.rst:259 msgid "" "Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, " "htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, " @@ -517,6 +570,12 @@ msgid "" "order, these do nothing, but where the machine is byte-reversed, these swap " "the bytes around appropriately." msgstr "" +"ソケットライブラリには、16 ビットと 32 ビットの整数を変換する関数 ``ntohl, " +"htonl, ntohs, htons`` がある。\n" +"「n」は *network*、「h」は *host*、「s」は *short*、「l」は *long* を意味す" +"る。\n" +"ネットワークとホストのバイト順が同じなら何もしないが、逆のバイト順を使うマシ" +"ンでは適切にバイトを入れ替える。" #: ../../howto/sockets.rst:265 msgid "" @@ -586,7 +645,6 @@ msgstr "" msgid "When Sockets Die" msgstr "ソケットが死ぬと" -#: ../../howto/sockets.rst:301 msgid "" "Probably the worst thing about using blocking sockets is what happens when " "the other side comes down hard (without doing a ``close``). Your socket is " @@ -600,32 +658,36 @@ msgid "" "automatic recycling of resources. In other words, if you do manage to kill " "the thread, your whole process is likely to be screwed up." msgstr "" -"ブロッキングソケットを使っていて一番いやなのは多分、相手側が意地悪く " -"(``close`` せずに) ダウンするときに起こる事柄だ。自分側のソケットは高確率でハ" -"ングするだろう。TCP は信頼性の高いプロトコルなので、ずっとずっと待ち続けて、" -"なかなか見捨てないのだ。スレッドを使っているのであれば、そのスレッド全体が根" -"本から死んだ状態になる。こうなると、もう手の施しようがない。まあ、ブロッキン" -"グ読み出しの間ロックし続けるといった馬鹿げたことをしていない限り、リソースの" -"点ではたいして消費にならない。だから *ぜったいに* そのスレッドを殺そうとして" -"はいけない - プロセスよりスレッドが効率的である理由のひとつは、自動リソース回" -"収にまつわるオーバヘッドを避けられるという点にあるのだ。つまり別の言い方をす" -"ると、どうにかしてそのスレッドを殺したなら、プロセス全体がぐちゃぐちゃになっ" -"てしまうだろうということだ。" +"ブロッキングソケットを使っていて一番いやなのは多分、相手側が突然 (``close`` " +"せずに) ダウンするときに起こる事柄だ。\n" +"自分側のソケットは高確率でハングするだろう。\n" +"TCP は信頼性の高いプロトコルなので、ずっとずっと待ち続けて、なかなか見捨てな" +"いのだ。\n" +"スレッドを使っているのであれば、そのスレッド全体が根本から死んだ状態にな" +"る。\n" +"こうなると、もう手の施しようがない。\n" +"まあ、ブロッキング読み出しの間ロックし続けるといった馬鹿げたことをしていない" +"限り、リソースの点ではたいして消費にならない。\n" +"だから *ぜったいに* そのスレッドを殺そうとしてはいけない - プロセスよりスレッ" +"ドが効率的である理由のひとつは、自動リソース回収にまつわるオーバヘッドを避け" +"られるという点にあるのだ。\n" +"つまり別の言い方をすると、どうにかしてそのスレッドを殺したなら、プロセス全体" +"がぐちゃぐちゃになってしまうだろうということだ。" #: ../../howto/sockets.rst:315 msgid "Non-blocking Sockets" msgstr "ノンブロッキングソケット" -#: ../../howto/sockets.rst:317 msgid "" "If you've understood the preceding, you already know most of what you need " "to know about the mechanics of using sockets. You'll still use the same " "calls, in much the same ways. It's just that, if you do it right, your app " "will be almost inside-out." msgstr "" -"ここまで理解してきたなら、もうソケットの仕組みについて必要なことはほとんど" -"知っていることになる。これからも同じコールを、ほぼ同じように使っていくだけ、" -"それだけだ。これをちゃんとやっていれば、そのアプリはだいたい完璧であろう。" +"ここまで理解できたなら、ソケットを使う仕組みについて必要なことはほとんど分" +"かっている。\n" +"使う関数も、その使い方も、これまでとほぼ同じだ。\n" +"ただし、適切に実装すると、アプリケーションの構成はほとんど裏返しになる。" #: ../../howto/sockets.rst:322 msgid "" @@ -672,7 +734,6 @@ msgstr "" "い。しかし Python で ``select`` を理解しておけば C でもほとんど問題なく書け" "る、という程度には似ている::" -#: ../../howto/sockets.rst:342 msgid "" "ready_to_read, ready_to_write, in_error = \\\n" " select.select(\n" @@ -681,6 +742,12 @@ msgid "" " potential_errs,\n" " timeout)" msgstr "" +"ready_to_read, ready_to_write, in_error = \\\n" +" select.select(\n" +" potential_readers,\n" +" potential_writers,\n" +" potential_errs,\n" +" timeout)" #: ../../howto/sockets.rst:349 msgid "" diff --git a/howto/sorting.po b/howto/sorting.po index 9f2886add..c5a998451 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -55,11 +55,12 @@ msgstr "" "単純な昇順のソートはとても簡単です: :func:`sorted` 関数を呼ぶだけです。そうす" "れば、新たにソートされたリストが返されます::" -#: ../../howto/sorting.rst:19 msgid "" ">>> sorted([5, 2, 3, 1, 4])\n" "[1, 2, 3, 4, 5]" msgstr "" +">>> sorted([5, 2, 3, 1, 4])\n" +"[1, 2, 3, 4, 5]" #: ../../howto/sorting.rst:24 msgid "" @@ -73,13 +74,16 @@ msgstr "" "します)。多くの場合、こちらの方法は :func:`sorted` と比べると不便です - ただ" "し、元々のリストが不要な場合には、わずかですがより効率的です。" -#: ../../howto/sorting.rst:29 msgid "" ">>> a = [5, 2, 3, 1, 4]\n" ">>> a.sort()\n" ">>> a\n" "[1, 2, 3, 4, 5]" msgstr "" +">>> a = [5, 2, 3, 1, 4]\n" +">>> a.sort()\n" +">>> a\n" +"[1, 2, 3, 4, 5]" #: ../../howto/sorting.rst:36 msgid "" @@ -89,35 +93,41 @@ msgstr "" "違いは他にもあります、 :meth:`list.sort` メソッドはリストにのみ定義されていま" "す。一方 :func:`sorted` 関数は任意のイテラブルを受け付けます。" -#: ../../howto/sorting.rst:39 msgid "" ">>> sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})\n" "[1, 2, 3, 4, 5]" msgstr "" +">>> sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})\n" +"[1, 2, 3, 4, 5]" #: ../../howto/sorting.rst:45 msgid "Key Functions" msgstr "Key 関数" -#: ../../howto/sorting.rst:47 msgid "" "The :meth:`list.sort` method and the functions :func:`sorted`, :func:`min`, :" "func:`max`, :func:`heapq.nsmallest`, and :func:`heapq.nlargest` have a *key* " "parameter to specify a function (or other callable) to be called on each " "list element prior to making comparisons." msgstr "" +":meth:`list.sort` メソッドと :func:`sorted`、:func:`min`、:func:`max`、:func:" +"`heapq.nsmallest`、:func:`heapq.nlargest` 関数には、比較の前にリストの各要素" +"に対して呼び出す関数 (または他の呼び出し可能オブジェクト) を指定する ``key`` " +"パラメーターがあります。" -#: ../../howto/sorting.rst:53 msgid "" "For example, here's a case-insensitive string comparison using :meth:`str." "casefold`:" msgstr "" +"例えば、:meth:`str.casefold` を使うと、大文字と小文字を区別せずに文字列を比較" +"できます。" -#: ../../howto/sorting.rst:56 msgid "" ">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n" "['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']" msgstr "" +">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n" +"['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']" #: ../../howto/sorting.rst:61 msgid "" @@ -131,15 +141,14 @@ msgstr "" "りソートを高速に行えます、キー関数は各入力レコードに対してきっちり一回だけ呼" "び出されるからです。" -#: ../../howto/sorting.rst:66 msgid "" "A common pattern is to sort complex objects using some of the object's " "indices as keys. For example:" msgstr "" -"よくある利用パターンはいくつかの要素から成る対象をインデクスのどれかをキーと" -"してソートすることです。例えば:" +"よくある使い方は、複数の要素を持つオブジェクトからインデックスで取り出した値" +"をキーにしてソートすることです。\n" +"例を示します。" -#: ../../howto/sorting.rst:69 msgid "" ">>> student_tuples = [\n" "... ('john', 'A', 15),\n" @@ -149,6 +158,13 @@ msgid "" ">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> student_tuples = [\n" +"... ('john', 'A', 15),\n" +"... ('jane', 'B', 12),\n" +"... ('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_tuples, key=lambda student: student[2]) # 年齢でソート\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" #: ../../howto/sorting.rst:79 msgid "" @@ -157,7 +173,6 @@ msgstr "" "同じテクニックは名前づけされた属性 (named attributes) を使うことでオブジェク" "トに対しても動作します。例えば:" -#: ../../howto/sorting.rst:81 msgid "" ">>> class Student:\n" "... def __init__(self, name, grade, age):\n" @@ -176,6 +191,22 @@ msgid "" "age\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> class Student:\n" +"... def __init__(self, name, grade, age):\n" +"... self.name = name\n" +"... self.grade = grade\n" +"... self.age = age\n" +"... def __repr__(self):\n" +"... return repr((self.name, self.grade, self.age))\n" +"\n" +">>> student_objects = [\n" +"... Student('john', 'A', 15),\n" +"... Student('jane', 'B', 12),\n" +"... Student('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_objects, key=lambda student: student.age) # 年齢でソー" +"ト\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" #: ../../howto/sorting.rst:99 msgid "" @@ -207,7 +238,6 @@ msgstr "" msgid "Using those functions, the above examples become simpler and faster:" msgstr "これらの関数を利用すると、上の例はもっと簡単で高速になります:" -#: ../../howto/sorting.rst:113 msgid "" ">>> from operator import itemgetter, attrgetter\n" "\n" @@ -217,16 +247,22 @@ msgid "" ">>> sorted(student_objects, key=attrgetter('age'))\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> from operator import itemgetter, attrgetter\n" +"\n" +">>> sorted(student_tuples, key=itemgetter(2))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -#: ../../howto/sorting.rst:123 msgid "" "The operator module functions allow multiple levels of sorting. For example, " "to sort by *grade* then by *age*:" msgstr "" -"operator モジュールの関数は複数の段階でのソートを可能にします。例えば、 " -"*grade* でソートしてさらに *age* でソートする場合:" +"operator モジュールの関数では、複数のキーに優先順位を付けてソートできます。\n" +"例えば、まず *grade* で比較し、同じ場合は *age* で比較するには、次のようにし" +"ます。" -#: ../../howto/sorting.rst:126 msgid "" ">>> sorted(student_tuples, key=itemgetter(1,2))\n" "[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]\n" @@ -234,6 +270,11 @@ msgid "" ">>> sorted(student_objects, key=attrgetter('grade', 'age'))\n" "[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]" msgstr "" +">>> sorted(student_tuples, key=itemgetter(1,2))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('grade', 'age'))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]" #: ../../howto/sorting.rst:134 msgid "" @@ -246,7 +287,6 @@ msgstr "" "す。:func:`~functools.partial` 関数は複数引数の関数の `アリティ `_ を減らし、キー関数に適したものにできます。" -#: ../../howto/sorting.rst:139 msgid "" ">>> from functools import partial\n" ">>> from unicodedata import normalize\n" @@ -259,6 +299,16 @@ msgid "" ">>> sorted(names, key=partial(normalize, 'NFC'))\n" "['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']" msgstr "" +">>> from functools import partial\n" +">>> from unicodedata import normalize\n" +"\n" +">>> names = 'Zoë Åbjørn Núñez Élana Zeke Abe Nubia Eloise'.split()\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFD'))\n" +"['Abe', 'Åbjørn', 'Eloise', 'Élana', 'Nubia', 'Núñez', 'Zeke', 'Zoë']\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFC'))\n" +"['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']" #: ../../howto/sorting.rst:153 msgid "Ascending and Descending" @@ -274,7 +324,6 @@ msgstr "" "として受け付けます。このパラメータは降順ソートを行うかどうかの フラグとして利" "用されます。 例えば、学生のデータを *age* の逆順で得たい場合:" -#: ../../howto/sorting.rst:159 msgid "" ">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n" "[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]\n" @@ -282,6 +331,11 @@ msgid "" ">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n" "[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" msgstr "" +">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" #: ../../howto/sorting.rst:168 msgid "Sort Stability and Complex Sorts" @@ -297,12 +351,14 @@ msgstr "" "Sorting_algorithm#Stability>`_ であることが保証されています。これはレコードの" "中に同じキーがある場合、元々の順序が維持されるということを意味します。" -#: ../../howto/sorting.rst:174 msgid "" ">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" ">>> sorted(data, key=itemgetter(0))\n" "[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]" msgstr "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> sorted(data, key=itemgetter(0))\n" +"[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]" #: ../../howto/sorting.rst:180 msgid "" @@ -312,17 +368,15 @@ msgstr "" "二つの *blue* のレコードが元々の順序を維持して、 ``('blue', 1)`` が " "``('blue', 2)`` の前にあることに注意してください。" -#: ../../howto/sorting.rst:183 msgid "" "This wonderful property lets you build complex sorts in a series of sorting " "steps. For example, to sort the student data by descending *grade* and then " "ascending *age*, do the *age* sort first and then sort again using *grade*:" msgstr "" -"この素晴しい性質によって複数のソートを段階的に組み合わせることができます。例" -"えば、学生データを *grade* の降順にソートし、さらに *age* の昇順にソートした" -"い場合には、まず *age* でソートし、次に *grade* でもう一度ソートします:" +"この性質を使うと、複数回のソートを組み合わせて複雑な順序で並べられます。\n" +"例えば、学生のデータを *grade* の降順に並べ、同じ成績の中では *age* の昇順に" +"並べるには、先に *age* でソートしてから *grade* でもう一度ソートします。" -#: ../../howto/sorting.rst:187 msgid "" ">>> s = sorted(student_objects, key=attrgetter('age')) # sort on " "secondary key\n" @@ -330,6 +384,11 @@ msgid "" "primary key, descending\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> s = sorted(student_objects, key=attrgetter('age')) # 第 2 キーでソー" +"ト\n" +">>> sorted(s, key=attrgetter('grade'), reverse=True) # 次に第 1 キーの" +"降順でソート\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" #: ../../howto/sorting.rst:193 msgid "" @@ -339,7 +398,6 @@ msgstr "" "この処理は、リストおよびフィールド名とソート順序のタプルを複数受け取れるラッ" "パー関数へ抽象化できます。" -#: ../../howto/sorting.rst:196 msgid "" ">>> def multisort(xs, specs):\n" "... for key, reverse in reversed(specs):\n" @@ -349,6 +407,13 @@ msgid "" ">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> def multisort(xs, specs):\n" +"... for key, reverse in reversed(specs):\n" +"... xs.sort(key=attrgetter(key), reverse=reverse)\n" +"... return xs\n" +"\n" +">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" #: ../../howto/sorting.rst:206 msgid "" @@ -394,7 +459,6 @@ msgid "" "For example, to sort the student data by *grade* using the DSU approach:" msgstr "例えば、DSU アプローチを利用して学生データを *grade* でソートする場合:" -#: ../../howto/sorting.rst:224 msgid "" ">>> decorated = [(student.grade, i, student) for i, student in " "enumerate(student_objects)]\n" @@ -402,15 +466,20 @@ msgid "" ">>> [student for grade, i, student in decorated] # undecorate\n" "[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" msgstr "" +">>> decorated = [(student.grade, i, student) for i, student in " +"enumerate(student_objects)]\n" +">>> decorated.sort()\n" +">>> [student for grade, i, student in decorated] # デコレートを" +"取り除く\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" -#: ../../howto/sorting.rst:231 msgid "" "This idiom works because tuples are compared lexicographically; the first " "items are compared; if they are the same then the second items are compared, " "and so on." msgstr "" -"このイディオムはタブルが辞書編集的に比較されるため正しく動作します; 最初の要" -"素が比較され、同じ場合には第二の要素が比較され、以下も同様に動きます。" +"このイディオムが機能するのは、タプルが辞書式順序で比較されるためです。\n" +"最初の要素を比較し、同じなら二番目の要素を比較する、というように進みます。" #: ../../howto/sorting.rst:235 msgid "" @@ -428,34 +497,33 @@ msgstr "" "ソートが安定になります -- もし二つの要素が同じキーを持つ場合、それらの順序が" "ソートされたリストでも維持されます。" -#: ../../howto/sorting.rst:241 msgid "" "The original items do not have to be comparable because the ordering of the " "decorated tuples will be determined by at most the first two items. So for " "example the original list could contain complex numbers which cannot be " "sorted directly." msgstr "" -"元々の要素が比較可能な要素を持つとは限りません、なぜならデコレートされたタブ" -"ルの順序は多くの場合、最初の二つの要素で決定されるからです。例として元のリス" -"トは直接比較できない複素数を含むことができます。" +"デコレートしたタプルの順序は、最大でも最初の二つの要素を比較すれば決まるた" +"め、元の要素は比較可能である必要がありません。\n" +"例えば、元のリストに、そのままではソートできない複素数を含めることもできま" +"す。" -#: ../../howto/sorting.rst:246 msgid "" "Another name for this idiom is `Schwartzian transform `_\\, after Randal L. Schwartz, who " "popularized it among Perl programmers." msgstr "" -"このイディオムの別名に `Schwartzian transform `_ があります。これは Perl プログラマの間で有名な " -"Randal L. Schwartz にちなんでいます。" +"このイディオムは `Schwartzian transform `_ とも呼ばれます。\n" +"Perl プログラマーの間にこの手法を広めた Randal L. Schwartz にちなんだ名前で" +"す。" -#: ../../howto/sorting.rst:250 msgid "" "Now that Python sorting provides key-functions, this technique is not often " "needed." msgstr "" -"いまや Python のソートは key 関数による方法を提供しているので、このテクニック" -"は不要でしょう。" +"現在の Python のソートではキー関数を使えるため、このテクニックが必要になるこ" +"とはあまりありません。" #: ../../howto/sorting.rst:253 msgid "Comparison Functions" @@ -494,50 +562,48 @@ msgstr "" "数を目にすることがよくあります。また、その API の一部として比較関数を提供して" "いるライブラリもあります。例えば、 :func:`locale.strcoll` は比較関数です。" -#: ../../howto/sorting.rst:269 msgid "" "To accommodate those situations, Python provides :class:`functools." "cmp_to_key` to wrap the comparison function to make it usable as a key " "function::" msgstr "" "このような場合に対処するため、Python は比較関数をラップしてキー関数として使え" -"るようにする関数 :class:`functools.cmp_to_key` を提供しています。" +"るようにする関数 :class:`functools.cmp_to_key` を提供しています。 ::" -#: ../../howto/sorting.rst:273 msgid "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order" -msgstr "" +msgstr "sorted(words, key=cmp_to_key(strcoll)) # ロケールに応じたソート順" -#: ../../howto/sorting.rst:276 msgid "Strategies For Unorderable Types and Values" -msgstr "" +msgstr "順序を比較できない型や値への対処" -#: ../../howto/sorting.rst:278 msgid "" "A number of type and value issues can arise when sorting. Here are some " "strategies that can help:" msgstr "" +"ソートでは、型や値に関する問題が起こる場合があります。\n" +"役に立つ対処方法をいくつか紹介します。" -#: ../../howto/sorting.rst:281 msgid "Convert non-comparable input types to strings prior to sorting:" -msgstr "" +msgstr "比較できない型の入力は、ソートの前に文字列に変換します。" -#: ../../howto/sorting.rst:283 msgid "" ">>> data = ['twelve', '11', 10]\n" ">>> sorted(map(str, data))\n" "['10', '11', 'twelve']" msgstr "" +">>> data = ['twelve', '11', 10]\n" +">>> sorted(map(str, data))\n" +"['10', '11', 'twelve']" -#: ../../howto/sorting.rst:289 msgid "" "This is needed because most cross-type comparisons raise a :exc:`TypeError`." msgstr "" +"型が異なる値を比較すると、多くの場合 :exc:`TypeError` が送出されるため、この" +"変換が必要です。" -#: ../../howto/sorting.rst:292 msgid "Remove special values prior to sorting:" -msgstr "" +msgstr "ソートの前に特殊な値を取り除きます。" -#: ../../howto/sorting.rst:294 msgid "" ">>> from math import isnan\n" ">>> from itertools import filterfalse\n" @@ -545,62 +611,74 @@ msgid "" ">>> sorted(filterfalse(isnan, data))\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> from math import isnan\n" +">>> from itertools import filterfalse\n" +">>> data = [3.3, float('nan'), 1.1, 2.2]\n" +">>> sorted(filterfalse(isnan, data))\n" +"[1.1, 2.2, 3.3]" -#: ../../howto/sorting.rst:302 msgid "" "This is needed because the `IEEE-754 standard `_ specifies that, \"Every NaN shall compare unordered with " "everything, including itself.\"" msgstr "" +"`IEEE-754 規格 `_ は「すべての NaN " +"は、自分自身を含むあらゆる値との比較で順序付け不能となる」と定めているため、" +"この処理が必要です。" -#: ../../howto/sorting.rst:306 msgid "Likewise, ``None`` can be stripped from datasets as well:" -msgstr "" +msgstr "同様に、データから ``None`` を取り除くこともできます。" -#: ../../howto/sorting.rst:308 msgid "" ">>> data = [3.3, None, 1.1, 2.2]\n" ">>> sorted(x for x in data if x is not None)\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> data = [3.3, None, 1.1, 2.2]\n" +">>> sorted(x for x in data if x is not None)\n" +"[1.1, 2.2, 3.3]" -#: ../../howto/sorting.rst:314 msgid "This is needed because ``None`` is not comparable to other types." -msgstr "" +msgstr "``None`` と他の型の値では順序を比較できないため、この処理が必要です。" -#: ../../howto/sorting.rst:316 msgid "Convert mapping types into sorted item lists before sorting:" -msgstr "" +msgstr "マッピング型は、ソートの前にソート済みの要素のリストに変換します。" -#: ../../howto/sorting.rst:318 msgid "" ">>> data = [{'a': 1}, {'b': 2}]\n" ">>> sorted(data, key=lambda d: sorted(d.items()))\n" "[{'a': 1}, {'b': 2}]" msgstr "" +">>> data = [{'a': 1}, {'b': 2}]\n" +">>> sorted(data, key=lambda d: sorted(d.items()))\n" +"[{'a': 1}, {'b': 2}]" -#: ../../howto/sorting.rst:324 msgid "" "This is needed because dict-to-dict comparisons raise a :exc:`TypeError`." msgstr "" +"辞書同士の順序を比較すると :exc:`TypeError` が送出されるため、この変換が必要" +"です。" -#: ../../howto/sorting.rst:327 msgid "Convert set types into sorted lists before sorting:" -msgstr "" +msgstr "集合型は、ソートの前にソート済みのリストに変換します。" -#: ../../howto/sorting.rst:329 msgid "" ">>> data = [{'a', 'b', 'c'}, {'b', 'c', 'd'}]\n" ">>> sorted(map(sorted, data))\n" "[['a', 'b', 'c'], ['b', 'c', 'd']]" msgstr "" +">>> data = [{'a', 'b', 'c'}, {'b', 'c', 'd'}]\n" +">>> sorted(map(sorted, data))\n" +"[['a', 'b', 'c'], ['b', 'c', 'd']]" -#: ../../howto/sorting.rst:335 msgid "" "This is needed because the elements contained in set types do not have a " "deterministic order. For example, ``list({'a', 'b'})`` may produce either " "``['a', 'b']`` or ``['b', 'a']``." msgstr "" +"集合型に含まれる要素には決まった順序がないため、この変換が必要です。\n" +"例えば、``list({'a', 'b'})`` の結果は ``['a', 'b']`` にも ``['b', 'a']`` にも" +"なり得ます。" #: ../../howto/sorting.rst:340 msgid "Odds and Ends" @@ -629,7 +707,6 @@ msgstr "" "しい場合元々の順序が維持されます)。面白いことにこの影響はパラメータ無しで :" "func:`reversed` 関数を二回使うことで模倣することができます:" -#: ../../howto/sorting.rst:352 msgid "" ">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" ">>> standard_way = sorted(data, key=itemgetter(0), reverse=True)\n" @@ -639,6 +716,13 @@ msgid "" ">>> standard_way\n" "[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]" msgstr "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> standard_way = sorted(data, key=itemgetter(0), reverse=True)\n" +">>> double_reversed = list(reversed(sorted(reversed(data), " +"key=itemgetter(0))))\n" +">>> assert standard_way == double_reversed\n" +">>> standard_way\n" +"[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]" #: ../../howto/sorting.rst:361 msgid "" @@ -650,14 +734,15 @@ msgstr "" "ラスに標準のソート順序を追加することは :meth:`~object.__lt__` メソッドを定義" "することで達成できます。" -#: ../../howto/sorting.rst:365 msgid "" ">>> Student.__lt__ = lambda self, other: self.age < other.age\n" ">>> sorted(student_objects)\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> Student.__lt__ = lambda self, other: self.age < other.age\n" +">>> sorted(student_objects)\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -#: ../../howto/sorting.rst:371 msgid "" "However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" "meth:`~object.__lt__` is not implemented (see :func:`object.__lt__` for " @@ -665,6 +750,13 @@ msgid "" "six comparison methods be implemented. The :deco:`~functools.total_ordering` " "decorator is provided to make that task easier." msgstr "" +"ただし、:meth:`~object.__lt__` が実装されていない場合、``<`` は代わりに :" +"meth:`~object.__gt__` を使うことがあります (仕組みの詳細は :func:`object." +"__lt__` を参照)。\n" +"予想外の動作を避けるため、:pep:`8` は六つの比較メソッドをすべて実装するよう推" +"奨しています。\n" +"この作業を簡単にするために、:deco:`~functools.total_ordering` デコレーターが" +"提供されています。" #: ../../howto/sorting.rst:378 msgid "" @@ -677,13 +769,16 @@ msgstr "" "ソースにアクセスすることもできます。例えば学生の成績が辞書に保存されている場" "合、それを利用して別の学生の名前のリストをソートすることができます:" -#: ../../howto/sorting.rst:383 msgid "" ">>> students = ['dave', 'john', 'jane']\n" ">>> newgrades = {'john': 'F', 'jane':'A', 'dave': 'C'}\n" ">>> sorted(students, key=newgrades.__getitem__)\n" "['jane', 'dave', 'john']" msgstr "" +">>> students = ['dave', 'john', 'jane']\n" +">>> newgrades = {'john': 'F', 'jane':'A', 'dave': 'C'}\n" +">>> sorted(students, key=newgrades.__getitem__)\n" +"['jane', 'dave', 'john']" #: ../../howto/sorting.rst:391 msgid "Partial Sorts" diff --git a/howto/timerfd.po b/howto/timerfd.po index a432326f9..9983fff3d 100644 --- a/howto/timerfd.po +++ b/howto/timerfd.po @@ -22,34 +22,33 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/timerfd.rst:5 msgid "timer file descriptor HOWTO" -msgstr "" +msgstr "タイマーファイル記述子 HOWTO" #: ../../howto/timerfd.rst:0 msgid "Release" msgstr "リリース" -#: ../../howto/timerfd.rst:7 msgid "1.13" -msgstr "" +msgstr "1.13" -#: ../../howto/timerfd.rst:9 msgid "" "This HOWTO discusses Python's support for the linux timer file descriptor." msgstr "" +"この HOWTO では、Linux のタイマーファイル記述子を Python で使う方法を説明しま" +"す。" #: ../../howto/timerfd.rst:13 msgid "Examples" msgstr "使用例" -#: ../../howto/timerfd.rst:15 msgid "" "The following example shows how to use a timer file descriptor to execute a " "function twice a second:" msgstr "" +"次の例は、タイマーファイル記述子を使って 1 秒に 2 回関数を実行する方法を示し" +"ます。" -#: ../../howto/timerfd.rst:18 msgid "" "# Practical scripts should use really use a non-blocking timer,\n" "# we use a blocking timer here for simplicity.\n" @@ -71,21 +70,43 @@ msgid "" " # Remember to close the timer file descriptor!\n" " os.close(fd)" msgstr "" +"# 実用的なスクリプトではノンブロッキングのタイマーを使うべきだが、\n" +"# ここでは簡単にするためブロッキングのタイマーを使う。\n" +"import os, time\n" +"\n" +"# タイマーファイル記述子を作成する\n" +"fd = os.timerfd_create(time.CLOCK_REALTIME)\n" +"\n" +"# 1 秒後に初回の満了を迎え、その後は 0.5 秒間隔とする\n" +"os.timerfd_settime(fd, initial=1, interval=0.5)\n" +"\n" +"try:\n" +" # タイマーのイベントを 4 回処理する。\n" +" for _ in range(4):\n" +" # タイマーが満了するまで read() はブロックする\n" +" _ = os.read(fd, 8)\n" +" print(\"Timer expired\")\n" +"finally:\n" +" # 忘れずにタイマーファイル記述子を閉じる。\n" +" os.close(fd)" -#: ../../howto/timerfd.rst:40 msgid "" "To avoid the precision loss caused by the :class:`float` type, timer file " "descriptors allow specifying initial expiration and interval in integer " "nanoseconds with ``_ns`` variants of the functions." msgstr "" +":class:`float` 型による精度の低下を避けるため、タイマーファイル記述子の関数に" +"は ``_ns`` 版が用意されています。\n" +"これらを使うと、最初にタイマーが満了するまでの時間と間隔を、整数のナノ秒単位" +"で指定できます。" -#: ../../howto/timerfd.rst:44 msgid "" "This example shows how :func:`~select.epoll` can be used with timer file " "descriptors to wait until the file descriptor is ready for reading:" msgstr "" +"この例は、タイマーファイル記述子と :func:`~select.epoll` を組み合わせ、ファイ" +"ル記述子が読み取り可能になるまで待つ方法を示します。" -#: ../../howto/timerfd.rst:47 msgid "" "import os, time, select, socket, sys\n" "\n" @@ -202,12 +223,124 @@ msgid "" " os.close(fd)\n" " ep.close()" msgstr "" +"import os, time, select, socket, sys\n" +"\n" +"# epoll オブジェクトを作成する\n" +"ep = select.epoll()\n" +"\n" +"# この例ではループバックアドレスでサーバーに \"stop\" コマンドを送る。\n" +"#\n" +"# $ telnet 127.0.0.1 1234\n" +"# Trying 127.0.0.1...\n" +"# Connected to 127.0.0.1.\n" +"# Escape character is '^]'.\n" +"# stop\n" +"# Connection closed by foreign host.\n" +"#\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"sock.bind((\"127.0.0.1\", 1234))\n" +"sock.setblocking(False)\n" +"sock.listen(1)\n" +"ep.register(sock, select.EPOLLIN)\n" +"\n" +"# ノンブロッキングモードでタイマーファイル記述子を作成する。\n" +"num = 3\n" +"fds = []\n" +"for _ in range(num):\n" +" fd = os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" +" fds.append(fd)\n" +" # タイマーファイル記述子を読み取りイベント用に登録する\n" +" ep.register(fd, select.EPOLLIN)\n" +"\n" +"# os.timerfd_settime_ns() でナノ秒単位の時間を指定してタイマーを開始する。\n" +"# タイマー 1 は 0.25 秒間隔、タイマー 2 は 0.5 秒間隔、以下も同様。\n" +"for i, fd in enumerate(fds, start=1):\n" +" one_sec_in_nsec = 10**9\n" +" i = i * one_sec_in_nsec\n" +" os.timerfd_settime_ns(fd, initial=i//4, interval=i//4)\n" +"\n" +"timeout = 3\n" +"try:\n" +" conn = None\n" +" is_active = True\n" +" while is_active:\n" +" # タイマーの満了を最大 3 秒待つ。\n" +" # epoll.poll() は (fd, event) のペアのリストを返す。\n" +" # fd はファイル記述子。\n" +" # sock と conn [socket.accept() の戻り値] はファイル記述子ではなくソ" +"ケットオブジェクト。\n" +" # そのため、ファイル記述子は sock.fileno() と conn.fileno() で取得す" +"る。\n" +" events = ep.poll(timeout)\n" +"\n" +" # 複数のタイマーファイル記述子が同時に読み取り可能になった場合、\n" +" # epoll.poll() は (fd, event) のペアのリストを返す。\n" +" #\n" +" # この例の設定では、\n" +" # 第 1 タイマーは 0.25 秒後から 0.25 秒間隔で満了する。(0.25, " +"0.5, 0.75, 1.0, ...)\n" +" # 第 2 タイマーは 0.5 秒後から 0.5 秒間隔。(0.5, 1.0, 1.5, " +"2.0, ...)\n" +" # 第 3 タイマーは 0.75 秒後から 0.75 秒間隔。(0.75, 1.5, 2.25, " +"3.0, ...)\n" +" #\n" +" # 0.25 秒後には第 1 タイマーだけが満了する。\n" +" # 0.5 秒後には第 1 タイマーと第 2 タイマーが同時に満了する。\n" +" # 0.75 秒後には第 1 タイマーと第 3 タイマーが同時に満了する。\n" +" # 1.5 秒後には第 1、第 2、第 3 タイマーが同時に満了する。\n" +" #\n" +" # タイマーファイル記述子が前回の os.read() の呼び出し以降に\n" +" # 複数回通知された場合、os.read() は通知回数を\n" +" # ホストのバイト順の bytes オブジェクトとして返す。\n" +" print(f\"Signaled events={events}\")\n" +" for fd, event in events:\n" +" if event & select.EPOLLIN:\n" +" if fd == sock.fileno():\n" +" # 接続要求があるか確認する。\n" +" print(f\"Accepting connection {fd}\")\n" +" conn, addr = sock.accept()\n" +" conn.setblocking(False)\n" +" print(f\"Accepted connection {conn} from {addr}\")\n" +" ep.register(conn, select.EPOLLIN)\n" +" elif conn and fd == conn.fileno():\n" +" # 読み取るデータがあるか確認する。\n" +" print(f\"Reading data {fd}\")\n" +" data = conn.recv(1024)\n" +" if data:\n" +" # 安全のため、UnicodeDecodeError 例外を捕捉するべ" +"き。\n" +" cmd = data.decode()\n" +" if cmd.startswith(\"stop\"):\n" +" print(f\"Stopping server\")\n" +" is_active = False\n" +" else:\n" +" print(f\"Unknown command: {cmd}\")\n" +" else:\n" +" # これ以上データがないので接続を閉じる\n" +" print(f\"Closing connection {fd}\")\n" +" ep.unregister(conn)\n" +" conn.close()\n" +" conn = None\n" +" elif fd in fds:\n" +" print(f\"Reading timer {fd}\")\n" +" count = int.from_bytes(os.read(fd, 8), byteorder=sys." +"byteorder)\n" +" print(f\"Timer {fds.index(fd) + 1} expired {count} " +"times\")\n" +" else:\n" +" print(f\"Unknown file descriptor {fd}\")\n" +"finally:\n" +" for fd in fds:\n" +" ep.unregister(fd)\n" +" os.close(fd)\n" +" ep.close()" -#: ../../howto/timerfd.rst:153 msgid "" "This example shows how :func:`~select.select` can be used with timer file " "descriptors to wait until the file descriptor is ready for reading:" msgstr "" +"この例は、タイマーファイル記述子と :func:`~select.select` を組み合わせ、ファ" +"イル記述子が読み取り可能になるまで待つ方法を示します。" #: ../../howto/timerfd.rst:156 msgid "" diff --git a/howto/unicode.po b/howto/unicode.po index 1232aa8fb..b73f35fd0 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -92,7 +92,6 @@ msgstr "" "例えば、「ローマ数字の 1」という文字 'Ⅰ' は大文字の 'I' とは別の文字です。\n" "両者は通常は同じに見えますが、異なる意味を持つ別々の2つの文字です。" -#: ../../howto/unicode.rst:40 msgid "" "The Unicode standard describes how characters are represented by **code " "points**. A code point value is an integer in the range 0 to 0x10FFFF " @@ -101,6 +100,12 @@ msgid "" "this document, a code point is written using the notation ``U+265E`` to mean " "the character with value ``0x265e`` (9,822 in decimal)." msgstr "" +"Unicode 標準は、文字を **コードポイント** で表す方法を定めています。\n" +"コードポイントの値は 0 から 0x10FFFF までの整数です (約 110 万個の値があり、`" +"実際に割り当てられた数 `_ " +"はそれより少なくなっています)。\n" +"標準とこの文書では、``U+265E`` という表記で、値が ``0x265e`` (10 進数では " +"9,822) の文字を表します。" #: ../../howto/unicode.rst:48 msgid "" @@ -110,7 +115,6 @@ msgstr "" "Unicode 標準は、文字とそれに対応するコードポイントを列挙した多くの表を含んで" "います:" -#: ../../howto/unicode.rst:51 msgid "" "0061 'a'; LATIN SMALL LETTER A\n" "0062 'b'; LATIN SMALL LETTER B\n" @@ -128,6 +132,21 @@ msgid "" "1F609 '😉'; WINKING FACE\n" "..." msgstr "" +"0061 'a'; LATIN SMALL LETTER A\n" +"0062 'b'; LATIN SMALL LETTER B\n" +"0063 'c'; LATIN SMALL LETTER C\n" +"...\n" +"007B '{'; LEFT CURLY BRACKET\n" +"...\n" +"2167 'Ⅷ'; ROMAN NUMERAL EIGHT\n" +"2168 'Ⅸ'; ROMAN NUMERAL NINE\n" +"...\n" +"265E '♞'; BLACK CHESS KNIGHT\n" +"265F '♟'; BLACK CHESS PAWN\n" +"...\n" +"1F600 '😀'; GRINNING FACE\n" +"1F609 '😉'; WINKING FACE\n" +"..." #: ../../howto/unicode.rst:69 msgid "" @@ -179,19 +198,23 @@ msgstr "" "訳する規則を **文字エンコーディング** または単に **エンコーディング** と呼び" "ます。" -#: ../../howto/unicode.rst:95 msgid "" "The first encoding you might think of is using 32-bit integers as the code " "unit, and then using the CPU's representation of 32-bit integers. In this " "representation, the string \"Python\" might look like this:" msgstr "" +"最初に思い付くエンコーディングは、32 ビット整数をコードユニットとし、CPU の " +"32 ビット整数表現を使う方法かもしれません。\n" +"この方法では、文字列 \"Python\" は例えば次のように表されます。" -#: ../../howto/unicode.rst:99 msgid "" " P y t h o n\n" "0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00\n" " 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" msgstr "" +" P y t h o n\n" +"0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00\n" +" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" #: ../../howto/unicode.rst:105 msgid "" @@ -232,13 +255,13 @@ msgstr "" "``strlen()`` のような現存する C 関数と互換性がありません、そのためワイド文字" "列関数一式が新たに必要となります。" -#: ../../howto/unicode.rst:121 msgid "" "Therefore this encoding isn't used very much, and people instead choose " "other encodings that are more efficient and convenient, such as UTF-8." msgstr "" +"そのため、このエンコーディングはあまり使われず、代わりに UTF-8 のような、より" +"効率的で便利なエンコーディングが選ばれます。" -#: ../../howto/unicode.rst:124 msgid "" "UTF-8 is one of the most commonly used encodings, and Python often defaults " "to using it. UTF stands for \"Unicode Transformation Format\", and the '8' " @@ -246,6 +269,13 @@ msgid "" "and UTF-32 encodings, but they are less frequently used than UTF-8.) UTF-8 " "uses the following rules:" msgstr "" +"UTF-8 は最も広く使われるエンコーディングの一つで、Python でもデフォルトとして" +"よく使われます。\n" +"UTF は \"Unicode Transformation Format\" の略で、「8」はエンコーディングに 8 " +"ビットの値を使うことを意味します。\n" +"(UTF-16 や UTF-32 というエンコーディングもありますが、UTF-8 ほど頻繁には使わ" +"れません。)\n" +"UTF-8 は次の規則に従います。" #: ../../howto/unicode.rst:130 msgid "" @@ -268,7 +298,6 @@ msgstr "UTF-8 はいくつかの便利な性質を持っています:" msgid "It can handle any Unicode code point." msgstr "任意の Unicode コードポイントを扱うことができる。" -#: ../../howto/unicode.rst:137 msgid "" "A Unicode string is turned into a sequence of bytes that contains embedded " "zero bytes only where they represent the null character (U+0000). This means " @@ -276,6 +305,10 @@ msgid "" "sent through protocols that can't handle zero bytes for anything other than " "end-of-string markers." msgstr "" +"Unicode 文字列をバイト列に変換したとき、値がゼロのバイトが含まれるのは、それ" +"がヌル文字 (U+0000) を表す場合だけです。\n" +"そのため、UTF-8 文字列は ``strcpy()`` などの C 関数で処理でき、文字列の終端以" +"外ではゼロのバイトを扱えないプロトコルでも送信できます。" #: ../../howto/unicode.rst:142 msgid "A string of ASCII text is also valid UTF-8 text." @@ -299,7 +332,6 @@ msgstr "" "の開始を決定し、再同期することができる可能性があります。同様の理由でランダム" "な 8-bit データは正当な UTF-8 とみなされにくくなっています。" -#: ../../howto/unicode.rst:148 msgid "" "UTF-8 is a byte oriented encoding. The encoding specifies that each " "character is represented by a specific sequence of one or more bytes. This " @@ -307,6 +339,12 @@ msgid "" "oriented encodings, like UTF-16 and UTF-32, where the sequence of bytes " "varies depending on the hardware on which the string was encoded." msgstr "" +"UTF-8 はバイト単位のエンコーディングです。\n" +"各文字を、決まった 1 バイト以上の並びで表すように定めています。\n" +"そのため、整数やワード単位のエンコーディングで生じ得るバイト順の問題を避けら" +"れます。\n" +"例えば UTF-16 や UTF-32 では、文字列をエンコードしたハードウェアによってバイ" +"トの並びが変わります。" #: ../../howto/unicode.rst:156 ../../howto/unicode.rst:514 #: ../../howto/unicode.rst:735 @@ -326,12 +364,14 @@ msgstr "" "悟してください。Unicode の起源と発展の `年表 `_ もサイトにあります。" -#: ../../howto/unicode.rst:163 msgid "" "On the Computerphile Youtube channel, Tom Scott briefly `discusses the " "history of Unicode and UTF-8 `_ " "(9 minutes 36 seconds)." msgstr "" +"Computerphile の YouTube チャンネルでは、Tom Scott が `Unicode と UTF-8 の歴" +"史を簡潔に説明しています `_ (9 " +"分 36 秒)。" #: ../../howto/unicode.rst:167 msgid "" @@ -342,7 +382,6 @@ msgstr "" "標準を理解する助けにするために、Jukka Korpela が Unicode 文字表を読むための `" "入門ガイド `_ を書いています。" -#: ../../howto/unicode.rst:171 msgid "" "Another `good introductory article `_ もありま" +"す。\n" +"ここまでの説明で理解できなかった場合は、先に進む前にそちらの記事を読んでみて" +"ください。" #: ../../howto/unicode.rst:176 msgid "" @@ -377,13 +422,15 @@ msgstr "" msgid "The String Type" msgstr "文字列型" -#: ../../howto/unicode.rst:190 msgid "" "Since Python 3.0, the language's :class:`str` type contains Unicode " "characters, meaning any string created using ``\"unicode rocks!\"``, " "``'unicode rocks!'``, or the triple-quoted string syntax is stored as " "Unicode." msgstr "" +"Python 3.0 以降、:class:`str` 型は Unicode 文字を格納します。\n" +"つまり、``\"unicode rocks!\"``、``'unicode rocks!'``、または三重引用符の文字" +"列構文で作った文字列は、すべて Unicode として保存されます。" #: ../../howto/unicode.rst:194 msgid "" @@ -393,7 +440,6 @@ msgstr "" "Python ソースコードのデフォルトエンコーディングは UTF-8 なので、文字列リテラ" "ルの中に Unicode 文字をそのまま含めることができます::" -#: ../../howto/unicode.rst:197 msgid "" "try:\n" " with open('/tmp/input.txt', 'r') as f:\n" @@ -402,32 +448,39 @@ msgid "" " # 'File not found' error message.\n" " print(\"Fichier non trouvé\")" msgstr "" +"try:\n" +" with open('/tmp/input.txt', 'r') as f:\n" +" ...\n" +"except OSError:\n" +" # 「ファイルが見つからない」というエラーメッセージ。\n" +" print(\"Fichier non trouvé\")" #: ../../howto/unicode.rst:204 msgid "" "Side note: Python 3 also supports using Unicode characters in identifiers::" msgstr "追記: Python3 は Unicode 文字を使った識別子もサポートしています::" -#: ../../howto/unicode.rst:206 msgid "" "répertoire = \"/tmp/records.log\"\n" "with open(répertoire, \"w\") as f:\n" " f.write(\"test\\n\")" msgstr "" +"répertoire = \"/tmp/records.log\"\n" +"with open(répertoire, \"w\") as f:\n" +" f.write(\"test\\n\")" -#: ../../howto/unicode.rst:210 msgid "" "If you can't enter a particular character in your editor or want to keep the " "source code ASCII-only for some reason, you can also use escape sequences in " "string literals. (Depending on your system, you may see the actual capital-" "delta glyph instead of a \\u escape.) ::" msgstr "" -"エディタである特定の文字が入力できなかったり、とある理由でソースコードを " -"ASCII のみに保ちたい場合は、文字列リテラルでエスケープシーケンスが使えます。" -"(使ってるシステムによっては、\\u でエスケープされた文字列ではなく、実物の大文" -"字のラムダのグリフが見えるかもしれません。)::" +"エディターで特定の文字を入力できない場合や、何らかの理由でソースコードを " +"ASCII だけにしたい場合は、文字列リテラルでエスケープシーケンスを使えます。\n" +"(システムによっては、\\u エスケープではなく、実際の大文字のデルタのグリフが表" +"示される場合があります。\n" +") ::" -#: ../../howto/unicode.rst:215 msgid "" ">>> \"\\N{GREEK CAPITAL LETTER DELTA}\" # Using the character name\n" "'\\u0394'\n" @@ -436,6 +489,12 @@ msgid "" ">>> \"\\U00000394\" # Using a 32-bit hex value\n" "'\\u0394'" msgstr "" +">>> \"\\N{GREEK CAPITAL LETTER DELTA}\" # 文字名を使う\n" +"'\\u0394'\n" +">>> \"\\u0394\" # 16 ビットの 16 進数を使う\n" +"'\\u0394'\n" +">>> \"\\U00000394\" # 32 ビットの 16 進数を使う\n" +"'\\u0394'" #: ../../howto/unicode.rst:222 msgid "" @@ -464,7 +523,6 @@ msgstr "" "く) 、``'backslashreplace'`` (エスケープシーケンス ``\\xNN`` を挿入する) で" "す。次の例はこれらの違いを示しています::" -#: ../../howto/unicode.rst:234 msgid "" ">>> b'\\x80abc'.decode(\"utf-8\", \"strict\")\n" "Traceback (most recent call last):\n" @@ -478,6 +536,17 @@ msgid "" ">>> b'\\x80abc'.decode(\"utf-8\", \"ignore\")\n" "'abc'" msgstr "" +">>> b'\\x80abc'.decode(\"utf-8\", \"strict\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:\n" +" invalid start byte\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"replace\")\n" +"'\\ufffdabc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"backslashreplace\")\n" +"'\\\\x80abc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"ignore\")\n" +"'abc'" #: ../../howto/unicode.rst:246 msgid "" @@ -506,13 +575,16 @@ msgstr "" "文字列を返します。逆の操作は :func:`ord` 組み込み関数です、この関数は一文字" "の Unicode 文字列を引数にとり、コードポイント値を返します::" -#: ../../howto/unicode.rst:258 msgid "" ">>> chr(57344)\n" "'\\ue000'\n" ">>> ord('\\ue000')\n" "57344" msgstr "" +">>> chr(57344)\n" +"'\\ue000'\n" +">>> ord('\\ue000')\n" +"57344" #: ../../howto/unicode.rst:264 msgid "Converting to Bytes" @@ -528,7 +600,6 @@ msgstr "" "のメソッドは、 Unicode 文字列を指定された *encoding* でエンコードして、 :" "class:`bytes` による表現で返します。" -#: ../../howto/unicode.rst:270 msgid "" "The *errors* parameter is the same as the parameter of the :meth:`~bytes." "decode` method but supports a few more possible handlers. As well as " @@ -543,14 +614,13 @@ msgstr "" "``'strict'`` 、 ``'ignore'`` 、 ``'replace'`` (このメソッドでは、エンコードで" "きなかった文字の代わりに疑問符を挿入する) の他に、 ``'xmlcharrefreplace'`` " "(XML 文字参照を挿入する) と ``backslashreplace`` (エスケープシーケンス " -"``\\nNNNN`` を挿入する)、 ``namereplace`` (エスケープシーケンス ``\\N{...}`` " +"``\\uNNNN`` を挿入する)、 ``namereplace`` (エスケープシーケンス ``\\N{...}`` " "を挿入する) があります。" #: ../../howto/unicode.rst:278 msgid "The following example shows the different results::" msgstr "次の例では、それぞれの異なる処理結果が示されています::" -#: ../../howto/unicode.rst:280 msgid "" ">>> u = chr(40960) + 'abcd' + chr(1972)\n" ">>> u.encode('utf-8')\n" @@ -571,6 +641,24 @@ msgid "" ">>> u.encode('ascii', 'namereplace')\n" "b'\\\\N{YI SYLLABLE IT}abcd\\\\u07b4'" msgstr "" +">>> u = chr(40960) + 'abcd' + chr(1972)\n" +">>> u.encode('utf-8')\n" +"b'\\xea\\x80\\x80abcd\\xde\\xb4'\n" +">>> u.encode('ascii')\n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeEncodeError: 'ascii' codec can't encode character '\\ua000' in\n" +" position 0: ordinal not in range(128)\n" +">>> u.encode('ascii', 'ignore')\n" +"b'abcd'\n" +">>> u.encode('ascii', 'replace')\n" +"b'?abcd?'\n" +">>> u.encode('ascii', 'xmlcharrefreplace')\n" +"b'ꀀabcd޴'\n" +">>> u.encode('ascii', 'backslashreplace')\n" +"b'\\\\ua000abcd\\\\u07b4'\n" +">>> u.encode('ascii', 'namereplace')\n" +"b'\\\\N{YI SYLLABLE IT}abcd\\\\u07b4'" #: ../../howto/unicode.rst:299 msgid "" @@ -603,7 +691,6 @@ msgstr "" "``\\u`` を使い、続けてコードポイントを4桁の16進数を書きます。エスケープシーケ" "ンス ``\\U`` も同様です、ただし4桁ではなく8桁の16進数を使います::" -#: ../../howto/unicode.rst:315 msgid "" ">>> s = \"a\\xac\\u1234\\u20ac\\U00008000\"\n" "... # ^^^^ two-digit hex escape\n" @@ -612,6 +699,12 @@ msgid "" ">>> [ord(c) for c in s]\n" "[97, 172, 4660, 8364, 32768]" msgstr "" +">>> s = \"a\\xac\\u1234\\u20ac\\U00008000\"\n" +"... # ^^^^ 2 桁の 16 進エスケープ\n" +"... # ^^^^^^ 4 桁の Unicode エスケープ\n" +"... # ^^^^^^^^^^ 8 桁の Unicode エスケープ\n" +">>> [ord(c) for c in s]\n" +"[97, 172, 4660, 8364, 32768]" #: ../../howto/unicode.rst:322 msgid "" @@ -650,7 +743,6 @@ msgstr "" "はソースファイルの一行目や二行目に特別なコメントを含めることによってできま" "す::" -#: ../../howto/unicode.rst:337 msgid "" "#!/usr/bin/env python\n" "# -*- coding: latin-1 -*-\n" @@ -658,6 +750,11 @@ msgid "" "u = 'abcdé'\n" "print(ord(u[-1]))" msgstr "" +"#!/usr/bin/env python\n" +"# -*- coding: latin-1 -*-\n" +"\n" +"u = 'abcdé'\n" +"print(ord(u[-1]))" #: ../../howto/unicode.rst:343 msgid "" @@ -686,7 +783,6 @@ msgstr "" msgid "Unicode Properties" msgstr "Unicode プロパティ" -#: ../../howto/unicode.rst:358 msgid "" "The Unicode specification includes a database of information about code " "points. For each defined code point, the information includes the " @@ -695,6 +791,13 @@ msgid "" "fractions such as one-third and four-fifths, etc.). There are also display-" "related properties, such as how to use the code point in bidirectional text." msgstr "" +"Unicode の仕様には、コードポイントに関する情報のデータベースが含まれていま" +"す。\n" +"定義済みのコードポイントごとに、文字名、カテゴリー、該当する場合は数値 (ロー" +"マ数字や、3 分の 1、5 分の 4 などの分数といった、数の概念を表す文字の場合) が" +"記録されています。\n" +"双方向テキストでのコードポイントの使い方など、表示に関するプロパティもありま" +"す。" #: ../../howto/unicode.rst:366 msgid "" @@ -704,7 +807,6 @@ msgstr "" "以下のプログラムはいくつかの文字に対する情報を表示し、特定の文字の数値を印字" "します::" -#: ../../howto/unicode.rst:369 msgid "" "import unicodedata\n" "\n" @@ -717,12 +819,21 @@ msgid "" "# Get numeric value of second character\n" "print(unicodedata.numeric(u[1]))" msgstr "" +"import unicodedata\n" +"\n" +"u = chr(233) + chr(0x0bf2) + chr(3972) + chr(6000) + chr(13231)\n" +"\n" +"for i, c in enumerate(u):\n" +" print(i, '%04x' % ord(c), unicodedata.category(c), end=\" \")\n" +" print(unicodedata.name(c))\n" +"\n" +"# 2 番目の文字の数値を取得する\n" +"print(unicodedata.numeric(u[1]))" #: ../../howto/unicode.rst:380 msgid "When run, this prints:" msgstr "実行すると、このように出力されます::" -#: ../../howto/unicode.rst:382 msgid "" "0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" "1 0bf2 No TAMIL NUMBER ONE THOUSAND\n" @@ -731,6 +842,12 @@ msgid "" "4 33af So SQUARE RAD OVER S SQUARED\n" "1000.0" msgstr "" +"0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" +"1 0bf2 No TAMIL NUMBER ONE THOUSAND\n" +"2 0f84 Mn TIBETAN MARK HALANTA\n" +"3 1770 Lo TAGBANWA LETTER SA\n" +"4 33af So SQUARE RAD OVER S SQUARED\n" +"1000.0" #: ../../howto/unicode.rst:391 msgid "" @@ -753,11 +870,9 @@ msgstr "" "Values 節 `_ " "を参照してください。" -#: ../../howto/unicode.rst:402 msgid "Comparing Strings" -msgstr "" +msgstr "文字列の比較" -#: ../../howto/unicode.rst:404 msgid "" "Unicode adds some complication to comparing strings, because the same set of " "characters can be represented by different sequences of code points. For " @@ -766,8 +881,14 @@ msgid "" "point for 'COMBINING CIRCUMFLEX ACCENT'. These will produce the same output " "when printed, but one is a string of length 1 and the other is of length 2." msgstr "" +"Unicode では、同じ文字の並びを異なるコードポイント列で表せるため、文字列の比" +"較が少し複雑になります。\n" +"例えば「ê」は、一つのコードポイント U+00EA でも、U+0065 U+0302 という並びでも" +"表せます。\n" +"後者は「e」のコードポイントの後に「COMBINING CIRCUMFLEX ACCENT」のコードポイ" +"ントを置いたものです。\n" +"表示すると同じ出力になりますが、一方は長さ 1、もう一方は長さ 2 の文字列です。" -#: ../../howto/unicode.rst:412 msgid "" "One tool for a case-insensitive comparison is the :meth:`~str.casefold` " "string method that converts a string to a case-insensitive form following an " @@ -775,13 +896,21 @@ msgid "" "handling for characters such as the German letter 'ß' (code point U+00DF), " "which becomes the pair of lowercase letters 'ss'." msgstr "" +"大文字と小文字を区別しない比較に使える方法の一つが、文字列の :meth:`~str." +"casefold` メソッドです。\n" +"Unicode 標準のアルゴリズムに従い、大文字と小文字を区別しない形式に文字列を変" +"換します。\n" +"このアルゴリズムは、ドイツ語の「ß」(コードポイント U+00DF) などの文字を特別に" +"扱い、この文字は小文字二つの「ss」に変換されます。" -#: ../../howto/unicode.rst:421 msgid "" ">>> street = 'Gürzenichstraße'\n" ">>> street.casefold()\n" "'gürzenichstrasse'" msgstr "" +">>> street = 'Gürzenichstraße'\n" +">>> street.casefold()\n" +"'gürzenichstrasse'" #: ../../howto/unicode.rst:425 msgid "" @@ -793,7 +922,6 @@ msgid "" "combining characters differently:" msgstr "" -#: ../../howto/unicode.rst:434 msgid "" "import unicodedata\n" "\n" @@ -810,31 +938,49 @@ msgid "" "print('length of second string=', len(multiple_chars))\n" "print(compare_strs(single_char, multiple_chars))" msgstr "" +"import unicodedata\n" +"\n" +"def compare_strs(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(s1) == NFD(s2)\n" +"\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN SMALL LETTER E}\\N{COMBINING CIRCUMFLEX " +"ACCENT}'\n" +"print('length of first string=', len(single_char))\n" +"print('length of second string=', len(multiple_chars))\n" +"print(compare_strs(single_char, multiple_chars))" #: ../../howto/unicode.rst:448 msgid "When run, this outputs:" msgstr "実行すると、このように出力されます:" -#: ../../howto/unicode.rst:450 msgid "" "$ python compare-strs.py\n" "length of first string= 1\n" "length of second string= 2\n" "True" msgstr "" +"$ python compare-strs.py\n" +"length of first string= 1\n" +"length of second string= 2\n" +"True" -#: ../../howto/unicode.rst:457 msgid "" "The first argument to the :func:`~unicodedata.normalize` function is a " "string giving the desired normalization form, which can be one of 'NFC', " "'NFKC', 'NFD', and 'NFKD'." msgstr "" +":func:`~unicodedata.normalize` 関数の最初の引数は、目的の正規化形式を表す文字" +"列です。\n" +"'NFC'、'NFKC'、'NFD'、'NFKD' のいずれかを指定できます。" -#: ../../howto/unicode.rst:461 msgid "The Unicode Standard also specifies how to do caseless comparisons::" msgstr "" +"Unicode 標準には、大文字と小文字を区別しない比較の方法も定められています。 ::" -#: ../../howto/unicode.rst:463 msgid "" "import unicodedata\n" "\n" @@ -851,14 +997,32 @@ msgid "" "\n" "print(compare_caseless(single_char, multiple_chars))" msgstr "" +"import unicodedata\n" +"\n" +"def compare_caseless(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(NFD(s1).casefold()) == NFD(NFD(s2).casefold())\n" +"\n" +"# 使用例\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN CAPITAL LETTER E}\\N{COMBINING CIRCUMFLEX " +"ACCENT}'\n" +"\n" +"print(compare_caseless(single_char, multiple_chars))" -#: ../../howto/unicode.rst:477 msgid "" "This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " "there are a few characters that make :meth:`~str.casefold` return a non-" "normalized string, so the result needs to be normalized again. See section " "3.13 of the Unicode Standard for a discussion and an example.)" msgstr "" +"この例は ``True`` を表示します。\n" +"(:func:`!NFD` を 2 回呼び出すのはなぜでしょうか。\n" +"一部の文字では :meth:`~str.casefold` が正規化されていない文字列を返すため、結" +"果をもう一度正規化する必要があるからです。\n" +"説明と例は Unicode 標準の 3.13 節を参照してください。)" #: ../../howto/unicode.rst:484 msgid "Unicode Regular Expressions" @@ -879,15 +1043,13 @@ msgstr "" "る意味を持ちます。例えば、 ``\\d`` はバイト列では ``[0-9]`` の範囲の文字と一" "致しますが、文字列では ``'Nd'`` カテゴリーにある任意の文字と一致します。" -#: ../../howto/unicode.rst:493 msgid "" "The string in this example has the number 57 written in both Thai and Arabic " "numerals::" msgstr "" "この例にある文字列には、タイ語の数字とアラビア数字の両方で数字の 57 が書いて" -"あります。" +"あります。 ::" -#: ../../howto/unicode.rst:496 msgid "" "import re\n" "p = re.compile(r'\\d+')\n" @@ -896,6 +1058,12 @@ msgid "" "m = p.search(s)\n" "print(repr(m.group()))" msgstr "" +"import re\n" +"p = re.compile(r'\\d+')\n" +"\n" +"s = \"Over \\u0e55\\u0e57 57 flavours\"\n" +"m = p.search(s)\n" +"print(repr(m.group()))" #: ../../howto/unicode.rst:503 msgid "" @@ -907,15 +1075,14 @@ msgstr "" "const:`re.ASCII` を :func:`~re.compile` に渡した場合、 ``\\d+`` は先程とは" "違って部分文字列 \"57\" に一致します。" -#: ../../howto/unicode.rst:507 msgid "" "Similarly, ``\\w`` matches a wide variety of Unicode characters but only " "``[a-zA-Z0-9_]`` in bytes or if :const:`re.ASCII` is supplied, and ``\\s`` " "will match either Unicode whitespace characters or ``[ \\t\\n\\r\\f\\v]``." msgstr "" -"同様に、 ``\\w`` は非常に多くの Unicode 文字に一致しますが、バイト列の場合も" -"しくは :const:`re.ASCII` が渡された場合は ``[a-zA-Z0-9_]`` にしか一致しませ" -"ん。 ``\\s`` は文字列では Unicode 空白文字に、バイト列では " +"同様に、``\\w`` は幅広い Unicode 文字に一致しますが、バイト列の場合や :const:" +"`re.ASCII` を指定した場合には ``[a-zA-Z0-9_]`` だけに一致します。\n" +"``\\s`` も同じ条件に応じて、Unicode の空白文字、または " "``[ \\t\\n\\r\\f\\v]`` に一致します。" #: ../../howto/unicode.rst:518 @@ -982,7 +1149,6 @@ msgstr "" "力です。プログラムは Unicode 文字列をどう受けとり、どう Unicode を外部記憶装" "置や送受信装置に適した形式に変換するのでしょう?" -#: ../../howto/unicode.rst:544 msgid "" "It's possible that you may not need to do anything depending on your input " "sources and output destinations; you should check whether the libraries used " @@ -990,13 +1156,13 @@ msgid "" "Unicode data, for example. Many relational databases also support Unicode-" "valued columns and can return Unicode values from an SQL query." msgstr "" -"入力ソースと出力先に依存しないような方法は可能です; アプリケーションに利用さ" -"れているライブラリが Unicode をそのままサポートしているかを調べなければいけま" -"せん。例えば XML パーサーは大抵 Unicode データを返します。多くのリレーショナ" -"ルデータベースも Unicode 値の入ったコラムをサポートしていますし、 SQL の問い" -"合わせで Unicode 値を返すことができます。" +"入力元と出力先によっては、何もする必要がないかもしれません。\n" +"アプリケーションで使っているライブラリが Unicode をそのまま扱えるか確認してく" +"ださい。\n" +"例えば、XML パーサーは多くの場合 Unicode データを返します。\n" +"多くのリレーショナルデータベースも Unicode 値の列をサポートし、SQL の問い合わ" +"せに Unicode 値を返せます。" -#: ../../howto/unicode.rst:550 msgid "" "Unicode data is usually converted to a particular encoding before it gets " "written to disk or sent over a socket. It's possible to do all the work " @@ -1004,10 +1170,12 @@ msgid "" "bytes with ``bytes.decode(encoding)``. However, the manual approach is not " "recommended." msgstr "" -"Unicode のデータはディスクに書き込まれたり、ソケットを介して送信されたりする" -"にあたって、通常、特定のエンコーディングに変換されます。推奨はされませんが、" -"これを手動で行うことも可能です。ファイルを開き、8バイトオブジェクトを読み込" -"み、バイト列を ``bytes.decode(encoding)`` で変換することにより実現できます。" +"Unicode データは通常、ディスクに書いたりソケット経由で送ったりする前に、特定" +"のエンコーディングに変換されます。\n" +"すべてを自分で処理することもできます。\n" +"ファイルを開き、8 ビットのバイトからなるオブジェクトを読み取り、``bytes." +"decode(encoding)`` でバイト列を変換します。\n" +"ただし、このように手動で処理する方法は推奨しません。" #: ../../howto/unicode.rst:555 msgid "" @@ -1049,12 +1217,14 @@ msgstr "" msgid "Reading Unicode from a file is therefore simple::" msgstr "そのためファイルから Unicode を読むのは単純です::" -#: ../../howto/unicode.rst:576 msgid "" "with open('unicode.txt', encoding='utf-8') as f:\n" " for line in f:\n" " print(repr(line))" msgstr "" +"with open('unicode.txt', encoding='utf-8') as f:\n" +" for line in f:\n" +" print(repr(line))" #: ../../howto/unicode.rst:580 msgid "" @@ -1062,13 +1232,16 @@ msgid "" "writing::" msgstr "読み書きの両方ができる update モードでファイルを開くことも可能です::" -#: ../../howto/unicode.rst:583 msgid "" "with open('test', encoding='utf-8', mode='w+') as f:\n" " f.write('\\u4500 blah blah blah\\n')\n" " f.seek(0)\n" " print(repr(f.readline()[:1]))" msgstr "" +"with open('test', encoding='utf-8', mode='w+') as f:\n" +" f.write('\\u4500 blah blah blah\\n')\n" +" f.seek(0)\n" +" print(repr(f.readline()[:1]))" #: ../../howto/unicode.rst:588 msgid "" @@ -1091,7 +1264,6 @@ msgstr "" "ディアン (big-endian) 用の 'utf-16-be' というような変種があり、これらは特定の" "1つのバイト順を指定していて BOM をスキップしません。" -#: ../../howto/unicode.rst:597 msgid "" "In some areas, it is also convention to use a \"BOM\" at the start of UTF-8 " "encoded files; the name is misleading since UTF-8 is not byte-order " @@ -1099,6 +1271,12 @@ msgid "" "reading such files, use the 'utf-8-sig' codec to automatically skip the mark " "if present." msgstr "" +"UTF-8 でエンコードされたファイルの先頭にも「BOM」を付ける慣習がある分野があり" +"ます。\n" +"UTF-8 はバイト順に依存しないため、この名前は紛らわしいものです。\n" +"このマークは、ファイルが UTF-8 でエンコードされていることを示すだけです。\n" +"このようなファイルを読むときは、'utf-8-sig' コーデックを使えば、マークがあっ" +"た場合に自動的に読み飛ばせます。" #: ../../howto/unicode.rst:604 msgid "Unicode filenames" @@ -1131,12 +1309,14 @@ msgstr "" "イル名を Unicode 文字列として渡すだけで正しいエンコーディングに自動的に変更さ" "れます::" -#: ../../howto/unicode.rst:622 msgid "" "filename = 'filename\\u4500abc'\n" "with open(filename, 'w') as f:\n" " f.write('blah\\n')" msgstr "" +"filename = 'filename\\u4500abc'\n" +"with open(filename, 'w') as f:\n" +" f.write('blah\\n')" #: ../../howto/unicode.rst:626 msgid "" @@ -1146,7 +1326,6 @@ msgstr "" ":func:`os.stat` のような :mod:`os` モジュールの関数も Unicode のファイル名を" "受け付けます。" -#: ../../howto/unicode.rst:629 msgid "" "The :func:`os.listdir` function returns filenames, which raises an issue: " "should it return the Unicode version of filenames, or should it return bytes " @@ -1158,8 +1337,17 @@ msgid "" "assuming the default :term:`filesystem encoding ` is UTF-8, running the following program::" msgstr "" +":func:`os.listdir` 関数はファイル名を返しますが、ここで問題になるのは、ファイ" +"ル名を Unicode で返すべきか、エンコードしたバイト列で返すべきかということで" +"す。\n" +":func:`os.listdir` は、ディレクトリのパスをバイト列と Unicode 文字列のどちら" +"で渡すかに応じて、両方に対応します。\n" +"パスを Unicode 文字列で渡すと、ファイル名をファイルシステムのエンコーディング" +"でデコードし、Unicode 文字列のリストを返します。\n" +"バイト列でパスを渡すと、ファイル名もバイト列で返します。\n" +"例えば、デフォルトの :term:`ファイルシステムエンコーディング ` が UTF-8 の場合、次のプログラムを実行すると、 ::" -#: ../../howto/unicode.rst:639 msgid "" "fn = 'filename\\u4500abc'\n" "f = open(fn, 'w')\n" @@ -1169,17 +1357,26 @@ msgid "" "print(os.listdir(b'.'))\n" "print(os.listdir('.'))" msgstr "" +"fn = 'filename\\u4500abc'\n" +"f = open(fn, 'w')\n" +"f.close()\n" +"\n" +"import os\n" +"print(os.listdir(b'.'))\n" +"print(os.listdir('.'))" #: ../../howto/unicode.rst:647 msgid "will produce the following output:" msgstr "以下の出力結果が生成されます:" -#: ../../howto/unicode.rst:649 msgid "" "$ python listdir-test.py\n" "[b'filename\\xe4\\x94\\x80abc', ...]\n" "['filename\\u4500abc', ...]" msgstr "" +"$ python listdir-test.py\n" +"[b'filename\\xe4\\x94\\x80abc', ...]\n" +"['filename\\u4500abc', ...]" #: ../../howto/unicode.rst:655 msgid "" @@ -1189,13 +1386,16 @@ msgstr "" "最初のリストは UTF-8 でエンコーディングされたファイル名を含み、第二のリスト" "は Unicode 版を含んでいます。" -#: ../../howto/unicode.rst:658 msgid "" "Note that on most occasions, you should can just stick with using Unicode " "with these APIs. The bytes APIs should only be used on systems where " "undecodable file names can be present; that's pretty much only Unix systems " "now." msgstr "" +"ほとんどの場合、これらの API では Unicode を使えば十分です。\n" +"バイト列の API は、デコードできないファイル名が存在し得るシステムでのみ使うべ" +"きです。\n" +"現在では、ほぼ Unix システムに限られます。" #: ../../howto/unicode.rst:665 msgid "Tips for Writing Unicode-aware Programs" @@ -1220,7 +1420,6 @@ msgstr "" "ソフトウェアは内部では Unicode 文字列のみを利用し、入力データはできるだけ早期" "にデコードし、出力の直前でエンコードすべきです。" -#: ../../howto/unicode.rst:675 msgid "" "If you attempt to write processing functions that accept both Unicode and " "byte strings, you will find your program vulnerable to bugs wherever you " @@ -1228,6 +1427,10 @@ msgid "" "or decoding: if you do e.g. ``str + bytes``, a :exc:`TypeError` will be " "raised." msgstr "" +"Unicode 文字列とバイト列の両方を受け付ける処理関数を書こうとすると、この二種" +"類を組み合わせるあらゆる箇所でバグが生じやすくなります。\n" +"自動的なエンコードやデコードは行われません。\n" +"例えば ``str + bytes`` を行うと :exc:`TypeError` が送出されます。" #: ../../howto/unicode.rst:680 msgid "" @@ -1254,20 +1457,23 @@ msgstr "" msgid "Converting Between File Encodings" msgstr "ファイルエンコーディングの変換" -#: ../../howto/unicode.rst:693 msgid "" "The :class:`~codecs.StreamRecoder` class can transparently convert between " "encodings, taking a stream that returns data in encoding #1 and behaving " "like a stream returning data in encoding #2." msgstr "" +":class:`~codecs.StreamRecoder` クラスは、エンコーディング間の変換を透過的に行" +"えます。\n" +"エンコーディング #1 でデータを返すストリームを受け取り、エンコーディング #2 " +"でデータを返すストリームとして動作します。" -#: ../../howto/unicode.rst:697 msgid "" "For example, if you have an input file *f* that's in Latin-1, you can wrap " "it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" msgstr "" +"例えば、Latin-1 の入力ファイル ``f`` を :class:`~codecs.StreamRecoder` でラッ" +"プすると、UTF-8 でエンコードされたバイト列を返すようにできます。 ::" -#: ../../howto/unicode.rst:701 msgid "" "new_f = codecs.StreamRecoder(f,\n" " # en/decoder: used by read() to encode its results and\n" @@ -1277,20 +1483,30 @@ msgid "" " # reader/writer: used to read and write to the stream.\n" " codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" msgstr "" +"new_f = codecs.StreamRecoder(f,\n" +" # エンコーダー/デコーダー: read() の結果のエンコードと\n" +" # write() の入力のデコードに使う。\n" +" codecs.getencoder('utf-8'), codecs.getdecoder('utf-8'),\n" +"\n" +" # リーダー/ライター: ストリームの読み書きに使う。\n" +" codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" #: ../../howto/unicode.rst:711 msgid "Files in an Unknown Encoding" msgstr "不明なエンコーディングのファイル" -#: ../../howto/unicode.rst:713 msgid "" "What can you do if you need to make a change to a file, but don't know the " "file's encoding? If you know the encoding is ASCII-compatible and only want " "to examine or modify the ASCII parts, you can open the file with the " "``surrogateescape`` error handler::" msgstr "" +"ファイルを変更したいのに、そのエンコーディングが分からない場合はどうすればよ" +"いでしょうか。\n" +"ASCII 互換のエンコーディングだと分かっていて、ASCII の部分だけを調べたり変更" +"したりしたい場合は、``surrogateescape`` エラーハンドラーを指定してファイルを" +"開けます。 ::" -#: ../../howto/unicode.rst:718 msgid "" "with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" " data = f.read()\n" @@ -1301,23 +1517,35 @@ msgid "" " encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" " f.write(data)" msgstr "" +"with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" data = f.read()\n" +"\n" +"# 文字列 'data' を変更する\n" +"\n" +"with open(fname + '.new', 'w',\n" +" encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" f.write(data)" -#: ../../howto/unicode.rst:727 msgid "" "The ``surrogateescape`` error handler will decode any non-ASCII bytes as " "code points in a special range running from U+DC80 to U+DCFF. These code " "points will then turn back into the same bytes when the ``surrogateescape`` " "error handler is used to encode the data and write it back out." msgstr "" +"``surrogateescape`` エラーハンドラーは、ASCII 以外のバイトを U+DC80 から " +"U+DCFF までの特別な範囲のコードポイントにデコードします。\n" +"``surrogateescape`` エラーハンドラーを使ってデータをエンコードし、書き戻す" +"と、これらのコードポイントは元と同じバイトに戻ります。" -#: ../../howto/unicode.rst:737 msgid "" "One section of `Mastering Python 3 Input/Output `_, a PyCon 2010 talk by David " "Beazley, discusses text processing and binary data handling." msgstr "" +"David Beazley による PyCon 2010 の講演 `Mastering Python 3 Input/Output " +"`_ では、テ" +"キスト処理とバイナリデータの扱いを説明する節があります。" -#: ../../howto/unicode.rst:741 msgid "" "The `PDF slides for Marc-André Lemburg's presentation \"Writing Unicode-" "aware Applications in Python\" から入手可能です、そして" -"文字エンコーディングの問題と同様にアプリケーションの国際化やローカライズにつ" -"いても議論されています。このスライドは Python 2.x のみをカバーしています。" +"`Marc-André Lemburg の講演 \"Writing Unicode-aware Applications in Python\" " +"の PDF スライド `_ は、文字エンコーディングの問題に" +"加え、アプリケーションの国際化とローカライズの方法を説明しています。\n" +"このスライドは Python 2.x だけを対象にしています。" -#: ../../howto/unicode.rst:747 msgid "" "`The Guts of Unicode in Python `_ is a PyCon 2013 talk by Benjamin Peterson that " "discusses the internal Unicode representation in Python 3.3." msgstr "" +"`The Guts of Unicode in Python `_ は、Python 3.3 の Unicode の内部表現を解説する、" +"Benjamin Peterson による PyCon 2013 の講演です。" #: ../../howto/unicode.rst:754 msgid "Acknowledgements" diff --git a/howto/urllib2.po b/howto/urllib2.po index 125f7b95a..d0f36991d 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -38,17 +38,17 @@ msgstr "" "同じように Python でインターネットリソースを取得するのに以下の記事が役に立ち" "ます:" -#: ../../howto/urllib2.rst:15 msgid "" "`Basic Authentication `__" msgstr "" +"`Basic 認証 `__" #: ../../howto/urllib2.rst:17 msgid "A tutorial on *Basic Authentication*, with examples in Python." msgstr "*Basic 認証* についてのチュートリアルで Python の例がついています。" -#: ../../howto/urllib2.rst:19 msgid "" "**urllib.request** is a Python module for fetching URLs (Uniform Resource " "Locators). It offers a very simple interface, in the form of the *urlopen* " @@ -57,14 +57,14 @@ msgid "" "common situations - like basic authentication, cookies, proxies and so on. " "These are provided by objects called handlers and openers." msgstr "" -"**urllib.request** は URLs (Uniform Resource Locators) を取得するための " -"Python モジュールです。このモジュールはとても簡単なインターフェースを " -"*urlopen* 関数の形式で提供しています。また、このモジュールは一般的な状況で利" -"用するためにいくらか複雑なインターフェースも提供しています - basic 認証やクッ" -"キー、プロキシ等。これらは handler や opener と呼ばれるオブジェクトとして提供" -"されます。" +"**urllib.request** は、URL (Uniform Resource Locator) からリソースを取得する " +"Python モジュールです。\n" +"*urlopen* 関数という、とても単純なインターフェースを提供します。\n" +"この関数は、さまざまなプロトコルを使って URL からリソースを取得できます。\n" +"また、Basic 認証、クッキー、プロキシなど、よくある状況を扱うための、少し複雑" +"なインターフェースも提供します。\n" +"これらは handler や opener と呼ばれるオブジェクトによって提供されます。" -#: ../../howto/urllib2.rst:26 msgid "" "urllib.request supports fetching URLs for many \"URL schemes\" (identified " "by the string before the ``\":\"`` in URL - for example ``\"ftp\"`` is the " @@ -72,9 +72,11 @@ msgid "" "protocols (e.g. FTP, HTTP). This tutorial focuses on the most common case, " "HTTP." msgstr "" -"urllib.request は多くの \"URL スキーム\" (URL の \":\" の前の文字列で識別され" -"るもの - 例えば \"ftp://python.org/\" では \"ftp\") の URL を、関連するネット" -"ワークプロトコル(例えば FTP, HTTP) を利用することで、取得できます。" +"urllib.request は、多くの「URL スキーム」に対応するネットワークプロトコル " +"(FTP、HTTP など) を使って、URL からリソースを取得できます。\n" +"URL スキームは URL の ``\":\"`` より前の文字列で識別されます。\n" +"例えば、``\"ftp://python.org/\"`` の URL スキームは ``\"ftp\"`` です。\n" +"このチュートリアルでは、最も一般的な HTTP に焦点を当てます。" #: ../../howto/urllib2.rst:31 msgid "" @@ -104,12 +106,14 @@ msgstr "URL を取得する" msgid "The simplest way to use urllib.request is as follows::" msgstr "urllib.request を利用する最も簡単な方法は以下です::" -#: ../../howto/urllib2.rst:45 msgid "" "import urllib.request\n" "with urllib.request.urlopen('http://python.org/') as response:\n" " html = response.read()" msgstr "" +"import urllib.request\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" html = response.read()" #: ../../howto/urllib2.rst:49 msgid "" @@ -121,7 +125,6 @@ msgstr "" "func:`shutil.copyfileobj` と :func:`tempfile.NamedTemporaryFile` 関数を使って" "行うことができます::" -#: ../../howto/urllib2.rst:53 msgid "" "import shutil\n" "import tempfile\n" @@ -134,6 +137,16 @@ msgid "" "with open(tmp_file.name) as html:\n" " pass" msgstr "" +"import shutil\n" +"import tempfile\n" +"import urllib.request\n" +"\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" with tempfile.NamedTemporaryFile(delete=False) as tmp_file:\n" +" shutil.copyfileobj(response, tmp_file)\n" +"\n" +"with open(tmp_file.name) as html:\n" +" pass" #: ../../howto/urllib2.rst:64 msgid "" @@ -165,7 +178,6 @@ msgstr "" "オブジェクトで、これはつまりレスポンスに ``.read()`` と呼び出せることを意味し" "ています::" -#: ../../howto/urllib2.rst:77 msgid "" "import urllib.request\n" "\n" @@ -173,6 +185,11 @@ msgid "" "with urllib.request.urlopen(req) as response:\n" " the_page = response.read()" msgstr "" +"import urllib.request\n" +"\n" +"req = urllib.request.Request('http://python.org/')\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" #: ../../howto/urllib2.rst:83 msgid "" @@ -182,9 +199,8 @@ msgstr "" "urllib.request は同じリクエストインターフェースを全ての URL スキームに対して" "利用できるようにしています。例えば、FTP リクエストの場合はこうできます::" -#: ../../howto/urllib2.rst:86 msgid "req = urllib.request.Request('ftp://example.com/')" -msgstr "" +msgstr "req = urllib.request.Request('ftp://example.com/')" #: ../../howto/urllib2.rst:88 msgid "" @@ -226,7 +242,6 @@ msgstr "" "ストオブジェクトに ``data`` 引数として渡します。エンコーディングは :mod:" "`urllib.parse` ライブラリの関数を使って行います。 ::" -#: ../../howto/urllib2.rst:107 msgid "" "import urllib.parse\n" "import urllib.request\n" @@ -242,6 +257,19 @@ msgid "" "with urllib.request.urlopen(req) as response:\n" " the_page = response.read()" msgstr "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"values = {'name' : 'Michael Foord',\n" +" 'location' : 'Northampton',\n" +" 'language' : 'Python' }\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii') # data は bytes にする\n" +"req = urllib.request.Request(url, data)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" #: ../../howto/urllib2.rst:121 msgid "" @@ -254,7 +282,6 @@ msgstr "" "Specification, Form Submission `_ を見て下さい)。" -#: ../../howto/urllib2.rst:126 msgid "" "If you do not pass the ``data`` argument, urllib uses a **GET** request. One " "way in which GET and POST requests differ is that POST requests often have " @@ -266,21 +293,22 @@ msgid "" "side-effects, nor a POST requests from having no side-effects. Data can also " "be passed in an HTTP GET request by encoding it in the URL itself." msgstr "" -"``data`` 引数を渡さない場合、urllib は **GET** リクエストを利用します。GET " -"と POST リクエストの一つの違いは、POST リクエストにしばしば、「副作用」がある" -"ことです: POST リクエストはいくつかの方法によってシステムの状態を変化させま" -"す (例えば100ポンドのスパムの缶詰をドアの前まで配達する注文を web サイトで行" -"う)。とはいえ HTTP 標準で明確にされている内容では、POST は *常に* 副作用を持" -"ち、GET リクエストは *決して* 副作用を持たないことを意図するけれども、、GET " -"リクエストが副作用を持つことも、POST リクエストが副作用を持たないことも、妨げ" -"られません。HTTP の GET リクエストでもデータ自身をエンコーディングすることで" -"データを渡すことができます。" +"``data`` 引数を渡さない場合、urllib は **GET** リクエストを利用します。\n" +"GET と POST リクエストの一つの違いは、POST リクエストにしばしば、「副作用」が" +"あることです: POST リクエストはいくつかの方法によってシステムの状態を変化させ" +"ます (例えば100ポンドのスパムの缶詰をドアの前まで配達する注文を web サイトで" +"行う)。\n" +"とはいえ HTTP 標準で明確にされている内容では、POST は *常に* 副作用を持ち、" +"GET リクエストは *決して* 副作用を持たないことを意図するけれども、GET リクエ" +"ストが副作用を持つことも、POST リクエストが副作用を持たないことも、妨げられま" +"せん。\n" +"HTTP の GET リクエストでも、URL 自体にデータをエンコードすることでデータを渡" +"せます。" #: ../../howto/urllib2.rst:136 msgid "This is done as follows::" msgstr "以下のようにして行います::" -#: ../../howto/urllib2.rst:138 msgid "" ">>> import urllib.request\n" ">>> import urllib.parse\n" @@ -295,6 +323,18 @@ msgid "" ">>> full_url = url + '?' + url_values\n" ">>> data = urllib.request.urlopen(full_url)" msgstr "" +">>> import urllib.request\n" +">>> import urllib.parse\n" +">>> data = {}\n" +">>> data['name'] = 'Somebody Here'\n" +">>> data['location'] = 'Northampton'\n" +">>> data['language'] = 'Python'\n" +">>> url_values = urllib.parse.urlencode(data)\n" +">>> print(url_values) # 順序は下の出力と異なる場合がある。\n" +"name=Somebody+Here&language=Python&location=Northampton\n" +">>> url = 'http://www.example.com/example.cgi'\n" +">>> full_url = url + '?' + url_values\n" +">>> data = urllib.request.urlopen(full_url)" #: ../../howto/urllib2.rst:151 msgid "" @@ -338,7 +378,6 @@ msgstr "" "できます。以下の例は上の例と同じですが、自身を Internet Explorer [#]_ のバー" "ジョンの一つとして扱っています。 ::" -#: ../../howto/urllib2.rst:171 msgid "" "import urllib.parse\n" "import urllib.request\n" @@ -356,32 +395,50 @@ msgid "" "with urllib.request.urlopen(req) as response:\n" " the_page = response.read()" msgstr "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'\n" +"values = {'name': 'Michael Foord',\n" +" 'location': 'Northampton',\n" +" 'language': 'Python' }\n" +"headers = {'User-Agent': user_agent}\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii')\n" +"req = urllib.request.Request(url, data, headers)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" -#: ../../howto/urllib2.rst:187 msgid "" "The response also has two useful methods. See the section on `info and " "geturl`_ which comes after we have a look at what happens when things go " "wrong." msgstr "" -"レスポンスは二つの便利なメソッドも持っています。 `info と geturl`_ の節を見て" -"下さい、この節は後で問題が起きた場合に見ておくべき内容です。" +"レスポンスには便利なメソッドが二つあります。\n" +"問題が起きたときの動作を説明した後の、`info と geturl `_ の" +"節を参照してください。" #: ../../howto/urllib2.rst:192 msgid "Handling Exceptions" msgstr "例外を処理する" -#: ../../howto/urllib2.rst:194 msgid "" "*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a " "response (though as usual with Python APIs, built-in exceptions such as :exc:" "`ValueError`, :exc:`TypeError` etc. may also be raised)." msgstr "" +"*urlopen* はレスポンスを処理できない場合に :exc:`~urllib.error.URLError` を送" +"出します (ただし、他の Python API と同様に、:exc:`ValueError` や :exc:" +"`TypeError` などの組み込み例外が送出される場合もあります)。" -#: ../../howto/urllib2.rst:198 msgid "" ":exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error." "URLError` raised in the specific case of HTTP URLs." msgstr "" +":exc:`~urllib.error.HTTPError` は :exc:`~urllib.error.URLError` のサブクラス" +"で、HTTP URL に固有の場合に送出されます。" #: ../../howto/urllib2.rst:201 msgid "The exception classes are exported from the :mod:`urllib.error` module." @@ -420,7 +477,6 @@ msgstr "" msgid "HTTPError" msgstr "HTTPError" -#: ../../howto/urllib2.rst:224 msgid "" "Every HTTP response from the server contains a numeric \"status code\". " "Sometimes the status code indicates that the server is unable to fulfil the " @@ -431,17 +487,29 @@ msgid "" "HTTPError`. Typical errors include '404' (page not found), '403' (request " "forbidden), and '401' (authentication required)." msgstr "" +"サーバーからのすべての HTTP レスポンスには、数値の「ステータスコード」が含ま" +"れます。\n" +"ステータスコードは、サーバーがリクエストを処理できないことを示す場合がありま" +"す。\n" +"デフォルトのハンドラーは、そうしたレスポンスの一部を処理します。\n" +"例えば、別の URL から文書を取得するようクライアントに要求する「リダイレクト」" +"の場合、urllib が処理します。\n" +"処理できないレスポンスに対しては、urlopen が :exc:`~urllib.error.HTTPError` " +"を送出します。\n" +"よくあるエラーには、'404' (ページが見つからない)、'403' (リクエストが禁止され" +"ている)、'401' (認証が必要) があります。" #: ../../howto/urllib2.rst:232 msgid "" "See section 10 of :rfc:`2616` for a reference on all the HTTP error codes." msgstr "HTTP のエラーコード全てについては :rfc:`2616` の10節を参照して下さい。" -#: ../../howto/urllib2.rst:234 msgid "" "The :exc:`~urllib.error.HTTPError` instance raised will have an integer " "'code' attribute, which corresponds to the error sent by the server." msgstr "" +"送出された :exc:`~urllib.error.HTTPError` インスタンスには、サーバーが送った" +"エラーに対応する整数の 'code' 属性があります。" #: ../../howto/urllib2.rst:238 msgid "Error Codes" @@ -457,14 +525,15 @@ msgstr "" "100--299番台のコードは成功を意味しているので、たいていの場合は400--599番台の" "エラーコードのみを見るだけですみます。" -#: ../../howto/urllib2.rst:244 msgid "" ":attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary " "of response codes that shows all the response codes used by :rfc:`2616`. An " "excerpt from the dictionary is shown below ::" msgstr "" +":attr:`http.server.BaseHTTPRequestHandler.responses` は、:rfc:`2616` で使われ" +"るすべてのレスポンスコードを確認できる便利な辞書です。\n" +"辞書からの抜粋を示します。 ::" -#: ../../howto/urllib2.rst:248 msgid "" "responses = {\n" " ...\n" @@ -489,6 +558,28 @@ msgid "" " ...\n" " }" msgstr "" +"responses = {\n" +" ...\n" +" : ('OK', 'Request fulfilled, document follows'),\n" +" ...\n" +" : ('Forbidden',\n" +" 'Request forbidden -- authorization will " +"'\n" +" 'not help'),\n" +" : ('Not Found',\n" +" 'Nothing matches the given URI'),\n" +" ...\n" +" : (\"I'm a Teapot\",\n" +" 'Server refuses to brew coffee because " +"'\n" +" 'it is a teapot'),\n" +" ...\n" +" : ('Service Unavailable',\n" +" 'The server cannot process the " +"'\n" +" 'request due to a high load'),\n" +" ...\n" +" }" #: ../../howto/urllib2.rst:268 msgid "" @@ -503,7 +594,6 @@ msgstr "" "スポンスとして扱えます。これは code 属性だけでなく、 ``urllib.response`` モ" "ジュールが返すような read, geturl, info メソッドも持つことを意味します::" -#: ../../howto/urllib2.rst:273 msgid "" ">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" ">>> try:\n" @@ -520,23 +610,37 @@ msgid "" " Page Not Found\\n\n" " ..." msgstr "" +">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" +">>> try:\n" +"... urllib.request.urlopen(req)\n" +"... except urllib.error.HTTPError as e:\n" +"... print(e.code)\n" +"... print(e.read())\n" +"...\n" +"404\n" +"b'\\n\\n\\nPage Not Found\\n\n" +" ..." -#: ../../howto/urllib2.rst:288 msgid "Wrapping it Up" -msgstr "エラーをラップする" +msgstr "まとめ" -#: ../../howto/urllib2.rst:290 msgid "" "So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:" "`~urllib.error.URLError` there are two basic approaches. I prefer the second " "approach." msgstr "" +":exc:`~urllib.error.HTTPError` *または* :exc:`~urllib.error.URLError` に対応" +"するには、基本的に二つの方法があります。\n" +"筆者は二番目の方法を好んでいます。" #: ../../howto/urllib2.rst:294 msgid "Number 1" msgstr "その1" -#: ../../howto/urllib2.rst:299 msgid "" "from urllib.request import Request, urlopen\n" "from urllib.error import URLError, HTTPError\n" @@ -552,12 +656,27 @@ msgid "" "else:\n" " # everything is fine" msgstr "" +"from urllib.request import Request, urlopen\n" +"from urllib.error import URLError, HTTPError\n" +"req = Request(someurl)\n" +"try:\n" +" response = urlopen(req)\n" +"except HTTPError as e:\n" +" print('The server couldn\\'t fulfill the request.')\n" +" print('Error code: ', e.code)\n" +"except URLError as e:\n" +" print('We failed to reach a server.')\n" +" print('Reason: ', e.reason)\n" +"else:\n" +" # すべて正常" -#: ../../howto/urllib2.rst:316 msgid "" "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " "will *also* catch an :exc:`~urllib.error.HTTPError`." msgstr "" +"``except HTTPError`` を *必ず* 先に書いてください。\n" +"そうしないと、``except URLError`` が :exc:`~urllib.error.HTTPError` *も* 捕捉" +"してしまいます。" #: ../../howto/urllib2.rst:320 msgid "Number 2" @@ -585,12 +704,14 @@ msgstr "" msgid "info and geturl" msgstr "info と geturl" -#: ../../howto/urllib2.rst:343 msgid "" "The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " "instance) has two useful methods :meth:`!info` and :meth:`!geturl` and is " "defined in the module :mod:`urllib.response`." msgstr "" +"urlopen が返すレスポンス (または :exc:`~urllib.error.HTTPError` インスタン" +"ス) には、便利なメソッド :meth:`!info` と :meth:`!geturl` があります。\n" +"これらは :mod:`urllib.response` モジュールで定義されています。" #: ../../howto/urllib2.rst:347 msgid "" @@ -656,26 +777,23 @@ msgstr "" "たいと思うでしょう、例えばクッキーを処理する opener が得たい場合や、リダイレ" "クションを処理しない opener を得たい場合。" -#: ../../howto/urllib2.rst:376 msgid "" "To create an opener, instantiate an ``OpenerDirector``, and then call ``." "add_handler(some_handler_instance)`` repeatedly." msgstr "" -"opener を作成するには、 ``OpenerDirector`` をインスタンス化して、続けて、 ``." -"add_handler(some_handler_instance)`` を呼び出します。" +"opener を作るには、``OpenerDirector`` のインスタンスを作成し、``." +"add_handler(some_handler_instance)`` を繰り返し呼び出します。" -#: ../../howto/urllib2.rst:379 msgid "" "Alternatively, you can use ``build_opener``, which is a convenience function " "for creating opener objects with a single function call. ``build_opener`` " "adds several handlers by default, but provides a quick way to add more and/" "or override the default handlers." msgstr "" -"それに代わる方法として、 ``build_opener`` を利用することもできます、これは " -"opener オブジェクトを一回の関数呼び出しで作成できる便利な関数です。 " -"``build_opener`` はいくつかのハンドラをデフォルトで追加しますが、デフォルトの" -"ハンドラに対して追加、継承のどちらかまたは両方を行うのに手っ取り早い方法を提" -"供してくれます。" +"代わりに、一度の関数呼び出しで opener オブジェクトを作れる便利な関数 " +"``build_opener`` も使えます。\n" +"``build_opener`` はデフォルトでいくつかのハンドラーを追加しますが、さらにハン" +"ドラーを追加したり、デフォルトのハンドラーを置き換えたりするのも簡単です。" #: ../../howto/urllib2.rst:384 msgid "" @@ -685,15 +803,14 @@ msgstr "" "追加したくなる可能性がある handler としては、プロキシ処理、認証など、一般的で" "すがいくらか特定の状況に限られるものでしょう。" -#: ../../howto/urllib2.rst:387 msgid "" "``install_opener`` can be used to make an ``opener`` object the (global) " "default opener. This means that calls to ``urlopen`` will use the opener you " "have installed." msgstr "" -"``install_opener`` も (グローバルな) デフォルト ``opener`` オブジェクトの作成" -"に利用できます。つまり、 ``urlopen`` を呼び出すと、インストールした opener が" -"利用されます。" +"``install_opener`` を使うと、``opener`` オブジェクトを (グローバルな) デフォ" +"ルトの opener に設定できます。\n" +"以降、``urlopen`` の呼び出しは、登録した opener を使います。" #: ../../howto/urllib2.rst:391 msgid "" @@ -709,7 +826,6 @@ msgstr "" msgid "Basic Authentication" msgstr "Basic 認証" -#: ../../howto/urllib2.rst:399 msgid "" "To illustrate creating and installing a handler we will use the " "``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- " @@ -717,6 +833,10 @@ msgid "" "Authentication Tutorial `__." msgstr "" +"ハンドラーの作成と登録の例として、``HTTPBasicAuthHandler`` を使います。\n" +"Basic 認証の仕組みを含む詳しい説明は、`Basic 認証のチュートリアル `__ を参照してください。" #: ../../howto/urllib2.rst:405 msgid "" @@ -733,23 +853,21 @@ msgstr "" msgid "e.g." msgstr "例" -#: ../../howto/urllib2.rst:412 msgid "WWW-Authenticate: Basic realm=\"cPanel Users\"" -msgstr "" +msgstr "WWW-Authenticate: Basic realm=\"cPanel Users\"" -#: ../../howto/urllib2.rst:417 msgid "" "The client should then retry the request with the appropriate name and " "password for the realm included as a header in the request. This is 'basic " "authentication'. In order to simplify this process we can create an instance " "of ``HTTPBasicAuthHandler`` and an opener to use this handler." msgstr "" -"クライアントはリクエストヘッダに含まれる realm に対して適切な名前とパスワード" -"とともにリクエストを再試行する必要があります。これが 'basic 認証' です。一連" -"の流れを簡単化するために、 ``HTTPBasicAuthHandler`` のインスタンスを作成し、 " -"opener が handler を利用するようにします。" +"クライアントは、その realm に適した名前とパスワードをリクエストヘッダーに含め" +"て、リクエストを再試行します。\n" +"これが「Basic 認証」です。\n" +"この処理を簡単にするために、``HTTPBasicAuthHandler`` のインスタンスと、そのハ" +"ンドラーを使う opener を作成できます。" -#: ../../howto/urllib2.rst:422 msgid "" "The ``HTTPBasicAuthHandler`` uses an object called a password manager to " "handle the mapping of URLs and realms to passwords and usernames. If you " @@ -761,25 +879,26 @@ msgid "" "providing an alternative combination for a specific realm. We indicate this " "by providing ``None`` as the realm argument to the ``add_password`` method." msgstr "" -"``HTTPBasicAuthHandler`` はパスワードマネージャーと呼ばれる、 URL と realm を" -"パスワードとユーザ名への対応づけを処理する、オブジェクトを利用します。 realm " -"が何なのか(サーバから返される認証ヘッダから) 知りたい場合には、 " -"``HTTPPasswordMgr`` を利用できます。多くの場合、realm が何なのかについて気に" -"することはありません。そのような場合には ``HTTPPasswordMgrWithDefaultRealm`` " -"を使うと便利です。これは URL に対してデフォルトのユーザ名とパスワードを指定で" -"きます。これによって特定の realm に対する代替の組み合わせを提供することなしに" -"利用できるようになります。このことは ``add_password`` メソッドの realm 引数と" -"して ``None`` を与えることで明示することができます。" +"``HTTPBasicAuthHandler`` は、パスワードマネージャーというオブジェクトを使い、" +"URL と realm をユーザー名とパスワードに対応付けます。\n" +"サーバーからの認証ヘッダーで realm が分かっている場合は、``HTTPPasswordMgr`` " +"を使えます。\n" +"realm を特に気にしないことも多く、その場合は " +"``HTTPPasswordMgrWithDefaultRealm`` が便利です。\n" +"これを使うと、URL に対するデフォルトのユーザー名とパスワードを指定できま" +"す。\n" +"特定の realm に別の組み合わせを指定していなければ、このデフォルト値が使われま" +"す。\n" +"デフォルト値を登録するには、``add_password`` メソッドの ``realm`` 引数に " +"``None`` を渡します。" -#: ../../howto/urllib2.rst:432 msgid "" "The top-level URL is the first URL that requires authentication. URLs " "\"deeper\" than the URL you pass to .add_password() will also match. ::" msgstr "" -"トップレベルの URL が認証が必要なはじめに URL です。この URL よりも「深い」" -"URL を渡しても .add_password() は同様にマッチします。::" +"トップレベルの URL は、認証が必要になる最初の URL です。\n" +"``.add_password()`` に渡した URL より「深い」URL も対象になります。 ::" -#: ../../howto/urllib2.rst:435 msgid "" "# create a password manager\n" "password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()\n" @@ -801,8 +920,26 @@ msgid "" "# Now all calls to urllib.request.urlopen use our opener.\n" "urllib.request.install_opener(opener)" msgstr "" +"# パスワードマネージャーを作成する\n" +"password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()\n" +"\n" +"# ユーザー名とパスワードを追加する。\n" +"# realm が分かっていれば、None の代わりに指定できる。\n" +"top_level_url = \"http://example.com/foo/\"\n" +"password_mgr.add_password(None, top_level_url, username, password)\n" +"\n" +"handler = urllib.request.HTTPBasicAuthHandler(password_mgr)\n" +"\n" +"# \"opener\" (OpenerDirector のインスタンス) を作成する\n" +"opener = urllib.request.build_opener(handler)\n" +"\n" +"# opener を使って URL を取得する\n" +"opener.open(a_url)\n" +"\n" +"# opener を登録する。\n" +"# 以降の urllib.request.urlopen の呼び出しはすべてこの opener を使う。\n" +"urllib.request.install_opener(opener)" -#: ../../howto/urllib2.rst:457 msgid "" "In the above example we only supplied our ``HTTPBasicAuthHandler`` to " "``build_opener``. By default openers have the handlers for normal situations " @@ -811,6 +948,12 @@ msgid "" "``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, " "``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``." msgstr "" +"上の例では、``build_opener`` に ``HTTPBasicAuthHandler`` だけを渡しました。\n" +"デフォルトの opener には、通常の状況に対応するハンドラーが備わっています。\n" +"``ProxyHandler`` (:envvar:`!http_proxy` 環境変数などのプロキシ設定がある場" +"合)、``UnknownHandler``、``HTTPHandler``、``HTTPDefaultErrorHandler``、" +"``HTTPRedirectHandler``、``FTPHandler``、``FileHandler``、``DataHandler``、" +"``HTTPErrorProcessor`` です。" #: ../../howto/urllib2.rst:464 msgid "" @@ -849,12 +992,14 @@ msgstr "" "`Basic Authentication`_ handler を設定したときと同じような流れで行うことがで" "きます: ::" -#: ../../howto/urllib2.rst:483 msgid "" ">>> proxy_support = urllib.request.ProxyHandler({})\n" ">>> opener = urllib.request.build_opener(proxy_support)\n" ">>> urllib.request.install_opener(opener)" msgstr "" +">>> proxy_support = urllib.request.ProxyHandler({})\n" +">>> opener = urllib.request.build_opener(proxy_support)\n" +">>> urllib.request.install_opener(opener)" #: ../../howto/urllib2.rst:489 msgid "" @@ -904,7 +1049,6 @@ msgstr "" "ベルからは隠蔽されていています。しかし、以下を利用することで全てのソケットに" "対してグローバルにデフォルトタイムアウトを設定することができます ::" -#: ../../howto/urllib2.rst:511 msgid "" "import socket\n" "import urllib.request\n" @@ -918,6 +1062,17 @@ msgid "" "req = urllib.request.Request('http://www.voidspace.org.uk')\n" "response = urllib.request.urlopen(req)" msgstr "" +"import socket\n" +"import urllib.request\n" +"\n" +"# 秒単位のタイムアウト\n" +"timeout = 10\n" +"socket.setdefaulttimeout(timeout)\n" +"\n" +"# この urllib.request.urlopen の呼び出しは、socket モジュールに\n" +"# 設定したデフォルトのタイムアウトを使う\n" +"req = urllib.request.Request('http://www.voidspace.org.uk')\n" +"response = urllib.request.urlopen(req)" #: ../../howto/urllib2.rst:528 msgid "Footnotes" @@ -927,9 +1082,8 @@ msgstr "脚注" msgid "This document was reviewed and revised by John Lee." msgstr "このドキュメントは John Lee によって査読、改訂されました。" -#: ../../howto/urllib2.rst:532 msgid "Google for example." -msgstr "Google を例題にする。" +msgstr "例えば Google です。" #: ../../howto/urllib2.rst:533 msgid "" @@ -971,9 +1125,11 @@ msgstr "" "報を利用します。localhost のサーバでスクリプトをテストしようとすると、urllib " "がプロキシを利用するのを止めなければいけません。" -#: ../../howto/urllib2.rst:545 msgid "" "urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_." msgstr "" +"SSL プロキシ (CONNECT メソッド) 用の urllib opener: `ASPN Cookbook Recipe " +"`_。" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 261749a4b..d861af5cf 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -23,9 +23,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-eventloop.rst:8 msgid "Event loop" -msgstr "" +msgstr "イベントループ" msgid "" "**Source code:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/" diff --git a/library/concurrent.interpreters.po b/library/concurrent.interpreters.po index e6e5e5625..cf8d1a1b4 100644 --- a/library/concurrent.interpreters.po +++ b/library/concurrent.interpreters.po @@ -63,9 +63,8 @@ msgstr "" msgid "Combines threads with interpreters in a familiar interface." msgstr "" -#: ../../library/concurrent.interpreters.rst:33 msgid ":ref:`isolating-extensions-howto`" -msgstr "" +msgstr ":ref:`isolating-extensions-howto`" #: ../../library/concurrent.interpreters.rst:34 msgid "How to update an extension module to support multiple interpreters." diff --git a/library/enum.po b/library/enum.po index 392b0bc63..517e46efa 100644 --- a/library/enum.po +++ b/library/enum.po @@ -1605,7 +1605,6 @@ msgstr "" "__members__` に別名がないかどうか検索します; 見つかった場合、:exc:" "`ValueError` が詳細情報とともに送出されます::" -#: ../../library/enum.rst:1026 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -1619,6 +1618,17 @@ msgid "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" msgstr "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" #: ../../library/enum.rst:1040 msgid "" diff --git a/library/re.po b/library/re.po index 66a645913..7c394e212 100644 --- a/library/re.po +++ b/library/re.po @@ -1177,9 +1177,8 @@ msgid "" "neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:665 msgid "``\\z``" -msgstr "" +msgstr "``\\z``" #: ../../library/re.rst:666 msgid "Matches only at the end of the string." @@ -1189,9 +1188,10 @@ msgstr "文字列の末尾でのみマッチします。" msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:671 msgid "The same as ``\\z``. For compatibility with old Python versions." msgstr "" +"``\\z`` と同じです。\n" +"古い Python バージョンとの互換性のためにあります。" #: ../../library/re.rst:687 msgid "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 481e7f2a6..7d180acd9 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -3666,9 +3666,8 @@ msgid "" "surrogates." msgstr "" -#: ../../library/sqlite3.rst:2634 msgid ":ref:`unicode-howto`" -msgstr "" +msgstr ":ref:`unicode-howto`" #: ../../library/sqlite3.rst:2640 msgid "Explanation" diff --git a/library/sys.po b/library/sys.po index 018ddb97a..b9d49bff1 100644 --- a/library/sys.po +++ b/library/sys.po @@ -2925,9 +2925,8 @@ msgstr "" msgid "Stack trampolines cannot be activated if the JIT is active." msgstr "" -#: ../../library/sys.rst:2071 msgid ":ref:`perf_profiling`" -msgstr "" +msgstr ":ref:`perf_profiling`" #: ../../library/sys.rst:2072 msgid "https://perf.wiki.kernel.org" diff --git a/library/tkinter.po b/library/tkinter.po index 983ba082b..93285ff53 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7804,9 +7804,8 @@ msgid "" "this class is not normally used directly." msgstr "" -#: ../../library/tkinter.rst:6452 msgid "Module-level functions" -msgstr "" +msgstr "モジュールレベルの関数" #: ../../library/tkinter.rst:6456 msgid "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 5b5e2685a..4c71499af 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -3493,9 +3493,8 @@ msgstr "" msgid "async" msgstr "" -#: ../../reference/compound_stmts.rst:1637 msgid "await" -msgstr "" +msgstr "await" #: ../../reference/compound_stmts.rst:1661 msgid "async for" diff --git a/reference/expressions.po b/reference/expressions.po index 3d84aac8b..19776131b 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -3840,9 +3840,8 @@ msgstr "if" msgid "async for" msgstr "" -#: ../../reference/expressions.rst:900 ../../reference/expressions.rst:1735 msgid "await" -msgstr "" +msgstr "await" #: ../../reference/expressions.rst:956 ../../reference/expressions.rst:1073 msgid "generator" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index a78a68675..48f11fa6d 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -893,12 +893,14 @@ msgstr "" "で :meth:`readline` を呼び出すもので、つまりファイルを行ごとに読み出すのにこ" "のように書けるわけです::" -#: ../../whatsnew/2.2.rst:523 msgid "" "for line in file:\n" " # do something for each line\n" " ..." msgstr "" +"for line in file:\n" +" # 各行について処理する\n" +" ..." #: ../../whatsnew/2.2.rst:527 msgid "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 82457ea09..fcee72c13 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -772,9 +772,8 @@ msgid "" "that can be assigned to a variable or otherwise operated on::" msgstr "" -#: ../../whatsnew/2.5.rst:444 msgid "val = (yield i)" -msgstr "" +msgstr "val = (yield i)" #: ../../whatsnew/2.5.rst:446 msgid "" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index a4857b48d..5914c1e02 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -767,12 +767,14 @@ msgid "" "contains rationale and information surrounding this work." msgstr "" -#: ../../whatsnew/3.13.rst:358 msgid "" "`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " "extension authors." msgstr "" +"`Porting Extension Modules to Support Free-Threading `_: 拡張の開発者向けにコミュニティが保守している" +"移植ガイド。" #: ../../whatsnew/3.13.rst:366 msgid "An experimental just-in-time (JIT) compiler" @@ -4934,9 +4936,8 @@ msgstr "" msgid ":c:func:`PySys_AuditTuple`" msgstr "" -#: ../../whatsnew/3.13.rst:2341 msgid ":c:func:`PyType_GetModuleByDef`" -msgstr "" +msgstr ":c:func:`PyType_GetModuleByDef`" #: ../../whatsnew/3.13.rst:2343 msgid "(Contributed by Victor Stinner in :gh:`85283` and :gh:`116936`.)" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 26a22584c..9ad343d45 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -1894,9 +1894,8 @@ msgstr "" msgid "For example, if your ``tp_traverse`` function includes:" msgstr "" -#: ../../whatsnew/3.9.rst:1180 msgid "base->tp_traverse(self, visit, arg)" -msgstr "" +msgstr "base->tp_traverse(self, visit, arg)" #: ../../whatsnew/3.9.rst:1184 msgid "then add:" From c3f5851d4ae234415732f63d2bc32ead81b4c77b Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 26 Oct 2026 14:58:44 +0000 Subject: [PATCH 18/21] Merge 3.15 into 3.14 --- builtins/exceptions.po | 3 +- c-api/exceptions.po | 3 +- c-api/frame.po | 3 +- c-api/module.po | 4 +- c-api/monitoring.po | 54 +- c-api/structures.po | 23 +- deprecations/index.po | 17 +- deprecations/pending-removal-in-3.17.po | 17 +- howto/logging.po | 3 +- install/index.po | 15 +- library/__future__.po | 57 +- library/__main__.po | 245 +- library/_thread.po | 66 +- library/abc.po | 240 +- library/aifc.po | 6 +- library/annotationlib.po | 721 +++- library/archiving.po | 5 +- library/argparse.po | 1454 +++++-- library/array.po | 128 +- library/ast.po | 1876 +++++++-- library/asynchat.po | 13 +- library/asyncio-api-index.po | 13 +- library/asyncio-dev.po | 312 +- library/asyncio-eventloop.po | 666 ++- library/asyncio-extending.po | 90 +- library/asyncio-future.po | 73 +- library/asyncio-graph.po | 111 +- library/asyncio-llapi-index.po | 63 +- library/asyncio-platforms.po | 17 +- library/asyncio-policy.po | 40 +- library/asyncio-protocol.po | 295 +- library/asyncio-queue.po | 111 +- library/asyncio-runner.po | 120 +- library/asyncio-stream.po | 193 +- library/asyncio-subprocess.po | 144 +- library/asyncio-sync.po | 181 +- library/asyncio-task.po | 955 ++++- library/asyncio-threading.po | 127 +- library/asyncio-tools.po | 156 +- library/asyncio.po | 26 +- library/asyncore.po | 13 +- library/atexit.po | 93 +- library/audioop.po | 6 +- library/audit_events.po | 9 +- library/base64.po | 206 +- library/bdb.po | 199 +- library/binascii.po | 251 +- library/bisect.po | 117 +- library/builtins.po | 33 +- library/bz2.po | 48 +- library/calendar.po | 321 +- library/cgitb.po | 6 +- library/chunk.po | 6 +- library/cmath.po | 302 +- library/cmd.po | 130 +- library/cmdline.po | 45 +- library/code.po | 11 +- library/codecs.po | 411 +- library/codeop.po | 15 +- library/collections.abc.po | 86 +- library/collections.po | 391 +- library/colorsys.po | 22 +- library/compileall.po | 99 +- library/compression.po | 22 +- library/compression.zstd.po | 688 ++- library/concurrency.po | 10 +- library/concurrent.futures.po | 403 +- library/concurrent.interpreters.po | 338 +- library/concurrent.po | 6 +- library/configparser.po | 699 +++- library/contextlib.po | 599 ++- library/contextvars.po | 189 +- library/copy.po | 47 +- library/copyreg.po | 9 +- library/crypt.po | 12 +- library/crypto.po | 8 +- library/csv.po | 296 +- library/ctypes.po | 1867 ++++++--- library/curses.ascii.po | 19 +- library/curses.panel.po | 26 +- library/curses.po | 583 ++- library/dataclasses.po | 733 +++- library/datatypes.po | 6 +- library/datetime.po | 1225 ++++-- library/dbm.po | 362 +- library/debug.po | 3 +- library/decimal.po | 634 ++- library/devmode.po | 133 +- library/dialog.po | 210 +- library/difflib.po | 263 +- library/dis.po | 1194 +++--- library/distutils.po | 12 +- library/doctest.po | 731 +++- library/email.charset.po | 5 +- library/email.compat32-message.po | 263 +- library/email.contentmanager.po | 147 +- library/email.encoders.po | 12 +- library/email.errors.po | 84 +- library/email.examples.po | 349 +- library/email.generator.po | 160 +- library/email.header.po | 71 +- library/email.headerregistry.po | 227 +- library/email.iterators.po | 23 +- library/email.message.po | 414 +- library/email.mime.po | 53 +- library/email.parser.po | 141 +- library/email.po | 94 +- library/email.policy.po | 407 +- library/email.utils.po | 42 +- library/ensurepip.po | 35 +- library/enum.po | 516 ++- library/errno.po | 155 +- library/exceptions.po | 3 +- library/faulthandler.po | 171 +- library/fcntl.po | 172 +- library/filecmp.po | 57 +- library/fileinput.po | 36 +- library/fnmatch.po | 31 +- library/fractions.po | 134 +- library/frameworks.po | 13 +- library/ftplib.po | 243 +- library/functools.po | 538 ++- library/gc.po | 107 +- library/getopt.po | 194 +- library/getpass.po | 49 +- library/gettext.po | 309 +- library/glob.po | 44 +- library/graphlib.po | 132 +- library/grp.po | 5 +- library/gzip.po | 132 +- library/hashlib.po | 428 +- library/heapq.po | 193 +- library/hmac.po | 45 +- library/html.parser.po | 214 +- library/html.po | 10 +- library/http.client.po | 318 +- library/http.cookiejar.po | 255 +- library/http.cookies.po | 105 +- library/http.po | 57 +- library/http.server.po | 377 +- library/idle.po | 738 +++- library/imaplib.po | 312 +- library/imghdr.po | 10 +- library/imp.po | 13 +- library/importlib.metadata.po | 529 ++- library/importlib.po | 548 ++- library/importlib.resources.abc.po | 119 +- library/importlib.resources.po | 179 +- library/index.po | 22 +- library/inspect.po | 397 +- library/intro.po | 97 +- library/io.po | 498 ++- library/ipaddress.po | 338 +- library/itertools.po | 1051 ++++- library/json.po | 278 +- library/linecache.po | 21 +- library/locale.po | 218 +- library/logging.config.po | 347 +- library/logging.handlers.po | 155 +- library/logging.po | 96 +- library/lzma.po | 147 +- library/mailbox.po | 146 +- library/mailcap.po | 6 +- library/marshal.po | 140 +- library/math.po | 422 +- library/mimetypes.po | 137 +- library/mmap.po | 192 +- library/modulefinder.po | 44 +- library/msilib.po | 6 +- library/msvcrt.po | 108 +- library/multiprocessing.po | 1615 ++++++-- library/multiprocessing.shared_memory.po | 303 +- library/netrc.po | 9 +- library/nis.po | 6 +- library/nntplib.po | 6 +- library/numbers.po | 124 +- library/operator.po | 105 +- library/optparse.po | 1217 ++++-- library/os.path.po | 303 +- library/os.po | 2334 +++++++---- library/ossaudiodev.po | 6 +- library/pathlib.po | 900 +++- library/pdb.po | 436 +- library/pickle.po | 545 ++- library/pickletools.po | 31 +- library/pipes.po | 8 +- library/pkgutil.po | 130 +- library/platform.po | 133 +- library/plistlib.po | 58 +- library/poplib.po | 34 +- library/posix.po | 48 +- library/pprint.po | 143 +- library/profile.po | 209 +- library/pty.po | 73 +- library/pwd.po | 15 +- library/py_compile.po | 82 +- library/pyclbr.po | 83 +- library/pydoc.po | 60 +- library/pyexpat.po | 396 +- library/python.po | 9 +- library/queue.po | 127 +- library/random.po | 314 +- library/re.po | 792 +++- library/readline.po | 243 +- library/reprlib.po | 110 +- library/resource.po | 133 +- library/rlcompleter.po | 39 +- library/runpy.po | 116 +- library/sched.po | 37 +- library/secrets.po | 64 +- library/security_warnings.po | 49 +- library/select.po | 329 +- library/selectors.po | 68 +- library/shelve.po | 131 +- library/shlex.po | 165 +- library/shutil.po | 293 +- library/signal.po | 394 +- library/site.po | 320 +- library/smtpd.po | 14 +- library/smtplib.po | 243 +- library/sndhdr.po | 10 +- library/socket.po | 1020 +++-- library/socketserver.po | 311 +- library/spwd.po | 9 +- library/sqlite3.po | 753 +++- library/ssl.po | 1135 +++-- library/stat.po | 86 +- library/statistics.po | 719 +++- library/string.po | 317 +- library/string.templatelib.po | 143 +- library/stringprep.po | 21 +- library/struct.po | 360 +- library/subprocess.po | 650 ++- library/sunau.po | 6 +- library/superseded.po | 13 +- library/symtable.po | 144 +- library/sys.monitoring.po | 403 +- library/sys.po | 1297 ++++-- library/sys_path_init.po | 113 +- library/sysconfig.po | 308 +- library/syslog.po | 60 +- library/tarfile.po | 784 ++-- library/telnetlib.po | 10 +- library/tempfile.po | 172 +- library/termios.po | 55 +- library/test.po | 1043 +++-- library/text.po | 8 +- library/textwrap.po | 92 +- library/threading.po | 706 +++- library/time.po | 399 +- library/timeit.po | 84 +- library/tk.po | 15 +- library/tkinter.colorchooser.po | 19 +- library/tkinter.dnd.po | 52 +- library/tkinter.font.po | 106 +- library/tkinter.messagebox.po | 131 +- library/tkinter.po | 4840 +++++++++++++++------- library/tkinter.scrolledtext.po | 17 +- library/tkinter.ttk.po | 768 ++-- library/token.po | 273 +- library/tokenize.po | 123 +- library/tomllib.po | 68 +- library/trace.po | 45 +- library/traceback.po | 347 +- library/tracemalloc.po | 346 +- library/tty.po | 41 +- library/turtle.po | 1402 +++++-- library/types.po | 233 +- library/typing.po | 2991 +++++++++---- library/unicodedata.po | 322 +- library/unittest.mock-examples.po | 507 ++- library/unittest.mock.po | 982 +++-- library/unittest.po | 656 ++- library/unix.po | 3 +- library/urllib.error.po | 4 +- library/urllib.parse.po | 333 +- library/urllib.request.po | 337 +- library/urllib.robotparser.po | 45 +- library/uu.po | 9 +- library/uuid.po | 182 +- library/venv.po | 167 +- library/warnings.po | 451 +- library/wave.po | 128 +- library/weakref.po | 269 +- library/webbrowser.po | 114 +- library/winreg.po | 72 +- library/winsound.po | 29 +- library/wsgiref.po | 252 +- library/xdrlib.po | 6 +- library/xml.dom.minidom.po | 174 +- library/xml.dom.po | 477 ++- library/xml.dom.pulldom.po | 122 +- library/xml.etree.elementtree.po | 706 +++- library/xml.po | 64 +- library/xml.sax.handler.po | 154 +- library/xml.sax.po | 68 +- library/xml.sax.reader.po | 70 +- library/xml.sax.utils.po | 31 +- library/xmlrpc.client.po | 242 +- library/xmlrpc.server.po | 169 +- library/zipapp.po | 180 +- library/zipfile.po | 487 ++- library/zipimport.po | 41 +- library/zlib.po | 250 +- library/zoneinfo.po | 322 +- reference/compound_stmts.po | 7 +- reference/datamodel.po | 3 +- reference/expressions.po | 6 +- reference/lexical_analysis.po | 3 +- whatsnew/3.10.po | 6 +- whatsnew/3.12.po | 22 +- whatsnew/3.13.po | 17 +- whatsnew/3.14.po | 20 +- whatsnew/3.2.po | 9 +- whatsnew/3.5.po | 6 +- whatsnew/3.6.po | 3 +- whatsnew/3.7.po | 7 +- 317 files changed, 60778 insertions(+), 21883 deletions(-) diff --git a/builtins/exceptions.po b/builtins/exceptions.po index 3d91da35e..d45d016da 100644 --- a/builtins/exceptions.po +++ b/builtins/exceptions.po @@ -1394,9 +1394,8 @@ msgstr "" "この警告は通常、Python ソースコードのコンパイル時に発生し、コンパイル済みの" "コードの実行時には通常は報告されません。" -#: ../../builtins/exceptions.rst:912 msgid "Base class for warnings about dubious runtime behavior." -msgstr "あいまいなランタイム挙動に対する警告の基底クラスです。" +msgstr "疑わしい実行時の動作についての警告の基底クラスです。" #: ../../builtins/exceptions.rst:917 msgid "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 105c157e8..548231786 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -1777,9 +1777,8 @@ msgstr ":exc:`BytesWarning`" msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1320 msgid ":exc:`EncodingWarning`" -msgstr "" +msgstr ":exc:`EncodingWarning`" #: ../../c-api/exceptions.rst:1322 msgid ":exc:`FutureWarning`" diff --git a/c-api/frame.po b/c-api/frame.po index 158ec84be..8182a199b 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -243,9 +243,8 @@ msgid "" "an exception set on failure." msgstr "" -#: ../../c-api/frame.rst:213 msgid ":pep:`667`" -msgstr "" +msgstr ":pep:`667`" #: ../../c-api/frame.rst:217 msgid "Internal frames" diff --git a/c-api/module.po b/c-api/module.po index 2feae0822..361c817ee 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -1114,11 +1114,13 @@ msgid "" "respectively. Defined for backwards compatibility." msgstr "" -#: ../../c-api/module.rst:902 ../../c-api/module.rst:910 msgid "" "Currently, this constant is not updated in new Python versions, and is not " "useful for versioning. This may change in the future." msgstr "" +"現在、この定数は新しい Python バージョンでも更新されないため、バージョンの判" +"別には役立ちません。\n" +"将来は変更される可能性があります。" #: ../../c-api/module.rst:908 msgid "" diff --git a/c-api/monitoring.po b/c-api/monitoring.po index ede1b8418..3fad417ac 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -220,77 +220,59 @@ msgstr "" msgid "Event" msgstr "Event" -#: ../../c-api/monitoring.rst:176 msgid ":monitoring-event:`BRANCH_LEFT`" -msgstr "" +msgstr ":monitoring-event:`BRANCH_LEFT`" -#: ../../c-api/monitoring.rst:177 msgid ":monitoring-event:`BRANCH_RIGHT`" -msgstr "" +msgstr ":monitoring-event:`BRANCH_RIGHT`" -#: ../../c-api/monitoring.rst:178 msgid ":monitoring-event:`CALL`" -msgstr "" +msgstr ":monitoring-event:`CALL`" -#: ../../c-api/monitoring.rst:179 msgid ":monitoring-event:`C_RAISE`" -msgstr "" +msgstr ":monitoring-event:`C_RAISE`" -#: ../../c-api/monitoring.rst:180 msgid ":monitoring-event:`C_RETURN`" -msgstr "" +msgstr ":monitoring-event:`C_RETURN`" -#: ../../c-api/monitoring.rst:181 msgid ":monitoring-event:`EXCEPTION_HANDLED`" -msgstr "" +msgstr ":monitoring-event:`EXCEPTION_HANDLED`" -#: ../../c-api/monitoring.rst:182 msgid ":monitoring-event:`INSTRUCTION`" -msgstr "" +msgstr ":monitoring-event:`INSTRUCTION`" -#: ../../c-api/monitoring.rst:183 msgid ":monitoring-event:`JUMP`" -msgstr "" +msgstr ":monitoring-event:`JUMP`" -#: ../../c-api/monitoring.rst:184 msgid ":monitoring-event:`LINE`" -msgstr "" +msgstr ":monitoring-event:`LINE`" -#: ../../c-api/monitoring.rst:185 msgid ":monitoring-event:`PY_RESUME`" -msgstr "" +msgstr ":monitoring-event:`PY_RESUME`" -#: ../../c-api/monitoring.rst:186 msgid ":monitoring-event:`PY_RETURN`" -msgstr "" +msgstr ":monitoring-event:`PY_RETURN`" -#: ../../c-api/monitoring.rst:187 msgid ":monitoring-event:`PY_START`" -msgstr "" +msgstr ":monitoring-event:`PY_START`" -#: ../../c-api/monitoring.rst:188 msgid ":monitoring-event:`PY_THROW`" -msgstr "" +msgstr ":monitoring-event:`PY_THROW`" -#: ../../c-api/monitoring.rst:189 msgid ":monitoring-event:`PY_UNWIND`" -msgstr "" +msgstr ":monitoring-event:`PY_UNWIND`" -#: ../../c-api/monitoring.rst:190 msgid ":monitoring-event:`PY_YIELD`" -msgstr "" +msgstr ":monitoring-event:`PY_YIELD`" -#: ../../c-api/monitoring.rst:191 msgid ":monitoring-event:`RAISE`" -msgstr "" +msgstr ":monitoring-event:`RAISE`" -#: ../../c-api/monitoring.rst:192 msgid ":monitoring-event:`RERAISE`" -msgstr "" +msgstr ":monitoring-event:`RERAISE`" -#: ../../c-api/monitoring.rst:193 msgid ":monitoring-event:`STOP_ITERATION`" -msgstr "" +msgstr ":monitoring-event:`STOP_ITERATION`" #: ../../c-api/monitoring.rst:198 msgid "" diff --git a/c-api/structures.po b/c-api/structures.po index 9587038e1..a2f43f759 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -955,14 +955,8 @@ msgstr "Python の型" msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../c-api/structures.rst:787 ../../c-api/structures.rst:788 -#: ../../c-api/structures.rst:789 ../../c-api/structures.rst:790 -#: ../../c-api/structures.rst:791 ../../c-api/structures.rst:792 -#: ../../c-api/structures.rst:793 ../../c-api/structures.rst:794 -#: ../../c-api/structures.rst:795 ../../c-api/structures.rst:796 -#: ../../c-api/structures.rst:797 msgid ":py:class:`int`" -msgstr "" +msgstr ":py:class:`int`" #: ../../c-api/structures.rst:788 msgid ":c:expr:`short`" @@ -976,9 +970,8 @@ msgstr ":c:expr:`int`" msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:791 msgid ":c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`long long`" #: ../../c-api/structures.rst:792 msgid ":c:expr:`unsigned char`" @@ -996,9 +989,8 @@ msgstr ":c:expr:`unsigned short`" msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:796 msgid ":c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned long long`" #: ../../c-api/structures.rst:797 msgid ":c:expr:`Py_ssize_t`" @@ -1008,9 +1000,8 @@ msgstr "" msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:798 ../../c-api/structures.rst:799 msgid ":py:class:`float`" -msgstr "" +msgstr ":py:class:`float`" #: ../../c-api/structures.rst:799 msgid ":c:expr:`double`" @@ -1020,9 +1011,8 @@ msgstr ":c:expr:`double`" msgid ":c:expr:`char` (written as 0 or 1)" msgstr "" -#: ../../c-api/structures.rst:800 msgid ":py:class:`bool`" -msgstr "" +msgstr ":py:class:`bool`" #: ../../c-api/structures.rst:802 msgid ":c:expr:`const char *` (*)" @@ -1044,9 +1034,8 @@ msgstr "" msgid ":py:class:`str` (**)" msgstr "" -#: ../../c-api/structures.rst:805 msgid ":c:expr:`PyObject *`" -msgstr "" +msgstr ":c:expr:`PyObject *`" #: ../../c-api/structures.rst:805 msgid ":py:class:`object` (D)" diff --git a/deprecations/index.po b/deprecations/index.po index af54b0e24..fca162850 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -247,8 +247,6 @@ msgid "" ":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." msgstr "" -#: ../../deprecations/pending-removal-in-3.17.rst:16 -#: ../../deprecations/pending-removal-in-3.17.rst:62 msgid "" "Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " "implements the :ref:`buffer protocol ` at runtime. For use in " @@ -256,9 +254,13 @@ msgid "" "that explicitly specifies the types your code supports (e.g., ``bytes | " "bytearray | memoryview``)." msgstr "" +"実行時に ``obj`` が :ref:`バッファプロトコル ` を実装している" +"か調べるには、``isinstance(obj, collections.abc.Buffer)`` を使ってくださ" +"い。\n" +"型アノテーションには :class:`~collections.abc.Buffer` を使うか、コードが対応" +"する型を明示したユニオン (例えば ``bytes | bytearray | memoryview``) を使って" +"ください。" -#: ../../deprecations/pending-removal-in-3.17.rst:22 -#: ../../deprecations/pending-removal-in-3.17.rst:68 msgid "" ":class:`!ByteString` was originally intended to be an abstract class that " "would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " @@ -268,6 +270,13 @@ msgid "" "also never understood as subtypes of :class:`!ByteString` (either at runtime " "or by static type checkers)." msgstr "" +":class:`!ByteString` は元々、:class:`bytes` と :class:`bytearray` の両方の" +"スーパータイプとなる抽象クラスを意図していました。\n" +"しかし、この抽象基底クラスにはメソッドがなかったため、オブジェクトが :class:" +"`!ByteString` のインスタンスであると分かっても、実際には有用な情報は得られま" +"せんでした。\n" +":class:`memoryview` など、他の一般的なバッファ型も、実行時にも静的型チェッ" +"カーでも :class:`!ByteString` のサブタイプとはみなされていませんでした。" #: ../../deprecations/pending-removal-in-3.17.rst:30 #: ../../deprecations/pending-removal-in-3.17.rst:76 diff --git a/deprecations/pending-removal-in-3.17.po b/deprecations/pending-removal-in-3.17.po index 5c8af27cc..620c54d59 100644 --- a/deprecations/pending-removal-in-3.17.po +++ b/deprecations/pending-removal-in-3.17.po @@ -42,8 +42,6 @@ msgid "" ":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." msgstr "" -#: ../../deprecations/pending-removal-in-3.17.rst:16 -#: ../../deprecations/pending-removal-in-3.17.rst:62 msgid "" "Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " "implements the :ref:`buffer protocol ` at runtime. For use in " @@ -51,9 +49,13 @@ msgid "" "that explicitly specifies the types your code supports (e.g., ``bytes | " "bytearray | memoryview``)." msgstr "" +"実行時に ``obj`` が :ref:`バッファプロトコル ` を実装している" +"か調べるには、``isinstance(obj, collections.abc.Buffer)`` を使ってくださ" +"い。\n" +"型アノテーションには :class:`~collections.abc.Buffer` を使うか、コードが対応" +"する型を明示したユニオン (例えば ``bytes | bytearray | memoryview``) を使って" +"ください。" -#: ../../deprecations/pending-removal-in-3.17.rst:22 -#: ../../deprecations/pending-removal-in-3.17.rst:68 msgid "" ":class:`!ByteString` was originally intended to be an abstract class that " "would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " @@ -63,6 +65,13 @@ msgid "" "also never understood as subtypes of :class:`!ByteString` (either at runtime " "or by static type checkers)." msgstr "" +":class:`!ByteString` は元々、:class:`bytes` と :class:`bytearray` の両方の" +"スーパータイプとなる抽象クラスを意図していました。\n" +"しかし、この抽象基底クラスにはメソッドがなかったため、オブジェクトが :class:" +"`!ByteString` のインスタンスであると分かっても、実際には有用な情報は得られま" +"せんでした。\n" +":class:`memoryview` など、他の一般的なバッファ型も、実行時にも静的型チェッ" +"カーでも :class:`!ByteString` のサブタイプとはみなされていませんでした。" #: ../../deprecations/pending-removal-in-3.17.rst:30 #: ../../deprecations/pending-removal-in-3.17.rst:76 diff --git a/howto/logging.po b/howto/logging.po index ba204b6ab..31aa76bd7 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -208,11 +208,10 @@ msgstr "より重大な問題により、ソフトウェアがある機能を実 msgid "``CRITICAL``" msgstr "``CRITICAL``" -#: ../../howto/logging.rst:91 msgid "" "A serious error, indicating that the program itself may be unable to " "continue running." -msgstr "プログラム自体が実行を続けられないことを表す、重大なエラー。" +msgstr "プログラム自体が実行を継続できない可能性を示す、重大なエラー。" msgid "" "The default level is ``WARNING``, which means that only events of this " diff --git a/install/index.po b/install/index.po index dd8808bd0..523447180 100644 --- a/install/index.po +++ b/install/index.po @@ -782,7 +782,6 @@ msgstr "(Windows の場合はスラッシュをバックスラッシュに脳内 msgid "Alternate installation: Unix (the prefix scheme)" msgstr "別の場所へのインストール: Unix (prefix スキーム)" -#: ../../install/index.rst:400 msgid "" "The \"prefix scheme\" is useful when you wish to use one Python installation " "to perform the build/install (i.e., to run the setup script), but install " @@ -792,13 +791,13 @@ msgid "" "and home schemes come before. However, there are at least two known cases " "where the prefix scheme will be useful." msgstr "" -"あるインストール済みの Python を使ってモジュールのビルド/インストールを (例え" -"ば setup スクリプトを実行して) 行いたいけれども、 別のインストール済みの " -"Python のサードパーティ製モジュール置き場 (あるいは、そう見えるようなディレク" -"トリ構造) に、ビルドされた モジュールをインストールしたい場合には、\"prefix " -"スキーム\" が便利です。そんな作業はまったくありえそうにない、と思うなら、確か" -"にその通りです --- \"home スキーム\" を先に説明したのもそのためです。とはい" -"え、prefix スキームが有用なケースは少なくとも二つあります。" +"ある Python 環境を使ってビルドやインストール (setup スクリプトの実行) を行い" +"ながら、別の Python 環境のサードパーティーモジュール用ディレクトリ (またはそ" +"れに似た構成のディレクトリ) にモジュールをインストールしたい場合、プレフィッ" +"クススキームが便利です。\n" +"少し変わった使い方に思えるかもしれませんが、その通りです。\n" +"そのため、ユーザースキームとホームスキームを先に説明しました。\n" +"それでも、プレフィックススキームが役立つ場面は少なくとも 2 つあります。" #: ../../install/index.rst:407 msgid "" diff --git a/library/__future__.po b/library/__future__.po index ada1f1f55..a8aa46b79 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -42,13 +42,17 @@ msgstr "" "標準になるリリースの前に Python コンパイラーが future 文を含むモジュールで " "Python の新機能を使用できるようにします。" -#: ../../library/__future__.rst:16 msgid "" "While these future statements are given additional special meaning by the " "Python compiler, they are still executed like any other import statement and " "the :mod:`!__future__` exists and is handled by the import system the same " "way any other Python module would be. This design serves three purposes:" msgstr "" +"Python コンパイラはこれらの future 文に特別な意味を与えますが、文自体は他の " +"import 文と同じように実行されます。\n" +":mod:`!__future__` も実在するモジュールで、インポートシステムは他の Python モ" +"ジュールと同じように扱います。\n" +"この設計には三つの目的があります。" #: ../../library/__future__.rst:21 msgid "" @@ -58,48 +62,52 @@ msgstr "" "import 文を解析する既存のツールを混乱させることを避け、インポートしようとして" "いるモジュールを見つけられるようにするため。" -#: ../../library/__future__.rst:24 msgid "" "To document when incompatible changes were introduced, and when they will be " "--- or were --- made mandatory. This is a form of executable documentation, " "and can be inspected programmatically via importing :mod:`!__future__` and " "examining its contents." msgstr "" +"互換性のない変更がいつ導入され、いつ必須になる予定か、またはいつ必須になった" +"かを記録するため。\n" +"これは実行可能なドキュメントの一種で、:mod:`!__future__` をインポートして内容" +"を調べることで、プログラムから確認できます。" -#: ../../library/__future__.rst:29 msgid "" "To ensure that :ref:`future statements ` run under releases prior to " "Python 2.1 at least yield runtime exceptions (the import of :mod:`!" "__future__` will fail, because there was no module of that name prior to " "2.1)." msgstr "" +"Python 2.1 より前のリリースで :ref:`future 文 ` を実行した場合に、少" +"なくとも実行時例外が発生するようにするため。\n" +"(2.1 より前にはその名前のモジュールがないため、:mod:`!__future__` のインポー" +"トは失敗します。)" #: ../../library/__future__.rst:34 msgid "Module Contents" msgstr "モジュールコンテンツ" -#: ../../library/__future__.rst:36 msgid "" "No feature description will ever be deleted from :mod:`!__future__`. Since " "its introduction in Python 2.1 the following features have found their way " "into the language using this mechanism:" msgstr "" +":mod:`!__future__` から機能の説明が削除されることはありません。\n" +"Python 2.1 での導入以来、次の機能がこの仕組みを通して言語に取り入れられまし" +"た。" -#: ../../library/__future__.rst:45 msgid "feature" -msgstr "feature" +msgstr "機能" -#: ../../library/__future__.rst:46 msgid "optional in" -msgstr "optional in" +msgstr "選択可能になったリリース" -#: ../../library/__future__.rst:47 msgid "mandatory in" -msgstr "mandatory in" +msgstr "必須になったリリース" -#: ../../library/__future__.rst:48 msgid "effect" -msgstr "effect" +msgstr "内容" #: ../../library/__future__.rst:50 msgid "2.1.0b1" @@ -150,9 +158,8 @@ msgstr ":pep:`328`: *Imports: Multi-Line and Absolute/Relative*" msgid "2.6" msgstr "2.6" -#: ../../library/__future__.rst:68 msgid ":pep:`343`: *The “with” Statement*" -msgstr "" +msgstr ":pep:`343`: *「with」文*" #: ../../library/__future__.rst:70 ../../library/__future__.rst:74 msgid "2.6.0a2" @@ -182,25 +189,26 @@ msgstr ":pep:`479`: *StopIteration handling inside generators*" msgid "3.7.0b1" msgstr "3.7.0b1" -#: ../../library/__future__.rst:83 msgid "Never [1]_" -msgstr "" +msgstr "予定なし [1]_" -#: ../../library/__future__.rst:84 msgid "" ":pep:`563`: *Postponed evaluation of annotations*, :pep:`649`: *Deferred " "evaluation of annotations using descriptors*" msgstr "" +":pep:`563`: *アノテーションの評価の延期*、:pep:`649`: *デスクリプタを使ったア" +"ノテーションの遅延評価*" #: ../../library/__future__.rst:93 msgid "Each statement in :file:`__future__.py` is of the form::" msgstr ":file:`__future__.py` のそれぞれの文は次のような形式をしています::" -#: ../../library/__future__.rst:95 msgid "" "FeatureName = _Feature(OptionalRelease, MandatoryRelease,\n" " CompilerFlag)" msgstr "" +"FeatureName = _Feature(OptionalRelease, MandatoryRelease,\n" +" CompilerFlag)" msgid "" "where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " @@ -209,7 +217,6 @@ msgstr "" "通常、*OptionalRelease* は *MandatoryRelease* より小さく、どちらも :data:" "`sys.version_info` と同じ形式の 5 要素のタプルです。 ::" -#: ../../library/__future__.rst:101 msgid "" "(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int\n" " PY_MINOR_VERSION, # the 1; an int\n" @@ -219,6 +226,13 @@ msgid "" " PY_RELEASE_SERIAL # the 3; an int\n" ")" msgstr "" +"(PY_MAJOR_VERSION, # 2.1.0a3 の 2。整数\n" +" PY_MINOR_VERSION, # 1。整数\n" +" PY_MICRO_VERSION, # 0。整数\n" +" PY_RELEASE_LEVEL, # \"alpha\", \"beta\", \"candidate\", \"final\" のいずれ" +"か。文字列\n" +" PY_RELEASE_SERIAL # 3。整数\n" +")" #: ../../library/__future__.rst:110 msgid "" @@ -266,13 +280,16 @@ msgstr "" "のフラグは :class:`_Feature` インスタンスの :attr:`_Feature.compiler_flag` 属" "性に保存されています。" -#: ../../library/__future__.rst:133 msgid "" "``from __future__ import annotations`` was previously scheduled to become " "mandatory in Python 3.10, but the change was delayed and ultimately " "canceled. This feature will eventually be deprecated and removed. See :pep:" "`649` and :pep:`749`." msgstr "" +"``from __future__ import annotations`` は、以前は Python 3.10 で必須になる予" +"定でしたが、延期された後、最終的に取りやめになりました。\n" +"この機能はいずれ非推奨となり、削除される予定です。\n" +":pep:`649` と :pep:`749` を参照してください。" #: ../../library/__future__.rst:141 msgid ":ref:`future`" diff --git a/library/__main__.po b/library/__main__.po index a76985276..e1a4a14f2 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -76,12 +76,14 @@ msgstr "" "通常、インポートされる Python ファイル自体のファイル名から拡張子 ``.py`` を除" "いたものとなります::" -#: ../../library/__main__.rst:31 msgid "" ">>> import configparser\n" ">>> configparser.__name__\n" "'configparser'" msgstr "" +">>> import configparser\n" +">>> configparser.__name__\n" +"'configparser'" #: ../../library/__main__.rst:35 msgid "" @@ -91,12 +93,14 @@ msgstr "" "インポートされるファイルがパッケージの一部である場合は、 ``__name__`` にはそ" "のパッケージのパスも含まれます::" -#: ../../library/__main__.rst:38 msgid "" ">>> from concurrent.futures import process\n" ">>> process.__name__\n" "'concurrent.futures.process'" msgstr "" +">>> from concurrent.futures import process\n" +">>> process.__name__\n" +"'concurrent.futures.process'" #: ../../library/__main__.rst:42 msgid "" @@ -132,21 +136,23 @@ msgstr "以下のものがトップレベルのスクリプト環境となりま msgid "the scope of an interactive prompt::" msgstr "インタラクティブプロンプトのスコープ::" -#: ../../library/__main__.rst:57 msgid "" ">>> __name__\n" "'__main__'" msgstr "" +">>> __name__\n" +"'__main__'" #: ../../library/__main__.rst:60 msgid "the Python module passed to the Python interpreter as a file argument:" msgstr "Python インタープリタにファイル引数として渡される Python モジュール:" -#: ../../library/__main__.rst:62 msgid "" "$ python helloworld.py\n" "Hello, world!" msgstr "" +"$ python helloworld.py\n" +"Hello, world!" #: ../../library/__main__.rst:67 msgid "" @@ -156,17 +162,17 @@ msgstr "" "Python インタープリタにPython :option:`-m` オプションとして渡される Python モ" "ジュールまたはパッケージ:" -#: ../../library/__main__.rst:70 msgid "" "$ python -m tarfile\n" "usage: tarfile.py [-h] [-v] (...)" msgstr "" +"$ python -m tarfile\n" +"usage: tarfile.py [-h] [-v] (...)" #: ../../library/__main__.rst:75 msgid "Python code read by the Python interpreter from standard input:" msgstr "標準入力から Python インタープリタが読み込む Python コード:" -#: ../../library/__main__.rst:77 msgid "" "$ echo \"import this\" | python\n" "The Zen of Python, by Tim Peters\n" @@ -175,6 +181,12 @@ msgid "" "Explicit is better than implicit.\n" "..." msgstr "" +"$ echo \"import this\" | python\n" +"The Zen of Python, by Tim Peters\n" +"\n" +"Beautiful is better than ugly.\n" +"Explicit is better than implicit.\n" +"..." #: ../../library/__main__.rst:86 msgid "" @@ -182,7 +194,6 @@ msgid "" msgstr "" "Python インタープリタに :option:`-c` オプションで渡される Python コード:" -#: ../../library/__main__.rst:88 msgid "" "$ python -c \"import this\"\n" "The Zen of Python, by Tim Peters\n" @@ -191,6 +202,12 @@ msgid "" "Explicit is better than implicit.\n" "..." msgstr "" +"$ python -c \"import this\"\n" +"The Zen of Python, by Tim Peters\n" +"\n" +"Beautiful is better than ugly.\n" +"Explicit is better than implicit.\n" +"..." #: ../../library/__main__.rst:97 msgid "" @@ -212,12 +229,14 @@ msgstr "" "このことから、モジュールが import 文で初期化された場合以外の場合でのみコード" "を実行するため、次のコードがしばしば用いられます::" -#: ../../library/__main__.rst:105 msgid "" "if __name__ == '__main__':\n" " # Execute when the module is not initialized from an import statement.\n" " ..." msgstr "" +"if __name__ == '__main__':\n" +" # モジュールが import 文で初期化された場合以外に実行する。\n" +" ..." #: ../../library/__main__.rst:111 msgid "" @@ -264,7 +283,6 @@ msgstr "" "最もよくあるのが、プログラムの主要な処理を ``main`` 関数の中にカプセル化する" "ことです::" -#: ../../library/__main__.rst:131 msgid "" "# echo.py\n" "\n" @@ -286,6 +304,25 @@ msgid "" "if __name__ == '__main__':\n" " sys.exit(main()) # next section explains the use of sys.exit" msgstr "" +"# echo.py\n" +"\n" +"import shlex\n" +"import sys\n" +"\n" +"def echo(phrase: str) -> None:\n" +" \"\"\"print を呼び出すだけのダミーのラッパー。\"\"\"\n" +" # 説明のため、この関数に有用で再利用可能な処理が\n" +" # 含まれていると考える\n" +" print(phrase)\n" +"\n" +"def main() -> int:\n" +" \"\"\"入力された引数を標準出力に出力する\"\"\"\n" +" phrase = shlex.join(sys.argv)\n" +" echo(phrase)\n" +" return 0\n" +"\n" +"if __name__ == '__main__':\n" +" sys.exit(main()) # sys.exit の使い方は次の節で説明" #: ../../library/__main__.rst:151 msgid "" @@ -320,35 +357,42 @@ msgstr "" msgid "Packaging Considerations" msgstr "パッケージングで考慮すべき点" -#: ../../library/__main__.rst:167 msgid "" "``main`` functions are often used to create command-line tools by specifying " "them as entry points for console scripts. When this is done, `pip `_ inserts the function call into a template script, where the " "return value of ``main`` is passed into :func:`sys.exit`. For example::" msgstr "" +"``main`` 関数は、コンソールスクリプトのエントリーポイントに指定して、コマンド" +"ラインツールを作るためによく使われます。\n" +"この場合、`pip `_ は関数呼び出しをテンプレートのスクリ" +"プトに挿入し、``main`` の戻り値を :func:`sys.exit` に渡します。\n" +"例えば、次のようになります。 ::" -#: ../../library/__main__.rst:173 msgid "sys.exit(main())" -msgstr "" +msgstr "sys.exit(main())" -#: ../../library/__main__.rst:175 msgid "" "Since the call to ``main`` is wrapped in :func:`sys.exit`, the expectation " "is that your function will return some value acceptable as an input to :func:" "`sys.exit`; typically, an integer or ``None`` (which is implicitly returned " "if your function does not have a return statement)." msgstr "" +"``main`` の呼び出しは :func:`sys.exit` で囲まれるため、関数は :func:`sys." +"exit` の入力として受け付けられる値を返すことが想定されています。\n" +"通常は整数か ``None`` です (関数に return 文がない場合は暗黙に ``None`` を返" +"します)。" -#: ../../library/__main__.rst:180 msgid "" "By proactively following this convention ourselves, our module will have the " "same behavior when run directly (i.e. ``python echo.py``) as it will have if " "we later package it as a console script entry-point in a pip-installable " "package." msgstr "" +"最初からこの慣習に従っておくと、モジュールを直接実行した場合 (``python echo." +"py`` など) と、後で pip でインストール可能なパッケージのコンソールスクリプト" +"のエントリーポイントとして配布した場合とで、同じ動作になります。" -#: ../../library/__main__.rst:185 msgid "" "In particular, be careful about returning strings from your ``main`` " "function. :func:`sys.exit` will interpret a string argument as a failure " @@ -357,53 +401,68 @@ msgid "" "py`` example from earlier exemplifies using the ``sys.exit(main())`` " "convention." msgstr "" +"特に、``main`` 関数から文字列を返す場合は注意してください。\n" +":func:`sys.exit` は文字列の引数を失敗のメッセージとして扱うため、プログラムは" +"失敗を示す終了コード ``1`` で終了し、その文字列は :data:`sys.stderr` に出力さ" +"れます。\n" +"先ほどの ``echo.py`` は、``sys.exit(main())`` の慣習に従った例です。" -#: ../../library/__main__.rst:193 msgid "" "`Python Packaging User Guide `_ contains a " "collection of tutorials and references on how to distribute and install " "Python packages with modern tools." msgstr "" +"`Python Packaging User Guide `_ には、現在使わ" +"れているツールで Python パッケージを配布・インストールする方法について、" +"チュートリアルとリファレンスがまとめられています。" -#: ../../library/__main__.rst:199 msgid "``__main__.py`` in Python Packages" -msgstr "" +msgstr "Python パッケージの ``__main__.py``" -#: ../../library/__main__.rst:201 msgid "" "If you are not familiar with Python packages, see section :ref:`tut-" "packages` of the tutorial. Most commonly, the ``__main__.py`` file is used " "to provide a command-line interface for a package. Consider the following " "hypothetical package, \"bandclass\":" msgstr "" +"Python パッケージについてよく知らない場合は、チュートリアルの :ref:`tut-" +"packages` を参照してください。\n" +"``__main__.py`` ファイルは、主にパッケージのコマンドラインインターフェースを" +"提供するために使われます。\n" +"次のような「bandclass」という架空のパッケージを考えてみます。" -#: ../../library/__main__.rst:206 msgid "" "bandclass\n" " ├── __init__.py\n" " ├── __main__.py\n" " └── student.py" msgstr "" +"bandclass\n" +" ├── __init__.py\n" +" ├── __main__.py\n" +" └── student.py" -#: ../../library/__main__.rst:213 msgid "" "``__main__.py`` will be executed when the package itself is invoked directly " "from the command line using the :option:`-m` flag. For example:" msgstr "" +"コマンドラインから :option:`-m` フラグでパッケージ自体を直接実行すると、" +"``__main__.py`` が実行されます。\n" +"例を示します。" -#: ../../library/__main__.rst:216 msgid "$ python -m bandclass" -msgstr "" +msgstr "$ python -m bandclass" -#: ../../library/__main__.rst:220 msgid "" "This command will cause ``__main__.py`` to run. How you utilize this " "mechanism will depend on the nature of the package you are writing, but in " "this hypothetical case, it might make sense to allow the teacher to search " "for students::" msgstr "" +"このコマンドで ``__main__.py`` が実行されます。\n" +"この仕組みの使い方は、作成するパッケージの性質によります。\n" +"この架空の例では、教師が生徒を検索できるようにするとよいでしょう。 ::" -#: ../../library/__main__.rst:225 msgid "" "# bandclass/__main__.py\n" "\n" @@ -413,69 +472,98 @@ msgid "" "student_name = sys.argv[1] if len(sys.argv) >= 2 else ''\n" "print(f'Found student: {search_students(student_name)}')" msgstr "" +"# bandclass/__main__.py\n" +"\n" +"import sys\n" +"from .student import search_students\n" +"\n" +"student_name = sys.argv[1] if len(sys.argv) >= 2 else ''\n" +"print(f'Found student: {search_students(student_name)}')" -#: ../../library/__main__.rst:233 msgid "" "Note that ``from .student import search_students`` is an example of a " "relative import. This import style can be used when referencing modules " "within a package. For more details, see :ref:`intra-package-references` in " "the :ref:`tut-modules` section of the tutorial." msgstr "" +"``from .student import search_students`` は相対インポートの例です。\n" +"この書き方は、パッケージ内のモジュールを参照するときに使えます。\n" +"詳しくは、チュートリアルの :ref:`tut-modules` にある :ref:`intra-package-" +"references` を参照してください。" -#: ../../library/__main__.rst:241 msgid "" "The content of ``__main__.py`` typically isn't fenced with an ``if __name__ " "== '__main__'`` block. Instead, those files are kept short and import " "functions to execute from other modules. Those other modules can then be " "easily unit-tested and are properly reusable." msgstr "" +"通常、``__main__.py`` の内容は ``if __name__ == '__main__'`` ブロックでは囲み" +"ません。\n" +"代わりに、ファイルを短く保ち、実行する関数を他のモジュールからインポートしま" +"す。\n" +"そうすれば、それらのモジュールを簡単にユニットテストでき、再利用もしやすくな" +"ります。" -#: ../../library/__main__.rst:246 msgid "" "If used, an ``if __name__ == '__main__'`` block will still work as expected " "for a ``__main__.py`` file within a package, because its ``__name__`` " "attribute will include the package's path if imported::" msgstr "" +"パッケージ内の ``__main__.py`` で ``if __name__ == '__main__'`` ブロックを" +"使った場合も、期待どおりに動作します。\n" +"インポートされたときには、``__name__`` 属性にパッケージのパスが含まれるためで" +"す。 ::" -#: ../../library/__main__.rst:250 msgid "" ">>> import asyncio.__main__\n" ">>> asyncio.__main__.__name__\n" "'asyncio.__main__'" msgstr "" +">>> import asyncio.__main__\n" +">>> asyncio.__main__.__name__\n" +"'asyncio.__main__'" -#: ../../library/__main__.rst:254 msgid "" "This won't work for ``__main__.py`` files in the root directory of a ``." "zip`` file though. Hence, for consistency, a minimal ``__main__.py`` " "without a ``__name__`` check is preferred." msgstr "" +"ただし、``.zip`` ファイルのルートディレクトリにある ``__main__.py`` では、こ" +"の方法は使えません。\n" +"そのため、一貫性を保つには、``__name__`` のチェックを含まない最小限の " +"``__main__.py`` にする方がよいでしょう。" -#: ../../library/__main__.rst:260 msgid "" "See :mod:`venv` for an example of a package with a minimal ``__main__.py`` " "in the standard library. It doesn't contain a ``if __name__ == '__main__'`` " "block. You can invoke it with ``python -m venv [directory]``." msgstr "" +"標準ライブラリ内で最小限の ``__main__.py`` を持つパッケージの例は、:mod:" +"`venv` を参照してください。\n" +"``if __name__ == '__main__'`` ブロックは含まれていません。\n" +"``python -m venv [directory]`` で実行できます。" -#: ../../library/__main__.rst:264 msgid "" "See :mod:`runpy` for more details on the :option:`-m` flag to the " "interpreter executable." msgstr "" +"インタープリタ実行ファイルの :option:`-m` フラグの詳細は、:mod:`runpy` を参照" +"してください。" -#: ../../library/__main__.rst:267 msgid "" "See :mod:`zipapp` for how to run applications packaged as *.zip* files. In " "this case Python looks for a ``__main__.py`` file in the root directory of " "the archive." msgstr "" +"*.zip* ファイルにまとめたアプリケーションの実行方法は、:mod:`zipapp` を参照し" +"てください。\n" +"この場合、Python はアーカイブのルートディレクトリにある ``__main__.py`` を探" +"します。" #: ../../library/__main__.rst:274 msgid "``import __main__``" msgstr "``import __main__``" -#: ../../library/__main__.rst:276 msgid "" "Regardless of which module a Python program was started with, other modules " "running within that same program can import the top-level environment's " @@ -483,12 +571,15 @@ msgid "" "doesn't import a ``__main__.py`` file but rather whichever module that " "received the special name ``'__main__'``." msgstr "" +"Python プログラムをどのモジュールから起動したかにかかわらず、同じプログラム内" +"の他のモジュールは、``__main__`` モジュールをインポートすることでトップレベル" +"環境のスコープ (:term:`名前空間 `) をインポートできます。\n" +"これは ``__main__.py`` というファイルのインポートではなく、特別な名前 " +"``'__main__'`` が割り当てられたモジュールのインポートです。" -#: ../../library/__main__.rst:282 msgid "Here is an example module that consumes the ``__main__`` namespace::" -msgstr "" +msgstr "``__main__`` の名前空間を利用するモジュールの例を示します。 ::" -#: ../../library/__main__.rst:284 msgid "" "# namely.py\n" "\n" @@ -503,12 +594,22 @@ msgid "" "\n" " print(__main__.my_name)" msgstr "" +"# namely.py\n" +"\n" +"import __main__\n" +"\n" +"def did_user_define_their_name():\n" +" return 'my_name' in dir(__main__)\n" +"\n" +"def print_user_name():\n" +" if not did_user_define_their_name():\n" +" raise ValueError('Define the variable `my_name`!')\n" +"\n" +" print(__main__.my_name)" -#: ../../library/__main__.rst:297 msgid "Example usage of this module could be as follows::" -msgstr "" +msgstr "このモジュールは、例えば次のように使えます。 ::" -#: ../../library/__main__.rst:299 msgid "" "# start.py\n" "\n" @@ -527,39 +628,60 @@ msgid "" "if __name__ == \"__main__\":\n" " sys.exit(main())" msgstr "" +"# start.py\n" +"\n" +"import sys\n" +"\n" +"from namely import print_user_name\n" +"\n" +"# my_name = \"Dinsdale\"\n" +"\n" +"def main():\n" +" try:\n" +" print_user_name()\n" +" except ValueError as ve:\n" +" return str(ve)\n" +"\n" +"if __name__ == \"__main__\":\n" +" sys.exit(main())" -#: ../../library/__main__.rst:316 msgid "Now, if we started our program, the result would look like this:" -msgstr "" +msgstr "このプログラムを起動すると、次のような結果になります。" -#: ../../library/__main__.rst:318 msgid "" "$ python start.py\n" "Define the variable `my_name`!" msgstr "" +"$ python start.py\n" +"Define the variable `my_name`!" -#: ../../library/__main__.rst:323 msgid "" "The exit code of the program would be 1, indicating an error. Uncommenting " "the line with ``my_name = \"Dinsdale\"`` fixes the program and now it exits " "with status code 0, indicating success:" msgstr "" +"プログラムの終了コードは、エラーを示す 1 になります。\n" +"``my_name = \"Dinsdale\"`` の行のコメントを外すとプログラムは正しく動作し、成" +"功を示す終了コード 0 で終了します。" -#: ../../library/__main__.rst:327 msgid "" "$ python start.py\n" "Dinsdale" msgstr "" +"$ python start.py\n" +"Dinsdale" -#: ../../library/__main__.rst:332 msgid "" "Note that importing ``__main__`` doesn't cause any issues with " "unintentionally running top-level code meant for script use which is put in " "the ``if __name__ == \"__main__\"`` block of the ``start`` module. Why does " "this work?" msgstr "" +"``__main__`` をインポートしても、``start`` モジュールの ``if __name__ == " +"\"__main__\"`` ブロックにある、スクリプト用のトップレベルコードが意図せず実行" +"されることはありません。\n" +"なぜこのように動作するのでしょうか。" -#: ../../library/__main__.rst:336 msgid "" "Python inserts an empty ``__main__`` module in :data:`sys.modules` at " "interpreter startup, and populates it by running top-level code. In our " @@ -571,14 +693,24 @@ msgid "" "` in the import system's reference for details on how " "this works." msgstr "" +"Python はインタープリタの起動時に空の ``__main__`` モジュールを :data:`sys." +"modules` に追加し、トップレベルコードを実行してその内容を埋めていきます。\n" +"この例では、``start`` モジュールが一行ずつ実行され、``namely`` をインポートし" +"ます。\n" +"今度は ``namely`` が ``__main__`` (実体は ``start``) をインポートするので、循" +"環インポートになります。\n" +"しかし、内容が部分的に埋まった ``__main__`` モジュールが :data:`sys.modules` " +"にあるため、Python はそれを ``namely`` に渡せます。\n" +"詳しい仕組みは、インポートシステムのリファレンスの :ref:`__main__ に関する特" +"別な考慮事項 ` を参照してください。" -#: ../../library/__main__.rst:345 msgid "" "The Python REPL is another example of a \"top-level environment\", so " "anything defined in the REPL becomes part of the ``__main__`` scope::" msgstr "" +"Python の REPL も「トップレベル環境」の一例なので、REPL で定義したものはすべ" +"て ``__main__`` のスコープの一部になります。 ::" -#: ../../library/__main__.rst:348 msgid "" ">>> import namely\n" ">>> namely.did_user_define_their_name()\n" @@ -593,9 +725,22 @@ msgid "" ">>> namely.print_user_name()\n" "Jabberwocky" msgstr "" +">>> import namely\n" +">>> namely.did_user_define_their_name()\n" +"False\n" +">>> namely.print_user_name()\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Define the variable `my_name`!\n" +">>> my_name = 'Jabberwocky'\n" +">>> namely.did_user_define_their_name()\n" +"True\n" +">>> namely.print_user_name()\n" +"Jabberwocky" -#: ../../library/__main__.rst:361 msgid "" "The ``__main__`` scope is used in the implementation of :mod:`pdb` and :mod:" "`rlcompleter`." msgstr "" +"``__main__`` のスコープは、:mod:`pdb` と :mod:`rlcompleter` の実装で使われて" +"います。" diff --git a/library/_thread.po b/library/_thread.po index 771431a1c..a370ab56c 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -74,59 +74,70 @@ msgstr "" msgid "When the function returns, the thread silently exits." msgstr "関数が戻るとき、スレッドは静かに終了します。" -#: ../../library/_thread.rst:47 msgid "" "When the function terminates with an unhandled exception, :func:`sys." "unraisablehook` is called to handle the exception. The *object* attribute of " "the hook argument is *function*. By default, a stack trace is printed and " "then the thread exits (but other threads continue to run)." msgstr "" +"処理されない例外によって関数が終了すると、例外を処理するために :func:`sys." +"unraisablehook` が呼び出されます。\n" +"フックに渡される引数の ``object`` 属性は ``function`` です。\n" +"デフォルトではスタックトレースを表示してスレッドを終了します (他のスレッドは" +"実行を続けます)。" -#: ../../library/_thread.rst:52 msgid "" "When the function raises a :exc:`SystemExit` exception, it is silently " "ignored." msgstr "" +"関数が :exc:`SystemExit` 例外を送出した場合は、何も表示せずに無視します。" -#: ../../library/_thread.rst:55 msgid "" "Raises an :ref:`auditing event ` ``_thread.start_new_thread`` with " "arguments ``function``, ``args``, ``kwargs``." msgstr "" +"引数 ``function``、``args``、``kwargs`` を指定して、:ref:`監査イベント " +"` ``_thread.start_new_thread`` を発生させます。" -#: ../../library/_thread.rst:57 msgid ":func:`sys.unraisablehook` is now used to handle unhandled exceptions." msgstr "" +"処理されない例外を扱うために :func:`sys.unraisablehook` を使うようになりまし" +"た。" -#: ../../library/_thread.rst:63 msgid "" "Simulate the effect of a signal arriving in the main thread. A thread can " "use this function to interrupt the main thread, though there is no guarantee " "that the interruption will happen immediately." msgstr "" +"メインスレッドにシグナルが届いたときの効果を模倣します。\n" +"スレッドはこの関数でメインスレッドに割り込めますが、即座に割り込む保証はあり" +"ません。" -#: ../../library/_thread.rst:67 msgid "" "If given, *signum* is the number of the signal to simulate. If *signum* is " "not given, :const:`signal.SIGINT` is simulated." msgstr "" +"``signum`` を指定した場合は、模倣するシグナルの番号になります。\n" +"``signum`` を指定しない場合は、:const:`signal.SIGINT` を模倣します。" -#: ../../library/_thread.rst:70 msgid "" "If the given signal isn't handled by Python (it was set to :const:`signal." "SIG_DFL` or :const:`signal.SIG_IGN`), this function does nothing." msgstr "" +"指定したシグナルを Python が処理しない場合 (:const:`signal.SIG_DFL` または :" +"const:`signal.SIG_IGN` に設定されている場合)、この関数は何もしません。" -#: ../../library/_thread.rst:74 msgid "The *signum* argument is added to customize the signal number." -msgstr "" +msgstr "シグナル番号を変更できるよう、``signum`` 引数が追加されました。" -#: ../../library/_thread.rst:78 msgid "" "This does not emit the corresponding signal but schedules a call to the " "associated handler (if it exists). If you want to truly emit the signal, " "use :func:`signal.raise_signal`." msgstr "" +"この関数は実際にシグナルを発生させるのではなく、対応するハンドラーがあれば、" +"その呼び出しを予約します。\n" +"実際にシグナルを発生させるには :func:`signal.raise_signal` を使ってください。" #: ../../library/_thread.rst:85 msgid "" @@ -157,24 +168,25 @@ msgstr "" "な、マジッククッキーとして意図されています。スレッドが終了し、他のスレッドが" "作られたとき、スレッド ID は再利用されるかもしれません。" -#: ../../library/_thread.rst:113 msgid "" "Return the native integral Thread ID of the current thread assigned by the " "kernel. This is a non-negative integer. Its value may be used to uniquely " "identify this particular thread system-wide (until the thread terminates, " "after which the value may be recycled by the OS)." msgstr "" +"カーネルが割り当てた、現在のスレッドのネイティブなスレッド ID を返します。\n" +"これは非負の整数です。\n" +"この値で、システム全体においてこのスレッドを一意に識別できます (スレッドが終" +"了するまでで、その後は OS が値を再利用することがあります)。" msgid "Availability" msgstr "利用可能な環境" -#: ../../library/_thread.rst:122 msgid "Added support for GNU/kFreeBSD." -msgstr "" +msgstr "GNU/kFreeBSD のサポートが追加されました。" -#: ../../library/_thread.rst:125 msgid "Added support for Solaris." -msgstr "" +msgstr "Solaris のサポートが追加されました。" #: ../../library/_thread.rst:131 msgid "" @@ -209,16 +221,17 @@ msgstr "" "トフォームに関する情報がない場合は 4096 の整数倍のスタックサイズを選ぶといい" "かもしれません)。" -#: ../../library/_thread.rst:148 msgid "Unix platforms with POSIX threads support." -msgstr "" +msgstr "POSIX スレッドをサポートする Unix プラットフォーム。" -#: ../../library/_thread.rst:153 msgid "" "The maximum value allowed for the *timeout* parameter of :meth:`Lock.acquire " "`. Specifying a timeout greater than this value will " "raise an :exc:`OverflowError`." msgstr "" +":meth:`Lock.acquire ` の ``timeout`` パラメーターに指" +"定できる最大値です。\n" +"この値を超えるタイムアウトを指定すると :exc:`OverflowError` が送出されます。" #: ../../library/_thread.rst:169 msgid "This is the type of lock objects." @@ -240,13 +253,15 @@ msgstr "" "ている場合には解除されるまで待ってからロックを獲得します (同時にロックを獲得" "できるスレッドはひとつだけであり、これこそがロックの存在理由です)。" -#: ../../library/_thread.rst:179 msgid "" "If the *blocking* argument is present, the action depends on its value: if " "it is false, the lock is only acquired if it can be acquired immediately " "without waiting, while if it is true, the lock is acquired unconditionally " "as above." msgstr "" +"``blocking`` 引数を指定した場合、動作はその値によって変わります。\n" +"偽なら、待たずにすぐ獲得できる場合だけロックを獲得します。\n" +"真なら、上で説明したように無条件にロックを獲得します。" #: ../../library/_thread.rst:184 msgid "" @@ -272,9 +287,8 @@ msgstr "新しい *timeout* 引数。" msgid "Lock acquires can now be interrupted by signals on POSIX." msgstr "POSIX ではロックの取得がシグナルに割り込まれるようになりました。" -#: ../../library/_thread.rst:198 msgid "Lock acquires can now be interrupted by signals on Windows." -msgstr "" +msgstr "Windows でのロックの獲得をシグナルで中断できるようになりました。" #: ../../library/_thread.rst:203 msgid "" @@ -300,7 +314,6 @@ msgstr "" "これらのメソッドに加えて、ロックオブジェクトは :keyword:`with` 文を通じて以下" "の例のように使うこともできます。 ::" -#: ../../library/_thread.rst:214 msgid "" "import _thread\n" "\n" @@ -309,16 +322,23 @@ msgid "" "with a_lock:\n" " print(\"a_lock is locked while this executes\")" msgstr "" +"import _thread\n" +"\n" +"a_lock = _thread.allocate_lock()\n" +"\n" +"with a_lock:\n" +" print(\"a_lock is locked while this executes\")" #: ../../library/_thread.rst:221 msgid "**Caveats:**" msgstr "**警告:**" -#: ../../library/_thread.rst:225 msgid "" "Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` " "exception will be received by that thread.)" msgstr "" +"割り込みは常にメインスレッドに届きます (:exc:`KeyboardInterrupt` 例外を受け取" +"るのはこのスレッドです)。" #: ../../library/_thread.rst:228 msgid "" diff --git a/library/abc.po b/library/abc.po index 307c22884..4a3cb0ee7 100644 --- a/library/abc.po +++ b/library/abc.po @@ -77,15 +77,17 @@ msgstr "" "ことで、:class:`!ABC` を継承するだけで抽象基底クラスを作成でき、しばしば混乱" "しがちなメタクラスの使用を避けることができます。例えば::" -#: ../../library/abc.rst:32 msgid "" "from abc import ABC\n" "\n" "class MyABC(ABC):\n" " pass" msgstr "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass" -#: ../../library/abc.rst:37 msgid "" "Note that the type of :class:`!ABC` is still :class:`ABCMeta`, therefore " "inheriting from :class:`!ABC` requires the usual precautions regarding " @@ -93,14 +95,22 @@ msgid "" "One may also define an abstract base class by passing the metaclass keyword " "and using :class:`!ABCMeta` directly, for example::" msgstr "" +":class:`!ABC` の型は :class:`ABCMeta` なので、:class:`!ABC` を継承する場合" +"も、メタクラスを使う際の通常の注意が必要です。\n" +"多重継承ではメタクラスが競合する場合があります。\n" +"また、``metaclass`` キーワードに :class:`!ABCMeta` を直接指定して、抽象基底ク" +"ラスを定義することもできます。 ::" -#: ../../library/abc.rst:43 msgid "" "from abc import ABCMeta\n" "\n" "class MyABC(metaclass=ABCMeta):\n" " pass" msgstr "" +"from abc import ABCMeta\n" +"\n" +"class MyABC(metaclass=ABCMeta):\n" +" pass" #: ../../library/abc.rst:53 msgid "Metaclass for defining Abstract Base Classes (ABCs)." @@ -125,11 +135,10 @@ msgstr "" "Resolution Order, メソッド解決順)には現れませんし、この ABC のメソッド実装が" "(:func:`super` を通してだけでなく)呼び出し可能になるわけでもありません。 [#]_" -#: ../../library/abc.rst:64 msgid "" "Classes created with a metaclass of :class:`!ABCMeta` have the following " "method:" -msgstr "" +msgstr "メタクラスが :class:`!ABCMeta` のクラスには、次のメソッドがあります。" #: ../../library/abc.rst:68 msgid "" @@ -137,7 +146,6 @@ msgid "" msgstr "" "*subclass* を \"仮想的サブクラス\" としてこの ABC に登録します。たとえば::" -#: ../../library/abc.rst:71 msgid "" "from abc import ABC\n" "\n" @@ -149,6 +157,15 @@ msgid "" "assert issubclass(tuple, MyABC)\n" "assert isinstance((), MyABC)" msgstr "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass\n" +"\n" +"MyABC.register(tuple)\n" +"\n" +"assert issubclass(tuple, MyABC)\n" +"assert isinstance((), MyABC)" #: ../../library/abc.rst:81 msgid "Returns the registered subclass, to allow usage as a class decorator." @@ -156,11 +173,12 @@ msgstr "" "クラスデコレータとして使うことができるように、登録されたサブクラスを返しま" "す。" -#: ../../library/abc.rst:84 msgid "" "To detect calls to :meth:`!register`, you can use the :func:" "`get_cache_token` function." msgstr "" +":meth:`!register` の呼び出しを検出するには、:func:`get_cache_token` 関数を使" +"えます。" #: ../../library/abc.rst:88 msgid "You can also override this method in an abstract base class:" @@ -170,7 +188,6 @@ msgstr "また、次のメソッドを抽象基底クラスの中でオーバー msgid "(Must be defined as a class method.)" msgstr "(クラスメソッドとして定義しなければなりません。)" -#: ../../library/abc.rst:94 msgid "" "Check whether *subclass* is considered a subclass of this ABC. This means " "that you can customize the behavior of :func:`issubclass` further without " @@ -178,8 +195,13 @@ msgid "" "subclass of the ABC. (This class method is called from the :meth:`~type." "__subclasscheck__` method of the ABC.)" msgstr "" +"``subclass`` がこの ABC のサブクラスとみなされるか調べます。\n" +"このメソッドで :func:`issubclass` の動作をさらにカスタマイズすれば、ABC のサ" +"ブクラスとみなしたいクラスごとに :meth:`register` を呼ぶ必要がなくなりま" +"す。\n" +"(このクラスメソッドは、ABC の :meth:`~type.__subclasscheck__` メソッドから呼" +"び出されます。)" -#: ../../library/abc.rst:100 msgid "" "This method should return ``True``, ``False`` or :data:`NotImplemented`. If " "it returns ``True``, the *subclass* is considered a subclass of this ABC. If " @@ -187,13 +209,18 @@ msgid "" "ABC, even if it would normally be one. If it returns :data:`!" "NotImplemented`, the subclass check is continued with the usual mechanism." msgstr "" +"このメソッドは ``True``、``False``、:data:`NotImplemented` のいずれかを返す必" +"要があります。\n" +"``True`` を返すと、``subclass`` はこの ABC のサブクラスとみなされます。\n" +"``False`` を返すと、通常ならサブクラスであっても、``subclass`` はこの ABC の" +"サブクラスとはみなされません。\n" +":data:`!NotImplemented` を返すと、通常の仕組みでサブクラスの検査を続けます。" #: ../../library/abc.rst:110 msgid "" "For a demonstration of these concepts, look at this example ABC definition::" msgstr "この概念のデモとして、次の ABC 定義の例を見てください::" -#: ../../library/abc.rst:112 msgid "" "class Foo:\n" " def __getitem__(self, index):\n" @@ -222,8 +249,33 @@ msgid "" "\n" "MyIterable.register(Foo)" msgstr "" +"class Foo:\n" +" def __getitem__(self, index):\n" +" ...\n" +" def __len__(self):\n" +" ...\n" +" def get_iterator(self):\n" +" return iter(self)\n" +"\n" +"class MyIterable(ABC):\n" +"\n" +" @abstractmethod\n" +" def __iter__(self):\n" +" while False:\n" +" yield None\n" +"\n" +" def get_iterator(self):\n" +" return self.__iter__()\n" +"\n" +" @classmethod\n" +" def __subclasshook__(cls, C):\n" +" if cls is MyIterable:\n" +" if any(\"__iter__\" in B.__dict__ for B in C.__mro__):\n" +" return True\n" +" return NotImplemented\n" +"\n" +"MyIterable.register(Foo)" -#: ../../library/abc.rst:139 msgid "" "The ABC ``MyIterable`` defines the standard iterable method, :meth:`~object." "__iter__`, as an abstract method. The implementation given here can still " @@ -231,16 +283,24 @@ msgid "" "the ``MyIterable`` abstract base class, but it does not have to be " "overridden in non-abstract derived classes." msgstr "" +"ABC ``MyIterable`` は、イテラブルの標準的なメソッド :meth:`~object.__iter__` " +"を抽象メソッドとして定義しています。\n" +"ここで定義した実装は、サブクラスから呼び出すこともできます。\n" +":meth:`!get_iterator` メソッドも抽象基底クラス ``MyIterable`` の一部ですが、" +"抽象クラスではない派生クラスでオーバーライドする必要はありません。" -#: ../../library/abc.rst:145 msgid "" "The :meth:`__subclasshook__` class method defined here says that any class " "that has an :meth:`~object.__iter__` method in its :attr:`~object.__dict__` " "(or in that of one of its base classes, accessed via the :attr:`~type." "__mro__` list) is considered a ``MyIterable`` too." msgstr "" +"ここで定義したクラスメソッド :meth:`__subclasshook__` は、:attr:`~object." +"__dict__` に :meth:`~object.__iter__` メソッドを持つクラスを ``MyIterable`` " +"とみなします。\n" +"また、:attr:`~type.__mro__` リストからたどれる基底クラスのいずれかがそのメ" +"ソッドを持つ場合も、同様にみなします。" -#: ../../library/abc.rst:150 msgid "" "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " "even though it does not define an :meth:`~object.__iter__` method (it uses " @@ -249,16 +309,20 @@ msgid "" "``get_iterator`` available as a method of ``Foo``, so it is provided " "separately." msgstr "" +"最後の行では、:meth:`~object.__iter__` メソッドを定義していない ``Foo`` も、" +"``MyIterable`` の仮想的サブクラスにしています (``Foo`` は :meth:`~object." +"__len__` と :meth:`~object.__getitem__` に基づく古いイテラブルプロトコルを" +"使っています)。\n" +"ただし、これによって ``get_iterator`` が ``Foo`` のメソッドとして使えるように" +"なるわけではないので、別途定義しています。" -#: ../../library/abc.rst:159 msgid "The :mod:`!abc` module also provides the following decorator:" -msgstr "" +msgstr ":mod:`!abc` モジュールは、次のデコレータも提供します。" #: ../../library/abc.rst:163 msgid "A decorator indicating abstract methods." msgstr "抽象メソッドを示すデコレータです。" -#: ../../library/abc.rst:165 msgid "" "Using this decorator requires that the class's metaclass is :class:`ABCMeta` " "or is derived from it. A class that has a metaclass derived from :class:`!" @@ -267,8 +331,14 @@ msgid "" "the normal 'super' call mechanisms. :deco:`!abstractmethod` may be used to " "declare abstract methods for properties and descriptors." msgstr "" +"このデコレータを使うには、クラスのメタクラスが :class:`ABCMeta` またはその派" +"生クラスである必要があります。\n" +"メタクラスが :class:`!ABCMeta` から派生しているクラスは、すべての抽象メソッド" +"と抽象プロパティがオーバーライドされるまで、インスタンス化できません。\n" +"抽象メソッドは、通常の super 呼び出しの仕組みで呼び出せます。\n" +":deco:`!abstractmethod` は、プロパティやデスクリプタの抽象メソッドを宣言する" +"ためにも使えます。" -#: ../../library/abc.rst:172 msgid "" "Dynamically adding abstract methods to a class, or attempting to modify the " "abstraction status of a method or class once it is created, are only " @@ -277,15 +347,22 @@ msgid "" "\"virtual subclasses\" registered with the ABC's :meth:`~ABCMeta.register` " "method are not affected." msgstr "" +"クラスへの抽象メソッドの動的な追加や、作成済みのメソッドやクラスが抽象である" +"かどうかの変更は、:func:`update_abstractmethods` 関数を使う場合にのみサポート" +"されます。\n" +":deco:`!abstractmethod` が影響するのは、通常の継承によるサブクラスだけで" +"す。\n" +"ABC の :meth:`~ABCMeta.register` メソッドで登録された「仮想的サブクラス」には" +"影響しません。" -#: ../../library/abc.rst:179 msgid "" "When :deco:`!abstractmethod` is applied in combination with other method " "descriptors, it should be applied as the innermost decorator, as shown in " "the following usage examples::" msgstr "" +":deco:`!abstractmethod` を他のメソッドデスクリプタと組み合わせる場合は、次の" +"例のように最も内側のデコレータとして適用してください。 ::" -#: ../../library/abc.rst:183 msgid "" "class C(ABC):\n" " @abstractmethod\n" @@ -317,8 +394,36 @@ msgid "" " ...\n" " x = property(_get_x, _set_x)" msgstr "" +"class C(ABC):\n" +" @abstractmethod\n" +" def my_abstract_method(self, arg1):\n" +" ...\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg2):\n" +" ...\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg3):\n" +" ...\n" +"\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ...\n" +" @my_abstract_property.setter\n" +" @abstractmethod\n" +" def my_abstract_property(self, val):\n" +" ...\n" +"\n" +" @abstractmethod\n" +" def _get_x(self):\n" +" ...\n" +" @abstractmethod\n" +" def _set_x(self, val):\n" +" ...\n" +" x = property(_get_x, _set_x)" -#: ../../library/abc.rst:213 msgid "" "In order to correctly interoperate with the abstract base class machinery, " "the descriptor must identify itself as abstract using :attr:`!" @@ -326,8 +431,12 @@ msgid "" "of the methods used to compose the descriptor are abstract. For example, " "Python's built-in :deco:`property` does the equivalent of::" msgstr "" +"抽象基底クラスの仕組みと正しく連携するには、デスクリプタが抽象であることを :" +"attr:`!__isabstractmethod__` で示す必要があります。\n" +"一般に、デスクリプタを構成するメソッドのいずれかが抽象なら、この属性を " +"``True`` にするべきです。\n" +"例えば、Python の組み込み :deco:`property` は次と同等の処理を行います。 ::" -#: ../../library/abc.rst:219 msgid "" "class Descriptor:\n" " ...\n" @@ -336,6 +445,12 @@ msgid "" " return any(getattr(f, '__isabstractmethod__', False) for\n" " f in (self._fget, self._fset, self._fdel))" msgstr "" +"class Descriptor:\n" +" ...\n" +" @property\n" +" def __isabstractmethod__(self):\n" +" return any(getattr(f, '__isabstractmethod__', False) for\n" +" f in (self._fget, self._fset, self._fdel))" #: ../../library/abc.rst:228 msgid "" @@ -350,29 +465,31 @@ msgstr "" "ことができます。これは協調的多重継承を使ったフレームワークにおいて super 呼び" "出しの終点として有効です。" -#: ../../library/abc.rst:235 msgid "The :mod:`!abc` module also supports the following legacy decorators:" -msgstr "" +msgstr ":mod:`!abc` モジュールは、次の古いデコレータもサポートしています。" -#: ../../library/abc.rst:240 msgid "" "It is now possible to use :deco:`classmethod` with :deco:`abstractmethod`, " "making this decorator redundant." msgstr "" +":deco:`classmethod` と :deco:`abstractmethod` を組み合わせて使えるようになっ" +"たため、このデコレータは不要になりました。" -#: ../../library/abc.rst:244 msgid "" "A subclass of the built-in :class:`classmethod`, indicating an abstract " "classmethod. Otherwise it is similar to :deco:`abstractmethod`." msgstr "" +"抽象クラスメソッドを表す、組み込みの :class:`classmethod` のサブクラスで" +"す。\n" +"それ以外の点では :deco:`abstractmethod` と同様です。" -#: ../../library/abc.rst:247 msgid "" "This special case is deprecated, as the :deco:`classmethod` decorator is now " "correctly identified as abstract when applied to an abstract method::" msgstr "" +"抽象メソッドに :deco:`classmethod` デコレータを適用すれば、抽象であると正しく" +"認識されるようになったため、この特別なデコレータは非推奨です。 ::" -#: ../../library/abc.rst:251 msgid "" "class C(ABC):\n" " @classmethod\n" @@ -380,26 +497,33 @@ msgid "" " def my_abstract_classmethod(cls, arg):\n" " ..." msgstr "" +"class C(ABC):\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg):\n" +" ..." -#: ../../library/abc.rst:261 msgid "" "It is now possible to use :deco:`staticmethod` with :deco:`abstractmethod`, " "making this decorator redundant." msgstr "" +":deco:`staticmethod` と :deco:`abstractmethod` を組み合わせて使えるようになっ" +"たため、このデコレータは不要になりました。" -#: ../../library/abc.rst:265 msgid "" "A subclass of the built-in :class:`staticmethod`, indicating an abstract " "staticmethod. Otherwise it is similar to :deco:`abstractmethod`." msgstr "" +"抽象静的メソッドを表す、組み込みの :class:`staticmethod` のサブクラスです。\n" +"それ以外の点では :deco:`abstractmethod` と同様です。" -#: ../../library/abc.rst:268 msgid "" "This special case is deprecated, as the :deco:`staticmethod` decorator is " "now correctly identified as abstract when applied to an abstract method::" msgstr "" +"抽象メソッドに :deco:`staticmethod` デコレータを適用すれば、抽象であると正し" +"く認識されるようになったため、この特別なデコレータは非推奨です。 ::" -#: ../../library/abc.rst:272 msgid "" "class C(ABC):\n" " @staticmethod\n" @@ -407,27 +531,33 @@ msgid "" " def my_abstract_staticmethod(arg):\n" " ..." msgstr "" +"class C(ABC):\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg):\n" +" ..." -#: ../../library/abc.rst:281 msgid "" "It is now possible to use :deco:`property`, :deco:`property.getter`, :deco:" "`property.setter` and :deco:`property.deleter` with :deco:`abstractmethod`, " "making this decorator redundant." msgstr "" +":deco:`property`、:deco:`property.getter`、:deco:`property.setter`、:deco:" +"`property.deleter` を :deco:`abstractmethod` と組み合わせて使えるようになった" +"ため、このデコレータは不要になりました。" -#: ../../library/abc.rst:286 msgid "" "A subclass of the built-in :class:`property`, indicating an abstract " "property." -msgstr "" +msgstr "抽象プロパティを表す、組み込みの :class:`property` のサブクラスです。" -#: ../../library/abc.rst:289 msgid "" "This special case is deprecated, as the :deco:`property` decorator is now " "correctly identified as abstract when applied to an abstract method::" msgstr "" +"抽象メソッドに :deco:`property` デコレータを適用すれば、抽象であると正しく認" +"識されるようになったため、この特別なデコレータは非推奨です。 ::" -#: ../../library/abc.rst:293 msgid "" "class C(ABC):\n" " @property\n" @@ -435,6 +565,11 @@ msgid "" " def my_abstract_property(self):\n" " ..." msgstr "" +"class C(ABC):\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ..." #: ../../library/abc.rst:299 msgid "" @@ -446,7 +581,6 @@ msgstr "" "ドの1つ以上を abstract にすることで、読み書きできる抽象プロパティを定義するこ" "とができます::" -#: ../../library/abc.rst:303 msgid "" "class C(ABC):\n" " @property\n" @@ -458,6 +592,15 @@ msgid "" " def x(self, val):\n" " ..." msgstr "" +"class C(ABC):\n" +" @property\n" +" def x(self):\n" +" ...\n" +"\n" +" @x.setter\n" +" @abstractmethod\n" +" def x(self, val):\n" +" ..." #: ../../library/abc.rst:313 msgid "" @@ -467,17 +610,19 @@ msgstr "" "構成するメソッド全てが abstract でない場合、abstract と定義されたメソッドのみ" "が、具象サブクラスによってオーバーライドする必要があります::" -#: ../../library/abc.rst:316 msgid "" "class D(C):\n" " @C.x.setter\n" " def x(self, val):\n" " ..." msgstr "" +"class D(C):\n" +" @C.x.setter\n" +" def x(self, val):\n" +" ..." -#: ../../library/abc.rst:322 msgid "The :mod:`!abc` module also provides the following functions:" -msgstr "" +msgstr ":mod:`!abc` モジュールは、次の関数も提供します。" #: ../../library/abc.rst:326 msgid "Returns the current abstract base class cache token." @@ -494,27 +639,30 @@ msgstr "" "任意のABCでの :meth:`ABCMeta.register` の呼び出しごとに、トークンは変更されま" "す。" -#: ../../library/abc.rst:336 msgid "" "A function to recalculate an abstract class's abstraction status. This " "function should be called if a class's abstract methods have been " "implemented or changed after it was created. Usually, this function should " "be called from within a class decorator." msgstr "" +"抽象クラスが抽象であるかどうかを再計算する関数です。\n" +"クラスを作成した後で、その抽象メソッドを実装したり変更したりした場合に呼び出" +"してください。\n" +"通常はクラスデコレータの中から呼び出します。" -#: ../../library/abc.rst:341 msgid "Returns *cls*, to allow usage as a class decorator." -msgstr "" +msgstr "クラスデコレータとして使えるように、``cls`` を返します。" -#: ../../library/abc.rst:343 msgid "If *cls* is not an instance of :class:`ABCMeta`, does nothing." -msgstr "" +msgstr "``cls`` が :class:`ABCMeta` のインスタンスでなければ、何もしません。" -#: ../../library/abc.rst:347 msgid "" "This function assumes that *cls*'s superclasses are already updated. It does " "not update any subclasses." msgstr "" +"この関数は、``cls`` のスーパークラスがすでに更新されていることを前提としま" +"す。\n" +"サブクラスの更新は行いません。" #: ../../library/abc.rst:353 msgid "Footnotes" diff --git a/library/aifc.po b/library/aifc.po index cebcd430d..44f1142a1 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/aifc.rst:2 msgid ":mod:`!aifc` --- Read and write AIFF and AIFC files" -msgstr "" +msgstr ":mod:`!aifc` --- AIFF および AIFC ファイルの読み書き" #: ../../library/aifc.rst:10 msgid "" @@ -36,8 +35,9 @@ msgstr "" "ルは Python 3.11 で非推奨となったあと、:ref:`Python 3.13 で削除` されました。削除の決定は :pep:`594` でなされました。" -#: ../../library/aifc.rst:14 msgid "" "The last version of Python that provided the :mod:`!aifc` module was `Python " "3.12 `_." msgstr "" +":mod:`!aifc` モジュールを提供していた最後の Python バージョンは、`Python " +"3.12 `_ です。" diff --git a/library/annotationlib.po b/library/annotationlib.po index be9b96b40..29c5fa42d 100644 --- a/library/annotationlib.po +++ b/library/annotationlib.po @@ -22,21 +22,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/annotationlib.rst:2 msgid ":mod:`!annotationlib` --- Functionality for introspecting annotations" -msgstr "" +msgstr ":mod:`!annotationlib` --- アノテーションを調べるための機能" -#: ../../library/annotationlib.rst:9 msgid "**Source code:** :source:`Lib/annotationlib.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/annotationlib.py`" -#: ../../library/annotationlib.rst:18 msgid "" "The :mod:`!annotationlib` module provides tools for introspecting :term:" "`annotations ` on modules, classes, and functions." msgstr "" +":mod:`!annotationlib` モジュールは、モジュール、クラス、関数の :term:`アノ" +"テーション ` を調べるためのツールを提供します。" -#: ../../library/annotationlib.rst:21 msgid "" "Annotations are :ref:`lazily evaluated ` and often contain " "forward references to objects that are not yet defined when the annotation " @@ -44,36 +42,47 @@ msgid "" "to retrieve annotations in a reliable way, even in the presence of forward " "references and other edge cases." msgstr "" +"アノテーションは :ref:`遅延評価 ` され、作成時にはまだ定義さ" +"れていないオブジェクトへの前方参照を含むことがよくあります。\n" +"このモジュールは、前方参照やその他の特殊な場合があっても、アノテーションを確" +"実に取得するための低水準のツール群を提供します。" -#: ../../library/annotationlib.rst:26 msgid "" "This module supports retrieving annotations in three main formats (see :" "class:`Format`), each of which works best for different use cases:" msgstr "" +"このモジュールは、アノテーションを取得するための三つの主要な形式をサポートし" +"ます (:class:`Format` を参照)。\n" +"それぞれ適した用途が異なります。" -#: ../../library/annotationlib.rst:29 msgid "" ":attr:`~Format.VALUE` evaluates the annotations and returns their value. " "This is most straightforward to work with, but it may raise errors, for " "example if the annotations contain references to undefined names." msgstr "" +":attr:`~Format.VALUE` は、アノテーションを評価してその値を返します。\n" +"最も直接的に扱える形式ですが、未定義の名前を参照するアノテーションなどでは、" +"エラーが発生する場合があります。" -#: ../../library/annotationlib.rst:32 msgid "" ":attr:`~Format.FORWARDREF` returns :class:`ForwardRef` objects for " "annotations that cannot be resolved, allowing you to inspect the annotations " "without evaluating them. This is useful when you need to work with " "annotations that may contain unresolved forward references." msgstr "" +":attr:`~Format.FORWARDREF` は、解決できないアノテーションに対して :class:" +"`ForwardRef` オブジェクトを返すので、それらを評価せずに調べられます。\n" +"未解決の前方参照を含む可能性のあるアノテーションを扱う場合に便利です。" -#: ../../library/annotationlib.rst:36 msgid "" ":attr:`~Format.STRING` returns the annotations as a string, similar to how " "it would appear in the source file. This is useful for documentation " "generators that want to display annotations in a readable way." msgstr "" +":attr:`~Format.STRING` は、ソースファイルでの表記に近い文字列としてアノテー" +"ションを返します。\n" +"アノテーションを読みやすく表示するドキュメント生成ツールなどに便利です。" -#: ../../library/annotationlib.rst:40 msgid "" "The :func:`get_annotations` function is the main entry point for retrieving " "annotations. Given a function, class, or module, it returns an annotations " @@ -83,72 +92,88 @@ msgid "" "func:`call_annotate_function`, as well as the :func:`call_evaluate_function` " "function for working with :term:`evaluate functions `." msgstr "" +"アノテーションを取得する主な入口は :func:`get_annotations` 関数です。\n" +"関数、クラス、モジュールを渡すと、指定した形式のアノテーション辞書を返しま" +"す。\n" +"このモジュールには、アノテーションの評価に使う :term:`annotate 関数 " +"` を直接扱う :func:`get_annotate_from_class_namespace` " +"や :func:`call_annotate_function`、および :term:`evaluate 関数 ` を扱う :func:`call_evaluate_function` もあります。" -#: ../../library/annotationlib.rst:51 msgid "" "Most functionality in this module can execute arbitrary code; see :ref:`the " "security section ` for more information." msgstr "" +"このモジュールの大半の機能では、任意のコードが実行される可能性があります。\n" +"詳しくは :ref:`セキュリティの節 ` を参照してくださ" +"い。" -#: ../../library/annotationlib.rst:56 msgid "" ":pep:`649` proposed the current model for how annotations work in Python." msgstr "" +"現在の Python のアノテーションの動作モデルは :pep:`649` で提案されました。" -#: ../../library/annotationlib.rst:58 msgid "" ":pep:`749` expanded on various aspects of :pep:`649` and introduced the :mod:" "`!annotationlib` module." msgstr "" +":pep:`749` は :pep:`649` のさまざまな側面を詳しく規定し、:mod:`!" +"annotationlib` モジュールを導入しました。" -#: ../../library/annotationlib.rst:61 msgid "" ":ref:`annotations-howto` provides best practices for working with " "annotations." msgstr "" +"アノテーションを扱う際の推奨方法は :ref:`annotations-howto` を参照してくださ" +"い。" -#: ../../library/annotationlib.rst:64 msgid "" ":pypi:`typing-extensions` provides a backport of :func:`get_annotations` " "that works on earlier versions of Python." msgstr "" +":pypi:`typing-extensions` は、以前の Python バージョンでも使える :func:" +"`get_annotations` のバックポートを提供します。" -#: ../../library/annotationlib.rst:68 msgid "Annotation semantics" -msgstr "" +msgstr "アノテーションの意味論" -#: ../../library/annotationlib.rst:70 msgid "" "The way annotations are evaluated has changed over the history of Python 3, " "and currently still depends on a :ref:`future import `. There have " "been execution models for annotations:" msgstr "" +"Python 3 の歴史の中で、アノテーションの評価方法は変化してきました。\n" +"現在も :ref:`future インポート ` によって動作が変わります。\n" +"これまで、次の実行モデルが使われてきました。" -#: ../../library/annotationlib.rst:74 msgid "" "*Stock semantics* (default in Python 3.0 through 3.13; see :pep:`3107` and :" "pep:`526`): Annotations are evaluated eagerly, as they are encountered in " "the source code." msgstr "" +"*従来の意味論* (Python 3.0 から 3.13 までのデフォルト。:pep:`3107` と :pep:" +"`526` を参照): ソースコード内でアノテーションに到達した時点で、即座に評価しま" +"す。" -#: ../../library/annotationlib.rst:77 msgid "" "*Stringified annotations* (used with ``from __future__ import annotations`` " "in Python 3.7 and newer; see :pep:`563`): Annotations are stored as strings " "only." msgstr "" +"*文字列化されたアノテーション* (Python 3.7 以降で ``from __future__ import " +"annotations`` を使った場合。:pep:`563` を参照): アノテーションを文字列として" +"のみ保存します。" -#: ../../library/annotationlib.rst:80 msgid "" "*Deferred evaluation* (default in Python 3.14 and newer; see :pep:`649` and :" "pep:`749`): Annotations are evaluated lazily, only when they are accessed." msgstr "" +"*遅延評価* (Python 3.14 以降のデフォルト。:pep:`649` と :pep:`749` を参照): " +"アノテーションにアクセスしたときに初めて評価します。" -#: ../../library/annotationlib.rst:83 msgid "As an example, consider the following program::" -msgstr "" +msgstr "例として、次のプログラムを考えます。 ::" -#: ../../library/annotationlib.rst:85 msgid "" "def func(a: Cls) -> None:\n" " print(a)\n" @@ -157,31 +182,39 @@ msgid "" "\n" "print(func.__annotations__)" msgstr "" +"def func(a: Cls) -> None:\n" +" print(a)\n" +"\n" +"class Cls: pass\n" +"\n" +"print(func.__annotations__)" -#: ../../library/annotationlib.rst:92 msgid "This will behave as follows:" -msgstr "" +msgstr "動作は次のようになります。" -#: ../../library/annotationlib.rst:94 msgid "" "Under stock semantics (Python 3.13 and earlier), it will throw a :exc:" "`NameError` at the line where ``func`` is defined, because ``Cls`` is an " "undefined name at that point." msgstr "" +"従来の意味論 (Python 3.13 以前) では、``func`` を定義する行で :exc:" +"`NameError` が送出されます。\n" +"その時点では ``Cls`` が未定義だからです。" -#: ../../library/annotationlib.rst:97 msgid "" "Under stringified annotations (if ``from __future__ import annotations`` is " "used), it will print ``{'a': 'Cls', 'return': 'None'}``." msgstr "" +"文字列化されたアノテーション (``from __future__ import annotations`` を使った" +"場合) では、``{'a': 'Cls', 'return': 'None'}`` が表示されます。" -#: ../../library/annotationlib.rst:99 msgid "" "Under deferred evaluation (Python 3.14 and later), it will print ``{'a': " ", 'return': None}``." msgstr "" +"遅延評価 (Python 3.14 以降) では、``{'a': , 'return': None}`` が" +"表示されます。" -#: ../../library/annotationlib.rst:102 msgid "" "Stock semantics were used when function annotations were first introduced in " "Python 3.0 (by :pep:`3107`) because this was the simplest, most obvious way " @@ -201,24 +234,42 @@ msgid "" "__future__ import annotations`` is present, but this behavior will " "eventually be removed." msgstr "" +"Python 3.0 で関数のアノテーションが初めて導入されたとき (:pep:`3107`)、実装方" +"法として最も単純で分かりやすかったため、従来の意味論が採用されました。\n" +"Python 3.6 で変数のアノテーションが導入されたとき (:pep:`526`) も、同じ実行モ" +"デルが使われました。\n" +"しかし、アノテーションを型ヒントとして使うと、アノテーションに到達した時点で" +"はまだ定義されていない名前を参照したい場合などに、問題が生じました。\n" +"また、モジュールのインポート時にアノテーションを評価することには、性能上の問" +"題もありました。\n" +"そのため、Python 3.7 では :pep:`563` により、``from __future__ import " +"annotations`` という構文でアノテーションを文字列として保存する機能が導入され" +"ました。\n" +"当初は将来この動作をデフォルトにする予定でしたが、実行時にアノテーションを調" +"べる用途では、文字列化されたアノテーションを処理しにくいという問題が現れまし" +"た。\n" +"代案の :pep:`649` は、三つ目の実行モデルである遅延評価を導入し、Python 3.14 " +"に実装されました。\n" +"``from __future__ import annotations`` がある場合は今も文字列化されたアノテー" +"ションが使われますが、この動作はいずれ削除される予定です。" #: ../../library/annotationlib.rst:121 msgid "Classes" msgstr "クラス" -#: ../../library/annotationlib.rst:125 msgid "" "An :class:`~enum.IntEnum` describing the formats in which annotations can be " "returned. Members of the enum, or their equivalent integer values, can be " "passed to :func:`get_annotations` and other functions in this module, as " "well as to :attr:`~object.__annotate__` functions." msgstr "" +"アノテーションを返す形式を表す :class:`~enum.IntEnum` です。\n" +"列挙型のメンバーまたは対応する整数値を、:func:`get_annotations` などのこのモ" +"ジュールの関数や、:attr:`~object.__annotate__` 関数に渡せます。" -#: ../../library/annotationlib.rst:133 msgid "Values are the result of evaluating the annotation expressions." -msgstr "" +msgstr "値は、アノテーションの式を評価した結果です。" -#: ../../library/annotationlib.rst:138 msgid "" "Special value used to signal that an annotate function is being evaluated in " "a special environment with fake globals. When passed this value, annotate " @@ -227,50 +278,63 @@ msgid "" "not support execution in this environment. This format is only used " "internally and should not be passed to the functions in this module." msgstr "" +"annotate 関数が、仮のグローバル名前空間を持つ特別な環境で評価されていることを" +"示す特別な値です。\n" +"この値を渡された annotate 関数は、:attr:`Format.VALUE` 形式と同じ値を返すか、" +"この環境での実行をサポートしないことを示す :exc:`NotImplementedError` を送出" +"する必要があります。\n" +"この形式は内部でのみ使われ、このモジュールの関数に渡すべきではありません。" -#: ../../library/annotationlib.rst:149 msgid "" "Values are real annotation values (as per :attr:`Format.VALUE` format) for " "defined values, and :class:`ForwardRef` proxies for undefined values. Real " "objects may contain references to :class:`ForwardRef` proxy objects." msgstr "" +"定義済みの値には実際のアノテーションの値 (:attr:`Format.VALUE` 形式と同じ)、" +"未定義の値には :class:`ForwardRef` プロキシを使います。\n" +"実際のオブジェクトが :class:`ForwardRef` プロキシオブジェクトへの参照を含むこ" +"ともあります。" -#: ../../library/annotationlib.rst:157 msgid "" "Values are the text string of the annotation as it appears in the source " "code, up to modifications including, but not restricted to, whitespace " "normalizations and constant values optimizations." msgstr "" +"値は、ソースコード内のアノテーションの表記を文字列にしたものです。\n" +"ただし、空白の正規化や定数値の最適化などの変更が加わる場合があり、変更はこれ" +"らに限りません。" -#: ../../library/annotationlib.rst:161 msgid "" "The exact values of these strings may change in future versions of Python." msgstr "" +"これらの文字列の厳密な値は、将来の Python バージョンで変わる可能性がありま" +"す。" -#: ../../library/annotationlib.rst:167 msgid "A proxy object for forward references in annotations." -msgstr "" +msgstr "アノテーションの前方参照を表すプロキシオブジェクトです。" -#: ../../library/annotationlib.rst:169 msgid "" "Instances of this class are returned when the :attr:`~Format.FORWARDREF` " "format is used and annotations contain a name that cannot be resolved. This " "can happen when a forward reference is used in an annotation, such as when a " "class is referenced before it is defined." msgstr "" +":attr:`~Format.FORWARDREF` 形式を使い、アノテーションに解決できない名前が含ま" +"れている場合、このクラスのインスタンスが返されます。\n" +"例えば、定義前のクラスを参照するなど、アノテーションが前方参照を含む場合に起" +"こります。" -#: ../../library/annotationlib.rst:176 msgid "" "A string containing the code that was evaluated to produce the :class:" "`~ForwardRef`. The string may not be exactly equivalent to the original " "source." msgstr "" +":class:`~ForwardRef` を生成するために評価されたコードを含む文字列です。\n" +"元のソースコードと完全には一致しない場合があります。" -#: ../../library/annotationlib.rst:182 msgid "Evaluate the forward reference, returning its value." -msgstr "" +msgstr "前方参照を評価し、その値を返します。" -#: ../../library/annotationlib.rst:184 msgid "" "If the *format* argument is :attr:`~Format.VALUE` (the default), this method " "may throw an exception, such as :exc:`NameError`, if the forward reference " @@ -284,16 +348,31 @@ msgid "" "``list[ForwardRef('undefined')]``. If the *format* argument is :attr:" "`~Format.STRING`, the method will return :attr:`~ForwardRef.__forward_arg__`." msgstr "" +"``format`` 引数が :attr:`~Format.VALUE` (デフォルト) の場合、前方参照が解決で" +"きない名前を参照していると、:exc:`NameError` などの例外が送出されることがあり" +"ます。\n" +"このメソッドの引数を使うと、そうしなければ未定義となる名前に値を束縛できま" +"す。\n" +"``format`` 引数が :attr:`~Format.FORWARDREF` の場合、メソッドは例外を送出せ" +"ず、:class:`~ForwardRef` インスタンスを返すことがあります。\n" +"例えば、前方参照オブジェクトが ``list[undefined]`` というコードを含み、" +"``undefined`` が未定義の名前である場合、:attr:`~Format.FORWARDREF` 形式で評価" +"すると ``list[ForwardRef('undefined')]`` を返します。\n" +"``format`` 引数が :attr:`~Format.STRING` の場合は、:attr:`~ForwardRef." +"__forward_arg__` を返します。" -#: ../../library/annotationlib.rst:196 msgid "" "The *owner* parameter provides the preferred mechanism for passing scope " "information to this method. The owner of a :class:`~ForwardRef` is the " "object that contains the annotation from which the :class:`~ForwardRef` " "derives, such as a module object, type object, or function object." msgstr "" +"このメソッドにスコープの情報を渡すには、``owner`` パラメーターを使う方法を推" +"奨します。\n" +":class:`~ForwardRef` の所有者は、その :class:`~ForwardRef` の元となったアノ" +"テーションを含むオブジェクトです。\n" +"モジュールオブジェクト、型オブジェクト、関数オブジェクトなどが該当します。" -#: ../../library/annotationlib.rst:201 msgid "" "The *globals*, *locals*, and *type_params* parameters provide a more precise " "mechanism for influencing the names that are available when the :class:" @@ -307,8 +386,19 @@ msgid "" "an annotation found in the class namespace of a generic class ``C``, " "*type_params* should be set to ``C.__type_params__``." msgstr "" +"``globals``、``locals``、``type_params`` パラメーターを使うと、:class:" +"`~ForwardRef` の評価時に利用できる名前をより細かく制御できます。\n" +"``globals`` と ``locals`` は :func:`eval` に渡され、名前を評価するグローバル" +"名前空間とローカル名前空間を表します。\n" +"``type_params`` は、:ref:`ジェネリッククラス ` や :ref:`ジェ" +"ネリック関数 ` の専用構文で作成されたオブジェクトに関係し" +"ます。\n" +"前方参照の評価時にスコープ内にある :ref:`型パラメーター ` のタプ" +"ルです。\n" +"例えば、ジェネリッククラス ``C`` のクラス名前空間にあるアノテーションから取得" +"した :class:`~ForwardRef` を評価する場合、``type_params`` に ``C." +"__type_params__`` を指定してください。" -#: ../../library/annotationlib.rst:212 msgid "" ":class:`~ForwardRef` instances returned by :func:`get_annotations` retain " "references to information about the scope they originated from, so calling " @@ -317,19 +407,26 @@ msgid "" "any information about their scope, so passing arguments to this method may " "be necessary to evaluate them successfully." msgstr "" +":func:`get_annotations` が返す :class:`~ForwardRef` インスタンスは、元のス" +"コープの情報への参照を保持します。\n" +"そのため、追加の引数を指定せずにこのメソッドを呼ぶだけで、評価できる場合があ" +"ります。\n" +"他の方法で作った :class:`~ForwardRef` インスタンスにはスコープの情報がない場" +"合があるため、正しく評価するには引数を渡す必要があるかもしれません。" -#: ../../library/annotationlib.rst:219 msgid "" "If no *owner*, *globals*, *locals*, or *type_params* are provided and the :" "class:`~ForwardRef` does not contain information about its origin, empty " "globals and locals dictionaries are used." msgstr "" +"``owner``、``globals``、``locals``、``type_params`` をどれも指定せず、:class:" +"`~ForwardRef` に元のスコープの情報がない場合、グローバルとローカルの名前空間" +"には空の辞書を使います。" #: ../../library/annotationlib.rst:227 msgid "Functions" msgstr "関数" -#: ../../library/annotationlib.rst:231 msgid "" "Convert an annotations dict containing runtime values to a dict containing " "only strings. If the values are not already strings, they are converted " @@ -337,29 +434,39 @@ msgid "" "annotate functions that support the :attr:`~Format.STRING` format but do not " "have access to the code creating the annotations." msgstr "" +"実行時の値を含むアノテーション辞書を、文字列だけを含む辞書に変換します。\n" +"値がまだ文字列でなければ、:func:`type_repr` で変換します。\n" +"これは、:attr:`~Format.STRING` 形式をサポートするものの、アノテーションを作成" +"したコードにはアクセスできない、ユーザー定義の annotate 関数を補助するための" +"関数です。" -#: ../../library/annotationlib.rst:238 msgid "" "For example, this is used to implement the :attr:`~Format.STRING` format " "for :class:`typing.TypedDict` classes created through the functional syntax:" msgstr "" +"例えば、関数形式の構文で作成した :class:`typing.TypedDict` クラスの :attr:" +"`~Format.STRING` 形式は、この関数で実装されています。" -#: ../../library/annotationlib.rst:241 msgid "" ">>> from typing import TypedDict\n" ">>> Movie = TypedDict(\"movie\", {\"name\": str, \"year\": int})\n" ">>> get_annotations(Movie, format=Format.STRING)\n" "{'name': 'str', 'year': 'int'}" msgstr "" +">>> from typing import TypedDict\n" +">>> Movie = TypedDict(\"movie\", {\"name\": str, \"year\": int})\n" +">>> get_annotations(Movie, format=Format.STRING)\n" +"{'name': 'str', 'year': 'int'}" -#: ../../library/annotationlib.rst:252 msgid "" "Call the :term:`annotate function` *annotate* with the given *format*, a " "member of the :class:`Format` enum, and return the annotations dictionary " "produced by the function." msgstr "" +":term:`annotate 関数 ` ``annotate`` を、:class:`Format` 列" +"挙型のメンバーである ``format`` を指定して呼び出し、その関数が生成したアノ" +"テーション辞書を返します。" -#: ../../library/annotationlib.rst:256 msgid "" "This helper function is required because annotate functions generated by the " "compiler for functions, classes, and modules only support the :attr:`~Format." @@ -369,22 +476,32 @@ msgid "" "when implementing functionality that needs to partially evaluate annotations " "while a class is being constructed." msgstr "" +"関数、クラス、モジュールのためにコンパイラが生成する annotate 関数は、直接呼" +"び出した場合には :attr:`~Format.VALUE` 形式しかサポートしないため、この補助関" +"数が必要です。\n" +"他の形式をサポートするため、この関数は特別な環境で annotate 関数を呼び出し、" +"それらの形式のアノテーションを生成できるようにします。\n" +"クラスの作成途中でアノテーションを部分的に評価する機能を実装する際に役立ちま" +"す。" -#: ../../library/annotationlib.rst:265 msgid "" "*owner* is the object that owns the annotation function, usually a function, " "class, or module. If provided, it is used in the :attr:`~Format.FORWARDREF` " "format to produce a :class:`ForwardRef` object that carries more information." msgstr "" +"``owner`` はアノテーション関数を所有するオブジェクトで、通常は関数、クラス、" +"モジュールのいずれかです。\n" +"指定すると、:attr:`~Format.FORWARDREF` 形式で、より多くの情報を持つ :class:" +"`ForwardRef` オブジェクトを生成するために使われます。" -#: ../../library/annotationlib.rst:272 msgid "" ":PEP:`PEP 649 <649#the-stringizer-and-the-fake-globals-environment>` " "contains an explanation of the implementation technique used by this " "function." msgstr "" +"この関数で使われている実装手法は、:PEP:`PEP 649 <649#the-stringizer-and-the-" +"fake-globals-environment>` で説明されています。" -#: ../../library/annotationlib.rst:280 msgid "" "Call the :term:`evaluate function` *evaluate* with the given *format*, a " "member of the :class:`Format` enum, and return the value produced by the " @@ -392,56 +509,57 @@ msgid "" "always returns a dictionary mapping strings to annotations, while this " "function returns a single value." msgstr "" +":term:`evaluate 関数 ` ``evaluate`` を、:class:`Format` 列" +"挙型のメンバーである ``format`` を指定して呼び出し、その関数が生成した値を返" +"します。\n" +":func:`call_annotate_function` と似ていますが、そちらは常に文字列をアノテー" +"ションに対応付ける辞書を返すのに対し、この関数は一つの値を返します。" -#: ../../library/annotationlib.rst:286 msgid "" "This is intended for use with the evaluate functions generated for lazily " "evaluated elements related to type aliases and type parameters:" msgstr "" +"この関数は、型エイリアスや型パラメーターに関係する、遅延評価される要素のため" +"に生成された evaluate 関数で使うことを想定しています。" -#: ../../library/annotationlib.rst:289 msgid ":meth:`typing.TypeAliasType.evaluate_value`, the value of type aliases" -msgstr "" +msgstr ":meth:`typing.TypeAliasType.evaluate_value`: 型エイリアスの値" -#: ../../library/annotationlib.rst:290 msgid ":meth:`typing.TypeVar.evaluate_bound`, the bound of type variables" -msgstr "" +msgstr ":meth:`typing.TypeVar.evaluate_bound`: 型変数の上限" -#: ../../library/annotationlib.rst:291 msgid "" ":meth:`typing.TypeVar.evaluate_constraints`, the constraints of type " "variables" -msgstr "" +msgstr ":meth:`typing.TypeVar.evaluate_constraints`: 型変数の制約" -#: ../../library/annotationlib.rst:293 msgid "" ":meth:`typing.TypeVar.evaluate_default`, the default value of type variables" -msgstr "" +msgstr ":meth:`typing.TypeVar.evaluate_default`: 型変数のデフォルト値" -#: ../../library/annotationlib.rst:295 msgid "" ":meth:`typing.ParamSpec.evaluate_default`, the default value of parameter " "specifications" msgstr "" +":meth:`typing.ParamSpec.evaluate_default`: パラメーター仕様のデフォルト値" -#: ../../library/annotationlib.rst:297 msgid "" ":meth:`typing.TypeVarTuple.evaluate_default`, the default value of type " "variable tuples" msgstr "" +":meth:`typing.TypeVarTuple.evaluate_default`: 型変数タプルのデフォルト値" -#: ../../library/annotationlib.rst:300 msgid "" "*owner* is the object that owns the evaluate function, such as the type " "alias or type variable object." msgstr "" +"``owner`` は evaluate 関数を所有するオブジェクトです。\n" +"型エイリアスや型変数のオブジェクトなどが該当します。" -#: ../../library/annotationlib.rst:303 msgid "" "*format* can be used to control the format in which the value is returned:" -msgstr "" +msgstr "``format`` で、値を返す形式を制御できます。" -#: ../../library/annotationlib.rst:305 msgid "" ">>> type Alias = undefined\n" ">>> call_evaluate_function(Alias.evaluate_value, Format.VALUE)\n" @@ -453,8 +571,16 @@ msgid "" ">>> call_evaluate_function(Alias.evaluate_value, Format.STRING)\n" "'undefined'" msgstr "" +">>> type Alias = undefined\n" +">>> call_evaluate_function(Alias.evaluate_value, Format.VALUE)\n" +"Traceback (most recent call last):\n" +"...\n" +"NameError: name 'undefined' is not defined\n" +">>> call_evaluate_function(Alias.evaluate_value, Format.FORWARDREF)\n" +"ForwardRef('undefined')\n" +">>> call_evaluate_function(Alias.evaluate_value, Format.STRING)\n" +"'undefined'" -#: ../../library/annotationlib.rst:321 msgid "" "Retrieve the :term:`annotate function` from a class namespace dictionary " "*namespace*. Return :const:`!None` if the namespace does not contain an " @@ -463,40 +589,55 @@ msgid "" "function can be retrieved with ``cls.__annotate__``. See :ref:`below " "` for an example using this function in a metaclass." msgstr "" +"クラスの名前空間辞書 ``namespace`` から :term:`annotate 関数 ` を取得します。\n" +"名前空間に annotate 関数がなければ :const:`!None` を返します。\n" +"主に、クラスの作成が完了する前 (メタクラス内など) に役立ちます。\n" +"クラスができた後は、``cls.__annotate__`` で annotate 関数を取得できます。\n" +"メタクラスでこの関数を使う例は :ref:`後述 ` します。" #: ../../library/annotationlib.rst:331 msgid "Compute the annotations dict for an object." msgstr "オブジェクトに対するアノテーション辞書を計算します。" -#: ../../library/annotationlib.rst:333 msgid "" "*obj* may be a callable, class, module, or other object with :attr:`~object." "__annotate__` or :attr:`~object.__annotations__` attributes. Passing any " "other object raises :exc:`TypeError`." msgstr "" +"``obj`` には、呼び出し可能オブジェクト、クラス、モジュール、または :attr:" +"`~object.__annotate__` 属性か :attr:`~object.__annotations__` 属性を持つ他の" +"オブジェクトを指定できます。\n" +"それ以外のオブジェクトを渡すと :exc:`TypeError` が送出されます。" -#: ../../library/annotationlib.rst:337 msgid "" "The *format* parameter controls the format in which annotations are " "returned, and must be a member of the :class:`Format` enum or its integer " "equivalent. The different formats work as follows:" msgstr "" +"``format`` パラメーターはアノテーションを返す形式を制御し、:class:`Format` 列" +"挙型のメンバーまたは対応する整数値を指定する必要があります。\n" +"各形式の動作は次のとおりです。" -#: ../../library/annotationlib.rst:341 msgid "" "VALUE: :attr:`!object.__annotations__` is tried first; if that does not " "exist, the :attr:`!object.__annotate__` function is called if it exists." msgstr "" +"VALUE: まず :attr:`!object.__annotations__` を試します。\n" +"それがなければ、:attr:`!object.__annotate__` 関数があれば呼び出します。" -#: ../../library/annotationlib.rst:344 msgid "" "FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated " "successfully, it is used; otherwise, the :attr:`!object.__annotate__` " "function is called. If it does not exist either, :attr:`!object." "__annotations__` is tried again and any error from accessing it is re-raised." msgstr "" +"FORWARDREF: :attr:`!object.__annotations__` があり、正常に評価できればそれを" +"使います。\n" +"そうでなければ :attr:`!object.__annotate__` 関数を呼び出します。\n" +"その関数もない場合は、再び :attr:`!object.__annotations__` を試し、アクセス時" +"のエラーを再送出します。" -#: ../../library/annotationlib.rst:349 msgid "" "When calling :attr:`!object.__annotate__` it is first called with :attr:" "`~Format.FORWARDREF`. If this is not implemented, it will then check if :" @@ -505,15 +646,22 @@ msgid "" "back to using :attr:`~Format.VALUE`. If :attr:`~Format.VALUE` fails, the " "error from this call will be raised." msgstr "" +":attr:`!object.__annotate__` は、まず :attr:`~Format.FORWARDREF` を指定して呼" +"び出します。\n" +"その形式が実装されていなければ、:attr:`~Format.VALUE_WITH_FAKE_GLOBALS` のサ" +"ポートを確認し、仮のグローバル名前空間を持つ環境で使います。\n" +"どちらの形式もサポートされていなければ、:attr:`~Format.VALUE` を使います。\n" +":attr:`~Format.VALUE` での呼び出しが失敗した場合は、そのエラーを送出します。" -#: ../../library/annotationlib.rst:355 msgid "" "STRING: If :attr:`!object.__annotate__` exists, it is called first; " "otherwise, :attr:`!object.__annotations__` is used and stringified using :" "func:`annotations_to_string`." msgstr "" +"STRING: :attr:`!object.__annotate__` があれば、まずそれを呼び出します。\n" +"なければ :attr:`!object.__annotations__` を使い、:func:" +"`annotations_to_string` で文字列化します。" -#: ../../library/annotationlib.rst:359 msgid "" "When calling :attr:`!object.__annotate__` it is first called with :attr:" "`~Format.STRING`. If this is not implemented, it will then check if :attr:" @@ -523,115 +671,157 @@ msgid "" "`annotations_to_string`. If :attr:`~Format.VALUE` fails, the error from this " "call will be raised." msgstr "" +":attr:`!object.__annotate__` は、まず :attr:`~Format.STRING` を指定して呼び出" +"します。\n" +"その形式が実装されていなければ、:attr:`~Format.VALUE_WITH_FAKE_GLOBALS` のサ" +"ポートを確認し、仮のグローバル名前空間を持つ環境で使います。\n" +"どちらの形式もサポートされていなければ、:attr:`~Format.VALUE` を使い、その結" +"果を :func:`annotations_to_string` で変換します。\n" +":attr:`~Format.VALUE` での呼び出しが失敗した場合は、そのエラーを送出します。" -#: ../../library/annotationlib.rst:366 msgid "" "Returns a dict. :func:`!get_annotations` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" +"辞書を返します。\n" +":func:`!get_annotations` は呼び出すたびに新しい辞書を返します。\n" +"同じオブジェクトに対して 2 回呼び出すと、内容は同じでも別々の辞書が返されま" +"す。" -#: ../../library/annotationlib.rst:370 msgid "This function handles several details for you:" -msgstr "" +msgstr "この関数は、次の細部も処理します。" -#: ../../library/annotationlib.rst:372 msgid "" "If *eval_str* is true, values of type :class:`!str` will be un-stringized " "using :func:`eval`. This is intended for use with stringized annotations " "(``from __future__ import annotations``). It is an error to set *eval_str* " "to true with formats other than :attr:`Format.VALUE`." msgstr "" +"``eval_str`` が真の場合、:class:`!str` 型の値を :func:`eval` で評価し、文字列" +"化される前の値に戻します。\n" +"これは、文字列化されたアノテーション (``from __future__ import " +"annotations``) で使うことを想定しています。\n" +":attr:`Format.VALUE` 以外の形式で ``eval_str`` を真にすると、エラーになりま" +"す。" -#: ../../library/annotationlib.rst:377 msgid "" "If *obj* doesn't have an annotations dict, returns an empty dict. (Functions " "and methods always have an annotations dict; classes, modules, and other " "types of callables may not.)" msgstr "" +"``obj`` にアノテーション辞書がなければ、空の辞書を返します。\n" +"(関数とメソッドには常にアノテーション辞書がありますが、クラス、モジュール、他" +"の種類の呼び出し可能オブジェクトにはない場合があります。)" -#: ../../library/annotationlib.rst:381 msgid "" "Ignores inherited annotations on classes, as well as annotations on " "metaclasses. If a class doesn't have its own annotations dict, returns an " "empty dict." msgstr "" +"クラスが継承したアノテーションと、メタクラスのアノテーションは無視します。\n" +"クラス自体にアノテーション辞書がなければ、空の辞書を返します。" -#: ../../library/annotationlib.rst:384 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" +"安全のため、オブジェクトのメンバーと辞書の値へのアクセスには、すべて " +"``getattr()`` と ``dict.get()`` を使います。" -#: ../../library/annotationlib.rst:387 msgid "" "*eval_str* controls whether or not values of type :class:`!str` are replaced " "with the result of calling :func:`eval` on those values:" msgstr "" +"``eval_str`` は、:class:`!str` 型の値を、その値に対して :func:`eval` を呼び出" +"した結果に置き換えるかどうかを制御します。" -#: ../../library/annotationlib.rst:390 msgid "" "If eval_str is true, :func:`eval` is called on values of type :class:`!str`. " "(Note that :func:`!get_annotations` doesn't catch exceptions; if :func:" "`eval` raises an exception, it will unwind the stack past the :func:`!" "get_annotations` call.)" msgstr "" +"``eval_str`` が真の場合、:class:`!str` 型の値に対して :func:`eval` を呼び出し" +"ます。\n" +"(:func:`!get_annotations` は例外を捕捉しません。\n" +":func:`eval` が例外を送出すると、:func:`!get_annotations` の呼び出し元まで伝" +"播します。)" -#: ../../library/annotationlib.rst:394 msgid "" "If *eval_str* is false (the default), values of type :class:`!str` are " "unchanged." msgstr "" +"``eval_str`` が偽 (デフォルト) の場合、:class:`!str` 型の値は変更しません。" -#: ../../library/annotationlib.rst:397 msgid "" "*globals* and *locals* are passed in to :func:`eval`; see the documentation " "for :func:`eval` for more information. If *globals* or *locals* is :const:`!" "None`, this function may replace that value with a context-specific default, " "contingent on ``type(obj)``:" msgstr "" +"``globals`` と ``locals`` は :func:`eval` に渡されます。\n" +"詳しくは :func:`eval` のドキュメントを参照してください。\n" +"``globals`` または ``locals`` が :const:`!None` の場合、この関数は " +"``type(obj)`` に応じて、その値を文脈に適したデフォルト値に置き換えることがあ" +"ります。" -#: ../../library/annotationlib.rst:402 msgid "If *obj* is a module, *globals* defaults to ``obj.__dict__``." msgstr "" +"``obj`` がモジュールの場合、``globals`` のデフォルト値は ``obj.__dict__`` で" +"す。" -#: ../../library/annotationlib.rst:403 msgid "" "If *obj* is a class, *globals* defaults to ``sys.modules[obj.__module__]." "__dict__`` and *locals* defaults to the *obj* class namespace." msgstr "" +"``obj`` がクラスの場合、``globals`` のデフォルト値は ``sys.modules[obj." +"__module__].__dict__``、``locals`` のデフォルト値は ``obj`` のクラス名前空間" +"です。" -#: ../../library/annotationlib.rst:406 msgid "" "If *obj* is a callable, *globals* defaults to :attr:`obj.__globals__ " "`, although if *obj* is a wrapped function (using :" "func:`functools.update_wrapper`) or a :class:`functools.partial` object, it " "is unwrapped until a non-wrapped function is found." msgstr "" +"``obj`` が呼び出し可能オブジェクトの場合、``globals`` のデフォルト値は :attr:" +"`obj.__globals__ ` です。\n" +"ただし、``obj`` が (:func:`functools.update_wrapper` を使って) ラップされた関" +"数か :class:`functools.partial` オブジェクトの場合は、ラップされていない関数" +"が見つかるまでラッパーをたどって外します。" -#: ../../library/annotationlib.rst:412 msgid "" "Calling :func:`!get_annotations` is best practice for accessing the " "annotations dict of any object. See :ref:`annotations-howto` for more " "information on annotations best practices." msgstr "" +"オブジェクトのアノテーション辞書へのアクセスには、:func:`!get_annotations` の" +"呼び出しを推奨します。\n" +"アノテーションの推奨される扱い方については、:ref:`annotations-howto` を参照し" +"てください。" -#: ../../library/annotationlib.rst:416 msgid "" ">>> def f(a: int, b: str) -> float:\n" "... pass\n" ">>> get_annotations(f)\n" "{'a': , 'b': , 'return': }" msgstr "" +">>> def f(a: int, b: str) -> float:\n" +"... pass\n" +">>> get_annotations(f)\n" +"{'a': , 'b': , 'return': }" -#: ../../library/annotationlib.rst:427 msgid "" "Convert an arbitrary Python value to a format suitable for use by the :attr:" "`~Format.STRING` format. This calls :func:`repr` for most objects, but has " "special handling for some objects, such as type objects." msgstr "" +"任意の Python の値を、:attr:`~Format.STRING` 形式での使用に適した表現に変換し" +"ます。\n" +"大半のオブジェクトには :func:`repr` を呼び出しますが、型オブジェクトなど一部" +"のオブジェクトには特別な処理を行います。" -#: ../../library/annotationlib.rst:431 msgid "" "This is meant as a helper for user-provided annotate functions that support " "the :attr:`~Format.STRING` format but do not have access to the code " @@ -639,16 +829,19 @@ msgid "" "string representation for other objects that contain values that are " "commonly encountered in annotations." msgstr "" +"これは、:attr:`~Format.STRING` 形式をサポートするものの、アノテーションを作成" +"したコードにはアクセスできない、ユーザー定義の annotate 関数を補助するための" +"関数です。\n" +"アノテーションでよく使われる値を含む他のオブジェクトについても、読みやすい文" +"字列表現を提供するために使えます。" #: ../../library/annotationlib.rst:441 msgid "Recipes" msgstr "レシピ" -#: ../../library/annotationlib.rst:446 msgid "Using annotations in a metaclass" -msgstr "" +msgstr "メタクラスでのアノテーションの利用" -#: ../../library/annotationlib.rst:448 msgid "" "A :ref:`metaclass ` may want to inspect or even modify the " "annotations in a class body during class creation. Doing so requires " @@ -661,21 +854,33 @@ msgid "" "format will usually be best, because this allows the annotations to refer to " "names that cannot yet be resolved when the class is created." msgstr "" +":ref:`メタクラス ` では、クラスの作成中にクラス本体のアノテー" +"ションを調べたり変更したりしたい場合があります。\n" +"そのためには、クラスの名前空間辞書からアノテーションを取得する必要がありま" +"す。\n" +"``from __future__ import annotations`` を使って作成されたクラスでは、アノテー" +"ションは辞書の ``__annotations__`` キーにあります。\n" +"それ以外のアノテーションを持つクラスでは、:func:" +"`get_annotate_from_class_namespace` で annotate 関数を取得し、:func:" +"`call_annotate_function` で呼び出してアノテーションを取得できます。\n" +"クラスの作成時にはまだ解決できない名前をアノテーションで参照できるよう、通常" +"は :attr:`~Format.FORWARDREF` 形式を使うのが最適です。" -#: ../../library/annotationlib.rst:459 msgid "" "To modify the annotations, it is best to create a wrapper annotate function " "that calls the original annotate function, makes any necessary adjustments, " "and returns the result." msgstr "" +"アノテーションを変更するには、元の annotate 関数を呼び出して必要な調整を加" +"え、結果を返すラッパーの annotate 関数を作るのがよい方法です。" -#: ../../library/annotationlib.rst:463 msgid "" "Below is an example of a metaclass that filters out all :class:`typing." "ClassVar` annotations from the class and puts them in a separate attribute:" msgstr "" +"次の例は、クラスからすべての :class:`typing.ClassVar` アノテーションを取り出" +"し、別の属性に格納するメタクラスです。" -#: ../../library/annotationlib.rst:466 msgid "" "import annotationlib\n" "import typing\n" @@ -725,12 +930,55 @@ msgid "" "attribute\n" " return typ" msgstr "" +"import annotationlib\n" +"import typing\n" +"\n" +"class ClassVarSeparator(type):\n" +" def __new__(mcls, name, bases, ns):\n" +" if \"__annotations__\" in ns: # from __future__ import annotations\n" +" annotations = ns[\"__annotations__\"]\n" +" classvar_keys = {\n" +" key for key, value in annotations.items()\n" +" # 簡単にするため文字列を比較する。より堅牢な方法には\n" +" # annotationlib.ForwardRef.evaluate を使える\n" +" if value.startswith(\"ClassVar\")\n" +" }\n" +" classvars = {key: annotations[key] for key in classvar_keys}\n" +" ns[\"__annotations__\"] = {\n" +" key: value for key, value in annotations.items()\n" +" if key not in classvar_keys\n" +" }\n" +" wrapped_annotate = None\n" +" elif annotate := annotationlib.get_annotate_from_class_namespace(ns):\n" +" annotations = annotationlib.call_annotate_function(\n" +" annotate, format=annotationlib.Format.FORWARDREF\n" +" )\n" +" classvar_keys = {\n" +" key for key, value in annotations.items()\n" +" if typing.get_origin(value) is typing.ClassVar\n" +" }\n" +" classvars = {key: annotations[key] for key in classvar_keys}\n" +"\n" +" def wrapped_annotate(format):\n" +" annos = annotationlib.call_annotate_function(annotate, format, " +"owner=typ)\n" +" return {key: value for key, value in annos.items() if key not in " +"classvar_keys}\n" +"\n" +" else: # アノテーションなし\n" +" classvars = {}\n" +" wrapped_annotate = None\n" +" typ = super().__new__(mcls, name, bases, ns)\n" +"\n" +" if wrapped_annotate is not None:\n" +" # 元の __annotate__ を、ClassVar を取り除くラッパーで包む\n" +" typ.__annotate__ = wrapped_annotate\n" +" typ.classvars = classvars # ClassVar を別の属性に格納する\n" +" return typ" -#: ../../library/annotationlib.rst:514 msgid "Creating a custom callable annotate function" -msgstr "" +msgstr "独自の呼び出し可能オブジェクトによる annotate 関数の作成" -#: ../../library/annotationlib.rst:516 msgid "" "Custom :term:`annotate functions ` may be literal " "functions like those automatically generated for functions, classes, and " @@ -738,59 +986,77 @@ msgid "" "in which case any :term:`callable` can be used as an :term:`annotate " "function`." msgstr "" +"独自の :term:`annotate 関数 ` は、関数、クラス、モジュール" +"用に自動生成されるものと同じように、通常の関数で実装できます。\n" +"クラスによるカプセル化を使いたい場合には、任意の :term:`呼び出し可能オブジェ" +"クト ` を :term:`annotate 関数 ` として使えま" +"す。" -#: ../../library/annotationlib.rst:521 msgid "" "To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or :attr:" "`~Format.FORWARDREF` formats directly, an :term:`annotate function` must " "provide the following attribute:" msgstr "" +":attr:`~Format.VALUE`、:attr:`~Format.STRING`、:attr:`~Format.FORWARDREF` 形" +"式を直接提供するには、:term:`annotate 関数 ` に次の属性が" +"必要です。" -#: ../../library/annotationlib.rst:525 msgid "" "A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that " "does not raise a :exc:`NotImplementedError` when called with a supported " "format." msgstr "" +"``__call__(format, /) -> dict`` というシグネチャの呼び出し可能な " +"``__call__``。\n" +"サポートする形式を指定して呼び出した場合に、:exc:`NotImplementedError` を送出" +"しないもの。" -#: ../../library/annotationlib.rst:528 msgid "" "To provide the :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` format, which is used " "to automatically generate :attr:`~Format.STRING` or :attr:`~Format." "FORWARDREF` if they are not supported directly, :term:`annotate functions " "` must provide the following attributes:" msgstr "" +":attr:`~Format.VALUE_WITH_FAKE_GLOBALS` 形式は、:attr:`~Format.STRING` や :" +"attr:`~Format.FORWARDREF` が直接サポートされていない場合に、それらを自動生成" +"するために使われます。\n" +"この形式を提供する :term:`annotate 関数 ` には、次の属性が" +"必要です。" -#: ../../library/annotationlib.rst:533 msgid "" "A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that " "does not raise a :exc:`NotImplementedError` when called with :attr:`~Format." "VALUE_WITH_FAKE_GLOBALS`." msgstr "" +"``__call__(format, /) -> dict`` というシグネチャの呼び出し可能な " +"``__call__``。\n" +":attr:`~Format.VALUE_WITH_FAKE_GLOBALS` を指定して呼び出した場合に、:exc:" +"`NotImplementedError` を送出しないもの。" -#: ../../library/annotationlib.rst:536 msgid "" "A :ref:`code object ` ``__code__`` containing the compiled " "code for the annotate function." msgstr "" +"annotate 関数のコンパイル済みコードを含む :ref:`コードオブジェクト ` ``__code__``。" -#: ../../library/annotationlib.rst:538 msgid "" "Optional: A tuple of the function's positional defaults ``__defaults__``, if " "the function represented by ``__code__`` uses any positional defaults." msgstr "" +"任意: ``__code__`` が表す関数が位置引数のデフォルト値を使う場合、その値のタプ" +"ル ``__defaults__``。" -#: ../../library/annotationlib.rst:540 msgid "" "Optional: A dict of the function's keyword defaults ``__kwdefaults__``, if " "the function represented by ``__code__`` uses any keyword defaults." msgstr "" +"任意: ``__code__`` が表す関数がキーワード引数のデフォルト値を使う場合、その値" +"の辞書 ``__kwdefaults__``。" -#: ../../library/annotationlib.rst:542 msgid "Optional: All other :ref:`function attributes `." -msgstr "" +msgstr "任意: その他すべての :ref:`関数の属性 `。" -#: ../../library/annotationlib.rst:544 msgid "" "class Annotate:\n" " called_formats = []\n" @@ -814,21 +1080,42 @@ msgid "" " __builtins__ = {}\n" " __closure__ = None" msgstr "" +"class Annotate:\n" +" called_formats = []\n" +"\n" +" def __call__(self, format=None, /, *, _self=None):\n" +" # 仮のグローバル名前空間で呼ぶ場合、_self が実際の self の値、\n" +" # self が形式になる。\n" +" if _self is not None:\n" +" self, format = _self, self\n" +"\n" +" self.called_formats.append(format)\n" +" if format <= 2: # VALUE または VALUE_WITH_FAKE_GLOBALS\n" +" return {\"x\": MyType}\n" +" raise NotImplementedError\n" +"\n" +" __code__ = __call__.__code__\n" +" __defaults__ = (None,)\n" +" __kwdefaults__ = property(lambda self: dict(_self=self))\n" +"\n" +" __globals__ = {}\n" +" __builtins__ = {}\n" +" __closure__ = None" -#: ../../library/annotationlib.rst:568 msgid "This can then be called with:" -msgstr "" +msgstr "次のように呼び出せます。" -#: ../../library/annotationlib.rst:570 msgid "" ">>> from annotationlib import call_annotate_function, Format\n" ">>> call_annotate_function(Annotate(), format=Format.STRING)\n" "{'x': 'MyType'}" msgstr "" +">>> from annotationlib import call_annotate_function, Format\n" +">>> call_annotate_function(Annotate(), format=Format.STRING)\n" +"{'x': 'MyType'}" -#: ../../library/annotationlib.rst:576 msgid "Or used as the annotate function for an object:" -msgstr "" +msgstr "また、オブジェクトの annotate 関数としても使えます。" #: ../../library/annotationlib.rst:578 msgid "" @@ -840,25 +1127,29 @@ msgid "" "{'x': 'MyType'}" msgstr "" -#: ../../library/annotationlib.rst:589 msgid "Limitations of the ``STRING`` format" -msgstr "" +msgstr "``STRING`` 形式の制限" -#: ../../library/annotationlib.rst:591 msgid "" "The :attr:`~Format.STRING` format is meant to approximate the source code of " "the annotation, but the implementation strategy used means that it is not " "always possible to recover the exact source code." msgstr "" +":attr:`~Format.STRING` 形式は、アノテーションのソースコードに近い表現を生成す" +"るためのものです。\n" +"ただし、使用している実装手法のため、元のソースコードを完全に復元できるとは限" +"りません。" -#: ../../library/annotationlib.rst:595 msgid "" "First, the stringifier of course cannot recover any information that is not " "present in the compiled code, including comments, whitespace, " "parenthesization, and operations that get simplified by the compiler." msgstr "" +"第一に、文字列化の仕組みは、コンパイル済みコードに残っていない情報を復元でき" +"ません。\n" +"コメント、空白、括弧の付け方、コンパイラによって簡略化された演算などが該当し" +"ます。" -#: ../../library/annotationlib.rst:599 msgid "" "Second, the stringifier can intercept almost all operations that involve " "names looked up in some scope, but it cannot intercept operations that " @@ -867,8 +1158,14 @@ msgid "" "enough that it is possible to achieve arbitrary code execution even with no " "access to any globals or builtins. For example:" msgstr "" +"第二に、文字列化の仕組みは、スコープから検索した名前を含む演算のほとんどを横" +"取りできますが、定数だけを対象にした演算は横取りできません。\n" +"そのため、信頼できないコードに対して ``STRING`` 形式を要求することも安全では" +"ありません。\n" +"Python は十分に強力なので、グローバル名や組み込み名に一切アクセスしなくても、" +"任意のコードを実行できます。\n" +"例を示します。" -#: ../../library/annotationlib.rst:605 msgid "" ">>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__." "__builtins__[\"print\"](\"Hello world\")): pass\n" @@ -877,14 +1174,20 @@ msgid "" "Hello world\n" "{'x': 'None'}" msgstr "" +">>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__." +"__builtins__[\"print\"](\"Hello world\")): pass\n" +"...\n" +">>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING)\n" +"Hello world\n" +"{'x': 'None'}" -#: ../../library/annotationlib.rst:614 msgid "" "This particular example works as of the time of writing, but it relies on " "implementation details and is not guaranteed to work in the future." msgstr "" +"この例は執筆時点では動作しますが、実装の詳細に依存しており、将来も動作する保" +"証はありません。" -#: ../../library/annotationlib.rst:617 msgid "" "Among the different kinds of expressions that exist in Python, as " "represented by the :mod:`ast` module, some expressions are supported, " @@ -892,170 +1195,148 @@ msgid "" "code; others are unsupported, meaning that they may result in incorrect " "output or an error." msgstr "" +":mod:`ast` モジュールで表される Python のさまざまな式のうち、一部はサポートさ" +"れており、``STRING`` 形式で元のソースコードをおおむね復元できます。\n" +"その他の式はサポートされておらず、誤った出力やエラーを生じる場合があります。" -#: ../../library/annotationlib.rst:622 msgid "The following are supported (sometimes with caveats):" -msgstr "" +msgstr "次のものがサポートされています (一部には注意事項があります)。" -#: ../../library/annotationlib.rst:624 msgid ":class:`ast.BinOp`" -msgstr "" +msgstr ":class:`ast.BinOp`" -#: ../../library/annotationlib.rst:625 msgid ":class:`ast.UnaryOp`" -msgstr "" +msgstr ":class:`ast.UnaryOp`" -#: ../../library/annotationlib.rst:627 msgid "" ":class:`ast.Invert` (``~``), :class:`ast.UAdd` (``+``), and :class:`ast." "USub` (``-``) are supported" msgstr "" +":class:`ast.Invert` (``~``)、:class:`ast.UAdd` (``+``)、:class:`ast.USub` " +"(``-``) はサポートされています。" -#: ../../library/annotationlib.rst:628 msgid ":class:`ast.Not` (``not``) is not supported" -msgstr "" +msgstr ":class:`ast.Not` (``not``) はサポートされていません。" -#: ../../library/annotationlib.rst:630 msgid ":class:`ast.Dict` (except when using ``**`` unpacking)" -msgstr "" +msgstr ":class:`ast.Dict` (``**`` によるアンパックを使う場合を除く)" -#: ../../library/annotationlib.rst:631 msgid ":class:`ast.Set`" -msgstr "" +msgstr ":class:`ast.Set`" -#: ../../library/annotationlib.rst:632 msgid ":class:`ast.Compare`" -msgstr "" +msgstr ":class:`ast.Compare`" -#: ../../library/annotationlib.rst:634 msgid ":class:`ast.Eq` and :class:`ast.NotEq` are supported" -msgstr "" +msgstr ":class:`ast.Eq` と :class:`ast.NotEq` はサポートされています。" -#: ../../library/annotationlib.rst:635 msgid "" ":class:`ast.Lt`, :class:`ast.LtE`, :class:`ast.Gt`, and :class:`ast.GtE` are " "supported, but the operand may be flipped" msgstr "" +":class:`ast.Lt`、:class:`ast.LtE`、:class:`ast.Gt`、:class:`ast.GtE` はサポー" +"トされていますが、オペランドが入れ替わる場合があります。" -#: ../../library/annotationlib.rst:636 msgid "" ":class:`ast.Is`, :class:`ast.IsNot`, :class:`ast.In`, and :class:`ast.NotIn` " "are not supported" msgstr "" +":class:`ast.Is`、:class:`ast.IsNot`、:class:`ast.In`、:class:`ast.NotIn` はサ" +"ポートされていません。" -#: ../../library/annotationlib.rst:638 msgid ":class:`ast.Call` (except when using ``**`` unpacking)" -msgstr "" +msgstr ":class:`ast.Call` (``**`` によるアンパックを使う場合を除く)" -#: ../../library/annotationlib.rst:639 msgid "" ":class:`ast.Constant` (though not the exact representation of the constant; " "for example, escape sequences in strings are lost; hexadecimal numbers are " "converted to decimal)" msgstr "" +":class:`ast.Constant` (ただし、定数の厳密な表記は保持されません。例えば、文字" +"列内のエスケープシーケンスは失われ、16 進数は 10 進数に変換されます)" -#: ../../library/annotationlib.rst:641 msgid ":class:`ast.Attribute` (assuming the value is not a constant)" -msgstr "" +msgstr ":class:`ast.Attribute` (対象の値が定数ではない場合)" -#: ../../library/annotationlib.rst:642 msgid ":class:`ast.Subscript` (assuming the value is not a constant)" -msgstr "" +msgstr ":class:`ast.Subscript` (対象の値が定数ではない場合)" -#: ../../library/annotationlib.rst:643 msgid ":class:`ast.Starred` (``*`` unpacking)" -msgstr "" +msgstr ":class:`ast.Starred` (``*`` によるアンパック)" -#: ../../library/annotationlib.rst:644 msgid ":class:`ast.Name`" -msgstr "" +msgstr ":class:`ast.Name`" -#: ../../library/annotationlib.rst:645 msgid ":class:`ast.List`" -msgstr "" +msgstr ":class:`ast.List`" -#: ../../library/annotationlib.rst:646 msgid ":class:`ast.Tuple`" -msgstr "" +msgstr ":class:`ast.Tuple`" -#: ../../library/annotationlib.rst:647 msgid ":class:`ast.Slice`" -msgstr "" +msgstr ":class:`ast.Slice`" -#: ../../library/annotationlib.rst:649 msgid "" "The following are unsupported, but throw an informative error when " "encountered by the stringifier:" msgstr "" +"次のものはサポートされていませんが、文字列化の処理で検出すると、説明のあるエ" +"ラーを送出します。" -#: ../../library/annotationlib.rst:652 msgid "" ":class:`ast.FormattedValue` (f-strings; error is not detected if conversion " "specifiers like ``!r`` are used)" msgstr "" +":class:`ast.FormattedValue` (f 文字列。ただし、``!r`` などの変換指定子がある" +"場合はエラーを検出できません)" -#: ../../library/annotationlib.rst:654 msgid ":class:`ast.JoinedStr` (f-strings)" -msgstr "" +msgstr ":class:`ast.JoinedStr` (f 文字列)" -#: ../../library/annotationlib.rst:656 msgid "The following are unsupported and result in incorrect output:" -msgstr "" +msgstr "次のものはサポートされておらず、誤った出力になります。" -#: ../../library/annotationlib.rst:658 msgid ":class:`ast.BoolOp` (``and`` and ``or``)" -msgstr "" +msgstr ":class:`ast.BoolOp` (``and`` と ``or``)" -#: ../../library/annotationlib.rst:659 msgid ":class:`ast.IfExp`" -msgstr "" +msgstr ":class:`ast.IfExp`" -#: ../../library/annotationlib.rst:660 msgid ":class:`ast.Lambda`" -msgstr "" +msgstr ":class:`ast.Lambda`" -#: ../../library/annotationlib.rst:661 msgid ":class:`ast.ListComp`" -msgstr "" +msgstr ":class:`ast.ListComp`" -#: ../../library/annotationlib.rst:662 msgid ":class:`ast.SetComp`" -msgstr "" +msgstr ":class:`ast.SetComp`" -#: ../../library/annotationlib.rst:663 msgid ":class:`ast.DictComp`" -msgstr "" +msgstr ":class:`ast.DictComp`" -#: ../../library/annotationlib.rst:664 msgid ":class:`ast.GeneratorExp`" -msgstr "" +msgstr ":class:`ast.GeneratorExp`" -#: ../../library/annotationlib.rst:666 msgid "" "The following are disallowed in annotation scopes and therefore not relevant:" msgstr "" +"次のものはアノテーションスコープで禁止されているため、対象になりません。" -#: ../../library/annotationlib.rst:668 msgid ":class:`ast.NamedExpr` (``:=``)" -msgstr "" +msgstr ":class:`ast.NamedExpr` (``:=``)" -#: ../../library/annotationlib.rst:669 msgid ":class:`ast.Await`" -msgstr "" +msgstr ":class:`ast.Await`" -#: ../../library/annotationlib.rst:670 msgid ":class:`ast.Yield`" -msgstr "" +msgstr ":class:`ast.Yield`" -#: ../../library/annotationlib.rst:671 msgid ":class:`ast.YieldFrom`" -msgstr "" +msgstr ":class:`ast.YieldFrom`" -#: ../../library/annotationlib.rst:675 msgid "Limitations of the ``FORWARDREF`` format" -msgstr "" +msgstr "``FORWARDREF`` 形式の制限" -#: ../../library/annotationlib.rst:677 msgid "" "The :attr:`~Format.FORWARDREF` format aims to produce real values as much as " "possible, with anything that cannot be resolved replaced with :class:" @@ -1064,12 +1345,15 @@ msgid "" "literals or that use unsupported expression types may raise exceptions when " "evaluated using the :attr:`~Format.FORWARDREF` format." msgstr "" +":attr:`~Format.FORWARDREF` 形式は、可能な限り実際の値を生成し、解決できないも" +"のを :class:`ForwardRef` オブジェクトに置き換えようとします。\n" +"制限はおおむね :attr:`~Format.STRING` 形式と同じです。\n" +"リテラルに対する演算や、サポートされていない種類の式を含むアノテーションを :" +"attr:`~Format.FORWARDREF` 形式で評価すると、例外が送出される場合があります。" -#: ../../library/annotationlib.rst:684 msgid "Below are a few examples of the behavior with unsupported expressions:" -msgstr "" +msgstr "サポートされていない式での動作例をいくつか示します。" -#: ../../library/annotationlib.rst:686 msgid "" ">>> from annotationlib import get_annotations, Format\n" ">>> def zerodiv(x: 1 / 0): ...\n" @@ -1085,12 +1369,23 @@ msgid "" ">>> get_annotations(ifexp, format=Format.STRING)\n" "{'x': '1'}" msgstr "" +">>> from annotationlib import get_annotations, Format\n" +">>> def zerodiv(x: 1 / 0): ...\n" +">>> get_annotations(zerodiv, format=Format.STRING)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ZeroDivisionError: division by zero\n" +">>> get_annotations(zerodiv, format=Format.FORWARDREF)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ZeroDivisionError: division by zero\n" +">>> def ifexp(x: 1 if y else 0): ...\n" +">>> get_annotations(ifexp, format=Format.STRING)\n" +"{'x': '1'}" -#: ../../library/annotationlib.rst:705 msgid "Security implications of introspecting annotations" -msgstr "" +msgstr "アノテーションを調べる際のセキュリティへの影響" -#: ../../library/annotationlib.rst:707 msgid "" "Much of the functionality in this module involves executing code related to " "annotations, which can then do arbitrary things. For example, :func:" @@ -1102,8 +1397,17 @@ msgid "" "functions in the :mod:`typing` module that work with annotations, such as :" "func:`typing.get_type_hints`." msgstr "" +"このモジュールの多くの機能はアノテーションに関係するコードを実行し、そのコー" +"ドは任意の操作を行えます。\n" +"例えば、:func:`get_annotations` は任意の :term:`annotate 関数 ` を呼び出す可能性があり、:meth:`ForwardRef.evaluate` は任意の文字列" +"に対して :func:`eval` を呼び出す可能性があります。\n" +"アノテーション内のコードは、任意のシステムコールを実行したり、無限ループに" +"入ったり、その他のあらゆる操作を行ったりするかもしれません。\n" +"この点は、:attr:`~object.__annotations__` 属性へのあらゆるアクセスや、:func:" +"`typing.get_type_hints` など、アノテーションを扱う :mod:`typing` モジュールの" +"関数にも当てはまります。" -#: ../../library/annotationlib.rst:716 msgid "" "Any security issue arising from this also applies immediately after " "importing code that may contain untrusted annotations: importing code can " @@ -1113,3 +1417,10 @@ msgid "" "``__annotations__`` dictionary or directly creating a :class:`ForwardRef` " "object." msgstr "" +"このことから生じるセキュリティの問題は、信頼できないアノテーションを含む可能" +"性があるコードをインポートした直後にも当てはまります。\n" +"コードのインポートでは、常に任意の操作が実行され得るためです。\n" +"ただし、信頼できない入力元から文字列などを受け取り、アノテーションを調べる " +"API に渡すのは安全ではありません。\n" +"例えば、``__annotations__`` 辞書の編集や、:class:`ForwardRef` オブジェクトの" +"直接作成によって、そのような入力を渡す場合が該当します。" diff --git a/library/archiving.po b/library/archiving.po index 316b87287..9b1efb54d 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -26,10 +26,13 @@ msgstr "" msgid "Data Compression and Archiving" msgstr "データ圧縮とアーカイブ" -#: ../../library/archiving.rst:7 msgid "" "The modules described in this chapter support data compression with the " "zlib, gzip, bzip2, lzma, and zstd algorithms, and the creation of ZIP- and " "tar-format archives. See also :ref:`archiving-operations` provided by the :" "mod:`shutil` module." msgstr "" +"この章のモジュールは、zlib、gzip、bzip2、lzma、zstd アルゴリズムによるデータ" +"圧縮と、ZIP 形式・tar 形式のアーカイブ作成をサポートします。\n" +":mod:`shutil` モジュールが提供する :ref:`archiving-operations` も参照してくだ" +"さい。" diff --git a/library/argparse.po b/library/argparse.po index b49366da3..6a7ea8824 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -36,7 +36,6 @@ msgstr "" msgid "**Source code:** :source:`Lib/argparse.py`" msgstr "**ソースコード:** :source:`Lib/argparse.py`" -#: ../../library/argparse.rst:13 msgid "" "While :mod:`!argparse` is the default recommended standard library module " "for implementing basic command line applications, authors with more exacting " @@ -48,6 +47,14 @@ msgid "" "option parameter values that start with ``-`` even when they correspond to " "another defined option)." msgstr "" +":mod:`!argparse` は基本的なコマンドラインアプリケーションの実装に推奨される標" +"準ライブラリのモジュールですが、動作を厳密に制御したい場合には、必要な制御が" +"できないことがあります。\n" +"``argparse`` が必要な動作をサポートしていない場合、代替手段については :ref:" +"`choosing-an-argument-parser` を参照してください。\n" +"例えば、オプションと位置引数の混在を完全に禁止したり、``-`` で始まる値が他の" +"定義済みオプションと一致する場合でもオプションの値として受け付けたりしたい場" +"合が該当します。" #: ../../library/argparse.rst-1 msgid "Tutorial" @@ -63,7 +70,6 @@ msgstr "" "リアル ` では、コマンドラインの解析についてより優しく説明" "しています。" -#: ../../library/argparse.rst:31 msgid "" "The :mod:`!argparse` module makes it easy to write user-friendly command-" "line interfaces. The program defines what arguments it requires, and :mod:`!" @@ -72,14 +78,23 @@ msgid "" "messages. The module will also issue errors when users give the program " "invalid arguments." msgstr "" +":mod:`!argparse` モジュールを使うと、使いやすいコマンドラインインターフェース" +"を簡単に作成できます。\n" +"プログラムで必要な引数を定義すると、:mod:`!argparse` が :data:`sys.argv` から" +"それらを解析する方法を判断します。\n" +":mod:`!argparse` はヘルプと使用法のメッセージも自動生成し、ユーザーが不正な引" +"数を渡すとエラーを表示します。" -#: ../../library/argparse.rst:37 msgid "" "The :mod:`!argparse` module's support for command-line interfaces is built " "around an instance of :class:`argparse.ArgumentParser`. It is a container " "for argument specifications and has options that apply to the parser as " "whole::" msgstr "" +":mod:`!argparse` のコマンドラインインターフェースのサポートは、:class:" +"`argparse.ArgumentParser` のインスタンスを中心に構成されています。\n" +"このオブジェクトは引数の仕様を格納し、パーサー全体に適用するオプションを持ち" +"ます。 ::" #: ../../library/argparse.rst:41 msgid "" @@ -123,18 +138,20 @@ msgstr "" ":meth:`ArgumentParser.parse_args` メソッドはパーサーを実行し、抽出したデータ" "を :class:`argparse.Namespace` オブジェクト内に配置します::" -#: ../../library/argparse.rst:58 msgid "" "args = parser.parse_args()\n" "print(args.filename, args.count, args.verbose)" msgstr "" +"args = parser.parse_args()\n" +"print(args.filename, args.count, args.verbose)" -#: ../../library/argparse.rst:62 msgid "" "If you're looking for a guide about how to upgrade :mod:`optparse` code to :" "mod:`!argparse`, see :ref:`Upgrading Optparse Code `." msgstr "" +":mod:`optparse` のコードを :mod:`!argparse` に移行する方法は、:ref:`Optparse " +"のコードのアップグレード ` を参照してください。" #: ../../library/argparse.rst:66 msgid "ArgumentParser objects" @@ -150,11 +167,12 @@ msgstr "" "ワード引数として渡すべきです。各引数についてはあとで詳しく説明しますが、簡単" "に言うと:" -#: ../../library/argparse.rst:80 msgid "" "prog_ - The name of the program (default: generated from the ``__main__`` " "module attributes and ``sys.argv[0]``)" msgstr "" +"prog_ - プログラム名 (デフォルト: ``__main__`` モジュールの属性と ``sys." +"argv[0]`` から生成)" #: ../../library/argparse.rst:83 msgid "" @@ -223,27 +241,29 @@ msgstr "" "add_help_ - ``-h/--help`` オプションをパーサーに追加する (デフォルト: " "``True``)" -#: ../../library/argparse.rst:110 msgid "" "allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is " "unambiguous (default: ``True``)" msgstr "" +"allow_abbrev_ - 意味が一意に決まる場合に、長いオプションの省略を許可する (デ" +"フォルト: ``True``)" -#: ../../library/argparse.rst:113 msgid "" "exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits " "with error info when an error occurs. (default: ``True``)" msgstr "" +"exit_on_error_ - エラーが起きたときに、:class:`!ArgumentParser` がエラー情報" +"を表示して終了するかどうか (デフォルト: ``True``)" -#: ../../library/argparse.rst:116 msgid "" "suggest_on_error_ - Enables suggestions for mistyped argument choices and " "subparser names (default: ``True``)" msgstr "" +"suggest_on_error_ - 引数の選択肢やサブパーサー名の入力ミスに対して候補を提示" +"する (デフォルト: ``True``)" -#: ../../library/argparse.rst:119 msgid "color_ - Allow color output (default: ``True``)" -msgstr "" +msgstr "color_ - 色付きの出力を許可する (デフォルト: ``True``)" #: ../../library/argparse.rst:121 msgid "*allow_abbrev* parameter was added." @@ -261,13 +281,11 @@ msgstr "" msgid "*exit_on_error* parameter was added." msgstr "*exit_on_error* 引数が追加されました。" -#: ../../library/argparse.rst:131 msgid "*suggest_on_error* and *color* parameters were added." -msgstr "" +msgstr "``suggest_on_error`` と ``color`` パラメーターが追加されました。" -#: ../../library/argparse.rst:134 msgid "*suggest_on_error* default changed to ``True``." -msgstr "" +msgstr "``suggest_on_error`` のデフォルト値が ``True`` に変わりました。" #: ../../library/argparse.rst:137 ../../library/argparse.rst:699 msgid "The following sections describe how each of these are used." @@ -277,39 +295,45 @@ msgstr "以下の節では各オプションの利用方法を説明します。 msgid "prog" msgstr "``prog``" -#: ../../library/argparse.rst:146 msgid "" "By default, :class:`ArgumentParser` calculates the name of the program to " "display in help messages depending on the way the Python interpreter was run:" msgstr "" +"デフォルトでは、:class:`ArgumentParser` は Python インタープリタの実行方法に" +"応じて、ヘルプに表示するプログラム名を求めます。" -#: ../../library/argparse.rst:149 msgid "" "The :func:`base name ` of ``sys.argv[0]`` if a file was " "passed as argument." msgstr "" +"ファイルを引数に渡した場合は、``sys.argv[0]`` の :func:`ベース名 `。" -#: ../../library/argparse.rst:151 msgid "" "The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " "zipfile was passed as argument." msgstr "" +"ディレクトリか ZIP ファイルを引数に渡した場合は、Python インタープリタの名前" +"に ``sys.argv[0]`` を続けたもの。" -#: ../../library/argparse.rst:153 msgid "" "The Python interpreter name followed by ``-m`` followed by the module or " "package name if the :option:`-m` option was used." msgstr "" +":option:`-m` オプションを使った場合は、Python インタープリタの名前に ``-m``、" +"モジュール名またはパッケージ名を続けたもの。" -#: ../../library/argparse.rst:156 msgid "" "This default is almost always desirable because it will make the help " "messages match the string that was used to invoke the program on the command " "line. However, to change this default behavior, another value can be " "supplied using the ``prog=`` argument to :class:`ArgumentParser`::" msgstr "" +"このデフォルトの動作では、コマンドラインでプログラムを実行した文字列とヘルプ" +"の表記が一致するので、ほとんどの場合に適しています。\n" +"変更したい場合は、:class:`ArgumentParser` の ``prog=`` 引数に別の値を指定でき" +"ます。 ::" -#: ../../library/argparse.rst:161 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.print_help()\n" @@ -318,15 +342,22 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" -#: ../../library/argparse.rst:168 msgid "" "Note that the program name, whether determined from ``sys.argv[0]``, from " "the ``__main__`` module attributes or from the ``prog=`` argument, is " "available to help messages using the ``%(prog)s`` format specifier." msgstr "" +"プログラム名は、``sys.argv[0]``、``__main__`` モジュールの属性、``prog=`` 引" +"数のどれから決まった場合でも、ヘルプ内で書式指定子 ``%(prog)s`` を使って参照" +"できます。" -#: ../../library/argparse.rst:175 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" @@ -337,25 +368,35 @@ msgid "" " -h, --help show this help message and exit\n" " --foo FOO foo of the myprogram program" msgstr "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO foo of the myprogram program" -#: ../../library/argparse.rst:184 msgid "" "The default ``prog`` value now reflects how ``__main__`` was actually " "executed, rather than always being ``os.path.basename(sys.argv[0])``." msgstr "" +"デフォルトの ``prog`` 値は、常に ``os.path.basename(sys.argv[0])`` になるので" +"はなく、``__main__`` の実際の実行方法を反映するようになりました。" #: ../../library/argparse.rst:189 msgid "usage" msgstr "usage" -#: ../../library/argparse.rst:191 msgid "" "By default, :class:`ArgumentParser` calculates the usage message from the " "arguments it contains. The default message can be overridden with the " "``usage=`` keyword argument::" msgstr "" +"デフォルトでは、:class:`ArgumentParser` は登録された引数から使用法のメッセー" +"ジを生成します。\n" +"``usage=`` キーワード引数を指定すると、このメッセージを置き換えられます。 ::" -#: ../../library/argparse.rst:195 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " "[options]')\n" @@ -371,6 +412,19 @@ msgid "" " -h, --help show this help message and exit\n" " --foo [FOO] foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " +"[options]')\n" +">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [options]\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo [FOO] foo help" #: ../../library/argparse.rst:208 msgid "" @@ -380,7 +434,6 @@ msgstr "" "``%(prog)s`` フォーマット指定子を、使用法メッセージ内でプログラム名として利用" "できます。" -#: ../../library/argparse.rst:211 msgid "" "When a custom usage message is specified for the main parser, you may also " "want to consider passing the ``prog`` argument to :meth:`~ArgumentParser." @@ -388,12 +441,15 @@ msgid "" "`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and " "usage information across subparsers." msgstr "" +"メインのパーサーに独自の使用法メッセージを指定する場合は、サブパーサー間でコ" +"マンドの先頭部分や使用法の情報を揃えるため、:meth:`~ArgumentParser." +"add_subparsers` に ``prog`` 引数を渡すか、:meth:`~_SubParsersAction." +"add_parser` に ``prog`` と ``usage`` 引数を渡すことも検討してください。" #: ../../library/argparse.rst:221 msgid "description" msgstr "description" -#: ../../library/argparse.rst:223 msgid "" "Most calls to the :class:`ArgumentParser` constructor will use the " "``description=`` keyword argument. This argument gives a brief description " @@ -401,6 +457,11 @@ msgid "" "description is displayed between the command-line usage string and the help " "messages for the various arguments." msgstr "" +":class:`ArgumentParser` コンストラクターを呼ぶ際は、多くの場合 " +"``description=`` キーワード引数を使います。\n" +"この引数には、プログラムが何をどのように行うかの簡潔な説明を指定します。\n" +"ヘルプでは、コマンドラインの使用法を示す文字列と各引数のヘルプの間に表示され" +"ます。" #: ../../library/argparse.rst:229 msgid "" @@ -424,7 +485,6 @@ msgstr "" "します。このテキストは :class:`ArgumentParser` の ``epilog=`` 引数に指定でき" "ます::" -#: ../../library/argparse.rst:240 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... description='A foo that bars',\n" @@ -439,6 +499,18 @@ msgid "" "\n" "And that's how you'd foo a bar" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... description='A foo that bars',\n" +"... epilog=\"And that's how you'd foo a bar\")\n" +">>> parser.print_help()\n" +"usage: argparse.py [-h]\n" +"\n" +"A foo that bars\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"And that's how you'd foo a bar" #: ../../library/argparse.rst:253 msgid "" @@ -470,7 +542,6 @@ msgstr "" "すべての位置アクションとオプションのアクションをそれらから集め、そのアクショ" "ンを構築中の :class:`ArgumentParser` オブジェクトに追加します::" -#: ../../library/argparse.rst:268 msgid "" ">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" ">>> parent_parser.add_argument('--parent', type=int)\n" @@ -485,6 +556,18 @@ msgid "" ">>> bar_parser.parse_args(['--bar', 'YYY'])\n" "Namespace(bar='YYY', parent=None)" msgstr "" +">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" +">>> parent_parser.add_argument('--parent', type=int)\n" +"\n" +">>> foo_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> foo_parser.add_argument('foo')\n" +">>> foo_parser.parse_args(['--parent', '2', 'XXX'])\n" +"Namespace(foo='XXX', parent=2)\n" +"\n" +">>> bar_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> bar_parser.add_argument('--bar')\n" +">>> bar_parser.parse_args(['--bar', 'YYY'])\n" +"Namespace(bar='YYY', parent=None)" msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " @@ -530,7 +613,6 @@ msgstr "" "`ArgumentParser` オブジェクトはコマンドラインヘルプの中の description_ と " "epilog_ を折り返して表示します::" -#: ../../library/argparse.rst:310 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -553,6 +635,26 @@ msgid "" "words\n" "will be wrapped across a couple lines" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... description='''this description\n" +"... was indented weird\n" +"... but that is okay''',\n" +"... epilog='''\n" +"... likewise for this epilog whose whitespace will\n" +"... be cleaned up and whose words will be wrapped\n" +"... across a couple lines''')\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"this description was indented weird but that is okay\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"likewise for this epilog whose whitespace will be cleaned up and whose " +"words\n" +"will be wrapped across a couple lines" #: ../../library/argparse.rst:330 msgid "" @@ -563,7 +665,6 @@ msgstr "" "``formatter_class=`` に :class:`RawDescriptionHelpFormatter` を渡した場合、 " "description_ と epilog_ は整形済みとされ改行されません::" -#: ../../library/argparse.rst:334 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -587,14 +688,38 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.RawDescriptionHelpFormatter,\n" +"... description=textwrap.dedent('''\\\n" +"... Please do not mess up this text!\n" +"... --------------------------------\n" +"... I have indented it\n" +"... exactly the way\n" +"... I want it\n" +"... '''))\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"Please do not mess up this text!\n" +"--------------------------------\n" +" I have indented it\n" +" exactly the way\n" +" I want it\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" -#: ../../library/argparse.rst:356 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " "text, including argument descriptions. However, multiple newlines are " "replaced with one. If you wish to preserve multiple blank lines, add spaces " "between the newlines." msgstr "" +":class:`RawTextHelpFormatter` は、引数の説明を含むすべてのヘルプテキストの空" +"白を保持します。\n" +"ただし、連続する改行は一つにまとめられます。\n" +"複数の空行を残したい場合は、改行の間にスペースを入れてください。" #: ../../library/argparse.rst:361 msgid "" @@ -604,7 +729,6 @@ msgstr "" ":class:`ArgumentDefaultsHelpFormatter` は各引数のデフォルト値を自動的にヘルプ" "に追加します::" -#: ../../library/argparse.rst:364 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -621,6 +745,20 @@ msgid "" " -h, --help show this help message and exit\n" " --foo FOO FOO! (default: 42)" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int, default=42, help='FOO!')\n" +">>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo FOO] [bar ...]\n" +"\n" +"positional arguments:\n" +" bar BAR! (default: [1, 2, 3])\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO FOO! (default: 42)" #: ../../library/argparse.rst:379 msgid "" @@ -631,7 +769,6 @@ msgstr "" ":class:`MetavarTypeHelpFormatter` は、各引数の値の表示名に type_ 引数の値を使" "用します (通常は dest_ の値が使用されます)::" -#: ../../library/argparse.rst:383 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -648,20 +785,37 @@ msgid "" " -h, --help show this help message and exit\n" " --foo int" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.MetavarTypeHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', type=float)\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo int] float\n" +"\n" +"positional arguments:\n" +" float\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo int" #: ../../library/argparse.rst:400 msgid "prefix_chars" msgstr "prefix_chars" -#: ../../library/argparse.rst:402 msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " "for options like ``+f`` or ``/foo``, may specify them using the " "``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" msgstr "" +"ほとんどのコマンドラインオプションでは、``-f/--foo`` のように接頭辞として ``-" +"`` を使います。\n" +"``+f`` や ``/foo`` のように、別の文字や追加の文字を接頭辞としてサポートする必" +"要があるパーサーでは、:class:`ArgumentParser` コンストラクターの " +"``prefix_chars=`` 引数でそれらの文字を指定できます。 ::" -#: ../../library/argparse.rst:408 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" ">>> parser.add_argument('+f')\n" @@ -669,6 +823,11 @@ msgid "" ">>> parser.parse_args('+f X ++bar Y'.split())\n" "Namespace(bar='Y', f='X')" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" +">>> parser.add_argument('+f')\n" +">>> parser.add_argument('++bar')\n" +">>> parser.parse_args('+f X ++bar Y'.split())\n" +"Namespace(bar='Y', f='X')" #: ../../library/argparse.rst:414 msgid "" @@ -698,7 +857,6 @@ msgstr "" "た場合、指定された文字のいずれかで始まる引数はファイルとして扱われ、そのファ" "イルに含まれる引数リストに置換されます。例えば::" -#: ../../library/argparse.rst:429 msgid "" ">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" "... fp.write('-f\\nbar')\n" @@ -708,8 +866,14 @@ msgid "" ">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" "Namespace(f='bar')" msgstr "" +">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" +"... fp.write('-f\\nbar')\n" +"...\n" +">>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@')\n" +">>> parser.add_argument('-f')\n" +">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" +"Namespace(f='bar')" -#: ../../library/argparse.rst:437 msgid "" "Arguments read from a file must be one per line by default (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -718,18 +882,26 @@ msgid "" "'@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-" "f', 'bar']``." msgstr "" +"デフォルトでは、ファイルから読み込む引数は 1 行に一つずつ記述します (:meth:" +"`~ArgumentParser.convert_arg_line_to_args` も参照してください)。\n" +"読み込んだ引数は、コマンドラインでそのファイルを指定した引数の位置にあるもの" +"として扱われます。\n" +"上の例では、``['-f', 'foo', '@args.txt']`` は ``['-f', 'foo', '-f', 'bar']`` " +"と同じものとして扱われます。" -#: ../../library/argparse.rst:445 msgid "" "Each line is treated as a single argument, so an empty line is read as an " "empty string (``''``)." msgstr "" +"各行が一つの引数として扱われるので、空行は空文字列 (``''``) として読み込まれ" +"ます。" -#: ../../library/argparse.rst:448 msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." msgstr "" +":class:`ArgumentParser` は、引数を記述したファイルを :term:`filesystem " +"encoding and error handler` を使って読み込みます。" #: ../../library/argparse.rst:451 msgid "" @@ -739,7 +911,6 @@ msgstr "" "``fromfile_prefix_chars=`` 引数のデフォルト値は ``None`` で、引数がファイル参" "照として扱われることがないことを意味しています。" -#: ../../library/argparse.rst:454 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " "from default (e.g. :func:`locale.getpreferredencoding(False) ` と ``\"strict\"`` など) から :term:" +"`filesystem encoding and error handler` に変更しました。\n" +"Windows では、引数ファイルを ANSI コードページではなく UTF-8 でエンコードして" +"ください。" #: ../../library/argparse.rst:462 msgid "argument_default" @@ -771,7 +948,6 @@ msgstr "" "全体で :meth:`~ArgumentParser.parse_args` メソッド呼び出しの属性の生成を抑制" "するには、``argument_default=SUPPRESS`` を指定します::" -#: ../../library/argparse.rst:473 msgid "" ">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" ">>> parser.add_argument('--foo')\n" @@ -781,6 +957,13 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace()" msgstr "" +">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar', nargs='?')\n" +">>> parser.parse_args(['--foo', '1', 'BAR'])\n" +"Namespace(bar='BAR', foo='1')\n" +">>> parser.parse_args([])\n" +"Namespace()" #: ../../library/argparse.rst:484 msgid "allow_abbrev" @@ -801,7 +984,6 @@ msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" "この機能は、``allow_abbrev`` に ``False`` を指定することで無効にできます::" -#: ../../library/argparse.rst:492 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" ">>> parser.add_argument('--foobar', action='store_true')\n" @@ -810,6 +992,12 @@ msgid "" "usage: PROG [-h] [--foobar] [--foonley]\n" "PROG: error: unrecognized arguments: --foon" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" +">>> parser.add_argument('--foobar', action='store_true')\n" +">>> parser.add_argument('--foonley', action='store_false')\n" +">>> parser.parse_args(['--foon'])\n" +"usage: PROG [-h] [--foobar] [--foonley]\n" +"PROG: error: unrecognized arguments: --foon" #: ../../library/argparse.rst:503 msgid "conflict_handler" @@ -827,7 +1015,6 @@ msgstr "" "デフォルトでは、:class:`ArgumentParser` オブジェクトは、すでに利用されている" "オプション文字列を使って新しい引数をつくろうとしたときに例外を送出します::" -#: ../../library/argparse.rst:510 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo', help='old foo help')\n" @@ -836,6 +1023,12 @@ msgid "" " ..\n" "ArgumentError: argument --foo: conflicting option string(s): --foo" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +"Traceback (most recent call last):\n" +" ..\n" +"ArgumentError: argument --foo: conflicting option string(s): --foo" #: ../../library/argparse.rst:517 msgid "" @@ -848,7 +1041,6 @@ msgstr "" "で上書きするほうが便利な場合があります。この動作をするには、:class:" "`ArgumentParser` の ``conflict_handler=`` 引数に ``'resolve'`` を渡します::" -#: ../../library/argparse.rst:522 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', " "conflict_handler='resolve')\n" @@ -862,6 +1054,17 @@ msgid "" " -f FOO old foo help\n" " --foo FOO new foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', " +"conflict_handler='resolve')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-f FOO] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -f FOO old foo help\n" +" --foo FOO new foo help" #: ../../library/argparse.rst:533 msgid "" @@ -879,12 +1082,15 @@ msgstr "" msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:542 msgid "" "By default, :class:`ArgumentParser` objects add an option which simply " "displays the parser's help message. If ``-h`` or ``--help`` is supplied at " "the command line, the :class:`!ArgumentParser` help will be printed." msgstr "" +"デフォルトでは、:class:`ArgumentParser` オブジェクトに、パーサーのヘルプを表" +"示するオプションが追加されます。\n" +"コマンドラインで ``-h`` または ``--help`` を指定すると、:class:`!" +"ArgumentParser` のヘルプが表示されます。" #: ../../library/argparse.rst:546 msgid "" @@ -895,7 +1101,6 @@ msgstr "" "必要に応じて、この help オプションを無効にする場合があります。これは :class:" "`ArgumentParser` の ``add_help=`` 引数に ``False`` を渡すことで可能です::" -#: ../../library/argparse.rst:550 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> parser.add_argument('--foo', help='foo help')\n" @@ -905,6 +1110,13 @@ msgid "" "options:\n" " --foo FOO foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> parser.add_argument('--foo', help='foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO]\n" +"\n" +"options:\n" +" --foo FOO foo help" #: ../../library/argparse.rst:558 msgid "" @@ -918,7 +1130,6 @@ msgstr "" "オプションではありません。この場合、``prefix_chars`` の最初の文字がヘルプオプ" "ションの接頭辞として利用されます::" -#: ../../library/argparse.rst:564 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" ">>> parser.print_help()\n" @@ -927,17 +1138,25 @@ msgid "" "options:\n" " +h, ++help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" +">>> parser.print_help()\n" +"usage: PROG [+h]\n" +"\n" +"options:\n" +" +h, ++help show this help message and exit" #: ../../library/argparse.rst:573 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:575 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " "print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" +"通常、:class:`ArgumentParser` の :meth:`~ArgumentParser.parse_args` メソッド" +"に不正な引数リストを渡すと、:data:`sys.stderr` に *メッセージ* を表示し、終了" +"ステータス 2 で終了します。" #: ../../library/argparse.rst:579 msgid "" @@ -947,7 +1166,6 @@ msgstr "" "もしエラーを例外としてプログラム内でキャッチしたい場合は、``exit_on_error`` " "を ``False`` に設定してください::" -#: ../../library/argparse.rst:582 msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" @@ -961,12 +1179,21 @@ msgid "" "...\n" "Catching an argumentError" msgstr "" +">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" +">>> parser.add_argument('--integers', type=int)\n" +"_StoreAction(option_strings=['--integers'], dest='integers', nargs=None, " +"const=None, default=None, type=, choices=None, help=None, " +"metavar=None)\n" +">>> try:\n" +"... parser.parse_args('--integers a'.split())\n" +"... except argparse.ArgumentError:\n" +"... print('Catching an argumentError')\n" +"...\n" +"Catching an argumentError" -#: ../../library/argparse.rst:595 msgid "suggest_on_error" -msgstr "" +msgstr "suggest_on_error" -#: ../../library/argparse.rst:597 msgid "" "By default, when a user passes an invalid argument choice or subparser " "name, :class:`ArgumentParser` will exit with error info and provide " @@ -975,8 +1202,14 @@ msgid "" "\"maybe you meant\" suggestion if a close match is found. Note that this " "only applies for arguments when the choices specified are strings::" msgstr "" +"デフォルトでは、ユーザーが引数の選択肢やサブパーサー名として不正な値を渡す" +"と、:class:`ArgumentParser` はエラー情報と入力ミスに対する候補を表示して終了" +"します。\n" +"エラーメッセージには、引数で指定できる選択肢 (定義されている場合) またはサブ" +"パーサー名を列挙し、似たものが見つかれば \"maybe you meant\" とともに候補を表" +"示します。\n" +"引数の場合、この機能が適用されるのは選択肢が文字列のときだけです。 ::" -#: ../../library/argparse.rst:604 msgid "" ">>> parser = argparse.ArgumentParser(suggest_on_error=True)\n" ">>> parser.add_argument('--action', choices=['debug', 'dryrun'])\n" @@ -985,22 +1218,28 @@ msgid "" "tester.py: error: argument --action: invalid choice: 'debugg', maybe you " "meant 'debug'? (choose from debug, dryrun)" msgstr "" +">>> parser = argparse.ArgumentParser(suggest_on_error=True)\n" +">>> parser.add_argument('--action', choices=['debug', 'dryrun'])\n" +">>> parser.parse_args(['--action', 'debugg'])\n" +"usage: tester.py [-h] [--action {debug,dryrun}]\n" +"tester.py: error: argument --action: invalid choice: 'debugg', maybe you " +"meant 'debug'? (choose from debug, dryrun)" -#: ../../library/argparse.rst:610 msgid "" "You can disable suggestions by setting ``suggest_on_error`` to ``False``." msgstr "" +"``suggest_on_error`` を ``False`` に設定すると、候補の提示を無効にできます。" -#: ../../library/argparse.rst:613 msgid "" "Changed default value of ``suggest_on_error`` from ``False`` to ``True``." msgstr "" +"``suggest_on_error`` のデフォルト値が ``False`` から ``True`` に変わりまし" +"た。" #: ../../library/argparse.rst:617 msgid "color" msgstr "color" -#: ../../library/argparse.rst:619 msgid "" "By default, the help message is printed in color using `ANSI escape " "sequences `__. If you want " @@ -1008,8 +1247,12 @@ msgid "" "environment `, or in the argument parser itself " "by setting ``color`` to ``False``::" msgstr "" +"デフォルトでは、ヘルプは `ANSI エスケープシーケンス `__ を使って色付きで表示されます。\n" +"プレーンテキストで表示したい場合は、:ref:`ローカル環境の設定 ` で色を無効にするか、引数パーサーの ``color`` を " +"``False`` に設定してください。 ::" -#: ../../library/argparse.rst:625 msgid "" ">>> parser = argparse.ArgumentParser(description='Process some integers.',\n" "... color=False)\n" @@ -1018,22 +1261,32 @@ msgid "" "... help='an integer for the accumulator')\n" ">>> parser.parse_args(['--help'])" msgstr "" +">>> parser = argparse.ArgumentParser(description='Process some integers.',\n" +"... color=False)\n" +">>> parser.add_argument('--action', choices=['sum', 'max'])\n" +">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +"... help='an integer for the accumulator')\n" +">>> parser.parse_args(['--help'])" -#: ../../library/argparse.rst:632 msgid "" "Note that when ``color=True``, colored output depends on both environment " "variables and terminal capabilities. However, if ``color=False``, colored " "output is always disabled, even if environment variables like " "``FORCE_COLOR`` are set." msgstr "" +"``color=True`` の場合、色付きで表示されるかどうかは環境変数と端末の機能によっ" +"て決まります。\n" +"一方、``color=False`` の場合は、``FORCE_COLOR`` のような環境変数が設定されて" +"いても、色付きの出力は常に無効になります。" -#: ../../library/argparse.rst:639 msgid "" "To highlight inline code in your description, epilog, or argument ``help`` " "text, you can use single or double backticks::" msgstr "" +"``description``、``epilog``、引数の ``help`` テキストでインラインのコードを強" +"調表示するには、シングルバッククォートまたはダブルバッククォートで囲みま" +"す。 ::" -#: ../../library/argparse.rst:642 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... formatter_class=argparse.RawDescriptionHelpFormatter,\n" @@ -1044,13 +1297,24 @@ msgid "" "... ''')\n" ">>> parser.add_argument('--foo', help='set the `foo` value')" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... formatter_class=argparse.RawDescriptionHelpFormatter,\n" +"... description='Run ``python -m myapp`` to start.',\n" +"... epilog='''Examples:\n" +"... `python -m myapp --verbose`\n" +"... ``python -m myapp --config settings.json``\n" +"... ''')\n" +">>> parser.add_argument('--foo', help='set the `foo` value')" -#: ../../library/argparse.rst:651 msgid "" "When colors are enabled, the text inside backticks will be displayed in a " "distinct color to help examples stand out. When colors are disabled, " "backticks are preserved as-is, which is readable in plain text." msgstr "" +"色が有効な場合、バッククォートで囲んだテキストは別の色で表示され、例が目立つ" +"ようになります。\n" +"色が無効な場合はバッククォートがそのまま残り、プレーンテキストでも読める形に" +"なります。" #: ../../library/argparse.rst:659 msgid "The add_argument() method" @@ -1064,11 +1328,12 @@ msgstr "" "1つのコマンドライン引数がどう解析されるかを定義します。各引数についての詳細は" "後述しますが、簡単に言うと:" -#: ../../library/argparse.rst:668 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " "or ``'-f', '--foo'``." msgstr "" +"`name or flags`_ - 名前、またはオプション文字列のリスト (例: ``'foo'``、``'-" +"f', '--foo'``)。" #: ../../library/argparse.rst:671 msgid "" @@ -1122,13 +1387,11 @@ msgid "" "meth:`parse_args`." msgstr "dest_ - :meth:`parse_args` が返すオブジェクトに追加される属性名。" -#: ../../library/argparse.rst:695 msgid "deprecated_ - Whether or not use of the argument is deprecated." -msgstr "" +msgstr "deprecated_ - この引数の使用が非推奨かどうか。" -#: ../../library/argparse.rst:697 msgid "The method returns an :class:`Action` object representing the argument." -msgstr "" +msgstr "このメソッドは、引数を表す :class:`Action` オブジェクトを返します。" #: ../../library/argparse.rst:705 msgid "name or flags" @@ -1152,17 +1415,15 @@ msgstr "" msgid "For example, an optional argument could be created like::" msgstr "たとえば、オプション引数は次のように作成します::" -#: ../../library/argparse.rst:715 msgid ">>> parser.add_argument('-f', '--foo')" -msgstr "" +msgstr ">>> parser.add_argument('-f', '--foo')" #: ../../library/argparse.rst:717 msgid "while a positional argument could be created like::" msgstr "一方、位置引数は次のように作成します::" -#: ../../library/argparse.rst:719 msgid ">>> parser.add_argument('bar')" -msgstr "" +msgstr ">>> parser.add_argument('bar')" #: ../../library/argparse.rst:721 msgid "" @@ -1173,7 +1434,6 @@ msgstr "" ":meth:`~ArgumentParser.parse_args` が呼ばれたとき、オプション引数は接頭辞 ``-" "`` により識別され、それ以外の引数は位置引数として扱われます::" -#: ../../library/argparse.rst:725 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -1186,8 +1446,17 @@ msgid "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['BAR'])\n" +"Namespace(bar='BAR', foo=None)\n" +">>> parser.parse_args(['BAR', '--foo', 'FOO'])\n" +"Namespace(bar='BAR', foo='FOO')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"usage: PROG [-h] [-f FOO] bar\n" +"PROG: error: the following arguments are required: bar" -#: ../../library/argparse.rst:736 msgid "" "By default, :mod:`!argparse` automatically handles the internal naming and " "display names of arguments, simplifying the process without requiring " @@ -1196,6 +1465,13 @@ msgid "" "the argument name, with underscores ``_`` replacing hyphens ``-``. The " "metavar_ parameter defaults to the upper-cased name. For example::" msgstr "" +"デフォルトでは、:mod:`!argparse` が引数の内部的な名前と表示名を自動的に決める" +"ため、追加の設定は必要ありません。\n" +"そのため、dest_ と metavar_ パラメーターを指定する必要はありません。\n" +"オプション引数の場合、dest_ のデフォルトは、引数名のハイフン ``-`` をアンダー" +"スコア ``_`` に置き換えたものです。\n" +"metavar_ のデフォルトは、この名前を大文字にしたものです。\n" +"例えば次のようになります。 ::" #: ../../library/argparse.rst:744 msgid "" @@ -1231,11 +1507,12 @@ msgstr "" "引数は、コマンドライン引数がどう処理されるかを指定します。提供されているアク" "ションは:" -#: ../../library/argparse.rst:767 msgid "" "``'store'`` - This just stores the argument's value. This is the default " "action." msgstr "" +"``'store'`` - 引数の値を格納します。\n" +"これがデフォルトのアクションです。" #: ../../library/argparse.rst:770 msgid "" @@ -1249,22 +1526,26 @@ msgstr "" "ください。``'store_const'`` アクションは、何かの種類のフラグを指定するオプ" "ション引数によく使われます。例えば::" -#: ../../library/argparse.rst:775 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_const', const=42)\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(foo=42)" -#: ../../library/argparse.rst:780 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` that respectively store the values ``True`` and ``False`` " "with default values of ``False`` and ``True``::" msgstr "" +"``'store_true'`` と ``'store_false'`` - ``'store_const'`` の特殊な形で、それ" +"ぞれ ``True`` と ``False`` を格納し、デフォルト値はそれぞれ ``False`` と " +"``True`` になります。 ::" -#: ../../library/argparse.rst:785 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -1273,8 +1554,13 @@ msgid "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('--bar', action='store_false')\n" +">>> parser.add_argument('--baz', action='store_false')\n" +">>> parser.parse_args('--foo --bar'.split())\n" +"Namespace(foo=True, bar=False, baz=True)" -#: ../../library/argparse.rst:792 msgid "" "``'append'`` - This appends each argument value to a list. It is useful for " "allowing an option to be specified multiple times. If the default value is a " @@ -1282,24 +1568,36 @@ msgid "" "and any values from the command line will be appended after those default " "values. Example usage::" msgstr "" +"``'append'`` - 引数の値をリストに追加します。\n" +"同じオプションを複数回指定できるようにする場合に便利です。\n" +"デフォルト値が空でないリストの場合、解析結果のリストはそのデフォルト値の要素" +"から始まり、コマンドラインから取得した値はその後ろに追加されます。\n" +"使用例です。 ::" -#: ../../library/argparse.rst:798 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append', default=['0'])\n" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['0', '1', '2'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='append', default=['0'])\n" +">>> parser.parse_args('--foo 1 --foo 2'.split())\n" +"Namespace(foo=['0', '1', '2'])" -#: ../../library/argparse.rst:803 msgid "" "``'append_const'`` - This appends the value specified by the const_ keyword " "argument to a list; note that the const_ keyword argument defaults to " "``None``. The ``'append_const'`` action is typically useful when multiple " "arguments need to store constants to the same list. For example::" msgstr "" +"``'append_const'`` - const_ キーワード引数で指定した値をリストに追加しま" +"す。\n" +"const_ キーワード引数のデフォルト値は ``None`` です。\n" +"``'append_const'`` アクションは、複数の引数で同じリストに定数を格納したい場合" +"に便利です。\n" +"例えば次のようになります。 ::" -#: ../../library/argparse.rst:809 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1309,8 +1607,14 @@ msgid "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[, ])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--str', dest='types', action='append_const', " +"const=str)\n" +">>> parser.add_argument('--int', dest='types', action='append_const', " +"const=int)\n" +">>> parser.parse_args('--str --int'.split())\n" +"Namespace(types=[, ])" -#: ../../library/argparse.rst:815 msgid "" "``'extend'`` - This appends each item from a multi-value argument to a list. " "The ``'extend'`` action is typically used with the nargs_ keyword argument " @@ -1318,8 +1622,13 @@ msgid "" "``'?'``, each character of the argument string will be appended to the list. " "Example usage::" msgstr "" +"``'extend'`` - 複数の値を持つ引数の各要素をリストに追加します。\n" +"``'extend'`` アクションは通常、nargs_ キーワード引数に ``'+'`` または " +"``'*'`` を指定して使います。\n" +"nargs_ が ``None`` (デフォルト) または ``'?'`` の場合は、引数文字列の各文字が" +"リストに追加されることに注意してください。\n" +"使用例です。 ::" -#: ../../library/argparse.rst:823 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1328,38 +1637,49 @@ msgid "" "\"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " +"type=str)\n" +">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " +"\"f4\"])\n" +"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -#: ../../library/argparse.rst:830 msgid "" "``'count'`` - This counts the number of times an argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" +"``'count'`` - 引数が指定された回数を数えます。\n" +"例えば、出力の詳細度を上げるために使えます。 ::" -#: ../../library/argparse.rst:833 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" ">>> parser.parse_args(['-vvv'])\n" "Namespace(verbose=3)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" +">>> parser.parse_args(['-vvv'])\n" +"Namespace(verbose=3)" -#: ../../library/argparse.rst:838 msgid "" "Unless explicitly set, the *default* will be ``None``. If the default value " "is a non-zero number, the count starts from that number rather than from " "zero." msgstr "" +"明示的に設定しなければ、*default* は ``None`` です。\n" +"デフォルト値がゼロ以外の数値の場合、ゼロではなくその値から数え始めます。" -#: ../../library/argparse.rst:842 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " "added to the parser. See :class:`ArgumentParser` for details of how the " "output is created." msgstr "" -"``'help'`` - このアクションは現在のパーサー中のすべてのオプションのヘルプメッ" -"セージを表示し、終了します。出力の生成方法の詳細については :class:" -"`ArgumentParser` を参照してください。" +"``'help'`` - 現在のパーサーのすべてのオプションについてヘルプを表示し、終了し" +"ます。\n" +"デフォルトでは、このヘルプアクションはパーサーに自動的に追加されます。\n" +"出力の生成方法の詳細は :class:`ArgumentParser` を参照してください。" #: ../../library/argparse.rst:847 msgid "" @@ -1371,7 +1691,6 @@ msgstr "" "出しに ``version=`` キーワード引数を期待します。指定されたときはバージョン情" "報を表示して終了します::" -#: ../../library/argparse.rst:851 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1380,8 +1699,13 @@ msgid "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--version', action='version', version='%(prog)s " +"2.0')\n" +">>> parser.parse_args(['--version'])\n" +"PROG 2.0" -#: ../../library/argparse.rst:857 msgid "" "You may also specify an arbitrary action by passing an :class:`Action` " "subclass (e.g. :class:`BooleanOptionalAction`) or other object that " @@ -1389,8 +1713,13 @@ msgid "" "arguments (e.g. ``'store'``, ``'append'``, ``'extend'``, or custom actions " "with non-zero ``nargs``) can be used with positional arguments." msgstr "" +":class:`Action` のサブクラス (:class:`BooleanOptionalAction` など) や、同じイ" +"ンターフェースを実装する別のオブジェクトを渡して、任意のアクションを指定する" +"こともできます。\n" +"位置引数に使えるのは、コマンドライン引数を消費するアクション (``'store'``、" +"``'append'``、``'extend'``、``nargs`` がゼロ以外のカスタムアクションなど) だ" +"けです。" -#: ../../library/argparse.rst:863 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " @@ -1398,12 +1727,16 @@ msgid "" "using the :meth:`~ArgumentParser.register` method and reference them by " "their registered name." msgstr "" +"カスタムアクションを作るには、:class:`Action` を継承して :meth:`!__call__` メ" +"ソッドをオーバーライドし、必要に応じて :meth:`!__init__` と :meth:`!" +"format_usage` メソッドもオーバーライドする方法を推奨します。\n" +":meth:`~ArgumentParser.register` メソッドでカスタムアクションを登録し、その登" +"録名で参照することもできます。" #: ../../library/argparse.rst:868 msgid "An example of a custom action::" msgstr "カスタムアクションの例です::" -#: ../../library/argparse.rst:870 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1423,6 +1756,23 @@ msgid "" ">>> args\n" "Namespace(bar='1', foo='2')" msgstr "" +">>> class FooAction(argparse.Action):\n" +"... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" +"... if nargs is not None:\n" +"... raise ValueError(\"nargs not allowed\")\n" +"... super().__init__(option_strings, dest, **kwargs)\n" +"... def __call__(self, parser, namespace, values, option_string=None):\n" +"... print('%r %r %r' % (namespace, values, option_string))\n" +"... setattr(namespace, self.dest, values)\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=FooAction)\n" +">>> parser.add_argument('bar', action=FooAction)\n" +">>> args = parser.parse_args('1 --foo 2'.split())\n" +"Namespace(bar=None, foo=None) '1' None\n" +"Namespace(bar='1', foo=None) '2' '--foo'\n" +">>> args\n" +"Namespace(bar='1', foo='2')" #: ../../library/argparse.rst:888 msgid "For more details, see :class:`Action`." @@ -1432,7 +1782,6 @@ msgstr "詳細は :class:`Action` を参照してください。" msgid "nargs" msgstr "nargs" -#: ../../library/argparse.rst:896 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1440,6 +1789,12 @@ msgid "" "action. See also :ref:`specifying-ambiguous-arguments`. The supported values " "are:" msgstr "" +":class:`ArgumentParser` オブジェクトは通常、一つのコマンドライン引数に対して" +"一つのアクションを実行します。\n" +"``nargs`` キーワード引数を使うと、一つのアクションに別の個数のコマンドライン" +"引数を対応させられます。\n" +":ref:`specifying-ambiguous-arguments` も参照してください。\n" +"指定できる値は次のとおりです。" #: ../../library/argparse.rst:901 msgid "" @@ -1449,7 +1804,6 @@ msgstr "" "``N`` (整数) -- ``N`` 個の引数がコマンドラインから集められ、リストに格納され" "ます。例えば::" -#: ../../library/argparse.rst:904 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1457,6 +1811,11 @@ msgid "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs=2)\n" +">>> parser.add_argument('bar', nargs=1)\n" +">>> parser.parse_args('c --foo a b'.split())\n" +"Namespace(bar=['c'], foo=['a', 'b'])" #: ../../library/argparse.rst:910 msgid "" @@ -1481,7 +1840,6 @@ msgstr "" "いというケースもありえます。この場合は const_ の値が生成されます。この動作の" "例です::" -#: ../../library/argparse.rst:922 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1493,6 +1851,15 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" +">>> parser.add_argument('bar', nargs='?', default='d')\n" +">>> parser.parse_args(['XX', '--foo', 'YY'])\n" +"Namespace(bar='XX', foo='YY')\n" +">>> parser.parse_args(['XX', '--foo'])\n" +"Namespace(bar='XX', foo='c')\n" +">>> parser.parse_args([])\n" +"Namespace(bar='d', foo='d')" #: ../../library/argparse.rst:932 msgid "" @@ -1501,7 +1868,6 @@ msgid "" msgstr "" "``nargs='?'`` のよくある利用例の1つは、入出力ファイルの指定オプションです::" -#: ../../library/argparse.rst:935 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?')\n" @@ -1513,6 +1879,15 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(infile=None, outfile=None)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', nargs='?')\n" +">>> parser.add_argument('outfile', nargs='?')\n" +">>> parser.parse_args(['input.txt', 'output.txt'])\n" +"Namespace(infile='input.txt', outfile='output.txt')\n" +">>> parser.parse_args(['input.txt'])\n" +"Namespace(infile='input.txt', outfile=None)\n" +">>> parser.parse_args([])\n" +"Namespace(infile=None, outfile=None)" #: ../../library/argparse.rst:947 msgid "" @@ -1525,7 +1900,6 @@ msgstr "" "が ``nargs='*'`` を持つことにあまり意味はありませんが、複数のオプション引数" "が ``nargs='*'`` を持つことはありえます。例えば::" -#: ../../library/argparse.rst:952 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1534,15 +1908,23 @@ msgid "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='*')\n" +">>> parser.add_argument('--bar', nargs='*')\n" +">>> parser.add_argument('baz', nargs='*')\n" +">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" +"Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:961 msgid "" "``'+'``. Just like ``'*'``, all command-line arguments present are gathered " "into a list. Additionally, an error message will be generated if there " "wasn't at least one command-line argument present. For example::" msgstr "" +"``'+'`` - ``'*'`` と同様に、コマンドラインで指定された引数をすべてリストに集" +"めます。\n" +"ただし、コマンドライン引数が一つもなければエラーメッセージを表示します。\n" +"例えば次のようになります。 ::" -#: ../../library/argparse.rst:965 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1552,8 +1934,14 @@ msgid "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('foo', nargs='+')\n" +">>> parser.parse_args(['a', 'b'])\n" +"Namespace(foo=['a', 'b'])\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] foo [foo ...]\n" +"PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:973 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1561,6 +1949,12 @@ msgid "" "be produced. Actions that do not consume command-line arguments (e.g. " "``'store_const'``) set ``nargs=0``." msgstr "" +"``nargs`` キーワード引数を指定しなかった場合、消費する引数の数は action_ に" +"よって決まります。\n" +"通常は、一つのコマンドライン引数を消費して、リストではなく単一の値を生成しま" +"す。\n" +"コマンドライン引数を消費しないアクション (``'store_const'`` など) では、" +"``nargs=0`` が設定されます。" #: ../../library/argparse.rst:983 msgid "const" @@ -1593,7 +1987,6 @@ msgstr "" "`~ArgumentParser.add_argument` に与えられなければ、``None`` のデフォルト値を" "受け取ります。" -#: ../../library/argparse.rst:997 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1602,6 +1995,13 @@ msgid "" "command-line argument following it, the value from ``const`` will be used. " "See the nargs_ description for examples." msgstr "" +":meth:`~ArgumentParser.add_argument` にオプション文字列 (``-f`` や ``--foo`` " +"など) と ``nargs='?'`` を指定した場合。\n" +"この場合、その後にコマンドライン引数を 0 個または 1 個指定できるオプション引" +"数が作られます。\n" +"コマンドラインの解析時に、オプション文字列の後に引数がなければ ``const`` の値" +"が使われます。\n" +"例は nargs_ の説明を参照してください。" #: ../../library/argparse.rst:1004 msgid "" @@ -1630,7 +2030,6 @@ msgstr "" "る値を指定します。オプション引数では、オプション文字列がコマンドライン上に存" "在しなかったときに ``default`` の値が利用されます::" -#: ../../library/argparse.rst:1020 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1639,20 +2038,30 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args(['--foo', '2'])\n" +"Namespace(foo='2')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" -#: ../../library/argparse.rst:1027 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" +"対象の名前空間にすでに属性が設定されている場合、アクションの *default* はその" +"値を上書きしません。 ::" -#: ../../library/argparse.rst:1030 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" +"Namespace(foo=101)" #: ../../library/argparse.rst:1035 msgid "" @@ -1666,7 +2075,6 @@ msgstr "" "に、type_ 変換引数が与えられていればそれらを適用します。そうでない場合、パー" "サーは値をそのまま使用します::" -#: ../../library/argparse.rst:1040 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1674,6 +2082,11 @@ msgid "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--length', default='10', type=int)\n" +">>> parser.add_argument('--width', default=10.5, type=int)\n" +">>> parser.parse_args()\n" +"Namespace(length=10, width=10.5)" #: ../../library/argparse.rst:1046 msgid "" @@ -1683,7 +2096,6 @@ msgstr "" "nargs_ が ``?`` か ``*`` である位置引数では、コマンドライン引数が指定されな" "かった場合 ``default`` の値が使われます。例えば::" -#: ../../library/argparse.rst:1049 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1692,20 +2104,31 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', nargs='?', default=42)\n" +">>> parser.parse_args(['a'])\n" +"Namespace(foo='a')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" -#: ../../library/argparse.rst:1056 msgid "" "Because ``nargs='*'`` gathers any supplied values into a list, an absent " "positional argument yields an empty list (``[]``). Only a non-``None`` " "*default* overrides this (so ``default=None`` still gives ``[]``)." msgstr "" +"``nargs='*'`` は指定された値をリストに集めるため、位置引数が指定されなければ" +"空リスト (``[]``) になります。\n" +"この動作を変更できるのは *default* が ``None`` 以外の場合だけです " +"(``default=None`` でも ``[]`` になります)。" -#: ../../library/argparse.rst:1060 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" +"required_ の引数では ``default`` の値は無視されます。\n" +"例えば、nargs_ が ``?`` や ``*`` 以外の位置引数や、``required=True`` を指定し" +"たオプション引数が該当します。" #: ../../library/argparse.rst:1064 msgid "" @@ -1715,7 +2138,6 @@ msgstr "" "``default=argparse.SUPPRESS`` を渡すと、コマンドライン引数が存在しないときに" "属性の追加をしなくなります::" -#: ../../library/argparse.rst:1067 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1724,6 +2146,12 @@ msgid "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" +">>> parser.parse_args([])\n" +"Namespace()\n" +">>> parser.parse_args(['--foo', '1'])\n" +"Namespace(foo='1')" #: ../../library/argparse.rst:1078 msgid "type" @@ -1752,7 +2180,6 @@ msgstr "" "``default`` の値が文字列のときのみ、type converter による変換などが行われま" "す。" -#: ../../library/argparse.rst:1089 msgid "" "The argument to ``type`` can be a callable that accepts a single string or " "the name of a registered type (see :meth:`~ArgumentParser.register`) If the " @@ -1760,13 +2187,17 @@ msgid "" "`ValueError`, the exception is caught and a nicely formatted error message " "is displayed. Other exception types are not handled." msgstr "" +"``type`` には、一つの文字列を受け取る呼び出し可能オブジェクト、または登録済み" +"の型の名前 (:meth:`~ArgumentParser.register` を参照) を渡せます。\n" +"この関数が :exc:`ArgumentTypeError`、:exc:`TypeError`、:exc:`ValueError` を送" +"出すると、その例外を捕捉して読みやすい形式のエラーメッセージを表示します。\n" +"それ以外の例外は処理しません。" #: ../../library/argparse.rst:1095 msgid "Common built-in types and functions can be used as type converters:" msgstr "" "一般的なビルトインデータ型や関数を ``type`` 引数の値として直接指定できます::" -#: ../../library/argparse.rst:1097 msgid "" "import argparse\n" "import pathlib\n" @@ -1778,12 +2209,20 @@ msgid "" "parser.add_argument('code_point', type=ord)\n" "parser.add_argument('datapath', type=pathlib.Path)" msgstr "" +"import argparse\n" +"import pathlib\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('count', type=int)\n" +"parser.add_argument('distance', type=float)\n" +"parser.add_argument('street', type=ascii)\n" +"parser.add_argument('code_point', type=ord)\n" +"parser.add_argument('datapath', type=pathlib.Path)" #: ../../library/argparse.rst:1109 msgid "User defined functions can be used as well:" msgstr "ユーザが定義した関数も使用できます::" -#: ../../library/argparse.rst:1111 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1793,27 +2232,40 @@ msgid "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" msgstr "" +">>> def hyphenated(string):\n" +"... return '-'.join([word[:4] for word in string.casefold().split()])\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> _ = parser.add_argument('short_title', type=hyphenated)\n" +">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" +"Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1121 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired::" msgstr "" +":func:`bool` 関数を型変換に使うことは推奨しません。\n" +"空文字列を ``False`` に、空でない文字列を ``True`` に変換するだけなので、通常" +"は意図した結果になりません。 ::" -#: ../../library/argparse.rst:1125 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> _ = parser.add_argument('--verbose', type=bool)\n" ">>> parser.parse_args(['--verbose', 'False'])\n" "Namespace(verbose=True)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> _ = parser.add_argument('--verbose', type=bool)\n" +">>> parser.parse_args(['--verbose', 'False'])\n" +"Namespace(verbose=True)" -#: ../../library/argparse.rst:1130 msgid "" "See :class:`BooleanOptionalAction` or ``action='store_true'`` for common " "alternatives." msgstr "" +"よく使われる代替手段については、:class:`BooleanOptionalAction` または " +"``action='store_true'`` を参照してください。" #: ../../library/argparse.rst:1133 msgid "" @@ -1839,7 +2291,6 @@ msgstr "" "発生しうる) :exc:`~json.JSONDecodeError` は適切に整形されて表示されません。ま" "た、:exc:`FileNotFoundError` が発生しても parser は何も処理しません。" -#: ../../library/argparse.rst:1143 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1848,6 +2299,12 @@ msgid "" "the parser has run and then use the :keyword:`with`-statement to manage the " "files." msgstr "" +":class:`~argparse.FileType` でさえ、``type`` キーワードでの使用には制限があり" +"ます。\n" +"ある引数で :class:`~argparse.FileType` を使い、その後の引数でエラーが起きる" +"と、エラーは報告されますが、ファイルは自動的には閉じられません。\n" +"この場合は、引数の解析が終わってから :keyword:`with` 文でファイルを管理する方" +"が適切です。" #: ../../library/argparse.rst:1150 msgid "" @@ -1875,7 +2332,6 @@ msgstr "" "き、引数の値がチェックされ、その値が選択肢の中に含まれていない場合はエラー" "メッセージを表示します::" -#: ../../library/argparse.rst:1165 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1886,6 +2342,14 @@ msgid "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" msgstr "" +">>> parser = argparse.ArgumentParser(prog='game.py')\n" +">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" +">>> parser.parse_args(['rock'])\n" +"Namespace(move='rock')\n" +">>> parser.parse_args(['fire'])\n" +"usage: game.py [-h] {rock,paper,scissors}\n" +"game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" +"'paper', 'scissors')" #: ../../library/argparse.rst:1174 msgid "" @@ -1904,19 +2368,24 @@ msgstr "" "ただし、:class:`enum.Enum` を渡すことは推奨されません。使用方法、ヘルプ、エ" "ラーメッセージなどでどのように表示されるかを制御することが難いからです。" -#: ../../library/argparse.rst:1180 msgid "" "Note that *choices* are checked after any type_ conversions have been " "performed, so objects in *choices* should match the type_ specified. This " "can make *choices* appear unfamiliar in usage, help, or error messages." msgstr "" +"*choices* の検査は type_ による変換の後に行われるので、*choices* のオブジェク" +"トは指定した type_ に合うものにしてください。\n" +"そのため、使用法、ヘルプ、エラーメッセージに表示される *choices* が、ユーザー" +"にとってなじみのない表記になることがあります。" -#: ../../library/argparse.rst:1185 msgid "" "To keep *choices* user-friendly, consider a custom type wrapper that " "converts and formats values, or omit type_ and handle conversion in your " "application code." msgstr "" +"*choices* をユーザーにわかりやすく表示するには、値の変換と書式化を行う独自の" +"型ラッパーを使うか、type_ を指定せず、アプリケーションのコードで変換すること" +"を検討してください。" #: ../../library/argparse.rst:1189 msgid "" @@ -1935,15 +2404,17 @@ msgstr "" msgid "required" msgstr "required" -#: ../../library/argparse.rst:1200 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " "command line. To make an option *required*, ``True`` can be specified for " "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" +":mod:`!argparse` モジュールは通常、``-f`` や ``--bar`` のようなフラグを、コマ" +"ンドラインで常に省略できる *オプション* 引数として扱います。\n" +"オプションを *必須* にするには、:meth:`~ArgumentParser.add_argument` の " +"``required=`` キーワード引数に ``True`` を指定します。 ::" -#: ../../library/argparse.rst:1205 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1953,6 +2424,13 @@ msgid "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', required=True)\n" +">>> parser.parse_args(['--foo', 'BAR'])\n" +"Namespace(foo='BAR')\n" +">>> parser.parse_args([])\n" +"usage: [-h] --foo FOO\n" +": error: the following arguments are required: --foo" #: ../../library/argparse.rst:1213 msgid "" @@ -1976,13 +2454,15 @@ msgstr "" msgid "help" msgstr "help" -#: ../../library/argparse.rst:1228 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " "at the command line), these ``help`` descriptions will be displayed with " "each argument." msgstr "" +"``help`` の値には、引数の簡潔な説明を文字列で指定します。\n" +"ユーザーがヘルプを要求すると (通常はコマンドラインで ``-h`` または ``--" +"help`` を指定します)、各引数とともにこの ``help`` の説明が表示されます。" #: ../../library/argparse.rst:1233 msgid "" @@ -1997,7 +2477,6 @@ msgstr "" "プログラム名 ``%(prog)s`` と、 ``%(default)s`` や ``%(type)s`` など :meth:" "`~ArgumentParser.add_argument` のキーワード引数の多くが含まれます::" -#: ../../library/argparse.rst:1238 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -2011,6 +2490,17 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" +"... help='the bar to %(prog)s (default: %(default)s)')\n" +">>> parser.print_help()\n" +"usage: frobble [-h] [bar]\n" +"\n" +"positional arguments:\n" +" bar the bar to frobble (default: 42)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" #: ../../library/argparse.rst:1250 msgid "" @@ -2020,13 +2510,13 @@ msgstr "" "ヘルプ文字列は %-フォーマットをサポートしているので、ヘルプ文字列内にリテラ" "ル ``%`` を表示したい場合は ``%%`` のようにエスケープしなければなりません。" -#: ../../library/argparse.rst:1253 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" +":mod:`!argparse` では、``help`` の値を ``argparse.SUPPRESS`` に設定すると、そ" +"のオプションをヘルプに表示しないようにできます。 ::" -#: ../../library/argparse.rst:1256 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -2036,12 +2526,18 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" +">>> parser.print_help()\n" +"usage: frobble [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" #: ../../library/argparse.rst:1268 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1270 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -2052,8 +2548,17 @@ msgid "" "single optional argument ``--foo`` that should be followed by a single " "command-line argument will be referred to as ``FOO``. An example::" msgstr "" +":class:`ArgumentParser` がヘルプを生成する際には、受け付ける各引数を表す名前" +"が必要です。\n" +"デフォルトでは、:class:`!ArgumentParser` オブジェクトは dest_ の値を各引数の" +"「名前」として使います。\n" +"位置引数のアクションでは dest_ の値をそのまま使い、オプション引数のアクション" +"では dest_ の値を大文字にして使います。\n" +"そのため、``dest='bar'`` の位置引数は ``bar`` と表示されます。\n" +"コマンドライン引数を一つ受け取るオプション ``--foo`` では、その値が ``FOO`` " +"と表示されます。\n" +"例えば次のようになります。 ::" -#: ../../library/argparse.rst:1279 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2070,12 +2575,25 @@ msgid "" " -h, --help show this help message and exit\n" " --foo FOO" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo FOO] bar\n" +"\n" +"positional arguments:\n" +" bar\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO" #: ../../library/argparse.rst:1294 msgid "An alternative name can be specified with ``metavar``::" msgstr "代わりの名前を、``metavar`` として指定できます::" -#: ../../library/argparse.rst:1296 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2092,6 +2610,20 @@ msgid "" " -h, --help show this help message and exit\n" " --foo YYY" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', metavar='YYY')\n" +">>> parser.add_argument('bar', metavar='XXX')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo YYY] XXX\n" +"\n" +"positional arguments:\n" +" XXX\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo YYY" #: ../../library/argparse.rst:1311 msgid "" @@ -2112,7 +2644,6 @@ msgstr "" "``nargs`` を指定した場合、metavar が複数回利用されるかもしれません。" "``metavar`` にタプルを渡すと、各引数に対して異なる名前を指定できます::" -#: ../../library/argparse.rst:1319 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2125,6 +2656,16 @@ msgid "" " -x X X\n" " --foo bar baz" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', nargs=2)\n" +">>> parser.add_argument('--foo', nargs=2, metavar=('bar', 'baz'))\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-x X X] [--foo bar baz]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -x X X\n" +" --foo bar baz" #: ../../library/argparse.rst:1334 msgid "dest" @@ -2145,15 +2686,17 @@ msgstr "" "決定されます。位置引数のアクションについては、 ``dest`` は通常 :meth:" "`~ArgumentParser.add_argument` の第一引数として渡します::" -#: ../../library/argparse.rst:1343 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['XXX'])\n" +"Namespace(bar='XXX')" -#: ../../library/argparse.rst:1348 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2166,6 +2709,17 @@ msgid "" "characters will be converted to ``_`` characters to make sure the string is " "a valid attribute name. The examples below illustrate this behavior::" msgstr "" +"オプション引数のアクションでは、通常 ``dest`` の値はオプション文字列から決ま" +"ります。\n" +":class:`ArgumentParser` は、二つのダッシュで始まる最初の長いオプション文字列" +"から、先頭の ``-`` を取り除いて ``dest`` の値にします。\n" +"二つのダッシュで始まる長いオプション文字列がなければ、一つのダッシュで始まる" +"最初の長いオプション文字列から、先頭の ``-`` を取り除きます。\n" +"長いオプション文字列がなければ、最初の短いオプション文字列から先頭の ``-`` を" +"取り除きます。\n" +"属性名として使える文字列にするため、内部の ``-`` はすべて ``_`` に変換しま" +"す。\n" +"以下の例でこの動作を示します。 ::" #: ../../library/argparse.rst:1361 msgid "" @@ -2183,15 +2737,17 @@ msgstr "" msgid "``dest`` allows a custom attribute name to be provided::" msgstr "``dest`` にカスタムの属性名を与えることも可能です::" -#: ../../library/argparse.rst:1372 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', dest='bar')\n" +">>> parser.parse_args('--foo XXX'.split())\n" +"Namespace(bar='XXX')" -#: ../../library/argparse.rst:1377 msgid "" "Multiple arguments may share the same ``dest``. By default, the value from " "the last such argument given on the command line wins. Use " @@ -2199,16 +2755,21 @@ msgid "" "For conflicting *option strings* rather than ``dest`` names, see " "conflict_handler_." msgstr "" +"複数の引数で同じ ``dest`` を使えます。\n" +"デフォルトでは、それらのうちコマンドラインで最後に指定された引数の値が使われ" +"ます。\n" +"すべての値をリストに集めるには、``action='append'`` を使ってください。\n" +"``dest`` の名前ではなく *オプション文字列* が重複する場合は、" +"conflict_handler_ を参照してください。" -#: ../../library/argparse.rst:1382 msgid "Single-dash long option now takes precedence over short options." msgstr "" +"一つのダッシュで始まる長いオプションが、短いオプションより優先されるようにな" +"りました。" -#: ../../library/argparse.rst:1389 msgid "deprecated" -msgstr "" +msgstr "deprecated" -#: ../../library/argparse.rst:1391 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2218,8 +2779,15 @@ msgid "" "the future. For arguments, if ``deprecated`` is ``True``, then a warning " "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" +"プロジェクトの開発を続けるうちに、コマンドライン引数を削除する必要が生じるこ" +"とがあります。\n" +"削除する前に、その引数が非推奨となり、削除される予定であることをユーザーに知" +"らせてください。\n" +":meth:`~ArgumentParser.add_argument` の ``deprecated`` キーワード引数は、その" +"引数が非推奨で将来削除されるかどうかを指定し、デフォルトは ``False`` です。\n" +"``deprecated`` が ``True`` の引数を使うと、:data:`sys.stderr` に警告が表示さ" +"れます。 ::" -#: ../../library/argparse.rst:1401 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2230,20 +2798,31 @@ msgid "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='snake.py')\n" +">>> parser.add_argument('--legs', default=0, type=int, deprecated=True)\n" +">>> parser.parse_args([])\n" +"Namespace(legs=0)\n" +">>> parser.parse_args(['--legs', '4'])\n" +"snake.py: warning: option '--legs' is deprecated\n" +"Namespace(legs=4)" #: ../../library/argparse.rst:1414 msgid "Action classes" msgstr "Action クラス" -#: ../../library/argparse.rst:1416 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " "follows this API may be passed as the ``action`` parameter to :meth:" "`~ArgumentParser.add_argument`." msgstr "" +":class:`!Action` クラスは Action API を実装します。\n" +"この API は、呼び出されると、コマンドライン引数を処理する呼び出し可能オブジェ" +"クトを返します。\n" +"この API に従うオブジェクトであれば、:meth:`~ArgumentParser.add_argument` の " +"``action`` パラメーターに渡せます。" -#: ../../library/argparse.rst:1425 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -2251,8 +2830,12 @@ msgid "" "positional arguments plus any keyword arguments passed to :meth:" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" +":class:`ArgumentParser` は :class:`!Action` オブジェクトを使って、コマンドラ" +"インの一つ以上の文字列から一つの引数を解析するために必要な情報を表します。\n" +":class:`!Action` クラスは、二つの位置引数と、:meth:`ArgumentParser." +"add_argument` に渡されたキーワード引数 (``action`` 自身を除く) を受け付けなけ" +"ればなりません。" -#: ../../library/argparse.rst:1431 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2260,63 +2843,82 @@ msgid "" "help`, etc. defined. The easiest way to ensure these attributes are defined " "is to call :meth:`!Action.__init__`." msgstr "" +":class:`!Action` のインスタンス (または ``action`` パラメーターに渡した呼び出" +"し可能オブジェクトの返り値) には、:attr:`!dest`、:attr:`!option_strings`、:" +"attr:`!default`、:attr:`!type`、:attr:`!required`、:attr:`!help` などの属性を" +"定義してください。\n" +"これらの属性を確実に定義する最も簡単な方法は、:meth:`!Action.__init__` を呼び" +"出すことです。" -#: ../../library/argparse.rst:1439 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" +":class:`!Action` のインスタンスは呼び出し可能でなければなりません。\n" +"そのため、サブクラスでは :meth:`!__call__` メソッドをオーバーライドし、次の四" +"つの引数を受け付けるようにしてください。" -#: ../../library/argparse.rst:1442 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." -msgstr "" +msgstr "*parser* - このアクションを含む :class:`ArgumentParser` オブジェクト。" -#: ../../library/argparse.rst:1444 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" +"*namespace* - :meth:`~ArgumentParser.parse_args` が返す :class:`Namespace` オ" +"ブジェクト。\n" +"ほとんどのアクションは :func:`setattr` を使って、このオブジェクトに属性を追加" +"します。" -#: ../../library/argparse.rst:1448 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" +"*values* - 対応するコマンドライン引数に型変換を適用した値。\n" +"型変換は :meth:`~ArgumentParser.add_argument` の type_ キーワード引数で指定し" +"ます。" -#: ../../library/argparse.rst:1452 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" +"*option_string* - このアクションの呼び出しに使われたオプション文字列。\n" +"``option_string`` 引数は省略可能で、位置引数に対応するアクションでは指定され" +"ません。" -#: ../../library/argparse.rst:1456 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" +":meth:`!__call__` メソッドは任意の処理を行えますが、通常は ``dest`` と " +"``values`` に基づいて ``namespace`` の属性を設定します。" -#: ../../library/argparse.rst:1461 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " "usage of the program. If such method is not provided, a sensible default " "will be used." msgstr "" +":class:`!Action` のサブクラスでは、引数を取らず、プログラムの使用法の表示に使" +"う文字列を返す :meth:`!format_usage` メソッドを定義できます。\n" +"このメソッドを定義しなければ、適切なデフォルトの表示が使われます。" -#: ../../library/argparse.rst:1467 msgid "" "A subclass of :class:`Action` for handling boolean flags with positive and " "negative options. Adding a single argument such as ``--foo`` automatically " "creates both ``--foo`` and ``--no-foo`` options, storing ``True`` and " "``False`` respectively::" msgstr "" +"有効にするオプションと無効にするオプションを持つ真偽値のフラグを扱う、:class:" +"`Action` のサブクラスです。\n" +"``--foo`` のような引数を一つ追加すると、``--foo`` と ``--no-foo`` の両方が自" +"動的に作られ、それぞれ ``True`` と ``False`` を格納します。 ::" -#: ../../library/argparse.rst:1472 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -2324,21 +2926,28 @@ msgid "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" -#: ../../library/argparse.rst:1478 msgid "" "Single-dash long options are also supported. For example, negative option ``-" "nofoo`` is automatically added for positive option ``-foo``. But no " "additional options are added for short options such as ``-f``." msgstr "" +"一つのダッシュで始まる長いオプションもサポートしています。\n" +"例えば、有効にするオプション ``-foo`` に対して、無効にするオプション ``-" +"nofoo`` が自動的に追加されます。\n" +"ただし、``-f`` のような短いオプションに対しては、追加のオプションは作られませ" +"ん。" -#: ../../library/argparse.rst:1485 msgid "Added support for single-dash options." -msgstr "" +msgstr "一つのダッシュで始まるオプションのサポートが追加されました。" -#: ../../library/argparse.rst:1488 msgid "Added support for alternate prefix_chars_." -msgstr "" +msgstr "別の prefix_chars_ を使う場合のサポートが追加されました。" #: ../../library/argparse.rst:1492 msgid "The parse_args() method" @@ -2352,12 +2961,14 @@ msgstr "" "引数の文字列をオブジェクトに変換し、namespace オブジェクトの属性に代入しま" "す。結果の namespace オブジェクトを返します。" -#: ../../library/argparse.rst:1499 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" +"どのようなオブジェクトを作り、どう代入するかは、それまでの :meth:" +"`add_argument` の呼び出しで決まります。\n" +"詳細は :meth:`!add_argument` のドキュメントを参照してください。" #: ../../library/argparse.rst:1503 msgid "" @@ -2389,7 +3000,6 @@ msgstr "" "オプションの値の指定に複数の方法をサポートしています。もっとも単純な場合に" "は、オプションとその値は次のように2つの別々の引数として渡されます::" -#: ../../library/argparse.rst:1517 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2399,6 +3009,13 @@ msgid "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x')\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(['-x', 'X'])\n" +"Namespace(foo=None, x='X')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"Namespace(foo='FOO', x=None)" #: ../../library/argparse.rst:1525 msgid "" @@ -2410,11 +3027,12 @@ msgstr "" "値は次のように ``=`` で区切られた1つのコマンドライン引数として渡すこともでき" "ます::" -#: ../../library/argparse.rst:1529 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" msgstr "" +">>> parser.parse_args(['--foo=FOO'])\n" +"Namespace(foo='FOO', x=None)" #: ../../library/argparse.rst:1532 msgid "" @@ -2424,11 +3042,12 @@ msgstr "" "短いオプション (1文字のオプション) では、オプションとその値は次のように連結し" "て渡すことができます::" -#: ../../library/argparse.rst:1535 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" msgstr "" +">>> parser.parse_args(['-xX'])\n" +"Namespace(foo=None, x='X')" #: ../../library/argparse.rst:1538 msgid "" @@ -2439,7 +3058,6 @@ msgstr "" "い場合、複数の短いオプションは次のように1つの接頭辞 ``-`` だけで連結できま" "す::" -#: ../../library/argparse.rst:1541 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2448,6 +3066,12 @@ msgid "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', action='store_true')\n" +">>> parser.add_argument('-y', action='store_true')\n" +">>> parser.add_argument('-z')\n" +">>> parser.parse_args(['-xyzZ'])\n" +"Namespace(x=True, y=True, z='Z')" #: ../../library/argparse.rst:1550 msgid "Invalid arguments" @@ -2465,7 +3089,6 @@ msgstr "" "ます。それらのエラーが発生した場合、エラーメッセージと使用法メッセージを表示" "して終了します::" -#: ../../library/argparse.rst:1557 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2486,6 +3109,24 @@ msgid "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: unrecognized arguments: badger" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', nargs='?')\n" +"\n" +">>> # 不正な型\n" +">>> parser.parse_args(['--foo', 'spam'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: argument --foo: invalid int value: 'spam'\n" +"\n" +">>> # 不正なオプション\n" +">>> parser.parse_args(['--bar'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: unrecognized arguments: --bar\n" +"\n" +">>> # 引数の数が不正\n" +">>> parser.parse_args(['spam', 'badger'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: unrecognized arguments: badger" #: ../../library/argparse.rst:1578 msgid "Arguments containing ``-``" @@ -2553,24 +3194,27 @@ msgstr "" "引数 ``'--'`` を挿入して、:meth:`~ArgumentParser.parse_args` にそれ以降のすべ" "てが位置引数だと教えることができます::" -#: ../../library/argparse.rst:1623 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" msgstr "" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1626 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" +"詳細は :ref:`argparse の HOWTO の曖昧な引数についての説明 ` も参照してください。" -#: ../../library/argparse.rst:1629 msgid "" "Negative-number matching was expanded to include numbers in scientific " "notation (``-2.5e-6``), numbers containing underscores (``-1_234.5``), and " "complex numbers (``-1.2e-3j``)." msgstr "" +"負数として認識する形式を拡張し、指数表記の数値 (``-2.5e-6``)、アンダースコア" +"を含む数値 (``-1_234.5``)、複素数 (``-1.2e-3j``) も認識するようになりました。" #: ../../library/argparse.rst:1637 msgid "Argument abbreviations (prefix matching)" @@ -2586,7 +3230,6 @@ msgstr "" "`、長いオプションに曖昧さがない (先頭文字列が一意である) かぎ" "り、先頭文字列に短縮して指定できます::" -#: ../../library/argparse.rst:1643 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2599,6 +3242,16 @@ msgid "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-bacon')\n" +">>> parser.add_argument('-badger')\n" +">>> parser.parse_args('-bac MMM'.split())\n" +"Namespace(bacon='MMM', badger=None)\n" +">>> parser.parse_args('-bad WOOD'.split())\n" +"Namespace(bacon=None, badger='WOOD')\n" +">>> parser.parse_args('-ba BA'.split())\n" +"usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" +"PROG: error: ambiguous option: -ba could match -badger, -bacon" #: ../../library/argparse.rst:1654 msgid "" @@ -2612,15 +3265,18 @@ msgstr "" msgid "Beyond ``sys.argv``" msgstr "``sys.argv`` 以外" -#: ../../library/argparse.rst:1662 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " "passing a list of strings to :meth:`~ArgumentParser.parse_args`. This is " "useful for testing at the interactive prompt::" msgstr "" +":class:`ArgumentParser` で :data:`sys.argv` 以外の引数を解析したい場合もあり" +"ます。\n" +"その場合は、:meth:`~ArgumentParser.parse_args` に文字列のリストを渡してくださ" +"い。\n" +"対話プロンプトでのテストに便利です。 ::" -#: ../../library/argparse.rst:1667 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2634,6 +3290,17 @@ msgid "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\n" +"... 'integers', metavar='int', type=int, choices=range(10),\n" +"... nargs='+', help='an integer in the range 0..9')\n" +">>> parser.add_argument(\n" +"... '--sum', dest='accumulate', action='store_const', const=sum,\n" +"... default=max, help='sum the integers (default: find the max)')\n" +">>> parser.parse_args(['1', '2', '3', '4'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])\n" +">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])" #: ../../library/argparse.rst:1682 msgid "The Namespace object" @@ -2657,7 +3324,6 @@ msgstr "" "class:`object` のサブクラスです。もし属性を辞書のように扱える方が良ければ、標" "準的な Python のイディオム :func:`vars` を利用できます::" -#: ../../library/argparse.rst:1693 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2665,6 +3331,11 @@ msgid "" ">>> vars(args)\n" "{'foo': 'BAR'}" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> args = parser.parse_args(['--foo', 'BAR'])\n" +">>> vars(args)\n" +"{'foo': 'BAR'}" #: ../../library/argparse.rst:1699 msgid "" @@ -2676,7 +3347,6 @@ msgstr "" "既存のオブジェクトに属性を設定する方が良い場合があります。これは " "``namespace=`` キーワード引数を指定することで可能です::" -#: ../../library/argparse.rst:1703 msgid "" ">>> class C:\n" "... pass\n" @@ -2688,16 +3358,23 @@ msgid "" ">>> c.foo\n" "'BAR'" msgstr "" +">>> class C:\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(args=['--foo', 'BAR'], namespace=c)\n" +">>> c.foo\n" +"'BAR'" #: ../../library/argparse.rst:1715 msgid "Other utilities" msgstr "その他のユーティリティ" -#: ../../library/argparse.rst:1718 msgid "Subcommands" -msgstr "" +msgstr "サブコマンド" -#: ../../library/argparse.rst:1725 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2711,36 +3388,54 @@ msgid "" "command name and any :class:`!ArgumentParser` constructor arguments, and " "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" +"多くのプログラムは、機能をいくつかのサブコマンドに分けています。\n" +"例えば ``svn`` プログラムでは、``svn checkout``、``svn update``、``svn " +"commit`` などのサブコマンドを呼び出せます。\n" +"それぞれ異なる種類のコマンドライン引数を必要とする複数の機能を持つプログラム" +"では、このように分ける方法が特に適しています。\n" +":class:`ArgumentParser` では :meth:`!add_subparsers` メソッドでサブコマンドを" +"作成できます。\n" +"通常、:meth:`!add_subparsers` は引数なしで呼び出し、専用のアクションオブジェ" +"クトを返します。\n" +"このオブジェクトの :meth:`~_SubParsersAction.add_parser` メソッドは、コマンド" +"名と任意の :class:`!ArgumentParser` コンストラクター引数を受け取り、通常と同" +"じように設定できる :class:`!ArgumentParser` オブジェクトを返します。" #: ../../library/argparse.rst:1737 msgid "Description of parameters:" msgstr "引数の説明:" -#: ../../library/argparse.rst:1739 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" +"*title* - ヘルプに表示するサブパーサーグループのタイトル。\n" +"デフォルトでは、``description`` が指定されていれば \"subcommands\"、そうでな" +"ければ位置引数のタイトルを使います。" -#: ../../library/argparse.rst:1743 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" +"*description* - ヘルプに表示するサブパーサーグループの説明。\n" +"デフォルトは ``None`` です。" -#: ../../library/argparse.rst:1746 msgid "" "*prog* - usage information that will be displayed with subcommand help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" +"*prog* - サブコマンドのヘルプに表示する使用法の情報。\n" +"デフォルトでは、プログラム名とサブパーサー引数より前にあるすべての位置引数で" +"す。" -#: ../../library/argparse.rst:1750 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" +"*parser_class* - サブパーサーのインスタンスを作るクラス。\n" +"デフォルトでは、現在のパーサーのクラス (:class:`ArgumentParser` など) です。" #: ../../library/argparse.rst:1753 msgid "" @@ -2748,11 +3443,12 @@ msgid "" "encountered at the command line" msgstr "action_ - コマンドラインにこの引数があったときの基本のアクション。" -#: ../../library/argparse.rst:1756 msgid "" "dest_ - name of the attribute under which subcommand name will be stored; by " "default ``None`` and no value is stored" msgstr "" +"dest_ - サブコマンド名を格納する属性の名前。\n" +"デフォルトは ``None`` で、値は格納されません。" #: ../../library/argparse.rst:1759 msgid "" @@ -2768,17 +3464,17 @@ msgstr "" "help_ - ヘルプ出力に表示されるサブパーサーグループのヘルプです。デフォルトは " "``None`` です" -#: ../../library/argparse.rst:1764 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" +"metavar_ - ヘルプで利用可能なサブコマンドを表す文字列。\n" +"デフォルトは ``None`` で、{cmd1, cmd2, ..} の形式で表示されます。" #: ../../library/argparse.rst:1767 msgid "Some example usage::" msgstr "いくつかの使用例::" -#: ../../library/argparse.rst:1769 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2800,8 +3496,26 @@ msgid "" ">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" "Namespace(baz='Z', foo=True)" msgstr "" +">>> # 最上位のパーサーを作成する\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', action='store_true', help='foo help')\n" +">>> subparsers = parser.add_subparsers(help='subcommand help')\n" +">>>\n" +">>> # \"a\" コマンド用のパーサーを作成する\n" +">>> parser_a = subparsers.add_parser('a', help='a help')\n" +">>> parser_a.add_argument('bar', type=int, help='bar help')\n" +">>>\n" +">>> # \"b\" コマンド用のパーサーを作成する\n" +">>> parser_b = subparsers.add_parser('b', help='b help')\n" +">>> parser_b.add_argument('--baz', choices=('X', 'Y', 'Z'), help='baz " +"help')\n" +">>>\n" +">>> # 引数リストを解析する\n" +">>> parser.parse_args(['a', '12'])\n" +"Namespace(bar=12, foo=False)\n" +">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" +"Namespace(baz='Z', foo=True)" -#: ../../library/argparse.rst:1788 msgid "" "Note that the object returned by :meth:`~ArgumentParser.parse_args` will " "only contain attributes for the main parser and the subparser that was " @@ -2810,14 +3524,21 @@ msgid "" "``bar`` attributes are present, and when the ``b`` command is specified, " "only the ``foo`` and ``baz`` attributes are present." msgstr "" +":meth:`~ArgumentParser.parse_args` が返すオブジェクトに含まれるのは、メイン" +"パーサーと、コマンドラインで選ばれたサブパーサーの属性だけです。\n" +"それ以外のサブパーサーの属性は含まれません。\n" +"上の例では、``a`` コマンドを指定すると ``foo`` と ``bar`` 属性だけが存在し、" +"``b`` コマンドを指定すると ``foo`` と ``baz`` 属性だけが存在します。" -#: ../../library/argparse.rst:1795 msgid "" "If a subparser defines an argument with the same ``dest`` as the parent " "parser, the two share a single namespace attribute, so the parent's value " "won't be retained. Users should give them distinct ``dest`` values to keep " "both." msgstr "" +"サブパーサーが親パーサーと同じ ``dest`` の引数を定義すると、両者は同じ名前空" +"間の属性を共有するため、親の値は保持されません。\n" +"両方の値を保持するには、異なる ``dest`` を指定してください。" #: ../../library/argparse.rst:1800 msgid "" @@ -2833,7 +3554,6 @@ msgstr "" "メッセージは、上の例にもあるように :meth:`~_SubParsersAction.add_parser` の " "``help=`` 引数によって指定できます)" -#: ../../library/argparse.rst:1808 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -2863,16 +3583,46 @@ msgid "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" msgstr "" +">>> parser.parse_args(['--help'])\n" +"usage: PROG [-h] [--foo] {a,b} ...\n" +"\n" +"positional arguments:\n" +" {a,b} subcommand help\n" +" a a help\n" +" b b help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo foo help\n" +"\n" +">>> parser.parse_args(['a', '--help'])\n" +"usage: PROG a [-h] bar\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +">>> parser.parse_args(['b', '--help'])\n" +"usage: PROG b [-h] [--baz {X,Y,Z}]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1836 msgid "" "The :meth:`~ArgumentParser.add_subparsers` method also supports ``title`` " "and ``description`` keyword arguments. When either is present, the " "subparser's commands will appear in their own group in the help output. For " "example::" msgstr "" +":meth:`~ArgumentParser.add_subparsers` メソッドは ``title`` と " +"``description`` キーワード引数もサポートしています。\n" +"どちらかを指定すると、サブパーサーのコマンドがヘルプ内で独立したグループとし" +"て表示されます。\n" +"例えば次のようになります。 ::" -#: ../../library/argparse.rst:1840 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2891,16 +3641,34 @@ msgid "" "\n" " {foo,bar} additional help" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(title='subcommands',\n" +"... description='valid subcommands',\n" +"... help='additional help')\n" +">>> subparsers.add_parser('foo')\n" +">>> subparsers.add_parser('bar')\n" +">>> parser.parse_args(['-h'])\n" +"usage: [-h] {foo,bar} ...\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"subcommands:\n" +" valid subcommands\n" +"\n" +" {foo,bar} additional help" -#: ../../library/argparse.rst:1857 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`~ArgumentParser.add_subparsers` method with calls to :meth:" "`~ArgumentParser.set_defaults` so that each subparser knows which Python " "function it should execute. For example::" msgstr "" +"サブコマンドを扱う特に効果的な方法は、:meth:`~ArgumentParser.add_subparsers` " +"と :meth:`~ArgumentParser.set_defaults` を組み合わせて、各サブパーサーに実行" +"すべき Python 関数を設定することです。\n" +"例えば次のようになります。 ::" -#: ../../library/argparse.rst:1862 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2934,6 +3702,37 @@ msgid "" ">>> args.func(args)\n" "((XYZYX))" msgstr "" +">>> # サブコマンドの関数\n" +">>> def foo(args):\n" +"... print(args.x * args.y)\n" +"...\n" +">>> def bar(args):\n" +"... print('((%s))' % args.z)\n" +"...\n" +">>> # 最上位のパーサーを作成する\n" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(required=True)\n" +">>>\n" +">>> # \"foo\" コマンド用のパーサーを作成する\n" +">>> parser_foo = subparsers.add_parser('foo')\n" +">>> parser_foo.add_argument('-x', type=int, default=1)\n" +">>> parser_foo.add_argument('y', type=float)\n" +">>> parser_foo.set_defaults(func=foo)\n" +">>>\n" +">>> # \"bar\" コマンド用のパーサーを作成する\n" +">>> parser_bar = subparsers.add_parser('bar')\n" +">>> parser_bar.add_argument('z')\n" +">>> parser_bar.set_defaults(func=bar)\n" +">>>\n" +">>> # 引数を解析し、選ばれた関数を呼び出す\n" +">>> args = parser.parse_args('foo 1 -x 2'.split())\n" +">>> args.func(args)\n" +"2.0\n" +">>>\n" +">>> # 引数を解析し、選ばれた関数を呼び出す\n" +">>> args = parser.parse_args('bar XYZYX'.split())\n" +">>> args.func(args)\n" +"((XYZYX))" #: ../../library/argparse.rst:1894 msgid "" @@ -2946,7 +3745,6 @@ msgid "" "work::" msgstr "" -#: ../../library/argparse.rst:1901 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2957,38 +3755,45 @@ msgid "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" +">>> subparser1 = subparsers.add_parser('1')\n" +">>> subparser1.add_argument('-x')\n" +">>> subparser2 = subparsers.add_parser('2')\n" +">>> subparser2.add_argument('y')\n" +">>> parser.parse_args(['2', 'frobble'])\n" +"Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1910 msgid "New *required* keyword-only parameter." -msgstr "" +msgstr "キーワード専用の *required* パラメーターが追加されました。" -#: ../../library/argparse.rst:1913 msgid "" "Subparser's *prog* is no longer affected by a custom usage message in the " "main parser." msgstr "" +"メインパーサーに指定した独自の使用法メッセージが、サブパーサーの *prog* に影" +"響しなくなりました。" -#: ../../library/argparse.rst:1921 msgid "" "Create and return a new :class:`ArgumentParser` object for the subcommand " "*name*." msgstr "" +"サブコマンド *name* 用の新しい :class:`ArgumentParser` オブジェクトを作成して" +"返します。" -#: ../../library/argparse.rst:1924 msgid "The *name* argument is the name of the sub-command." -msgstr "" +msgstr "*name* 引数はサブコマンドの名前です。" -#: ../../library/argparse.rst:1926 msgid "The *help* argument provides a short description for this sub-command." -msgstr "" +msgstr "*help* 引数は、このサブコマンドの簡潔な説明を指定します。" -#: ../../library/argparse.rst:1928 msgid "" "The *aliases* argument allows providing alternative names for this sub-" "command. For example::" msgstr "" +"*aliases* 引数では、このサブコマンドの別名を指定できます。\n" +"例えば次のようになります。 ::" -#: ../../library/argparse.rst:1931 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2997,12 +3802,20 @@ msgid "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers()\n" +">>> checkout = subparsers.add_parser('checkout', aliases=['co'])\n" +">>> checkout.add_argument('foo')\n" +">>> parser.parse_args(['co', 'bar'])\n" +"Namespace(foo='bar')" -#: ../../library/argparse.rst:1938 msgid "" "The *deprecated* argument, if ``True``, marks the sub-command as deprecated " "and will issue a warning when used. For example::" msgstr "" +"*deprecated* 引数を ``True`` にすると、そのサブコマンドを非推奨とし、使用時に" +"警告を表示します。\n" +"例えば次のようになります。 ::" #: ../../library/argparse.rst:1941 msgid "" @@ -3014,15 +3827,15 @@ msgid "" "Namespace()" msgstr "" -#: ../../library/argparse.rst:1948 msgid "" "All other keyword arguments are passed directly to the :class:`!" "ArgumentParser` constructor." msgstr "" +"それ以外のキーワード引数はすべて、:class:`!ArgumentParser` コンストラクターに" +"直接渡されます。" -#: ../../library/argparse.rst:1951 msgid "Added the *deprecated* parameter." -msgstr "" +msgstr "*deprecated* パラメーターが追加されました。" #: ../../library/argparse.rst:1956 msgid "FileType objects" @@ -3042,7 +3855,6 @@ msgstr "" "ズ、エンコーディング、エラー処理でファイルとして開きます (詳細は :func:" "`open` 関数を参照してください。)::" -#: ../../library/argparse.rst:1966 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3052,6 +3864,13 @@ msgid "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" +">>> parser.add_argument('out', type=argparse.FileType('w', " +"encoding='UTF-8'))\n" +">>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])\n" +"Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " +"raw=<_io.FileIO name='raw.dat' mode='wb'>)" #: ../../library/argparse.rst:1972 msgid "" @@ -3063,15 +3882,17 @@ msgstr "" "`FileType` であれば :data:`sys.stdin` を、書き込み用の :class:`FileType` であ" "れば :data:`sys.stdout` に変換します::" -#: ../../library/argparse.rst:1976 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" +">>> parser.parse_args(['-'])\n" +"Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1983 msgid "" "If one argument uses *FileType* and then a subsequent argument fails, an " "error is reported but the file is not automatically closed. This can also " @@ -3079,6 +3900,11 @@ msgid "" "after the parser has run and then use the :keyword:`with`-statement to " "manage the files." msgstr "" +"ある引数で *FileType* を使い、その後の引数でエラーが起きると、エラーは報告さ" +"れますが、ファイルは自動的には閉じられません。\n" +"出力ファイルの内容を失うこともあります。\n" +"この場合は、引数の解析が終わってから :keyword:`with` 文でファイルを管理する方" +"が適切です。" #: ../../library/argparse.rst:1989 msgid "Added the *encoding* and *errors* parameters." @@ -3088,7 +3914,6 @@ msgstr "*encoding* と *errors* が引数に追加されました。" msgid "Argument groups" msgstr "引数グループ" -#: ../../library/argparse.rst:2001 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3096,8 +3921,11 @@ msgid "" "appropriate groups can be created using the :meth:`!add_argument_group` " "method::" msgstr "" +"デフォルトでは、:class:`ArgumentParser` はヘルプを表示する際に、コマンドライ" +"ン引数を \"positional arguments\" と \"options\" に分けます。\n" +"引数の意味に応じた別の分け方が適している場合は、:meth:`!add_argument_group` " +"メソッドでグループを作成できます。 ::" -#: ../../library/argparse.rst:2007 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3110,8 +3938,17 @@ msgid "" " bar bar help\n" " --foo FOO foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group = parser.add_argument_group('group')\n" +">>> group.add_argument('--foo', help='foo help')\n" +">>> group.add_argument('bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO] bar\n" +"\n" +"group:\n" +" bar bar help\n" +" --foo FOO foo help" -#: ../../library/argparse.rst:2018 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3121,8 +3958,14 @@ msgid "" "accepts *title* and *description* arguments which can be used to customize " "this display::" msgstr "" +":meth:`add_argument_group` メソッドは、通常の :class:`ArgumentParser` と同じ" +"ように :meth:`~ArgumentParser.add_argument` メソッドを持つ引数グループオブ" +"ジェクトを返します。\n" +"グループに追加した引数は通常の引数と同じように処理されますが、ヘルプでは別の" +"グループに表示されます。\n" +":meth:`!add_argument_group` の *title* と *description* 引数で、この表示をカ" +"スタマイズできます。 ::" -#: ../../library/argparse.rst:2026 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3142,8 +3985,24 @@ msgid "" "\n" " --bar BAR bar help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" +">>> group1.add_argument('foo', help='foo help')\n" +">>> group2 = parser.add_argument_group('group2', 'group2 description')\n" +">>> group2.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--bar BAR] foo\n" +"\n" +"group1:\n" +" group1 description\n" +"\n" +" foo foo help\n" +"\n" +"group2:\n" +" group2 description\n" +"\n" +" --bar BAR bar help" -#: ../../library/argparse.rst:2044 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3151,6 +4010,10 @@ msgid "" "`ArgumentParser` constructor, but apply specifically to the argument group " "rather than the entire parser." msgstr "" +"省略可能なキーワード専用パラメーター argument_default_ と conflict_handler_ " +"を使うと、引数グループの動作をより細かく制御できます。\n" +"これらの意味は :class:`ArgumentParser` コンストラクターと同じですが、パーサー" +"全体ではなく、その引数グループだけに適用されます。" #: ../../library/argparse.rst:2049 msgid "" @@ -3160,35 +4023,39 @@ msgstr "" "ユーザー定義グループにないすべての引数は通常の \"位置引数\" と \"オプション引" "数\" セクションに表示されます。" -#: ../../library/argparse.rst:2052 msgid "" "Within each argument group, arguments are displayed in help output in the " "order in which they are added." -msgstr "" +msgstr "各引数グループ内の引数は、追加した順にヘルプに表示されます。" -#: ../../library/argparse.rst:2055 msgid "" "Calling :meth:`add_argument_group` on an argument group now raises an " "exception. This nesting was never supported, often failed to work correctly, " "and was unintentionally exposed through inheritance." msgstr "" +"引数グループに対して :meth:`add_argument_group` を呼び出すと、例外が送出され" +"るようになりました。\n" +"この入れ子構造はもともとサポートされておらず、正しく動作しないことも多くあり" +"ました。\n" +"継承によって意図せず利用可能になっていたものです。" -#: ../../library/argparse.rst:2060 msgid "Passing prefix_chars_ to :meth:`add_argument_group` is now deprecated." msgstr "" +":meth:`add_argument_group` に prefix_chars_ を渡すことは非推奨になりました。" #: ../../library/argparse.rst:2066 msgid "Mutual exclusion" msgstr "相互排他" -#: ../../library/argparse.rst:2070 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" +"相互排他グループを作成します。\n" +":mod:`!argparse` は、そのグループに含まれる複数の引数がコマンドラインで同時に" +"指定されないことを確認します。 ::" -#: ../../library/argparse.rst:2074 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3202,6 +4069,17 @@ msgid "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group()\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(bar=True, foo=True)\n" +">>> parser.parse_args(['--bar'])\n" +"Namespace(bar=False, foo=False)\n" +">>> parser.parse_args(['--foo', '--bar'])\n" +"usage: PROG [-h] [--foo | --bar]\n" +"PROG: error: argument --bar: not allowed with argument --foo" #: ../../library/argparse.rst:2086 msgid "" @@ -3212,7 +4090,6 @@ msgstr "" ":meth:`add_mutually_exclusive_group` メソッドの引数 *required* に True 値を指" "定すると、その相互排他引数のどれか1つを選ぶことが要求されます::" -#: ../../library/argparse.rst:2090 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3222,16 +4099,26 @@ msgid "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group(required=True)\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] (--foo | --bar)\n" +"PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:2098 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." "add_argument_group`. However, a mutually exclusive group can be added to an " "argument group that has a title and description. For example::" msgstr "" +"現在、相互排他引数グループでは :meth:`~ArgumentParser.add_argument_group` の " +"*title* と *description* 引数はサポートされていません。\n" +"ただし、タイトルと説明を持つ引数グループに、相互排他グループを追加することは" +"できます。\n" +"例えば次のようになります。 ::" -#: ../../library/argparse.rst:2104 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3250,14 +4137,35 @@ msgid "" " --foo FOO foo help\n" " --bar BAR bar help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_argument_group('Group title', 'Group description')\n" +">>> exclusive_group = group.add_mutually_exclusive_group(required=True)\n" +">>> exclusive_group.add_argument('--foo', help='foo help')\n" +">>> exclusive_group.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] (--foo FOO | --bar BAR)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"Group title:\n" +" Group description\n" +"\n" +" --foo FOO foo help\n" +" --bar BAR bar help" -#: ../../library/argparse.rst:2121 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group now raises an exception. This nesting was " "never supported, often failed to work correctly, and was unintentionally " "exposed through inheritance." msgstr "" +"相互排他グループに対して :meth:`add_argument_group` または :meth:" +"`add_mutually_exclusive_group` を呼び出すと、例外が送出されるようになりまし" +"た。\n" +"この入れ子構造はもともとサポートされておらず、正しく動作しないことも多くあり" +"ました。\n" +"継承によって意図せず利用可能になっていたものです。" #: ../../library/argparse.rst:2129 msgid "Parser defaults" @@ -3276,7 +4184,6 @@ msgstr "" "を使うと与えられたコマンドライン引数の内容によらず追加の属性を決定することが" "可能です::" -#: ../../library/argparse.rst:2139 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3284,16 +4191,23 @@ msgid "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', type=int)\n" +">>> parser.set_defaults(bar=42, baz='badger')\n" +">>> parser.parse_args(['736'])\n" +"Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:2145 msgid "" "Note that defaults can be set at both the parser level using :meth:" "`set_defaults` and at the argument level using :meth:`add_argument`. If both " "are called for the same argument, the last default set for an argument is " "used::" msgstr "" +"デフォルト値は、:meth:`set_defaults` でパーサーに設定することも、:meth:" +"`add_argument` で個々の引数に設定することもできます。\n" +"同じ引数について両方を呼び出した場合は、最後に設定したデフォルト値が使われま" +"す。 ::" -#: ../../library/argparse.rst:2149 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3301,6 +4215,11 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='bar')\n" +">>> parser.set_defaults(foo='spam')\n" +">>> parser.parse_args([])\n" +"Namespace(foo='spam')" #: ../../library/argparse.rst:2155 msgid "" @@ -3320,13 +4239,16 @@ msgstr "" ":meth:`~ArgumentParser.add_argument` か :meth:`~ArgumentParser.set_defaults` " "によって指定された、 namespace の属性のデフォルト値を取得します::" -#: ../../library/argparse.rst:2165 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" ">>> parser.get_default('foo')\n" "'badger'" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='badger')\n" +">>> parser.get_default('foo')\n" +"'badger'" #: ../../library/argparse.rst:2172 msgid "Printing help" @@ -3389,23 +4311,27 @@ msgstr "" msgid "Partial parsing" msgstr "部分解析" -#: ../../library/argparse.rst:2209 msgid "" "Sometimes a script only needs to handle a specific set of command-line " "arguments, leaving any unrecognized arguments for another script or program. " "In these cases, the :meth:`~ArgumentParser.parse_known_args` method can be " "useful." msgstr "" +"スクリプトが特定のコマンドライン引数だけを処理し、認識できない引数を別のスク" +"リプトやプログラムに渡したい場合があります。\n" +"その場合は :meth:`~ArgumentParser.parse_known_args` メソッドが便利です。" -#: ../../library/argparse.rst:2214 msgid "" "This method works similarly to :meth:`~ArgumentParser.parse_args`, but it " "does not raise an error for extra, unrecognized arguments. Instead, it " "parses the known arguments and returns a two item tuple that contains the " "populated namespace and the list of any unrecognized arguments." msgstr "" +"このメソッドは :meth:`~ArgumentParser.parse_args` と同様に動作しますが、認識" +"できない余分な引数があってもエラーにはなりません。\n" +"認識できる引数を解析し、値を設定した名前空間と、認識できなかった引数のリスト" +"からなる 2 要素のタプルを返します。" -#: ../../library/argparse.rst:2221 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3413,6 +4339,11 @@ msgid "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" +"(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" #: ../../library/argparse.rst:2228 msgid "" @@ -3460,31 +4391,35 @@ msgstr "" "このメソッドをオーバーライドすると便利なこととして、スペースで区切られた行の" "単語1つ1つを別々の引数として扱えます。次の例でその方法を示します::" -#: ../../library/argparse.rst:2251 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" msgstr "" +"class MyArgumentParser(argparse.ArgumentParser):\n" +" def convert_arg_line_to_args(self, arg_line):\n" +" return arg_line.split()" -#: ../../library/argparse.rst:2255 msgid "" "Note that with this override an argument can no longer contain spaces, since " "each space-separated word becomes a separate argument." msgstr "" +"このようにオーバーライドすると、スペースで区切られた単語がそれぞれ別の引数に" +"なるため、引数にスペースを含められなくなります。" #: ../../library/argparse.rst:2260 msgid "Exiting methods" msgstr "終了メソッド" -#: ../../library/argparse.rst:2264 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" +"このメソッドは、指定された *status* でプログラムを終了します。\n" +"*message* が指定されていれば、終了前に :data:`sys.stderr` に表示します。\n" +"このメソッドをオーバーライドして、これらの処理を変更できます。 ::" -#: ../../library/argparse.rst:2268 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3492,12 +4427,18 @@ msgid "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" msgstr "" +"class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" +" def exit(self, status=0, message=None):\n" +" if status:\n" +" raise Exception(f'Exiting because of an error: {message}')\n" +" exit(status)" -#: ../../library/argparse.rst:2276 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" +"このメソッドは、*message* を含む使用法メッセージを :data:`sys.stderr` に表示" +"し、ステータスコード 2 でプログラムを終了します。" #: ../../library/argparse.rst:2281 msgid "Intermixed parsing" @@ -3515,13 +4456,16 @@ msgstr "" "parse_known_intermixed_args` メソッドは、このような方法での解析をサポートして" "います。" -#: ../../library/argparse.rst:2291 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " "subparsers, and mutually exclusive groups that include both optionals and " "positionals are not supported." msgstr "" +"これらのパーサーは :mod:`!argparse` のすべての機能をサポートしているわけでは" +"なく、未対応の機能を使うと例外を送出します。\n" +"特に、サブパーサーと、オプション引数と位置引数の両方を含む相互排他グループに" +"は対応していません。" #: ../../library/argparse.rst:2296 msgid "" @@ -3534,7 +4478,6 @@ msgstr "" "parse_intermixed_args` の違いを表しています: 前者は ``['2', '3']`` を、解析さ" "れない引数として返し、後者は全ての位置引数を ``rest`` に入れて返しています::" -#: ../../library/argparse.rst:2302 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3545,6 +4488,14 @@ msgid "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('cmd')\n" +">>> parser.add_argument('rest', nargs='*', type=int)\n" +">>> parser.parse_known_args('doit 1 --foo bar 2 3'.split())\n" +"(Namespace(cmd='doit', foo='bar', rest=[1]), ['2', '3'])\n" +">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" +"Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" #: ../../library/argparse.rst:2311 msgid "" @@ -3558,32 +4509,35 @@ msgstr "" ":meth:`~ArgumentParser.parse_intermixed_args` は、解析されない引数が残された" "場合にはエラーを送出します。" -#: ../../library/argparse.rst:2320 msgid "Registering custom types or actions" -msgstr "" +msgstr "独自の型やアクションの登録" -#: ../../library/argparse.rst:2324 msgid "" "Sometimes it's desirable to use a custom string in error messages to provide " "more user-friendly output. In these cases, :meth:`!register` can be used to " "register custom actions or types with a parser and allow you to reference " "the type by their registered name instead of their callable name." msgstr "" +"エラーメッセージに独自の文字列を使って、出力をユーザーにわかりやすくしたい場" +"合があります。\n" +"その場合は、:meth:`!register` で独自のアクションや型をパーサーに登録すると、" +"呼び出し可能オブジェクトの名前の代わりに登録名で型を参照できます。" -#: ../../library/argparse.rst:2329 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " "``action``, ``type``), *value*, which is the key under which the object will " "be registered, and object, the callable to be registered." msgstr "" +":meth:`!register` メソッドは三つの引数を受け取ります。\n" +"*registry_name* はオブジェクトを格納する内部レジストリ (``action``、``type`` " +"など)、*value* は登録に使うキー、``object`` は登録する呼び出し可能オブジェク" +"トです。" -#: ../../library/argparse.rst:2334 msgid "" "The following example shows how to register a custom type with a parser::" -msgstr "" +msgstr "次の例は、パーサーに独自の型を登録する方法を示します。 ::" -#: ../../library/argparse.rst:2336 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -3598,6 +4552,18 @@ msgid "" "usage: PROG [-h] [--foo FOO]\n" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n" +">>> parser.add_argument('--foo', type='hexadecimal integer')\n" +"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, " +"default=None, type='hexadecimal integer', choices=None, required=False, " +"help=None, metavar=None, deprecated=False)\n" +">>> parser.parse_args(['--foo', '0xFA'])\n" +"Namespace(foo=250)\n" +">>> parser.parse_args(['--foo', '1.2'])\n" +"usage: PROG [-h] [--foo FOO]\n" +"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" #: ../../library/argparse.rst:2348 msgid "Exceptions" diff --git a/library/array.po b/library/array.po index b80f50d72..caaf6fbee 100644 --- a/library/array.po +++ b/library/array.po @@ -92,9 +92,8 @@ msgstr "``'u'``" msgid "wchar_t" msgstr "wchar_t" -#: ../../library/array.rst:25 ../../library/array.rst:27 msgid "Unicode character" -msgstr "Unicode文字(unicode型)" +msgstr "Unicode 文字" #: ../../library/array.rst:25 ../../library/array.rst:29 #: ../../library/array.rst:31 ../../library/array.rst:33 @@ -110,9 +109,8 @@ msgstr "\\(1)" msgid "``'w'``" msgstr "``'w'``" -#: ../../library/array.rst:27 msgid "Py_UCS4" -msgstr "" +msgstr "Py_UCS4" #: ../../library/array.rst:27 ../../library/array.rst:37 #: ../../library/array.rst:39 ../../library/array.rst:47 @@ -196,9 +194,8 @@ msgstr "unsigned long long" msgid "``'e'``" msgstr "``'e'``" -#: ../../library/array.rst:45 msgid "_Float16" -msgstr "" +msgstr "_Float16" #: ../../library/array.rst:45 ../../library/array.rst:47 #: ../../library/array.rst:49 @@ -221,13 +218,11 @@ msgstr "``'d'``" msgid "double" msgstr "double" -#: ../../library/array.rst:51 msgid "``'Zf'``" -msgstr "" +msgstr "``'Zf'``" -#: ../../library/array.rst:51 msgid "float complex" -msgstr "" +msgstr "float complex" #: ../../library/array.rst:51 ../../library/array.rst:53 msgid "complex" @@ -237,13 +232,11 @@ msgstr "複素数" msgid "\\(4)" msgstr "\\(4)" -#: ../../library/array.rst:53 msgid "``'Zd'``" -msgstr "" +msgstr "``'Zd'``" -#: ../../library/array.rst:53 msgid "double complex" -msgstr "" +msgstr "double complex" #: ../../library/array.rst:53 msgid "16" @@ -253,30 +246,35 @@ msgstr "16" msgid "Notes:" msgstr "注釈:" -#: ../../library/array.rst:60 msgid "It can be 16 bits or 32 bits depending on the platform." msgstr "" +"プラットフォームによって、16 ビットの場合と 32 ビットの場合があります。" -#: ../../library/array.rst:62 msgid "" "``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated " "``Py_UNICODE``. This change doesn't affect its behavior because " "``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." msgstr "" +"``array('u')`` の C の型は、非推奨の ``Py_UNICODE`` から :c:type:`wchar_t` に" +"変更されました。\n" +"Python 3.3 以降、``Py_UNICODE`` は :c:type:`wchar_t` の別名なので、この変更に" +"よる動作の違いはありません。" -#: ../../library/array.rst:67 msgid "Please migrate to ``'w'`` typecode." -msgstr "" +msgstr "型コード ``'w'`` に移行してください。" -#: ../../library/array.rst:74 msgid "" "The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 " "revision of the `IEEE 754 standard `_. This type is not " "widely supported by C compilers. It's available as :c:expr:`_Float16` type, " "if the compiler supports the Annex H of the C23 standard." msgstr "" +"IEEE 754 binary16「半精度」型は、`IEEE 754 規格 `_ の " +"2008 年の改訂で導入されました。\n" +"この型は C コンパイラでは広くサポートされていません。\n" +"コンパイラが C23 規格の附属書 H をサポートしていれば、:c:expr:`_Float16` 型と" +"して使えます。" -#: ../../library/array.rst:83 msgid "" "Complex types (``Zf`` and ``Zd``) are available unconditionally, regardless " "on support for complex types (the Annex G of the C11 standard) by the C " @@ -284,14 +282,21 @@ msgid "" "by a two-element C array containing, respectively, the real and imaginary " "parts." msgstr "" +"複素数型 (``Zf`` と ``Zd``) は、C コンパイラによる複素数型 (C11 規格の附属書 " +"G) のサポートの有無にかかわらず、常に利用できます。\n" +"C11 規格の規定に従い、各複素数型は実部と虚部を順に格納する 2 要素の C の配列" +"で表されます。" -#: ../../library/array.rst:93 msgid "" "The :ref:`ctypes ` and :ref:`struct ` modules, as well as third-party modules like `numpy `__, use similar -- but slightly different -- type codes." msgstr "" +":ref:`ctypes ` モジュール、:ref:`struct " +"` モジュール、`numpy `__ などのサード" +"パーティー製モジュールも、似ているものの少し異なる型コードを使っています。" #: ../../library/array.rst:99 msgid "" @@ -306,27 +311,27 @@ msgstr "" msgid "The module defines the following item:" msgstr "このモジュールは以下の項目を定義しています:" -#: ../../library/array.rst:108 msgid "A tuple with all available type codes." -msgstr "" +msgstr "利用可能なすべての型コードを含むタプルです。" -#: ../../library/array.rst:110 msgid "The type changed from :class:`str` to :class:`tuple`." -msgstr "" +msgstr "型が :class:`str` から :class:`tuple` に変わりました。" #: ../../library/array.rst:114 msgid "The module defines the following type:" msgstr "このモジュールでは次の型を定義しています:" -#: ../../library/array.rst:119 msgid "" "A new array whose items are restricted by *typecode*, and initialized from " "the optional *initializer* value, which must be a :class:`bytes` or :class:" "`bytearray` object, a Unicode string, or iterable over elements of the " "appropriate type." msgstr "" +"要素の型を *typecode* で制限した新しい配列を作成します。\n" +"省略可能な *initializer* を指定すると、その値で初期化します。\n" +"この値は :class:`bytes` オブジェクト、:class:`bytearray` オブジェクト、" +"Unicode 文字列、または適切な型の要素を返すイテラブルでなければなりません。" -#: ../../library/array.rst:124 msgid "" "If given a :class:`bytes` or :class:`bytearray` object, the initializer is " "passed to the new array's :meth:`frombytes` method; if given a Unicode " @@ -334,8 +339,12 @@ msgid "" "otherwise, the initializer's iterator is passed to the :meth:`extend` method " "to add initial items to the array." msgstr "" +":class:`bytes` または :class:`bytearray` オブジェクトを指定した場合、" +"``initializer`` は新しい配列の :meth:`frombytes` メソッドに渡されます。\n" +"Unicode 文字列を指定した場合は :meth:`fromunicode` メソッドに渡されます。\n" +"それ以外の場合は、``initializer`` のイテレーターを :meth:`extend` メソッドに" +"渡して、初期値となる要素を配列に追加します。" -#: ../../library/array.rst:131 msgid "" "Array objects support the ordinary :ref:`mutable ` :term:" "`sequence` operations of indexing, slicing, concatenation, and " @@ -344,10 +353,17 @@ msgid "" "is raised. Array objects also implement the buffer interface, and may be " "used wherever :term:`bytes-like objects ` are supported." msgstr "" +"配列オブジェクトは、インデックス参照、スライス、連結、繰り返しといった、通常" +"の :ref:`ミュータブルな ` :term:`シーケンス ` の" +"操作をサポートします。\n" +"スライス代入では、代入する値は同じ型コードの配列オブジェクトでなければなら" +"ず、それ以外の場合は :exc:`TypeError` を送出します。\n" +"配列オブジェクトはバッファインターフェースも実装しており、:term:`bytes-like " +"オブジェクト ` を受け付ける場所で使えます。" -#: ../../library/array.rst:137 msgid "Arrays are :ref:`generic ` over the type of their contents." msgstr "" +"配列は、要素の型をパラメーターとする :ref:`ジェネリック型 ` です。" #: ../../library/array.rst:139 msgid "" @@ -365,9 +381,8 @@ msgstr "アレイを作るときに使う型コード文字です。" msgid "The length in bytes of one array item in the internal representation." msgstr "アレイの要素 1 つの内部表現に使われるバイト長です。" -#: ../../library/array.rst:154 msgid "Append a new item with the specified value to the end of the array." -msgstr "" +msgstr "指定した値を持つ新しい要素を配列の末尾に追加します。" #: ../../library/array.rst:159 msgid "" @@ -402,7 +417,6 @@ msgstr "" "互換性のために保守されており、新しいコードでの使用は避けるべきです。バッファ" "インターフェースの説明は :ref:`bufferobjects` にあります。" -#: ../../library/array.rst:178 msgid "" "\"Byteswap\" all items of the array. This is only supported for values " "which are 1, 2, 4, 8 or 16 bytes in size; for other types of values, :exc:" @@ -411,10 +425,15 @@ msgid "" "types the order of components (the real part, followed by imaginary part) is " "preserved." msgstr "" +"配列の全要素のバイト順を逆にします。\n" +"サイズが 1、2、4、8、16 バイトの値だけをサポートし、それ以外の型の値では :" +"exc:`RuntimeError` を送出します。\n" +"バイト順が異なるマシンで書き込まれたファイルからデータを読み込む際に便利で" +"す。\n" +"複素数型の場合、成分の順序 (実部、虚部の順) は変わりません。" -#: ../../library/array.rst:187 msgid "Return the number of occurrences of *value* in the array." -msgstr "" +msgstr "配列内で *value* が出現する回数を返します。" #: ../../library/array.rst:192 msgid "" @@ -429,12 +448,14 @@ msgstr "" "ない場合、アレイに値を追加できるような正しい型の要素からなるイテレーション可" "能オブジェクトでなければなりません。" -#: ../../library/array.rst:200 msgid "" "Appends items from the :term:`bytes-like object`, interpreting its content " "as an array of machine values (as if it had been read from a file using the :" "meth:`fromfile` method)." msgstr "" +":term:`bytes-like object` の内容をマシンのデータ形式の配列として解釈し、要素" +"を追加します (:meth:`fromfile` メソッドでファイルから読み込んだ場合と同じで" +"す)。" #: ../../library/array.rst:204 msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity." @@ -462,31 +483,39 @@ msgstr "" "リストから要素を追加します。型に関するエラーが発生した場合にアレイが変更され" "ないことを除き、 ``for x in list: a.append(x)`` と同じです。" -#: ../../library/array.rst:224 msgid "" "Extends this array with data from the given Unicode string. The array must " "have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. " "Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to " "an array of some other type." msgstr "" +"指定した Unicode 文字列のデータを配列に追加します。\n" +"配列の型コードは ``'u'`` または ``'w'`` でなければならず、それ以外では :exc:" +"`ValueError` を送出します。\n" +"他の型の配列に Unicode データを追加するには、``array.frombytes(unicodestring." +"encode(enc))`` を使ってください。" -#: ../../library/array.rst:232 msgid "" "Return the smallest *i* such that *i* is the index of the first occurrence " "of *value* in the array. The optional arguments *start* and *stop* can be " "specified to search for *value* within a subsection of the array. Raise :" "exc:`ValueError` if *value* is not found." msgstr "" +"配列内で *value* が最初に出現するインデックス *i* (つまり、該当する最小の " +"*i*) を返します。\n" +"省略可能な引数 *start* と *stop* を指定すると、配列の一部分から *value* を探" +"せます。\n" +"*value* が見つからなければ :exc:`ValueError` を送出します。" -#: ../../library/array.rst:237 msgid "Added optional *start* and *stop* parameters." -msgstr "" +msgstr "省略可能な *start* と *stop* パラメーターが追加されました。" -#: ../../library/array.rst:243 msgid "" "Insert a new item *value* in the array before position *index*. Negative " "values are treated as being relative to the end of the array." msgstr "" +"配列の *index* が示す位置の直前に、新しい要素 *value* を挿入します。\n" +"負のインデックスは配列の末尾からの相対位置として扱われます。" #: ../../library/array.rst:249 msgid "" @@ -498,13 +527,11 @@ msgstr "" "フォルトで ``-1`` になっていて、最後の要素を取り除いて返すようになっていま" "す。" -#: ../../library/array.rst:256 msgid "Remove the first occurrence of *value* from the array." -msgstr "" +msgstr "配列内で最初に出現する *value* を削除します。" -#: ../../library/array.rst:261 msgid "Remove all elements from the array." -msgstr "" +msgstr "配列のすべての要素を削除します。" #: ../../library/array.rst:268 msgid "Reverse the order of the items in the array." @@ -519,9 +546,9 @@ msgstr "" "array をマシンの値の array に変換して、 bytes の形で返します (:meth:`tofile` " "メソッドを使ってファイルに書かれるバイト列と同じです)。" -#: ../../library/array.rst:277 msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity." msgstr "" +"名前を明確にするため、:meth:`!tostring` を :meth:`tobytes` に改名しました。" #: ../../library/array.rst:283 msgid "Write all items (as machine values) to the :term:`file object` *f*." @@ -532,12 +559,16 @@ msgstr "" msgid "Convert the array to an ordinary list with the same items." msgstr "アレイを同じ要素を持つ普通のリストに変換します。" -#: ../../library/array.rst:293 msgid "" "Convert the array to a Unicode string. The array must have a type ``'u'`` " "or ``'w'``; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." "decode(enc)`` to obtain a Unicode string from an array of some other type." msgstr "" +"配列を Unicode 文字列に変換します。\n" +"配列の型コードは ``'u'`` または ``'w'`` でなければならず、それ以外では :exc:" +"`ValueError` を送出します。\n" +"他の型の配列から Unicode 文字列を得るには、``array.tobytes().decode(enc)`` を" +"使ってください。" #: ../../library/array.rst:298 msgid "" @@ -552,13 +583,16 @@ msgid "" "Examples::" msgstr "" -#: ../../library/array.rst:310 msgid "" "array('l')\n" "array('w', 'hello \\u2641')\n" "array('l', [1, 2, 3, 4, 5])\n" "array('d', [1.0, 2.0, 3.14, -inf, nan])" msgstr "" +"array('l')\n" +"array('w', 'hello \\u2641')\n" +"array('l', [1, 2, 3, 4, 5])\n" +"array('d', [1.0, 2.0, 3.14, -inf, nan])" #: ../../library/array.rst:318 msgid "Module :mod:`struct`" diff --git a/library/ast.po b/library/ast.po index 94e5d43d7..4859ebdec 100644 --- a/library/ast.po +++ b/library/ast.po @@ -22,21 +22,23 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/ast.rst:2 msgid ":mod:`!ast` --- Abstract syntax trees" -msgstr "" +msgstr ":mod:`!ast` --- 抽象構文木" #: ../../library/ast.rst:11 msgid "**Source code:** :source:`Lib/ast.py`" msgstr "**ソースコード:** :source:`Lib/ast.py`" -#: ../../library/ast.rst:15 msgid "" "The :mod:`!ast` module helps Python applications to process trees of the " "Python abstract syntax grammar. The abstract syntax itself might change " "with each Python release; this module helps to find out programmatically " "what the current grammar looks like." msgstr "" +":mod:`!ast` モジュールは、Python の抽象構文を表す木を Python アプリケーション" +"で処理するための機能を提供します。\n" +"抽象構文自体は Python のリリースごとに変わる可能性がありますが、このモジュー" +"ルを使えば、現在の文法をプログラムから調べられます。" #: ../../library/ast.rst:20 msgid "" @@ -54,15 +56,13 @@ msgstr "" "`compile` を使って Python コード・オブジェクトにコンパイルすることができま" "す。" -#: ../../library/ast.rst:30 msgid "Abstract grammar" -msgstr "" +msgstr "抽象文法" #: ../../library/ast.rst:32 msgid "The abstract grammar is currently defined as follows:" msgstr "抽象文法は、現在次のように定義されています:" -#: ../../library/ast.rst:34 msgid "" "-- ASDL's 4 builtin types are:\n" "-- identifier, int, string, constant\n" @@ -239,18 +239,194 @@ msgid "" "end_col_offset)\n" "}\n" msgstr "" +"-- ASDL の四つの組み込み型:\n" +"-- identifier, int, string, constant\n" +"\n" +"module Python\n" +"{\n" +" mod = Module(stmt* body, type_ignore* type_ignores)\n" +" | Interactive(stmt* body)\n" +" | Expression(expr body)\n" +" | FunctionType(expr* argtypes, expr returns)\n" +"\n" +" stmt = FunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? returns,\n" +" string? type_comment, type_param* type_params)\n" +" | AsyncFunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? " +"returns,\n" +" string? type_comment, type_param* type_params)\n" +"\n" +" | ClassDef(identifier name,\n" +" expr* bases,\n" +" keyword* keywords,\n" +" stmt* body,\n" +" expr* decorator_list,\n" +" type_param* type_params)\n" +" | Return(expr? value)\n" +"\n" +" | Delete(expr* targets)\n" +" | Assign(expr* targets, expr value, string? type_comment)\n" +" | TypeAlias(expr name, type_param* type_params, expr value)\n" +" | AugAssign(expr target, operator op, expr value)\n" +" -- 'simple' は括弧のない単純な名前へのアノテーションを示す\n" +" | AnnAssign(expr target, expr annotation, expr? value, int " +"simple)\n" +"\n" +" -- 対象言語では else がキーワードなので 'orelse' を使う\n" +" | For(expr target, expr iter, stmt* body, stmt* orelse, string? " +"type_comment)\n" +" | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, " +"string? type_comment)\n" +" | While(expr test, stmt* body, stmt* orelse)\n" +" | If(expr test, stmt* body, stmt* orelse)\n" +" | With(withitem* items, stmt* body, string? type_comment)\n" +" | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" +"\n" +" | Match(expr subject, match_case* cases)\n" +"\n" +" | Raise(expr? exc, expr? cause)\n" +" | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | Assert(expr test, expr? msg)\n" +"\n" +" | Import(alias* names, int? is_lazy)\n" +" | ImportFrom(identifier? module, alias* names, int? level, int? " +"is_lazy)\n" +"\n" +" | Global(identifier* names)\n" +" | Nonlocal(identifier* names)\n" +" | Expr(expr value)\n" +" | Pass | Break | Continue\n" +"\n" +" -- col_offset はパーサーが使う UTF-8 文字列内のバイトオフセット\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- BoolOp() は left と right を使えるか?\n" +" expr = BoolOp(boolop op, expr* values)\n" +" | NamedExpr(expr target, expr value)\n" +" | BinOp(expr left, operator op, expr right)\n" +" | UnaryOp(unaryop op, expr operand)\n" +" | Lambda(arguments args, expr body)\n" +" | IfExp(expr test, expr body, expr orelse)\n" +" | Dict(expr?* keys, expr* values)\n" +" | Set(expr* elts)\n" +" | ListComp(expr elt, comprehension* generators)\n" +" | SetComp(expr elt, comprehension* generators)\n" +" | DictComp(expr key, expr? value, comprehension* generators)\n" +" | GeneratorExp(expr elt, comprehension* generators)\n" +" -- yield 式が現れる位置は文法によって制限される\n" +" | Await(expr value)\n" +" | Yield(expr? value)\n" +" | YieldFrom(expr value)\n" +" -- 次の二つを区別するため、比較にはシーケンスが必要\n" +" -- x < 4 < 3 と (x < 4) < 3\n" +" | Compare(expr left, cmpop* ops, expr* comparators)\n" +" | Call(expr func, expr* args, keyword* keywords)\n" +" | FormattedValue(expr value, int conversion, expr? format_spec)\n" +" | Interpolation(expr value, constant str, int conversion, expr? " +"format_spec)\n" +" | JoinedStr(expr* values)\n" +" | TemplateStr(expr* values)\n" +" | Constant(constant value, string? kind)\n" +"\n" +" -- 以下の式は代入のコンテキストに現れうる\n" +" | Attribute(expr value, identifier attr, expr_context ctx)\n" +" | Subscript(expr value, expr slice, expr_context ctx)\n" +" | Starred(expr value, expr_context ctx)\n" +" | Name(identifier id, expr_context ctx)\n" +" | List(expr* elts, expr_context ctx)\n" +" | Tuple(expr* elts, expr_context ctx)\n" +"\n" +" -- Subscript 内にのみ現れる\n" +" | Slice(expr? lower, expr? upper, expr? step)\n" +"\n" +" -- col_offset はパーサーが使う UTF-8 文字列内のバイトオフセット\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" expr_context = Load | Store | Del\n" +"\n" +" boolop = And | Or\n" +"\n" +" operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n" +" | RShift | BitOr | BitXor | BitAnd | FloorDiv\n" +"\n" +" unaryop = Invert | Not | UAdd | USub\n" +"\n" +" cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n" +"\n" +" comprehension = (expr target, expr iter, expr* ifs, int is_async)\n" +"\n" +" excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n" +" attributes (int lineno, int col_offset, int? end_lineno, " +"int? end_col_offset)\n" +"\n" +" arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" +" expr?* kw_defaults, arg? kwarg, expr* defaults)\n" +"\n" +" arg = (identifier arg, expr? annotation, string? type_comment)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- 呼び出しに渡すキーワード引数 (**kwargs の identifier は NULL)\n" +" keyword = (identifier? arg, expr value)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- インポート名と、省略可能な 'as' による別名。\n" +" alias = (identifier name, identifier? asname)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" withitem = (expr context_expr, expr? optional_vars)\n" +"\n" +" match_case = (pattern pattern, expr? guard, stmt* body)\n" +"\n" +" pattern = MatchValue(expr value)\n" +" | MatchSingleton(constant value)\n" +" | MatchSequence(pattern* patterns)\n" +" | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n" +" | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, " +"pattern* kwd_patterns)\n" +"\n" +" | MatchStar(identifier? name)\n" +" -- MatchMapping の省略可能な \"rest\" パラメーターで残りのマッピ" +"ングのキーをキャプチャする\n" +"\n" +" | MatchAs(pattern? pattern, identifier? name)\n" +" | MatchOr(pattern* patterns)\n" +"\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"\n" +" type_ignore = TypeIgnore(int lineno, string tag)\n" +"\n" +" type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n" +" | ParamSpec(identifier name, expr? default_value)\n" +" | TypeVarTuple(identifier name, expr? default_value)\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"}\n" #: ../../library/ast.rst:41 msgid "Node classes" msgstr "Node クラス" -#: ../../library/ast.rst:45 msgid "" "This is the abstract base of all AST node classes. The actual node classes " "are derived from the :file:`Parser/Python.asdl` file, which is reproduced :" "ref:`above `. They are defined in the :mod:`!_ast` C " "module and re-exported in :mod:`!ast`." msgstr "" +"すべての AST ノードクラスの抽象基底クラスです。\n" +"実際のノードクラスは、:ref:`上に掲載した ` :file:`Parser/" +"Python.asdl` ファイルから生成されます。\n" +"これらは C モジュール :mod:`!_ast` で定義され、:mod:`!ast` から再エクスポート" +"されます。" #: ../../library/ast.rst:50 msgid "" @@ -303,20 +479,22 @@ msgstr "" "ストで表されます。全ての属性は AST を :func:`compile` でコンパイルする際には" "存在しなければならず、そして妥当な値でなければなりません。" -#: ../../library/ast.rst:78 msgid "" "The :attr:`!_field_types` attribute on each concrete class is a dictionary " "mapping field names (as also listed in :attr:`_fields`) to their types." msgstr "" +"各具象クラスの :attr:`!_field_types` 属性は、フィールド名 (:attr:`_fields` に" +"も列挙されています) をその型に対応付ける辞書です。" -#: ../../library/ast.rst:81 msgid "" ">>> ast.TypeVar._field_types\n" "{'name': , 'bound': ast.expr | None, 'default_value': ast.expr " "| None}" msgstr "" +">>> ast.TypeVar._field_types\n" +"{'name': , 'bound': ast.expr | None, 'default_value': ast.expr " +"| None}" -#: ../../library/ast.rst:93 msgid "" "Instances of :class:`ast.expr` and :class:`ast.stmt` subclasses have :attr:" "`lineno`, :attr:`col_offset`, :attr:`end_lineno`, and :attr:`end_col_offset` " @@ -327,13 +505,14 @@ msgid "" "the node. The UTF-8 offset is recorded because the parser uses UTF-8 " "internally." msgstr "" -":class:`ast.expr` や :class:`ast.stmt` のサブクラスのインスタンスは :attr:" -"`lineno`, :attr:`col_offset`, :attr:`end_lineno`, および :attr:" -"`end_col_offset` 属性を持ちます。 :attr:`lineno` と :attr:`end_lineno` はソー" -"ステキストの範囲を最初と最後の行番号で表し (1 から数え始めるので、最初の行の" -"行番号は 1 となります)、 :attr:`col_offset` と :attr:`end_col_offset` はノー" -"ドが生成した最初と最後のトークンの UTF-8 バイトオフセットです。 UTF-8 オフ" -"セットはパーサが内部で使用するので記録されます。" +":class:`ast.expr` と :class:`ast.stmt` のサブクラスのインスタンスは、:attr:" +"`lineno`、:attr:`col_offset`、:attr:`end_lineno`、:attr:`end_col_offset` 属性" +"を持ちます。\n" +":attr:`lineno` と :attr:`end_lineno` は、対応するソーステキストの最初と最後の" +"行番号です (1 から数えるので、先頭行は 1 です)。\n" +":attr:`col_offset` と :attr:`end_col_offset` は、ノードの生成元となった最初と" +"最後のトークンに対応する UTF-8 バイトオフセットです。\n" +"パーサーは内部で UTF-8 を使うため、この形式のオフセットを記録します。" #: ../../library/ast.rst:102 msgid "" @@ -376,11 +555,12 @@ msgstr "" "たとえば、 :class:`ast.UnaryOp` ノードを生成して属性を埋めるには、次のように" "することができます ::" -#: ../../library/ast.rst:117 msgid "" "node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" " lineno=0, col_offset=0)" msgstr "" +"node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" +" lineno=0, col_offset=0)" #: ../../library/ast.rst:120 msgid "" @@ -404,7 +584,6 @@ msgstr "" "単純なインデックスはその値で表現され、幅を持つスライスはタプルで表現されま" "す。" -#: ../../library/ast.rst:138 msgid "" "AST node constructors were changed to provide sensible defaults for omitted " "fields: optional fields now default to ``None``, list fields default to an " @@ -412,14 +591,21 @@ msgid "" "`Load() `. Previously, omitted attributes would not exist on " "constructed nodes (accessing them raised :exc:`AttributeError`)." msgstr "" +"AST ノードのコンストラクターが、省略されたフィールドに適切なデフォルト値を設" +"定するようになりました。\n" +"省略可能なフィールドは ``None``、リストのフィールドは空リスト、:class:`!ast." +"expr_context` 型のフィールドは :class:`Load() ` がデフォルトになり" +"ます。\n" +"以前は、省略された属性は作成したノードに存在せず、アクセスすると :exc:" +"`AttributeError` が送出されていました。" -#: ../../library/ast.rst:146 msgid "" "The :meth:`~object.__repr__` output of :class:`~ast.AST` nodes includes the " "values of the node fields." msgstr "" +":class:`~ast.AST` ノードの :meth:`~object.__repr__` の出力に、ノードのフィー" +"ルドの値が含まれるようになりました。" -#: ../../library/ast.rst:151 msgid "" "Previous versions of Python provided the AST classes :class:`!ast.Num`, :" "class:`!ast.Str`, :class:`!ast.Bytes`, :class:`!ast.NameConstant` and :class:" @@ -427,15 +613,21 @@ msgid "" "removed in Python 3.14, and their functionality has been replaced with :" "class:`ast.Constant`." msgstr "" +"以前の Python には、AST クラス :class:`!ast.Num`、:class:`!ast.Str`、:class:" +"`!ast.Bytes`、:class:`!ast.NameConstant`、:class:`!ast.Ellipsis` がありました" +"が、Python 3.8 で非推奨になりました。\n" +"これらは Python 3.14 で削除され、その機能は :class:`ast.Constant` に置き換え" +"られました。" -#: ../../library/ast.rst:159 msgid "" "Old classes :class:`!ast.Index` and :class:`!ast.ExtSlice` are still " "available, but they will be removed in future Python releases. In the " "meantime, instantiating them will return an instance of a different class." msgstr "" +"古いクラス :class:`!ast.Index` と :class:`!ast.ExtSlice` はまだ利用できます" +"が、将来の Python で削除されます。\n" +"現在、これらをインスタンス化すると、別のクラスのインスタンスが返されます。" -#: ../../library/ast.rst:166 msgid "" "Previous versions of Python allowed the creation of AST nodes that were " "missing required fields. Similarly, AST node constructors allowed arbitrary " @@ -443,8 +635,11 @@ msgid "" "did not match any of the fields of the AST node. These cases now raise a :" "exc:`TypeError`." msgstr "" +"以前の Python では、必須のフィールドが欠けた AST ノードを作成できました。\n" +"また、AST ノードのコンストラクターに任意のキーワード引数を渡すことができ、" +"ノードのフィールドに対応していなくても属性として設定されていました。\n" +"これらの場合に :exc:`TypeError` を送出するようになりました。" -#: ../../library/ast.rst:173 msgid "" "In the :ref:`grammar above `, the AST node classes that " "correspond to production rules with variants (aka \"sums\") are abstract " @@ -452,6 +647,11 @@ msgid "" "instances of these abstract node classes. This behavior is deprecated and " "will be removed in Python 3.20." msgstr "" +":ref:`上の文法 ` で選択肢のある生成規則 (\"sums\" とも呼ば" +"れます) に対応する AST ノードクラスは、抽象クラスです。\n" +"以前の Python では、これらの抽象ノードクラスのインスタンスを直接作成できまし" +"た。\n" +"この動作は非推奨で、Python 3.20 で削除されます。" #: ../../library/ast.rst:181 msgid "" @@ -463,27 +663,29 @@ msgstr "" "Snakes `__ プロジェクトと" "そのすべての貢献者の成果物をもとにしています。" -#: ../../library/ast.rst:190 msgid "Root nodes" -msgstr "" +msgstr "ルートノード" -#: ../../library/ast.rst:194 msgid "" "A Python module, as with :ref:`file input `. Node type generated " "by :func:`ast.parse` in the default ``\"exec\"`` *mode*." msgstr "" +":ref:`ファイル入力 ` のような Python モジュールを表します。\n" +":func:`ast.parse` の *mode* がデフォルトの ``\"exec\"`` のときに生成される" +"ノード型です。" -#: ../../library/ast.rst:197 msgid "``body`` is a :class:`list` of the module's :ref:`ast-statements`." msgstr "" +"``body`` は、モジュールの :ref:`文 ` の :class:`list` です。" -#: ../../library/ast.rst:199 msgid "" "``type_ignores`` is a :class:`list` of the module's type ignore comments; " "see :func:`ast.parse` for more details." msgstr "" +"``type_ignores`` は、モジュールの型検査を無視するコメントの :class:`list` で" +"す。\n" +"詳細は :func:`ast.parse` を参照してください。" -#: ../../library/ast.rst:202 msgid "" ">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" "Module(\n" @@ -493,37 +695,48 @@ msgid "" " Name(id='x', ctx=Store())],\n" " value=Constant(value=1))])" msgstr "" +">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1))])" -#: ../../library/ast.rst:215 msgid "" "A single Python :ref:`expression input `. Node type " "generated by :func:`ast.parse` when *mode* is ``\"eval\"``." msgstr "" +"Python の単一の :ref:`式入力 ` を表します。\n" +":func:`ast.parse` の *mode* が ``\"eval\"`` のときに生成されるノード型です。" -#: ../../library/ast.rst:218 msgid "" "``body`` is a single node, one of the :ref:`expression types `." msgstr "" +"``body`` は、:ref:`式の型 ` のいずれかの単一ノードです。" -#: ../../library/ast.rst:221 msgid "" ">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" "Expression(\n" " body=Constant(value=123))" msgstr "" +">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value=123))" -#: ../../library/ast.rst:230 msgid "" "A single :ref:`interactive input `, like in :ref:`tut-interac`. " "Node type generated by :func:`ast.parse` when *mode* is ``\"single\"``." msgstr "" +":ref:`対話モード ` などでの、単一の :ref:`対話的な入力 " +"` を表します。\n" +":func:`ast.parse` の *mode* が ``\"single\"`` のときに生成されるノード型で" +"す。" -#: ../../library/ast.rst:233 msgid "``body`` is a :class:`list` of :ref:`statement nodes `." -msgstr "" +msgstr "``body`` は :ref:`文ノード ` の :class:`list` です。" -#: ../../library/ast.rst:235 msgid "" ">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" "Interactive(\n" @@ -537,35 +750,49 @@ msgid "" " Name(id='y', ctx=Store())],\n" " value=Constant(value=2))])" msgstr "" +">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" +"Interactive(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1)),\n" +" Assign(\n" +" targets=[\n" +" Name(id='y', ctx=Store())],\n" +" value=Constant(value=2))])" -#: ../../library/ast.rst:252 msgid "" "A representation of an old-style type comments for functions, as Python " "versions prior to 3.5 didn't support :pep:`484` annotations. Node type " "generated by :func:`ast.parse` when *mode* is ``\"func_type\"``." msgstr "" +"関数の旧形式の型コメントを表します。\n" +"Python 3.5 より前のバージョンでは、:pep:`484` のアノテーションはサポートされ" +"ていませんでした。\n" +":func:`ast.parse` の *mode* が ``\"func_type\"`` のときに生成されるノード型で" +"す。" -#: ../../library/ast.rst:256 msgid "Such type comments would look like this::" -msgstr "" +msgstr "この形式の型コメントは、次のようなものです。 ::" -#: ../../library/ast.rst:258 msgid "" "def sum_two_number(a, b):\n" " # type: (int, int) -> int\n" " return a + b" msgstr "" +"def sum_two_number(a, b):\n" +" # type: (int, int) -> int\n" +" return a + b" -#: ../../library/ast.rst:262 msgid "" "``argtypes`` is a :class:`list` of :ref:`expression nodes `." msgstr "" +"``argtypes`` は :ref:`式ノード ` の :class:`list` です。" -#: ../../library/ast.rst:264 msgid "``returns`` is a single :ref:`expression node `." -msgstr "" +msgstr "``returns`` は単一の :ref:`式ノード ` です。" -#: ../../library/ast.rst:266 msgid "" ">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " "indent=4))\n" @@ -577,12 +804,20 @@ msgid "" " value=Name(id='List'),\n" " slice=Name(id='int')))" msgstr "" +">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " +"indent=4))\n" +"FunctionType(\n" +" argtypes=[\n" +" Name(id='int'),\n" +" Name(id='str')],\n" +" returns=Subscript(\n" +" value=Name(id='List'),\n" +" slice=Name(id='int')))" #: ../../library/ast.rst:281 msgid "Literals" msgstr "リテラル" -#: ../../library/ast.rst:285 msgid "" "A constant value. The ``value`` attribute of the ``Constant`` literal " "contains the Python object it represents. The values represented can be " @@ -590,15 +825,22 @@ msgid "" "class:`complex`, and :class:`bool`, and the constants :data:`None` and :data:" "`Ellipsis`." msgstr "" +"定数値を表します。\n" +"``Constant`` リテラルの ``value`` 属性には、それが表す Python オブジェクトが" +"格納されます。\n" +"表せる値は、:class:`str`、:class:`bytes`、:class:`int`、:class:`float`、:" +"class:`complex`、:class:`bool` のインスタンスと、定数 :data:`None`、:data:" +"`Ellipsis` です。" -#: ../../library/ast.rst:290 msgid "" "The ``kind`` attribute is an optional string. For string literals with a " "``u`` prefix, ``kind`` is set to ``'u'``. For all other constants, ``kind`` " "is ``None``." msgstr "" +"``kind`` 属性は省略可能な文字列です。\n" +"接頭辞 ``u`` のある文字列リテラルでは ``kind`` は ``'u'`` になります。\n" +"それ以外の定数では ``None`` です。" -#: ../../library/ast.rst:294 msgid "" ">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" "Expression(\n" @@ -607,6 +849,12 @@ msgid "" "Expression(\n" " body=Constant(value='hello', kind='u'))" msgstr "" +">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value=123))\n" +">>> print(ast.dump(ast.parse(\"u'hello'\", mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value='hello', kind='u'))" #: ../../library/ast.rst:306 msgid "" @@ -634,17 +882,14 @@ msgstr "``conversion`` は整数です:" msgid "-1: no formatting" msgstr "-1: 書式指定なし" -#: ../../library/ast.rst:315 msgid "97 (``ord('a')``): ``!a`` :func:`ASCII ` formatting" -msgstr "" +msgstr "97 (``ord('a')``): ``!a`` による :func:`ASCII ` 形式への変換" -#: ../../library/ast.rst:316 msgid "114 (``ord('r')``): ``!r`` :func:`repr` formatting" -msgstr "" +msgstr "114 (``ord('r')``): ``!r`` による :func:`repr` 形式への変換" -#: ../../library/ast.rst:317 msgid "115 (``ord('s')``): ``!s`` :func:`string ` formatting" -msgstr "" +msgstr "115 (``ord('s')``): ``!s`` による :func:`文字列 ` への変換" #: ../../library/ast.rst:319 msgid "" @@ -664,7 +909,6 @@ msgstr "" ":class:`FormattedValue` ノードと :class:`Constant` ノードの集まりからなる f-" "string です。" -#: ../../library/ast.rst:329 msgid "" ">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " "indent=4))\n" @@ -686,15 +930,35 @@ msgid "" " values=[\n" " Constant(value='.3')]))]))" msgstr "" +">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=JoinedStr(\n" +" values=[\n" +" Constant(value='sin('),\n" +" FormattedValue(\n" +" value=Name(id='a'),\n" +" conversion=-1),\n" +" Constant(value=') is '),\n" +" FormattedValue(\n" +" value=Call(\n" +" func=Name(id='sin'),\n" +" args=[\n" +" Name(id='a')]),\n" +" conversion=-1,\n" +" format_spec=JoinedStr(\n" +" values=[\n" +" Constant(value='.3')]))]))" -#: ../../library/ast.rst:355 msgid "" "Node representing a template string literal, comprising a series of :class:" "`Interpolation` and :class:`Constant` nodes. These nodes may be any order, " "and do not need to be interleaved." msgstr "" +"テンプレート文字列リテラルを表すノードで、一連の :class:`Interpolation` ノー" +"ドと :class:`Constant` ノードからなります。\n" +"これらのノードはどのような順序でもよく、交互に並ぶ必要はありません。" -#: ../../library/ast.rst:359 msgid "" ">>> expr = ast.parse('t\"{name} finished {place:ordinal}\"', mode='eval')\n" ">>> print(ast.dump(expr, indent=4))\n" @@ -714,57 +978,74 @@ msgid "" " values=[\n" " Constant(value='ordinal')]))]))" msgstr "" +">>> expr = ast.parse('t\"{name} finished {place:ordinal}\"', mode='eval')\n" +">>> print(ast.dump(expr, indent=4))\n" +"Expression(\n" +" body=TemplateStr(\n" +" values=[\n" +" Interpolation(\n" +" value=Name(id='name'),\n" +" str='name',\n" +" conversion=-1),\n" +" Constant(value=' finished '),\n" +" Interpolation(\n" +" value=Name(id='place'),\n" +" str='place',\n" +" conversion=-1,\n" +" format_spec=JoinedStr(\n" +" values=[\n" +" Constant(value='ordinal')]))]))" -#: ../../library/ast.rst:383 msgid "" "Node representing a single interpolation field in a template string literal." -msgstr "" +msgstr "テンプレート文字列リテラル内の一つの補間フィールドを表すノードです。" -#: ../../library/ast.rst:385 msgid "" "``value`` is any expression node (such as a literal, a variable, or a " "function call). This has the same meaning as ``FormattedValue.value``." msgstr "" +"``value`` は任意の式ノード (リテラル、変数、関数呼び出しなど) です。\n" +"``FormattedValue.value`` と同じ意味を持ちます。" -#: ../../library/ast.rst:388 msgid "" "``str`` is a constant containing the text of the interpolation expression." -msgstr "" +msgstr "``str`` は、補間する式のテキストを格納する定数です。" -#: ../../library/ast.rst:390 msgid "" "If ``str`` is set to ``None``, then ``value`` is used to generate code when " "calling :func:`ast.unparse`. This no longer guarantees that the generated " "code is identical to the original and is intended for code generation." msgstr "" +"``str`` を ``None`` に設定すると、:func:`ast.unparse` の呼び出し時には " +"``value`` からコードを生成します。\n" +"この場合、生成したコードが元のコードと同一である保証はなくなり、コード生成の" +"用途を想定しています。" -#: ../../library/ast.rst:396 msgid "-1: no conversion" -msgstr "" +msgstr "-1: 変換なし" -#: ../../library/ast.rst:397 msgid "97 (``ord('a')``): ``!a`` :func:`ASCII ` conversion" -msgstr "" +msgstr "97 (``ord('a')``): ``!a`` による :func:`ASCII ` 形式への変換" -#: ../../library/ast.rst:398 msgid "114 (``ord('r')``): ``!r`` :func:`repr` conversion" -msgstr "" +msgstr "114 (``ord('r')``): ``!r`` による :func:`repr` 形式への変換" -#: ../../library/ast.rst:399 msgid "115 (``ord('s')``): ``!s`` :func:`string ` conversion" -msgstr "" +msgstr "115 (``ord('s')``): ``!s`` による :func:`文字列 ` への変換" -#: ../../library/ast.rst:401 msgid "This has the same meaning as ``FormattedValue.conversion``." -msgstr "" +msgstr "``FormattedValue.conversion`` と同じ意味を持ちます。" -#: ../../library/ast.rst:402 msgid "" "``format_spec`` is a :class:`JoinedStr` node representing the formatting of " "the value, or ``None`` if no format was specified. Both ``conversion`` and " "``format_spec`` can be set at the same time. This has the same meaning as " "``FormattedValue.format_spec``." msgstr "" +"``format_spec`` は、値の書式指定を表す :class:`JoinedStr` ノードです。\n" +"書式指定がなければ ``None`` になります。\n" +"``conversion`` と ``format_spec`` は同時に指定できます。\n" +"``FormattedValue.format_spec`` と同じ意味を持ちます。" #: ../../library/ast.rst:411 msgid "" @@ -777,7 +1058,6 @@ msgstr "" "ば ``(x,y)=something`` のような場合) は :class:`Store` であり、そうでない場合" "は :class:`Load` です。" -#: ../../library/ast.rst:415 msgid "" ">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" "Expression(\n" @@ -794,14 +1074,27 @@ msgid "" " Constant(value=2),\n" " Constant(value=3)]))" msgstr "" - +">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=List(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)]))\n" +">>> print(ast.dump(ast.parse('(1, 2, 3)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Tuple(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)]))" + #: ../../library/ast.rst:435 msgid "A set. ``elts`` holds a list of nodes representing the set's elements." msgstr "" "集合 (set) をあらわします。 ``elts`` は集合の各要素を表現するノードのリストを" "保持します。" -#: ../../library/ast.rst:437 msgid "" ">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" "Expression(\n" @@ -811,6 +1104,13 @@ msgid "" " Constant(value=2),\n" " Constant(value=3)]))" msgstr "" +">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Set(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)]))" #: ../../library/ast.rst:450 msgid "" @@ -830,7 +1130,6 @@ msgstr "" "辞書リテラルで辞書のアンパックを行う場合、展開対象の式が ``values`` リストに" "入り、``keys`` の対応する位置には ``None`` が入ります。" -#: ../../library/ast.rst:458 msgid "" ">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" "Expression(\n" @@ -842,6 +1141,15 @@ msgid "" " Constant(value=1),\n" " Name(id='d')]))" msgstr "" +">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Dict(\n" +" keys=[\n" +" Constant(value='a'),\n" +" None],\n" +" values=[\n" +" Constant(value=1),\n" +" Name(id='d')]))" #: ../../library/ast.rst:472 msgid "Variables" @@ -865,7 +1173,6 @@ msgstr "" "るために使うことができます。変数の参照はこれら3つの場合を区別するためのコンテ" "キストによって与えられます。" -#: ../../library/ast.rst:488 msgid "" ">>> print(ast.dump(ast.parse('a'), indent=4))\n" "Module(\n" @@ -888,6 +1195,26 @@ msgid "" " targets=[\n" " Name(id='a', ctx=Del())])])" msgstr "" +">>> print(ast.dump(ast.parse('a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Name(id='a'))])\n" +"\n" +">>> print(ast.dump(ast.parse('a = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store())],\n" +" value=Constant(value=1))])\n" +"\n" +">>> print(ast.dump(ast.parse('del a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='a', ctx=Del())])])" msgid "" "A ``*var`` variable reference. ``value`` holds the variable, typically a :" @@ -898,7 +1225,6 @@ msgstr "" "class:`Name` ノード、を保持します。この型は ``*args`` を伴う関数呼び出しノー" "ド :class:`Call` を構築する際に使用します。" -#: ../../library/ast.rst:518 msgid "" ">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" "Module(\n" @@ -914,6 +1240,19 @@ msgid "" " ctx=Store())],\n" " value=Name(id='it'))])" msgstr "" +">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Starred(\n" +" value=Name(id='b', ctx=Store()),\n" +" ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='it'))])" #: ../../library/ast.rst:538 msgid "Expressions" @@ -933,7 +1272,6 @@ msgstr "" "`Lambda` ノード :class:`Yield` ノードまたは :class:`YieldFrom` ノードのいずれ" "かを保持します。" -#: ../../library/ast.rst:547 msgid "" ">>> print(ast.dump(ast.parse('-a'), indent=4))\n" "Module(\n" @@ -943,6 +1281,13 @@ msgid "" " op=USub(),\n" " operand=Name(id='a')))])" msgstr "" +">>> print(ast.dump(ast.parse('-a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=UnaryOp(\n" +" op=USub(),\n" +" operand=Name(id='a')))])" #: ../../library/ast.rst:560 msgid "" @@ -960,7 +1305,6 @@ msgstr "" "単項演算の演算子をあらわします。 :class:`Not` は論理否定キーワード ``not`` で" "あり、 :class:`Invert` はビット反転演算子 ``~`` です。" -#: ../../library/ast.rst:572 msgid "" ">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" "Expression(\n" @@ -968,16 +1312,19 @@ msgid "" " op=Not(),\n" " operand=Name(id='x')))" msgstr "" +">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" +"Expression(\n" +" body=UnaryOp(\n" +" op=Not(),\n" +" operand=Name(id='x')))" -#: ../../library/ast.rst:583 msgid "" "A binary operation (like addition or division). ``op`` is the operator, and " "``left`` and ``right`` are any expression nodes." msgstr "" -"(加算や減算のような) 二項演算をあらわします。 ``op`` は演算子、 ``left`` と " -"``right`` は任意の式ツリーのノードです。" +"加算や除算のような二項演算を表します。\n" +"``op`` は演算子で、``left`` と ``right`` は任意の式ノードです。" -#: ../../library/ast.rst:586 msgid "" ">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" "Expression(\n" @@ -986,6 +1333,12 @@ msgid "" " op=Add(),\n" " right=Name(id='y')))" msgstr "" +">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BinOp(\n" +" left=Name(id='x'),\n" +" op=Add(),\n" +" right=Name(id='y')))" #: ../../library/ast.rst:610 msgid "Binary operator tokens." @@ -1007,7 +1360,6 @@ msgstr "" msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." msgstr "``not`` は単項演算 :class:`UnaryOp` のため、ここには含まれません。" -#: ../../library/ast.rst:622 msgid "" ">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" "Expression(\n" @@ -1017,6 +1369,13 @@ msgid "" " Name(id='x'),\n" " Name(id='y')]))" msgstr "" +">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BoolOp(\n" +" op=Or(),\n" +" values=[\n" +" Name(id='x'),\n" +" Name(id='y')]))" #: ../../library/ast.rst:636 msgid "Boolean operator tokens." @@ -1031,7 +1390,6 @@ msgstr "" "2つ以上の値の比較をあらわします。 ``left`` 比較の中の最初の値、``ops`` は演算" "子のリスト、 ``comparators`` は2つ目以降の値のリストです。" -#: ../../library/ast.rst:645 msgid "" ">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" "Expression(\n" @@ -1044,6 +1402,16 @@ msgid "" " Name(id='a'),\n" " Constant(value=10)]))" msgstr "" +">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Compare(\n" +" left=Constant(value=1),\n" +" ops=[\n" +" LtE(),\n" +" Lt()],\n" +" comparators=[\n" +" Name(id='a'),\n" +" Constant(value=10)]))" #: ../../library/ast.rst:670 msgid "Comparison operator tokens." @@ -1060,19 +1428,18 @@ msgstr "" msgid "``args`` holds a list of the arguments passed by position." msgstr "``args`` は位置引数のリストを保持します。" -#: ../../library/ast.rst:679 msgid "" "``keywords`` holds a list of :class:`.keyword` objects representing " "arguments passed by keyword." msgstr "" +"``keywords`` は、キーワードで渡す引数を表す :class:`.keyword` オブジェクトの" +"リストを保持します。" -#: ../../library/ast.rst:682 msgid "" "The ``args`` and ``keywords`` arguments are optional and default to empty " "lists." -msgstr "" +msgstr "``args`` と ``keywords`` 引数は省略可能で、デフォルトは空リストです。" -#: ../../library/ast.rst:684 msgid "" ">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), " "indent=4))\n" @@ -1090,6 +1457,21 @@ msgid "" " keyword(\n" " value=Name(id='e'))]))" msgstr "" +">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=Call(\n" +" func=Name(id='func'),\n" +" args=[\n" +" Name(id='a'),\n" +" Starred(\n" +" value=Name(id='d'))],\n" +" keywords=[\n" +" keyword(\n" +" arg='b',\n" +" value=Name(id='c')),\n" +" keyword(\n" +" value=Name(id='e'))]))" #: ../../library/ast.rst:704 msgid "" @@ -1107,7 +1489,6 @@ msgstr "" "``a if b else c`` のような式をあらわします。各フィールドは単一のノードを保持" "します。以下の例では、3つの式ノードはすべて :class:`Name` ノードです。" -#: ../../library/ast.rst:713 msgid "" ">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" "Expression(\n" @@ -1116,6 +1497,12 @@ msgid "" " body=Name(id='a'),\n" " orelse=Name(id='c')))" msgstr "" +">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" +"Expression(\n" +" body=IfExp(\n" +" test=Name(id='b'),\n" +" body=Name(id='a'),\n" +" orelse=Name(id='c')))" #: ../../library/ast.rst:725 msgid "" @@ -1129,7 +1516,6 @@ msgstr "" "はその属性がどのように振る舞うかに応じて :class:`Load`、 :class:`Store` また" "は :class:`Del` のいずれかです。" -#: ../../library/ast.rst:730 msgid "" ">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" "Expression(\n" @@ -1137,6 +1523,11 @@ msgid "" " value=Name(id='snake'),\n" " attr='colour'))" msgstr "" +">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Attribute(\n" +" value=Name(id='snake'),\n" +" attr='colour'))" #: ../../library/ast.rst:741 msgid "" @@ -1150,7 +1541,6 @@ msgstr "" "であってもよい :class:`Assign` ノードと異なり、このノードの場合は ``target`` " "と ``value`` の両方が単一のノードでなければなりません。" -#: ../../library/ast.rst:746 msgid "" ">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" "Expression(\n" @@ -1158,6 +1548,11 @@ msgid "" " target=Name(id='x', ctx=Store()),\n" " value=Constant(value=4)))" msgstr "" +">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=NamedExpr(\n" +" target=Name(id='x', ctx=Store()),\n" +" value=Constant(value=4)))" #: ../../library/ast.rst:757 msgid "Subscripting" @@ -1176,7 +1571,6 @@ msgstr "" "ん。 ``ctx`` は要素の参照により実行されるアクションに応じて :class:`Load`、 :" "class:`Store` または :class:`Del` のいずれかです。" -#: ../../library/ast.rst:767 msgid "" ">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" "Expression(\n" @@ -1189,6 +1583,16 @@ msgid "" " upper=Constant(value=2)),\n" " Constant(value=3)])))" msgstr "" +">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l'),\n" +" slice=Tuple(\n" +" elts=[\n" +" Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2)),\n" +" Constant(value=3)])))" #: ../../library/ast.rst:783 msgid "" @@ -1200,7 +1604,6 @@ msgstr "" "わします。 :class:`Subscript` の *slice* フィールドでの直接指定か、または :" "class:`Tuple` の要素として指定する場合のみ利用可能です。" -#: ../../library/ast.rst:787 msgid "" ">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" "Expression(\n" @@ -1210,6 +1613,13 @@ msgid "" " lower=Constant(value=1),\n" " upper=Constant(value=2))))" msgstr "" +">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l'),\n" +" slice=Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2))))" #: ../../library/ast.rst:799 msgid "Comprehensions" @@ -1225,18 +1635,18 @@ msgstr "" "たは ``key`` と ``value``) は各要素として評価される部品をあらわす単一のノード" "です。" -#: ../../library/ast.rst:810 msgid "" "For dictionary comprehensions using unpacking, for example ``{**item for " "item in items}``, the expression to be expanded goes in ``key`` and " "``value`` is ``None``." msgstr "" +"``{**item for item in items}`` のようにアンパックを使う辞書内包表記では、展開" +"する式が ``key`` に入り、``value`` は ``None`` になります。" #: ../../library/ast.rst:814 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "``generators`` は :class:`comprehension` ノードのリストです。" -#: ../../library/ast.rst:816 msgid "" ">>> print(ast.dump(\n" "... ast.parse('[x for x in numbers]', mode='eval'),\n" @@ -1279,6 +1689,46 @@ msgid "" " iter=Name(id='numbers'),\n" " is_async=0)]))" msgstr "" +">>> print(ast.dump(\n" +"... ast.parse('[x for x in numbers]', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='x'),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers'),\n" +" is_async=0)]))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x: x**2 for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=DictComp(\n" +" key=Name(id='x'),\n" +" value=BinOp(\n" +" left=Name(id='x'),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers'),\n" +" is_async=0)]))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=SetComp(\n" +" elt=Name(id='x'),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers'),\n" +" is_async=0)]))" #: ../../library/ast.rst:862 msgid "" @@ -1300,7 +1750,6 @@ msgstr "" "``is_async`` は内包表記が非同期であることを示します (``async for`` を " "``for`` の代わりに使います)。値は整数です (0 または 1)。" -#: ../../library/ast.rst:870 msgid "" ">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " "mode='eval'),\n" @@ -1360,6 +1809,63 @@ msgid "" " iter=Name(id='soc'),\n" " is_async=1)]))" msgstr "" +">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " +"mode='eval'),\n" +"... indent=4)) # 一つの内包表記に複数の for 節。\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Call(\n" +" func=Name(id='ord'),\n" +" args=[\n" +" Name(id='c')]),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='line', ctx=Store()),\n" +" iter=Name(id='file'),\n" +" is_async=0),\n" +" comprehension(\n" +" target=Name(id='c', ctx=Store()),\n" +" iter=Name(id='line'),\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', " +"mode='eval'),\n" +"... indent=4)) # ジェネレーター式\n" +"Expression(\n" +" body=GeneratorExp(\n" +" elt=BinOp(\n" +" left=Name(id='n'),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='n', ctx=Store()),\n" +" iter=Name(id='it'),\n" +" ifs=[\n" +" Compare(\n" +" left=Name(id='n'),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" Compare(\n" +" left=Name(id='n'),\n" +" ops=[\n" +" Lt()],\n" +" comparators=[\n" +" Constant(value=10)])],\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('[i async for i in soc]', mode='eval'),\n" +"... indent=4)) # 非同期内包表記\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='i'),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='i', ctx=Store()),\n" +" iter=Name(id='soc'),\n" +" is_async=1)]))" #: ../../library/ast.rst:932 msgid "Statements" @@ -1390,7 +1896,6 @@ msgstr "" "``type_comment`` はコメントとして型アノテーションをあらわすオプション文字列で" "す。" -#: ../../library/ast.rst:946 msgid "" ">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment\n" "Module(\n" @@ -1413,25 +1918,54 @@ msgid "" " ctx=Store())],\n" " value=Name(id='c'))])" msgstr "" - -#: ../../library/ast.rst:972 -msgid "" -"An assignment with a type annotation. ``target`` is a single node and can be " -"a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. " -"``annotation`` is the annotation, such as a :class:`Constant` or :class:" -"`Name` node. ``value`` is a single optional node." -msgstr "" - -#: ../../library/ast.rst:977 -msgid "" -"``simple`` is always either 0 (indicating a \"complex\" target) or 1 " -"(indicating a \"simple\" target). A \"simple\" target consists solely of a :" -"class:`Name` node that does not appear between parentheses; all other " -"targets are considered complex. Only simple targets appear in the :attr:" -"`~object.__annotations__` dictionary of modules and classes." +">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # 多重代入\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" value=Constant(value=1))])\n" +"\n" +">>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # アンパック\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='c'))])" + +msgid "" +"An assignment with a type annotation. ``target`` is a single node and can be " +"a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. " +"``annotation`` is the annotation, such as a :class:`Constant` or :class:" +"`Name` node. ``value`` is a single optional node." +msgstr "" +"型アノテーションを伴う代入です。\n" +"``target`` は単一のノードで、:class:`Name`、:class:`Attribute`、:class:" +"`Subscript` のいずれかです。\n" +"``annotation`` はアノテーションを表す :class:`Constant` や :class:`Name` など" +"のノードです。\n" +"``value`` は省略可能な単一のノードです。" + +msgid "" +"``simple`` is always either 0 (indicating a \"complex\" target) or 1 " +"(indicating a \"simple\" target). A \"simple\" target consists solely of a :" +"class:`Name` node that does not appear between parentheses; all other " +"targets are considered complex. Only simple targets appear in the :attr:" +"`~object.__annotations__` dictionary of modules and classes." msgstr "" +"``simple`` は常に 0 (「複雑な」代入先) または 1 (「単純な」代入先) のいずれか" +"です。\n" +"「単純な」代入先は、括弧で囲まれていない :class:`Name` ノードだけからなり、そ" +"れ以外はすべて複雑な代入先とみなされます。\n" +"モジュールやクラスの :attr:`~object.__annotations__` 辞書に含まれるのは、単純" +"な代入先だけです。" -#: ../../library/ast.rst:983 msgid "" ">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" "Module(\n" @@ -1474,6 +2008,46 @@ msgid "" " annotation=Name(id='int'),\n" " simple=0)])" msgstr "" +">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='c', ctx=Store()),\n" +" annotation=Name(id='int'),\n" +" simple=1)])\n" +"\n" +">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # 括弧を伴うアノテー" +"ション\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='a', ctx=Store()),\n" +" annotation=Name(id='int'),\n" +" value=Constant(value=1),\n" +" simple=0)])\n" +"\n" +">>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # 属性のアノテーション\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Attribute(\n" +" value=Name(id='a'),\n" +" attr='b',\n" +" ctx=Store()),\n" +" annotation=Name(id='int'),\n" +" simple=0)])\n" +"\n" +">>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # 添字付きのアノテー" +"ション\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Subscript(\n" +" value=Name(id='a'),\n" +" slice=Constant(value=1),\n" +" ctx=Store()),\n" +" annotation=Name(id='int'),\n" +" simple=0)])" #: ../../library/ast.rst:1027 msgid "" @@ -1495,7 +2069,6 @@ msgstr "" ":class:`Assign` と異なり、 ``target`` 属性は class :class:`Tuple` や :class:" "`List` であってはいけません。" -#: ../../library/ast.rst:1035 msgid "" ">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" "Module(\n" @@ -1505,6 +2078,13 @@ msgid "" " op=Add(),\n" " value=Constant(value=2))])" msgstr "" +">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" +"Module(\n" +" body=[\n" +" AugAssign(\n" +" target=Name(id='x', ctx=Store()),\n" +" op=Add(),\n" +" value=Constant(value=2))])" #: ../../library/ast.rst:1048 msgid "" @@ -1517,7 +2097,6 @@ msgstr "" "指定します。 ``cause`` はオプションで、 ``raise x from y`` の ``y`` にあたり" "ます。" -#: ../../library/ast.rst:1052 msgid "" ">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" "Module(\n" @@ -1526,6 +2105,12 @@ msgid "" " exc=Name(id='x'),\n" " cause=Name(id='y'))])" msgstr "" +">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Raise(\n" +" exc=Name(id='x'),\n" +" cause=Name(id='y'))])" #: ../../library/ast.rst:1064 msgid "" @@ -1535,7 +2120,6 @@ msgstr "" "アサーションです。 ``test`` は :class:`Compare` ノードなどのような条件を保持" "します。 ``msg`` は失敗した時のメッセージを保持します。" -#: ../../library/ast.rst:1067 msgid "" ">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" "Module(\n" @@ -1544,6 +2128,12 @@ msgid "" " test=Name(id='x'),\n" " msg=Name(id='y'))])" msgstr "" +">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assert(\n" +" test=Name(id='x'),\n" +" msg=Name(id='y'))])" #: ../../library/ast.rst:1079 msgid "" @@ -1553,7 +2143,6 @@ msgstr "" "``del`` 文をあらわします。 ``targets`` は :class:`Name`, :class:" "`Attribute`, :class:`Subscript` などのノードのリストです。" -#: ../../library/ast.rst:1082 msgid "" ">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" "Module(\n" @@ -1564,28 +2153,40 @@ msgid "" " Name(id='y', ctx=Del()),\n" " Name(id='z', ctx=Del())])])" msgstr "" +">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='x', ctx=Del()),\n" +" Name(id='y', ctx=Del()),\n" +" Name(id='z', ctx=Del())])])" #: ../../library/ast.rst:1096 msgid "A ``pass`` statement." msgstr "``pass`` 文をあらわします。" -#: ../../library/ast.rst:1098 msgid "" ">>> print(ast.dump(ast.parse('pass'), indent=4))\n" "Module(\n" " body=[\n" " Pass()])" msgstr "" +">>> print(ast.dump(ast.parse('pass'), indent=4))\n" +"Module(\n" +" body=[\n" +" Pass()])" -#: ../../library/ast.rst:1108 msgid "" "A :ref:`type alias ` created through the :keyword:`type` " "statement. ``name`` is the name of the alias, ``type_params`` is a list of :" "ref:`type parameters `, and ``value`` is the value of the " "type alias." msgstr "" +":keyword:`type` 文で作成した :ref:`型エイリアス ` です。\n" +"``name`` はエイリアスの名前、``type_params`` は :ref:`型パラメーター ` のリスト、``value`` は型エイリアスの値です。" -#: ../../library/ast.rst:1113 msgid "" ">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" "Module(\n" @@ -1594,6 +2195,12 @@ msgid "" " name=Name(id='Alias', ctx=Store()),\n" " value=Name(id='int'))])" msgstr "" +">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" value=Name(id='int'))])" #: ../../library/ast.rst:1124 msgid "" @@ -1610,7 +2217,6 @@ msgstr "インポート" msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "インポート文です。 ``names`` は :class:`alias` ノードのリストです。" -#: ../../library/ast.rst:1134 msgid "" ">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" "Module(\n" @@ -1622,6 +2228,15 @@ msgid "" " alias(name='z')],\n" " is_lazy=0)])" msgstr "" +">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Import(\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')],\n" +" is_lazy=0)])" #: ../../library/ast.rst:1149 msgid "" @@ -1635,7 +2250,6 @@ msgstr "" "のような構文の場合は ``None`` を指定します。 ``level`` は相対インポートのレベ" "ルを表す整数を保持します (0 は絶対インポートを意味します)。" -#: ../../library/ast.rst:1154 msgid "" ">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" "Module(\n" @@ -1649,6 +2263,17 @@ msgid "" " level=0,\n" " is_lazy=0)])" msgstr "" +">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='y',\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')],\n" +" level=0,\n" +" is_lazy=0)])" #: ../../library/ast.rst:1171 msgid "" @@ -1658,7 +2283,6 @@ msgstr "" "いずれのパラメータも名前をあらわす生の文字列です。 ``asname`` は標準の名前を" "使う場合は ``None`` を指定できます。" -#: ../../library/ast.rst:1174 msgid "" ">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" "Module(\n" @@ -1671,6 +2295,16 @@ msgid "" " level=2,\n" " is_lazy=0)])" msgstr "" +">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='foo.bar',\n" +" names=[\n" +" alias(name='a', asname='b'),\n" +" alias(name='c')],\n" +" level=2,\n" +" is_lazy=0)])" #: ../../library/ast.rst:1188 msgid "Control flow" @@ -1701,7 +2335,6 @@ msgstr "" "``elif`` 節は AST において固有の表現を持たず、先行する節をあらわすノードの " "``orelse`` セクションに追加の :class:`If` ノードとして現れます。" -#: ../../library/ast.rst:1203 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... if x:\n" @@ -1728,8 +2361,31 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... if x:\n" +"... ...\n" +"... elif y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" If(\n" +" test=Name(id='x'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" If(\n" +" test=Name(id='y'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1233 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" @@ -1738,8 +2394,16 @@ msgid "" "Those in ``orelse`` are executed if the loop finishes normally, rather than " "via a ``break`` statement." msgstr "" +"``for`` ループです。\n" +"``target`` はループの代入先となる変数を、単一の :class:`Name`、:class:" +"`Tuple`、:class:`List`、:class:`Attribute`、:class:`Subscript` のいずれかの" +"ノードとして保持します。\n" +"``iter`` は繰り返しの対象となるオブジェクトを、同じく単一のノードとして保持し" +"ます。\n" +"``body`` と ``orelse`` は実行するノードのリストを保持します。\n" +"``orelse`` 内のノードは、``break`` 文によらずループが正常に終了した場合に実行" +"されます。" -#: ../../library/ast.rst:1244 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... for x in y:\n" @@ -1759,6 +2423,23 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... for x in y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='y'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" #: ../../library/ast.rst:1267 msgid "" @@ -1768,7 +2449,6 @@ msgstr "" "``while`` ループです。 ``test`` は :class:`Compare` のような条件をあらわす" "ノードを保持します。" -#: ../../library/ast.rst:1270 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... while x:\n" @@ -1787,12 +2467,27 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... while x:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" While(\n" +" test=Name(id='x'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" #: ../../library/ast.rst:1293 msgid "The ``break`` and ``continue`` statements." msgstr "``break`` 文および ``continue`` 文です。" -#: ../../library/ast.rst:1295 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... for a in b:\n" @@ -1820,6 +2515,31 @@ msgid "" " orelse=[\n" " Continue()])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... for a in b:\n" +"... if a > 5:\n" +"... break\n" +"... else:\n" +"... continue\n" +"...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='a', ctx=Store()),\n" +" iter=Name(id='b'),\n" +" body=[\n" +" If(\n" +" test=Compare(\n" +" left=Name(id='a'),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" body=[\n" +" Break()],\n" +" orelse=[\n" +" Continue()])])])" #: ../../library/ast.rst:1326 msgid "" @@ -1829,7 +2549,6 @@ msgstr "" "``try`` ブロックです。 :class:`ExceptHandler` ノードのリストである " "``handlers`` を除き、全ての属性はそれぞれの節で実行するノードのリストです。" -#: ../../library/ast.rst:1329 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... try:\n" @@ -1868,15 +2587,52 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except Exception:\n" +"... ...\n" +"... except OtherException as e:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... finally:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" ExceptHandler(\n" +" type=Name(id='OtherException'),\n" +" name='e',\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" finalbody=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" -#: ../../library/ast.rst:1371 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " "``handlers`` are interpreted as ``except*`` blocks rather than ``except``." msgstr "" +"``except*`` 節を伴う ``try`` ブロックです。\n" +"属性は :class:`Try` と同じですが、``handlers`` 内の :class:`ExceptHandler` " +"ノードは ``except`` ではなく ``except*`` ブロックとして解釈されます。" -#: ../../library/ast.rst:1375 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... try:\n" @@ -1897,10 +2653,28 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" - -#: ../../library/ast.rst:1400 -msgid "" -"A single ``except`` clause. ``type`` is the exception type it will match, " +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except* Exception:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TryStar(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" + +#: ../../library/ast.rst:1400 +msgid "" +"A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " "clause). ``name`` is a raw string for the name to hold the exception, or " "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." @@ -1911,7 +2685,6 @@ msgstr "" "持する変数の名前をあらわす生の文字列で、 ``as foo`` を持たない節の場合は " "``None`` を指定します。 ``body`` はノードのリストです。" -#: ../../library/ast.rst:1405 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... try:\n" @@ -1934,6 +2707,26 @@ msgid "" " body=[\n" " Pass()])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... try:\n" +"... a + 1\n" +"... except TypeError:\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=BinOp(\n" +" left=Name(id='a'),\n" +" op=Add(),\n" +" right=Constant(value=1)))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='TypeError'),\n" +" body=[\n" +" Pass()])])])" #: ../../library/ast.rst:1431 msgid "" @@ -1958,7 +2751,6 @@ msgstr "" "class:`Tuple` または :class:`List` のいずれかのノードか、または、この部分が不" "要な場合は ``None`` を設定します。" -#: ../../library/ast.rst:1446 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... with a as b, c as d:\n" @@ -1982,39 +2774,65 @@ msgid "" " Name(id='b'),\n" " Name(id='d')]))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... with a as b, c as d:\n" +"... something(b, d)\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" With(\n" +" items=[\n" +" withitem(\n" +" context_expr=Name(id='a'),\n" +" optional_vars=Name(id='b', ctx=Store())),\n" +" withitem(\n" +" context_expr=Name(id='c'),\n" +" optional_vars=Name(id='d', ctx=Store()))],\n" +" body=[\n" +" Expr(\n" +" value=Call(\n" +" func=Name(id='something'),\n" +" args=[\n" +" Name(id='b'),\n" +" Name(id='d')]))])])" -#: ../../library/ast.rst:1472 msgid "Pattern matching" -msgstr "" +msgstr "パターンマッチ" -#: ../../library/ast.rst:1477 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " "iterable of :class:`match_case` nodes with the different cases." msgstr "" +"``match`` 文です。\n" +"``subject`` はマッチ対象 (各 case と照合するオブジェクト) を保持し、" +"``cases`` は各 case を表す :class:`match_case` ノードのイテラブルを保持しま" +"す。" -#: ../../library/ast.rst:1485 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" "`AST` nodes produced for patterns differ from those produced for " "expressions, even when they share the same syntax." msgstr "" +"``match`` 文の一つの case パターンです。\n" +"``pattern`` は、対象と照合するパターンを保持します。\n" +"構文が同じでも、パターン用に生成される :class:`AST` ノードは、式用に生成され" +"るノードとは異なります。" -#: ../../library/ast.rst:1490 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." msgstr "" +"``guard`` 属性は、パターンが対象にマッチした場合に評価する式を保持します。" -#: ../../library/ast.rst:1493 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." msgstr "" +"``body`` は、パターンがマッチし、ガード式の評価結果が真だった場合に実行する" +"ノードのリストを保持します。" -#: ../../library/ast.rst:1496 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2048,16 +2866,50 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] if x>0:\n" +"... ...\n" +"... case tuple():\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" guard=Compare(\n" +" left=Name(id='x'),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=0)]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='tuple')),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1534 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " "match statement documentation. This pattern succeeds if the match subject is " "equal to the evaluated value." msgstr "" +"等価比較を行うリテラルパターンまたは値パターンです。\n" +"``value`` は式ノードです。\n" +"指定できる値ノードは、match 文のドキュメントに記載されたとおりに制限されま" +"す。\n" +"マッチ対象が、式を評価した値と等しければ成功します。" -#: ../../library/ast.rst:1539 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2076,15 +2928,33 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case \"Relevant\":\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchValue(\n" +" value=Constant(value='Relevant')),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1562 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " "pattern succeeds if the match subject is the given constant." msgstr "" +"同一性を比較するリテラルパターンです。\n" +"``value`` は比較対象のシングルトンで、``None``、``True``、``False`` のいずれ" +"かです。\n" +"マッチ対象がこの定数と同一のオブジェクトなら成功します。" -#: ../../library/ast.rst:1566 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2102,16 +2972,34 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case None:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSingleton(value=None),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1588 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " "variable length sequence if one of the subpatterns is a ``MatchStar`` node, " "otherwise matches a fixed length sequence." msgstr "" +"シーケンスパターンです。\n" +"``patterns`` は、対象がシーケンスである場合にその各要素と照合するパターンを保" +"持します。\n" +"サブパターンの一つが ``MatchStar`` ノードなら可変長のシーケンスに、それ以外な" +"ら固定長のシーケンスにマッチします。" -#: ../../library/ast.rst:1593 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2134,16 +3022,37 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [1, 2]:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1620 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " "sequence elements is bound to that name if the overall sequence pattern is " "successful." msgstr "" +"可変長のシーケンスパターンで、シーケンスの残りの部分にマッチします。\n" +"``name`` が ``None`` でなければ、シーケンスパターン全体が成功したときに、残り" +"の要素を含むリストをその名前に束縛します。" -#: ../../library/ast.rst:1624 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2176,8 +3085,37 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [1, 2, *rest]:\n" +"... ...\n" +"... case [*_]:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2)),\n" +" MatchStar(name='rest')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchStar()]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1661 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -2185,8 +3123,13 @@ msgid "" "elements. Permitted key expressions are restricted as described in the match " "statement documentation." msgstr "" +"マッピングパターンです。\n" +"``keys`` は式ノードのシーケンス、``patterns`` はそれに対応するパターンノード" +"のシーケンスです。\n" +"``rest`` は省略可能な名前で、マッピングの残りの要素を取得する場合に指定しま" +"す。\n" +"キーに使える式は、match 文のドキュメントに記載されたとおりに制限されます。" -#: ../../library/ast.rst:1667 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -2194,8 +3137,11 @@ msgid "" "dict containing the remaining mapping elements is bound to that name if the " "overall mapping pattern is successful." msgstr "" +"対象がマッピングで、すべてのキー式の評価結果がそのマッピングに存在し、各キー" +"に対応する値が対応するサブパターンにマッチすれば成功します。\n" +"``rest`` が ``None`` でなければ、マッピングパターン全体が成功したときに、残り" +"の要素を含む辞書をその名前に束縛します。" -#: ../../library/ast.rst:1673 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2226,8 +3172,35 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case {1: _, 2: _}:\n" +"... ...\n" +"... case {**rest}:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchMapping(\n" +" keys=[\n" +" Constant(value=1),\n" +" Constant(value=2)],\n" +" patterns=[\n" +" MatchAs(),\n" +" MatchAs()]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchMapping(rest='rest'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1708 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -2237,22 +3210,33 @@ msgid "" "the corresponding patterns (specified as keyword values in the class " "pattern)." msgstr "" +"クラスパターンです。\n" +"``cls`` は照合に使うクラスを表す式です。\n" +"``patterns`` はパターンノードのシーケンスで、クラスが定義するパターンマッチ用" +"の属性の並びと照合します。\n" +"``kwd_attrs`` は追加で照合する属性のシーケンス (クラスパターンのキーワード引" +"数の名前)、``kwd_patterns`` はそれらに対応するパターン (クラスパターンのキー" +"ワード引数の値) です。" -#: ../../library/ast.rst:1715 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" +"対象が指定したクラスのインスタンスで、すべての位置パターンがクラスで定義した" +"対応する属性にマッチし、キーワードで指定した属性もそれぞれ対応するパターンに" +"マッチすれば成功します。" -#: ../../library/ast.rst:1719 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" +"クラスに ``self`` を返すプロパティを定義すると、パターンノードをインスタンス" +"自体と照合できます。\n" +"match 文のドキュメントで説明しているように、一部の組み込み型も同じように照合" +"されます。" -#: ../../library/ast.rst:1723 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2295,24 +3279,95 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case Point2D(0, 0):\n" +"... ...\n" +"... case Point3D(x=0, y=0, z=0):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point2D'),\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point3D'),\n" +" kwd_attrs=[\n" +" 'x',\n" +" 'y',\n" +" 'z'],\n" +" kwd_patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1770 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " "pattern is ``None``, the node represents a capture pattern (i.e a bare name) " "and will always succeed." msgstr "" +"AS パターン、キャプチャパターン、またはワイルドカードパターンです。\n" +"``pattern`` は、対象と照合するパターンを保持します。\n" +"``pattern`` が ``None`` の場合、このノードはキャプチャパターン (名前だけのパ" +"ターン) を表し、常に成功します。" -#: ../../library/ast.rst:1775 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" - -#: ../../library/ast.rst:1779 -msgid "" +"``name`` 属性は、パターンが成功した場合に束縛する名前を保持します。\n" +"``name`` が ``None`` の場合は ``pattern`` も ``None`` でなければならず、ノー" +"ドはワイルドカードパターンを表します。" + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] as y:\n" +"... ...\n" +"... case _:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchAs(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" name='y'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchAs(),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" "... case [x] as y:\n" @@ -2339,9 +3394,7 @@ msgid "" " body=[\n" " Expr(\n" " value=Constant(value=Ellipsis))])])])" -msgstr "" -#: ../../library/ast.rst:1812 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -2349,8 +3402,12 @@ msgid "" "``patterns`` attribute contains a list of match pattern nodes that will be " "matched against the subject." msgstr "" +"OR パターンです。\n" +"各サブパターンを順に対象と照合し、どれか一つが成功すれば OR パターン全体が成" +"功します。\n" +"どのサブパターンも成功しなければ失敗します。\n" +"``patterns`` 属性は、対象と照合するパターンノードのリストを保持します。" -#: ../../library/ast.rst:1818 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2373,18 +3430,37 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] | (y):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x'),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchOr(\n" +" patterns=[\n" +" MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" MatchAs(name='y')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -#: ../../library/ast.rst:1845 msgid "Type annotations" -msgstr "" +msgstr "型アノテーション" -#: ../../library/ast.rst:1849 msgid "" "A ``# type: ignore`` comment located at *lineno*. *tag* is the optional tag " "specified by the form ``# type: ignore ``." msgstr "" +"*lineno* 行にある ``# type: ignore`` コメントです。\n" +"*tag* は、``# type: ignore `` の形式で指定する省略可能なタグです。" -#: ../../library/ast.rst:1852 msgid "" ">>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), " "indent=4))\n" @@ -2408,25 +3484,47 @@ msgid "" " type_ignores=[\n" " TypeIgnore(lineno=1, tag='[assignment]')])" msgstr "" +">>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1))],\n" +" type_ignores=[\n" +" TypeIgnore(lineno=1, tag='')])\n" +">>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', " +"type_comments=True), indent=4))\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='x', ctx=Store()),\n" +" annotation=Name(id='bool'),\n" +" value=Constant(value=1),\n" +" simple=1)],\n" +" type_ignores=[\n" +" TypeIgnore(lineno=1, tag='[assignment]')])" -#: ../../library/ast.rst:1875 msgid "" ":class:`!TypeIgnore` nodes are not generated when the *type_comments* " "parameter is set to ``False`` (default). See :func:`ast.parse` for more " "details." msgstr "" +"*type_comments* パラメーターが ``False`` (デフォルト) の場合、:class:`!" +"TypeIgnore` ノードは生成されません。\n" +"詳細は :func:`ast.parse` を参照してください。" -#: ../../library/ast.rst:1883 msgid "Type parameters" -msgstr "" +msgstr "型パラメーター" -#: ../../library/ast.rst:1885 msgid "" ":ref:`Type parameters ` can exist on classes, functions, and " "type aliases." msgstr "" +"クラス、関数、型エイリアスには :ref:`型パラメーター ` を定義でき" +"ます。" -#: ../../library/ast.rst:1890 msgid "" "A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " "``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" @@ -2434,8 +3532,13 @@ msgid "" "``default_value`` is the default value; if the :class:`!TypeVar` has no " "default, this attribute will be set to ``None``." msgstr "" +":class:`typing.TypeVar` を表します。\n" +"``name`` は型変数の名前です。\n" +"``bound`` は、指定されていれば上限または制約を保持します。\n" +":class:`Tuple` なら制約、それ以外なら上限を表します。\n" +"``default_value`` はデフォルト値で、:class:`!TypeVar` にデフォルトがなければ " +"``None`` になります。" -#: ../../library/ast.rst:1896 msgid "" ">>> print(ast.dump(ast.parse(\"type Alias[T: int = bool] = list[T]\"), " "indent=4))\n" @@ -2452,20 +3555,34 @@ msgid "" " value=Name(id='list'),\n" " slice=Name(id='T')))])" msgstr "" +">>> print(ast.dump(ast.parse(\"type Alias[T: int = bool] = list[T]\"), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVar(\n" +" name='T',\n" +" bound=Name(id='int'),\n" +" default_value=Name(id='bool'))],\n" +" value=Subscript(\n" +" value=Name(id='list'),\n" +" slice=Name(id='T')))])" -#: ../../library/ast.rst:1914 ../../library/ast.rst:1946 -#: ../../library/ast.rst:1973 msgid "Added the *default_value* parameter." -msgstr "" +msgstr "*default_value* パラメーターが追加されました。" -#: ../../library/ast.rst:1919 msgid "" "A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " "specification. ``default_value`` is the default value; if the :class:`!" "ParamSpec` has no default, this attribute will be set to ``None``." msgstr "" +":class:`typing.ParamSpec` を表します。\n" +"``name`` はパラメーター仕様の名前です。\n" +"``default_value`` はデフォルト値で、:class:`!ParamSpec` にデフォルトがなけれ" +"ば ``None`` になります。" -#: ../../library/ast.rst:1923 msgid "" ">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, " "int]\"), indent=4))\n" @@ -2487,15 +3604,36 @@ msgid "" " Name(id='P'),\n" " Name(id='int')])))])" msgstr "" +">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, " +"int]\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" ParamSpec(\n" +" name='P',\n" +" default_value=List(\n" +" elts=[\n" +" Name(id='int'),\n" +" Name(id='str')]))],\n" +" value=Subscript(\n" +" value=Name(id='Callable'),\n" +" slice=Tuple(\n" +" elts=[\n" +" Name(id='P'),\n" +" Name(id='int')])))])" -#: ../../library/ast.rst:1951 msgid "" "A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " "tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` " "has no default, this attribute will be set to ``None``." msgstr "" +":class:`typing.TypeVarTuple` を表します。\n" +"``name`` は型変数タプルの名前です。\n" +"``default_value`` はデフォルト値で、:class:`!TypeVarTuple` にデフォルトがなけ" +"れば ``None`` になります。" -#: ../../library/ast.rst:1955 msgid "" ">>> print(ast.dump(ast.parse(\"type Alias[*Ts = ()] = tuple[*Ts]\"), " "indent=4))\n" @@ -2512,6 +3650,20 @@ msgid "" " Starred(\n" " value=Name(id='Ts'))])))])" msgstr "" +">>> print(ast.dump(ast.parse(\"type Alias[*Ts = ()] = tuple[*Ts]\"), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVarTuple(name='Ts', default_value=Tuple())],\n" +" value=Subscript(\n" +" value=Name(id='tuple'),\n" +" slice=Tuple(\n" +" elts=[\n" +" Starred(\n" +" value=Name(id='Ts'))])))])" #: ../../library/ast.rst:1977 msgid "Function and class definitions" @@ -2546,14 +3698,12 @@ msgstr "" msgid "``returns`` is the return annotation." msgstr "``returns`` は戻り値に対する注釈です。" -#: ../../library/ast.rst:1989 ../../library/ast.rst:2152 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "" +"``type_params`` は :ref:`型パラメーター ` のリストです。" -#: ../../library/ast.rst:1995 ../../library/ast.rst:2179 -#: ../../library/ast.rst:2190 msgid "Added ``type_params``." -msgstr "" +msgstr "``type_params`` が追加されました。" #: ../../library/ast.rst:2001 msgid "" @@ -2563,7 +3713,6 @@ msgstr "" "``lambda`` は式の中で使うことができる最小限の関数定義です。 :class:" "`FunctionDef` ノードと異なり、 ``body`` は単一のノードとなります。" -#: ../../library/ast.rst:2004 msgid "" ">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" "Module(\n" @@ -2576,6 +3725,16 @@ msgid "" " arg(arg='y')]),\n" " body=Constant(value=Ellipsis)))])" msgstr "" +">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Lambda(\n" +" args=arguments(\n" +" args=[\n" +" arg(arg='x'),\n" +" arg(arg='y')]),\n" +" body=Constant(value=Ellipsis)))])" #: ../../library/ast.rst:2020 msgid "The arguments for a function." @@ -2614,11 +3773,13 @@ msgstr "" "です。デフォルト値の数nが位置引数の数より少ない場合、それらは最後のn個の引数" "に割り当てられます。" -#: ../../library/ast.rst:2034 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name; " "``annotation`` is its annotation, such as a :class:`Name` node." msgstr "" +"引数リスト内の一つの引数を表します。\n" +"``arg`` は引数名の文字列で、``annotation`` は :class:`Name` ノードなどで表す" +"アノテーションです。" #: ../../library/ast.rst:2039 msgid "" @@ -2627,7 +3788,6 @@ msgstr "" "``type_comment`` はコメントとして型アノテーションをあらわすオプション文字列で" "す。" -#: ../../library/ast.rst:2041 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... @decorator1\n" @@ -2665,12 +3825,46 @@ msgid "" " Name(id='decorator2')],\n" " returns=Constant(value='return annotation'))])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... def f(a: 'annotation', b=1, c=2, *d, e, f=3, **g) -> 'return " +"annotation':\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" FunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" args=[\n" +" arg(\n" +" arg='a',\n" +" annotation=Constant(value='annotation')),\n" +" arg(arg='b'),\n" +" arg(arg='c')],\n" +" vararg=arg(arg='d'),\n" +" kwonlyargs=[\n" +" arg(arg='e'),\n" +" arg(arg='f')],\n" +" kw_defaults=[\n" +" None,\n" +" Constant(value=3)],\n" +" kwarg=arg(arg='g'),\n" +" defaults=[\n" +" Constant(value=1),\n" +" Constant(value=2)]),\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1'),\n" +" Name(id='decorator2')],\n" +" returns=Constant(value='return annotation'))])" #: ../../library/ast.rst:2081 msgid "A ``return`` statement." msgstr "``return`` 文です。" -#: ../../library/ast.rst:2083 msgid "" ">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" "Module(\n" @@ -2678,15 +3872,21 @@ msgid "" " Return(\n" " value=Constant(value=4))])" msgstr "" +">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" +"Module(\n" +" body=[\n" +" Return(\n" +" value=Constant(value=4))])" -#: ../../library/ast.rst:2095 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in an :class:`Expr` node if the value sent back is not " "used." msgstr "" +"``yield`` 式または ``yield from`` 式です。\n" +"これらは式なので、返されてきた値を使わない場合は :class:`Expr` ノードで囲む必" +"要があります。" -#: ../../library/ast.rst:2098 msgid "" ">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" "Module(\n" @@ -2702,6 +3902,19 @@ msgid "" " value=YieldFrom(\n" " value=Name(id='x')))])" msgstr "" +">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Yield(\n" +" value=Name(id='x')))])\n" +"\n" +">>> print(ast.dump(ast.parse('yield from x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=YieldFrom(\n" +" value=Name(id='x')))])" #: ../../library/ast.rst:2118 msgid "" @@ -2709,7 +3922,6 @@ msgid "" msgstr "" "``global`` および ``nonlocal`` 文です。 ``names`` は生の文字列のリストです。" -#: ../../library/ast.rst:2120 msgid "" ">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" "Module(\n" @@ -2729,6 +3941,23 @@ msgid "" " 'y',\n" " 'z'])])" msgstr "" +">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Global(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])])\n" +"\n" +">>> print(ast.dump(ast.parse('nonlocal x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Nonlocal(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])])" #: ../../library/ast.rst:2143 msgid "A class definition." @@ -2742,12 +3971,14 @@ msgstr "``name`` はクラス名をあらわす生の文字列です。" msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "``bases`` は明示的に指定された基底クラスをあらわすノードのリストです。" -#: ../../library/ast.rst:2147 msgid "" "``keywords`` is a list of :class:`.keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per :pep:" "`3115`." msgstr "" +"``keywords`` は :class:`.keyword` ノードのリストで、主に 'metaclass' の指定に" +"使います。\n" +"それ以外のキーワードは :pep:`3115` に従ってメタクラスに渡されます。" #: ../../library/ast.rst:2149 msgid "" @@ -2761,7 +3992,6 @@ msgstr "" "``decorator_list`` はノードのリストで、関数定義 :class:`FunctionDef` の場合と" "同様に解釈されます。" -#: ../../library/ast.rst:2154 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... @decorator1\n" @@ -2786,6 +4016,28 @@ msgid "" " Name(id='decorator1'),\n" " Name(id='decorator2')])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... class Foo(base1, base2, metaclass=meta):\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" ClassDef(\n" +" name='Foo',\n" +" bases=[\n" +" Name(id='base1'),\n" +" Name(id='base2')],\n" +" keywords=[\n" +" keyword(\n" +" arg='metaclass',\n" +" value=Name(id='meta'))],\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1'),\n" +" Name(id='decorator2')])])" #: ../../library/ast.rst:2183 msgid "Async and await" @@ -2807,7 +4059,6 @@ msgstr "" "``await`` 式をあらわします。 ``value`` は待ち受ける値です。 :class:" "`AsyncFunctionDef` の本体 (body) の中でのみ有効です。" -#: ../../library/ast.rst:2199 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... async def f():\n" @@ -2824,6 +4075,20 @@ msgid "" " value=Call(\n" " func=Name(id='other_func'))))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... async def f():\n" +"... await other_func()\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" AsyncFunctionDef(\n" +" name='f',\n" +" args=arguments(),\n" +" body=[\n" +" Expr(\n" +" value=Await(\n" +" value=Call(\n" +" func=Name(id='other_func'))))])])" #: ../../library/ast.rst:2220 msgid "" @@ -2835,7 +4100,6 @@ msgstr "" "class:`For` および :class:`With` と同じフィールドを持ちます。 :class:" "`AsyncFunctionDef` の本体 (body) の中でのみ有効です。" -#: ../../library/ast.rst:2225 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -2843,26 +4107,34 @@ msgid "" "singletons. Changes to one will be reflected in all other occurrences of the " "same value (for example, :class:`ast.Add`)." msgstr "" +":func:`ast.parse` で文字列を解析すると、返される木の演算子ノード (:class:" +"`ast.operator`、:class:`ast.unaryop`、:class:`ast.cmpop`、:class:`ast." +"boolop`、:class:`ast.expr_context` のサブクラス) はシングルトンになります。\n" +"一つを変更すると、同じ値 (例えば :class:`ast.Add`) を持つ他のすべての箇所にも" +"反映されます。" -#: ../../library/ast.rst:2233 msgid ":mod:`!ast` helpers" -msgstr "" +msgstr ":mod:`!ast` の補助機能" -#: ../../library/ast.rst:2235 msgid "" "Apart from the node classes, the :mod:`!ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" +":mod:`!ast` モジュールは、ノードクラスに加えて、抽象構文木をたどるための次の" +"関数とクラスを定義しています。" -#: ../../library/ast.rst:2240 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, flags=FLAGS_VALUE, optimize=optimize, module=module)``, " "where ``FLAGS_VALUE`` is ``ast.PyCF_ONLY_AST`` if ``optimize <= 0`` and " "``ast.PyCF_OPTIMIZED_AST`` otherwise." msgstr "" +"ソースコードを解析し、AST ノードにします。\n" +"``compile(source, filename, mode, flags=FLAGS_VALUE, optimize=optimize, " +"module=module)`` と同じです。\n" +"ここで ``FLAGS_VALUE`` は、``optimize <= 0`` なら ``ast.PyCF_ONLY_AST``、それ" +"以外なら ``ast.PyCF_OPTIMIZED_AST`` です。" -#: ../../library/ast.rst:2245 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -2874,15 +4146,25 @@ msgid "" "the ``type_ignores`` attribute of :class:`Module` (otherwise it is always an " "empty list)." msgstr "" +"``type_comments=True`` を指定すると、パーサーは :pep:`484` と :pep:`526` で定" +"義された型コメントを検査して返すようになります。\n" +"これは :func:`compile` に渡すフラグに :data:`ast.PyCF_TYPE_COMMENTS` を追加す" +"るのと同じです。\n" +"不適切な位置に型コメントがあると構文エラーを報告します。\n" +"このフラグがなければ型コメントは無視され、対応する AST ノードの " +"``type_comment`` フィールドは常に ``None`` になります。\n" +"また、``# type: ignore`` コメントの位置は :class:`Module` の " +"``type_ignores`` 属性として返されます (このフラグがなければ常に空リストで" +"す)。" -#: ../../library/ast.rst:2255 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", for example ``(str, " "int) -> List[str]``." msgstr "" +"さらに、``mode`` が ``'func_type'`` の場合、``(str, int) -> List[str]`` のよ" +"うな :pep:`484` の「シグネチャ型コメント」に対応する入力構文を使います。" -#: ../../library/ast.rst:2259 msgid "" "Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a " "\"best-effort\" attempt to parse using that Python version's grammar. For " @@ -2894,13 +4176,22 @@ msgid "" "is the same as when run on the Python version corresponding to " "``feature_version``." msgstr "" +"``feature_version`` にタプル ``(major, minor)`` を指定すると、できる限りその " +"Python バージョンの文法を使って解析します。\n" +"例えば ``feature_version=(3, 9)`` なら、:keyword:`match` 文を受け付けないよう" +"にします。\n" +"現在、``major`` は ``3`` でなければなりません。\n" +"サポートする最も古いバージョンは ``(3, 7)`` (将来の Python では引き上げられる" +"可能性があります)、最も新しいバージョンは ``sys.version_info[0:2]`` です。\n" +"あくまで可能な限り合わせるものであり、解析結果や解析の成否が " +"``feature_version`` に対応する Python で実行した場合と同じになる保証はありま" +"せん。" #: ../../library/ast.rst:2269 msgid "" "If source contains a null character (``\\0``), :exc:`ValueError` is raised." msgstr "" -#: ../../library/ast.rst:2272 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -2909,12 +4200,20 @@ msgid "" "node for a return statement, but it cannot be compiled alone (it needs to be " "inside a function node)." msgstr "" +"ソースコードを AST オブジェクトに解析できても、実行可能な正しい Python コード" +"であるとは限りません。\n" +"コンパイルの段階で、さらに :exc:`SyntaxError` が送出される可能性がありま" +"す。\n" +"例えば、``return 42`` というソースからは有効な return 文の AST ノードが生成さ" +"れますが、単独ではコンパイルできません (関数ノードの内部に置く必要がありま" +"す)。" -#: ../../library/ast.rst:2279 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" +"特に、:func:`ast.parse` はスコープの検査を行いません。\n" +"これはコンパイルの段階で行われます。" #: ../../library/ast.rst:2283 msgid "" @@ -2931,11 +4230,13 @@ msgstr "" "``type_comments``、``mode='func_type'``、``feature_version`` が追加されまし" "た。" -#: ../../library/ast.rst:2290 msgid "" "The minimum supported version for ``feature_version`` is now ``(3, 7)``. The " "``optimize`` argument was added." msgstr "" +"``feature_version`` でサポートする最も古いバージョンが ``(3, 7)`` になりまし" +"た。\n" +"``optimize`` 引数が追加されました。" #: ../../library/ast.rst:2294 msgid "Added the *module* parameter." @@ -2978,17 +4279,16 @@ msgstr "" "ます: 文字列、バイト列、数、タプル、リスト、辞書、集合、ブール値、``None``、" "``Ellipsis``。" -#: ../../library/ast.rst:2323 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -"この関数は Python の式を含んだ文字列を、値自身を解析することなしに評価するの" -"に使えます。この関数は、例えば演算や添え字を含んだ任意の複雑な表現を評価する" -"のには使えません。" +"この関数を使うと、Python の値を含む文字列を、自分で解析する処理を書かずに評価" +"できます。\n" +"演算子やインデックス参照を含む式など、任意の複雑な式を評価することはできませ" +"ん。" -#: ../../library/ast.rst:2328 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -2999,6 +4299,17 @@ msgid "" "excessive CPU consumption denial of service on some inputs. Calling it on " "untrusted data is thus not recommended." msgstr "" +"この関数は以前、意味を明確にしないまま「安全」と説明されていましたが、これは" +"誤解を招く表現でした。\n" +"より汎用的な :func:`eval` とは異なり、Python コードを実行しないように設計され" +"ています。\n" +"名前空間や名前の検索はなく、関数などを呼び出すこともできません。\n" +"しかし、攻撃を受けないわけではありません。\n" +"比較的小さな入力でも、メモリや C スタックを使い果たし、プロセスをクラッシュさ" +"せる可能性があります。\n" +"入力によっては、過剰な CPU 使用によるサービス拒否を引き起こす可能性もありま" +"す。\n" +"そのため、信頼できないデータに対して呼び出すことは推奨しません。" #: ../../library/ast.rst:2338 msgid "" @@ -3008,11 +4319,13 @@ msgstr "" "Python の抽象構文木コンパイラのスタックの深さの限界を越えることで、 Python イ" "ンタプリタをクラッシュさせる可能性があります。" -#: ../../library/ast.rst:2341 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" +"不正な入力の内容によっては、:exc:`ValueError`、:exc:`TypeError`、:exc:" +"`SyntaxError`、:exc:`MemoryError`、:exc:`RecursionError` を送出することがあり" +"ます。" #: ../../library/ast.rst:2345 msgid "Now allows bytes and set literals." @@ -3022,9 +4335,8 @@ msgstr "バイト列リテラルと集合リテラルが受け取れるように msgid "Now supports creating empty sets with ``'set()'``." msgstr "``'set()'`` による空の集合の生成をサポートするようになりました。" -#: ../../library/ast.rst:2351 msgid "For string inputs, leading spaces and tabs are now stripped." -msgstr "" +msgstr "文字列の入力では、先頭のスペースとタブを取り除くようになりました。" #: ../../library/ast.rst:2357 msgid "" @@ -3043,13 +4355,16 @@ msgstr "" msgid ":class:`AsyncFunctionDef` is now supported." msgstr ":class:`AsyncFunctionDef` がサポートされました。" -#: ../../library/ast.rst:2369 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :" "attr:`~ast.AST.col_offset`, or :attr:`~ast.AST.end_col_offset`) is missing, " "return ``None``." msgstr "" +"*source* から、*node* の生成元となったソースコードの部分を取得します。\n" +"位置情報 (:attr:`~ast.AST.lineno`、:attr:`~ast.AST.end_lineno`、:attr:`~ast." +"AST.col_offset`、:attr:`~ast.AST.end_col_offset`) のいずれかが欠けていれば " +"``None`` を返します。" #: ../../library/ast.rst:2373 msgid "" @@ -3059,7 +4374,6 @@ msgstr "" "*padded* が ``True`` の場合、複数行にわたる文の最初の行が元の位置に一致するよ" "うに空白文字でパディングされます。" -#: ../../library/ast.rst:2381 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every " @@ -3068,6 +4382,12 @@ msgid "" "set, by setting them to the values of the parent node. It works recursively " "starting at *node*." msgstr "" +"ノードの木を :func:`compile` でコンパイルする際、コンパイラは、対応するすべて" +"のノードに :attr:`~ast.AST.lineno` と :attr:`~ast.AST.col_offset` 属性がある" +"ことを前提とします。\n" +"生成したノードにこれらを手作業で設定するのは煩雑なので、この補助関数は、まだ" +"設定されていない属性に親ノードの値を再帰的に設定します。\n" +"処理は *node* から始まります。" #: ../../library/ast.rst:2390 msgid "" @@ -3078,12 +4398,14 @@ msgstr "" "*node* で始まるツリー内の各ノードの行番号と終了行番号を *n* ずつ増やします。" "これはファイルの中で別の場所に \"コードを移動する\" ときに便利です。" -#: ../../library/ast.rst:2397 msgid "" "Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :" "attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " "*old_node* to *new_node* if possible, and return *new_node*." msgstr "" +"可能であれば、*old_node* のソース上の位置 (:attr:`~ast.AST.lineno`、:attr:" +"`~ast.AST.col_offset`、:attr:`~ast.AST.end_lineno`、:attr:`~ast.AST." +"end_col_offset`) を *new_node* にコピーし、*new_node* を返します。" #: ../../library/ast.rst:2404 msgid "" @@ -3153,9 +4475,8 @@ msgstr "" "ビジターが :meth:`generic_visit` を呼び出すかそれ自身で子ノードを訪れない限り" "訪れられないということです。" -#: ../../library/ast.rst:2446 msgid "Handles all constant nodes." -msgstr "" +msgstr "すべての定数ノードを処理します。" #: ../../library/ast.rst:2448 msgid "" @@ -3167,13 +4488,17 @@ msgstr "" "いけません。そうした目的のために変更を許す特別なビジター (:class:" "`NodeTransformer`) があります。" -#: ../../library/ast.rst:2454 msgid "" "Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:" "`!visit_NameConstant` and :meth:`!visit_Ellipsis` will not be called in " "Python 3.14+. Add the :meth:`visit_Constant` method instead to handle all " "constant nodes." msgstr "" +"Python 3.14 以降では、:meth:`!visit_Num`、:meth:`!visit_Str`、:meth:`!" +"visit_Bytes`、:meth:`!visit_NameConstant`、:meth:`!visit_Ellipsis` メソッドは" +"呼び出されません。\n" +"代わりに :meth:`visit_Constant` メソッドを追加して、すべての定数ノードを処理" +"してください。" #: ../../library/ast.rst:2462 msgid "" @@ -3205,7 +4530,6 @@ msgstr "" "それでは例を示しましょう。Name (たとえば ``foo``) を見つけるたび全て " "``data['foo']`` に書き換える変換器 (transformer) です::" -#: ../../library/ast.rst:2474 msgid "" "class RewriteName(NodeTransformer):\n" "\n" @@ -3216,13 +4540,23 @@ msgid "" " ctx=node.ctx\n" " )" msgstr "" +"class RewriteName(NodeTransformer):\n" +"\n" +" def visit_Name(self, node):\n" +" return Subscript(\n" +" value=Name(id='data'),\n" +" slice=Constant(value=node.id),\n" +" ctx=node.ctx\n" +" )" -#: ../../library/ast.rst:2483 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`~ast." "NodeVisitor.generic_visit` method for the node first." msgstr "" +"処理するノードに子ノードがある場合は、子ノードを自分で変換するか、先にその" +"ノードに対して :meth:`~ast.NodeVisitor.generic_visit` メソッドを呼び出す必要" +"があります。" msgid "" "For nodes that were part of a collection of statements (that applies to all " @@ -3232,27 +4566,29 @@ msgstr "" "文のコレクションの要素であるノード (すべての文ノードが該当します) に対して" "は、ビジターは単一のノードの代わりにノードのリストを返すこともできます。" -#: ../../library/ast.rst:2491 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:`~ast." "AST.lineno`), :func:`fix_missing_locations` should be called with the new " "sub-tree to recalculate the location information::" msgstr "" +":class:`NodeTransformer` で元の木にない新しいノードを追加し、:attr:`~ast.AST." +"lineno` などの位置情報を設定していない場合は、新しい部分木に対して :func:" +"`fix_missing_locations` を呼び出し、位置情報を補ってください。 ::" -#: ../../library/ast.rst:2496 msgid "" "tree = ast.parse('foo', mode='eval')\n" "new_tree = fix_missing_locations(RewriteName().visit(tree))" msgstr "" +"tree = ast.parse('foo', mode='eval')\n" +"new_tree = fix_missing_locations(RewriteName().visit(tree))" #: ../../library/ast.rst:2499 msgid "Usually you use the transformer like this::" msgstr "たいてい、変換器の使い方は次のようになります::" -#: ../../library/ast.rst:2501 msgid "node = YourTransformer().visit(node)" -msgstr "" +msgstr "node = YourTransformer().visit(node)" #: ../../library/ast.rst:2506 msgid "" @@ -3271,12 +4607,14 @@ msgstr "" "号や列オフセットのような属性はデフォルトではダンプされません。これが必要であ" "れば、 *include_attributes* を true にすると表示できます。" -#: ../../library/ast.rst:2514 msgid "" "If *color* is ``True``, the returned string is syntax highlighted using ANSI " "escape sequences. If ``False`` (the default), colored output is always " "disabled." msgstr "" +"*color* が ``True`` の場合、返される文字列は ANSI エスケープシーケンスで構文" +"を色分けします。\n" +"``False`` (デフォルト) の場合、色付きの出力は常に無効になります。" #: ../../library/ast.rst:2518 msgid "" @@ -3294,14 +4632,15 @@ msgstr "" "インデントされます。 *indent* が文字列 (``\"\\t\"`` など) の場合、その文字列" "が各レベルのインデントに使われます。" -#: ../../library/ast.rst:2525 msgid "" "If *show_empty* is false (the default), optional empty lists and ``Load()`` " "values will be omitted from the output. Optional ``None`` values are always " "omitted." msgstr "" +"*show_empty* が偽 (デフォルト) の場合、省略可能な空リストと ``Load()`` の値は" +"出力から省かれます。\n" +"省略可能な ``None`` の値は常に省かれます。" -#: ../../library/ast.rst:2529 msgid "" ">>> tree = ast.parse('print(None)', '?', 'eval')\n" ">>> print(ast.dump(tree, indent=4))\n" @@ -3318,28 +4657,37 @@ msgid "" " Constant(value=None)],\n" " keywords=[]))" msgstr "" +">>> tree = ast.parse('print(None)', '?', 'eval')\n" +">>> print(ast.dump(tree, indent=4))\n" +"Expression(\n" +" body=Call(\n" +" func=Name(id='print'),\n" +" args=[\n" +" Constant(value=None)]))\n" +">>> print(ast.dump(tree, indent=4, show_empty=True))\n" +"Expression(\n" +" body=Call(\n" +" func=Name(id='print', ctx=Load()),\n" +" args=[\n" +" Constant(value=None)],\n" +" keywords=[]))" #: ../../library/ast.rst:2546 msgid "Added the *indent* option." msgstr "*indent* オプションを追加しました。" -#: ../../library/ast.rst:2549 msgid "Added the *show_empty* option." -msgstr "" +msgstr "*show_empty* オプションが追加されました。" -#: ../../library/ast.rst:2552 msgid "Omit optional ``Load()`` values by default." -msgstr "" +msgstr "省略可能な ``Load()`` の値をデフォルトで省くようになりました。" -#: ../../library/ast.rst:2555 msgid "Added the *color* parameter." -msgstr "" +msgstr "*color* パラメーターを追加しました。" -#: ../../library/ast.rst:2561 msgid "Recursively compares two ASTs." -msgstr "" +msgstr "二つの AST を再帰的に比較します。" -#: ../../library/ast.rst:2563 msgid "" "*compare_attributes* affects whether AST attributes are considered in the " "comparison. If *compare_attributes* is ``False`` (default), then attributes " @@ -3347,6 +4695,12 @@ msgid "" "check whether the ASTs are structurally equal but differ in whitespace or " "similar details. Attributes include line numbers and column offsets." msgstr "" +"*compare_attributes* は、比較に AST の属性を含めるかどうかを指定します。\n" +"``False`` (デフォルト) の場合は属性を無視し、それ以外の場合はすべての属性が等" +"しい必要があります。\n" +"このオプションは、空白などの細部が異なっていても AST の構造が等しいかどうかを" +"調べる際に便利です。\n" +"属性には行番号や列オフセットが含まれます。" msgid "Compiler flags" msgstr "コンパイラのフラグ" @@ -3374,11 +4728,12 @@ msgid "" msgstr "" "コンパイルされたコードオブジェクトの代わりに抽象構文木を生成して返します。" -#: ../../library/ast.rst:2595 msgid "" "The returned AST is optimized according to the *optimize* argument in :func:" "`compile` or :func:`ast.parse`." msgstr "" +"返される AST は、:func:`compile` または :func:`ast.parse` の *optimize* 引数" +"に従って最適化されます。" #: ../../library/ast.rst:2602 msgid "" @@ -3392,21 +4747,22 @@ msgstr "" msgid "Command-line usage" msgstr "コマンドラインでの使用" -#: ../../library/ast.rst:2615 msgid "" "The output is now syntax highlighted by default. This can be :ref:" "`controlled using environment variables `." msgstr "" +"デフォルトで、出力の構文を色分けするようになりました。\n" +"この動作は :ref:`環境変数で制御できます `。" -#: ../../library/ast.rst:2619 msgid "" "The :mod:`!ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" +":mod:`!ast` モジュールは、次のようにコマンドラインからスクリプトとして実行で" +"きます。" -#: ../../library/ast.rst:2622 msgid "python -m ast [-m ] [-a] [infile]" -msgstr "" +msgstr "python -m ast [-m ] [-a] [infile]" #: ../../library/ast.rst:2626 msgid "The following options are accepted:" @@ -3436,15 +4792,17 @@ msgstr "行番号や列オフセットなどの属性を含めます。" msgid "Indentation of nodes in AST (number of spaces)." msgstr "AST におけるノードのインデント (空白の数) です。" -#: ../../library/ast.rst:2655 msgid "" "Python version in the format 3.x (for example, 3.10). Defaults to the " "current version of the interpreter." msgstr "" +"3.x 形式の Python バージョン (例: 3.10)。\n" +"デフォルトは現在のインタープリタのバージョンです。" -#: ../../library/ast.rst:2663 msgid "Optimization level for parser. Defaults to no optimization." msgstr "" +"パーサーの最適化レベル。\n" +"デフォルトでは最適化しません。" #: ../../library/ast.rst:2669 msgid "" @@ -3478,12 +4836,14 @@ msgstr "" "Python AST を、生成元のソースコードのトークン位置やテキストで注解します。これ" "はソースコード変換を行うツールで有用です。" -#: ../../library/ast.rst:2689 msgid "" "`leoAst.py `_ unifies the token-based and parse-tree-based views of python programs " "by inserting two-way links between tokens and ast nodes." msgstr "" +"`leoAst.py `_ は、トークンと AST ノードの間に双方向のリンクを挿入することで、Python " +"プログラムのトークンに基づく表現と構文木に基づく表現を結び付けます。" #: ../../library/ast.rst:2694 msgid "" @@ -3496,21 +4856,23 @@ msgstr "" "は自動リファクタリングアプリケーション (codemod) やリンタを作成する際に有用で" "す。" -#: ../../library/ast.rst:2699 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " "multiple Python versions). Parso is also able to list multiple syntax errors " "in your Python file." msgstr "" +"`Parso `_ は、エラーからの回復と、ソースコード" +"を解析して元に戻す処理をサポートする Python パーサーです。\n" +"複数の Python バージョン上で動作し、異なるバージョンの構文を扱えます。\n" +"Python ファイル内の複数の構文エラーを列挙することもできます。" #: ../../library/ast.rst:58 msgid "? (question mark)" msgstr "? (クエスチョンマーク)" -#: ../../library/ast.rst:58 ../../library/ast.rst:59 msgid "in AST grammar" -msgstr "" +msgstr "AST の文法内" #: ../../library/ast.rst:59 msgid "* (asterisk)" diff --git a/library/asynchat.po b/library/asynchat.po index f012e513a..688ba24db 100644 --- a/library/asynchat.po +++ b/library/asynchat.po @@ -18,23 +18,26 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asynchat.rst:2 msgid ":mod:`!asynchat` --- Asynchronous socket command/response handler" -msgstr "" +msgstr ":mod:`!asynchat` --- 非同期ソケットのコマンド・応答ハンドラー" -#: ../../library/asynchat.rst:10 msgid "" "This module is no longer part of the Python standard library. It was :ref:" "`removed in Python 3.12 ` after being deprecated in " "Python 3.6. The removal was decided in :pep:`594`." msgstr "" +"このモジュールは Python 標準ライブラリから削除されました。\n" +"Python 3.6 で非推奨となり、:ref:`Python 3.12 で削除 ` さ" +"れました。\n" +"削除は :pep:`594` で決定されました。" -#: ../../library/asynchat.rst:14 msgid "Applications should use the :mod:`asyncio` module instead." msgstr "" +"アプリケーションでは、代わりに :mod:`asyncio` モジュールを使ってください。" -#: ../../library/asynchat.rst:16 msgid "" "The last version of Python that provided the :mod:`!asynchat` module was " "`Python 3.11 `_." msgstr "" +":mod:`!asynchat` モジュールが含まれる最後のバージョンは `Python 3.11 " +"`_ です。" diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index c272264c4..e15b8a555 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -26,23 +26,21 @@ msgstr "" msgid "High-level API Index" msgstr "高水準の API インデックス" -#: ../../library/asyncio-api-index.rst:8 msgid "This page lists all high-level async/await enabled asyncio APIs." msgstr "" -"このページには、すべての高水準の 非同期/待機 可能な asyncio API が一覧になっ" -"ています。" +"このページには、async/await に対応する asyncio の高水準 API をすべて列挙して" +"います。" #: ../../library/asyncio-api-index.rst:12 msgid "Tasks" msgstr "Task" -#: ../../library/asyncio-api-index.rst:14 msgid "" "Utilities to run asyncio programs, create Tasks, and await on multiple " "things with timeouts." msgstr "" -"ユーティリティは asyncio プログラムを実行し、タスクを作成し、タイムアウトのあ" -"る複数の機能を待っています。" +"asyncio プログラムの実行、タスクの作成、タイムアウト付きで複数の処理の完了を" +"待つためのユーティリティです。" #: ../../library/asyncio-api-index.rst:21 msgid ":func:`run`" @@ -108,9 +106,8 @@ msgstr "イベントループのまだ終了していないすべてのタスク msgid "``await`` :func:`sleep`" msgstr "``await`` :func:`sleep`" -#: ../../library/asyncio-api-index.rst:45 msgid "Sleep for a number of seconds." -msgstr "数秒間スリープします。" +msgstr "指定した秒数だけスリープします。" #: ../../library/asyncio-api-index.rst:47 msgid "``await`` :func:`gather`" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 0fdf92abc..b788aa0d2 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -26,12 +26,11 @@ msgstr "" msgid "Developing with asyncio" msgstr "asyncio での開発" -#: ../../library/asyncio-dev.rst:9 msgid "" "Asynchronous programming is different from classic \"sequential\" " "programming." msgstr "" -"非同期プログラミングは伝統的な \"同期的\" プログラミングとは異なります。" +"非同期プログラミングは、従来の「逐次的」なプログラミングとは異なります。" #: ../../library/asyncio-dev.rst:12 msgid "" @@ -85,9 +84,8 @@ msgstr "" ":ref:`asyncio ロガー ` のログレベルを :py:const:`logging." "DEBUG` に設定します。例えばアプリケーションの起動時に以下を実行します::" -#: ../../library/asyncio-dev.rst:40 msgid "logging.basicConfig(level=logging.DEBUG)" -msgstr "" +msgstr "logging.basicConfig(level=logging.DEBUG)" #: ../../library/asyncio-dev.rst:42 msgid "" @@ -121,15 +119,14 @@ msgstr "" "I/O セレクタが I/O 処理を実行する時間が長すぎる場合、その実行時間が記録されま" "す。" -#: ../../library/asyncio-dev.rst:56 msgid "" "Callbacks taking longer than 100 milliseconds are logged. The :attr:`loop." "slow_callback_duration` attribute can be used to set the minimum execution " "duration in seconds that is considered \"slow\"." msgstr "" -"実行時間が100ミリ秒を超えるコールバックは記録されます。 \"遅い\" の判断基準と" -"なる実行時間の最小値は :attr:`loop.slow_callback_duration` 属性で設定できま" -"す。" +"実行時間が 100 ミリ秒を超えるコールバックはログに記録されます。\n" +":attr:`loop.slow_callback_duration` 属性で、「遅い」とみなす実行時間の最小値" +"を秒単位で設定できます。" #: ../../library/asyncio-dev.rst:64 msgid "Concurrency and Multithreading" @@ -157,9 +154,8 @@ msgstr "" "別の OS スレッドからのコールバック (:term:`callback`) をスケジュールする場" "合、 :meth:`loop.call_soon_threadsafe` メソッドを使ってください。例:" -#: ../../library/asyncio-dev.rst:75 msgid "loop.call_soon_threadsafe(callback, *args)" -msgstr "" +msgstr "loop.call_soon_threadsafe(callback, *args)" msgid "" "Almost all asyncio objects are not thread safe, which is typically not a " @@ -173,9 +169,8 @@ msgstr "" "び出すようなコードを書く必要がある場合、 :meth:`loop.call_soon_threadsafe` メ" "ソッドを使ってください。例:" -#: ../../library/asyncio-dev.rst:83 msgid "loop.call_soon_threadsafe(fut.cancel)" -msgstr "" +msgstr "loop.call_soon_threadsafe(fut.cancel)" #: ../../library/asyncio-dev.rst:85 msgid "" @@ -188,7 +183,6 @@ msgstr "" "``run_coroutine_threadsafe()`` は結果にアクセスするための :class:`concurrent." "futures.Future` オブジェクトを返します:" -#: ../../library/asyncio-dev.rst:89 msgid "" "async def coro_func():\n" " return await asyncio.sleep(1, 42)\n" @@ -199,6 +193,14 @@ msgid "" "# Wait for the result:\n" "result = future.result()" msgstr "" +"async def coro_func():\n" +" return await asyncio.sleep(1, 42)\n" +"\n" +"# 後で、別の OS スレッド内で実行する:\n" +"\n" +"future = asyncio.run_coroutine_threadsafe(coro_func(), loop)\n" +"# 結果を待つ:\n" +"result = future.result()" #: ../../library/asyncio-dev.rst:98 msgid "To handle signals the event loop must be run in the main thread." @@ -206,13 +208,16 @@ msgstr "" "シグナルの処理を行うには、イベントループはメインスレッド内で実行しなければな" "りません。" -#: ../../library/asyncio-dev.rst:101 msgid "" "The :meth:`loop.run_in_executor` method can be used with a :class:" "`concurrent.futures.ThreadPoolExecutor` or :class:`~concurrent.futures." "InterpreterPoolExecutor` to execute blocking code in a different OS thread " "without blocking the OS thread that the event loop runs in." msgstr "" +":meth:`loop.run_in_executor` メソッドを :class:`concurrent.futures." +"ThreadPoolExecutor` または :class:`~concurrent.futures." +"InterpreterPoolExecutor` と組み合わせると、イベントループの OS スレッドをブ" +"ロックせずに、別の OS スレッドでブロッキングコードを実行できます。" #: ../../library/asyncio-dev.rst:107 msgid "" @@ -249,13 +254,15 @@ msgstr "" "たとえば、 CPU 負荷の高い関数を1秒実行したとすると、並行に処理されている全て" "の非同期タスクと I/O 処理は1秒遅れる可能性があります。" -#: ../../library/asyncio-dev.rst:128 msgid "" "An executor can be used to run a task in a different thread, including in a " "different interpreter, or even in a different process to avoid blocking the " "OS thread with the event loop. See the :meth:`loop.run_in_executor` method " "for more details." msgstr "" +"Executor を使うと、別のスレッド (別のインタープリタを含む) や別のプロセスで処" +"理を実行し、イベントループの OS スレッドがブロックされるのを避けられます。\n" +"詳細は :meth:`loop.run_in_executor` メソッドを参照してください。" #: ../../library/asyncio-dev.rst:138 msgid "Logging" @@ -277,9 +284,8 @@ msgstr "" "デフォルトのログレベルは :py:const:`logging.INFO` ですが、これは簡単に調節で" "きます:" -#: ../../library/asyncio-dev.rst:146 msgid "logging.getLogger(\"asyncio\").setLevel(logging.WARNING)" -msgstr "" +msgstr "logging.getLogger(\"asyncio\").setLevel(logging.WARNING)" #: ../../library/asyncio-dev.rst:149 msgid "" @@ -295,18 +301,15 @@ msgstr "" msgid "Detect never-awaited coroutines" msgstr "待ち受け処理を伴わないコルーチンの検出" -#: ../../library/asyncio-dev.rst:159 msgid "" "When a coroutine function is called, but not awaited (e.g. ``coro()`` " "instead of ``await coro()``) or the coroutine is not scheduled with :meth:" "`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::" msgstr "" -"コルーチンが呼び出されただけで、待ち受け処理がない場合 (たとえば ``await " -"coro()`` のかわりに ``coro()`` と書いてしまった場合) 、またはコルーチンが :" -"meth:`asyncio.create_task` を使わずにスケジュールされた場合、 asyncio は :" -"exc:`RuntimeWarning` 警告を送出します:" +"コルーチン関数を呼び出しただけで、await も :meth:`asyncio.create_task` による" +"スケジュールも行わなかった場合 (例えば ``await coro()`` の代わりに " +"``coro()`` と書いた場合)、asyncio は :exc:`RuntimeWarning` を出します。 ::" -#: ../../library/asyncio-dev.rst:164 msgid "" "import asyncio\n" "\n" @@ -318,23 +321,32 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def test():\n" +" print(\"never scheduled\")\n" +"\n" +"async def main():\n" +" test()\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-dev.rst:174 ../../library/asyncio-dev.rst:219 #: ../../library/asyncio-dev.rst:393 ../../library/asyncio-dev.rst:450 msgid "Output::" msgstr "出力::" -#: ../../library/asyncio-dev.rst:176 msgid "" "test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" " test()" msgstr "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +" test()" #: ../../library/asyncio-dev.rst:179 ../../library/asyncio-dev.rst:235 msgid "Output in debug mode::" msgstr "デバッグモードの出力::" -#: ../../library/asyncio-dev.rst:181 msgid "" "test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" "Coroutine created at (most recent call last)\n" @@ -347,6 +359,16 @@ msgid "" " test()\n" " test()" msgstr "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +"Coroutine created at (most recent call last)\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +" < .. >\n" +"\n" +" File \"../t.py\", line 7, in main\n" +" test()\n" +" test()" #: ../../library/asyncio-dev.rst:192 msgid "" @@ -356,11 +378,12 @@ msgstr "" "通常の修正方法はコルーチンを待ち受ける (await) か、 :meth:`asyncio." "create_task` 関数を呼び出すことです:" -#: ../../library/asyncio-dev.rst:195 msgid "" "async def main():\n" " await test()" msgstr "" +"async def main():\n" +" await test()" #: ../../library/asyncio-dev.rst:200 msgid "Detect never-retrieved exceptions" @@ -382,7 +405,6 @@ msgstr "" msgid "Example of an unhandled exception::" msgstr "処理されない例外の例:" -#: ../../library/asyncio-dev.rst:209 msgid "" "import asyncio\n" "\n" @@ -394,8 +416,16 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def bug():\n" +" raise Exception(\"not consumed\")\n" +"\n" +"async def main():\n" +" asyncio.create_task(bug())\n" +"\n" +"asyncio.run(main())" -#: ../../library/asyncio-dev.rst:221 msgid "" "Task exception was never retrieved\n" "future: \n" @@ -406,6 +436,14 @@ msgid "" " raise Exception(\"not consumed\")\n" "Exception: not consumed" msgstr "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed')>\n" +"\n" +"Traceback (most recent call last):\n" +" File \"test.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" #: ../../library/asyncio-dev.rst:230 msgid "" @@ -415,11 +453,9 @@ msgstr "" "タスクが生成された箇所を特定するには、 :ref:`デバッグモードを有効化して " "` トレースバックを取得してください:" -#: ../../library/asyncio-dev.rst:233 msgid "asyncio.run(main(), debug=True)" -msgstr "" +msgstr "asyncio.run(main(), debug=True)" -#: ../../library/asyncio-dev.rst:237 msgid "" "Task exception was never retrieved\n" "future: \n" @@ -436,23 +472,36 @@ msgid "" " raise Exception(\"not consumed\")\n" "Exception: not consumed" msgstr "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed') created at asyncio/tasks.py:321>\n" +"\n" +"source_traceback: Object created at (most recent call last):\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +"< .. >\n" +"\n" +"Traceback (most recent call last):\n" +" File \"../t.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" -#: ../../library/asyncio-dev.rst:254 msgid "Asynchronous generators best practices" -msgstr "" +msgstr "非同期ジェネレーターを使う際の推奨事項" -#: ../../library/asyncio-dev.rst:256 msgid "" "Writing correct and efficient asyncio code requires awareness of certain " "pitfalls. This section outlines essential best practices that can save you " "hours of debugging." msgstr "" +"正しく効率的な asyncio コードを書くには、いくつかの落とし穴を知っておく必要が" +"あります。\n" +"この節では、長時間のデバッグを避けるために役立つ重要な実践方法を説明します。" -#: ../../library/asyncio-dev.rst:261 msgid "Close asynchronous generators explicitly" -msgstr "" +msgstr "非同期ジェネレーターを明示的に閉じる" -#: ../../library/asyncio-dev.rst:263 msgid "" "It is recommended to manually close the :term:`asynchronous generator " "`. If a generator exits early - for " @@ -461,14 +510,23 @@ msgid "" "occur after the tasks it depends on have completed, or during the event loop " "shutdown when the async-generator's garbage collection hook is called." msgstr "" +":term:`非同期ジェネレーター ` は明示的に閉じ" +"ることを推奨します。\n" +"例えば ``async for`` ループの本体で例外が起きるなどして、途中でジェネレーター" +"の使用を終えると、非同期の後始末処理が予期しないコンテキストで実行される可能" +"性があります。\n" +"依存するタスクが完了した後や、イベントループの終了中に非同期ジェネレーターの" +"ガベージコレクション用フックが呼び出されたときに、後始末が行われることがあり" +"ます。" -#: ../../library/asyncio-dev.rst:271 msgid "" "To avoid this, explicitly close the generator by calling its :meth:`~agen." "aclose` method, or use the :func:`contextlib.aclosing` context manager::" msgstr "" +"これを避けるには、:meth:`~agen.aclose` メソッドを呼び出して明示的にジェネレー" +"ターを閉じるか、:func:`contextlib.aclosing` コンテキストマネージャーを使って" +"ください。 ::" -#: ../../library/asyncio-dev.rst:275 msgid "" "import asyncio\n" "import contextlib\n" @@ -484,15 +542,29 @@ msgid "" "\n" "asyncio.run(func())" msgstr "" +"import asyncio\n" +"import contextlib\n" +"\n" +"async def gen():\n" +" yield 1\n" +" yield 2\n" +"\n" +"async def func():\n" +" async with contextlib.aclosing(gen()) as g:\n" +" async for x in g:\n" +" break # 最後までイテレーションしない\n" +"\n" +"asyncio.run(func())" -#: ../../library/asyncio-dev.rst:289 msgid "" "As noted above, the cleanup code for these asynchronous generators is " "deferred. The following example demonstrates that the finalization of an " "asynchronous generator can occur in an unexpected order::" msgstr "" +"前述のとおり、これらの非同期ジェネレーターの後始末処理は後回しにされます。\n" +"次の例は、非同期ジェネレーターの終了処理が予期しない順序で行われる場合を示し" +"ています。 ::" -#: ../../library/asyncio-dev.rst:293 msgid "" "import asyncio\n" "work_done = False\n" @@ -520,12 +592,35 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"work_done = False\n" +"\n" +"async def cursor():\n" +" try:\n" +" yield 1\n" +" finally:\n" +" assert work_done\n" +"\n" +"async def rows():\n" +" global work_done\n" +" try:\n" +" yield 2\n" +" finally:\n" +" await asyncio.sleep(0.1) # 非同期の処理を模倣する\n" +" work_done = True\n" +"\n" +"\n" +"async def main():\n" +" async for c in cursor():\n" +" async for r in rows():\n" +" break\n" +" break\n" +"\n" +"asyncio.run(main())" -#: ../../library/asyncio-dev.rst:319 msgid "For this example, we get the following output::" -msgstr "" +msgstr "この例の出力は次のようになります。 ::" -#: ../../library/asyncio-dev.rst:321 msgid "" "unhandled exception during asyncio.run() shutdown\n" "task: ()> exception=AssertionError()>\n" +"Traceback (most recent call last):\n" +" File \"example.py\", line 6, in cursor\n" +" yield 1\n" +"asyncio.exceptions.CancelledError\n" +"\n" +"During handling of the above exception, another exception occurred:\n" +"\n" +"Traceback (most recent call last):\n" +" File \"example.py\", line 8, in cursor\n" +" assert work_done\n" +" ^^^^^^^^^\n" +"AssertionError" -#: ../../library/asyncio-dev.rst:336 msgid "" "The ``cursor()`` asynchronous generator was finalized before the ``rows`` " "generator - an unexpected behavior." msgstr "" +"``cursor()`` 非同期ジェネレーターの終了処理が ``rows`` ジェネレーターより先に" +"行われています。\n" +"これは意図しない動作です。" -#: ../../library/asyncio-dev.rst:339 msgid "" "The example can be fixed by explicitly closing the ``cursor`` and ``rows`` " "async-generators::" msgstr "" +"この例は、``cursor`` と ``rows`` の非同期ジェネレーターを明示的に閉じることで" +"修正できます。 ::" -#: ../../library/asyncio-dev.rst:342 msgid "" "async def main():\n" " async with contextlib.aclosing(cursor()) as cursor_gen:\n" @@ -566,6 +678,13 @@ msgid "" " break\n" " break" msgstr "" +"async def main():\n" +" async with contextlib.aclosing(cursor()) as cursor_gen:\n" +" async for c in cursor_gen:\n" +" async with contextlib.aclosing(rows()) as rows_gen:\n" +" async for r in rows_gen:\n" +" break\n" +" break" #: ../../library/asyncio-dev.rst:352 msgid "Create asynchronous generators only when the event loop is running" @@ -577,27 +696,33 @@ msgid "" "generator iterator>` only after the event loop has been created." msgstr "" -#: ../../library/asyncio-dev.rst:358 msgid "" "To ensure that asynchronous generators close reliably, the event loop uses " "the :func:`sys.set_asyncgen_hooks` function to register callback functions. " "These callbacks update the list of running asynchronous generators to keep " "it in a consistent state." msgstr "" +"非同期ジェネレーターを確実に閉じるため、イベントループは :func:`sys." +"set_asyncgen_hooks` 関数でコールバック関数を登録します。\n" +"これらのコールバックは、実行中の非同期ジェネレーターの一覧を更新し、整合性を" +"保ちます。" -#: ../../library/asyncio-dev.rst:363 msgid "" "When the :meth:`loop.shutdown_asyncgens() ` " "function is called, the running generators are stopped gracefully and the " "list is cleared." msgstr "" +":meth:`loop.shutdown_asyncgens() ` 関数が呼" +"び出されると、実行中のジェネレーターの終了処理を行い、一覧を空にします。" -#: ../../library/asyncio-dev.rst:367 msgid "" "The asynchronous generator invokes the corresponding system hook during its " "first iteration. At the same time, the generator records that the hook has " "been called and does not call it again." msgstr "" +"非同期ジェネレーターは、最初のイテレーションで対応するシステムフックを呼び出" +"します。\n" +"同時に、フックを呼び出したことを記録し、以後は再び呼び出しません。" #: ../../library/asyncio-dev.rst:371 msgid "" @@ -612,7 +737,6 @@ msgstr "" msgid "Consider the following example::" msgstr "次に示す例について考えてみてください。::" -#: ../../library/asyncio-dev.rst:379 msgid "" "import asyncio\n" "\n" @@ -628,8 +752,20 @@ msgid "" " print(runner.run(anext(agen)))\n" " del agen" msgstr "" +"import asyncio\n" +"\n" +"async def agenfn():\n" +" try:\n" +" yield 10\n" +" finally:\n" +" await asyncio.sleep(0)\n" +"\n" +"\n" +"with asyncio.Runner() as runner:\n" +" agen = agenfn()\n" +" print(runner.run(anext(agen)))\n" +" del agen" -#: ../../library/asyncio-dev.rst:395 msgid "" "10\n" "Exception ignored while closing generator :\n" +"Traceback (most recent call last):\n" +" File \"example.py\", line 13, in \n" +" del agen\n" +" ^^^^\n" +"RuntimeError: async generator ignored GeneratorExit" -#: ../../library/asyncio-dev.rst:403 msgid "This example can be fixed as follows::" -msgstr "" +msgstr "この例は次のように修正できます。 ::" -#: ../../library/asyncio-dev.rst:405 msgid "" "import asyncio\n" "\n" @@ -662,10 +804,23 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def agenfn():\n" +" try:\n" +" yield 10\n" +" finally:\n" +" await asyncio.sleep(0)\n" +"\n" +"async def main():\n" +" agen = agenfn()\n" +" print(await anext(agen))\n" +" del agen\n" +"\n" +"asyncio.run(main())" -#: ../../library/asyncio-dev.rst:422 msgid "Avoid concurrent iteration and closure of the same generator" -msgstr "" +msgstr "同じジェネレーターのイテレーションとクローズを並行して行わない" #: ../../library/asyncio-dev.rst:424 msgid "" @@ -674,11 +829,9 @@ msgid "" "lead to an inconsistent state of the async generator and can cause errors." msgstr "" -#: ../../library/asyncio-dev.rst:429 msgid "Let's consider the following example::" -msgstr "" +msgstr "次の例を考えてみてください。 ::" -#: ../../library/asyncio-dev.rst:431 msgid "" "import asyncio\n" "\n" @@ -699,8 +852,25 @@ msgid "" "\n" "asyncio.run(amain())" msgstr "" +"import asyncio\n" +"\n" +"async def consumer():\n" +" for idx in range(100):\n" +" await asyncio.sleep(0)\n" +" message = yield idx\n" +" print('received', message)\n" +"\n" +"async def amain():\n" +" agenerator = consumer()\n" +" await agenerator.asend(None)\n" +"\n" +" fa = asyncio.create_task(agenerator.asend('A'))\n" +" fb = asyncio.create_task(agenerator.asend('B'))\n" +" await fa\n" +" await fb\n" +"\n" +"asyncio.run(amain())" -#: ../../library/asyncio-dev.rst:452 msgid "" "received A\n" "Traceback (most recent call last):\n" @@ -720,9 +890,27 @@ msgid "" " await fb\n" "RuntimeError: anext(): asynchronous generator is already running" msgstr "" +"received A\n" +"Traceback (most recent call last):\n" +" File \"test.py\", line 38, in \n" +" asyncio.run(amain())\n" +" ~~~~~~~~~~~^^^^^^^^^\n" +" File \"Lib/asyncio/runners.py\", line 204, in run\n" +" return runner.run(main)\n" +" ~~~~~~~~~~^^^^^^\n" +" File \"Lib/asyncio/runners.py\", line 127, in run\n" +" return self._loop.run_until_complete(task)\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n" +" File \"Lib/asyncio/base_events.py\", line 719, in run_until_complete\n" +" return future.result()\n" +" ~~~~~~~~~~~~~^^\n" +" File \"test.py\", line 36, in amain\n" +" await fb\n" +"RuntimeError: anext(): asynchronous generator is already running" -#: ../../library/asyncio-dev.rst:471 msgid "" "Therefore, it is recommended to avoid using asynchronous generators in " "parallel tasks or across multiple event loops." msgstr "" +"そのため、並行して動くタスクや複数のイベントループで非同期ジェネレーターを共" +"有して使うことは避けるよう推奨します。" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index d861af5cf..d3236717d 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -75,29 +75,29 @@ msgstr "以下の低水準関数はイベントループの取得、設定、生 msgid "Return the running event loop in the current OS thread." msgstr "現在の OS スレッドで実行中のイベントループを取得します。" -#: ../../library/asyncio-eventloop.rst:36 msgid "Raise a :exc:`RuntimeError` if there is no running event loop." -msgstr "" +msgstr "実行中のイベントループがなければ :exc:`RuntimeError` を送出します。" -#: ../../library/asyncio-eventloop.rst:38 msgid "This function can only be called from a coroutine or a callback." -msgstr "" +msgstr "この関数は、コルーチンまたはコールバックからのみ呼び出せます。" #: ../../library/asyncio-eventloop.rst:44 msgid "Get the current event loop." msgstr "現在のイベントループを取得します。" -#: ../../library/asyncio-eventloop.rst:46 msgid "" "When called from a coroutine or a callback (e.g. scheduled with call_soon or " "similar API), this function will always return the running event loop." msgstr "" +"コルーチンまたはコールバック (``call_soon()`` などの API でスケジュールしたも" +"の) から呼び出すと、常に実行中のイベントループを返します。" -#: ../../library/asyncio-eventloop.rst:50 msgid "" "If there is no running event loop set, the function will return the result " "of the ``get_event_loop_policy().get_event_loop()`` call." msgstr "" +"実行中のイベントループがなければ、``get_event_loop_policy()." +"get_event_loop()`` の呼び出し結果を返します。" #: ../../library/asyncio-eventloop.rst:53 msgid "" @@ -109,24 +109,28 @@ msgstr "" "なため、コルーチンやコールバックでは :func:`get_event_loop` よりも :func:" "`get_running_loop` を使うほうが好ましいと考えられます。" -#: ../../library/asyncio-eventloop.rst:58 msgid "" "As noted above, consider using the higher-level :func:`asyncio.run` " "function, instead of using these lower level functions to manually create " "and close an event loop." msgstr "" +"前述のとおり、これらの低水準関数でイベントループを手動で作成・クローズする代" +"わりに、より高水準な :func:`asyncio.run` の使用を検討してください。" -#: ../../library/asyncio-eventloop.rst:62 msgid "Raises a :exc:`RuntimeError` if there is no current event loop." msgstr "" +"現在のイベントループがなければ :exc:`RuntimeError` を送出するようになりまし" +"た。" -#: ../../library/asyncio-eventloop.rst:67 msgid "" "The :mod:`!asyncio` policy system is deprecated and will be removed in " "Python 3.16; from there on, this function will return the current running " "event loop if present else it will return the loop set by :func:" "`set_event_loop`." msgstr "" +":mod:`!asyncio` のポリシーシステムは非推奨で、Python 3.16 で削除されます。\n" +"それ以降、この関数は実行中のイベントループがあればそれを返し、なければ :func:" +"`set_event_loop` で設定したループを返します。" #: ../../library/asyncio-eventloop.rst:74 msgid "Set *loop* as the current event loop for the current OS thread." @@ -191,9 +195,8 @@ msgid "" "The `Examples`_ section showcases how to work with some event loop APIs." msgstr "`使用例`_ 節ではイベントループ API の具体的な使い方を紹介しています。" -#: ../../library/asyncio-eventloop.rst:109 msgid "Event loop methods" -msgstr "" +msgstr "イベントループのメソッド" #: ../../library/asyncio-eventloop.rst:111 msgid "Event loops have **low-level** APIs for the following:" @@ -203,10 +206,8 @@ msgstr "イベントループは以下の **低水準な** API を持ってい msgid "Running and stopping the loop" msgstr "ループの開始と停止" -#: ../../library/asyncio-eventloop.rst:123 msgid "Run until the *future* (an instance of :class:`Future`) has completed." -msgstr "" -"*フューチャー* (:class:`Future` インスタンス) が完了するまで実行します。" +msgstr "*future* (:class:`Future` のインスタンス) が完了するまで実行します。" #: ../../library/asyncio-eventloop.rst:126 msgid "" @@ -318,7 +319,6 @@ msgstr ":func:`asyncio.run` を使った場合はこの関数を呼び出す必 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/asyncio-eventloop.rst:185 msgid "" "try:\n" " loop.run_forever()\n" @@ -326,34 +326,46 @@ msgid "" " loop.run_until_complete(loop.shutdown_asyncgens())\n" " loop.close()" msgstr "" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.run_until_complete(loop.shutdown_asyncgens())\n" +" loop.close()" -#: ../../library/asyncio-eventloop.rst:196 msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " "this method has been called, using the default executor with :meth:`loop." "run_in_executor` will raise a :exc:`RuntimeError`." msgstr "" +"デフォルトの Executor の終了をスケジュールし、:class:`~concurrent.futures." +"ThreadPoolExecutor` のすべてのスレッドの終了を待ちます。\n" +"このメソッドを呼び出した後で :meth:`loop.run_in_executor` によりデフォルトの " +"Executor を使うと、:exc:`RuntimeError` が送出されます。" -#: ../../library/asyncio-eventloop.rst:202 msgid "" "The *timeout* parameter specifies the amount of time (in :class:`float` " "seconds) the executor will be given to finish joining. With the default, " "``None``, the executor is allowed an unlimited amount of time." msgstr "" +"*timeout* は、Executor のスレッドの終了を待つ制限時間を秒単位の :class:" +"`float` で指定します。\n" +"デフォルトの ``None`` では、待ち時間に制限はありません。" -#: ../../library/asyncio-eventloop.rst:207 msgid "" "If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the " "default executor is terminated without waiting for its threads to finish " "joining." msgstr "" +"*timeout* に達すると :exc:`RuntimeWarning` を出し、スレッドの終了を待たずにデ" +"フォルトの Executor の終了処理を行います。" -#: ../../library/asyncio-eventloop.rst:213 msgid "" "Do not call this method when using :func:`asyncio.run`, as the latter " "handles default executor shutdown automatically." msgstr "" +":func:`asyncio.run` はデフォルトの Executor の終了処理を自動的に行うため、こ" +"れを使う場合はこのメソッドを呼び出さないでください。" #: ../../library/asyncio-eventloop.rst:218 msgid "Added the *timeout* parameter." @@ -387,30 +399,38 @@ msgstr "" "コールバックは登録された順に呼び出されます。各コールバックは厳密に1回だけ呼び" "出されます。" -#: ../../library/asyncio-eventloop.rst:235 msgid "" "The optional keyword-only *context* argument specifies a custom :class:" "`contextvars.Context` for the *callback* to run in. Callbacks use the " "current context when no *context* is provided." msgstr "" +"省略可能なキーワード専用引数 *context* には、*callback* の実行に使う :class:" +"`contextvars.Context` を指定します。\n" +"*context* を指定しなければ、現在のコンテキストを使います。" -#: ../../library/asyncio-eventloop.rst:239 msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." msgstr "" +":meth:`call_soon_threadsafe` とは異なり、このメソッドはスレッドセーフではあり" +"ません。" -#: ../../library/asyncio-eventloop.rst:243 msgid "" "A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from " "another thread, this function *must* be used, since :meth:`call_soon` is not " "thread-safe." msgstr "" +":meth:`call_soon` のスレッドセーフな版です。\n" +":meth:`call_soon` はスレッドセーフではないため、別のスレッドからコールバック" +"をスケジュールする場合は *必ず* この関数を使ってください。" -#: ../../library/asyncio-eventloop.rst:247 msgid "" "This function is safe to be called from a reentrant context or signal " "handler, however, it is not safe or fruitful to use the returned handle in " "such contexts." msgstr "" +"この関数は、再入可能なコンテキストやシグナルハンドラーから安全に呼び出せま" +"す。\n" +"ただし、そのようなコンテキストで返されたハンドルを使うことは、安全でも有用で" +"もありません。" #: ../../library/asyncio-eventloop.rst:250 msgid "" @@ -448,12 +468,14 @@ msgstr "" "をコールバックに渡すことを許していません。キーワード引数を渡すためには :func:" "`functools.partial` を使ってください:" -#: ../../library/asyncio-eventloop.rst:268 msgid "" "# will schedule \"print(\"Hello\", flush=True)\"\n" "loop.call_soon(\n" " functools.partial(print, \"Hello\", flush=True))" msgstr "" +"# print(\"Hello\", flush=True) をスケジュールする\n" +"loop.call_soon(\n" +" functools.partial(print, \"Hello\", flush=True))" #: ../../library/asyncio-eventloop.rst:272 msgid "" @@ -502,12 +524,14 @@ msgstr "" "*callback* は厳密に一度だけ呼び出されます。2つのコールバックが完全に同じ時間" "にスケジュールされた場合、呼び出しの順序は未定義です。" -#: ../../library/asyncio-eventloop.rst:299 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. Use :func:`functools.partial` :ref:`to pass keyword arguments " "` to *callback*." msgstr "" +"省略可能な位置引数 *args* は、コールバックの呼び出し時に渡されます。\n" +"*callback* に :ref:`キーワード引数を渡す ` には、:" +"func:`functools.partial` を使ってください。" #: ../../library/asyncio-eventloop.rst:304 msgid "" @@ -519,12 +543,14 @@ msgstr "" "する際のコンテキスト :class:`contextvars.Context` を設定することができます。" "コンテキスト *context* が指定されない場合は現在のコンテキストが使われます。" -#: ../../library/asyncio-eventloop.rst:310 msgid "" "For performance, callbacks scheduled with :meth:`loop.call_later` may run up " "to one clock-resolution early (see ``time.get_clock_info('monotonic')." "resolution``)." msgstr "" +"性能上の理由から、:meth:`loop.call_later` でスケジュールしたコールバックは、" +"時計の分解能の 1 単位分だけ早く実行される可能性があります (``time." +"get_clock_info('monotonic').resolution`` を参照)。" #: ../../library/asyncio-eventloop.rst:318 msgid "" @@ -547,12 +573,14 @@ msgstr "" msgid "This method's behavior is the same as :meth:`call_later`." msgstr "このメソッドの振る舞いは :meth:`call_later` と同じです。" -#: ../../library/asyncio-eventloop.rst:336 msgid "" "For performance, callbacks scheduled with :meth:`loop.call_at` may run up to " "one clock-resolution early (see ``time.get_clock_info('monotonic')." "resolution``)." msgstr "" +"性能上の理由から、:meth:`loop.call_at` でスケジュールしたコールバックは、時計" +"の分解能の 1 単位分だけ早く実行される可能性があります (``time." +"get_clock_info('monotonic').resolution`` を参照)。" #: ../../library/asyncio-eventloop.rst:344 msgid "" @@ -585,9 +613,8 @@ msgstr "" msgid "The :func:`asyncio.sleep` function." msgstr "関数 :func:`asyncio.sleep`。" -#: ../../library/asyncio-eventloop.rst:365 msgid "Creating futures and tasks" -msgstr "" +msgstr "Future とタスクの作成" #: ../../library/asyncio-eventloop.rst:369 msgid "Create an :class:`asyncio.Future` object attached to the event loop." @@ -620,12 +647,15 @@ msgstr "" "サードパーティのイベントループは相互運用のための自身の :class:`Task` のサブク" "ラスを使用できます。この場合、結果は :class:`Task` のサブクラスになります。" -#: ../../library/asyncio-eventloop.rst:386 msgid "" "The full function signature is largely the same as that of the :class:`Task` " "constructor (or factory) - all of the keyword arguments to this function are " "passed through to that interface." msgstr "" +"関数のシグネチャ全体は :class:`Task` のコンストラクター (またはファクトリー) " +"とほぼ同じです。\n" +"この関数に渡したキーワード引数はすべて、そのコンストラクターやファクトリーに" +"渡されます。" #: ../../library/asyncio-eventloop.rst:390 msgid "" @@ -645,13 +675,17 @@ msgstr "" "の :class:`contextvars.Context` を指定できます。*context* が省略された場合、" "現在のコンテキストのコピーが作成されます。" -#: ../../library/asyncio-eventloop.rst:397 msgid "" "An optional keyword-only *eager_start* argument allows specifying if the " "task should execute eagerly during the call to create_task, or be scheduled " "later. If *eager_start* is not passed the mode set by :meth:`loop." "set_task_factory` will be used." msgstr "" +"省略可能なキーワード専用引数 *eager_start* では、``create_task()`` の呼び出し" +"中にタスクの実行を即座に開始するか、後で実行するようにスケジュールするかを指" +"定できます。\n" +"*eager_start* を渡さない場合は :meth:`loop.set_task_factory` で設定したモード" +"を使います。" #: ../../library/asyncio-eventloop.rst:402 msgid "Added the *name* parameter." @@ -661,30 +695,34 @@ msgstr "*name* パラメータを追加しました。" msgid "Added the *context* parameter." msgstr "*context* パラメータを追加しました。" -#: ../../library/asyncio-eventloop.rst:408 msgid "" "Added ``kwargs`` which passes on arbitrary extra parameters, including " "``name`` and ``context``." msgstr "" +"``name`` と ``context`` を含む任意の追加パラメーターを渡す ``kwargs`` が追加" +"されました。" -#: ../../library/asyncio-eventloop.rst:411 msgid "" "Rolled back the change that passes on *name* and *context* (if it is None), " "while still passing on other arbitrary keyword arguments (to avoid breaking " "backwards compatibility with 3.13.3)." msgstr "" +"*name* と、値が ``None`` の場合の *context* を渡す変更を取り消しました。\n" +"それ以外の任意のキーワード引数は、3.13.3 との後方互換性を保つため、引き続き渡" +"されます。" -#: ../../library/asyncio-eventloop.rst:415 msgid "" "All *kwargs* are now passed on. The *eager_start* parameter works with eager " "task factories." msgstr "" +"すべての *kwargs* を渡すようになりました。\n" +"*eager_start* パラメーターは、タスクを即座に実行するファクトリーで機能しま" +"す。" #: ../../library/asyncio-eventloop.rst:420 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr ":meth:`loop.create_task` が使用するタスクファクトリーを設定します。" -#: ../../library/asyncio-eventloop.rst:423 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " @@ -692,22 +730,32 @@ msgid "" "*coro* is a coroutine object. The callable must pass on all *kwargs*, and " "return a :class:`asyncio.Task`-compatible object." msgstr "" +"*factory* が ``None`` の場合は、デフォルトのタスクファクトリーを設定しま" +"す。\n" +"それ以外の場合、*factory* はシグネチャが ``(loop, coro, **kwargs)`` に対応す" +"る *呼び出し可能オブジェクト* でなければなりません。\n" +"ここで *loop* は使用するイベントループへの参照、*coro* はコルーチンオブジェク" +"トです。\n" +"この呼び出し可能オブジェクトは、すべての *kwargs* を呼び出し先に渡し、:class:" +"`asyncio.Task` と互換性のあるオブジェクトを返す必要があります。" -#: ../../library/asyncio-eventloop.rst:429 msgid "Required that all *kwargs* are passed on to :class:`asyncio.Task`." msgstr "" +"すべての *kwargs* を :class:`asyncio.Task` に渡すことが必須になりました。" -#: ../../library/asyncio-eventloop.rst:432 msgid "" "*name* is no longer passed to task factories. *context* is no longer passed " "to task factories if it is ``None``." msgstr "" +"*name* をタスクファクトリーに渡さなくなりました。\n" +"*context* も、値が ``None`` の場合は渡さなくなりました。" -#: ../../library/asyncio-eventloop.rst:436 msgid "" "*name* and *context* are now unconditionally passed on to task factories " "again." msgstr "" +"*name* と *context* を、再び無条件にタスクファクトリーに渡すようになりまし" +"た。" #: ../../library/asyncio-eventloop.rst:441 msgid "Return a task factory or ``None`` if the default one is in use." @@ -837,17 +885,16 @@ msgstr "" "致確認は行われません (これは深刻なセキュリティリスクであり、中間者攻撃を受け" "る可能性があります)。" -#: ../../library/asyncio-eventloop.rst:506 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " "these should all be integers from the corresponding :mod:`socket` module " "constants." msgstr "" -"*family*, *proto*, *flags* は任意のアドレスファミリであり、*host* 解決のため" -"の getaddrinfo() 経由で渡されるプロトコルおよびフラグになります。このオプショ" -"ンが与えられた場合、これらはすべて :mod:`socket` モジュール定数に従った整数で" -"なければなりません。" +"*family*、*proto*、*flags* は省略可能な引数で、それぞれアドレスファミリー、プ" +"ロトコル、フラグを指定します。\n" +"*host* の名前解決のために ``getaddrinfo()`` に渡されます。\n" +"指定する場合は、:mod:`socket` モジュールの対応する整数定数を使ってください。" #: ../../library/asyncio-eventloop.rst:511 msgid "" @@ -895,14 +942,14 @@ msgstr "" "*port*、 *family*、 *proto*、 *flags*、 *happy_eyeballs_delay*、 " "*interleave* および *local_addr* のいずれも指定してはいけません。" -#: ../../library/asyncio-eventloop.rst:536 -#: ../../library/asyncio-eventloop.rst:662 -#: ../../library/asyncio-eventloop.rst:910 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." "BaseTransport.close` method." msgstr "" +"*sock* 引数を渡すと、ソケットの所有権は作成されたトランスポートに移ります。\n" +"ソケットを閉じるには、トランスポートの :meth:`~asyncio.BaseTransport.close` " +"メソッドを呼び出してください。" #: ../../library/asyncio-eventloop.rst:540 msgid "" @@ -926,17 +973,15 @@ msgstr "" "の) 待ち時間を秒単位で指定します。指定した待ち時間を超えると接続は中断しま" "す。 ``None`` が与えられた場合はデフォルト値 ``60.0`` が使われます。" -#: ../../library/asyncio-eventloop.rst:548 -#: ../../library/asyncio-eventloop.rst:817 -#: ../../library/asyncio-eventloop.rst:921 -#: ../../library/asyncio-eventloop.rst:1010 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" +"*ssl_shutdown_timeout* は、接続を中断する前に SSL の終了処理を待つ時間を秒単" +"位で指定します。\n" +"``None`` (デフォルト) の場合は ``30.0`` 秒です。" -#: ../../library/asyncio-eventloop.rst:552 msgid "" "*all_errors* determines what exceptions are raised when a connection cannot " "be created. By default, only a single ``Exception`` is raised: the first " @@ -945,6 +990,12 @@ msgid "" "``True``, an ``ExceptionGroup`` will be raised containing all exceptions " "(even if there is only one)." msgstr "" +"*all_errors* は、接続を確立できなかった場合に送出する例外を指定します。\n" +"デフォルトでは ``Exception`` を一つだけ送出します。\n" +"例外が一つだけの場合や、すべてのエラーメッセージが同じ場合は最初の例外、それ" +"以外の場合はエラーメッセージをまとめた一つの ``OSError`` です。\n" +"``all_errors`` が ``True`` の場合、すべての例外を含む ``ExceptionGroup`` を送" +"出します (例外が一つだけでも同じです)。" #: ../../library/asyncio-eventloop.rst:562 #: ../../library/asyncio-eventloop.rst:829 @@ -969,7 +1020,6 @@ msgstr "*ssl_handshake_timeout* 引数が追加されました。" msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "*happy_eyeballs_delay* と *interleave* が追加されました。" -#: ../../library/asyncio-eventloop.rst:577 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -979,6 +1029,15 @@ msgid "" "This document specifies requirements for algorithms that reduce this user-" "visible delay and provides an algorithm." msgstr "" +"Happy Eyeballs アルゴリズム: デュアルスタックホストでの接続を成功させる方" +"法。\n" +"サーバーへの IPv4 の経路とプロトコルが機能していても、IPv6 の経路とプロトコル" +"が機能していないと、デュアルスタックのクライアントアプリケーションでは、IPv4 " +"専用のクライアントに比べて接続が大幅に遅れることがあります。\n" +"デュアルスタックのクライアントで利用者の使い勝手が悪くなるため、これは望まし" +"くありません。\n" +"この文書は、利用者に見えるこの遅延を減らすアルゴリズムの要件を定め、一つのア" +"ルゴリズムを示します。" #: ../../library/asyncio-eventloop.rst:586 msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" @@ -998,11 +1057,12 @@ msgstr "*ssl_shutdown_timeout* パラメータが追加されました。" msgid "*all_errors* was added." msgstr "*all_errors* が追加されました" -#: ../../library/asyncio-eventloop.rst:595 msgid "" "Raises a ``ValueError`` if ``ssl.check_hostname`` is ``True`` and " "``server_hostname`` is not supplied." msgstr "" +"``ssl.check_hostname`` が ``True`` で、``server_hostname`` が指定されていない" +"場合に ``ValueError`` を送出するようになりました。" #: ../../library/asyncio-eventloop.rst:601 msgid "" @@ -1057,11 +1117,12 @@ msgstr "" "``(local_host, local_port)`` のタプルを指定します。 *local_host* と " "*local_port* は :meth:`getaddrinfo` メソッドを使用して検索されます。" -#: ../../library/asyncio-eventloop.rst:633 msgid "" "On Windows, when using the proactor event loop with ``local_addr=None``, an :" "exc:`OSError` with :attr:`!errno.WSAEINVAL` will be raised when running it." msgstr "" +"Windows で Proactor イベントループを使い、``local_addr=None`` として実行する" +"と、:attr:`!errno.WSAEINVAL` の :exc:`OSError` が送出されます。" msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " @@ -1072,17 +1133,16 @@ msgstr "" "``(remote_host, remote_port)`` タプルを渡します。\n" "*remote_host* と *remote_port* は :meth:`getaddrinfo` を使って検索されます。" -#: ../../library/asyncio-eventloop.rst:641 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " "given, these should all be integers from the corresponding :mod:`socket` " "module constants." msgstr "" -"*family*, *proto*, *flags* は任意のアドレスファミリです。これらのファミリ、プ" -"ロトコル、フラグは、*host* 解決のため :meth:`getaddrinfo` 経由でオプションで" -"渡されます。これらのオプションを指定する場合、すべて :mod:`socket` モジュール" -"定数に従った整数でなければなりません。" +"*family*、*proto*、*flags* は省略可能な引数で、それぞれアドレスファミリー、プ" +"ロトコル、フラグを指定します。\n" +"*host* の名前解決のために :meth:`getaddrinfo` に渡されます。\n" +"指定する場合は、:mod:`socket` モジュールの対応する整数定数を使ってください。" #: ../../library/asyncio-eventloop.rst:646 msgid "" @@ -1173,11 +1233,12 @@ msgstr "" "SO_REUSEPORT ` を使っており、複数のプロセスが異なる " "UID で同一のソケットに対して割り当てられるのを明確に禁止します。" -#: ../../library/asyncio-eventloop.rst:693 msgid "" "The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" +"Python 3.8.1、3.7.6、3.6.10 以降で無効になっていた *reuse_address* パラメー" +"ターが、完全に削除されました。" #: ../../library/asyncio-eventloop.rst:703 msgid "Create a Unix connection." @@ -1212,21 +1273,23 @@ msgstr "" msgid "Availability" msgstr "利用可能な環境" -#: ../../library/asyncio-eventloop.rst:720 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" +"*ssl_handshake_timeout* パラメーターが追加されました。\n" +"*path* パラメーターに :term:`path-like object` を指定できるようになりました。" #: ../../library/asyncio-eventloop.rst:730 msgid "Creating network servers" msgstr "ネットワークサーバの生成" -#: ../../library/asyncio-eventloop.rst:746 msgid "" "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" +"アドレス *host* のポート *port* で接続を待ち受ける TCP サーバー (ソケットタイ" +"プ :const:`~socket.SOCK_STREAM`) を作成します。" #: ../../library/asyncio-eventloop.rst:749 msgid "Returns a :class:`Server` object." @@ -1269,20 +1332,27 @@ msgstr "" "*host* が空の文字列か ``None`` の場合、すべてのインターフェースが想定され、複" "合的なソケットのリスト (通常は一つが IPv4、もう一つが IPv6) が返されます。" -#: ../../library/asyncio-eventloop.rst:769 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " "selected (note that if *host* resolves to multiple network interfaces, a " "different random port will be selected for each interface)." msgstr "" +"*port* パラメーターには、サーバーが待ち受けるポートを指定できます。\n" +"``0`` または ``None`` (デフォルト) の場合、未使用のポートがランダムに選ばれま" +"す。\n" +"*host* が複数のネットワークインターフェースに解決される場合は、インターフェー" +"スごとに異なるランダムなポートが選ばれることに注意してください。" -#: ../../library/asyncio-eventloop.rst:774 msgid "" "*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." msgstr "" +"*family* に :const:`socket.AF_INET` または :const:`~socket.AF_INET6` を指定す" +"ると、ソケットでそれぞれ IPv4 または IPv6 を使うよう強制できます。\n" +"指定しなければホスト名から決まり、デフォルト値は :const:`~socket.AF_UNSPEC` " +"です。" #: ../../library/asyncio-eventloop.rst:779 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." @@ -1297,11 +1367,13 @@ msgstr "" "*sock* にソケットオブジェクトを設定することができます。指定した場合、 *host* " "と *port* を指定してはいけません。" -#: ../../library/asyncio-eventloop.rst:786 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" +"*sock* 引数を渡すと、ソケットの所有権は作成されたサーバーに移ります。\n" +"ソケットを閉じるには、サーバーの :meth:`~asyncio.Server.close` メソッドを呼び" +"出してください。" #: ../../library/asyncio-eventloop.rst:790 msgid "" @@ -1342,15 +1414,15 @@ msgstr "" "SO_REUSEPORT を使用します)。このオプションは、Windows ではサポートされていま" "せん。" -#: ../../library/asyncio-eventloop.rst:806 msgid "" "*keep_alive* set to ``True`` keeps connections active by enabling the " "periodic transmission of messages." msgstr "" +"*keep_alive* を ``True`` にすると、定期的なメッセージ送信を有効にして接続を維" +"持します。" -#: ../../library/asyncio-eventloop.rst:811 msgid "Added the *keep_alive* parameter." -msgstr "" +msgstr "*keep_alive* パラメーターが追加されました。" #: ../../library/asyncio-eventloop.rst:813 msgid "" @@ -1378,12 +1450,14 @@ msgstr "" msgid "The *host* parameter can be a sequence of strings." msgstr "*host* パラメータに文字列のシーケンスを指定できるようになりました。" -#: ../../library/asyncio-eventloop.rst:837 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :ref:`socket.TCP_NODELAY ` is set by default " "for all TCP connections." msgstr "" +"*ssl_handshake_timeout* と *start_serving* パラメーターが追加されました。\n" +"すべての TCP 接続で、デフォルトでソケットオプション :ref:`socket.TCP_NODELAY " +"` を設定するようになりました。" #: ../../library/asyncio-eventloop.rst:847 msgid "" @@ -1395,11 +1469,12 @@ msgstr "" "`StreamReader` と :class:`StreamWriter` のペアを返し、async/await コードから" "使うことができます。" -#: ../../library/asyncio-eventloop.rst:859 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." msgstr "" +":meth:`loop.create_server` と似ていますが、ソケットファミリー :py:const:" +"`~socket.AF_UNIX` を使います。" #: ../../library/asyncio-eventloop.rst:862 msgid "" @@ -1411,12 +1486,14 @@ msgstr "" "須です。 抽象 Unix ソケット、 :class:`str`、 :class:`bytes`、 and :class:" "`~pathlib.Path` 形式でのパスがサポートされています。" -#: ../../library/asyncio-eventloop.rst:867 msgid "" "If *cleanup_socket* is true then the Unix socket will automatically be " "removed from the filesystem when the server is closed, unless the socket has " "been replaced after the server has been created." msgstr "" +"*cleanup_socket* が真の場合、サーバーを閉じると Unix ソケットをファイルシステ" +"ムから自動的に削除します。\n" +"ただし、サーバーを作成した後にソケットが置き換えられていれば削除しません。" #: ../../library/asyncio-eventloop.rst:871 msgid "" @@ -1426,15 +1503,16 @@ msgstr "" "このメソッドの引数についての詳細は :meth:`loop.create_server` メソッドのド" "キュメントを参照してください。" -#: ../../library/asyncio-eventloop.rst:878 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." msgstr "" +"*ssl_handshake_timeout* と *start_serving* パラメーターが追加されました。\n" +"*path* パラメーターに :class:`~pathlib.Path` オブジェクトを指定できるようにな" +"りました。" -#: ../../library/asyncio-eventloop.rst:887 msgid "Added the *cleanup_socket* parameter." -msgstr "" +msgstr "*cleanup_socket* パラメーターが追加されました。" #: ../../library/asyncio-eventloop.rst:895 msgid "Wrap an already accepted connection into a transport/protocol pair." @@ -1540,34 +1618,41 @@ msgstr "" "システムが *sendfile* システムコールをサポートしておらず、かつ *fallback* が " "``False`` の場合、 :exc:`SendfileNotAvailableError` 例外を送出します。" -#: ../../library/asyncio-eventloop.rst:970 msgid "TLS upgrade" -msgstr "" +msgstr "TLS へのアップグレード" #: ../../library/asyncio-eventloop.rst:978 msgid "Upgrade an existing transport-based connection to TLS." msgstr "既存のトランスポートベースの接続を TLS にアップグレードします。" -#: ../../library/asyncio-eventloop.rst:980 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" +"TLS のエンコード・デコードを行うインスタンスを作成し、*transport* と " +"*protocol* の間に挿入します。\n" +"このインスタンスは、*transport* に対するプロトコルと、*protocol* に対するトラ" +"ンスポートの両方のインターフェースを実装します。" -#: ../../library/asyncio-eventloop.rst:984 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " "object only because the coder caches *protocol*-side data and sporadically " "exchanges extra TLS session packets with *transport*." msgstr "" +"作成した、二つのインターフェースを持つインスタンスを返します。\n" +"*await* の後、*protocol* は元の *transport* の使用をやめ、返されたオブジェク" +"トだけを使って通信する必要があります。\n" +"エンコーダーが *protocol* 側のデータをキャッシュし、必要に応じて追加の TLS " +"セッションパケットを *transport* と交換するためです。" -#: ../../library/asyncio-eventloop.rst:989 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "" +"渡されたトランスポートがすでに終了処理中である場合など、状況によっては " +"``None`` を返すことがあります。" #: ../../library/asyncio-eventloop.rst:994 msgid "" @@ -1609,25 +1694,27 @@ msgstr "" "ファイル記述子 *fd* に対する読み込みが可能かどうかの監視を開始し、 *fd* が読" "み込み可能になると、指定した引数でコールバック *callback* を呼び出します。" -#: ../../library/asyncio-eventloop.rst:1031 -#: ../../library/asyncio-eventloop.rst:1045 msgid "" "Any preexisting callback registered for *fd* is cancelled and replaced by " "*callback*." msgstr "" +"*fd* にすでに登録されているコールバックがあれば、キャンセルして *callback* に" +"置き換えます。" -#: ../../library/asyncio-eventloop.rst:1036 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" +"ファイル記述子 *fd* が読み込み可能になるのを監視する処理を停止します。\n" +"それまで *fd* の読み込みを監視していた場合は ``True`` を返します。" -#: ../../library/asyncio-eventloop.rst:1041 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments *args* once *fd* is available for " "writing." msgstr "" +"ファイル記述子 *fd* が書き込み可能になるのを監視し始めます。\n" +"書き込み可能になると、指定した引数 *args* で *callback* を呼び出します。" #: ../../library/asyncio-eventloop.rst:1048 #: ../../library/asyncio-eventloop.rst:1367 @@ -1638,11 +1725,12 @@ msgstr "" "コールバック *callback* に :ref:`キーワード引数を渡す ` 場合は :func:`functools.partial` を使ってください。" -#: ../../library/asyncio-eventloop.rst:1053 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" +"ファイル記述子 *fd* が書き込み可能になるのを監視する処理を停止します。\n" +"それまで *fd* の書き込みを監視していた場合は ``True`` を返します。" #: ../../library/asyncio-eventloop.rst:1056 msgid "" @@ -1694,15 +1782,15 @@ msgstr "受信したデータをバイトオブジェクトとして返します msgid "*sock* must be a non-blocking socket." msgstr "*sock* はノンブロッキングソケットでなければなりません。" -#: ../../library/asyncio-eventloop.rst:1080 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" "このメソッドは常にコルーチンメソッドとしてドキュメントに記載されてきました" -"が、 Python 3.7 以前のリリースでは :class:`Future` オブジェクトを返していまし" -"た。 Python 3.7 からは ``async def`` メソッドになりました。" +"が、 Python 3.7 より前のリリースでは :class:`Future` オブジェクトを返していま" +"した。\n" +"Python 3.7 からは ``async def`` メソッドになりました。" #: ../../library/asyncio-eventloop.rst:1088 msgid "" @@ -1717,25 +1805,25 @@ msgstr "" msgid "Return the number of bytes written to the buffer." msgstr "バッファに書き込んだデータのバイト数を返します。" -#: ../../library/asyncio-eventloop.rst:1100 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" +"*sock* から最大 *bufsize* バイトのデータグラムを受信します。\n" +":meth:`socket.recvfrom() ` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1103 msgid "Return a tuple of (received data, remote address)." -msgstr "" +msgstr "(受信したデータ, 送信元アドレス) のタプルを返します。" -#: ../../library/asyncio-eventloop.rst:1112 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" +"*sock* から最大 *nbytes* バイトのデータグラムを受信し、*buf* に格納します。\n" +":meth:`socket.recvfrom_into() ` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1116 msgid "Return a tuple of (number of bytes received, remote address)." -msgstr "" +msgstr "(受信したバイト数, 送信元アドレス) のタプルを返します。" #: ../../library/asyncio-eventloop.rst:1125 msgid "" @@ -1758,26 +1846,25 @@ msgstr "" "場合は例外が送出されます。エラーとなった場合、接続の受信側で正しく処理された" "データの総量を特定する方法はありません。" -#: ../../library/asyncio-eventloop.rst:1136 -#: ../../library/asyncio-eventloop.rst:1199 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" "このメソッドは常にコルーチンメソッドとしてドキュメントに記載されてきました" -"が、 Python 3.7 以前のリリースでは :class:`Future` オブジェクトを返していまし" -"た。 Python 3.7 からは ``async def`` メソッドになりました。" +"が、 Python 3.7 より前のリリースでは :class:`Future` オブジェクトを返していま" +"した。\n" +"Python 3.7 からは ``async def`` メソッドになりました。" -#: ../../library/asyncio-eventloop.rst:1144 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" +"*sock* から *address* にデータグラムを送信します。\n" +":meth:`socket.sendto() ` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1148 msgid "Return the number of bytes sent." -msgstr "" +msgstr "送信したバイト数を返します。" #: ../../library/asyncio-eventloop.rst:1157 msgid "Connect *sock* to a remote socket at *address*." @@ -1788,7 +1875,6 @@ msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr ":meth:`socket.connect() ` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1163 msgid "" "With :class:`SelectorEventLoop`, *address* does not need to be resolved: " "for :const:`~socket.AF_INET` and :const:`~socket.AF_INET6` sockets, " @@ -1796,8 +1882,12 @@ msgid "" "calling :func:`socket.inet_pton`, and uses :meth:`loop.getaddrinfo` to " "resolve it if it is not." msgstr "" +":class:`SelectorEventLoop` では、*address* を事前に名前解決する必要はありませ" +"ん。\n" +":const:`~socket.AF_INET` と :const:`~socket.AF_INET6` のソケットでは、" +"``sock_connect`` はまず :func:`socket.inet_pton` で *address* が解決済みかど" +"うかを確認し、未解決なら :meth:`loop.getaddrinfo` で解決します。" -#: ../../library/asyncio-eventloop.rst:1169 msgid "" ":class:`ProactorEventLoop`, the default event loop on Windows, does not " "resolve *address*. The host must already be a numeric IP address; passing a " @@ -1805,11 +1895,18 @@ msgid "" "getaddrinfo` first, or use :meth:`loop.create_connection`, which resolves " "the address on every platform." msgstr "" +"Windows のデフォルトである :class:`ProactorEventLoop` は、*address* の名前解" +"決を行いません。\n" +"ホストは数値の IP アドレスでなければならず、ホスト名を渡すと :exc:`OSError` " +"を送出します。\n" +"先に :meth:`loop.getaddrinfo` でアドレスを解決するか、すべてのプラットフォー" +"ムで名前解決を行う :meth:`loop.create_connection` を使ってください。" -#: ../../library/asyncio-eventloop.rst:1175 msgid "" "With :class:`SelectorEventLoop`, ``address`` no longer needs to be resolved." msgstr "" +":class:`SelectorEventLoop` では、``address`` を事前に名前解決する必要がなくな" +"りました。" #: ../../library/asyncio-eventloop.rst:1181 msgid "" @@ -1902,7 +1999,6 @@ msgstr ":meth:`socket.getaddrinfo` の非同期版です。" msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr ":meth:`socket.getnameinfo` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1256 msgid "" "Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " "versions through the loop's default thread pool executor. When this executor " @@ -1911,8 +2007,13 @@ msgid "" "consider using a custom executor for other user tasks, or setting a default " "executor with a larger number of workers." msgstr "" +"*getaddrinfo* と *getnameinfo* は、内部ではループのデフォルトのスレッドプー" +"ル Executor を通じて同期版を呼び出します。\n" +"この Executor に空きがなくなると処理が遅れ、高水準のネットワークライブラリで" +"タイムアウトが増えることがあります。\n" +"これを軽減するには、他のユーザー処理に別の Executor を使うか、ワーカー数の多" +"い Executor をデフォルトに設定することを検討してください。" -#: ../../library/asyncio-eventloop.rst:1263 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1920,9 +2021,9 @@ msgid "" "coroutines." msgstr "" "*getaddrinfo* と *getnameinfo* の2つのメソッドは、いずれも常にコルーチンメ" -"ソッドとしてドキュメントに記載されてきましたが、 Python 3.7 以前のリリースで" -"は、実際には :class:`asyncio.Future` オブジェクトを返していました。 Python " -"3.7 からはどちらのメソッドもコルーチンになりました。" +"ソッドとしてドキュメントに記載されてきましたが、 Python 3.7 より前のリリース" +"では、実際には :class:`asyncio.Future` オブジェクトを返していました。\n" +"Python 3.7 からはどちらのメソッドもコルーチンになりました。" #: ../../library/asyncio-eventloop.rst:1271 msgid "Working with pipes" @@ -1931,12 +2032,13 @@ msgstr "パイプとやりとりする" msgid "Register the read end of *pipe* in the event loop." msgstr "*pipe* の読み込み側の終端をイベントループに登録します。" -#: ../../library/asyncio-eventloop.rst:1281 -#: ../../library/asyncio-eventloop.rst:1300 msgid "" "*pipe* is a :term:`file-like object `. See :ref:`Supported " "pipe objects ` for the objects supported as *pipe*." msgstr "" +"*pipe* は :term:`ファイルライクオブジェクト ` です。\n" +"指定できるオブジェクトについては :ref:`サポートされるパイプオブジェクト " +"` を参照してください。" #: ../../library/asyncio-eventloop.rst:1285 msgid "" @@ -1969,11 +2071,9 @@ msgstr "" "`WriteTransport` のインスタンスであり、 *protocol* は *protocol_factory* ファ" "クトリでインスタンス化されたオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1314 msgid "Supported pipe objects" -msgstr "" +msgstr "サポートされるパイプオブジェクト" -#: ../../library/asyncio-eventloop.rst:1315 msgid "" "These methods only work with objects the operating system can poll for " "readiness or perform overlapped I/O on. Regular files on disk are **not** " @@ -1981,28 +2081,33 @@ msgid "" "use :meth:`loop.run_in_executor` to read and write regular files without " "blocking the event loop." msgstr "" +"これらのメソッドで扱えるのは、OS が読み書きの準備状況をポーリングできるオブ" +"ジェクト、またはオーバーラップ I/O を実行できるオブジェクトだけです。\n" +"ディスク上の通常のファイルは、どのプラットフォームでも **サポートされません" +"**。\n" +"asyncio に非同期ファイル I/O はないため、イベントループをブロックせずに通常の" +"ファイルを読み書きするには :meth:`loop.run_in_executor` を使ってください。" -#: ../../library/asyncio-eventloop.rst:1321 msgid "" "On Unix, with :class:`SelectorEventLoop`, *pipe* must wrap one of the " "following:" msgstr "" +"Unix の :class:`SelectorEventLoop` では、*pipe* は次のいずれかをラップする必" +"要があります。" -#: ../../library/asyncio-eventloop.rst:1324 msgid "" "a pipe, such as an end of an :func:`os.pipe` pair or a FIFO created with :" "func:`os.mkfifo`;" msgstr "" +":func:`os.pipe` で作成したペアの一端や、:func:`os.mkfifo` で作成した FIFO な" +"どのパイプ" -#: ../../library/asyncio-eventloop.rst:1326 msgid "a socket;" -msgstr "" +msgstr "ソケット" -#: ../../library/asyncio-eventloop.rst:1327 msgid "a character device, such as a terminal." -msgstr "" +msgstr "端末などのキャラクターデバイス" -#: ../../library/asyncio-eventloop.rst:1329 msgid "" "On Windows, where only :class:`ProactorEventLoop` implements these methods, " "*pipe* must wrap a handle opened for overlapped I/O (that is, created with " @@ -2013,6 +2118,15 @@ msgid "" "created by :func:`os.pipe` are **not** opened for overlapped I/O and " "therefore cannot be used with these methods." msgstr "" +"Windows では、これらのメソッドを実装しているのは :class:`ProactorEventLoop` " +"だけです。\n" +"ハンドルを I/O 完了ポートに関連付ける必要があるため、*pipe* はオーバーラップ " +"I/O 用に開かれたハンドル (``FILE_FLAG_OVERLAPPED`` フラグで作成したもの) を" +"ラップしなければなりません。\n" +"オーバーラップ I/O 用に開かれていないハンドルは拒否されます。\n" +"特に、標準ストリーム (:data:`sys.stdin`、:data:`sys.stdout`、:data:`sys." +"stderr`)、コンソールのハンドル、:func:`os.pipe` で作成したパイプは、オーバー" +"ラップ I/O 用には開かれていないため、これらのメソッドでは **使えません**。" #: ../../library/asyncio-eventloop.rst:1340 msgid "" @@ -2032,11 +2146,12 @@ msgstr "" msgid "Unix signals" msgstr "Unix シグナル" -#: ../../library/asyncio-eventloop.rst:1356 msgid "" "Set *callback* as the handler for the *signum* signal, passing *args* as " "positional arguments." msgstr "" +"*callback* をシグナル *signum* のハンドラーに設定し、*args* を位置引数として" +"渡します。" msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " @@ -2084,13 +2199,13 @@ msgstr ":mod:`signal` モジュール。" msgid "Executing code in thread or process pools" msgstr "スレッドまたはプロセスプールでコードを実行する" -#: ../../library/asyncio-eventloop.rst:1392 msgid "" "Arrange for *func* to be called in the specified executor passing *args* as " "positional arguments." msgstr "" +"指定した Executor 内で、*args* を位置引数として *func* を呼び出すように手配し" +"ます。" -#: ../../library/asyncio-eventloop.rst:1395 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``. The " @@ -2098,8 +2213,13 @@ msgid "" "a :class:`concurrent.futures.ThreadPoolExecutor` will be lazy-initialized " "and used by :func:`run_in_executor` if needed." msgstr "" +"*executor* 引数には :class:`concurrent.futures.Executor` のインスタンスを指定" +"します。\n" +"``None`` の場合はデフォルトの Executor を使います。\n" +"デフォルトの Executor は :meth:`loop.set_default_executor` で設定できます。\n" +"設定しなければ、:func:`run_in_executor` が必要になった時点で :class:" +"`concurrent.futures.ThreadPoolExecutor` を初期化して使います。" -#: ../../library/asyncio-eventloop.rst:1403 msgid "" "import asyncio\n" "import concurrent.futures\n" @@ -2147,14 +2267,62 @@ msgid "" "if __name__ == '__main__':\n" " asyncio.run(main())" msgstr "" +"import asyncio\n" +"import concurrent.futures\n" +"\n" +"def blocking_io():\n" +" # ログ記録などのファイル操作はイベントループをブロックする\n" +" # 可能性があるので、スレッドプールで実行する。\n" +" with open('/dev/urandom', 'rb') as f:\n" +" return f.read(100)\n" +"\n" +"def cpu_bound():\n" +" # CPU バウンドな処理はイベントループをブロックする。\n" +" # 通常はプロセスプールで実行する方がよい。\n" +" return sum(i * i for i in range(10 ** 7))\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" ## 実行方法:\n" +"\n" +" # 1. ループのデフォルトの Executor で実行する:\n" +" result = await loop.run_in_executor(\n" +" None, blocking_io)\n" +" print('default thread pool', result)\n" +"\n" +" # 2. 自分で作成したスレッドプールで実行する:\n" +" with concurrent.futures.ThreadPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, blocking_io)\n" +" print('custom thread pool', result)\n" +"\n" +" # 3. 自分で作成したプロセスプールで実行する:\n" +" with concurrent.futures.ProcessPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, cpu_bound)\n" +" print('custom process pool', result)\n" +"\n" +" # 4. 自分で作成したインタープリタプールで実行する:\n" +" with concurrent.futures.InterpreterPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, cpu_bound)\n" +" print('custom interpreter pool', result)\n" +"\n" +"if __name__ == '__main__':\n" +" asyncio.run(main())" -#: ../../library/asyncio-eventloop.rst:1449 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " "used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe " "importing of main module `." msgstr "" +"例の 3 番では、:class:`~concurrent.futures.ProcessPoolExecutor` が使う :mod:" +"`multiprocessing` の特性により、エントリーポイントのガード (``if __name__ == " +"'__main__'``) が必要です。\n" +":ref:`メインモジュールの安全なインポート ` " +"を参照してください。" #: ../../library/asyncio-eventloop.rst:1454 msgid "This method returns a :class:`asyncio.Future` object." @@ -2180,23 +2348,27 @@ msgstr "" "`~concurrent.futures.ThreadPoolExecutor`) にデフォルト値を設定させるようにな" "りました。" -#: ../../library/asyncio-eventloop.rst:1468 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`, which includes :class:`~concurrent.futures." "InterpreterPoolExecutor`." msgstr "" +"*executor* を、:meth:`run_in_executor` が使うデフォルトの Executor に設定しま" +"す。\n" +"*executor* は :class:`~concurrent.futures.ThreadPoolExecutor` のインスタンス" +"でなければなりません。\n" +"これには :class:`~concurrent.futures.InterpreterPoolExecutor` も含まれます。" -#: ../../library/asyncio-eventloop.rst:1473 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" +"*executor* は :class:`~concurrent.futures.ThreadPoolExecutor` のインスタンス" +"でなければならなくなりました。" -#: ../../library/asyncio-eventloop.rst:1479 msgid "Error handling API" -msgstr "" +msgstr "エラー処理 API" #: ../../library/asyncio-eventloop.rst:1481 msgid "Allows customizing how exceptions are handled in the event loop." @@ -2221,18 +2393,21 @@ msgstr "" "``dict`` オブジェクトです (*context* についての詳細は :meth:" "`call_exception_handler` メソッドのドキュメントを参照してください)。" -#: ../../library/asyncio-eventloop.rst:1495 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " "task or callback handle." msgstr "" +":class:`~asyncio.Task` または :class:`~asyncio.Handle` のためにハンドラーを呼" +"び出す場合、そのタスクまたはコールバックハンドルの :class:`contextvars." +"Context` で実行します。" -#: ../../library/asyncio-eventloop.rst:1501 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." msgstr "" +"例外が発生したタスクまたはハンドルの :class:`~contextvars.Context` で、ハンド" +"ラーを呼び出す場合があるようになりました。" #: ../../library/asyncio-eventloop.rst:1506 msgid "" @@ -2286,9 +2461,8 @@ msgstr "'exception' (任意): 例外オブジェクト;" msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "'future' (任意): :class:`asyncio.Future` インスタンス;" -#: ../../library/asyncio-eventloop.rst:1532 msgid "'task' (optional): :class:`asyncio.Task` instance;" -msgstr "" +msgstr "'task' (省略可能): :class:`asyncio.Task` のインスタンス" #: ../../library/asyncio-eventloop.rst:1533 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" @@ -2303,17 +2477,14 @@ msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" "'transport' (任意): :ref:`トランスポート ` インスタンス;" -#: ../../library/asyncio-eventloop.rst:1536 msgid "'socket' (optional): :class:`socket.socket` instance;" -msgstr "" +msgstr "'socket' (省略可能): :class:`socket.socket` のインスタンス" -#: ../../library/asyncio-eventloop.rst:1537 msgid "'source_traceback' (optional): Traceback of the source;" -msgstr "" +msgstr "'source_traceback' (省略可能): 生成元のトレースバック" -#: ../../library/asyncio-eventloop.rst:1538 msgid "'handle_traceback' (optional): Traceback of the handle;" -msgstr "" +msgstr "'handle_traceback' (省略可能): ハンドルのトレースバック" #: ../../library/asyncio-eventloop.rst:1539 msgid "'asyncgen' (optional): Asynchronous generator that caused" @@ -2323,11 +2494,14 @@ msgstr "" msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1544 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler` method." msgstr "" +"イベントループのサブクラスで、このメソッドをオーバーライドしないでくださ" +"い。\n" +"例外処理をカスタマイズするには :meth:`set_exception_handler` を使ってくださ" +"い。" #: ../../library/asyncio-eventloop.rst:1549 msgid "Enabling debug mode" @@ -2357,24 +2531,24 @@ msgstr "" "新しい :ref:`Python 開発モード ` を使ってデバッグモードを有効化する" "ことができるようになりました。" -#: ../../library/asyncio-eventloop.rst:1570 msgid "" "This attribute can be used to set the minimum execution duration in seconds " "that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " "are logged." msgstr "" +"この属性は、「遅い」とみなす実行時間の最小値を秒単位で設定するために使いま" +"す。\n" +"デバッグモードが有効な場合、「遅い」コールバックがログに記録されます。" -#: ../../library/asyncio-eventloop.rst:1574 msgid "Default value is 100 milliseconds." -msgstr "" +msgstr "デフォルト値は 100 ミリ秒です。" #: ../../library/asyncio-eventloop.rst:1578 msgid "The :ref:`debug mode of asyncio `." msgstr ":ref:`asyncio のデバッグモード `。" -#: ../../library/asyncio-eventloop.rst:1582 msgid "Running subprocesses" -msgstr "" +msgstr "サブプロセスの実行" #: ../../library/asyncio-eventloop.rst:1584 msgid "" @@ -2386,12 +2560,15 @@ msgstr "" "高水準の関数である :func:`asyncio.create_subprocess_shell` や :func:`asyncio." "create_subprocess_exec` を代わりに使うことを検討してください。" -#: ../../library/asyncio-eventloop.rst:1591 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" +"Windows では、デフォルトの :class:`ProactorEventLoop` はサブプロセスをサポー" +"トしますが、:class:`SelectorEventLoop` はサポートしません。\n" +"詳細は :ref:`Windows でのサブプロセスのサポート ` を参照してください。" #: ../../library/asyncio-eventloop.rst:1603 msgid "" @@ -2454,17 +2631,15 @@ msgstr "その他の引数:" msgid "*stdin* can be any of these:" msgstr "*stdin* は下記のいずれかをとることができます:" -#: ../../library/asyncio-eventloop.rst:1629 -#: ../../library/asyncio-eventloop.rst:1640 -#: ../../library/asyncio-eventloop.rst:1650 msgid "a file-like object" -msgstr "" +msgstr "ファイルライクオブジェクト" -#: ../../library/asyncio-eventloop.rst:1630 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe`" msgstr "" +"既存のファイル記述子 (正の整数)。\n" +"例えば :meth:`os.pipe` で作成したもの。" #: ../../library/asyncio-eventloop.rst:1631 #: ../../library/asyncio-eventloop.rst:1641 @@ -2532,13 +2707,16 @@ msgstr "" "していません。ストリームからテキストに変換するには :func:`bytes.decode` 関数" "を使ってください。" -#: ../../library/asyncio-eventloop.rst:1669 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" "`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use with " "the event loop." msgstr "" +"*stdin*、*stdout*、*stderr* として渡したファイルライクオブジェクトがパイプを" +"表す場合、イベントループで使うには、パイプのもう一方の端を :meth:`~loop." +"connect_write_pipe` または :meth:`~loop.connect_read_pipe` で登録してくださ" +"い。" #: ../../library/asyncio-eventloop.rst:1674 msgid "" @@ -2558,12 +2736,12 @@ msgstr "" "`asyncio.SubprocessTransport` 基底クラスに適合するオブジェクトで、 " "*protocol* は *protocol_factory* によりインスタンス化されたオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1681 -#: ../../library/asyncio-eventloop.rst:1707 msgid "" "If the transport is closed or is garbage collected, the child process is " "killed if it is still running." msgstr "" +"トランスポートを閉じた場合や、トランスポートがガベージコレクションで回収され" +"た場合、子プロセスがまだ実行中なら強制終了します。" #: ../../library/asyncio-eventloop.rst:1689 msgid "" @@ -2625,9 +2803,8 @@ msgstr "" "ください。シェルコマンドを構成する文字列内の空白文字と特殊文字のエスケープ" "は、 :func:`shlex.quote` 関数を使うと適切に行うことができます。" -#: ../../library/asyncio-eventloop.rst:1720 msgid "Callback handles" -msgstr "" +msgstr "コールバックハンドル" #: ../../library/asyncio-eventloop.rst:1724 msgid "" @@ -2637,10 +2814,11 @@ msgstr "" ":meth:`loop.call_soon` や :meth:`loop.call_soon_threadsafe` が返すコールバッ" "クのラッパーです。" -#: ../../library/asyncio-eventloop.rst:1729 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" +"ハンドルに関連付けられた :class:`contextvars.Context` オブジェクトを返しま" +"す。" #: ../../library/asyncio-eventloop.rst:1736 msgid "" @@ -2678,9 +2856,8 @@ msgstr "" "戻り値の時刻は絶対値で、 :meth:`loop.time` と同じ参照時刻を使って定義されてい" "ます。" -#: ../../library/asyncio-eventloop.rst:1763 msgid "Server objects" -msgstr "" +msgstr "サーバーオブジェクト" #: ../../library/asyncio-eventloop.rst:1765 msgid "" @@ -2692,9 +2869,8 @@ msgstr "" "create_unix_server`、 :func:`start_server` および :func:`start_unix_server` " "関数により生成されます。" -#: ../../library/asyncio-eventloop.rst:1769 msgid "Do not instantiate the :class:`Server` class directly." -msgstr "" +msgstr ":class:`Server` クラスを直接インスタンス化しないでください。" #: ../../library/asyncio-eventloop.rst:1773 msgid "" @@ -2706,7 +2882,6 @@ msgstr "" "の中で使われた場合、 ``async with`` 文が完了した時に Server オブジェクトがク" "ローズされること、およびそれ以降に接続を受け付けないことが保証されます。" -#: ../../library/asyncio-eventloop.rst:1778 msgid "" "srv = await loop.create_server(...)\n" "\n" @@ -2715,6 +2890,12 @@ msgid "" "\n" "# At this point, srv is closed and no longer accepts new connections." msgstr "" +"srv = await loop.create_server(...)\n" +"\n" +"async with srv:\n" +" # 何らかの処理\n" +"\n" +"# この時点で srv は閉じられており、新しい接続を受け付けない。" #: ../../library/asyncio-eventloop.rst:1786 msgid "Server object is an asynchronous context manager since Python 3.7." @@ -2722,11 +2903,12 @@ msgstr "" "Python 3.7 から、 Server オブジェクトは非同期のコンテキストマネージャになりま" "した。" -#: ../../library/asyncio-eventloop.rst:1789 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" +"このクラスは Python 3.9.11、3.10.3、3.11 で ``asyncio.Server`` として公開され" +"ました。" #: ../../library/asyncio-eventloop.rst:1794 msgid "" @@ -2742,43 +2924,49 @@ msgid "" "open." msgstr "既存の受信中のクライアントとの接続を表すソケットはオープンのままです。" -#: ../../library/asyncio-eventloop.rst:1800 msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." msgstr "" +"サーバーは非同期に閉じられます。\n" +"サーバーが閉じられ、すべての接続が終了するまで待つには、:meth:`wait_closed` " +"コルーチンを使ってください。" -#: ../../library/asyncio-eventloop.rst:1806 msgid "Close all existing incoming client connections." -msgstr "" +msgstr "受け付け済みのすべてのクライアント接続を閉じます。" -#: ../../library/asyncio-eventloop.rst:1808 msgid "" "Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." msgstr "" +"関連付けられたすべてのトランスポートに対して :meth:`~asyncio.BaseTransport." +"close` を呼び出します。" -#: ../../library/asyncio-eventloop.rst:1811 msgid "" ":meth:`close` should be called before :meth:`close_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" +"新しいクライアント接続との競合を避けるため、サーバーを閉じる際は :meth:" +"`close_clients` の前に :meth:`close` を呼び出してください。" -#: ../../library/asyncio-eventloop.rst:1818 msgid "" "Close all existing incoming client connections immediately, without waiting " "for pending operations to complete." msgstr "" +"保留中の処理の完了を待たずに、受け付け済みのすべてのクライアント接続を即座に" +"閉じます。" -#: ../../library/asyncio-eventloop.rst:1821 msgid "" "Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." msgstr "" +"関連付けられたすべてのトランスポートに対して :meth:`~asyncio.WriteTransport." +"abort` を呼び出します。" -#: ../../library/asyncio-eventloop.rst:1824 msgid "" ":meth:`close` should be called before :meth:`abort_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" +"新しいクライアント接続との競合を避けるため、サーバーを閉じる際は :meth:" +"`abort_clients` の前に :meth:`close` を呼び出してください。" #: ../../library/asyncio-eventloop.rst:1831 msgid "Return the event loop associated with the server object." @@ -2788,11 +2976,12 @@ msgstr "サーバオブジェクトに付随するイベントループを返し msgid "Start accepting connections." msgstr "接続の受け付けを開始します。" -#: ../../library/asyncio-eventloop.rst:1840 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" +"このメソッドはべき等なので、サーバーがすでに接続を受け付けていても呼び出せま" +"す。" #: ../../library/asyncio-eventloop.rst:1843 msgid "" @@ -2824,7 +3013,6 @@ msgstr "" "す。ひとつの *Server* オブジェクトにつき ``serve_forever`` タスクはひとつだけ" "存在できます。" -#: ../../library/asyncio-eventloop.rst:1865 msgid "" "async def client_connected(reader, writer):\n" " # Communicate with the client with\n" @@ -2838,23 +3026,38 @@ msgid "" "\n" "asyncio.run(main('127.0.0.1', 0))" msgstr "" +"async def client_connected(reader, writer):\n" +" # reader/writer ストリームでクライアントと通信する。\n" +" # 例えば次のようにする:\n" +" await reader.readline()\n" +"\n" +"async def main(host, port):\n" +" srv = await asyncio.start_server(\n" +" client_connected, host, port)\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main('127.0.0.1', 0))" #: ../../library/asyncio-eventloop.rst:1881 msgid "Return ``True`` if the server is accepting new connections." msgstr "サーバーが新規に接続の受け入れを開始した場合 ``True`` を返します。" -#: ../../library/asyncio-eventloop.rst:1888 msgid "" "Wait until the :meth:`close` method completes and all active connections " "have finished." msgstr "" +":meth:`close` メソッドが完了し、すべてのアクティブな接続が終了するまで待ちま" +"す。" -#: ../../library/asyncio-eventloop.rst:1891 msgid "" "``wait_closed()`` now waits until the server is closed and all active " "connections have finished. Previously, it returned immediately if the " "server was already closed, even if connections were still active." msgstr "" +"``wait_closed()`` は、サーバーが閉じられ、すべてのアクティブな接続が終了する" +"まで待つようになりました。\n" +"以前は、サーバーがすでに閉じられていると、接続がまだ残っていても即座に返って" +"いました。" #: ../../library/asyncio-eventloop.rst:1899 msgid "" @@ -2871,9 +3074,8 @@ msgstr "" "バーソケットのリストを直接返していました。 Python 3.7 ではリストのコピーが返" "されるようになりました。" -#: ../../library/asyncio-eventloop.rst:1912 msgid "Event loop implementations" -msgstr "" +msgstr "イベントループの実装" msgid "" "asyncio ships with two different event loop implementations: :class:" @@ -2882,15 +3084,16 @@ msgstr "" "asyncio は2つの異なるイベントループの実装、 :class:`SelectorEventLoop` と :" "class:`ProactorEventLoop`、 を提供します:" -#: ../../library/asyncio-eventloop.rst:1917 msgid "By default asyncio is configured to use :class:`EventLoop`." msgstr "" +"デフォルトでは、asyncio は :class:`EventLoop` を使うように設定されています。" -#: ../../library/asyncio-eventloop.rst:1922 msgid "" "A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " "module." msgstr "" +":mod:`selectors` モジュールに基づく :class:`AbstractEventLoop` のサブクラスで" +"す。" #: ../../library/asyncio-eventloop.rst:1925 msgid "" @@ -2901,7 +3104,6 @@ msgstr "" "プラットフォーム上で利用可能な最も効率の良い *selector* を使います。特定のセ" "レクタ実装を使うように手動で構成することも可能です::" -#: ../../library/asyncio-eventloop.rst:1929 msgid "" "import asyncio\n" "import selectors\n" @@ -2913,40 +3115,54 @@ msgid "" "SelectSelector())\n" "asyncio.run(main(), loop_factory=loop_factory)" msgstr "" +"import asyncio\n" +"import selectors\n" +"\n" +"async def main():\n" +" ...\n" +"\n" +"loop_factory = lambda: asyncio.SelectorEventLoop(selectors." +"SelectSelector())\n" +"asyncio.run(main(), loop_factory=loop_factory)" -#: ../../library/asyncio-eventloop.rst:1944 msgid "" "A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " "Completion Ports\" (IOCP)." msgstr "" +"I/O 完了ポート (IOCP) を使う、Windows 用の :class:`AbstractEventLoop` のサブ" +"クラスです。" -#: ../../library/asyncio-eventloop.rst:1950 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" +"`I/O 完了ポートの MSDN ドキュメント `_。" -#: ../../library/asyncio-eventloop.rst:1955 msgid "" "An alias to the most efficient available subclass of :class:" "`AbstractEventLoop` for the given platform." msgstr "" +"そのプラットフォームで利用可能な、最も効率的な :class:`AbstractEventLoop` の" +"サブクラスの別名です。" -#: ../../library/asyncio-eventloop.rst:1958 msgid "" "It is an alias to :class:`SelectorEventLoop` on Unix and :class:" "`ProactorEventLoop` on Windows." msgstr "" +"Unix では :class:`SelectorEventLoop`、Windows では :class:" +"`ProactorEventLoop` の別名です。" #: ../../library/asyncio-eventloop.rst:1964 msgid "Abstract base class for asyncio-compliant event loops." msgstr "asyncio に適合するイベントループの抽象基底クラスです。" -#: ../../library/asyncio-eventloop.rst:1966 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" +":ref:`asyncio-event-loop-methods` の節には、``AbstractEventLoop`` の代替実装" +"で定義すべきメソッドをすべて列挙しています。" #: ../../library/asyncio-eventloop.rst:1972 msgid "Examples" @@ -2976,7 +3192,6 @@ msgstr "" ":meth:`loop.call_soon` メソッドを使ってコールバックをスケジュールする例です。" "コールバックは ``\"Hello World\"`` を出力しイベントループを停止します::" -#: ../../library/asyncio-eventloop.rst:1990 msgid "" "import asyncio\n" "\n" @@ -2996,6 +3211,24 @@ msgid "" "finally:\n" " loop.close()" msgstr "" +"import asyncio\n" +"\n" +"def hello_world(loop):\n" +" \"\"\"'Hello World' を表示してイベントループを停止するコールバック" +"\"\"\"\n" +" print('Hello World')\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# hello_world() の呼び出しをスケジュールする\n" +"loop.call_soon(hello_world, loop)\n" +"\n" +"# loop.stop() で終了するブロッキング呼び出し\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" #: ../../library/asyncio-eventloop.rst:2010 msgid "" @@ -3019,7 +3252,6 @@ msgstr "" "call_later` メソッドを使って自身を5秒後に実行するよう再スケジュールし、イベン" "トループを停止します::" -#: ../../library/asyncio-eventloop.rst:2023 msgid "" "import asyncio\n" "import datetime as dt\n" @@ -3043,6 +3275,27 @@ msgid "" "finally:\n" " loop.close()" msgstr "" +"import asyncio\n" +"import datetime as dt\n" +"\n" +"def display_date(end_time, loop):\n" +" print(dt.datetime.now())\n" +" if (loop.time() + 1.0) < end_time:\n" +" loop.call_later(1, display_date, end_time, loop)\n" +" else:\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# display_date() の最初の呼び出しをスケジュールする\n" +"end_time = loop.time() + 5.0\n" +"loop.call_soon(display_date, end_time, loop)\n" +"\n" +"# loop.stop() で終了するブロッキング呼び出し\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" #: ../../library/asyncio-eventloop.rst:2047 msgid "" @@ -3064,7 +3317,6 @@ msgstr "" "ファイル記述子が :meth:`loop.add_reader` メソッドを使って何らかのデータを受信" "するまで待機し、その後イベントループをクローズします::" -#: ../../library/asyncio-eventloop.rst:2059 msgid "" "import asyncio\n" "from socket import socketpair\n" @@ -3099,6 +3351,38 @@ msgid "" " wsock.close()\n" " loop.close()" msgstr "" +"import asyncio\n" +"from socket import socketpair\n" +"\n" +"# 接続されたファイル記述子のペアを作成する\n" +"rsock, wsock = socketpair()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"def reader():\n" +" data = rsock.recv(100)\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # 処理が済んだので、ファイル記述子の登録を解除する\n" +" loop.remove_reader(rsock)\n" +"\n" +" # イベントループを停止する\n" +" loop.stop()\n" +"\n" +"# 読み込みイベント用にファイル記述子を登録する\n" +"loop.add_reader(rsock, reader)\n" +"\n" +"# ネットワークからのデータ受信を模倣する\n" +"loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +"try:\n" +" # イベントループを実行する\n" +" loop.run_forever()\n" +"finally:\n" +" # 処理が済んだので、ソケットとイベントループを閉じる。\n" +" rsock.close()\n" +" wsock.close()\n" +" loop.close()" msgid "" "A similar :ref:`example ` using " @@ -3119,15 +3403,15 @@ msgstr "" msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "SIGINT および SIGTERM 用のシグナルハンドラーの設定" -#: ../../library/asyncio-eventloop.rst:2108 msgid "(This ``signal`` example only works on Unix.)" -msgstr "" +msgstr "(この ``signal`` の例は Unix でのみ動作します。)" -#: ../../library/asyncio-eventloop.rst:2110 msgid "" "Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." "SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" +":meth:`loop.add_signal_handler` メソッドで、シグナル :const:`~signal.SIGINT` " +"と :const:`~signal.SIGTERM` のハンドラーを登録します。 ::" #: ../../library/asyncio-eventloop.rst:2113 msgid "" diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index 46dcd8eb5..d5aaae181 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -18,139 +18,145 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-extending.rst:6 msgid "Extending" -msgstr "" +msgstr "拡張" -#: ../../library/asyncio-extending.rst:8 msgid "" "The main direction for :mod:`asyncio` extending is writing custom *event " "loop* classes. Asyncio has helpers that could be used to simplify this task." msgstr "" +":mod:`asyncio` を拡張する主な方法は、独自の *イベントループ* クラスを書くこと" +"です。\n" +"asyncio には、この作業を簡単にするための補助機能があります。" -#: ../../library/asyncio-extending.rst:13 msgid "" "Third-parties should reuse existing asyncio code with caution, a new Python " "version is free to break backward compatibility in *internal* part of API." msgstr "" +"サードパーティーが既存の asyncio コードを再利用する際は注意してください。\n" +"新しい Python バージョンでは、API の *内部的な* 部分について後方互換性が失わ" +"れる可能性があります。" -#: ../../library/asyncio-extending.rst:19 msgid "Writing a Custom Event Loop" -msgstr "" +msgstr "独自のイベントループを書く" -#: ../../library/asyncio-extending.rst:21 msgid "" ":class:`asyncio.AbstractEventLoop` declares very many methods. Implementing " "all them from scratch is a tedious job." msgstr "" +":class:`asyncio.AbstractEventLoop` には非常に多くのメソッドが宣言されており、" +"すべてを一から実装するのは大変な作業です。" -#: ../../library/asyncio-extending.rst:24 msgid "" "A loop can get many common methods implementation for free by inheriting " "from :class:`asyncio.BaseEventLoop`." msgstr "" +":class:`asyncio.BaseEventLoop` を継承すれば、多くの共通メソッドの実装をそのま" +"ま利用できます。" -#: ../../library/asyncio-extending.rst:27 msgid "" "In turn, the successor should implement a bunch of *private* methods " "declared but not implemented in :class:`asyncio.BaseEventLoop`." msgstr "" +"その代わり、サブクラスでは :class:`asyncio.BaseEventLoop` に宣言されているも" +"のの実装されていない *非公開* メソッドを実装する必要があります。" -#: ../../library/asyncio-extending.rst:30 msgid "" "For example, ``loop.create_connection()`` checks arguments, resolves DNS " "addresses, and calls ``loop._make_socket_transport()`` that should be " "implemented by inherited class. The ``_make_socket_transport()`` method is " "not documented and is considered as an *internal* API." msgstr "" +"例えば ``loop.create_connection()`` は、引数の検査と DNS によるアドレス解決を" +"行い、サブクラスで実装すべき ``loop._make_socket_transport()`` を呼び出しま" +"す。\n" +"``_make_socket_transport()`` は文書化されておらず、*内部* API とみなされま" +"す。" -#: ../../library/asyncio-extending.rst:38 msgid "Future and Task private constructors" -msgstr "" +msgstr "Future と Task の非公開コンストラクター" -#: ../../library/asyncio-extending.rst:40 msgid "" ":class:`asyncio.Future` and :class:`asyncio.Task` should be never created " "directly, please use corresponding :meth:`loop.create_future` and :meth:" "`loop.create_task`, or :func:`asyncio.create_task` factories instead." msgstr "" +":class:`asyncio.Future` と :class:`asyncio.Task` は直接作成しないでくださ" +"い。\n" +"代わりに、それぞれに対応するファクトリー :meth:`loop.create_future` と :meth:" +"`loop.create_task`、または :func:`asyncio.create_task` を使ってください。" -#: ../../library/asyncio-extending.rst:44 msgid "" "However, third-party *event loops* may *reuse* built-in future and task " "implementations for the sake of getting a complex and highly optimized code " "for free." msgstr "" +"ただし、サードパーティーの *イベントループ* は、複雑で高度に最適化されたコー" +"ドを自前で実装せずに利用するために、組み込みの Future と Task の実装を *再利" +"用* してもかまいません。" -#: ../../library/asyncio-extending.rst:47 msgid "For this purpose the following, *private* constructors are listed:" -msgstr "" +msgstr "この目的のために、以下の *非公開* コンストラクターを紹介します。" -#: ../../library/asyncio-extending.rst:51 msgid "Create a built-in future instance." -msgstr "" +msgstr "組み込みの Future インスタンスを作成します。" -#: ../../library/asyncio-extending.rst:53 msgid "*loop* is an optional event loop instance." -msgstr "" +msgstr "*loop* は省略可能なイベントループのインスタンスです。" -#: ../../library/asyncio-extending.rst:57 msgid "Create a built-in task instance." -msgstr "" +msgstr "組み込みの Task インスタンスを作成します。" -#: ../../library/asyncio-extending.rst:59 msgid "" "*loop* is an optional event loop instance. The rest of arguments are " "described in :meth:`loop.create_task` description." msgstr "" +"*loop* は省略可能なイベントループのインスタンスです。\n" +"他の引数については :meth:`loop.create_task` を参照してください。" -#: ../../library/asyncio-extending.rst:64 msgid "*context* argument is added." -msgstr "" +msgstr "*context* 引数が追加されました。" -#: ../../library/asyncio-extending.rst:69 msgid "Task lifetime support" -msgstr "" +msgstr "タスクの生存期間の管理" -#: ../../library/asyncio-extending.rst:71 msgid "" "A third party task implementation should call the following functions to " "keep a task visible by :func:`asyncio.all_tasks` and :func:`asyncio." "current_task`:" msgstr "" +"サードパーティーのタスク実装では、:func:`asyncio.all_tasks` と :func:" +"`asyncio.current_task` でタスクを取得できるように、次の関数を呼び出す必要があ" +"ります。" -#: ../../library/asyncio-extending.rst:76 msgid "Register a new *task* as managed by *asyncio*." -msgstr "" +msgstr "新しい *task* を *asyncio* が管理するタスクとして登録します。" -#: ../../library/asyncio-extending.rst:78 msgid "Call the function from a task constructor." -msgstr "" +msgstr "タスクのコンストラクターから呼び出してください。" -#: ../../library/asyncio-extending.rst:82 msgid "Unregister a *task* from *asyncio* internal structures." -msgstr "" +msgstr "*asyncio* の内部データ構造から *task* の登録を解除します。" -#: ../../library/asyncio-extending.rst:84 msgid "The function should be called when a task is about to finish." -msgstr "" +msgstr "タスクが終了する直前に呼び出してください。" -#: ../../library/asyncio-extending.rst:88 msgid "Switch the current task to the *task* argument." -msgstr "" +msgstr "現在のタスクを、引数 *task* に切り替えます。" -#: ../../library/asyncio-extending.rst:90 msgid "" "Call the function just before executing a portion of embedded *coroutine* (:" "meth:`coroutine.send` or :meth:`coroutine.throw`)." msgstr "" +"タスク内の *コルーチン* を部分的に実行する直前 (:meth:`coroutine.send` また" +"は :meth:`coroutine.throw` の呼び出し直前) に呼び出してください。" -#: ../../library/asyncio-extending.rst:95 msgid "Switch the current task back from *task* to ``None``." -msgstr "" +msgstr "現在のタスクを *task* から ``None`` に戻します。" -#: ../../library/asyncio-extending.rst:97 msgid "" "Call the function just after :meth:`coroutine.send` or :meth:`coroutine." "throw` execution." msgstr "" +":meth:`coroutine.send` または :meth:`coroutine.throw` の実行直後に呼び出して" +"ください。" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index f7cb11f61..039f64612 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -99,18 +99,21 @@ msgstr "" "引数 *obj* が上記のいずれにもあてはまらない場合は :exc:`TypeError` 例外を送出" "します。" -#: ../../library/asyncio-future.rst:54 msgid "" "Save a reference to the result of this function, to avoid a task " "disappearing mid-execution." msgstr "" +"タスクが実行途中で消えないように、この関数の返り値への参照を保持してくださ" +"い。" -#: ../../library/asyncio-future.rst:57 msgid "" "See also the :func:`create_task` function which is the preferred way for " "creating new tasks or use :class:`asyncio.TaskGroup` which keeps reference " "to the task internally." msgstr "" +"新しいタスクの作成に推奨される :func:`create_task` 関数も参照してください。\n" +"または、タスクへの参照を内部で保持する :class:`asyncio.TaskGroup` を使ってく" +"ださい。" #: ../../library/asyncio-future.rst:61 msgid "The function accepts any :term:`awaitable` object." @@ -118,11 +121,12 @@ msgstr "" "この関数はどんな :term:`awaitable` なオブジェクトでも受け入れるようになりまし" "た。" -#: ../../library/asyncio-future.rst:64 msgid "" "Deprecation warning is emitted if *obj* is not a Future-like object and " "*loop* is not specified and there is no running event loop." msgstr "" +"*obj* が Future に相当するオブジェクトではなく、*loop* を指定せず、実行中のイ" +"ベントループもない場合に、非推奨の警告が出ます。" #: ../../library/asyncio-future.rst:71 msgid "" @@ -132,11 +136,12 @@ msgstr "" ":class:`concurrent.futures.Future` オブジェクトを :class:`asyncio.Future` オ" "ブジェクトでラップします。" -#: ../../library/asyncio-future.rst:74 msgid "" "Deprecation warning is emitted if *future* is not a Future-like object and " "*loop* is not specified and there is no running event loop." msgstr "" +"*future* が Future に相当するオブジェクトではなく、*loop* を指定せず、実行中" +"のイベントループもない場合に、非推奨の警告が出ます。" #: ../../library/asyncio-future.rst:81 msgid "Future Object" @@ -149,12 +154,15 @@ msgid "" msgstr "" "Future は非同期処理の最終結果を表すクラスです。スレッドセーフではありません。" -#: ../../library/asyncio-future.rst:88 msgid "" "Future is an :term:`awaitable` object. Coroutines can await on Future " "objects until they either have a result or an exception set, or until they " "are cancelled. A Future can be awaited multiple times and the result is same." msgstr "" +"Future は :term:`awaitable` オブジェクトです。\n" +"コルーチンは Future を await して、結果か例外が設定されるか、キャンセルされる" +"まで待機できます。\n" +"同じ Future を複数回 await でき、その結果は同じです。" #: ../../library/asyncio-future.rst:93 msgid "" @@ -179,19 +187,21 @@ msgstr "" "呼び出すことです。これによりイベントループの代替実装は、自身に最適化された " "Future オブジェクトの実装を合わせて提供することができます。" -#: ../../library/asyncio-future.rst:104 msgid "Futures are :ref:`generic ` over the type of their results." msgstr "" +"Future は、結果の型をパラメーターとする :ref:`ジェネリック型 ` で" +"す。" #: ../../library/asyncio-future.rst:106 msgid "Added support for the :mod:`contextvars` module." msgstr ":mod:`contextvars` モジュールのサポートを追加。" -#: ../../library/asyncio-future.rst:109 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" +"*loop* が指定されておらず、実行中のイベントループもない場合に、非推奨の警告を" +"出すようになりました。" #: ../../library/asyncio-future.rst:115 msgid "Return the result of the Future." @@ -221,20 +231,21 @@ msgstr "" "Future が *キャンセルされた* 場合、このメソッドは :exc:`CancelledError` 例外" "を送出します。" -#: ../../library/asyncio-future.rst:126 msgid "" "If the Future's result isn't yet available, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" +"Future の結果がまだ得られない場合は、:exc:`InvalidStateError` を送出します。" #: ../../library/asyncio-future.rst:131 msgid "Mark the Future as *done* and set its result." msgstr "Future を *完了* とマークし、結果を設定します。" -#: ../../library/asyncio-future.rst:133 ../../library/asyncio-future.rst:140 msgid "" "Raises an :exc:`InvalidStateError` error if the Future is already *done*." msgstr "" +"Future がすでに *完了* している場合は、:exc:`InvalidStateError` を送出しま" +"す。" #: ../../library/asyncio-future.rst:138 msgid "Mark the Future as *done* and set an exception." @@ -265,11 +276,12 @@ msgstr "" "通常の場合、このメソッドは Future に処理結果や例外を設定する前に Future が *" "キャンセルされていない* ことを確認するために使用されます::" -#: ../../library/asyncio-future.rst:158 msgid "" "if not fut.cancelled():\n" " fut.set_result(42)" msgstr "" +"if not fut.cancelled():\n" +" fut.set_result(42)" #: ../../library/asyncio-future.rst:163 msgid "Add a callback to be run when the Future is *done*." @@ -305,12 +317,14 @@ msgstr "" "コールバックにパラメータを渡すには、次の例のように :func:`functools.partial` " "を使うことができます::" -#: ../../library/asyncio-future.rst:178 msgid "" "# Call 'print(\"Future:\", fut)' when \"fut\" is done.\n" "fut.add_done_callback(\n" " functools.partial(print, \"Future:\"))" msgstr "" +"# fut が完了したら print(\"Future:\", fut) を呼び出す。\n" +"fut.add_done_callback(\n" +" functools.partial(print, \"Future:\"))" #: ../../library/asyncio-future.rst:182 msgid "" @@ -346,15 +360,15 @@ msgstr "" "す。そうでない場合 Future の状態を *キャンセル* に変更した上でコールバックを" "スケジュールし、 ``True`` を返します。" -#: ../../library/asyncio-future.rst:201 msgid "" "The optional string argument *msg* is passed as the argument to the :exc:" "`CancelledError` exception raised when a cancelled Future is awaited." msgstr "" +"省略可能な文字列引数 *msg* は、キャンセル済みの Future を await したときに送" +"出する :exc:`CancelledError` の引数として渡されます。" -#: ../../library/asyncio-future.rst:205 msgid "Added the *msg* parameter." -msgstr "" +msgstr "*msg* パラメーターが追加されました。" #: ../../library/asyncio-future.rst:210 msgid "Return the exception that was set on this Future." @@ -388,7 +402,6 @@ msgstr "" "この例は Future オブジェクトを生成し、Future に結果を設定するための非同期タス" "クを生成してスケジュールし、そして Future に結果が設定されるまで待機します::" -#: ../../library/asyncio-future.rst:234 msgid "" "async def set_after(fut, delay, value):\n" " # Sleep for *delay* seconds.\n" @@ -418,6 +431,33 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def set_after(fut, delay, value):\n" +" # delay 秒スリープする。\n" +" await asyncio.sleep(delay)\n" +"\n" +" # Future fut の結果に value を設定する。\n" +" fut.set_result(value)\n" +"\n" +"async def main():\n" +" # 現在のイベントループを取得する。\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # 新しい Future オブジェクトを作成する。\n" +" fut = loop.create_future()\n" +"\n" +" # set_after() コルーチンを別のタスクで並行して実行する。\n" +" # ここではイベントループへの参照をすでに持っているので、\n" +" # 低水準の loop.create_task() API を使っている。\n" +" # そうでなければ asyncio.create_task() を使えばよい。\n" +" loop.create_task(\n" +" set_after(fut, 1, '... world'))\n" +"\n" +" print('hello ...')\n" +"\n" +" # fut の結果が得られるまで待ち (1 秒)、表示する。\n" +" print(await fut)\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-future.rst:265 msgid "" @@ -468,8 +508,9 @@ msgstr "" "asyncio の Future は :func:`concurrent.futures.wait` および :func:" "`concurrent.futures.as_completed` との互換性がありません。" -#: ../../library/asyncio-future.rst:286 msgid "" ":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but :" "meth:`concurrent.futures.Future.cancel` does not." msgstr "" +":meth:`asyncio.Future.cancel` は省略可能な ``msg`` 引数を受け付けますが、:" +"meth:`concurrent.futures.Future.cancel` は受け付けません。" diff --git a/library/asyncio-graph.po b/library/asyncio-graph.po index e53d5c9ea..9f3b059f0 100644 --- a/library/asyncio-graph.po +++ b/library/asyncio-graph.po @@ -22,57 +22,60 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-graph.rst:8 msgid "Call graph introspection" -msgstr "" +msgstr "呼び出しグラフのイントロスペクション" -#: ../../library/asyncio-graph.rst:10 msgid "**Source code:** :source:`Lib/asyncio/graph.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/asyncio/graph.py`" -#: ../../library/asyncio-graph.rst:14 msgid "" "asyncio has powerful runtime call graph introspection utilities to trace the " "entire call graph of a running *coroutine* or *task*, or a suspended " "*future*. These utilities and the underlying machinery can be used from " "within a Python program or by external profilers and debuggers." msgstr "" +"asyncio は、実行中の *コルーチン* や *タスク*、または中断中の *Future* の呼び" +"出しグラフ全体を実行時にたどる、強力なイントロスペクション機能を備えていま" +"す。\n" +"これらの機能とその基盤の仕組みは、Python プログラム内からも、外部のプロファイ" +"ラーやデバッガーからも利用できます。" -#: ../../library/asyncio-graph.rst:22 msgid ":ref:`asyncio-introspection-tools`" -msgstr "" +msgstr ":ref:`asyncio-introspection-tools`" -#: ../../library/asyncio-graph.rst:23 msgid "" "Command-line tools for inspecting tasks in another running Python process." msgstr "" +"実行中の別の Python プロセス内のタスクを調べるコマンドラインツールです。" -#: ../../library/asyncio-graph.rst:31 msgid "" "Print the async call graph for the current task or the provided :class:" "`Task` or :class:`Future`." msgstr "" +"現在のタスク、または指定した :class:`Task` や :class:`Future` の非同期呼び出" +"しグラフを表示します。" -#: ../../library/asyncio-graph.rst:34 msgid "" "This function prints entries starting from the top frame and going down " "towards the invocation point." msgstr "" +"スタックの最上部のフレームから、呼び出し元の起点に向かって順に表示します。" -#: ../../library/asyncio-graph.rst:37 msgid "" "The function receives an optional *future* argument. If not passed, the " "current running task will be used." msgstr "" +"省略可能な *future* 引数を受け取ります。\n" +"指定しなければ、現在実行中のタスクを使います。" -#: ../../library/asyncio-graph.rst:40 ../../library/asyncio-graph.rst:99 msgid "" "If the function is called on *the current task*, the optional keyword-only " "*depth* argument can be used to skip the specified number of frames from top " "of the stack." msgstr "" +"*現在のタスク* に対して呼び出す場合、省略可能なキーワード専用引数 *depth* " +"で、スタックの最上部から飛ばすフレーム数を指定できます。" -#: ../../library/asyncio-graph.rst:44 msgid "" "If the optional keyword-only *limit* argument is provided, each call stack " "in the resulting graph is truncated to include at most ``abs(limit)`` " @@ -82,22 +85,26 @@ msgid "" "``0``, the call stack is not printed at all, only \"awaited by\" information " "is printed." msgstr "" +"省略可能なキーワード専用引数 *limit* を指定すると、グラフ内の各コールスタック" +"のエントリー数を最大 ``abs(limit)`` 個に制限します。\n" +"*limit* が正なら呼び出し元の起点に近いエントリーを、負ならスタックの最上部に" +"近いエントリーを残します。\n" +"*limit* を省略するか ``None`` にすると、すべてのエントリーを含めます。\n" +"``0`` の場合、コールスタックは表示せず、何に await されているかの情報だけを表" +"示します。" -#: ../../library/asyncio-graph.rst:52 msgid "" "If *file* is omitted or ``None``, the function will print to :data:`sys." "stdout`." msgstr "" +"*file* を省略するか ``None`` にすると、:data:`sys.stdout` に出力します。" -#: ../../library/asyncio-graph.rst:55 msgid "**Example:**" -msgstr "" +msgstr "**例:**" -#: ../../library/asyncio-graph.rst:57 msgid "The following Python code:" -msgstr "" +msgstr "次の Python コードは、" -#: ../../library/asyncio-graph.rst:59 msgid "" "import asyncio\n" "\n" @@ -110,12 +117,21 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def test():\n" +" asyncio.print_call_graph()\n" +"\n" +"async def main():\n" +" async with asyncio.TaskGroup() as g:\n" +" g.create_task(test(), name='test')\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-graph.rst:72 msgid "will print::" msgstr "このサンプルコードは以下を出力します::" -#: ../../library/asyncio-graph.rst:74 msgid "" "* Task(name='test', id=0x1039f0fe0)\n" "+ Call stack:\n" @@ -126,6 +142,14 @@ msgid "" " | File 'taskgroups.py', line 107, in async TaskGroup.__aexit__()\n" " | File 't2.py', line 7, in async main()" msgstr "" +"* Task(name='test', id=0x1039f0fe0)\n" +"+ Call stack:\n" +"| File 't2.py', line 4, in async test()\n" +"+ Awaited by:\n" +" * Task(name='Task-1', id=0x103a5e060)\n" +" + Call stack:\n" +" | File 'taskgroups.py', line 107, in async TaskGroup.__aexit__()\n" +" | File 't2.py', line 7, in async main()" #: ../../library/asyncio-graph.rst:85 msgid "" @@ -133,11 +157,12 @@ msgid "" "and there's no current task, the function returns an empty string." msgstr "" -#: ../../library/asyncio-graph.rst:92 msgid "" "Capture the async call graph for the current task or the provided :class:" "`Task` or :class:`Future`." msgstr "" +"現在のタスク、または指定した :class:`Task` や :class:`Future` の非同期呼び出" +"しグラフを取得します。" #: ../../library/asyncio-graph.rst:95 msgid "" @@ -146,43 +171,37 @@ msgid "" "returns ``None``." msgstr "" -#: ../../library/asyncio-graph.rst:103 msgid "Returns a ``FutureCallGraph`` data class object:" -msgstr "" +msgstr "``FutureCallGraph`` データクラスのオブジェクトを返します。" -#: ../../library/asyncio-graph.rst:105 msgid "``FutureCallGraph(future, call_stack, awaited_by)``" -msgstr "" +msgstr "``FutureCallGraph(future, call_stack, awaited_by)``" -#: ../../library/asyncio-graph.rst:107 msgid "" "Where *future* is a reference to a :class:`Future` or a :class:`Task` (or " "their subclasses.)" msgstr "" +"*future* は :class:`Future` または :class:`Task` (またはそのサブクラス) への" +"参照です。" -#: ../../library/asyncio-graph.rst:110 msgid "``call_stack`` is a tuple of ``FrameCallGraphEntry`` objects." -msgstr "" +msgstr "``call_stack`` は ``FrameCallGraphEntry`` オブジェクトのタプルです。" -#: ../../library/asyncio-graph.rst:112 msgid "``awaited_by`` is a tuple of ``FutureCallGraph`` objects." -msgstr "" +msgstr "``awaited_by`` は ``FutureCallGraph`` オブジェクトのタプルです。" -#: ../../library/asyncio-graph.rst:114 msgid "``FrameCallGraphEntry(frame)``" -msgstr "" +msgstr "``FrameCallGraphEntry(frame)``" -#: ../../library/asyncio-graph.rst:116 msgid "" "Where *frame* is a frame object of a regular Python function in the call " "stack." msgstr "" +"*frame* は、コールスタック内の通常の Python 関数のフレームオブジェクトです。" -#: ../../library/asyncio-graph.rst:121 msgid "Low level utility functions" -msgstr "" +msgstr "低水準の補助関数" -#: ../../library/asyncio-graph.rst:123 msgid "" "To introspect an async call graph asyncio requires cooperation from control " "flow structures, such as :func:`shield` or :class:`TaskGroup`. Any time an " @@ -192,24 +211,32 @@ msgid "" "such intermediate future objects are connected with the tasks they wrap or " "control." msgstr "" +"非同期呼び出しグラフを調べるために、asyncio は :func:`shield` や :class:" +"`TaskGroup` などの制御フローを扱う仕組みとの連携を必要とします。\n" +":meth:`Future.add_done_callback() ` のよう" +"な低水準 API を使う中間的な :class:`Future` オブジェクトが関わる場合は、次の" +"二つの関数を使ってください。\n" +"これにより、その Future が、ラップしたり制御したりするタスクとどうつながって" +"いるかを asyncio に伝えます。" -#: ../../library/asyncio-graph.rst:134 msgid "Record that *future* is awaited on by *waiter*." -msgstr "" +msgstr "*future* が *waiter* に await されていることを記録します。" -#: ../../library/asyncio-graph.rst:136 ../../library/asyncio-graph.rst:149 msgid "" "Both *future* and *waiter* must be instances of :class:`Future` or :class:" "`Task` or their subclasses, otherwise the call would have no effect." msgstr "" +"*future* と *waiter* はどちらも :class:`Future` または :class:`Task`、あるい" +"はそのサブクラスのインスタンスでなければなりません。\n" +"それ以外の場合、呼び出しても何も起こりません。" -#: ../../library/asyncio-graph.rst:140 msgid "" "A call to ``future_add_to_awaited_by()`` must be followed by an eventual " "call to the :func:`future_discard_from_awaited_by` function with the same " "arguments." msgstr "" +"``future_add_to_awaited_by()`` を呼び出した後は、いずれ同じ引数で :func:" +"`future_discard_from_awaited_by` を呼び出す必要があります。" -#: ../../library/asyncio-graph.rst:147 msgid "Record that *future* is no longer awaited on by *waiter*." -msgstr "" +msgstr "*future* が *waiter* に await されなくなったことを記録します。" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index b9b3a9e8b..5242de58c 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -46,9 +46,10 @@ msgstr "実行中のイベントループを取得するために **利用が推 msgid ":func:`asyncio.get_event_loop`" msgstr ":func:`asyncio.get_event_loop`" -#: ../../library/asyncio-llapi-index.rst:22 msgid "Get an event loop instance (running or current via the current policy)." msgstr "" +"実行中のイベントループ、または現在のポリシーが返す現在のイベントループのイン" +"スタンスを取得します。" #: ../../library/asyncio-llapi-index.rst:24 msgid ":func:`asyncio.set_event_loop`" @@ -81,11 +82,10 @@ msgstr ":ref:`asyncio.get_running_loop() を使う `。" msgid "Event Loop Methods" msgstr "イベントループのメソッド" -#: ../../library/asyncio-llapi-index.rst:39 msgid "" "See also the main documentation section about the :ref:`asyncio-event-loop-" "methods`." -msgstr "" +msgstr ":ref:`asyncio-event-loop-methods` の本編も参照してください。" #: ../../library/asyncio-llapi-index.rst:42 msgid "Lifecycle" @@ -123,17 +123,15 @@ msgstr ":meth:`loop.close`" msgid "Close the event loop." msgstr "イベントループをクローズします。" -#: ../../library/asyncio-llapi-index.rst:59 msgid ":meth:`loop.is_running`" -msgstr "" +msgstr ":meth:`loop.is_running`" #: ../../library/asyncio-llapi-index.rst:60 msgid "Return ``True`` if the event loop is running." msgstr "イベントループが実行中の場合 ``True`` を返します。" -#: ../../library/asyncio-llapi-index.rst:62 msgid ":meth:`loop.is_closed`" -msgstr "" +msgstr ":meth:`loop.is_closed`" #: ../../library/asyncio-llapi-index.rst:63 msgid "Return ``True`` if the event loop is closed." @@ -202,9 +200,8 @@ msgstr ":meth:`loop.call_at`" msgid "Invoke a callback *at* the given time." msgstr "*与えられた時刻に* コールバックを実行します。" -#: ../../library/asyncio-llapi-index.rst:99 msgid "Thread/Interpreter/Process Pool" -msgstr "" +msgstr "スレッド・インタープリタ・プロセスのプール" #: ../../library/asyncio-llapi-index.rst:104 msgid "``await`` :meth:`loop.run_in_executor`" @@ -393,25 +390,21 @@ msgstr ":class:`~socket.socket` からデータを受信します。" msgid "``await`` :meth:`loop.sock_recv_into`" msgstr "``await`` :meth:`loop.sock_recv_into`" -#: ../../library/asyncio-llapi-index.rst:190 msgid "Receive data from the :class:`~socket.socket` into a buffer." -msgstr ":class:`~socket.socket` からデータを受信し、バッファに送信します。" +msgstr ":class:`~socket.socket` からデータを受信し、バッファに格納します。" -#: ../../library/asyncio-llapi-index.rst:192 msgid "``await`` :meth:`loop.sock_recvfrom`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_recvfrom`" -#: ../../library/asyncio-llapi-index.rst:193 msgid "Receive a datagram from the :class:`~socket.socket`." -msgstr "" +msgstr ":class:`~socket.socket` からデータグラムを受信します。" -#: ../../library/asyncio-llapi-index.rst:195 msgid "``await`` :meth:`loop.sock_recvfrom_into`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_recvfrom_into`" -#: ../../library/asyncio-llapi-index.rst:196 msgid "Receive a datagram from the :class:`~socket.socket` into a buffer." msgstr "" +":class:`~socket.socket` からデータグラムを受信し、バッファに格納します。" #: ../../library/asyncio-llapi-index.rst:198 msgid "``await`` :meth:`loop.sock_sendall`" @@ -421,13 +414,13 @@ msgstr "``await`` :meth:`loop.sock_sendall`" msgid "Send data to the :class:`~socket.socket`." msgstr ":class:`~socket.socket` にデータを送信します。" -#: ../../library/asyncio-llapi-index.rst:201 msgid "``await`` :meth:`loop.sock_sendto`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_sendto`" -#: ../../library/asyncio-llapi-index.rst:202 msgid "Send a datagram via the :class:`~socket.socket` to the given address." msgstr "" +":class:`~socket.socket` を通じて、指定したアドレスにデータグラムを送信しま" +"す。" #: ../../library/asyncio-llapi-index.rst:204 msgid "``await`` :meth:`loop.sock_connect`" @@ -449,9 +442,8 @@ msgstr ":class:`~socket.socket` の接続を受け入れます。" msgid "``await`` :meth:`loop.sock_sendfile`" msgstr "``await`` :meth:`loop.sock_sendfile`" -#: ../../library/asyncio-llapi-index.rst:211 msgid "Send a file over the :class:`~socket.socket`." -msgstr "Send a file over the :class:`~socket.socket`." +msgstr ":class:`~socket.socket` を通じてファイルを送信します。" #: ../../library/asyncio-llapi-index.rst:213 msgid ":meth:`loop.add_reader`" @@ -561,11 +553,12 @@ msgstr ":meth:`loop.default_exception_handler`" msgid "The default exception handler implementation." msgstr "デフォルトの例外ハンドラー実装です。" -#: ../../library/asyncio-llapi-index.rst:270 msgid "" ":ref:`Using asyncio.new_event_loop() and loop.run_forever() " "`." msgstr "" +":ref:`asyncio.new_event_loop() と loop.run_forever() を使う " +"`。" #: ../../library/asyncio-llapi-index.rst:273 msgid ":ref:`Using loop.call_later() `." @@ -701,9 +694,8 @@ msgstr "" "ドです。該当するトランスポートは :meth:`loop.create_connection`, :meth:`loop." "create_unix_connection`, :meth:`loop.connect_write_pipe` などの戻り値です:" -#: ../../library/asyncio-llapi-index.rst:339 msgid "Write Transports" -msgstr "トランスポートにデータを書き込みます。" +msgstr "書き込みトランスポート" #: ../../library/asyncio-llapi-index.rst:344 msgid ":meth:`transport.write() `" @@ -758,15 +750,15 @@ msgstr "" ":meth:`transport.get_write_buffer_size() `" -#: ../../library/asyncio-llapi-index.rst:361 msgid "Return the current size of the output buffer." -msgstr "" +msgstr "出力バッファの現在のサイズを返します。" -#: ../../library/asyncio-llapi-index.rst:363 msgid "" ":meth:`transport.get_write_buffer_limits() `" msgstr "" +":meth:`transport.get_write_buffer_limits() `" #: ../../library/asyncio-llapi-index.rst:365 msgid "Return high and low water marks for write flow control." @@ -812,9 +804,8 @@ msgstr "" "サブプロセスに対するトランスポートの低レベルな抽象化です。 :meth:`loop." "subprocess_exec` や :meth:`loop.subprocess_shell` の戻り値です:" -#: ../../library/asyncio-llapi-index.rst:390 msgid "Subprocess Transports" -msgstr "サブプロセス化されたトランスポート" +msgstr "サブプロセストランスポート" #: ../../library/asyncio-llapi-index.rst:395 msgid ":meth:`transport.get_pid() `" @@ -1001,9 +992,8 @@ msgstr "" msgid "Subprocess Protocols" msgstr "サブプロセスプロトコル" -#: ../../library/asyncio-llapi-index.rst:487 msgid "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" -msgstr "" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" #: ../../library/asyncio-llapi-index.rst:488 msgid "" @@ -1012,9 +1002,8 @@ msgstr "" "子プロセスが標準出力 (*stdout*) または標準エラー出力 (*stderr*) のパイプに" "データを書き込んだときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:491 msgid "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" -msgstr "" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" #: ../../library/asyncio-llapi-index.rst:492 msgid "" @@ -1028,12 +1017,14 @@ msgid "" msgstr "" "``callback`` :meth:`process_exited() `" -#: ../../library/asyncio-llapi-index.rst:497 msgid "" "Called when the child process has exited. It can be called before :meth:" "`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol." "pipe_connection_lost` methods." msgstr "" +"子プロセスが終了したときに呼び出されます。\n" +":meth:`~SubprocessProtocol.pipe_data_received` や :meth:`~SubprocessProtocol." +"pipe_connection_lost` より先に呼び出されることもあります。" #: ../../library/asyncio-llapi-index.rst:503 msgid "Event Loop Policies" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index d79ee9c38..ace45d59c 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -48,12 +48,15 @@ msgstr "" ":meth:`loop.add_reader` と :meth:`loop.add_writer` をファイル I/O を監視する" "ためには使えません。" -#: ../../library/asyncio-platforms.rst:22 msgid "" ":meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` cannot be " "used with regular files. See :ref:`Supported pipe objects ` for the objects that are accepted on each platform." msgstr "" +":meth:`loop.connect_read_pipe` と :meth:`loop.connect_write_pipe` は、通常の" +"ファイルには使えません。\n" +"各プラットフォームで受け付けるオブジェクトについては、:ref:`サポートされるパ" +"イプオブジェクト ` を参照してください。" #: ../../library/asyncio-platforms.rst:29 msgid "Windows" @@ -143,12 +146,15 @@ msgid "" msgstr "" ":meth:`loop.add_reader` と :meth:`loop.add_writer` はサポートされていません。" -#: ../../library/asyncio-platforms.rst:70 msgid "" ":meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` only " "accept a handle opened for overlapped I/O. See :ref:`Supported pipe objects " "` for which objects are supported." msgstr "" +":meth:`loop.connect_read_pipe` と :meth:`loop.connect_write_pipe` は、オー" +"バーラップ I/O 用に開かれたハンドルだけを受け付けます。\n" +"対応するオブジェクトについては、:ref:`サポートされるパイプオブジェクト " +"` を参照してください。" #: ../../library/asyncio-platforms.rst:74 msgid "" @@ -202,7 +208,6 @@ msgstr "" "class:`~selectors.SelectSelector` または :class:`~selectors.PollSelector` を" "使うように手動で設定します。以下はその例です::" -#: ../../library/asyncio-platforms.rst:104 msgid "" "import asyncio\n" "import selectors\n" @@ -211,3 +216,9 @@ msgid "" "loop = asyncio.SelectorEventLoop(selector)\n" "asyncio.set_event_loop(loop)" msgstr "" +"import asyncio\n" +"import selectors\n" +"\n" +"selector = selectors.SelectSelector()\n" +"loop = asyncio.SelectorEventLoop(selector)\n" +"asyncio.set_event_loop(loop)" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index aed270386..8283b708d 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -26,14 +26,15 @@ msgstr "" msgid "Policies" msgstr "ポリシー" -#: ../../library/asyncio-policy.rst:12 msgid "" "Policies are deprecated and will be removed in Python 3.16. Users are " "encouraged to use the :func:`asyncio.run` function or the :class:`asyncio." "Runner` with *loop_factory* to use the desired loop implementation." msgstr "" +"ポリシーは非推奨で、Python 3.16 で削除されます。\n" +"使いたいイベントループの実装を選ぶには、:func:`asyncio.run` 関数、または :" +"class:`asyncio.Runner` に *loop_factory* を指定する方法を推奨します。" -#: ../../library/asyncio-policy.rst:18 msgid "" "An event loop policy is a global object used to get and set the current :ref:" "`event loop `, as well as create new event loops. The " @@ -42,19 +43,31 @@ msgid "" "implementations, or substituted by a :ref:`custom policy ` that can override these behaviors." msgstr "" +"イベントループポリシーは、現在の :ref:`イベントループ ` " +"の取得・設定と、新しいイベントループの作成に使うグローバルオブジェクトで" +"す。\n" +"異なるイベントループの実装を使うには、デフォルトのポリシーを :ref:`組み込みの" +"別のポリシー ` に :ref:`置き換える ` ことができます。\n" +"また、これらの動作を変更する :ref:`カスタムポリシー ` に置き換えることもできます。" -#: ../../library/asyncio-policy.rst:27 msgid "" "The :ref:`policy object ` gets and sets a separate " "event loop per *context*. This is per-thread by default, though custom " "policies could define *context* differently." msgstr "" +":ref:`ポリシーオブジェクト ` は、*コンテキスト* ごと" +"に独立したイベントループを取得・設定します。\n" +"デフォルトではスレッドごとですが、カスタムポリシーでは *コンテキスト* を別の" +"単位で定義できます。" -#: ../../library/asyncio-policy.rst:32 msgid "" "Custom event loop policies can control the behavior of :func:" "`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`." msgstr "" +"カスタムイベントループポリシーは、:func:`get_event_loop`、:func:" +"`set_event_loop`、:func:`new_event_loop` の動作を制御できます。" #: ../../library/asyncio-policy.rst:35 msgid "" @@ -79,11 +92,11 @@ msgstr "" msgid "Return the current process-wide policy." msgstr "プロセス全体にわたる現在のポリシーを返します。" -#: ../../library/asyncio-policy.rst:51 msgid "" "The :func:`get_event_loop_policy` function is deprecated and will be removed " "in Python 3.16." msgstr "" +":func:`get_event_loop_policy` 関数は非推奨で、Python 3.16 で削除されます。" #: ../../library/asyncio-policy.rst:57 msgid "Set the current process-wide policy to *policy*." @@ -94,11 +107,11 @@ msgid "If *policy* is set to ``None``, the default policy is restored." msgstr "" "*policy* が ``None`` の場合、デフォルトポリシーが現在のポリシーに戻されます。" -#: ../../library/asyncio-policy.rst:61 msgid "" "The :func:`set_event_loop_policy` function is deprecated and will be removed " "in Python 3.16." msgstr "" +":func:`set_event_loop_policy` 関数は非推奨で、Python 3.16 で削除されます。" #: ../../library/asyncio-policy.rst:69 msgid "Policy Objects" @@ -136,11 +149,12 @@ msgstr "現在のコンテキストにイベントループ *loop* を設定し msgid "Create and return a new event loop object." msgstr "新しいイベントループオブジェクトを生成して返します。" -#: ../../library/asyncio-policy.rst:98 msgid "" "The :class:`AbstractEventLoopPolicy` class is deprecated and will be removed " "in Python 3.16." msgstr "" +":class:`AbstractEventLoopPolicy` クラスは非推奨で、Python 3.16 で削除されま" +"す。" #: ../../library/asyncio-policy.rst:105 msgid "asyncio ships with the following built-in policies:" @@ -167,17 +181,19 @@ msgstr "" "Windows では :class:`ProactorEventLoop` がデフォルトで使われるようになりまし" "た。" -#: ../../library/asyncio-policy.rst:120 msgid "" "The :meth:`get_event_loop` method of the default asyncio policy now raises " "a :exc:`RuntimeError` if there is no set event loop." msgstr "" +"asyncio のデフォルトポリシーの :meth:`get_event_loop` は、イベントループが設" +"定されていなければ :exc:`RuntimeError` を送出するようになりました。" -#: ../../library/asyncio-policy.rst:124 msgid "" "The :class:`DefaultEventLoopPolicy` class is deprecated and will be removed " "in Python 3.16." msgstr "" +":class:`DefaultEventLoopPolicy` クラスは非推奨で、Python 3.16 で削除されま" +"す。" #: ../../library/asyncio-policy.rst:131 msgid "" @@ -190,11 +206,12 @@ msgstr "" msgid "Availability" msgstr "利用可能な環境" -#: ../../library/asyncio-policy.rst:136 msgid "" "The :class:`WindowsSelectorEventLoopPolicy` class is deprecated and will be " "removed in Python 3.16." msgstr "" +":class:`WindowsSelectorEventLoopPolicy` クラスは非推奨で、Python 3.16 で削除" +"されます。" #: ../../library/asyncio-policy.rst:143 msgid "" @@ -204,11 +221,12 @@ msgstr "" ":class:`ProactorEventLoop` イベントループ実装を使った別のイベントループポリ" "シーです。" -#: ../../library/asyncio-policy.rst:148 msgid "" "The :class:`WindowsProactorEventLoopPolicy` class is deprecated and will be " "removed in Python 3.16." msgstr "" +":class:`WindowsProactorEventLoopPolicy` クラスは非推奨で、Python 3.16 で削除" +"されます。" #: ../../library/asyncio-policy.rst:156 msgid "Custom Policies" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 6cf362390..8f55a1139 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -339,12 +339,14 @@ msgstr "" "例えば、以下のコードはトランスポート内のソケットオブジェクトを取得しようとし" "ます::" -#: ../../library/asyncio-protocol.rst:182 msgid "" "sock = transport.get_extra_info('socket')\n" "if sock is not None:\n" " print(sock.getsockopt(...))" msgstr "" +"sock = transport.get_extra_info('socket')\n" +"if sock is not None:\n" +" print(sock.getsockopt(...))" #: ../../library/asyncio-protocol.rst:186 msgid "Categories of information that can be queried on some transports:" @@ -667,9 +669,8 @@ msgstr "" "` メソッドが引数 :const:`None` で呼び出されま" "す。" -#: ../../library/asyncio-protocol.rst:382 msgid "Subprocess Transports" -msgstr "サブプロセス化されたトランスポート" +msgstr "サブプロセストランスポート" #: ../../library/asyncio-protocol.rst:386 msgid "Return the subprocess process id as an integer." @@ -682,23 +683,27 @@ msgid "" msgstr "" "整数のファイル記述子 *fd* に該当する通信パイプのトランスポートを返します:" -#: ../../library/asyncio-protocol.rst:393 msgid "" "``0``: writable streaming transport of the standard input (*stdin*), or :" "const:`None` if the subprocess was not created with ``stdin=PIPE``" msgstr "" +"``0``: 標準入力 (*stdin*) の書き込み可能なストリーミングトランスポート。\n" +"サブプロセスの作成時に ``stdin=PIPE`` を指定していなければ :const:`None`。" -#: ../../library/asyncio-protocol.rst:395 msgid "" "``1``: readable streaming transport of the standard output (*stdout*), or :" "const:`None` if the subprocess was not created with ``stdout=PIPE``" msgstr "" +"``1``: 標準出力 (*stdout*) の読み込み可能なストリーミングトランスポート。\n" +"サブプロセスの作成時に ``stdout=PIPE`` を指定していなければ :const:`None`。" -#: ../../library/asyncio-protocol.rst:397 msgid "" "``2``: readable streaming transport of the standard error (*stderr*), or :" "const:`None` if the subprocess was not created with ``stderr=PIPE``" msgstr "" +"``2``: 標準エラー出力 (*stderr*) の読み込み可能なストリーミングトランスポー" +"ト。\n" +"サブプロセスの作成時に ``stderr=PIPE`` を指定していなければ :const:`None`。" #: ../../library/asyncio-protocol.rst:399 msgid "other *fd*: :const:`None`" @@ -1029,13 +1034,16 @@ msgstr "" msgid "State machine:" msgstr "ステートマシン:" -#: ../../library/asyncio-protocol.rst:585 msgid "" "start -> connection_made\n" " [-> data_received]*\n" " [-> eof_received]?\n" "-> connection_lost -> end" msgstr "" +"start -> connection_made\n" +" [-> data_received]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" #: ../../library/asyncio-protocol.rst:594 msgid "Buffered Streaming Protocols" @@ -1125,7 +1133,6 @@ msgstr "" "`~BufferedProtocol.get_buffer` と :meth:`~BufferedProtocol.buffer_updated` が" "呼び出されることはありません。" -#: ../../library/asyncio-protocol.rst:643 msgid "" "start -> connection_made\n" " [-> get_buffer\n" @@ -1134,6 +1141,12 @@ msgid "" " [-> eof_received]?\n" "-> connection_lost -> end" msgstr "" +"start -> connection_made\n" +" [-> get_buffer\n" +" [-> buffer_updated]?\n" +" ]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" #: ../../library/asyncio-protocol.rst:654 msgid "Datagram Protocols" @@ -1242,14 +1255,12 @@ msgstr "*fd* はクローズされたファイル記述子を表す整数です msgid "Called when the child process has exited." msgstr "子プロセスが終了したときに呼び出されます。" -#: ../../library/asyncio-protocol.rst:716 msgid "" "It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :" "meth:`~SubprocessProtocol.pipe_connection_lost` methods." msgstr "" -"これは、 :meth:`~SubprocessProtocol.pipe_data_received` と :meth:" -"`~SubprocessProtocol.pipe_connection_lost` メソッドの前に呼び出すことができま" -"す。" +":meth:`~SubprocessProtocol.pipe_data_received` や :meth:`~SubprocessProtocol." +"pipe_connection_lost` より先に呼び出されることもあります。" #: ../../library/asyncio-protocol.rst:721 msgid "Examples" @@ -1267,7 +1278,6 @@ msgstr "" ":meth:`loop.create_server` メソッドを使って TCP エコーサーバーを生成し、受信" "したデータをそのまま送り返して、最後にコネクションをクローズします::" -#: ../../library/asyncio-protocol.rst:731 msgid "" "import asyncio\n" "\n" @@ -1304,6 +1314,39 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol(asyncio.Protocol):\n" +" def connection_made(self, transport):\n" +" peername = transport.get_extra_info('peername')\n" +" print('Connection from {}'.format(peername))\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" message = data.decode()\n" +" print('Data received: {!r}'.format(message))\n" +"\n" +" print('Send: {!r}'.format(message))\n" +" self.transport.write(data)\n" +"\n" +" print('Close the client socket')\n" +" self.transport.close()\n" +"\n" +"\n" +"async def main():\n" +" # 低水準 API を使うため、イベントループへの参照を取得する。\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" server = await loop.create_server(\n" +" EchoServerProtocol,\n" +" '127.0.0.1', 8888)\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-protocol.rst:769 msgid "" @@ -1325,7 +1368,6 @@ msgstr "" ":meth:`loop.create_connection` メソッドを使った TCP エコークライアントは、" "データを送信したあとコネクションがクローズされるまで待機します::" -#: ../../library/asyncio-protocol.rst:780 msgid "" "import asyncio\n" "\n" @@ -1369,6 +1411,46 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol(asyncio.Protocol):\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" transport.write(self.message.encode())\n" +" print('Data sent: {!r}'.format(self.message))\n" +"\n" +" def data_received(self, data):\n" +" print('Data received: {!r}'.format(data.decode()))\n" +"\n" +" def connection_lost(self, exc):\n" +" print('The server closed the connection')\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # 低水準 API を使うため、イベントループへの参照を取得する。\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = 'Hello World!'\n" +"\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" '127.0.0.1', 8888)\n" +"\n" +" # プロトコルが接続の切断を通知するまで待ち、\n" +" # トランスポートを閉じる。\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-protocol.rst:825 msgid "" @@ -1391,7 +1473,6 @@ msgstr "" ":meth:`loop.create_datagram_endpoint` メソッドを使った UDP エコーサーバーは受" "信したデータをそのまま送り返します::" -#: ../../library/asyncio-protocol.rst:837 msgid "" "import asyncio\n" "\n" @@ -1428,6 +1509,39 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol:\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def datagram_received(self, data, addr):\n" +" message = data.decode()\n" +" print('Received %r from %s' % (message, addr))\n" +" print('Send %r to %s' % (message, addr))\n" +" self.transport.sendto(data, addr)\n" +"\n" +"\n" +"async def main():\n" +" print(\"Starting UDP server\")\n" +"\n" +" # 低水準 API を使うため、イベントループへの参照を取得する。\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # 一つのプロトコルインスタンスで、\n" +" # すべてのクライアント要求を処理する。\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" EchoServerProtocol,\n" +" local_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await asyncio.sleep(3600) # 1 時間処理を続ける。\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-protocol.rst:876 msgid "UDP Echo Client" @@ -1441,7 +1555,6 @@ msgstr "" ":meth:`loop.create_datagram_endpoint` メソッドを使った UDP エコークライアント" "はデータを送信し、応答を受信するとトランスポートをクローズします::" -#: ../../library/asyncio-protocol.rst:881 msgid "" "import asyncio\n" "\n" @@ -1491,6 +1604,52 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol:\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +" self.transport = None\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +" print('Send:', self.message)\n" +" self.transport.sendto(self.message.encode())\n" +"\n" +" def datagram_received(self, data, addr):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" print(\"Close the socket\")\n" +" self.transport.close()\n" +"\n" +" def error_received(self, exc):\n" +" print('Error received:', exc)\n" +"\n" +" def connection_lost(self, exc):\n" +" print(\"Connection closed\")\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # 低水準 API を使うため、イベントループへの参照を取得する。\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = \"Hello World!\"\n" +"\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" remote_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-protocol.rst:933 msgid "Connecting Existing Sockets" @@ -1504,7 +1663,6 @@ msgstr "" "プロトコルを設定した :meth:`loop.create_connection` メソッドを使ってソケット" "がデータを受信するまで待機します::" -#: ../../library/asyncio-protocol.rst:938 msgid "" "import asyncio\n" "import socket\n" @@ -1555,6 +1713,53 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import socket\n" +"\n" +"\n" +"class MyProtocol(asyncio.Protocol):\n" +"\n" +" def __init__(self, on_con_lost):\n" +" self.transport = None\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # 処理が済んだのでトランスポートを閉じる。\n" +" # connection_lost() は自動的に呼び出される。\n" +" self.transport.close()\n" +"\n" +" def connection_lost(self, exc):\n" +" # ソケットが閉じられた\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # 低水準 API を使うため、イベントループへの参照を取得する。\n" +" loop = asyncio.get_running_loop()\n" +" on_con_lost = loop.create_future()\n" +"\n" +" # 接続されたソケットのペアを作成する\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # データを待ち受けるためにソケットを登録する。\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: MyProtocol(on_con_lost), sock=rsock)\n" +"\n" +" # ネットワークからのデータ受信を模倣する。\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" try:\n" +" await protocol.on_con_lost\n" +" finally:\n" +" transport.close()\n" +" wsock.close()\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-protocol.rst:989 msgid "" @@ -1593,7 +1798,6 @@ msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" msgstr "" "サブプロセスは :meth:`loop.subprocess_exec` メソッドにより生成されます::" -#: ../../library/asyncio-protocol.rst:1007 msgid "" "import asyncio\n" "import sys\n" @@ -1653,6 +1857,61 @@ msgid "" "date = asyncio.run(get_date())\n" "print(f\"Current date: {date}\")" msgstr "" +"import asyncio\n" +"import sys\n" +"\n" +"class DateProtocol(asyncio.SubprocessProtocol):\n" +" def __init__(self, exit_future):\n" +" self.exit_future = exit_future\n" +" self.output = bytearray()\n" +" self.pipe_closed = False\n" +" self.exited = False\n" +"\n" +" def pipe_connection_lost(self, fd, exc):\n" +" self.pipe_closed = True\n" +" self.check_for_exit()\n" +"\n" +" def pipe_data_received(self, fd, data):\n" +" self.output.extend(data)\n" +"\n" +" def process_exited(self):\n" +" self.exited = True\n" +" # process_exited() は pipe_connection_lost() より先に\n" +" # 呼び出されることがあるので、両方が呼び出されるまで待つ。\n" +" self.check_for_exit()\n" +"\n" +" def check_for_exit(self):\n" +" if self.pipe_closed and self.exited:\n" +" self.exit_future.set_result(True)\n" +"\n" +"async def get_date():\n" +" # 低水準 API を使うため、イベントループへの参照を取得する。\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" code = 'import datetime as dt; print(dt.datetime.now())'\n" +" exit_future = asyncio.Future(loop=loop)\n" +"\n" +" # DateProtocol で制御するサブプロセスを作成し、\n" +" # 標準出力をパイプにリダイレクトする。\n" +" transport, protocol = await loop.subprocess_exec(\n" +" lambda: DateProtocol(exit_future),\n" +" sys.executable, '-c', code,\n" +" stdin=None, stderr=None)\n" +"\n" +" # プロトコルの process_exited() メソッドを使って、\n" +" # サブプロセスの終了を待つ。\n" +" await exit_future\n" +"\n" +" # 標準出力のパイプを閉じる。\n" +" transport.close()\n" +"\n" +" # プロトコルの pipe_data_received() メソッドが\n" +" # 集めた出力を読み出す。\n" +" data = bytes(protocol.output)\n" +" return data.decode('ascii').rstrip()\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" #: ../../library/asyncio-protocol.rst:1065 msgid "" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index b64e9fa39..c3f06da09 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -101,11 +101,12 @@ msgstr "キューが空ならば ``True`` を、そうでなければ ``False`` msgid "Return ``True`` if there are :attr:`maxsize` items in the queue." msgstr "キューに要素が :attr:`maxsize` 個あれば ``True`` を返します。" -#: ../../library/asyncio-queue.rst:57 msgid "" "If the queue was initialized with ``maxsize=0`` (the default), then :meth:" "`full` never returns ``True``." msgstr "" +"``maxsize=0`` (デフォルト) で初期化したキューでは、:meth:`full` が ``True`` " +"を返すことはありません。" #: ../../library/asyncio-queue.rst:63 msgid "" @@ -115,11 +116,12 @@ msgstr "" "キューから要素を削除して返します。キューが空の場合項目が利用可能になるまで待" "機します。" -#: ../../library/asyncio-queue.rst:66 msgid "" "Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or " "if the queue has been shut down immediately." msgstr "" +"キューがシャットダウン済みで空の場合、または即時シャットダウンされた場合は、:" +"exc:`QueueShutDown` を送出します。" msgid "" "Return an item if one is immediately available, else raise :exc:`QueueEmpty`." @@ -127,10 +129,10 @@ msgstr "" "直ちに利用できる要素がある場合はその要素を返し、そうでなければ :exc:" "`QueueEmpty` を送出します。" -#: ../../library/asyncio-queue.rst:74 msgid "" "Raises :exc:`QueueShutDown` if the queue has been shut down and is empty." msgstr "" +"キューがシャットダウン済みで空の場合、:exc:`QueueShutDown` を送出します。" #: ../../library/asyncio-queue.rst:79 msgid "Block until all items in the queue have been received and processed." @@ -157,9 +159,8 @@ msgstr "" "要素をキューに入力します。キューが満杯の場合、要素を追加する前に空きスロット" "が利用できるようになるまで待機します。" -#: ../../library/asyncio-queue.rst:93 ../../library/asyncio-queue.rst:101 msgid "Raises :exc:`QueueShutDown` if the queue has been shut down." -msgstr "" +msgstr "キューがシャットダウン済みの場合、:exc:`QueueShutDown` を送出します。" #: ../../library/asyncio-queue.rst:97 msgid "Put an item into the queue without blocking." @@ -173,36 +174,40 @@ msgstr "直ちに利用できるスロットがない場合、:exc:`QueueFull` msgid "Return the number of items in the queue." msgstr "キュー内の要素数を返します。" -#: ../../library/asyncio-queue.rst:109 msgid "Put a :class:`Queue` instance into a shutdown mode." -msgstr "" +msgstr ":class:`Queue` インスタンスをシャットダウンモードにします。" -#: ../../library/asyncio-queue.rst:111 msgid "" "The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc:" "`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be " "unblocked and will raise :exc:`QueueShutDown` in the formerly awaiting task." msgstr "" +"以後、キューに要素を追加できなくなります。\n" +":meth:`~Queue.put` を呼び出すと :exc:`QueueShutDown` を送出します。\n" +"すでに :meth:`~Queue.put` でブロックしている呼び出し元もブロックを解除され、" +"待機していたタスク内で :exc:`QueueShutDown` が送出されます。" -#: ../../library/asyncio-queue.rst:116 msgid "" "If *immediate* is false (the default), the queue can be wound down normally " "with :meth:`~Queue.get` calls to extract tasks that have already been loaded." msgstr "" +"*immediate* が偽 (デフォルト) の場合、:meth:`~Queue.get` で格納済みのタスクを" +"取り出し、通常の手順で処理を進めてキューを終了できます。" -#: ../../library/asyncio-queue.rst:120 msgid "" "And if :meth:`~Queue.task_done` is called for each remaining task, a " "pending :meth:`~Queue.join` will be unblocked normally." msgstr "" +"残っている各タスクに対して :meth:`~Queue.task_done` を呼び出せば、待機中の :" +"meth:`~Queue.join` のブロックは通常どおり解除されます。" -#: ../../library/asyncio-queue.rst:123 msgid "" "Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:" "`QueueShutDown`." msgstr "" +"キューが空になると、以後の :meth:`~Queue.get` は :exc:`QueueShutDown` を送出" +"します。" -#: ../../library/asyncio-queue.rst:126 msgid "" "If *immediate* is true, the queue is terminated immediately. The queue is " "drained to be completely empty and the count of unfinished tasks is reduced " @@ -211,24 +216,35 @@ msgid "" "get` are unblocked and will raise :exc:`QueueShutDown` because the queue is " "empty." msgstr "" +"*immediate* が真の場合、キューを即座に終了します。\n" +"キューからすべての要素を取り除いて空にし、取り除いたタスクの数だけ未完了タス" +"ク数を減らします。\n" +"未完了タスク数がゼロになると、:meth:`~Queue.join` の呼び出し元のブロックを解" +"除します。\n" +"また、:meth:`~Queue.get` でブロックしている呼び出し元もブロックを解除されます" +"が、キューが空なので :exc:`QueueShutDown` が送出されます。" -#: ../../library/asyncio-queue.rst:134 msgid "" "Use caution when using :meth:`~Queue.join` with *immediate* set to true. " "This unblocks the join even when no work has been done on the tasks, " "violating the usual invariant for joining a queue." msgstr "" +"*immediate* を真に設定するときは、:meth:`~Queue.join` の使用に注意してくださ" +"い。\n" +"タスクが処理されていなくても ``join()`` のブロックが解除され、キューの完了待" +"機で通常成り立つ不変条件が破られます。" -#: ../../library/asyncio-queue.rst:142 msgid "Indicate that a formerly enqueued work item is complete." -msgstr "" +msgstr "キューに投入されていた作業項目の処理が完了したことを通知します。" -#: ../../library/asyncio-queue.rst:144 msgid "" "Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " "item, a subsequent call to :meth:`task_done` tells the queue that the " "processing on the work item is complete." msgstr "" +"キューから作業を取り出す側が使います。\n" +":meth:`~Queue.get` で作業項目を取り出すたびに、処理後に :meth:`task_done` を" +"呼び出して、作業が完了したことをキューに伝えます。" #: ../../library/asyncio-queue.rst:148 msgid "" @@ -251,13 +267,10 @@ msgstr "" msgid "Priority Queue" msgstr "優先度付きのキュー" -#: ../../library/asyncio-queue.rst:162 msgid "" "A variant of :class:`Queue`; retrieves entries in priority order (lowest " "first)." -msgstr "" -":class:`Queue` の変種です; 優先順位にしたがって要素を取り出します (最低順位が" -"最初に取り出されます)。" +msgstr ":class:`Queue` の一種で、優先度の値が小さい要素から取り出します。" #: ../../library/asyncio-queue.rst:165 msgid "Entries are typically tuples of the form ``(priority_number, data)``." @@ -295,12 +308,14 @@ msgstr "" "サイズが *maxsize* に達したキューに対して :meth:`~Queue.put_nowait` メソッド" "が 呼ばれたときに送出される例外です。" -#: ../../library/asyncio-queue.rst:195 msgid "" "Exception raised when :meth:`~Queue.put`, :meth:`~Queue.put_nowait`, :meth:" "`~Queue.get` or :meth:`~Queue.get_nowait` is called on a queue which has " "been shut down." msgstr "" +"シャットダウン済みのキューに対して :meth:`~Queue.put`、:meth:`~Queue." +"put_nowait`、:meth:`~Queue.get`、:meth:`~Queue.get_nowait` を呼び出したときに" +"送出される例外です。" #: ../../library/asyncio-queue.rst:203 msgid "Examples" @@ -313,7 +328,6 @@ msgstr "" "キューを使って、並行処理を行う複数のタスクにワークロードを分散させることがで" "きます::" -#: ../../library/asyncio-queue.rst:210 msgid "" "import asyncio\n" "import random\n" @@ -369,3 +383,56 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import random\n" +"import time\n" +"\n" +"\n" +"async def worker(name, queue):\n" +" while True:\n" +" # キューから作業項目を取り出す。\n" +" sleep_for = await queue.get()\n" +"\n" +" # sleep_for 秒スリープする。\n" +" await asyncio.sleep(sleep_for)\n" +"\n" +" # 作業項目の処理が完了したことをキューに通知する。\n" +" queue.task_done()\n" +"\n" +" print(f'{name} has slept for {sleep_for:.2f} seconds')\n" +"\n" +"\n" +"async def main():\n" +" # 作業を格納するキューを作成する。\n" +" queue = asyncio.Queue()\n" +"\n" +" # ランダムな待ち時間を生成してキューに追加する。\n" +" total_sleep_time = 0\n" +" for _ in range(20):\n" +" sleep_for = random.uniform(0.05, 1.0)\n" +" total_sleep_time += sleep_for\n" +" queue.put_nowait(sleep_for)\n" +"\n" +" # キューを並行して処理する三つのワーカータスクを作成する。\n" +" tasks = []\n" +" for i in range(3):\n" +" task = asyncio.create_task(worker(f'worker-{i}', queue))\n" +" tasks.append(task)\n" +"\n" +" # キューの全項目の処理が完了するまで待つ。\n" +" started_at = time.monotonic()\n" +" await queue.join()\n" +" total_slept_for = time.monotonic() - started_at\n" +"\n" +" # ワーカータスクをキャンセルする。\n" +" for task in tasks:\n" +" task.cancel()\n" +" # すべてのワーカータスクのキャンセルが完了するまで待つ。\n" +" await asyncio.gather(*tasks, return_exceptions=True)\n" +"\n" +" print('====')\n" +" print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')\n" +" print(f'total expected sleep time: {total_sleep_time:.2f} seconds')\n" +"\n" +"\n" +"asyncio.run(main())" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 9d286da9f..a333a142d 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -23,9 +23,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-runner.rst:6 msgid "Runners" -msgstr "" +msgstr "Runner" #: ../../library/asyncio-runner.rst:8 msgid "**Source code:** :source:`Lib/asyncio/runners.py`" @@ -51,19 +50,18 @@ msgstr "" msgid "Running an asyncio Program" msgstr "非同期プログラムの実行" -#: ../../library/asyncio-runner.rst:27 msgid "Execute *coro* in an asyncio event loop and return the result." -msgstr "" +msgstr "asyncio のイベントループで *coro* を実行し、その結果を返します。" -#: ../../library/asyncio-runner.rst:29 ../../library/asyncio-runner.rst:121 msgid "The argument can be any awaitable object." -msgstr "" +msgstr "引数には任意の awaitable オブジェクトを指定できます。" -#: ../../library/asyncio-runner.rst:31 msgid "" "This function runs the awaitable, taking care of managing the asyncio event " "loop, *finalizing asynchronous generators*, and closing the executor." msgstr "" +"この関数は awaitable を実行し、asyncio のイベントループの管理、*非同期ジェネ" +"レーターの終了処理*、Executor の終了処理を行います。" #: ../../library/asyncio-runner.rst:35 ../../library/asyncio-runner.rst:131 msgid "" @@ -83,7 +81,6 @@ msgstr "" "``False`` は明示的にデバッグモードを無効化します。 グローバルな :ref:" "`asyncio-debug-mode` 設定を尊重するために ``None`` が使用されます。" -#: ../../library/asyncio-runner.rst:42 msgid "" "If *loop_factory* is not ``None``, it is used to create a new event loop; " "otherwise :func:`asyncio.new_event_loop` is used. The loop is closed at the " @@ -92,19 +89,29 @@ msgid "" "*loop_factory* to configure the event loop instead of policies. Passing :" "class:`asyncio.EventLoop` allows running asyncio without the policy system." msgstr "" +"*loop_factory* が ``None`` でなければ、それを使って新しいイベントループを作成" +"します。\n" +"それ以外の場合は :func:`asyncio.new_event_loop` を使います。\n" +"終了時にループを閉じます。\n" +"この関数は asyncio プログラムのメインのエントリーポイントとして使い、できれば" +"一度だけ呼び出してください。\n" +"イベントループの設定には、ポリシーの代わりに *loop_factory* を使うことを推奨" +"します。\n" +":class:`asyncio.EventLoop` を渡すと、ポリシーシステムを使わずに asyncio を実" +"行できます。" -#: ../../library/asyncio-runner.rst:50 msgid "" "The executor is given a timeout duration of 5 minutes to shutdown. If the " "executor hasn't finished within that duration, a warning is emitted and the " "executor is closed." msgstr "" +"Executor の終了を待つ制限時間は 5 分です。\n" +"その時間内に終了しなければ、警告を出して Executor の終了処理を行います。" #: ../../library/asyncio-runner.rst:54 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/asyncio-runner.rst:56 msgid "" "async def main():\n" " await asyncio.sleep(1)\n" @@ -112,6 +119,11 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-runner.rst:64 msgid "Updated to use :meth:`loop.shutdown_default_executor`." @@ -129,20 +141,20 @@ msgstr "" msgid "Added *loop_factory* parameter." msgstr "*loop_factory* 引数が追加されました。" -#: ../../library/asyncio-runner.rst:77 ../../library/asyncio-runner.rst:136 msgid "*coro* can be any awaitable object." -msgstr "" +msgstr "*coro* に任意の awaitable オブジェクトを指定できるようになりました。" -#: ../../library/asyncio-runner.rst:81 msgid "" "The :mod:`!asyncio` policy system is deprecated and will be removed in " "Python 3.16; from there on, an explicit *loop_factory* is needed to " "configure the event loop." msgstr "" +":mod:`!asyncio` のポリシーシステムは非推奨で、Python 3.16 で削除されます。\n" +"それ以降、イベントループを設定するには *loop_factory* を明示的に指定する必要" +"があります。" -#: ../../library/asyncio-runner.rst:87 msgid "Runner context manager" -msgstr "" +msgstr "Runner コンテキストマネージャー" #: ../../library/asyncio-runner.rst:91 msgid "" @@ -152,27 +164,31 @@ msgstr "" "同じコンテキスト上での *複数* の非同期関数呼び出しをシンプルにするコンテキス" "トマネージャ。" -#: ../../library/asyncio-runner.rst:94 msgid "" "Sometimes several top-level async functions should be called in the same :" "ref:`event loop ` and :class:`contextvars.Context`." msgstr "" +"複数のトップレベルの非同期関数を、同じ :ref:`イベントループ ` と :class:`contextvars.Context` で呼び出したい場合があります。" -#: ../../library/asyncio-runner.rst:101 msgid "" "*loop_factory* could be used for overriding the loop creation. It is the " "responsibility of the *loop_factory* to set the created loop as the current " "one. By default :func:`asyncio.new_event_loop` is used and set as current " "event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``." msgstr "" +"*loop_factory* で、ループの作成方法を変更できます。\n" +"作成したループを現在のループとして設定するのは *loop_factory* の役割です。\n" +"*loop_factory* が ``None`` の場合は、デフォルトで :func:`asyncio." +"new_event_loop` を使い、:func:`asyncio.set_event_loop` で現在のイベントループ" +"に設定します。" -#: ../../library/asyncio-runner.rst:106 msgid "" "Basically, :func:`asyncio.run` example can be rewritten with the runner " "usage::" msgstr "" +":func:`asyncio.run` の例は、Runner を使って次のように書き換えられます。 ::" -#: ../../library/asyncio-runner.rst:108 msgid "" "async def main():\n" " await asyncio.sleep(1)\n" @@ -181,84 +197,95 @@ msgid "" "with asyncio.Runner() as runner:\n" " runner.run(main())" msgstr "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"with asyncio.Runner() as runner:\n" +" runner.run(main())" -#: ../../library/asyncio-runner.rst:119 msgid "Execute *coro* in the embedded event loop." -msgstr "" +msgstr "内部のイベントループで *coro* を実行します。" -#: ../../library/asyncio-runner.rst:123 msgid "If the argument is a coroutine, it is wrapped in a Task." -msgstr "" +msgstr "引数がコルーチンの場合、Task でラップします。" -#: ../../library/asyncio-runner.rst:125 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the code to run in. The runner's default " "context is used if context is ``None``." msgstr "" +"省略可能なキーワード専用引数 *context* には、コードの実行に使う :class:" +"`contextvars.Context` を指定できます。\n" +"``context`` が ``None`` の場合は、Runner のデフォルトのコンテキストを使いま" +"す。" -#: ../../library/asyncio-runner.rst:129 msgid "Returns the awaitable's result or raises an exception." -msgstr "" +msgstr "awaitable の結果を返すか、例外を送出します。" -#: ../../library/asyncio-runner.rst:140 msgid "Close the runner." -msgstr "" +msgstr "Runner を閉じます。" -#: ../../library/asyncio-runner.rst:142 msgid "" "Finalize asynchronous generators, shutdown default executor, close the event " "loop and release embedded :class:`contextvars.Context`." msgstr "" +"非同期ジェネレーターの終了処理を行い、デフォルトの Executor とイベントループ" +"を閉じ、内部の :class:`contextvars.Context` を解放します。" -#: ../../library/asyncio-runner.rst:147 msgid "Return the event loop associated with the runner instance." -msgstr "" +msgstr "Runner インスタンスに関連付けられたイベントループを返します。" -#: ../../library/asyncio-runner.rst:151 msgid "" ":class:`Runner` uses the lazy initialization strategy, its constructor " "doesn't initialize underlying low-level structures." msgstr "" +":class:`Runner` は遅延初期化を採用しており、コンストラクターでは内部の低水準" +"なデータ構造を初期化しません。" -#: ../../library/asyncio-runner.rst:154 msgid "" "Embedded *loop* and *context* are created at the :keyword:`with` body " "entering or the first call of :meth:`run` or :meth:`get_loop`." msgstr "" +"内部の *loop* と *context* は、:keyword:`with` 文の本体に入るとき、または :" +"meth:`run` か :meth:`get_loop` を初めて呼び出すときに作成されます。" -#: ../../library/asyncio-runner.rst:159 msgid "Handling Keyboard Interruption" -msgstr "" +msgstr "キーボード割り込みの処理" -#: ../../library/asyncio-runner.rst:163 msgid "" "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, :exc:" "`KeyboardInterrupt` exception is raised in the main thread by default. " "However this doesn't work with :mod:`asyncio` because it can interrupt " "asyncio internals and can hang the program from exiting." msgstr "" +":kbd:`Ctrl-C` で :const:`signal.SIGINT` が発生すると、デフォルトではメインス" +"レッドで :exc:`KeyboardInterrupt` が送出されます。\n" +"しかし :mod:`asyncio` では、内部の処理が中断されてプログラムが終了できなくな" +"る可能性があるため、この動作は適していません。" -#: ../../library/asyncio-runner.rst:168 msgid "" "To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as " "follows:" msgstr "" +"この問題を軽減するため、:mod:`asyncio` は :const:`signal.SIGINT` を次のように" +"処理します。" -#: ../../library/asyncio-runner.rst:170 msgid "" ":meth:`asyncio.Runner.run` installs a custom :const:`signal.SIGINT` handler " "before any user code is executed and removes it when exiting from the " "function." msgstr "" +":meth:`asyncio.Runner.run` はユーザーコードの実行前に独自の :const:`signal." +"SIGINT` ハンドラーを設定し、関数を終了するときに取り除きます。" -#: ../../library/asyncio-runner.rst:172 msgid "" "The :class:`~asyncio.Runner` creates the main task for the passed coroutine " "for its execution." msgstr "" +":class:`~asyncio.Runner` は、渡されたコルーチンを実行するメインタスクを作成し" +"ます。" -#: ../../library/asyncio-runner.rst:174 msgid "" "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, the custom signal " "handler cancels the main task by calling :meth:`asyncio.Task.cancel` which " @@ -267,11 +294,22 @@ msgid "" "used for resource cleanup. After the main task is cancelled, :meth:`asyncio." "Runner.run` raises :exc:`KeyboardInterrupt`." msgstr "" +":kbd:`Ctrl-C` によって :const:`signal.SIGINT` が発生すると、独自のシグナルハ" +"ンドラーが :meth:`asyncio.Task.cancel` を呼び出してメインタスクをキャンセルし" +"ます。\n" +"これにより、メインタスク内で :exc:`asyncio.CancelledError` が送出されます。\n" +"Python のスタックが巻き戻されるため、``try/except`` や ``try/finally`` ブロッ" +"クでリソースを解放できます。\n" +"メインタスクのキャンセル後、:meth:`asyncio.Runner.run` は :exc:" +"`KeyboardInterrupt` を送出します。" -#: ../../library/asyncio-runner.rst:180 msgid "" "A user could write a tight loop which cannot be interrupted by :meth:" "`asyncio.Task.cancel`, in which case the second following :kbd:`Ctrl-C` " "immediately raises the :exc:`KeyboardInterrupt` without cancelling the main " "task." msgstr "" +"ユーザーが書いたループが処理を譲らずに繰り返し続け、:meth:`asyncio.Task." +"cancel` で中断できない場合があります。\n" +"その場合、2 回目の :kbd:`Ctrl-C` はメインタスクをキャンセルせず、即座に :exc:" +"`KeyboardInterrupt` を送出します。" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index bd5a16783..d040fad36 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -46,7 +46,6 @@ msgid "Here is an example of a TCP echo client written using asyncio streams::" msgstr "" "以下は asyncio ストリームを使って書いた TCP エコークライアントの例です::" -#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:455 msgid "" "import asyncio\n" "\n" @@ -67,6 +66,24 @@ msgid "" "\n" "asyncio.run(tcp_echo_client('Hello World!'))" msgstr "" +"import asyncio\n" +"\n" +"async def tcp_echo_client(message):\n" +" reader, writer = await asyncio.open_connection(\n" +" '127.0.0.1', 8888)\n" +"\n" +" print(f'Send: {message!r}')\n" +" writer.write(message.encode())\n" +" await writer.drain()\n" +"\n" +" data = await reader.read(100)\n" +" print(f'Received: {data.decode()!r}')\n" +"\n" +" print('Close the connection')\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"asyncio.run(tcp_echo_client('Hello World!'))" #: ../../library/asyncio-stream.rst:42 msgid "See also the `Examples`_ section below." @@ -114,12 +131,15 @@ msgid "" "create_connection`." msgstr "残りの引数は直接 :meth:`loop.create_connection` に渡されます。" -#: ../../library/asyncio-stream.rst:74 ../../library/asyncio-stream.rst:154 msgid "" "The *sock* argument transfers ownership of the socket to the :class:" "`StreamWriter` created. To close the socket, call its :meth:`~asyncio." "StreamWriter.close` method." msgstr "" +"*sock* 引数を渡すと、ソケットの所有権は作成された :class:`StreamWriter` に移" +"ります。\n" +"ソケットを閉じるには、その :meth:`~asyncio.StreamWriter.close` メソッドを呼び" +"出してください。" #: ../../library/asyncio-stream.rst:78 msgid "Added the *ssl_handshake_timeout* parameter." @@ -171,20 +191,21 @@ msgid "" "The rest of the arguments are passed directly to :meth:`loop.create_server`." msgstr "残りの引数は直接 :meth:`loop.create_server` に渡されます。" -#: ../../library/asyncio-stream.rst:121 ../../library/asyncio-stream.rst:189 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" +"*sock* 引数を渡すと、ソケットの所有権は作成されたサーバーに移ります。\n" +"ソケットを閉じるには、サーバーの :meth:`~asyncio.Server.close` メソッドを呼び" +"出してください。" #: ../../library/asyncio-stream.rst:125 msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." msgstr "" "*ssl_handshake_timeout* と *start_serving* パラメータが追加されました。" -#: ../../library/asyncio-stream.rst:134 msgid "Added the *keep_alive* parameter." -msgstr "" +msgstr "*keep_alive* パラメーターが追加されました。" #: ../../library/asyncio-stream.rst:139 msgid "Unix Sockets" @@ -210,11 +231,12 @@ msgstr ":meth:`loop.create_unix_connection` のドキュメントも参照して msgid "Availability" msgstr "利用可能な環境" -#: ../../library/asyncio-stream.rst:160 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`" msgstr "" +"*ssl_handshake_timeout* パラメーターが追加されました。\n" +"*path* パラメーターに :term:`path-like object` を指定できるようになりました。" #: ../../library/asyncio-stream.rst:177 msgid "Start a Unix socket server." @@ -224,37 +246,41 @@ msgstr "Unix のソケットサーバーを起動します。" msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr ":func:`start_server` と似ていますが Unix ソケットに対して動作します。" -#: ../../library/asyncio-stream.rst:181 msgid "" "If *cleanup_socket* is true then the Unix socket will automatically be " "removed from the filesystem when the server is closed, unless the socket has " "been replaced after the server has been created." msgstr "" +"*cleanup_socket* が真の場合、サーバーを閉じると Unix ソケットをファイルシステ" +"ムから自動的に削除します。\n" +"ただし、サーバーを作成した後にソケットが置き換えられていれば削除しません。" #: ../../library/asyncio-stream.rst:185 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr ":meth:`loop.create_unix_server` のドキュメントも参照してください。" -#: ../../library/asyncio-stream.rst:195 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :term:`path-like object`." msgstr "" +"*ssl_handshake_timeout* と *start_serving* パラメーターが追加されました。\n" +"*path* パラメーターに :term:`path-like object` を指定できるようになりました。" -#: ../../library/asyncio-stream.rst:205 msgid "Added the *cleanup_socket* parameter." -msgstr "" +msgstr "*cleanup_socket* パラメーターが追加されました。" #: ../../library/asyncio-stream.rst:210 msgid "StreamReader" msgstr "StreamReader" -#: ../../library/asyncio-stream.rst:214 msgid "" "Represents a reader object that provides APIs to read data from the IO " "stream. As an :term:`asynchronous iterable`, the object supports the :" "keyword:`async for` statement." msgstr "" +"I/O ストリームからデータを読み込む API を提供するリーダーオブジェクトです。\n" +":term:`非同期イテラブル ` なので、:keyword:`async " +"for` 文をサポートします。" #: ../../library/asyncio-stream.rst:218 msgid "" @@ -364,17 +390,22 @@ msgstr "" "外が送出され、内部バッファーがリセットされます。このとき :attr:" "`IncompleteReadError.partial` 属性は区切り文字の一部を含むかもしれません。" -#: ../../library/asyncio-stream.rst:282 msgid "" "The *separator* may also be a tuple of separators. In this case the return " "value will be the shortest possible that has any separator as the suffix. " "For the purposes of :exc:`LimitOverrunError`, the shortest possible " "separator is considered to be the one that matched." msgstr "" +"*separator* には、区切り文字のタプルも指定できます。\n" +"この場合、いずれかの区切り文字を末尾に持つ、できる限り短いデータを返しま" +"す。\n" +":exc:`LimitOverrunError` の判定では、該当する最短の区切り文字がマッチしたもの" +"として扱います。" -#: ../../library/asyncio-stream.rst:292 msgid "The *separator* parameter may now be a :class:`tuple` of separators." msgstr "" +"*separator* パラメーターに、区切り文字の :class:`tuple` を指定できるようにな" +"りました。" #: ../../library/asyncio-stream.rst:297 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." @@ -410,21 +441,23 @@ msgstr "" "込みに失敗した場合、データは送信可能になるまで内部の書き込みバッファーに格納" "されて待機します。" -#: ../../library/asyncio-stream.rst:319 msgid "" "The *data* buffer should be a bytes, bytearray, or C-contiguous one-" "dimensional memoryview object." msgstr "" +"*data* バッファには、``bytes``、``bytearray``、または C 形式で連続した 1 次元" +"の ``memoryview`` オブジェクトを指定してください。" #: ../../library/asyncio-stream.rst:322 ../../library/asyncio-stream.rst:335 msgid "The method should be used along with the ``drain()`` method::" msgstr "このメソッドは ``drain()`` メソッドと組み合わせて使うべきです::" -#: ../../library/asyncio-stream.rst:324 msgid "" "stream.write(data)\n" "await stream.drain()" msgstr "" +"stream.write(data)\n" +"await stream.drain()" #: ../../library/asyncio-stream.rst:330 msgid "" @@ -436,27 +469,30 @@ msgstr "" "を即座に書き込みます。書き込みに失敗した場合、データは送信可能になるまで内部" "の書き込みバッファーに格納されて待機します。" -#: ../../library/asyncio-stream.rst:337 msgid "" "stream.writelines(lines)\n" "await stream.drain()" msgstr "" +"stream.writelines(lines)\n" +"await stream.drain()" #: ../../library/asyncio-stream.rst:342 msgid "The method closes the stream and the underlying socket." msgstr "このメソッドはストリームと背後にあるソケットをクローズします。" -#: ../../library/asyncio-stream.rst:344 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" msgstr "" +"必須ではありませんが、このメソッドは ``wait_closed()`` と組み合わせて使ってく" +"ださい。 ::" -#: ../../library/asyncio-stream.rst:347 msgid "" "stream.close()\n" "await stream.wait_closed()" msgstr "" +"stream.close()\n" +"await stream.wait_closed()" #: ../../library/asyncio-stream.rst:352 msgid "" @@ -489,11 +525,12 @@ msgstr "" msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "ストリームへの書き込み再開に適切な状態になるまで待ちます。使用例::" -#: ../../library/asyncio-stream.rst:375 msgid "" "writer.write(data)\n" "await writer.drain()" msgstr "" +"writer.write(data)\n" +"await writer.drain()" msgid "" "This is a flow control method that interacts with the underlying IO write " @@ -517,9 +554,8 @@ msgid "" "explicitly with ``await asyncio.sleep(0)`` (see :func:`asyncio.sleep`)." msgstr "" -#: ../../library/asyncio-stream.rst:399 msgid "Upgrade an existing stream-based connection to TLS." -msgstr "" +msgstr "既存のストリームベースの接続を TLS にアップグレードします。" #: ../../library/asyncio-stream.rst:401 msgid "Parameters:" @@ -537,25 +573,30 @@ msgstr "" "*server_hostname*: 対象のサーバーの証明書との照合に使われるホスト名を設定また" "は上書きします。" -#: ../../library/asyncio-stream.rst:408 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" +"*ssl_handshake_timeout* は、接続を中断する前に TLS ハンドシェイクの完了を待つ" +"時間を秒単位で指定します。\n" +"``None`` (デフォルト) の場合は ``60.0`` 秒です。" -#: ../../library/asyncio-stream.rst:412 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" +"*ssl_shutdown_timeout* は、接続を中断する前に SSL の終了処理を待つ時間を秒単" +"位で指定します。\n" +"``None`` (デフォルト) の場合は ``30.0`` 秒です。" -#: ../../library/asyncio-stream.rst:421 msgid "" "Raises a ``ValueError`` if ``sslcontext.check_hostname`` is ``True`` and " "``server_hostname`` is not supplied." msgstr "" +"``sslcontext.check_hostname`` が ``True`` で、``server_hostname`` が指定され" +"ていない場合に ``ValueError`` を送出するようになりました。" #: ../../library/asyncio-stream.rst:428 msgid "" @@ -568,12 +609,14 @@ msgstr "" msgid "Wait until the stream is closed." msgstr "ストリームがクローズされるまで待機します。" -#: ../../library/asyncio-stream.rst:438 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " "program." msgstr "" +":meth:`close` の後に呼び出して、下層の接続が閉じられるまで待ってください。\n" +"これにより、例えばプログラムを終了する前に、すべてのデータがフラッシュされた" +"ことを確認できます。" #: ../../library/asyncio-stream.rst:446 msgid "Examples" @@ -606,7 +649,6 @@ msgstr "ストリームを使った TCP Echo サーバー" msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr ":func:`asyncio.start_server` 関数を使った TCP Echo サーバーです::" -#: ../../library/asyncio-stream.rst:488 msgid "" "import asyncio\n" "\n" @@ -637,6 +679,34 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def handle_echo(reader, writer):\n" +" data = await reader.read(100)\n" +" message = data.decode()\n" +" addr = writer.get_extra_info('peername')\n" +"\n" +" print(f\"Received {message!r} from {addr!r}\")\n" +"\n" +" print(f\"Send: {message!r}\")\n" +" writer.write(data)\n" +" await writer.drain()\n" +"\n" +" print(\"Close the connection\")\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"async def main():\n" +" server = await asyncio.start_server(\n" +" handle_echo, '127.0.0.1', 8888)\n" +"\n" +" addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets)\n" +" print(f'Serving on {addrs}')\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-stream.rst:520 msgid "" @@ -658,7 +728,6 @@ msgid "" msgstr "" "コマンドラインから渡された URL の HTTP ヘッダーを問い合わせる簡単な例です::" -#: ../../library/asyncio-stream.rst:529 msgid "" "import asyncio\n" "import urllib.parse\n" @@ -696,22 +765,55 @@ msgid "" "url = sys.argv[1]\n" "asyncio.run(print_http_headers(url))" msgstr "" +"import asyncio\n" +"import urllib.parse\n" +"import sys\n" +"\n" +"async def print_http_headers(url):\n" +" url = urllib.parse.urlsplit(url)\n" +" if url.scheme == 'https':\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 443, ssl=True)\n" +" else:\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 80)\n" +"\n" +" query = (\n" +" f\"HEAD {url.path or '/'} HTTP/1.0\\r\\n\"\n" +" f\"Host: {url.hostname}\\r\\n\"\n" +" f\"\\r\\n\"\n" +" )\n" +"\n" +" writer.write(query.encode('latin-1'))\n" +" while True:\n" +" line = await reader.readline()\n" +" if not line:\n" +" break\n" +"\n" +" line = line.decode('latin1').rstrip()\n" +" if line:\n" +" print(f'HTTP header> {line}')\n" +"\n" +" # 本文を無視し、ソケットを閉じる\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"url = sys.argv[1]\n" +"asyncio.run(print_http_headers(url))" #: ../../library/asyncio-stream.rst:566 msgid "Usage::" msgstr "使い方::" -#: ../../library/asyncio-stream.rst:568 msgid "python example.py http://example.com/path/page.html" -msgstr "" +msgstr "python example.py http://example.com/path/page.html" #: ../../library/asyncio-stream.rst:570 msgid "or with HTTPS::" msgstr "または HTTPS を使用::" -#: ../../library/asyncio-stream.rst:572 msgid "python example.py https://example.com/path/page.html" -msgstr "" +msgstr "python example.py https://example.com/path/page.html" #: ../../library/asyncio-stream.rst:578 msgid "Register an open socket to wait for data using streams" @@ -725,7 +827,6 @@ msgstr "" ":func:`open_connection` 関数を使ってソケットがデータを受信するまで待つコルー" "チンです::" -#: ../../library/asyncio-stream.rst:583 msgid "" "import asyncio\n" "import socket\n" @@ -757,6 +858,34 @@ msgid "" "\n" "asyncio.run(wait_for_data())" msgstr "" +"import asyncio\n" +"import socket\n" +"\n" +"async def wait_for_data():\n" +" # 低水準 API を使うため、現在のイベントループへの参照を取得する。\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # 接続されたソケットのペアを作成する。\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # データを待ち受けるために、開いているソケットを登録する。\n" +" reader, writer = await asyncio.open_connection(sock=rsock)\n" +"\n" +" # ネットワークからのデータ受信を模倣する\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" # データを待つ\n" +" data = await reader.read(100)\n" +"\n" +" # データを受信して処理が済んだので、ソケットを閉じる\n" +" print(\"Received:\", data.decode())\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +" # もう一方のソケットを閉じる\n" +" wsock.close()\n" +"\n" +"asyncio.run(wait_for_data())" #: ../../library/asyncio-stream.rst:615 msgid "" diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index db9e35167..61a3b1340 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -50,7 +50,6 @@ msgstr "" "以下は、 asyncio モジュールがどのようにシェルコマンドを実行し、結果を取得でき" "るかを示す例です::" -#: ../../library/asyncio-subprocess.rst:22 msgid "" "import asyncio\n" "\n" @@ -70,31 +69,48 @@ msgid "" "\n" "asyncio.run(run('ls /zzz'))" msgstr "" +"import asyncio\n" +"\n" +"async def run(cmd):\n" +" proc = await asyncio.create_subprocess_shell(\n" +" cmd,\n" +" stdout=asyncio.subprocess.PIPE,\n" +" stderr=asyncio.subprocess.PIPE)\n" +"\n" +" stdout, stderr = await proc.communicate()\n" +"\n" +" print(f'[{cmd!r} exited with {proc.returncode}]')\n" +" if stdout:\n" +" print(f'[stdout]\\n{stdout.decode()}')\n" +" if stderr:\n" +" print(f'[stderr]\\n{stderr.decode()}')\n" +"\n" +"asyncio.run(run('ls /zzz'))" #: ../../library/asyncio-subprocess.rst:40 msgid "will print::" msgstr "このサンプルコードは以下を出力します::" -#: ../../library/asyncio-subprocess.rst:42 msgid "" "['ls /zzz' exited with 1]\n" "[stderr]\n" "ls: /zzz: No such file or directory" msgstr "" +"['ls /zzz' exited with 1]\n" +"[stderr]\n" +"ls: /zzz: No such file or directory" -#: ../../library/asyncio-subprocess.rst:46 msgid "" "Because all asyncio subprocess functions are asynchronous and asyncio " "provides many tools to work with such functions, it is easy to execute and " "monitor multiple subprocesses in parallel. It is indeed trivial to modify " "the above example to run several commands simultaneously::" msgstr "" -"全ての asyncio のサブプロセス関数は非同期ですが、 asyncio モジュールはこれら" -"の非同期関数と協調するための多くのツールを提供しているので、複数のサブプロセ" -"スを並列に実行して監視することは簡単です。実際、上記のサンプルコードを複数の" -"コマンドを同時に実行するように修正するのはきわめて単純です::" +"asyncio のサブプロセス関数はすべて非同期で、asyncio にはこれらの関数を扱うた" +"めのツールが多数あるため、複数のサブプロセスを並列に実行して監視するのは簡単" +"です。\n" +"実際、上の例を変更して複数のコマンドを同時に実行するのはごく簡単です。 ::" -#: ../../library/asyncio-subprocess.rst:51 msgid "" "async def main():\n" " await asyncio.gather(\n" @@ -103,6 +119,12 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def main():\n" +" await asyncio.gather(\n" +" run('ls /zzz'),\n" +" run('sleep 1; echo \"hello\"'))\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-subprocess.rst:58 msgid "See also the `Examples`_ subsection." @@ -116,14 +138,16 @@ msgstr "サブプロセスの生成" msgid "Create a subprocess." msgstr "サブプロセスを作成します。" -#: ../../library/asyncio-subprocess.rst:70 -#: ../../library/asyncio-subprocess.rst:92 msgid "" "The *limit* argument sets the buffer limit for :class:`StreamReader` " "wrappers for :attr:`~asyncio.subprocess.Process.stdout` and :attr:`~asyncio." "subprocess.Process.stderr` (if :const:`subprocess.PIPE` is passed to " "*stdout* and *stderr* arguments)." msgstr "" +"*limit* 引数は、:attr:`~asyncio.subprocess.Process.stdout` と :attr:" +"`~asyncio.subprocess.Process.stderr` をラップする :class:`StreamReader` の" +"バッファの上限を設定します (*stdout* と *stderr* 引数に :const:`subprocess." +"PIPE` を渡した場合)。" #: ../../library/asyncio-subprocess.rst:74 #: ../../library/asyncio-subprocess.rst:96 @@ -206,20 +230,25 @@ msgstr "定数" msgid "Can be passed to the *stdin*, *stdout* or *stderr* parameters." msgstr "*stdin*, *stdout* または *stderr* に渡すことができます。" -#: ../../library/asyncio-subprocess.rst:139 msgid "" "If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin ` attribute will point to a :class:`~asyncio." "StreamWriter` instance." msgstr "" +"*stdin* 引数に *PIPE* を渡すと、:attr:`Process.stdin ` 属性は :class:`~asyncio.StreamWriter` インスタンスを指しま" +"す。" -#: ../../library/asyncio-subprocess.rst:143 msgid "" "If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process." "stdout ` and :attr:`Process.stderr " "` attributes will point to :class:" "`~asyncio.StreamReader` instances." msgstr "" +"*stdout* または *stderr* 引数に *PIPE* を渡すと、対応する :attr:`Process." +"stdout ` 属性または :attr:`Process.stderr " +"` 属性は :class:`~asyncio.StreamReader` イ" +"ンスタンスを指します。" #: ../../library/asyncio-subprocess.rst:151 msgid "" @@ -255,12 +284,14 @@ msgstr "" "プロセスと通信したり、サブプロセスの完了を監視したりするための高水準のラッ" "パーです。" -#: ../../library/asyncio-subprocess.rst:173 msgid "" "An object that wraps OS processes created by the :func:`~asyncio." "create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` " "functions." msgstr "" +":func:`~asyncio.create_subprocess_exec` 関数や :func:`~asyncio." +"create_subprocess_shell` 関数で作成した OS のプロセスをラップするオブジェクト" +"です。" #: ../../library/asyncio-subprocess.rst:177 msgid "" @@ -278,12 +309,14 @@ msgstr "" "Popen と異なり、 Process インスタンスは :meth:`~subprocess.Popen.poll` メソッ" "ドに相当するメソッドを持っていません;" -#: ../../library/asyncio-subprocess.rst:184 msgid "" "the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio." "subprocess.Process.wait` methods don't have a *timeout* parameter: use the :" "func:`~asyncio.wait_for` function;" msgstr "" +":meth:`~asyncio.subprocess.Process.communicate` メソッドと :meth:`~asyncio." +"subprocess.Process.wait` メソッドには *timeout* パラメーターがありません。\n" +":func:`~asyncio.wait_for` 関数を使ってください。" #: ../../library/asyncio-subprocess.rst:188 msgid "" @@ -320,17 +353,16 @@ msgstr "子プロセスが終了するのを待ち受けます。" msgid "Set and return the :attr:`returncode` attribute." msgstr ":attr:`returncode` 属性を設定し、その値を返します。" -#: ../../library/asyncio-subprocess.rst:208 msgid "" "This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and " "the child process generates so much output that it blocks waiting for the OS " "pipe buffer to accept more data. Use the :meth:`communicate` method when " "using pipes to avoid this condition." msgstr "" -"``stdout=PIPE`` または ``stderr=PIPE`` を使っており、OS パイプバッファがさら" -"なるデータを受け付けるようになるまで子プロセスをブロックするほど大量の出力を" -"生成場合、このメソッドはデッドロックする可能性があります。この条件を避けるた" -"め、パイプを使用する場合は :meth:`communicate` メソッドを使ってください。" +"``stdout=PIPE`` または ``stderr=PIPE`` を使う場合、子プロセスが大量に出力し" +"て OS のパイプバッファに空きができるまでブロックされると、このメソッドはデッ" +"ドロックする可能性があります。\n" +"パイプを使うときは :meth:`communicate` メソッドでこの状況を回避してください。" #: ../../library/asyncio-subprocess.rst:217 msgid "Interact with process:" @@ -364,17 +396,16 @@ msgstr "" msgid "Return a tuple ``(stdout_data, stderr_data)``." msgstr "``(stdout_data, stderr_data)`` のタプルを返します。" -#: ../../library/asyncio-subprocess.rst:229 msgid "" "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " "raised when writing *input* into *stdin*, the exception is ignored. This " "condition occurs when the process exits before all data are written into " "*stdin*." msgstr "" -"*input* を標準入力 *stdin* nに書き込んでいる時に :exc:`BrokenPipeError` また" -"は :exc:`ConnectionResetError` 例外が送出された場合、例外は無視されます。この" -"ような条件は、全てのデータが *stdin* に書き込まれる前にプロセスが終了した場合" -"に起こります。" +"*input* を *stdin* に書き込む際に :exc:`BrokenPipeError` または :exc:" +"`ConnectionResetError` が送出された場合、その例外は無視されます。\n" +"これは、すべてのデータを *stdin* に書き込む前にプロセスが終了すると発生しま" +"す。" #: ../../library/asyncio-subprocess.rst:234 msgid "" @@ -397,87 +428,98 @@ msgstr "" "い。そのため、返されるデータのサイズが大きいかまたは無制限の場合はこのメソッ" "ドを使わないようにしてください。" -#: ../../library/asyncio-subprocess.rst:245 msgid "*stdin* gets closed when ``input=None`` too." -msgstr "" +msgstr "``input=None`` の場合も *stdin* を閉じるようになりました。" #: ../../library/asyncio-subprocess.rst:249 msgid "Sends the signal *signal* to the child process." msgstr "子プロセスにシグナル *signal* を送信します。" -#: ../../library/asyncio-subprocess.rst:253 msgid "" "On Windows, :py:const:`~signal.SIGTERM` is an alias for :meth:`terminate`. " "``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started " "with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" +"Windows では :py:const:`~signal.SIGTERM` の送信は :meth:`terminate` の呼び出" +"しと同じです。\n" +"*creationflags* パラメーターに ``CREATE_NEW_PROCESS_GROUP`` を含めて起動した" +"プロセスには、``CTRL_C_EVENT`` と ``CTRL_BREAK_EVENT`` を送信できます。" #: ../../library/asyncio-subprocess.rst:260 msgid "Stop the child process." msgstr "子プロセスを停止します。" -#: ../../library/asyncio-subprocess.rst:262 msgid "" "On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child " "process." msgstr "" +"POSIX システムでは、子プロセスに :py:const:`~signal.SIGTERM` を送信します。" -#: ../../library/asyncio-subprocess.rst:265 msgid "" "On Windows the Win32 API function :c:func:`!TerminateProcess` is called to " "stop the child process." msgstr "" +"Windows では、Win32 API 関数 :c:func:`!TerminateProcess` を呼び出して子プロセ" +"スを停止します。" #: ../../library/asyncio-subprocess.rst:270 msgid "Kill the child process." msgstr "子プロセスを強制終了 (kill) します。" -#: ../../library/asyncio-subprocess.rst:272 msgid "" "On POSIX systems this method sends :py:data:`~signal.SIGKILL` to the child " "process." msgstr "" +"POSIX システムでは、子プロセスに :py:data:`~signal.SIGKILL` を送信します。" #: ../../library/asyncio-subprocess.rst:275 msgid "On Windows this method is an alias for :meth:`terminate`." msgstr "Windows では、このメソッドは :meth:`terminate` のエイリアスです。" -#: ../../library/asyncio-subprocess.rst:279 msgid "" "Standard input stream (:class:`~asyncio.StreamWriter`) or ``None`` if the " "process was created with ``stdin=None``." msgstr "" +"標準入力ストリーム (:class:`~asyncio.StreamWriter`) です。\n" +"``stdin=None`` でプロセスを作成した場合は ``None`` です。" -#: ../../library/asyncio-subprocess.rst:284 msgid "" "Standard output stream (:class:`~asyncio.StreamReader`) or ``None`` if the " "process was created with ``stdout=None``." msgstr "" +"標準出力ストリーム (:class:`~asyncio.StreamReader`) です。\n" +"``stdout=None`` でプロセスを作成した場合は ``None`` です。" -#: ../../library/asyncio-subprocess.rst:289 msgid "" "Standard error stream (:class:`~asyncio.StreamReader`) or ``None`` if the " "process was created with ``stderr=None``." msgstr "" +"標準エラーストリーム (:class:`~asyncio.StreamReader`) です。\n" +"``stderr=None`` でプロセスを作成した場合は ``None`` です。" -#: ../../library/asyncio-subprocess.rst:294 msgid "" "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " "`, :attr:`await process.stdout.read() ` or :attr:`await " "process.stderr.read() `. This avoids deadlocks due to streams " "pausing reading or writing and blocking the child process." msgstr "" +":attr:`process.stdin.write() `、:attr:`await process.stdout.read() " +"`、:attr:`await process.stderr.read() ` の代わりに :meth:" +"`communicate` メソッドを使ってください。\n" +"これにより、ストリームの読み書きが一時停止して子プロセスがブロックされること" +"によるデッドロックを回避できます。" #: ../../library/asyncio-subprocess.rst:303 msgid "Process identification number (PID)." msgstr "子プロセスのプロセス番号 (PID) です。" -#: ../../library/asyncio-subprocess.rst:305 msgid "" "Note that for processes created by the :func:`~asyncio." "create_subprocess_shell` function, this attribute is the PID of the spawned " "shell." msgstr "" +":func:`~asyncio.create_subprocess_shell` 関数で作成したプロセスでは、この属性" +"は起動したシェルの PID です。" #: ../../library/asyncio-subprocess.rst:310 msgid "Return code of the process when it exits." @@ -489,20 +531,26 @@ msgstr "" "この属性が ``None`` であることは、プロセスがまだ終了していないことを示してい" "ます。" -#: ../../library/asyncio-subprocess.rst:314 msgid "" "For processes created with :func:`~asyncio.create_subprocess_exec`, a " "negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" +":func:`~asyncio.create_subprocess_exec` で作成したプロセスでは、負の値 ``-" +"N`` は子プロセスがシグナル ``N`` によって終了したことを示します (POSIX の" +"み)。" -#: ../../library/asyncio-subprocess.rst:318 msgid "" "For processes created with :func:`~asyncio.create_subprocess_shell`, the " "return code reflects the exit status of the shell itself (e.g. ``/bin/sh``), " "which may map signals to codes such as ``128+N``. See the documentation of " "the shell (for example, the Bash manual's Exit Status) for details." msgstr "" +":func:`~asyncio.create_subprocess_shell` で作成したプロセスでは、戻りコードは" +"シェル自体 (例えば ``/bin/sh``) の終了ステータスを反映します。\n" +"シェルによってはシグナルを ``128+N`` などのコードに対応付けます。\n" +"詳しくは、シェルのドキュメント (例えば Bash マニュアルの Exit Status) を参照" +"してください。" #: ../../library/asyncio-subprocess.rst:329 msgid "Subprocess and Threads" @@ -557,7 +605,6 @@ msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "サブプロセスは :func:`create_subprocess_exec` 関数により生成されます::" -#: ../../library/asyncio-subprocess.rst:358 msgid "" "import asyncio\n" "import sys\n" @@ -582,6 +629,27 @@ msgid "" "date = asyncio.run(get_date())\n" "print(f\"Current date: {date}\")" msgstr "" +"import asyncio\n" +"import sys\n" +"\n" +"async def get_date():\n" +" code = 'import datetime as dt; print(dt.datetime.now())'\n" +"\n" +" # サブプロセスを作成し、標準出力をパイプにリダイレクトする。\n" +" proc = await asyncio.create_subprocess_exec(\n" +" sys.executable, '-c', code,\n" +" stdout=asyncio.subprocess.PIPE)\n" +"\n" +" # 出力を 1 行読み込む。\n" +" data = await proc.stdout.readline()\n" +" line = data.decode('ascii').rstrip()\n" +"\n" +" # サブプロセスの終了を待つ。\n" +" await proc.wait()\n" +" return line\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" #: ../../library/asyncio-subprocess.rst:382 msgid "" diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index 9916652b7..2dc420c78 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -107,7 +107,6 @@ msgstr "" "Lock の望ましい使用方法は、 :keyword:`async with` 文と組み合わせて使うことで" "す::" -#: ../../library/asyncio-sync.rst:50 msgid "" "lock = asyncio.Lock()\n" "\n" @@ -115,13 +114,17 @@ msgid "" "async with lock:\n" " # access shared state" msgstr "" +"lock = asyncio.Lock()\n" +"\n" +"# ... 後で\n" +"async with lock:\n" +" # 共有状態にアクセスする" #: ../../library/asyncio-sync.rst:56 ../../library/asyncio-sync.rst:201 #: ../../library/asyncio-sync.rst:309 msgid "which is equivalent to::" msgstr "これは以下のコードと等価です::" -#: ../../library/asyncio-sync.rst:58 msgid "" "lock = asyncio.Lock()\n" "\n" @@ -132,6 +135,14 @@ msgid "" "finally:\n" " lock.release()" msgstr "" +"lock = asyncio.Lock()\n" +"\n" +"# ... 後で\n" +"await lock.acquire()\n" +"try:\n" +" # 共有状態にアクセスする\n" +"finally:\n" +" lock.release()" #: ../../library/asyncio-sync.rst:67 ../../library/asyncio-sync.rst:113 #: ../../library/asyncio-sync.rst:189 ../../library/asyncio-sync.rst:297 @@ -216,7 +227,6 @@ msgstr "" msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/asyncio-sync.rst:120 msgid "" "async def waiter(event):\n" " print('waiting for it ...')\n" @@ -239,6 +249,26 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def waiter(event):\n" +" print('waiting for it ...')\n" +" await event.wait()\n" +" print('... got it!')\n" +"\n" +"async def main():\n" +" # Event オブジェクトを作成する。\n" +" event = asyncio.Event()\n" +"\n" +" # 'event' がセットされるまで待機するタスクを起動する。\n" +" waiter_task = asyncio.create_task(waiter(event))\n" +"\n" +" # 1 秒待ってからイベントをセットする。\n" +" await asyncio.sleep(1)\n" +" event.set()\n" +"\n" +" # 待機中のタスクが終了するまで待つ。\n" +" await waiter_task\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-sync.rst:144 msgid "Wait until the event is set." @@ -266,11 +296,12 @@ msgstr "" msgid "Clear (unset) the event." msgstr "イベントをクリア (アンセット) します" -#: ../../library/asyncio-sync.rst:160 msgid "" "Subsequent tasks awaiting on :meth:`~Event.wait` will now block until the :" "meth:`~Event.set` method is called again." msgstr "" +"以降に :meth:`~Event.wait` を await するタスクは、:meth:`~Event.set` メソッド" +"が再び呼び出されるまでブロックされます。" #: ../../library/asyncio-sync.rst:165 msgid "Return ``True`` if the event is set." @@ -322,7 +353,6 @@ msgstr "" "Condition の望ましい使用方法は :keyword:`async with` 文と組み合わせて使うこと" "です::" -#: ../../library/asyncio-sync.rst:195 msgid "" "cond = asyncio.Condition()\n" "\n" @@ -330,8 +360,12 @@ msgid "" "async with cond:\n" " await cond.wait()" msgstr "" +"cond = asyncio.Condition()\n" +"\n" +"# ... 後で\n" +"async with cond:\n" +" await cond.wait()" -#: ../../library/asyncio-sync.rst:203 msgid "" "cond = asyncio.Condition()\n" "\n" @@ -342,6 +376,14 @@ msgid "" "finally:\n" " cond.release()" msgstr "" +"cond = asyncio.Condition()\n" +"\n" +"# ... 後で\n" +"await cond.acquire()\n" +"try:\n" +" await cond.wait()\n" +"finally:\n" +" cond.release()" #: ../../library/asyncio-sync.rst:215 msgid "Acquire the underlying lock." @@ -355,11 +397,12 @@ msgstr "" "このメソッドは下層のロックが *解除される* まで待機し、ロックを *ロック状態* " "に変更して ``True`` を返します。" -#: ../../library/asyncio-sync.rst:222 msgid "" "Wake up *n* tasks (1 by default) waiting on this condition. If fewer than " "*n* tasks are waiting they are all awakened." msgstr "" +"この条件変数で待機しているタスクを *n* 個 (デフォルトは 1 個) 起こします。\n" +"待機しているタスクが *n* 個未満なら、すべて起こします。" #: ../../library/asyncio-sync.rst:225 ../../library/asyncio-sync.rst:240 msgid "" @@ -418,24 +461,30 @@ msgstr "" "動されると、 Condition は再びロックを獲得し、メソッドは ``True`` を返しま" "す。" -#: ../../library/asyncio-sync.rst:264 msgid "" "Note that a task *may* return from this call spuriously, which is why the " "caller should always re-check the state and be prepared to :meth:`~Condition." "wait` again. For this reason, you may prefer to use :meth:`~Condition." "wait_for` instead." msgstr "" +"この呼び出しは、通知を受けていなくても返る *場合があります*。\n" +"そのため、呼び出し側では必ず状態を再確認し、必要なら再び :meth:`~Condition." +"wait` できるようにしてください。\n" +"このため、代わりに :meth:`~Condition.wait_for` を使う方が適している場合もあり" +"ます。" -#: ../../library/asyncio-sync.rst:272 msgid "Wait until a predicate becomes *true*." -msgstr "引数 predicate の条件が *真* になるまで待機します。" +msgstr "``predicate`` の評価結果が *真* になるまで待機します。" -#: ../../library/asyncio-sync.rst:274 msgid "" "The predicate must be a callable which result will be interpreted as a " "boolean value. The method will repeatedly :meth:`~Condition.wait` until the " "predicate evaluates to *true*. The final value is the return value." msgstr "" +"``predicate`` は呼び出し可能オブジェクトでなければならず、その結果はブール値" +"として解釈されます。\n" +"このメソッドは ``predicate`` の評価結果が *真* になるまで :meth:`~Condition." +"wait` を繰り返し、最後の評価結果を返します。" #: ../../library/asyncio-sync.rst:281 msgid "Semaphore" @@ -475,7 +524,6 @@ msgstr "" "セマフォの望ましい使用方法は、 :keyword:`async with` 文と組み合わせて使うこと" "です::" -#: ../../library/asyncio-sync.rst:303 msgid "" "sem = asyncio.Semaphore(10)\n" "\n" @@ -483,8 +531,12 @@ msgid "" "async with sem:\n" " # work with shared resource" msgstr "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... 後で\n" +"async with sem:\n" +" # 共有リソースを操作する" -#: ../../library/asyncio-sync.rst:311 msgid "" "sem = asyncio.Semaphore(10)\n" "\n" @@ -495,6 +547,14 @@ msgid "" "finally:\n" " sem.release()" msgstr "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... 後で\n" +"await sem.acquire()\n" +"try:\n" +" # 共有リソースを操作する\n" +"finally:\n" +" sem.release()" #: ../../library/asyncio-sync.rst:323 msgid "Acquire a semaphore." @@ -538,25 +598,23 @@ msgstr "BoundedSemaphore" msgid "A bounded semaphore object. Not thread-safe." msgstr "有限セマフォオブジェクトです。スレッドセーフではありません。" -#: ../../library/asyncio-sync.rst:349 msgid "" "Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:" "`ValueError` in :meth:`~Semaphore.release` if it increases the internal " "counter above the initial *value*." msgstr "" -"有限セマフォは :class:`Semaphore` の一種で、 :meth:`~Semaphore.release` メ" -"ソッドの呼び出しにより内部カウンターが *初期値* よりも増加してしまう場合は :" -"exc:`ValueError` 例外を送出します。" +"有限セマフォは :class:`Semaphore` の一種です。\n" +":meth:`~Semaphore.release` によって内部カウンターが初期値 *value* を超える場" +"合、:exc:`ValueError` を送出します。" -#: ../../library/asyncio-sync.rst:358 msgid "Barrier" -msgstr "" +msgstr "Barrier" -#: ../../library/asyncio-sync.rst:362 msgid "A barrier object. Not thread-safe." msgstr "" +"バリアオブジェクトです。\n" +"スレッドセーフではありません。" -#: ../../library/asyncio-sync.rst:364 msgid "" "A barrier is a simple synchronization primitive that allows to block until " "*parties* number of tasks are waiting on it. Tasks can wait on the :meth:" @@ -564,18 +622,22 @@ msgid "" "tasks end up waiting on :meth:`~Barrier.wait`. At that point all of the " "waiting tasks would unblock simultaneously." msgstr "" +"バリアは、*parties* 個のタスクが待機するまでブロックできる単純な同期プリミ" +"ティブです。\n" +"タスクは :meth:`~Barrier.wait` メソッドで待機でき、指定した数のタスクが :" +"meth:`~Barrier.wait` で待機するまでブロックされます。\n" +"その時点で、待機しているすべてのタスクのブロックが同時に解除されます。" -#: ../../library/asyncio-sync.rst:370 msgid "" ":keyword:`async with` can be used as an alternative to awaiting on :meth:" "`~Barrier.wait`." msgstr "" +":meth:`~Barrier.wait` を await する代わりに :keyword:`async with` を使えま" +"す。" -#: ../../library/asyncio-sync.rst:373 msgid "The barrier can be reused any number of times." -msgstr "" +msgstr "バリアは何度でも再利用できます。" -#: ../../library/asyncio-sync.rst:379 msgid "" "async def example_barrier():\n" " # barrier with 3 parties\n" @@ -598,40 +660,68 @@ msgid "" "\n" "asyncio.run(example_barrier())" msgstr "" +"async def example_barrier():\n" +" # 3 タスクが参加するバリア\n" +" b = asyncio.Barrier(3)\n" +"\n" +" # 待機するタスクを 2 つ作成する\n" +" asyncio.create_task(b.wait())\n" +" asyncio.create_task(b.wait())\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +" # 3 回目の .wait() の呼び出しでバリアを通過する\n" +" await b.wait()\n" +" print(b)\n" +" print(\"barrier passed\")\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +"asyncio.run(example_barrier())" -#: ../../library/asyncio-sync.rst:400 msgid "Result of this example is::" -msgstr "" +msgstr "この例の実行結果は次のとおりです。 ::" -#: ../../library/asyncio-sync.rst:402 msgid "" "\n" "\n" "barrier passed\n" "" msgstr "" +"\n" +"\n" +"barrier passed\n" +"" -#: ../../library/asyncio-sync.rst:412 msgid "" "Pass the barrier. When all the tasks party to the barrier have called this " "function, they are all unblocked simultaneously." msgstr "" +"バリアを通過します。\n" +"バリアに参加するすべてのタスクがこの関数を呼び出すと、すべてのタスクのブロッ" +"クが同時に解除されます。" -#: ../../library/asyncio-sync.rst:415 msgid "" "When a waiting or blocked task in the barrier is cancelled, this task exits " "the barrier which stays in the same state. If the state of the barrier is " "\"filling\", the number of waiting task decreases by 1." msgstr "" +"バリアで待機中またはブロック中のタスクがキャンセルされると、そのタスクはバリ" +"アから抜けます。\n" +"バリアの状態は変わりません。\n" +"バリアが \"filling\" 状態の場合、待機中のタスク数は 1 減ります。" -#: ../../library/asyncio-sync.rst:420 msgid "" "The return value is an integer in the range of 0 to ``parties-1``, different " "for each task. This can be used to select a task to do some special " "housekeeping, e.g.::" msgstr "" +"戻り値は 0 から ``parties-1`` までの整数で、タスクごとに異なります。\n" +"これを使うと、後片付けなどの特別な処理を行うタスクを選べます。\n" +"例えば次のようにします。 ::" -#: ../../library/asyncio-sync.rst:424 msgid "" "...\n" "async with barrier as position:\n" @@ -639,41 +729,52 @@ msgid "" " # Only one task prints this\n" " print('End of *draining phase*')" msgstr "" +"...\n" +"async with barrier as position:\n" +" if position == 0:\n" +" # 1 つのタスクだけがこれを表示する\n" +" print('End of *draining phase*')" -#: ../../library/asyncio-sync.rst:430 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a task is waiting. It could raise a :exc:" "`CancelledError` if a task is cancelled." msgstr "" +"タスクの待機中にバリアが broken 状態になるかリセットされると、:class:" +"`BrokenBarrierError` が送出される場合があります。\n" +"タスクがキャンセルされると :exc:`CancelledError` が送出される場合があります。" -#: ../../library/asyncio-sync.rst:437 msgid "" "Return the barrier to the default, empty state. Any tasks waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" +"バリアをデフォルトの空の状態に戻します。\n" +"バリアで待機しているタスクには :class:`BrokenBarrierError` が送出されます。" -#: ../../library/asyncio-sync.rst:440 msgid "" "If a barrier is broken it may be better to just leave it and create a new " "one." msgstr "" +"バリアが broken 状態になった場合は、そのバリアをそのままにして新しく作り直す" +"方がよいこともあります。" -#: ../../library/asyncio-sync.rst:445 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " "this for example if one of the tasks needs to abort, to avoid infinite " "waiting tasks." msgstr "" +"バリアを broken 状態にします。\n" +"これにより、実行中および今後の :meth:`~Barrier.wait` の呼び出しは :class:" +"`BrokenBarrierError` で失敗します。\n" +"例えば、いずれかのタスクが処理を中断する必要があるときに、他のタスクが無限に" +"待機しないようにするために使います。" -#: ../../library/asyncio-sync.rst:452 msgid "The number of tasks required to pass the barrier." -msgstr "" +msgstr "バリアを通過するために必要なタスク数です。" -#: ../../library/asyncio-sync.rst:456 msgid "The number of tasks currently waiting in the barrier while filling." -msgstr "" +msgstr "filling 状態のバリアで現在待機しているタスク数です。" #: ../../library/asyncio-sync.rst:460 msgid "A boolean that is ``True`` if the barrier is in the broken state." diff --git a/library/asyncio-task.po b/library/asyncio-task.po index a0e072754..fbfa07065 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-task.rst:6 msgid "Coroutines and tasks" -msgstr "" +msgstr "コルーチンとタスク" #: ../../library/asyncio-task.rst:8 msgid "" @@ -38,9 +37,8 @@ msgstr "" msgid "Coroutines" msgstr "コルーチン" -#: ../../library/asyncio-task.rst:21 msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/asyncio/coroutines.py`" msgid "" ":term:`Coroutines ` declared with the async/await syntax is the " @@ -51,7 +49,6 @@ msgstr "" "使ったアプリケーションを書くのに推奨される方法です。例えば、次のコードスニ" "ペットは \"hello\" を出力し、そこから 1 秒待って \"world\" を出力します::" -#: ../../library/asyncio-task.rst:30 msgid "" ">>> import asyncio\n" "\n" @@ -64,6 +61,16 @@ msgid "" "hello\n" "world" msgstr "" +">>> import asyncio\n" +"\n" +">>> async def main():\n" +"... print('hello')\n" +"... await asyncio.sleep(1)\n" +"... print('world')\n" +"\n" +">>> asyncio.run(main())\n" +"hello\n" +"world" #: ../../library/asyncio-task.rst:41 msgid "" @@ -72,11 +79,12 @@ msgstr "" "単にコルーチンを呼び出しただけでは、コルーチンの実行スケジュールは予約されて" "いないことに注意してください::" -#: ../../library/asyncio-task.rst:44 msgid "" ">>> main()\n" "" msgstr "" +">>> main()\n" +"" #: ../../library/asyncio-task.rst:47 msgid "To actually run a coroutine, asyncio provides the following mechanisms:" @@ -101,7 +109,6 @@ msgstr "" "コルーチンを await すること。次のコード片は 1 秒間待機した後に \"hello\" と出" "力し、 *更に* 2 秒間待機してから \"world\" と出力します::" -#: ../../library/asyncio-task.rst:56 msgid "" "import asyncio\n" "import time\n" @@ -120,18 +127,37 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import time\n" +"\n" +"async def say_after(delay, what):\n" +" await asyncio.sleep(delay)\n" +" print(what)\n" +"\n" +"async def main():\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" await say_after(1, 'hello')\n" +" await say_after(2, 'world')\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-task.rst:73 msgid "Expected output::" msgstr "予想される出力::" -#: ../../library/asyncio-task.rst:75 msgid "" "started at 17:13:52\n" "hello\n" "world\n" "finished at 17:13:55" msgstr "" +"started at 17:13:52\n" +"hello\n" +"world\n" +"finished at 17:13:55" #: ../../library/asyncio-task.rst:80 msgid "" @@ -149,7 +175,6 @@ msgstr "" "上のコード例を編集して、ふたつの ``say_after`` コルーチンを *並行して* 走らせ" "てみましょう::" -#: ../../library/asyncio-task.rst:86 msgid "" "async def main():\n" " task1 = asyncio.create_task(\n" @@ -167,6 +192,20 @@ msgid "" "\n" " print(f\"finished at {time.strftime('%X')}\")" msgstr "" +"async def main():\n" +" task1 = asyncio.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = asyncio.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # 両方のタスクが完了するまで待つ (約 2 秒かかる)。\n" +" await task1\n" +" await task2\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" #: ../../library/asyncio-task.rst:102 msgid "" @@ -176,21 +215,25 @@ msgstr "" "予想される出力が、スニペットの実行が前回よりも 1 秒早いことを示していることに" "注意してください::" -#: ../../library/asyncio-task.rst:105 msgid "" "started at 17:14:32\n" "hello\n" "world\n" "finished at 17:14:34" msgstr "" +"started at 17:14:32\n" +"hello\n" +"world\n" +"finished at 17:14:34" -#: ../../library/asyncio-task.rst:110 msgid "" "The :class:`asyncio.TaskGroup` class provides a more modern alternative to :" "func:`create_task`. Using this API, the last example becomes::" msgstr "" +":class:`asyncio.TaskGroup` クラスは、:func:`create_task` に代わるより新しい手" +"段です。\n" +"この API を使うと、直前の例は次のようになります。 ::" -#: ../../library/asyncio-task.rst:114 msgid "" "async def main():\n" " async with asyncio.TaskGroup() as tg:\n" @@ -206,10 +249,22 @@ msgid "" "\n" " print(f\"finished at {time.strftime('%X')}\")" msgstr "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = tg.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # コンテキストマネージャーを抜けるときに暗黙に await する。\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" -#: ../../library/asyncio-task.rst:128 msgid "The timing and output should be the same as for the previous version." -msgstr "" +msgstr "実行にかかる時間と出力は、直前の例と同じになるはずです。" #: ../../library/asyncio-task.rst:130 msgid ":class:`asyncio.TaskGroup`." @@ -245,7 +300,6 @@ msgstr "" "Python のコルーチンは *awaitable* であり、他のコルーチンから待機されることが" "できます::" -#: ../../library/asyncio-task.rst:152 msgid "" "import asyncio\n" "\n" @@ -263,6 +317,21 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # \"nested()\" を呼び出すだけでは何も起こらない。\n" +" # コルーチンオブジェクトは作成されるが await されないので、\n" +" # まったく実行されない。\n" +" nested() # \"RuntimeWarning\" が発生する。\n" +"\n" +" # 今度は await してみる:\n" +" print(await nested()) # \"42\" と表示する。\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-task.rst:170 msgid "" @@ -299,7 +368,6 @@ msgstr "" ":func:`asyncio.create_task` のような関数で、コルーチンが *Task* にラップされ" "ているとき、自動的にコルーチンは即時実行されるようにスケジュールされます::" -#: ../../library/asyncio-task.rst:187 msgid "" "import asyncio\n" "\n" @@ -317,6 +385,20 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # nested() がまもなく \"main()\" と並行して実行されるようにする。\n" +" task = asyncio.create_task(nested())\n" +"\n" +" # \"task\" で \"nested()\" をキャンセルしたり、\n" +" # 単に await して完了を待ったりできる:\n" +" await task\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio-task.rst:205 msgid "Futures" @@ -362,7 +444,6 @@ msgstr "" "Future オブジェクトはライブラリや asyncio のAPIで外部に提供されることもあり、" "await (待機)されることができます::" -#: ../../library/asyncio-task.rst:221 msgid "" "async def main():\n" " await function_that_returns_a_future_object()\n" @@ -373,6 +454,14 @@ msgid "" " some_python_coroutine()\n" " )" msgstr "" +"async def main():\n" +" await function_that_returns_a_future_object()\n" +"\n" +" # これも有効:\n" +" await asyncio.gather(\n" +" function_that_returns_a_future_object(),\n" +" some_python_coroutine()\n" +" )" #: ../../library/asyncio-task.rst:230 msgid "" @@ -382,9 +471,8 @@ msgstr "" "Future オブジェクトを返す低レベル関数の良い例は :meth:`loop.run_in_executor` " "です。" -#: ../../library/asyncio-task.rst:235 msgid "Creating tasks" -msgstr "" +msgstr "タスクの作成" #: ../../library/asyncio-task.rst:237 msgid "**Source code:** :source:`Lib/asyncio/tasks.py`" @@ -399,12 +487,15 @@ msgstr "" "ケジュールします。\n" "Task オブジェクトを返します。" -#: ../../library/asyncio-task.rst:246 msgid "" "The full function signature is largely the same as that of the :class:`Task` " "constructor (or factory) - all of the keyword arguments to this function are " "passed through to that interface." msgstr "" +"関数のシグネチャ全体は :class:`Task` のコンストラクター (またはファクトリー) " +"とほぼ同じです。\n" +"この関数に渡したキーワード引数はすべて、そのコンストラクターやファクトリーに" +"渡されます。" #: ../../library/asyncio-task.rst:250 msgid "" @@ -416,13 +507,17 @@ msgstr "" "の :class:`contextvars.Context` を指定できます。*context* が省略された場合、" "現在のコンテキストのコピーが作成されます。" -#: ../../library/asyncio-task.rst:254 msgid "" "An optional keyword-only *eager_start* argument allows specifying if the " "task should execute eagerly during the call to create_task, or be scheduled " "later. If *eager_start* is not passed the mode set by :meth:`loop." "set_task_factory` will be used." msgstr "" +"省略可能なキーワード専用引数 *eager_start* では、``create_task()`` の呼び出し" +"中にタスクの実行を即座に開始するか、後で実行するようにスケジュールするかを指" +"定できます。\n" +"*eager_start* を渡さない場合は :meth:`loop.set_task_factory` で設定したモード" +"を使います。" #: ../../library/asyncio-task.rst:259 msgid "" @@ -433,12 +528,14 @@ msgstr "" "行されます。現在のスレッドに実行中のループが無い場合は、 :exc:`RuntimeError` " "が送出されます。" -#: ../../library/asyncio-task.rst:265 msgid "" ":meth:`asyncio.TaskGroup.create_task` is a new alternative leveraging " "structural concurrency; it allows for waiting for a group of related tasks " "with strong safety guarantees." msgstr "" +":meth:`asyncio.TaskGroup.create_task` は、構造化された並行処理を使う新しい代" +"替手段です。\n" +"強い安全性の保証のもとで、関連するタスクのグループを待機できます。" #: ../../library/asyncio-task.rst:271 msgid "" @@ -453,7 +550,6 @@ msgstr "" "なくてもガーベジコレクションされる可能性があります。信頼性のある \"fire-and-" "forget\" バックグラウンドタスクが必要な場合、コレクションを使ってください。" -#: ../../library/asyncio-task.rst:278 msgid "" "background_tasks = set()\n" "\n" @@ -468,8 +564,18 @@ msgid "" " # completion:\n" " task.add_done_callback(background_tasks.discard)" msgstr "" +"background_tasks = set()\n" +"\n" +"for i in range(10):\n" +" task = asyncio.create_task(some_coro(param=i))\n" +"\n" +" # タスクを集合に追加する。これにより強参照が作成される。\n" +" background_tasks.add(task)\n" +"\n" +" # 完了したタスクへの参照を保持し続けないように、\n" +" # 各タスクが完了したら集合から自身への参照を削除するようにする:\n" +" task.add_done_callback(background_tasks.discard)" -#: ../../library/asyncio-task.rst:291 msgid "" "Note that this approach never awaits the tasks, so if a task fails, its " "exception is never retrieved and asyncio logs a \"Task exception was never " @@ -477,13 +583,21 @@ msgid "" "class:`asyncio.TaskGroup` which keeps a strong reference to each task, " "awaits them and propagates their exceptions::" msgstr "" +"この方法ではタスクを await しないため、タスクが失敗しても例外は取得されませ" +"ん。\n" +"タスクがガベージコレクションされると、asyncio は \"Task exception was never " +"retrieved\" というメッセージをログに記録します。\n" +"これを避けるには :class:`asyncio.TaskGroup` を使ってください。\n" +"各タスクへの強参照を保持してタスクを await し、例外を伝播させます。 ::" -#: ../../library/asyncio-task.rst:298 msgid "" "async with asyncio.TaskGroup() as tg:\n" " for i in range(10):\n" " tg.create_task(some_coro(param=i))" msgstr "" +"async with asyncio.TaskGroup() as tg:\n" +" for i in range(10):\n" +" tg.create_task(some_coro(param=i))" #: ../../library/asyncio-task.rst:304 ../../library/asyncio-task.rst:1265 msgid "Added the *name* parameter." @@ -493,13 +607,13 @@ msgstr "*name* パラメータを追加しました。" msgid "Added the *context* parameter." msgstr "*context* パラメータを追加しました。" -#: ../../library/asyncio-task.rst:310 msgid "Added the *eager_start* parameter by passing on all *kwargs*." msgstr "" +"すべての *kwargs* を渡すようにすることで、*eager_start* パラメーターが追加さ" +"れました。" -#: ../../library/asyncio-task.rst:315 msgid "Task cancellation" -msgstr "" +msgstr "タスクのキャンセル" #: ../../library/asyncio-task.rst:317 msgid "" @@ -509,7 +623,6 @@ msgstr "" "タスクは簡単に、そして安全にキャンセルできます。タスクがキャンセルされた場" "合、:exc:`asyncio.CancelledError` が次の機会に送出されます。" -#: ../../library/asyncio-task.rst:321 msgid "" "It is recommended that coroutines use ``try/finally`` blocks to robustly " "perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly " @@ -517,8 +630,13 @@ msgid "" "`asyncio.CancelledError` directly subclasses :exc:`BaseException` so most " "code will not need to be aware of it." msgstr "" +"後片付けを確実に行うため、コルーチンでは ``try/finally`` ブロックを使うことを" +"推奨します。\n" +":exc:`asyncio.CancelledError` を明示的に捕捉した場合、通常は後片付けが終わっ" +"たら伝播させてください。\n" +":exc:`asyncio.CancelledError` は :exc:`BaseException` の直接のサブクラスなの" +"で、ほとんどのコードでは特別に意識する必要はありません。" -#: ../../library/asyncio-task.rst:327 msgid "" "The asyncio components that enable structured concurrency, like :class:" "`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using " @@ -528,88 +646,114 @@ msgid "" "exc:`asyncio.CancelledError` is truly desired, it is necessary to also call " "``uncancel()`` to completely remove the cancellation state." msgstr "" +":class:`asyncio.TaskGroup` や :func:`asyncio.timeout` など、構造化された並行" +"処理を実現する asyncio の構成要素は内部でキャンセルを使って実装されていま" +"す。\n" +"コルーチンが :exc:`asyncio.CancelledError` を握りつぶすと、正しく動作しない場" +"合があります。\n" +"同様に、ユーザーのコードから :meth:`uncancel ` を呼び" +"出すことも通常は避けてください。\n" +"ただし、本当に :exc:`asyncio.CancelledError` を抑制したい場合は、キャンセル状" +"態を完全に解除するために ``uncancel()`` も呼び出す必要があります。" -#: ../../library/asyncio-task.rst:339 msgid "Task groups" -msgstr "" +msgstr "タスクグループ" -#: ../../library/asyncio-task.rst:341 msgid "" "Task groups combine a task creation API with a convenient and reliable way " "to wait for all tasks in the group to finish." msgstr "" +"タスクグループは、タスクを作成する API と、グループ内のすべてのタスクの終了を" +"便利かつ確実に待つ手段を組み合わせたものです。" -#: ../../library/asyncio-task.rst:346 msgid "" "An :ref:`asynchronous context manager ` holding a " "group of tasks. Tasks can be added to the group using :meth:`create_task`. " "All tasks are awaited when the context manager exits." msgstr "" +"タスクのグループを保持する :ref:`非同期コンテキストマネージャー ` です。\n" +":meth:`create_task` でタスクをグループに追加できます。\n" +"コンテキストマネージャーを抜けるときに、すべてのタスクを await します。" -#: ../../library/asyncio-task.rst:355 msgid "" "Create a task in this task group. The signature matches that of :func:" "`asyncio.create_task`. If the task group is inactive (e.g. not yet entered, " "already finished, or in the process of shutting down), we will close the " "given ``coro`` and raise :exc:`RuntimeError`." msgstr "" +"このタスクグループにタスクを作成します。\n" +"シグネチャは :func:`asyncio.create_task` と同じです。\n" +"タスクグループが非アクティブ (まだ開始していない、すでに終了した、終了処理中" +"など) の場合は、渡された ``coro`` を閉じて :exc:`RuntimeError` を送出します。" -#: ../../library/asyncio-task.rst:363 msgid "Close the given coroutine if the task group is not active." msgstr "" +"タスクグループがアクティブでない場合、渡されたコルーチンを閉じるようになりま" +"した。" -#: ../../library/asyncio-task.rst:367 msgid "Passes on all *kwargs* to :meth:`loop.create_task`" -msgstr "" +msgstr "すべての *kwargs* を :meth:`loop.create_task` に渡すようになりました。" -#: ../../library/asyncio-task.rst:371 msgid "" "Cancel the task group. This is a non-exceptional, early exit of the task " "group's lifetime -- useful once the group's goal has been met or its " "services no longer needed." msgstr "" +"タスクグループをキャンセルします。\n" +"例外を発生させずにタスクグループの処理を早期に終了します。\n" +"グループの目的を達成した場合や、グループの処理が不要になった場合に役立ちま" +"す。" -#: ../../library/asyncio-task.rst:375 msgid "" ":meth:`~asyncio.Task.cancel` will be called on any tasks in the group that " "aren't yet done, as well as the parent (body) of the group. The task group " "context manager will exit *without* :exc:`asyncio.CancelledError` being " "raised." msgstr "" +"グループ内でまだ完了していないタスクと、グループの親 (本体) に対して :meth:" +"`~asyncio.Task.cancel` を呼び出します。\n" +"タスクグループのコンテキストマネージャーは、:exc:`asyncio.CancelledError` を" +"送出 *せずに* 終了します。" -#: ../../library/asyncio-task.rst:379 msgid "" "If :meth:`cancel` is called before entering the task group, the group will " "be cancelled upon entry. This is useful for patterns where one piece of " "code passes an unused :class:`asyncio.TaskGroup` instance to another in " "order to have the ability to cancel anything run within the group." msgstr "" +"タスクグループに入る前に :meth:`cancel` を呼び出すと、グループに入った時点で" +"キャンセルされます。\n" +"これは、あるコードから別のコードへ未使用の :class:`asyncio.TaskGroup` インス" +"タンスを渡し、グループ内で実行される処理をキャンセルできるようにするパターン" +"で役立ちます。" -#: ../../library/asyncio-task.rst:384 msgid "" ":meth:`cancel` is idempotent and may be called after the task group has " "already exited." msgstr "" +":meth:`cancel` は冪等で、タスクグループがすでに終了した後にも呼び出せます。" -#: ../../library/asyncio-task.rst:387 msgid "Some ways to use :meth:`cancel`:" -msgstr "" +msgstr ":meth:`cancel` の使用方法の例:" -#: ../../library/asyncio-task.rst:389 msgid "call it from the task group body based on some condition or event" -msgstr "" +msgstr "条件やイベントに応じてタスクグループの本体から呼び出す" -#: ../../library/asyncio-task.rst:390 msgid "" "pass the task group instance to child tasks via :meth:`create_task`, " "allowing a child task to conditionally cancel the entire group" msgstr "" +":meth:`create_task` で子タスクにタスクグループのインスタンスを渡し、子タスク" +"が条件に応じてグループ全体をキャンセルできるようにする" -#: ../../library/asyncio-task.rst:392 msgid "" "pass the task group instance or bound :meth:`cancel` method to some other " "task *before* opening the task group, allowing remote cancellation" msgstr "" +"タスクグループを開始する *前に*、タスクグループのインスタンスまたは束縛され" +"た :meth:`cancel` メソッドを他のタスクに渡し、そのタスクからキャンセルできる" +"ようにする" #: ../../library/asyncio-task.rst:397 ../../library/asyncio-task.rst:565 #: ../../library/asyncio-task.rst:738 ../../library/asyncio-task.rst:799 @@ -617,7 +761,6 @@ msgstr "" msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/asyncio-task.rst:399 msgid "" "async def main():\n" " async with asyncio.TaskGroup() as tg:\n" @@ -626,8 +769,13 @@ msgid "" " print(f\"Both tasks have completed now: {task1.result()}, {task2." "result()}\")" msgstr "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(some_coro(...))\n" +" task2 = tg.create_task(another_coro(...))\n" +" print(f\"Both tasks have completed now: {task1.result()}, {task2." +"result()}\")" -#: ../../library/asyncio-task.rst:405 msgid "" "The ``async with`` statement will wait for all tasks in the group to finish. " "While waiting, new tasks may still be added to the group (for example, by " @@ -637,8 +785,14 @@ msgid "" "last task has finished and the ``async with`` block is exited, no new tasks " "may be added to the group." msgstr "" +"``async with`` 文はグループ内のすべてのタスクが終了するまで待ちます。\n" +"待機中も新しいタスクをグループに追加できます (例えば、いずれかのコルーチンに " +"``tg`` を渡し、そのコルーチンで ``tg.create_task()`` を呼び出します)。\n" +"条件に応じて ``tg.cancel()`` でタスクグループ全体の終了を要求することもできま" +"す。\n" +"最後のタスクが終了して ``async with`` ブロックを抜けると、グループに新しいタ" +"スクを追加することはできません。" -#: ../../library/asyncio-task.rst:413 msgid "" "The first time any of the tasks belonging to the group fails with an " "exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " @@ -649,16 +803,26 @@ msgid "" "exc:`asyncio.CancelledError` will interrupt an ``await``, but it will not " "bubble out of the containing ``async with`` statement." msgstr "" +"グループ内のいずれかのタスクが :exc:`asyncio.CancelledError` 以外の例外で初め" +"て失敗した時点で、グループ内の残りのタスクをキャンセルします。\n" +"それ以降はグループにタスクを追加できません。\n" +"この時点で ``async with`` 文の本体がまだ実行中 (つまり :meth:`~object." +"__aexit__` がまだ呼び出されていない) なら、``async with`` 文を直接含むタスク" +"もキャンセルされます。\n" +"これによって生じる :exc:`asyncio.CancelledError` は ``await`` を中断します" +"が、それを含む ``async with`` 文の外には伝播しません。" -#: ../../library/asyncio-task.rst:423 msgid "" "Once all tasks have finished, if any tasks have failed with an exception " "other than :exc:`asyncio.CancelledError`, those exceptions are combined in " "an :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup` (as appropriate; see " "their documentation) which is then raised." msgstr "" +"すべてのタスクが終了した時点で、:exc:`asyncio.CancelledError` 以外の例外で失" +"敗したタスクがあれば、それらの例外を :exc:`ExceptionGroup` または :exc:" +"`BaseExceptionGroup` にまとめて送出します (どちらを使うかは、それぞれのドキュ" +"メントを参照してください)。" -#: ../../library/asyncio-task.rst:430 msgid "" "Two base exceptions are treated specially: If any task fails with :exc:" "`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " @@ -666,8 +830,12 @@ msgid "" "`KeyboardInterrupt` or :exc:`SystemExit` is re-raised instead of :exc:" "`ExceptionGroup` or :exc:`BaseExceptionGroup`." msgstr "" +"基底例外のうち、2 つは特別に扱います。\n" +"いずれかのタスクが :exc:`KeyboardInterrupt` または :exc:`SystemExit` で失敗し" +"た場合も、タスクグループは残りのタスクをキャンセルして終了を待ちます。\n" +"ただし、その後は :exc:`ExceptionGroup` や :exc:`BaseExceptionGroup` ではな" +"く、最初の :exc:`KeyboardInterrupt` または :exc:`SystemExit` を再送出します。" -#: ../../library/asyncio-task.rst:436 msgid "" "If the body of the ``async with`` statement exits with an exception (so :" "meth:`~object.__aexit__` is called with an exception set), this is treated " @@ -681,8 +849,19 @@ msgid "" "with``: if it raises :exc:`GeneratorExit` and none of the other tasks raise " "exceptions that would be reported, then the :exc:`GeneratorExit` is reraised." msgstr "" +"``async with`` 文の本体が例外によって終了した場合 (つまり例外が設定された状態" +"で :meth:`~object.__aexit__` が呼び出された場合) は、タスクが失敗した場合と同" +"じように扱います。\n" +"残りのタスクをキャンセルして終了を待ち、キャンセル以外の例外を例外グループに" +"まとめて送出します。\n" +":meth:`~object.__aexit__` に渡された例外も、:exc:`asyncio.CancelledError` で" +"なければ例外グループに含めます。\n" +":exc:`KeyboardInterrupt` と :exc:`SystemExit` には、前の段落と同じ特別な扱い" +"をします。\n" +"``async with`` の本体に限り、さらに特別な扱いがあります。\n" +"本体が :exc:`GeneratorExit` を送出し、他のタスクが報告対象となる例外を送出し" +"なかった場合は、その :exc:`GeneratorExit` を再送出します。" -#: ../../library/asyncio-task.rst:452 msgid "" "Task groups are careful not to mix up the internal cancellation used to " "\"wake up\" their :meth:`~object.__aexit__` with cancellation requests for " @@ -692,30 +871,41 @@ msgid "" "group will process its exceptions, and then the outer task group will " "receive another cancellation and process its own exceptions." msgstr "" +"タスクグループは、:meth:`~object.__aexit__` を「起こす」ための内部的なキャン" +"セルと、タスクグループが実行されているタスクに対する外部からのキャンセル要求" +"を区別します。\n" +"特に、タスクグループが構文上入れ子になっていて、両方のグループの子タスクで同" +"時に例外が発生した場合は、まず内側のグループが例外を処理します。\n" +"その後、外側のグループが別のキャンセルを受け取り、自身の例外を処理します。" -#: ../../library/asyncio-task.rst:460 msgid "" "In the case where a task group is cancelled externally and also must raise " "an :exc:`ExceptionGroup`, it will call the parent task's :meth:`~asyncio." "Task.cancel` method. This ensures that a :exc:`asyncio.CancelledError` will " "be raised at the next :keyword:`await`, so the cancellation is not lost." msgstr "" +"タスクグループが外部からキャンセルされ、かつ :exc:`ExceptionGroup` を送出する" +"必要もある場合は、親タスクの :meth:`~asyncio.Task.cancel` メソッドを呼び出し" +"ます。\n" +"これにより、次の :keyword:`await` で :exc:`asyncio.CancelledError` が送出さ" +"れ、キャンセルが失われないようにします。" -#: ../../library/asyncio-task.rst:466 msgid "" "Task groups preserve the cancellation count reported by :meth:`asyncio.Task." "cancelling`." msgstr "" +"タスクグループは :meth:`asyncio.Task.cancelling` が返すキャンセル回数を保持し" +"ます。" -#: ../../library/asyncio-task.rst:471 msgid "" "Improved handling of simultaneous internal and external cancellations and " "correct preservation of cancellation counts." msgstr "" +"内部と外部からのキャンセルが同時に発生した場合の処理が改善され、キャンセル回" +"数が正しく保持されるようになりました。" -#: ../../library/asyncio-task.rst:476 msgid "Addition of the special case for :exc:`GeneratorExit`." -msgstr "" +msgstr ":exc:`GeneratorExit` の特別な扱いが追加されました。" #: ../../library/asyncio-task.rst:479 msgid "Sleeping" @@ -740,22 +930,21 @@ msgstr "" "``sleep()`` は常に現在の Task を一時中断し、他の Task が実行されるのを許可し" "ます。" -#: ../../library/asyncio-task.rst:492 msgid "" "Setting the delay to 0 provides an optimized path to allow other tasks to " "run. This can be used by long-running functions to avoid blocking the event " "loop for the full duration of the function call." msgstr "" -"delay を 0 に設定することで、他のタスクを実行可能にする最適な方針を提供しま" -"す。この方法は、実行時間の長い関数が、その実行時間全体にわたってイベントルー" -"プをブロックしないようにするために利用できます。" +"``delay`` を 0 に設定すると、最適化された処理経路で他のタスクを実行できるよう" +"にします。\n" +"長時間実行する関数でこれを使うと、関数の呼び出し中ずっとイベントループをブ" +"ロックしてしまうのを避けられます。" #: ../../library/asyncio-task.rst:498 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "現在の時刻を5秒間、毎秒表示するコルーチンの例::" -#: ../../library/asyncio-task.rst:501 msgid "" "import asyncio\n" "import datetime as dt\n" @@ -771,6 +960,19 @@ msgid "" "\n" "asyncio.run(display_date())" msgstr "" +"import asyncio\n" +"import datetime as dt\n" +"\n" +"async def display_date():\n" +" loop = asyncio.get_running_loop()\n" +" end_time = loop.time() + 5.0\n" +" while True:\n" +" print(dt.datetime.now())\n" +" if (loop.time() + 1.0) >= end_time:\n" +" break\n" +" await asyncio.sleep(1)\n" +"\n" +"asyncio.run(display_date())" #: ../../library/asyncio-task.rst:516 ../../library/asyncio-task.rst:614 #: ../../library/asyncio-task.rst:713 ../../library/asyncio-task.rst:887 @@ -778,13 +980,13 @@ msgstr "" msgid "Removed the *loop* parameter." msgstr "*loop* パラメータが削除されました。" -#: ../../library/asyncio-task.rst:519 msgid "Raises :exc:`ValueError` if *delay* is :data:`~math.nan`." msgstr "" +"*delay* が :data:`~math.nan` の場合に :exc:`ValueError` を送出するようになり" +"ました。" -#: ../../library/asyncio-task.rst:524 msgid "Running tasks concurrently" -msgstr "" +msgstr "タスクの並行実行" #: ../../library/asyncio-task.rst:528 msgid "" @@ -852,7 +1054,6 @@ msgstr "" "これは、起動された 1 つの Task あるいは Future のキャンセルが、他の Task ある" "いは Future のキャンセルを引き起こすのを避けるためです。" -#: ../../library/asyncio-task.rst:556 msgid "" "A new alternative to create and run tasks concurrently and wait for their " "completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger " @@ -861,8 +1062,14 @@ msgid "" "*TaskGroup* will, while *gather* will not, cancel the remaining scheduled " "tasks." msgstr "" +"タスクを作成して並行に実行し、完了を待つための新しい代替手段として :class:" +"`asyncio.TaskGroup` があります。\n" +"サブタスクを入れ子にスケジュールする場合、*TaskGroup* は *gather* よりも強い" +"安全性を保証します。\n" +"タスク (またはタスクがスケジュールしたサブタスク) が例外を送出すると、" +"*TaskGroup* はスケジュール済みの残りのタスクをキャンセルしますが、*gather* は" +"キャンセルしません。" -#: ../../library/asyncio-task.rst:567 msgid "" "import asyncio\n" "\n" @@ -900,8 +1107,42 @@ msgid "" "# Task C: factorial(4) = 24\n" "# [2, 6, 24]" msgstr "" +"import asyncio\n" +"\n" +"async def factorial(name, number):\n" +" f = 1\n" +" for i in range(2, number + 1):\n" +" print(f\"Task {name}: Compute factorial({number}), currently i={i}..." +"\")\n" +" await asyncio.sleep(1)\n" +" f *= i\n" +" print(f\"Task {name}: factorial({number}) = {f}\")\n" +" return f\n" +"\n" +"async def main():\n" +" # 3 つの呼び出しを並行に実行するようスケジュールする:\n" +" L = await asyncio.gather(\n" +" factorial(\"A\", 2),\n" +" factorial(\"B\", 3),\n" +" factorial(\"C\", 4),\n" +" )\n" +" print(L)\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# 期待される出力:\n" +"#\n" +"# Task A: Compute factorial(2), currently i=2...\n" +"# Task B: Compute factorial(3), currently i=2...\n" +"# Task C: Compute factorial(4), currently i=2...\n" +"# Task A: factorial(2) = 2\n" +"# Task B: Compute factorial(3), currently i=3...\n" +"# Task C: Compute factorial(4), currently i=3...\n" +"# Task B: factorial(3) = 6\n" +"# Task C: Compute factorial(4), currently i=4...\n" +"# Task C: factorial(4) = 24\n" +"# [2, 6, 24]" -#: ../../library/asyncio-task.rst:603 msgid "" "If *return_exceptions* is false, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -909,6 +1150,12 @@ msgid "" "calling ``gather.cancel()`` after catching an exception (raised by one of " "the awaitables) from gather won't cancel any other awaitables." msgstr "" +"*return_exceptions* が偽の場合、完了状態になった後で ``gather()`` をキャンセ" +"ルしても、渡された awaitable はキャンセルされません。\n" +"例えば、``gather`` は例外を呼び出し元に伝播した時点で完了状態になることがあり" +"ます。\n" +"そのため、いずれかの awaitable が送出した例外を ``gather`` から捕捉した後で " +"``gather.cancel()`` を呼び出しても、他の awaitable はキャンセルされません。" #: ../../library/asyncio-task.rst:610 msgid "" @@ -918,22 +1165,21 @@ msgstr "" "*gather* 自身がキャンセルされた場合は、 *return_exceptions* の値に関わらず" "キャンセルが伝搬されます。" -#: ../../library/asyncio-task.rst:617 msgid "" "Deprecation warning is emitted if no positional arguments are provided or " "not all positional arguments are Future-like objects and there is no running " "event loop." msgstr "" +"位置引数が渡されていない場合、または位置引数のすべてが Future のようなオブ" +"ジェクトというわけではなく、かつ実行中のイベントループがない場合に、非推奨の" +"警告を出すようになりました。" -#: ../../library/asyncio-task.rst:626 msgid "Eager task factory" -msgstr "" +msgstr "即時実行するタスクファクトリー" -#: ../../library/asyncio-task.rst:630 msgid "A task factory for eager task execution." -msgstr "" +msgstr "タスクの実行を即座に開始するタスクファクトリーです。" -#: ../../library/asyncio-task.rst:632 msgid "" "When using this factory (via :meth:`loop.set_task_factory(asyncio." "eager_task_factory) `), coroutines begin execution " @@ -942,14 +1188,21 @@ msgid "" "overhead of loop scheduling is avoided for coroutines that complete " "synchronously." msgstr "" +"このファクトリーを :meth:`loop.set_task_factory(asyncio.eager_task_factory) " +"` で使うと、:class:`Task` の構築中にコルーチンの実行を" +"同期的に開始します。\n" +"タスクがイベントループにスケジュールされるのは、処理がブロックした場合だけで" +"す。\n" +"同期的に完了するコルーチンではループへのスケジュールに伴うオーバーヘッドを避" +"けられるため、性能が向上する場合があります。" -#: ../../library/asyncio-task.rst:638 msgid "" "A common example where this is beneficial is coroutines which employ caching " "or memoization to avoid actual I/O when possible." msgstr "" +"これが役立つ典型例は、キャッシュやメモ化を使って可能な限り実際の I/O を避ける" +"コルーチンです。" -#: ../../library/asyncio-task.rst:643 msgid "" "Immediate execution of the coroutine is a semantic change. If the coroutine " "returns or raises, the task is never scheduled to the event loop. If the " @@ -957,31 +1210,45 @@ msgid "" "change may introduce behavior changes to existing applications. For example, " "the application's task execution order is likely to change." msgstr "" +"コルーチンを即座に実行すると、実行の意味が変わります。\n" +"コルーチンが値を返すか例外を送出すると、タスクはイベントループにスケジュール" +"されません。\n" +"コルーチンの実行がブロックすると、タスクはイベントループにスケジュールされま" +"す。\n" +"この変更により、既存のアプリケーションの動作が変わる可能性があります。\n" +"例えば、タスクの実行順序は変わる可能性が高いでしょう。" -#: ../../library/asyncio-task.rst:654 msgid "" "Create an eager task factory, similar to :func:`eager_task_factory`, using " "the provided *custom_task_constructor* when creating a new task instead of " "the default :class:`Task`." msgstr "" +":func:`eager_task_factory` と同様に即時実行するタスクファクトリーを作成しま" +"す。\n" +"新しいタスクの作成には、デフォルトの :class:`Task` の代わりに、指定された " +"*custom_task_constructor* を使います。" -#: ../../library/asyncio-task.rst:658 msgid "" "*custom_task_constructor* must be a *callable* with the signature matching " "the signature of :class:`Task.__init__ `. The callable must return a :" "class:`asyncio.Task`-compatible object." msgstr "" +"*custom_task_constructor* は :class:`Task.__init__ ` と同じシグネチャを" +"持つ *呼び出し可能オブジェクト* でなければなりません。\n" +"このオブジェクトは :class:`asyncio.Task` と互換性のあるオブジェクトを返す必要" +"があります。" -#: ../../library/asyncio-task.rst:662 msgid "" "This function returns a *callable* intended to be used as a task factory of " "an event loop via :meth:`loop.set_task_factory(factory) `)." msgstr "" +"この関数は、:meth:`loop.set_task_factory(factory) ` で" +"イベントループのタスクファクトリーとして使うための *呼び出し可能オブジェクト" +"* を返します。" -#: ../../library/asyncio-task.rst:669 msgid "Shielding from cancellation" -msgstr "" +msgstr "キャンセルからの保護" #: ../../library/asyncio-task.rst:673 msgid "" @@ -1000,19 +1267,19 @@ msgstr "" msgid "The statement::" msgstr "文::" -#: ../../library/asyncio-task.rst:680 msgid "" "task = asyncio.create_task(something())\n" "res = await shield(task)" msgstr "" +"task = asyncio.create_task(something())\n" +"res = await shield(task)" #: ../../library/asyncio-task.rst:683 msgid "is equivalent to::" msgstr "は、以下と同じです ::" -#: ../../library/asyncio-task.rst:685 msgid "res = await something()" -msgstr "" +msgstr "res = await something()" msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " @@ -1044,7 +1311,6 @@ msgstr "" "完全にキャンセルを無視したい場合 (推奨はしません) は、 ``shield()`` 関数は次" "のように try/except 節と組み合わせることになるでしょう::" -#: ../../library/asyncio-task.rst:700 msgid "" "task = asyncio.create_task(something())\n" "try:\n" @@ -1052,71 +1318,92 @@ msgid "" "except CancelledError:\n" " res = None" msgstr "" +"task = asyncio.create_task(something())\n" +"try:\n" +" res = await shield(task)\n" +"except CancelledError:\n" +" res = None" -#: ../../library/asyncio-task.rst:708 msgid "" "Save a reference to tasks passed to this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " "tasks. A task that isn't referenced elsewhere may get garbage collected at " "any time, even before it's done." msgstr "" +"タスクが実行途中で消えないように、この関数に渡すタスクへの参照を保持してくだ" +"さい。\n" +"イベントループはタスクへの弱参照しか保持しません。\n" +"他から参照されていないタスクは、完了前でもいつでもガベージコレクションされる" +"可能性があります。" -#: ../../library/asyncio-task.rst:716 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" +"*aw* が Future のようなオブジェクトでなく、実行中のイベントループもない場合" +"に、非推奨の警告を出すようになりました。" #: ../../library/asyncio-task.rst:722 msgid "Timeouts" msgstr "タイムアウト" -#: ../../library/asyncio-task.rst:726 msgid "" "Return an :ref:`asynchronous context manager ` that " "can be used to limit the amount of time spent waiting on something." msgstr "" +"待機に費やす時間を制限できる :ref:`非同期コンテキストマネージャー ` を返します。" -#: ../../library/asyncio-task.rst:730 msgid "" "*delay* can either be ``None``, or a float/int number of seconds to wait. If " "*delay* is ``None``, no time limit will be applied; this can be useful if " "the delay is unknown when the context manager is created." msgstr "" +"*delay* には ``None``、または待機する秒数を浮動小数点数か整数で指定できま" +"す。\n" +"*delay* が ``None`` の場合、時間制限は適用されません。\n" +"コンテキストマネージャーの作成時点で待機時間が分からない場合に便利です。" -#: ../../library/asyncio-task.rst:735 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" +"どちらの場合も、作成後に :meth:`Timeout.reschedule` でコンテキストマネー" +"ジャーの期限を変更できます。" -#: ../../library/asyncio-task.rst:740 msgid "" "async def main():\n" " async with asyncio.timeout(10):\n" " await long_running_task()" msgstr "" +"async def main():\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()" -#: ../../library/asyncio-task.rst:744 msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " "manager will cancel the current task and handle the resulting :exc:`asyncio." "CancelledError` internally, transforming it into a :exc:`TimeoutError` which " "can be caught and handled." msgstr "" +"``long_running_task`` の完了に 10 秒を超えてかかると、コンテキストマネー" +"ジャーは現在のタスクをキャンセルします。\n" +"その結果生じる :exc:`asyncio.CancelledError` を内部で処理し、捕捉して処理でき" +"る :exc:`TimeoutError` に変換します。" -#: ../../library/asyncio-task.rst:751 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:" "`TimeoutError` can only be caught *outside* of the context manager." msgstr "" +":exc:`asyncio.CancelledError` を :exc:`TimeoutError` に変換するのは :func:" +"`asyncio.timeout` のコンテキストマネージャーです。\n" +"そのため、:exc:`TimeoutError` を捕捉できるのはコンテキストマネージャーの *外" +"側* だけです。" -#: ../../library/asyncio-task.rst:756 msgid "Example of catching :exc:`TimeoutError`::" -msgstr "" +msgstr ":exc:`TimeoutError` を捕捉する例です。 ::" -#: ../../library/asyncio-task.rst:758 msgid "" "async def main():\n" " try:\n" @@ -1127,55 +1414,65 @@ msgid "" "\n" " print(\"This statement will run regardless.\")" msgstr "" +"async def main():\n" +" try:\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" -#: ../../library/asyncio-task.rst:767 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" +":func:`asyncio.timeout` が生成するコンテキストマネージャーは、期限を変更した" +"り、状態を調べたりできます。" -#: ../../library/asyncio-task.rst:772 msgid "" "An :ref:`asynchronous context manager ` for " "cancelling overdue coroutines." msgstr "" +"期限を超えたコルーチンをキャンセルするための :ref:`非同期コンテキストマネー" +"ジャー ` です。" -#: ../../library/asyncio-task.rst:775 msgid "" "Prefer using :func:`asyncio.timeout` or :func:`asyncio.timeout_at` rather " "than instantiating :class:`!Timeout` directly." msgstr "" +":class:`!Timeout` を直接インスタンス化するよりも、:func:`asyncio.timeout` ま" +"たは :func:`asyncio.timeout_at` を使うことを推奨します。" -#: ../../library/asyncio-task.rst:778 msgid "" "``when`` should be an absolute time at which the context should time out, as " "measured by the event loop's clock:" msgstr "" +"``when`` には、イベントループの時計で計測した、タイムアウトすべき絶対時刻を指" +"定してください。" -#: ../../library/asyncio-task.rst:781 msgid "If ``when`` is ``None``, the timeout will never trigger." -msgstr "" +msgstr "``when`` が ``None`` の場合、タイムアウトは発生しません。" -#: ../../library/asyncio-task.rst:782 msgid "" "If ``when < loop.time()``, the timeout will trigger on the next iteration of " "the event loop." msgstr "" +"``when < loop.time()`` の場合、イベントループの次の反復でタイムアウトが発生し" +"ます。" -#: ../../library/asyncio-task.rst:787 msgid "" "Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" +"現在の期限を返します。\n" +"期限が設定されていなければ ``None`` を返します。" -#: ../../library/asyncio-task.rst:792 msgid "Reschedule the timeout." -msgstr "" +msgstr "タイムアウトの期限を変更します。" -#: ../../library/asyncio-task.rst:796 msgid "Return whether the context manager has exceeded its deadline (expired)." -msgstr "" +msgstr "コンテキストマネージャーが期限を過ぎたかどうかを返します。" -#: ../../library/asyncio-task.rst:801 msgid "" "async def main():\n" " try:\n" @@ -1192,18 +1489,31 @@ msgid "" " if cm.expired():\n" " print(\"Looks like we haven't finished on time.\")" msgstr "" +"async def main():\n" +" try:\n" +" # 開始時には期限が分からないので、``None`` を渡す。\n" +" async with asyncio.timeout(None) as cm:\n" +" # 期限が分かったので設定する。\n" +" new_deadline = get_running_loop().time() + 10\n" +" cm.reschedule(new_deadline)\n" +"\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" pass\n" +"\n" +" if cm.expired():\n" +" print(\"Looks like we haven't finished on time.\")" -#: ../../library/asyncio-task.rst:816 msgid "Timeout context managers can be safely nested." -msgstr "" +msgstr "タイムアウトのコンテキストマネージャーは安全に入れ子にできます。" -#: ../../library/asyncio-task.rst:822 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" +":func:`asyncio.timeout` と似ていますが、*when* には待機を終了する絶対時刻、ま" +"たは ``None`` を指定します。" -#: ../../library/asyncio-task.rst:827 msgid "" "async def main():\n" " loop = get_running_loop()\n" @@ -1216,6 +1526,16 @@ msgid "" "\n" " print(\"This statement will run regardless.\")" msgstr "" +"async def main():\n" +" loop = get_running_loop()\n" +" deadline = loop.time() + 20\n" +" try:\n" +" async with asyncio.timeout_at(deadline):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" #: ../../library/asyncio-task.rst:843 msgid "" @@ -1234,13 +1554,14 @@ msgstr "" "す。\n" "*timeout* が ``None`` の場合、 Future が完了するまで待ちます。" -#: ../../library/asyncio-task.rst:850 msgid "If a timeout occurs, it cancels *aw* and raises :exc:`TimeoutError`." msgstr "" +"タイムアウトが発生すると *aw* をキャンセルし、:exc:`TimeoutError` を送出しま" +"す。" -#: ../../library/asyncio-task.rst:852 msgid "To prevent *aw* from being cancelled, wrap it in :func:`shield`." msgstr "" +"*aw* がキャンセルされないようにするには :func:`shield` でラップしてください。" #: ../../library/asyncio-task.rst:854 msgid "" @@ -1256,7 +1577,6 @@ msgstr "" msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "待機が中止された場合 *aw* も中止されます。" -#: ../../library/asyncio-task.rst:864 msgid "" "async def eternity():\n" " # Sleep for one hour\n" @@ -1276,33 +1596,55 @@ msgid "" "#\n" "# timeout!" msgstr "" +"async def eternity():\n" +" # 1 時間スリープする\n" +" await asyncio.sleep(3600)\n" +" print('yay!')\n" +"\n" +"async def main():\n" +" # 最大 1 秒待つ\n" +" try:\n" +" await asyncio.wait_for(eternity(), timeout=1.0)\n" +" except TimeoutError:\n" +" print('timeout!')\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# 期待される出力:\n" +"#\n" +"# timeout!" -#: ../../library/asyncio-task.rst:882 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" +"タイムアウトにより *aw* をキャンセルする場合、``wait_for`` は *aw* のキャンセ" +"ルが完了するまで待つようになりました。\n" +"以前は :exc:`TimeoutError` を即座に送出していました。" -#: ../../library/asyncio-task.rst:890 msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." msgstr "" +":exc:`asyncio.TimeoutError` の代わりに :exc:`TimeoutError` を送出するようにな" +"りました。" -#: ../../library/asyncio-task.rst:893 msgid "" "Implemented using :func:`asyncio.timeout`, a coroutine passed as *aw* is no " "longer wrapped in a :class:`Task` when *timeout* is positive." msgstr "" +":func:`asyncio.timeout` を使った実装になり、*timeout* が正の場合に *aw* とし" +"て渡されたコルーチンを :class:`Task` でラップしなくなりました。" -#: ../../library/asyncio-task.rst:899 msgid "Waiting primitives" -msgstr "" +msgstr "待機プリミティブ" -#: ../../library/asyncio-task.rst:904 msgid "" "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " "*aws* iterable concurrently and block until the condition specified by " "*return_when*." msgstr "" +"イテラブル *aws* に含まれる :class:`~asyncio.Future` と :class:`~asyncio." +"Task` のインスタンスを並行に実行し、*return_when* で指定した条件が満たされる" +"までブロックします。" #: ../../library/asyncio-task.rst:908 msgid "The *aws* iterable must not be empty." @@ -1316,9 +1658,8 @@ msgstr "Task/Future からなる 2 つの集合 ``(done, pending)`` を返しま msgid "Usage::" msgstr "使い方::" -#: ../../library/asyncio-task.rst:914 msgid "done, pending = await asyncio.wait(aws)" -msgstr "" +msgstr "done, pending = await asyncio.wait(aws)" #: ../../library/asyncio-task.rst:916 msgid "" @@ -1328,12 +1669,14 @@ msgstr "" "*timeout* (浮動小数点数または整数) が指定されていたら、処理を返すのを待つ最大" "秒数を制御するのに使われます。" -#: ../../library/asyncio-task.rst:919 msgid "" "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " "that aren't done when the timeout occurs are simply returned in the second " "set." msgstr "" +"この関数は :exc:`TimeoutError` を送出しません。\n" +"タイムアウト時点で完了していない Future や Task は、単に 2 番目の集合に入れて" +"返されます。" #: ../../library/asyncio-task.rst:923 msgid "" @@ -1355,12 +1698,13 @@ msgstr "説明" msgid "The function will return when any future finishes or is cancelled." msgstr "いずれかのフューチャが終了したかキャンセルされたときに返します。" -#: ../../library/asyncio-task.rst:936 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" +"いずれかのフューチャが例外を送出して終了すると、この関数は返ります。\n" +"例外を送出するフューチャがない場合は、:const:`ALL_COMPLETED` と等価です。" #: ../../library/asyncio-task.rst:941 msgid "The function will return when all futures finish or are cancelled." @@ -1374,28 +1718,29 @@ msgstr "" ":func:`~asyncio.wait_for` と異なり、 ``wait()`` はタイムアウトが起きたとき" "に Future をキャンセルしません。" -#: ../../library/asyncio-task.rst:946 msgid "" "If ``wait()`` is cancelled, the futures in *aws* are not cancelled and " "continue to run." msgstr "" +"``wait()`` がキャンセルされても、*aws* 内の Future はキャンセルされずに実行を" +"続けます。" -#: ../../library/asyncio-task.rst:952 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." -msgstr "" +msgstr "``wait()`` にコルーチンオブジェクトを直接渡すことは禁止されました。" -#: ../../library/asyncio-task.rst:955 ../../library/asyncio-task.rst:1017 msgid "Added support for generators yielding tasks." -msgstr "" +msgstr "タスクを yield するジェネレーターをサポートするようになりました。" -#: ../../library/asyncio-task.rst:961 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. The returned object can be iterated to obtain the results of " "the awaitables as they finish." msgstr "" +"イテラブル *aws* に含まれる :ref:`awaitable オブジェクト ` を並行に実行します。\n" +"返されたオブジェクトを反復すると、awaitable の完了に応じて結果を取得できま" +"す。" -#: ../../library/asyncio-task.rst:965 msgid "" "The object returned by ``as_completed()`` can be iterated as an :term:" "`asynchronous iterator` or a plain :term:`iterator`. When asynchronous " @@ -1403,8 +1748,13 @@ msgid "" "are tasks or futures. This makes it easy to correlate previously-scheduled " "tasks with their results. Example::" msgstr "" +"``as_completed()`` が返すオブジェクトは :term:`asynchronous iterator` として" +"も通常の :term:`iterator` としても反復できます。\n" +"非同期反復の場合、もともと渡された awaitable が Task または Future なら、その" +"オブジェクトを yield します。\n" +"これにより、スケジュール済みのタスクと結果を簡単に対応付けられます。\n" +"例えば次のように使います。 ::" -#: ../../library/asyncio-task.rst:971 msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" "ipv6_connect = create_task(open_connection(\"::1\", 80))\n" @@ -1420,21 +1770,38 @@ msgid "" " else:\n" " print(\"IPv4 connection established.\")" msgstr "" +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"async for earliest_connect in as_completed(tasks):\n" +" # earliest_connect は完了している。await するか\n" +" # earliest_connect.result() を呼び出すと結果を取得できる。\n" +" reader, writer = await earliest_connect\n" +"\n" +" if earliest_connect is ipv6_connect:\n" +" print(\"IPv6 connection established.\")\n" +" else:\n" +" print(\"IPv4 connection established.\")" -#: ../../library/asyncio-task.rst:985 msgid "" "During asynchronous iteration, implicitly-created tasks will be yielded for " "supplied awaitables that aren't tasks or futures." msgstr "" +"非同期反復では、渡された awaitable が Task や Future でない場合、暗黙に作成さ" +"れたタスクを yield します。" -#: ../../library/asyncio-task.rst:988 msgid "" "When used as a plain iterator, each iteration yields a new coroutine that " "returns the result or raises the exception of the next completed awaitable. " "This pattern is compatible with Python versions older than 3.13::" msgstr "" +"通常のイテレーターとして使う場合、反復のたびに新しいコルーチンを yield しま" +"す。\n" +"このコルーチンは、次に完了する awaitable の結果を返すか、その例外を送出しま" +"す。\n" +"この使い方は Python 3.13 より前のバージョンと互換性があります。 ::" -#: ../../library/asyncio-task.rst:992 msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" "ipv6_connect = create_task(open_connection(\"::1\", 80))\n" @@ -1446,36 +1813,53 @@ msgid "" " # awaitable that finishes next.\n" " reader, writer = await next_connect" msgstr "" +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"for next_connect in as_completed(tasks):\n" +" # next_connect は元のタスクオブジェクトではない。\n" +" # await すると、次に完了する awaitable の結果を取得するか、\n" +" # その例外を送出する。\n" +" reader, writer = await next_connect" -#: ../../library/asyncio-task.rst:1002 msgid "" "A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables " "are done. This is raised by the ``async for`` loop during asynchronous " "iteration or by the coroutines yielded during plain iteration." msgstr "" +"すべての awaitable が完了する前にタイムアウトすると、:exc:`TimeoutError` を送" +"出します。\n" +"非同期反復では ``async for`` ループが、通常の反復では yield されたコルーチン" +"が、この例外を送出します。" -#: ../../library/asyncio-task.rst:1006 msgid "" "``as_completed()`` does not cancel the tasks running the supplied " "awaitables: if a timeout occurs or the iteration is cancelled, the remaining " "tasks continue to run." msgstr "" +"``as_completed()`` は、渡された awaitable を実行しているタスクをキャンセルし" +"ません。\n" +"タイムアウトした場合や反復がキャンセルされた場合も、残りのタスクは実行を続け" +"ます。" -#: ../../library/asyncio-task.rst:1013 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" +"イテラブル *aws* に含まれる awaitable オブジェクトのすべてが Future のような" +"オブジェクトというわけではなく、かつ実行中のイベントループがない場合に、非推" +"奨の警告を出すようになりました。" -#: ../../library/asyncio-task.rst:1020 msgid "" "The result can now be used as either an :term:`asynchronous iterator` or as " "a plain :term:`iterator` (previously it was only a plain iterator)." msgstr "" +"結果を :term:`asynchronous iterator` としても通常の :term:`iterator` としても" +"使えるようになりました (以前は通常のイテレーターとしてのみ使えました)。" -#: ../../library/asyncio-task.rst:1026 msgid "Running in threads" -msgstr "" +msgstr "スレッドでの実行" #: ../../library/asyncio-task.rst:1031 msgid "Asynchronously run function *func* in a separate thread." @@ -1497,14 +1881,15 @@ msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "関数 *func* の最終結果を待ち受けできるコルーチンを返します。" -#: ../../library/asyncio-task.rst:1040 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" +"このコルーチン関数は主に、メインスレッドで実行するとイベントループをブロック" +"してしまう I/O バウンドの関数やメソッドを実行するためのものです。\n" +"例えば次のように使います。 ::" -#: ../../library/asyncio-task.rst:1044 msgid "" "def blocking_io():\n" " print(f\"start blocking_io at {time.strftime('%X')}\")\n" @@ -1532,14 +1917,42 @@ msgid "" "# blocking_io complete at 19:50:54\n" "# finished main at 19:50:54" msgstr "" +"def blocking_io():\n" +" print(f\"start blocking_io at {time.strftime('%X')}\")\n" +" # time.sleep() は、ファイル操作などのブロックする\n" +" # I/O バウンドの処理に置き換えられる。\n" +" time.sleep(1)\n" +" print(f\"blocking_io complete at {time.strftime('%X')}\")\n" +"\n" +"async def main():\n" +" print(f\"started main at {time.strftime('%X')}\")\n" +"\n" +" await asyncio.gather(\n" +" asyncio.to_thread(blocking_io),\n" +" asyncio.sleep(1))\n" +"\n" +" print(f\"finished main at {time.strftime('%X')}\")\n" +"\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# 期待される出力:\n" +"#\n" +"# started main at 19:50:53\n" +"# start blocking_io at 19:50:53\n" +"# blocking_io complete at 19:50:54\n" +"# finished main at 19:50:54" -#: ../../library/asyncio-task.rst:1070 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " "Instead, by using ``asyncio.to_thread()``, we can run it in a separate " "thread without blocking the event loop." msgstr "" +"コルーチン内で ``blocking_io()`` を直接呼び出すと、実行中ずっとイベントループ" +"をブロックするため、実行時間が 1 秒長くなります。\n" +"代わりに ``asyncio.to_thread()`` を使えば、イベントループをブロックせずに別の" +"スレッドで実行できます。" #: ../../library/asyncio-task.rst:1077 msgid "" @@ -1549,9 +1962,8 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:1086 msgid "Scheduling from other threads" -msgstr "" +msgstr "他のスレッドからのスケジュール" #: ../../library/asyncio-task.rst:1090 msgid "Submit a coroutine to the given event loop. Thread-safe." @@ -1576,7 +1988,6 @@ msgstr "" "び出すためのものです。\n" "例えば次のように使います::" -#: ../../library/asyncio-task.rst:1098 msgid "" "def in_thread(loop: asyncio.AbstractEventLoop) -> None:\n" " # Run some blocking IO\n" @@ -1599,12 +2010,32 @@ msgid "" " # Run something in a thread\n" " await asyncio.to_thread(in_thread, loop)" msgstr "" +"def in_thread(loop: asyncio.AbstractEventLoop) -> None:\n" +" # ブロックする I/O を実行する\n" +" pathlib.Path(\"example.txt\").write_text(\"hello world\", " +"encoding=\"utf8\")\n" +"\n" +" # コルーチンを作成する\n" +" coro = asyncio.sleep(1, result=3)\n" +"\n" +" # 指定されたループにコルーチンを送る\n" +" future = asyncio.run_coroutine_threadsafe(coro, loop)\n" +"\n" +" # 省略可能な timeout 引数を指定して結果を待つ\n" +" assert future.result(timeout=2) == 3\n" +"\n" +"async def amain() -> None:\n" +" # 実行中のループを取得する\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # スレッドで処理を実行する\n" +" await asyncio.to_thread(in_thread, loop)" -#: ../../library/asyncio-task.rst:1118 msgid "It's also possible to run the other way around. Example::" msgstr "" +"逆に、別のスレッドで実行するイベントループへ処理を送ることもできます。\n" +"例えば次のようにします。 ::" -#: ../../library/asyncio-task.rst:1120 msgid "" "@contextlib.contextmanager\n" "def loop_in_thread() -> Generator[asyncio.AbstractEventLoop]:\n" @@ -1639,6 +2070,38 @@ msgid "" " # Wait for the result with an optional timeout argument\n" " assert future.result(timeout=2) == 3" msgstr "" +"@contextlib.contextmanager\n" +"def loop_in_thread() -> Generator[asyncio.AbstractEventLoop]:\n" +" loop_fut = concurrent.futures.Future[asyncio.AbstractEventLoop]()\n" +" stop_event = asyncio.Event()\n" +"\n" +" async def main() -> None:\n" +" loop_fut.set_result(asyncio.get_running_loop())\n" +" await stop_event.wait()\n" +"\n" +" with concurrent.futures.ThreadPoolExecutor(1) as tpe:\n" +" complete_fut = tpe.submit(asyncio.run, main())\n" +" for fut in concurrent.futures.as_completed((loop_fut, " +"complete_fut)):\n" +" if fut is loop_fut:\n" +" loop = loop_fut.result()\n" +" try:\n" +" yield loop\n" +" finally:\n" +" loop.call_soon_threadsafe(stop_event.set)\n" +" else:\n" +" fut.result()\n" +"\n" +"# 別のスレッドにループを作成する\n" +"with loop_in_thread() as loop:\n" +" # コルーチンを作成する\n" +" coro = asyncio.sleep(1, result=3)\n" +"\n" +" # 指定されたループにコルーチンを送る\n" +" future = asyncio.run_coroutine_threadsafe(coro, loop)\n" +"\n" +" # 省略可能な timeout 引数を指定して結果を待つ\n" +" assert future.result(timeout=2) == 3" #: ../../library/asyncio-task.rst:1152 msgid "" @@ -1648,7 +2111,6 @@ msgstr "" "コルーチンから例外が送出された場合、返された Future に通知されます。\n" "これはイベントループの Task をキャンセルするのにも使えます::" -#: ../../library/asyncio-task.rst:1156 msgid "" "try:\n" " result = future.result(timeout)\n" @@ -1660,6 +2122,15 @@ msgid "" "else:\n" " print(f'The coroutine returned: {result!r}')" msgstr "" +"try:\n" +" result = future.result(timeout)\n" +"except TimeoutError:\n" +" print('The coroutine took too long, cancelling the task...')\n" +" future.cancel()\n" +"except Exception as exc:\n" +" print(f'The coroutine raised an exception: {exc!r}')\n" +"else:\n" +" print(f'The coroutine returned: {result!r}')" #: ../../library/asyncio-task.rst:1166 msgid "" @@ -1710,13 +2181,11 @@ msgstr "" "*loop* が ``None`` の場合、 :func:`get_running_loop` は現在のループを取得する" "のに使われます。" -#: ../../library/asyncio-task.rst:1203 msgid "Return ``True`` if *obj* is a coroutine object." -msgstr "" +msgstr "*obj* がコルーチンオブジェクトなら ``True`` を返します。" -#: ../../library/asyncio-task.rst:1210 msgid "Task object" -msgstr "" +msgstr "Task オブジェクト" #: ../../library/asyncio-task.rst:1214 msgid "" @@ -1760,13 +2229,18 @@ msgstr "" "ださい。\n" "Task を直接インスタンス化することは推奨されません。" -#: ../../library/asyncio-task.rst:1233 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " "coroutine. If a coroutine is awaiting on a future-like object during " "cancellation, the awaited object will be cancelled." msgstr "" +"実行中の Task をキャンセルするには :meth:`cancel` メソッドを使ってくださ" +"い。\n" +"このメソッドを呼び出すと、Task がラップしているコルーチンに :exc:" +"`CancelledError` を送出します。\n" +"キャンセル時にコルーチンが Future のようなオブジェクトを await している場合、" +"そのオブジェクトもキャンセルされます。" msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " @@ -1785,15 +2259,17 @@ msgstr "" ":class:`asyncio.Task` は、:meth:`Future.set_result` と :meth:`Future." "set_exception` を除いて、:class:`Future` の API をすべて継承しています。" -#: ../../library/asyncio-task.rst:1247 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. If no *context* is " "provided, the Task copies the current context and later runs its coroutine " "in the copied context." msgstr "" +"省略可能なキーワード専用引数 *context* では、*coro* を実行するための独自の :" +"class:`contextvars.Context` を指定できます。\n" +"*context* を指定しない場合、Task は現在のコンテキストをコピーし、後でそのコ" +"ピーの中でコルーチンを実行します。" -#: ../../library/asyncio-task.rst:1252 msgid "" "An optional keyword-only *eager_start* argument allows eagerly starting the " "execution of the :class:`asyncio.Task` at task creation time. If set to " @@ -1802,26 +2278,33 @@ msgid "" "coroutine returns or raises without blocking, the task will be finished " "eagerly and will skip scheduling to the event loop." msgstr "" +"省略可能なキーワード専用引数 *eager_start* では、:class:`asyncio.Task` の作成" +"時に実行を即座に開始するよう指定できます。\n" +"``True`` に設定され、イベントループが実行中であれば、タスクはコルーチンの実行" +"を即座に開始し、コルーチンが初めてブロックするまで実行します。\n" +"コルーチンがブロックせずに値を返すか例外を送出すると、タスクはその場で完了" +"し、イベントループへのスケジュールを省略します。" -#: ../../library/asyncio-task.rst:1259 msgid "" "Tasks are :ref:`generic ` over the return type of their wrapped " "coroutines." msgstr "" +"Task は、ラップするコルーチンの戻り値の型を型パラメーターとする :ref:`ジェネ" +"リック型 ` です。" #: ../../library/asyncio-task.rst:1262 msgid "Added support for the :mod:`contextvars` module." msgstr ":mod:`contextvars` モジュールのサポートを追加。" -#: ../../library/asyncio-task.rst:1268 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" +"*loop* が指定されておらず、実行中のイベントループもない場合に、非推奨の警告を" +"出すようになりました。" -#: ../../library/asyncio-task.rst:1275 msgid "Added the *eager_start* parameter." -msgstr "" +msgstr "*eager_start* パラメーターが追加されました。" #: ../../library/asyncio-task.rst:1280 msgid "Return ``True`` if the Task is *done*." @@ -1855,11 +2338,12 @@ msgstr "" "Task が *キャンセル* されている場合、このメソッドは :exc:`CancelledError` 例" "外を送出します。" -#: ../../library/asyncio-task.rst:1296 msgid "" "If the Task's result isn't yet available, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" +"Task の結果がまだ利用できない場合、このメソッドは :exc:`InvalidStateError` を" +"送出します。" #: ../../library/asyncio-task.rst:1301 msgid "Return the exception of the Task." @@ -1963,30 +2447,33 @@ msgstr "" msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "引数 *limit* は :meth:`get_stack` にそのまま渡されます。" -#: ../../library/asyncio-task.rst:1361 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" +"*file* 引数は出力先の I/O ストリームです。\n" +"デフォルトでは :data:`sys.stdout` に出力します。" #: ../../library/asyncio-task.rst:1366 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr ":class:`Task` がラップしているコルーチンオブジェクトを返します。" -#: ../../library/asyncio-task.rst:1370 msgid "" "This will return ``None`` for Tasks which have already completed eagerly. " "See the :ref:`Eager Task Factory `." msgstr "" +"即時実行ですでに完了した Task では ``None`` を返します。\n" +":ref:`即時実行するタスクファクトリー ` を参照してくださ" +"い。" -#: ../../library/asyncio-task.rst:1377 msgid "Newly added eager task execution means result may be ``None``." msgstr "" +"即時実行するタスクが追加されたため、結果が ``None`` になる場合があります。" -#: ../../library/asyncio-task.rst:1381 msgid "" "Return the :class:`contextvars.Context` object associated with the task." msgstr "" +"タスクに関連付けられた :class:`contextvars.Context` オブジェクトを返します。" #: ../../library/asyncio-task.rst:1388 msgid "Return the name of the Task." @@ -2010,31 +2497,31 @@ msgid "" msgstr "" "引数 *value* は文字列に変換可能なオブジェクトであれば何でもかまいません。" -#: ../../library/asyncio-task.rst:1403 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -"Task のデフォルト実装では、名前はオブジェクトの :func:`repr` メソッドの出力で" +"デフォルトの Task 実装では、タスクオブジェクトの :func:`repr` の出力で名前を" "確認できます。" #: ../../library/asyncio-task.rst:1410 msgid "Request the Task to be cancelled." msgstr "このタスクに、自身のキャンセルを要求します。" -#: ../../library/asyncio-task.rst:1412 msgid "" "If the Task is already *done* or *cancelled*, return ``False``, otherwise, " "return ``True``." msgstr "" +"Task がすでに *完了* または *キャンセル* されている場合は ``False`` を、それ" +"以外の場合は ``True`` を返します。" -#: ../../library/asyncio-task.rst:1415 msgid "" "The method arranges for a :exc:`CancelledError` exception to be thrown into " "the wrapped coroutine on the next cycle of the event loop." msgstr "" +"このメソッドは、イベントループの次のサイクルで、ラップしているコルーチンに :" +"exc:`CancelledError` を送出するように手配します。" -#: ../../library/asyncio-task.rst:1418 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -2045,31 +2532,37 @@ msgid "" "suppress the cancellation, it needs to call :meth:`Task.uncancel` in " "addition to catching the exception." msgstr "" +"コルーチンは、:keyword:`try` ... ``except CancelledError`` ... :keyword:" +"`finally` ブロックで後片付けをしたり、例外を抑制してキャンセル要求を拒否した" +"りできます。\n" +"このため、:meth:`Future.cancel` と異なり、:meth:`Task.cancel` は Task がキャ" +"ンセルされることを保証しません。\n" +"ただし、キャンセルを完全に抑制するのは一般的ではなく、強く非推奨とします。\n" +"それでもキャンセルを抑制する場合、コルーチンは例外を捕捉するだけでなく :meth:" +"`Task.uncancel` も呼び出す必要があります。" -#: ../../library/asyncio-task.rst:1428 msgid "" "If the Task being cancelled is currently awaiting on a future-like object, " "that awaited object will also be cancelled. This cancellation propagates " "down the entire chain of awaited objects." msgstr "" +"キャンセルされる Task が Future のようなオブジェクトを await している場合、そ" +"のオブジェクトもキャンセルされます。\n" +"このキャンセルは、await されているオブジェクトの連鎖全体に伝播します。" -#: ../../library/asyncio-task.rst:1432 msgid "Added the *msg* parameter." -msgstr "" +msgstr "*msg* パラメーターが追加されました。" -#: ../../library/asyncio-task.rst:1435 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" +"``msg`` パラメーターが、キャンセルされたタスクからそのタスクを await する側へ" +"伝播するようになりました。" -#: ../../library/asyncio-task.rst:1440 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" -msgstr "" -"以下の例は、コルーチンがどのようにしてキャンセルのリクエストを阻止するかを示" -"しています::" +msgstr "次の例は、コルーチンがキャンセル要求を捕捉する方法を示しています。 ::" -#: ../../library/asyncio-task.rst:1443 msgid "" "async def cancel_me():\n" " print('cancel_me(): before sleep')\n" @@ -2105,6 +2598,39 @@ msgid "" "# cancel_me(): after sleep\n" "# main(): cancel_me is cancelled now" msgstr "" +"async def cancel_me():\n" +" print('cancel_me(): before sleep')\n" +"\n" +" try:\n" +" # 1 時間待つ\n" +" await asyncio.sleep(3600)\n" +" except asyncio.CancelledError:\n" +" print('cancel_me(): cancel sleep')\n" +" raise\n" +" finally:\n" +" print('cancel_me(): after sleep')\n" +"\n" +"async def main():\n" +" # \"cancel_me\" タスクを作成する\n" +" task = asyncio.create_task(cancel_me())\n" +"\n" +" # 1 秒待つ\n" +" await asyncio.sleep(1)\n" +"\n" +" task.cancel()\n" +" try:\n" +" await task\n" +" except asyncio.CancelledError:\n" +" print(\"main(): cancel_me is cancelled now\")\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# 期待される出力:\n" +"#\n" +"# cancel_me(): before sleep\n" +"# cancel_me(): cancel sleep\n" +"# cancel_me(): after sleep\n" +"# main(): cancel_me is cancelled now" #: ../../library/asyncio-task.rst:1479 msgid "Return ``True`` if the Task is *cancelled*." @@ -2120,21 +2646,19 @@ msgstr "" "ているコルーチンが内部で送出された :exc:`CancelledError` 例外を伝達したと" "き、 Task は実際に *キャンセル* されます。" -#: ../../library/asyncio-task.rst:1487 msgid "Decrement the count of cancellation requests to this Task." -msgstr "" +msgstr "この Task に対するキャンセル要求の回数を減らします。" -#: ../../library/asyncio-task.rst:1489 msgid "Returns the remaining number of cancellation requests." -msgstr "" +msgstr "残っているキャンセル要求の回数を返します。" -#: ../../library/asyncio-task.rst:1491 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" +"キャンセルされたタスクの実行が完了した後は、:meth:`uncancel` を呼び出しても効" +"果はありません。" -#: ../../library/asyncio-task.rst:1496 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -2142,8 +2666,13 @@ msgid "" "func:`asyncio.timeout` to continue running, isolating cancellation to the " "respective structured block. For example::" msgstr "" +"このメソッドは asyncio の内部で使うもので、ユーザーのコードからの使用は想定し" +"ていません。\n" +"特に、Task のキャンセル状態を正常に解除できると、キャンセルの影響をそれぞれの" +"構造化されたブロック内に限定でき、:ref:`taskgroups` や :func:`asyncio." +"timeout` などの構造化された並行処理を継続できます。\n" +"例えば次のようになります。 ::" -#: ../../library/asyncio-task.rst:1503 msgid "" "async def make_request_with_timeout():\n" " try:\n" @@ -2156,8 +2685,17 @@ msgid "" " # Outer code not affected by the timeout:\n" " await unrelated_code()" msgstr "" +"async def make_request_with_timeout():\n" +" try:\n" +" async with asyncio.timeout(1):\n" +" # タイムアウトの影響を受ける構造化されたブロック:\n" +" await make_request()\n" +" await make_another_request()\n" +" except TimeoutError:\n" +" log(\"There was a timeout\")\n" +" # 外側のコードはタイムアウトの影響を受けない:\n" +" await unrelated_code()" -#: ../../library/asyncio-task.rst:1514 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -2165,15 +2703,22 @@ msgid "" "`uncancel`. :class:`TaskGroup` context managers use :func:`uncancel` in a " "similar fashion." msgstr "" +"``make_request()`` と ``make_another_request()`` を含むブロックはタイムアウト" +"によってキャンセルされる可能性がありますが、その場合も ``unrelated_code()`` " +"は実行を続ける必要があります。\n" +"これを実現するのが :meth:`uncancel` です。\n" +":class:`TaskGroup` コンテキストマネージャーも同様に :func:`uncancel` を使いま" +"す。" -#: ../../library/asyncio-task.rst:1520 msgid "" "If end-user code is, for some reason, suppressing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" +"何らかの理由でユーザーのコードが :exc:`CancelledError` を捕捉してキャンセルを" +"抑制する場合、キャンセル状態を解除するためにこのメソッドを呼び出す必要があり" +"ます。" -#: ../../library/asyncio-task.rst:1524 msgid "" "When this method decrements the cancellation count to zero, the method " "checks if a previous :meth:`cancel` call had arranged for :exc:" @@ -2181,18 +2726,24 @@ msgid "" "that arrangement will be rescinded (by resetting the internal " "``_must_cancel`` flag)." msgstr "" +"このメソッドによってキャンセル回数がゼロになると、以前の :meth:`cancel` の呼" +"び出しがタスクへの :exc:`CancelledError` の送出を手配していたかどうかを確認し" +"ます。\n" +"まだ送出されていなければ、内部の ``_must_cancel`` フラグをリセットして、その" +"手配を取り消します。" -#: ../../library/asyncio-task.rst:1530 msgid "Changed to rescind pending cancellation requests upon reaching zero." msgstr "" +"キャンセル回数がゼロになったら、保留中のキャンセル要求を取り消すようになりま" +"した。" -#: ../../library/asyncio-task.rst:1535 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" +"この Task に対する保留中のキャンセル要求の回数、つまり :meth:`cancel` の呼び" +"出し回数から :meth:`uncancel` の呼び出し回数を引いた値を返します。" -#: ../../library/asyncio-task.rst:1539 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -2200,9 +2751,15 @@ msgid "" "the task not being cancelled after all if the cancellation requests go down " "to zero." msgstr "" +"この回数がゼロより大きくても、Task がまだ実行中なら :meth:`cancelled` は " +"``False`` を返します。\n" +":meth:`uncancel` を呼び出してこの回数を減らし、キャンセル要求がゼロになれば、" +"最終的にタスクがキャンセルされないこともあるためです。" -#: ../../library/asyncio-task.rst:1545 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." msgstr "" +"このメソッドは asyncio の内部で使うもので、ユーザーのコードからの使用は想定し" +"ていません。\n" +"詳しくは :meth:`uncancel` を参照してください。" diff --git a/library/asyncio-threading.po b/library/asyncio-threading.po index a0ec84704..6847b7b29 100644 --- a/library/asyncio-threading.po +++ b/library/asyncio-threading.po @@ -18,9 +18,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-threading.rst:6 msgid "asyncio and free-threaded Python" -msgstr "" +msgstr "asyncio とフリースレッド Python" #: ../../library/asyncio-threading.rst:8 msgid "" @@ -31,22 +30,24 @@ msgid "" "limited by the :term:`global interpreter lock` in CPython." msgstr "" -#: ../../library/asyncio-threading.rst:15 msgid "" "However, in :ref:`free-threaded Python `, the " "GIL is disabled and Python can run true multi-threaded code. This means that " "asyncio can now take advantage of multiple CPU cores without the limitations " "imposed by the GIL." msgstr "" +"一方、:ref:`フリースレッド Python ` では GIL が無" +"効になり、Python コードを複数のスレッドで真に並列実行できます。\n" +"これにより、asyncio でも GIL の制限を受けずに複数の CPU コアを活用できます。" -#: ../../library/asyncio-threading.rst:20 msgid "" "Since Python 3.14, asyncio has first-class support for free-threaded Python, " "and the implementation of asyncio is safe to use in a multi-threaded " "environment." msgstr "" +"Python 3.14 以降、asyncio はフリースレッド Python を正式にサポートしており、" +"マルチスレッド環境でも安全に使える実装になっています。" -#: ../../library/asyncio-threading.rst:24 msgid "" "A single event loop on one core can handle many connections concurrently, " "but the Python code that runs to handle each one still executes serially. " @@ -57,8 +58,16 @@ msgid "" "multiple CPU cores. It is also useful when you need to run blocking or CPU-" "bound code from an asyncio application." msgstr "" +"1 つのコア上のイベントループでも多数の接続を並行に処理できますが、各接続を処" +"理する Python コードは依然として逐次実行されます。\n" +"リクエストごとに相応の計算が必要になると、その処理がボトルネックとなり、1 つ" +"のコアでは追いつかなくなります。\n" +"asyncio とスレッドの組み合わせが特に役立つのはこのような場合です。\n" +"スレッドごとにイベントループを実行すると、異なるリクエストの処理を複数の CPU " +"コアで並列に実行できます。\n" +"asyncio アプリケーションからブロックするコードや CPU バウンドのコードを実行す" +"る必要がある場合にも役立ちます。" -#: ../../library/asyncio-threading.rst:37 msgid "" "`Scaling asyncio on Free-Threaded Python `__, a blog post by Kumar Aditya " @@ -66,32 +75,39 @@ msgid "" "under free-threaded Python, together with benchmarks of the resulting " "improvements." msgstr "" +"Kumar Aditya によるブログ記事 `Scaling asyncio on Free-Threaded Python " +"`__ " +"では、フリースレッド Python 上で asyncio を安全かつ効率的に動作させるための内" +"部的な変更と、改善の効果を示すベンチマークを紹介しています。" -#: ../../library/asyncio-threading.rst:45 msgid "Thread safety considerations" -msgstr "" +msgstr "スレッド安全性に関する注意点" -#: ../../library/asyncio-threading.rst:47 msgid "" "While asyncio is designed to be thread-safe in a free-threaded Python " "environment, there are still some considerations to keep in mind when using " "asyncio with threads:" msgstr "" +"asyncio はフリースレッド Python 環境で安全に動作するように設計されています" +"が、スレッドと組み合わせて使う際には、次の点に注意する必要があります。" -#: ../../library/asyncio-threading.rst:51 msgid "" "**Event loop**: Each thread should have its own event loop which should not " "be shared across threads. This ensures that the event loop can manage its " "own tasks and callbacks without interference from other threads." msgstr "" +"**イベントループ**: 各スレッドが専用のイベントループを持ち、スレッド間で共有" +"しないようにしてください。\n" +"これにより、イベントループは他のスレッドから干渉されずに自身のタスクやコール" +"バックを管理できます。" -#: ../../library/asyncio-threading.rst:56 msgid "" "**Task management**: Tasks and futures created in one thread should not be " "awaited or manipulated from another thread." msgstr "" +"**タスクの管理**: あるスレッドで作成した Task や Future を、別のスレッドから " +"await したり操作したりしないでください。" -#: ../../library/asyncio-threading.rst:59 msgid "" "**Thread-safe APIs**: When interacting with asyncio from multiple threads, " "it's important to use thread-safe APIs provided by asyncio, such as :func:" @@ -99,8 +115,13 @@ msgid "" "loop from another thread. If you need to call a callback from a different " "thread, you can use :meth:`loop.call_soon_threadsafe` to schedule it safely." msgstr "" +"**スレッドセーフな API**: 複数のスレッドから asyncio を使う場合は、asyncio が" +"提供するスレッドセーフな API を使うことが重要です。\n" +"例えば、別のスレッドからイベントループにコルーチンを送るには :func:`asyncio." +"run_coroutine_threadsafe` を使います。\n" +"別のスレッドからコールバックを呼び出す必要がある場合は、:meth:`loop." +"call_soon_threadsafe` で安全にスケジュールできます。" -#: ../../library/asyncio-threading.rst:66 msgid "" "**Synchronization**: The synchronization primitives provided by asyncio " "(like :class:`asyncio.Lock` and :class:`asyncio.Event`) are not designed to " @@ -108,24 +129,29 @@ msgid "" "should use the synchronization primitives from the :mod:`threading` module " "instead." msgstr "" +"**同期**: asyncio が提供する同期プリミティブ (:class:`asyncio.Lock` や :" +"class:`asyncio.Event` など) は、スレッドをまたいで使うようには設計されていま" +"せん。\n" +"スレッド間で同期する必要がある場合は、代わりに :mod:`threading` モジュールの" +"同期プリミティブを使ってください。" -#: ../../library/asyncio-threading.rst:74 msgid "Using asyncio with threads" -msgstr "" +msgstr "asyncio とスレッドの併用" -#: ../../library/asyncio-threading.rst:76 msgid "" "asyncio supports running one event loop per thread, which allows you to take " "advantage of multiple CPU cores in a free-threaded Python environment. Each " "thread can run its own event loop, and tasks can be scheduled on those loops " "independently." msgstr "" +"asyncio はスレッドごとに 1 つのイベントループを実行できるため、フリースレッ" +"ド Python 環境で複数の CPU コアを活用できます。\n" +"各スレッドは専用のイベントループを実行し、それぞれのループに独立してタスクを" +"スケジュールできます。" -#: ../../library/asyncio-threading.rst:81 msgid "Here's an example of how to use asyncio with threads::" -msgstr "" +msgstr "asyncio とスレッドを併用する例を示します。 ::" -#: ../../library/asyncio-threading.rst:83 msgid "" "import asyncio\n" "import threading\n" @@ -147,27 +173,51 @@ msgid "" "for t in threads:\n" " t.join()" msgstr "" +"import asyncio\n" +"import threading\n" +"\n" +"async def worker(name: str) -> None:\n" +" print(f\"Worker {name} starting\")\n" +" await asyncio.sleep(1)\n" +" print(f\"Worker {name} done\")\n" +"\n" +"def run_loop(name: str) -> None:\n" +" asyncio.run(worker(name))\n" +"\n" +"threads = [\n" +" threading.Thread(target=run_loop, args=(f\"T{i}\",))\n" +" for i in range(4)\n" +"]\n" +"for t in threads:\n" +" t.start()\n" +"for t in threads:\n" +" t.join()" -#: ../../library/asyncio-threading.rst:103 msgid "" "In this example, each thread creates its own event loop with :func:`asyncio." "run` and runs a coroutine on it. The threads execute concurrently, and in a " "free-threaded build they can run on separate CPU cores in parallel." msgstr "" +"この例では、各スレッドが :func:`asyncio.run` で専用のイベントループを作成し、" +"その上でコルーチンを実行します。\n" +"スレッドは並行に実行され、フリースレッドビルドでは別々の CPU コアで並列に実行" +"できます。" -#: ../../library/asyncio-threading.rst:110 msgid "Producer/consumer across threads" -msgstr "" +msgstr "スレッドをまたぐ生産者と消費者" -#: ../../library/asyncio-threading.rst:112 msgid "" "When a regular (non-asyncio) thread needs to hand work to an asyncio event " "loop running in another thread, use a thread-safe primitive such as :class:" "`queue.Queue` rather than :class:`asyncio.Queue`, which is only safe within " "a single event loop.::" msgstr "" +"通常の (asyncio ではない) スレッドから、別のスレッドで動いている asyncio のイ" +"ベントループに処理を渡すには、:class:`queue.Queue` などのスレッドセーフなプリ" +"ミティブを使ってください。\n" +":class:`asyncio.Queue` を安全に使えるのは、単一のイベントループ内だけで" +"す。 ::" -#: ../../library/asyncio-threading.rst:117 msgid "" "import asyncio\n" "import queue\n" @@ -199,6 +249,35 @@ msgid "" "producer(q)\n" "consumer_thread.join()" msgstr "" +"import asyncio\n" +"import queue\n" +"import threading\n" +"\n" +"def producer(q: queue.Queue[int]) -> None:\n" +" for i in range(5):\n" +" print(f\"Producing {i}\")\n" +" q.put(i)\n" +" q.shutdown()\n" +"\n" +"async def consumer(q: queue.Queue[int]) -> None:\n" +" while True:\n" +" try:\n" +" item = q.get_nowait()\n" +" except queue.Empty:\n" +" await asyncio.sleep(0.1)\n" +" continue\n" +" except queue.ShutDown:\n" +" break\n" +" print(f\"Consumed {item}\")\n" +" await asyncio.sleep(item)\n" +"\n" +"q: queue.Queue[int] = queue.Queue()\n" +"consumer_thread = threading.Thread(\n" +" target=lambda: asyncio.run(consumer(q))\n" +")\n" +"consumer_thread.start()\n" +"producer(q)\n" +"consumer_thread.join()" #: ../../library/asyncio-threading.rst:147 msgid "" diff --git a/library/asyncio-tools.po b/library/asyncio-tools.po index fe3e55a56..24ac5025b 100644 --- a/library/asyncio-tools.po +++ b/library/asyncio-tools.po @@ -22,61 +22,65 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-tools.rst:7 msgid "Command-line introspection tools" -msgstr "" +msgstr "コマンドラインのイントロスペクションツール" -#: ../../library/asyncio-tools.rst:9 msgid "**Source code:** :source:`Lib/asyncio/tools.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/asyncio/tools.py`" -#: ../../library/asyncio-tools.rst:13 msgid "" "The :mod:`!asyncio` module can be invoked as a script via ``python -m " "asyncio`` to inspect the task graph of another running Python process " "without modifying it or restarting it. The :mod:`!asyncio.tools` submodule " "implements this interface." msgstr "" +":mod:`!asyncio` モジュールは ``python -m asyncio`` でスクリプトとして実行で" +"き、実行中の別の Python プロセスを変更したり再起動したりせずに、そのタスクグ" +"ラフを調べられます。\n" +"このインターフェースは :mod:`!asyncio.tools` サブモジュールが実装しています。" -#: ../../library/asyncio-tools.rst:18 msgid "The following commands inspect the process identified by ``PID``:" -msgstr "" +msgstr "次のコマンドは、``PID`` で指定したプロセスを調べます。" -#: ../../library/asyncio-tools.rst:20 msgid "" "$ python -m asyncio pstree [--retries N] PID\n" "$ python -m asyncio ps [--retries N] PID" msgstr "" +"$ python -m asyncio pstree [--retries N] PID\n" +"$ python -m asyncio ps [--retries N] PID" -#: ../../library/asyncio-tools.rst:25 msgid "" "The commands read the target process state without executing any code in it. " "They are only available on supported platforms and may require permission to " "inspect another process. See the :ref:`permission requirements ` for details." msgstr "" +"これらのコマンドは、対象プロセス内でコードを実行せずに、その状態を読み取りま" +"す。\n" +"サポートされているプラットフォームでのみ利用でき、別のプロセスを調べるための" +"権限が必要な場合があります。\n" +"詳しくは :ref:`必要な権限 ` を参照してください。" -#: ../../library/asyncio-tools.rst:31 msgid ":ref:`asyncio-graph`" -msgstr "" +msgstr ":ref:`asyncio-graph`" -#: ../../library/asyncio-tools.rst:32 msgid "" "Programmatic APIs for inspecting the async call graph of a task or future in " "the current process." msgstr "" +"現在のプロセス内の Task や Future の非同期呼び出しグラフを、プログラムから調" +"べるための API です。" -#: ../../library/asyncio-tools.rst:35 msgid "" "The command examples below use this program, which creates a task hierarchy " "suitable for inspection and prints its process ID:" msgstr "" +"以下のコマンド例では、調査用のタスク階層を作成してプロセス ID を表示する次の" +"プログラムを使います。" -#: ../../library/asyncio-tools.rst:38 msgid "example.py" -msgstr "" +msgstr "example.py" -#: ../../library/asyncio-tools.rst:38 msgid "" "import asyncio\n" "import os\n" @@ -104,29 +108,55 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import os\n" +"\n" +"async def play(track):\n" +" await asyncio.sleep(3600)\n" +" print(f\"🎵 Finished: {track}\")\n" +"\n" +"async def album(name, tracks):\n" +" async with asyncio.TaskGroup() as tg:\n" +" for track in tracks:\n" +" tg.create_task(play(track), name=track)\n" +"\n" +"async def main():\n" +" print(f\"PID: {os.getpid()}\")\n" +" async with asyncio.TaskGroup() as tg:\n" +" tg.create_task(\n" +" album(\"Sundowning\", [\"TNDNBTG\", \"Levitate\"]),\n" +" name=\"Sundowning\",\n" +" )\n" +" tg.create_task(\n" +" album(\"TMBTE\", [\"DYWTYLM\", \"Aqua Regia\"]),\n" +" name=\"TMBTE\",\n" +" )\n" +"\n" +"asyncio.run(main())" -#: ../../library/asyncio-tools.rst:67 msgid "Run the program in one terminal and leave it running:" -msgstr "" +msgstr "1 つの端末でプログラムを起動し、実行したままにします。" -#: ../../library/asyncio-tools.rst:69 msgid "" "$ python example.py\n" "PID: 12345" msgstr "" +"$ python example.py\n" +"PID: 12345" -#: ../../library/asyncio-tools.rst:74 msgid "" "Then pass the printed process ID to the commands from another terminal. " "Thread IDs, task IDs, file paths, and line numbers vary between runs and " "source layouts." msgstr "" +"次に、表示されたプロセス ID を、別の端末からコマンドに渡します。\n" +"スレッド ID、タスク ID、ファイルパス、行番号は、実行時やソースコードの配置に" +"よって異なります。" #: ../../library/asyncio-tools.rst:81 msgid "Command-line options" msgstr "コマンドラインオプション" -#: ../../library/asyncio-tools.rst:85 msgid "" "Display task and coroutine relationships as a tree. Each task is shown with " "its full coroutine stack, nested under the task (if any) that is awaiting " @@ -134,8 +164,12 @@ msgid "" "task hierarchy is blocked and where in its coroutine stack execution has " "paused:" msgstr "" +"タスクとコルーチンの関係をツリーとして表示します。\n" +"各タスクはコルーチンのスタック全体とともに表示され、そのタスクを await してい" +"るタスクがあれば、その下に入れ子で配置されます。\n" +"このサブコマンドは、タスク階層のどの枝がブロックしていて、コルーチンのスタッ" +"クのどこで実行が止まっているかを素早く把握するのに役立ちます。" -#: ../../library/asyncio-tools.rst:91 msgid "" "$ python -m asyncio pstree 12345\n" "└── (T) Task-1\n" @@ -167,36 +201,74 @@ msgid "" " └── play example.py:4\n" " └── sleep Lib/asyncio/tasks.py:702" msgstr "" +"$ python -m asyncio pstree 12345\n" +"└── (T) Task-1\n" +" └── main example.py:12\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups.py:75\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124\n" +" ├── (T) Sundowning\n" +" │ └── album example.py:7\n" +" │ └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:75\n" +" │ └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:124\n" +" │ ├── (T) TNDNBTG\n" +" │ │ └── play example.py:4\n" +" │ │ └── sleep Lib/asyncio/tasks.py:702\n" +" │ └── (T) Levitate\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) TMBTE\n" +" └── album example.py:7\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:75\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:124\n" +" ├── (T) DYWTYLM\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) Aqua Regia\n" +" └── play example.py:4\n" +" └── sleep Lib/asyncio/tasks.py:702" -#: ../../library/asyncio-tools.rst:119 msgid "" "If the await graph contains a cycle, ``pstree`` reports an error instead of " "printing a tree. A cycle in the await graph is unusual and typically " "indicates a programming error:" msgstr "" +"await の関係を表すグラフに循環がある場合、``pstree`` はツリーを表示せずにエ" +"ラーを報告します。\n" +"このグラフに循環があるのはまれで、通常はプログラムの誤りを示します。" -#: ../../library/asyncio-tools.rst:123 msgid "" "$ python -m asyncio pstree 12345\n" "ERROR: await-graph contains cycles - cannot print a tree!\n" "\n" "cycle: Task-2 → Task-3 → Task-2" msgstr "" +"$ python -m asyncio pstree 12345\n" +"ERROR: await-graph contains cycles - cannot print a tree!\n" +"\n" +"cycle: Task-2 → Task-3 → Task-2" -#: ../../library/asyncio-tools.rst:132 msgid "" "Display a flat table of all pending tasks in the process *PID*. Each row " "shows the event-loop thread ID, task ID and name, coroutine stack, and the " "awaiting task's stack, name, and ID, if any." msgstr "" +"プロセス *PID* 内の未完了のタスクをすべて、階層のない表で表示します。\n" +"各行には、イベントループのスレッド ID、タスクの ID と名前、コルーチンのスタッ" +"クを表示します。\n" +"そのタスクを await しているタスクがあれば、そのスタック、名前、ID も表示しま" +"す。" -#: ../../library/asyncio-tools.rst:136 msgid "" "This subcommand prints all tasks regardless of whether the await graph " "contains cycles:" msgstr "" +"このサブコマンドは、await の関係を表すグラフに循環があるかどうかにかかわら" +"ず、すべてのタスクを表示します。" -#: ../../library/asyncio-tools.rst:139 msgid "" "$ python -m asyncio ps 12345\n" "tid task id task name coroutine " @@ -226,9 +298,37 @@ msgid "" "play TaskGroup._aexit -> TaskGroup." "__aexit__ -> album TMBTE 0x10a439d70" msgstr "" +"$ python -m asyncio ps 12345\n" +"tid task id task name coroutine " +"stack awaiter " +"chain awaiter name awaiter id\n" +"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" +"18445801 0x10a456060 Task-1 TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> " +"main " +"0x0\n" +"18445801 0x10a439f60 Sundowning TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> " +"main Task-1 0x10a456060\n" +"18445801 0x10a439d70 TMBTE TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> " +"main Task-1 0x10a456060\n" +"18445801 0x10a2a3a80 TNDNBTG sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album Sundowning 0x10a439f60\n" +"18445801 0x10a2a38a0 Levitate sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album Sundowning 0x10a439f60\n" +"18445801 0x10a2d7150 DYWTYLM sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x10a439d70\n" +"18445801 0x10a6bdaa0 Aqua Regia sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x10a439d70" -#: ../../library/asyncio-tools.rst:154 msgid "" "Retry failed attempts to inspect the target process up to *N* times. This " "can help when the target process changes while its state is being read." msgstr "" +"対象プロセスの調査に失敗した場合、最大 *N* 回再試行します。\n" +"状態の読み取り中に対象プロセスが変化する場合に役立ちます。" diff --git a/library/asyncio.po b/library/asyncio.po index 074495ae0..bf77a9087 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -28,9 +28,8 @@ msgstr "" msgid "High-level APIs" msgstr "高水準 API" -#: ../../library/asyncio.rst:119 msgid "Introspection APIs" -msgstr "" +msgstr "イントロスペクション API" #: ../../library/asyncio.rst:126 msgid "Low-level APIs" @@ -48,7 +47,6 @@ msgstr ":mod:`!asyncio` --- 非同期 I/O" msgid "Hello World!" msgstr "Hello World!" -#: ../../library/asyncio.rst:13 msgid "" "import asyncio\n" "\n" @@ -59,6 +57,14 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def main():\n" +" print('Hello ...')\n" +" await asyncio.sleep(1)\n" +" print('... World!')\n" +"\n" +"asyncio.run(main())" #: ../../library/asyncio.rst:22 msgid "" @@ -117,24 +123,25 @@ msgstr ":ref:`subprocesses ` を管理する" msgid "distribute tasks via :ref:`queues `;" msgstr ":ref:`キュー ` を使ってタスクを分散する" -#: ../../library/asyncio.rst:48 msgid ":ref:`synchronize ` concurrent code;" -msgstr "並列処理のコードを :ref:`同期 ` させる" +msgstr "並行処理のコードを :ref:`同期 ` させる" -#: ../../library/asyncio.rst:50 msgid "For **introspection**, asyncio provides APIs and tools for:" msgstr "" +"asyncio は **イントロスペクション** のために、次の API とツールを提供していま" +"す。" -#: ../../library/asyncio.rst:52 msgid "" "inspecting the :ref:`async call graph ` of tasks and futures;" msgstr "" +"タスクと Future の :ref:`非同期呼び出しグラフ ` を調べる" -#: ../../library/asyncio.rst:54 msgid "" "inspecting tasks in another running Python process with :ref:`command-line " "tools `;" msgstr "" +":ref:`コマンドラインツール ` で、実行中の別の " +"Python プロセス内のタスクを調べる" #: ../../library/asyncio.rst:57 msgid "" @@ -213,12 +220,13 @@ msgstr "" ">>> await asyncio.sleep(10, result='hello')\n" "'hello'" -#: ../../library/asyncio.rst:89 msgid "" "This REPL provides limited compatibility with :envvar:`PYTHON_BASIC_REPL`. " "It is recommended that the default REPL is used for full functionality and " "the latest features." msgstr "" +"この REPL と :envvar:`PYTHON_BASIC_REPL` の互換性は限定的です。\n" +"すべての機能と最新の機能を使うには、デフォルトの REPL を推奨します。" msgid "" "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " diff --git a/library/asyncore.po b/library/asyncore.po index b2465c6bd..464823a40 100644 --- a/library/asyncore.po +++ b/library/asyncore.po @@ -18,23 +18,26 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncore.rst:2 msgid ":mod:`!asyncore` --- Asynchronous socket handler" -msgstr "" +msgstr ":mod:`!asyncore` --- 非同期ソケットハンドラー" -#: ../../library/asyncore.rst:10 msgid "" "This module is no longer part of the Python standard library. It was :ref:" "`removed in Python 3.12 ` after being deprecated in " "Python 3.6. The removal was decided in :pep:`594`." msgstr "" +"このモジュールは Python 標準ライブラリから削除されました。\n" +"Python 3.6 で非推奨となり、:ref:`Python 3.12 で削除 ` さ" +"れました。\n" +"削除は :pep:`594` で決定されました。" -#: ../../library/asyncore.rst:14 msgid "Applications should use the :mod:`asyncio` module instead." msgstr "" +"アプリケーションでは、代わりに :mod:`asyncio` モジュールを使ってください。" -#: ../../library/asyncore.rst:16 msgid "" "The last version of Python that provided the :mod:`!asyncore` module was " "`Python 3.11 `_." msgstr "" +":mod:`!asyncore` モジュールを提供していた最後のバージョンは `Python 3.11 " +"`_ です。" diff --git a/library/atexit.po b/library/atexit.po index 7cbdcc678..878db26b8 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -26,7 +26,6 @@ msgstr "" msgid ":mod:`!atexit` --- Exit handlers" msgstr ":mod:`!atexit` --- 終了ハンドラー" -#: ../../library/atexit.rst:9 msgid "" "The :mod:`!atexit` module defines functions to register and unregister :dfn:" "`exit handlers`: functions that are automatically executed \"at exit\", that " @@ -34,8 +33,12 @@ msgid "" "called or the main module's execution completes) or, more generally, upon :" "term:`interpreter shutdown`." msgstr "" +":mod:`!atexit` モジュールは、:dfn:`終了ハンドラー` を登録・解除する関数を定義" +"します。\n" +"終了ハンドラーは、プログラムの正常終了時 (例えば :func:`sys.exit` が呼び出さ" +"れたときや、メインモジュールの実行が完了したとき)、より一般的には :term:" +"`interpreter shutdown` 時に自動的に実行される関数です。" -#: ../../library/atexit.rst:15 msgid "" "At exit, all registered exit handlers are called in the *reverse* order in " "which they were registered. If you register ``A``, ``B``, and ``C``, at " @@ -43,6 +46,12 @@ msgid "" "The assumption is that lower level modules will normally be imported before " "higher level modules and thus must be cleaned up later." msgstr "" +"終了時には、登録されているすべての終了ハンドラーを登録した順序の *逆順* に呼" +"び出します。\n" +"``A``、``B``、``C`` の順に登録すると、インタープリタの終了時には ``C``、" +"``B``、``A`` の順に実行します。\n" +"これは、通常は低水準のモジュールが高水準のモジュールより先にインポートされる" +"ので、後片付けは後で行う必要があるという想定に基づいています。" #: ../../library/atexit.rst:22 msgid "" @@ -52,7 +61,6 @@ msgid "" "last exception to be raised is re-raised." msgstr "" -#: ../../library/atexit.rst:27 msgid "" "In programs that use multiple interpreters, each interpreter has its own " "stack of exit handlers, which are executed when the interpreter shuts down " @@ -60,13 +68,22 @@ msgid "" "C API :c:func:`Py_EndInterpreter`). Registration functions in this module " "only affect the interpreter they are called from." msgstr "" +"複数のインタープリタを使うプログラムでは、各インタープリタが終了ハンドラーの" +"スタックを持ちます。\n" +"ハンドラーは、そのインタープリタが終了するとき (例えば :meth:`concurrent." +"interpreters.Interpreter.close` や C API の :c:func:`Py_EndInterpreter` によ" +"る終了時) に実行されます。\n" +"このモジュールの登録用関数が影響するのは、呼び出し元のインタープリタだけで" +"す。" -#: ../../library/atexit.rst:34 msgid "" "**Note:** Exit handlers are not called when the program is killed by a " "signal not handled by Python, when a Python fatal internal error is " "detected, or when :func:`os._exit` is called." msgstr "" +"**注意:** Python が処理しないシグナルによってプログラムが強制終了した場合、" +"Python 内部の致命的なエラーが検出された場合、または :func:`os._exit` が呼び出" +"された場合、終了ハンドラーは呼び出されません。" #: ../../library/atexit.rst:38 msgid "" @@ -76,14 +93,17 @@ msgstr "" "**注意:** クリーンアップ関数内からの関数の登録・登録解除効果は定義されていま" "せん。" -#: ../../library/atexit.rst:42 msgid "" "When writing exit handlers, especially in C API extensions, keep in mind " "that other exit handlers may still run arbitrary Python code after you clean " "up. Such code should succeed or fail with an exception, rather than crash." msgstr "" +"終了ハンドラーを作成するとき、特に C API を使った拡張では、自身の後片付けが終" +"わった後も、他の終了ハンドラーが任意の Python コードを実行する可能性があるこ" +"とに注意してください。\n" +"そのようなコードは正常に実行されるか例外で失敗するべきであり、クラッシュして" +"はいけません。" -#: ../../library/atexit.rst:47 msgid "" "Attempts to start a new thread or :func:`os.fork` a new process in an exit " "handler now leads to :exc:`RuntimeError`. Previously, this could cause race " @@ -91,19 +111,29 @@ msgid "" "while internal :mod:`threading` routines or the new process try to use that " "state, which could lead to crashes rather than clean shutdown." msgstr "" +"終了ハンドラー内で新しいスレッドを開始したり、:func:`os.fork` で新しいプロセ" +"スを作成したりしようとすると、:exc:`RuntimeError` を送出するようになりまし" +"た。\n" +"以前は、Python ランタイムのメインスレッドがスレッド状態を解放する一方で、:" +"mod:`threading` 内部のルーチンや新しいプロセスがその状態を使おうとして、競合" +"状態が発生する可能性がありました。\n" +"その結果、正常に終了せずクラッシュすることがありました。" -#: ../../library/atexit.rst:55 msgid "" "When used with subinterpreters, registered functions are local to the " "interpreter they were registered in." msgstr "" +"サブインタープリタで使う場合、登録した関数は登録先のインタープリタに固有とな" +"りました。" -#: ../../library/atexit.rst:61 msgid "" "Register *func* as an exit handler. Any optional arguments that are to be " "passed to *func* must be passed as arguments to :func:`register`. It is " "possible to register the same function and arguments more than once." msgstr "" +"*func* を終了ハンドラーとして登録します。\n" +"*func* に渡す引数があれば、:func:`register` の引数として渡してください。\n" +"同じ関数と引数を複数回登録することもできます。" #: ../../library/atexit.rst:66 msgid "" @@ -111,7 +141,6 @@ msgid "" "decorator." msgstr "この関数は *func* を返し、これをデコレータとして利用できます。" -#: ../../library/atexit.rst:71 msgid "" "Remove *func* from the list of exit handlers. :func:`unregister` silently " "does nothing if *func* was not previously registered. If *func* has been " @@ -120,20 +149,27 @@ msgid "" "internally during unregistration, so function references do not need to have " "matching identities." msgstr "" +"終了ハンドラーのリストから *func* を削除します。\n" +"*func* が登録されていなければ、:func:`unregister` は何もせず、エラーも出しま" +"せん。\n" +"*func* が複数回登録されていた場合、:mod:`!atexit` の呼び出しスタックから、そ" +"の関数をすべて削除します。\n" +"登録解除では内部で等価比較 (``==``) を使うため、関数の参照先が同一のオブジェ" +"クトである必要はありません。" #: ../../library/atexit.rst:81 msgid "Module :mod:`readline`" msgstr ":mod:`readline` モジュール" -#: ../../library/atexit.rst:82 msgid "" "Useful example of :mod:`!atexit` to read and write :mod:`readline` history " "files." msgstr "" +":mod:`readline` の履歴ファイルを読み書きする、:mod:`!atexit` の実用的な使用例" +"です。" -#: ../../library/atexit.rst:89 msgid ":mod:`!atexit` Example" -msgstr "" +msgstr ":mod:`!atexit` の使用例" msgid "" "The following simple example demonstrates how a module can initialize a " @@ -146,7 +182,6 @@ msgstr "" "アプリケーションが終了時にこのモジュールを明示的に呼び出す必要はありませ" "ん。 ::" -#: ../../library/atexit.rst:96 msgid "" "try:\n" " with open('counterfile') as infile:\n" @@ -166,6 +201,23 @@ msgid "" "\n" "atexit.register(savecounter)" msgstr "" +"try:\n" +" with open('counterfile') as infile:\n" +" _count = int(infile.read())\n" +"except FileNotFoundError:\n" +" _count = 0\n" +"\n" +"def incrcounter(n):\n" +" global _count\n" +" _count = _count + n\n" +"\n" +"def savecounter():\n" +" with open('counterfile', 'w') as outfile:\n" +" outfile.write('%d' % _count)\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(savecounter)" #: ../../library/atexit.rst:114 msgid "" @@ -175,7 +227,6 @@ msgstr "" ":func:`register` に指定した位置引数とキーワード引数は登録した関数を呼び出す際" "に渡されます::" -#: ../../library/atexit.rst:117 msgid "" "def goodbye(name, adjective):\n" " print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n" @@ -186,12 +237,19 @@ msgid "" "# or:\n" "atexit.register(goodbye, adjective='nice', name='Donny')" msgstr "" +"def goodbye(name, adjective):\n" +" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(goodbye, 'Donny', 'nice')\n" +"# または:\n" +"atexit.register(goodbye, adjective='nice', name='Donny')" #: ../../library/atexit.rst:126 msgid "Usage as a :term:`decorator`::" msgstr ":term:`デコレータ ` として利用する例::" -#: ../../library/atexit.rst:128 msgid "" "import atexit\n" "\n" @@ -199,6 +257,11 @@ msgid "" "def goodbye():\n" " print('You are now leaving the Python sector.')" msgstr "" +"import atexit\n" +"\n" +"@atexit.register\n" +"def goodbye():\n" +" print('You are now leaving the Python sector.')" msgid "This only works with functions that can be called without arguments." msgstr "デコレータとして利用できるのは、引数なしで呼び出せる関数に限られます。" diff --git a/library/audioop.po b/library/audioop.po index 8136aac28..02155c70c 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/audioop.rst:2 msgid ":mod:`!audioop` --- Manipulate raw audio data" -msgstr "" +msgstr ":mod:`!audioop` --- 生の音声データの操作" #: ../../library/audioop.rst:10 msgid "" @@ -36,8 +35,9 @@ msgstr "" "ルは Python 3.11 で非推奨となったあと、:ref:`Python 3.13 で削除` されました。削除の決定は :pep:`594` でなされました。" -#: ../../library/audioop.rst:14 msgid "" "The last version of Python that provided the :mod:`!audioop` module was " "`Python 3.12 `_." msgstr "" +":mod:`!audioop` モジュールを提供していた最後のバージョンは `Python 3.12 " +"`_ です。" diff --git a/library/audit_events.po b/library/audit_events.po index 9272db57a..44ea96b5d 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -124,13 +124,11 @@ msgstr "_winapi.TerminateProcess" msgid "``handle``, ``exit_code``" msgstr "``handle``, ``exit_code``" -#: ../../library/audit_events.rst:46 msgid "_posixsubprocess.fork_exec" -msgstr "" +msgstr "_posixsubprocess.fork_exec" -#: ../../library/audit_events.rst:46 msgid "``exec_list``, ``args``, ``env``" -msgstr "" +msgstr "``exec_list``, ``args``, ``env``" #: ../../library/audit_events.rst:48 msgid "ctypes.PyObj_FromPtr" @@ -140,9 +138,8 @@ msgstr "ctypes.PyObj_FromPtr" msgid "``obj``" msgstr "``obj``" -#: ../../library/audit_events.rst:51 msgid "The ``_posixsubprocess.fork_exec`` internal audit event." -msgstr "" +msgstr "内部の監査イベント ``_posixsubprocess.fork_exec``。" #: ../../library/audit_events.rst:3 msgid "audit events" diff --git a/library/base64.po b/library/base64.po index 464bbaf28..4f6b3ec88 100644 --- a/library/base64.po +++ b/library/base64.po @@ -32,7 +32,6 @@ msgstr ":mod:`!base64` --- Base16, Base32, Base64, Base85 データのエンコ msgid "**Source code:** :source:`Lib/base64.py`" msgstr "**ソースコード:** :source:`Lib/base64.py`" -#: ../../library/base64.rst:16 msgid "" "This module provides functions for encoding binary data to printable ASCII " "characters and decoding such encodings back to binary data. This includes " @@ -41,6 +40,12 @@ msgid "" "`PDF 2.0 `_, and non-standard " "variants of Base85 used elsewhere." msgstr "" +"このモジュールは、バイナリデータを表示可能な ASCII 文字にエンコードし、エン" +"コードされたデータをバイナリデータに戻す関数を提供します。\n" +":rfc:`4648` で :ref:`規定されているエンコーディング ` " +"(Base64、Base32、Base16)、`PDF 2.0 `_ で規定されている :ref:`Base85 エンコーディング `、その他" +"の場所で使われる Base85 の非標準の変種を含みます。" #: ../../library/base64.rst:24 msgid "" @@ -126,23 +131,25 @@ msgstr "" "成できます。デフォルトは ``None`` で、標準の Base64 アルファベットが使われま" "す。" -#: ../../library/base64.rst:66 msgid "" "If *padded* is true (default), pad the encoded data with the '=' character " "to a size multiple of 4. If *padded* is false, do not add the pad characters." msgstr "" +"*padded* が真 (デフォルト) の場合、エンコードしたデータの長さが 4 の倍数にな" +"るように '=' でパディングします。\n" +"*padded* が偽の場合、パディング文字を追加しません。" -#: ../../library/base64.rst:70 ../../library/base64.rst:323 msgid "" "If *wrapcol* is non-zero, insert a newline (``b'\\n'``) character after at " "most every *wrapcol* characters. If *wrapcol* is zero (default), do not " "insert any newlines." msgstr "" +"*wrapcol* がゼロでない場合、最大 *wrapcol* 文字ごとに改行文字 (``b'\\n'``) を" +"挿入します。\n" +"*wrapcol* がゼロ (デフォルト) の場合、改行を挿入しません。" -#: ../../library/base64.rst:74 ../../library/base64.rst:183 -#: ../../library/base64.rst:231 msgid "Added the *padded* and *wrapcol* parameters." -msgstr "" +msgstr "*padded* と *wrapcol* パラメーターが追加されました。" #: ../../library/base64.rst:81 msgid "" @@ -162,7 +169,6 @@ msgstr "" "ASCII 文字列で、``+`` と ``/`` の代わりに使われる代替アルファベットを指定しま" "す。" -#: ../../library/base64.rst:88 msgid "" "If *padded* is true, the last group of 4 base 64 alphabet characters must be " "padded with the '=' character. If *padded* is false, padding is neither " @@ -171,6 +177,13 @@ msgid "" "*validate* is false, or causes an :exc:`~binascii.Error` when *validate* is " "true unless b'=' is included in *ignorechars*." msgstr "" +"*padded* が真の場合、Base64 アルファベットの最後の 4 文字の組には '=' による" +"パディングが必要です。\n" +"*padded* が偽の場合、パディングは不要で、パディングとしての認識もしません。\n" +"'=' はパディングではなくアルファベット外の文字として扱われるため、*validate* " +"が偽なら黙って破棄されます。\n" +"*validate* が真なら、*ignorechars* に ``b'='`` が含まれていない限り :exc:" +"`~binascii.Error` が発生します。" #: ../../library/base64.rst:96 msgid "" @@ -179,7 +192,6 @@ msgstr "" "*s* が正しくパディングされていない場合は :exc:`binascii.Error` 例外を発生させ" "ます。" -#: ../../library/base64.rst:99 msgid "" "If *ignorechars* is specified, it should be a :term:`bytes-like object` " "containing characters to ignore from the input when *validate* is true. If " @@ -188,6 +200,12 @@ msgid "" "will be ignored. The default value of *validate* is ``True`` if " "*ignorechars* is specified, ``False`` otherwise." msgstr "" +"*ignorechars* を指定する場合は、*validate* が真のときに入力から無視する文字を" +"含む :term:`bytes-like object` を渡してください。\n" +"*ignorechars* にパディング文字 ``'='`` を含めると、エンコードされたデータの末" +"尾より前に現れるパディング文字や、余分なパディング文字を無視します。\n" +"*validate* のデフォルト値は、*ignorechars* を指定した場合は ``True``、それ以" +"外は ``False`` です。" #: ../../library/base64.rst:107 msgid "" @@ -198,17 +216,19 @@ msgid "" "future Python versions)." msgstr "" -#: ../../library/base64.rst:114 msgid "" "If *validate* is true, these non-alphabet characters in the input result in " "a :exc:`binascii.Error`." msgstr "" +"*validate* が真の場合、入力にこれらのアルファベット外の文字があると :exc:" +"`binascii.Error` が発生します。" -#: ../../library/base64.rst:117 msgid "" "If *canonical* is true, non-zero padding bits are rejected. See :func:" "`binascii.a2b_base64` for details." msgstr "" +"*canonical* が真の場合、ゼロでないパディングビットを拒否します。\n" +"詳しくは :func:`binascii.a2b_base64` を参照してください。" #: ../../library/base64.rst:120 msgid "" @@ -218,16 +238,15 @@ msgstr "" "厳密な base64 チェックのについての詳細は :func:`binascii.a2b_base64` を参照し" "てください" -#: ../../library/base64.rst:122 ../../library/base64.rst:220 -#: ../../library/base64.rst:247 msgid "Added the *canonical*, *ignorechars*, and *padded* parameters." -msgstr "" +msgstr "*canonical*、*ignorechars*、*padded* パラメーターが追加されました。" -#: ../../library/base64.rst:125 msgid "" "Accepting the ``+`` and ``/`` characters with an alternative alphabet is now " "deprecated." msgstr "" +"代替アルファベットの使用時に ``+`` と ``/`` を受け入れることは非推奨になりま" +"した。" #: ../../library/base64.rst:132 msgid "" @@ -245,17 +264,20 @@ msgstr "" "標準の base64 アルファベットを使用した :term:`bytes-like object` または " "ASCII 文字列 *s* をデコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:144 msgid "" "Encode :term:`bytes-like object` *s* using the URL- and filesystem-safe " "alphabet, which substitutes ``-`` instead of ``+`` and ``_`` instead of ``/" "`` in the standard Base64 alphabet, and return the encoded :class:`bytes`. " "The result can still contain ``=`` if *padded* is true (default)." msgstr "" +":term:`bytes-like object` *s* を、URL やファイルシステムで安全に使えるアル" +"ファベットでエンコードし、エンコードされた :class:`bytes` を返します。\n" +"このアルファベットは、標準の Base64 アルファベットの ``+`` を ``-`` に、``/" +"`` を ``_`` に置き換えたものです。\n" +"*padded* が真 (デフォルト) の場合、結果には ``=`` が含まれることがあります。" -#: ../../library/base64.rst:150 msgid "Added the *padded* parameter." -msgstr "" +msgstr "*padded* パラメーターが追加されました。" #: ../../library/base64.rst:156 msgid "" @@ -269,15 +291,15 @@ msgstr "" "返します。標準 base64 アルファベットに比べて、``+`` の替わりに ``-`` を、``/" "`` の替わりに ``_`` を置換します。" -#: ../../library/base64.rst:162 msgid "" "Added the *padded* parameter. Padding of input is no longer required by " "default." msgstr "" +"*padded* パラメーターが追加されました。\n" +"デフォルトでは入力のパディングが不要になりました。" -#: ../../library/base64.rst:166 msgid "Accepting the ``+`` and ``/`` characters is now deprecated." -msgstr "" +msgstr "``+`` と ``/`` を受け入れることは非推奨になりました。" #: ../../library/base64.rst:172 msgid "" @@ -287,19 +309,22 @@ msgstr "" "Base32 を使って :term:`bytes-like object` の *s* をエンコードし、エンコードさ" "れた :class:`bytes` を返します。" -#: ../../library/base64.rst:175 msgid "" "If *padded* is true (default), pad the encoded data with the '=' character " "to a size multiple of 8. If *padded* is false, do not add the pad characters." msgstr "" +"*padded* が真 (デフォルト) の場合、エンコードしたデータの長さが 8 の倍数にな" +"るように '=' でパディングします。\n" +"*padded* が偽の場合、パディング文字を追加しません。" -#: ../../library/base64.rst:179 ../../library/base64.rst:256 -#: ../../library/base64.rst:382 ../../library/base64.rst:421 msgid "" "If *wrapcol* is non-zero, insert a newline (``b'\\n'``) character after at " "most every *wrapcol* characters. If *wrapcol* is zero (default), do not add " "any newlines." msgstr "" +"*wrapcol* がゼロでない場合、最大 *wrapcol* 文字ごとに改行文字 (``b'\\n'``) を" +"挿入します。\n" +"*wrapcol* がゼロ (デフォルト) の場合、改行を追加しません。" #: ../../library/base64.rst:189 msgid "" @@ -336,7 +361,6 @@ msgstr "" "ティ上の理由により、これはデフォルトでは ``None`` になっているため、 0 およ" "び 1 は入力として許可されていません。" -#: ../../library/base64.rst:203 msgid "" "If *padded* is true, the last group of 8 base 32 alphabet characters must be " "padded with the '=' character. If *padded* is false, padding is neither " @@ -344,19 +368,26 @@ msgid "" "a non-alphabet character, which means it raises an :exc:`~binascii.Error` " "unless b'=' is included in *ignorechars*." msgstr "" +"*padded* が真の場合、Base32 アルファベットの最後の 8 文字の組には '=' による" +"パディングが必要です。\n" +"*padded* が偽の場合、パディングは不要で、パディングとしての認識もしません。\n" +"'=' はパディングではなくアルファベット外の文字として扱われるため、" +"*ignorechars* に ``b'='`` が含まれていない限り :exc:`~binascii.Error` が発生" +"します。" -#: ../../library/base64.rst:210 ../../library/base64.rst:273 -#: ../../library/base64.rst:397 ../../library/base64.rst:439 msgid "" "*ignorechars* should be a :term:`bytes-like object` containing characters to " "ignore from the input." msgstr "" +"*ignorechars* には、入力から無視する文字を含む :term:`bytes-like object` を指" +"定してください。" -#: ../../library/base64.rst:213 msgid "" "If *canonical* is true, non-zero padding bits are rejected. See :func:" "`binascii.a2b_base32` for details." msgstr "" +"*canonical* が真の場合、ゼロでないパディングビットを拒否します。\n" +"詳しくは :func:`binascii.a2b_base32` を参照してください。" #: ../../library/base64.rst:216 ../../library/base64.rst:276 msgid "" @@ -382,13 +413,16 @@ msgstr "" ":func:`b32decode` に似ていますが、 :rfc:`4648` で定義されているように" "Extended Hex Alphabetを使用します。" -#: ../../library/base64.rst:240 msgid "" "This version does not allow the digit 0 (zero) to the letter O (oh) and " "digit 1 (one) to either the letter I (eye) or letter L (el) mappings, all " "these characters are included in the Extended Hex Alphabet and are not " "interchangeable." msgstr "" +"この方式では、数字の 0 (ゼロ) を文字の O (オー) に、数字の 1 (いち) を文字の " +"I (アイ) または L (エル) に対応付けることはできません。\n" +"これらはすべて Extended Hex Alphabet に含まれる別々の文字で、置き換えられない" +"ためです。" #: ../../library/base64.rst:253 msgid "" @@ -398,10 +432,8 @@ msgstr "" "Base16 を使って :term:`bytes-like object` の *s* をエンコードし、エンコードさ" "れた :class:`bytes` を返します。" -#: ../../library/base64.rst:260 ../../library/base64.rst:388 -#: ../../library/base64.rst:430 msgid "Added the *wrapcol* parameter." -msgstr "" +msgstr "*wrapcol* パラメーターが追加されました。" #: ../../library/base64.rst:266 msgid "" @@ -411,15 +443,13 @@ msgstr "" "Base16 エンコードされた :term:`bytes-like object` または ASCII 文字列 *s* を" "デコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:280 msgid "Added the *ignorechars* parameter." -msgstr "" +msgstr "*ignorechars* パラメーターが追加されました。" #: ../../library/base64.rst:287 msgid "Base85 Encodings" msgstr "Base85 エンコーディング" -#: ../../library/base64.rst:289 msgid "" "Base85 encoding is a family of algorithms which represent four bytes using " "five ASCII characters. Originally implemented in the Unix ``btoa(1)`` " @@ -427,50 +457,53 @@ msgid "" "language and is standardized in PDF 2.0 (ISO 32000-2). This version, in both " "its ``btoa`` and PDF variants, is implemented by :func:`a85encode`." msgstr "" +"Base85 エンコーディングは、4 バイトを 5 つの ASCII 文字で表すアルゴリズム群で" +"す。\n" +"もともとは Unix の ``btoa(1)`` ユーティリティに実装され、その後 Adobe がその" +"一種を PostScript 言語に採用し、PDF 2.0 (ISO 32000-2) で標準化されました。\n" +"この方式の ``btoa`` 版と PDF 版は、どちらも :func:`a85encode` に実装されてい" +"ます。" -#: ../../library/base64.rst:296 msgid "" "A separate version, using a different output character set, was defined as " "an April Fool's joke in :rfc:`1924` but is now used by Git and other " "software. This version is implemented by :func:`b85encode`." msgstr "" +"出力に異なる文字集合を使う別の方式は、エイプリルフールのジョークとして :rfc:" +"`1924` で定義されましたが、現在は Git などのソフトウェアで使われています。\n" +"この方式は :func:`b85encode` に実装されています。" -#: ../../library/base64.rst:300 msgid "" "Finally, a third version, using yet another output character set designed " "for safe inclusion in programming language strings, is defined by ZeroMQ and " "implemented here by :func:`z85encode`." msgstr "" +"さらに、プログラミング言語の文字列に安全に含められるよう設計された、別の出力" +"文字集合を使う 3 番目の方式を ZeroMQ が定義しています。\n" +"この方式は :func:`z85encode` に実装されています。" -#: ../../library/base64.rst:304 msgid "" "The functions present in this module differ in how they handle the following:" -msgstr "" +msgstr "このモジュールの各関数は、次の点の扱いが異なります。" -#: ../../library/base64.rst:306 msgid "Whether to include and expect enclosing ``<~`` and ``~>`` markers." -msgstr "" +msgstr "囲みのマーカー ``<~`` と ``~>`` を出力に含めるか、入力に期待するか。" -#: ../../library/base64.rst:307 msgid "Whether to fold the input into multiple lines." -msgstr "" +msgstr "入力を複数の行に折り返すか。" -#: ../../library/base64.rst:308 msgid "The set of ASCII characters used for encoding." -msgstr "" +msgstr "エンコードに使う ASCII 文字の集合。" -#: ../../library/base64.rst:309 msgid "Compact encodings of sequences of spaces and null bytes." -msgstr "" +msgstr "連続するスペースやヌルバイトの短縮表現。" -#: ../../library/base64.rst:310 msgid "The encoding of zero-padding bytes applied to the input." -msgstr "" +msgstr "入力に加えたゼロパディングのバイトをどうエンコードするか。" -#: ../../library/base64.rst:312 msgid "" "Refer to the documentation of the individual functions for more information." -msgstr "" +msgstr "詳しくは、各関数のドキュメントを参照してください。" msgid "" "Encode the :term:`bytes-like object` *b* using Ascii85 and return the " @@ -479,12 +512,15 @@ msgstr "" "Ascii85 を使って :term:`bytes-like object` の *b* をエンコードし、エンコード" "された :class:`bytes` を返します。" -#: ../../library/base64.rst:319 msgid "" "*foldspaces* is an optional flag that uses the special short sequence 'y' " "instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This " "feature is not supported by the standard encoding used in PDF." msgstr "" +"*foldspaces* は省略可能なフラグです。\n" +"'btoa' と同様に、連続する 4 つのスペース (ASCII 0x20) の代わりに特別な短縮表" +"現 'y' を使います。\n" +"PDF で使われる標準のエンコーディングは、この機能をサポートしていません。" #: ../../library/base64.rst:327 msgid "" @@ -494,13 +530,16 @@ msgid "" "used in PDF, as it does not preserve the length of the data." msgstr "" -#: ../../library/base64.rst:333 msgid "" "*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " "``~>``, as in a PostScript base-85 string literal. Note that while " "ASCII85Decode streams in PDF documents *must* be terminated with ``~>``, " "they *must not* use a leading ``<~``." msgstr "" +"*adobe* は、PostScript の Base85 文字列リテラルのように、エンコードしたバイト" +"列を ``<~`` と ``~>`` で囲むかどうかを制御します。\n" +"PDF 文書の ASCII85Decode ストリームは ``~>`` で終わる *必要があります* が、先" +"頭に ``<~`` を付けては *いけません*。" msgid "" "Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and " @@ -509,19 +548,24 @@ msgstr "" "Ascii85 エンコードされた :term:`bytes-like object` または ASCII 文字列 *b* を" "デコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:346 msgid "" "*foldspaces* is a flag that specifies whether the 'y' short sequence should " "be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature " "is not supported by the standard Ascii85 encoding used in PDF and PostScript." msgstr "" +"*foldspaces* は、短縮表現 'y' を連続する 4 つのスペース (ASCII 0x20) として受" +"け入れるかどうかを指定するフラグです。\n" +"PDF や PostScript で使われる標準の Ascii85 エンコーディングは、この機能をサ" +"ポートしていません。" -#: ../../library/base64.rst:351 msgid "" "*adobe* controls whether the ``<~`` and ``~>`` markers are present. While " "the leading ``<~`` is not required, the input must end with ``~>``, or a :" "exc:`ValueError` is raised." msgstr "" +"*adobe* は、マーカー ``<~`` と ``~>`` の有無を指定します。\n" +"先頭の ``<~`` は必須ではありませんが、入力は ``~>`` で終わる必要があり、そう" +"でなければ :exc:`ValueError` を送出します。" #: ../../library/base64.rst:355 msgid "" @@ -530,17 +574,20 @@ msgid "" "by default contains all whitespace characters in ASCII." msgstr "" -#: ../../library/base64.rst:360 msgid "" "If *canonical* is true, non-canonical encodings are rejected. See :func:" "`binascii.a2b_ascii85` for details." msgstr "" +"*canonical* が真の場合、正規形でないエンコーディングを拒否します。\n" +"詳しくは :func:`binascii.a2b_ascii85` を参照してください。" -#: ../../library/base64.rst:365 msgid "" "Added the *canonical* parameter. Single-character final groups are now " "always rejected as encoding violations." msgstr "" +"*canonical* パラメーターが追加されました。\n" +"最後のグループが 1 文字だけの場合は、エンコーディングの規則に違反するものとし" +"て常に拒否するようになりました。" #: ../../library/base64.rst:373 msgid "" @@ -551,55 +598,67 @@ msgstr "" "て :term:`bytes-like object` の *b* をエンコードし、エンコードされた :class:" "`bytes` を返します。" -#: ../../library/base64.rst:376 msgid "" "The input is padded with ``b'\\0'`` so its length is a multiple of 4 bytes " "before encoding. If *pad* is true, all the resulting characters are " "retained in the output, which will always be a multiple of 5 bytes, and thus " "the length of the data may not be preserved on decoding." msgstr "" +"エンコードの前に、入力の長さが 4 バイトの倍数になるよう ``b'\\0'`` でパディン" +"グします。\n" +"*pad* が真の場合、結果の文字はすべて出力に残るため、出力の長さは常に 5 バイト" +"の倍数になります。\n" +"そのため、デコード時にデータの長さが保たれない場合があります。" -#: ../../library/base64.rst:394 msgid "" "Decode the base85-encoded :term:`bytes-like object` or ASCII string *b* and " "return the decoded :class:`bytes`." msgstr "" +"Base85 でエンコードされた :term:`bytes-like object` または ASCII 文字列 *b* " +"をデコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:400 ../../library/base64.rst:442 msgid "" "If *canonical* is true, non-canonical encodings are rejected. See :func:" "`binascii.a2b_base85` for details." msgstr "" +"*canonical* が真の場合、正規形でないエンコーディングを拒否します。\n" +"詳しくは :func:`binascii.a2b_base85` を参照してください。" -#: ../../library/base64.rst:405 ../../library/base64.rst:447 msgid "" "Added the *canonical* and *ignorechars* parameters. Single-character final " "groups are now always rejected as encoding violations." msgstr "" +"*canonical* と *ignorechars* パラメーターが追加されました。\n" +"最後のグループが 1 文字だけの場合は、エンコーディングの規則に違反するものとし" +"て常に拒否するようになりました。" -#: ../../library/base64.rst:413 msgid "" "Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ) and " "return the encoded :class:`bytes`." msgstr "" +":term:`bytes-like object` *s* を、ZeroMQ で使われる Z85 でエンコードし、エン" +"コードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:416 msgid "" "The input is padded with ``b'\\0'`` so its length is a multiple of 4 bytes " "before encoding. If *pad* is true, all the resulting characters are " "retained in the output, which will always be a multiple of 5 bytes, as " "required by the ZeroMQ standard." msgstr "" +"エンコードの前に、入力の長さが 4 バイトの倍数になるよう ``b'\\0'`` でパディン" +"グします。\n" +"*pad* が真の場合、結果の文字はすべて出力に残るため、ZeroMQ の標準で要求される" +"とおり、出力の長さは常に 5 バイトの倍数になります。" -#: ../../library/base64.rst:427 msgid "The *pad* parameter was added." -msgstr "" +msgstr "*pad* パラメーターが追加されました。" -#: ../../library/base64.rst:436 msgid "" "Decode the Z85-encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`." msgstr "" +"Z85 でエンコードされた :term:`bytes-like object` または ASCII 文字列 *s* をデ" +"コードし、デコードされた :class:`bytes` を返します。" #: ../../library/base64.rst:456 msgid "Legacy Interface" @@ -662,12 +721,14 @@ msgstr "モジュールの使用例:" msgid "Security Considerations" msgstr "セキュリティで考慮すべき点" -#: ../../library/base64.rst:509 msgid "" "A new security considerations section was added to :rfc:`4648` (section 12); " "it's recommended to review the security section for any code deployed to " "production." msgstr "" +":rfc:`4648` に、セキュリティ上の考慮事項をまとめた節 (第 12 節) が新たに追加" +"されました。\n" +"本番環境で使うコードでは、このセキュリティの節を確認することを推奨します。" #: ../../library/base64.rst:514 msgid "Module :mod:`binascii`" @@ -697,28 +758,31 @@ msgstr "" "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "of the base64 encoding." -#: ../../library/base64.rst:521 msgid "" "`ISO 32000-2 Portable document format - Part 2: PDF 2.0 `_" msgstr "" +"`ISO 32000-2 Portable document format - Part 2: PDF 2.0 `_" -#: ../../library/base64.rst:522 msgid "" "Section 7.4.3, \"ASCII85Decode Filter,\" provides the definition of the " "Ascii85 encoding used in PDF and PostScript, including the output character " "set and the details of data length preservation using zero-padding and " "partial output groups." msgstr "" +"第 7.4.3 節 \"ASCII85Decode Filter\" は、PDF と PostScript で使われる " +"Ascii85 エンコーディングを定義しています。\n" +"出力の文字集合のほか、ゼロパディングと部分的な出力グループによってデータ長を" +"保持する方法が詳しく説明されています。" -#: ../../library/base64.rst:527 msgid "`ZeroMQ RFC 32/Z85 `_" -msgstr "" +msgstr "`ZeroMQ RFC 32/Z85 `_" -#: ../../library/base64.rst:528 msgid "" "The \"Formal Specification\" section provides the character set used in Z85." msgstr "" +"\"Formal Specification\" の節は、Z85 で使われる文字集合を定義しています。" #: ../../library/base64.rst:10 msgid "base64" diff --git a/library/bdb.po b/library/bdb.po index 6876d90f8..d46792a2b 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -30,11 +30,12 @@ msgstr ":mod:`!bdb` --- デバッガーフレームワーク" msgid "**Source code:** :source:`Lib/bdb.py`" msgstr "**ソースコード:** :source:`Lib/bdb.py`" -#: ../../library/bdb.rst:11 msgid "" "The :mod:`!bdb` module handles basic debugger functions, like setting " "breakpoints or managing execution via the debugger." msgstr "" +":mod:`!bdb` モジュールは、ブレークポイントの設定やデバッガーを通じた実行の管" +"理など、デバッガーの基本的な機能を扱います。" #: ../../library/bdb.rst:14 msgid "The following exception is defined:" @@ -44,9 +45,8 @@ msgstr "以下の例外が定義されています:" msgid "Exception raised by the :class:`Bdb` class for quitting the debugger." msgstr ":class:`Bdb` クラスが、デバッガーを終了させるために投げる例外。" -#: ../../library/bdb.rst:21 msgid "The :mod:`!bdb` module also defines two classes:" -msgstr "" +msgstr ":mod:`!bdb` モジュールは、次の 2 つのクラスも定義しています。" #: ../../library/bdb.rst:25 msgid "" @@ -110,29 +110,23 @@ msgid "" "formatted:" msgstr "ブレークポイントに関する情報を持つ文字列をフォーマットして返します:" -#: ../../library/bdb.rst:63 msgid "Breakpoint number." -msgstr "" +msgstr "ブレークポイントの番号。" -#: ../../library/bdb.rst:64 msgid "Temporary status (del or keep)." -msgstr "" +msgstr "一時的なブレークポイントかどうか (del または keep)。" -#: ../../library/bdb.rst:65 msgid "File/line position." -msgstr "" +msgstr "ファイルと行の位置。" -#: ../../library/bdb.rst:66 msgid "Break condition." -msgstr "" +msgstr "停止する条件。" -#: ../../library/bdb.rst:67 msgid "Number of times to ignore." -msgstr "" +msgstr "無視する回数。" -#: ../../library/bdb.rst:68 msgid "Number of times hit." -msgstr "" +msgstr "ヒットした回数。" #: ../../library/bdb.rst:74 msgid "" @@ -146,31 +140,29 @@ msgstr "" msgid ":class:`Breakpoint` instances have the following attributes:" msgstr ":class:`Breakpoint` インスタンスは以下の属性を持ちます:" -#: ../../library/bdb.rst:81 msgid "File name of the :class:`Breakpoint`." -msgstr "" +msgstr ":class:`Breakpoint` のファイル名です。" -#: ../../library/bdb.rst:85 msgid "Line number of the :class:`Breakpoint` within :attr:`file`." -msgstr "" +msgstr ":attr:`file` 内での :class:`Breakpoint` の行番号です。" -#: ../../library/bdb.rst:89 msgid "``True`` if a :class:`Breakpoint` at (file, line) is temporary." msgstr "" +"``(file, line)`` の :class:`Breakpoint` が一時的なものであれば ``True`` で" +"す。" -#: ../../library/bdb.rst:93 msgid "Condition for evaluating a :class:`Breakpoint` at (file, line)." -msgstr "" +msgstr "``(file, line)`` の :class:`Breakpoint` を評価する条件です。" -#: ../../library/bdb.rst:97 msgid "" "Function name that defines whether a :class:`Breakpoint` is hit upon " "entering the function." msgstr "" +"関数に入ったときに :class:`Breakpoint` にヒットするかどうかを決める関数名で" +"す。" -#: ../../library/bdb.rst:102 msgid "``True`` if :class:`Breakpoint` is enabled." -msgstr "" +msgstr ":class:`Breakpoint` が有効なら ``True`` です。" #: ../../library/bdb.rst:106 msgid "Numeric index for a single instance of a :class:`Breakpoint`." @@ -182,13 +174,11 @@ msgid "" "`line`) tuples." msgstr "" -#: ../../library/bdb.rst:115 msgid "Number of times to ignore a :class:`Breakpoint`." -msgstr "" +msgstr ":class:`Breakpoint` を無視する回数です。" -#: ../../library/bdb.rst:119 msgid "Count of the number of times a :class:`Breakpoint` has been hit." -msgstr "" +msgstr ":class:`Breakpoint` にヒットした回数です。" #: ../../library/bdb.rst:123 msgid "The :class:`Bdb` class acts as a generic Python debugger base class." @@ -219,7 +209,6 @@ msgstr "" "で発生したかどうかは、フレームのグローバル変数の ``__name__`` によって決定さ" "れます。" -#: ../../library/bdb.rst:135 msgid "" "The *backend* argument specifies the backend to use for :class:`Bdb`. It can " "be either ``'settrace'`` or ``'monitoring'``. ``'settrace'`` uses :func:`sys." @@ -230,14 +219,24 @@ msgid "" "some differences. The debugger developers are encouraged to use the " "``'monitoring'`` backend to achieve better performance." msgstr "" +"*backend* 引数は :class:`Bdb` が使うバックエンドを指定します。\n" +"``'settrace'`` または ``'monitoring'`` を指定できます。\n" +"``'settrace'`` は :func:`sys.settrace` を使い、後方互換性が最も高いバックエン" +"ドです。\n" +"``'monitoring'`` は Python 3.12 で導入された :mod:`sys.monitoring` を使いま" +"す。\n" +"使わないイベントを無効にできるため、大幅に効率がよくなる場合があります。\n" +"両方のバックエンドで同一のインターフェースを保つようにしていますが、いくつか" +"違いがあります。\n" +"性能を高めるため、デバッガーの開発者には ``'monitoring'`` バックエンドの使用" +"を推奨します。" #: ../../library/bdb.rst:145 msgid "Added the *skip* parameter." msgstr "*skip* パラメータが追加されました。" -#: ../../library/bdb.rst:148 msgid "Added the *backend* parameter." -msgstr "" +msgstr "*backend* パラメーターが追加されました。" #: ../../library/bdb.rst:151 msgid "" @@ -245,36 +244,42 @@ msgid "" msgstr "" "以下の :class:`Bdb` のメソッドは、通常オーバーライドする必要はありません。" -#: ../../library/bdb.rst:155 msgid "Return canonical form of *filename*." -msgstr "" +msgstr "*filename* を正規化した形式で返します。" -#: ../../library/bdb.rst:157 msgid "" "For real file names, the canonical form is an operating-system-dependent, :" "func:`case-normalized ` :func:`absolute path `. A *filename* with angle brackets, such as ``\"\"`` " "generated in interactive mode, is returned unchanged." msgstr "" +"実際のファイル名では、正規化された形式とは、OS に応じて :func:`大文字・小文字" +"を正規化した ` :func:`絶対パス ` です。\n" +"対話モードで生成される ``\"\"`` のように山括弧で囲まれた *filename* " +"は、そのまま返します。" -#: ../../library/bdb.rst:164 msgid "" "Start tracing. For ``'settrace'`` backend, this method is equivalent to " "``sys.settrace(self.trace_dispatch)``" msgstr "" +"トレースを開始します。\n" +"``'settrace'`` バックエンドでは、``sys.settrace(self.trace_dispatch)`` と同じ" +"です。" -#: ../../library/bdb.rst:171 msgid "" "Stop tracing. For ``'settrace'`` backend, this method is equivalent to ``sys." "settrace(None)``" msgstr "" +"トレースを停止します。\n" +"``'settrace'`` バックエンドでは、``sys.settrace(None)`` と同じです。" -#: ../../library/bdb.rst:178 msgid "" "Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` and :" "attr:`quitting ` attributes with values ready to start " "debugging." msgstr "" +":attr:`!botframe`、:attr:`!stopframe`、:attr:`!returnframe`、:attr:`quitting " +"` 属性を、デバッグを開始できる値に設定します。" #: ../../library/bdb.rst:183 msgid "" @@ -312,9 +317,8 @@ msgstr "``\"return\"``: 関数か別のコードブロックからreturnしよ msgid "``\"exception\"``: An exception has occurred." msgstr "``\"exception\"``: 例外が発生しました。" -#: ../../library/bdb.rst:196 msgid "For all the events, specialized functions (see below) are called." -msgstr "" +msgstr "各イベントに対応する専用の関数 (後述) を呼び出します。" #: ../../library/bdb.rst:198 msgid "The *arg* parameter depends on the previous event." @@ -330,7 +334,6 @@ msgstr "" "を参照してください。コードとフレームオブジェクトについてのより詳しい情報" "は、 :ref:`types` を参照してください。" -#: ../../library/bdb.rst:206 msgid "" "If the debugger should stop on the current line, invoke the :meth:" "`user_line` method (which should be overridden in subclasses). Raise a :exc:" @@ -338,8 +341,13 @@ msgid "" "(which can be set from :meth:`user_line`). Return a reference to the :meth:" "`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーが現在の行で停止するべきなら、:meth:`user_line` メソッドを呼び出し" +"ます (サブクラスでオーバーライドしてください)。\n" +":attr:`quitting ` フラグが設定されていれば :exc:`BdbQuit` を送" +"出します (このフラグは :meth:`user_line` から設定できます)。\n" +"そのスコープ内のトレースを続けるために、:meth:`trace_dispatch` メソッドへの参" +"照を返します。" -#: ../../library/bdb.rst:214 msgid "" "If the debugger should stop on this function call, invoke the :meth:" "`user_call` method (which should be overridden in subclasses). Raise a :exc:" @@ -347,8 +355,13 @@ msgid "" "(which can be set from :meth:`user_call`). Return a reference to the :meth:" "`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーがこの関数呼び出しで停止するべきなら、:meth:`user_call` メソッドを" +"呼び出します (サブクラスでオーバーライドしてください)。\n" +":attr:`quitting ` フラグが設定されていれば :exc:`BdbQuit` を送" +"出します (このフラグは :meth:`user_call` から設定できます)。\n" +"そのスコープ内のトレースを続けるために、:meth:`trace_dispatch` メソッドへの参" +"照を返します。" -#: ../../library/bdb.rst:222 msgid "" "If the debugger should stop on this function return, invoke the :meth:" "`user_return` method (which should be overridden in subclasses). Raise a :" @@ -356,8 +369,13 @@ msgid "" "(which can be set from :meth:`user_return`). Return a reference to the :" "meth:`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーがこの関数からのリターンで停止するべきなら、:meth:`user_return` メ" +"ソッドを呼び出します (サブクラスでオーバーライドしてください)。\n" +":attr:`quitting ` フラグが設定されていれば :exc:`BdbQuit` を送" +"出します (このフラグは :meth:`user_return` から設定できます)。\n" +"そのスコープ内のトレースを続けるために、:meth:`trace_dispatch` メソッドへの参" +"照を返します。" -#: ../../library/bdb.rst:230 msgid "" "If the debugger should stop at this exception, invokes the :meth:" "`user_exception` method (which should be overridden in subclasses). Raise a :" @@ -365,6 +383,12 @@ msgid "" "(which can be set from :meth:`user_exception`). Return a reference to the :" "meth:`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーがこの例外で停止するべきなら、:meth:`user_exception` メソッドを呼び" +"出します (サブクラスでオーバーライドしてください)。\n" +":attr:`quitting ` フラグが設定されていれば :exc:`BdbQuit` を送" +"出します (このフラグは :meth:`user_exception` から設定できます)。\n" +"そのスコープ内のトレースを続けるために、:meth:`trace_dispatch` メソッドへの参" +"照を返します。" #: ../../library/bdb.rst:236 msgid "" @@ -374,27 +398,30 @@ msgstr "" "通常、継承クラスは以下のメソッド群をオーバーライドしません。しかし、停止やブ" "レークポイント機能を再定義したい場合には、オーバーライドすることもあります。" -#: ../../library/bdb.rst:241 msgid "Return ``True`` if *module_name* matches any skip pattern." msgstr "" +"*module_name* がいずれかのスキップパターンにマッチすれば ``True`` を返しま" +"す。" #: ../../library/bdb.rst:245 msgid "Return ``True`` if *frame* is below the starting frame in the stack." msgstr "" -#: ../../library/bdb.rst:249 msgid "Return ``True`` if there is an effective breakpoint for this line." -msgstr "" +msgstr "この行に実際に停止するブレークポイントがあれば ``True`` を返します。" -#: ../../library/bdb.rst:251 msgid "" "Check whether a line or function breakpoint exists and is in effect. Delete " "temporary breakpoints based on information from :func:`effective`." msgstr "" +"行または関数のブレークポイントが存在し、実際に停止するかどうかを確認しま" +"す。\n" +":func:`effective` の情報に基づいて、一時的なブレークポイントを削除します。" -#: ../../library/bdb.rst:256 msgid "Return ``True`` if any breakpoint exists for *frame*'s filename." msgstr "" +"*frame* のファイル名に対してブレークポイントが 1 つでもあれば ``True`` を返し" +"ます。" #: ../../library/bdb.rst:258 msgid "" @@ -404,17 +431,19 @@ msgstr "" "継承クラスはデバッガー操作をするために以下のメソッド群をオーバーライドするべ" "きです。" -#: ../../library/bdb.rst:263 msgid "" "Called from :meth:`dispatch_call` if a break might stop inside the called " "function." msgstr "" +"呼び出された関数内で停止する可能性がある場合、:meth:`dispatch_call` から呼び" +"出されます。" -#: ../../library/bdb.rst:266 msgid "" "*argument_list* is not used anymore and will always be ``None``. The " "argument is kept for backwards compatibility." msgstr "" +"*argument_list* は現在使われておらず、常に ``None`` です。\n" +"後方互換性のために残されています。" #: ../../library/bdb.rst:271 msgid "" @@ -486,11 +515,12 @@ msgstr "" "*frame* からデバッグを開始します。*frame* が指定されなかった場合、デバッグは" "呼び出し元のフレームから開始します。" -#: ../../library/bdb.rst:315 msgid "" ":func:`set_trace` will enter the debugger immediately, rather than on the " "next line of code to be executed." msgstr "" +":func:`set_trace` は、次に実行されるコードの行を待たずに、直ちにデバッガに入" +"るようになりました。" #: ../../library/bdb.rst:321 msgid "" @@ -500,11 +530,13 @@ msgstr "" "ブレークポイントに到達するか終了したときにストップします。もしブレークポイン" "トが1つも無い場合、システムのトレース関数を ``None`` に設定します。" -#: ../../library/bdb.rst:328 msgid "" "Set the :attr:`!quitting` attribute to ``True``. This raises :exc:`BdbQuit` " "in the next call to one of the :meth:`!dispatch_\\*` methods." msgstr "" +":attr:`!quitting` 属性を ``True`` に設定します。\n" +"これにより、次にいずれかの :meth:`!dispatch_\\*` メソッドを呼び出すと :exc:" +"`BdbQuit` が送出されます。" #: ../../library/bdb.rst:332 msgid "" @@ -570,9 +602,9 @@ msgstr "" "ら数値に変換されます。 *arg* が非数値の文字列である場合、指定されたブレークポ" "イントが存在しないか削除された場合、 :exc:`ValueError` が上げられます。" -#: ../../library/bdb.rst:374 msgid "Return ``True`` if there is a breakpoint for *lineno* in *filename*." msgstr "" +"*filename* の *lineno* 行にブレークポイントがあれば ``True`` を返します。" #: ../../library/bdb.rst:378 msgid "" @@ -592,27 +624,36 @@ msgstr "" msgid "Return all breakpoints that are set." msgstr "セットされているすべてのブレークポイントを返します。" -#: ../../library/bdb.rst:390 msgid "" "Derived classes and clients can call the following methods to disable and " "restart events to achieve better performance. These methods only work when " "using the ``'monitoring'`` backend." msgstr "" +"派生クラスやクライアントは、次のメソッドでイベントを無効にしたり再開したりし" +"て、性能を高められます。\n" +"これらのメソッドが機能するのは ``'monitoring'`` バックエンドを使う場合だけで" +"す。" -#: ../../library/bdb.rst:396 msgid "" "Disable the current event until the next time :func:`restart_events` is " "called. This is helpful when the debugger is not interested in the current " "line." msgstr "" +"次に :func:`restart_events` が呼び出されるまで、現在のイベントを無効にしま" +"す。\n" +"デバッガーが現在の行を調べる必要がない場合に役立ちます。" -#: ../../library/bdb.rst:404 msgid "" "Restart all the disabled events. This function is automatically called in " "``dispatch_*`` methods after ``user_*`` methods are called. If the " "``dispatch_*`` methods are not overridden, the disabled events will be " "restarted after each user interaction." msgstr "" +"無効にしたすべてのイベントを再開します。\n" +"この関数は ``dispatch_*`` メソッド内で、``user_*`` メソッドの呼び出し後に自動" +"的に呼び出されます。\n" +"``dispatch_*`` メソッドをオーバーライドしていなければ、ユーザーとのやりとりの" +"たびに、無効にしたイベントが再開されます。" #: ../../library/bdb.rst:412 msgid "" @@ -632,15 +673,16 @@ msgid "" "of frames below the frame where the debugger was invoked." msgstr "" -#: ../../library/bdb.rst:424 msgid "" "Return a string with information about a stack entry, which is a ``(frame, " "lineno)`` tuple. The return string contains:" msgstr "" +"スタックのエントリーを表す ``(frame, lineno)`` タプルについての情報を文字列で" +"返します。\n" +"返す文字列には次の情報を含みます。" -#: ../../library/bdb.rst:427 msgid "The canonical filename which contains the frame." -msgstr "" +msgstr "フレームを含むファイルの正規化された名前。" #: ../../library/bdb.rst:428 msgid "The function name or ``\"\"``." @@ -666,11 +708,13 @@ msgstr "" "以下の2つのメソッドは、文字列として渡された :term:`文 ` をデバッグ" "するもので、クライアントから利用されます。" -#: ../../library/bdb.rst:439 msgid "" "Debug a statement executed via the :func:`exec` function. *globals* " "defaults to :attr:`!__main__.__dict__`, *locals* defaults to *globals*." msgstr "" +":func:`exec` 関数で実行する文をデバッグします。\n" +"*globals* のデフォルトは :attr:`!__main__.__dict__`、*locals* のデフォルトは " +"*globals* です。" #: ../../library/bdb.rst:444 msgid "" @@ -680,9 +724,10 @@ msgstr "" ":func:`eval` 関数を利用して式を実行しデバッグします。 *globals* と *locals* " "は :meth:`run` と同じ意味です。" -#: ../../library/bdb.rst:449 msgid "For backwards compatibility. Calls the :meth:`run` method." -msgstr "後方互換性のためのメソッドです。 :meth:`run` を使ってください。" +msgstr "" +"後方互換性のためのメソッドです。\n" +":meth:`run` メソッドを呼び出します。" #: ../../library/bdb.rst:453 msgid "Debug a single function call, and return its result." @@ -692,13 +737,13 @@ msgstr "1つの関数呼び出しをデバッグし、その結果を返しま msgid "Finally, the module defines the following functions:" msgstr "最後に、このモジュールは以下の関数を提供しています:" -#: ../../library/bdb.rst:460 msgid "" "Return ``True`` if we should break here, depending on the way the :class:" "`Breakpoint` *b* was set." msgstr "" +":class:`Breakpoint` *b* の設定に基づき、この位置で停止するべきなら ``True`` " +"を返します。" -#: ../../library/bdb.rst:463 msgid "" "If it was set via line number, it checks if :attr:`b.line ` is the same as the one in *frame*. If the breakpoint was set via :" @@ -706,14 +751,19 @@ msgid "" "the right *frame* (the right function) and if we are on its first executable " "line." msgstr "" +"行番号で設定されたブレークポイントでは、:attr:`b.line ` " +"と *frame* の行番号が同じかどうかを確認します。\n" +":attr:`関数名 ` で設定された場合は、正しい *frame* " +"(正しい関数) 内にいて、その関数の最初の実行可能な行にいるかどうかを確認する必" +"要があります。" -#: ../../library/bdb.rst:472 msgid "" "Return ``(active breakpoint, delete temporary flag)`` or ``(None, None)`` as " "the breakpoint to act upon." msgstr "" +"停止に使うブレークポイントとして ``(active breakpoint, delete temporary " +"flag)``、または ``(None, None)`` を返します。" -#: ../../library/bdb.rst:475 msgid "" "The *active breakpoint* is the first entry in :attr:`bplist ` for the (:attr:`file `, :attr:`line ` cannot be evaluated (in which case, :attr:`ignore ` count is ignored)." msgstr "" +"*active breakpoint* は、存在する (:attr:`file `、:attr:" +"`line `) に対応する :attr:`bplist ` のうち、次の条件を満たす最初のエントリーです。\n" +":attr:`有効 ` で、:func:`checkfuncname` が真を返し、:" +"attr:`条件 ` が偽ではなく、:attr:`無視する回数 ` が正でもないことが条件です。\n" +"一時的なブレークポイントを削除すべきことを表す *flag* が ``False`` になるの" +"は、:attr:`cond ` を評価できない場合だけです (この場" +"合、:attr:`無視する回数 ` は考慮しません)。" -#: ../../library/bdb.rst:486 msgid "If no such entry exists, then ``(None, None)`` is returned." -msgstr "" +msgstr "該当するエントリーがなければ ``(None, None)`` を返します。" #: ../../library/bdb.rst:491 msgid "Start debugging with a :class:`Bdb` instance from caller's frame." @@ -736,6 +794,5 @@ msgstr "" ":class:`Bdb` クラスのインスタンスを使って、呼び出し元のフレームからデバッグを" "開始します。" -#: ../../library/bdb.rst:326 msgid "quitting (bdb.Bdb attribute)" -msgstr "" +msgstr "quitting (bdb.Bdb の属性)" diff --git a/library/binascii.po b/library/binascii.po index d2ba363ef..ed1161d00 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -26,7 +26,6 @@ msgstr "" msgid ":mod:`!binascii` --- Convert between binary and ASCII" msgstr ":mod:`!binascii` --- バイナリ と ASCII 間の変換" -#: ../../library/binascii.rst:13 msgid "" "The :mod:`!binascii` module contains a number of methods to convert between " "binary and various ASCII-encoded binary representations. Normally, you will " @@ -34,6 +33,12 @@ msgid "" "instead. The :mod:`!binascii` module contains low-level functions written in " "C for greater speed that are used by the higher-level modules." msgstr "" +":mod:`!binascii` モジュールは、バイナリデータと、ASCII でエンコードされたさま" +"ざまなバイナリ表現との間で変換するための関数を提供します。\n" +"通常はこれらの関数を直接使わず、:mod:`base64` などのラッパーモジュールを使い" +"ます。\n" +":mod:`!binascii` は、高水準のモジュールから使われる低水準の関数を含んでおり、" +"高速化のために C で実装されています。" #: ../../library/binascii.rst:22 msgid "" @@ -52,9 +57,8 @@ msgid "ASCII-only unicode strings are now accepted by the ``a2b_*`` functions." msgstr "" "``a2b_*`` 関数は ASCII のみのユニコード文字列を受け取るようになりました。" -#: ../../library/binascii.rst:31 msgid "The :mod:`!binascii` module defines the following functions:" -msgstr "" +msgstr ":mod:`!binascii` モジュールは次の関数を定義しています。" msgid "" "Convert a single line of uuencoded data back to binary and return the binary " @@ -66,13 +70,16 @@ msgstr "" "最後の行を除いて、通常 1 行には (バイナリデータで) 45 バイトが含まれます。\n" "行データの後ろには空白文字が続いていてもかまいません。" -#: ../../library/binascii.rst:43 msgid "" "Convert binary data to a line of ASCII characters, the return value is the " "converted line, including a newline char. The length of *data* should be at " "most 45. If *backtick* is true, zeros are represented by ``'`'`` instead of " "spaces." msgstr "" +"バイナリデータを 1 行の ASCII 文字列に変換し、改行文字を含む変換結果を返しま" +"す。\n" +"*data* の長さは 45 以下でなければなりません。\n" +"*backtick* が真の場合、ゼロをスペースではなく ``'`'`` で表します。" #: ../../library/binascii.rst:47 msgid "Added the *backtick* parameter." @@ -86,13 +93,13 @@ msgstr "" "base64 でエンコードされたデータのブロックをバイナリに変換し、変換後のバイナリ" "データを返します。一度に 1 行以上のデータを与えてもかまいません。" -#: ../../library/binascii.rst:57 msgid "" "Optional *alphabet* must be a :class:`bytes` object of length 64 which " "specifies an alternative alphabet." msgstr "" +"省略可能な *alphabet* には、代替アルファベットを指定する長さ 64 の :class:" +"`bytes` オブジェクトを渡してください。" -#: ../../library/binascii.rst:60 msgid "" "If *padded* is true, the last group of 4 base 64 alphabet characters must be " "padded with the '=' character. If *padded* is false, padding is neither " @@ -101,8 +108,14 @@ msgid "" "*strict_mode* is false, or causes an :exc:`~binascii.Error` when " "*strict_mode* is true unless b'=' is included in *ignorechars*." msgstr "" +"*padded* が真の場合、Base64 アルファベットの最後の 4 文字の組には '=' による" +"パディングが必要です。\n" +"*padded* が偽の場合、パディングは不要で、パディングとしての認識もしません。\n" +"'=' はパディングではなくアルファベット外の文字として扱われるため、" +"*strict_mode* が偽なら黙って破棄されます。\n" +"*strict_mode* が真なら、*ignorechars* に ``b'='`` が含まれていない限り :exc:" +"`~binascii.Error` が発生します。" -#: ../../library/binascii.rst:68 msgid "" "If *ignorechars* is specified, it should be a :term:`bytes-like object` " "containing characters to ignore from the input when *strict_mode* is true. " @@ -111,90 +124,96 @@ msgid "" "will be ignored. The default value of *strict_mode* is ``True`` if " "*ignorechars* is specified, ``False`` otherwise." msgstr "" +"*ignorechars* を指定する場合は、*strict_mode* が真のときに入力から無視する文" +"字を含む :term:`bytes-like object` を渡してください。\n" +"*ignorechars* にパディング文字 ``'='`` を含めると、エンコードされたデータの末" +"尾より前に現れるパディング文字や、余分なパディング文字を無視します。\n" +"*strict_mode* のデフォルト値は、*ignorechars* を指定した場合は ``True``、それ" +"以外は ``False`` です。" -#: ../../library/binascii.rst:76 msgid "" "If *strict_mode* is true, only valid base64 data will be converted. Invalid " "base64 data will raise :exc:`binascii.Error`." msgstr "" +"*strict_mode* が真の場合、有効な Base64 データのみ変換します。\n" +"無効な Base64 データでは :exc:`binascii.Error` を送出します。" -#: ../../library/binascii.rst:79 msgid "Valid base64:" -msgstr "" +msgstr "有効な Base64 データの条件:" -#: ../../library/binascii.rst:81 msgid "Conforms to :rfc:`4648`." -msgstr "" +msgstr ":rfc:`4648` に準拠している。" -#: ../../library/binascii.rst:82 msgid "Contains only characters from the base64 alphabet." -msgstr "" +msgstr "Base64 アルファベットの文字だけを含む。" -#: ../../library/binascii.rst:83 msgid "" "Contains no excess data after padding (including excess padding, newlines, " "etc.)." msgstr "" +"パディングの後に余分なデータ (余分なパディングや改行などを含む) がない。" -#: ../../library/binascii.rst:84 msgid "Does not start with a padding." -msgstr "" +msgstr "パディングで始まらない。" -#: ../../library/binascii.rst:86 msgid "" "If *canonical* is true, non-zero padding bits in the last group are rejected " "with :exc:`binascii.Error`, enforcing canonical encoding as defined in :rfc:" "`4648` section 3.5. This check is independent of *strict_mode*." msgstr "" +"*canonical* が真の場合、最後のグループのゼロでないパディングビットを :exc:" +"`binascii.Error` で拒否し、:rfc:`4648` の第 3.5 節で定義された正規形のエン" +"コーディングを要求します。\n" +"この検査は *strict_mode* とは独立しています。" -#: ../../library/binascii.rst:90 msgid "Added the *strict_mode* parameter." -msgstr "" +msgstr "*strict_mode* パラメーターが追加されました。" -#: ../../library/binascii.rst:93 msgid "" "Added the *alphabet*, *canonical*, *ignorechars*, and *padded* parameters." msgstr "" +"*alphabet*、*canonical*、*ignorechars*、*padded* パラメーターが追加されまし" +"た。" -#: ../../library/binascii.rst:99 msgid "" "Convert binary data to a line(s) of ASCII characters in base64 coding, as " "specified in :rfc:`4648`." msgstr "" +"バイナリデータを、:rfc:`4648` で規定された Base64 エンコーディングで、1 行以" +"上の ASCII 文字列に変換します。" -#: ../../library/binascii.rst:102 msgid "" "If *padded* is true (default), pad the encoded data with the '=' character " "to a size multiple of 4. If *padded* is false, do not add the pad characters." msgstr "" +"*padded* が真 (デフォルト) の場合、エンコードしたデータの長さが 4 の倍数にな" +"るように '=' でパディングします。\n" +"*padded* が偽の場合、パディング文字を追加しません。" -#: ../../library/binascii.rst:106 ../../library/binascii.rst:166 -#: ../../library/binascii.rst:219 ../../library/binascii.rst:280 msgid "" "If *wrapcol* is non-zero, insert a newline (``b'\\n'``) character after at " "most every *wrapcol* characters. If *wrapcol* is zero (default), do not " "insert any newlines." msgstr "" +"*wrapcol* がゼロでない場合、最大 *wrapcol* 文字ごとに改行文字 (``b'\\n'``) を" +"挿入します。\n" +"*wrapcol* がゼロ (デフォルト) の場合、改行を挿入しません。" -#: ../../library/binascii.rst:110 msgid "" "If *newline* is true (default), a newline character will be added at the end " "of the output." -msgstr "" +msgstr "*newline* が真 (デフォルト) の場合、出力の末尾に改行文字を追加します。" #: ../../library/binascii.rst:113 msgid "Added the *newline* parameter." msgstr "パラメータに *newline* を追加しました。" -#: ../../library/binascii.rst:116 msgid "Added the *alphabet*, *padded* and *wrapcol* parameters." -msgstr "" +msgstr "*alphabet*、*padded*、*wrapcol* パラメーターが追加されました。" -#: ../../library/binascii.rst:122 msgid "Convert Ascii85 data back to binary and return the binary data." -msgstr "" +msgstr "Ascii85 データをバイナリに戻し、バイナリデータを返します。" -#: ../../library/binascii.rst:124 msgid "" "Valid Ascii85 data contains characters from the Ascii85 alphabet in groups " "of five (except for the final group, which may have from two to five " @@ -204,6 +223,14 @@ msgid "" "bytes. A single-character final group is always rejected as an encoding " "violation." msgstr "" +"有効な Ascii85 データは、Ascii85 アルファベットの文字を 5 文字ずつのグループ" +"にしたものです (最後のグループは 2~5 文字でもかまいません)。\n" +"各グループは ``0`` から ``2 ** 32 - 1`` までの範囲の 32 ビットのバイナリデー" +"タを表します。\n" +"特別な文字 ``z`` は、連続する 4 つのヌルバイトを表すグループ ``!!!!!`` の短縮" +"形として受け入れられます。\n" +"最後のグループが 1 文字だけの場合は、エンコーディングの規則に違反するものとし" +"て常に拒否します。" #: ../../library/binascii.rst:132 msgid "" @@ -215,21 +242,26 @@ msgstr "" "0x20)と解釈するかどうかを制御します。この機能は \"標準\" Ascii85 ではサポート" "されていません。" -#: ../../library/binascii.rst:136 msgid "" "*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " "``~>``, as in a PostScript base-85 string literal. If *adobe* is true, a " "leading ``<~`` is optionally accepted, while a trailing ``~>`` is " "*required*, and :exc:`binascii.Error` is raised if it is not found." msgstr "" +"*adobe* は、PostScript の Base85 文字列リテラルのように、エンコードされたバイ" +"ト列が ``<~`` と ``~>`` で囲まれているかどうかを指定します。\n" +"*adobe* が真の場合、先頭の ``<~`` は省略できますが、末尾の ``~>`` は *必須* " +"です。\n" +"末尾のマーカーがなければ :exc:`binascii.Error` を送出します。" -#: ../../library/binascii.rst:142 msgid "" "*ignorechars* should be a :term:`bytes-like object` containing characters to " "ignore from the input. This should only contain whitespace characters." msgstr "" +"*ignorechars* には、入力から無視する文字を含む :term:`bytes-like object` を指" +"定してください。\n" +"空白文字だけを含めるようにしてください。" -#: ../../library/binascii.rst:146 msgid "" "If *canonical* is true, non-canonical encodings are rejected with :exc:" "`binascii.Error`. Here \"canonical\" means the encoding that :func:" @@ -237,16 +269,21 @@ msgid "" "zero groups (rather than ``!!!!!``), and partial final groups must use the " "same padding digits as the encoder." msgstr "" +"*canonical* が真の場合、正規形でないエンコーディングを :exc:`binascii.Error` " +"で拒否します。\n" +"ここで「正規形」とは、:func:`b2a_ascii85` が生成するエンコーディングです。\n" +"すべてゼロのグループには ``!!!!!`` ではなく短縮形 ``z`` を使い、最後の不完全" +"なグループにはエンコーダーと同じパディング桁を使う必要があります。" -#: ../../library/binascii.rst:152 msgid "Invalid Ascii85 data will raise :exc:`binascii.Error`." -msgstr "" +msgstr "無効な Ascii85 データでは :exc:`binascii.Error` を送出します。" -#: ../../library/binascii.rst:159 msgid "" "Convert binary data to a formatted sequence of ASCII characters in Ascii85 " "coding. The return value is the converted data." msgstr "" +"バイナリデータを Ascii85 エンコーディングで整形された ASCII 文字列に変換し、" +"変換結果を返します。" #: ../../library/binascii.rst:162 msgid "" @@ -266,21 +303,24 @@ msgid "" "used in PDF, as it does not preserve the length of the data." msgstr "" -#: ../../library/binascii.rst:176 msgid "" "*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " "``~>``, as in a PostScript base-85 string literal. Note that while " "ASCII85Decode streams in PDF documents *must* be terminated with ``~>``, " "they *must not* use a leading ``<~``." msgstr "" +"*adobe* は、PostScript の Base85 文字列リテラルのように、エンコードしたバイト" +"列を ``<~`` と ``~>`` で囲むかどうかを制御します。\n" +"PDF 文書の ASCII85Decode ストリームは ``~>`` で終わる *必要があります* が、先" +"頭に ``<~`` を付けては *いけません*。" -#: ../../library/binascii.rst:186 msgid "" "Convert Base85 data back to binary and return the binary data. More than one " "line may be passed at a time." msgstr "" +"Base85 データをバイナリに戻し、バイナリデータを返します。\n" +"一度に複数行を渡すこともできます。" -#: ../../library/binascii.rst:189 msgid "" "Valid Base85 data contains characters from the Base85 alphabet in groups of " "five (except for the final group, which may have from two to five " @@ -288,119 +328,151 @@ msgid "" "``0`` to ``2 ** 32 - 1``, inclusive. A single-character final group is " "always rejected as an encoding violation." msgstr "" +"有効な Base85 データは、Base85 アルファベットの文字を 5 文字ずつのグループに" +"したものです (最後のグループは 2~5 文字でもかまいません)。\n" +"各グループは ``0`` から ``2 ** 32 - 1`` までの範囲の 32 ビットのバイナリデー" +"タを表します。\n" +"最後のグループが 1 文字だけの場合は、エンコーディングの規則に違反するものとし" +"て常に拒否します。" -#: ../../library/binascii.rst:195 msgid "" "Optional *alphabet* must be a :class:`bytes` object of length 85 which " "specifies an alternative alphabet." msgstr "" +"省略可能な *alphabet* には、代替アルファベットを指定する長さ 85 の :class:" +"`bytes` オブジェクトを渡してください。" -#: ../../library/binascii.rst:198 ../../library/binascii.rst:367 msgid "" "*ignorechars* should be a :term:`bytes-like object` containing characters to " "ignore from the input." msgstr "" +"*ignorechars* には、入力から無視する文字を含む :term:`bytes-like object` を指" +"定してください。" -#: ../../library/binascii.rst:201 msgid "" "If *canonical* is true, non-canonical encodings are rejected with :exc:" "`binascii.Error`. Here \"canonical\" means the encoding that :func:" "`b2a_base85` would produce: partial final groups must use the same padding " "digits as the encoder." msgstr "" +"*canonical* が真の場合、正規形でないエンコーディングを :exc:`binascii.Error` " +"で拒否します。\n" +"ここで「正規形」とは、:func:`b2a_base85` が生成するエンコーディングです。\n" +"最後の不完全なグループには、エンコーダーと同じパディング桁を使う必要がありま" +"す。" -#: ../../library/binascii.rst:206 msgid "Invalid Base85 data will raise :exc:`binascii.Error`." -msgstr "" +msgstr "無効な Base85 データでは :exc:`binascii.Error` を送出します。" -#: ../../library/binascii.rst:213 msgid "" "Convert binary data to a line of ASCII characters in Base85 coding. The " "return value is the converted line." msgstr "" +"バイナリデータを Base85 エンコーディングで 1 行の ASCII 文字列に変換し、その" +"行を返します。" -#: ../../library/binascii.rst:216 msgid "" "Optional *alphabet* must be a :term:`bytes-like object` of length 85 which " "specifies an alternative alphabet." msgstr "" +"省略可能な *alphabet* には、代替アルファベットを指定する長さ 85 の :term:" +"`bytes-like object` を渡してください。" -#: ../../library/binascii.rst:223 msgid "" "If *pad* is true, the zero-padding applied to the end of the input is " "retained in the output, which will always be a multiple of 5 bytes, and thus " "the length of the data may not be preserved on decoding." msgstr "" +"*pad* が真の場合、入力の末尾に加えたゼロパディングを出力に残すため、出力の長" +"さは常に 5 バイトの倍数になります。\n" +"そのため、デコード時にデータの長さが保たれない場合があります。" -#: ../../library/binascii.rst:233 msgid "Convert base32 data back to binary and return the binary data." -msgstr "" +msgstr "Base32 データをバイナリに戻し、バイナリデータを返します。" -#: ../../library/binascii.rst:235 msgid "" "Valid base32 data contains characters from the base32 alphabet specified in :" "rfc:`4648` in groups of eight (if necessary, the final group is padded to " "eight characters with ``=``). Each group encodes 40 bits of binary data in " "the range from ``0`` to ``2 ** 40 - 1``, inclusive." msgstr "" +"有効な Base32 データは、:rfc:`4648` で規定された Base32 アルファベットの文字" +"を 8 文字ずつのグループにしたものです (必要なら、最後のグループを ``=`` で 8 " +"文字までパディングします)。\n" +"各グループは ``0`` から ``2 ** 40 - 1`` までの範囲の 40 ビットのバイナリデー" +"タを表します。" -#: ../../library/binascii.rst:241 msgid "" "This function does not map lowercase characters (which are invalid in " "standard base32) to their uppercase counterparts, nor does it contextually " "map ``0`` to ``O`` and ``1`` to ``I``/``L`` as :rfc:`4648` allows." msgstr "" +"この関数は、標準の Base32 では無効な小文字を大文字に変換しません。\n" +"また、:rfc:`4648` で許可されている、文脈に応じた ``0`` から ``O`` への変換や " +"``1`` から ``I`` または ``L`` への変換も行いません。" -#: ../../library/binascii.rst:246 msgid "" "Optional *alphabet* must be a :class:`bytes` object of length 32 which " "specifies an alternative alphabet." msgstr "" +"省略可能な *alphabet* には、代替アルファベットを指定する長さ 32 の :class:" +"`bytes` オブジェクトを渡してください。" -#: ../../library/binascii.rst:249 msgid "" "If *padded* is true, the last group of 8 base 32 alphabet characters must be " "padded with the '=' character. If *padded* is false, the '=' character is " "treated as other non-alphabet characters (depending on the value of " "*ignorechars*)." msgstr "" +"*padded* が真の場合、Base32 アルファベットの最後の 8 文字の組には '=' による" +"パディングが必要です。\n" +"*padded* が偽の場合、'=' は他のアルファベット外の文字と同様に、*ignorechars* " +"の値に応じて扱われます。" -#: ../../library/binascii.rst:254 msgid "" "*ignorechars* should be a :term:`bytes-like object` containing characters to " "ignore from the input. If *ignorechars* contains the pad character ``'='``, " "the pad characters presented before the end of the encoded data and the " "excess pad characters will be ignored." msgstr "" +"*ignorechars* には、入力から無視する文字を含む :term:`bytes-like object` を指" +"定してください。\n" +"*ignorechars* にパディング文字 ``'='`` を含めると、エンコードされたデータの末" +"尾より前に現れるパディング文字や、余分なパディング文字を無視します。" -#: ../../library/binascii.rst:260 msgid "" "If *canonical* is true, non-zero padding bits in the last group are rejected " "with :exc:`binascii.Error`, enforcing canonical encoding as defined in :rfc:" "`4648` section 3.5." msgstr "" +"*canonical* が真の場合、最後のグループのゼロでないパディングビットを :exc:" +"`binascii.Error` で拒否し、:rfc:`4648` の第 3.5 節で定義された正規形のエン" +"コーディングを要求します。" -#: ../../library/binascii.rst:264 msgid "Invalid base32 data will raise :exc:`binascii.Error`." -msgstr "" +msgstr "無効な Base32 データでは :exc:`binascii.Error` を送出します。" -#: ../../library/binascii.rst:270 msgid "" "Convert binary data to a line of ASCII characters in base32 coding, as " "specified in :rfc:`4648`. The return value is the converted line." msgstr "" +"バイナリデータを、:rfc:`4648` で規定された Base32 エンコーディングで 1 行の " +"ASCII 文字列に変換し、その行を返します。" -#: ../../library/binascii.rst:273 msgid "" "Optional *alphabet* must be a :term:`bytes-like object` of length 32 which " "specifies an alternative alphabet." msgstr "" +"省略可能な *alphabet* には、代替アルファベットを指定する長さ 32 の :term:" +"`bytes-like object` を渡してください。" -#: ../../library/binascii.rst:276 msgid "" "If *padded* is true (default), pad the encoded data with the '=' character " "to a size multiple of 8. If *padded* is false, do not add the pad characters." msgstr "" +"*padded* が真 (デフォルト) の場合、エンコードしたデータの長さが 8 の倍数にな" +"るように '=' でパディングします。\n" +"*padded* が偽の場合、パディング文字を追加しません。" #: ../../library/binascii.rst:288 msgid "" @@ -464,7 +536,6 @@ msgstr "" "アルゴリズムとして設計されたもので、一般的なハッシュアルゴリズムには向きませ" "ん。以下のようにして使います::" -#: ../../library/binascii.rst:322 msgid "" "print(binascii.crc32(b\"hello world\"))\n" "# Or, in two pieces:\n" @@ -472,10 +543,14 @@ msgid "" "crc = binascii.crc32(b\" world\", crc)\n" "print('crc32 = {:#010x}'.format(crc))" msgstr "" +"print(binascii.crc32(b\"hello world\"))\n" +"# または、2 つに分けて計算する:\n" +"crc = binascii.crc32(b\"hello\")\n" +"crc = binascii.crc32(b\" world\", crc)\n" +"print('crc32 = {:#010x}'.format(crc))" -#: ../../library/binascii.rst:328 msgid "The result is always unsigned." -msgstr "" +msgstr "結果は常に符号なしになりました。" #: ../../library/binascii.rst:334 msgid "" @@ -487,19 +562,24 @@ msgstr "" "表現に変換されます。したがって、返されるバイトオブジェクトは *data* の2倍の長" "さになります。" -#: ../../library/binascii.rst:338 msgid "" "Similar functionality (but returning a text string) is also conveniently " "accessible using the :meth:`bytes.hex` method." msgstr "" +"同様の機能は :meth:`bytes.hex` メソッドからも手軽に使えます (ただしテキスト文" +"字列を返します)。" -#: ../../library/binascii.rst:341 msgid "" "If *sep* is specified, it must be a single character str or bytes object. It " "will be inserted in the output after every *bytes_per_sep* input bytes. " "Separator placement is counted from the right end of the output by default, " "if you wish to count from the left, supply a negative *bytes_per_sep* value." msgstr "" +"*sep* を指定する場合は、1 文字の ``str`` または ``bytes`` オブジェクトでなけ" +"ればなりません。\n" +"入力の *bytes_per_sep* バイトごとに、出力に区切り文字を挿入します。\n" +"デフォルトでは出力の右端から数えて区切り文字を配置します。\n" +"左端から数えるには *bytes_per_sep* に負の値を指定してください。" #: ../../library/binascii.rst:356 msgid "The *sep* and *bytes_per_sep* parameters were added." @@ -517,15 +597,15 @@ msgstr "" "偶数個含んでいなければなりません。そうでない場合、例外 :exc:`Error` が送出さ" "れます。" -#: ../../library/binascii.rst:370 msgid "" "Similar functionality (but more liberal towards whitespace) is also " "accessible using the :meth:`bytes.fromhex` class method." msgstr "" +"同様の機能は :meth:`bytes.fromhex` クラスメソッドからも使えます (ただし空白文" +"字をより寛容に受け入れます)。" -#: ../../library/binascii.rst:373 msgid "Added the *ignorechars* parameter." -msgstr "" +msgstr "*ignorechars* パラメーターが追加されました。" #: ../../library/binascii.rst:379 msgid "Exception raised on errors. These are usually programming errors." @@ -539,50 +619,47 @@ msgstr "" "変換するデータが不完全な場合に送出される例外です。通常はプログラムのエラーで" "はなく、多少追加読み込みを行って再度変換を試みることで対処できます。" -#: ../../library/binascii.rst:390 msgid "The Base 64 alphabet according to :rfc:`4648`." -msgstr "" +msgstr ":rfc:`4648` で規定された Base64 アルファベットです。" -#: ../../library/binascii.rst:396 msgid "" "The \"URL and filename safe\" Base 64 alphabet according to :rfc:`4648`." msgstr "" +":rfc:`4648` で規定された、URL とファイル名で安全に使える Base64 アルファベッ" +"トです。" -#: ../../library/binascii.rst:402 msgid "The uuencoding alphabet." -msgstr "" +msgstr "uuencode のアルファベットです。" -#: ../../library/binascii.rst:408 msgid "" "The Base 64 alphabet used in the :manpage:`crypt(3)` routine and in the " "GEDCOM format." msgstr "" +":manpage:`crypt(3)` ルーチンと GEDCOM 形式で使われる Base64 アルファベットで" +"す。" -#: ../../library/binascii.rst:414 msgid "The Base 64 alphabet used in BinHex 4 (HQX) within the classic Mac OS." -msgstr "" +msgstr "従来の Mac OS で BinHex 4 (HQX) に使われる Base64 アルファベットです。" -#: ../../library/binascii.rst:420 msgid "The Base85 alphabet." -msgstr "" +msgstr "Base85 アルファベットです。" -#: ../../library/binascii.rst:426 msgid "The Ascii85 alphabet." -msgstr "" +msgstr "Ascii85 アルファベットです。" -#: ../../library/binascii.rst:432 msgid "The `Z85 `_ alphabet." -msgstr "" +msgstr "`Z85 `_ アルファベットです。" -#: ../../library/binascii.rst:438 msgid "The Base 32 alphabet according to :rfc:`4648`." -msgstr "" +msgstr ":rfc:`4648` で規定された Base32 アルファベットです。" -#: ../../library/binascii.rst:444 msgid "" "The \"Extended Hex\" Base 32 alphabet according to :rfc:`4648`. Data encoded " "with this alphabet maintains its sort order during bitwise comparisons." msgstr "" +":rfc:`4648` で規定された \"Extended Hex\" Base32 アルファベットです。\n" +"このアルファベットでエンコードしたデータは、ビット単位の比較でもソート順を保" +"ちます。" #: ../../library/binascii.rst:453 msgid "Module :mod:`base64`" diff --git a/library/bisect.po b/library/bisect.po index 657fca243..dda6e09dc 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -44,7 +44,6 @@ msgstr "" "リストの場合、これは線形検索や頻繁な並べ替えよりも改善される可能性がありま" "す。" -#: ../../library/bisect.rst:16 msgid "" "The module is called :mod:`!bisect` because it uses a basic bisection " "algorithm to do its work. Unlike other bisection tools that search for a " @@ -54,8 +53,15 @@ msgid "" "functions only call the :meth:`~object.__lt__` method and will return an " "insertion point between values in an array." msgstr "" +"基本的な二分法アルゴリズムで処理するため、このモジュールは :mod:`!bisect` と" +"呼ばれます。\n" +"特定の値を探す他の二分探索ツールとは異なり、このモジュールの関数は挿入位置を" +"探すように設計されています。\n" +"そのため、値が見つかったかを判断するために :meth:`~object.__eq__` メソッドを" +"呼び出すことはありません。\n" +"代わりに :meth:`~object.__lt__` メソッドだけを呼び出し、配列内の値の間にある" +"挿入位置を返します。" -#: ../../library/bisect.rst:26 msgid "" "The functions in this module are not thread-safe. If multiple threads " "concurrently use :mod:`!bisect` functions on the same sequence, this may " @@ -65,6 +71,13 @@ msgid "" "on the same list from multiple threads may result in the list becoming " "unsorted." msgstr "" +"このモジュールの関数はスレッドセーフではありません。\n" +"複数のスレッドから同じシーケンスに対して :mod:`!bisect` の関数を同時に使う" +"と、動作が未定義になる可能性があります。\n" +"同様に、:mod:`!bisect` の関数がシーケンスを操作している間に別のスレッドがその" +"シーケンスを変更した場合も、結果は未定義です。\n" +"例えば、複数のスレッドから同じリストに対して :py:func:`~bisect.insort_left` " +"を使うと、リストのソート順が崩れる可能性があります。" #: ../../library/bisect.rst:36 msgid "The following functions are provided:" @@ -86,29 +99,29 @@ msgstr "" "insert()`` の第一引数として使うのに適しています。*a* はすでにソートされている" "ものとします。" -#: ../../library/bisect.rst:48 msgid "" "The returned insertion point *ip* partitions the array *a* into two slices " "such that ``all(elem < x for elem in a[lo : ip])`` is true for the left " "slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right " "slice." msgstr "" -"返された挿入点 *ip* パーティションは、左のスライスでは ``all(elem < x for " -"elem in a[lo : ip])`` が真となり、右のスライスでは ``all(elem >= x for elem " -"in a[ip : hi])`` が真となるように、配列 *a* を2つのスライスに分割します。" +"返された挿入位置 *ip* は、配列 *a* を 2 つのスライスに分割します。\n" +"左側のスライスでは ``all(elem < x for elem in a[lo : ip])`` が真となり、右側" +"のスライスでは ``all(elem >= x for elem in a[ip : hi])`` が真となります。" -#: ../../library/bisect.rst:53 msgid "" "*key* specifies a :term:`key function` of one argument that is used to " "extract a comparison key from each element in the array. To support " "searching complex records, the key function is not applied to the *x* value." msgstr "" +"*key* は、配列の各要素から比較用のキーを取り出す、引数を 1 つ受け取る :term:`" +"キー関数 ` を指定します。\n" +"複雑なレコードを検索できるように、キー関数は値 *x* には適用しません。" -#: ../../library/bisect.rst:57 msgid "" "If *key* is ``None``, the elements are compared directly and no key function " "is called." -msgstr "" +msgstr "*key* が ``None`` の場合は要素を直接比較し、キー関数を呼び出しません。" #: ../../library/bisect.rst:60 ../../library/bisect.rst:74 #: ../../library/bisect.rst:92 ../../library/bisect.rst:112 @@ -123,39 +136,42 @@ msgstr "" ":py:func:`~bisect.bisect_left` と似ていますが、 *a* に含まれる *x* のうち、ど" "のエントリーよりも後ろ(右)にくるような挿入点を返します。" -#: ../../library/bisect.rst:70 msgid "" "The returned insertion point *ip* partitions the array *a* into two slices " "such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left " "slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right " "slice." msgstr "" -"返された挿入点 *ip* パーティションは、左のスライスでは ``all(elem <= x for " -"elem in a[lo : ip])`` が真となり、右のスライスでは ``all(elem > x for elem " -"in a[ip : hi])`` が真となるように、配列 *a* を2つのスライスに分割します。" +"返された挿入位置 *ip* は、配列 *a* を 2 つのスライスに分割します。\n" +"左側のスライスでは ``all(elem <= x for elem in a[lo : ip])`` が真となり、右側" +"のスライスでは ``all(elem > x for elem in a[ip : hi])`` が真となります。" #: ../../library/bisect.rst:80 msgid "Insert *x* in *a* in sorted order." msgstr "*x* を *a* にソート順で挿入します。" -#: ../../library/bisect.rst:82 msgid "" "This function first runs :py:func:`~bisect.bisect_left` to locate an " "insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to " "insert *x* at the appropriate position to maintain sort order." msgstr "" +"まず :py:func:`~bisect.bisect_left` で挿入位置を探します。\n" +"次に *a* の :meth:`~sequence.insert` メソッドを呼び出し、ソート順を保つ適切な" +"位置に *x* を挿入します。" -#: ../../library/bisect.rst:86 ../../library/bisect.rst:106 msgid "" "To support inserting records in a table, the *key* function (if any) is " "applied to *x* for the search step but not for the insertion step." msgstr "" +"テーブルへのレコードの挿入に対応するため、*key* 関数を指定した場合は、探索の" +"段階で *x* に適用し、挿入の段階では適用しません。" -#: ../../library/bisect.rst:89 ../../library/bisect.rst:109 msgid "" "Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ " "(*n*) insertion step." msgstr "" +"*O*\\ (log *n*) の探索よりも、遅い *O*\\ (*n*) の挿入処理が全体の実行時間を支" +"配することに注意してください。" #: ../../library/bisect.rst:99 msgid "" @@ -165,12 +181,14 @@ msgstr "" ":py:func:`~bisect.insort_left` と似ていますが、 *a* に含まれる *x* のうち、ど" "のエントリーよりも後ろに *x* を挿入します。" -#: ../../library/bisect.rst:102 msgid "" "This function first runs :py:func:`~bisect.bisect_right` to locate an " "insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to " "insert *x* at the appropriate position to maintain sort order." msgstr "" +"まず :py:func:`~bisect.bisect_right` で挿入位置を探します。\n" +"次に *a* の :meth:`~sequence.insert` メソッドを呼び出し、ソート順を保つ適切な" +"位置に *x* を挿入します。" #: ../../library/bisect.rst:117 msgid "Performance Notes" @@ -192,13 +210,13 @@ msgstr "" "二分法は、値の範囲を検索するのに有効です。 特定の値を検索する場合は、辞書の方" "が効率的です。" -#: ../../library/bisect.rst:125 msgid "" "The *insort()* functions are *O*\\ (*n*) because the logarithmic search step " "is dominated by the linear time insertion step." msgstr "" +"*insort()* 関数の計算量は *O*\\ (*n*) です。\n" +"対数時間の探索よりも、線形時間の挿入処理が全体の実行時間を支配するためです。" -#: ../../library/bisect.rst:128 msgid "" "The search functions are stateless and discard key function results after " "they are used. Consequently, if the search functions are used in a loop, " @@ -208,13 +226,22 @@ msgid "" "searching an array of precomputed keys to locate the insertion point (as " "shown in the examples section below)." msgstr "" +"探索関数は状態を保持せず、キー関数の結果を使用後に破棄します。\n" +"そのため、ループ内で探索関数を使うと、配列の同じ要素に対してキー関数を繰り返" +"し呼び出す可能性があります。\n" +"キー関数が遅い場合は、:py:deco:`functools.cache` でラップして重複した計算を避" +"けることを検討してください。\n" +"または、あらかじめ計算したキーの配列を探索して挿入位置を求める方法もあります " +"(後の使用例を参照してください)。" -#: ../../library/bisect.rst:138 msgid "" "`Sorted Collections `_ is a " "high performance module that uses *bisect* to managed sorted collections of " "data." msgstr "" +"`Sorted Collections `_ は、" +"*bisect* を使ってソート済みのデータのコレクションを管理する高性能なモジュール" +"です。" #: ../../library/bisect.rst:142 msgid "" @@ -331,7 +358,6 @@ msgstr "" "の集合に基づいて、試験の成績の等級を表す文字を調べます。区切り点は 90 以上は " "'A'、 80 から 89 は 'B'、などです::" -#: ../../library/bisect.rst:203 msgid "" ">>> def grade(score):\n" "... i = bisect([60, 70, 80, 90], score)\n" @@ -340,6 +366,12 @@ msgid "" ">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" "['F', 'A', 'C', 'C', 'B', 'A', 'A']" msgstr "" +">>> def grade(score):\n" +"... i = bisect([60, 70, 80, 90], score)\n" +"... return \"FDCBA\"[i]\n" +"...\n" +">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" +"['F', 'A', 'C', 'C', 'B', 'A', 'A']" #: ../../library/bisect.rst:210 msgid "" @@ -351,7 +383,6 @@ msgstr "" "動作します。 引数 *key* はテーブルのレコードの順序付けに使用されるフィールド" "を抽出します::" -#: ../../library/bisect.rst:214 msgid "" ">>> from collections import namedtuple\n" ">>> from operator import attrgetter\n" @@ -383,6 +414,35 @@ msgid "" " Movie(name='Aliens', released=1986, director='Cameron'),\n" " Movie(name='Titanic', released=1997, director='Cameron')]" msgstr "" +">>> from collections import namedtuple\n" +">>> from operator import attrgetter\n" +">>> from bisect import bisect, insort\n" +">>> from pprint import pprint\n" +"\n" +">>> Movie = namedtuple('Movie', ('name', 'released', 'director'))\n" +"\n" +">>> movies = [\n" +"... Movie('Jaws', 1975, 'Spielberg'),\n" +"... Movie('Titanic', 1997, 'Cameron'),\n" +"... Movie('The Birds', 1963, 'Hitchcock'),\n" +"... Movie('Aliens', 1986, 'Cameron')\n" +"... ]\n" +"\n" +">>> # 1960 年より後に公開された最初の映画を探す\n" +">>> by_year = attrgetter('released')\n" +">>> movies.sort(key=by_year)\n" +">>> movies[bisect(movies, 1960, key=by_year)]\n" +"Movie(name='The Birds', released=1963, director='Hitchcock')\n" +"\n" +">>> # ソート順を保ったまま映画を挿入する\n" +">>> romance = Movie('Love Story', 1970, 'Hiller')\n" +">>> insort(movies, romance, key=by_year)\n" +">>> pprint(movies)\n" +"[Movie(name='The Birds', released=1963, director='Hitchcock'),\n" +" Movie(name='Love Story', released=1970, director='Hiller'),\n" +" Movie(name='Jaws', released=1975, director='Spielberg'),\n" +" Movie(name='Aliens', released=1986, director='Cameron'),\n" +" Movie(name='Titanic', released=1997, director='Cameron')]" #: ../../library/bisect.rst:244 msgid "" @@ -393,7 +453,6 @@ msgstr "" "計算されたキーのリストを検索することにより、関数呼び出しの繰り返しを回避する" "ことが可能です::" -#: ../../library/bisect.rst:247 msgid "" ">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n" ">>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).\n" @@ -407,3 +466,15 @@ msgid "" ">>> data[bisect_left(keys, 8)]\n" "('yellow', 8)" msgstr "" +">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n" +">>> data.sort(key=lambda r: r[1]) # または operator.itemgetter(1) を使" +"う。\n" +">>> keys = [r[1] for r in data] # キーのリストを事前に計算する。\n" +">>> data[bisect_left(keys, 0)]\n" +"('black', 0)\n" +">>> data[bisect_left(keys, 1)]\n" +"('blue', 1)\n" +">>> data[bisect_left(keys, 5)]\n" +"('red', 5)\n" +">>> data[bisect_left(keys, 8)]\n" +"('yellow', 8)" diff --git a/library/builtins.po b/library/builtins.po index a2ea8cc52..2f3fc7ad6 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -26,12 +26,14 @@ msgstr "" msgid ":mod:`!builtins` --- Built-in objects" msgstr ":mod:`!builtins` --- 組み込みオブジェクト" -#: ../../library/builtins.rst:9 msgid "" "This module provides direct access to all 'built-in' identifiers of Python; " "for example, ``builtins.open`` is the full name for the built-in function :" "func:`open`." msgstr "" +"このモジュールを使うと、Python のすべての「組み込み」識別子に直接アクセスでき" +"ます。\n" +"例えば ``builtins.open`` は、組み込み関数 :func:`open` の完全な名前です。" #: ../../library/builtins.rst:12 msgid "" @@ -47,7 +49,6 @@ msgstr "" "ば、組み込みの :func:`open` をラップした :func:`open` という関数を実装したい" "モジュールがあったとすると、このモジュールは次のように直接的に使われます::" -#: ../../library/builtins.rst:18 msgid "" "import builtins\n" "\n" @@ -66,6 +67,22 @@ msgid "" "\n" " # ..." msgstr "" +"import builtins\n" +"\n" +"def open(path):\n" +" f = builtins.open(path, 'r')\n" +" return UpperCaser(f)\n" +"\n" +"class UpperCaser:\n" +" '''ファイルから得られる出力を大文字に変換するラッパー。'''\n" +"\n" +" def __init__(self, f):\n" +" self._f = f\n" +"\n" +" def read(self, count=-1):\n" +" return self._f.read(count).upper()\n" +"\n" +" # ..." #: ../../library/builtins.rst:35 msgid "" @@ -81,18 +98,14 @@ msgstr "" "詳細部分なので、異なる Python の実装では ``__builtins__`` は使われていないこ" "ともあります。" -#: ../../library/builtins.rst:43 msgid ":ref:`built-in-consts`" -msgstr "" +msgstr ":ref:`built-in-consts`" -#: ../../library/builtins.rst:44 msgid ":ref:`bltin-exceptions`" -msgstr "" +msgstr ":ref:`bltin-exceptions`" -#: ../../library/builtins.rst:45 msgid ":ref:`built-in-funcs`" -msgstr "" +msgstr ":ref:`built-in-funcs`" -#: ../../library/builtins.rst:46 msgid ":ref:`bltin-types`" -msgstr "" +msgstr ":ref:`bltin-types`" diff --git a/library/bz2.po b/library/bz2.po index b10844116..c93c85536 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -38,9 +38,8 @@ msgstr "" "このモジュールは、bzip2 アルゴリズムを用いて圧縮・展開を行う包括的なインター" "フェイスを提供します。" -#: ../../library/bz2.rst:14 msgid "The :mod:`!bz2` module contains:" -msgstr "" +msgstr ":mod:`!bz2` モジュールは次の機能を提供します。" #: ../../library/bz2.rst:16 msgid "" @@ -65,13 +64,16 @@ msgid "" msgstr "" "一度に圧縮・展開を行う :func:`compress` および :func:`decompress` 関数。" -#: ../../includes/optional-module.rst:1 msgid "" "This is an :term:`optional module`. If it is missing from your copy of " "CPython, look for documentation from your distributor (that is, whoever " "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" +"これは :term:`オプションモジュール ` です。\n" +"使用している CPython に含まれていない場合は、配布元 (Python を提供した組織な" +"ど) のドキュメントを確認してください。\n" +"配布する立場の場合は :ref:`optional-module-requirements` を参照してください。" #: ../../library/bz2.rst:27 msgid "(De)compression of files" @@ -187,13 +189,12 @@ msgstr "" "``1`` から ``9`` の整数で指定できます。\n" "圧縮率は ``1`` が最低で、``9`` (デフォルト値) が最高です。" -#: ../../library/bz2.rst:83 msgid "" "If *mode* is ``'r'``, the input file may be the concatenation of multiple " "compressed streams." msgstr "" -"*mode* の値が ``'r'`` の場合、入力ファイルは複数の圧縮ストリームでも構いませ" -"ん。" +"*mode* が ``'r'`` の場合、入力ファイルは複数の圧縮ストリームを連結したもので" +"もかまいません。" #: ../../library/bz2.rst:86 msgid "" @@ -206,9 +207,8 @@ msgstr "" "truncate` を除くすべてが備わっています。イテレーションと :keyword:`with` 文を" "サポートしています。" -#: ../../library/bz2.rst:91 msgid ":class:`BZ2File` also provides the following methods and attributes:" -msgstr "" +msgstr ":class:`BZ2File` は次のメソッドと属性も提供します。" #: ../../library/bz2.rst:95 msgid "" @@ -231,50 +231,47 @@ msgstr "" "下層のファイルオブジェクトの位置が変わる惧れがあります(e.g. :class:`BZ2File` " "を *filename* にファイルオブジェクトを渡して作成した場合)。" -#: ../../library/bz2.rst:108 msgid "Return the file descriptor for the underlying file." -msgstr "" +msgstr "下層のファイルのファイル記述子を返します。" -#: ../../library/bz2.rst:114 msgid "Return whether the file was opened for reading." -msgstr "" +msgstr "ファイルが読み込み用に開かれたかどうかを返します。" -#: ../../library/bz2.rst:120 msgid "Return whether the file supports seeking." -msgstr "" +msgstr "ファイルがシークをサポートしているかどうかを返します。" -#: ../../library/bz2.rst:126 msgid "Return whether the file was opened for writing." -msgstr "" +msgstr "ファイルが書き込み用に開かれたかどうかを返します。" -#: ../../library/bz2.rst:132 msgid "" "Read up to *size* uncompressed bytes, while trying to avoid making multiple " "reads from the underlying stream. Reads up to a buffer's worth of data if " "size is negative." msgstr "" +"下層のストリームから複数回読み込むのをなるべく避けながら、展開後のデータを最" +"大 *size* バイト読み込みます。\n" +"``size`` が負の場合、最大でバッファ 1 つ分のデータを読み込みます。" -#: ../../library/bz2.rst:136 msgid "Returns ``b''`` if the file is at EOF." -msgstr "" +msgstr "ファイルが EOF に達している場合は ``b''`` を返します。" -#: ../../library/bz2.rst:142 msgid "Read bytes into *b*." -msgstr "" +msgstr "*b* にバイト列を読み込みます。" -#: ../../library/bz2.rst:144 msgid "Returns the number of bytes read (0 for EOF)." -msgstr "" +msgstr "読み込んだバイト数を返します (EOF の場合は 0)。" #: ../../library/bz2.rst:150 msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "``'rb'`` は読み込み用、 ``'wb'`` は書き込み用です。" -#: ../../library/bz2.rst:156 msgid "" "The bzip2 file name. Equivalent to the :attr:`~io.FileIO.name` attribute of " "the underlying :term:`file object`." msgstr "" +"bzip2 ファイルの名前です。\n" +"下層の :term:`ファイルオブジェクト ` の :attr:`~io.FileIO.name` " +"属性と同じです。" #: ../../library/bz2.rst:162 msgid "Support for the :keyword:`with` statement was added." @@ -513,9 +510,8 @@ msgstr "複数ストリームの入力をサポートしました。" msgid "Examples of usage" msgstr "使い方の例" -#: ../../library/bz2.rst:315 msgid "Below are some examples of typical usage of the :mod:`!bz2` module." -msgstr "" +msgstr ":mod:`!bz2` モジュールの典型的な使い方をいくつか示します。" #: ../../library/bz2.rst:317 msgid "" diff --git a/library/calendar.po b/library/calendar.po index b77a7fb50..a54d96549 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -85,43 +85,42 @@ msgstr "" "使えるいくつかのメソッドを提供しています。しかし整形機能そのものは提供してい" "ません。それはサブクラスの仕事なのです。" -#: ../../library/calendar.rst:39 msgid ":class:`Calendar` instances have the following methods and attributes:" -msgstr "" +msgstr ":class:`Calendar` インスタンスは次のメソッドと属性を持ちます。" -#: ../../library/calendar.rst:43 msgid "The first weekday as an integer (0--6)." -msgstr "" +msgstr "週の最初の曜日を表す整数 (0~6) です。" -#: ../../library/calendar.rst:45 msgid "" "This property can also be set and read using :meth:`~Calendar." "setfirstweekday` and :meth:`~Calendar.getfirstweekday` respectively." msgstr "" +"このプロパティは、:meth:`~Calendar.setfirstweekday` で設定し、:meth:" +"`~Calendar.getfirstweekday` で読み取ることもできます。" -#: ../../library/calendar.rst:51 msgid "Return an :class:`int` for the current first weekday (0--6)." -msgstr "" +msgstr "現在の週の最初の曜日を :class:`int` (0~6) で返します。" -#: ../../library/calendar.rst:53 msgid "Identical to reading the :attr:`~Calendar.firstweekday` property." -msgstr "" +msgstr ":attr:`~Calendar.firstweekday` プロパティを読み取るのと同じです。" -#: ../../library/calendar.rst:57 msgid "" "Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6)." msgstr "" +"週の最初の曜日を、:class:`int` (0~6) で渡された *firstweekday* に設定しま" +"す。" -#: ../../library/calendar.rst:59 msgid "Identical to setting the :attr:`~Calendar.firstweekday` property." -msgstr "" +msgstr ":attr:`~Calendar.firstweekday` プロパティを設定するのと同じです。" -#: ../../library/calendar.rst:63 msgid "" "Return an iterator for the weekday numbers that will be used for one week. " "The first value from the iterator will be the same as the value of the :attr:" "`~Calendar.firstweekday` property." msgstr "" +"1 週間に使う曜日番号のイテレーターを返します。\n" +"イテレーターの最初の値は :attr:`~Calendar.firstweekday` プロパティの値と同じ" +"です。" #: ../../library/calendar.rst:70 msgid "" @@ -135,37 +134,46 @@ msgstr "" "た後の日のうち、週の欠けを埋めるために必要な日を (:class:`datetime.date` オブ" "ジェクトとして) 返します。" -#: ../../library/calendar.rst:78 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " "Days returned will simply be day of the month numbers. For the days outside " "of the specified month, the day number is ``0``." msgstr "" +":meth:`itermonthdates` と同様に *year* 年 *month* 月のイテレーターを返します" +"が、:class:`datetime.date` の範囲には制限されません。\n" +"各日は単に月内の日を表す数値として返されます。\n" +"指定した月に含まれない日は ``0`` です。" -#: ../../library/calendar.rst:86 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " "Days returned will be tuples consisting of a day of the month number and a " "weekday number." msgstr "" +":meth:`itermonthdates` と同様に *year* 年 *month* 月のイテレーターを返します" +"が、:class:`datetime.date` の範囲には制限されません。\n" +"各日は、月内の日を表す数値と曜日番号からなるタプルとして返されます。" -#: ../../library/calendar.rst:94 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " "Days returned will be tuples consisting of a year, a month and a day of the " "month numbers." msgstr "" +":meth:`itermonthdates` と同様に *year* 年 *month* 月のイテレーターを返します" +"が、:class:`datetime.date` の範囲には制限されません。\n" +"各日は、年、月、日を表す数値からなるタプルとして返されます。" -#: ../../library/calendar.rst:104 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " "Days returned will be tuples consisting of a year, a month, a day of the " "month, and a day of the week numbers." msgstr "" +":meth:`itermonthdates` と同様に *year* 年 *month* 月のイテレーターを返します" +"が、:class:`datetime.date` の範囲には制限されません。\n" +"各日は、年、月、日、曜日を表す数値からなるタプルとして返されます。" #: ../../library/calendar.rst:114 msgid "" @@ -230,11 +238,12 @@ msgstr "このクラスはプレインテキストのカレンダーを生成す msgid ":class:`TextCalendar` instances have the following methods:" msgstr ":class:`TextCalendar` インスタンスには以下のメソッドがあります:" -#: ../../library/calendar.rst:161 msgid "" "Print a week's calendar as returned by :meth:`formatweek` and without a " "final newline." msgstr "" +":meth:`formatweek` が返す 1 週間分のカレンダーを、末尾に改行を付けずに表示し" +"ます。" #: ../../library/calendar.rst:167 msgid "" @@ -243,12 +252,15 @@ msgid "" "representing an empty day. The *weekday* parameter is unused." msgstr "" -#: ../../library/calendar.rst:174 msgid "" "Return a single week in a string with no newline. *width* specifies the " "width of the date columns, which are centered. Depends on the first weekday " "as specified in the constructor or set by the :meth:`setfirstweekday` method." msgstr "" +"1 週間分を、改行を含まない文字列で返します。\n" +"*width* は、日付を中央揃えで表示する列の幅を指定します。\n" +"コンストラクターまたは :meth:`setfirstweekday` メソッドで指定した週の最初の曜" +"日に従います。" #: ../../library/calendar.rst:182 msgid "" @@ -257,12 +269,14 @@ msgid "" "day of the week, where ``0`` is Monday and ``6`` is Sunday." msgstr "" -#: ../../library/calendar.rst:189 msgid "" "Return a string containing the header row of weekday names, formatted with " "the given *width* for each column. The names depend on the locale settings " "and are padded to the specified width." msgstr "" +"曜日名のヘッダー行を、各列の幅が *width* になるよう整形した文字列で返しま" +"す。\n" +"曜日名はロケール設定に従い、指定した幅になるよう空白を補います。" #: ../../library/calendar.rst:196 msgid "" @@ -277,13 +291,15 @@ msgstr "" "とができます。 :meth:`setfirstweekday` メソッドでセットされた週の最初の曜日に" "依存します。" -#: ../../library/calendar.rst:205 msgid "" "Return a string representing the month's name centered within the specified " "*width*. If *withyear* is ``True``, include the year in the output. The " "*theyear* and *themonth* parameters specify the year and month for the name " "to be formatted respectively." msgstr "" +"月名を指定した *width* の幅で中央揃えにした文字列を返します。\n" +"*withyear* が ``True`` なら、出力に年も含めます。\n" +"*theyear* と *themonth* はそれぞれ、表示する名前の年と月を指定します。" #: ../../library/calendar.rst:213 msgid "Print a month's calendar as returned by :meth:`formatmonth`." @@ -333,7 +349,6 @@ msgstr "" "一年分のカレンダーを HTML のテーブルとして返します。*width* の値 (デフォルト" "では 3 です) は何ヶ月分を一行に収めるかを指定します。" -#: ../../library/calendar.rst:253 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -341,93 +356,105 @@ msgid "" "be used. *encoding* specifies the encoding to be used for the output " "(defaulting to ``'utf-8'``)." msgstr "" +"1 年分のカレンダーを完全な HTML ページとして返します。\n" +"*width* (デフォルトは 3) は、1 行に表示する月の数を指定します。\n" +"*css* は使用するカスケーディングスタイルシートの名前です。\n" +"スタイルシートを使わない場合は :const:`None` を渡せます。\n" +"*encoding* は出力のエンコーディングを指定します (デフォルトは ``'utf-8'``)。" -#: ../../library/calendar.rst:262 msgid "" "Return a month name as an HTML table row. If *withyear* is true the year " "will be included in the row, otherwise just the month name will be used." msgstr "" +"月名を HTML の表の行として返します。\n" +"*withyear* が真の場合は行に年も含め、それ以外の場合は月名だけを使います。" -#: ../../library/calendar.rst:267 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr "" +":class:`!HTMLCalendar` の次の属性をオーバーライドすると、カレンダーで使う " +"CSS クラスを変更できます。" -#: ../../library/calendar.rst:272 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "" +"各曜日に使う CSS クラスのリストです。\n" +"デフォルトのリストは次のとおりです。 ::" -#: ../../library/calendar.rst:274 msgid "" "cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" msgstr "" +"cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" -#: ../../library/calendar.rst:276 msgid "more styles can be added for each day::" -msgstr "" +msgstr "各曜日にスタイルを追加できます。 ::" -#: ../../library/calendar.rst:278 msgid "" "cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " "\"sat\", \"sun red\"]" msgstr "" +"cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " +"\"sat\", \"sun red\"]" -#: ../../library/calendar.rst:280 msgid "Note that the length of this list must be seven items." -msgstr "" +msgstr "このリストの要素数は 7 でなければなりません。" -#: ../../library/calendar.rst:285 msgid "The CSS class for a weekday occurring in the previous or coming month." -msgstr "" +msgstr "前月または翌月に属する日に使う CSS クラスです。" -#: ../../library/calendar.rst:292 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." msgstr "" +"ヘッダー行の曜日名に使う CSS クラスのリストです。\n" +"デフォルトは :attr:`cssclasses` と同じです。" -#: ../../library/calendar.rst:300 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." msgstr "" +"月の見出しに使う CSS クラスです (:meth:`formatmonthname` が使用します)。\n" +"デフォルト値は ``\"month\"`` です。" -#: ../../library/calendar.rst:308 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." msgstr "" +"月全体の表に使う CSS クラスです (:meth:`formatmonth` が使用します)。\n" +"デフォルト値は ``\"month\"`` です。" -#: ../../library/calendar.rst:316 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" +"1 年分の各月の表をまとめる表に使う CSS クラスです (:meth:`formatyear` が使用" +"します)。\n" +"デフォルト値は ``\"year\"`` です。" -#: ../../library/calendar.rst:324 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" +"年全体の表の見出しに使う CSS クラスです (:meth:`formatyear` が使用します)。\n" +"デフォルト値は ``\"year\"`` です。" -#: ../../library/calendar.rst:330 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " "single CSS class with a space separated list of CSS classes, for example::" msgstr "" +"これらのクラス属性の名前は単数形 (例えば ``cssclass_month`` や " +"``cssclass_noday``) ですが、単一の CSS クラスを、スペースで区切った複数の " +"CSS クラスに置き換えることもできます。\n" +"例えば次のように指定します。 ::" -#: ../../library/calendar.rst:334 msgid "\"text-bold text-red\"" -msgstr "" +msgstr "\"text-bold text-red\"" -#: ../../library/calendar.rst:336 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" -msgstr "" +msgstr ":class:`!HTMLCalendar` をカスタマイズする例です。 ::" -#: ../../library/calendar.rst:338 msgid "" "class CustomHTMLCal(calendar.HTMLCalendar):\n" " cssclasses = [style + \" text-nowrap\" for style in\n" @@ -436,26 +463,40 @@ msgid "" " cssclass_month = \"text-center month\"\n" " cssclass_year = \"text-italic lead\"" msgstr "" +"class CustomHTMLCal(calendar.HTMLCalendar):\n" +" cssclasses = [style + \" text-nowrap\" for style in\n" +" calendar.HTMLCalendar.cssclasses]\n" +" cssclass_month_head = \"text-center month-head\"\n" +" cssclass_month = \"text-center month\"\n" +" cssclass_year = \"text-italic lead\"" -#: ../../library/calendar.rst:348 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." msgstr "" +":class:`TextCalendar` のこのサブクラスは、コンストラクターにロケール名を渡せ" +"ます。\n" +"指定したロケールの月名と曜日名を返します。" -#: ../../library/calendar.rst:354 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." msgstr "" +":class:`HTMLCalendar` のこのサブクラスは、コンストラクターにロケール名を渡せ" +"ます。\n" +"指定したロケールの月名と曜日名を返します。" -#: ../../library/calendar.rst:360 msgid "" "The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " "*locale*. Because the current locale is a process-wide setting, they are not " "thread-safe." msgstr "" +"これら 2 つのクラスのコンストラクターと :meth:`!formatweekday`、:meth:`!" +"formatmonthname` メソッドは、``LC_TIME`` ロケールを指定された *locale* に一時" +"的に変更します。\n" +"現在のロケールはプロセス全体の設定なので、これらはスレッドセーフではありませ" +"ん。" #: ../../library/calendar.rst:366 msgid "For simple text calendars this module provides the following functions." @@ -475,11 +516,12 @@ msgstr "" "`FRIDAY`, :const:`SATURDAY` 及び :const:`SUNDAY` は便宜上提供されています。例" "えば、日曜日を週の開始日に設定するときは::" -#: ../../library/calendar.rst:375 msgid "" "import calendar\n" "calendar.setfirstweekday(calendar.SUNDAY)" msgstr "" +"import calendar\n" +"calendar.setfirstweekday(calendar.SUNDAY)" #: ../../library/calendar.rst:381 msgid "Returns the current setting for the weekday to start each week." @@ -511,17 +553,18 @@ msgstr "" "*year* (``1970``--...), *month* (``1``--``12``), *day* (``1``--``31``) で与え" "られた日の曜日(``0`` は月曜日)を返します。" -#: ../../library/calendar.rst:405 msgid "" "Return a header containing abbreviated weekday names. *width* specifies the " "width in characters for one weekday." msgstr "" +"曜日の略称を含むヘッダーを返します。\n" +"*width* は曜日 1 つあたりの幅を文字数で指定します。" -#: ../../library/calendar.rst:411 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "" +"指定した *year* 年 *month* 月の、最初の日の曜日とその月の日数を返します。" #: ../../library/calendar.rst:417 msgid "" @@ -537,24 +580,25 @@ msgstr "" msgid "Prints a month's calendar as returned by :func:`month`." msgstr ":func:`month` 関数によって返される月のカレンダーを出力します。" -#: ../../library/calendar.rst:429 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" "`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." msgstr "" +":class:`TextCalendar` クラスの :meth:`~TextCalendar.formatmonth` を使い、1 か" +"月分のカレンダーを複数行の文字列で返します。" #: ../../library/calendar.rst:435 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr ":func:`calendar` 関数で返される一年間のカレンダーを出力します。" -#: ../../library/calendar.rst:440 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." msgstr "" +":class:`TextCalendar` クラスの :meth:`~TextCalendar.formatyear` を使い、1 年" +"分の 3 列のカレンダーを複数行の文字列で返します。" -#: ../../library/calendar.rst:446 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -562,44 +606,54 @@ msgid "" "encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each other's " "inverse." msgstr "" +"カレンダーとは直接関係しませんが、便利な関数です。\n" +":mod:`time` モジュールの :func:`~time.gmtime` 関数が返すような時刻タプルを受" +"け取り、1970 年をエポックとする POSIX の表現に従った Unix タイムスタンプを返" +"します。\n" +":func:`time.gmtime` と :func:`timegm` は、互いに逆の変換を行います。" -#: ../../library/calendar.rst:453 msgid "The :mod:`!calendar` module exports the following data attributes:" -msgstr "" +msgstr ":mod:`!calendar` モジュールは次のデータ属性を公開します。" -#: ../../library/calendar.rst:457 msgid "" "A sequence that represents the days of the week in the current locale, where " "Monday is day number 0." msgstr "" +"現在のロケールの曜日名を表すシーケンスです。\n" +"月曜日が曜日番号 0 です。" -#: ../../library/calendar.rst:467 msgid "" "A sequence that represents the abbreviated days of the week in the current " "locale, where Mon is day number 0." msgstr "" +"現在のロケールの曜日の略称を表すシーケンスです。\n" +"月曜日 (Mon) が曜日番号 0 です。" -#: ../../library/calendar.rst:482 msgid "" "Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " "is ``6``." msgstr "" +"曜日を表す別名です。\n" +"``MONDAY`` が ``0``、``SUNDAY`` が ``6`` です。" -#: ../../library/calendar.rst:490 msgid "" "Enumeration defining days of the week as integer constants. The members of " "this enumeration are exported to the module scope as :data:`MONDAY` through :" "data:`SUNDAY`." msgstr "" +"曜日を整数定数として定義する列挙型です。\n" +"この列挙型のメンバーは、モジュールのスコープに :data:`MONDAY` から :data:" +"`SUNDAY` として公開されます。" -#: ../../library/calendar.rst:499 msgid "" "A sequence that represents the months of the year in the current locale. " "This follows normal convention of January being month number 1, so it has a " "length of 13 and ``month_name[0]`` is the empty string." msgstr "" +"現在のロケールの月名を表すシーケンスです。\n" +"通常の慣例どおり 1 月の月番号を 1 とするため、長さは 13 で、" +"``month_name[0]`` は空文字列です。" -#: ../../library/calendar.rst:509 msgid "" "In locales with alternative month names forms, the :data:`!month_name` " "sequence may not be suitable when a month name stands by itself and not as " @@ -607,58 +661,76 @@ msgid "" "languages, :data:`!month_name` will produce the month in genitive case. Use :" "data:`standalone_month_name` for a form suitable for standalone use." msgstr "" +"月名に複数の語形があるロケールでは、日付の一部ではなく月名だけを単独で表示す" +"る場合、:data:`!month_name` が適さないことがあります。\n" +"例えばギリシャ語や、多くのスラブ系・バルト系の言語では、:data:`!month_name` " +"は月名の属格を返します。\n" +"単独で使うのに適した語形を得るには :data:`standalone_month_name` を使ってくだ" +"さい。" -#: ../../library/calendar.rst:518 msgid "" "A sequence that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " "it has a length of 13 and ``month_abbr[0]`` is the empty string." msgstr "" +"現在のロケールの月名の略称を表すシーケンスです。\n" +"通常の慣例どおり 1 月の月番号を 1 とするため、長さは 13 で、" +"``month_abbr[0]`` は空文字列です。" -#: ../../library/calendar.rst:528 msgid "" "In locales with alternative month names forms, the :data:`!month_abbr` " "sequence may not be suitable when a month name stands by itself and not as " "part of a date. Use :data:`standalone_month_abbr` for a form suitable for " "standalone use." msgstr "" +"月名に複数の語形があるロケールでは、日付の一部ではなく月名だけを単独で表示す" +"る場合、:data:`!month_abbr` が適さないことがあります。\n" +"単独で使うのに適した語形を得るには :data:`standalone_month_abbr` を使ってくだ" +"さい。" -#: ../../library/calendar.rst:535 msgid "" "A sequence that represents the months of the year in the current locale in " "the standalone form if the locale provides one. Else it is equivalent to :" "data:`month_name`." msgstr "" +"現在のロケールの月名を表すシーケンスです。\n" +"ロケールに単独使用の語形があればそれを使い、なければ :data:`month_name` と同" +"じです。" -#: ../../library/calendar.rst:544 msgid "" "A sequence that represents the abbreviated months of the year in the current " "locale in the standalone form if the locale provides one. Else it is " "equivalent to :data:`month_abbr`." msgstr "" +"現在のロケールの月名の略称を表すシーケンスです。\n" +"ロケールに単独使用の語形があればそれを使い、なければ :data:`month_abbr` と同" +"じです。" -#: ../../library/calendar.rst:564 msgid "" "Aliases for the months of the year, where ``JANUARY`` is ``1`` and " "``DECEMBER`` is ``12``." msgstr "" +"月を表す別名です。\n" +"``JANUARY`` が ``1``、``DECEMBER`` が ``12`` です。" -#: ../../library/calendar.rst:572 msgid "" "Enumeration defining months of the year as integer constants. The members of " "this enumeration are exported to the module scope as :data:`JANUARY` " "through :data:`DECEMBER`." msgstr "" +"月を整数定数として定義する列挙型です。\n" +"この列挙型のメンバーは、モジュールのスコープに :data:`JANUARY` から :data:" +"`DECEMBER` として公開されます。" -#: ../../library/calendar.rst:579 msgid "The :mod:`!calendar` module defines the following exceptions:" -msgstr "" +msgstr ":mod:`!calendar` モジュールは次の例外を定義します。" -#: ../../library/calendar.rst:583 msgid "" "A subclass of :exc:`ValueError` and :exc:`IndexError`, raised when the given " "month number is outside of the range 1-12 (inclusive)." msgstr "" +":exc:`ValueError` と :exc:`IndexError` のサブクラスで、指定された月番号が 1~" +"12 の範囲外の場合に送出されます。" #: ../../library/calendar.rst:586 msgid "" @@ -666,19 +738,18 @@ msgid "" "code should avoid catching :exc:`IndexError`." msgstr "" -#: ../../library/calendar.rst:593 msgid "The invalid month number." -msgstr "" +msgstr "無効な月番号です。" -#: ../../library/calendar.rst:598 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" +":exc:`ValueError` のサブクラスで、指定された曜日番号が 0~6 の範囲外の場合に" +"送出されます。" -#: ../../library/calendar.rst:603 msgid "The invalid weekday number." -msgstr "" +msgstr "無効な曜日番号です。" #: ../../library/calendar.rst:608 msgid "Module :mod:`datetime`" @@ -704,24 +775,25 @@ msgstr "時間に関連した低水準の関数群。" msgid "Command-line usage" msgstr "コマンドラインでの使用" -#: ../../library/calendar.rst:623 msgid "" "The :mod:`!calendar` module can be executed as a script from the command " "line to interactively print a calendar." msgstr "" +":mod:`!calendar` モジュールは、コマンドラインからスクリプトとして実行し、対話" +"的にカレンダーを表示できます。" -#: ../../library/calendar.rst:626 msgid "" "python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" " [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" " [-f FIRST_WEEKDAY] [year] [month]" msgstr "" +"python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" +" [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" +" [-f FIRST_WEEKDAY] [year] [month]" -#: ../../library/calendar.rst:633 msgid "For example, to print a calendar for the year 2000:" -msgstr "" +msgstr "例えば、2000 年のカレンダーを表示するには次のようにします。" -#: ../../library/calendar.rst:635 msgid "" "$ python -m calendar 2000\n" " 2000\n" @@ -761,6 +833,43 @@ msgid "" "23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" "30 31" msgstr "" +"$ python -m calendar 2000\n" +" 2000\n" +"\n" +" January February March\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3 4 5\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26\n" +"24 25 26 27 28 29 30 28 29 27 28 29 30 31\n" +"31\n" +"\n" +" April May June\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 7 1 2 3 4\n" +" 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11\n" +"10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18\n" +"17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25\n" +"24 25 26 27 28 29 30 29 30 31 26 27 28 29 30\n" +"\n" +" July August September\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24\n" +"24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30\n" +"31\n" +"\n" +" October November December\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 1 2 3 4 5 1 2 3\n" +" 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10\n" +" 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17\n" +"16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24\n" +"23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" +"30 31" #: ../../library/calendar.rst:676 msgid "The following options are accepted:" @@ -770,81 +879,99 @@ msgstr "以下のオプションが使用できます:" msgid "Show the help message and exit." msgstr "ヘルプメッセージを表示して終了します。" -#: ../../library/calendar.rst:688 msgid "The locale to use for month and weekday names. Defaults to English." msgstr "" +"月名と曜日名に使うロケールです。\n" +"デフォルトは英語です。" -#: ../../library/calendar.rst:694 msgid "" "The encoding to use for output. :option:`--encoding` is required if :option:" "`--locale` is set." msgstr "" +"出力に使うエンコーディングです。\n" +":option:`--locale` を設定した場合は :option:`--encoding` が必須です。" -#: ../../library/calendar.rst:700 msgid "Print the calendar to the terminal as text, or as an HTML document." msgstr "" +"カレンダーをテキストとして端末に表示するか、HTML 文書として出力します。" -#: ../../library/calendar.rst:706 msgid "" "The weekday to start each week. Must be a number between 0 (Monday) and 6 " "(Sunday). Defaults to 0." msgstr "" +"週の最初の曜日です。\n" +"0 (月曜日) から 6 (日曜日) までの数値を指定してください。\n" +"デフォルトは 0 です。" -#: ../../library/calendar.rst:714 msgid "The year to print the calendar for. Defaults to the current year." msgstr "" +"カレンダーを表示する年です。\n" +"デフォルトは現在の年です。" -#: ../../library/calendar.rst:720 msgid "" "The month of the specified :option:`year` to print the calendar for. Must be " "a number between 1 and 12. Defaults to printing a calendar for the full year." msgstr "" +":option:`year` で指定した年のうち、カレンダーを表示する月です。\n" +"1~12 の数値を指定してください。\n" +"デフォルトでは 1 年分のカレンダーを表示します。" -#: ../../library/calendar.rst:725 msgid "*Text-mode options:*" -msgstr "" +msgstr "*テキストモードのオプション:*" -#: ../../library/calendar.rst:729 msgid "" "The width of the date column in terminal columns. The date is printed " "centred in the column. Any value lower than 2 is ignored. Defaults to 2." msgstr "" +"日付の列の幅を、端末の桁数で指定します。\n" +"日付は列の中央に表示されます。\n" +"2 未満の値は無視します。\n" +"デフォルトは 2 です。" -#: ../../library/calendar.rst:737 msgid "" "The number of lines for each week in terminal rows. The date is printed top-" "aligned. Any value lower than 1 is ignored. Defaults to 1." msgstr "" +"各週に使う行数を、端末の行数で指定します。\n" +"日付は上揃えで表示されます。\n" +"1 未満の値は無視します。\n" +"デフォルトは 1 です。" -#: ../../library/calendar.rst:745 msgid "" "The space between months in columns. Any value lower than 2 is ignored. " "Defaults to 6." msgstr "" +"月と月の間隔を桁数で指定します。\n" +"2 未満の値は無視します。\n" +"デフォルトは 6 です。" -#: ../../library/calendar.rst:752 msgid "The number of months printed per row. Defaults to 3." msgstr "" +"1 行に表示する月の数です。\n" +"デフォルトは 3 です。" -#: ../../library/calendar.rst:755 msgid "" "By default, today's date is highlighted in color and can be :ref:`controlled " "using environment variables `." msgstr "" +"デフォルトでは今日の日付を色で強調表示します。\n" +"この動作は :ref:`環境変数で制御できます `。" -#: ../../library/calendar.rst:759 msgid "" "By default, the month is now also highlighted in color, and the days of the " "week are also in color. This behavior can be :ref:`controlled using " "environment variables `." msgstr "" +"デフォルトで月も色で強調表示し、曜日にも色を付けるようになりました。\n" +"この動作は :ref:`環境変数で制御できます `。" -#: ../../library/calendar.rst:764 msgid "*HTML-mode options:*" -msgstr "" +msgstr "*HTML モードのオプション:*" -#: ../../library/calendar.rst:768 msgid "" "The path of a CSS stylesheet to use for the calendar. This must either be " "relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." msgstr "" +"カレンダーに使う CSS スタイルシートのパスです。\n" +"生成される HTML からの相対パスか、絶対 HTTP URL または ``file:///`` URL でな" +"ければなりません。" diff --git a/library/cgitb.po b/library/cgitb.po index 9b93afa24..2ed5ab44b 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/cgitb.rst:2 msgid ":mod:`!cgitb` --- Traceback manager for CGI scripts" -msgstr "" +msgstr ":mod:`!cgitb` --- CGI スクリプトのトレースバック管理" #: ../../library/cgitb.rst:10 msgid "" @@ -43,8 +42,9 @@ msgid "" "core Python team." msgstr "" -#: ../../library/cgitb.rst:18 msgid "" "The last version of Python that provided the :mod:`!cgitb` module was " "`Python 3.12 `_." msgstr "" +":mod:`!cgitb` モジュールを提供していた最後のバージョンは `Python 3.12 " +"`_ です。" diff --git a/library/chunk.po b/library/chunk.po index 2044fbbbf..ed9f69e8b 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/chunk.rst:2 msgid ":mod:`!chunk` --- Read IFF chunked data" -msgstr "" +msgstr ":mod:`!chunk` --- IFF チャンクデータの読み込み" #: ../../library/chunk.rst:10 msgid "" @@ -36,8 +35,9 @@ msgstr "" "ルは Python 3.11 で非推奨となったあと、:ref:`Python 3.13 で削除` されました。削除の決定は :pep:`594` でなされました。" -#: ../../library/chunk.rst:14 msgid "" "The last version of Python that provided the :mod:`!chunk` module was " "`Python 3.12 `_." msgstr "" +":mod:`!chunk` モジュールを提供していた最後のバージョンは `Python 3.12 " +"`_ です。" diff --git a/library/cmath.po b/library/cmath.po index cc95582ce..52370ab40 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -44,7 +44,6 @@ msgstr "" "これらのメソッドはそのオブジェクトを複素数または浮動小数点数に変換するのにそ" "れぞれ使われ、呼び出された関数はそうして変換された結果を利用します。" -#: ../../library/cmath.rst:18 msgid "" "For functions involving branch cuts, we have the problem of deciding how to " "define those functions on the cut itself. Following Kahan's \"Branch cuts " @@ -54,236 +53,194 @@ msgid "" "axis we look at the sign of the imaginary part, while for a branch cut along " "the imaginary axis we look at the sign of the real part." msgstr "" +"分枝切断を持つ関数では、切断そのものの上で関数をどう定義するかが問題になりま" +"す。\n" +"Kahan の論文 \"Branch cuts for complex elementary functions\" と、C99 以降の " +"C 規格の附属書 G に従い、ゼロの符号で分枝切断のどちら側かを区別します。\n" +"実軸の一部に沿った分枝切断では虚部の符号を使い、虚軸に沿った分枝切断では実部" +"の符号を使います。" -#: ../../library/cmath.rst:26 msgid "" "For example, the :func:`cmath.sqrt` function has a branch cut along the " "negative real axis. An argument of ``-2-0j`` is treated as though it lies " "*below* the branch cut, and so gives a result on the negative imaginary " "axis::" msgstr "" +"例えば :func:`cmath.sqrt` 関数は、負の実軸に沿った分枝切断を持ちます。\n" +"引数 ``-2-0j`` は分枝切断の *下側* にあるものとして扱うため、結果は負の虚軸上" +"になります。 ::" -#: ../../library/cmath.rst:31 msgid "" ">>> cmath.sqrt(-2-0j)\n" "-1.4142135623730951j" msgstr "" +">>> cmath.sqrt(-2-0j)\n" +"-1.4142135623730951j" -#: ../../library/cmath.rst:34 msgid "" "But an argument of ``-2+0j`` is treated as though it lies above the branch " "cut::" -msgstr "" +msgstr "一方、引数 ``-2+0j`` は分枝切断の上側にあるものとして扱います。 ::" -#: ../../library/cmath.rst:37 msgid "" ">>> cmath.sqrt(-2+0j)\n" "1.4142135623730951j" msgstr "" +">>> cmath.sqrt(-2+0j)\n" +"1.4142135623730951j" -#: ../../library/cmath.rst:42 msgid "**Conversions to and from polar coordinates**" -msgstr "" +msgstr "**極座標変換**" -#: ../../library/cmath.rst:44 msgid ":func:`phase(z) `" -msgstr "" +msgstr ":func:`phase(z) `" -#: ../../library/cmath.rst:44 msgid "Return the phase of *z*" -msgstr "" +msgstr "*z* の位相を返します" -#: ../../library/cmath.rst:45 msgid ":func:`polar(z) `" -msgstr "" +msgstr ":func:`polar(z) `" -#: ../../library/cmath.rst:45 msgid "Return the representation of *z* in polar coordinates" -msgstr "" +msgstr "*z* を極座標で表した値を返します" -#: ../../library/cmath.rst:46 msgid ":func:`rect(r, phi) `" -msgstr "" +msgstr ":func:`rect(r, phi) `" -#: ../../library/cmath.rst:46 msgid "Return the complex number *z* with polar coordinates *r* and *phi*" -msgstr "" +msgstr "極座標が *r* と *phi* である複素数 *z* を返します" -#: ../../library/cmath.rst:48 msgid "**Power and logarithmic functions**" -msgstr "" +msgstr "**指数関数と対数関数**" -#: ../../library/cmath.rst:50 msgid ":func:`exp(z) `" -msgstr "" +msgstr ":func:`exp(z) `" -#: ../../library/cmath.rst:50 msgid "Return *e* raised to the power *z*" -msgstr "" +msgstr "*e* の *z* 乗を返します" -#: ../../library/cmath.rst:51 msgid ":func:`log(z[, base]) `" -msgstr "" +msgstr ":func:`log(z[, base]) `" -#: ../../library/cmath.rst:51 msgid "Return the logarithm of *z* to the given *base* (*e* by default)" -msgstr "" +msgstr "*base* (デフォルトは *e*) を底とする *z* の対数を返します" -#: ../../library/cmath.rst:52 msgid ":func:`log10(z) `" -msgstr "" +msgstr ":func:`log10(z) `" -#: ../../library/cmath.rst:52 msgid "Return the base-10 logarithm of *z*" -msgstr "" +msgstr "10 を底とする *z* の対数を返します" -#: ../../library/cmath.rst:53 msgid ":func:`sqrt(z) `" -msgstr "" +msgstr ":func:`sqrt(z) `" -#: ../../library/cmath.rst:53 msgid "Return the square root of *z*" -msgstr "" +msgstr "*z* の平方根を返します" -#: ../../library/cmath.rst:55 msgid "**Trigonometric functions**" -msgstr "" +msgstr "**三角関数**" -#: ../../library/cmath.rst:57 msgid ":func:`acos(z) `" -msgstr "" +msgstr ":func:`acos(z) `" -#: ../../library/cmath.rst:57 msgid "Return the arc cosine of *z*" -msgstr "" +msgstr "*z* の逆余弦を返します" -#: ../../library/cmath.rst:58 msgid ":func:`asin(z) `" -msgstr "" +msgstr ":func:`asin(z) `" -#: ../../library/cmath.rst:58 msgid "Return the arc sine of *z*" -msgstr "" +msgstr "*z* の逆正弦を返します" -#: ../../library/cmath.rst:59 msgid ":func:`atan(z) `" -msgstr "" +msgstr ":func:`atan(z) `" -#: ../../library/cmath.rst:59 msgid "Return the arc tangent of *z*" -msgstr "" +msgstr "*z* の逆正接を返します" -#: ../../library/cmath.rst:60 msgid ":func:`cos(z) `" -msgstr "" +msgstr ":func:`cos(z) `" -#: ../../library/cmath.rst:60 msgid "Return the cosine of *z*" -msgstr "" +msgstr "*z* の余弦を返します" -#: ../../library/cmath.rst:61 msgid ":func:`sin(z) `" -msgstr "" +msgstr ":func:`sin(z) `" -#: ../../library/cmath.rst:61 msgid "Return the sine of *z*" -msgstr "" +msgstr "*z* の正弦を返します" -#: ../../library/cmath.rst:62 msgid ":func:`tan(z) `" -msgstr "" +msgstr ":func:`tan(z) `" -#: ../../library/cmath.rst:62 msgid "Return the tangent of *z*" -msgstr "" +msgstr "*z* の正接を返します" -#: ../../library/cmath.rst:64 msgid "**Hyperbolic functions**" -msgstr "" +msgstr "**双曲線関数**" -#: ../../library/cmath.rst:66 msgid ":func:`acosh(z) `" -msgstr "" +msgstr ":func:`acosh(z) `" -#: ../../library/cmath.rst:66 msgid "Return the inverse hyperbolic cosine of *z*" -msgstr "" +msgstr "*z* の逆双曲線余弦を返します" -#: ../../library/cmath.rst:67 msgid ":func:`asinh(z) `" -msgstr "" +msgstr ":func:`asinh(z) `" -#: ../../library/cmath.rst:67 msgid "Return the inverse hyperbolic sine of *z*" -msgstr "" +msgstr "*z* の逆双曲線正弦を返します" -#: ../../library/cmath.rst:68 msgid ":func:`atanh(z) `" -msgstr "" +msgstr ":func:`atanh(z) `" -#: ../../library/cmath.rst:68 msgid "Return the inverse hyperbolic tangent of *z*" -msgstr "" +msgstr "*z* の逆双曲線正接を返します" -#: ../../library/cmath.rst:69 msgid ":func:`cosh(z) `" -msgstr "" +msgstr ":func:`cosh(z) `" -#: ../../library/cmath.rst:69 msgid "Return the hyperbolic cosine of *z*" -msgstr "" +msgstr "*z* の双曲線余弦を返します" -#: ../../library/cmath.rst:70 msgid ":func:`sinh(z) `" -msgstr "" +msgstr ":func:`sinh(z) `" -#: ../../library/cmath.rst:70 msgid "Return the hyperbolic sine of *z*" -msgstr "" +msgstr "*z* の双曲線正弦を返します" -#: ../../library/cmath.rst:71 msgid ":func:`tanh(z) `" -msgstr "" +msgstr ":func:`tanh(z) `" -#: ../../library/cmath.rst:71 msgid "Return the hyperbolic tangent of *z*" -msgstr "" +msgstr "*z* の双曲線正接を返します" -#: ../../library/cmath.rst:73 msgid "**Classification functions**" -msgstr "" +msgstr "**類別関数**" -#: ../../library/cmath.rst:75 msgid ":func:`isfinite(z) `" -msgstr "" +msgstr ":func:`isfinite(z) `" -#: ../../library/cmath.rst:75 msgid "Check if all components of *z* are finite" -msgstr "" +msgstr "*z* の実部と虚部が両方とも有限かどうかを調べます" -#: ../../library/cmath.rst:76 msgid ":func:`isinf(z) `" -msgstr "" +msgstr ":func:`isinf(z) `" -#: ../../library/cmath.rst:76 msgid "Check if any component of *z* is infinite" -msgstr "" +msgstr "*z* の実部または虚部が無限大かどうかを調べます" -#: ../../library/cmath.rst:77 msgid ":func:`isnan(z) `" -msgstr "" +msgstr ":func:`isnan(z) `" -#: ../../library/cmath.rst:77 msgid "Check if any component of *z* is a NaN" -msgstr "" +msgstr "*z* の実部または虚部が NaN かどうかを調べます" -#: ../../library/cmath.rst:78 msgid ":func:`isclose(a, b, *, rel_tol, abs_tol) `" -msgstr "" +msgstr ":func:`isclose(a, b, *, rel_tol, abs_tol) `" -#: ../../library/cmath.rst:78 msgid "Check if the values *a* and *b* are close to each other" -msgstr "" +msgstr "*a* と *b* が互いに近い値かを調べる" #: ../../library/cmath.rst:80 msgid "**Constants**" @@ -321,13 +278,11 @@ msgstr ":data:`inf`" msgid "Positive infinity" msgstr "正の無限大" -#: ../../library/cmath.rst:86 msgid ":data:`infj`" -msgstr "" +msgstr ":data:`infj`" -#: ../../library/cmath.rst:86 msgid "Pure imaginary infinity" -msgstr "" +msgstr "虚部が無限大の純虚数" #: ../../library/cmath.rst:87 msgid ":data:`nan`" @@ -337,24 +292,24 @@ msgstr ":data:`nan`" msgid "\"Not a number\" (NaN)" msgstr "非数 \"Not a number\" (NaN)" -#: ../../library/cmath.rst:88 msgid ":data:`nanj`" -msgstr "" +msgstr ":data:`nanj`" -#: ../../library/cmath.rst:88 msgid "Pure imaginary NaN" -msgstr "" +msgstr "虚部が NaN の純虚数" #: ../../library/cmath.rst:93 msgid "Conversions to and from polar coordinates" msgstr "極座標変換" -#: ../../library/cmath.rst:95 msgid "" "A Python complex number ``z`` is stored internally using *rectangular* or " "*Cartesian* coordinates. It is completely determined by its *real part* ``z." "real`` and its *imaginary part* ``z.imag``." msgstr "" +"Python の複素数 ``z`` は、内部では *直交座標* (デカルト座標) で保持されま" +"す。\n" +"*実部* ``z.real`` と *虚部* ``z.imag`` によって完全に定まります。" #: ../../library/cmath.rst:99 msgid "" @@ -377,7 +332,6 @@ msgid "" msgstr "" "次の関数はネイティブの直交座標を極座標に変換したりその逆を行うのに使えます。" -#: ../../library/cmath.rst:111 msgid "" "Return the phase of *z* (also known as the *argument* of *z*), as a float. " "``phase(z)`` is equivalent to ``math.atan2(z.imag, z.real)``. The result " @@ -385,155 +339,179 @@ msgid "" "along the negative real axis. The sign of the result is the same as the " "sign of ``z.imag``, even when ``z.imag`` is zero::" msgstr "" +"*z* の位相 (*偏角* とも呼びます) を浮動小数点数で返します。\n" +"``phase(z)`` は ``math.atan2(z.imag, z.real)`` と同じです。\n" +"結果の範囲は [-\\ *π*, *π*] で、分枝切断は負の実軸に沿っています。\n" +"``z.imag`` がゼロの場合も、結果の符号は ``z.imag`` の符号と同じです。 ::" -#: ../../library/cmath.rst:117 msgid "" ">>> phase(-1+0j)\n" "3.141592653589793\n" ">>> phase(-1-0j)\n" "-3.141592653589793" msgstr "" +">>> phase(-1+0j)\n" +"3.141592653589793\n" +">>> phase(-1-0j)\n" +"-3.141592653589793" -#: ../../library/cmath.rst:125 msgid "" "The modulus (absolute value) of a complex number *z* can be computed using " "the built-in :func:`abs` function. There is no separate :mod:`!cmath` " "module function for this operation." msgstr "" +"複素数 *z* の大きさ (絶対値) は、組み込み関数 :func:`abs` で計算できます。\n" +":mod:`!cmath` モジュールには、このための専用の関数はありません。" -#: ../../library/cmath.rst:132 msgid "" "Return the representation of *z* in polar coordinates. Returns a pair ``(r, " "phi)`` where *r* is the modulus of *z* and *phi* is the phase of *z*. " "``polar(z)`` is equivalent to ``(abs(z), phase(z))``." msgstr "" +"*z* の極座標表現を返します。\n" +"戻り値は ``(r, phi)`` の組で、*r* は *z* の大きさ、*phi* は *z* の位相で" +"す。\n" +"``polar(z)`` は ``(abs(z), phase(z))`` と同じです。" -#: ../../library/cmath.rst:140 msgid "" "Return the complex number *z* with polar coordinates *r* and *phi*. " "Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi))``." msgstr "" +"極座標が *r* と *phi* である複素数 *z* を返します。\n" +"``complex(r * math.cos(phi), r * math.sin(phi))`` と同じです。" #: ../../library/cmath.rst:145 msgid "Power and logarithmic functions" msgstr "指数関数と対数関数" -#: ../../library/cmath.rst:149 msgid "" "Return *e* raised to the power *z*, where *e* is the base of natural " "logarithms." -msgstr "" +msgstr "自然対数の底 *e* の *z* 乗を返します。" -#: ../../library/cmath.rst:155 msgid "" "Return the logarithm of *z* to the given *base*. If the *base* is not " "specified, returns the natural logarithm of *z*. There is one branch cut, " "from 0 along the negative real axis to -∞." msgstr "" +"*base* を底とする *z* の対数を返します。\n" +"*base* を指定しない場合は *z* の自然対数を返します。\n" +"分枝切断は 1 つで、0 から負の実軸に沿って -∞ まで延びています。" -#: ../../library/cmath.rst:162 msgid "" "Return the base-10 logarithm of *z*. This has the same branch cut as :func:" "`log`." msgstr "" +"10 を底とする *z* の対数を返します。\n" +"分枝切断は :func:`log` と同じです。" -#: ../../library/cmath.rst:168 msgid "" "Return the square root of *z*. This has the same branch cut as :func:`log`." msgstr "" +"*z* の平方根を返します。\n" +"分枝切断は :func:`log` と同じです。" #: ../../library/cmath.rst:172 msgid "Trigonometric functions" msgstr "三角関数" -#: ../../library/cmath.rst:176 msgid "" "Return the arc cosine of *z*. There are two branch cuts: One extends right " "from 1 along the real axis to ∞. The other extends left from -1 along the " "real axis to -∞." msgstr "" +"*z* の逆余弦を返します。\n" +"分枝切断は 2 つあります。\n" +"一方は 1 から実軸に沿って右に ∞ まで、もう一方は -1 から実軸に沿って左に -∞ " +"まで延びています。" -#: ../../library/cmath.rst:183 msgid "" "Return the arc sine of *z*. This has the same branch cuts as :func:`acos`." msgstr "" +"*z* の逆正弦を返します。\n" +"分枝切断は :func:`acos` と同じです。" -#: ../../library/cmath.rst:188 msgid "" "Return the arc tangent of *z*. There are two branch cuts: One extends from " "``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " "along the imaginary axis to ``-∞j``." msgstr "" +"*z* の逆正接を返します。\n" +"分枝切断は 2 つあります。\n" +"一方は ``1j`` から虚軸に沿って ``∞j`` まで、もう一方は ``-1j`` から虚軸に沿っ" +"て ``-∞j`` まで延びています。" -#: ../../library/cmath.rst:195 msgid "Return the cosine of *z*." -msgstr "" +msgstr "*z* の余弦を返します。" -#: ../../library/cmath.rst:200 msgid "Return the sine of *z*." -msgstr "" +msgstr "*z* の正弦を返します。" -#: ../../library/cmath.rst:205 msgid "Return the tangent of *z*." -msgstr "" +msgstr "*z* の正接を返します。" #: ../../library/cmath.rst:209 msgid "Hyperbolic functions" msgstr "双曲線関数" -#: ../../library/cmath.rst:213 msgid "" "Return the inverse hyperbolic cosine of *z*. There is one branch cut, " "extending left from 1 along the real axis to -∞." msgstr "" +"*z* の逆双曲線余弦を返します。\n" +"分枝切断は 1 つで、1 から実軸に沿って左に -∞ まで延びています。" -#: ../../library/cmath.rst:219 msgid "" "Return the inverse hyperbolic sine of *z*. There are two branch cuts: One " "extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " "from ``-1j`` along the imaginary axis to ``-∞j``." msgstr "" +"*z* の逆双曲線正弦を返します。\n" +"分枝切断は 2 つあります。\n" +"一方は ``1j`` から虚軸に沿って ``∞j`` まで、もう一方は ``-1j`` から虚軸に沿っ" +"て ``-∞j`` まで延びています。" -#: ../../library/cmath.rst:226 msgid "" "Return the inverse hyperbolic tangent of *z*. There are two branch cuts: One " "extends from ``1`` along the real axis to ``∞``. The other extends from " "``-1`` along the real axis to ``-∞``." msgstr "" +"*z* の逆双曲線正接を返します。\n" +"分枝切断は 2 つあります。\n" +"一方は ``1`` から実軸に沿って ``∞`` まで、もう一方は ``-1`` から実軸に沿って " +"``-∞`` まで延びています。" -#: ../../library/cmath.rst:233 msgid "Return the hyperbolic cosine of *z*." -msgstr "" +msgstr "*z* の双曲線余弦を返します。" -#: ../../library/cmath.rst:238 msgid "Return the hyperbolic sine of *z*." -msgstr "" +msgstr "*z* の双曲線正弦を返します。" -#: ../../library/cmath.rst:243 msgid "Return the hyperbolic tangent of *z*." -msgstr "" +msgstr "*z* の双曲線正接を返します。" #: ../../library/cmath.rst:247 msgid "Classification functions" msgstr "類別関数" -#: ../../library/cmath.rst:251 msgid "" "Return ``True`` if both the real and imaginary parts of *z* are finite, and " "``False`` otherwise." msgstr "" +"*z* の実部と虚部が両方とも有限なら ``True``、それ以外は ``False`` を返しま" +"す。" -#: ../../library/cmath.rst:259 msgid "" "Return ``True`` if either the real or the imaginary part of *z* is an " "infinity, and ``False`` otherwise." msgstr "" +"*z* の実部または虚部が無限大なら ``True``、それ以外は ``False`` を返します。" -#: ../../library/cmath.rst:265 msgid "" "Return ``True`` if either the real or the imaginary part of *z* is a NaN, " "and ``False`` otherwise." msgstr "" +"*z* の実部または虚部が NaN なら ``True``、それ以外は ``False`` を返します。" #: ../../library/cmath.rst:271 msgid "" @@ -543,14 +521,16 @@ msgstr "" "値 *a* と *b* が互いに近い場合 ``True`` を、そうでない場合は ``False`` を返し" "ます。" -#: ../../library/cmath.rst:274 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances. If no errors occur, the result will " "be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." msgstr "" +"2 つの値が近いとみなされるかは、指定された絶対許容誤差と相対許容誤差で決まり" +"ます。\n" +"エラーが起きなければ、結果は ``abs(a-b) <= max(rel_tol * max(abs(a), " +"abs(b)), abs_tol)`` です。" -#: ../../library/cmath.rst:278 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -559,6 +539,12 @@ msgid "" "within about 9 decimal digits. *rel_tol* must be nonnegative and less than " "``1.0``." msgstr "" +"*rel_tol* は相対許容誤差です。\n" +"*a* と *b* の絶対値の大きい方に対する、両者の差の許容最大比率を表します。\n" +"例えば、5% の誤差を許容するには ``rel_tol=0.05`` を渡します。\n" +"デフォルトの許容誤差は ``1e-09`` で、2 つの値がおよそ 10 進 9 桁の精度で等し" +"いことを保証します。\n" +"*rel_tol* は非負で ``1.0`` 未満でなければなりません。" #: ../../library/cmath.rst:285 msgid "" @@ -613,11 +599,13 @@ msgstr "" "実部がゼロ、虚部が正の無限大の複素数です。``complex(0.0, float('inf'))`` と等" "価です。" -#: ../../library/cmath.rst:340 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``. See also :data:`math.nan`." msgstr "" +"浮動小数点数の非数 (NaN) です。\n" +"``float('nan')`` と同じです。\n" +":data:`math.nan` も参照してください。" #: ../../library/cmath.rst:348 msgid "" @@ -639,7 +627,6 @@ msgid "" "zero)." msgstr "" -#: ../../library/cmath.rst:364 msgid "" "A note on branch cuts: They are curves along which the given function fails " "to be continuous. They are a necessary feature of many complex functions. " @@ -649,12 +636,11 @@ msgid "" "choice of branch cuts for numerical purposes, a good reference should be the " "following:" msgstr "" -"分枝切断 (branch cut) に関する注釈: 分枝切断を持つ曲線上では、与えられた関数" -"は連続ではなくなります。これらは多くの複素関数における必然的な特性です。複素" -"関数を計算する必要がある場合、これらの分枝に関して理解しているものと仮定して" -"います。悟りに至るために何らかの (到底基礎的とはいえない) 複素数に関する書を" -"ひもといてください。数値計算を目的とした分枝切断の正しい選択方法についての情" -"報としては、以下がよい参考文献となります:" +"分枝切断 (branch cut) について: 分枝切断は、関数が連続でなくなる曲線で、多く" +"の複素関数に必要なものです。\n" +"複素関数を計算する場合、分枝切断を理解していることを前提とします。\n" +"詳しくは、初歩的すぎない複素関数の教科書を参照してください。\n" +"数値計算に適した分枝切断の選び方については、次の文献が参考になります。" #: ../../library/cmath.rst:374 msgid "" diff --git a/library/cmd.po b/library/cmd.po index 3162b38d1..47109bde8 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -67,7 +67,6 @@ msgstr "" "トは :kbd:`Tab` です。 *completekey* が :const:`None` でなく、 :mod:" "`readline` が利用できるならば、コマンド補完は自動的に行われます。" -#: ../../library/cmd.rst:27 msgid "" "The default, ``'tab'``, is treated specially, so that it refers to the :kbd:" "`Tab` key on every :data:`readline.backend`. Specifically, if :data:" @@ -75,6 +74,12 @@ msgid "" "``'tab'``. Note that other values are not treated this way, and might only " "work with a specific backend." msgstr "" +"デフォルト値 ``'tab'`` は、すべての :data:`readline.backend` で :kbd:`Tab` " +"キーを指すように特別に扱われます。\n" +"具体的には、:data:`readline.backend` が ``editline`` の場合、``Cmd`` は " +"``'tab'`` の代わりに ``'^I'`` を使います。\n" +"他の値はこのようには扱われず、特定のバックエンドでしか機能しない可能性があり" +"ます。" #: ../../library/cmd.rst:34 msgid "" @@ -96,9 +101,10 @@ msgstr "" "引数に渡した *stdin* を使いたい場合は、インスタンスの :attr:`use_rawinput` 属" "性を ``False`` にセットしてください。そうしないと *stdin* は無視されます。" -#: ../../library/cmd.rst:43 msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``." msgstr "" +"``editline`` では ``completekey='tab'`` を ``'^I'`` に置き換えるようになりま" +"した。" #: ../../library/cmd.rst:50 msgid "Cmd Objects" @@ -144,7 +150,6 @@ msgstr "" msgid "An end-of-file on input is passed back as the string ``'EOF'``." msgstr "入力のファイル終端は、文字列 ``'EOF'`` として渡されます。" -#: ../../library/cmd.rst:76 msgid "" "An interpreter instance will recognize a command name ``foo`` if and only if " "it has a method :meth:`!do_foo`. As a special case, a line beginning with " @@ -152,15 +157,21 @@ msgid "" "another special case, a line beginning with the character ``'!'`` is " "dispatched to the method :meth:`!do_shell` (if such a method is defined)." msgstr "" +"インタープリタのインスタンスがコマンド名 ``foo`` を認識するのは、:meth:`!" +"do_foo` メソッドを持つ場合に限られます。\n" +"例外として、``'?'`` で始まる行は :meth:`do_help` メソッドに振り分けます。\n" +"また、``'!'`` で始まる行は :meth:`!do_shell` メソッドが定義されていれば、その" +"メソッドに振り分けます。" -#: ../../library/cmd.rst:82 msgid "" "This method will return when the :meth:`postcmd` method returns a true " "value. The *stop* argument to :meth:`postcmd` is the return value from the " "command's corresponding :meth:`!do_\\*` method." msgstr "" +"このメソッドは、:meth:`postcmd` メソッドが真の値を返すと終了します。\n" +":meth:`postcmd` の *stop* 引数は、コマンドに対応する :meth:`!do_\\*` メソッド" +"の戻り値です。" -#: ../../library/cmd.rst:86 msgid "" "If completion is enabled, completing commands will be done automatically, " "and completing of commands args is done by calling :meth:`!complete_foo` " @@ -171,8 +182,15 @@ msgid "" "could be used to provide different completion depending upon which position " "the argument is in." msgstr "" +"補完が有効な場合、コマンド名は自動的に補完します。\n" +"コマンドの引数の補完には、*text*、*line*、*begidx*、*endidx* を引数として :" +"meth:`!complete_foo` を呼び出します。\n" +"*text* はマッチさせる文字列の接頭辞で、返す候補はすべてこの文字列で始まらなけ" +"ればなりません。\n" +"*line* は先頭の空白を取り除いた現在の入力行です。\n" +"*begidx* と *endidx* は接頭辞のテキストの開始・終了インデックスで、引数の位置" +"に応じて補完内容を変えるために使えます。" -#: ../../library/cmd.rst:97 msgid "" "All subclasses of :class:`Cmd` inherit a predefined :meth:`!do_help`. This " "method, called with an argument ``'bar'``, invokes the corresponding method :" @@ -182,6 +200,17 @@ msgid "" "help_\\*` methods or commands that have docstrings), and also lists any " "undocumented commands." msgstr "" +":class:`Cmd` のすべてのサブクラスは、あらかじめ定義された :meth:`!do_help` を" +"継承します。\n" +"引数 ``'bar'`` を渡すと、対応する :meth:`!help_bar` メソッドを呼び出しま" +"す。\n" +"そのメソッドがなければ、:meth:`!do_bar` の docstring がある場合にそれを表示し" +"ます。\n" +"引数なしの場合、:meth:`!do_help` は利用可能なヘルプトピックをすべて表示しま" +"す。\n" +"つまり、対応する :meth:`!help_\\*` メソッドがあるコマンドや、docstring がある" +"コマンドの一覧です。\n" +"説明のないコマンドの一覧も表示します。" #: ../../library/cmd.rst:108 msgid "" @@ -211,18 +240,23 @@ msgstr "" "コマンドの先頭の語が認識されないときに、入力行に対して呼び出されます。このメ" "ソッドがオーバーライドされていないなら、エラーメッセージを表示して戻ります。" -#: ../../library/cmd.rst:131 msgid "" "Method called to complete an input line when no command-specific :meth:`!" "complete_\\*` method is available. By default, it returns an empty list." msgstr "" +"コマンド専用の :meth:`!complete_\\*` メソッドがない場合に、入力行を補完するた" +"めに呼び出されるメソッドです。\n" +"デフォルトでは空のリストを返します。" -#: ../../library/cmd.rst:137 msgid "" "Method called to display a list of strings as a compact set of columns. Each " "column is only as wide as necessary. Columns are separated by two spaces for " "readability." msgstr "" +"文字列のリストを、コンパクトな複数列の形式で表示するために呼び出されるメソッ" +"ドです。\n" +"各列の幅は必要な分だけ確保します。\n" +"読みやすくするため、列の間は 2 つのスペースで区切ります。" #: ../../library/cmd.rst:144 msgid "" @@ -317,12 +351,15 @@ msgid "" msgstr "" "ヘルプ出力に文書化されたコマンドのセクションがある場合に表示するヘッダ。" -#: ../../library/cmd.rst:212 msgid "" "The header to issue if the help output has a section for miscellaneous help " "topics (that is, there are :meth:`!help_\\*` methods without corresponding :" "meth:`!do_\\*` methods)." msgstr "" +"ヘルプ出力にその他のヘルプトピックのセクションがある場合に表示する見出しで" +"す。\n" +"これは、対応する :meth:`!do_\\*` メソッドのない :meth:`!help_\\*` メソッドが" +"ある場合です。" #: ../../library/cmd.rst:219 msgid "" @@ -353,11 +390,12 @@ msgstr "" msgid "Cmd Example" msgstr "Cmd の例" -#: ../../library/cmd.rst:244 msgid "" "The :mod:`!cmd` module is mainly useful for building custom shells that let " "a user work with a program interactively." msgstr "" +":mod:`!cmd` モジュールは主に、ユーザーがプログラムを対話的に操作できる独自の" +"シェルを作成するのに役立ちます。" #: ../../library/cmd.rst:247 msgid "" @@ -367,15 +405,17 @@ msgstr "" "この節では、:mod:`turtle` モジュールのいくつかのコマンドを持ったシェルの作成" "方法の簡単な例を示します。" -#: ../../library/cmd.rst:250 msgid "" "Basic turtle commands such as :meth:`~turtle.forward` are added to a :class:" "`Cmd` subclass with method named :meth:`!do_forward`. The argument is " "converted to a number and dispatched to the turtle module. The docstring is " "used in the help utility provided by the shell." msgstr "" +":meth:`~turtle.forward` などの基本的な turtle コマンドを、:meth:`!" +"do_forward` という名前のメソッドで :class:`Cmd` のサブクラスに追加します。\n" +"引数を数値に変換して turtle モジュールに渡します。\n" +"docstring はシェルのヘルプ機能で使われます。" -#: ../../library/cmd.rst:255 msgid "" "The example also includes a basic record and playback facility implemented " "with the :meth:`~Cmd.precmd` method which is responsible for converting the " @@ -383,6 +423,11 @@ msgid "" "do_playback` method reads the file and adds the recorded commands to the :" "attr:`~Cmd.cmdqueue` for immediate playback::" msgstr "" +"この例には、:meth:`~Cmd.precmd` メソッドで実装した簡単な記録・再生機能もあり" +"ます。\n" +"このメソッドは入力を小文字に変換し、コマンドをファイルに書き込みます。\n" +":meth:`!do_playback` メソッドはファイルを読み取り、記録されたコマンドを :" +"attr:`~Cmd.cmdqueue` に追加してすぐに再生します。 ::" #: ../../library/cmd.rst:261 msgid "" @@ -473,7 +518,6 @@ msgstr "" "以下は、turtle シェルでの機能のヘルプ表示、空行によるコマンドの繰り返し、単純" "な記録と再実行のセッション例です:" -#: ../../library/cmd.rst:339 msgid "" "Welcome to the turtle shell. Type help or ? to list commands.\n" "\n" @@ -533,14 +577,70 @@ msgid "" "(turtle) bye\n" "Thank you for using Turtle" msgstr "" +"Welcome to the turtle shell. Type help or ? to list commands.\n" +"\n" +"(turtle) ?\n" +"\n" +"Documented commands (type help ):\n" +"========================================\n" +"bye color goto home playback record right\n" +"circle forward heading left position reset undo\n" +"\n" +"(turtle) help forward\n" +"Move the turtle forward by the specified distance: FORWARD 10\n" +"(turtle) record spiral.cmd\n" +"(turtle) position\n" +"Current position is 0 0\n" +"\n" +"(turtle) heading\n" +"Current heading is 0\n" +"\n" +"(turtle) reset\n" +"(turtle) circle 20\n" +"(turtle) right 30\n" +"(turtle) circle 40\n" +"(turtle) right 30\n" +"(turtle) circle 60\n" +"(turtle) right 30\n" +"(turtle) circle 80\n" +"(turtle) right 30\n" +"(turtle) circle 100\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) heading\n" +"Current heading is 180\n" +"\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 500\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 300\n" +"(turtle) playback spiral.cmd\n" +"Current position is 0 0\n" +"\n" +"Current heading is 0\n" +"\n" +"Current heading is 180\n" +"\n" +"(turtle) bye\n" +"Thank you for using Turtle" #: ../../library/cmd.rst:72 msgid "? (question mark)" msgstr "? (クエスチョンマーク)" -#: ../../library/cmd.rst:72 msgid "in a command interpreter" -msgstr "" +msgstr "コマンドインタープリタでの使用" #: ../../library/cmd.rst:72 msgid "! (exclamation)" diff --git a/library/cmdline.po b/library/cmdline.po index a122ce002..d3089d273 100644 --- a/library/cmdline.po +++ b/library/cmdline.po @@ -54,25 +54,24 @@ msgstr ":mod:`code`" msgid ":ref:`compileall `" msgstr ":ref:`compileall `" -#: ../../library/cmdline.rst:15 msgid "``cProfile``: see :ref:`profiling.tracing `" msgstr "" +"``cProfile``: :ref:`profiling.tracing ` を参照してくだ" +"さい。" #: ../../library/cmdline.rst:16 msgid ":ref:`dis `" msgstr ":ref:`dis `" -#: ../../library/cmdline.rst:17 msgid ":ref:`doctest `" -msgstr "" +msgstr ":ref:`doctest `" #: ../../library/cmdline.rst:18 msgid ":mod:`!encodings.rot_13`" msgstr ":mod:`!encodings.rot_13`" -#: ../../library/cmdline.rst:19 msgid ":ref:`ensurepip `" -msgstr "" +msgstr ":ref:`ensurepip `" #: ../../library/cmdline.rst:20 msgid ":mod:`filecmp`" @@ -94,53 +93,44 @@ msgstr ":ref:`gzip `" msgid ":ref:`http.server `" msgstr ":ref:`http.server `" -#: ../../library/cmdline.rst:25 msgid ":ref:`idlelib `" -msgstr "" +msgstr ":ref:`idlelib `" #: ../../library/cmdline.rst:26 msgid ":ref:`inspect `" msgstr ":ref:`inspect `" -#: ../../library/cmdline.rst:27 msgid ":ref:`json `" -msgstr "" +msgstr ":ref:`json `" -#: ../../library/cmdline.rst:28 msgid ":ref:`mimetypes `" -msgstr "" +msgstr ":ref:`mimetypes `" -#: ../../library/cmdline.rst:29 msgid ":ref:`pdb `" -msgstr "" +msgstr ":ref:`pdb `" -#: ../../library/cmdline.rst:30 msgid ":ref:`pickle `" -msgstr "" +msgstr ":ref:`pickle `" #: ../../library/cmdline.rst:31 msgid ":ref:`pickletools `" msgstr ":ref:`pickletools `" -#: ../../library/cmdline.rst:32 msgid ":ref:`platform `" -msgstr "" +msgstr ":ref:`platform `" #: ../../library/cmdline.rst:33 msgid ":mod:`poplib`" msgstr ":mod:`poplib`" -#: ../../library/cmdline.rst:34 msgid ":ref:`profiling.sampling `" -msgstr "" +msgstr ":ref:`profiling.sampling `" -#: ../../library/cmdline.rst:35 msgid ":ref:`profiling.tracing `" -msgstr "" +msgstr ":ref:`profiling.tracing `" -#: ../../library/cmdline.rst:36 msgid ":ref:`pstats `" -msgstr "" +msgstr ":ref:`pstats `" #: ../../library/cmdline.rst:37 msgid ":ref:`py_compile `" @@ -174,9 +164,8 @@ msgstr ":ref:`site `" msgid ":ref:`sqlite3 `" msgstr ":ref:`sqlite3 `" -#: ../../library/cmdline.rst:45 msgid ":ref:`symtable `" -msgstr "" +msgstr ":ref:`symtable `" #: ../../library/cmdline.rst:46 msgid ":ref:`sysconfig `" @@ -218,13 +207,11 @@ msgstr ":ref:`unittest `" msgid ":ref:`uuid `" msgstr ":ref:`uuid `" -#: ../../library/cmdline.rst:56 msgid ":ref:`venv `" -msgstr "" +msgstr ":ref:`venv `" -#: ../../library/cmdline.rst:57 msgid ":ref:`webbrowser `" -msgstr "" +msgstr ":ref:`webbrowser `" #: ../../library/cmdline.rst:58 msgid ":ref:`zipapp `" diff --git a/library/code.po b/library/code.po index 00a2c07b2..e5029d982 100644 --- a/library/code.po +++ b/library/code.po @@ -56,13 +56,16 @@ msgstr "" "``'__name__'`` が ``'__console__'`` に設定され、キー ``'__doc__'`` が " "``None`` に設定された新しく作られた辞書です。" -#: ../../library/code.rst:25 msgid "" "Note that functions and classes objects created under an :class:`!" "InteractiveInterpreter` instance will belong to the namespace specified by " "*locals*. They are only pickleable if *locals* is the namespace of an " "existing module." msgstr "" +":class:`!InteractiveInterpreter` インスタンスで作成した関数やクラスのオブジェ" +"クトは、*locals* で指定した名前空間に属します。\n" +"これらを pickle 化できるのは、*locals* が既存のモジュールの名前空間である場合" +"だけです。" #: ../../library/code.rst:34 msgid "" @@ -165,12 +168,16 @@ msgstr "" "で、 *symbol* は ``'single'`` です。あるいくつかのことが起きる可能性がありま" "す:" -#: ../../library/code.rst:94 msgid "" "The input is incorrect; :func:`compile_command` raised an exception " "(usually :exc:`SyntaxError`). A syntax traceback will be printed by calling " "the :meth:`showsyntaxerror` method. :meth:`runsource` returns ``False``." msgstr "" +"入力が不正で、:func:`compile_command` が例外 (通常は :exc:`SyntaxError`) を送" +"出した場合。\n" +":meth:`showsyntaxerror` メソッドを呼び出して構文エラーのトレースバックを表示" +"します。\n" +":meth:`runsource` は ``False`` を返します。" #: ../../library/code.rst:99 msgid "" diff --git a/library/codecs.po b/library/codecs.po index e01b48fe4..b7a6f5caa 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -95,7 +95,6 @@ msgstr "" "を送出することを意味します。codec エラー処理についてのより詳しい情報は :ref:" "`codec-base-classes` を参照してください。" -#: ../../library/codecs.rst:54 msgid "" "Return a mapping suitable for encoding with a custom single-byte encoding. " "Given a :class:`str` *string* of up to 256 characters representing a " @@ -103,6 +102,11 @@ msgid "" "``EncodingMap`` or a :class:`dictionary ` mapping character ordinals " "to byte values. Raises a :exc:`TypeError` on invalid input." msgstr "" +"独自の 1 バイトエンコーディングでのエンコードに適したマッピングを返します。\n" +"デコード用のテーブルを表す最大 256 文字の :class:`str` *string* を渡すと、コ" +"ンパクトな内部マッピングオブジェクト ``EncodingMap``、または文字のコードポイ" +"ントをバイト値に対応付ける :class:`辞書 ` を返します。\n" +"入力が不正な場合は :exc:`TypeError` を送出します。" #: ../../library/codecs.rst:60 msgid "The full details for each codec can also be looked up directly:" @@ -116,7 +120,6 @@ msgstr "" "Python codec レジストリから codec 情報を探し、以下で定義するような :class:" "`CodecInfo` オブジェクトを返します。" -#: ../../library/codecs.rst:67 msgid "" "This function first normalizes the *encoding*: all ASCII letters are " "converted to lower case, spaces are replaced with hyphens. Then encoding is " @@ -125,18 +128,28 @@ msgid "" "exc:`LookupError` is raised. Otherwise, the :class:`CodecInfo` object is " "stored in the cache and returned to the caller." msgstr "" +"まず *encoding* を正規化します。\n" +"ASCII の英字をすべて小文字に変換し、スペースをハイフンに置き換えます。\n" +"次に、レジストリのキャッシュでエンコーディングを検索します。\n" +"見つからなければ、登録された検索関数のリストを順に調べます。\n" +":class:`CodecInfo` オブジェクトが見つからない場合は :exc:`LookupError` を送出" +"します。\n" +"見つかった場合は、その :class:`CodecInfo` オブジェクトをキャッシュに保存して" +"呼び出し元に返します。" -#: ../../library/codecs.rst:74 msgid "" "Any characters except ASCII letters and digits and a dot are converted to " "underscore." msgstr "" +"ASCII の英字、数字、ピリオド以外の文字をすべてアンダースコアに変換するように" +"なりました。" -#: ../../library/codecs.rst:77 msgid "" "No characters are converted to underscore anymore. Spaces are converted to " "hyphens." msgstr "" +"アンダースコアへの変換を行わなくなりました。\n" +"スペースはハイフンに変換します。" #: ../../library/codecs.rst:84 msgid "" @@ -270,19 +283,25 @@ msgstr "" "次のように、適切な codec 検索関数を登録することで、カスタムの codecs を利用す" "ることができます。" -#: ../../library/codecs.rst:175 msgid "" "Register a codec search function. Search functions are expected to take one " "argument, being the encoding name in all lower case letters with spaces " "converted to hyphens, and return a :class:`CodecInfo` object. In case a " "search function cannot find a given encoding, it should return ``None``." msgstr "" +"codec 検索関数を登録します。\n" +"検索関数は引数を 1 つ受け取り、:class:`CodecInfo` オブジェクトを返す必要があ" +"ります。\n" +"引数は、小文字に変換され、スペースをハイフンに置き換えたエンコーディング名で" +"す。\n" +"指定されたエンコーディングが見つからない場合は ``None`` を返してください。" -#: ../../library/codecs.rst:184 msgid "" "Unregister a codec search function and clear the registry's cache. If the " "search function is not registered, do nothing." msgstr "" +"codec 検索関数の登録を解除し、レジストリのキャッシュを消去します。\n" +"検索関数が登録されていなければ何もしません。" #: ../../library/codecs.rst:190 msgid "" @@ -339,19 +358,19 @@ msgstr "" "は ``'strict'`` で、エンコード時にエラーがあれば :exc:`ValueError` を送出しま" "す。" -#: ../../library/codecs.rst:216 msgid "" "*buffering* has the same meaning as for the built-in :func:`open` function. " "It defaults to -1 which means that the default buffer size will be used." msgstr "" +"*buffering* は組み込み関数 :func:`open` の引数と同じ意味です。\n" +"デフォルトは -1 で、デフォルトのバッファサイズを使うことを意味します。" #: ../../library/codecs.rst:219 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` モードは削除されました。" -#: ../../library/codecs.rst:224 msgid ":func:`codecs.open` has been superseded by :func:`open`." -msgstr "" +msgstr ":func:`codecs.open` は :func:`open` に置き換えられました。" #: ../../library/codecs.rst:229 msgid "" @@ -390,13 +409,18 @@ msgstr "" "は ``'strict'`` で、エンコード時にエラーがあれば :exc:`ValueError` を送出しま" "す。" -#: ../../library/codecs.rst:248 msgid "" "Uses an incremental encoder to iteratively encode the input provided by " "*iterator*. *iterator* must yield :class:`str` objects. This function is a :" "term:`generator`. The *errors* argument (as well as any other keyword " "argument) is passed through to the incremental encoder." msgstr "" +"インクリメンタル・エンコーダを使って、*iterator* から得られる入力を順にエン" +"コードします。\n" +"*iterator* は :class:`str` オブジェクトを yield する必要があります。\n" +"この関数は :term:`ジェネレーター ` です。\n" +"*errors* 引数とその他のキーワード引数は、インクリメンタル・エンコーダにそのま" +"ま渡されます。" #: ../../library/codecs.rst:253 msgid "" @@ -409,13 +433,18 @@ msgstr "" "従って、 ``base64_codec`` のようなバイトからバイトへのエンコーダはサポートし" "ていません。" -#: ../../library/codecs.rst:260 msgid "" "Uses an incremental decoder to iteratively decode the input provided by " "*iterator*. *iterator* must yield :class:`bytes` objects. This function is " "a :term:`generator`. The *errors* argument (as well as any other keyword " "argument) is passed through to the incremental decoder." msgstr "" +"インクリメンタル・デコーダを使って、*iterator* から得られる入力を順にデコード" +"します。\n" +"*iterator* は :class:`bytes` オブジェクトを yield する必要があります。\n" +"この関数は :term:`ジェネレーター ` です。\n" +"*errors* 引数とその他のキーワード引数は、インクリメンタル・デコーダにそのまま" +"渡されます。" msgid "" "This function requires that the codec accept :class:`bytes` objects to " @@ -429,22 +458,24 @@ msgstr "" "んが、\n" "``rot_13`` は :func:`iterencode` で同じように使えます。" -#: ../../library/codecs.rst:273 msgid "" "Return a :class:`tuple` containing the raw bytes of *buffer*, a :ref:`buffer-" "compatible object ` or :class:`str` (encoded to UTF-8 before " "processing), and their length in bytes." msgstr "" +":ref:`バッファ互換のオブジェクト ` または :class:`str` である " +"*buffer* の生のバイト列と、そのバイト数を含む :class:`tuple` を返します。\n" +"``str`` は処理の前に UTF-8 でエンコードします。" -#: ../../library/codecs.rst:277 msgid "The *errors* argument is ignored." -msgstr "" +msgstr "*errors* 引数は無視します。" -#: ../../library/codecs.rst:279 msgid "" ">>> codecs.readbuffer_encode(b\"Zito\")\n" "(b'Zito', 4)" msgstr "" +">>> codecs.readbuffer_encode(b\"Zito\")\n" +"(b'Zito', 4)" #: ../../library/codecs.rst:285 msgid "" @@ -479,12 +510,14 @@ msgstr "" msgid "Codec Base Classes" msgstr "Codec 基底クラス" -#: ../../library/codecs.rst:316 msgid "" "The :mod:`!codecs` module defines a set of base classes which define the " "interfaces for working with codec objects, and can also be used as the basis " "for custom codec implementations." msgstr "" +":mod:`!codecs` モジュールは、codec オブジェクトを扱うためのインターフェースを" +"定義する基底クラス群を提供します。\n" +"独自の codec を実装する基盤としても使えます。" #: ../../library/codecs.rst:320 msgid "" @@ -512,11 +545,12 @@ msgstr "" "エラー処理の簡便化と標準化のため、コーデックは、*errors* 文字列引数を指定した" "場合に別のエラー処理を行うような仕組みを実装してもかまいません\\:" -#: ../../library/codecs.rst:353 msgid "" "The following error handlers can be used with all Python :ref:`standard-" "encodings` codecs:" msgstr "" +"次のエラーハンドラは、Python のすべての :ref:`standard-encodings` の codec で" +"使えます。" #: ../../library/codecs.rst:359 ../../library/codecs.rst:402 #: ../../library/codecs.rst:422 @@ -557,24 +591,31 @@ msgstr "" msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/codecs.rst:369 msgid "" "Replace with a replacement marker. On encoding, use ``?`` (ASCII character). " "On decoding, use ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). " "Implemented in :func:`replace_errors`." msgstr "" +"代替の文字に置き換えます。\n" +"エンコード時は ASCII 文字の ``?``、デコード時は ``�`` (U+FFFD、正式名称 " +"REPLACEMENT CHARACTER) を使います。\n" +":func:`replace_errors` に実装されています。" #: ../../library/codecs.rst:375 msgid "``'backslashreplace'``" msgstr "``'backslashreplace'``" -#: ../../library/codecs.rst:375 msgid "" "Replace with backslashed escape sequences. On encoding, use hexadecimal form " "of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" "samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with " "format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." msgstr "" +"バックスラッシュによるエスケープシーケンスに置き換えます。\n" +"エンコード時は、Unicode コードポイントを :samp:`\\\\x{hh}`、:samp:`\\" +"\\u{xxxx}`、:samp:`\\\\U{xxxxxxxx}` の形式の 16 進表現にします。\n" +"デコード時は、バイト値を :samp:`\\\\x{hh}` の形式の 16 進表現にします。\n" +":func:`backslashreplace_errors` に実装されています。" #: ../../library/codecs.rst:384 msgid "``'surrogateescape'``" @@ -592,33 +633,38 @@ msgstr "" "ンドラが使用されると、このコードは同じバイト列に戻されます。 (詳しくは :pep:" "`383` を参照。)" -#: ../../library/codecs.rst:398 msgid "" "The following error handlers are only applicable to encoding (within :term:" "`text encodings `):" msgstr "" +"次のエラーハンドラは、:term:`テキストエンコーディング ` のエン" +"コード時にのみ使えます。" #: ../../library/codecs.rst:404 msgid "``'xmlcharrefreplace'``" msgstr "``'xmlcharrefreplace'``" -#: ../../library/codecs.rst:404 msgid "" "Replace with XML/HTML numeric character reference, which is a decimal form " "of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" "`xmlcharrefreplace_errors`." msgstr "" +"Unicode コードポイントを :samp:`&#{num};` の形式で 10 進数で表した、XML/HTML " +"の数値文字参照に置き換えます。\n" +":func:`xmlcharrefreplace_errors` に実装されています。" #: ../../library/codecs.rst:410 msgid "``'namereplace'``" msgstr "``'namereplace'``" -#: ../../library/codecs.rst:410 msgid "" "Replace with ``\\N{...}`` escape sequences, what appears in the braces is " "the Name property from Unicode Character Database. Implemented in :func:" "`namereplace_errors`." msgstr "" +"``\\N{...}`` のエスケープシーケンスに置き換えます。\n" +"波括弧の中には Unicode 文字データベースの Name プロパティを使います。\n" +":func:`namereplace_errors` に実装されています。" #: ../../library/codecs.rst:419 msgid "" @@ -637,32 +683,36 @@ msgstr "``'surrogatepass'``" msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -#: ../../library/codecs.rst:424 msgid "" "Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " "as normal code point. Otherwise these codecs treat the presence of surrogate " "code point in :class:`str` as an error." msgstr "" +"サロゲートコードポイント (``U+D800``~``U+DFFF``) を通常のコードポイントとし" +"てエンコード・デコードできるようにします。\n" +"この指定がなければ、これらの codec は :class:`str` にサロゲートコードポイント" +"が含まれているとエラーとして扱います。" #: ../../library/codecs.rst:431 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "``'surrogateescape'`` および ``'surrogatepass'`` エラーハンドラ。" -#: ../../library/codecs.rst:434 msgid "" "The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " "codecs." msgstr "" +"``'surrogatepass'`` エラーハンドラが utf-16\\* と utf-32\\* の codec でも使え" +"るようになりました。" #: ../../library/codecs.rst:438 msgid "The ``'namereplace'`` error handler." msgstr "``'namereplace'`` エラーハンドラです。" -#: ../../library/codecs.rst:441 msgid "" "The ``'backslashreplace'`` error handler now works with decoding and " "translating." msgstr "" +"``'backslashreplace'`` エラーハンドラがデコードと文字変換にも対応しました。" #: ../../library/codecs.rst:445 msgid "" @@ -707,15 +757,14 @@ msgstr "" "対位置として扱われます。境界の外側にある位置を返した場合には :exc:" "`IndexError` が送出されます。" -#: ../../library/codecs.rst:466 msgid "" "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " "or :exc:`UnicodeTranslateError` will be passed to the handler and that the " "replacement from the error handler will be put into the output directly." msgstr "" -"デコードと翻訳の動作は似ていますが、エラーハンドラに渡されるのが :exc:" -"`UnicodeDecodeError` か :exc:`UnicodeTranslateError` である点と、エラーハンド" -"ラの置換した内容が直接出力されるという点が異なります。" +"デコードと文字変換も同様に動作しますが、ハンドラには :exc:" +"`UnicodeDecodeError` または :exc:`UnicodeTranslateError` が渡されます。\n" +"また、エラーハンドラが返す置換内容は、そのまま出力に入れられます。" #: ../../library/codecs.rst:471 msgid "" @@ -739,76 +788,84 @@ msgid "" "level functions:" msgstr "以下の標準エラーハンドラも、モジュールレベルの関数として利用できます。" -#: ../../library/codecs.rst:485 msgid "Implements the ``'strict'`` error handling." -msgstr "" +msgstr "``'strict'`` エラー処理を実装します。" -#: ../../library/codecs.rst:487 msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." msgstr "" +"エンコードまたはデコードのエラーごとに :exc:`UnicodeError` を送出します。" -#: ../../library/codecs.rst:492 msgid "Implements the ``'ignore'`` error handling." -msgstr "" +msgstr "``'ignore'`` エラー処理を実装します。" -#: ../../library/codecs.rst:494 msgid "" "Malformed data is ignored; encoding or decoding is continued without further " "notice." msgstr "" +"不正な形式のデータを無視し、通知せずにエンコードまたはデコードを続けます。" -#: ../../library/codecs.rst:500 msgid "Implements the ``'replace'`` error handling." -msgstr "" +msgstr "``'replace'`` エラー処理を実装します。" -#: ../../library/codecs.rst:502 msgid "" "Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " "the official REPLACEMENT CHARACTER) for decoding errors." msgstr "" +"エンコードエラーでは ASCII 文字の ``?``、デコードエラーでは ``�`` (U+FFFD、正" +"式名称 REPLACEMENT CHARACTER) に置き換えます。" -#: ../../library/codecs.rst:508 msgid "Implements the ``'backslashreplace'`` error handling." -msgstr "" +msgstr "``'backslashreplace'`` エラー処理を実装します。" -#: ../../library/codecs.rst:510 msgid "" "Malformed data is replaced by a backslashed escape sequence. On encoding, " "use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" "` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the " "hexadecimal form of byte value with format :samp:`\\\\x{hh}`." msgstr "" +"不正な形式のデータを、バックスラッシュによるエスケープシーケンスに置き換えま" +"す。\n" +"エンコード時は、Unicode コードポイントを :samp:`\\\\x{hh}`、:samp:`\\" +"\\u{xxxx}`、:samp:`\\\\U{xxxxxxxx}` の形式の 16 進表現にします。\n" +"デコード時は、バイト値を :samp:`\\\\x{hh}` の形式の 16 進表現にします。" -#: ../../library/codecs.rst:516 msgid "Works with decoding and translating." -msgstr "" +msgstr "デコードと文字変換にも対応しました。" -#: ../../library/codecs.rst:522 msgid "" "Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" "term:`text encoding` only)." msgstr "" +"``'xmlcharrefreplace'`` エラー処理を実装します (:term:`テキストエンコーディン" +"グ ` のエンコード時のみ)。" -#: ../../library/codecs.rst:525 msgid "" "The unencodable character is replaced by an appropriate XML/HTML numeric " "character reference, which is a decimal form of Unicode code point with " "format :samp:`&#{num};` ." msgstr "" +"エンコードできない文字を、対応する XML/HTML の数値文字参照に置き換えます。\n" +"これは Unicode コードポイントを :samp:`&#{num};` の形式で 10 進数で表したもの" +"です。" -#: ../../library/codecs.rst:532 msgid "" "Implements the ``'namereplace'`` error handling (for encoding within :term:" "`text encoding` only)." msgstr "" +"``'namereplace'`` エラー処理を実装します (:term:`テキストエンコーディング " +"` のエンコード時のみ)。" -#: ../../library/codecs.rst:535 msgid "" "The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " "set of characters that appear in the braces is the Name property from " "Unicode Character Database. For example, the German lowercase letter ``'ß'`` " "will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." msgstr "" +"エンコードできない文字を ``\\N{...}`` のエスケープシーケンスに置き換えま" +"す。\n" +"波括弧の中には Unicode 文字データベースの Name プロパティを使います。\n" +"例えば、ドイツ語の小文字 ``'ß'`` はバイト列 ``\\N{LATIN SMALL LETTER SHARP S}" +"`` に変換されます。" #: ../../library/codecs.rst:546 msgid "Stateless Encoding and Decoding" @@ -1135,12 +1192,15 @@ msgstr "" msgid "Stream Encoding and Decoding" msgstr "ストリームのエンコードとデコード" -#: ../../library/codecs.rst:737 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " "very easily. See :mod:`!encodings.utf_8` for an example of how this is done." msgstr "" +":class:`StreamWriter` クラスと :class:`StreamReader` クラスは、汎用的な動作イ" +"ンターフェースを提供し、新しいエンコーディングのサブモジュールを簡単に実装で" +"きるようにします。\n" +"実装例は :mod:`!encodings.utf_8` を参照してください。" #: ../../library/codecs.rst:745 msgid "StreamWriter Objects" @@ -1202,12 +1262,15 @@ msgstr "" msgid "Writes the object's contents encoded to the stream." msgstr "*object* の内容をエンコードしてストリームに書き出します。" -#: ../../library/codecs.rst:778 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" +"文字列のイテラブルの内容を連結してストリームに書き込みます (:meth:`write` メ" +"ソッドを再利用する場合もあります)。\n" +"無限のイテラブルや非常に大きいイテラブルはサポートしません。\n" +"標準のバイト列からバイト列への codec では、このメソッドをサポートしません。" #: ../../library/codecs.rst:786 ../../library/codecs.rst:881 msgid "Resets the codec buffers used for keeping internal state." @@ -1309,7 +1372,6 @@ msgstr "" ":func:`read` メソッドは要求された量を超えるデータを返すことはありません。\n" "利用できるデータが足りない場合は、それより少ない量を返すことがあります。" -#: ../../library/codecs.rst:839 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1317,10 +1379,12 @@ msgid "" "much as possible. This parameter is intended to prevent having to decode " "huge files in one step." msgstr "" -"*size* 引数は、デコード用に読み込むエンコードされたバイト列またはコードポイン" -"トの、およその最大バイト数を表します。デコーダはこの値を適切な値に変更できま" -"す。デフォルト値 -1 の場合、可能な限り多くのデータを読み込みます。この引数の" -"目的は、巨大なファイルの一括デコードを防ぐことにあります。" +"*size* 引数は、デコードのために読み込むエンコード済みデータの、およその最大バ" +"イト数または最大コードポイント数を指定します。\n" +"デコーダは必要に応じてこの設定を変更できます。\n" +"デフォルト値 -1 は、可能な限り多く読み込んでデコードすることを意味します。\n" +"このパラメーターは、巨大なファイルを一度にデコードせずに済むようにするための" +"ものです。" #: ../../library/codecs.rst:846 msgid "" @@ -1453,13 +1517,17 @@ msgstr "" ":class:`StreamRecoder` はデータをあるエンコーディングから別のエンコーディング" "に変換します。異なるエンコーディング環境を扱うとき、便利な場合があります。" -#: ../../library/codecs.rst:928 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " "conversion: *encode* and *decode* work on the frontend — the data visible to " "code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, " "while *Reader* and *Writer* work on the backend — the data in *stream*." msgstr "" +"双方向の変換を行う :class:`StreamRecoder` インスタンスを作成します。\n" +"*encode* と *decode* はフロントエンド、つまり :meth:`~StreamReader.read` や :" +"meth:`~StreamWriter.write` を呼び出すコードから見えるデータを扱います。\n" +"一方、*Reader* と *Writer* はバックエンド、つまり *stream* 内のデータを扱いま" +"す。" #: ../../library/codecs.rst:934 msgid "" @@ -1715,7 +1783,6 @@ msgstr "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK" msgid "INVERTED QUESTION MARK" msgstr "INVERTED QUESTION MARK" -#: ../../library/codecs.rst:1056 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1726,19 +1793,21 @@ msgid "" "three bytes if they appear as the first three bytes in the file. In UTF-8, " "the use of the BOM is discouraged and should generally be avoided." msgstr "" -"のようになる)ので、``utf-8-sig`` エンコーディングがバイト列から正しく推測され" -"る確率を高めます。つまりここでは BOM はバイト列を生成する際のバイト順を決定で" -"きるように使われているのではなく、エンコーディングを推測する助けになる印とし" -"て使われているのです。``utf-8-sig`` codec はエンコーディングの際ファイルに最" -"初の3文字として ``0xef``, ``0xbb``, ``0xbf`` を書き込みます。デコーディングの" -"際はファイルの先頭に現れたこれら3バイトはスキップします。UTF-8 では BOM の使" -"用は推奨されておらず、一般的には避けるべきです。" +"に対応します)。\n" +"このため、バイト列から ``utf-8-sig`` エンコーディングを正しく推測できる確率が" +"高まります。\n" +"ここで BOM はバイト順を判定するためではなく、エンコーディングの推測を助ける印" +"として使われます。\n" +"``utf-8-sig`` codec は、エンコード時にファイルの最初の 3 バイトとして " +"``0xef``、``0xbb``、``0xbf`` を書き込みます。\n" +"デコード時は、これらがファイルの最初の 3 バイトに現れた場合にスキップしま" +"す。\n" +"UTF-8 での BOM の使用は推奨されず、通常は避けてください。" #: ../../library/codecs.rst:1069 msgid "Standard Encodings" msgstr "標準エンコーディング" -#: ../../library/codecs.rst:1071 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1750,19 +1819,33 @@ msgid "" "normalized by :func:`~encodings.normalize_encoding`. For example, " "``'utf-8'`` is a valid alias for the ``'utf_8'`` codec." msgstr "" +"Python には、C 関数やマッピングテーブルとしての辞書で実装された多数の codec " +"が組み込まれています。\n" +"次の表には、codec の名前、よく使われる別名、そのエンコーディングが主に使われ" +"る言語を示します。\n" +"別名と言語のどちらも網羅的な一覧ではありません。\n" +"大文字・小文字だけが異なる名前や、アンダースコアの代わりにスペースやハイフン" +"を使った名前も、有効な別名です。\n" +":func:`~encodings.normalize_encoding` で正規化すると同じ名前になるためで" +"す。\n" +"例えば ``'utf-8'`` は ``'utf_8'`` codec の有効な別名です。" -#: ../../library/codecs.rst:1083 msgid "" "The below table lists the most common aliases, for a complete list refer to " "the source :source:`aliases.py ` file." msgstr "" +"次の表には、よく使われる別名を示します。\n" +"完全な一覧はソースファイル :source:`aliases.py ` を" +"参照してください。" -#: ../../library/codecs.rst:1086 msgid "" "On Windows, ``cpXXX`` codecs are available for all code pages. But only " "codecs listed in the following table are guaranteed to exist on other " "platforms." msgstr "" +"Windows では、すべてのコードページに対して ``cpXXX`` codec を利用できます。\n" +"ただし、他のプラットフォームでも存在が保証されるのは、次の表にある codec だけ" +"です。" msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " @@ -1948,10 +2031,8 @@ msgstr "cp775" msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1145 ../../library/codecs.rst:1212 -#: ../../library/codecs.rst:1279 msgid "Baltic languages" -msgstr "バルト沿岸国" +msgstr "バルト諸語" #: ../../library/codecs.rst:1147 msgid "cp850" @@ -1982,10 +2063,8 @@ msgstr "cp855" msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1151 ../../library/codecs.rst:1199 -#: ../../library/codecs.rst:1264 ../../library/codecs.rst:1301 msgid "Belarusian, Bulgarian, Macedonian, Russian, Serbian" -msgstr "" +msgstr "ベラルーシ語、ブルガリア語、マケドニア語、ロシア語、セルビア語" #: ../../library/codecs.rst:1154 msgid "cp856" @@ -2009,9 +2088,8 @@ msgstr "トルコ語" msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1158 msgid "858, IBM00858" -msgstr "" +msgstr "858, IBM00858" #: ../../library/codecs.rst:1160 msgid "cp860" @@ -2073,9 +2151,8 @@ msgstr "cp865" msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1170 msgid "Danish, Norwegian" -msgstr "デンマーク、ノルウェー" +msgstr "デンマーク語、ノルウェー語" #: ../../library/codecs.rst:1172 msgid "cp866" @@ -2113,9 +2190,8 @@ msgstr "cp875" msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1180 msgid "932, ms932, mskanji, ms-kanji, windows-31j" -msgstr "" +msgstr "932, ms932, mskanji, ms-kanji, windows-31j" #: ../../library/codecs.rst:1180 ../../library/codecs.rst:1216 #: ../../library/codecs.rst:1218 ../../library/codecs.rst:1220 @@ -2151,9 +2227,8 @@ msgstr "950, ms950" msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1187 msgid "Urdu" -msgstr "Urdu" +msgstr "ウルドゥー語" #: ../../library/codecs.rst:1189 msgid "cp1026" @@ -2179,9 +2254,8 @@ msgstr "ウクライナ語" msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1195 msgid "IBM01140" -msgstr "" +msgstr "IBM01140" #: ../../library/codecs.rst:1197 msgid "cp1250" @@ -2255,9 +2329,8 @@ msgstr "cp1258" msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1214 msgid "Vietnamese" -msgstr "ベトナム" +msgstr "ベトナム語" #: ../../library/codecs.rst:1216 msgid "euc_jp" @@ -2419,9 +2492,8 @@ msgstr "iso8859_3" msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1260 msgid "Esperanto, Maltese" -msgstr "エスペラント、マルタ" +msgstr "エスペラント、マルタ語" #: ../../library/codecs.rst:1262 msgid "iso8859_4" @@ -2431,9 +2503,8 @@ msgstr "iso8859_4" msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1262 msgid "Northern Europe" -msgstr "" +msgstr "北ヨーロッパ" #: ../../library/codecs.rst:1264 msgid "iso8859_5" @@ -2555,9 +2626,8 @@ msgstr "koi8_r" msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1291 msgid "Tajik" -msgstr "タジク" +msgstr "タジク語" #: ../../library/codecs.rst:1295 msgid "koi8_u" @@ -2571,9 +2641,8 @@ msgstr "kz1048" msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1297 ../../library/codecs.rst:1315 msgid "Kazakh" -msgstr "カザフ" +msgstr "カザフ語" #: ../../library/codecs.rst:1301 msgid "mac_cyrillic" @@ -2603,9 +2672,8 @@ msgstr "maciceland" msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1308 msgid "maclatin2, maccentraleurope, mac_centeuro" -msgstr "" +msgstr "maclatin2, maccentraleurope, mac_centeuro" #: ../../library/codecs.rst:1311 msgid "mac_roman" @@ -2723,17 +2791,15 @@ msgstr "U7, unicode-1-1-utf-7" msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1341 msgid "U8, UTF, utf8, cp65001" -msgstr "" +msgstr "U8, UTF, utf8, cp65001" #: ../../library/codecs.rst:1343 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1343 msgid "utf8-sig" -msgstr "" +msgstr "utf8-sig" #: ../../library/codecs.rst:1346 msgid "" @@ -2745,13 +2811,13 @@ msgstr "" "``U+DFFF``) がエンコードされることを許可しなくなりました。utf-32\\* デコーダ" "は、サロゲートコードポイントに対応するバイト列をデコードしなくなりました。" -#: ../../library/codecs.rst:1352 msgid "``cp65001`` is now an alias to ``utf_8``." -msgstr "" +msgstr "``cp65001`` は ``utf_8`` の別名になりました。" -#: ../../library/codecs.rst:1355 msgid "On Windows, ``cpXXX`` codecs are now available for all code pages." msgstr "" +"Windows では、すべてのコードページに対して ``cpXXX`` codec を利用できるように" +"なりました。" #: ../../library/codecs.rst:1360 msgid "Python Specific Encodings" @@ -2800,11 +2866,13 @@ msgstr "" ":rfc:`3490` の実装です。 :mod:`encodings.idna` も参照してください。 " "``errors='strict'`` のみがサポートされています。" -#: ../../library/codecs.rst:1389 msgid "" "This codec builds on ``punycode``, whose algorithms scale poorly, so limit " "the length of untrusted input." msgstr "" +"この codec は ``punycode`` を基にしています。\n" +"そのアルゴリズムは入力が長くなると処理効率が大きく低下するため、信頼できない" +"入力の長さを制限してください。" #: ../../library/codecs.rst:1396 msgid "mbcs" @@ -2848,30 +2916,33 @@ msgstr "punycode" msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr ":rfc:`3492` の実装です。ステートフル codecs は、サポートされません。" -#: ../../library/codecs.rst:1414 msgid "" "The decoding and encoding algorithms scale poorly, so limit the length of " "untrusted input." msgstr "" +"デコードとエンコードのアルゴリズムは、入力が長くなると処理効率が大きく低下す" +"るため、信頼できない入力の長さを制限してください。" #: ../../library/codecs.rst:1420 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1420 msgid "" "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " "other code points. Existing backslashes are not escaped in any way. It is " "used in the Python pickle protocol." msgstr "" +"Latin-1 エンコーディングを使い、その範囲外のコードポイントを :samp:`\\" +"\\u{XXXX}` と :samp:`\\\\U{XXXXXXXX}` で表します。\n" +"既存のバックスラッシュはエスケープしません。\n" +"Python の pickle プロトコルで使われています。" #: ../../library/codecs.rst:1430 msgid "undefined" msgstr "undefined" -#: ../../library/codecs.rst:1430 msgid "This Codec should only be used for testing purposes." -msgstr "" +msgstr "この codec はテスト目的にのみ使ってください。" #: ../../library/codecs.rst:1434 msgid "" @@ -2896,9 +2967,8 @@ msgstr "" "ドからデコードします。実際には、Python のソースコードはデフォルトでは UTF-8 " "を使用することに注意してください。" -#: ../../library/codecs.rst:1451 msgid "\"unicode_internal\" codec is removed." -msgstr "" +msgstr "\"unicode_internal\" codec は削除されました。" #: ../../library/codecs.rst:1458 msgid "Binary Transforms" @@ -3045,11 +3115,9 @@ msgstr "" "バイナリ変換のエイリアスが復活しました。(訳注: 2.x にはあったエイリアス。3.2 " "でエイリアスは復活しなかった。)" -#: ../../library/codecs.rst:1514 msgid "Standalone Codec Functions" -msgstr "" +msgstr "単独の codec 関数" -#: ../../library/codecs.rst:1516 msgid "" "The following functions provide encoding and decoding functionality similar " "to codecs, but are not available as named codecs through :func:`codecs." @@ -3057,30 +3125,35 @@ msgid "" "mod:`pickle`) and behave similarly to the ``string_escape`` codec that was " "removed in Python 3." msgstr "" +"次の関数は codec と同様のエンコード・デコード機能を提供しますが、:func:" +"`codecs.encode` や :func:`codecs.decode` で名前を指定して使う codec としては" +"利用できません。\n" +"内部で (例えば :mod:`pickle` から) 使われており、Python 3 で削除された " +"``string_escape`` codec と同様に動作します。" -#: ../../library/codecs.rst:1523 msgid "" "Encode *input* using escape sequences. Similar to how :func:`repr` on bytes " "produces escaped byte values." msgstr "" +"エスケープシーケンスを使って *input* をエンコードします。\n" +"バイト列に対する :func:`repr` が、エスケープしたバイト値を生成するのと同様で" +"す。" -#: ../../library/codecs.rst:1526 msgid "*input* must be a :class:`bytes` object." -msgstr "" +msgstr "*input* は :class:`bytes` オブジェクトでなければなりません。" -#: ../../library/codecs.rst:1528 ../../library/codecs.rst:1537 msgid "" "Returns a tuple ``(output, length)`` where *output* is a :class:`bytes` " "object and *length* is the number of bytes consumed." msgstr "" +"タプル ``(output, length)`` を返します。\n" +"*output* は :class:`bytes` オブジェクト、*length* は消費したバイト数です。" -#: ../../library/codecs.rst:1533 msgid "Decode *input* from escape sequences back to the original bytes." -msgstr "" +msgstr "*input* のエスケープシーケンスをデコードし、元のバイト列に戻します。" -#: ../../library/codecs.rst:1535 msgid "*input* must be a :term:`bytes-like object`." -msgstr "" +msgstr "*input* は :term:`bytes-like object` でなければなりません。" #: ../../library/codecs.rst:1544 msgid "Text Transforms" @@ -3120,17 +3193,14 @@ msgstr "" "``rot13`` エイリアスが復活しました。(訳注: 2.x にはあったエイリアス。3.2 でエ" "イリアスは復活しなかった。)" -#: ../../library/codecs.rst:1568 msgid ":mod:`!encodings` --- Encodings package" -msgstr "" +msgstr ":mod:`!encodings` --- エンコーディングパッケージ" -#: ../../library/codecs.rst:1573 msgid "This module implements the following functions:" -msgstr "" +msgstr "このモジュールは次の関数を実装しています。" -#: ../../library/codecs.rst:1577 msgid "Normalize encoding name *encoding*." -msgstr "" +msgstr "エンコーディング名 *encoding* を正規化します。" #: ../../library/codecs.rst:1579 msgid "" @@ -3140,23 +3210,23 @@ msgid "" "-;#'`` becomes ``'_'``." msgstr "" -#: ../../library/codecs.rst:1584 msgid "Note that *encoding* should be ASCII only." -msgstr "" +msgstr "*encoding* には ASCII 文字だけを使ってください。" -#: ../../library/codecs.rst:1588 msgid "" "The following functions should not be used directly, except for testing " "purposes; :func:`codecs.lookup` should be used instead." msgstr "" +"次の関数は、テスト目的を除いて直接使わないでください。\n" +"代わりに :func:`codecs.lookup` を使ってください。" -#: ../../library/codecs.rst:1594 msgid "" "Search for the codec module corresponding to the given encoding name " "*encoding*." msgstr "" +"指定したエンコーディング名 *encoding* に対応する codec モジュールを検索しま" +"す。" -#: ../../library/codecs.rst:1597 msgid "" "This function first normalizes the *encoding* using :func:" "`normalize_encoding`, then looks for a corresponding alias. It attempts to " @@ -3165,39 +3235,45 @@ msgid "" "``getregentry()`` function that returns a :class:`codecs.CodecInfo` object, " "the codec is cached and returned." msgstr "" +"まず :func:`normalize_encoding` で *encoding* を正規化し、対応する別名を探し" +"ます。\n" +"別名または正規化した名前を使い、encodings パッケージから codec モジュールのイ" +"ンポートを試みます。\n" +"モジュールが見つかり、:class:`codecs.CodecInfo` オブジェクトを返す有効な " +"``getregentry()`` 関数が定義されていれば、codec をキャッシュして返します。" -#: ../../library/codecs.rst:1604 msgid "" "If the codec module defines a ``getaliases()`` function any returned aliases " "are registered for future use." msgstr "" +"codec モジュールに ``getaliases()`` 関数が定義されていれば、返された別名を今" +"後使えるよう登録します。" -#: ../../library/codecs.rst:1610 msgid "" "Search for a Windows code page encoding *encoding* of the form ``cpXXXX``." msgstr "" +"``cpXXXX`` 形式の Windows コードページエンコーディング *encoding* を検索しま" +"す。" -#: ../../library/codecs.rst:1612 msgid "" "If the code page is valid and supported, return a :class:`codecs.CodecInfo` " "object for it." msgstr "" +"コードページが有効でサポートされていれば、その :class:`codecs.CodecInfo` オブ" +"ジェクトを返します。" msgid "Availability" msgstr "利用可能な環境" -#: ../../library/codecs.rst:1620 msgid "This module implements the following exception:" -msgstr "" +msgstr "このモジュールは次の例外を実装しています。" -#: ../../library/codecs.rst:1624 msgid "Raised when a codec is invalid or incompatible." -msgstr "" +msgstr "codec が無効または非互換の場合に送出されます。" -#: ../../library/codecs.rst:1628 msgid "" ":mod:`!encodings.idna` --- Internationalized Domain Names in Applications" -msgstr "" +msgstr ":mod:`!encodings.idna` --- アプリケーションにおける国際化ドメイン名" #: ../../library/codecs.rst:1633 msgid "" @@ -3212,17 +3288,20 @@ msgstr "" "ています。このモジュールは ``punycode`` エンコーディングおよび :mod:" "`stringprep` の上に構築されています。" -#: ../../library/codecs.rst:1640 msgid "" "This module builds on ``punycode``, whose algorithms scale poorly, so limit " "the length of untrusted input." msgstr "" +"このモジュールは ``punycode`` を基にしています。\n" +"そのアルゴリズムは入力が長くなると処理効率が大きく低下するため、信頼できない" +"入力の長さを制限してください。" -#: ../../library/codecs.rst:1643 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party :pypi:`idna` module." msgstr "" +":rfc:`5891` と :rfc:`5895` の IDNA 2008 規格が必要な場合は、サードパーティー" +"の :pypi:`idna` モジュールを使ってください。" #: ../../library/codecs.rst:1646 msgid "" @@ -3286,13 +3365,16 @@ msgstr "" "変換は行われません: こうしたホスト名をユーザに提供したいアプリケーションで" "は、Unicode にデコードしてやる必要があります。" -#: ../../library/codecs.rst:1674 msgid "" "The module :mod:`!encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" "insensitivity of international domain names, and to unify similar " "characters. The nameprep functions can be used directly if desired." msgstr "" +":mod:`!encodings.idna` モジュールは nameprep 手順も実装しています。\n" +"これは、国際化ドメイン名の大文字・小文字を区別しないようにし、似た文字を統一" +"するため、ホスト名に一定の正規化を行います。\n" +"必要なら nameprep 関数を直接使うこともできます。" #: ../../library/codecs.rst:1682 msgid "" @@ -3314,29 +3396,25 @@ msgstr "" msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr ":rfc:`3490` 仕様に従ってラベルを Unicode に変換します。" -#: ../../library/codecs.rst:1698 msgid ":mod:`!encodings.mbcs` --- Windows ANSI codepage" -msgstr "" +msgstr ":mod:`!encodings.mbcs` --- Windows ANSI コードページ" -#: ../../library/codecs.rst:1703 msgid "This module implements the ANSI codepage (CP_ACP)." -msgstr "" +msgstr "このモジュールは ANSI コードページ (CP_ACP) を実装しています。" -#: ../../library/codecs.rst:1707 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -"3.2 以前は *errors* 引数は無視されました; エンコードには常に ``'replace'`` " -"が、デコードには ``'ignore'`` が使われました。" +"3.2 より前は *errors* 引数が無視され、エンコードには常に ``'replace'``、デ" +"コードには ``'ignore'`` が使われていました。" #: ../../library/codecs.rst:1711 msgid "Support any error handler." msgstr "任意のエラーハンドラのサポート。" -#: ../../library/codecs.rst:1716 msgid ":mod:`!encodings.utf_8_sig` --- UTF-8 codec with BOM signature" -msgstr "" +msgstr ":mod:`!encodings.utf_8_sig` --- BOM シグネチャ付き UTF-8 codec" #: ../../library/codecs.rst:1721 msgid "" @@ -3372,42 +3450,34 @@ msgstr "ストリーム" msgid "stackable" msgstr "スタック可能" -#: ../../library/codecs.rst:341 msgid "strict" -msgstr "" +msgstr "strict" -#: ../../library/codecs.rst:341 ../../library/codecs.rst:393 -#: ../../library/codecs.rst:416 msgid "error handler's name" -msgstr "" +msgstr "エラーハンドラ名" #: ../../library/codecs.rst:341 msgid "ignore" msgstr "ignore" -#: ../../library/codecs.rst:341 msgid "replace" -msgstr "" +msgstr "replace" -#: ../../library/codecs.rst:341 msgid "backslashreplace" -msgstr "" +msgstr "backslashreplace" -#: ../../library/codecs.rst:341 msgid "surrogateescape" -msgstr "" +msgstr "surrogateescape" #: ../../library/codecs.rst:341 msgid "? (question mark)" msgstr "? (クエスチョンマーク)" -#: ../../library/codecs.rst:341 msgid "replacement character" -msgstr "" +msgstr "置換文字" -#: ../../library/codecs.rst:341 msgid "\\ (backslash)" -msgstr "" +msgstr "\\ (バックスラッシュ)" #: ../../library/codecs.rst:341 ../../library/codecs.rst:393 msgid "escape sequence" @@ -3425,14 +3495,11 @@ msgstr "\\u" msgid "\\U" msgstr "\\U" -#: ../../library/codecs.rst:393 msgid "xmlcharrefreplace" -msgstr "" +msgstr "xmlcharrefreplace" -#: ../../library/codecs.rst:393 msgid "namereplace" -msgstr "" +msgstr "namereplace" -#: ../../library/codecs.rst:416 msgid "surrogatepass" -msgstr "" +msgstr "surrogatepass" diff --git a/library/codeop.po b/library/codeop.po index d36aafdd7..cd04d9cc8 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -30,7 +30,6 @@ msgstr ":mod:`!codeop` --- Python コードをコンパイルする" msgid "**Source code:** :source:`Lib/codeop.py`" msgstr "**ソースコード:** :source:`Lib/codeop.py`" -#: ../../library/codeop.rst:11 msgid "" "The :mod:`!codeop` module provides utilities upon which the Python read-eval-" "print loop can be emulated, as is done in the :mod:`code` module. As a " @@ -38,6 +37,12 @@ msgid "" "include such a loop in your program you probably want to use the :mod:`code` " "module instead." msgstr "" +":mod:`!codeop` モジュールは、:mod:`code` モジュールが行っているように、" +"Python の read-eval-print (読み込み・評価・表示) ループをエミュレートするため" +"の機能を提供します。\n" +"通常、このモジュールを直接使う必要はありません。\n" +"そのようなループをプログラムに組み込むには、代わりに :mod:`code` モジュールを" +"使うとよいでしょう。" #: ../../library/codeop.rst:17 msgid "There are two parts to this job:" @@ -51,19 +56,19 @@ msgstr "" "入力の一行がPythonの文として完全であるかどうかを見分けられること: 簡単に言え" "ば、次が '``>>>``' か、あるいは '``...``' かどうかを見分けます。" -#: ../../library/codeop.rst:22 msgid "" "Remembering which future statements the user has entered, so subsequent " "input can be compiled with these in effect." msgstr "" -"どのfuture文をユーザが入力したのかを覚えていること。したがって、実質的にそれ" -"に続く入力をこれらとともにコンパイルすることができます。" +"ユーザーが入力した future 文を記憶し、それ以降の入力を、その指定が有効な状態" +"でコンパイルできること。" -#: ../../library/codeop.rst:25 msgid "" "The :mod:`!codeop` module provides a way of doing each of these things, and " "a way of doing them both." msgstr "" +":mod:`!codeop` モジュールは、これらを個別に行う手段と、両方をまとめて行う手段" +"を提供します。" #: ../../library/codeop.rst:28 msgid "To do just the former:" diff --git a/library/collections.abc.po b/library/collections.abc.po index 8437a07e7..c4669a875 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -54,13 +54,16 @@ msgstr "" ":func:`issubclass` や :func:`isinstance` を使ったインターフェースに対するテス" "トは、以下の3つのいずれかの方法で動作します。" -#: ../../library/collections.abc.rst:27 msgid "" "A newly written class can inherit directly from one of the abstract base " "classes. The class must supply the required abstract methods. The " "remaining mixin methods come from inheritance and can be overridden if " "desired. Other methods may be added as needed:" msgstr "" +"新しく作るクラスは、抽象基底クラスのいずれかを直接継承できます。\n" +"そのクラスでは、必須の抽象メソッドを実装しなければなりません。\n" +"残りの mixin メソッドは継承され、必要に応じてオーバーライドできます。\n" +"他のメソッドも必要に応じて追加できます:" #: ../../library/collections.abc.rst:32 msgid "" @@ -90,7 +93,6 @@ msgstr "" ">>> isinstance(C(), Sequence)\n" "True" -#: ../../library/collections.abc.rst:47 msgid "" "Existing classes and built-in classes can be registered as \"virtual " "subclasses\" of the ABCs. Those classes should define the full API " @@ -99,6 +101,13 @@ msgid "" "determine whether the full interface is supported. The exception to this " "rule is for methods that are automatically inferred from the rest of the API:" msgstr "" +"既存のクラスや組み込みクラスは、ABC の「仮想サブクラス」として登録できま" +"す。\n" +"それらのクラスでは、すべての抽象メソッドとすべての mixin メソッドを含む完全" +"な API を定義する必要があります。\n" +"これにより、利用者は :func:`issubclass` や :func:`isinstance` によるテスト" +"で、完全なインターフェースがサポートされているかどうかを判断できます。\n" +"ただし、API の他の部分から自動的に導かれるメソッドは例外です:" #: ../../library/collections.abc.rst:55 msgid "" @@ -148,11 +157,13 @@ msgstr "" "`reversed` 関数は自動的に ``__getitem__`` と ``__len__`` を使うようにフォール" "バックするからです。" -#: ../../library/collections.abc.rst:79 msgid "" "Some simple interfaces are directly recognizable by the presence of the " "required methods (unless those methods have been set to :const:`None`):" msgstr "" +"単純なインターフェースの中には、必要なメソッドが存在することによって直接認識" +"できるものもあります (ただし、それらのメソッドが :const:`None` に設定されてい" +"ない場合に限ります):" #: ../../library/collections.abc.rst:82 msgid "" @@ -368,12 +379,14 @@ msgstr ":class:`Set`" msgid ":class:`Collection`" msgstr ":class:`Collection`" -#: ../../library/collections.abc.rst:143 msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " "``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " "``__rxor__`` and ``isdisjoint``" msgstr "" +"``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " +"``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " +"``__rxor__``, ``isdisjoint``" #: ../../library/collections.abc.rst:148 msgid ":class:`MutableSet`" @@ -433,9 +446,8 @@ msgstr ":class:`MappingView`" msgid ":class:`Sized`" msgstr ":class:`Sized`" -#: ../../library/collections.abc.rst:165 msgid "``__init__``, ``__len__`` and ``__repr__``" -msgstr "" +msgstr "``__init__``, ``__len__``, ``__repr__``" #: ../../library/collections.abc.rst:166 msgid ":class:`ItemsView`" @@ -648,7 +660,6 @@ msgstr "" "読み出し専用の :term:`シーケンス ` およびミュータブルなシーケンス" "の ABC です。" -#: ../../library/collections.abc.rst:267 msgid "" "Implementation note: Some of the mixin methods, such as :meth:`~container." "__iter__`, :meth:`~object.__reversed__`, and :meth:`~sequence.index` make " @@ -658,31 +669,35 @@ msgid "" "the underlying method is linear (as it would be with a linked list), the " "mixins will have quadratic performance and will likely need to be overridden." msgstr "" +"実装上の注意: :meth:`~container.__iter__`、:meth:`~object.__reversed__`、:" +"meth:`~sequence.index` などの mixin メソッドは、基となる :meth:`~object." +"__getitem__` メソッドを繰り返し呼び出します。\n" +"そのため、:meth:`~object.__getitem__` が定数時間でアクセスできるように実装さ" +"れていれば、mixin メソッドの実行時間は線形になります。\n" +"しかし、基となるメソッドの実行時間が (連結リストの場合のように) 線形なら、" +"mixin メソッドの実行時間は二次になり、オーバーライドが必要になる可能性が高く" +"なります。" -#: ../../library/collections.abc.rst:279 msgid "Return first index of *value*." -msgstr "" +msgstr "*value* が最初に現れるインデックスを返します。" -#: ../../library/collections.abc.rst:281 msgid "Raises :exc:`ValueError` if the value is not present." -msgstr "" +msgstr "値が存在しない場合は :exc:`ValueError` を送出します。" -#: ../../library/collections.abc.rst:283 msgid "" "Supporting the *start* and *stop* arguments is optional, but recommended." -msgstr "" +msgstr "*start* と *stop* 引数のサポートは任意ですが、推奨されます。" -#: ../../library/collections.abc.rst:285 msgid "" "The :meth:`~sequence.index` method gained support for the *stop* and *start* " "arguments." msgstr "" +":meth:`~sequence.index` メソッドが *stop* と *start* 引数をサポートするように" +"なりました。" -#: ../../library/collections.abc.rst:289 msgid "The :class:`ByteString` ABC has been deprecated." -msgstr "" +msgstr ":class:`ByteString` ABC は非推奨になりました。" -#: ../../library/collections.abc.rst:292 msgid "" "Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " "implements the :ref:`buffer protocol ` at runtime. For use in " @@ -690,8 +705,12 @@ msgid "" "specifies the types your code supports (e.g., ``bytes | bytearray | " "memoryview``)." msgstr "" +"実行時に ``obj`` が :ref:`バッファプロトコル ` を実装している" +"かどうかを調べるには、``isinstance(obj, collections.abc.Buffer)`` を使ってく" +"ださい。\n" +"型アノテーションでは、:class:`Buffer` を使うか、コードがサポートする型を明示" +"した共用体 (例: ``bytes | bytearray | memoryview``) を使ってください。" -#: ../../library/collections.abc.rst:298 msgid "" ":class:`!ByteString` was originally intended to be an abstract class that " "would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " @@ -701,10 +720,16 @@ msgid "" "also never understood as subtypes of :class:`!ByteString` (either at runtime " "or by static type checkers)." msgstr "" +":class:`!ByteString` は元々、:class:`bytes` と :class:`bytearray` の両方の" +"スーパータイプとなる抽象クラスを意図していました。\n" +"しかし、この抽象基底クラスにはメソッドがなかったため、オブジェクトが :class:" +"`!ByteString` のインスタンスであると分かっても、実際には有用な情報は得られま" +"せんでした。\n" +":class:`memoryview` など、他の一般的なバッファ型も、実行時にも静的型チェッ" +"カーでも :class:`!ByteString` のサブタイプとはみなされていませんでした。" -#: ../../library/collections.abc.rst:306 msgid "See :pep:`PEP 688 <688#current-options>` for more details." -msgstr "" +msgstr "詳細は :pep:`PEP 688 <688#current-options>` を参照してください。" msgid "ABCs for read-only and mutable :ref:`sets `." msgstr "" @@ -739,7 +764,6 @@ msgstr "" ":term:`コルーチン ` オブジェクトと :class:`~collections.abc." "Coroutine` ABC のインスタンスは、いずれもこの ABC のインスタンスです。" -#: ../../library/collections.abc.rst:335 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " "decorated with :deco:`types.coroutine`) are *awaitables*, even though they " @@ -747,6 +771,12 @@ msgid "" "Awaitable)`` for them will return ``False``. Use :func:`inspect.isawaitable` " "to detect them." msgstr "" +"CPython では、ジェネレータベースのコルーチン (:deco:`types.coroutine` でデコ" +"レートされた :term:`ジェネレータ `) は、:meth:`~object.__await__` " +"メソッドを持たなくても *awaitable* です。\n" +"それらに対して ``isinstance(gencoro, Awaitable)`` を使うと ``False`` が返りま" +"す。\n" +"検出には :func:`inspect.isawaitable` を使ってください。" #: ../../library/collections.abc.rst:345 msgid "" @@ -763,7 +793,6 @@ msgstr "" "`Coroutine` のすべてのインスタンスは、 :class:`Awaitable` のインスタンスでも" "あります。" -#: ../../library/collections.abc.rst:353 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " "decorated with :deco:`types.coroutine`) are *awaitables*, even though they " @@ -771,6 +800,12 @@ msgid "" "Coroutine)`` for them will return ``False``. Use :func:`inspect.isawaitable` " "to detect them." msgstr "" +"CPython では、ジェネレータベースのコルーチン (:deco:`types.coroutine` でデコ" +"レートされた :term:`ジェネレータ `) は、:meth:`~object.__await__` " +"メソッドを持たなくても *awaitable* です。\n" +"それらに対して ``isinstance(gencoro, Coroutine)`` を使うと ``False`` が返りま" +"す。\n" +"検出には :func:`inspect.isawaitable` を使ってください。" msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" @@ -942,7 +977,6 @@ msgstr "" "meth:`~object.__le__` と :meth:`~object.__ge__` だけを再定義すれば、その他の" "演算は自動的に追随します。" -#: ../../library/collections.abc.rst:456 msgid "" "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " "value for the set; however, :meth:`~object.__hash__` is not defined because " @@ -950,6 +984,12 @@ msgid "" "using mixins, inherit from both :class:`Set` and :class:`Hashable`, then " "define ``__hash__ = Set._hash``." msgstr "" +":class:`Set` mixin は集合のハッシュ値を計算する :meth:`!_hash` メソッドを提供" +"します。\n" +"しかし、すべての集合が :term:`ハッシュ可能 ` またはイミュータブルで" +"あるとは限らないため、:meth:`~object.__hash__` は定義されていません。\n" +"mixin を使って集合をハッシュ可能にするには、:class:`Set` と :class:" +"`Hashable` の両方を継承し、``__hash__ = Set._hash`` を定義してください。" #: ../../library/collections.abc.rst:464 msgid "" diff --git a/library/collections.po b/library/collections.po index a245aa065..365d962a0 100644 --- a/library/collections.po +++ b/library/collections.po @@ -359,7 +359,6 @@ msgid "" msgstr "" "ユーザ指定のコマンドライン引数、環境変数、デフォルト値、の順に優先させる例::" -#: ../../library/collections.rst:156 msgid "" "import os, argparse\n" "\n" @@ -376,6 +375,20 @@ msgid "" "print(combined['color'])\n" "print(combined['user'])" msgstr "" +"import os, argparse\n" +"\n" +"defaults = {'color': 'red', 'user': 'guest'}\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('-u', '--user')\n" +"parser.add_argument('-c', '--color')\n" +"namespace = parser.parse_args()\n" +"command_line_args = {k: v for k, v in vars(namespace).items() if v is not " +"None}\n" +"\n" +"combined = ChainMap(command_line_args, os.environ, defaults)\n" +"print(combined['color'])\n" +"print(combined['user'])" #: ../../library/collections.rst:170 msgid "" @@ -417,7 +430,6 @@ msgstr "" "除を望むなら、チェーンの深いところで見つかったキーを更新するサブクラスを簡単" "に作れます::" -#: ../../library/collections.rst:194 msgid "" "class DeepChainMap(ChainMap):\n" " 'Variant of ChainMap that allows direct updates to inner scopes'\n" @@ -444,6 +456,30 @@ msgid "" ">>> d # display result\n" "DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})" msgstr "" +"class DeepChainMap(ChainMap):\n" +" '内側のスコープを直接更新できる ChainMap の変種'\n" +"\n" +" def __setitem__(self, key, value):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" mapping[key] = value\n" +" return\n" +" self.maps[0][key] = value\n" +"\n" +" def __delitem__(self, key):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" del mapping[key]\n" +" return\n" +" raise KeyError(key)\n" +"\n" +">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': " +"'yellow'})\n" +">>> d['lion'] = 'orange' # 2 階層下の既存のキーを更新\n" +">>> d['snake'] = 'red' # 新しいキーは最上位の辞書に追加\n" +">>> del d['elephant'] # 1 階層下の既存のキーを削除\n" +">>> d # 結果を表示\n" +"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})" #: ../../library/collections.rst:220 msgid ":class:`Counter` objects" @@ -456,7 +492,6 @@ msgid "" msgstr "" "便利で迅速な検数をサポートするカウンタツールが提供されています。例えば::" -#: ../../library/collections.rst:225 msgid "" ">>> # Tally occurrences of words in a list\n" ">>> cnt = Counter()\n" @@ -473,6 +508,20 @@ msgid "" "[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n" " ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]" msgstr "" +">>> # リスト内の単語の出現回数を数える\n" +">>> cnt = Counter()\n" +">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n" +"... cnt[word] += 1\n" +"...\n" +">>> cnt\n" +"Counter({'blue': 3, 'red': 2, 'green': 1})\n" +"\n" +">>> # Hamlet で最も頻出する単語を 10 個見つける\n" +">>> import re\n" +">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n" +">>> Counter(words).most_common(10)\n" +"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n" +" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]" #: ../../library/collections.rst:244 msgid "" @@ -569,11 +618,12 @@ msgstr "" msgid "Compute the sum of the counts." msgstr "カウントの合計を計算します。" -#: ../../library/collections.rst:328 msgid "" "The usual dictionary methods are available for :class:`Counter` objects " "except for these two which work differently for counters:" msgstr "" +"通常の辞書のメソッドは :class:`Counter` オブジェクトでも利用できますが、次の" +"二つはカウンタでは動作が異なります:" #: ../../library/collections.rst:333 msgid "This class method is not implemented for :class:`Counter` objects." @@ -622,7 +672,6 @@ msgstr "" msgid "Common patterns for working with :class:`Counter` objects::" msgstr ":class:`Counter` オブジェクトを使ったよくあるパターン::" -#: ../../library/collections.rst:359 msgid "" "c.total() # total of all counts\n" "c.clear() # reset all counts\n" @@ -634,8 +683,16 @@ msgid "" "c.most_common()[:-n-1:-1] # n least common elements\n" "+c # remove zero and negative counts" msgstr "" +"c.total() # すべてのカウントの合計\n" +"c.clear() # すべてのカウントをリセット\n" +"list(c) # 重複しない要素のリスト\n" +"set(c) # 集合に変換\n" +"dict(c) # 通常の辞書に変換\n" +"c.items() # (elem, cnt) のペアにアクセス\n" +"Counter(dict(list_of_pairs)) # (elem, cnt) のペアのリストから変換\n" +"c.most_common()[:-n-1:-1] # 出現回数が少ない方から n 個の要素\n" +"+c # 0 と負のカウントを削除" -#: ../../library/collections.rst:369 msgid "" "Several mathematical operations are provided for combining :class:`Counter` " "objects to produce multisets (counters that have counts greater than zero). " @@ -647,8 +704,16 @@ msgid "" "accept inputs with signed counts, but the output will exclude results with " "counts of zero or below." msgstr "" +":class:`Counter` オブジェクトを組み合わせて多重集合 (カウントが 0 より大きい" +"カウンタ) を作るために、いくつかの数学演算が用意されています。\n" +"加算と減算は、対応する要素のカウントを加算または減算してカウンタを組み合わせ" +"ます。\n" +"共通部分と和集合は、対応するカウントの最小値と最大値を返します。\n" +"対称差は、対応するカウントの最大値と最小値の差を返します。\n" +"等価性と包含関係の比較では、対応するカウントを比較します。\n" +"各演算には符号付きのカウントを入力できますが、出力からはカウントが 0 以下の結" +"果が除外されます。" -#: ../../library/collections.rst:379 msgid "" ">>> c = Counter(a=3, b=1)\n" ">>> d = Counter(a=1, b=2)\n" @@ -667,6 +732,22 @@ msgid "" ">>> c <= d # inclusion: c[x] <= d[x]\n" "False" msgstr "" +">>> c = Counter(a=3, b=1)\n" +">>> d = Counter(a=1, b=2)\n" +">>> c + d # 二つのカウンタを加算: c[x] + d[x]\n" +"Counter({'a': 4, 'b': 3})\n" +">>> c - d # 減算 (正のカウントのみ残す)\n" +"Counter({'a': 2})\n" +">>> c & d # 共通部分: min(c[x], d[x])\n" +"Counter({'a': 1, 'b': 1})\n" +">>> c | d # 和集合: max(c[x], d[x])\n" +"Counter({'a': 3, 'b': 2})\n" +">>> c ^ d # max(c[x], d[x]) - min(c[x], d[x])\n" +"Counter({'a': 2, 'b': 1})\n" +">>> c == d # 等価性: c[x] == d[x]\n" +"False\n" +">>> c <= d # 包含関係: c[x] <= d[x]\n" +"False" #: ../../library/collections.rst:398 msgid "" @@ -682,10 +763,9 @@ msgid "" msgstr "" "単項加算、単項減算、in-place の多重集合操作のサポートが追加されました。" -#: ../../library/collections.rst:410 msgid "" "Added support for the symmetric difference multiset operation, ``c ^ d``." -msgstr "" +msgstr "多重集合の対称差演算 ``c ^ d`` のサポートが追加されました。" #: ../../library/collections.rst:415 msgid "" @@ -790,10 +870,10 @@ msgstr "" "上げるには、 :func:`itertools.combinations_with_replacement` を参照してくださ" "い::" -#: ../../library/collections.rst:457 msgid "" "map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC" msgstr "" +"map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC" #: ../../library/collections.rst:461 msgid ":class:`deque` objects" @@ -853,21 +933,19 @@ msgstr "" "トランザクションの tracking や最近使った要素だけを残したいデータプール (pool " "of data) などにも便利です。" -#: ../../library/collections.rst:487 msgid "Deques are :ref:`generic ` over the type of their contents." msgstr "" +"deque は、要素の型をパラメータとする :ref:`ジェネリック ` です。" #: ../../library/collections.rst:490 msgid "Deque objects support the following methods:" msgstr "Deque オブジェクトは以下のようなメソッドをサポートしています:" -#: ../../library/collections.rst:494 msgid "Add *item* to the right side of the deque." -msgstr "" +msgstr "*item* を deque の右側に追加します。" -#: ../../library/collections.rst:499 msgid "Add *item* to the left side of the deque." -msgstr "" +msgstr "*item* を deque の左側に追加します。" #: ../../library/collections.rst:504 msgid "Remove all elements from the deque leaving it with length 0." @@ -877,9 +955,8 @@ msgstr "deque からすべての要素を削除し、長さを 0 にします。 msgid "Create a shallow copy of the deque." msgstr "deque の浅いコピーを作成します。" -#: ../../library/collections.rst:516 msgid "Count the number of deque elements equal to *value*." -msgstr "" +msgstr "deque 内で *value* と等しい要素の数を数えます。" #: ../../library/collections.rst:523 msgid "" @@ -897,16 +974,17 @@ msgstr "" "イテラブルな引数 iterable から得られる要素を deque の左側に追加し拡張します。" "注意: 左から追加した結果は、イテラブルな引数の順序とは逆になります。" -#: ../../library/collections.rst:536 msgid "" "Return the position of *value* in the deque (at or after index *start* and " "before index *stop*). Returns the first match or raises :exc:`ValueError` " "if not found." msgstr "" +"deque 内の *value* の位置 (インデックス *start* 以上、インデックス *stop* 未" +"満) を返します。\n" +"最初に一致した位置を返し、見つからない場合は :exc:`ValueError` を送出します。" -#: ../../library/collections.rst:545 msgid "Insert *value* into the deque at position *index*." -msgstr "" +msgstr "deque の位置 *index* に *value* を挿入します。" #: ../../library/collections.rst:547 msgid "" @@ -997,7 +1075,6 @@ msgstr "" msgid "Example:" msgstr "例:" -#: ../../library/collections.rst:608 msgid "" ">>> from collections import deque\n" ">>> d = deque('ghi') # make a new deque with three items\n" @@ -1052,6 +1129,56 @@ msgid "" ">>> d\n" "deque(['c', 'b', 'a'])" msgstr "" +">>> from collections import deque\n" +">>> d = deque('ghi') # 3 要素の deque を新しく作成\n" +">>> for elem in d: # deque の要素を反復処理\n" +"... print(elem.upper())\n" +"G\n" +"H\n" +"I\n" +"\n" +">>> d.append('j') # 新しい要素を右側に追加\n" +">>> d.appendleft('f') # 新しい要素を左側に追加\n" +">>> d # deque の表現を表示\n" +"deque(['f', 'g', 'h', 'i', 'j'])\n" +"\n" +">>> d.pop() # 右端の要素を返して削除\n" +"'j'\n" +">>> d.popleft() # 左端の要素を返して削除\n" +"'f'\n" +">>> list(d) # deque の内容をリストにする\n" +"['g', 'h', 'i']\n" +">>> d[0] # 左端の要素を見る\n" +"'g'\n" +">>> d[-1] # 右端の要素を見る\n" +"'i'\n" +"\n" +">>> list(reversed(d)) # deque の内容を逆順のリストにする\n" +"['i', 'h', 'g']\n" +">>> 'h' in d # deque を検索\n" +"True\n" +">>> d.extend('jkl') # 複数の要素を一度に追加\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +">>> d.rotate(1) # 右にローテート\n" +">>> d\n" +"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n" +">>> d.rotate(-1) # 左にローテート\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +"\n" +">>> deque(reversed(d)) # 逆順の deque を新しく作成\n" +"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n" +">>> d.clear() # deque を空にする\n" +">>> d.pop() # 空の deque からは取り出せない\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" d.pop()\n" +"IndexError: pop from an empty deque\n" +"\n" +">>> d.extendleft('abc') # extendleft() は入力の順序を反転する\n" +">>> d\n" +"deque(['c', 'b', 'a'])" #: ../../library/collections.rst:663 msgid ":class:`deque` Recipes" @@ -1069,13 +1196,16 @@ msgstr "" "長さが制限された deque は Unix における ``tail`` フィルタに相当する機能を提供" "します::" -#: ../../library/collections.rst:670 msgid "" "def tail(filename, n=10):\n" " 'Return the last n lines of a file'\n" " with open(filename) as f:\n" " return deque(f, n)" msgstr "" +"def tail(filename, n=10):\n" +" 'ファイルの末尾 n 行を返す'\n" +" with open(filename) as f:\n" +" return deque(f, n)" #: ../../library/collections.rst:675 msgid "" @@ -1085,7 +1215,6 @@ msgstr "" "deque を使用する別のアプローチは、右に要素を追加し左から要素を取り出すことで" "最近追加した要素のシーケンスを保持することです::" -#: ../../library/collections.rst:678 msgid "" "def moving_average(iterable, n=3):\n" " # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n" @@ -1099,8 +1228,18 @@ msgid "" " d.append(elem)\n" " yield s / n" msgstr "" +"def moving_average(iterable, n=3):\n" +" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n" +" # https://en.wikipedia.org/wiki/Moving_average\n" +" it = iter(iterable)\n" +" d = deque(itertools.islice(it, n-1))\n" +" d.appendleft(0)\n" +" s = sum(d)\n" +" for elem in it:\n" +" s += elem - d.popleft()\n" +" d.append(elem)\n" +" yield s / n" -#: ../../library/collections.rst:690 msgid "" "A `round-robin scheduler `_ can be implemented with input iterators stored in a :" @@ -1109,8 +1248,13 @@ msgid "" "`~deque.popleft`; otherwise, it can be cycled back to the end with the :meth:" "`~deque.rotate` method::" msgstr "" +"入力イテレータを :class:`deque` に格納すると、`ラウンドロビンスケジューラ " +"`_ を実装できます。\n" +"位置 0 にあるアクティブなイテレータから値を yield します。\n" +"そのイテレータが :term:`使い果たされた ` 場合は :meth:`~deque." +"popleft` で削除でき、それ以外の場合は :meth:`~deque.rotate` メソッドで末尾に" +"戻せます。 ::" -#: ../../library/collections.rst:697 msgid "" "def roundrobin(*iterables):\n" " \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n" @@ -1124,6 +1268,17 @@ msgid "" " # Remove an exhausted iterator.\n" " iterators.popleft()" msgstr "" +"def roundrobin(*iterables):\n" +" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n" +" iterators = deque(map(iter, iterables))\n" +" while iterators:\n" +" try:\n" +" while True:\n" +" yield next(iterators[0])\n" +" iterators.rotate(-1)\n" +" except StopIteration:\n" +" # 使い果たされたイテレータを削除\n" +" iterators.popleft()" msgid "" "The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " @@ -1135,13 +1290,16 @@ msgstr "" "例えば、``del d[n]`` を純粋な Python で実装するには、``rotate()`` メソッドで" "削除対象の要素を取り出せる位置に移動します。 ::" -#: ../../library/collections.rst:713 msgid "" "def delete_nth(d, n):\n" " d.rotate(-n)\n" " d.popleft()\n" " d.rotate(n)" msgstr "" +"def delete_nth(d, n):\n" +" d.rotate(-n)\n" +" d.popleft()\n" +" d.rotate(n)" #: ../../library/collections.rst:718 msgid "" @@ -1186,11 +1344,12 @@ msgstr "" "``None`` です。残りの引数はキーワード引数も含め、 :class:`dict` のコンストラ" "クタに与えられた場合と同様に扱われます。" -#: ../../library/collections.rst:744 msgid "" ":class:`!defaultdict`\\s are :ref:`generic ` over two types, " "signifying (respectively) the types of the dictionary's keys and values." msgstr "" +":class:`!defaultdict` は、辞書のキーと値の型をそれぞれ表す二つの型をパラメー" +"タとする :ref:`ジェネリック ` です。" #: ../../library/collections.rst:748 msgid "" @@ -1478,7 +1637,6 @@ msgstr "" "*defaults* 引数と :attr:`~somenamedtuple._field_defaults` 属性が追加されまし" "た。" -#: ../../library/collections.rst:921 msgid "" ">>> # Basic example\n" ">>> Point = namedtuple('Point', ['x', 'y'])\n" @@ -1494,6 +1652,20 @@ msgid "" ">>> p # readable __repr__ with a name=value style\n" "Point(x=11, y=22)" msgstr "" +">>> # 基本的な例\n" +">>> Point = namedtuple('Point', ['x', 'y'])\n" +">>> p = Point(11, y=22) # 位置引数またはキーワード引数でインスタンスを作" +"成\n" +">>> p[0] + p[1] # 通常のタプル (11, 22) と同様にインデックスでア" +"クセス可能\n" +"33\n" +">>> x, y = p # 通常のタプルと同様にアンパック\n" +">>> x, y\n" +"(11, 22)\n" +">>> p.x + p.y # フィールドには名前でもアクセス可能\n" +"33\n" +">>> p # name=value 形式の読みやすい __repr__\n" +"Point(x=11, y=22)" #: ../../library/collections.rst:937 msgid "" @@ -1538,12 +1710,14 @@ msgid "" msgstr "" "既存の sequence や Iterable から新しいインスタンスを作るクラスメソッド." -#: ../../library/collections.rst:961 msgid "" ">>> t = [11, 22]\n" ">>> Point._make(t)\n" "Point(x=11, y=22)" msgstr "" +">>> t = [11, 22]\n" +">>> Point._make(t)\n" +"Point(x=11, y=22)" #: ../../library/collections.rst:969 msgid "" @@ -1552,12 +1726,14 @@ msgid "" msgstr "" "フィールド名を対応する値にマッピングする新しい :class:`dict` を返します::" -#: ../../library/collections.rst:972 msgid "" ">>> p = Point(x=11, y=22)\n" ">>> p._asdict()\n" "{'x': 11, 'y': 22}" msgstr "" +">>> p = Point(x=11, y=22)\n" +">>> p._asdict()\n" +"{'x': 11, 'y': 22}" #: ../../library/collections.rst:978 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." @@ -1584,7 +1760,6 @@ msgstr "" "指定されたフィールドを新しい値で置き換えた、新しい名前付きタプルを作って返し" "ます::" -#: ../../library/collections.rst:993 msgid "" ">>> p = Point(x=11, y=22)\n" ">>> p._replace(x=33)\n" @@ -1594,6 +1769,13 @@ msgid "" "... inventory[partnum] = record._replace(price=newprices[partnum], " "timestamp=time.now())" msgstr "" +">>> p = Point(x=11, y=22)\n" +">>> p._replace(x=33)\n" +"Point(x=33, y=22)\n" +"\n" +">>> for partnum, record in inventory.items():\n" +"... inventory[partnum] = record._replace(price=newprices[partnum], " +"timestamp=time.now())" #: ../../library/collections.rst:1000 msgid "" @@ -1617,7 +1799,6 @@ msgstr "" "フィールド名をリストにしたタプルです。内省 (introspection) したり、既存の名前" "付きタプルをもとに新しい名前つきタプルを作成する時に便利です。" -#: ../../library/collections.rst:1011 msgid "" ">>> p._fields # view the field names\n" "('x', 'y')\n" @@ -1627,12 +1808,18 @@ msgid "" ">>> Pixel(11, 22, 128, 255, 0)\n" "Pixel(x=11, y=22, red=128, green=255, blue=0)" msgstr "" +">>> p._fields # フィールド名を表示\n" +"('x', 'y')\n" +"\n" +">>> Color = namedtuple('Color', 'red green blue')\n" +">>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)\n" +">>> Pixel(11, 22, 128, 255, 0)\n" +"Pixel(x=11, y=22, red=128, green=255, blue=0)" #: ../../library/collections.rst:1023 msgid "Dictionary mapping field names to default values." msgstr "フィールド名からデフォルト値への対応を持つ辞書です。" -#: ../../library/collections.rst:1025 msgid "" ">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" ">>> Account._field_defaults\n" @@ -1640,6 +1827,11 @@ msgid "" ">>> Account('premium')\n" "Account(type='premium', balance=0)" msgstr "" +">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" +">>> Account._field_defaults\n" +"{'balance': 0}\n" +">>> Account('premium')\n" +"Account(type='premium', balance=0)" #: ../../library/collections.rst:1033 msgid "" @@ -1667,7 +1859,6 @@ msgstr "" "のは容易です。次の例では計算済みフィールドと固定幅の print format を追加して" "います:" -#: ../../library/collections.rst:1050 msgid "" ">>> class Point(namedtuple('Point', ['x', 'y'])):\n" "... __slots__ = ()\n" @@ -1683,6 +1874,19 @@ msgid "" "Point: x= 3.000 y= 4.000 hypot= 5.000\n" "Point: x=14.000 y= 0.714 hypot=14.018" msgstr "" +">>> class Point(namedtuple('Point', ['x', 'y'])):\n" +"... __slots__ = ()\n" +"... @property\n" +"... def hypot(self):\n" +"... return (self.x ** 2 + self.y ** 2) ** 0.5\n" +"... def __str__(self):\n" +"... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, " +"self.hypot)\n" +"\n" +">>> for p in Point(3, 4), Point(14, 5/7):\n" +"... print(p)\n" +"Point: x= 3.000 y= 4.000 hypot= 5.000\n" +"Point: x=14.000 y= 0.714 hypot=14.018" #: ../../library/collections.rst:1065 msgid "" @@ -1725,13 +1929,16 @@ msgstr "" "NamedTuple` を参照してください。\n" ":keyword:`class` キーワードを使った洗練された記法も紹介されています::" -#: ../../library/collections.rst:1091 msgid "" "class Component(NamedTuple):\n" " part_number: int\n" " weight: float\n" " description: Optional[str] = None" msgstr "" +"class Component(NamedTuple):\n" +" part_number: int\n" +" weight: float\n" +" description: Optional[str] = None" #: ../../library/collections.rst:1096 msgid "" @@ -1840,13 +2047,12 @@ msgstr "" "は ``(k := next(iter(d)), d.pop(k))`` で実現できます。これにより、該当する要" "素のうちで最も左側の (先頭の) ものを辞書から削除して返すことができます。" -#: ../../library/collections.rst:1140 msgid "" ":class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to " "efficiently reposition an element to an endpoint." msgstr "" -":class:`OrderedDict` には、 効率的に要素を末尾に置き直す :meth:`~OrderedDict." -"move_to_end` メソッドがあります。" +":class:`OrderedDict` には、要素を先頭または末尾に効率よく移動する :meth:" +"`~OrderedDict.move_to_end` メソッドがあります。" #: ../../library/collections.rst:1143 msgid "" @@ -1867,12 +2073,11 @@ msgstr "" "OrderedDict の ``od.move_to_end(k, last=False)`` を実現する効率の良い方法はあ" "りません。" -#: ../../library/collections.rst:1151 msgid "" "Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method." msgstr "" -"Python 3.8 以前は、 :class:`dict` には :meth:`~object.__reversed__` メソッド" -"が欠けています。" +"Python 3.8 より前の :class:`dict` には :meth:`~object.__reversed__` メソッド" +"がありませんでした。" #: ../../library/collections.rst:1158 msgid "" @@ -1904,7 +2109,6 @@ msgstr "" "場合には先頭に移動します。指定した *key* が存在しない場合は :exc:`KeyError` " "を送出します。" -#: ../../library/collections.rst:1177 msgid "" ">>> d = OrderedDict.fromkeys('abcde')\n" ">>> d.move_to_end('b')\n" @@ -1914,6 +2118,13 @@ msgid "" ">>> ''.join(d)\n" "'bacde'" msgstr "" +">>> d = OrderedDict.fromkeys('abcde')\n" +">>> d.move_to_end('b')\n" +">>> ''.join(d)\n" +"'acdeb'\n" +">>> d.move_to_end('b', last=False)\n" +">>> ''.join(d)\n" +"'bacde'" #: ../../library/collections.rst:1189 msgid "" @@ -1923,19 +2134,23 @@ msgstr "" "通常のマッピングのメソッドに加え、順序付き辞書は :func:`reversed` による逆順" "の反復もサポートしています。" -#: ../../library/collections.rst:1194 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " "are roughly equivalent to ``list(od1.items())==list(od2.items())``." msgstr "" +":class:`OrderedDict` オブジェクト同士の等価性の比較は順序を考慮し、ほぼ " +"``list(od1.items())==list(od2.items())`` と等価です。" -#: ../../library/collections.rst:1197 msgid "" "Equality tests between :class:`OrderedDict` objects and other :class:" "`~collections.abc.Mapping` objects are order-insensitive like regular " "dictionaries. This allows :class:`OrderedDict` objects to be substituted " "anywhere a regular dictionary is used." msgstr "" +":class:`OrderedDict` オブジェクトと他の :class:`~collections.abc.Mapping` オ" +"ブジェクトの等価性の比較では、通常の辞書と同様に順序は考慮されません。\n" +"このため、通常の辞書を使う場所ならどこでも :class:`OrderedDict` オブジェクト" +"で置き換えられます。" #: ../../library/collections.rst:1202 msgid "" @@ -1969,7 +2184,6 @@ msgstr "" "簡単です。\n" "新しい値が既存の値を上書きする場合、元々の挿入位置が最後尾へ変更されます::" -#: ../../library/collections.rst:1223 msgid "" "class LastUpdatedOrderedDict(OrderedDict):\n" " 'Store items in the order that the keys were last updated.'\n" @@ -1978,14 +2192,20 @@ msgid "" " super().__setitem__(key, value)\n" " self.move_to_end(key)" msgstr "" +"class LastUpdatedOrderedDict(OrderedDict):\n" +" 'キーが最後に更新された順に要素を保存する'\n" +"\n" +" def __setitem__(self, key, value):\n" +" super().__setitem__(key, value)\n" +" self.move_to_end(key)" -#: ../../library/collections.rst:1230 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "deco:`functools.lru_cache`:" msgstr "" +":class:`OrderedDict` は、:deco:`functools.lru_cache` の変種を実装する際にも役" +"立ちます:" -#: ../../library/collections.rst:1233 msgid "" "from collections import OrderedDict\n" "from time import monotonic\n" @@ -2011,8 +2231,30 @@ msgid "" " self.cache.popitem(last=False)\n" " return result" msgstr "" +"from collections import OrderedDict\n" +"from time import monotonic\n" +"\n" +"class TimeBoundedLRU:\n" +" \"古いエントリーを無効化して更新する LRU キャッシュ\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxage=30):\n" +" self.cache = OrderedDict() # { args : (timestamp, result)}\n" +" self.func = func\n" +" self.maxsize = maxsize\n" +" self.maxage = maxage\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" timestamp, result = self.cache[args]\n" +" if monotonic() - timestamp <= self.maxage:\n" +" return result\n" +" result = self.func(*args)\n" +" self.cache[args] = monotonic(), result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(last=False)\n" +" return result" -#: ../../library/collections.rst:1260 msgid "" "class MultiHitLRUCache:\n" " \"\"\" LRU cache that defers caching a result until\n" @@ -2049,6 +2291,41 @@ msgid "" " self.cache.popitem(last=False)\n" " return result" msgstr "" +"class MultiHitLRUCache:\n" +" \"\"\" 結果が複数回要求されるまで\n" +" キャッシュへの保存を遅らせる LRU キャッシュ。\n" +"\n" +"\n" +" 一度しか要求されない結果で LRU キャッシュが置き換わるのを防ぐため、\n" +" 同じ要求が複数回行われるまでキャッシュに保存しない。\n" +"\n" +"\n" +" \"\"\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxrequests=4096, cache_after=1):\n" +" self.requests = OrderedDict() # { uncached_key : request_count }\n" +" self.cache = OrderedDict() # { cached_key : function_result }\n" +" self.func = func\n" +" self.maxrequests = maxrequests # キャッシュにない要求の最大数\n" +" self.maxsize = maxsize # 保存する戻り値の最大数\n" +" self.cache_after = cache_after\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" return self.cache[args]\n" +" result = self.func(*args)\n" +" self.requests[args] = self.requests.get(args, 0) + 1\n" +" if self.requests[args] <= self.cache_after:\n" +" self.requests.move_to_end(args)\n" +" if len(self.requests) > self.maxrequests:\n" +" self.requests.popitem(last=False)\n" +" else:\n" +" self.requests.pop(args, None)\n" +" self.cache[args] = result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(last=False)\n" +" return result" #: ../../library/collections.rst:1329 msgid ":class:`UserDict` objects" @@ -2066,36 +2343,44 @@ msgstr "" "取って代わられました; しかし、根底の辞書に属性としてアクセスできるので、この" "クラスを使った方が簡単になることもあります。" -#: ../../library/collections.rst:1341 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" "class:`!UserDict` instances. If arguments are provided, they are used to " "initialize :attr:`data`, like a regular dictionary." msgstr "" +"辞書をシミュレートするクラスです。\n" +"インスタンスの内容は通常の辞書に保存され、:class:`!UserDict` インスタンスの :" +"attr:`data` 属性を通してアクセスできます。\n" +"引数が指定された場合は、通常の辞書と同様に :attr:`data` の初期化に使われま" +"す。" -#: ../../library/collections.rst:1346 msgid "" "In addition to supporting the methods and operations of mappings, :class:`!" "UserDict` instances provide the following attribute:" msgstr "" +"マッピングのメソッドと演算をサポートするのに加え、:class:`!UserDict` インスタ" +"ンスは次の属性を提供します:" #: ../../library/collections.rst:1351 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr ":class:`UserDict` クラスの内容を保存するために使われる実際の辞書です。" -#: ../../library/collections.rst:1354 msgid ":class:`!UserDict` instances also override the following method:" -msgstr "" +msgstr ":class:`!UserDict` インスタンスは、次のメソッドもオーバーライドします:" -#: ../../library/collections.rst:1358 msgid "" "Remove and return a ``(key, value)`` pair from the wrapped dictionary. Pairs " "are returned in the same order as ``data.popitem()``. (For the default :meth:" "`dict.popitem`, this order is :abbr:`LIFO (last-in, first-out)`.) If the " "dictionary is empty, raises a :exc:`KeyError`." msgstr "" +"ラップしている辞書から ``(key, value)`` のペアを削除して返します。\n" +"ペアは ``data.popitem()`` と同じ順序で返されます (デフォルトの :meth:`dict." +"popitem` の場合、この順序は :abbr:`LIFO (last-in, first-out, 後入先出)` で" +"す)。\n" +"辞書が空の場合は :exc:`KeyError` を送出します。" #: ../../library/collections.rst:1364 msgid ":class:`UserList` objects" diff --git a/library/colorsys.po b/library/colorsys.po index a79ed505f..0ddb920b1 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -30,7 +30,6 @@ msgstr ":mod:`!colorsys` --- 色体系間の変換" msgid "**Source code:** :source:`Lib/colorsys.py`" msgstr "**ソースコード:** :source:`Lib/colorsys.py`" -#: ../../library/colorsys.rst:11 msgid "" "The :mod:`!colorsys` module defines bidirectional conversions of color " "values between colors expressed in the RGB (Red Green Blue) color space used " @@ -40,17 +39,26 @@ msgid "" "coordinate is between 0 and 1, but the I and Q coordinates can be positive " "or negative. In all other spaces, the coordinates are all between 0 and 1." msgstr "" +":mod:`!colorsys` モジュールは、コンピュータのモニターで使われる RGB (Red " +"Green Blue: 赤・緑・青) 色空間と、他の三つの座標系である YIQ、HLS (Hue " +"Lightness Saturation: 色相・明度・彩度)、HSV (Hue Saturation Value: 色相・彩" +"度・明度) との間で、色の値を双方向に変換する関数を定義しています。\n" +"これらの色空間の座標はすべて浮動小数点数です。\n" +"YIQ 空間では、Y 座標は 0 から 1 の範囲ですが、I 座標と Q 座標は正にも負にもな" +"ります。\n" +"それ以外の空間では、すべての座標が 0 から 1 の範囲です。" -#: ../../library/colorsys.rst:21 msgid "" "More information about color spaces can be found at https://www.poynton.ca/" "pdf/ColourFAQ.pdf and https://www.cambridgeincolour.com/tutorials/color-" "spaces.htm." msgstr "" +"色空間について詳しくは、https://www.poynton.ca/pdf/ColourFAQ.pdf および " +"https://www.cambridgeincolour.com/tutorials/color-spaces.htm を参照してくださ" +"い。" -#: ../../library/colorsys.rst:25 msgid "The :mod:`!colorsys` module defines the following functions:" -msgstr "" +msgstr ":mod:`!colorsys` モジュールは、以下の関数を定義しています:" #: ../../library/colorsys.rst:30 msgid "Convert the color from RGB coordinates to YIQ coordinates." @@ -80,7 +88,6 @@ msgstr "HSV から RGB に変換します。" msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/colorsys.rst:59 msgid "" ">>> import colorsys\n" ">>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)\n" @@ -88,3 +95,8 @@ msgid "" ">>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)\n" "(0.2, 0.4, 0.4)" msgstr "" +">>> import colorsys\n" +">>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)\n" +"(0.5, 0.5, 0.4)\n" +">>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)\n" +"(0.2, 0.4, 0.4)" diff --git a/library/compileall.po b/library/compileall.po index 93f9bb792..a5f93fe0e 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -111,25 +111,25 @@ msgstr "" "る時点でソースファイルが存在しない場合に、トレースバックやその他のメッセージ" "に使われるバイトコードファイルにもコンパイルされます。" -#: ../../library/compileall.rst:60 msgid "" "Remove the given prefix from paths recorded in the ``.pyc`` files. Paths are " "made relative to the prefix." msgstr "" +"``.pyc`` ファイルに記録するパスから、指定された接頭辞を取り除きます。\n" +"パスはその接頭辞からの相対パスになります。" -#: ../../library/compileall.rst:63 msgid "This option can be used with ``-p`` but not with ``-d``." -msgstr "" +msgstr "このオプションは ``-p`` と併用できますが、``-d`` とは併用できません。" -#: ../../library/compileall.rst:67 msgid "" "Prepend the given prefix to paths recorded in the ``.pyc`` files. Use ``-p /" "`` to make the paths absolute." msgstr "" +"``.pyc`` ファイルに記録するパスの先頭に、指定された接頭辞を追加します。\n" +"パスを絶対パスにするには ``-p /`` を使ってください。" -#: ../../library/compileall.rst:70 msgid "This option can be used with ``-s`` but not with ``-d``." -msgstr "" +msgstr "このオプションは ``-s`` と併用できますが、``-d`` とは併用できません。" #: ../../library/compileall.rst:74 msgid "" @@ -173,11 +173,13 @@ msgstr "" ":program:`python -m compileall -r 0` は :program:`python -m " "compileall -l` と等価です。" -#: ../../library/compileall.rst:99 msgid "" "Use *N* workers to compile the files within the given directory. If ``0`` is " "used, then the result of :func:`os.process_cpu_count` will be used." msgstr "" +"指定されたディレクトリ内のファイルを *N* 個のワーカーを使ってコンパイルしま" +"す。\n" +"``0`` を指定すると、:func:`os.process_cpu_count` の結果が使われます。" msgid "" "Control how the generated byte-code files are invalidated at runtime. The " @@ -203,47 +205,52 @@ msgstr "" "``timestamp`` で、``SOURCE_DATE_EPOCH`` 環境変数が設定されていれば、" "``checked-hash`` になります。" -#: ../../library/compileall.rst:118 msgid "" "Compile with the given optimization level. May be used multiple times to " "compile for multiple levels at a time (for example, ``compileall -o 1 -o " "2``)." msgstr "" +"指定された最適化レベルでコンパイルします。\n" +"複数回指定すると、複数のレベルで一度にコンパイルできます (例: ``compileall -" +"o 1 -o 2``)。" -#: ../../library/compileall.rst:124 msgid "Ignore symlinks pointing outside the given directory." -msgstr "" +msgstr "指定されたディレクトリの外を指すシンボリックリンクを無視します。" -#: ../../library/compileall.rst:128 msgid "" "If two ``.pyc`` files with different optimization level have the same " "content, use hard links to consolidate duplicate files." msgstr "" +"最適化レベルが異なる二つの ``.pyc`` ファイルの内容が同じ場合、ハードリンクを" +"使って重複するファイルをまとめます。" #: ../../library/compileall.rst:131 msgid "Added the ``-i``, ``-b`` and ``-h`` options." msgstr "``-i``, ``-b``, ``-h`` オプションを追加。" -#: ../../library/compileall.rst:134 msgid "" "Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed " "to a multilevel value. ``-b`` will always produce a byte-code file ending " "in ``.pyc``, never ``.pyo``." msgstr "" -"``-j``, ``-r``, ``-qq`` オプションが追加されました。``-q`` オプションが複数の" -"レベルの値に変更されました。``-b`` は常に拡張子 ``.pyc`` のバイトエンコーディ" -"ングファイルを生成し、``.pyo`` を作りません。" +"``-j``、``-r``、``-qq`` オプションが追加されました。\n" +"``-q`` オプションが複数のレベルの値を取るように変更されました。\n" +"``-b`` は常に拡張子が ``.pyc`` のバイトコードファイルを生成し、``.pyo`` は生" +"成しません。" #: ../../library/compileall.rst:139 msgid "Added the ``--invalidation-mode`` option." msgstr "``--invalidation-mode`` オプションが追加されました。" -#: ../../library/compileall.rst:142 msgid "" "Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised " "the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. " "Added the possibility to specify the ``-o`` option multiple times." msgstr "" +"``-s``、``-p``、``-e``、``--hardlink-dupes`` オプションが追加されました。\n" +"デフォルトの再帰上限が 10 から :py:func:`sys.getrecursionlimit()` に引き上げ" +"られました。\n" +"``-o`` オプションを複数回指定できるようになりました。" #: ../../library/compileall.rst:149 msgid "" @@ -255,13 +262,17 @@ msgstr "" "ンはありません。 Python インタプリタ自体のオプションを使ってください: :" "program:`python -O -m compileall`." -#: ../../library/compileall.rst:153 msgid "" "Similarly, the :func:`compile` function respects the :data:`sys." "pycache_prefix` setting. The generated bytecode cache will only be useful " "if :func:`compile` is run with the same :data:`sys.pycache_prefix` (if any) " "that will be used at runtime." msgstr "" +"同様に、:func:`compile` 関数は :data:`sys.pycache_prefix` の設定に従いま" +"す。\n" +"生成されたバイトコードキャッシュを利用するには、:func:`compile` の実行時と" +"コードの実行時で :data:`sys.pycache_prefix` の設定を揃える必要があります (設" +"定しない場合も同様です)。" #: ../../library/compileall.rst:159 msgid "Public functions" @@ -307,13 +318,17 @@ msgstr "" "*force* が真の場合、タイムスタンプが最新のであってもモジュールは再コンパイル" "されます。" -#: ../../library/compileall.rst:179 msgid "" "If *rx* is given, its ``search`` method is called on the complete path to " "each file considered for compilation, and if it returns a true value, the " "file is skipped. This can be used to exclude files matching a regular " "expression, given as a :ref:`re.Pattern ` object." msgstr "" +"*rx* が指定された場合、コンパイル対象の各ファイルの完全なパスを引数として、そ" +"の ``search`` メソッドを呼び出します。\n" +"真の値が返された場合、そのファイルはスキップされます。\n" +":ref:`re.Pattern ` オブジェクトとして渡した正規表現にマッチする" +"ファイルを除外するために使えます。" #: ../../library/compileall.rst:184 ../../library/compileall.rst:261 msgid "" @@ -339,15 +354,17 @@ msgstr "" "す。デフォルトは :pep:`3147` で決められた場所と名前を使い、複数のバージョン" "の Python のバイトコードファイルが共存できるようにします。" -#: ../../library/compileall.rst:194 ../../library/compileall.rst:271 msgid "" "*optimize* specifies the optimization level for the compiler. It is passed " "to the built-in :func:`compile` function. Accepts also a sequence of " "optimization levels which lead to multiple compilations of one :file:`.py` " "file in one call." msgstr "" +"*optimize* はコンパイラの最適化レベルを指定します。\n" +"この値は組み込みの :func:`compile` 関数に渡されます。\n" +"最適化レベルのシーケンスも受け付け、その場合は一回の呼び出しで一つの :file:`." +"py` ファイルを複数回コンパイルします。" -#: ../../library/compileall.rst:198 msgid "" "The argument *workers* specifies how many workers are used to compile files " "in parallel. The default is to not use multiple workers. If the platform " @@ -356,6 +373,12 @@ msgid "" "cores in the system is used. If *workers* is lower than ``0``, a :exc:" "`ValueError` will be raised." msgstr "" +"*workers* 引数は、ファイルを並列にコンパイルするワーカーの数を指定します。\n" +"デフォルトでは複数のワーカーを使いません。\n" +"複数のワーカーを使えないプラットフォームで *workers* 引数が指定された場合は、" +"逐次コンパイルにフォールバックします。\n" +"*workers* が 0 の場合は、システムのコア数が使われます。\n" +"*workers* が ``0`` より小さい場合は :exc:`ValueError` を送出します。" #: ../../library/compileall.rst:205 ../../library/compileall.rst:275 msgid "" @@ -366,19 +389,22 @@ msgstr "" "*invalidation_mode* は、:class:`py_compile.PycInvalidationMode` のメンバーで" "なければならず、生成されたpycファイルを実行時に無効化する方法を制御します。" -#: ../../library/compileall.rst:209 ../../library/compileall.rst:279 msgid "" "The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the " "``-s``, ``-p`` and ``-e`` options described above. They may be specified as " "``str`` or :py:class:`os.PathLike`." msgstr "" +"*stripdir*、*prependdir*、*limit_sl_dest* 引数は、それぞれ上で説明した ``-" +"s``、``-p``、``-e`` オプションに対応します。\n" +"``str`` または :py:class:`os.PathLike` として指定できます。" -#: ../../library/compileall.rst:213 ../../library/compileall.rst:283 msgid "" "If *hardlink_dupes* is true and two ``.pyc`` files with different " "optimization level have the same content, use hard links to consolidate " "duplicate files." msgstr "" +"*hardlink_dupes* が真で、最適化レベルが異なる二つの ``.pyc`` ファイルの内容が" +"同じ場合、ハードリンクを使って重複するファイルをまとめます。" #: ../../library/compileall.rst:216 ../../library/compileall.rst:314 msgid "Added the *legacy* and *optimize* parameter." @@ -411,22 +437,24 @@ msgstr ":term:`path-like object` を受け入れるようになりました。" msgid "The *invalidation_mode* parameter was added." msgstr "*invalidation_mode* 引数を追加しました。" -#: ../../library/compileall.rst:235 ../../library/compileall.rst:298 -#: ../../library/compileall.rst:327 msgid "" "The *invalidation_mode* parameter's default value is updated to ``None``." msgstr "" +"*invalidation_mode* パラメータのデフォルト値が ``None`` に変更されました。" -#: ../../library/compileall.rst:238 msgid "Setting *workers* to 0 now chooses the optimal number of cores." msgstr "" +"*workers* を 0 に設定すると、最適なコア数が選択されるようになりました。" -#: ../../library/compileall.rst:241 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments. Default value of *maxlevels* was changed from ``10`` to ``sys." "getrecursionlimit()``" msgstr "" +"*stripdir*、*prependdir*、*limit_sl_dest*、*hardlink_dupes* 引数が追加されま" +"した。\n" +"*maxlevels* のデフォルト値が ``10`` から ``sys.getrecursionlimit()`` に変更さ" +"れました。" #: ../../library/compileall.rst:247 msgid "" @@ -449,7 +477,6 @@ msgstr "" "ルが実行される時点でソースファイルが存在しない場合に、トレースバックやその他" "のメッセージに使われるバイトコードファイルにもコンパイルされます。" -#: ../../library/compileall.rst:256 msgid "" "If *rx* is given, its ``search`` method is passed the full path name to the " "file being compiled, and if it returns a true value, the file is not " @@ -457,6 +484,12 @@ msgid "" "matching a regular expression, given as a :ref:`re.Pattern ` " "object." msgstr "" +"*rx* が指定された場合、コンパイル対象のファイルの完全なパス名を、その " +"``search`` メソッドに渡します。\n" +"真の値が返された場合、そのファイルはコンパイルされず、``True`` が返されま" +"す。\n" +":ref:`re.Pattern ` オブジェクトとして渡した正規表現にマッチする" +"ファイルを除外するために使えます。" #: ../../library/compileall.rst:301 msgid "" @@ -498,7 +531,6 @@ msgstr "" ":file:`Lib/` ディレクトリ以下にある全ての :file:`.py` ファイルを強制的に再コ" "ンパイルするには、以下のようにします::" -#: ../../library/compileall.rst:333 msgid "" "import compileall\n" "\n" @@ -512,6 +544,17 @@ msgid "" "import pathlib\n" "compileall.compile_dir(pathlib.Path('Lib/'), force=True)" msgstr "" +"import compileall\n" +"\n" +"compileall.compile_dir('Lib/', force=True)\n" +"\n" +"# .svn ディレクトリ内のファイルを除外して同じコンパイルを実行\n" +"import re\n" +"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), force=True)\n" +"\n" +"# pathlib.Path オブジェクトも使用可能\n" +"import pathlib\n" +"compileall.compile_dir(pathlib.Path('Lib/'), force=True)" #: ../../library/compileall.rst:347 msgid "Module :mod:`py_compile`" diff --git a/library/compression.po b/library/compression.po index d2ce6d994..039538eab 100644 --- a/library/compression.po +++ b/library/compression.po @@ -26,7 +26,6 @@ msgstr "" msgid "The :mod:`!compression` package" msgstr ":mod:`!compression` パッケージ" -#: ../../library/compression.rst:8 msgid "" "The :mod:`!compression` package contains the canonical compression modules " "containing interfaces to several different compression algorithms. Some of " @@ -35,24 +34,25 @@ msgid "" "reasons, and will not be removed without a deprecation cycle. The use of " "modules in :mod:`!compression` is encouraged where practical." msgstr "" +":mod:`!compression` パッケージには、複数の圧縮アルゴリズムへのインターフェー" +"スを提供する標準的な圧縮モジュールが含まれています。\n" +"一部のモジュールは、以前から独立したモジュールとして提供されてきました。\n" +"それらは互換性のために元の名前でも引き続き利用でき、非推奨期間を経ずに削除さ" +"れることはありません。\n" +"可能な場合は :mod:`!compression` 内のモジュールを使うことを推奨します。" -#: ../../library/compression.rst:15 msgid ":mod:`!compression.bz2` -- Re-exports :mod:`bz2`" -msgstr "" +msgstr ":mod:`!compression.bz2` -- :mod:`bz2` を再エクスポート" -#: ../../library/compression.rst:16 msgid ":mod:`!compression.gzip` -- Re-exports :mod:`gzip`" -msgstr "" +msgstr ":mod:`!compression.gzip` -- :mod:`gzip` を再エクスポート" -#: ../../library/compression.rst:17 msgid ":mod:`!compression.lzma` -- Re-exports :mod:`lzma`" -msgstr "" +msgstr ":mod:`!compression.lzma` -- :mod:`lzma` を再エクスポート" -#: ../../library/compression.rst:18 msgid ":mod:`!compression.zlib` -- Re-exports :mod:`zlib`" -msgstr "" +msgstr ":mod:`!compression.zlib` -- :mod:`zlib` を再エクスポート" -#: ../../library/compression.rst:19 msgid "" ":mod:`compression.zstd` -- Wrapper for the Zstandard compression library" -msgstr "" +msgstr ":mod:`compression.zstd` -- Zstandard 圧縮ライブラリのラッパ" diff --git a/library/compression.zstd.po b/library/compression.zstd.po index 2b26fb199..5ff7c8929 100644 --- a/library/compression.zstd.po +++ b/library/compression.zstd.po @@ -22,16 +22,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/compression.zstd.rst:2 msgid "" ":mod:`!compression.zstd` --- Compression compatible with the Zstandard format" -msgstr "" +msgstr ":mod:`!compression.zstd` --- Zstandard 形式に対応した圧縮" -#: ../../library/compression.zstd.rst:10 msgid "**Source code:** :source:`Lib/compression/zstd/__init__.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/compression/zstd/__init__.py`" -#: ../../library/compression.zstd.rst:14 msgid "" "This module provides classes and functions for compressing and decompressing " "data using the Zstandard (or *zstd*) compression algorithm. The `zstd manual " @@ -42,22 +39,30 @@ msgid "" "of ``.zst`` files created by the :program:`zstd` utility, as well as raw " "zstd compressed streams." msgstr "" +"このモジュールは、Zstandard (または *zstd*) 圧縮アルゴリズムを使ってデータを" +"圧縮・展開するクラスと関数を提供します。\n" +"`zstd マニュアル `__ では、Zstandard を「zlib と同等以上の圧縮率で、リアルタイム圧縮を対" +"象とした高速な可逆圧縮アルゴリズム」と説明しています。\n" +":program:`zstd` ユーティリティで作成した ``.zst`` ファイルの内容や、生の " +"zstd 圧縮ストリームの読み書きをサポートするファイルインターフェースも含まれて" +"います。" -#: ../../library/compression.zstd.rst:23 msgid "The :mod:`!compression.zstd` module contains:" -msgstr "" +msgstr ":mod:`!compression.zstd` モジュールには次のものが含まれています:" -#: ../../library/compression.zstd.rst:25 msgid "" "The :func:`.open` function and :class:`ZstdFile` class for reading and " "writing compressed files." msgstr "" +"圧縮ファイルを読み書きする :func:`.open` 関数と :class:`ZstdFile` クラス。" -#: ../../library/compression.zstd.rst:27 msgid "" "The :class:`ZstdCompressor` and :class:`ZstdDecompressor` classes for " "incremental (de)compression." msgstr "" +"インクリメンタルに圧縮・展開を行う :class:`ZstdCompressor` クラスと :class:" +"`ZstdDecompressor` クラス。" #: ../../library/compression.zstd.rst:29 msgid "" @@ -66,55 +71,64 @@ msgid "" msgstr "" "一度に圧縮・展開を行う :func:`compress` および :func:`decompress` 関数。" -#: ../../library/compression.zstd.rst:31 msgid "" "The :func:`train_dict` and :func:`finalize_dict` functions and the :class:" "`ZstdDict` class to train and manage Zstandard dictionaries." msgstr "" +"Zstandard 辞書を学習・管理する :func:`train_dict` 関数、:func:" +"`finalize_dict` 関数、:class:`ZstdDict` クラス。" -#: ../../library/compression.zstd.rst:33 msgid "" "The :class:`CompressionParameter`, :class:`DecompressionParameter`, and :" "class:`Strategy` classes for setting advanced (de)compression parameters." msgstr "" +"圧縮・展開の高度なパラメータを設定する :class:`CompressionParameter` クラ" +"ス、:class:`DecompressionParameter` クラス、:class:`Strategy` クラス。" -#: ../../includes/optional-module.rst:1 msgid "" "This is an :term:`optional module`. If it is missing from your copy of " "CPython, look for documentation from your distributor (that is, whoever " "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" +"これは :term:`オプションモジュール ` です。\n" +"使用している CPython に含まれていない場合は、配布元 (Python を提供した組織な" +"ど) のドキュメントを確認してください。\n" +"配布する立場の場合は :ref:`optional-module-requirements` を参照してください。" #: ../../library/compression.zstd.rst:40 msgid "Exceptions" msgstr "例外" -#: ../../library/compression.zstd.rst:44 msgid "" "This exception is raised when an error occurs during compression or " "decompression, or while initializing the (de)compressor state." msgstr "" +"圧縮・展開中、または圧縮・展開オブジェクトの状態の初期化中にエラーが発生する" +"と送出される例外です。" #: ../../library/compression.zstd.rst:49 msgid "Reading and writing compressed files" msgstr "圧縮ファイルへの読み書き" -#: ../../library/compression.zstd.rst:54 msgid "" "Open a Zstandard-compressed file in binary or text mode, returning a :term:" "`file object`." msgstr "" +"Zstandard で圧縮されたファイルをバイナリモードまたはテキストモードで開き、:" +"term:`ファイルオブジェクト ` を返します。" -#: ../../library/compression.zstd.rst:57 msgid "" "The *file* argument can be either a file name (given as a :class:`str`, :" "class:`bytes` or :term:`path-like ` object), in which case " "the named file is opened, or it can be an existing file object to read from " "or write to." msgstr "" +"*file* 引数には、ファイル名 (:class:`str`、:class:`bytes`、または :term:`パス" +"状オブジェクト `) を指定でき、その場合はその名前のファイル" +"を開きます。\n" +"また、読み書きする既存のファイルオブジェクトも指定できます。" -#: ../../library/compression.zstd.rst:62 msgid "" "The mode argument can be either ``'rb'`` for reading (default), ``'wb'`` for " "overwriting, ``'ab'`` for appending, or ``'xb'`` for exclusive creation. " @@ -122,8 +136,12 @@ msgid "" "respectively. You may also open in text mode with ``'rt'``, ``'wt'``, " "``'at'``, and ``'xt'`` respectively." msgstr "" +"``mode`` 引数には、読み込み用 (デフォルト) の ``'rb'``、上書き用の ``'wb'``、" +"追記用の ``'ab'``、排他的な作成用の ``'xb'`` のいずれかを指定できます。\n" +"それぞれ ``'r'``、``'w'``、``'a'``、``'x'`` と指定しても同じです。\n" +"それぞれ ``'rt'``、``'wt'``、``'at'``、``'xt'`` を指定してテキストモードで開" +"くこともできます。" -#: ../../library/compression.zstd.rst:68 ../../library/compression.zstd.rst:112 msgid "" "When reading, the *options* argument can be a dictionary providing advanced " "decompression parameters; see :class:`DecompressionParameter` for detailed " @@ -131,8 +149,14 @@ msgid "" "`ZstdDict` instance to be used during decompression. When reading, if the " "*level* argument is not None, a :exc:`!TypeError` will be raised." msgstr "" +"読み込み時には、展開の高度なパラメータを指定する辞書を *options* 引数に渡せま" +"す。\n" +"サポートされるパラメータの詳細は :class:`DecompressionParameter` を参照してく" +"ださい。\n" +"*zstd_dict* 引数は、展開時に使う :class:`ZstdDict` インスタンスです。\n" +"読み込み時に *level* 引数が ``None`` でない場合は :exc:`!TypeError` を送出し" +"ます。" -#: ../../library/compression.zstd.rst:75 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " "compression parameters; see :class:`CompressionParameter` for detailed " @@ -141,26 +165,35 @@ msgid "" "or *options* may be non-None. The *zstd_dict* argument is a :class:" "`ZstdDict` instance to be used during compression." msgstr "" +"書き込み時には、圧縮の高度なパラメータを指定する辞書を *options* 引数に渡せま" +"す。\n" +"サポートされるパラメータの詳細は :class:`CompressionParameter` を参照してくだ" +"さい。\n" +"*level* 引数は、圧縮データを書き込む際の圧縮レベルです。\n" +"*level* と *options* のうち、``None`` 以外にできるのは一方だけです。\n" +"*zstd_dict* 引数は、圧縮時に使う :class:`ZstdDict` インスタンスです。" -#: ../../library/compression.zstd.rst:83 msgid "" "In binary mode, this function is equivalent to the :class:`ZstdFile` " "constructor: ``ZstdFile(file, mode, ...)``. In this case, the *encoding*, " "*errors*, and *newline* parameters must not be provided." msgstr "" +"バイナリモードでは、この関数は :class:`ZstdFile` コンストラクタ " +"``ZstdFile(file, mode, ...)`` と等価です。\n" +"この場合、*encoding*、*errors*、*newline* パラメータを指定してはいけません。" -#: ../../library/compression.zstd.rst:87 msgid "" "In text mode, a :class:`ZstdFile` object is created, and wrapped in an :" "class:`io.TextIOWrapper` instance with the specified encoding, error " "handling behavior, and line endings." msgstr "" +"テキストモードでは、:class:`ZstdFile` オブジェクトを作成し、指定されたエン" +"コーディング、エラー処理、改行文字で :class:`io.TextIOWrapper` インスタンスに" +"ラップします。" -#: ../../library/compression.zstd.rst:95 msgid "Open a Zstandard-compressed file in binary mode." -msgstr "" +msgstr "Zstandard で圧縮されたファイルをバイナリモードで開きます。" -#: ../../library/compression.zstd.rst:97 msgid "" "A :class:`ZstdFile` can wrap an already-open :term:`file object`, or operate " "directly on a named file. The *file* argument specifies either the file " @@ -169,22 +202,32 @@ msgid "" "existing file object, the wrapped file will not be closed when the :class:" "`ZstdFile` is closed." msgstr "" +":class:`ZstdFile` は、すでに開かれた :term:`ファイルオブジェクト ` をラップすることも、名前で指定したファイルを直接操作することもできま" +"す。\n" +"*file* 引数には、ラップするファイルオブジェクトか、開くファイルの名前 (:" +"class:`str`、:class:`bytes`、または :term:`パス状オブジェクト `) を指定します。\n" +"既存のファイルオブジェクトをラップした場合、:class:`ZstdFile` を閉じても、" +"ラップされたファイルは閉じられません。" -#: ../../library/compression.zstd.rst:104 msgid "" "The *mode* argument can be either ``'rb'`` for reading (default), ``'wb'`` " "for overwriting, ``'xb'`` for exclusive creation, or ``'ab'`` for appending. " "These can equivalently be given as ``'r'``, ``'w'``, ``'x'`` and ``'a'`` " "respectively." msgstr "" +"*mode* 引数には、読み込み用 (デフォルト) の ``'rb'``、上書き用の ``'wb'``、排" +"他的な作成用の ``'xb'``、追記用の ``'ab'`` のいずれかを指定できます。\n" +"それぞれ ``'r'``、``'w'``、``'x'``、``'a'`` と指定しても同じです。" -#: ../../library/compression.zstd.rst:109 msgid "" "If *file* is a file object (rather than an actual file name), a mode of " "``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." msgstr "" +"*file* が実際のファイル名ではなくファイルオブジェクトの場合、モード ``'w'`` " +"はファイルを切り詰めず、``'a'`` と等価になります。" -#: ../../library/compression.zstd.rst:119 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " "compression parameters; see :class:`CompressionParameter` for detailed " @@ -193,13 +236,23 @@ msgid "" "or *options* may be passed. The *zstd_dict* argument is a :class:`ZstdDict` " "instance to be used during compression." msgstr "" +"書き込み時には、圧縮の高度なパラメータを指定する辞書を *options* 引数に渡せま" +"す。\n" +"サポートされるパラメータの詳細は :class:`CompressionParameter` を参照してくだ" +"さい。\n" +"*level* 引数は、圧縮データを書き込む際の圧縮レベルです。\n" +"*level* と *options* は、一方しか渡せません。\n" +"*zstd_dict* 引数は、圧縮時に使う :class:`ZstdDict` インスタンスです。" -#: ../../library/compression.zstd.rst:127 msgid "" ":class:`!ZstdFile` supports all the members specified by :class:`io." "BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." "IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." msgstr "" +":class:`!ZstdFile` は、:meth:`~io.BufferedIOBase.detach` と :meth:`~io." +"IOBase.truncate` を除き、:class:`io.BufferedIOBase` で規定されたすべてのメン" +"バーをサポートします。\n" +"反復処理と :keyword:`with` 文もサポートします。" #: ../../library/compression.zstd.rst:132 msgid "The following method and attributes are also provided:" @@ -215,36 +268,39 @@ msgstr "" "り、少なくとも 1 バイトが返されます。返される正確なバイト数は規定されていませ" "ん (引数 *size* は無視されます)。" -#: ../../library/compression.zstd.rst:140 msgid "" "While calling :meth:`peek` does not change the file position of the :class:" "`ZstdFile`, it may change the position of the underlying file object (for " "example, if the :class:`ZstdFile` was constructed by passing a file object " "for *file*)." msgstr "" +":meth:`peek` を呼び出しても :class:`ZstdFile` のファイル位置は変わりません" +"が、基となるファイルオブジェクトの位置は変わる場合があります (例えば、*file* " +"にファイルオブジェクトを渡して :class:`ZstdFile` を構築した場合)。" #: ../../library/compression.zstd.rst:147 msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "``'rb'`` は読み込み用、 ``'wb'`` は書き込み用です。" -#: ../../library/compression.zstd.rst:151 msgid "" "The name of the Zstandard file. Equivalent to the :attr:`~io.FileIO.name` " "attribute of the underlying :term:`file object`." msgstr "" +"Zstandard ファイルの名前です。\n" +"基となる :term:`ファイルオブジェクト ` の :attr:`~io.FileIO." +"name` 属性と等価です。" #: ../../library/compression.zstd.rst:156 msgid "Compressing and decompressing data in memory" msgstr "メモリ上での圧縮と展開" -#: ../../library/compression.zstd.rst:160 msgid "" "Compress *data* (a :term:`bytes-like object`), returning the compressed data " "as a :class:`bytes` object." msgstr "" +"*data* (:term:`バイト列状オブジェクト `) を圧縮し、圧縮" +"データを :class:`bytes` オブジェクトとして返します。" -#: ../../library/compression.zstd.rst:163 -#: ../../library/compression.zstd.rst:207 msgid "" "The *level* argument is an integer controlling the level of compression. " "*level* is an alternative to setting :attr:`CompressionParameter." @@ -254,70 +310,87 @@ msgid "" "*level* argument must be omitted and in the *options* dictionary the :attr:`!" "CompressionParameter.compression_level` parameter should be set." msgstr "" +"*level* 引数は、圧縮レベルを制御する整数です。\n" +"*level* は、*options* に :attr:`CompressionParameter.compression_level` を設" +"定する代わりに使えます。\n" +"*level* に渡せる値を取得するには、:attr:`~CompressionParameter." +"compression_level` の :meth:`~CompressionParameter.bounds` を使ってくださ" +"い。\n" +"高度な圧縮オプションが必要な場合は *level* 引数を省略し、*options* 辞書に :" +"attr:`!CompressionParameter.compression_level` パラメータを設定してください。" -#: ../../library/compression.zstd.rst:172 -#: ../../library/compression.zstd.rst:216 msgid "" "The *options* argument is a Python dictionary containing advanced " "compression parameters. The valid keys and values for compression parameters " "are documented as part of the :class:`CompressionParameter` documentation." msgstr "" +"*options* 引数は、高度な圧縮パラメータを含む Python の辞書です。\n" +"圧縮パラメータの有効なキーと値は、:class:`CompressionParameter` のドキュメン" +"トに記載されています。" -#: ../../library/compression.zstd.rst:176 msgid "" "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " "trained data to improve compression efficiency. The function :func:" "`train_dict` can be used to generate a Zstandard dictionary." msgstr "" +"*zstd_dict* 引数は、圧縮効率を改善するための学習済みデータを含む :class:" +"`ZstdDict` インスタンスです。\n" +"Zstandard 辞書を生成するには :func:`train_dict` 関数を使えます。" -#: ../../library/compression.zstd.rst:183 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning the uncompressed " "data as a :class:`bytes` object." msgstr "" +"*data* (:term:`バイト列状オブジェクト `) を展開し、展開し" +"たデータを :class:`bytes` オブジェクトとして返します。" -#: ../../library/compression.zstd.rst:186 -#: ../../library/compression.zstd.rst:308 msgid "" "The *options* argument is a Python dictionary containing advanced " "decompression parameters. The valid keys and values for compression " "parameters are documented as part of the :class:`DecompressionParameter` " "documentation." msgstr "" +"*options* 引数は、高度な展開パラメータを含む Python の辞書です。\n" +"パラメータの有効なキーと値は、:class:`DecompressionParameter` のドキュメント" +"に記載されています。" -#: ../../library/compression.zstd.rst:191 -#: ../../library/compression.zstd.rst:313 msgid "" "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " "trained data used during compression. This must be the same Zstandard " "dictionary used during compression." msgstr "" +"*zstd_dict* 引数は、圧縮時に使った学習済みデータを含む :class:`ZstdDict` イン" +"スタンスです。\n" +"圧縮時に使ったものと同じ Zstandard 辞書でなければなりません。" -#: ../../library/compression.zstd.rst:195 msgid "" "If *data* is the concatenation of multiple distinct compressed frames, " "decompress all of these frames, and return the concatenation of the results." msgstr "" +"*data* が複数の独立した圧縮フレームを連結したものである場合、すべてのフレーム" +"を展開し、その結果を連結して返します。" #: ../../library/compression.zstd.rst:201 msgid "" "Create a compressor object, which can be used to compress data incrementally." msgstr "データをインクリメンタルに圧縮する圧縮オブジェクトを作成します。" -#: ../../library/compression.zstd.rst:204 msgid "" "For a more convenient way of compressing a single chunk of data, see the " "module-level function :func:`compress`." msgstr "" +"単一のデータチャンクをより手軽に圧縮する方法については、モジュールレベルの :" +"func:`compress` 関数を参照してください。" -#: ../../library/compression.zstd.rst:220 msgid "" "The *zstd_dict* argument is an optional instance of :class:`ZstdDict` " "containing trained data to improve compression efficiency. The function :" "func:`train_dict` can be used to generate a Zstandard dictionary." msgstr "" +"*zstd_dict* 引数は省略可能で、圧縮効率を改善するための学習済みデータを含む :" +"class:`ZstdDict` インスタンスを指定します。\n" +"Zstandard 辞書を生成するには :func:`train_dict` 関数を使えます。" -#: ../../library/compression.zstd.rst:227 msgid "" "Compress *data* (a :term:`bytes-like object`), returning a :class:`bytes` " "object with compressed data if possible, or otherwise an empty :class:`!" @@ -325,20 +398,32 @@ msgid "" "calls to :meth:`!compress` and :meth:`~.flush`. The returned data should be " "concatenated with the output of any previous calls to :meth:`~.compress`." msgstr "" +"*data* (:term:`バイト列状オブジェクト `) を圧縮し、可能で" +"あれば圧縮データを含む :class:`bytes` オブジェクトを返し、それ以外の場合は空" +"の :class:`!bytes` オブジェクトを返します。\n" +"*data* の一部は内部にバッファリングされ、後続の :meth:`!compress` や :meth:" +"`~.flush` の呼び出しで使われる場合があります。\n" +"返されたデータは、それ以前の :meth:`~.compress` の呼び出しによる出力と連結し" +"てください。" -#: ../../library/compression.zstd.rst:234 msgid "" "The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." "CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" +"*mode* 引数は :class:`ZstdCompressor` の属性である :attr:`~.CONTINUE`、:attr:" +"`~.FLUSH_BLOCK`、:attr:`~.FLUSH_FRAME` のいずれかです。" -#: ../../library/compression.zstd.rst:238 msgid "" "When all data has been provided to the compressor, call the :meth:`~.flush` " "method to finish the compression process. If :meth:`~.compress` is called " "with *mode* set to :attr:`~.FLUSH_FRAME`, :meth:`~.flush` should not be " "called, as it would write out a new empty frame." msgstr "" +"すべてのデータを圧縮オブジェクトに渡したら、:meth:`~.flush` メソッドを呼び出" +"して圧縮処理を完了してください。\n" +"*mode* を :attr:`~.FLUSH_FRAME` にして :meth:`~.compress` を呼び出した場合" +"は、:meth:`~.flush` を呼び出さないでください。\n" +"呼び出すと、新しい空のフレームが書き出されます。" #: ../../library/compression.zstd.rst:246 msgid "" @@ -348,13 +433,13 @@ msgstr "" "圧縮処理を終了し、コンプレッサの内部バッファにあるあらゆるデータを格納する :" "class:`bytes` オブジェクトを返します。" -#: ../../library/compression.zstd.rst:249 msgid "" "The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." "FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" +"*mode* 引数は :class:`ZstdCompressor` の属性である :attr:`~.FLUSH_BLOCK`、:" +"attr:`~.FLUSH_FRAME` のいずれかです。" -#: ../../library/compression.zstd.rst:254 msgid "" "Specify the amount of uncompressed data *size* that will be provided for the " "next frame. *size* will be written into the frame header of the next frame " @@ -364,8 +449,15 @@ msgid "" "data size require less memory to decompress, especially at higher " "compression levels." msgstr "" +"次のフレームに渡す非圧縮データの量 *size* を指定します。\n" +":attr:`CompressionParameter.content_size_flag` が ``False`` または ``0`` でな" +"い限り、*size* は次のフレームのヘッダーに書き込まれます。\n" +"サイズが ``0`` の場合、そのフレームは空であることを意味します。\n" +"*size* が ``None`` の場合、フレームヘッダーからフレームサイズが省略されま" +"す。\n" +"非圧縮データのサイズを含むフレームは、特に圧縮レベルが高い場合、展開に必要な" +"メモリが少なくなります。" -#: ../../library/compression.zstd.rst:262 msgid "" "If :attr:`last_mode` is not :attr:`FLUSH_FRAME`, a :exc:`ValueError` is " "raised as the compressor is not at the start of a frame. If the pledged size " @@ -373,41 +465,60 @@ msgid "" "calls to :meth:`!compress` or :meth:`flush` may raise :exc:`ZstdError` and " "the last chunk of data may be lost." msgstr "" +":attr:`last_mode` が :attr:`FLUSH_FRAME` でない場合、圧縮オブジェクトがフレー" +"ムの開始位置にないため、:exc:`ValueError` を送出します。\n" +"宣言したサイズが :meth:`.compress` に渡したデータの実際のサイズと一致しない場" +"合、その後の :meth:`!compress` や :meth:`flush` の呼び出しで :exc:" +"`ZstdError` が送出され、最後のデータチャンクが失われる可能性があります。" -#: ../../library/compression.zstd.rst:269 msgid "" "After :meth:`flush` or :meth:`.compress` are called with mode :attr:" "`FLUSH_FRAME`, the next frame will not include the frame size into the " "header unless :meth:`!set_pledged_input_size` is called again." msgstr "" +"``mode`` を :attr:`FLUSH_FRAME` にして :meth:`flush` または :meth:`." +"compress` を呼び出した後は、:meth:`!set_pledged_input_size` を再度呼び出さな" +"い限り、次のフレームのヘッダーにフレームサイズは含まれません。" -#: ../../library/compression.zstd.rst:275 msgid "" "Collect more data for compression, which may or may not generate output " "immediately. This mode optimizes the compression ratio by maximizing the " "amount of data per block and frame." msgstr "" +"圧縮するデータをさらに集めます。\n" +"すぐに出力が生成される場合も、されない場合もあります。\n" +"このモードはブロックとフレームあたりのデータ量を最大化することで圧縮率を最適" +"化します。" -#: ../../library/compression.zstd.rst:281 msgid "" "Complete and write a block to the data stream. The data returned so far can " "be immediately decompressed. Past data can still be referenced in future " "blocks generated by calls to :meth:`~.compress`, improving compression." msgstr "" +"ブロックを完了し、データストリームに書き込みます。\n" +"それまでに返されたデータはすぐに展開できます。\n" +"その後の :meth:`~.compress` の呼び出しで生成するブロックからも過去のデータを" +"参照でき、圧縮率が向上します。" -#: ../../library/compression.zstd.rst:288 msgid "" "Complete and write out a frame. Future data provided to :meth:`~.compress` " "will be written into a new frame and *cannot* reference past data." msgstr "" +"フレームを完了して書き出します。\n" +"その後 :meth:`~.compress` に渡すデータは新しいフレームに書き込まれ、過去の" +"データを参照することは *できません*。" -#: ../../library/compression.zstd.rst:294 msgid "" "The last mode passed to either :meth:`~.compress` or :meth:`~.flush`. The " "value can be one of :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~." "FLUSH_FRAME`. The initial value is :attr:`~.FLUSH_FRAME`, signifying that " "the compressor is at the start of a new frame." msgstr "" +":meth:`~.compress` または :meth:`~.flush` に最後に渡されたモードです。\n" +"値は :attr:`~.CONTINUE`、:attr:`~.FLUSH_BLOCK`、:attr:`~.FLUSH_FRAME` のいず" +"れかです。\n" +"初期値は :attr:`~.FLUSH_FRAME` で、圧縮オブジェクトが新しいフレームの開始位置" +"にあることを表します。" #: ../../library/compression.zstd.rst:302 msgid "" @@ -417,13 +528,13 @@ msgstr "" "データをインクリメンタルに展開するために使用できる展開オブジェクトを作成しま" "す。" -#: ../../library/compression.zstd.rst:305 msgid "" "For a more convenient way of decompressing an entire compressed stream at " "once, see the module-level function :func:`decompress`." msgstr "" +"圧縮ストリーム全体を一度に展開する、より手軽な方法については、モジュールレベ" +"ルの :func:`decompress` 関数を参照してください。" -#: ../../library/compression.zstd.rst:318 msgid "" "This class does not transparently handle inputs containing multiple " "compressed frames, unlike the :func:`decompress` function and :class:" @@ -431,16 +542,25 @@ msgid "" "`decompress`, :class:`ZstdFile` if working with a :term:`file object`, or " "multiple :class:`!ZstdDecompressor` instances." msgstr "" +"このクラスは、:func:`decompress` 関数や :class:`ZstdFile` クラスとは異なり、" +"複数の圧縮フレームを含む入力を自動的には処理しません。\n" +"複数フレームの入力を展開するには、:func:`decompress`、:term:`ファイルオブジェ" +"クト ` を扱う場合は :class:`ZstdFile`、または複数の :class:`!" +"ZstdDecompressor` インスタンスを使ってください。" -#: ../../library/compression.zstd.rst:326 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " "to :meth:`!decompress`. The returned data should be concatenated with the " "output of any previous calls to :meth:`!decompress`." msgstr "" +"*data* (:term:`バイト列状オブジェクト `) を展開し、展開し" +"たデータをバイト列として返します。\n" +"*data* の一部は内部にバッファリングされ、後続の :meth:`!decompress` の呼び出" +"しで使われる場合があります。\n" +"返されたデータは、それ以前の :meth:`!decompress` の呼び出しによる出力と連結し" +"てください。" -#: ../../library/compression.zstd.rst:332 msgid "" "If *max_length* is non-negative, the method returns at most *max_length* " "bytes of decompressed data. If this limit is reached and further output can " @@ -449,13 +569,22 @@ msgid "" "provide *data* as ``b''`` to obtain more of the output. The full content can " "thus be read like::" msgstr "" +"*max_length* が非負の場合、このメソッドは展開したデータを最大 *max_length* バ" +"イト返します。\n" +"この上限に達し、さらに出力を生成できる場合 (または EOF に達した場合)、:attr:" +"`~.needs_input` 属性は ``False`` に設定されます。\n" +"この場合、次の :meth:`~.decompress` の呼び出しでは *data* に ``b''`` を渡し" +"て、さらに出力を取得できます。\n" +"そのため、内容全体は次のように読み取れます。 ::" -#: ../../library/compression.zstd.rst:339 msgid "" "process_output(d.decompress(data, max_length))\n" "while not d.eof and not d.needs_input:\n" " process_output(d.decompress(b\"\", max_length))" msgstr "" +"process_output(d.decompress(data, max_length))\n" +"while not d.eof and not d.needs_input:\n" +" process_output(d.decompress(b\"\", max_length))" msgid "" "If all of the input data was decompressed and returned (either because this " @@ -466,12 +595,15 @@ msgstr "" "*max_length* が負のため) 場合、\n" ":attr:`~.needs_input` 属性は ``True`` になります。" -#: ../../library/compression.zstd.rst:348 msgid "" "Attempting to decompress data after the end of a frame will raise a :exc:" "`EOFError`. Any data found after the end of the frame is ignored and saved " "in the :attr:`~.unused_data` attribute." msgstr "" +"フレームの終端に達した後でデータを展開しようとすると、:exc:`EOFError` を送出" +"します。\n" +"フレームの終端より後にあるデータは無視され、:attr:`~.unused_data` 属性に保存" +"されます。" #: ../../library/compression.zstd.rst:354 msgid "``True`` if the end-of-stream marker has been reached." @@ -481,21 +613,19 @@ msgstr "ストリーム終端記号に到達した場合 ``True`` を返しま msgid "Data found after the end of the compressed stream." msgstr "圧縮ストリームの末尾以降に存在したデータを表します。" -#: ../../library/compression.zstd.rst:360 msgid "Before the end of the stream is reached, this will be ``b''``." -msgstr "" +msgstr "ストリームの終端に達するまでは ``b''`` です。" -#: ../../library/compression.zstd.rst:364 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new compressed input." msgstr "" +":meth:`.decompress` メソッドが新たな圧縮入力を必要とせずに、さらに展開データ" +"を提供できる場合は ``False`` です。" -#: ../../library/compression.zstd.rst:369 msgid "Zstandard dictionaries" -msgstr "" +msgstr "Zstandard 辞書" -#: ../../library/compression.zstd.rst:374 msgid "" "Train a Zstandard dictionary, returning a :class:`ZstdDict` instance. " "Zstandard dictionaries enable more efficient compression of smaller sizes of " @@ -504,14 +634,19 @@ msgid "" "files), Zstandard dictionaries can improve compression ratios and speed " "significantly." msgstr "" +"Zstandard 辞書を学習し、:class:`ZstdDict` インスタンスを返します。\n" +"Zstandard 辞書を使うと、繰り返しが少ないため従来は圧縮が難しかった小さなデー" +"タを、より効率よく圧縮できます。\n" +"複数の似たデータ群 (似たファイルなど) を圧縮する場合、Zstandard 辞書によって" +"圧縮率と速度を大きく改善できます。" -#: ../../library/compression.zstd.rst:381 msgid "" "The *samples* argument (an iterable of :class:`bytes` objects), is the " "population of samples used to train the Zstandard dictionary." msgstr "" +"*samples* 引数 (:class:`bytes` オブジェクトのイテラブル) は、Zstandard 辞書の" +"学習に使うサンプルの集まりです。" -#: ../../library/compression.zstd.rst:384 msgid "" "The *dict_size* argument, an integer, is the maximum size (in bytes) the " "Zstandard dictionary should be. The Zstandard documentation suggests an " @@ -520,56 +655,75 @@ msgid "" "compression, but improve compression ratios. Smaller dictionaries lead to " "faster compression, but reduce the compression ratio." msgstr "" +"整数の *dict_size* 引数は、Zstandard 辞書の最大サイズをバイト単位で指定しま" +"す。\n" +"Zstandard のドキュメントでは最大でも 100 KB 以下にすることを勧めていますが、" +"データによってはさらに小さな最大値で十分な場合があります。\n" +"一般に、辞書が大きいと圧縮は遅くなるものの圧縮率が向上します。\n" +"辞書が小さいと圧縮は速くなるものの圧縮率が低下します。" -#: ../../library/compression.zstd.rst:394 msgid "" "An advanced function for converting a \"raw content\" Zstandard dictionary " "into a regular Zstandard dictionary. \"Raw content\" dictionaries are a " "sequence of bytes that do not need to follow the structure of a normal " "Zstandard dictionary." msgstr "" +"「生の内容」の Zstandard 辞書を通常の Zstandard 辞書に変換する高度な関数で" +"す。\n" +"「生の内容」の辞書は、通常の Zstandard 辞書の構造に従う必要のないバイト列で" +"す。" -#: ../../library/compression.zstd.rst:399 msgid "" "The *zstd_dict* argument is a :class:`ZstdDict` instance with the :attr:" "`~ZstdDict.dict_content` containing the raw dictionary contents." msgstr "" +"*zstd_dict* 引数は、:attr:`~ZstdDict.dict_content` に生の辞書の内容を格納し" +"た :class:`ZstdDict` インスタンスです。" -#: ../../library/compression.zstd.rst:402 msgid "" "The *samples* argument (an iterable of :class:`bytes` objects), contains " "sample data for generating the Zstandard dictionary." msgstr "" +"*samples* 引数 (:class:`bytes` オブジェクトのイテラブル) は、Zstandard 辞書を" +"生成するためのサンプルデータを含みます。" -#: ../../library/compression.zstd.rst:405 msgid "" "The *dict_size* argument, an integer, is the maximum size (in bytes) the " "Zstandard dictionary should be. See :func:`train_dict` for suggestions on " "the maximum dictionary size." msgstr "" +"整数の *dict_size* 引数は、Zstandard 辞書の最大サイズをバイト単位で指定しま" +"す。\n" +"辞書の最大サイズについての推奨は :func:`train_dict` を参照してください。" -#: ../../library/compression.zstd.rst:409 msgid "" "The *level* argument (an integer) is the compression level expected to be " "passed to the compressors using this dictionary. The dictionary information " "varies for each compression level, so tuning for the proper compression " "level can make compression more efficient." msgstr "" +"*level* 引数 (整数) は、この辞書を使う圧縮オブジェクトに渡す予定の圧縮レベル" +"です。\n" +"辞書の情報は圧縮レベルごとに異なるため、適切な圧縮レベルに調整すると圧縮効率" +"を改善できます。" -#: ../../library/compression.zstd.rst:417 msgid "" "A wrapper around Zstandard dictionaries. Dictionaries can be used to improve " "the compression of many small chunks of data. Use :func:`train_dict` if you " "need to train a new dictionary from sample data." msgstr "" +"Zstandard 辞書のラッパです。\n" +"辞書を使うと、多数の小さなデータチャンクの圧縮を改善できます。\n" +"サンプルデータから新しい辞書を学習する必要がある場合は、:func:`train_dict` を" +"使ってください。" -#: ../../library/compression.zstd.rst:421 msgid "" "The *dict_content* argument (a :term:`bytes-like object`), is the already " "trained dictionary information." msgstr "" +"*dict_content* 引数 (:term:`バイト列状オブジェクト `) は、" +"学習済みの辞書情報です。" -#: ../../library/compression.zstd.rst:424 msgid "" "The *is_raw* argument, a boolean, is an advanced parameter controlling the " "meaning of *dict_content*. ``True`` means *dict_content* is a \"raw " @@ -578,8 +732,12 @@ msgid "" "functions, for example, :func:`train_dict` or the external :program:`zstd` " "CLI." msgstr "" +"真偽値の *is_raw* 引数は、*dict_content* の意味を制御する高度なパラメータで" +"す。\n" +"``True`` の場合、*dict_content* は形式の制約がない「生の内容」の辞書です。\n" +"``False`` の場合、*dict_content* は :func:`train_dict` などの Zstandard の関" +"数や外部の :program:`zstd` CLI で作成された通常の Zstandard 辞書です。" -#: ../../library/compression.zstd.rst:430 msgid "" "When passing a :class:`!ZstdDict` to a function, the :attr:`!" "as_digested_dict` and :attr:`!as_undigested_dict` attributes can control how " @@ -590,141 +748,155 @@ msgid "" "passing a digested dictionary will reduce the overhead of loading the " "dictionary." msgstr "" +":class:`!ZstdDict` を関数に渡す際、:attr:`!as_digested_dict` または :attr:`!" +"as_undigested_dict` 属性を ``zstd_dict`` 引数として渡すと、辞書の読み込み方法" +"を制御できます。\n" +"例えば、``compress(data, zstd_dict=zd.as_digested_dict)`` とします。\n" +"辞書の前処理 (digest) は、Zstandard 辞書の読み込み時に行われるコストの高い処" +"理です。\n" +"圧縮や展開を複数回呼び出す場合、前処理済みの辞書を渡すと、辞書の読み込みにか" +"かるオーバーヘッドを減らせます。" -#: ../../library/compression.zstd.rst:439 msgid "Difference for compression" -msgstr "" +msgstr "圧縮時の違い" -#: ../../library/compression.zstd.rst:444 msgid "Digested dictionary" -msgstr "" +msgstr "前処理済みの辞書" -#: ../../library/compression.zstd.rst:445 msgid "Undigested dictionary" -msgstr "" +msgstr "前処理していない辞書" -#: ../../library/compression.zstd.rst:446 msgid "" "Advanced parameters of the compressor which may be overridden by the " "dictionary's parameters" msgstr "" +"辞書のパラメータによって上書きされる可能性がある圧縮オブジェクトの高度なパラ" +"メータ" -#: ../../library/compression.zstd.rst:448 msgid "" "``window_log``, ``hash_log``, ``chain_log``, ``search_log``, ``min_match``, " "``target_length``, ``strategy``, ``enable_long_distance_matching``, " "``ldm_hash_log``, ``ldm_min_match``, ``ldm_bucket_size_log``, " "``ldm_hash_rate_log``, and some non-public parameters." msgstr "" +"``window_log``、``hash_log``、``chain_log``、``search_log``、``min_match``、" +"``target_length``、``strategy``、``enable_long_distance_matching``、" +"``ldm_hash_log``、``ldm_min_match``、``ldm_bucket_size_log``、" +"``ldm_hash_rate_log``、および一部の非公開パラメータ。" #: ../../library/compression.zstd.rst:453 msgid "None" msgstr "None" -#: ../../library/compression.zstd.rst:454 msgid ":class:`!ZstdDict` internally caches the dictionary" -msgstr "" +msgstr ":class:`!ZstdDict` が辞書を内部でキャッシュするか" -#: ../../library/compression.zstd.rst:455 msgid "" "Yes. It's faster when loading a digested dictionary again with the same " "compression level." msgstr "" +"はい。\n" +"同じ圧縮レベルで前処理済みの辞書を再び読み込む場合に高速になります。" -#: ../../library/compression.zstd.rst:457 msgid "" "No. If you wish to load an undigested dictionary multiple times, consider " "reusing a compressor object." msgstr "" +"いいえ。\n" +"前処理していない辞書を複数回読み込む場合は、圧縮オブジェクトの再利用を検討し" +"てください。" -#: ../../library/compression.zstd.rst:460 msgid "" "If passing a :class:`!ZstdDict` without any attribute, an undigested " "dictionary is passed by default when compressing and a digested dictionary " "is generated if necessary and passed by default when decompressing." msgstr "" +"属性を使わずに :class:`!ZstdDict` を渡した場合、圧縮時にはデフォルトで前処理" +"していない辞書が渡されます。\n" +"展開時には、必要に応じて前処理済みの辞書が生成され、デフォルトで渡されます。" -#: ../../library/compression.zstd.rst:466 msgid "" "The content of the Zstandard dictionary, a ``bytes`` object. It's the same " "as the *dict_content* argument in the ``__init__`` method. It can be used " "with other programs, such as the ``zstd`` CLI program." msgstr "" +"Zstandard 辞書の内容を表す ``bytes`` オブジェクトです。\n" +"``__init__`` メソッドの *dict_content* 引数と同じものです。\n" +"``zstd`` CLI プログラムなど、他のプログラムで使うこともできます。" -#: ../../library/compression.zstd.rst:472 msgid "Identifier of the Zstandard dictionary, a non-negative int value." -msgstr "" +msgstr "Zstandard 辞書の識別子を表す非負の整数値です。" -#: ../../library/compression.zstd.rst:474 msgid "" "Non-zero means the dictionary is ordinary, created by Zstandard functions " "and following the Zstandard format." msgstr "" +"0 以外の場合、Zstandard の関数で作成され、Zstandard 形式に従う通常の辞書であ" +"ることを意味します。" -#: ../../library/compression.zstd.rst:477 msgid "" "``0`` means a \"raw content\" dictionary, free of any format restriction, " "used for advanced users." msgstr "" +"``0`` は、上級ユーザー向けの、形式の制約がない「生の内容」の辞書を意味しま" +"す。" -#: ../../library/compression.zstd.rst:482 msgid "" "The meaning of ``0`` for :attr:`!ZstdDict.dict_id` is different from the " "``dictionary_id`` attribute to the :func:`get_frame_info` function." msgstr "" +":attr:`!ZstdDict.dict_id` における ``0`` の意味は、:func:`get_frame_info` 関" +"数が返すオブジェクトの ``dictionary_id`` 属性における意味とは異なります。" -#: ../../library/compression.zstd.rst:488 msgid "Load as a digested dictionary." -msgstr "" +msgstr "前処理済みの辞書として読み込みます。" -#: ../../library/compression.zstd.rst:492 msgid "Load as an undigested dictionary." -msgstr "" +msgstr "前処理していない辞書として読み込みます。" -#: ../../library/compression.zstd.rst:496 msgid "Advanced parameter control" -msgstr "" +msgstr "高度なパラメータの制御" -#: ../../library/compression.zstd.rst:500 msgid "" "An :class:`~enum.IntEnum` containing the advanced compression parameter keys " "that can be used when compressing data." msgstr "" +"データの圧縮時に使える高度な圧縮パラメータのキーを含む :class:`~enum." +"IntEnum` です。" -#: ../../library/compression.zstd.rst:503 -#: ../../library/compression.zstd.rst:737 msgid "" "The :meth:`~.bounds` method can be used on any attribute to get the valid " "values for that parameter." msgstr "" +"各属性で :meth:`~.bounds` メソッドを使うと、そのパラメータの有効な値を取得で" +"きます。" -#: ../../library/compression.zstd.rst:506 msgid "" "Parameters are optional; any omitted parameter will have its value selected " "automatically." msgstr "" +"パラメータは省略可能です。\n" +"省略したパラメータの値は自動的に選択されます。" -#: ../../library/compression.zstd.rst:509 msgid "" "Example getting the lower and upper bound of :attr:`~.compression_level`::" -msgstr "" +msgstr ":attr:`~.compression_level` の下限と上限を取得する例。 ::" -#: ../../library/compression.zstd.rst:511 msgid "lower, upper = CompressionParameter.compression_level.bounds()" -msgstr "" +msgstr "lower, upper = CompressionParameter.compression_level.bounds()" -#: ../../library/compression.zstd.rst:513 msgid "Example setting the :attr:`~.window_log` to the maximum size::" -msgstr "" +msgstr ":attr:`~.window_log` を最大サイズに設定する例。 ::" -#: ../../library/compression.zstd.rst:515 msgid "" "_lower, upper = CompressionParameter.window_log.bounds()\n" "options = {CompressionParameter.window_log: upper}\n" "compress(b'venezuelan beaver cheese', options=options)" msgstr "" +"_lower, upper = CompressionParameter.window_log.bounds()\n" +"options = {CompressionParameter.window_log: upper}\n" +"compress(b'venezuelan beaver cheese', options=options)" -#: ../../library/compression.zstd.rst:521 msgid "" "Return the tuple of int bounds, ``(lower, upper)``, of a compression " "parameter. This method should be called on the attribute you wish to " @@ -732,62 +904,61 @@ msgid "" "compression_level`, one may check the result of ``CompressionParameter." "compression_level.bounds()``." msgstr "" +"圧縮パラメータの整数の範囲を、タプル ``(lower, upper)`` として返します。\n" +"このメソッドは、範囲を取得したい属性に対して呼び出してください。\n" +"例えば、:attr:`~.compression_level` の有効な値を取得するには、" +"``CompressionParameter.compression_level.bounds()`` の結果を調べます。" -#: ../../library/compression.zstd.rst:527 -#: ../../library/compression.zstd.rst:755 msgid "Both the lower and upper bounds are inclusive." -msgstr "" +msgstr "下限と上限は、どちらも範囲に含まれます。" -#: ../../library/compression.zstd.rst:531 msgid "" "A high-level means of setting other compression parameters that affect the " "speed and ratio of compressing data." msgstr "" +"データの圧縮速度や圧縮率に影響する他の圧縮パラメータを設定する、高水準の手段" +"です。" -#: ../../library/compression.zstd.rst:534 msgid "" "Regular compression levels are greater than ``0``. Values greater than " "``20`` are considered \"ultra\" compression and require more memory than " "other levels. Negative values can be used to trade off faster compression " "for worse compression ratios." msgstr "" +"通常の圧縮レベルは ``0`` より大きい値です。\n" +"``20`` より大きい値は「ultra」圧縮とみなされ、他のレベルより多くのメモリを必" +"要とします。\n" +"負の値を使うと、圧縮率を下げる代わりに圧縮を高速化できます。" -#: ../../library/compression.zstd.rst:539 msgid "Setting the level to zero uses :attr:`COMPRESSION_LEVEL_DEFAULT`." msgstr "" +"レベルを 0 に設定すると :attr:`COMPRESSION_LEVEL_DEFAULT` が使われます。" -#: ../../library/compression.zstd.rst:543 msgid "" "Maximum allowed back-reference distance the compressor can use when " "compressing data, expressed as power of two, ``1 << window_log`` bytes. This " "parameter greatly influences the memory usage of compression. Higher values " "require more memory but gain better compression values." msgstr "" +"圧縮時に使用できる後方参照の最大距離を 2 のべき乗で表したものです。\n" +"距離は ``1 << window_log`` バイトになります。\n" +"このパラメータは圧縮時のメモリ使用量に大きく影響します。\n" +"値が大きいほど多くのメモリを必要としますが、圧縮率が向上します。" -#: ../../library/compression.zstd.rst:548 -#: ../../library/compression.zstd.rst:557 -#: ../../library/compression.zstd.rst:568 -#: ../../library/compression.zstd.rst:576 -#: ../../library/compression.zstd.rst:587 -#: ../../library/compression.zstd.rst:602 -#: ../../library/compression.zstd.rst:633 -#: ../../library/compression.zstd.rst:640 -#: ../../library/compression.zstd.rst:648 -#: ../../library/compression.zstd.rst:656 -#: ../../library/compression.zstd.rst:715 -#: ../../library/compression.zstd.rst:764 msgid "A value of zero causes the value to be selected automatically." -msgstr "" +msgstr "値を 0 にすると、自動的に値が選択されます。" -#: ../../library/compression.zstd.rst:552 msgid "" "Size of the initial probe table, as a power of two. The resulting memory " "usage is ``1 << (hash_log+2)`` bytes. Larger tables improve compression " "ratio of strategies <= :attr:`~Strategy.dfast`, and improve compression " "speed of strategies > :attr:`~Strategy.dfast`." msgstr "" +"最初の探索テーブルのサイズを 2 のべき乗で表したものです。\n" +"メモリ使用量は ``1 << (hash_log+2)`` バイトになります。\n" +"テーブルが大きいほど、ストラテジーが :attr:`~Strategy.dfast` 以下の場合は圧縮" +"率が向上し、:attr:`~Strategy.dfast` より大きい場合は圧縮速度が向上します。" -#: ../../library/compression.zstd.rst:561 msgid "" "Size of the multi-probe search table, as a power of two. The resulting " "memory usage is ``1 << (chain_log+2)`` bytes. Larger tables result in better " @@ -795,15 +966,23 @@ msgid "" "`~Strategy.fast` strategy. It's still useful when using :attr:`~Strategy." "dfast` strategy, in which case it defines a secondary probe table." msgstr "" +"複数回の探索に使うテーブルのサイズを 2 のべき乗で表したものです。\n" +"メモリ使用量は ``1 << (chain_log+2)`` バイトになります。\n" +"テーブルが大きいほど圧縮率が向上しますが、圧縮は遅くなります。\n" +"このパラメータは :attr:`~Strategy.fast` ストラテジーでは効果がありません。\n" +":attr:`~Strategy.dfast` ストラテジーでは、二つ目の探索テーブルを定義するため" +"有効です。" -#: ../../library/compression.zstd.rst:572 msgid "" "Number of search attempts, as a power of two. More attempts result in better " "and slower compression. This parameter is useless for :attr:`~Strategy.fast` " "and :attr:`~Strategy.dfast` strategies." msgstr "" +"探索を試みる回数を 2 のべき乗で表したものです。\n" +"回数が多いほど圧縮率が向上しますが、圧縮は遅くなります。\n" +"このパラメータは :attr:`~Strategy.fast` と :attr:`~Strategy.dfast` ストラテ" +"ジーでは役に立ちません。" -#: ../../library/compression.zstd.rst:580 msgid "" "Minimum size of searched matches. Larger values increase compression and " "decompression speed, but decrease ratio. Note that Zstandard can still find " @@ -812,49 +991,66 @@ msgid "" "effective minimum is ``4``; for all strategies > :attr:`~Strategy.fast`, the " "effective maximum is ``6``." msgstr "" +"検索する一致部分の最小サイズです。\n" +"値が大きいほど圧縮と展開が速くなりますが、圧縮率は低下します。\n" +"ただし、Zstandard はこれより小さい一致部分も見つけることがあります。\n" +"このパラメータは、指定したサイズ以上の一致を探すよう検索アルゴリズムを調整す" +"るだけです。\n" +":attr:`~Strategy.btopt` より小さいすべてのストラテジーでは実効的な最小値は " +"``4`` です。\n" +":attr:`~Strategy.fast` より大きいすべてのストラテジーでは実効的な最大値は " +"``6`` です。" -#: ../../library/compression.zstd.rst:591 msgid "The impact of this field depends on the selected :class:`Strategy`." msgstr "" +"このフィールドの効果は、選択した :class:`Strategy` によって異なります。" -#: ../../library/compression.zstd.rst:593 msgid "" "For strategies :attr:`~Strategy.btopt`, :attr:`~Strategy.btultra` and :attr:" "`~Strategy.btultra2`, the value is the length of a match considered \"good " "enough\" to stop searching. Larger values make compression ratios better, " "but compresses slower." msgstr "" +":attr:`~Strategy.btopt`、:attr:`~Strategy.btultra`、:attr:`~Strategy." +"btultra2` ストラテジーでは、この値は、探索を打ち切るのに「十分によい」とみな" +"す一致部分の長さです。\n" +"値が大きいほど圧縮率が向上しますが、圧縮は遅くなります。" -#: ../../library/compression.zstd.rst:598 msgid "" "For strategy :attr:`~Strategy.fast`, it is the distance between match " "sampling. Larger values make compression faster, but with a worse " "compression ratio." msgstr "" +":attr:`~Strategy.fast` ストラテジーでは、一致を調べるサンプリングの間隔で" +"す。\n" +"値が大きいほど圧縮は速くなりますが、圧縮率は低下します。" -#: ../../library/compression.zstd.rst:606 msgid "" "The higher the value of selected strategy, the more complex the compression " "technique used by zstd, resulting in higher compression ratios but slower " "compression." msgstr "" +"選択したストラテジーの値が大きいほど、zstd は複雑な圧縮手法を使うため、圧縮率" +"は向上しますが圧縮は遅くなります。" -#: ../../library/compression.zstd.rst:610 msgid ":class:`Strategy`" -msgstr "" +msgstr ":class:`Strategy`" -#: ../../library/compression.zstd.rst:614 msgid "" "Long distance matching can be used to improve compression for large inputs " "by finding large matches at greater distances. It increases memory usage and " "window size." msgstr "" +"長距離マッチングを使うと、遠く離れた位置にある長い一致部分を見つけ、大きな入" +"力の圧縮を改善できます。\n" +"メモリ使用量とウィンドウサイズは増加します。" -#: ../../library/compression.zstd.rst:618 msgid "" "``True`` or ``1`` enable long distance matching while ``False`` or ``0`` " "disable it." msgstr "" +"``True`` または ``1`` は長距離マッチングを有効にし、``False`` または ``0`` は" +"無効にします。" #: ../../library/compression.zstd.rst:621 msgid "" @@ -864,157 +1060,186 @@ msgid "" "compression strategy >= :attr:`~Strategy.btopt` (compression level 16+)." msgstr "" -#: ../../library/compression.zstd.rst:629 msgid "" "Size of the table for long distance matching, as a power of two. Larger " "values increase memory usage and compression ratio, but decrease compression " "speed." msgstr "" +"長距離マッチング用のテーブルのサイズを 2 のべき乗で表したものです。\n" +"値が大きいほどメモリ使用量と圧縮率が増加しますが、圧縮速度は低下します。" -#: ../../library/compression.zstd.rst:637 msgid "" "Minimum match size for long distance matcher. Larger or too small values can " "often decrease the compression ratio." msgstr "" +"長距離マッチングでの一致部分の最小サイズです。\n" +"値が大きい場合や小さすぎる場合は、圧縮率が低下することがよくあります。" -#: ../../library/compression.zstd.rst:644 msgid "" "Log size of each bucket in the long distance matcher hash table for " "collision resolution. Larger values improve collision resolution but " "decrease compression speed." msgstr "" +"長距離マッチング用のハッシュテーブルで衝突を解決するための、各バケットのサイ" +"ズの対数です。\n" +"値が大きいほど衝突の解決が改善しますが、圧縮速度は低下します。" -#: ../../library/compression.zstd.rst:652 msgid "" "Frequency of inserting/looking up entries into the long distance matcher " "hash table. Larger values improve compression speed. Deviating far from the " "default value will likely result in a compression ratio decrease." msgstr "" +"長距離マッチング用のハッシュテーブルに対して、エントリーを挿入・検索する頻度" +"です。\n" +"値が大きいほど圧縮速度が向上します。\n" +"デフォルト値から大きく外れると、圧縮率が低下する可能性が高くなります。" -#: ../../library/compression.zstd.rst:660 msgid "" "Write the size of the data to be compressed into the Zstandard frame header " "when known prior to compressing." msgstr "" +"圧縮するデータのサイズが圧縮前に分かっている場合、そのサイズを Zstandard フ" +"レームのヘッダーに書き込みます。" -#: ../../library/compression.zstd.rst:663 msgid "This flag only takes effect under the following scenarios:" -msgstr "" +msgstr "このフラグは、次の場合にのみ効果があります:" -#: ../../library/compression.zstd.rst:665 msgid "Calling :func:`compress` for one-shot compression" -msgstr "" +msgstr "一度に圧縮するために :func:`compress` を呼び出す場合" -#: ../../library/compression.zstd.rst:666 msgid "" "Providing all of the data to be compressed in the frame in a single :meth:" "`ZstdCompressor.compress` call, with the :attr:`ZstdCompressor.FLUSH_FRAME` " "mode." msgstr "" +":attr:`ZstdCompressor.FLUSH_FRAME` モードで :meth:`ZstdCompressor.compress` " +"を一度だけ呼び出し、そのフレームに圧縮するすべてのデータを渡す場合。" -#: ../../library/compression.zstd.rst:669 msgid "" "Calling :meth:`ZstdCompressor.set_pledged_input_size` with the exact amount " "of data that will be provided to the compressor prior to any calls to :meth:" "`ZstdCompressor.compress` for the current frame. :meth:`!ZstdCompressor." "set_pledged_input_size` must be called for each new frame." msgstr "" +"現在のフレームに対して :meth:`ZstdCompressor.compress` を呼び出す前に、圧縮オ" +"ブジェクトに渡す正確なデータ量で :meth:`ZstdCompressor." +"set_pledged_input_size` を呼び出す場合。\n" +"新しいフレームごとに :meth:`!ZstdCompressor.set_pledged_input_size` を呼び出" +"さなければなりません。" -#: ../../library/compression.zstd.rst:675 msgid "" "All other compression calls may not write the size information into the " "frame header." msgstr "" +"それ以外の圧縮の呼び出しでは、サイズ情報がフレームヘッダーに書き込まれない場" +"合があります。" -#: ../../library/compression.zstd.rst:678 msgid "" "``True`` or ``1`` enable the content size flag while ``False`` or ``0`` " "disable it." msgstr "" +"``True`` または ``1`` は内容サイズのフラグを有効にし、``False`` または ``0`` " +"は無効にします。" -#: ../../library/compression.zstd.rst:683 msgid "" "A four-byte checksum using XXHash64 of the uncompressed content is written " "at the end of each frame. Zstandard's decompression code verifies the " "checksum. If there is a mismatch a :class:`ZstdError` exception is raised." msgstr "" +"非圧縮の内容から XXHash64 で計算した 4 バイトのチェックサムを、各フレームの末" +"尾に書き込みます。\n" +"Zstandard の展開コードはこのチェックサムを検証します。\n" +"一致しない場合は :class:`ZstdError` 例外を送出します。" -#: ../../library/compression.zstd.rst:688 msgid "" "``True`` or ``1`` enable checksum generation while ``False`` or ``0`` " "disable it." msgstr "" +"``True`` または ``1`` はチェックサムの生成を有効にし、``False`` または ``0`` " +"は無効にします。" -#: ../../library/compression.zstd.rst:693 msgid "" "When compressing with a :class:`ZstdDict`, the dictionary's ID is written " "into the frame header." msgstr "" +":class:`ZstdDict` を使って圧縮する際、辞書の ID をフレームヘッダーに書き込み" +"ます。" -#: ../../library/compression.zstd.rst:696 msgid "" "``True`` or ``1`` enable storing the dictionary ID while ``False`` or ``0`` " "disable it." msgstr "" +"``True`` または ``1`` は辞書 ID の保存を有効にし、``False`` または ``0`` は無" +"効にします。" -#: ../../library/compression.zstd.rst:701 msgid "" "Select how many threads will be spawned to compress in parallel. When :attr:" "`!nb_workers` > 0, enables multi-threaded compression, a value of ``1`` " "means \"one-thread multi-threaded mode\". More workers improve speed, but " "also increase memory usage and slightly reduce compression ratio." msgstr "" +"並列に圧縮するために起動するスレッド数を選択します。\n" +":attr:`!nb_workers` が 0 より大きい場合、マルチスレッド圧縮が有効になりま" +"す。\n" +"値 ``1`` は「1 スレッドのマルチスレッドモード」を意味します。\n" +"ワーカーが多いほど速度が向上しますが、メモリ使用量も増加し、圧縮率はわずかに" +"低下します。" -#: ../../library/compression.zstd.rst:706 msgid "A value of zero disables multi-threading." -msgstr "" +msgstr "値を 0 にすると、マルチスレッド処理が無効になります。" -#: ../../library/compression.zstd.rst:710 msgid "" "Size of a compression job, in bytes. This value is enforced only when :attr:" "`~CompressionParameter.nb_workers` >= 1. Each compression job is completed " "in parallel, so this value can indirectly impact the number of active " "threads." msgstr "" +"圧縮ジョブのサイズ (バイト単位) です。\n" +"この値は、:attr:`~CompressionParameter.nb_workers` が 1 以上の場合にのみ適用" +"されます。\n" +"各圧縮ジョブは並列に実行されるため、この値はアクティブなスレッド数に間接的に" +"影響する場合があります。" -#: ../../library/compression.zstd.rst:719 msgid "" "Sets how much data is reloaded from previous jobs (threads) for new jobs to " "be used by the look behind window during compression. This value is only " "used when :attr:`~CompressionParameter.nb_workers` >= 1. Acceptable values " "vary from 0 to 9." msgstr "" +"新しいジョブで圧縮時の後方参照ウィンドウに使うために、前のジョブ (スレッド) " +"から再読み込みするデータ量を設定します。\n" +"この値は、:attr:`~CompressionParameter.nb_workers` が 1 以上の場合にのみ使わ" +"れます。\n" +"指定できる値は 0 から 9 です。" -#: ../../library/compression.zstd.rst:724 msgid "0 means dynamically set the overlap amount" -msgstr "" +msgstr "0 は重複量を動的に設定することを意味します" -#: ../../library/compression.zstd.rst:725 msgid "1 means no overlap" -msgstr "" +msgstr "1 は重複なしを意味します" -#: ../../library/compression.zstd.rst:726 msgid "9 means use a full window size from the previous job" -msgstr "" +msgstr "9 は前のジョブのウィンドウサイズ全体を使うことを意味します" -#: ../../library/compression.zstd.rst:728 msgid "" "Each increment halves/doubles the overlap size. \"8\" means an overlap of " "``window_size/2``, \"7\" means an overlap of ``window_size/4``, etc." msgstr "" +"値を一つ減らすと重複サイズは半分になり、一つ増やすと倍になります。\n" +"「8」は ``window_size/2``、「7」は ``window_size/4`` の重複を意味します。" -#: ../../library/compression.zstd.rst:733 msgid "" "An :class:`~enum.IntEnum` containing the advanced decompression parameter " "keys that can be used when decompressing data. Parameters are optional; any " "omitted parameter will have its value selected automatically." msgstr "" +"データの展開時に使える高度な展開パラメータのキーを含む :class:`~enum." +"IntEnum` です。\n" +"パラメータは省略可能で、省略したパラメータの値は自動的に選択されます。" -#: ../../library/compression.zstd.rst:740 msgid "Example setting the :attr:`~.window_log_max` to the maximum size::" -msgstr "" +msgstr ":attr:`~.window_log_max` を最大サイズに設定する例。 ::" -#: ../../library/compression.zstd.rst:742 msgid "" "data = compress(b'Some very long buffer of bytes...')\n" "\n" @@ -1023,96 +1248,111 @@ msgid "" "options = {DecompressionParameter.window_log_max: upper}\n" "decompress(data, options=options)" msgstr "" +"data = compress(b'Some very long buffer of bytes...')\n" +"\n" +"_lower, upper = DecompressionParameter.window_log_max.bounds()\n" +"\n" +"options = {DecompressionParameter.window_log_max: upper}\n" +"decompress(data, options=options)" -#: ../../library/compression.zstd.rst:751 msgid "" "Return the tuple of int bounds, ``(lower, upper)``, of a decompression " "parameter. This method should be called on the attribute you wish to " "retrieve the bounds of." msgstr "" +"展開パラメータの整数の範囲を、タプル ``(lower, upper)`` として返します。\n" +"このメソッドは、範囲を取得したい属性に対して呼び出してください。" -#: ../../library/compression.zstd.rst:759 msgid "" "The base-two logarithm of the maximum size of the window used during " "decompression. This can be useful to limit the amount of memory used when " "decompressing data. A larger maximum window size leads to faster " "decompression." msgstr "" +"展開時に使うウィンドウの最大サイズの、2 を底とする対数です。\n" +"展開時のメモリ使用量を制限するのに役立ちます。\n" +"ウィンドウの最大サイズが大きいほど、展開は速くなります。" -#: ../../library/compression.zstd.rst:769 msgid "" "An :class:`~enum.IntEnum` containing strategies for compression. Higher-" "numbered strategies correspond to more complex and slower compression." msgstr "" +"圧縮ストラテジーを含む :class:`~enum.IntEnum` です。\n" +"数値が大きいストラテジーほど、複雑で遅い圧縮に対応します。" -#: ../../library/compression.zstd.rst:775 msgid "" "The values of attributes of :class:`!Strategy` are not necessarily stable " "across zstd versions. Only the ordering of the attributes may be relied " "upon. The attributes are listed below in order." msgstr "" +":class:`!Strategy` の属性の値は、zstd のバージョン間で必ずしも一定ではありま" +"せん。\n" +"依存できるのは属性の順序だけです。\n" +"以下に属性を順番に示します。" -#: ../../library/compression.zstd.rst:779 msgid "The following strategies are available:" -msgstr "" +msgstr "次のストラテジーを利用できます:" #: ../../library/compression.zstd.rst:801 msgid "Miscellaneous" msgstr "その他" -#: ../../library/compression.zstd.rst:805 msgid "" "Retrieve a :class:`FrameInfo` object containing metadata about a Zstandard " "frame. Frames contain metadata related to the compressed data they hold." msgstr "" +"Zstandard フレームのメタデータを含む :class:`FrameInfo` オブジェクトを取得し" +"ます。\n" +"フレームには、格納する圧縮データに関するメタデータが含まれています。" -#: ../../library/compression.zstd.rst:811 msgid "Metadata related to a Zstandard frame." -msgstr "" +msgstr "Zstandard フレームに関するメタデータです。" -#: ../../library/compression.zstd.rst:815 msgid "The size of the decompressed contents of the frame." -msgstr "" +msgstr "フレームの内容を展開したサイズです。" -#: ../../library/compression.zstd.rst:819 msgid "" "An integer representing the Zstandard dictionary ID needed for decompressing " "the frame. ``0`` means the dictionary ID was not recorded in the frame " "header. This may mean that a Zstandard dictionary is not needed, or that the " "ID of a required dictionary was not recorded." msgstr "" +"フレームの展開に必要な Zstandard 辞書の ID を表す整数です。\n" +"``0`` は、辞書 ID がフレームヘッダーに記録されていないことを意味します。\n" +"Zstandard 辞書が不要な場合もあれば、必要な辞書の ID が記録されていない場合も" +"あります。" -#: ../../library/compression.zstd.rst:827 msgid "The default compression level for Zstandard: ``3``." -msgstr "" +msgstr "Zstandard のデフォルトの圧縮レベル: ``3``。" -#: ../../library/compression.zstd.rst:832 msgid "" "Version number of the runtime zstd library as a tuple of integers (major, " "minor, release)." msgstr "" +"実行時に使う zstd ライブラリのバージョン番号を表す整数のタプル (major, " +"minor, release) です。" #: ../../library/compression.zstd.rst:837 msgid "Examples" msgstr "使用例" -#: ../../library/compression.zstd.rst:839 msgid "Reading in a compressed file:" -msgstr "" +msgstr "圧縮ファイルの読み込み:" -#: ../../library/compression.zstd.rst:841 msgid "" "from compression import zstd\n" "\n" "with zstd.open(\"file.zst\") as f:\n" " file_content = f.read()" msgstr "" +"from compression import zstd\n" +"\n" +"with zstd.open(\"file.zst\") as f:\n" +" file_content = f.read()" -#: ../../library/compression.zstd.rst:848 msgid "Creating a compressed file:" -msgstr "" +msgstr "圧縮ファイルの作成:" -#: ../../library/compression.zstd.rst:850 msgid "" "from compression import zstd\n" "\n" @@ -1120,24 +1360,29 @@ msgid "" "with zstd.open(\"file.zst\", \"w\") as f:\n" " f.write(data)" msgstr "" +"from compression import zstd\n" +"\n" +"data = b\"Insert Data Here\"\n" +"with zstd.open(\"file.zst\", \"w\") as f:\n" +" f.write(data)" -#: ../../library/compression.zstd.rst:858 msgid "Compressing data in memory:" -msgstr "" +msgstr "メモリ上でのデータの圧縮:" -#: ../../library/compression.zstd.rst:860 msgid "" "from compression import zstd\n" "\n" "data_in = b\"Insert Data Here\"\n" "data_out = zstd.compress(data_in)" msgstr "" +"from compression import zstd\n" +"\n" +"data_in = b\"Insert Data Here\"\n" +"data_out = zstd.compress(data_in)" -#: ../../library/compression.zstd.rst:867 msgid "Incremental compression:" -msgstr "" +msgstr "インクリメンタルな圧縮:" -#: ../../library/compression.zstd.rst:869 msgid "" "from compression import zstd\n" "\n" @@ -1149,12 +1394,19 @@ msgid "" "# Concatenate all the partial results:\n" "result = b\"\".join([out1, out2, out3, out4])" msgstr "" +"from compression import zstd\n" +"\n" +"comp = zstd.ZstdCompressor()\n" +"out1 = comp.compress(b\"Some data\\n\")\n" +"out2 = comp.compress(b\"Another piece of data\\n\")\n" +"out3 = comp.compress(b\"Even more data\\n\")\n" +"out4 = comp.flush()\n" +"# 部分的な結果をすべて連結する:\n" +"result = b\"\".join([out1, out2, out3, out4])" -#: ../../library/compression.zstd.rst:881 msgid "Writing compressed data to an already-open file:" -msgstr "" +msgstr "すでに開かれたファイルへの圧縮データの書き込み:" -#: ../../library/compression.zstd.rst:883 msgid "" "from compression import zstd\n" "\n" @@ -1164,12 +1416,17 @@ msgid "" " zstf.write(b\"This *will* be compressed\\n\")\n" " f.write(b\"Not compressed\\n\")" msgstr "" +"from compression import zstd\n" +"\n" +"with open(\"myfile\", \"wb\") as f:\n" +" f.write(b\"This data will not be compressed\\n\")\n" +" with zstd.open(f, \"w\") as zstf:\n" +" zstf.write(b\"This *will* be compressed\\n\")\n" +" f.write(b\"Not compressed\\n\")" -#: ../../library/compression.zstd.rst:893 msgid "Creating a compressed file using compression parameters:" -msgstr "" +msgstr "圧縮パラメータを使った圧縮ファイルの作成:" -#: ../../library/compression.zstd.rst:895 msgid "" "from compression import zstd\n" "\n" @@ -1179,3 +1436,10 @@ msgid "" "with zstd.open(\"file.zst\", \"w\", options=options) as f:\n" " f.write(b\"Mind if I squeeze in?\")" msgstr "" +"from compression import zstd\n" +"\n" +"options = {\n" +" zstd.CompressionParameter.checksum_flag: 1\n" +"}\n" +"with zstd.open(\"file.zst\", \"w\", options=options) as f:\n" +" f.write(b\"Mind if I squeeze in?\")" diff --git a/library/concurrency.po b/library/concurrency.po index 2a1eabfe1..941631d27 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -26,7 +26,6 @@ msgstr "" msgid "Concurrent Execution" msgstr "並行実行" -#: ../../library/concurrency.rst:7 msgid "" "The modules described in this chapter provide support for concurrent " "execution of code. The appropriate choice of tool will depend on the task to " @@ -34,10 +33,11 @@ msgid "" "(event driven cooperative multitasking vs preemptive multitasking). Here's " "an overview:" msgstr "" -"この章で記述されているモジュールは、コードの並行実行のサポートを提供します。" -"ツールの適切な選択は、実行されるタスク(IO bound vs CPU bound) や推奨される開" -"発スタイル (イベントドリブンな協調的マルチタスク vs プリエンプティブマルチタ" -"スク) に依存します。ここに概観を示します:" +"この章で説明するモジュールは、コードの並行実行をサポートします。\n" +"適切なツールは、実行するタスク (CPU バウンドか I/O バウンドか) と、好みの開発" +"スタイル (イベント駆動の協調的マルチタスクかプリエンプティブマルチタスクか) " +"によって異なります。\n" +"概要は以下のとおりです:" #: ../../library/concurrency.rst:28 msgid "The following are support modules for some of the above services:" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 364a54e02..deff3163d 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -37,27 +37,37 @@ msgstr "" "concurrent/futures/process.py` および :source:`Lib/concurrent/futures/" "interpreter.py`" -#: ../../library/concurrent.futures.rst:15 msgid "" "The :mod:`!concurrent.futures` module provides a high-level interface for " "asynchronously executing callables." msgstr "" +":mod:`!concurrent.futures` モジュールは、呼び出し可能オブジェクトを非同期に実" +"行するための高水準インターフェースを提供します。" -#: ../../library/concurrent.futures.rst:18 msgid "" "The asynchronous execution can be performed with threads, using :class:" "`ThreadPoolExecutor` or :class:`InterpreterPoolExecutor`, or separate " "processes, using :class:`ProcessPoolExecutor`. Each implements the same " "interface, which is defined by the abstract :class:`Executor` class." msgstr "" +"非同期実行には、:class:`ThreadPoolExecutor` または :class:" +"`InterpreterPoolExecutor` によるスレッド、あるいは :class:" +"`ProcessPoolExecutor` による別プロセスを使えます。\n" +"いずれも、抽象クラス :class:`Executor` で定義された同じインターフェースを実装" +"しています。" -#: ../../library/concurrent.futures.rst:24 msgid "" ":class:`concurrent.futures.Future` must not be confused with :class:`asyncio." "Future`, which is designed for use with :mod:`asyncio` tasks and coroutines. " "See the :doc:`asyncio's Future ` documentation for a " "detailed comparison of the two." msgstr "" +":class:`concurrent.futures.Future` と :class:`asyncio.Future` を混同しないで" +"ください。\n" +"後者は :mod:`asyncio` のタスクやコルーチンとともに使うよう設計されていま" +"す。\n" +"両者の詳しい比較は、:doc:`asyncio の Future ` のドキュメント" +"を参照してください。" msgid "Availability" msgstr "利用可能な環境" @@ -92,30 +102,35 @@ msgstr "" "にスケジュールし、呼び出し可能オブジェクトの実行を表現する :class:`Future` オ" "ブジェクトを返します。 ::" -#: ../../library/concurrent.futures.rst:45 msgid "" "with ThreadPoolExecutor(max_workers=1) as executor:\n" " future = executor.submit(pow, 323, 1235)\n" " print(future.result())" msgstr "" +"with ThreadPoolExecutor(max_workers=1) as executor:\n" +" future = executor.submit(pow, 323, 1235)\n" +" print(future.result())" -#: ../../library/concurrent.futures.rst:51 msgid "Similar to :func:`map(fn, *iterables) ` except:" -msgstr "" +msgstr ":func:`map(fn, *iterables) ` と似ていますが、次の違いがあります:" -#: ../../library/concurrent.futures.rst:53 msgid "" "The *iterables* are collected immediately rather than lazily, unless a " "*buffersize* is specified to limit the number of submitted tasks whose " "results have not yet been yielded. If the buffer is full, iteration over the " "*iterables* pauses until a result is yielded from the buffer." msgstr "" +"結果をまだ yield していない投入済みタスクの数を制限する *buffersize* が指定さ" +"れていない限り、*iterables* の要素は遅延せず、直ちに収集されます。\n" +"バッファがいっぱいになると、バッファから結果が yield されるまで *iterables* " +"の反復処理は一時停止します。" -#: ../../library/concurrent.futures.rst:58 msgid "" "*fn* is executed asynchronously and several calls to *fn* may be made " "concurrently." msgstr "" +"*fn* は非同期に実行され、複数の *fn* の呼び出しが並行して行われる場合がありま" +"す。" msgid "" "The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator." @@ -138,7 +153,6 @@ msgstr "" "もし *fn* の呼び出しが例外を送出した場合、その例外はイテレータから値を受け取" "る時に送出されます。" -#: ../../library/concurrent.futures.rst:70 msgid "" "When using :class:`ProcessPoolExecutor`, this method chops *iterables* into " "a number of chunks which it submits to the pool as separate tasks. The " @@ -148,6 +162,14 @@ msgid "" "size of 1. With :class:`ThreadPoolExecutor` and :class:" "`InterpreterPoolExecutor`, *chunksize* has no effect." msgstr "" +":class:`ProcessPoolExecutor` を使う場合、このメソッドは *iterables* を複数の" +"チャンクに分割し、それぞれを別々のタスクとしてプールに投入します。\n" +"*chunksize* を正の整数に設定すると、各チャンクのおおよそのサイズを指定できま" +"す。\n" +"非常に長いイテラブルでは、*chunksize* に大きな値を使うと、デフォルトのサイズ " +"1 に比べて性能が大幅に向上する場合があります。\n" +":class:`ThreadPoolExecutor` と :class:`InterpreterPoolExecutor` では、" +"*chunksize* は効果がありません。" #: ../../library/concurrent.futures.rst:79 msgid "Added the *chunksize* parameter." @@ -186,29 +208,36 @@ msgstr "" "れます。 *wait* の値に関係なく、すべての未完了のフューチャの実行が完了するま" "で Python プログラム全体は終了しません。" -#: ../../library/concurrent.futures.rst:100 msgid "" "If *cancel_futures* is ``True``, this method will cancel all pending futures " "that the executor has not started running. Any futures that are completed or " "running won't be cancelled, regardless of the value of *cancel_futures*." msgstr "" +"*cancel_futures* が ``True`` の場合、このメソッドは executor がまだ実行を開始" +"していない未完了のフューチャをすべてキャンセルします。\n" +"すでに完了したフューチャや実行中のフューチャは、*cancel_futures* の値にかかわ" +"らずキャンセルされません。" -#: ../../library/concurrent.futures.rst:105 msgid "" "If both *cancel_futures* and *wait* are ``True``, all futures that the " "executor has started running will be completed prior to this method " "returning. The remaining futures are cancelled." msgstr "" +"*cancel_futures* と *wait* がともに ``True`` の場合、executor が実行を開始し" +"たフューチャはすべて、このメソッドが返る前に完了します。\n" +"残りのフューチャはキャンセルされます。" -#: ../../library/concurrent.futures.rst:109 msgid "" "You can avoid having to call this method explicitly if you use the executor " "as a :term:`context manager` via the :keyword:`with` statement, which will " "shutdown the :class:`Executor` (waiting as if :meth:`Executor.shutdown` were " "called with *wait* set to ``True``)::" msgstr "" +":keyword:`with` 文で executor を :term:`コンテキストマネージャ ` として使えば、このメソッドを明示的に呼び出す必要はありません。\n" +":class:`Executor` はシャットダウンされます (*wait* を ``True`` にして :meth:" +"`Executor.shutdown` を呼び出した場合と同様に待機します)。 ::" -#: ../../library/concurrent.futures.rst:114 msgid "" "import shutil\n" "with ThreadPoolExecutor(max_workers=4) as e:\n" @@ -217,6 +246,12 @@ msgid "" " e.submit(shutil.copy, 'src3.txt', 'dest3.txt')\n" " e.submit(shutil.copy, 'src4.txt', 'dest4.txt')" msgstr "" +"import shutil\n" +"with ThreadPoolExecutor(max_workers=4) as e:\n" +" e.submit(shutil.copy, 'src1.txt', 'dest1.txt')\n" +" e.submit(shutil.copy, 'src2.txt', 'dest2.txt')\n" +" e.submit(shutil.copy, 'src3.txt', 'dest3.txt')\n" +" e.submit(shutil.copy, 'src4.txt', 'dest4.txt')" #: ../../library/concurrent.futures.rst:121 msgid "Added *cancel_futures*." @@ -242,7 +277,6 @@ msgstr "" ":class:`Future` に関連づけられた呼び出し可能オブジェクトが、別の :class:" "`Future` の結果を待つ時にデッドロックすることがあります。例::" -#: ../../library/concurrent.futures.rst:134 msgid "" "import time\n" "def wait_on_b():\n" @@ -260,12 +294,26 @@ msgid "" "a = executor.submit(wait_on_b)\n" "b = executor.submit(wait_on_a)" msgstr "" +"import time\n" +"def wait_on_b():\n" +" time.sleep(5)\n" +" print(b.result()) # b は a を待っているため完了しない\n" +" return 5\n" +"\n" +"def wait_on_a():\n" +" time.sleep(5)\n" +" print(a.result()) # a は b を待っているため完了しない\n" +" return 6\n" +"\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=2)\n" +"a = executor.submit(wait_on_b)\n" +"b = executor.submit(wait_on_a)" #: ../../library/concurrent.futures.rst:150 msgid "And::" msgstr "以下でも同様です::" -#: ../../library/concurrent.futures.rst:152 msgid "" "def wait_on_future():\n" " f = executor.submit(pow, 5, 2)\n" @@ -278,6 +326,18 @@ msgid "" "# Note: calling future.result() would also cause a deadlock because\n" "# the single worker thread is already waiting for wait_on_future()." msgstr "" +"def wait_on_future():\n" +" f = executor.submit(pow, 5, 2)\n" +" # ワーカースレッドは一つしかなく、この関数を実行しているため\n" +" # この処理は完了しない\n" +" print(f.result())\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=1)\n" +"future = executor.submit(wait_on_future)\n" +"# 注意: future.result() を呼び出してもデッドロックが起こる。\n" +"\n" +"# 唯一のワーカースレッドはすでに wait_on_future() の終了を待っているためであ" +"る" #: ../../library/concurrent.futures.rst:166 msgid "" @@ -287,7 +347,6 @@ msgstr "" "最大で *max_workers* 個のスレッドを非同期実行に使う :class:`Executor` のサブ" "クラスです。" -#: ../../library/concurrent.futures.rst:169 msgid "" "All threads enqueued to ``ThreadPoolExecutor`` will be joined before the " "interpreter can exit. Note that the exit handler which does this is executed " @@ -296,8 +355,15 @@ msgid "" "exit gracefully. For this reason, it is recommended that " "``ThreadPoolExecutor`` not be used for long-running tasks." msgstr "" +"``ThreadPoolExecutor`` に登録されたすべてのスレッドは、インタープリタの終了前" +"に join されます。\n" +"この処理を行う終了ハンドラは、``atexit`` で追加した終了ハンドラよりも *前に* " +"実行されることに注意してください。\n" +"そのため、スレッドに正常終了を指示できるように、メインスレッドの例外を捕捉し" +"て処理しなければなりません。\n" +"この理由から、長時間実行するタスクには ``ThreadPoolExecutor`` を使わないこと" +"を推奨します。" -#: ../../library/concurrent.futures.rst:176 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker thread; *initargs* is a tuple of arguments passed to the " @@ -305,6 +371,12 @@ msgid "" "jobs will raise a :exc:`~concurrent.futures.thread.BrokenThreadPool`, as " "well as any attempt to submit more jobs to the pool." msgstr "" +"*initializer* は省略可能な呼び出し可能オブジェクトで、各ワーカースレッドの開" +"始時に呼び出されます。\n" +"*initargs* は、この初期化処理に渡す引数のタプルです。\n" +"*initializer* が例外を送出した場合、現在未完了のジョブはすべて :exc:" +"`~concurrent.futures.thread.BrokenThreadPool` を送出し、プールへの新たなジョ" +"ブの投入も同じ例外を送出します。" #: ../../library/concurrent.futures.rst:182 msgid "" @@ -335,31 +407,37 @@ msgstr "" msgid "Added the *initializer* and *initargs* arguments." msgstr "*initializer* と *initargs* 引数が追加されました。" -#: ../../library/concurrent.futures.rst:198 msgid "" "Default value of *max_workers* is changed to ``min(32, os.cpu_count() + " "4)``. This default value preserves at least 5 workers for I/O bound tasks. " "It utilizes at most 32 CPU cores for CPU bound tasks which release the GIL. " "And it avoids using very large resources implicitly on many-core machines." msgstr "" +"*max_workers* のデフォルト値が ``min(32, os.cpu_count() + 4)`` に変更されまし" +"た。\n" +"このデフォルト値により、I/O バウンドのタスクには少なくとも 5 個のワーカーが確" +"保されます。\n" +"GIL を解放する CPU バウンドのタスクには最大 32 個の CPU コアを利用します。\n" +"また、多数のコアを持つマシンで暗黙に大量のリソースを使うことを避けられます。" -#: ../../library/concurrent.futures.rst:204 msgid "" "ThreadPoolExecutor now reuses idle worker threads before starting " "*max_workers* worker threads too." msgstr "" +"ThreadPoolExecutor は、*max_workers* 個のワーカースレッドを起動する前に、待機" +"中のワーカースレッドを再利用するようにもなりました。" -#: ../../library/concurrent.futures.rst:207 msgid "" "Default value of *max_workers* is changed to ``min(32, (os." "process_cpu_count() or 1) + 4)``." msgstr "" +"*max_workers* のデフォルト値が ``min(32, (os.process_cpu_count() or 1) + " +"4)`` に変更されました。" #: ../../library/concurrent.futures.rst:215 msgid "ThreadPoolExecutor Example" msgstr "ThreadPoolExecutor の例" -#: ../../library/concurrent.futures.rst:218 msgid "" "import concurrent.futures\n" "import urllib.request\n" @@ -389,12 +467,38 @@ msgid "" " else:\n" " print('%r page is %d bytes' % (url, len(data)))" msgstr "" +"import concurrent.futures\n" +"import urllib.request\n" +"\n" +"URLS = ['http://www.foxnews.com/',\n" +" 'http://www.cnn.com/',\n" +" 'http://europe.wsj.com/',\n" +" 'http://www.bbc.co.uk/',\n" +" 'http://nonexistent-subdomain.python.org/']\n" +"\n" +"# 一つのページを取得し、URL と内容を報告する\n" +"def load_url(url, timeout):\n" +" with urllib.request.urlopen(url, timeout=timeout) as conn:\n" +" return conn.read()\n" +"\n" +"# with 文を使えばスレッドを速やかに後始末できる\n" +"with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:\n" +" # 読み込みを開始し、各フューチャに URL を対応付ける\n" +" future_to_url = {executor.submit(load_url, url, 60): url for url in " +"URLS}\n" +" for future in concurrent.futures.as_completed(future_to_url):\n" +" url = future_to_url[future]\n" +" try:\n" +" data = future.result()\n" +" except Exception as exc:\n" +" print('%r generated an exception: %s' % (url, exc))\n" +" else:\n" +" print('%r page is %d bytes' % (url, len(data)))" #: ../../library/concurrent.futures.rst:247 msgid "InterpreterPoolExecutor" msgstr "InterpreterPoolExecutor" -#: ../../library/concurrent.futures.rst:251 msgid "" "The :class:`InterpreterPoolExecutor` class uses a pool of interpreters to " "execute calls asynchronously. It is a :class:`ThreadPoolExecutor` subclass, " @@ -402,8 +506,13 @@ msgid "" "that each worker has its own interpreter, and runs each task using that " "interpreter." msgstr "" +":class:`InterpreterPoolExecutor` クラスは、インタープリタのプールを使って呼び" +"出しを非同期に実行します。\n" +":class:`ThreadPoolExecutor` のサブクラスなので、各ワーカーはそれぞれのスレッ" +"ドで動作します。\n" +"異なる点は、各ワーカーが専用のインタープリタを持ち、それを使って各タスクを実" +"行することです。" -#: ../../library/concurrent.futures.rst:257 msgid "" "The biggest benefit to using interpreters instead of only threads is true " "multi-core parallelism. Each interpreter has its own :term:`Global " @@ -411,8 +520,13 @@ msgid "" "interpreter can run on one CPU core, while code in another interpreter runs " "unblocked on a different core." msgstr "" +"スレッドだけを使う代わりにインタープリタを使う最大の利点は、複数のコアで真に" +"並列実行できることです。\n" +"各インタープリタはそれぞれの :term:`グローバルインタープリタロック ` を持ちます。\n" +"そのため、一つのインタープリタのコードをある CPU コアで実行しながら、別のイン" +"タープリタのコードを他のコアで、妨げられることなく実行できます。" -#: ../../library/concurrent.futures.rst:263 msgid "" "The tradeoff is that writing concurrent code for use with multiple " "interpreters can take extra effort. However, this is because it forces you " @@ -424,8 +538,17 @@ msgid "" "deal with several of the big pain points of using threads, like race " "conditions." msgstr "" +"その代わり、複数のインタープリタを使う並行コードの作成には、追加の手間がかか" +"る場合があります。\n" +"しかしこれは、インタープリタがいつ、どのようにやり取りするかを慎重に考え、共" +"有するデータを明示する必要があるためです。\n" +"このことは、複数コアでの真の並列実行をはじめ、追加の手間に見合ういくつかの利" +"点につながります。\n" +"例えば、このように書かれたコードでは、並行処理の振る舞いを考えやすくなる場合" +"があります。\n" +"競合状態など、スレッドを使う際の大きな問題のいくつかに対処せずに済むことも、" +"大きな利点です。" -#: ../../library/concurrent.futures.rst:273 msgid "" "Each worker's interpreter is isolated from all the other interpreters. " "\"Isolated\" means each interpreter has its own runtime state and operates " @@ -438,8 +561,21 @@ msgid "" "different interpreter, including :mod:`sys`, :mod:`builtins`, and even " "``__main__``." msgstr "" +"各ワーカーのインタープリタは、他のすべてのインタープリタから分離されていま" +"す。\n" +"「分離されている」とは、各インタープリタが独自の実行時の状態を持ち、完全に独" +"立して動作することです。\n" +"例えば、一つのインタープリタで :data:`sys.stdout` をリダイレクトしても、他の" +"インタープリタでは自動的にリダイレクトされません。\n" +"一つのインタープリタでモジュールをインポートしても、他のインタープリタでは自" +"動的にインポートされません。\n" +"そのモジュールを必要とするインタープリタごとに、個別にインポートする必要があ" +"ります。\n" +"実際、あるインタープリタでインポートしたモジュールは、別のインタープリタの同" +"じモジュールとは完全に別のオブジェクトです。\n" +"これは :mod:`sys`、:mod:`builtins`、さらには ``__main__`` にも当てはまりま" +"す。" -#: ../../library/concurrent.futures.rst:285 msgid "" "Isolation means a mutable object, or other data, cannot be used by more than " "one interpreter at the same time. That effectively means interpreters " @@ -448,16 +584,27 @@ msgid "" "copies manually. Immutable objects and data, like the builtin singletons, " "strings, and tuples of immutable objects, don't have these limitations." msgstr "" +"分離されているため、ミュータブルなオブジェクトやその他のデータを、複数のイン" +"タープリタで同時に使うことはできません。\n" +"実質的に、インタープリタ間でそのようなオブジェクトやデータを共有することはで" +"きないということです。\n" +"各インタープリタはそれぞれのコピーを持たなければならず、コピー間の変更は手動" +"で同期する必要があります。\n" +"組み込みのシングルトン、文字列、イミュータブルなオブジェクトからなるタプルな" +"ど、イミュータブルなオブジェクトやデータにはこの制約がありません。" -#: ../../library/concurrent.futures.rst:293 msgid "" "Communicating and synchronizing between interpreters is most effectively " "done using dedicated tools, like those proposed in :pep:`734`. One less " "efficient alternative is to serialize with :mod:`pickle` and then send the " "bytes over a shared :mod:`socket ` or :func:`pipe `." msgstr "" +"インタープリタ間の通信や同期には、:pep:`734` で提案されたような専用のツールを" +"使うのが最も効率的です。\n" +"効率は劣りますが、:mod:`pickle` でシリアライズしてから、共有の :mod:`ソケッ" +"ト ` や :func:`パイプ ` を介してバイト列を送る方法もありま" +"す。" -#: ../../library/concurrent.futures.rst:301 msgid "" "A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously " "using a pool of at most *max_workers* threads. Each thread runs tasks in " @@ -467,8 +614,15 @@ msgid "" "Interpreter Lock `, which means code run with this " "executor has true multi-core parallelism." msgstr "" +"最大 *max_workers* 個のスレッドからなるプールを使い、呼び出しを非同期に実行す" +"る :class:`ThreadPoolExecutor` のサブクラスです。\n" +"各スレッドは専用のインタープリタでタスクを実行します。\n" +"ワーカーのインタープリタは互いに分離されているため、それぞれが独自の実行時の" +"状態を持ち、ミュータブルなオブジェクトやその他のデータを共有できません。\n" +"各インタープリタはそれぞれの :term:`グローバルインタープリタロック ` を持つため、この executor で実行するコードは複数のコアで真" +"に並列実行できます。" -#: ../../library/concurrent.futures.rst:309 msgid "" "The optional *initializer* and *initargs* arguments have the same meaning as " "for :class:`!ThreadPoolExecutor`: the initializer is run when each worker is " @@ -476,26 +630,35 @@ msgid "" "executor serializes the *initializer* and *initargs* using :mod:`pickle` " "when sending them to the worker's interpreter." msgstr "" +"省略可能な *initializer* と *initargs* 引数の意味は :class:`!" +"ThreadPoolExecutor` と同じです。\n" +"初期化処理は各ワーカーの作成時に実行されますが、この場合はワーカーのインター" +"プリタ内で実行されます。\n" +"executor は、*initializer* と *initargs* をワーカーのインタープリタに送る際" +"に :mod:`pickle` でシリアライズします。" -#: ../../library/concurrent.futures.rst:317 msgid "" "The executor may replace uncaught exceptions from *initializer* with :class:" "`~concurrent.interpreters.ExecutionFailed`." msgstr "" +"executor は、*initializer* で捕捉されなかった例外を :class:`~concurrent." +"interpreters.ExecutionFailed` に置き換える場合があります。" -#: ../../library/concurrent.futures.rst:320 msgid "Other caveats from parent :class:`ThreadPoolExecutor` apply here." msgstr "" +"親クラス :class:`ThreadPoolExecutor` のその他の注意事項も当てはまります。" -#: ../../library/concurrent.futures.rst:322 msgid "" ":meth:`~Executor.submit` and :meth:`~Executor.map` work like normal, except " "the worker serializes the callable and arguments using :mod:`pickle` when " "sending them to its interpreter. The worker likewise serializes the return " "value when sending it back." msgstr "" +":meth:`~Executor.submit` と :meth:`~Executor.map` は通常どおり動作しますが、" +"ワーカーが呼び出し可能オブジェクトと引数を自分のインタープリタに送る際に :" +"mod:`pickle` でシリアライズする点が異なります。\n" +"戻り値を送り返す際にも、同様にシリアライズします。" -#: ../../library/concurrent.futures.rst:327 msgid "" "When a worker's current task raises an uncaught exception, the worker always " "tries to preserve the exception as-is. If that is successful then it also " @@ -505,6 +668,12 @@ msgid "" "original as-is then it directly preserves the corresponding :class:" "`~concurrent.interpreters.ExecutionFailed` instance instead." msgstr "" +"ワーカーが実行中のタスクで捕捉されない例外が発生すると、ワーカーは常にその例" +"外をそのまま保持しようとします。\n" +"保持できた場合は、元の例外の要約を含む、対応する :class:`~concurrent." +"interpreters.ExecutionFailed` インスタンスを ``__cause__`` にも設定します。\n" +"まれに元の例外をそのまま保持できない場合は、対応する :class:`~concurrent." +"interpreters.ExecutionFailed` インスタンスを直接保持します。" #: ../../library/concurrent.futures.rst:339 msgid "ProcessPoolExecutor" @@ -544,15 +713,17 @@ msgstr "" ":class:`ProcessPoolExecutor` に渡された呼び出し可能オブジェクトから :class:" "`Executor` や :class:`Future` メソッドを呼ぶとデッドロックに陥ります。" -#: ../../library/concurrent.futures.rst:354 msgid "" "Note that the restrictions on functions and arguments needing to picklable " "as per :class:`multiprocessing.Process` apply when using :meth:`~Executor." "submit` and :meth:`~Executor.map` on a :class:`ProcessPoolExecutor`. A " "function defined in a REPL or a lambda should not be expected to work." msgstr "" +":class:`ProcessPoolExecutor` の :meth:`~Executor.submit` と :meth:`~Executor." +"map` を使う際には、:class:`multiprocessing.Process` と同様に、関数と引数が " +"pickle 化可能でなければならないという制約があることに注意してください。\n" +"REPL で定義した関数や lambda が動作することは期待できません。" -#: ../../library/concurrent.futures.rst:361 msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " @@ -566,8 +737,21 @@ msgid "" "given, the default :mod:`multiprocessing` context is used. See :ref:" "`multiprocessing-start-methods`." msgstr "" +"最大 *max_workers* 個のプロセスからなるプールを使い、呼び出しを非同期に実行す" +"る :class:`Executor` のサブクラスです。\n" +"*max_workers* が ``None`` または省略された場合、デフォルトで :func:`os." +"process_cpu_count` が使われます。\n" +"*max_workers* が ``0`` 以下の場合は :exc:`ValueError` を送出します。\n" +"Windows では、*max_workers* は ``61`` 以下でなければなりません。\n" +"そうでない場合は :exc:`ValueError` を送出します。\n" +"*max_workers* が ``None`` の場合、利用可能なプロセッサ数がそれより多くても、" +"デフォルトで選択される値は最大 ``61`` です。\n" +"*mp_context* には :mod:`multiprocessing` のコンテキストまたは ``None`` を指定" +"でき、ワーカーの起動に使われます。\n" +"*mp_context* が ``None`` または省略された場合、デフォルトの :mod:" +"`multiprocessing` コンテキストが使われます。\n" +":ref:`multiprocessing-start-methods` を参照してください。" -#: ../../library/concurrent.futures.rst:375 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " @@ -575,8 +759,13 @@ msgid "" "jobs will raise a :exc:`~concurrent.futures.process.BrokenProcessPool`, as " "well as any attempt to submit more jobs to the pool." msgstr "" +"*initializer* は省略可能な呼び出し可能オブジェクトで、各ワーカープロセスの開" +"始時に呼び出されます。\n" +"*initargs* は、この初期化処理に渡す引数のタプルです。\n" +"*initializer* が例外を送出した場合、現在未完了のジョブはすべて :exc:" +"`~concurrent.futures.process.BrokenProcessPool` を送出し、プールへの新たな" +"ジョブの投入も同じ例外を送出します。" -#: ../../library/concurrent.futures.rst:381 msgid "" "*max_tasks_per_child* is an optional argument that specifies the maximum " "number of tasks a single process can execute before it will exit and be " @@ -586,6 +775,13 @@ msgid "" "default in absence of a *mp_context* parameter. This feature is incompatible " "with the \"fork\" start method." msgstr "" +"*max_tasks_per_child* は省略可能な引数で、一つのプロセスが終了して新しいワー" +"カープロセスに置き換わるまでに実行できるタスクの最大数を指定します。\n" +"デフォルトの *max_tasks_per_child* は ``None`` で、ワーカープロセスはプールが" +"存在する限り存続します。\n" +"最大数を指定し、*mp_context* パラメータを指定しなかった場合、デフォルトでは " +"multiprocessing の開始方式に \"spawn\" が使われます。\n" +"この機能は \"fork\" 開始方式とは併用できません。" #: ../../library/concurrent.futures.rst:389 msgid "" @@ -599,19 +795,20 @@ msgstr "" "以前は挙動は未定義でしたが、 executor や futures がフリーズしたりデッドロッ" "クを起こすことがしばしばでした。" -#: ../../library/concurrent.futures.rst:396 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" +"プールが作成するワーカープロセスの開始方式を利用者が制御できるよう、" +"*mp_context* 引数が追加されました。" -#: ../../library/concurrent.futures.rst:402 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" +"プール内のワーカーの存続期間を利用者が制御できるよう、*max_tasks_per_child* " +"引数が追加されました。" -#: ../../library/concurrent.futures.rst:406 msgid "" "On POSIX systems, if your application has multiple threads and the :mod:" "`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." @@ -619,56 +816,75 @@ msgid "" "`DeprecationWarning`. Pass a *mp_context* configured to use a different " "start method. See the :func:`os.fork` documentation for further explanation." msgstr "" +"POSIX システムで、アプリケーションが複数のスレッドを持ち、:mod:" +"`multiprocessing` コンテキストが ``\"fork\"`` 開始方式を使う場合、ワーカーを" +"起動するために内部で呼び出す :func:`os.fork` 関数が :exc:" +"`DeprecationWarning` を送出することがあります。\n" +"別の開始方式を使うように設定した *mp_context* を渡してください。\n" +"詳しくは :func:`os.fork` のドキュメントを参照してください。" -#: ../../library/concurrent.futures.rst:414 msgid "" "*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" +"*max_workers* のデフォルトで、:func:`os.cpu_count` の代わりに :func:`os." +"process_cpu_count` を使うようになりました。" -#: ../../library/concurrent.futures.rst:418 msgid "" "The default process start method (see :ref:`multiprocessing-start-methods`) " "changed away from *fork*. If you require the *fork* start method for :class:" "`ProcessPoolExecutor` you must explicitly pass ``mp_context=multiprocessing." "get_context(\"fork\")``." msgstr "" +"プロセスのデフォルトの開始方式 (:ref:`multiprocessing-start-methods` を参照) " +"が *fork* 以外に変更されました。\n" +":class:`ProcessPoolExecutor` で *fork* 開始方式が必要な場合は、" +"``mp_context=multiprocessing.get_context(\"fork\")`` を明示的に渡さなければな" +"りません。" -#: ../../library/concurrent.futures.rst:424 msgid "" "Fixed a deadlock (:gh:`115634`) where the executor could hang after a worker " "process exited upon reaching its *max_tasks_per_child* limit while tasks " "remained queued." msgstr "" +"キューにタスクが残っている間にワーカープロセスが *max_tasks_per_child* の上限" +"に達して終了すると、executor が停止したままになることがあるデッドロック (:gh:" +"`115634`) を修正しました。" -#: ../../library/concurrent.futures.rst:431 msgid "" "Attempt to terminate all living worker processes immediately by calling :" "meth:`Process.terminate ` on each of " "them. Internally, it will also call :meth:`Executor.shutdown` to ensure that " "all other resources associated with the executor are freed." msgstr "" +"存続中のすべてのワーカープロセスについて :meth:`Process.terminate " +"` を呼び出し、直ちに終了させようとしま" +"す。\n" +"executor に関連するその他のリソースをすべて解放するため、内部では :meth:" +"`Executor.shutdown` も呼び出します。" -#: ../../library/concurrent.futures.rst:436 -#: ../../library/concurrent.futures.rst:448 msgid "" "After calling this method the caller should no longer submit tasks to the " "executor." msgstr "" +"このメソッドを呼び出した後は、executor にタスクを投入しないでください。" -#: ../../library/concurrent.futures.rst:443 msgid "" "Attempt to kill all living worker processes immediately by calling :meth:" "`Process.kill ` on each of them. Internally, " "it will also call :meth:`Executor.shutdown` to ensure that all other " "resources associated with the executor are freed." msgstr "" +"存続中のすべてのワーカープロセスについて :meth:`Process.kill " +"` を呼び出し、直ちに強制終了させようとしま" +"す。\n" +"executor に関連するその他のリソースをすべて解放するため、内部では :meth:" +"`Executor.shutdown` も呼び出します。" #: ../../library/concurrent.futures.rst:456 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor の例" -#: ../../library/concurrent.futures.rst:459 msgid "" "import concurrent.futures\n" "import math\n" @@ -703,6 +919,38 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import concurrent.futures\n" +"import math\n" +"\n" +"PRIMES = [\n" +" 112272535095293,\n" +" 112582705942171,\n" +" 112272535095293,\n" +" 115280095190773,\n" +" 115797848077099,\n" +" 1099726899285419]\n" +"\n" +"def is_prime(n):\n" +" if n < 2:\n" +" return False\n" +" if n == 2:\n" +" return True\n" +" if n % 2 == 0:\n" +" return False\n" +"\n" +" sqrt_n = int(math.floor(math.sqrt(n)))\n" +" for i in range(3, sqrt_n + 1, 2):\n" +" if n % i == 0:\n" +" return False\n" +" return True\n" +"\n" +"def main():\n" +" with concurrent.futures.ProcessPoolExecutor() as executor:\n" +" for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):\n" +" print('%d is prime: %s' % (number, prime))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" #: ../../library/concurrent.futures.rst:494 msgid "Future Objects" @@ -727,13 +975,16 @@ msgstr "" "スタンスは :meth:`Executor.submit` で生成され、テストを除いて直接生成すべきで" "はありません。" -#: ../../library/concurrent.futures.rst:507 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " "``False``, otherwise the call will be cancelled and the method will return " "``True``." msgstr "" +"呼び出しのキャンセルを試みます。\n" +"呼び出しがすでに実行中または実行済みで、キャンセルできない場合は ``False`` を" +"返します。\n" +"それ以外の場合は呼び出しをキャンセルして ``True`` を返します。" #: ../../library/concurrent.futures.rst:514 msgid "Return ``True`` if the call was successfully cancelled." @@ -773,10 +1024,9 @@ msgstr "" "future が完了する前にキャンセルされた場合 :exc:`CancelledError` が送出されま" "す。" -#: ../../library/concurrent.futures.rst:538 msgid "" "If the call raised an exception, this method will raise the same exception." -msgstr "" +msgstr "呼び出しが例外を送出した場合、このメソッドも同じ例外を送出します。" #: ../../library/concurrent.futures.rst:542 msgid "" @@ -886,12 +1136,12 @@ msgstr "" "このメソッドは、 :class:`Executor` の実装またはユニットテストによってのみ使用" "してください。" -#: ../../library/concurrent.futures.rst:599 -#: ../../library/concurrent.futures.rst:612 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." msgstr "" +":class:`Future` がすでに完了している場合、このメソッドは :exc:`concurrent." +"futures.InvalidStateError` を送出します。" #: ../../library/concurrent.futures.rst:606 msgid "" @@ -905,7 +1155,6 @@ msgstr "" msgid "Module Functions" msgstr "モジュール関数" -#: ../../library/concurrent.futures.rst:622 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -915,6 +1164,14 @@ msgid "" "named ``not_done``, contains the futures that did not complete (pending or " "running futures)." msgstr "" +"*fs* で指定された :class:`Future` インスタンス (異なる :class:`Executor` イン" +"スタンスで作成されたものでも可) が完了するまで待機します。\n" +"*fs* に重複して指定されたフューチャは一つにまとめられ、一度だけ返されます。\n" +"集合を要素とする、要素数 2 の名前付きタプルを返します。\n" +"最初の集合 ``done`` には、待機が終わるまでに完了したフューチャ (実行済みまた" +"はキャンセル済みのフューチャ) が含まれます。\n" +"二つ目の集合 ``not_done`` には、完了していないフューチャ (保留中または実行中" +"のフューチャ) が含まれます。" #: ../../library/concurrent.futures.rst:630 msgid "" @@ -946,18 +1203,18 @@ msgstr "説明" msgid "The function will return when any future finishes or is cancelled." msgstr "いずれかのフューチャが終了したかキャンセルされたときに返します。" -#: ../../library/concurrent.futures.rst:647 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" +"いずれかのフューチャが例外を送出して終了すると、この関数は返ります。\n" +"例外を送出するフューチャがない場合は、:const:`ALL_COMPLETED` と等価です。" #: ../../library/concurrent.futures.rst:652 msgid "The function will return when all futures finish or are cancelled." msgstr "すべてのフューチャが終了したかキャンセルされたときに返します。" -#: ../../library/concurrent.futures.rst:656 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -969,6 +1226,17 @@ msgid "" "original call to :func:`as_completed`. *timeout* can be an int or float. If " "*timeout* is not specified or ``None``, there is no limit to the wait time." msgstr "" +"*fs* で指定された :class:`Future` インスタンス (異なる :class:`Executor` イン" +"スタンスで作成されたものでも可) を、完了するたびに (実行済みまたはキャンセル" +"済みになった順に) yield するイテレータを返します。\n" +"*fs* に重複して指定されたフューチャは、一度だけ返されます。\n" +":func:`as_completed` の呼び出し前に完了していたフューチャが、最初に yield さ" +"れます。\n" +"返されたイテレータの :meth:`~iterator.__next__` が呼び出された際、最初の :" +"func:`as_completed` の呼び出しから *timeout* 秒が経過しても結果を取得できなけ" +"れば、:exc:`TimeoutError` を送出します。\n" +"*timeout* には整数または浮動小数点数を指定できます。\n" +"*timeout* が省略された場合や ``None`` の場合は、待ち時間に制限はありません。" #: ../../library/concurrent.futures.rst:669 msgid ":pep:`3148` -- futures - execute computations asynchronously" @@ -988,47 +1256,58 @@ msgstr "例外クラス" msgid "Raised when a future is cancelled." msgstr "future がキャンセルされたときに送出されます。" -#: ../../library/concurrent.futures.rst:685 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" +":exc:`TimeoutError` の非推奨のエイリアスです。\n" +"フューチャの操作が指定されたタイムアウトを超えた場合に送出されます。" #: ../../library/concurrent.futures.rst:690 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "このクラスは :exc:`TimeoutError` のエイリアスになりました。" -#: ../../library/concurrent.futures.rst:695 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " "new tasks." msgstr "" +":exc:`RuntimeError` の派生クラスです。\n" +"何らかの理由で executor が壊れて、新しいタスクの投入や実行に使えなくなった場" +"合に送出されます。" -#: ../../library/concurrent.futures.rst:703 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "" +"フューチャに対して、現在の状態では許可されていない操作を行った場合に送出され" +"ます。" -#: ../../library/concurrent.futures.rst:712 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`~concurrent.futures." "ThreadPoolExecutor` has failed initializing." msgstr "" +":exc:`~concurrent.futures.BrokenExecutor` の派生クラスです。\n" +":class:`~concurrent.futures.ThreadPoolExecutor` のワーカーのいずれかで初期化" +"に失敗した場合に送出されます。" -#: ../../library/concurrent.futures.rst:723 msgid "" "Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " "exception class is raised when one of the workers of a :class:`~concurrent." "futures.InterpreterPoolExecutor` has failed initializing." msgstr "" +":exc:`~concurrent.futures.thread.BrokenThreadPool` の派生クラスです。\n" +":class:`~concurrent.futures.InterpreterPoolExecutor` のワーカーのいずれかで初" +"期化に失敗した場合に送出されます。" -#: ../../library/concurrent.futures.rst:734 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " "a :class:`~concurrent.futures.ProcessPoolExecutor` has terminated in a non-" "clean fashion (for example, if it was killed from the outside)." msgstr "" +":exc:`~concurrent.futures.BrokenExecutor` (以前は :exc:`RuntimeError`) の派生" +"クラスです。\n" +":class:`~concurrent.futures.ProcessPoolExecutor` のワーカーのいずれかが正常で" +"ない形で終了した場合 (例えば、外部から強制終了された場合) に送出されます。" diff --git a/library/concurrent.interpreters.po b/library/concurrent.interpreters.po index cf8d1a1b4..9ed45f3b0 100644 --- a/library/concurrent.interpreters.po +++ b/library/concurrent.interpreters.po @@ -24,63 +24,65 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/concurrent.interpreters.rst:2 msgid "" ":mod:`!concurrent.interpreters` --- Multiple interpreters in the same process" msgstr "" +":mod:`!concurrent.interpreters` --- 同じプロセス内の複数のインタープリタ" -#: ../../library/concurrent.interpreters.rst:9 msgid "**Source code:** :source:`Lib/concurrent/interpreters`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/concurrent/interpreters`" -#: ../../library/concurrent.interpreters.rst:13 msgid "" "The :mod:`!concurrent.interpreters` module constructs higher-level " "interfaces on top of the lower level :mod:`!_interpreters` module." msgstr "" +":mod:`!concurrent.interpreters` モジュールは、低水準の :mod:`!_interpreters` " +"モジュールの上に、より高水準のインターフェースを構築します。" -#: ../../library/concurrent.interpreters.rst:16 msgid "" "The module is primarily meant to provide a basic API for managing " "interpreters (AKA \"subinterpreters\") and running things in them. Running " "mostly involves switching to an interpreter (in the current thread) and " "calling a function in that execution context." msgstr "" +"このモジュールの主な目的は、インタープリタ (「サブインタープリタ」とも呼ばれ" +"ます) の管理と、その中での実行のための基本的な API を提供することです。\n" +"実行時には主に、現在のスレッドでインタープリタを切り替え、その実行コンテキス" +"トで関数を呼び出します。" -#: ../../library/concurrent.interpreters.rst:21 msgid "" "For concurrency, interpreters themselves (and this module) don't provide " "much more than isolation, which on its own isn't useful. Actual concurrency " "is available separately through :mod:`threads ` -- see `below " "`_." msgstr "" +"並行処理に関しては、インタープリタ自体 (およびこのモジュール) が提供するのは" +"ほぼ分離だけであり、それだけでは役に立ちません。\n" +"実際の並行処理は、別途 :mod:`スレッド ` によって利用できます。\n" +"`後述の説明 `_ を参照してください。" -#: ../../library/concurrent.interpreters.rst:28 msgid ":class:`~concurrent.futures.InterpreterPoolExecutor`" -msgstr "" +msgstr ":class:`~concurrent.futures.InterpreterPoolExecutor`" -#: ../../library/concurrent.interpreters.rst:29 msgid "Combines threads with interpreters in a familiar interface." msgstr "" +"使い慣れたインターフェースで、スレッドとインタープリタを組み合わせます。" msgid ":ref:`isolating-extensions-howto`" msgstr ":ref:`isolating-extensions-howto`" -#: ../../library/concurrent.interpreters.rst:34 msgid "How to update an extension module to support multiple interpreters." -msgstr "" +msgstr "複数のインタープリタをサポートするように拡張モジュールを更新する方法。" -#: ../../library/concurrent.interpreters.rst:36 msgid ":pep:`554`" -msgstr "" +msgstr ":pep:`554`" #: ../../library/concurrent.interpreters.rst:38 msgid ":pep:`734`" msgstr ":pep:`734`" -#: ../../library/concurrent.interpreters.rst:40 msgid ":pep:`684`" -msgstr "" +msgstr ":pep:`684`" msgid "Availability" msgstr "利用可能な環境" @@ -93,33 +95,31 @@ msgstr "" "このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" "`wasm-availability` を見てください。" -#: ../../library/concurrent.interpreters.rst:48 msgid "Key details" -msgstr "" +msgstr "主な注意点" -#: ../../library/concurrent.interpreters.rst:50 msgid "" "Before we dive in further, there are a small number of details to keep in " "mind about using multiple interpreters:" msgstr "" +"詳しい説明に入る前に、複数のインタープリタの使用について留意すべき点を挙げま" +"す:" -#: ../../library/concurrent.interpreters.rst:53 msgid "`isolated `_, by default" -msgstr "" +msgstr "デフォルトで `分離される `_" -#: ../../library/concurrent.interpreters.rst:54 msgid "no implicit threads" -msgstr "" +msgstr "暗黙にスレッドは作成されない" -#: ../../library/concurrent.interpreters.rst:55 msgid "not all PyPI packages support use in multiple interpreters yet" msgstr "" +"PyPI のすべてのパッケージが、複数のインタープリタでの使用をサポートしているわ" +"けではない" #: ../../library/concurrent.interpreters.rst:63 msgid "Introduction" msgstr "はじめに" -#: ../../library/concurrent.interpreters.rst:65 msgid "" "An \"interpreter\" is effectively the execution context of the Python " "runtime. It contains all of the state the runtime needs to execute a " @@ -128,6 +128,11 @@ msgid "" "in addition to the current interpreter, related to the current exception and " "the bytecode eval loop.)" msgstr "" +"「インタープリタ」は、実質的に Python ランタイムの実行コンテキストです。\n" +"プログラムの実行に必要な状態をすべて含んでいます。\n" +"これには、インポートの状態や組み込みオブジェクトなどが含まれます。\n" +"(メインスレッドしかない場合でも、各スレッドには現在のインタープリタの状態に加" +"え、現在の例外やバイトコードの評価ループに関する実行時の状態があります)。" #: ../../library/concurrent.interpreters.rst:72 msgid "" @@ -137,26 +142,29 @@ msgid "" "incomplete until version 3.12." msgstr "" -#: ../../library/concurrent.interpreters.rst:80 msgid "Multiple Interpreters and Isolation" -msgstr "" +msgstr "複数のインタープリタと分離" -#: ../../library/concurrent.interpreters.rst:82 msgid "" "A Python implementation may support using multiple interpreters in the same " "process. CPython has this support. Each interpreter is effectively " "isolated from the others (with a limited number of carefully managed process-" "global exceptions to the rule)." msgstr "" +"Python の実装は、同じプロセス内で複数のインタープリタを使うことをサポートする" +"場合があります。\n" +"CPython はこれをサポートしています。\n" +"各インタープリタは、他のインタープリタから実質的に分離されています (プロセス" +"全体で共有されるものに、慎重に管理された少数の例外があります)。" -#: ../../library/concurrent.interpreters.rst:87 msgid "" "That isolation is primarily useful as a strong separation between distinct " "logical components of a program, where you want to have careful control of " "how those components interact." msgstr "" +"この分離は主に、プログラムを構成する別々の論理的な部分を明確に切り離し、それ" +"らのやり取りを慎重に制御したい場合に役立ちます。" -#: ../../library/concurrent.interpreters.rst:93 msgid "" "Interpreters in the same process can technically never be strictly isolated " "from one another since there are few restrictions on memory access within " @@ -165,12 +173,16 @@ msgid "" "interpreters in security-sensitive situations, where they shouldn't have " "access to each other's data." msgstr "" +"同じプロセス内ではメモリアクセスに対する制限がほとんどないため、技術的には、" +"同じプロセス内のインタープリタを互いに厳密に分離することはできません。\n" +"Python ランタイムは可能な限り分離しますが、拡張モジュールは容易にその分離を破" +"ることができます。\n" +"したがって、互いのデータにアクセスできてはならないような、セキュリティが重要" +"な状況では、複数のインタープリタを使わないでください。" -#: ../../library/concurrent.interpreters.rst:101 msgid "Running in an Interpreter" -msgstr "" +msgstr "インタープリタ内での実行" -#: ../../library/concurrent.interpreters.rst:103 msgid "" "Running in a different interpreter involves switching to it in the current " "thread and then calling some function. The runtime will execute the " @@ -178,15 +190,22 @@ msgid "" "interpreters` module provides a basic API for creating and managing " "interpreters, as well as the switch-and-call operation." msgstr "" +"別のインタープリタ内で実行するには、現在のスレッドでそのインタープリタに切り" +"替えてから、関数を呼び出します。\n" +"ランタイムは、現在のインタープリタの状態を使って関数を実行します。\n" +":mod:`!concurrent.interpreters` モジュールは、インタープリタを作成・管理する" +"基本的な API と、この切り替えと呼び出しの操作を提供します。" -#: ../../library/concurrent.interpreters.rst:110 msgid "" "No other threads are automatically started for the operation. There is `a " "helper `_ for that though. There is another " "dedicated helper for calling the builtin :func:`exec` in an interpreter." msgstr "" +"この操作で、他のスレッドが自動的に開始されることはありません。\n" +"ただし、そのための `補助機能 `_ があります。\n" +"インタープリタ内で組み込みの :func:`exec` を呼び出すための専用の補助機能もあ" +"ります。" -#: ../../library/concurrent.interpreters.rst:115 msgid "" "When :func:`exec` (or :func:`eval`) are called in an interpreter, they run " "using the interpreter's :mod:`!__main__` module as the \"globals\" " @@ -194,20 +213,28 @@ msgid "" "module. This is the same as how scripts invoked from the command-line run " "in the :mod:`!__main__` module." msgstr "" +"インタープリタ内で :func:`exec` (または :func:`eval`) を呼び出すと、そのイン" +"タープリタの :mod:`!__main__` モジュールを「グローバル」名前空間として実行し" +"ます。\n" +"どのモジュールにも関連付けられていない関数も同様です。\n" +"これは、コマンドラインから起動したスクリプトが :mod:`!__main__` モジュール内" +"で動作するのと同じです。" -#: ../../library/concurrent.interpreters.rst:125 msgid "Concurrency and Parallelism" -msgstr "" +msgstr "並行処理と並列処理" -#: ../../library/concurrent.interpreters.rst:127 msgid "" "As noted earlier, interpreters do not provide any concurrency on their own. " "They strictly represent the isolated execution context the runtime will use " "*in the current thread*. That isolation makes them similar to processes, " "but they still enjoy in-process efficiency, like threads." msgstr "" +"前述のとおり、インタープリタ自体は並行処理を提供しません。\n" +"厳密には、ランタイムが *現在のスレッドで* 使う、分離された実行コンテキストを" +"表すものです。\n" +"その分離はプロセスに似ていますが、スレッドと同様に、同じプロセス内にあること" +"による効率のよさも得られます。" -#: ../../library/concurrent.interpreters.rst:133 msgid "" "All that said, interpreters do naturally support certain flavors of " "concurrency. There's a powerful side effect of that isolation. It enables a " @@ -215,8 +242,12 @@ msgid "" "It's a similar concurrency model to CSP or the actor model, a model which is " "relatively easy to reason about." msgstr "" +"とはいえ、インタープリタは特定の形態の並行処理を自然にサポートします。\n" +"分離には強力な副次効果があり、async やスレッドとは異なる並行処理の手法が可能" +"になります。\n" +"その並行処理モデルは CSP やアクターモデルに似ており、比較的理解しやすいもので" +"す。" -#: ../../library/concurrent.interpreters.rst:140 msgid "" "You can take advantage of that concurrency model in a single thread, " "switching back and forth between interpreters, Stackless-style. However, " @@ -224,50 +255,65 @@ msgid "" "threads. This mostly involves starting a new thread, where you switch to " "another interpreter and run what you want there." msgstr "" +"単一のスレッドでも、Stackless のようにインタープリタを行き来して、この並行処" +"理モデルを活用できます。\n" +"しかし、このモデルはインタープリタと複数のスレッドを組み合わせたときに、より" +"役立ちます。\n" +"主な手順は、新しいスレッドを起動し、その中で別のインタープリタに切り替えて、" +"必要な処理を実行することです。" -#: ../../library/concurrent.interpreters.rst:146 msgid "" "Each actual thread in Python, even if you're only running in the main " "thread, has its own *current* execution context. Multiple threads can use " "the same interpreter or different ones." msgstr "" +"メインスレッドだけで実行している場合でも、Python の各実スレッドには、それぞれ" +"の *現在の* 実行コンテキストがあります。\n" +"複数のスレッドで同じインタープリタを使うことも、別々のインタープリタを使うこ" +"ともできます。" -#: ../../library/concurrent.interpreters.rst:150 msgid "" "At a high level, you can think of the combination of threads and " "interpreters as threads with opt-in sharing." msgstr "" +"大まかには、スレッドとインタープリタの組み合わせを、明示的に選んだものだけを" +"共有するスレッドと考えることができます。" -#: ../../library/concurrent.interpreters.rst:153 msgid "" "As a significant bonus, interpreters are sufficiently isolated that they do " "not share the :term:`GIL`, which means combining threads with multiple " "interpreters enables full multi-core parallelism. (This has been the case " "since Python 3.12.)" msgstr "" +"大きな利点として、インタープリタは :term:`GIL` を共有しないほど十分に分離され" +"ています。\n" +"そのため、スレッドと複数のインタープリタを組み合わせると、複数コアでの完全な" +"並列実行が可能になります。\n" +"(Python 3.12 以降はこのようになっています)。" -#: ../../library/concurrent.interpreters.rst:159 msgid "Communication Between Interpreters" -msgstr "" +msgstr "インタープリタ間の通信" -#: ../../library/concurrent.interpreters.rst:161 msgid "" "In practice, multiple interpreters are useful only if we have a way to " "communicate between them. This usually involves some form of message " "passing, but can even mean sharing data in some carefully managed way." msgstr "" +"実際には、複数のインタープリタが役立つのは、それらの間で通信する手段がある場" +"合だけです。\n" +"通常は何らかのメッセージパッシングを使いますが、慎重に管理した方法でデータを" +"共有する場合もあります。" -#: ../../library/concurrent.interpreters.rst:166 msgid "" "With this in mind, the :mod:`!concurrent.interpreters` module provides a :" "class:`queue.Queue` implementation, available through :func:`create_queue`." msgstr "" +"このため、:mod:`!concurrent.interpreters` モジュールは :class:`queue.Queue` " +"の実装を提供しており、:func:`create_queue` で利用できます。" -#: ../../library/concurrent.interpreters.rst:173 msgid "\"Sharing\" Objects" -msgstr "" +msgstr "オブジェクトの「共有」" -#: ../../library/concurrent.interpreters.rst:175 msgid "" "Any data actually shared between interpreters loses the thread-safety " "provided by the :term:`GIL`. There are various options for dealing with " @@ -276,21 +322,31 @@ msgid "" "Instead, a copy must be created, which means mutable objects won't stay in " "sync." msgstr "" +"インタープリタ間で実際に共有されるデータは、:term:`GIL` が提供するスレッド" +"セーフ性を失います。\n" +"拡張モジュールでは、これに対処するための選択肢がいくつかあります。\n" +"しかし、Python コードでは、スレッドセーフ性がないため、ごく一部の例外を除いて" +"オブジェクトを実際に共有することはできません。\n" +"代わりにコピーを作成しなければならないため、ミュータブルなオブジェクトの同期" +"は保たれません。" -#: ../../library/concurrent.interpreters.rst:182 msgid "" "By default, most objects are copied with :mod:`pickle` when they are passed " "to another interpreter. Nearly all of the immutable builtin objects are " "either directly shared or copied efficiently. For example:" msgstr "" +"デフォルトでは、ほとんどのオブジェクトは別のインタープリタに渡す際に :mod:" +"`pickle` でコピーされます。\n" +"イミュータブルな組み込みオブジェクトのほぼすべては、直接共有されるか、効率よ" +"くコピーされます。\n" +"例えば、次のものがあります:" #: ../../library/concurrent.interpreters.rst:186 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/concurrent.interpreters.rst:187 msgid ":class:`bool` (:const:`True` and :const:`False`)" -msgstr "" +msgstr ":class:`bool` (:const:`True` と :const:`False`)" #: ../../library/concurrent.interpreters.rst:188 msgid ":class:`bytes`" @@ -308,15 +364,15 @@ msgstr ":class:`int`" msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/concurrent.interpreters.rst:192 msgid ":class:`tuple` (of similarly supported objects)" -msgstr "" +msgstr ":class:`tuple` (同様にサポートされているオブジェクトを要素とするもの)" -#: ../../library/concurrent.interpreters.rst:194 msgid "" "There are a small number of Python types that actually share mutable data " "between interpreters:" msgstr "" +"インタープリタ間で実際にミュータブルなデータを共有する Python の型も、少数で" +"すが存在します:" #: ../../library/concurrent.interpreters.rst:197 msgid ":class:`memoryview`" @@ -334,154 +390,163 @@ msgstr "リファレンス" msgid "This module defines the following functions:" msgstr "このモジュールは以下の関数を定義しています:" -#: ../../library/concurrent.interpreters.rst:208 msgid "" "Return a :class:`list` of :class:`Interpreter` objects, one for each " "existing interpreter." msgstr "" +"既存の各インタープリタに対応する :class:`Interpreter` オブジェクトの :class:" +"`list` を返します。" -#: ../../library/concurrent.interpreters.rst:213 msgid "" "Return an :class:`Interpreter` object for the currently running interpreter." msgstr "" +"現在実行中のインタープリタの :class:`Interpreter` オブジェクトを返します。" -#: ../../library/concurrent.interpreters.rst:218 msgid "" "Return an :class:`Interpreter` object for the main interpreter. This is the " "interpreter the runtime created to run the :term:`REPL` or the script given " "at the command-line. It is usually the only one." msgstr "" +"メインインタープリタの :class:`Interpreter` オブジェクトを返します。\n" +"これは、:term:`REPL` またはコマンドラインで指定されたスクリプトを実行するため" +"に、ランタイムが作成したインタープリタです。\n" +"通常は、これが唯一のインタープリタです。" -#: ../../library/concurrent.interpreters.rst:224 msgid "" "Initialize a new (idle) Python interpreter and return a :class:`Interpreter` " "object for it." msgstr "" +"新しい (実行中でない) Python インタープリタを初期化し、その :class:" +"`Interpreter` オブジェクトを返します。" -#: ../../library/concurrent.interpreters.rst:229 msgid "" "Initialize a new cross-interpreter queue and return a :class:`Queue` object " "for it." msgstr "" +"インタープリタ間で使う新しいキューを初期化し、その :class:`Queue` オブジェク" +"トを返します。" -#: ../../library/concurrent.interpreters.rst:232 msgid "" "*maxsize* is an integer that sets the upperbound limit on the number of " "items that can be placed in the queue. Insertion will be blocked once this " "size has been reached, until queue items are consumed. If *maxsize* is less " "than or equal to zero, the queue size is infinite." msgstr "" +"*maxsize* は、キューに入れられる要素数の上限を設定する整数です。\n" +"このサイズに達すると、キューの要素が取り出されるまで挿入はブロックされま" +"す。\n" +"*maxsize* が 0 以下の場合、キューのサイズに上限はありません。" -#: ../../library/concurrent.interpreters.rst:238 msgid "Interpreter objects" -msgstr "" +msgstr "インタープリタオブジェクト" -#: ../../library/concurrent.interpreters.rst:242 msgid "A single interpreter in the current process." -msgstr "" +msgstr "現在のプロセス内の一つのインタープリタです。" -#: ../../library/concurrent.interpreters.rst:244 msgid "" "Generally, :class:`Interpreter` shouldn't be called directly. Instead, use :" "func:`create` or one of the other module functions." msgstr "" +"通常、:class:`Interpreter` を直接呼び出すべきではありません。\n" +"代わりに :func:`create` または他のモジュール関数を使ってください。" -#: ../../library/concurrent.interpreters.rst:249 -#: ../../library/concurrent.interpreters.rst:255 -#: ../../library/concurrent.interpreters.rst:336 msgid "(read-only)" -msgstr "" +msgstr "(読み出し専用)" -#: ../../library/concurrent.interpreters.rst:251 msgid "The underlying interpreter's ID." -msgstr "" +msgstr "基となるインタープリタの ID です。" -#: ../../library/concurrent.interpreters.rst:257 msgid "A string describing where the interpreter came from." -msgstr "" +msgstr "インタープリタがどこから作成されたかを表す文字列です。" -#: ../../library/concurrent.interpreters.rst:261 msgid "" "Return ``True`` if the interpreter is currently executing code in its :mod:`!" "__main__` module and ``False`` otherwise." msgstr "" +"インタープリタが現在 :mod:`!__main__` モジュール内でコードを実行している場合" +"は ``True``、それ以外の場合は ``False`` を返します。" -#: ../../library/concurrent.interpreters.rst:266 msgid "Finalize and destroy the interpreter." -msgstr "" +msgstr "インタープリタの終了処理を行い、破棄します。" -#: ../../library/concurrent.interpreters.rst:270 msgid "Bind objects in the interpreter's :mod:`!__main__` module." msgstr "" +"インタープリタの :mod:`!__main__` モジュール内にオブジェクトを束縛します。" -#: ../../library/concurrent.interpreters.rst:272 -#: ../../library/concurrent.interpreters.rst:331 msgid "" "Some objects are actually shared and some are copied efficiently, but most " "are copied via :mod:`pickle`. See :ref:`interp-object-sharing`." msgstr "" +"一部のオブジェクトは実際に共有され、効率よくコピーされるものもありますが、ほ" +"とんどは :mod:`pickle` を介してコピーされます。\n" +":ref:`interp-object-sharing` を参照してください。" -#: ../../library/concurrent.interpreters.rst:277 msgid "Run the given source code in the interpreter (in the current thread)." msgstr "" +"指定されたソースコードを、現在のスレッドでそのインタープリタ内で実行します。" -#: ../../library/concurrent.interpreters.rst:281 msgid "" "Return the result of running the given function in the interpreter (in the " "current thread)." msgstr "" +"指定された関数を、現在のスレッドでそのインタープリタ内で実行した結果を返しま" +"す。" -#: ../../library/concurrent.interpreters.rst:288 msgid "Run the given function in the interpreter (in a new thread)." -msgstr "" +msgstr "指定された関数を、新しいスレッドでそのインタープリタ内で実行します。" #: ../../library/concurrent.interpreters.rst:291 msgid "Exceptions" msgstr "例外" -#: ../../library/concurrent.interpreters.rst:295 msgid "" "This exception, a subclass of :exc:`Exception`, is raised when an " "interpreter-related error happens." msgstr "" +":exc:`Exception` のサブクラスで、インタープリタに関するエラーが発生した場合に" +"送出されます。" -#: ../../library/concurrent.interpreters.rst:300 msgid "" "This exception, a subclass of :exc:`InterpreterError`, is raised when the " "targeted interpreter no longer exists." msgstr "" +":exc:`InterpreterError` のサブクラスで、対象のインタープリタがすでに存在しな" +"い場合に送出されます。" -#: ../../library/concurrent.interpreters.rst:305 msgid "" "This exception, a subclass of :exc:`InterpreterError`, is raised when the " "running code raised an uncaught exception." msgstr "" +":exc:`InterpreterError` のサブクラスで、実行中のコードが捕捉されない例外を送" +"出した場合に送出されます。" -#: ../../library/concurrent.interpreters.rst:310 msgid "A basic snapshot of the exception raised in the other interpreter." -msgstr "" +msgstr "別のインタープリタで送出された例外の基本的なスナップショットです。" -#: ../../library/concurrent.interpreters.rst:316 msgid "" "This exception, a subclass of :exc:`TypeError`, is raised when an object " "cannot be sent to another interpreter." msgstr "" +":exc:`TypeError` のサブクラスで、オブジェクトを別のインタープリタに送れない場" +"合に送出されます。" -#: ../../library/concurrent.interpreters.rst:321 msgid "Communicating Between Interpreters" -msgstr "" +msgstr "インタープリタ間での通信" -#: ../../library/concurrent.interpreters.rst:325 msgid "" "A wrapper around a low-level, cross-interpreter queue, which implements all " "the methods of :class:`queue.Queue` except for :meth:`~queue.Queue." "task_done`, :meth:`~queue.Queue.join` and :meth:`~queue.Queue.shutdown`. " "The underlying queue can only be created through :func:`create_queue`." msgstr "" +"インタープリタ間で使う低水準のキューのラッパです。\n" +":class:`queue.Queue` のメソッドのうち、:meth:`~queue.Queue.task_done`、:meth:" +"`~queue.Queue.join`、:meth:`~queue.Queue.shutdown` を除くすべてを実装していま" +"す。\n" +"基となるキューを作成できるのは :func:`create_queue` だけです。" -#: ../../library/concurrent.interpreters.rst:338 msgid "The queue's ID." -msgstr "" +msgstr "キューの ID です。" #: ../../library/concurrent.interpreters.rst:342 msgid "Return the number of items in the queue." @@ -491,11 +556,10 @@ msgstr "キュー内の要素数を返します。" msgid "Return ``True`` if the queue is empty, ``False`` otherwise." msgstr "キューが空ならば ``True`` を、そうでなければ ``False`` を返します。" -#: ../../library/concurrent.interpreters.rst:350 msgid "Return ``True`` if the queue is full, ``False`` otherwise." msgstr "" +"キューがいっぱいの場合は ``True``、それ以外の場合は ``False`` を返します。" -#: ../../library/concurrent.interpreters.rst:354 msgid "" "Put *obj* into the queue. If optional args *block* is true and *timeout* is " "``None`` (the default), block if necessary until a free slot is available. " @@ -505,12 +569,18 @@ msgid "" "free slot is immediately available, else raise the :exc:`QueueFull` " "exception (*timeout* is ignored in that case)." msgstr "" +"*obj* をキューに入れます。\n" +"オプション引数 *block* が真で、*timeout* が ``None`` (デフォルト) の場合、必" +"要に応じて空きができるまでブロックします。\n" +"*timeout* が正の数の場合、最大 *timeout* 秒ブロックし、その間に空きができなけ" +"れば :exc:`QueueFull` 例外を送出します。\n" +"それ以外の場合 (*block* が偽の場合)、直ちに利用できる空きがあればオブジェクト" +"をキューに入れ、なければ :exc:`QueueFull` 例外を送出します (この場合、" +"*timeout* は無視されます)。" -#: ../../library/concurrent.interpreters.rst:365 msgid "Equivalent to ``put(obj, block=False)``." -msgstr "" +msgstr "``put(obj, block=False)`` と等価です。" -#: ../../library/concurrent.interpreters.rst:369 msgid "" "Remove and return an object from the queue. If optional args *block* is " "true and *timeout* is ``None`` (the default), block if necessary until an " @@ -520,32 +590,39 @@ msgid "" "object if one is immediately available, else raise the :exc:`QueueEmpty` " "exception (*timeout* is ignored in that case)." msgstr "" +"キューからオブジェクトを取り出して返します。\n" +"オプション引数 *block* が真で、*timeout* が ``None`` (デフォルト) の場合、必" +"要に応じてオブジェクトが利用できるまでブロックします。\n" +"*timeout* が正の数の場合、最大 *timeout* 秒ブロックし、その間にオブジェクトが" +"利用できなければ :exc:`QueueEmpty` 例外を送出します。\n" +"それ以外の場合 (*block* が偽の場合)、直ちに利用できるオブジェクトがあればそれ" +"を返し、なければ :exc:`QueueEmpty` 例外を送出します (この場合、*timeout* は無" +"視されます)。" -#: ../../library/concurrent.interpreters.rst:380 msgid "Equivalent to ``get(block=False)``." -msgstr "" +msgstr "``get(block=False)`` と等価です。" -#: ../../library/concurrent.interpreters.rst:385 msgid "" "This exception, a subclass of :exc:`queue.Empty`, is raised from :meth:" "`Queue.get` and :meth:`Queue.get_nowait` when the queue is empty." msgstr "" +":exc:`queue.Empty` のサブクラスで、キューが空の場合に :meth:`Queue.get` と :" +"meth:`Queue.get_nowait` から送出されます。" -#: ../../library/concurrent.interpreters.rst:391 msgid "" "This exception, a subclass of :exc:`queue.Full`, is raised from :meth:`Queue." "put` and :meth:`Queue.put_nowait` when the queue is full." msgstr "" +":exc:`queue.Full` のサブクラスで、キューがいっぱいの場合に :meth:`Queue.put` " +"と :meth:`Queue.put_nowait` から送出されます。" #: ../../library/concurrent.interpreters.rst:397 msgid "Basic usage" msgstr "基本的な使い方" -#: ../../library/concurrent.interpreters.rst:399 msgid "Creating an interpreter and running code in it::" -msgstr "" +msgstr "インタープリタを作成し、その中でコードを実行する例。 ::" -#: ../../library/concurrent.interpreters.rst:401 msgid "" "from concurrent import interpreters\n" "\n" @@ -580,12 +657,42 @@ msgid "" "t = interp.call_in_thread(run)\n" "t.join()" msgstr "" +"from concurrent import interpreters\n" +"\n" +"interp = interpreters.create()\n" +"\n" +"# 現在の OS スレッドで実行する\n" +"\n" +"interp.exec('print(\"spam!\")')\n" +"\n" +"interp.exec(\"\"\"if True:\n" +" print('spam!')\n" +" \"\"\")\n" +"\n" +"from textwrap import dedent\n" +"interp.exec(dedent(\"\"\"\n" +" print('spam!')\n" +" \"\"\"))\n" +"\n" +"def run(arg):\n" +" return arg\n" +"\n" +"res = interp.call(run, 'spam!')\n" +"print(res)\n" +"\n" +"def run():\n" +" print('spam!')\n" +"\n" +"interp.call(run)\n" +"\n" +"# 新しい OS スレッドで実行する\n" +"\n" +"t = interp.call_in_thread(run)\n" +"t.join()" -#: ../../library/concurrent.interpreters.rst:434 msgid "Communicating between interpreters with a queue::" -msgstr "" +msgstr "キューを使ってインタープリタ間で通信する例。 ::" -#: ../../library/concurrent.interpreters.rst:436 msgid "" "from concurrent import interpreters\n" "\n" @@ -599,3 +706,14 @@ msgid "" "print(queue.get())\n" "t.join()" msgstr "" +"from concurrent import interpreters\n" +"\n" +"interp = interpreters.create()\n" +"queue = interpreters.create_queue()\n" +"\n" +"def worker(queue):\n" +" queue.put('spam!')\n" +"\n" +"t = interp.call_in_thread(worker, queue)\n" +"print(queue.get())\n" +"t.join()" diff --git a/library/concurrent.po b/library/concurrent.po index 0fa2e7d47..92b422977 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -26,15 +26,13 @@ msgstr "" msgid "The :mod:`!concurrent` package" msgstr ":mod:`!concurrent` パッケージ" -#: ../../library/concurrent.rst:4 msgid "This package contains the following modules:" -msgstr "" +msgstr "このパッケージには、以下のモジュールが含まれています:" #: ../../library/concurrent.rst:6 msgid ":mod:`concurrent.futures` -- Launching parallel tasks" msgstr ":mod:`concurrent.futures` -- 並列タスク実行" -#: ../../library/concurrent.rst:7 msgid "" ":mod:`concurrent.interpreters` -- Multiple interpreters in the same process" -msgstr "" +msgstr ":mod:`concurrent.interpreters` -- 同じプロセス内の複数のインタープリタ" diff --git a/library/configparser.po b/library/configparser.po index 77f427cac..08116b3a2 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -42,30 +42,34 @@ msgstr "" "ラスを使ってユーザーが簡単にカスタマイズできる Python プログラムを作ることが" "できます。" -#: ../../library/configparser.rst:24 msgid "" "This library does *not* interpret or write the value-type prefixes used in " "the Windows Registry extended version of INI syntax." msgstr "" -"このライブラリでは、Windowsのレジストリ用に拡張された INI 文法はサポート *し" -"ていません* 。" +"このライブラリは、Windows レジストリ用に拡張された INI 構文で使われる値の型を" +"表す接頭辞を解釈したり書き込んだりは *しません*。" -#: ../../library/configparser.rst:28 msgid "" "Be cautious when parsing data from untrusted sources. A malicious INI file " "may cause the decoder to consume considerable CPU and memory resources. " "Limiting the size of data to be parsed is recommended." msgstr "" +"信頼できない提供元のデータを解析するときは注意してください。\n" +"悪意のある INI ファイルにより、デコーダーが大量の CPU とメモリ資源を消費する" +"可能性があります。\n" +"解析するデータのサイズを制限することを推奨します。" #: ../../library/configparser.rst:34 msgid "Module :mod:`tomllib`" msgstr "モジュール :mod:`tomllib`" -#: ../../library/configparser.rst:35 msgid "" "TOML is a well-specified format for application configuration files. It is " "specifically designed to be an improved version of INI." msgstr "" +"TOML は、アプリケーションの設定ファイル向けに仕様が明確に定められた形式で" +"す。\n" +"INI を改善することを目的に設計されています。" #: ../../library/configparser.rst:38 msgid "Module :mod:`shlex`" @@ -83,11 +87,12 @@ msgstr "" msgid "Module :mod:`json`" msgstr ":mod:`json` モジュール" -#: ../../library/configparser.rst:43 msgid "" "The ``json`` module implements a subset of JavaScript syntax which is " "sometimes used for configuration, but does not support comments." msgstr "" +"``json`` モジュールは JavaScript の構文のサブセットを実装しています。\n" +"設定に使われることもありますが、コメントはサポートしません。" #: ../../library/configparser.rst:59 msgid "Quick Start" @@ -97,7 +102,6 @@ msgstr "クイックスタート" msgid "Let's take a very basic configuration file that looks like this:" msgstr "次のような、非常に簡単な設定ファイルを例に考えましょう:" -#: ../../library/configparser.rst:63 msgid "" "[DEFAULT]\n" "ServerAliveInterval = 45\n" @@ -112,8 +116,19 @@ msgid "" "Port = 50022\n" "ForwardX11 = no" msgstr "" +"[DEFAULT]\n" +"ServerAliveInterval = 45\n" +"Compression = yes\n" +"CompressionLevel = 9\n" +"ForwardX11 = yes\n" +"\n" +"[forge.example]\n" +"User = hg\n" +"\n" +"[topsecret.server.example]\n" +"Port = 50022\n" +"ForwardX11 = no" -#: ../../library/configparser.rst:78 msgid "" "The structure of INI files is described `in the following section " "<#supported-ini-file-structure>`_. Essentially, the file consists of " @@ -121,8 +136,13 @@ msgid "" "classes can read and write such files. Let's start by creating the above " "configuration file programmatically." msgstr "" +"INI ファイルの構造は `次の節 <#supported-ini-file-structure>`_ で説明しま" +"す。\n" +"基本的には、ファイルはセクションで構成され、各セクションには値を持つキーが含" +"まれます。\n" +":mod:`!configparser` のクラスは、このようなファイルを読み書きできます。\n" +"まず、上の設定ファイルをプログラムで作成してみましょう。" -#: ../../library/configparser.rst:84 msgid "" ">>> import configparser\n" ">>> config = configparser.ConfigParser()\n" @@ -140,6 +160,21 @@ msgid "" "... config.write(configfile)\n" "..." msgstr "" +">>> import configparser\n" +">>> config = configparser.ConfigParser()\n" +">>> config['DEFAULT'] = {'ServerAliveInterval': '45',\n" +"... 'Compression': 'yes',\n" +"... 'CompressionLevel': '9'}\n" +">>> config['forge.example'] = {}\n" +">>> config['forge.example']['User'] = 'hg'\n" +">>> config['topsecret.server.example'] = {}\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['Port'] = '50022' # パーサーを変更する\n" +">>> topsecret['ForwardX11'] = 'no' # ここも同様\n" +">>> config['DEFAULT']['ForwardX11'] = 'yes'\n" +">>> with open('example.ini', 'w') as configfile:\n" +"... config.write(configfile)\n" +"..." #: ../../library/configparser.rst:102 msgid "" @@ -159,7 +194,6 @@ msgstr "" "これで設定ファイルを作成して保存できました。次はこれを読み込み直して、中の" "データを取り出してみましょう。" -#: ../../library/configparser.rst:109 msgid "" ">>> config = configparser.ConfigParser()\n" ">>> config.sections()\n" @@ -191,6 +225,35 @@ msgid "" ">>> config['forge.example']['ForwardX11']\n" "'yes'" msgstr "" +">>> config = configparser.ConfigParser()\n" +">>> config.sections()\n" +"[]\n" +">>> config.read('example.ini')\n" +"['example.ini']\n" +">>> config.sections()\n" +"['forge.example', 'topsecret.server.example']\n" +">>> 'forge.example' in config\n" +"True\n" +">>> 'python.org' in config\n" +"False\n" +">>> config['forge.example']['User']\n" +"'hg'\n" +">>> config['DEFAULT']['Compression']\n" +"'yes'\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['ForwardX11']\n" +"'no'\n" +">>> topsecret['Port']\n" +"'50022'\n" +">>> for key in config['forge.example']:\n" +"... print(key)\n" +"user\n" +"compressionlevel\n" +"serveraliveinterval\n" +"compression\n" +"forwardx11\n" +">>> config['forge.example']['ForwardX11']\n" +"'yes'" #: ../../library/configparser.rst:141 msgid "" @@ -204,7 +267,6 @@ msgstr "" "[1]_。 また、セクション内の各キーは大文字小文字を区別せず、全て小文字で保存さ" "れていることにも注意してください [1]_。" -#: ../../library/configparser.rst:146 ../../library/configparser.rst:1001 msgid "" "It is possible to read several configurations into a single :class:" "`ConfigParser`, where the most recently added configuration has the highest " @@ -213,14 +275,20 @@ msgid "" "an ``override.ini`` file, which will override any conflicting keys from the " "``example.ini`` file." msgstr "" +"1 つの :class:`ConfigParser` に複数の設定を読み込むことができ、最後に追加した" +"設定が最も優先されます。\n" +"重複するキーには後から読み込んだ設定の値が使われ、重複しない既存のキーは保持" +"されます。\n" +"次の例では ``override.ini`` ファイルを読み込み、``example.ini`` ファイルと重" +"複するキーの値を上書きします。" -#: ../../library/configparser.rst:153 ../../library/configparser.rst:1008 msgid "" "[DEFAULT]\n" "ServerAliveInterval = -1" msgstr "" +"[DEFAULT]\n" +"ServerAliveInterval = -1" -#: ../../library/configparser.rst:158 ../../library/configparser.rst:1013 msgid "" ">>> config_override = configparser.ConfigParser()\n" ">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" @@ -233,12 +301,23 @@ msgid "" ">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" "-1" msgstr "" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" +">>> with open('override.ini', 'w') as configfile:\n" +"... config_override.write(configfile)\n" +"...\n" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override.read(['example.ini', 'override.ini'])\n" +"['example.ini', 'override.ini']\n" +">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" +"-1" -#: ../../library/configparser.rst:172 msgid "" "This behaviour is equivalent to a :meth:`ConfigParser.read` call with " "several files passed to the *filenames* parameter." msgstr "" +"この動作は、*filenames* 引数に複数のファイルを渡して :meth:`ConfigParser." +"read` を呼び出す場合と同じです。" #: ../../library/configparser.rst:177 msgid "Supported Datatypes" @@ -253,13 +332,16 @@ msgstr "" "Config parser は値のデータ型について何も推論せず、常に文字列のまま内部に保存" "します。他のデータ型が必要な場合は自分で変換する必要があります:" -#: ../../library/configparser.rst:183 msgid "" ">>> int(topsecret['Port'])\n" "50022\n" ">>> float(topsecret['CompressionLevel'])\n" "9.0" msgstr "" +">>> int(topsecret['Port'])\n" +"50022\n" +">>> float(topsecret['CompressionLevel'])\n" +"9.0" #: ../../library/configparser.rst:190 msgid "" @@ -279,7 +361,6 @@ msgstr "" "``'on'``/``'off'``、``'true'``/``'false'``、``'1'``/``'0'`` を真偽値として認" "識します [1]_。例えば:" -#: ../../library/configparser.rst:198 msgid "" ">>> topsecret.getboolean('ForwardX11')\n" "False\n" @@ -288,6 +369,12 @@ msgid "" ">>> config.getboolean('forge.example', 'Compression')\n" "True" msgstr "" +">>> topsecret.getboolean('ForwardX11')\n" +"False\n" +">>> config['forge.example'].getboolean('ForwardX11')\n" +"True\n" +">>> config.getboolean('forge.example', 'Compression')\n" +"True" #: ../../library/configparser.rst:207 msgid "" @@ -305,13 +392,13 @@ msgstr "" msgid "Fallback Values" msgstr "代替値" -#: ../../library/configparser.rst:215 msgid "" "As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " "method to provide fallback values:" msgstr "" +"辞書と同様に、セクションの :meth:`~ConfigParser.get` メソッドを使って代替値を" +"指定できます:" -#: ../../library/configparser.rst:218 msgid "" ">>> topsecret.get('Port')\n" "'50022'\n" @@ -321,6 +408,13 @@ msgid "" ">>> topsecret.get('Cipher', '3des-cbc')\n" "'3des-cbc'" msgstr "" +">>> topsecret.get('Port')\n" +"'50022'\n" +">>> topsecret.get('CompressionLevel')\n" +"'9'\n" +">>> topsecret.get('Cipher')\n" +">>> topsecret.get('Cipher', '3des-cbc')\n" +"'3des-cbc'" #: ../../library/configparser.rst:228 msgid "" @@ -335,26 +429,33 @@ msgstr "" "ん。その値を ``'topsecret.server.example'`` から取得しようとした場合、代替値" "を指定しても常にデフォルト値を返します:" -#: ../../library/configparser.rst:234 msgid "" ">>> topsecret.get('CompressionLevel', '3')\n" "'9'" msgstr "" +">>> topsecret.get('CompressionLevel', '3')\n" +"'9'" -#: ../../library/configparser.rst:239 msgid "" "One more thing to be aware of is that the parser-level :meth:`~ConfigParser." "get` method provides a custom, more complex interface, maintained for " "backwards compatibility. When using this method, a fallback value can be " "provided via the ``fallback`` keyword-only argument:" msgstr "" +"もう 1 つ注意が必要なのは、パーサーの :meth:`~ConfigParser.get` メソッドに" +"は、後方互換性のために維持されている独自の、より複雑なインターフェースがある" +"ことです。\n" +"このメソッドを使う場合、代替値はキーワード専用引数 ``fallback`` で指定できま" +"す:" -#: ../../library/configparser.rst:244 msgid "" ">>> config.get('forge.example', 'monster',\n" "... fallback='No such things as monsters')\n" "'No such things as monsters'" msgstr "" +">>> config.get('forge.example', 'monster',\n" +"... fallback='No such things as monsters')\n" +"'No such things as monsters'" #: ../../library/configparser.rst:250 msgid "" @@ -366,7 +467,6 @@ msgstr "" "`~ConfigParser.getfloat` と :meth:`~ConfigParser.getboolean` メソッドでも使え" "ます。例えば:" -#: ../../library/configparser.rst:254 msgid "" ">>> 'BatchMode' in topsecret\n" "False\n" @@ -376,12 +476,18 @@ msgid "" ">>> topsecret.getboolean('BatchMode', fallback=True)\n" "False" msgstr "" +">>> 'BatchMode' in topsecret\n" +"False\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"True\n" +">>> config['DEFAULT']['BatchMode'] = 'no'\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"False" #: ../../library/configparser.rst:266 msgid "Supported INI File Structure" msgstr "サポートするINI ファイルの構造" -#: ../../library/configparser.rst:268 msgid "" "A configuration file consists of sections, each led by a ``[section]`` " "header, followed by key/value entries separated by a specific string (``=`` " @@ -393,20 +499,37 @@ msgid "" "of the value. Depending on the parser's mode, blank lines may be treated as " "parts of multiline values or ignored." msgstr "" +"設定ファイルはセクションで構成されます。\n" +"各セクションは ``[section]`` ヘッダーで始まり、その後に特定の文字列 (デフォル" +"トでは ``=`` または ``:`` [1]_) で区切られたキーと値のエントリーが続きま" +"す。\n" +"デフォルトでは、セクション名は大文字と小文字を区別しますが、キーは区別しませ" +"ん [1]_。\n" +"キーと値の前後の空白は取り除かれます。\n" +"パーサーの設定で許可されていれば値を省略でき [1]_、その場合はキーと値を区切る" +"デリミタも省略できます。\n" +"値の最初の行よりも深くインデントすれば、値を複数行にわたって記述することもで" +"きます。\n" +"パーサーのモードによって、空行は複数行の値の一部として扱われる場合も、無視さ" +"れる場合もあります。" -#: ../../library/configparser.rst:278 msgid "" "By default, a valid section name can be any string that does not contain '\\" "\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." msgstr "" +"デフォルトでは、'\\\\n' を含まない任意の文字列をセクション名にできます。\n" +"これを変更するには :attr:`ConfigParser.SECTCRE` を参照してください。" -#: ../../library/configparser.rst:281 msgid "" "The first section name may be omitted if the parser is configured to allow " "an unnamed top level section with ``allow_unnamed_section=True``. In this " "case, the keys/values may be retrieved by :const:`UNNAMED_SECTION` as in " "``config[UNNAMED_SECTION]``." msgstr "" +"``allow_unnamed_section=True`` を指定して無名の最上位セクションを許可した場" +"合、最初のセクション名は省略できます。\n" +"この場合、``config[UNNAMED_SECTION]`` のように :const:`UNNAMED_SECTION` を" +"使ってキーと値を取得できます。" #: ../../library/configparser.rst:286 msgid "" @@ -422,7 +545,6 @@ msgstr "" msgid "For example:" msgstr "例えば:" -#: ../../library/configparser.rst:292 msgid "" "[Simple Values]\n" "key=value\n" @@ -466,18 +588,58 @@ msgid "" " of a value\n" " # Did I mention we can indent comments, too?" msgstr "" +"[Simple Values]\n" +"key=value\n" +"spaces in keys=allowed\n" +"spaces in values=allowed as well\n" +"spaces around the delimiter = obviously\n" +"you can also use : to delimit keys from values\n" +"\n" +"[All Values Are Strings]\n" +"values like this: 1000000\n" +"or this: 3.14159265359\n" +"are they treated as numbers? : no\n" +"integers, floats and booleans are held as: strings\n" +"can use the API to get converted values directly: true\n" +"\n" +"[Multiline Values]\n" +"chorus: I'm a lumberjack, and I'm okay\n" +" I sleep all night and I work all day\n" +"\n" +"[No Values]\n" +"key_without_value\n" +"empty string value here =\n" +"\n" +"[You can use comments]\n" +"# このように\n" +"; このようにも\n" +"\n" +"# デフォルトでは他の内容がない行にのみ記述できます。\n" +"# インラインコメントは、デリミタを値の一部として使えなくするため、\n" +"# 問題になることがあります。\n" +"# ただし、この動作はカスタマイズできます。\n" +"\n" +" [Sections Can Be Indented]\n" +" can_values_be_as_well = True\n" +" does_that_mean_anything_special = False\n" +" purpose = formatting for readability\n" +" multiline_values = are\n" +" handled just fine as\n" +" long as they are indented\n" +" deeper than the first line\n" +" of a value\n" +" # コメントもインデントできます。" -#: ../../library/configparser.rst:340 msgid "Unnamed Sections" -msgstr "" +msgstr "無名セクション" -#: ../../library/configparser.rst:342 msgid "" "The name of the first section (or unique) may be omitted and values " "retrieved by the :const:`UNNAMED_SECTION` attribute." msgstr "" +"最初のセクション (または唯一のセクション) の名前は省略でき、:const:" +"`UNNAMED_SECTION` 属性を使って値を取得できます。" -#: ../../library/configparser.rst:345 msgid "" ">>> config = \"\"\"\n" "... option = value\n" @@ -490,6 +652,16 @@ msgid "" ">>> unnamed.get(configparser.UNNAMED_SECTION, 'option')\n" "'value'" msgstr "" +">>> config = \"\"\"\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> unnamed = configparser.ConfigParser(allow_unnamed_section=True)\n" +">>> unnamed.read_string(config)\n" +">>> unnamed.get(configparser.UNNAMED_SECTION, 'option')\n" +"'value'" #: ../../library/configparser.rst:359 msgid "Interpolation of values" @@ -516,7 +688,6 @@ msgstr "" "別なデフォルトセクション中 [1]_ の他の値を参照するフォーマット文字列を含める" "ことができます。追加のデフォルト値を初期化時に提供できます。" -#: ../../library/configparser.rst:376 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -528,6 +699,14 @@ msgid "" "escaped):\n" "gain: 80%%" msgstr "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: %(home_dir)s/lumberjack\n" +"my_pictures: %(my_dir)s/Pictures\n" +"\n" +"[Escape]\n" +"# %% で % 記号をエスケープします (エスケープが必要なのは % だけです):\n" +"gain: 80%%" #: ../../library/configparser.rst:387 msgid "" @@ -577,7 +756,6 @@ msgstr "" "たとえば、上記の basic interpolation で指定した設定は、extended " "interpolation を使うと下記のようになります:" -#: ../../library/configparser.rst:412 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -589,12 +767,19 @@ msgid "" "escaped):\n" "cost: $$80" msgstr "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: ${home_dir}/lumberjack\n" +"my_pictures: ${my_dir}/Pictures\n" +"\n" +"[Escape]\n" +"# $$ で $ 記号をエスケープします (エスケープが必要なのは $ だけです):\n" +"cost: $$80" #: ../../library/configparser.rst:423 msgid "Values from other sections can be fetched as well:" msgstr "他のセクションから値を持ってくることもできます:" -#: ../../library/configparser.rst:425 msgid "" "[Common]\n" "home_dir: /Users\n" @@ -613,18 +798,37 @@ msgid "" "my_pictures: ${my_dir}/Pictures\n" "python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" msgstr "" +"[Common]\n" +"home_dir: /Users\n" +"library_dir: /Library\n" +"system_dir: /System\n" +"macports_dir: /opt/local\n" +"\n" +"[Frameworks]\n" +"Python: 3.2\n" +"path: ${Common:system_dir}/Library/Frameworks/\n" +"\n" +"[Arthur]\n" +"nickname: Two Sheds\n" +"last_name: Jackson\n" +"my_dir: ${Common:home_dir}/twosheds\n" +"my_pictures: ${my_dir}/Pictures\n" +"python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" #: ../../library/configparser.rst:445 msgid "Mapping Protocol Access" msgstr "マップ型プロトコルアクセス" -#: ../../library/configparser.rst:449 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:`!" "configparser`, the mapping interface implementation is using the " "``parser['section']['option']`` notation." msgstr "" +"マップ型プロトコルアクセスとは、独自のオブジェクトを辞書のように使える機能の" +"総称です。\n" +":mod:`!configparser` のマッピングインターフェースでは、``parser['section']" +"['option']`` という記法を使います。" #: ../../library/configparser.rst:454 msgid "" @@ -639,13 +843,17 @@ msgstr "" "サーから取られます。さらに重要なことに、セクションのプロキシの値が変更される" "と、オリジナルのパーサー中の値が実際に変更されます。" -#: ../../library/configparser.rst:460 msgid "" ":mod:`!configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" "`~collections.abc.MutableMapping` ABC. However, there are a few differences " "that should be taken into account:" msgstr "" +":mod:`!configparser` オブジェクトは、できる限り実際の辞書に近い振る舞いをしま" +"す。\n" +"マッピングインターフェースは完全に実装されており、:class:`~collections.abc." +"MutableMapping` ABC に従います。\n" +"ただし、注意すべき違いがいくつかあります:" #: ../../library/configparser.rst:465 msgid "" @@ -661,11 +869,12 @@ msgstr "" "す。同時に、キー ``'a'`` を含むセクションにおいて、どちらの式も ``True`` を返" "します::" -#: ../../library/configparser.rst:470 msgid "" "\"a\" in parser[\"section\"]\n" "\"A\" in parser[\"section\"]" msgstr "" +"\"a\" in parser[\"section\"]\n" +"\"A\" in parser[\"section\"]" #: ../../library/configparser.rst:473 msgid "" @@ -736,7 +945,6 @@ msgstr "" msgid "Customizing Parser Behaviour" msgstr "パーサーの振る舞いをカスタマイズする" -#: ../../library/configparser.rst:507 msgid "" "There are nearly as many INI format variants as there are applications using " "it. :mod:`!configparser` goes a long way to provide support for the largest " @@ -744,32 +952,40 @@ msgid "" "dictated by historical background and it's very likely that you will want to " "customize some of the features." msgstr "" +"INI 形式には、それを使うアプリケーションとほぼ同じ数の変種があります。\n" +":mod:`!configparser` は、妥当な範囲でできるだけ多くの INI の書式をサポートす" +"るよう努めています。\n" +"デフォルトの機能は主に歴史的な経緯によって決まっているため、機能の一部をカス" +"タマイズしたくなることも多いでしょう。" -#: ../../library/configparser.rst:513 msgid "" "The most common way to change the way a specific config parser works is to " "use the :meth:`!__init__` options:" msgstr "" +"個々の設定パーサーの動作を変える最も一般的な方法は、:meth:`!__init__` のオプ" +"ションを使うことです:" #: ../../library/configparser.rst:516 msgid "*defaults*, default value: ``None``" msgstr "*defaults*, デフォルト値: ``None``" -#: ../../library/configparser.rst:518 msgid "" "This option accepts a dictionary of key-value pairs which will be initially " "put in the ``DEFAULT`` section. This makes for an elegant way to support " "concise configuration files that don't specify values which are the same as " "the documented default." msgstr "" -"このオプションは最初に ``DEFAULT`` セクションに加えられるキー-値の対の辞書を" -"受け付けます。" +"このオプションは、最初に ``DEFAULT`` セクションに追加するキーと値の対を含む辞" +"書を受け付けます。\n" +"これにより、文書に記載されたデフォルト値と同じ値の指定を省いた、簡潔な設定" +"ファイルを容易にサポートできます。" -#: ../../library/configparser.rst:523 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" +"ヒント: 特定のセクションのデフォルト値を指定するには、実際のファイルを読み込" +"む前に :meth:`~ConfigParser.read_dict` を使ってください。" #: ../../library/configparser.rst:526 msgid "*dict_type*, default value: :class:`dict`" @@ -803,7 +1019,6 @@ msgstr "" "注意: 一度の操作でキー-値の対を複数追加する方法もあります。そのような操作に普" "通の辞書を使うと、キーの並びは挿入順になります。例えば:" -#: ../../library/configparser.rst:540 msgid "" ">>> parser = configparser.ConfigParser()\n" ">>> parser.read_dict({'section1': {'key1': 'value1',\n" @@ -821,20 +1036,37 @@ msgid "" ">>> [option for option in parser['section3']]\n" "['foo', 'bar', 'baz']" msgstr "" +">>> parser = configparser.ConfigParser()\n" +">>> parser.read_dict({'section1': {'key1': 'value1',\n" +"... 'key2': 'value2',\n" +"... 'key3': 'value3'},\n" +"... 'section2': {'keyA': 'valueA',\n" +"... 'keyB': 'valueB',\n" +"... 'keyC': 'valueC'},\n" +"... 'section3': {'foo': 'x',\n" +"... 'bar': 'y',\n" +"... 'baz': 'z'}\n" +"... })\n" +">>> parser.sections()\n" +"['section1', 'section2', 'section3']\n" +">>> [option for option in parser['section3']]\n" +"['foo', 'bar', 'baz']" #: ../../library/configparser.rst:558 msgid "*allow_no_value*, default value: ``False``" msgstr "*allow_no_value*, デフォルト値: ``False``" -#: ../../library/configparser.rst:560 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`!configparser`. " "The *allow_no_value* parameter to the constructor can be used to indicate " "that such values should be accepted:" msgstr "" +":mod:`!configparser` がサポートする構文におおむね従っていても、値のない設定を" +"含む設定ファイルがあります。\n" +"そのような値を受け付けるには、コンストラクタの *allow_no_value* 引数を使いま" +"す:" -#: ../../library/configparser.rst:565 msgid "" ">>> import configparser\n" "\n" @@ -864,6 +1096,33 @@ msgid "" " ...\n" "KeyError: 'does-not-exist'" msgstr "" +">>> import configparser\n" +"\n" +">>> sample_config = \"\"\"\n" +"... [mysqld]\n" +"... user = mysql\n" +"... pid-file = /var/run/mysqld/mysqld.pid\n" +"... skip-external-locking\n" +"... old_passwords = 1\n" +"... skip-bdb\n" +"... # 今回は ACID は不要です\n" +"... skip-innodb\n" +"... \"\"\"\n" +">>> config = configparser.ConfigParser(allow_no_value=True)\n" +">>> config.read_string(sample_config)\n" +"\n" +">>> # 値のある設定は従来どおりに扱われます:\n" +">>> config[\"mysqld\"][\"user\"]\n" +"'mysql'\n" +"\n" +">>> # 値のない設定は None を返します:\n" +">>> config[\"mysqld\"][\"skip-bdb\"]\n" +"\n" +">>> # 指定されていない設定は引き続きエラーになります:\n" +">>> config[\"mysqld\"][\"does-not-exist\"]\n" +"Traceback (most recent call last):\n" +" ...\n" +"KeyError: 'does-not-exist'" #: ../../library/configparser.rst:595 msgid "*delimiters*, default value: ``('=', ':')``" @@ -910,11 +1169,13 @@ msgstr "" "ン、空行も可能) の後に使えます。デフォルトではインラインコメントは無効化され" "ていて、``'#'`` と ``';'`` を行全体のコメントに使用します。" -#: ../../library/configparser.rst:615 msgid "" "In previous versions of :mod:`!configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" +"以前のバージョンの :mod:`!configparser` の動作は、" +"``comment_prefixes=('#',';')`` および ``inline_comment_prefixes=(';',)`` を指" +"定した場合と同じでした。" #: ../../library/configparser.rst:619 msgid "" @@ -932,7 +1193,6 @@ msgstr "" "も、複数行にわたる値で、行の先頭にコメント接頭辞文字を保存する唯一の方法は、" "次の例のように接頭辞を補間することです::" -#: ../../library/configparser.rst:626 msgid "" ">>> from configparser import ConfigParser, ExtendedInterpolation\n" ">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" @@ -973,24 +1233,67 @@ msgid "" "line #2\n" "line #3" msgstr "" +">>> from configparser import ConfigParser, ExtendedInterpolation\n" +">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" +">>> # デフォルトの BasicInterpolation も使用できます\n" +">>> parser.read_string(\"\"\"\n" +"... [DEFAULT]\n" +"... hash = #\n" +"...\n" +"... [hashes]\n" +"... shebang =\n" +"... ${hash}!/usr/bin/env python\n" +"... ${hash} -*- coding: utf-8 -*-\n" +"...\n" +"... extensions =\n" +"... enabled_extension\n" +"... another_extension\n" +"... #disabled_by_comment\n" +"... yet_another_extension\n" +"...\n" +"... interpolation not necessary = if # is not at line start\n" +"... even in multiline values = line #1\n" +"... line #2\n" +"... line #3\n" +"... \"\"\")\n" +">>> print(parser['hashes']['shebang'])\n" +"\n" +"#!/usr/bin/env python\n" +"# -*- coding: utf-8 -*-\n" +">>> print(parser['hashes']['extensions'])\n" +"\n" +"enabled_extension\n" +"another_extension\n" +"yet_another_extension\n" +">>> print(parser['hashes']['interpolation not necessary'])\n" +"if # is not at line start\n" +">>> print(parser['hashes']['even in multiline values'])\n" +"line #1\n" +"line #2\n" +"line #3" #: ../../library/configparser.rst:665 msgid "*strict*, default value: ``True``" msgstr "*strict*, デフォルト値: ``True``" -#: ../../library/configparser.rst:667 msgid "" "When set to ``True``, the parser will not allow for any section or option " "duplicates while reading from a single source (using :meth:`~ConfigParser." "read_file`, :meth:`~ConfigParser.read_string` or :meth:`~ConfigParser." "read_dict`). It is recommended to use strict parsers in new applications." msgstr "" +"``True`` に設定すると、パーサーは単一のソースから (:meth:`~ConfigParser." +"read_file`、:meth:`~ConfigParser.read_string`、:meth:`~ConfigParser." +"read_dict` を使って) 読み込む際に、セクションやオプションの重複を許可しませ" +"ん。\n" +"新しいアプリケーションでは、この厳密なパーサーを使うことを推奨します。" -#: ../../library/configparser.rst:672 msgid "" "In previous versions of :mod:`!configparser` behaviour matched " "``strict=False``." msgstr "" +"以前のバージョンの :mod:`!configparser` の動作は、``strict=False`` を指定した" +"場合と同じでした。" #: ../../library/configparser.rst:676 msgid "*empty_lines_in_values*, default value: ``True``" @@ -1011,7 +1314,6 @@ msgstr "" "ルが大きく複雑になったとき、ユーザーがファイル構造を見失いやすいです。この例" "をご覧ください:" -#: ../../library/configparser.rst:685 msgid "" "[Section]\n" "key = multiline\n" @@ -1019,6 +1321,11 @@ msgid "" "\n" " this = is still a part of the multiline value of 'key'" msgstr "" +"[Section]\n" +"key = multiline\n" +" value with a gotcha\n" +"\n" +" this = is still a part of the multiline value of 'key'" #: ../../library/configparser.rst:693 msgid "" @@ -1088,7 +1395,6 @@ msgstr "" msgid "*converters*, default value: not set" msgstr "*converters*, デフォルト値: 未設定" -#: ../../library/configparser.rst:724 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -1101,6 +1407,18 @@ msgid "" "``parser_instance.getdecimal('section', 'key', fallback=0)`` and " "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" +"設定パーサーには、型変換を行ってオプションの値を取得するメソッドがありま" +"す。\n" +"デフォルトでは :meth:`~ConfigParser.getint`、:meth:`~ConfigParser." +"getfloat`、:meth:`~ConfigParser.getboolean` が実装されています。\n" +"ほかの取得メソッドが必要な場合は、サブクラスで定義するか、各キーをコンバー" +"ター名、各値をその変換を実装する呼び出し可能オブジェクトとする辞書を渡せま" +"す。\n" +"例えば、``{'decimal': decimal.Decimal}`` を渡すと、パーサーオブジェクトとすべ" +"てのセクションプロキシに :meth:`!getdecimal` が追加されます。\n" +"つまり、``parser_instance.getdecimal('section', 'key', fallback=0)`` と " +"``parser_instance['section'].getdecimal('key', 0)`` のどちらも使えるようにな" +"ります。" #: ../../library/configparser.rst:735 msgid "" @@ -1138,7 +1456,6 @@ msgstr "" "``'false'``, ``'off'`` 。文字列と対応するブール値のカスタム辞書を指定すること" "でこれを上書きできます。たとえば:" -#: ../../library/configparser.rst:752 msgid "" ">>> custom = configparser.ConfigParser()\n" ">>> custom['section1'] = {'funky': 'nope'}\n" @@ -1150,6 +1467,15 @@ msgid "" ">>> custom['section1'].getboolean('funky')\n" "False" msgstr "" +">>> custom = configparser.ConfigParser()\n" +">>> custom['section1'] = {'funky': 'nope'}\n" +">>> custom['section1'].getboolean('funky')\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Not a boolean: nope\n" +">>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False}\n" +">>> custom['section1'].getboolean('funky')\n" +"False" #: ../../library/configparser.rst:764 msgid "" @@ -1171,7 +1497,6 @@ msgstr "" "すべてのキーは小文字になります。それがふさわしくなければ、このメソッドを上書" "きしてください。例えば:" -#: ../../library/configparser.rst:776 msgid "" ">>> config = \"\"\"\n" "... [Section1]\n" @@ -1194,15 +1519,36 @@ msgid "" ">>> list(custom['Section2'].keys())\n" "['AnotherKey']" msgstr "" +">>> config = \"\"\"\n" +"... [Section1]\n" +"... Key = Value\n" +"...\n" +"... [Section2]\n" +"... AnotherKey = Value\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> list(typical['Section1'].keys())\n" +"['key']\n" +">>> list(typical['Section2'].keys())\n" +"['anotherkey']\n" +">>> custom = configparser.RawConfigParser()\n" +">>> custom.optionxform = lambda option: option\n" +">>> custom.read_string(config)\n" +">>> list(custom['Section1'].keys())\n" +"['Key']\n" +">>> list(custom['Section2'].keys())\n" +"['AnotherKey']" -#: ../../library/configparser.rst:800 msgid "" "The optionxform function transforms option names to a canonical form. This " "should be an idempotent function: if the name is already in canonical form, " "it should be returned unchanged." msgstr "" +"``optionxform()`` 関数はオプション名を正規形に変換します。\n" +"この関数は冪等でなければなりません。\n" +"つまり、名前がすでに正規形であれば、そのまま返す必要があります。" -#: ../../library/configparser.rst:807 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -1210,13 +1556,13 @@ msgid "" "name ``\" larch \"``. Override this attribute if that's unsuitable. For " "example:" msgstr "" -"セクションヘッダを解析するのに使われる、コンパイルされた正規表現です。デフォ" -"ルトでは ``[section]`` が ``\"section\"`` という名前にマッチします。空白はセ" -"クション名の一部と見なされるので、``[ larch ]`` は ``\" larch \"`` という" -"名のセクションとして読み込まれます。これがふさわしくない場合、このメソッドを" -"上書きしてください。例えば:" +"セクションヘッダーを解析するために使われる、コンパイル済みの正規表現です。\n" +"デフォルトでは ``[section]`` にマッチし、名前を ``\"section\"`` とします。\n" +"空白はセクション名の一部と見なされるため、``[ larch ]`` は ``\" larch " +"\"`` という名前のセクションとして読み込まれます。\n" +"これが適切でなければ、この属性を上書きしてください。\n" +"例えば:" -#: ../../library/configparser.rst:813 msgid "" ">>> import re\n" ">>> config = \"\"\"\n" @@ -1236,6 +1582,23 @@ msgid "" ">>> custom.sections()\n" "['Section 1', 'Section 2']" msgstr "" +">>> import re\n" +">>> config = \"\"\"\n" +"... [Section 1]\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> typical.sections()\n" +"['Section 1', ' Section 2 ']\n" +">>> custom = configparser.ConfigParser()\n" +">>> custom.SECTCRE = re.compile(r\"\\[ *(?P
[^]]+?) *\\]\")\n" +">>> custom.read_string(config)\n" +">>> custom.sections()\n" +"['Section 1', 'Section 2']" #: ../../library/configparser.rst:835 msgid "" @@ -1251,7 +1614,6 @@ msgstr "" msgid "Legacy API Examples" msgstr "レガシーな API の例" -#: ../../library/configparser.rst:843 msgid "" "Mainly because of backwards compatibility concerns, :mod:`!configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -1259,12 +1621,17 @@ msgid "" "access is preferred for new projects. The legacy API is at times more " "advanced, low-level and downright counterintuitive." msgstr "" +":mod:`!configparser` は、主に後方互換性のために、明示的な ``get`` / ``set`` " +"メソッドを持つレガシーな API も提供しています。\n" +"以下のメソッドが適する用途もありますが、新しいプロジェクトではマップ型プロト" +"コルアクセスを優先してください。\n" +"レガシーな API は、場合によってはより高度で低水準であり、まったく直感的でない" +"こともあります。" #: ../../library/configparser.rst:849 msgid "An example of writing to a configuration file::" msgstr "設定ファイルを書き出す例::" -#: ../../library/configparser.rst:851 msgid "" "import configparser\n" "\n" @@ -1287,12 +1654,31 @@ msgid "" "with open('example.cfg', 'w') as configfile:\n" " config.write(configfile)" msgstr "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"\n" +"# RawConfigParser の set 関数では、内部的にキーに文字列以外の値も\n" +"# 代入できますが、ファイルへの書き出しや raw でないモードでの取得を\n" +"# 試みるとエラーになります。\n" +"# マップ型プロトコルや ConfigParser の set() による値の設定では、\n" +"# このような代入はできません。\n" +"config.add_section('Section1')\n" +"config.set('Section1', 'an_int', '15')\n" +"config.set('Section1', 'a_bool', 'true')\n" +"config.set('Section1', 'a_float', '3.1415')\n" +"config.set('Section1', 'baz', 'fun')\n" +"config.set('Section1', 'bar', 'Python')\n" +"config.set('Section1', 'foo', '%(bar)s is %(baz)s!')\n" +"\n" +"# 設定ファイルを 'example.cfg' に書き出す\n" +"with open('example.cfg', 'w') as configfile:\n" +" config.write(configfile)" #: ../../library/configparser.rst:872 msgid "An example of reading the configuration file again::" msgstr "設定ファイルを読み込む例::" -#: ../../library/configparser.rst:874 msgid "" "import configparser\n" "\n" @@ -1310,12 +1696,26 @@ msgid "" "if config.getboolean('Section1', 'a_bool'):\n" " print(config.get('Section1', 'foo'))" msgstr "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"config.read('example.cfg')\n" +"\n" +"# 値が浮動小数点数でなければ getfloat() は例外を送出します\n" +"# getint() と getboolean() もそれぞれの型について同様に動作します\n" +"a_float = config.getfloat('Section1', 'a_float')\n" +"an_int = config.getint('Section1', 'an_int')\n" +"print(a_float + an_int)\n" +"\n" +"# 次の出力では '%(bar)s' や '%(baz)s' は補間されません。\n" +"# これは RawConfigParser() を使用しているためです。\n" +"if config.getboolean('Section1', 'a_bool'):\n" +" print(config.get('Section1', 'foo'))" #: ../../library/configparser.rst:890 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "補間するには、 :class:`ConfigParser` を使ってください::" -#: ../../library/configparser.rst:892 msgid "" "import configparser\n" "\n" @@ -1349,6 +1749,38 @@ msgid "" "print(cfg.get('Section1', 'monster', fallback=None))\n" " # -> None" msgstr "" +"import configparser\n" +"\n" +"cfg = configparser.ConfigParser()\n" +"cfg.read('example.cfg')\n" +"\n" +"# 1 回の取得操作で補間を無効にするには、\n" +"# get() の省略可能な引数 *raw* を True に設定します。\n" +"print(cfg.get('Section1', 'foo', raw=False)) # -> \"Python is fun!\"\n" +"print(cfg.get('Section1', 'foo', raw=True)) # -> \"%(bar)s is %(baz)s!\"\n" +"\n" +"# 省略可能な引数 *vars* は、補間時に優先される要素を\n" +"# 含む辞書です。\n" +"print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation',\n" +" 'baz': 'evil'}))\n" +"\n" +"# 省略可能な引数 *fallback* で代替値を指定できます\n" +"print(cfg.get('Section1', 'foo'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'foo', fallback='Monty is not.'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback='No such things as " +"monsters.'))\n" +" # -> \"No such things as monsters.\"\n" +"\n" +"# 単に print(cfg.get('Section1', 'monster')) とすると NoOptionError になりま" +"すが、\n" +"# 次のようにも書けます:\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback=None))\n" +" # -> None" #: ../../library/configparser.rst:923 msgid "" @@ -1358,7 +1790,6 @@ msgstr "" "どちらの型の ConfigParsers でもデフォルト値が利用できます。使われているオプ" "ションがどこにも定義されていなければ、そのデフォルト値が補間に使われます。 ::" -#: ../../library/configparser.rst:926 msgid "" "import configparser\n" "\n" @@ -1371,6 +1802,17 @@ msgid "" "config.remove_option('Section1', 'baz')\n" "print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" msgstr "" +"import configparser\n" +"\n" +"# 'bar' と 'baz' のデフォルト値がそれぞれ 'Life' と 'hard' の新しいインスタン" +"ス\n" +"config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'})\n" +"config.read('example.cfg')\n" +"\n" +"print(config.get('Section1', 'foo')) # -> \"Python is fun!\"\n" +"config.remove_option('Section1', 'bar')\n" +"config.remove_option('Section1', 'baz')\n" +"print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" #: ../../library/configparser.rst:941 msgid "ConfigParser Objects" @@ -1401,7 +1843,6 @@ msgstr "" "す。*inline_comment_prefixes* が与えられた場合、非空行のコメントに接頭する部" "分文字列としての組み合わせとして使われます。" -#: ../../library/configparser.rst:962 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -1415,13 +1856,15 @@ msgid "" msgstr "" "*strict* が ``True`` (デフォルト) であれば、パーサーは単一のソース (ファイ" "ル、文字列、辞書) 中にセクションやオプションの重複を認めず、 :exc:" -"`DuplicateSectionError` や :exc:`DuplicateOptionError` を送出します。 " +"`DuplicateSectionError` や :exc:`DuplicateOptionError` を送出します。\n" "*empty_lines_in_values* が ``False`` (デフォルト: ``True``) なら、空行はそれ" -"ぞれオプションの終わりを示します。 *allow_no_value* が ``True`` (デフォルト: " -"``False``) なら、値のないオプションが受け付けられます。そのオプションの値は " -"``None`` となり、後端のデリミタを除いてシリアル化されます。" +"ぞれオプションの終わりを示します。\n" +"そうでなければ、複数行のオプション内の空行は値の一部として保持されます。\n" +"*allow_no_value* が ``True`` (デフォルト: ``False``) なら、値のないオプション" +"が受け付けられます。\n" +"そのオプションの値は ``None`` となり、後端のデリミタを除いてシリアル化されま" +"す。" -#: ../../library/configparser.rst:972 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -1430,6 +1873,12 @@ msgid "" "evaluate an already parsed config file, but will be used when writing parsed " "settings to a new config file." msgstr "" +"*default_section* を指定すると、ほかのセクションのデフォルト値や補間用の値を" +"保持する特別なセクションの名前 (通常は ``\"DEFAULT\"``) を設定できます。\n" +"この値は、インスタンス属性 ``default_section`` を使って実行時に取得、変更でき" +"ます。\n" +"値を変更しても、すでに解析した設定ファイルは再評価されませんが、解析済みの設" +"定を新しい設定ファイルへ書き出す際に使われます。" #: ../../library/configparser.rst:979 msgid "" @@ -1458,7 +1907,6 @@ msgstr "" "フォルトの実装を使うと、値 ``foo %(bar)s`` と ``foo %(BAR)s`` は等しくなりま" "す。" -#: ../../library/configparser.rst:991 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -1466,13 +1914,20 @@ msgid "" "converter gets its own corresponding :meth:`!get*` method on the parser " "object and section proxies." msgstr "" +"*converters* を指定する場合は、各キーを型コンバーター名、各値を文字列から目的" +"のデータ型への変換を実装する呼び出し可能オブジェクトとする辞書でなければなり" +"ません。\n" +"各コンバーターに対応する :meth:`!get*` メソッドが、パーサーオブジェクトとセク" +"ションプロキシに追加されます。" -#: ../../library/configparser.rst:997 msgid "" "When *allow_unnamed_section* is ``True`` (default: ``False``), the first " "section name can be omitted. See the `\"Unnamed Sections\" section <#unnamed-" "sections>`_." msgstr "" +"*allow_unnamed_section* が ``True`` (デフォルトは ``False``) の場合、最初のセ" +"クション名を省略できます。\n" +"`「無名セクション」の節 <#unnamed-sections>`_ を参照してください。" #: ../../library/configparser.rst:1026 msgid "The default *dict_type* is :class:`collections.OrderedDict`." @@ -1491,28 +1946,31 @@ msgstr "" msgid "The *converters* argument was added." msgstr "*converters* 引数が追加されました。" -#: ../../library/configparser.rst:1037 msgid "" "The *defaults* argument is read with :meth:`read_dict`, providing consistent " "behavior across the parser: non-string keys and values are implicitly " "converted to strings." msgstr "" +"*defaults* 引数は :meth:`read_dict` で読み込まれ、パーサー全体で動作が統一さ" +"れました。\n" +"文字列でないキーと値は暗黙に文字列に変換されます。" -#: ../../library/configparser.rst:1042 ../../library/configparser.rst:1330 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" +"挿入順を保持するようになったため、*dict_type* のデフォルトは :class:`dict` に" +"なりました。" -#: ../../library/configparser.rst:1046 msgid "" "Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, " "and a key without a value is continued with an indented line." msgstr "" +"*allow_no_value* が ``True`` で、値のないキーの後にインデントされた行が続く場" +"合、:exc:`MultilineContinuationError` を送出するようになりました。" -#: ../../library/configparser.rst:1050 ../../library/configparser.rst:1334 msgid "The *allow_unnamed_section* argument was added." -msgstr "" +msgstr "*allow_unnamed_section* 引数が追加されました。" #: ../../library/configparser.rst:1055 msgid "Return a dictionary containing the instance-wide defaults." @@ -1602,7 +2060,6 @@ msgstr "" "を呼ぶ前に 、まず :meth:`read_file` を用いて必要なファイルを読み込んでくださ" "い::" -#: ../../library/configparser.rst:1113 msgid "" "import configparser, os\n" "\n" @@ -1611,12 +2068,20 @@ msgid "" "config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" " encoding='cp1250')" msgstr "" +"import configparser, os\n" +"\n" +"config = configparser.ConfigParser()\n" +"config.read_file(open('defaults.cfg'))\n" +"config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" +" encoding='cp1250')" -#: ../../library/configparser.rst:1120 msgid "" "Added the *encoding* parameter. Previously, all files were read using the " "default encoding for :func:`open`." msgstr "" +"*encoding* 引数が追加されました。\n" +"以前は、すべてのファイルを :func:`open` のデフォルトのエンコーディングで読み" +"込んでいました。" #: ../../library/configparser.rst:1124 msgid "The *filenames* parameter accepts a :term:`path-like object`." @@ -1636,12 +2101,15 @@ msgstr "" "設定データを *f* から読み込んで解析します。*f* は Unicode 文字列を yield する" "イテラブル (例えばテキストモードで開かれたファイル) です。" -#: ../../library/configparser.rst:1136 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`!name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" +"省略可能な引数 *source* は、読み込むファイルの名前を指定します。\n" +"指定されておらず、*f* に :attr:`!name` 属性がある場合、その値が *source* に使" +"われます。\n" +"デフォルトは ``''`` です。" #: ../../library/configparser.rst:1140 msgid "Replaces :meth:`!readfp`." @@ -1701,14 +2169,13 @@ msgstr "" "す。\n" "*fallback* には ``None`` も指定できます。" -#: ../../library/configparser.rst:1178 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -"*raw* が真でない時には、全ての ``'%'`` 置換は展開されてから返されます。置換後" -"の値はオプションと同じ順序で探されます。" +"引数 *raw* が真でなければ、戻り値ではすべての ``'%'`` 補間が展開されます。\n" +"補間に使うキーの値は、オプションと同じ方法で検索されます。" #: ../../library/configparser.rst:1182 msgid "" @@ -1729,12 +2196,14 @@ msgstr "" "指定された *section* 中の *option* を整数に型強制する補助メソッドです。 " "*raw*, *vars* および *fallback* の説明は :meth:`get` を参照してください。" -#: ../../library/configparser.rst:1197 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating-point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" +"指定された *section* の *option* を浮動小数点数に変換する便利なメソッドで" +"す。\n" +"*raw*、*vars*、*fallback* の説明は :meth:`get` を参照してください。" msgid "" "A convenience method which coerces the *option* in the specified *section* " @@ -1804,11 +2273,12 @@ msgstr "" "後で :meth:`read` を呼び出すことでパースできます。 *space_around_delimiters* " "が真なら、キーと値の間のデリミタはスペースで囲まれます。" -#: ../../library/configparser.rst:1245 msgid "" "Raises InvalidWriteError if this would write a representation which cannot " "be accurately parsed by a future :meth:`read` call from this parser." msgstr "" +"このパーサーで後から :meth:`read` を呼び出したときに正確に解析できない表現を" +"書き込もうとすると、``InvalidWriteError`` を送出します。" #: ../../library/configparser.rst:1251 msgid "" @@ -1860,11 +2330,12 @@ msgstr "" "上で、これを文字列引数をとって文字列を返す関数に設定できます。例えば、これを " "``str`` に設定すると、オプション名に大文字小文字の区別をつけられます::" -#: ../../library/configparser.rst:1284 msgid "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" msgstr "" +"cfgparser = ConfigParser()\n" +"cfgparser.optionxform = str" #: ../../library/configparser.rst:1287 msgid "" @@ -1874,30 +2345,36 @@ msgstr "" "なお、設定ファイルを読み込むとき、オプション名の周りの空白は :meth:" "`optionxform` が呼び出される前に取り除かれます。" -#: ../../library/configparser.rst:1293 msgid "" "A special object representing a section name used to reference the unnamed " "section (see :ref:`unnamed-sections`)." msgstr "" +"無名セクションを参照するためのセクション名を表す特別なオブジェクトです (:ref:" +"`unnamed-sections` を参照)。" -#: ../../library/configparser.rst:1298 msgid "" "The maximum depth for recursive interpolation for :meth:`~configparser." "ConfigParser.get` when the *raw* parameter is false. This is relevant only " "when the default *interpolation* is used." msgstr "" +"引数 *raw* が偽の場合に :meth:`~configparser.ConfigParser.get` で行う、再帰的" +"な補間の深さの上限です。\n" +"デフォルトの *interpolation* を使う場合にのみ関係します。" #: ../../library/configparser.rst:1306 msgid "RawConfigParser Objects" msgstr "RawConfigParser オブジェクト" -#: ../../library/configparser.rst:1317 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " "via its unsafe ``add_section`` and ``set`` methods, as well as the legacy " "``defaults=`` keyword argument handling." msgstr "" +":class:`ConfigParser` のレガシーな変種です。\n" +"デフォルトで補間が無効になっており、安全でない ``add_section``、``set`` メ" +"ソッドと、レガシーな ``defaults=`` キーワード引数の処理を通じて、文字列でない" +"セクション名、オプション名、値を使用できます。" #: ../../library/configparser.rst:1338 msgid "" @@ -1909,18 +2386,23 @@ msgstr "" "してください。補間を望まない場合、 ``ConfigParser(interpolation=None)`` を使" "用できます。" -#: ../../library/configparser.rst:1345 msgid "" "Add a section named *section* or :const:`UNNAMED_SECTION` to the instance." msgstr "" +"*section* という名前のセクション、または :const:`UNNAMED_SECTION` をインスタ" +"ンスに追加します。" -#: ../../library/configparser.rst:1347 msgid "" "If the given section already exists, :exc:`DuplicateSectionError` is raised. " "If the *default section* name is passed, :exc:`ValueError` is raised. If :" "const:`UNNAMED_SECTION` is passed and support is disabled, :exc:" "`UnnamedSectionDisabledError` is raised." msgstr "" +"指定されたセクションがすでに存在する場合、:exc:`DuplicateSectionError` を送出" +"します。\n" +"*デフォルトセクション* の名前を渡すと、:exc:`ValueError` を送出します。\n" +":const:`UNNAMED_SECTION` を渡し、無名セクションのサポートが無効になっている場" +"合、:exc:`UnnamedSectionDisabledError` を送出します。" #: ../../library/configparser.rst:1352 msgid "" @@ -1931,9 +2413,8 @@ msgstr "" "ることができます。この振る舞いはサポートされておらず、内部エラーを起こす可能" "性があります。" -#: ../../library/configparser.rst:1355 msgid "Added support for :const:`UNNAMED_SECTION`." -msgstr "" +msgstr ":const:`UNNAMED_SECTION` のサポートが追加されました。" #: ../../library/configparser.rst:1361 msgid "" @@ -1967,26 +2448,28 @@ msgstr "" msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1379 msgid "Base class for all other :mod:`!configparser` exceptions." -msgstr "" +msgstr "ほかのすべての :mod:`!configparser` 例外の基底クラスです。" #: ../../library/configparser.rst:1384 msgid "Exception raised when a specified section is not found." msgstr "指定したセクションが見つからなかった時に起きる例外です。" -#: ../../library/configparser.rst:1389 msgid "" "Exception raised if :meth:`~ConfigParser.add_section` is called with the " "name of a section that is already present or in strict parsers when a " "section if found more than once in a single input file, string or dictionary." msgstr "" +"すでに存在するセクションの名前で :meth:`~ConfigParser.add_section` を呼び出し" +"た場合、または厳密なパーサーで単一の入力ファイル、文字列、辞書に同じセクショ" +"ンが複数回見つかった場合に送出される例外です。" -#: ../../library/configparser.rst:1393 msgid "" "Added the optional *source* and *lineno* attributes and parameters to :meth:" "`!__init__`." msgstr "" +":meth:`!__init__` に省略可能な *source*、*lineno* 属性と引数が追加されまし" +"た。" #: ../../library/configparser.rst:1400 msgid "" @@ -2051,36 +2534,41 @@ msgstr "" msgid "Exception raised when errors occur attempting to parse a file." msgstr "ファイルの構文解析中にエラーが起きた場合に発生する例外です。" -#: ../../library/configparser.rst:1446 msgid "" "The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" +"``filename`` 属性と :meth:`!__init__` コンストラクタの引数が削除されまし" +"た。\n" +"これらは 3.2 以降、``source`` という名前で利用できます。" -#: ../../library/configparser.rst:1452 msgid "" "Exception raised when a key without a corresponding value is continued with " "an indented line." msgstr "" +"対応する値のないキーの後にインデントされた行が続く場合に送出される例外です。" -#: ../../library/configparser.rst:1459 msgid "" "Exception raised when attempting to use the :const:`UNNAMED_SECTION` without " "enabling it." msgstr "" +":const:`UNNAMED_SECTION` を有効にせずに使おうとした場合に送出される例外です。" -#: ../../library/configparser.rst:1466 msgid "" "Exception raised when an attempted :meth:`ConfigParser.write` would not be " "parsed accurately with a future :meth:`ConfigParser.read` call." msgstr "" +":meth:`ConfigParser.write` で書き込もうとしている内容が、後の :meth:" +"`ConfigParser.read` 呼び出しで正確に解析できない場合に送出される例外です。" -#: ../../library/configparser.rst:1469 msgid "" "Ex: Writing a key beginning with the :attr:`ConfigParser.SECTCRE` pattern " "would parse as a section header when read. Attempting to write this will " "raise this exception." msgstr "" +"例えば、:attr:`ConfigParser.SECTCRE` のパターンで始まるキーを書き込むと、読み" +"込み時にセクションヘッダーとして解析されます。\n" +"このようなキーを書き込もうとすると、この例外を送出します。" #: ../../library/configparser.rst:1476 msgid "Footnotes" @@ -2120,9 +2608,8 @@ msgstr "Windows ini ファイル" msgid "% (percent)" msgstr "% (パーセント)" -#: ../../library/configparser.rst:365 ../../library/configparser.rst:398 msgid "interpolation in configuration files" -msgstr "" +msgstr "設定ファイル内の補間" #: ../../library/configparser.rst:398 msgid "$ (dollar)" diff --git a/library/contextlib.po b/library/contextlib.po index 97fe34edc..c116d0234 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -49,7 +49,6 @@ msgstr "ユーティリティ" msgid "Functions and classes provided:" msgstr "以下の関数とクラスを提供しています:" -#: ../../library/contextlib.rst:23 msgid "" "An :term:`abstract base class` for classes that implement :meth:`~object." "__enter__` and :meth:`~object.__exit__`. A default implementation for :meth:" @@ -57,8 +56,12 @@ msgid "" "__exit__` is an abstract method which by default returns ``None``. See also " "the definition of :ref:`typecontextmanager`." msgstr "" +":meth:`~object.__enter__` と :meth:`~object.__exit__` を実装するクラスのため" +"の :term:`abstract base class` です。\n" +":meth:`~object.__enter__` には ``self`` を返すデフォルトの実装があり、:meth:" +"`~object.__exit__` はデフォルトで ``None`` を返す抽象メソッドです。\n" +":ref:`typecontextmanager` の定義も参照してください。" -#: ../../library/contextlib.rst:34 msgid "" "An :term:`abstract base class` for classes that implement :meth:`~object." "__aenter__` and :meth:`~object.__aexit__`. A default implementation for :" @@ -66,6 +69,11 @@ msgid "" "`~object.__aexit__` is an abstract method which by default returns ``None``. " "See also the definition of :ref:`async-context-managers`." msgstr "" +":meth:`~object.__aenter__` と :meth:`~object.__aexit__` を実装するクラスのた" +"めの :term:`abstract base class` です。\n" +":meth:`~object.__aenter__` には ``self`` を返すデフォルトの実装があり、:meth:" +"`~object.__aexit__` はデフォルトで ``None`` を返す抽象メソッドです。\n" +":ref:`async-context-managers` の定義も参照してください。" #: ../../library/contextlib.rst:46 msgid "" @@ -79,13 +87,15 @@ msgstr "" "`~object.__enter__` と :meth:`~object.__exit__` メソッドを別々に定義しなくて" "も、ファクトリ関数を定義することができます。" -#: ../../library/contextlib.rst:50 msgid "" "While many objects natively support use in with statements, sometimes a " "resource needs to be managed that isn't a context manager in its own right, " "and doesn't implement a ``close()`` method for use with ``contextlib." "closing``." msgstr "" +"多くのオブジェクトは with 文での使用をサポートしていますが、コンテキストマ" +"ネージャではなく、``contextlib.closing`` で使うための ``close()`` メソッドも" +"実装していないリソースを管理する必要が生じることもあります。" #: ../../library/contextlib.rst:54 msgid "" @@ -94,7 +104,6 @@ msgid "" msgstr "" "リソースを正しく管理するよう保証する抽象的な例は以下のようなものでしょう::" -#: ../../library/contextlib.rst:57 msgid "" "from contextlib import contextmanager\n" "\n" @@ -108,17 +117,30 @@ msgid "" " # Code to release resource, e.g.:\n" " release_resource(resource)" msgstr "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def managed_resource(*args, **kwds):\n" +" # リソースを確保するコードの例:\n" +" resource = acquire_resource(*args, **kwds)\n" +" try:\n" +" yield resource\n" +" finally:\n" +" # リソースを解放するコードの例:\n" +" release_resource(resource)" #: ../../library/contextlib.rst:69 msgid "The function can then be used like this::" msgstr "このとき、関数は次のように使うことができます::" -#: ../../library/contextlib.rst:71 msgid "" ">>> with managed_resource(timeout=3600) as resource:\n" "... # Resource is released at the end of this block,\n" "... # even if code in the block raises an exception" msgstr "" +">>> with managed_resource(timeout=3600) as resource:\n" +"... # ブロック内のコードが例外を送出しても、\n" +"... # ブロックの終わりでリソースは解放されます" #: ../../library/contextlib.rst:75 msgid "" @@ -158,7 +180,6 @@ msgstr "" "に対して例外が処理されたことを示し、:keyword:`!with` 文の直後の文から実行を再" "開します。" -#: ../../library/contextlib.rst:91 msgid "" ":deco:`contextmanager` uses :class:`ContextDecorator` so the context " "managers it creates can be used as decorators as well as in :keyword:`with` " @@ -168,16 +189,24 @@ msgid "" "that context managers support multiple invocations in order to be used as " "decorators)." msgstr "" +":deco:`contextmanager` は :class:`ContextDecorator` を使用するため、作成した" +"コンテキストマネージャは :keyword:`with` 文でもデコレータとしても使用できま" +"す。\n" +"デコレータとして使う場合は、関数を呼び出すたびに、新しいジェネレータインスタ" +"ンスが暗黙に作成されます (これにより、:deco:`contextmanager` が作成する、本来" +"は一度しか使えないコンテキストマネージャも、デコレータとして使うための複数回" +"の呼び出しをサポートするという要件を満たせます)。" #: ../../library/contextlib.rst:98 msgid "Use of :class:`ContextDecorator`." msgstr ":class:`ContextDecorator` の使用。" -#: ../../library/contextlib.rst:104 msgid "" "Similar to :deco:`~contextlib.contextmanager`, but creates an :ref:" "`asynchronous context manager `." msgstr "" +":deco:`~contextlib.contextmanager` に似ていますが、:ref:`非同期コンテキストマ" +"ネージャ ` を作成します。" #: ../../library/contextlib.rst:107 msgid "" @@ -197,7 +226,6 @@ msgstr "" msgid "A simple example::" msgstr "簡単な例::" -#: ../../library/contextlib.rst:115 msgid "" "from contextlib import asynccontextmanager\n" "\n" @@ -213,14 +241,27 @@ msgid "" " async with get_connection() as conn:\n" " return conn.query('SELECT ...')" msgstr "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def get_connection():\n" +" conn = await acquire_db_connection()\n" +" try:\n" +" yield conn\n" +" finally:\n" +" await release_db_connection(conn)\n" +"\n" +"async def get_all_users():\n" +" async with get_connection() as conn:\n" +" return conn.query('SELECT ...')" -#: ../../library/contextlib.rst:131 msgid "" "Context managers defined with :deco:`asynccontextmanager` can be used either " "as decorators or with :keyword:`async with` statements::" msgstr "" +":deco:`asynccontextmanager` で定義したコンテキストマネージャは、デコレータと" +"しても :keyword:`async with` 文でも使用できます。 ::" -#: ../../library/contextlib.rst:134 msgid "" "import time\n" "from contextlib import asynccontextmanager\n" @@ -237,20 +278,39 @@ msgid "" "async def main():\n" " # ... async code ..." msgstr "" +"import time\n" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def timeit():\n" +" now = time.monotonic()\n" +" try:\n" +" yield\n" +" finally:\n" +" print(f'it took {time.monotonic() - now}s to run')\n" +"\n" +"@timeit()\n" +"async def main():\n" +" # ... 非同期のコード ..." -#: ../../library/contextlib.rst:149 msgid "" "When used as a decorator, a new generator instance is implicitly created on " "each function call. This allows the otherwise \"one-shot\" context managers " "created by :deco:`asynccontextmanager` to meet the requirement that context " "managers support multiple invocations in order to be used as decorators." msgstr "" +"デコレータとして使う場合は、関数を呼び出すたびに、新しいジェネレータインスタ" +"ンスが暗黙に作成されます。\n" +"これにより、:deco:`asynccontextmanager` が作成する、本来は一度しか使えないコ" +"ンテキストマネージャも、デコレータとして使うための複数回の呼び出しをサポート" +"するという要件を満たせます。" -#: ../../library/contextlib.rst:154 msgid "" "Async context managers created with :deco:`asynccontextmanager` can be used " "as decorators." msgstr "" +":deco:`asynccontextmanager` で作成した非同期コンテキストマネージャをデコレー" +"タとして使用できるようになりました。" #: ../../library/contextlib.rst:161 msgid "" @@ -260,7 +320,6 @@ msgstr "" "ブロックの完了時に *thing* を close するコンテキストマネージャを返します。こ" "れは基本的に以下と等価です::" -#: ../../library/contextlib.rst:164 msgid "" "from contextlib import contextmanager\n" "\n" @@ -271,6 +330,14 @@ msgid "" " finally:\n" " thing.close()" msgstr "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def closing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" thing.close()" #: ../../library/contextlib.rst:173 msgid "And lets you write code like this::" @@ -278,7 +345,6 @@ msgstr "" "そして、明示的に ``page`` を close する必要なしに、次のように書くことができま" "す::" -#: ../../library/contextlib.rst:175 msgid "" "from contextlib import closing\n" "from urllib.request import urlopen\n" @@ -287,6 +353,12 @@ msgid "" " for line in page:\n" " print(line)" msgstr "" +"from contextlib import closing\n" +"from urllib.request import urlopen\n" +"\n" +"with closing(urlopen('https://www.python.org')) as page:\n" +" for line in page:\n" +" print(line)" #: ../../library/contextlib.rst:182 msgid "" @@ -296,7 +368,6 @@ msgstr "" "``page`` を明示的に close する必要は無く、エラーが発生した場合でも、 :" "keyword:`with` ブロックを出るときに ``page.close()`` が呼ばれます。" -#: ../../library/contextlib.rst:187 msgid "" "Most types managing resources support the :term:`context manager` protocol, " "which closes *thing* on leaving the :keyword:`with` statement. As such, :" @@ -304,6 +375,12 @@ msgid "" "context managers. This example is purely for illustration purposes, as :func:" "`~urllib.request.urlopen` would normally be used in a context manager." msgstr "" +"リソースを管理するほとんどの型は :term:`context manager` プロトコルをサポート" +"し、:keyword:`with` 文を抜けるときに *thing* を閉じます。\n" +"そのため、:func:`!closing` はコンテキストマネージャをサポートしないサードパー" +"ティー製の型で特に役立ちます。\n" +":func:`~urllib.request.urlopen` は通常、コンテキストマネージャとして使用する" +"ため、この例は説明のためのものにすぎません。" #: ../../library/contextlib.rst:196 msgid "" @@ -313,7 +390,6 @@ msgstr "" "ブロックの完了時に *thing* の ``aclose()`` メソッドを呼び出すような非同期コン" "テキストマネージャを返します。これは基本的に以下と等価です::" -#: ../../library/contextlib.rst:199 msgid "" "from contextlib import asynccontextmanager\n" "\n" @@ -324,6 +400,14 @@ msgid "" " finally:\n" " await thing.aclose()" msgstr "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def aclosing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" await thing.aclose()" #: ../../library/contextlib.rst:208 msgid "" @@ -335,7 +419,6 @@ msgstr "" "ロックが終了した場合に、 ``aclosing()`` は非同期ジェネレータの決定論的なク" "リーンアップをサポートすることです::" -#: ../../library/contextlib.rst:212 msgid "" "from contextlib import aclosing\n" "\n" @@ -344,6 +427,12 @@ msgid "" " if value == 42:\n" " break" msgstr "" +"from contextlib import aclosing\n" +"\n" +"async with aclosing(my_generator()) as values:\n" +" async for value in values:\n" +" if value == 42:\n" +" break" #: ../../library/contextlib.rst:219 msgid "" @@ -357,14 +446,16 @@ msgstr "" "は期待通りに動作し、またジェネレータが依存するタスクの寿命が尽きたあとに終了" "のコードが実行されることもありません)。" -#: ../../library/contextlib.rst:231 msgid "" "Return a context manager that returns *enter_result* from :meth:`~object." "__enter__`, but otherwise does nothing. It is intended to be used as a stand-" "in for an optional context manager, for example::" msgstr "" +":meth:`~object.__enter__` から *enter_result* を返し、それ以外は何もしないコ" +"ンテキストマネージャを返します。\n" +"省略可能なコンテキストマネージャの代役として使用することを意図しています。\n" +"例えば次のように使います。 ::" -#: ../../library/contextlib.rst:235 msgid "" "def myfunction(arg, ignore_exceptions=False):\n" " if ignore_exceptions:\n" @@ -376,12 +467,20 @@ msgid "" " with cm:\n" " # Do something" msgstr "" +"def myfunction(arg, ignore_exceptions=False):\n" +" if ignore_exceptions:\n" +" # suppress を使ってすべての例外を無視します。\n" +" cm = contextlib.suppress(Exception)\n" +" else:\n" +" # 例外を無視せず、cm は何も行いません。\n" +" cm = contextlib.nullcontext()\n" +" with cm:\n" +" # 何らかの処理" #: ../../library/contextlib.rst:245 msgid "An example using *enter_result*::" msgstr "*enter_result* を使った例です::" -#: ../../library/contextlib.rst:247 msgid "" "def process_file(file_or_path):\n" " if isinstance(file_or_path, str):\n" @@ -394,6 +493,16 @@ msgid "" " with cm as file:\n" " # Perform processing on the file" msgstr "" +"def process_file(file_or_path):\n" +" if isinstance(file_or_path, str):\n" +" # 文字列の場合はファイルを開きます\n" +" cm = open(file_or_path)\n" +" else:\n" +" # ファイルを閉じる責任は呼び出し側にあります\n" +" cm = nullcontext(file_or_path)\n" +"\n" +" with cm as file:\n" +" # ファイルを処理します" #: ../../library/contextlib.rst:258 msgid "" @@ -403,7 +512,6 @@ msgstr "" ":ref:`非同期コンテキストマネージャ ` の代役として使う" "こともできます::" -#: ../../library/contextlib.rst:261 msgid "" "async def send_http(session=None):\n" " if not session:\n" @@ -416,6 +524,16 @@ msgid "" " async with cm as session:\n" " # Send http requests with session" msgstr "" +"async def send_http(session=None):\n" +" if not session:\n" +" # HTTP セッションがなければ aiohttp で作成します\n" +" cm = aiohttp.ClientSession()\n" +" else:\n" +" # セッションを閉じる責任は呼び出し側にあります\n" +" cm = nullcontext(session)\n" +"\n" +" async with cm as session:\n" +" # session を使って HTTP リクエストを送信します" #: ../../library/contextlib.rst:274 msgid ":term:`asynchronous context manager` support was added." @@ -448,7 +566,6 @@ msgstr "" msgid "For example::" msgstr "例えば::" -#: ../../library/contextlib.rst:293 msgid "" "from contextlib import suppress\n" "\n" @@ -458,12 +575,18 @@ msgid "" "with suppress(FileNotFoundError):\n" " os.remove('someotherfile.tmp')" msgstr "" +"from contextlib import suppress\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('somefile.tmp')\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('someotherfile.tmp')" #: ../../library/contextlib.rst:301 msgid "This code is equivalent to::" msgstr "これは以下と等価です::" -#: ../../library/contextlib.rst:303 msgid "" "try:\n" " os.remove('somefile.tmp')\n" @@ -475,6 +598,15 @@ msgid "" "except FileNotFoundError:\n" " pass" msgstr "" +"try:\n" +" os.remove('somefile.tmp')\n" +"except FileNotFoundError:\n" +" pass\n" +"\n" +"try:\n" +" os.remove('someotherfile.tmp')\n" +"except FileNotFoundError:\n" +" pass" #: ../../library/contextlib.rst:313 ../../library/contextlib.rst:362 #: ../../library/contextlib.rst:372 ../../library/contextlib.rst:389 @@ -483,7 +615,6 @@ msgstr "" "このコンテキストマネージャは :ref:`再入可能(リエントラント) ` " "です。" -#: ../../library/contextlib.rst:315 msgid "" "If the code within the :keyword:`!with` block raises a :exc:" "`BaseExceptionGroup`, suppressed exceptions are removed from the group. Any " @@ -491,26 +622,33 @@ msgid "" "group which is created using the original group's :meth:`~BaseExceptionGroup." "derive` method." msgstr "" +":keyword:`!with` ブロック内のコードが :exc:`BaseExceptionGroup` を送出した場" +"合、抑制対象の例外はグループから取り除かれます。\n" +"グループ内の抑制されなかった例外は、元のグループの :meth:" +"`~BaseExceptionGroup.derive` メソッドで作成した新しいグループにまとめて再送出" +"されます。" -#: ../../library/contextlib.rst:323 msgid "" "``suppress`` now supports suppressing exceptions raised as part of a :exc:" "`BaseExceptionGroup`." msgstr "" +"``suppress`` は、:exc:`BaseExceptionGroup` の一部として送出された例外の抑制を" +"サポートするようになりました。" -#: ../../library/contextlib.rst:329 msgid "" "Context manager for temporarily redirecting :data:`sys.stdout` to another :" "term:`file object`." msgstr "" +":data:`sys.stdout` を一時的に別の :term:`file object` にリダイレクトするコン" +"テキストマネージャです。" -#: ../../library/contextlib.rst:332 msgid "" "This tool adds flexibility to existing functions or classes whose output is " "hardwired to :data:`sys.stdout`." msgstr "" +"このツールは、出力先が :data:`sys.stdout` に固定されている既存の関数やクラス" +"を柔軟に使えるようにします。" -#: ../../library/contextlib.rst:335 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " "You can capture that output in a string by redirecting the output to an :" @@ -518,13 +656,20 @@ msgid "" "meth:`~object.__enter__` method and so is available as the target of the :" "keyword:`with` statement::" msgstr "" +"例えば、:func:`help` の出力は通常 *sys.stdout* に送られます。\n" +"出力先を :class:`io.StringIO` オブジェクトにリダイレクトすれば、出力を文字列" +"として取得できます。\n" +"置き換え先のストリームは :meth:`~object.__enter__` メソッドから返されるの" +"で、:keyword:`with` 文のターゲットとして使用できます。 ::" -#: ../../library/contextlib.rst:341 msgid "" "with redirect_stdout(io.StringIO()) as f:\n" " help(pow)\n" "s = f.getvalue()" msgstr "" +"with redirect_stdout(io.StringIO()) as f:\n" +" help(pow)\n" +"s = f.getvalue()" #: ../../library/contextlib.rst:345 msgid "" @@ -534,12 +679,14 @@ msgstr "" ":func:`help` の出力をディスク上のファイルに送るためには、出力を通常のファイル" "にリダイレクトします::" -#: ../../library/contextlib.rst:348 msgid "" "with open('help.txt', 'w') as f:\n" " with redirect_stdout(f):\n" " help(pow)" msgstr "" +"with open('help.txt', 'w') as f:\n" +" with redirect_stdout(f):\n" +" help(pow)" #: ../../library/contextlib.rst:352 msgid "To send the output of :func:`help` to *sys.stderr*::" @@ -547,11 +694,12 @@ msgstr "" ":func:`help` の出力を標準エラー出力 (*sys.stderr*) に送るには以下のようにしま" "す::" -#: ../../library/contextlib.rst:354 msgid "" "with redirect_stdout(sys.stderr):\n" " help(pow)" msgstr "" +"with redirect_stdout(sys.stderr):\n" +" help(pow)" #: ../../library/contextlib.rst:357 msgid "" @@ -566,11 +714,12 @@ msgstr "" "りますが、それでも多くのユーティリティスクリプトに対して有用なアプローチで" "す。" -#: ../../library/contextlib.rst:369 msgid "" "Similar to :func:`~contextlib.redirect_stdout` but redirecting the global :" "data:`sys.stderr` to another :term:`file object`." msgstr "" +":func:`~contextlib.redirect_stdout` に似ていますが、グローバルな :data:`sys." +"stderr` を別の :term:`file object` にリダイレクトします。" #: ../../library/contextlib.rst:379 msgid "" @@ -603,25 +752,27 @@ msgstr "" "コンテキストマネージャをデコレータとしても使用できるようにする基底クラスで" "す。" -#: ../../library/contextlib.rst:398 msgid "" "Context managers inheriting from ``ContextDecorator`` have to implement :" "meth:`~object.__enter__` and :meth:`~object.__exit__` as normal. " "``__exit__`` retains its optional exception handling even when used as a " "decorator." msgstr "" +"``ContextDecorator`` を継承するコンテキストマネージャは、通常どおり :meth:" +"`~object.__enter__` と :meth:`~object.__exit__` を実装する必要があります。\n" +"デコレータとして使用した場合も、``__exit__`` で任意に例外処理を行えます。" -#: ../../library/contextlib.rst:403 msgid "" "``ContextDecorator`` is used by :deco:`contextmanager`, so you get this " "functionality automatically." msgstr "" +":deco:`contextmanager` は ``ContextDecorator`` を使用するため、この機能を自動" +"的に利用できます。" #: ../../library/contextlib.rst:406 msgid "Example of ``ContextDecorator``::" msgstr "``ContextDecorator`` の例::" -#: ../../library/contextlib.rst:408 msgid "" "from contextlib import ContextDecorator\n" "\n" @@ -634,12 +785,21 @@ msgid "" " print('Finishing')\n" " return False" msgstr "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextDecorator):\n" +" def __enter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" print('Finishing')\n" +" return False" #: ../../library/contextlib.rst:419 ../../library/contextlib.rst:519 msgid "The class can then be used like this::" msgstr "このとき、クラスは次のように使うことができます::" -#: ../../library/contextlib.rst:421 msgid "" ">>> @mycontext()\n" "... def function():\n" @@ -657,29 +817,48 @@ msgid "" "The bit in the middle\n" "Finishing" msgstr "" +">>> @mycontext()\n" +"... def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> function()\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" #: ../../library/contextlib.rst:437 msgid "" "This change is just syntactic sugar for any construct of the following form::" msgstr "これは次のような形のコードに対するシンタックスシュガーになります::" -#: ../../library/contextlib.rst:439 msgid "" "def f():\n" " with cm():\n" " # Do stuff" msgstr "" +"def f():\n" +" with cm():\n" +" # 処理を行います" #: ../../library/contextlib.rst:443 msgid "``ContextDecorator`` lets you instead write::" msgstr "``ContextDecorator`` を使うと代わりに次のように書けます::" -#: ../../library/contextlib.rst:445 msgid "" "@cm()\n" "def f():\n" " # Do stuff" msgstr "" +"@cm()\n" +"def f():\n" +" # 処理を行います" #: ../../library/contextlib.rst:449 msgid "" @@ -697,7 +876,6 @@ msgstr "" "すでに基底クラスを持っているコンテキストマネージャーも、``ContextDecorator`` " "を mixin クラスとして利用することで拡張できます::" -#: ../../library/contextlib.rst:455 msgid "" "from contextlib import ContextDecorator\n" "\n" @@ -708,6 +886,14 @@ msgid "" " def __exit__(self, *exc):\n" " return False" msgstr "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextBaseClass, ContextDecorator):\n" +" def __enter__(self):\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" return False" #: ../../library/contextlib.rst:465 msgid "" @@ -720,7 +906,6 @@ msgstr "" "は複数の :keyword:`with` 文に対応する必要があります。そうでないなら、明示的" "な :keyword:`!with` 文を関数内で利用するべきです。" -#: ../../library/contextlib.rst:470 msgid "" "When the decorated callable is a generator function, coroutine function, or " "asynchronous generator function, the returned wrapper is of the same kind " @@ -729,43 +914,63 @@ msgid "" "object. Wrapped generators and asynchronous generators are explicitly " "closed when iteration ends, as if by :func:`closing` or :func:`aclosing`." msgstr "" +"デコレートする呼び出し可能オブジェクトがジェネレータ関数、コルーチン関数、非" +"同期ジェネレータ関数の場合、返されるラッパーも同じ種類になります。\n" +"コンテキストマネージャは、ジェネレータやコルーチンオブジェクトを作成する呼び" +"出しの間だけでなく、反復や await の間ずっと開いたままになります。\n" +"ラップされたジェネレータと非同期ジェネレータは、反復の終了時に :func:" +"`closing` や :func:`aclosing` を使った場合と同様に明示的に閉じられます。" -#: ../../library/contextlib.rst:478 msgid "" "For asynchronous generators the wrapper re-yields each value with ``async " "for``; values sent with :meth:`~agen.asend` and exceptions thrown with :meth:" "`~agen.athrow` are not forwarded to the wrapped generator." msgstr "" +"非同期ジェネレータのラッパーは、``async for`` を使って各値を再度 yield しま" +"す。\n" +":meth:`~agen.asend` で送った値や :meth:`~agen.athrow` で投げ込んだ例外は、" +"ラップされたジェネレータには転送されません。" -#: ../../library/contextlib.rst:485 msgid "" "Decorating a generator function, coroutine function, or asynchronous " "generator function now keeps the context manager open across iteration or " "await. Previously the context manager exited as soon as the generator or " "coroutine object was created." msgstr "" +"ジェネレータ関数、コルーチン関数、非同期ジェネレータ関数をデコレートすると、" +"反復や await の間もコンテキストマネージャを開いたままにするようになりまし" +"た。\n" +"以前は、ジェネレータやコルーチンオブジェクトを作成するとすぐにコンテキストマ" +"ネージャを終了していました。" -#: ../../library/contextlib.rst:494 msgid "" "Similar to :class:`ContextDecorator`, but the context manager is entered and " "exited with :keyword:`async with`. Decorate coroutine functions and " "asynchronous generator functions with this class; the returned wrapper is of " "the same kind." msgstr "" +":class:`ContextDecorator` に似ていますが、コンテキストマネージャへの出入り" +"に :keyword:`async with` を使います。\n" +"このクラスは、コルーチン関数と非同期ジェネレータ関数のデコレートに使ってくだ" +"さい。\n" +"返されるラッパーも同じ種類になります。" -#: ../../library/contextlib.rst:500 msgid "" "Synchronous functions and generators are accepted, but the wrapper is always " "asynchronous, so the decorated callable must then be awaited or iterated " "with ``async for``. If that change of calling convention is not intended, " "use :class:`ContextDecorator` instead." msgstr "" +"同期関数と同期ジェネレータも受け付けますが、ラッパーは常に非同期になるため、" +"デコレートした呼び出し可能オブジェクトは await するか、``async for`` で反復す" +"る必要があります。\n" +"呼び出し方を変更する意図がない場合は、代わりに :class:`ContextDecorator` を" +"使ってください。" #: ../../library/contextlib.rst:505 msgid "Example of ``AsyncContextDecorator``::" msgstr "``AsyncContextDecorator`` の使用例::" -#: ../../library/contextlib.rst:507 msgid "" "from asyncio import run\n" "from contextlib import AsyncContextDecorator\n" @@ -779,8 +984,18 @@ msgid "" " print('Finishing')\n" " return False" msgstr "" +"from asyncio import run\n" +"from contextlib import AsyncContextDecorator\n" +"\n" +"class mycontext(AsyncContextDecorator):\n" +" async def __aenter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" async def __aexit__(self, *exc):\n" +" print('Finishing')\n" +" return False" -#: ../../library/contextlib.rst:521 msgid "" ">>> @mycontext()\n" "... async def function():\n" @@ -800,8 +1015,24 @@ msgid "" "The bit in the middle\n" "Finishing" msgstr "" +">>> @mycontext()\n" +"... async def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> async def function():\n" +"... async with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" -#: ../../library/contextlib.rst:541 msgid "" "Decorating an asynchronous generator function now keeps the context manager " "open across iteration. Previously the context manager exited as soon as the " @@ -809,6 +1040,12 @@ msgid "" "generator functions are also now accepted, with an asynchronous wrapper " "returned." msgstr "" +"非同期ジェネレータ関数をデコレートすると、反復の間もコンテキストマネージャを" +"開いたままにするようになりました。\n" +"以前は、ジェネレータオブジェクトを作成するとすぐにコンテキストマネージャを終" +"了していました。\n" +"同期関数と同期ジェネレータ関数も受け付けるようになり、その場合は非同期のラッ" +"パーを返します。" #: ../../library/contextlib.rst:551 msgid "" @@ -825,7 +1062,6 @@ msgid "" "as follows::" msgstr "例えば、複数のファイルを1つの with 文で簡単に扱うことができます::" -#: ../../library/contextlib.rst:558 msgid "" "with ExitStack() as stack:\n" " files = [stack.enter_context(open(fname)) for fname in filenames]\n" @@ -833,12 +1069,18 @@ msgid "" " # the with statement, even if attempts to open files later\n" " # in the list raise an exception" msgstr "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # リストの後半にあるファイルを開く際に例外が発生しても、\n" +" # 開いたすべてのファイルは with 文の終わりで\n" +" # 自動的に閉じられます" -#: ../../library/contextlib.rst:564 msgid "" "The :meth:`~object.__enter__` method returns the :class:`ExitStack` " "instance, and performs no additional operations." msgstr "" +":meth:`~object.__enter__` メソッドは :class:`ExitStack` インスタンスを返すだ" +"けで、追加の処理は行いません。" #: ../../library/contextlib.rst:567 msgid "" @@ -886,12 +1128,15 @@ msgstr "" "す。アプリケーション独自のより高レベルなコンテキストマネージャーを作るための" "基板として使うのに適しています。" -#: ../../library/contextlib.rst:592 msgid "" "Enters a new context manager and adds its :meth:`~object.__exit__` method to " "the callback stack. The return value is the result of the context manager's " "own :meth:`~object.__enter__` method." msgstr "" +"新しいコンテキストマネージャに入り、その :meth:`~object.__exit__` メソッドを" +"コールバックスタックに追加します。\n" +"戻り値は、コンテキストマネージャ自身の :meth:`~object.__enter__` メソッドの結" +"果です。" #: ../../library/contextlib.rst:596 msgid "" @@ -909,37 +1154,45 @@ msgstr "" "*cm* がコンテキストマネージャでなかった場合、 :exc:`AttributeError` の代わり" "に :exc:`TypeError` 例外を送出します。" -#: ../../library/contextlib.rst:603 msgid "" "Added support for arbitrary descriptors :meth:`!__enter__` and :meth:`!" "__exit__`." msgstr "" +":meth:`!__enter__` と :meth:`!__exit__` に任意のデスクリプタを使用できるよう" +"になりました。" -#: ../../library/contextlib.rst:609 msgid "" "Adds a context manager's :meth:`~object.__exit__` method to the callback " "stack." msgstr "" +"コンテキストマネージャの :meth:`~object.__exit__` メソッドをコールバックス" +"タックに追加します。" -#: ../../library/contextlib.rst:611 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " "an :meth:`~object.__enter__` implementation with a context manager's own :" "meth:`~object.__exit__` method." msgstr "" +"``__enter__`` は呼び出され *ない* ため、このメソッドを使えば、:meth:`~object." +"__enter__` の実装の一部を、コンテキストマネージャ自身の :meth:`~object." +"__exit__` メソッドによる終了処理の対象にできます。" -#: ../../library/contextlib.rst:615 msgid "" "If passed an object that is not a context manager, this method assumes it is " "a callback with the same signature as a context manager's :meth:`~object." "__exit__` method and adds it directly to the callback stack." msgstr "" +"コンテキストマネージャでないオブジェクトが渡された場合、このメソッドは、その" +"オブジェクトをコンテキストマネージャの :meth:`~object.__exit__` メソッドと同" +"じシグネチャを持つコールバックと見なし、コールバックスタックに直接追加しま" +"す。" -#: ../../library/contextlib.rst:619 msgid "" "By returning true values, these callbacks can suppress exceptions the same " "way context manager :meth:`~object.__exit__` methods can." msgstr "" +"これらのコールバックは、真の値を返すことで、コンテキストマネージャの :meth:" +"`~object.__exit__` メソッドと同様に例外を抑制できます。" #: ../../library/contextlib.rst:622 msgid "" @@ -949,9 +1202,8 @@ msgstr "" "この関数はデコレータとしても使えるように、受け取ったオブジェクトをそのまま返" "します。" -#: ../../library/contextlib.rst:625 msgid "Added support for arbitrary descriptors :meth:`!__exit__`." -msgstr "" +msgstr ":meth:`!__exit__` に任意のデスクリプタを使用できるようになりました。" #: ../../library/contextlib.rst:630 msgid "" @@ -994,7 +1246,6 @@ msgid "" msgstr "" "例えば、複数のファイルを \"all or nothing\" に開く処理を次のように書けます::" -#: ../../library/contextlib.rst:649 msgid "" "with ExitStack() as stack:\n" " files = [stack.enter_context(open(fname)) for fname in filenames]\n" @@ -1005,6 +1256,15 @@ msgid "" " # they will remain open even after the with statement ends.\n" " # close_files() can then be invoked explicitly to close them all." msgstr "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # close メソッドを保持しますが、まだ呼び出しません。\n" +" close_files = stack.pop_all().close\n" +" # どれかのファイルを開くのに失敗すると、それまでに開いた\n" +" # すべてのファイルが自動的に閉じられます。\n" +" # すべてのファイルを\n" +" # 開けた場合は、with 文が終わった後も開いたままになります。\n" +" # その後、close_files() を明示的に呼んですべて閉じられます。" #: ../../library/contextlib.rst:660 msgid "" @@ -1026,17 +1286,19 @@ msgstr "" "managers>` です。スタック上で同期と非同期の両方のコンテキストマネージャの組み" "合わせをサポートします。また、後処理のためのコルーチンも持っています。" -#: ../../library/contextlib.rst:672 msgid "" "The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must " "be used instead." msgstr "" +":meth:`~ExitStack.close` メソッドは実装されていません。\n" +"代わりに :meth:`aclose` を使用する必要があります。" -#: ../../library/contextlib.rst:678 msgid "" "Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " "context manager." msgstr "" +":meth:`ExitStack.enter_context` に似ていますが、非同期コンテキストマネージャ" +"を受け取ります。" #: ../../library/contextlib.rst:681 msgid "" @@ -1046,35 +1308,35 @@ msgstr "" "*cm* が非同期コンテキストマネージャでなかった場合、 :exc:`AttributeError` の" "代わりに :exc:`TypeError` 例外を送出します。" -#: ../../library/contextlib.rst:685 msgid "" "Added support for arbitrary descriptors :meth:`!__aenter__` and :meth:`!" "__aexit__`." msgstr "" +":meth:`!__aenter__` と :meth:`!__aexit__` に任意のデスクリプタを使用できるよ" +"うになりました。" -#: ../../library/contextlib.rst:690 msgid "" "Similar to :meth:`ExitStack.push` but expects either an asynchronous context " "manager or a coroutine function." msgstr "" +":meth:`ExitStack.push` に似ていますが、非同期コンテキストマネージャまたはコ" +"ルーチン関数を受け取ります。" -#: ../../library/contextlib.rst:693 msgid "Added support for arbitrary descriptors :meth:`!__aexit__`." -msgstr "" +msgstr ":meth:`!__aexit__` に任意のデスクリプタを使用できるようになりました。" -#: ../../library/contextlib.rst:698 msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." msgstr "" +":meth:`ExitStack.callback` に似ていますが、コルーチン関数を受け取ります。" -#: ../../library/contextlib.rst:703 msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." msgstr "" +":meth:`ExitStack.close` に似ていますが、待機可能オブジェクトを適切に処理しま" +"す。" -#: ../../library/contextlib.rst:705 msgid "Continuing the example for :deco:`asynccontextmanager`::" -msgstr "" +msgstr ":deco:`asynccontextmanager` の例の続きです。 ::" -#: ../../library/contextlib.rst:707 msgid "" "async with AsyncExitStack() as stack:\n" " connections = [await stack.enter_async_context(get_connection())\n" @@ -1083,16 +1345,23 @@ msgid "" " # the async with statement, even if attempts to open a connection\n" " # later in the list raise an exception." msgstr "" +"async with AsyncExitStack() as stack:\n" +" connections = [await stack.enter_async_context(get_connection())\n" +" for i in range(5)]\n" +" # リストの後半で接続を開く際に例外が発生しても、\n" +" # 開いたすべての接続は async with 文の終わりで\n" +" # 自動的に解放されます。" #: ../../library/contextlib.rst:717 msgid "Examples and Recipes" msgstr "例とレシピ" -#: ../../library/contextlib.rst:719 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`!contextlib`." msgstr "" +"この節では、:mod:`!contextlib` の提供するツールを効果的に使うための例やレシピ" +"を紹介します。" #: ../../library/contextlib.rst:724 msgid "Supporting a variable number of context managers" @@ -1114,7 +1383,6 @@ msgstr "" "場合や、いくつかのコンテキストマネージャーがオプションとなる場合に、可変数個" "のコンテキストマネージャーが必要になります::" -#: ../../library/contextlib.rst:733 msgid "" "with ExitStack() as stack:\n" " for resource in resources:\n" @@ -1124,6 +1392,13 @@ msgid "" " stack.callback(release_special_resource, special)\n" " # Perform operations that use the acquired resources" msgstr "" +"with ExitStack() as stack:\n" +" for resource in resources:\n" +" stack.enter_context(resource)\n" +" if need_special_resource():\n" +" special = acquire_special_resource()\n" +" stack.callback(release_special_resource, special)\n" +" # 確保したリソースを使う操作を行います" #: ../../library/contextlib.rst:741 msgid "" @@ -1139,7 +1414,6 @@ msgstr "" msgid "Catching exceptions from ``__enter__`` methods" msgstr "``__enter__`` メソッドからの例外をキャッチする" -#: ../../library/contextlib.rst:749 msgid "" "It is occasionally desirable to catch exceptions from an :meth:`~object." "__enter__` method implementation, *without* inadvertently catching " @@ -1148,8 +1422,12 @@ msgid "" "context management protocol can be separated slightly in order to allow " "this::" msgstr "" +":keyword:`with` 文の本体やコンテキストマネージャの :meth:`~object.__exit__` " +"メソッドからの例外を誤って捕捉 *せずに*、:meth:`~object.__enter__` メソッドの" +"実装からの例外だけを捕捉したい場合があります。\n" +":class:`ExitStack` を使えば、コンテキスト管理プロトコルの手順を少し分離するこ" +"とで、これを実現できます。 ::" -#: ../../library/contextlib.rst:755 msgid "" "stack = ExitStack()\n" "try:\n" @@ -1160,6 +1438,14 @@ msgid "" " with stack:\n" " # Handle normal case" msgstr "" +"stack = ExitStack()\n" +"try:\n" +" x = stack.enter_context(cm)\n" +"except Exception:\n" +" # __enter__ の例外を処理します\n" +"else:\n" +" with stack:\n" +" # 通常の場合を処理します" #: ../../library/contextlib.rst:764 msgid "" @@ -1183,12 +1469,14 @@ msgstr "" msgid "Cleaning up in an ``__enter__`` implementation" msgstr "``__enter__`` 実装内のクリーンアップ" -#: ../../library/contextlib.rst:776 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" "meth:`~object.__enter__` implementation fail." msgstr "" +":meth:`ExitStack.push` のドキュメントで説明したとおり、このメソッドは :meth:" +"`~object.__enter__` の実装の後半で処理が失敗した場合に、すでに確保したリソー" +"スをクリーンアップするのに役立ちます。" #: ../../library/contextlib.rst:780 msgid "" @@ -1200,7 +1488,6 @@ msgstr "" "数を受け取るコンテキストマネージャーで、この方法を使ってコンテキストマネー" "ジャープロトコルを提供しています::" -#: ../../library/contextlib.rst:784 msgid "" "from contextlib import contextmanager, AbstractContextManager, ExitStack\n" "\n" @@ -1237,6 +1524,40 @@ msgid "" " # We don't need to duplicate any of our resource release logic\n" " self.release_resource()" msgstr "" +"from contextlib import contextmanager, AbstractContextManager, ExitStack\n" +"\n" +"class ResourceManager(AbstractContextManager):\n" +"\n" +" def __init__(self, acquire_resource, release_resource, " +"check_resource_ok=None):\n" +" self.acquire_resource = acquire_resource\n" +" self.release_resource = release_resource\n" +" if check_resource_ok is None:\n" +" def check_resource_ok(resource):\n" +" return True\n" +" self.check_resource_ok = check_resource_ok\n" +"\n" +" @contextmanager\n" +" def _cleanup_on_error(self):\n" +" with ExitStack() as stack:\n" +" stack.push(self)\n" +" yield\n" +" # 検証に成功し、例外は発生しませんでした。\n" +" # したがって、リソースを保持し、\n" +" # 呼び出し側に返します。\n" +" stack.pop_all()\n" +"\n" +" def __enter__(self):\n" +" resource = self.acquire_resource()\n" +" with self._cleanup_on_error():\n" +" if not self.check_resource_ok(resource):\n" +" msg = \"Failed validation for {!r}\"\n" +" raise RuntimeError(msg.format(resource))\n" +" return resource\n" +"\n" +" def __exit__(self, *exc_details):\n" +" # リソースの解放処理を重複して記述する必要はありません\n" +" self.release_resource()" #: ../../library/contextlib.rst:820 msgid "Replacing any use of ``try-finally`` and flag variables" @@ -1254,7 +1575,6 @@ msgstr "" "に ``except`` 句を使うだけでは処理できない) ケースでは次のようなコードになり" "ます::" -#: ../../library/contextlib.rst:827 msgid "" "cleanup_needed = True\n" "try:\n" @@ -1265,6 +1585,14 @@ msgid "" " if cleanup_needed:\n" " cleanup_resources()" msgstr "" +"cleanup_needed = True\n" +"try:\n" +" result = perform_operation()\n" +" if result:\n" +" cleanup_needed = False\n" +"finally:\n" +" if cleanup_needed:\n" +" cleanup_resources()" #: ../../library/contextlib.rst:836 msgid "" @@ -1284,7 +1612,6 @@ msgstr "" ":class:`ExitStack` を使えば、代わりに ``with`` 文の終わりに実行されるコール" "バックを登録し、後でそのコールバックをスキップするかどうかを決定できます::" -#: ../../library/contextlib.rst:844 msgid "" "from contextlib import ExitStack\n" "\n" @@ -1294,12 +1621,20 @@ msgid "" " if result:\n" " stack.pop_all()" msgstr "" +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" stack.callback(cleanup_resources)\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" -#: ../../library/contextlib.rst:852 msgid "" "This allows the intended cleanup behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" +"これにより、別途フラグ変数を用意せずに、意図したクリーンアップの動作をあらか" +"じめ明示できます。" #: ../../library/contextlib.rst:855 msgid "" @@ -1309,7 +1644,6 @@ msgstr "" "もしあるアプリケーションがこのパターンを多用するのであれば、小さいヘルパーク" "ラスを導入してよりシンプルにすることができます::" -#: ../../library/contextlib.rst:858 msgid "" "from contextlib import ExitStack\n" "\n" @@ -1326,6 +1660,20 @@ msgid "" " if result:\n" " cb.cancel()" msgstr "" +"from contextlib import ExitStack\n" +"\n" +"class Callback(ExitStack):\n" +" def __init__(self, callback, /, *args, **kwds):\n" +" super().__init__()\n" +" self.callback(callback, *args, **kwds)\n" +"\n" +" def cancel(self):\n" +" self.pop_all()\n" +"\n" +"with Callback(cleanup_resources) as cb:\n" +" result = perform_operation()\n" +" if result:\n" +" cb.cancel()" #: ../../library/contextlib.rst:873 msgid "" @@ -1337,7 +1685,6 @@ msgstr "" "`ExitStack.callback` のデコレーター形式を利用してリソース開放処理を宣言するこ" "とができます::" -#: ../../library/contextlib.rst:878 msgid "" "from contextlib import ExitStack\n" "\n" @@ -1349,6 +1696,15 @@ msgid "" " if result:\n" " stack.pop_all()" msgstr "" +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" @stack.callback\n" +" def cleanup_resources():\n" +" ...\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" #: ../../library/contextlib.rst:888 msgid "" @@ -1385,7 +1741,6 @@ msgstr "" "ネージャーを別々に書く代わりに、 :class:`ContextDecorator` を継承すると1つの" "定義で両方の機能を提供できます::" -#: ../../library/contextlib.rst:905 msgid "" "from contextlib import ContextDecorator\n" "import logging\n" @@ -1402,37 +1757,59 @@ msgid "" " def __exit__(self, exc_type, exc, exc_tb):\n" " logging.info('Exiting: %s', self.name)" msgstr "" +"from contextlib import ContextDecorator\n" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class track_entry_and_exit(ContextDecorator):\n" +" def __init__(self, name):\n" +" self.name = name\n" +"\n" +" def __enter__(self):\n" +" logging.info('Entering: %s', self.name)\n" +"\n" +" def __exit__(self, exc_type, exc, exc_tb):\n" +" logging.info('Exiting: %s', self.name)" #: ../../library/contextlib.rst:920 msgid "Instances of this class can be used as both a context manager::" msgstr "このクラスのインスタンスはコンテキストマネージャーとしても利用でき::" -#: ../../library/contextlib.rst:922 msgid "" "with track_entry_and_exit('widget loader'):\n" " print('Some time consuming activity goes here')\n" " load_widget()" msgstr "" +"with track_entry_and_exit('widget loader'):\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" #: ../../library/contextlib.rst:926 msgid "And also as a function decorator::" msgstr "また関数デコレーターとしても利用できます::" -#: ../../library/contextlib.rst:928 msgid "" "@track_entry_and_exit('widget loader')\n" "def activity():\n" " print('Some time consuming activity goes here')\n" " load_widget()" msgstr "" +"@track_entry_and_exit('widget loader')\n" +"def activity():\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" -#: ../../library/contextlib.rst:933 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" "`~object.__enter__`. If that value is needed, then it is still necessary to " "use an explicit ``with`` statement." msgstr "" +"コンテキストマネージャを関数デコレータとして使う場合には、もう 1 つ制限があり" +"ます。\n" +":meth:`~object.__enter__` の戻り値にアクセスする方法がありません。\n" +"その値が必要な場合は、明示的な ``with`` 文を使う必要があります。" #: ../../library/contextlib.rst:940 msgid ":pep:`343` - The \"with\" statement" @@ -1536,7 +1913,6 @@ msgstr "" "また :func:`suppress`, :func:`redirect_stdout`, そして :func:`chdir` もリエン" "トラントです。以下はリエントラントな利用法の非常に単純な例です::" -#: ../../library/contextlib.rst:1002 msgid "" ">>> from contextlib import redirect_stdout\n" ">>> from io import StringIO\n" @@ -1553,6 +1929,20 @@ msgid "" "This is written to the stream rather than stdout\n" "This is also written to the stream" msgstr "" +">>> from contextlib import redirect_stdout\n" +">>> from io import StringIO\n" +">>> stream = StringIO()\n" +">>> write_to_stream = redirect_stdout(stream)\n" +">>> with write_to_stream:\n" +"... print(\"This is written to the stream rather than stdout\")\n" +"... with write_to_stream:\n" +"... print(\"This is also written to the stream\")\n" +"...\n" +">>> print(\"This is written directly to stdout\")\n" +"This is written directly to stdout\n" +">>> print(stream.getvalue())\n" +"This is written to the stream rather than stdout\n" +"This is also written to the stream" #: ../../library/contextlib.rst:1017 msgid "" @@ -1617,7 +2007,6 @@ msgstr "" "バックを呼び出します。\n" "コールバックをどこで登録したかは関係ありません。 ::" -#: ../../library/contextlib.rst:1048 msgid "" ">>> from contextlib import ExitStack\n" ">>> stack = ExitStack()\n" @@ -1645,6 +2034,31 @@ msgid "" "Callback: from outer context\n" "Leaving outer context" msgstr "" +">>> from contextlib import ExitStack\n" +">>> stack = ExitStack()\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from first context\")\n" +"... print(\"Leaving first context\")\n" +"...\n" +"Leaving first context\n" +"Callback: from first context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from second context\")\n" +"... print(\"Leaving second context\")\n" +"...\n" +"Leaving second context\n" +"Callback: from second context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from outer context\")\n" +"... with stack:\n" +"... stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Callback: from outer context\n" +"Leaving outer context" #: ../../library/contextlib.rst:1074 msgid "" @@ -1665,7 +2079,6 @@ msgstr "" "ひとつの :class:`ExitStack` インスタンスを再利用する代わりに複数のインスタン" "スを使うことにより、この問題は回避することができます::" -#: ../../library/contextlib.rst:1082 msgid "" ">>> from contextlib import ExitStack\n" ">>> with ExitStack() as outer_stack:\n" @@ -1680,3 +2093,15 @@ msgid "" "Leaving outer context\n" "Callback: from outer context" msgstr "" +">>> from contextlib import ExitStack\n" +">>> with ExitStack() as outer_stack:\n" +"... outer_stack.callback(print, \"Callback: from outer context\")\n" +"... with ExitStack() as inner_stack:\n" +"... inner_stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Leaving outer context\n" +"Callback: from outer context" diff --git a/library/contextvars.po b/library/contextvars.po index d7f58a0f9..c9f7ed118 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -42,12 +42,14 @@ msgstr "" "`~contextvars.copy_context` 関数と :class:`~contextvars.Context` クラスを使う" "べきです。" -#: ../../library/contextvars.rst:15 msgid "" "Context managers that have state should use Context Variables instead of :" "func:`threading.local` to prevent their state from bleeding to other code " "unexpectedly, when used in concurrent code." msgstr "" +"状態を持つコンテキストマネージャは、並行コードで使用した際に、その状態が予期" +"せずほかのコードに漏れるのを防ぐため、:func:`threading.local` ではなくコンテ" +"キスト変数を使うべきです。" #: ../../library/contextvars.rst:19 msgid "See also :pep:`567` for additional details." @@ -63,9 +65,8 @@ msgstr "" "このクラスは新しいコンテキスト変数を宣言するのに使われます。例えば、次の通り" "です:" -#: ../../library/contextvars.rst:31 msgid "var: ContextVar[int] = ContextVar('var', default=42)" -msgstr "" +msgstr "var: ContextVar[int] = ContextVar('var', default=42)" #: ../../library/contextvars.rst:33 msgid "" @@ -93,11 +94,12 @@ msgstr "" "テキスト変数への強参照を持っており、コンテキスト変数がガーベジコレクトされる" "のを防ぎます。" -#: ../../library/contextvars.rst:45 msgid "" ":class:`!ContextVar`\\s are :ref:`generic ` over the type of their " "contained value." msgstr "" +":class:`!ContextVar` は、格納する値の型について :ref:`ジェネリック " +"` です。" #: ../../library/contextvars.rst:50 msgid "The name of the variable. This is a read-only property." @@ -150,13 +152,13 @@ msgstr "" ":class:`~contextvars.Token` オブジェクトを返します。このオブジェクトを :meth:" "`ContextVar.reset` メソッドに渡すことで、以前の値に戻すことができます。" -#: ../../library/contextvars.rst:81 msgid "" "For convenience, the token object can be used as a context manager to avoid " "calling :meth:`ContextVar.reset` manually::" msgstr "" +"便利な使い方として、トークンオブジェクトをコンテキストマネージャとして使え" +"ば、:meth:`ContextVar.reset` を手動で呼び出す必要がなくなります。 ::" -#: ../../library/contextvars.rst:84 msgid "" "var = ContextVar('var', default='default value')\n" "\n" @@ -165,12 +167,16 @@ msgid "" "\n" "assert var.get() == 'default value'" msgstr "" +"var = ContextVar('var', default='default value')\n" +"\n" +"with var.set('new value'):\n" +" assert var.get() == 'new value'\n" +"\n" +"assert var.get() == 'default value'" -#: ../../library/contextvars.rst:91 msgid "It is a shorthand for::" -msgstr "" +msgstr "これは次のコードの短縮形です。 ::" -#: ../../library/contextvars.rst:93 msgid "" "var = ContextVar('var', default='default value')\n" "\n" @@ -182,10 +188,18 @@ msgid "" "\n" "assert var.get() == 'default value'" msgstr "" +"var = ContextVar('var', default='default value')\n" +"\n" +"token = var.set('new value')\n" +"try:\n" +" assert var.get() == 'new value'\n" +"finally:\n" +" var.reset(token)\n" +"\n" +"assert var.get() == 'default value'" -#: ../../library/contextvars.rst:105 msgid "Added support for using tokens as context managers." -msgstr "" +msgstr "トークンをコンテキストマネージャとして使用できるようになりました。" #: ../../library/contextvars.rst:109 msgid "" @@ -199,7 +213,6 @@ msgstr "" msgid "For example::" msgstr "例えば::" -#: ../../library/contextvars.rst:114 msgid "" "var = ContextVar('var')\n" "\n" @@ -210,34 +223,47 @@ msgid "" "# After the reset call the var has no value again, so\n" "# var.get() would raise a LookupError." msgstr "" +"var = ContextVar('var')\n" +"\n" +"token = var.set('new value')\n" +"# 'var' を使うコード。\n" +"# var.get() は 'new value' を返します。\n" +"var.reset(token)\n" +"\n" +"# reset の呼び出し後は var の値が再びなくなるため、\n" +"# var.get() を呼ぶと LookupError が送出されます。" -#: ../../library/contextvars.rst:123 msgid "The same *token* cannot be used twice." -msgstr "" +msgstr "同じ *token* を 2 回使うことはできません。" -#: ../../library/contextvars.rst:128 msgid "" "*Token* objects are returned by the :meth:`ContextVar.set` method. They can " "be passed to the :meth:`ContextVar.reset` method to revert the value of the " "variable to what it was before the corresponding *set*. A single token " "cannot reset a context variable more than once." msgstr "" +"*Token* オブジェクトは :meth:`ContextVar.set` メソッドから返されます。\n" +"これを :meth:`ContextVar.reset` メソッドに渡すと、対応する *set* の呼び出し前" +"の値に変数を戻せます。\n" +"1 つのトークンでコンテキスト変数をリセットできるのは 1 回だけです。" -#: ../../library/contextvars.rst:133 msgid "" "Tokens support the :ref:`context manager protocol ` to " "automatically reset context variables. See :meth:`ContextVar.set`." msgstr "" +"トークンは :ref:`コンテキストマネージャプロトコル ` をサ" +"ポートし、コンテキスト変数を自動的にリセットできます。\n" +":meth:`ContextVar.set` を参照してください。" -#: ../../library/contextvars.rst:136 msgid "" "Tokens are :ref:`generic ` over the same type as the :class:" "`ContextVar` which created them." msgstr "" +"トークンは、それを生成した :class:`ContextVar` と同じ型について :ref:`ジェネ" +"リック ` です。" -#: ../../library/contextvars.rst:141 msgid "Added support for usage as a context manager." -msgstr "" +msgstr "コンテキストマネージャとして使用できるようになりました。" #: ../../library/contextvars.rst:145 msgid "" @@ -277,11 +303,12 @@ msgstr "" "次のスニペットは、現在のコンテキストのコピーを取得し、コンテキストに設定され" "ているすべての変数とその値を表示します::" -#: ../../library/contextvars.rst:170 msgid "" "ctx: Context = copy_context()\n" "print(list(ctx.items()))" msgstr "" +"ctx: Context = copy_context()\n" +"print(list(ctx.items()))" #: ../../library/contextvars.rst:173 msgid "" @@ -303,47 +330,59 @@ msgstr "" "``Context()`` は、値を持たない空のコンテキストを生成します。現在のコンテキス" "トのコピーを得るには、:func:`~contextvars.copy_context` 関数を利用します。" -#: ../../library/contextvars.rst:186 msgid "" "Each thread has its own effective stack of :class:`!Context` objects. The :" "term:`current context` is the :class:`!Context` object at the top of the " "current thread's stack. All :class:`!Context` objects in the stacks are " "considered to be *entered*." msgstr "" +"各スレッドには、実質的にそれぞれ独立した :class:`!Context` オブジェクトのス" +"タックがあります。\n" +":term:`current context` は、現在のスレッドのスタックの最上部にある :class:`!" +"Context` オブジェクトです。\n" +"スタック内のすべての :class:`!Context` オブジェクトは、*入っている* 状態と見" +"なされます。" -#: ../../library/contextvars.rst:191 msgid "" "*Entering* a context, which can be done by calling its :meth:`~Context.run` " "method, makes the context the current context by pushing it onto the top of " "the current thread's context stack." msgstr "" +"コンテキストに *入る* には、その :meth:`~Context.run` メソッドを呼び出しま" +"す。\n" +"これにより、そのコンテキストが現在のスレッドのコンテキストスタックの最上部に" +"積まれ、現在のコンテキストになります。" -#: ../../library/contextvars.rst:195 msgid "" "*Exiting* from the current context, which can be done by returning from the " "callback passed to the :meth:`~Context.run` method, restores the current " "context to what it was before the context was entered by popping the context " "off the top of the context stack." msgstr "" +"現在のコンテキストから *出る* には、:meth:`~Context.run` メソッドに渡したコー" +"ルバックから戻ります。\n" +"これにより、そのコンテキストがコンテキストスタックの最上部から取り除かれ、現" +"在のコンテキストが、そのコンテキストに入る前のものに戻ります。" -#: ../../library/contextvars.rst:200 msgid "" "Since each thread has its own context stack, :class:`ContextVar` objects " "behave in a similar fashion to :func:`threading.local` when values are " "assigned in different threads." msgstr "" +"各スレッドが独自のコンテキストスタックを持つため、異なるスレッドで値を代入し" +"た場合、:class:`ContextVar` オブジェクトは :func:`threading.local` と同様に振" +"る舞います。" -#: ../../library/contextvars.rst:204 msgid "" "Attempting to enter an already entered context, including contexts entered " "in other threads, raises a :exc:`RuntimeError`." msgstr "" +"ほかのスレッドで入っているコンテキストも含め、すでに入っているコンテキストに" +"入ろうとすると、:exc:`RuntimeError` が送出されます。" -#: ../../library/contextvars.rst:207 msgid "After exiting a context, it can later be re-entered (from any thread)." -msgstr "" +msgstr "コンテキストから出た後は、どのスレッドからでも再び入ることができます。" -#: ../../library/contextvars.rst:209 msgid "" "Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " "method are recorded in the current context. The :meth:`ContextVar.get` " @@ -352,24 +391,32 @@ msgid "" "context was entered (if needed, the values can be restored by re-entering " "the context)." msgstr "" +":meth:`ContextVar.set` メソッドによる :class:`ContextVar` の値の変更は、現在" +"のコンテキストに記録されます。\n" +":meth:`ContextVar.get` メソッドは、現在のコンテキストに対応する値を返しま" +"す。\n" +"コンテキストから出ると、そのコンテキストに入っていた間に行ったコンテキスト変" +"数の変更は、実質的に元に戻ります (必要であれば、そのコンテキストに再び入るこ" +"とで変更後の値を復元できます)。" #: ../../library/contextvars.rst:216 msgid "Context implements the :class:`collections.abc.Mapping` interface." msgstr "" "Context は、 :class:`collections.abc.Mapping` インターフェースを実装します。" -#: ../../library/contextvars.rst:220 msgid "" "Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " "Context. Returns *callable*'s return value, or propagates an exception if " "one occurred." msgstr "" +"このコンテキストに入り、``callable(*args, **kwargs)`` を実行してから、このコ" +"ンテキストを出ます。\n" +"*callable* の戻り値を返すか、例外が発生した場合はそれを伝播させます。" #: ../../library/contextvars.rst:224 msgid "Example:" msgstr "例:" -#: ../../library/contextvars.rst:226 msgid "" "import contextvars\n" "\n" @@ -402,6 +449,36 @@ msgid "" "# However, outside of 'ctx', 'var' is still set to 'spam':\n" "print(var.get()) # 'spam'" msgstr "" +"import contextvars\n" +"\n" +"var = contextvars.ContextVar('var')\n" +"var.set('spam')\n" +"print(var.get()) # 'spam'\n" +"\n" +"ctx = contextvars.copy_context()\n" +"\n" +"def main():\n" +" # 'copy_context()' と 'ctx.run(main)' を呼ぶ前に\n" +" # 'var' を 'spam' に設定したため、次のようになります:\n" +" print(var.get()) # 'spam'\n" +" print(ctx[var]) # 'spam'\n" +"\n" +" var.set('ham')\n" +"\n" +" # 'var' を 'ham' に設定した後は:\n" +" print(var.get()) # 'ham'\n" +" print(ctx[var]) # 'ham'\n" +"\n" +"# 'main' 関数が 'var' に行う変更はすべて\n" +"# 'ctx' 内にとどまります。\n" +"ctx.run(main)\n" +"\n" +"# 'main()' 関数は 'ctx' コンテキスト内で実行されたので、\n" +"# 'var' の変更はその中にとどまります:\n" +"print(ctx[var]) # 'ham'\n" +"\n" +"# 一方、'ctx' の外では 'var' は依然として 'spam' に設定されています:\n" +"print(var.get()) # 'spam'" #: ../../library/contextvars.rst:272 msgid "Return a shallow copy of the context object." @@ -460,18 +537,18 @@ msgstr "" msgid "asyncio support" msgstr "asyncio サポート" -#: ../../library/contextvars.rst:318 msgid "" "Context variables are natively supported in :mod:`asyncio` and are ready to " "be used without any extra configuration. For example, here is a simple echo " "server, that uses a context variable to make the address of a remote client " "available in the Task that handles that client::" msgstr "" -"コンテキスト変数は、追加の設定なしに :mod:`asyncio` をサポートします。例え" -"ば、次の単純なechoサーバーは、クライアントを扱う Task の中でリモートクライア" -"ントのアドレスが利用できるように、コンテキスト変数を利用します::" +"コンテキスト変数は :mod:`asyncio` に標準でサポートされており、追加の設定なし" +"に使用できます。\n" +"例えば、以下はコンテキスト変数を使った単純な echo サーバーです。\n" +"リモートクライアントのアドレスを、そのクライアントを扱う Task 内で利用できる" +"ようにしています。 ::" -#: ../../library/contextvars.rst:324 msgid "" "import asyncio\n" "import contextvars\n" @@ -516,3 +593,45 @@ msgid "" "# telnet 127.0.0.1 8081\n" "# curl 127.0.0.1:8081" msgstr "" +"import asyncio\n" +"import contextvars\n" +"\n" +"client_addr_var = contextvars.ContextVar('client_addr')\n" +"\n" +"def render_goodbye():\n" +" # 現在扱っているクライアントのアドレスを、この関数に\n" +" # 明示的に渡さなくても参照できます。\n" +"\n" +" client_addr = client_addr_var.get()\n" +" return f'Good bye, client @ {client_addr}\\r\\n'.encode()\n" +"\n" +"async def handle_request(reader, writer):\n" +" addr = writer.transport.get_extra_info('socket').getpeername()\n" +" client_addr_var.set(addr)\n" +"\n" +" # ここから呼び出すどのコードでも、'client_addr_var.get()' を\n" +" # 呼んでクライアントのアドレスを取得できます。\n" +"\n" +" while True:\n" +" line = await reader.readline()\n" +" print(line)\n" +" if not line.strip():\n" +" break\n" +"\n" +" writer.write(b'HTTP/1.1 200 OK\\r\\n') # ステータス行\n" +" writer.write(b'\\r\\n') # ヘッダー\n" +" writer.write(render_goodbye()) # 本文\n" +" writer.close()\n" +"\n" +"async def main():\n" +" srv = await asyncio.start_server(\n" +" handle_request, '127.0.0.1', 8081)\n" +"\n" +" async with srv:\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# テストには telnet や curl を使えます:\n" +"# telnet 127.0.0.1 8081\n" +"# curl 127.0.0.1:8081" diff --git a/library/copy.po b/library/copy.po index 63608c834..ef667feb7 100644 --- a/library/copy.po +++ b/library/copy.po @@ -58,11 +58,12 @@ msgstr "*obj* の浅い (shallow) コピーを返します。" msgid "Return a deep copy of *obj*." msgstr "*obj* の深い (deep) コピーを返します。" -#: ../../library/copy.rst:32 msgid "" "Creates a new object of the same type as *obj*, replacing fields with values " "from *changes*." msgstr "" +"*obj* と同じ型の新しいオブジェクトを作成し、フィールドを *changes* の値で置き" +"換えます。" #: ../../library/copy.rst:40 msgid "Raised for module specific errors." @@ -102,13 +103,12 @@ msgstr "" "深いコピー操作には、しばしば浅いコピー操作の時には存在しない 2 つの問題がつい" "てまわります:" -#: ../../library/copy.rst:56 msgid "" "Recursive objects (compound objects that, directly or indirectly, contain a " "reference to themselves) may cause a recursive loop." msgstr "" -"再帰的なオブジェクト (直接、間接に関わらず、自分自身に対する参照を持つ複合オ" -"ブジェクト) は再帰ループを引き起こします。" +"再帰的なオブジェクト (直接または間接に自分自身への参照を含む複合オブジェク" +"ト) は、再帰ループを引き起こすことがあります。" #: ../../library/copy.rst:59 msgid "" @@ -153,7 +153,6 @@ msgstr "" "または深く)「コピー」します。これは :mod:`pickle` モジュールでの扱われかたと" "同じです。" -#: ../../library/copy.rst:75 msgid "" "Shallow copies of many collections can be made using the corresponding :meth:" "`!copy` method (such as :meth:`list.copy`, :meth:`dict.copy` or :meth:`set." @@ -163,28 +162,41 @@ msgid "" "subclass, whereas :func:`copy.copy` normally returns an instance of the same " "type." msgstr "" +"多くのコレクションでは、対応する :meth:`!copy` メソッド (:meth:`list.copy`、:" +"meth:`dict.copy`、:meth:`set.copy` など) で浅いコピーを作成できます。\n" +"また、リストやバイト配列などのシーケンスでは、全体のスライス " +"(``sequence[:]``) を作成することでも浅いコピーを作れます。\n" +"ただし、これらのメソッドやスライス操作は、サブクラスのインスタンスをコピーす" +"るときに基底型のインスタンスを作成することがありますが、:func:`copy.copy` は" +"通常、同じ型のインスタンスを返します。" -#: ../../library/copy.rst:85 msgid "" "Classes can use the same interfaces to control copying that they use to " "control pickling. See the description of module :mod:`pickle` for " "information on these methods. In fact, the :mod:`!copy` module uses the " "registered pickle functions from the :mod:`copyreg` module." msgstr "" +"クラスは、pickle 化の制御に使うのと同じインターフェースでコピーを制御できま" +"す。\n" +"これらのメソッドについては、:mod:`pickle` モジュールの説明を参照してくださ" +"い。\n" +"実際、:mod:`!copy` モジュールは :mod:`copyreg` モジュールに登録された pickle " +"関数を使用します。" -#: ../../library/copy.rst:96 msgid "" "In order for a class to define its own copy implementation, it can define " "special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`." msgstr "" +"クラス独自のコピー処理を実装するには、特殊メソッド :meth:`~object.__copy__` " +"と :meth:`~object.__deepcopy__` を定義できます。" -#: ../../library/copy.rst:102 msgid "" "Called to implement the shallow copy operation; no additional arguments are " "passed." msgstr "" +"浅いコピー操作を実装するために呼び出されます。\n" +"追加の引数は渡されません。" -#: ../../library/copy.rst:108 msgid "" "Called to implement the deep copy operation; it is passed one argument, the " "*memo* dictionary. If the ``__deepcopy__`` implementation needs to make a " @@ -192,20 +204,30 @@ msgid "" "with the component as first argument and the *memo* dictionary as second " "argument. The *memo* dictionary should be treated as an opaque object." msgstr "" +"深いコピー操作を実装するために呼び出されます。\n" +"引数として *memo* 辞書が 1 つ渡されます。\n" +"``__deepcopy__`` の実装内で構成要素の深いコピーが必要な場合は、第 1 引数にそ" +"の構成要素、第 2 引数に *memo* 辞書を渡して :func:`~copy.deepcopy` 関数を呼び" +"出す必要があります。\n" +"*memo* 辞書は内部構造に立ち入らない不透明なオブジェクトとして扱ってください。" -#: ../../library/copy.rst:118 msgid "" "Function :func:`!copy.replace` is more limited than :func:`~copy.copy` and :" "func:`~copy.deepcopy`, and only supports named tuples created by :func:" "`~collections.namedtuple`, :mod:`dataclasses`, and other classes which " "define method :meth:`~object.__replace__`." msgstr "" +":func:`!copy.replace` 関数は :func:`~copy.copy` や :func:`~copy.deepcopy` よ" +"り制限が多く、:func:`~collections.namedtuple` で作成した名前付きタプル、:mod:" +"`dataclasses`、および :meth:`~object.__replace__` メソッドを定義するクラスの" +"みをサポートします。" -#: ../../library/copy.rst:126 msgid "" "This method should create a new object of the same type, replacing fields " "with values from *changes*." msgstr "" +"このメソッドは、フィールドを *changes* の値で置き換えた、同じ型の新しいオブ" +"ジェクトを作成する必要があります。" #: ../../library/copy.rst:134 msgid "Module :mod:`pickle`" @@ -235,6 +257,5 @@ msgstr "__copy__() (コピープロトコル)" msgid "__deepcopy__() (copy protocol)" msgstr "__deepcopy__() (コピープロトコル)" -#: ../../library/copy.rst:115 msgid "__replace__() (replace protocol)" -msgstr "" +msgstr "__replace__() (置換プロトコル)" diff --git a/library/copyreg.po b/library/copyreg.po index a4c378bc1..e12c1d176 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -30,7 +30,6 @@ msgstr ":mod:`!copyreg` --- :mod:`!pickle` サポート関数を登録する" msgid "**Source code:** :source:`Lib/copyreg.py`" msgstr "**ソースコード:** :source:`Lib/copyreg.py`" -#: ../../library/copyreg.rst:15 msgid "" "The :mod:`!copyreg` module offers a way to define functions used while " "pickling specific objects. The :mod:`pickle` and :mod:`copy` modules use " @@ -38,6 +37,14 @@ msgid "" "configuration information about object constructors which are not classes. " "Such constructors may be factory functions or class instances." msgstr "" +":mod:`!copyreg` モジュールは、特定のオブジェクトを pickle 化する際に使う関数" +"を定義する手段を提供します。\n" +":mod:`pickle` と :mod:`copy` モジュールは、そのオブジェクトを pickle 化または" +"コピーするときに、これらの関数を使用します。\n" +"このモジュールは、クラスではないオブジェクトコンストラクタに関する設定情報を" +"提供します。\n" +"このようなコンストラクタには、ファクトリ関数やクラスインスタンスなどがありま" +"す。" #: ../../library/copyreg.rst:24 msgid "" diff --git a/library/crypt.po b/library/crypt.po index 22f33479e..ab0715a40 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/crypt.rst:2 msgid ":mod:`!crypt` --- Function to check Unix passwords" -msgstr "" +msgstr ":mod:`!crypt` --- Unix パスワードを確認する関数" #: ../../library/crypt.rst:10 msgid "" @@ -36,16 +35,21 @@ msgstr "" "ルは Python 3.11 で非推奨となったあと、:ref:`Python 3.13 で削除` されました。削除の決定は :pep:`594` でなされました。" -#: ../../library/crypt.rst:14 msgid "" "Applications can use the :mod:`hashlib` module from the standard library. " "Other possible replacements are third-party libraries from PyPI: :pypi:" "`legacycrypt`, :pypi:`bcrypt`, or :pypi:`argon2-cffi`. These are not " "supported or maintained by the Python core team." msgstr "" +"アプリケーションでは、標準ライブラリの :mod:`hashlib` モジュールを使用できま" +"す。\n" +"ほかの代替候補として、PyPI のサードパーティー製ライブラリ :pypi:" +"`legacycrypt`、:pypi:`bcrypt`、:pypi:`argon2-cffi` があります。\n" +"これらは Python コアチームによるサポートや保守の対象ではありません。" -#: ../../library/crypt.rst:19 msgid "" "The last version of Python that provided the :mod:`!crypt` module was " "`Python 3.12 `_." msgstr "" +":mod:`!crypt` モジュールを提供していた最後の Python バージョンは `Python " +"3.12 `_ です。" diff --git a/library/crypto.po b/library/crypto.po index 3b29177c7..d7d68c774 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -26,15 +26,15 @@ msgstr "" msgid "Cryptographic Services" msgstr "暗号関連のサービス" -#: ../../library/crypto.rst:9 msgid "" "The modules described in this chapter implement various algorithms of a " "cryptographic nature. They are available at the discretion of the " "installation. Here's an overview:" msgstr "" -"この章で記述されているモジュールでは、暗号の本質に関わる様々なアルゴリズムを" -"実装しています。 これらは必要に応じてインストールすることで使用できます。概要" -"を以下に示します:" +"この章で説明するモジュールは、暗号に関するさまざまなアルゴリズムを実装してい" +"ます。\n" +"利用できるかどうかはインストール環境によります。\n" +"概要を以下に示します:" #: ../../library/crypto.rst:7 msgid "cryptography" diff --git a/library/csv.po b/library/csv.po index 45c1bf843..e965a98db 100644 --- a/library/csv.po +++ b/library/csv.po @@ -23,9 +23,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/csv.rst:2 msgid ":mod:`!csv` --- CSV file reading and writing" -msgstr "" +msgstr ":mod:`!csv` --- CSV ファイルの読み書き" #: ../../library/csv.rst:7 msgid "**Source code:** :source:`Lib/csv.py`" @@ -56,7 +55,6 @@ msgstr "" "作し、データの読み書きにおける細々としたことをプログラマ から隠蔽するような単" "一のモジュールを書くことは可能です。" -#: ../../library/csv.rst:26 msgid "" "The :mod:`!csv` module implements classes to read and write tabular data in " "CSV format. It allows programmers to say, \"write this data in the format " @@ -65,13 +63,23 @@ msgid "" "Excel. Programmers can also describe the CSV formats understood by other " "applications or define their own special-purpose CSV formats." msgstr "" +":mod:`!csv` モジュールは、表形式のデータを CSV 形式で読み書きするクラスを実装" +"しています。\n" +"Excel が使う CSV 形式の詳細を知らなくても、「このデータを Excel に適した形式" +"で書き込む」ことや「Excel が生成したこのファイルからデータを読み込む」ことが" +"できます。\n" +"また、ほかのアプリケーションが解釈する CSV 形式を記述したり、特定の用途向けに" +"独自の CSV 形式を定義したりすることもできます。" -#: ../../library/csv.rst:33 msgid "" "The :mod:`!csv` module's :class:`reader` and :class:`writer` objects read " "and write sequences. Programmers can also read and write data in dictionary " "form using the :class:`DictReader` and :class:`DictWriter` classes." msgstr "" +":mod:`!csv` モジュールの :class:`reader` オブジェクトと :class:`writer` オブ" +"ジェクトは、シーケンスを読み書きします。\n" +":class:`DictReader` クラスと :class:`DictWriter` クラスを使えば、辞書形式で" +"データを読み書きすることもできます。" #: ../../library/csv.rst:39 msgid ":pep:`305` - CSV File API" @@ -87,11 +95,9 @@ msgstr "" msgid "Module contents" msgstr "モジュールの内容" -#: ../../library/csv.rst:48 msgid "The :mod:`!csv` module defines the following functions:" -msgstr "" +msgstr ":mod:`!csv` モジュールは以下の関数を定義しています。" -#: ../../library/csv.rst:56 msgid "" "Return a :ref:`reader object ` that will process lines from " "the given *csvfile*. A csvfile must be an iterable of strings, each in the " @@ -105,6 +111,21 @@ msgid "" "parameters in the current dialect. For full details about the dialect and " "formatting parameters, see section :ref:`csv-fmt-params`." msgstr "" +"指定された *csvfile* の行を処理する :ref:`reader オブジェクト ` を返します。\n" +"``csvfile`` は文字列のイテラブルでなければならず、各文字列は reader に定義さ" +"れた CSV 形式である必要があります。\n" +"``csvfile`` には通常、ファイルライクオブジェクトやリストを使います。\n" +"*csvfile* がファイルオブジェクトの場合は、``newline=''`` を指定して開く必要が" +"あります [1]_。\n" +"省略可能な *dialect* 引数では、特定の CSV 表現形式に固有のパラメータ群を指定" +"できます。\n" +":class:`Dialect` クラスのサブクラスのインスタンスか、:func:`list_dialects` 関" +"数が返す文字列のいずれかを指定できます。\n" +"その他の省略可能なキーワード引数 *fmtparams* を指定すると、現在の表現形式の書" +"式パラメータを個別に上書きできます。\n" +"表現形式と書式パラメータの詳細については、:ref:`csv-fmt-params` 節を参照して" +"ください。" #: ../../library/csv.rst:70 msgid "" @@ -123,7 +144,6 @@ msgstr "" msgid "A short usage example::" msgstr "短い利用例::" -#: ../../library/csv.rst:76 msgid "" ">>> import csv\n" ">>> with open('eggs.csv', newline='') as csvfile:\n" @@ -133,16 +153,23 @@ msgid "" "Spam, Spam, Spam, Spam, Spam, Baked Beans\n" "Spam, Lovely Spam, Wonderful Spam" msgstr "" +">>> import csv\n" +">>> with open('eggs.csv', newline='') as csvfile:\n" +"... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')\n" +"... for row in spamreader:\n" +"... print(', '.join(row))\n" +"Spam, Spam, Spam, Spam, Spam, Baked Beans\n" +"Spam, Lovely Spam, Wonderful Spam" -#: ../../library/csv.rst:84 msgid "where :file:`eggs.csv` contains:" -msgstr "" +msgstr "ここで、:file:`eggs.csv` の内容は次のとおりです:" -#: ../../library/csv.rst:86 ../../library/csv.rst:122 msgid "" "Spam Spam Spam Spam Spam |Baked Beans|\n" "Spam |Lovely Spam| |Wonderful Spam|" msgstr "" +"Spam Spam Spam Spam Spam |Baked Beans|\n" +"Spam |Lovely Spam| |Wonderful Spam|" #: ../../library/csv.rst:94 msgid "" @@ -180,7 +207,6 @@ msgstr "" "きます。他の非文字列データは、書き出される前に :func:`str` を使って文字列に変" "換されます。" -#: ../../library/csv.rst:113 msgid "" "import csv\n" "with open('eggs.csv', 'w', newline='') as csvfile:\n" @@ -189,10 +215,15 @@ msgid "" " spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n" " spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" msgstr "" +"import csv\n" +"with open('eggs.csv', 'w', newline='') as csvfile:\n" +" spamwriter = csv.writer(csvfile, delimiter=' ',\n" +" quotechar='|', quoting=csv.QUOTE_MINIMAL)\n" +" spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n" +" spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" -#: ../../library/csv.rst:120 msgid "which writes :file:`eggs.csv` containing:" -msgstr "" +msgstr "これは、次の内容の :file:`eggs.csv` を書き出します:" #: ../../library/csv.rst:130 msgid "" @@ -237,9 +268,8 @@ msgstr "" "パーサが許容する現在の最大フィールドサイズを返します。 *new_limit* が渡された" "ときは、その値が新しい上限になります。" -#: ../../library/csv.rst:161 msgid "The :mod:`!csv` module defines the following classes:" -msgstr "" +msgstr ":mod:`!csv` モジュールは以下のクラスを定義しています。" #: ../../library/csv.rst:166 msgid "" @@ -251,7 +281,6 @@ msgstr "" "るオブジェクトを生成します。マップのキーは省略可能な *fieldnames* パラメータ" "で与えられます。" -#: ../../library/csv.rst:170 msgid "" "The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is " "omitted, the values in the first row of file *f* will be used as the " @@ -260,6 +289,12 @@ msgid "" "results. Regardless of how the fieldnames are determined, the dictionary " "preserves their original ordering." msgstr "" +"*fieldnames* 引数は :term:`sequence` です。\n" +"*fieldnames* を省略すると、ファイル *f* の最初の行の値をフィールド名として使" +"い、その行を結果から除外します。\n" +"*fieldnames* を指定すると、それをフィールド名として使い、最初の行も結果に含め" +"ます。\n" +"フィールド名の決め方にかかわらず、辞書はその元の順序を保持します。" #: ../../library/csv.rst:177 msgid "" @@ -299,7 +334,6 @@ msgstr "返される行の型は :class:`OrderedDict` になりました。" msgid "Returned rows are now of type :class:`dict`." msgstr "返される行の型は :class:`dict` になりました。" -#: ../../library/csv.rst:196 msgid "" ">>> import csv\n" ">>> with open('names.csv', newline='') as csvfile:\n" @@ -313,17 +347,29 @@ msgid "" ">>> print(row)\n" "{'first_name': 'John', 'last_name': 'Cleese'}" msgstr "" +">>> import csv\n" +">>> with open('names.csv', newline='') as csvfile:\n" +"... reader = csv.DictReader(csvfile)\n" +"... for row in reader:\n" +"... print(row['first_name'], row['last_name'])\n" +"...\n" +"Eric Idle\n" +"John Cleese\n" +"\n" +">>> print(row)\n" +"{'first_name': 'John', 'last_name': 'Cleese'}" -#: ../../library/csv.rst:208 msgid "where :file:`names.csv` contains:" -msgstr "" +msgstr ":file:`names.csv` の内容は次のとおりです:" -#: ../../library/csv.rst:210 msgid "" "first_name,last_name\n" "Eric,Idle\n" "John,Cleese" msgstr "" +"first_name,last_name\n" +"Eric,Idle\n" +"John,Cleese" msgid "" "Create an object which operates like a regular writer but maps dictionaries " @@ -363,7 +409,6 @@ msgstr "" ":class:`DictReader` クラスとは異なり、 :class:`DictWriter` の *fieldnames* パ" "ラメータは省略可能ではありません。" -#: ../../library/csv.rst:242 msgid "" "import csv\n" "\n" @@ -376,18 +421,30 @@ msgid "" " writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" " writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" msgstr "" +"import csv\n" +"\n" +"with open('names.csv', 'w', newline='') as csvfile:\n" +" fieldnames = ['first_name', 'last_name']\n" +" writer = csv.DictWriter(csvfile, fieldnames=fieldnames)\n" +"\n" +" writer.writeheader()\n" +" writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})\n" +" writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" +" writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" -#: ../../library/csv.rst:253 msgid "which writes :file:`names.csv` containing:" -msgstr "" +msgstr "これは、次の内容の :file:`names.csv` を書き出します:" -#: ../../library/csv.rst:255 msgid "" "first_name,last_name\n" "Baked,Beans\n" "Lovely,Spam\n" "Wonderful,Spam" msgstr "" +"first_name,last_name\n" +"Baked,Beans\n" +"Lovely,Spam\n" +"Wonderful,Spam" #: ../../library/csv.rst:265 msgid "" @@ -403,20 +460,26 @@ msgstr "" "す。 :class:`Dialect` クラスのインスタンスは :class:`reader` と :class:" "`writer` のインスタンスの挙動を定義します。" -#: ../../library/csv.rst:271 msgid "" "All available :class:`Dialect` names are returned by :func:`list_dialects`, " "and they can be registered with specific :class:`reader` and :class:`writer` " "classes through their initializer (``__init__``) functions like this::" msgstr "" +"利用可能な :class:`Dialect` の名前はすべて :func:`list_dialects` で取得できま" +"す。\n" +"次のように初期化関数 (``__init__``) を通じて、個々の :class:`reader` クラス" +"や :class:`writer` クラスに表現形式を指定できます。 ::" -#: ../../library/csv.rst:275 msgid "" "import csv\n" "\n" "with open('students.csv', 'w', newline='') as csvfile:\n" " writer = csv.writer(csvfile, dialect='unix')" msgstr "" +"import csv\n" +"\n" +"with open('students.csv', 'w', newline='') as csvfile:\n" +" writer = csv.writer(csvfile, dialect='unix')" #: ../../library/csv.rst:283 msgid "" @@ -467,21 +530,26 @@ msgstr "" "`Dialect` サブクラスを返します。オプションの *delimiters* パラメータを与えた" "場合、有効なデリミタ文字を含んでいるはずの文字列として解釈されます。" -#: ../../library/csv.rst:315 msgid "" "If several delimiters fit the sample equally well --- for example if both " "``','`` and ``';'`` split every row consistently --- the delimiters listed " "in the :attr:`~Sniffer.preferred` attribute are preferred, in that order, no " "matter how many times each of them occurs." msgstr "" +"複数のデリミタがサンプルに同じ程度に適合する場合 (例えば、``','`` と ``';'`` " +"のどちらでもすべての行を一貫して分割できる場合)、各デリミタの出現回数にかかわ" +"らず、:attr:`~Sniffer.preferred` 属性に並んだ順に優先されます。" -#: ../../library/csv.rst:323 msgid "" "Analyze the sample text (presumed to be in CSV format) and return :const:" "`True` if the first row appears to be a series of column headers. Inspecting " "each column, one of two key criteria will be considered to estimate if the " "sample contains a header:" msgstr "" +"CSV 形式であると想定したサンプルテキストを解析し、最初の行が列見出しの並びと" +"思われる場合に :const:`True` を返します。\n" +"各列を調べ、次の 2 つの主要な基準のいずれかに基づいて、サンプルに見出しが含ま" +"れるかを推定します:" #: ../../library/csv.rst:328 msgid "the second through n-th rows contain numeric values" @@ -507,22 +575,23 @@ msgstr "" "このメソッドは大雑把なヒューリスティックであり、結果が偽陽性や偽陰性である可" "能性があります。" -#: ../../library/csv.rst:340 msgid "The :class:`Sniffer` class has the following attribute:" -msgstr "" +msgstr ":class:`Sniffer` クラスには以下の属性があります:" -#: ../../library/csv.rst:344 msgid "" "The list of the delimiters preferred for breaking ties, in the order of " "preference. It can be modified. Its initial value is ``[',', '\\t', ';', ' " "', ':']``." msgstr "" +"同程度に適合する候補がある場合に優先するデリミタを、優先順に並べたリストで" +"す。\n" +"変更できます。\n" +"初期値は ``[',', '\\t', ';', ' ', ':']`` です。" #: ../../library/csv.rst:349 msgid "An example for :class:`Sniffer` use::" msgstr ":class:`Sniffer` の利用例::" -#: ../../library/csv.rst:351 msgid "" "with open('example.csv', newline='') as csvfile:\n" " dialect = csv.Sniffer().sniff(csvfile.read(1024))\n" @@ -530,10 +599,14 @@ msgid "" " reader = csv.reader(csvfile, dialect)\n" " # ... process CSV file contents here ..." msgstr "" +"with open('example.csv', newline='') as csvfile:\n" +" dialect = csv.Sniffer().sniff(csvfile.read(1024))\n" +" csvfile.seek(0)\n" +" reader = csv.reader(csvfile, dialect)\n" +" # ... ここで CSV ファイルの内容を処理します ..." -#: ../../library/csv.rst:360 msgid "The :mod:`!csv` module defines the following constants:" -msgstr "" +msgstr ":mod:`!csv` モジュールは以下の定数を定義しています。" #: ../../library/csv.rst:364 msgid "Instructs :class:`writer` objects to quote all fields." @@ -541,7 +614,6 @@ msgstr "" ":class:`writer` オブジェクトに対し、全てのフィールドをクオートするように指示" "します。" -#: ../../library/csv.rst:369 msgid "" "Instructs :class:`writer` objects to only quote those fields which contain " "special characters such as *delimiter*, *quotechar*, ``'\\r'``, ``'\\n'`` or " @@ -549,6 +621,12 @@ msgid "" "`False` and *escapechar* is set, the *quotechar* is escaped instead of " "causing the field to be quoted." msgstr "" +":class:`writer` オブジェクトに、*delimiter*、*quotechar*、``'\\r'``、" +"``'\\n'``、*lineterminator* に含まれる文字などの特殊文字を含むフィールドだけ" +"をクォートするよう指示します。\n" +"*doublequote* が :const:`False` で *escapechar* が設定されている場合、" +"*quotechar* はエスケープされ、その文字を理由としてフィールドがクォートされる" +"ことはありません。" #: ../../library/csv.rst:378 msgid "Instructs :class:`writer` objects to quote all non-numeric fields." @@ -572,7 +650,6 @@ msgid "" "data:`QUOTE_STRINGS` modes." msgstr "" -#: ../../library/csv.rst:391 msgid "" "Instructs :class:`writer` objects to never quote fields. When the current " "*delimiter*, *quotechar*, *escapechar*, ``'\\r'``, ``'\\n'`` or any of the " @@ -581,6 +658,14 @@ msgid "" "raise :exc:`Error` if any characters that require escaping are encountered. " "Set *quotechar* to ``None`` to prevent its escaping." msgstr "" +":class:`writer` オブジェクトに、フィールドを一切クォートしないよう指示しま" +"す。\n" +"出力データに現在の *delimiter*、*quotechar*、*escapechar*、``'\\r'``、" +"``'\\n'``、または *lineterminator* に含まれる文字が現れると、その直前に現在" +"の *escapechar* 文字を付けます。\n" +"*escapechar* が設定されていない場合、エスケープが必要な文字が見つかると " +"writer は :exc:`Error` を送出します。\n" +"*quotechar* のエスケープを避けるには、それを ``None`` に設定してください。" #: ../../library/csv.rst:399 msgid "" @@ -590,45 +675,51 @@ msgstr "" ":class:`reader` オブジェクトに、クオート文字に対する特殊処理を行わないよう指" "示します。" -#: ../../library/csv.rst:403 msgid "" "Instructs :class:`writer` objects to quote all fields which are not " "``None``. This is similar to :data:`QUOTE_ALL`, except that if a field " "value is ``None`` an empty (unquoted) string is written." msgstr "" +":class:`writer` オブジェクトに、``None`` ではないすべてのフィールドをクォート" +"するよう指示します。\n" +":data:`QUOTE_ALL` に似ていますが、フィールドの値が ``None`` の場合は、クォー" +"トされていない空文字列を書き込みます。" -#: ../../library/csv.rst:407 msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) field as " "``None`` and to otherwise behave as :data:`QUOTE_ALL`." msgstr "" +":class:`reader` オブジェクトに、クォートされていない空のフィールドを " +"``None`` と解釈し、それ以外は :data:`QUOTE_ALL` と同様に動作するよう指示しま" +"す。" -#: ../../library/csv.rst:414 msgid "" "Instructs :class:`writer` objects to always place quotes around fields which " "are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a " "field value is ``None`` an empty (unquoted) string is written." msgstr "" +":class:`writer` オブジェクトに、文字列のフィールドを常にクォートするよう指示" +"します。\n" +":data:`QUOTE_NONNUMERIC` に似ていますが、フィールドの値が ``None`` の場合は、" +"クォートされていない空文字列を書き込みます。" -#: ../../library/csv.rst:418 msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) string as " "``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." msgstr "" +":class:`reader` オブジェクトに、クォートされていない空文字列を ``None`` と解" +"釈し、それ以外は :data:`QUOTE_NONNUMERIC` と同様に動作するよう指示します。" -#: ../../library/csv.rst:423 msgid "The :mod:`!csv` module defines the following exception:" -msgstr "" +msgstr ":mod:`!csv` モジュールは以下の例外を定義しています。" #: ../../library/csv.rst:428 msgid "Raised by any of the functions when an error is detected." msgstr "全ての関数において、エラーが検出された際に送出される例外です。" -#: ../../library/csv.rst:433 msgid "Dialects and formatting parameters" -msgstr "" +msgstr "表現形式と書式パラメータ" -#: ../../library/csv.rst:435 msgid "" "To make it easier to specify the format of input and output records, " "specific formatting parameters are grouped together into dialects. A " @@ -640,6 +731,17 @@ msgid "" "specify individual formatting parameters, which have the same names as the " "attributes defined below for the :class:`Dialect` class." msgstr "" +"入出力レコードの形式を簡単に指定できるように、書式パラメータを表現形式 " +"(dialect) としてまとめています。\n" +"表現形式は :class:`Dialect` クラスのサブクラスであり、CSV ファイルの形式を記" +"述するさまざまな属性を持ちます。\n" +":class:`reader` オブジェクトや :class:`writer` オブジェクトを作成する際、" +"``dialect`` 引数には文字列か :class:`Dialect` クラスのサブクラスを指定できま" +"す。\n" +"*dialect* 引数に加えて、またはその代わりに、書式パラメータを個別に指定するこ" +"ともできます。\n" +"各パラメータの名前は、以下で定義する :class:`Dialect` クラスの属性名と同じで" +"す。" #: ../../library/csv.rst:445 msgid "Dialects support the following attributes:" @@ -674,37 +776,38 @@ msgstr "" "ていない場合、フィールド内に *quotechar* が現れると :exc:`Error` が送出されま" "す。" -#: ../../library/csv.rst:466 msgid "" "A one-character string used by the writer to escape characters that require " "escaping:" msgstr "" +"writer がエスケープを要する以下の文字をエスケープするために使う、1 文字の文字" +"列です:" -#: ../../library/csv.rst:469 msgid "" "the *delimiter*, the *quotechar*, ``'\\r'``, ``'\\n'`` and any of the " "characters in *lineterminator* are escaped if *quoting* is set to :const:" "`QUOTE_NONE`;" msgstr "" +"*quoting* が :const:`QUOTE_NONE` の場合は、*delimiter*、*quotechar*、" +"``'\\r'``、``'\\n'``、および *lineterminator* に含まれる文字。" -#: ../../library/csv.rst:472 msgid "the *quotechar* is escaped if *doublequote* is :const:`False`;" -msgstr "" +msgstr "*doublequote* が :const:`False` の場合は *quotechar*。" -#: ../../library/csv.rst:473 msgid "the *escapechar* itself." -msgstr "" +msgstr "*escapechar* 自身。" -#: ../../library/csv.rst:475 msgid "" "On reading, the *escapechar* removes any special meaning from the following " "character. It defaults to :const:`None`, which disables escaping." msgstr "" +"読み込み時には、*escapechar* は直後の文字の特殊な意味を取り除きます。\n" +"デフォルトは :const:`None` で、この場合エスケープは無効です。" -#: ../../library/csv.rst:478 msgid "" "Previously the *escapechar* itself was not escaped, which lost it on reading." msgstr "" +"以前は *escapechar* 自身がエスケープされず、読み込み時に失われていました。" #: ../../library/csv.rst:482 msgid "An empty *escapechar* is not allowed." @@ -728,7 +831,6 @@ msgstr "" "にハードコードされており、 *lineterminator* を無視します。この振る舞いは将来" "変更されるかもしれません。" -#: ../../library/csv.rst:499 msgid "" "A one-character string used to quote fields containing special characters, " "such as the *delimiter* or the *quotechar*, or which contain new-line " @@ -736,25 +838,38 @@ msgid "" "*lineterminator*). It defaults to ``'\"'``. Can be set to ``None`` to " "prevent escaping ``'\"'`` if *quoting* is set to :const:`QUOTE_NONE`." msgstr "" +"*delimiter* や *quotechar* などの特殊文字、または改行文字 (``'\\r'``、" +"``'\\n'``、*lineterminator* に含まれる文字) を含むフィールドをクォートするた" +"めの、1 文字の文字列です。\n" +"デフォルトは ``'\"'`` です。\n" +"*quoting* が :const:`QUOTE_NONE` の場合に ``'\"'`` がエスケープされないように" +"するには、``None`` に設定できます。" #: ../../library/csv.rst:506 msgid "An empty *quotechar* is not allowed." msgstr "空の *quotechar* は許可されていません。" -#: ../../library/csv.rst:511 msgid "" "Controls when quotes should be generated by the writer and recognised by the " "reader. It can take on any of the :ref:`QUOTE_\\* constants ` and defaults to :const:`QUOTE_MINIMAL` if *quotechar* is not " "``None``, and :const:`QUOTE_NONE` otherwise." msgstr "" +"writer がクォートを生成する条件と、reader がクォートを認識する条件を制御しま" +"す。\n" +":ref:`QUOTE_\\* 定数 ` のいずれかを指定できます。\n" +"デフォルトは、*quotechar* が ``None`` でなければ :const:`QUOTE_MINIMAL`、そう" +"でなければ :const:`QUOTE_NONE` です。" -#: ../../library/csv.rst:519 msgid "" "When :const:`True`, spaces immediately following the *delimiter* are " "ignored. The default is :const:`False`. When combining ``delimiter=' '`` " "with ``skipinitialspace=True``, unquoted empty fields are not allowed." msgstr "" +":const:`True` の場合、*delimiter* の直後の空白は無視されます。\n" +"デフォルトは :const:`False` です。\n" +"``delimiter=' '`` と ``skipinitialspace=True`` を組み合わせる場合、クォートさ" +"れていない空のフィールドは許可されません。" #: ../../library/csv.rst:526 msgid "" @@ -764,9 +879,8 @@ msgstr "" "``True`` の場合、 不正な CSV 入力に対して :exc:`Error` を送出します。デフォル" "トでは ``False`` です。" -#: ../../library/csv.rst:532 msgid "Reader objects" -msgstr "" +msgstr "reader オブジェクト" #: ../../library/csv.rst:534 msgid "" @@ -816,9 +930,8 @@ msgstr "" "オブジェクトを生成するときに渡されなかった場合、この属性は最初のアクセス時" "か、ファイルから最初のレコードを読み出したときに初期化されます。" -#: ../../library/csv.rst:569 msgid "Writer objects" -msgstr "" +msgstr "writer オブジェクト" #: ../../library/csv.rst:571 msgid "" @@ -875,12 +988,14 @@ msgstr "writer で使われる表現形式の読み出し専用の記述です msgid "DictWriter objects have the following public method:" msgstr "DictWriter のオブジェクトは以下の public メソッドを持っています:" -#: ../../library/csv.rst:608 msgid "" "Write a row with the field names (as specified in the constructor) to the " "writer's file object, formatted according to the current dialect. Return the " "return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" +"コンストラクタで指定したフィールド名を、現在の表現形式に従って整形し、writer " +"のファイルオブジェクトに 1 行書き込みます。\n" +"内部で呼び出す :meth:`csvwriter.writerow` の戻り値を返します。" #: ../../library/csv.rst:613 msgid "" @@ -898,7 +1013,6 @@ msgstr "使用例" msgid "The simplest example of reading a CSV file::" msgstr "最も簡単な CSV ファイル読み込みの例です::" -#: ../../library/csv.rst:625 msgid "" "import csv\n" "with open('some.csv', newline='') as f:\n" @@ -906,12 +1020,16 @@ msgid "" " for row in reader:\n" " print(row)" msgstr "" +"import csv\n" +"with open('some.csv', newline='') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" #: ../../library/csv.rst:631 msgid "Reading a file with an alternate format::" msgstr "別の書式での読み込み::" -#: ../../library/csv.rst:633 msgid "" "import csv\n" "with open('passwd', newline='') as f:\n" @@ -919,27 +1037,37 @@ msgid "" " for row in reader:\n" " print(row)" msgstr "" +"import csv\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, delimiter=':', quoting=csv.QUOTE_NONE)\n" +" for row in reader:\n" +" print(row)" #: ../../library/csv.rst:639 msgid "The corresponding simplest possible writing example is::" msgstr "上に対して、単純な書き込みのプログラム例は以下のようになります。 ::" -#: ../../library/csv.rst:641 msgid "" "import csv\n" "with open('some.csv', 'w', newline='') as f:\n" " writer = csv.writer(f)\n" " writer.writerows(someiterable)" msgstr "" +"import csv\n" +"with open('some.csv', 'w', newline='') as f:\n" +" writer = csv.writer(f)\n" +" writer.writerows(someiterable)" -#: ../../library/csv.rst:646 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " "default be decoded into Unicode using UTF-8. To decode a file using a " "different encoding, use the ``encoding`` argument of open::" msgstr "" +"CSV ファイルを読み込み用に開くには :func:`open` を使うため、デフォルトでは " +"UTF-8 を使用してファイルを Unicode にデコードします。\n" +"別のエンコーディングでデコードするには、``open()`` の ``encoding`` 引数を使っ" +"てください。 ::" -#: ../../library/csv.rst:650 msgid "" "import csv\n" "with open('some.csv', newline='', encoding='latin-1') as f:\n" @@ -947,24 +1075,33 @@ msgid "" " for row in reader:\n" " print(row)" msgstr "" +"import csv\n" +"with open('some.csv', newline='', encoding='latin-1') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" -#: ../../library/csv.rst:656 msgid "" "The same applies to writing in something other than the default encoding: " "specify the encoding argument when opening the output file." msgstr "" +"デフォルト以外のエンコーディングで書き込む場合も同様です。\n" +"出力ファイルを開く際に ``encoding`` 引数を指定してください。" #: ../../library/csv.rst:659 msgid "Registering a new dialect::" msgstr "新しい表現形式の登録::" -#: ../../library/csv.rst:661 msgid "" "import csv\n" "csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" "with open('passwd', newline='') as f:\n" " reader = csv.reader(f, 'unixpwd')" msgstr "" +"import csv\n" +"csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, 'unixpwd')" #: ../../library/csv.rst:666 msgid "" @@ -973,7 +1110,6 @@ msgid "" msgstr "" "もう少し手の込んだ reader の使い方 --- エラーを捉えてレポートします。 ::" -#: ../../library/csv.rst:668 msgid "" "import csv, sys\n" "filename = 'some.csv'\n" @@ -985,6 +1121,15 @@ msgid "" " except csv.Error as e:\n" " sys.exit(f'file {filename}, line {reader.line_num}: {e}')" msgstr "" +"import csv, sys\n" +"filename = 'some.csv'\n" +"with open(filename, newline='') as f:\n" +" reader = csv.reader(f)\n" +" try:\n" +" for row in reader:\n" +" print(row)\n" +" except csv.Error as e:\n" +" sys.exit(f'file {filename}, line {reader.line_num}: {e}')" #: ../../library/csv.rst:678 msgid "" @@ -993,18 +1138,19 @@ msgid "" msgstr "" "このモジュールは文字列の解析は直接サポートしませんが、簡単にできます。 ::" -#: ../../library/csv.rst:681 msgid "" "import csv\n" "for row in csv.reader(['one,two,three']):\n" " print(row)" msgstr "" +"import csv\n" +"for row in csv.reader(['one,two,three']):\n" +" print(row)" #: ../../library/csv.rst:687 msgid "Footnotes" msgstr "脚注" -#: ../../library/csv.rst:688 msgid "" "If ``newline=''`` is not specified, newlines embedded inside quoted fields " "will not be interpreted correctly, and on platforms that use ``\\r\\n`` line " @@ -1012,6 +1158,12 @@ msgid "" "to specify ``newline=''``, since the csv module does its own (:term:" "`universal `) newline handling." msgstr "" +"``newline=''`` を指定しないと、クォートされたフィールド内の改行を正しく解釈で" +"きません。\n" +"また、書き込み時の改行に ``\\r\\n`` を使うプラットフォームでは、余分な " +"``\\r`` が追加されます。\n" +"csv モジュール自身が (:term:`ユニバーサル `) 改行処理を行" +"うので、``newline=''`` は常に指定して差し支えありません。" #: ../../library/csv.rst:9 msgid "csv" diff --git a/library/ctypes.po b/library/ctypes.po index fc5334e33..10d37dba5 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -31,22 +31,27 @@ msgstr ":mod:`!ctypes` --- Python 用の外部関数ライブラリ" msgid "**Source code:** :source:`Lib/ctypes`" msgstr "**ソースコード:** :source:`Lib/ctypes`" -#: ../../library/ctypes.rst:11 msgid "" ":mod:`!ctypes` is a foreign function library for Python. It provides C " "compatible data types, and allows calling functions in DLLs or shared " "libraries. It can be used to wrap these libraries in pure Python." msgstr "" +":mod:`!ctypes` は Python 用の外部関数ライブラリです。\n" +"C と互換性のあるデータ型を提供し、DLL や共有ライブラリの関数を呼び出せま" +"す。\n" +"これらのライブラリを純粋な Python でラップするために使えます。" -#: ../../includes/optional-module.rst:1 msgid "" "This is an :term:`optional module`. If it is missing from your copy of " "CPython, look for documentation from your distributor (that is, whoever " "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" +"これは :term:`オプションモジュール ` です。\n" +"使用している CPython に含まれていない場合は、配布元 (Python を提供した組織な" +"ど) のドキュメントを確認してください。\n" +"配布する立場の場合は :ref:`optional-module-requirements` を参照してください。" -#: ../../library/ctypes.rst:19 msgid "" ":mod:`!ctypes` provides low-level access to native libraries and the " "process's memory, bypassing Python's safety mechanisms and allowing " @@ -54,6 +59,11 @@ msgid "" "objects, reveal sensitive information, cause crashes, or otherwise " "compromise the running process." msgstr "" +":mod:`!ctypes` は、Python の安全機構を迂回してネイティブライブラリやプロセス" +"のメモリに低水準でアクセスし、任意のネイティブコードを実行できるようにしま" +"す。\n" +"使い方を誤ると、データやオブジェクトの破損、機密情報の漏えい、クラッシュな" +"ど、実行中のプロセスの安全性を損なう事態を引き起こす可能性があります。" #: ../../library/ctypes.rst:29 msgid "ctypes tutorial" @@ -76,14 +86,16 @@ msgstr "" msgid "Loading dynamic link libraries" msgstr "動的リンクライブラリをロードする" -#: ../../library/ctypes.rst:41 msgid "" ":mod:`!ctypes` exports the :py:data:`~ctypes.cdll`, and on Windows :py:data:" "`~ctypes.windll` and :py:data:`~ctypes.oledll` objects, for loading dynamic " "link libraries." msgstr "" +":mod:`!ctypes` は、動的リンクライブラリをロードするための :py:data:`~ctypes." +"cdll` オブジェクトをエクスポートします。\n" +"Windows では :py:data:`~ctypes.windll` と :py:data:`~ctypes.oledll` オブジェ" +"クトもエクスポートします。" -#: ../../library/ctypes.rst:45 msgid "" "You load libraries by accessing them as attributes of these objects. :py:" "data:`!cdll` loads libraries which export functions using the standard " @@ -94,6 +106,14 @@ msgid "" "automatically raise an :class:`OSError` exception when the function call " "fails." msgstr "" +"これらのオブジェクトの属性にアクセスすると、ライブラリをロードできます。\n" +":py:data:`!cdll` は標準の ``cdecl`` 呼び出し規約で関数をエクスポートするライ" +"ブラリをロードし、:py:data:`!windll` のライブラリは ``stdcall`` 呼び出し規約" +"で関数を呼び出します。\n" +":py:data:`~oledll` も ``stdcall`` 呼び出し規約を使用し、関数が Windows の :c:" +"type:`!HRESULT` エラーコードを返すと仮定します。\n" +"関数呼び出しが失敗した場合は、このエラーコードを使って :class:`OSError` 例外" +"を自動的に送出します。" #: ../../library/ctypes.rst:55 msgid "" @@ -103,14 +123,15 @@ msgstr "" "Windows エラーは以前は :exc:`WindowsError` を送出していましたが、これは現在で" "は :exc:`OSError` の別名になっています。" -#: ../../library/ctypes.rst:60 msgid "" "Here are some examples for Windows. Note that ``msvcrt`` is the MS standard " "C library containing most standard C functions, and uses the ``cdecl`` " "calling convention::" msgstr "" +"Windows での例を示します。\n" +"``msvcrt`` は、標準 C 関数の大半を含む MS 標準 C ライブラリで、``cdecl`` 呼び" +"出し規約を使用します。 ::" -#: ../../library/ctypes.rst:64 msgid "" ">>> from ctypes import *\n" ">>> print(windll.kernel32)\n" @@ -120,6 +141,13 @@ msgid "" ">>> libc = cdll.msvcrt\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> print(windll.kernel32)\n" +"\n" +">>> print(cdll.msvcrt)\n" +"\n" +">>> libc = cdll.msvcrt\n" +">>>" #: ../../library/ctypes.rst:72 msgid "Windows appends the usual ``.dll`` file suffix automatically." @@ -137,7 +165,6 @@ msgstr "" "れます。可能な場合には、ネイティブ Python の機能を使用するか、``msvcrt`` モ" "ジュールをインポートして使用してください。" -#: ../../library/ctypes.rst:80 msgid "" "Other systems require the filename *including* the extension to load a " "library, so attribute access can not be used to load libraries. Either the :" @@ -145,12 +172,15 @@ msgid "" "or you should load the library by creating an instance of :py:class:`CDLL` " "by calling the constructor." msgstr "" +"ほかのシステムでは、ライブラリのロードに拡張子を *含む* ファイル名が必要なた" +"め、属性へのアクセスではロードできません。\n" +"DLL ローダーの :meth:`~LibraryLoader.LoadLibrary` メソッドを使うか、コンスト" +"ラクタを呼び出して :py:class:`CDLL` インスタンスを作成し、ライブラリをロード" +"してください。" -#: ../../library/ctypes.rst:86 msgid "For example, on Linux::" -msgstr "" +msgstr "例えば、Linux では次のようにします。 ::" -#: ../../library/ctypes.rst:88 msgid "" ">>> cdll.LoadLibrary(\"libc.so.6\")\n" "\n" @@ -159,12 +189,16 @@ msgid "" "\n" ">>>" msgstr "" +">>> cdll.LoadLibrary(\"libc.so.6\")\n" +"\n" +">>> libc = CDLL(\"libc.so.6\")\n" +">>> libc\n" +"\n" +">>>" -#: ../../library/ctypes.rst:95 msgid "On macOS::" -msgstr "" +msgstr "macOS では次のようにします。 ::" -#: ../../library/ctypes.rst:97 msgid "" ">>> cdll.LoadLibrary(\"libc.dylib\")\n" "\n" @@ -172,6 +206,11 @@ msgid "" ">>> libc\n" "" msgstr "" +">>> cdll.LoadLibrary(\"libc.dylib\")\n" +"\n" +">>> libc = CDLL(\"libc.dylib\")\n" +">>> libc\n" +"" #: ../../library/ctypes.rst:108 msgid "Accessing functions from loaded dlls" @@ -181,7 +220,6 @@ msgstr "ロードしたdllから関数にアクセスする" msgid "Functions are accessed as attributes of dll objects::" msgstr "dll オブジェクトの属性として関数にアクセスします::" -#: ../../library/ctypes.rst:112 msgid "" ">>> libc.printf\n" "<_FuncPtr object at 0x...>\n" @@ -195,8 +233,18 @@ msgid "" "AttributeError: function 'MyOwnFunction' not found\n" ">>>" msgstr "" +">>> libc.printf\n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.GetModuleHandleA)\n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.MyOwnFunction)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 239, in __getattr__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function 'MyOwnFunction' not found\n" +">>>" -#: ../../library/ctypes.rst:124 msgid "" "Note that win32 system dlls like ``kernel32`` and ``user32`` often export " "ANSI as well as UNICODE versions of a function. The UNICODE version is " @@ -206,14 +254,25 @@ msgid "" "following C prototype, and a macro is used to expose one of them as " "``GetModuleHandle`` depending on whether UNICODE is defined or not::" msgstr "" +"``kernel32`` や ``user32`` などの win32 システム DLL は、関数の ANSI 版と " +"UNICODE 版を両方エクスポートすることがよくあります。\n" +"UNICODE 版は名前の末尾に ``W``、ANSI 版は ``A`` を付けてエクスポートされま" +"す。\n" +"指定したモジュール名の *モジュールハンドル* を返す win32 の " +"``GetModuleHandle`` 関数には、以下の C プロトタイプがあります。\n" +"UNICODE が定義されているかどうかに応じて、マクロが一方を ``GetModuleHandle`` " +"として公開します。 ::" -#: ../../library/ctypes.rst:132 msgid "" "/* ANSI version */\n" "HMODULE GetModuleHandleA(LPCSTR lpModuleName);\n" "/* UNICODE version */\n" "HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" msgstr "" +"/* ANSI 版 */\n" +"HMODULE GetModuleHandleA(LPCSTR lpModuleName);\n" +"/* UNICODE 版 */\n" +"HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" #: ../../library/ctypes.rst:137 msgid "" @@ -236,12 +295,14 @@ msgstr "" "ない名前でエクスポートすることがあります。このような場合に関数を取り出すに" "は、 :func:`getattr` を使わなければなりません。::" -#: ../../library/ctypes.rst:145 msgid "" ">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" "<_FuncPtr object at 0x...>\n" ">>>" msgstr "" +">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" +"<_FuncPtr object at 0x...>\n" +">>>" #: ../../library/ctypes.rst:149 msgid "" @@ -253,7 +314,6 @@ msgstr "" "こうした関数には序数を使って dll オブジェクトにインデックス指定することでアク" "セスします::" -#: ../../library/ctypes.rst:152 msgid "" ">>> cdll.kernel32[1]\n" "<_FuncPtr object at 0x...>\n" @@ -265,37 +325,53 @@ msgid "" "AttributeError: function ordinal 0 not found\n" ">>>" msgstr "" +">>> cdll.kernel32[1]\n" +"<_FuncPtr object at 0x...>\n" +">>> cdll.kernel32[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 310, in __getitem__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function ordinal 0 not found\n" +">>>" #: ../../library/ctypes.rst:166 msgid "Calling functions" msgstr "関数を呼び出す" -#: ../../library/ctypes.rst:168 msgid "" "You can call these functions like any other Python callable. This example " "uses the ``rand()`` function, which takes no arguments and returns a pseudo-" "random integer::" msgstr "" +"これらの関数は、ほかの Python の呼び出し可能オブジェクトと同じように呼び出せ" +"ます。\n" +"この例では、引数を取らず疑似乱数の整数を返す ``rand()`` 関数を使います。 ::" -#: ../../library/ctypes.rst:171 msgid "" ">>> print(libc.rand())\n" "1804289383" msgstr "" +">>> print(libc.rand())\n" +"1804289383" -#: ../../library/ctypes.rst:174 msgid "" "On Windows, you can call the ``GetModuleHandleA()`` function, which returns " "a win32 module handle (passing ``None`` as single argument to call it with a " "``NULL`` pointer)::" msgstr "" +"Windows では、win32 モジュールハンドルを返す ``GetModuleHandleA()`` 関数を呼" +"び出せます (唯一の引数に ``None`` を渡すと、``NULL`` ポインタを渡して呼び出せ" +"ます)。 ::" -#: ../../library/ctypes.rst:177 msgid "" ">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" "0x1d000000\n" ">>>" msgstr "" +">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" +"0x1d000000\n" +">>>" #: ../../library/ctypes.rst:181 msgid "" @@ -330,14 +406,14 @@ msgstr "" "正しい呼び出し規約を知るためには、呼び出したい関数についての C ヘッダファイル" "もしくはドキュメントを見なければなりません。" -#: ../../library/ctypes.rst:199 msgid "" "On Windows, :mod:`!ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " "with invalid argument values::" msgstr "" +"Windows では、:mod:`!ctypes` は win32 の構造化例外処理を使い、無効な引数の値" +"で関数を呼び出した際の一般保護違反によるクラッシュを防ぎます。 ::" -#: ../../library/ctypes.rst:203 msgid "" ">>> windll.kernel32.GetModuleHandleA(32)\n" "Traceback (most recent call last):\n" @@ -345,14 +421,19 @@ msgid "" "OSError: exception: access violation reading 0x00000020\n" ">>>" msgstr "" +">>> windll.kernel32.GetModuleHandleA(32)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"OSError: exception: access violation reading 0x00000020\n" +">>>" -#: ../../library/ctypes.rst:209 msgid "" "The :mod:`faulthandler` module can help debug crashes, such as segmentation " "faults produced by erroneous C library calls." msgstr "" +":mod:`faulthandler` モジュールは、C ライブラリの誤った呼び出しによるセグメン" +"テーション違反などのクラッシュのデバッグに役立ちます。" -#: ../../library/ctypes.rst:212 msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " @@ -362,20 +443,28 @@ msgid "" "platform's default C :c:expr:`int` type, their value is masked to fit into " "the C type." msgstr "" +"これらの関数呼び出しに引数として直接渡せる Python 標準のオブジェクトは、" +"``None``、整数、バイト列オブジェクト、(Unicode) 文字列だけです。\n" +"``None`` は C の ``NULL`` ポインタとして渡され、バイト列オブジェクトと文字列" +"は、データを格納するメモリブロックへのポインタ (:c:expr:`char *` または :c:" +"expr:`wchar_t *`) として渡されます。\n" +"Python の整数は、プラットフォームのデフォルトの C :c:expr:`int` 型として渡さ" +"れ、その C 型に収まるよう値がマスクされます。" -#: ../../library/ctypes.rst:219 msgid "" "Before we move on calling functions with other parameter types, we have to " "learn more about :mod:`!ctypes` data types." msgstr "" +"ほかの型の引数を使って関数を呼び出す前に、:mod:`!ctypes` のデータ型を詳しく見" +"ておく必要があります。" #: ../../library/ctypes.rst:226 ../../library/ctypes.rst:2569 msgid "Fundamental data types" msgstr "基本データ型" -#: ../../library/ctypes.rst:228 msgid ":mod:`!ctypes` defines a number of primitive C compatible data types:" msgstr "" +":mod:`!ctypes` は、C と互換性のある基本データ型をいくつも定義しています:" #: ../../library/ctypes.rst:233 ../../library/ctypes.rst:372 msgid "ctypes type" @@ -389,9 +478,8 @@ msgstr "C の型" msgid "Python type" msgstr "Python の型" -#: ../../library/ctypes.rst:236 ../../library/ctypes.rst:375 msgid ":py:attr:`~_SimpleCData._type_`" -msgstr "" +msgstr ":py:attr:`~_SimpleCData._type_`" #: ../../library/ctypes.rst:237 msgid ":class:`c_bool`" @@ -401,13 +489,11 @@ msgstr ":class:`c_bool`" msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: ../../library/ctypes.rst:239 ../../library/ctypes.rst:363 msgid ":py:class:`bool`" -msgstr "" +msgstr ":py:class:`bool`" -#: ../../library/ctypes.rst:240 msgid "``'?'``" -msgstr "" +msgstr "``'?'``" #: ../../library/ctypes.rst:241 msgid ":class:`c_char`" @@ -417,9 +503,8 @@ msgstr ":class:`c_char`" msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../library/ctypes.rst:243 msgid "1-character :py:class:`bytes`" -msgstr "" +msgstr "1 文字の :py:class:`bytes`" #: ../../library/ctypes.rst:244 msgid "``'c'``" @@ -433,9 +518,8 @@ msgstr ":class:`c_wchar`" msgid ":c:type:`wchar_t`" msgstr ":c:type:`wchar_t`" -#: ../../library/ctypes.rst:247 msgid "1-character :py:class:`str`" -msgstr "" +msgstr "1 文字の :py:class:`str`" #: ../../library/ctypes.rst:248 msgid "``'u'``" @@ -445,19 +529,8 @@ msgstr "``'u'``" msgid ":class:`c_byte`" msgstr ":class:`c_byte`" -#: ../../library/ctypes.rst:251 ../../library/ctypes.rst:255 -#: ../../library/ctypes.rst:259 ../../library/ctypes.rst:263 -#: ../../library/ctypes.rst:267 ../../library/ctypes.rst:271 -#: ../../library/ctypes.rst:275 ../../library/ctypes.rst:279 -#: ../../library/ctypes.rst:283 ../../library/ctypes.rst:287 -#: ../../library/ctypes.rst:291 ../../library/ctypes.rst:295 -#: ../../library/ctypes.rst:299 ../../library/ctypes.rst:303 -#: ../../library/ctypes.rst:307 ../../library/ctypes.rst:311 -#: ../../library/ctypes.rst:315 ../../library/ctypes.rst:319 -#: ../../library/ctypes.rst:323 ../../library/ctypes.rst:327 -#: ../../library/ctypes.rst:331 msgid ":py:class:`int`" -msgstr "" +msgstr ":py:class:`int`" #: ../../library/ctypes.rst:252 msgid "``'b'``" @@ -507,50 +580,35 @@ msgstr ":class:`c_int`" msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../library/ctypes.rst:268 msgid "``'i'`` \\*" -msgstr "" +msgstr "``'i'`` \\*" -#: ../../library/ctypes.rst:269 msgid ":class:`c_int8`" -msgstr "" +msgstr ":class:`c_int8`" -#: ../../library/ctypes.rst:270 msgid ":c:type:`int8_t`" -msgstr "" +msgstr ":c:type:`int8_t`" -#: ../../library/ctypes.rst:272 ../../library/ctypes.rst:276 -#: ../../library/ctypes.rst:280 ../../library/ctypes.rst:284 -#: ../../library/ctypes.rst:292 ../../library/ctypes.rst:296 -#: ../../library/ctypes.rst:300 ../../library/ctypes.rst:304 -#: ../../library/ctypes.rst:324 ../../library/ctypes.rst:328 -#: ../../library/ctypes.rst:332 msgid "\\*" -msgstr "" +msgstr "\\*" -#: ../../library/ctypes.rst:273 msgid ":class:`c_int16`" -msgstr "" +msgstr ":class:`c_int16`" -#: ../../library/ctypes.rst:274 msgid ":c:type:`int16_t`" -msgstr "" +msgstr ":c:type:`int16_t`" -#: ../../library/ctypes.rst:277 msgid ":class:`c_int32`" -msgstr "" +msgstr ":class:`c_int32`" -#: ../../library/ctypes.rst:278 msgid ":c:type:`int32_t`" -msgstr "" +msgstr ":c:type:`int32_t`" -#: ../../library/ctypes.rst:281 msgid ":class:`c_int64`" -msgstr "" +msgstr ":class:`c_int64`" -#: ../../library/ctypes.rst:282 msgid ":c:type:`int64_t`" -msgstr "" +msgstr ":c:type:`int64_t`" #: ../../library/ctypes.rst:285 msgid ":class:`c_uint`" @@ -560,41 +618,32 @@ msgstr ":class:`c_uint`" msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../library/ctypes.rst:288 msgid "``'I'`` \\*" -msgstr "" +msgstr "``'I'`` \\*" -#: ../../library/ctypes.rst:289 msgid ":class:`c_uint8`" -msgstr "" +msgstr ":class:`c_uint8`" -#: ../../library/ctypes.rst:290 msgid ":c:type:`uint8_t`" -msgstr "" +msgstr ":c:type:`uint8_t`" -#: ../../library/ctypes.rst:293 msgid ":class:`c_uint16`" -msgstr "" +msgstr ":class:`c_uint16`" -#: ../../library/ctypes.rst:294 msgid ":c:type:`uint16_t`" -msgstr "" +msgstr ":c:type:`uint16_t`" -#: ../../library/ctypes.rst:297 msgid ":class:`c_uint32`" -msgstr "" +msgstr ":class:`c_uint32`" -#: ../../library/ctypes.rst:298 msgid ":c:type:`uint32_t`" -msgstr "" +msgstr ":c:type:`uint32_t`" -#: ../../library/ctypes.rst:301 msgid ":class:`c_uint64`" -msgstr "" +msgstr ":class:`c_uint64`" -#: ../../library/ctypes.rst:302 msgid ":c:type:`uint64_t`" -msgstr "" +msgstr ":c:type:`uint64_t`" #: ../../library/ctypes.rst:305 msgid ":class:`c_long`" @@ -624,25 +673,21 @@ msgstr "``'L'``" msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" -#: ../../library/ctypes.rst:314 msgid ":c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`long long`" -#: ../../library/ctypes.rst:316 msgid "``'q'`` \\*" -msgstr "" +msgstr "``'q'`` \\*" #: ../../library/ctypes.rst:317 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" -#: ../../library/ctypes.rst:318 msgid ":c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned long long`" -#: ../../library/ctypes.rst:320 msgid "``'Q'`` \\*" -msgstr "" +msgstr "``'Q'`` \\*" #: ../../library/ctypes.rst:321 msgid ":class:`c_size_t`" @@ -660,13 +705,11 @@ msgstr ":class:`c_ssize_t`" msgid ":c:type:`Py_ssize_t`" msgstr ":c:type:`Py_ssize_t`" -#: ../../library/ctypes.rst:329 msgid ":class:`c_time_t`" -msgstr "" +msgstr ":class:`c_time_t`" -#: ../../library/ctypes.rst:330 msgid ":c:type:`time_t`" -msgstr "" +msgstr ":c:type:`time_t`" #: ../../library/ctypes.rst:333 msgid ":class:`c_float`" @@ -676,10 +719,8 @@ msgstr ":class:`c_float`" msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../library/ctypes.rst:335 ../../library/ctypes.rst:339 -#: ../../library/ctypes.rst:343 msgid ":py:class:`float`" -msgstr "" +msgstr ":py:class:`float`" #: ../../library/ctypes.rst:336 msgid "``'f'``" @@ -705,9 +746,8 @@ msgstr ":class:`c_longdouble`" msgid ":c:expr:`long double`" msgstr ":c:expr:`long double`" -#: ../../library/ctypes.rst:344 msgid "``'g'`` \\*" -msgstr "" +msgstr "``'g'`` \\*" #: ../../library/ctypes.rst:345 msgid ":class:`c_char_p`" @@ -717,9 +757,8 @@ msgstr ":class:`c_char_p`" msgid ":c:expr:`char *` (NUL terminated)" msgstr ":c:expr:`char *` (NUL 終端)" -#: ../../library/ctypes.rst:347 msgid ":py:class:`bytes` or ``None``" -msgstr "" +msgstr ":py:class:`bytes` または ``None``" #: ../../library/ctypes.rst:348 msgid "``'z'``" @@ -733,9 +772,8 @@ msgstr ":class:`c_wchar_p`" msgid ":c:expr:`wchar_t *` (NUL terminated)" msgstr ":c:expr:`wchar_t *` (NUL 終端)" -#: ../../library/ctypes.rst:351 msgid ":py:class:`str` or ``None``" -msgstr "" +msgstr ":py:class:`str` または ``None``" #: ../../library/ctypes.rst:352 msgid "``'Z'``" @@ -749,95 +787,78 @@ msgstr ":class:`c_void_p`" msgid ":c:expr:`void *`" msgstr ":c:expr:`void *`" -#: ../../library/ctypes.rst:355 msgid ":py:class:`int` or ``None``" -msgstr "" +msgstr ":py:class:`int` または ``None``" -#: ../../library/ctypes.rst:356 msgid "``'P'``" -msgstr "" +msgstr "``'P'``" -#: ../../library/ctypes.rst:357 msgid ":class:`py_object`" -msgstr "" +msgstr ":class:`py_object`" -#: ../../library/ctypes.rst:358 msgid ":c:expr:`PyObject *`" -msgstr "" +msgstr ":c:expr:`PyObject *`" -#: ../../library/ctypes.rst:359 msgid ":py:class:`object`" -msgstr "" +msgstr ":py:class:`object`" #: ../../library/ctypes.rst:360 msgid "``'O'``" msgstr "``'O'``" -#: ../../library/ctypes.rst:361 msgid ":ref:`VARIANT_BOOL `" -msgstr "" +msgstr ":ref:`VARIANT_BOOL `" -#: ../../library/ctypes.rst:362 msgid ":c:expr:`short int`" -msgstr "" +msgstr ":c:expr:`short int`" -#: ../../library/ctypes.rst:364 msgid "``'v'``" -msgstr "" +msgstr "``'v'``" -#: ../../library/ctypes.rst:366 msgid "" "Additionally, if IEC 60559 compatible complex arithmetic (Annex G) is " "supported in both C and ``libffi``, the following complex types are " "available:" msgstr "" +"さらに、C と ``libffi`` の両方が IEC 60559 に準拠した複素数演算 (附属書 G) を" +"サポートする場合、以下の複素数型を利用できます:" -#: ../../library/ctypes.rst:376 msgid ":class:`c_float_complex`" -msgstr "" +msgstr ":class:`c_float_complex`" -#: ../../library/ctypes.rst:377 msgid ":c:expr:`float complex`" -msgstr "" +msgstr ":c:expr:`float complex`" -#: ../../library/ctypes.rst:378 ../../library/ctypes.rst:382 -#: ../../library/ctypes.rst:386 msgid ":py:class:`complex`" -msgstr "" +msgstr ":py:class:`complex`" -#: ../../library/ctypes.rst:379 msgid "``'Zf'``" -msgstr "" +msgstr "``'Zf'``" -#: ../../library/ctypes.rst:380 msgid ":class:`c_double_complex`" -msgstr "" +msgstr ":class:`c_double_complex`" -#: ../../library/ctypes.rst:381 msgid ":c:expr:`double complex`" -msgstr "" +msgstr ":c:expr:`double complex`" -#: ../../library/ctypes.rst:383 msgid "``'Zd'``" -msgstr "" +msgstr "``'Zd'``" -#: ../../library/ctypes.rst:384 msgid ":class:`c_longdouble_complex`" -msgstr "" +msgstr ":class:`c_longdouble_complex`" -#: ../../library/ctypes.rst:385 msgid ":c:expr:`long double complex`" -msgstr "" +msgstr ":c:expr:`long double complex`" -#: ../../library/ctypes.rst:387 msgid "``'Zg'``" -msgstr "" +msgstr "``'Zg'``" -#: ../../library/ctypes.rst:389 msgid "" "The :py:attr:`~_SimpleCData._type_` types ``F``, ``D`` and ``G`` have been " "replaced with ``Zf``, ``Zd`` and ``Zg``." msgstr "" +":py:attr:`~_SimpleCData._type_` の型 ``F``、``D``、``G`` は、``Zf``、``Zd``、" +"``Zg`` に置き換えられました。" #: ../../library/ctypes.rst:394 msgid "" @@ -847,7 +868,6 @@ msgstr "" "これら全ての型はその型を呼び出すことによって作成でき、オプションとして型と値" "が合っている初期化子を指定することができます::" -#: ../../library/ctypes.rst:397 msgid "" ">>> c_int()\n" "c_long(0)\n" @@ -857,28 +877,40 @@ msgid "" "c_ushort(65533)\n" ">>>" msgstr "" +">>> c_int()\n" +"c_long(0)\n" +">>> c_wchar_p(\"Hello, World\")\n" +"c_wchar_p(140018365411392)\n" +">>> c_ushort(-3)\n" +"c_ushort(65533)\n" +">>>" -#: ../../library/ctypes.rst:405 msgid "" "The constructors for numeric types will convert input using :py:meth:" "`~object.__bool__`, :py:meth:`~object.__index__` (for ``int``), :py:meth:" "`~object.__float__` or :py:meth:`~object.__complex__`. This means :py:class:" "`~ctypes.c_bool` accepts any object with a truth value::" msgstr "" +"数値型のコンストラクタは、:py:meth:`~object.__bool__`、:py:meth:`~object." +"__index__` (``int`` の場合)、:py:meth:`~object.__float__`、:py:meth:`~object." +"__complex__` を使って入力を変換します。\n" +"したがって、:py:class:`~ctypes.c_bool` は真偽値を持つ任意のオブジェクトを受け" +"付けます。 ::" -#: ../../library/ctypes.rst:411 msgid "" ">>> empty_list = []\n" ">>> c_bool(empty_list)\n" "c_bool(False)" msgstr "" +">>> empty_list = []\n" +">>> c_bool(empty_list)\n" +"c_bool(False)" #: ../../library/ctypes.rst:415 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "これらの型は変更可能であり、値を後で変更することもできます::" -#: ../../library/ctypes.rst:417 msgid "" ">>> i = c_int(42)\n" ">>> print(i)\n" @@ -890,14 +922,26 @@ msgid "" "-99\n" ">>>" msgstr "" +">>> i = c_int(42)\n" +">>> print(i)\n" +"c_long(42)\n" +">>> print(i.value)\n" +"42\n" +">>> i.value = -99\n" +">>> print(i.value)\n" +"-99\n" +">>>" -#: ../../library/ctypes.rst:427 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " "point to, *not the contents* of the memory block (of course not, because " "Python string objects are immutable)::" msgstr "" +"ポインタ型 :class:`c_char_p`、:class:`c_wchar_p`、:class:`c_void_p` のインス" +"タンスに新しい値を代入すると、そのポインタが指す *メモリ位置* が変わり、メモ" +"リブロックの *内容は変わりません* (Python の文字列オブジェクトは不変なので、" +"当然の動作です)。 ::" #: ../../library/ctypes.rst:432 msgid "" @@ -933,7 +977,6 @@ msgstr "" "ス (あるいは変更) することができます。もし現在のメモリブロックに NUL 終端文字" "列としてアクセスしたいなら、 ``value`` プロパティを使ってください::" -#: ../../library/ctypes.rst:454 msgid "" ">>> from ctypes import *\n" ">>> p = create_string_buffer(3) # create a 3 byte buffer, " @@ -954,14 +997,36 @@ msgid "" "10 b'Hi\\x00lo\\x00\\x00\\x00\\x00\\x00'\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> p = create_string_buffer(3) # NUL バイトで初期化した 3 バイト" +"のバッファを作成します\n" +">>> print(sizeof(p), repr(p.raw))\n" +"3 b'\\x00\\x00\\x00'\n" +">>> p = create_string_buffer(b\"Hello\") # NUL 終端文字列を含むバッファを" +"作成します\n" +">>> print(sizeof(p), repr(p.raw))\n" +"6 b'Hello\\x00'\n" +">>> print(repr(p.value))\n" +"b'Hello'\n" +">>> p = create_string_buffer(b\"Hello\", 10) # 10 バイトのバッファを作成しま" +"す\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hello\\x00\\x00\\x00\\x00\\x00'\n" +">>> p.value = b\"Hi\"\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hi\\x00lo\\x00\\x00\\x00\\x00\\x00'\n" +">>>" -#: ../../library/ctypes.rst:471 msgid "" "The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` " "function (which is still available as an alias). To create a mutable memory " "block containing unicode characters of the C type :c:type:`wchar_t`, use " "the :func:`create_unicode_buffer` function." msgstr "" +":func:`create_string_buffer` 関数は、古い :func:`!c_buffer` 関数を置き換える" +"ものです (後者は別名として引き続き利用できます)。\n" +"C の :c:type:`wchar_t` 型の Unicode 文字を格納する変更可能なメモリブロックを" +"作成するには、:func:`create_unicode_buffer` 関数を使ってください。" #: ../../library/ctypes.rst:480 msgid "Calling functions, continued" @@ -977,7 +1042,6 @@ msgstr "" "することに注意してください。したがって、これらの例はコンソールプロンプトでの" "み動作し、 *IDLE* や *PythonWin* では動作しません。::" -#: ../../library/ctypes.rst:486 msgid "" ">>> printf = libc.printf\n" ">>> printf(b\"Hello, %s\\n\", b\"World!\")\n" @@ -996,27 +1060,46 @@ msgid "" "parameter 2\n" ">>>" msgstr "" +">>> printf = libc.printf\n" +">>> printf(b\"Hello, %s\\n\", b\"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"Hello, %S\\n\", \"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"%d bottles of beer\\n\", 42)\n" +"42 bottles of beer\n" +"19\n" +">>> printf(b\"%f bottles of beer\\n\", 42.5)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert " +"parameter 2\n" +">>>" -#: ../../library/ctypes.rst:502 msgid "" "As has been mentioned before, all Python types except integers, strings, and " "bytes objects have to be wrapped in their corresponding :mod:`!ctypes` type, " "so that they can be converted to the required C data type::" msgstr "" +"前述のとおり、整数、文字列、バイト列オブジェクト以外の Python の型は、必要な " +"C のデータ型に変換できるよう、対応する :mod:`!ctypes` の型でラップする必要が" +"あります。 ::" -#: ../../library/ctypes.rst:506 msgid "" ">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" "An int 1234, a double 3.140000\n" "31\n" ">>>" msgstr "" +">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" +"An int 1234, a double 3.140000\n" +"31\n" +">>>" -#: ../../library/ctypes.rst:514 msgid "Calling variadic functions" -msgstr "" +msgstr "可変長引数関数の呼び出し" -#: ../../library/ctypes.rst:516 msgid "" "On a lot of platforms calling variadic functions through ctypes is exactly " "the same as calling functions with a fixed number of parameters. On some " @@ -1024,28 +1107,32 @@ msgid "" "convention for variadic functions is different than that for regular " "functions." msgstr "" +"多くのプラットフォームでは、ctypes を使った可変長引数関数の呼び出し方は、引数" +"の数が固定の関数とまったく同じです。\n" +"一部のプラットフォーム、特に Apple プラットフォームの ARM64 では、可変長引数" +"関数の呼び出し規約が通常の関数とは異なります。" -#: ../../library/ctypes.rst:521 msgid "" "On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` " "attribute for the regular, non-variadic, function arguments:" msgstr "" +"それらのプラットフォームでは、可変長ではない通常の引数について :attr:" +"`~_CFuncPtr.argtypes` 属性を指定する必要があります:" -#: ../../library/ctypes.rst:524 msgid "libc.printf.argtypes = [ctypes.c_char_p]" -msgstr "" +msgstr "libc.printf.argtypes = [ctypes.c_char_p]" -#: ../../library/ctypes.rst:528 msgid "" "Because specifying the attribute does not inhibit portability it is advised " "to always specify :attr:`~_CFuncPtr.argtypes` for all variadic functions." msgstr "" +"この属性の指定は移植性を損なわないため、すべての可変長引数関数について常に :" +"attr:`~_CFuncPtr.argtypes` を指定することを推奨します。" #: ../../library/ctypes.rst:535 msgid "Calling functions with your own custom data types" msgstr "自作のデータ型とともに関数を呼び出す" -#: ../../library/ctypes.rst:537 msgid "" "You can also customize :mod:`!ctypes` argument conversion to allow instances " "of your own classes be used as function arguments. :mod:`!ctypes` looks for " @@ -1053,8 +1140,13 @@ msgid "" "The attribute must be an integer, string, bytes, a :mod:`!ctypes` instance, " "or an object with an :attr:`!_as_parameter_` attribute::" msgstr "" +":mod:`!ctypes` の引数変換をカスタマイズして、自作クラスのインスタンスを関数の" +"引数として使うこともできます。\n" +":mod:`!ctypes` は :attr:`!_as_parameter_` 属性を探し、その値を関数の引数とし" +"て使用します。\n" +"この属性は、整数、文字列、バイト列、:mod:`!ctypes` のインスタンス、または :" +"attr:`!_as_parameter_` 属性を持つオブジェクトでなければなりません。 ::" -#: ../../library/ctypes.rst:543 msgid "" ">>> class Bottles:\n" "... def __init__(self, number):\n" @@ -1066,25 +1158,35 @@ msgid "" "19\n" ">>>" msgstr "" +">>> class Bottles:\n" +"... def __init__(self, number):\n" +"... self._as_parameter_ = number\n" +"...\n" +">>> bottles = Bottles(42)\n" +">>> printf(b\"%d bottles of beer\\n\", bottles)\n" +"42 bottles of beer\n" +"19\n" +">>>" -#: ../../library/ctypes.rst:553 msgid "" "If you don't want to store the instance's data in the :attr:`!" "_as_parameter_` instance variable, you could define a :deco:`property` which " "makes the attribute available on request." msgstr "" +"インスタンスのデータを :attr:`!_as_parameter_` インスタンス変数に保存したくな" +"い場合は、アクセス時に属性値を提供する :deco:`property` を定義できます。" #: ../../library/ctypes.rst:561 msgid "Specifying the required argument types (function prototypes)" msgstr "要求される引数の型を指定する (関数プロトタイプ)" -#: ../../library/ctypes.rst:563 msgid "" "It is possible to specify the required argument types of functions exported " "from DLLs by setting the :attr:`~_CFuncPtr.argtypes` attribute." msgstr "" +"DLL がエクスポートする関数の引数に必要な型は、:attr:`~_CFuncPtr.argtypes` 属" +"性を設定して指定できます。" -#: ../../library/ctypes.rst:566 msgid "" ":attr:`~_CFuncPtr.argtypes` must be a sequence of C data types (the :func:`!" "printf` function is probably not a good example here, because it takes a " @@ -1092,8 +1194,10 @@ msgid "" "string, on the other hand this is quite handy to experiment with this " "feature)::" msgstr "" +":attr:`~_CFuncPtr.argtypes` は C のデータ型のシーケンスでなければなりません " +"(:func:`!printf` 関数は、書式文字列に応じて引数の数や型が変わるので、ここでは" +"良い例とはいえませんが、この機能を試すには便利です)。 ::" -#: ../../library/ctypes.rst:571 msgid "" ">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" ">>> printf(b\"String '%s', Int %d, Double %f\\n\", b\"Hi\", 10, 2.2)\n" @@ -1101,6 +1205,11 @@ msgid "" "37\n" ">>>" msgstr "" +">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" +">>> printf(b\"String '%s', Int %d, Double %f\\n\", b\"Hi\", 10, 2.2)\n" +"String 'Hi', Int 10, Double 2.200000\n" +"37\n" +">>>" #: ../../library/ctypes.rst:577 msgid "" @@ -1111,7 +1220,6 @@ msgstr "" "(C の関数のプロトタイプのように) 書式を指定すると互換性のない引数型になるのを" "防ぎ、引数を有効な型へ変換しようとします。::" -#: ../../library/ctypes.rst:580 msgid "" ">>> printf(b\"%d %d %d\", 1, 2, 3)\n" "Traceback (most recent call last):\n" @@ -1123,8 +1231,16 @@ msgid "" "13\n" ">>>" msgstr "" +">>> printf(b\"%d %d %d\", 1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be " +"interpreted as ctypes.c_char_p\n" +">>> printf(b\"%s %d %f\\n\", b\"X\", 2, 3)\n" +"X 2 3.000000\n" +"13\n" +">>>" -#: ../../library/ctypes.rst:589 msgid "" "If you have defined your own classes which you pass to function calls, you " "have to implement a :meth:`~_CData.from_param` class method for them to be " @@ -1137,56 +1253,69 @@ msgid "" "bytes, a :mod:`!ctypes` instance, or an object with an :attr:`!" "_as_parameter_` attribute." msgstr "" +"関数呼び出しに渡すための独自クラスを定義した場合、そのクラスを :attr:" +"`~_CFuncPtr.argtypes` シーケンスで使うには :meth:`~_CData.from_param` クラス" +"メソッドを実装する必要があります。\n" +":meth:`~_CData.from_param` クラスメソッドは、関数呼び出しに渡された Python オ" +"ブジェクトを受け取ります。\n" +"型検査など、オブジェクトを受け付けられることを確認するための処理を行い、オブ" +"ジェクト自身、その :attr:`!_as_parameter_` 属性、または C 関数の引数として渡" +"したい値を返してください。\n" +"この場合も、戻り値は整数、文字列、バイト列、:mod:`!ctypes` のインスタンス、ま" +"たは :attr:`!_as_parameter_` 属性を持つオブジェクトである必要があります。" #: ../../library/ctypes.rst:603 msgid "Return types" msgstr "戻り値の型" -#: ../../library/ctypes.rst:613 msgid "" "By default functions are assumed to return the C :c:expr:`int` type. Other " "return types can be specified by setting the :attr:`~_CFuncPtr.restype` " "attribute of the function object." msgstr "" +"デフォルトでは、関数は C の :c:expr:`int` 型を返すと仮定します。\n" +"関数オブジェクトの :attr:`~_CFuncPtr.restype` 属性を設定すれば、ほかの戻り値" +"の型を指定できます。" -#: ../../library/ctypes.rst:617 msgid "" "The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:" "type:`time_t` might be of a different type than the default return type :c:" "expr:`int`, you should specify the :attr:`!restype` attribute::" msgstr "" +":c:func:`time` の C プロトタイプは ``time_t time(time_t *)`` です。\n" +":c:type:`time_t` は、デフォルトの戻り値の型 :c:expr:`int` と異なる場合がある" +"ため、:attr:`!restype` 属性を指定する必要があります。 ::" -#: ../../library/ctypes.rst:621 msgid ">>> libc.time.restype = c_time_t" -msgstr "" +msgstr ">>> libc.time.restype = c_time_t" -#: ../../library/ctypes.rst:623 msgid "The argument types can be specified using :attr:`~_CFuncPtr.argtypes`::" -msgstr "" +msgstr "引数の型は :attr:`~_CFuncPtr.argtypes` を使って指定できます。 ::" -#: ../../library/ctypes.rst:625 msgid ">>> libc.time.argtypes = (POINTER(c_time_t),)" -msgstr "" +msgstr ">>> libc.time.argtypes = (POINTER(c_time_t),)" -#: ../../library/ctypes.rst:627 msgid "" "To call the function with a ``NULL`` pointer as first argument, use " "``None``::" msgstr "" +"第 1 引数に ``NULL`` ポインタを渡して関数を呼び出すには、``None`` を使いま" +"す。 ::" -#: ../../library/ctypes.rst:629 msgid "" ">>> print(libc.time(None))\n" "1150640792" msgstr "" +">>> print(libc.time(None))\n" +"1150640792" -#: ../../library/ctypes.rst:632 msgid "" "Here is a more advanced example, it uses the :func:`!strchr` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" +"もう少し高度な例として、文字列へのポインタと char を受け取り、文字列へのポイ" +"ンタを返す :func:`!strchr` 関数を使います。 ::" -#: ../../library/ctypes.rst:635 msgid "" ">>> strchr = libc.strchr\n" ">>> strchr(b\"abcdef\", ord(\"d\"))\n" @@ -1198,15 +1327,26 @@ msgid "" "None\n" ">>>" msgstr "" +">>> strchr = libc.strchr\n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" +"8059983\n" +">>> strchr.restype = c_char_p # c_char_p は文字列へのポインタです\n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" +"b'def'\n" +">>> print(strchr(b\"abcdef\", ord(\"x\")))\n" +"None\n" +">>>" -#: ../../library/ctypes.rst:645 msgid "" "If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " "the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be " "converted from a single character Python bytes object into a C char:" msgstr "" +"上の例の :func:`ord(\"x\") ` の呼び出しを省くには、:attr:`~_CFuncPtr." +"argtypes` 属性を設定します。\n" +"これにより、第 2 引数が 1 文字の Python バイト列オブジェクトから C の char に" +"変換されます:" -#: ../../library/ctypes.rst:649 msgid "" ">>> strchr.restype = c_char_p\n" ">>> strchr.argtypes = [c_char_p, c_char]\n" @@ -1222,8 +1362,20 @@ msgid "" "b'def'\n" ">>>" msgstr "" +">>> strchr.restype = c_char_p\n" +">>> strchr.argtypes = [c_char_p, c_char]\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>> strchr(b\"abcdef\", b\"def\")\n" +"Traceback (most recent call last):\n" +"ctypes.ArgumentError: argument 2: TypeError: one character bytes, bytearray " +"or integer expected\n" +">>> print(strchr(b\"abcdef\", b\"x\"))\n" +"None\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>>" -#: ../../library/ctypes.rst:664 msgid "" "You can also use a callable Python object (a function or a class for " "example) as the :attr:`~_CFuncPtr.restype` attribute, if the foreign " @@ -1232,8 +1384,12 @@ msgid "" "result of your function call. This is useful to check for error return " "values and automatically raise an exception::" msgstr "" +"外部関数が整数を返す場合、:attr:`~_CFuncPtr.restype` 属性に、関数やクラスなど" +"の Python の呼び出し可能オブジェクトを使うこともできます。\n" +"C 関数が返した *整数* を引数としてそのオブジェクトが呼び出され、その結果が関" +"数呼び出しの結果として使われます。\n" +"これは、戻り値のエラーを検査して例外を自動的に送出するのに役立ちます。 ::" -#: ../../library/ctypes.rst:670 msgid "" ">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" ">>> def ValidHandle(value):\n" @@ -1252,6 +1408,22 @@ msgid "" "OSError: [Errno 126] The specified module could not be found.\n" ">>>" msgstr "" +">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" +">>> def ValidHandle(value):\n" +"... if value == 0:\n" +"... raise WinError()\n" +"... return value\n" +"...\n" +">>>\n" +">>> GetModuleHandle.restype = ValidHandle\n" +">>> GetModuleHandle(None)\n" +"486539264\n" +">>> GetModuleHandle(\"something silly\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 3, in ValidHandle\n" +"OSError: [Errno 126] The specified module could not be found.\n" +">>>" #: ../../library/ctypes.rst:687 msgid "" @@ -1265,12 +1437,14 @@ msgstr "" "オプションでエラーコードパラメータを取ります。このパラメータが使われない場合" "は、エラーコードを取り出すために :func:`GetLastError` を呼び出します。" -#: ../../library/ctypes.rst:692 msgid "" "Please note that a much more powerful error checking mechanism is available " "through the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual " "for details." msgstr "" +":attr:`~_CFuncPtr.errcheck` 属性を使うと、さらに強力なエラー検査の仕組みを利" +"用できます。\n" +"詳細はリファレンスマニュアルを参照してください。" #: ../../library/ctypes.rst:700 msgid "Passing pointers (or: passing parameters by reference)" @@ -1288,7 +1462,6 @@ msgstr "" "タが大きすぎて値渡しできない場合です。これは *パラメータの参照渡し* としても" "知られています。" -#: ../../library/ctypes.rst:706 msgid "" ":mod:`!ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" @@ -1296,8 +1469,13 @@ msgid "" "constructs a real pointer object, so it is faster to use :func:`byref` if " "you don't need the pointer object in Python itself::" msgstr "" +":mod:`!ctypes` は、引数を参照渡しするための :func:`byref` 関数をエクスポート" +"します。\n" +":func:`pointer` 関数でも同じ効果を得られますが、:func:`pointer` は実際のポイ" +"ンタオブジェクトを構築するため、より多くの処理を行います。\n" +"Python 側でポインタオブジェクト自体が必要なければ、:func:`byref` の方が高速で" +"す。 ::" -#: ../../library/ctypes.rst:712 msgid "" ">>> i = c_int()\n" ">>> f = c_float()\n" @@ -1311,12 +1489,22 @@ msgid "" "1 3.1400001049 b'Hello'\n" ">>>" msgstr "" +">>> i = c_int()\n" +">>> f = c_float()\n" +">>> s = create_string_buffer(b'\\000' * 32)\n" +">>> print(i.value, f.value, repr(s.value))\n" +"0 0.0 b''\n" +">>> libc.sscanf(b\"1 3.14 Hello\", b\"%d %f %s\",\n" +"... byref(i), byref(f), s)\n" +"3\n" +">>> print(i.value, f.value, repr(s.value))\n" +"1 3.1400001049 b'Hello'\n" +">>>" #: ../../library/ctypes.rst:728 msgid "Structures and unions" msgstr "構造体と共用体" -#: ../../library/ctypes.rst:730 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" "`Union` base classes which are defined in the :mod:`!ctypes` module. Each " @@ -1324,12 +1512,19 @@ msgid "" "_fields_` must be a list of *2-tuples*, containing a *field name* and a " "*field type*." msgstr "" +"構造体と共用体は、:mod:`!ctypes` モジュールが定義する :class:`Structure` と :" +"class:`Union` の基底クラスから派生させる必要があります。\n" +"各サブクラスには :attr:`~Structure._fields_` 属性を定義する必要があります。\n" +":attr:`!_fields_` は、*フィールド名* と *フィールドの型* を含む *2 要素のタプ" +"ル* のリストでなければなりません。" -#: ../../library/ctypes.rst:735 msgid "" "The field type must be a :mod:`!ctypes` type like :class:`c_int`, or any " "other derived :mod:`!ctypes` type: structure, union, array, pointer." msgstr "" +"フィールドの型は、:class:`c_int` などの :mod:`!ctypes` の型、または構造体、共" +"用体、配列、ポインタなど、ほかの派生した :mod:`!ctypes` の型でなければなりま" +"せん。" #: ../../library/ctypes.rst:738 msgid "" @@ -1340,7 +1535,6 @@ msgstr "" "以下は、 *x* と *y* という名前の二つの整数からなる簡単な POINT 構造体の例で" "す。コンストラクタで構造体を初期化する方法も説明しています::" -#: ../../library/ctypes.rst:741 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -1359,6 +1553,22 @@ msgid "" "TypeError: too many initializers\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = [(\"x\", c_int),\n" +"... (\"y\", c_int)]\n" +"...\n" +">>> point = POINT(10, 20)\n" +">>> print(point.x, point.y)\n" +"10 20\n" +">>> point = POINT(y=5)\n" +">>> print(point.x, point.y)\n" +"0 5\n" +">>> POINT(1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: too many initializers\n" +">>>" #: ../../library/ctypes.rst:758 msgid "" @@ -1376,7 +1586,6 @@ msgstr "" "*upperleft* と *lowerright* という名前の二つの POINT を持つ RECT 構造体で" "す。::" -#: ../../library/ctypes.rst:764 msgid "" ">>> class RECT(Structure):\n" "... _fields_ = [(\"upperleft\", POINT),\n" @@ -1389,6 +1598,16 @@ msgid "" "0 0\n" ">>>" msgstr "" +">>> class RECT(Structure):\n" +"... _fields_ = [(\"upperleft\", POINT),\n" +"... (\"lowerright\", POINT)]\n" +"...\n" +">>> rc = RECT(point)\n" +">>> print(rc.upperleft.x, rc.upperleft.y)\n" +"0 5\n" +">>> print(rc.lowerright.x, rc.lowerright.y)\n" +"0 0\n" +">>>" #: ../../library/ctypes.rst:775 msgid "" @@ -1398,20 +1617,22 @@ msgstr "" "入れ子になった構造体はいくつかの方法を用いてコンストラクタで初期化することが" "できます。::" -#: ../../library/ctypes.rst:777 msgid "" ">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" ">>> r = RECT((1, 2), (3, 4))" msgstr "" +">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" +">>> r = RECT((1, 2), (3, 4))" -#: ../../library/ctypes.rst:780 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " "useful for debugging because they can provide useful information. See :class:" "`CField`::" msgstr "" +"フィールドの :term:`descriptor` は *クラス* から取得でき、有用な情報を提供す" +"るためデバッグに役立ちます。\n" +":class:`CField` を参照してください。 ::" -#: ../../library/ctypes.rst:784 msgid "" ">>> POINT.x\n" "\n" @@ -1419,26 +1640,39 @@ msgid "" "\n" ">>>" msgstr "" +">>> POINT.x\n" +"\n" +">>> POINT.y\n" +"\n" +">>>" -#: ../../library/ctypes.rst:795 msgid "" ":mod:`!ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " "guaranteed by the library to work in the general case. Unions and " "structures with bit-fields should always be passed to functions by pointer." msgstr "" +":mod:`!ctypes` は、共用体やビットフィールドを持つ構造体を関数に値渡しすること" +"をサポートしていません。\n" +"32 ビットの x86 では動作することもありますが、一般に動作することはライブラリ" +"では保証していません。\n" +"共用体やビットフィールドを持つ構造体は、常にポインタとして関数に渡してくださ" +"い。" -#: ../../library/ctypes.rst:801 msgid "Structure/union layout, alignment and byte order" -msgstr "" +msgstr "構造体と共用体のレイアウト、アラインメント、バイト順序" -#: ../../library/ctypes.rst:803 msgid "" "By default, Structure and Union fields are laid out in the same way the C " "compiler does it. It is possible to override this behavior entirely by " "specifying a :attr:`~Structure._layout_` class attribute in the subclass " "definition; see the attribute documentation for details." msgstr "" +"デフォルトでは、``Structure`` と ``Union`` のフィールドは C コンパイラと同じ" +"方法で配置されます。\n" +"サブクラス定義で :attr:`~Structure._layout_` クラス属性を指定すれば、この動作" +"を完全に上書きできます。\n" +"詳細はこの属性のドキュメントを参照してください。" #: ../../library/ctypes.rst:808 msgid "" @@ -1448,7 +1682,6 @@ msgid "" "documentation for details." msgstr "" -#: ../../library/ctypes.rst:813 msgid "" ":mod:`!ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -1456,19 +1689,25 @@ msgid "" "`BigEndianUnion`, and :class:`LittleEndianUnion` base classes. These " "classes cannot contain pointer fields." msgstr "" +":mod:`!ctypes` は、構造体と共用体にネイティブのバイト順序を使用します。\n" +"ネイティブでないバイト順序の構造体を作るには、:class:`BigEndianStructure`、:" +"class:`LittleEndianStructure`、:class:`BigEndianUnion`、:class:" +"`LittleEndianUnion` のいずれかを基底クラスとして使えます。\n" +"これらのクラスにはポインタフィールドを含められません。" #: ../../library/ctypes.rst:823 msgid "Bit fields in structures and unions" msgstr "構造体と共用体におけるビットフィールド" -#: ../../library/ctypes.rst:825 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " "the third item in the :attr:`~Structure._fields_` tuples::" msgstr "" +"ビットフィールドを含む構造体や共用体も作成できます。\n" +"ビットフィールドにできるのは整数フィールドだけで、ビット幅は :attr:" +"`~Structure._fields_` のタプルの第 3 要素として指定します。 ::" -#: ../../library/ctypes.rst:829 msgid "" ">>> class Int(Structure):\n" "... _fields_ = [(\"first_16\", c_int, 16),\n" @@ -1479,8 +1718,15 @@ msgid "" ">>> print(Int.second_16)\n" "" msgstr "" +">>> class Int(Structure):\n" +"... _fields_ = [(\"first_16\", c_int, 16),\n" +"... (\"second_16\", c_int, 16)]\n" +"...\n" +">>> print(Int.first_16)\n" +"\n" +">>> print(Int.second_16)\n" +"" -#: ../../library/ctypes.rst:838 msgid "" "It is important to note that bit field allocation and layout in memory are " "not defined as a C standard; their implementation is compiler-specific. By " @@ -1488,6 +1734,12 @@ msgid "" "for the current platform. See the :attr:`~Structure._layout_` attribute for " "details on the default behavior and how to change it." msgstr "" +"ビットフィールドのメモリ内での割り当てやレイアウトは C 標準では定義されておら" +"ず、コンパイラ固有の実装であることに注意してください。\n" +"デフォルトでは、Python は現在のプラットフォームの「ネイティブ」コンパイラの動" +"作に合わせようとします。\n" +"デフォルトの動作とその変更方法については、:attr:`~Structure._layout_` 属性を" +"参照してください。" #: ../../library/ctypes.rst:849 msgid "Arrays" @@ -1506,9 +1758,8 @@ msgid "" "a positive integer::" msgstr "推奨されている配列の作成方法はデータ型に正の整数を掛けることです。::" -#: ../../library/ctypes.rst:856 msgid "TenPointsArrayType = POINT * 10" -msgstr "" +msgstr "TenPointsArrayType = POINT * 10" #: ../../library/ctypes.rst:858 msgid "" @@ -1518,7 +1769,6 @@ msgstr "" "ややわざとらしいデータ型の例になりますが、他のものに混ざって 4 個の POINT が" "ある構造体です::" -#: ../../library/ctypes.rst:861 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -1533,17 +1783,31 @@ msgid "" "4\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class MyStruct(Structure):\n" +"... _fields_ = [(\"a\", c_int),\n" +"... (\"b\", c_float),\n" +"... (\"point_array\", POINT * 4)]\n" +">>>\n" +">>> print(len(MyStruct().point_array))\n" +"4\n" +">>>" #: ../../library/ctypes.rst:874 msgid "Instances are created in the usual way, by calling the class::" msgstr "インスタンスはクラスを呼び出す通常の方法で作成します。::" -#: ../../library/ctypes.rst:876 msgid "" "arr = TenPointsArrayType()\n" "for pt in arr:\n" " print(pt.x, pt.y)" msgstr "" +"arr = TenPointsArrayType()\n" +"for pt in arr:\n" +" print(pt.x, pt.y)" #: ../../library/ctypes.rst:880 msgid "" @@ -1557,7 +1821,6 @@ msgstr "" msgid "Initializers of the correct type can also be specified::" msgstr "正しい型の初期化子を指定することもできます。::" -#: ../../library/ctypes.rst:885 msgid "" ">>> from ctypes import *\n" ">>> TenIntegers = c_int * 10\n" @@ -1569,24 +1832,37 @@ msgid "" "1 2 3 4 5 6 7 8 9 10\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> TenIntegers = c_int * 10\n" +">>> ii = TenIntegers(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n" +">>> print(ii)\n" +"\n" +">>> for i in ii: print(i, end=\" \")\n" +"...\n" +"1 2 3 4 5 6 7 8 9 10\n" +">>>" #: ../../library/ctypes.rst:899 msgid "Pointers" msgstr "ポインタ" -#: ../../library/ctypes.rst:901 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`!ctypes` type::" msgstr "" +":mod:`!ctypes` の型のオブジェクトに対して :func:`pointer` 関数を呼び出すと、" +"ポインタインスタンスが作成されます。 ::" -#: ../../library/ctypes.rst:904 msgid "" ">>> from ctypes import *\n" ">>> i = c_int(42)\n" ">>> pi = pointer(i)\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> i = c_int(42)\n" +">>> pi = pointer(i)\n" +">>>" #: ../../library/ctypes.rst:909 msgid "" @@ -1596,20 +1872,22 @@ msgstr "" "次のように、ポインタインスタンスは、ポインタが指すオブジェクト (上の例では " "``i``) を返す :attr:`~_Pointer.contents` 属性を持ちます::" -#: ../../library/ctypes.rst:912 msgid "" ">>> pi.contents\n" "c_long(42)\n" ">>>" msgstr "" +">>> pi.contents\n" +"c_long(42)\n" +">>>" -#: ../../library/ctypes.rst:916 msgid "" "Note that :mod:`!ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" +":mod:`!ctypes` は OOR (元のオブジェクトを返すこと) を行いません。\n" +"属性を取得するたびに、同等の新しいオブジェクトを構築します。 ::" -#: ../../library/ctypes.rst:919 msgid "" ">>> pi.contents is i\n" "False\n" @@ -1617,6 +1895,11 @@ msgid "" "False\n" ">>>" msgstr "" +">>> pi.contents is i\n" +"False\n" +">>> pi.contents is pi.contents\n" +"False\n" +">>>" #: ../../library/ctypes.rst:925 msgid "" @@ -1627,7 +1910,6 @@ msgstr "" "別の :class:`c_int` インスタンスがポインタの contents 属性に代入されると、こ" "れが記憶されているメモリ位置を指すポインタに変化します。::" -#: ../../library/ctypes.rst:928 msgid "" ">>> i = c_int(99)\n" ">>> pi.contents = i\n" @@ -1635,23 +1917,29 @@ msgid "" "c_long(99)\n" ">>>" msgstr "" +">>> i = c_int(99)\n" +">>> pi.contents = i\n" +">>> pi.contents\n" +"c_long(99)\n" +">>>" #: ../../library/ctypes.rst:937 msgid "Pointer instances can also be indexed with integers::" msgstr "ポインタインスタンスは整数でインデックス指定することもできます。::" -#: ../../library/ctypes.rst:939 msgid "" ">>> pi[0]\n" "99\n" ">>>" msgstr "" +">>> pi[0]\n" +"99\n" +">>>" #: ../../library/ctypes.rst:943 msgid "Assigning to an integer index changes the pointed to value::" msgstr "整数インデックスへ代入するとポインタが指す値が変更されます。::" -#: ../../library/ctypes.rst:945 msgid "" ">>> print(i)\n" "c_long(99)\n" @@ -1660,6 +1948,12 @@ msgid "" "c_long(22)\n" ">>>" msgstr "" +">>> print(i)\n" +"c_long(99)\n" +">>> pi[0] = 22\n" +">>> print(i)\n" +"c_long(22)\n" +">>>" #: ../../library/ctypes.rst:952 msgid "" @@ -1675,7 +1969,6 @@ msgstr "" "のポインタが単一の要素ではなく実際に配列を指していると *分かっている* 場合だ" "けです。" -#: ../../library/ctypes.rst:960 msgid "" "Because pointer objects support subscription, they implicitly support :term:" "`iteration `. Unless doing this in a controlled manner, such as by " @@ -1684,16 +1977,24 @@ msgid "" "knowing when to stop iteration. In other words, a ``pointer`` iterator will " "infinitely yield arbitrary memory." msgstr "" +"ポインタオブジェクトは添字付けをサポートするため、暗黙に :term:`反復 " +"` もサポートします。\n" +"ただし、:func:`pointer` のイテレータに対して :func:`next` を手動で呼び出すな" +"ど、制御しながら使わないと、通常は無限ループやクラッシュを引き起こします。\n" +"ctypes には反復をどこで終了すればよいか判断する方法がないためです。\n" +"つまり、``pointer`` のイテレータは任意のメモリの内容を際限なく yield します。" -#: ../../library/ctypes.rst:967 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " "the :func:`POINTER` function, which accepts any :mod:`!ctypes` type, and " "returns a new type::" msgstr "" +":func:`pointer` 関数は、内部では単にポインタインスタンスを作るだけでなく、ま" +"ずポインタの *型* を作る必要があります。\n" +"これには、任意の :mod:`!ctypes` の型を受け取り、新しい型を返す :func:" +"`POINTER` 関数を使います。 ::" -#: ../../library/ctypes.rst:972 msgid "" ">>> PI = POINTER(c_int)\n" ">>> PI\n" @@ -1706,6 +2007,16 @@ msgid "" "\n" ">>>" msgstr "" +">>> PI = POINTER(c_int)\n" +">>> PI\n" +"\n" +">>> PI(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: expected c_long instead of int\n" +">>> PI(c_int(42))\n" +"\n" +">>>" #: ../../library/ctypes.rst:983 msgid "" @@ -1715,21 +2026,25 @@ msgstr "" "ポインタ型を引数なしで呼び出すと ``NULL`` ポインタを作成します。 ``NULL`` ポ" "インタは ``False`` ブール値を持っています。::" -#: ../../library/ctypes.rst:986 msgid "" ">>> null_ptr = POINTER(c_int)()\n" ">>> print(bool(null_ptr))\n" "False\n" ">>>" msgstr "" +">>> null_ptr = POINTER(c_int)()\n" +">>> print(bool(null_ptr))\n" +"False\n" +">>>" -#: ../../library/ctypes.rst:991 msgid "" ":mod:`!ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" +":mod:`!ctypes` は、ポインタを参照外しする際に ``NULL`` かどうかを検査します " +"(ただし、``NULL`` でない無効なポインタを参照外しすると Python はクラッシュし" +"ます)。 ::" -#: ../../library/ctypes.rst:994 msgid "" ">>> null_ptr[0]\n" "Traceback (most recent call last):\n" @@ -1743,26 +2058,40 @@ msgid "" "ValueError: NULL pointer access\n" ">>>" msgstr "" +">>> null_ptr[0]\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>\n" +"\n" +">>> null_ptr[0] = 1234\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>" -#: ../../library/ctypes.rst:1009 msgid "Thread safety without the GIL" -msgstr "" +msgstr "GIL のない環境でのスレッド安全性" -#: ../../library/ctypes.rst:1011 msgid "" "From Python 3.13 onward, the :term:`GIL` can be disabled on the :term:`free-" "threaded build`. In ctypes, reads and writes to a single object concurrently " "is safe, but not across multiple objects:" msgstr "" +"Python 3.13 以降では、:term:`free-threaded build` で :term:`GIL` を無効にでき" +"ます。\n" +"ctypes では、単一のオブジェクトに対する並行した読み書きは安全ですが、複数のオ" +"ブジェクトを通じた並行した読み書きは安全ではありません:" -#: ../../library/ctypes.rst:1014 msgid "" ">>> number = c_int(42)\n" ">>> pointer_a = pointer(number)\n" ">>> pointer_b = pointer(number)" msgstr "" +">>> number = c_int(42)\n" +">>> pointer_a = pointer(number)\n" +">>> pointer_b = pointer(number)" -#: ../../library/ctypes.rst:1020 msgid "" "In the above, it's only safe for one object to read and write to the address " "at once if the GIL is disabled. So, ``pointer_a`` can be shared and written " @@ -1770,6 +2099,12 @@ msgid "" "to do the same. If this is an issue, consider using a :class:`threading." "Lock` to synchronize access to memory:" msgstr "" +"上の例で GIL が無効の場合、同じアドレスに対して一度に安全に読み書きできるの" +"は、1 つのオブジェクトだけです。\n" +"したがって、複数のスレッドで ``pointer_a`` を共有して書き込むことはできます" +"が、``pointer_b`` が同じことをしようとしていない場合に限られます。\n" +"これが問題になる場合は、:class:`threading.Lock` を使ってメモリへのアクセスを" +"同期することを検討してください:" #: ../../library/ctypes.rst:1025 msgid "" @@ -1787,7 +2122,6 @@ msgstr "" msgid "Type conversions" msgstr "型変換" -#: ../../library/ctypes.rst:1042 msgid "" "Usually, ctypes does strict type checking. This means, if you have " "``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or " @@ -1797,8 +2131,16 @@ msgid "" "array instances instead of pointer types. So, for ``POINTER(c_int)``, " "ctypes accepts an array of c_int::" msgstr "" +"通常、ctypes は厳密な型検査を行います。\n" +"例えば、関数の :attr:`~_CFuncPtr.argtypes` リストや構造体定義のメンバーフィー" +"ルドの型に ``POINTER(c_int)`` を指定した場合、まったく同じ型のインスタンスし" +"か受け付けません。\n" +"ただし、この規則には例外があり、ctypes がほかのオブジェクトを受け付ける場合も" +"あります。\n" +"例えば、ポインタ型の代わりに、互換性のある配列インスタンスを渡せます。\n" +"そのため、``POINTER(c_int)`` に対しては、ctypes は c_int の配列を受け付けま" +"す。 ::" -#: ../../library/ctypes.rst:1049 msgid "" ">>> class Bar(Structure):\n" "... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" @@ -1814,8 +2156,20 @@ msgid "" "3\n" ">>>" msgstr "" +">>> class Bar(Structure):\n" +"... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" +"...\n" +">>> bar = Bar()\n" +">>> bar.values = (c_int * 3)(1, 2, 3)\n" +">>> bar.count = 3\n" +">>> for i in range(bar.count):\n" +"... print(bar.values[i])\n" +"...\n" +"1\n" +"2\n" +"3\n" +">>>" -#: ../../library/ctypes.rst:1063 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " "type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object " @@ -1823,6 +2177,10 @@ msgid "" "ctypes will apply the required :func:`byref` conversion in this case " "automatically." msgstr "" +"さらに、:attr:`~_CFuncPtr.argtypes` で関数の引数を ``POINTER(c_int)`` などの" +"ポインタ型として明示的に宣言した場合、参照先の型 (この場合は ``c_int``) のオ" +"ブジェクトを関数に渡せます。\n" +"この場合、ctypes は必要な :func:`byref` 変換を自動的に適用します。" #: ../../library/ctypes.rst:1068 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" @@ -1830,13 +2188,13 @@ msgstr "" "POINTER型フィールドを ``NULL`` に設定するために、 ``None`` を代入してもかまい" "ません。::" -#: ../../library/ctypes.rst:1070 msgid "" ">>> bar.values = None\n" ">>>" msgstr "" +">>> bar.values = None\n" +">>>" -#: ../../library/ctypes.rst:1075 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`!ctypes` provides a :func:`cast` function " @@ -1844,8 +2202,13 @@ msgid "" "accepts ``POINTER(c_int)`` pointers or :class:`c_int` arrays for its " "``values`` field, but not instances of other types::" msgstr "" +"互換性のない型のインスタンスを扱うこともあります。\n" +"C では、ある型を別の型にキャストできます。\n" +":mod:`!ctypes` には、同じように使える :func:`cast` 関数があります。\n" +"上で定義した ``Bar`` 構造体の ``values`` フィールドは、``POINTER(c_int)`` ポ" +"インタや :class:`c_int` 配列を受け付けますが、ほかの型のインスタンスは受け付" +"けません。 ::" -#: ../../library/ctypes.rst:1081 msgid "" ">>> bar.values = (c_byte * 4)()\n" "Traceback (most recent call last):\n" @@ -1854,6 +2217,12 @@ msgid "" "instance\n" ">>>" msgstr "" +">>> bar.values = (c_byte * 4)()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long " +"instance\n" +">>>" #: ../../library/ctypes.rst:1087 msgid "For these cases, the :func:`cast` function is handy." @@ -1873,13 +2242,16 @@ msgstr "" "ります。そして、第二引数のインスタンスを返します。このインスタンスは第一引数" "と同じメモリブロックを参照しています::" -#: ../../library/ctypes.rst:1095 msgid "" ">>> a = (c_byte * 4)()\n" ">>> cast(a, POINTER(c_int))\n" "\n" ">>>" msgstr "" +">>> a = (c_byte * 4)()\n" +">>> cast(a, POINTER(c_int))\n" +"\n" +">>>" #: ../../library/ctypes.rst:1100 msgid "" @@ -1889,7 +2261,6 @@ msgstr "" "したがって、 :func:`cast` を ``Bar`` 構造体の ``values`` フィールドへ代入する" "ために使うことができます::" -#: ../../library/ctypes.rst:1103 msgid "" ">>> bar = Bar()\n" ">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" @@ -1897,6 +2268,11 @@ msgid "" "0\n" ">>>" msgstr "" +">>> bar = Bar()\n" +">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" +">>> print(bar.values[0])\n" +"0\n" +">>>" #: ../../library/ctypes.rst:1113 msgid "Incomplete Types" @@ -1911,7 +2287,6 @@ msgstr "" "*不完全型* はメンバーがまだ指定されていない構造体、共用体もしくは配列です。 " "C では、前方宣言により指定され、後で定義されます。::" -#: ../../library/ctypes.rst:1119 msgid "" "struct cell; /* forward declaration */\n" "\n" @@ -1920,6 +2295,12 @@ msgid "" " struct cell *next;\n" "};" msgstr "" +"struct cell; /* 前方宣言 */\n" +"\n" +"struct cell {\n" +" char *name;\n" +" struct cell *next;\n" +"};" #: ../../library/ctypes.rst:1126 msgid "" @@ -1928,7 +2309,6 @@ msgid "" msgstr "" "ctypes コードへの直接的な変換ではこうなるでしょう。しかし、動作しません::" -#: ../../library/ctypes.rst:1129 msgid "" ">>> class cell(Structure):\n" "... _fields_ = [(\"name\", c_char_p),\n" @@ -1940,15 +2320,26 @@ msgid "" "NameError: name 'cell' is not defined\n" ">>>" msgstr "" +">>> class cell(Structure):\n" +"... _fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 2, in cell\n" +"NameError: name 'cell' is not defined\n" +">>>" -#: ../../library/ctypes.rst:1139 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`!ctypes`, we can define the ``cell`` class and set the :" "attr:`~Structure._fields_` attribute later, after the class statement::" msgstr "" +"これは、新しい ``class cell`` が、そのクラス文の内部ではまだ利用できないため" +"です。\n" +":mod:`!ctypes` では、まず ``cell`` クラスを定義し、クラス文の後で :attr:" +"`~Structure._fields_` 属性を設定できます。 ::" -#: ../../library/ctypes.rst:1143 msgid "" ">>> from ctypes import *\n" ">>> class cell(Structure):\n" @@ -1958,6 +2349,13 @@ msgid "" "... (\"next\", POINTER(cell))]\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> class cell(Structure):\n" +"... pass\n" +"...\n" +">>> cell._fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +">>>" #: ../../library/ctypes.rst:1151 msgid "" @@ -1988,11 +2386,13 @@ msgstr "" msgid "Callback functions" msgstr "コールバック関数" -#: ../../library/ctypes.rst:1174 msgid "" ":mod:`!ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" +":mod:`!ctypes` を使うと、Python の呼び出し可能オブジェクトから、C で呼び出せ" +"る関数ポインタを作成できます。\n" +"これらは *コールバック関数* と呼ばれることもあります。" #: ../../library/ctypes.rst:1177 msgid "" @@ -2024,14 +2424,15 @@ msgstr "" "これらのファクトリ関数はともに最初の引数に戻り値の型、残りの引数としてコール" "バック関数が想定する引数の型を渡して呼び出されます。" -#: ../../library/ctypes.rst:1190 msgid "" "I will present an example here which uses the standard C library's :c:func:`!" "qsort` function, that is used to sort items with the help of a callback " "function. :c:func:`!qsort` will be used to sort an array of integers::" msgstr "" +"ここでは、標準 C ライブラリの :c:func:`!qsort` 関数を使う例を示します。\n" +"この関数は、コールバック関数を使って要素をソートします。\n" +":c:func:`!qsort` で整数の配列をソートしてみます。 ::" -#: ../../library/ctypes.rst:1194 msgid "" ">>> IntArray5 = c_int * 5\n" ">>> ia = IntArray5(5, 1, 7, 33, 99)\n" @@ -2039,8 +2440,12 @@ msgid "" ">>> qsort.restype = None\n" ">>>" msgstr "" +">>> IntArray5 = c_int * 5\n" +">>> ia = IntArray5(5, 1, 7, 33, 99)\n" +">>> qsort = libc.qsort\n" +">>> qsort.restype = None\n" +">>>" -#: ../../library/ctypes.rst:1200 msgid "" ":func:`!qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " @@ -2049,6 +2454,12 @@ msgid "" "is smaller than the second, a zero if they are equal, and a positive integer " "otherwise." msgstr "" +":func:`!qsort` は、ソートするデータへのポインタ、データ配列の要素数、1 要素の" +"サイズ、比較関数であるコールバックへのポインタを渡して呼び出す必要がありま" +"す。\n" +"コールバックは、要素への 2 つのポインタを引数として呼び出されます。\n" +"最初の要素が 2 番目より小さければ負の整数、等しければゼロ、それ以外なら正の整" +"数を返す必要があります。" #: ../../library/ctypes.rst:1206 msgid "" @@ -2058,11 +2469,12 @@ msgstr "" "コールバック関数は整数へのポインタを受け取り、整数を返す必要があります。ま" "ず、コールバック関数のための ``type`` を作成します。::" -#: ../../library/ctypes.rst:1209 msgid "" ">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" ">>>" msgstr "" +">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +">>>" #: ../../library/ctypes.rst:1212 msgid "" @@ -2071,7 +2483,6 @@ msgid "" msgstr "" "まず初めに、これが受け取った変数を表示するだけのシンプルなコールバックです::" -#: ../../library/ctypes.rst:1215 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -2079,13 +2490,18 @@ msgid "" "...\n" ">>> cmp_func = CMPFUNC(py_cmp_func)\n" ">>>" -msgstr "" +msgstr "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return 0\n" +"...\n" +">>> cmp_func = CMPFUNC(py_cmp_func)\n" +">>>" #: ../../library/ctypes.rst:1222 msgid "The result::" msgstr "結果は以下の通りです::" -#: ../../library/ctypes.rst:1224 msgid "" ">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" "py_cmp_func 5 1\n" @@ -2095,12 +2511,18 @@ msgid "" "py_cmp_func 1 7\n" ">>>" msgstr "" +">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 5 7\n" +"py_cmp_func 1 7\n" +">>>" #: ../../library/ctypes.rst:1232 msgid "Now we can actually compare the two items and return a useful result::" msgstr "ここで 2 つの要素を実際に比較し、役に立つ結果を返します::" -#: ../../library/ctypes.rst:1234 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -2115,18 +2537,33 @@ msgid "" "py_cmp_func 5 7\n" ">>>" msgstr "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>>\n" +">>> qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func))\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" #: ../../library/ctypes.rst:1247 msgid "As we can easily check, our array is sorted now::" msgstr "簡単に確認できるように、配列を次のようにソートしました::" -#: ../../library/ctypes.rst:1249 msgid "" ">>> for i in ia: print(i, end=\" \")\n" "...\n" "1 5 7 33 99\n" ">>>" msgstr "" +">>> for i in ia: print(i, end=\" \")\n" +"...\n" +"1 5 7 33 99\n" +">>>" #: ../../library/ctypes.rst:1254 msgid "" @@ -2136,7 +2573,6 @@ msgstr "" "関数ファクトリはデコレータファクトリとしても使えるので、次のようにも書けま" "す::" -#: ../../library/ctypes.rst:1257 msgid "" ">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" "... def py_cmp_func(a, b):\n" @@ -2151,13 +2587,29 @@ msgid "" "py_cmp_func 5 7\n" ">>>" msgstr "" +">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +"... def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>> qsort(ia, len(ia), sizeof(c_int), py_cmp_func)\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" -#: ../../library/ctypes.rst:1272 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`!ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" +"C コードで使用されている間は、必ず :func:`CFUNCTYPE` オブジェクトへの参照を保" +"持してください。\n" +":mod:`!ctypes` 自身は参照を保持しないため、参照を保持しないとオブジェクトがガ" +"ベージコレクションされ、コールバックの呼び出し時にプログラムがクラッシュする" +"可能性があります。" #: ../../library/ctypes.rst:1276 msgid "" @@ -2179,26 +2631,33 @@ msgstr "" msgid "Accessing values exported from dlls" msgstr "dllからエクスポートされた値へアクセスする" -#: ../../library/ctypes.rst:1288 msgid "" "Some shared libraries not only export functions, they also export variables. " "An example in the Python library itself is the :c:data:`Py_Version`, Python " "runtime version number encoded in a single constant integer." msgstr "" +"共有ライブラリには、関数だけでなく変数もエクスポートするものがあります。\n" +"Python ライブラリ自体にも例があり、:c:data:`Py_Version` は Python ランタイム" +"のバージョン番号を単一の定数の整数に符号化したものです。" -#: ../../library/ctypes.rst:1292 msgid "" ":mod:`!ctypes` can access values like this with the :meth:`~_CData.in_dll` " "class methods of the type. *pythonapi* is a predefined symbol giving access " "to the Python C api::" msgstr "" +":mod:`!ctypes` は、型の :meth:`~_CData.in_dll` クラスメソッドを使って、このよ" +"うな値にアクセスできます。\n" +"*pythonapi* は、Python C API へのアクセスを提供する定義済みのシンボルで" +"す。 ::" -#: ../../library/ctypes.rst:1296 msgid "" ">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" ">>> print(hex(version.value))\n" "0x30c00a0" msgstr "" +">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" +">>> print(hex(version.value))\n" +"0x30c00a0" #: ../../library/ctypes.rst:1300 msgid "" @@ -2226,11 +2685,13 @@ msgstr "" "サードパーティ製のコードからこのポインタに仕掛けを講じて、動的に生成されたフ" "リーズ化モジュールの集合を提供するようにできます。" -#: ../../library/ctypes.rst:1310 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`!ctypes`::" msgstr "" +"したがって、このポインタの操作は役立つこともあります。\n" +"例を短くするため、ここでは :mod:`!ctypes` を使ってこのテーブルを読み取る方法" +"だけを示します。 ::" #: ../../library/ctypes.rst:1313 msgid "" @@ -2302,17 +2763,17 @@ msgstr "" msgid "Surprises" msgstr "びっくり仰天" -#: ../../library/ctypes.rst:1357 msgid "" "There are some edges in :mod:`!ctypes` where you might expect something " "other than what actually happens." msgstr "" +":mod:`!ctypes` には、実際とは異なる動作を期待してしまいがちな部分がいくつかあ" +"ります。" #: ../../library/ctypes.rst:1360 msgid "Consider the following example::" msgstr "次に示す例について考えてみてください。::" -#: ../../library/ctypes.rst:1362 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -2332,6 +2793,23 @@ msgid "" "3 4 3 4\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class RECT(Structure):\n" +"... _fields_ = (\"a\", POINT), (\"b\", POINT)\n" +"...\n" +">>> p1 = POINT(1, 2)\n" +">>> p2 = POINT(3, 4)\n" +">>> rc = RECT(p1, p2)\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"1 2 3 4\n" +">>> # 2 つの点を交換します\n" +">>> rc.a, rc.b = rc.b, rc.a\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"3 4 3 4\n" +">>>" #: ../../library/ctypes.rst:1380 msgid "" @@ -2342,13 +2820,16 @@ msgstr "" "きたのでしょうか? 上の行の ``rc.a, rc.b = rc.b, rc.a`` の各段階はこのようにな" "ります。::" -#: ../../library/ctypes.rst:1383 msgid "" ">>> temp0, temp1 = rc.b, rc.a\n" ">>> rc.a = temp0\n" ">>> rc.b = temp1\n" ">>>" msgstr "" +">>> temp0, temp1 = rc.b, rc.a\n" +">>> rc.a = temp0\n" +">>> rc.b = temp1\n" +">>>" msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " @@ -2380,7 +2861,6 @@ msgid "" "this::" msgstr "期待とは違う振る舞いをする別の例はこれです::" -#: ../../library/ctypes.rst:1400 msgid "" ">>> s = c_char_p()\n" ">>> s.value = b\"abc def ghi\"\n" @@ -2390,6 +2870,13 @@ msgid "" "False\n" ">>>" msgstr "" +">>> s = c_char_p()\n" +">>> s.value = b\"abc def ghi\"\n" +">>> s.value\n" +"b'abc def ghi'\n" +">>> s.value is s.value\n" +"False\n" +">>>" #: ../../library/ctypes.rst:1410 msgid "" @@ -2417,11 +2904,11 @@ msgstr "" msgid "Variable-sized data types" msgstr "可変サイズのデータ型" -#: ../../library/ctypes.rst:1425 msgid "" ":mod:`!ctypes` provides some support for variable-sized arrays and " "structures." msgstr "" +":mod:`!ctypes` は、可変サイズの配列や構造体をある程度サポートしています。" #: ../../library/ctypes.rst:1427 msgid "" @@ -2437,7 +2924,6 @@ msgstr "" "常のメモリブロックより小さくすることはできません。これをやろうとすると、 :" "exc:`ValueError` が送出されます。::" -#: ../../library/ctypes.rst:1433 msgid "" ">>> short_array = (c_short * 4)()\n" ">>> print(sizeof(short_array))\n" @@ -2453,6 +2939,19 @@ msgid "" "8\n" ">>>" msgstr "" +">>> short_array = (c_short * 4)()\n" +">>> print(sizeof(short_array))\n" +"8\n" +">>> resize(short_array, 4)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: minimum size is 8\n" +">>> resize(short_array, 32)\n" +">>> sizeof(short_array)\n" +"32\n" +">>> sizeof(type(short_array))\n" +"8\n" +">>>" #: ../../library/ctypes.rst:1447 msgid "" @@ -2464,7 +2963,6 @@ msgstr "" "するのでしょうか? この型は要素の数が 4 個であるとまだ認識しているので、他の要" "素にアクセスするとエラーになります。::" -#: ../../library/ctypes.rst:1451 msgid "" ">>> short_array[:]\n" "[0, 0, 0, 0]\n" @@ -2474,13 +2972,22 @@ msgid "" "IndexError: invalid index\n" ">>>" msgstr "" +">>> short_array[:]\n" +"[0, 0, 0, 0]\n" +">>> short_array[7]\n" +"Traceback (most recent call last):\n" +" ...\n" +"IndexError: invalid index\n" +">>>" -#: ../../library/ctypes.rst:1459 msgid "" "Another way to use variable-sized data types with :mod:`!ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" +":mod:`!ctypes` で可変サイズのデータ型を使うもう 1 つの方法は、Python の動的な" +"性質を利用し、必要なサイズがわかった後で、場合に応じてデータ型を定義または再" +"定義することです。" #: ../../library/ctypes.rst:1467 msgid "ctypes reference" @@ -2490,17 +2997,17 @@ msgstr "ctypesリファレンス" msgid "Loading shared libraries" msgstr "共有ライブラリをロードする" -#: ../../library/ctypes.rst:1474 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate :py:class:`CDLL` or one of its subclasses:" msgstr "" +"共有ライブラリを Python プロセスにロードする方法はいくつかあります。\n" +"その 1 つは、:py:class:`CDLL` またはそのサブクラスのインスタンスを作成する方" +"法です:" -#: ../../library/ctypes.rst:1480 msgid "Represents a loaded shared library." -msgstr "" +msgstr "ロード済みの共有ライブラリを表します。" -#: ../../library/ctypes.rst:1482 msgid "" "Functions in this library use the standard C calling convention, and are " "assumed to return :c:expr:`int`. The Python :term:`global interpreter lock` " @@ -2509,8 +3016,13 @@ msgid "" "class:`~ctypes.OleDLL`, :py:class:`~ctypes.WinDLL`, or :py:class:`~ctypes." "PyDLL`." msgstr "" +"このライブラリの関数は標準の C 呼び出し規約を使用し、:c:expr:`int` を返すと仮" +"定されます。\n" +"これらのライブラリがエクスポートする関数を呼び出す前に、Python の :term:" +"`global interpreter lock` を解放し、呼び出し後に再取得します。\n" +"関数の動作を変えるには、サブクラス :py:class:`~ctypes.OleDLL`、:py:class:" +"`~ctypes.WinDLL`、:py:class:`~ctypes.PyDLL` を使用してください。" -#: ../../library/ctypes.rst:1489 msgid "" "If you have an existing :py:attr:`handle ` to an " "already loaded shared library, it can be passed as the *handle* argument to " @@ -2518,21 +3030,29 @@ msgid "" "*name* is only used to set the :py:attr:`~ctypes.CDLL._name` attribute, but " "it may be adjusted and/or validated." msgstr "" +"すでにロードした共有ライブラリの :py:attr:`ハンドル ` が" +"ある場合、それを *handle* 引数に渡すと、開いているライブラリを新しい :py:" +"class:`!CDLL` オブジェクトでラップできます。\n" +"この場合、*name* は :py:attr:`~ctypes.CDLL._name` 属性の設定にのみ使われます" +"が、調整や検証が行われることもあります。" -#: ../../library/ctypes.rst:1495 msgid "" "If *handle* is ``None``, the underlying platform's :manpage:`dlopen(3)` or " "`LoadLibraryExW`_ function is used to load the library into the process, and " "to get a handle to it." msgstr "" +"*handle* が ``None`` の場合、プラットフォームの :manpage:`dlopen(3)` または " +"`LoadLibraryExW`_ 関数を使って、ライブラリをプロセスにロードし、そのハンドル" +"を取得します。" -#: ../../library/ctypes.rst:1499 msgid "" "*name* is the pathname of the shared library to open. If *name* does not " "contain a path separator, the library is found in a platform-specific way." msgstr "" +"*name* は開く共有ライブラリのパス名です。\n" +"*name* にパスの区切り文字が含まれない場合、プラットフォーム固有の方法でライブ" +"ラリを探します。" -#: ../../library/ctypes.rst:1503 msgid "" "On Windows, the ``.DLL`` suffix may be missing. (For details, see " "`LoadLibraryExW`_ documentation.) Other platform-specific prefixes and " @@ -2540,6 +3060,12 @@ msgid "" "must be present in *name*; they are not added automatically. See :ref:" "`ctypes-finding-shared-libraries` for more information." msgstr "" +"Windows では、``.DLL`` 接尾辞を省略できます (詳細は `LoadLibraryExW`_ のド" +"キュメントを参照してください)。\n" +"ほかのプラットフォーム固有の接頭辞や接尾辞 (``lib``、``.so``、``.dylib``、" +"バージョン番号など) は *name* に含める必要があり、自動的には追加されませ" +"ん。\n" +"詳しくは :ref:`ctypes-finding-shared-libraries` を参照してください。" #: ../../library/ctypes.rst:1510 msgid "" @@ -2549,17 +3075,16 @@ msgid "" "is more portable.)" msgstr "" -#: ../../library/ctypes.rst:1516 msgid "CPython implementation detail" -msgstr "" +msgstr "CPython の実装の詳細" -#: ../../library/ctypes.rst:1518 msgid "" "Since CPython is linked to ``libc``, a ``None`` *name* is often used to " "access the C standard library::" msgstr "" +"CPython は ``libc`` にリンクされるため、C 標準ライブラリへのアクセスには " +"*name* に ``None`` を指定する方法がよく使われます。 ::" -#: ../../library/ctypes.rst:1521 msgid "" ">>> printf = ctypes.CDLL(None).printf\n" ">>> printf.argtypes = [ctypes.c_char_p]\n" @@ -2567,12 +3092,18 @@ msgid "" "hello\n" "6" msgstr "" +">>> printf = ctypes.CDLL(None).printf\n" +">>> printf.argtypes = [ctypes.c_char_p]\n" +">>> printf(b\"hello\\n\")\n" +"hello\n" +"6" -#: ../../library/ctypes.rst:1527 msgid "" "To access the Python C API, prefer :py:data:`ctypes.pythonapi` which works " "across platforms." msgstr "" +"Python C API にアクセスする場合は、各プラットフォームで動作する :py:data:" +"`ctypes.pythonapi` を優先してください。" msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " @@ -2586,7 +3117,6 @@ msgstr "" "Windows では *mode* は無視されます。\n" "POSIX システムでは RTLD_NOW が常に追加され、設定変更はできません。" -#: ../../library/ctypes.rst:1535 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:`!" @@ -2599,6 +3129,17 @@ msgid "" "example, a different CRT on Windows) has its own :data:`errno`, which :mod:`!" "ctypes` cannot observe." msgstr "" +"*use_errno* 引数を真に設定すると、システムのエラー番号 :data:`errno` に安全に" +"アクセスする ctypes の仕組みが有効になります。\n" +":mod:`!ctypes` は、システムの :data:`errno` 変数のコピーをスレッドローカルに" +"保持します。\n" +"``use_errno=True`` で作成した外部関数を呼び出すと、呼び出し前の :data:" +"`errno` 値を ctypes 内部のコピーと交換し、呼び出し直後にも同じ交換を行いま" +"す。\n" +"この仕組みは、インタープリタ自体と同じ C ランタイムライブラリを使うライブラリ" +"に対してのみ機能します。\n" +"別の C ランタイム (例えば Windows 上の別の CRT) にリンクされたライブラリは、" +"独自の :data:`errno` を持ち、:mod:`!ctypes` からは参照できません。" #: ../../library/ctypes.rst:1545 msgid "" @@ -2610,7 +3151,6 @@ msgstr "" "して、 :func:`ctypes.set_errno` 関数は ctypes のプライベートコピーを置き換" "え、以前の値を返します。" -#: ../../library/ctypes.rst:1549 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -2618,8 +3158,12 @@ msgid "" "and :func:`ctypes.set_last_error` are used to request and change the ctypes " "private copy of the windows error code." msgstr "" +"*use_last_error* 引数を真に設定すると、Windows API 関数の :func:" +"`GetLastError` と :func:`!SetLastError` が管理する Windows エラーコードについ" +"て同じ仕組みが有効になります。\n" +"ctypes 内部にある Windows エラーコードのコピーの取得と変更には、:func:" +"`ctypes.get_last_error` と :func:`ctypes.set_last_error` を使います。" -#: ../../library/ctypes.rst:1555 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -2628,8 +3172,14 @@ msgid "" "such as DLL hijacking. Passing the full path to the DLL is the safest way to " "ensure the correct library and dependencies are loaded." msgstr "" +"Windows では *mode* が無視されるため、*winmode* 引数でライブラリのロード方法" +"を指定します。\n" +"Win32 API の `LoadLibraryExW`_ の flags 引数として有効な値を指定できます。\n" +"省略時には、DLL ハイジャックなどの問題を避けるため、最も安全に DLL をロードす" +"るフラグが使われます。\n" +"正しいライブラリと依存ライブラリがロードされることを確実にする最も安全な方法" +"は、DLL のフルパスを渡すことです。" -#: ../../library/ctypes.rst:1562 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -2640,23 +3190,33 @@ msgid "" "which DLL is not found, you need to find the list of dependent DLLs and " "determine which one is not found using Windows debugging and tracing tools." msgstr "" +"Windows では、DLL の名前が存在していても :class:`CDLL` インスタンスの作成が失" +"敗することがあります。\n" +"ロードする DLL の依存先 DLL が見つからない場合、*\"[WinError 126] The " +"specified module could not be found\"* というメッセージで :exc:`OSError` が送" +"出されます。\n" +"Windows API がこの情報を返さないため、エラーメッセージには見つからない DLL の" +"名前が含まれず、原因の特定が難しくなります。\n" +"このエラーを解決し、見つからない DLL を特定するには、依存先 DLL の一覧を調" +"べ、Windows のデバッグツールやトレースツールで、どれが見つからないのかを判定" +"する必要があります。" -#: ../../library/ctypes.rst:1574 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL " "dependents." msgstr "" +"`Microsoft の DUMPBIN ツール `_ -- 依存先 DLL を調べるツールで" +"す。" #: ../../library/ctypes.rst:1577 msgid "Added *winmode* parameter." msgstr "*winmode* 引数が追加されました。" -#: ../../library/ctypes.rst:1582 msgid "The *name* parameter can now be a :term:`path-like object`." -msgstr "" +msgstr "*name* 引数に :term:`path-like object` を指定できるようになりました。" -#: ../../library/ctypes.rst:1584 msgid "" "Instances of this class have no public methods. Functions exported by the " "shared library can be accessed as attributes or by index. Please note that " @@ -2664,8 +3224,14 @@ msgid "" "accessing it repeatedly returns the same object each time. On the other " "hand, accessing it through an index returns a new object each time::" msgstr "" +"このクラスのインスタンスには公開メソッドがありません。\n" +"共有ライブラリがエクスポートする関数には、属性やインデックスを使ってアクセス" +"できます。\n" +"属性を通じてアクセスすると結果がキャッシュされ、繰り返しアクセスしても毎回同" +"じオブジェクトを返します。\n" +"一方、インデックスを通じてアクセスすると、毎回新しいオブジェクトを返しま" +"す。 ::" -#: ../../library/ctypes.rst:1590 msgid "" ">>> from ctypes import CDLL\n" ">>> libc = CDLL(\"libc.so.6\") # On Linux\n" @@ -2674,12 +3240,19 @@ msgid "" ">>> libc['time'] == libc['time']\n" "False" msgstr "" +">>> from ctypes import CDLL\n" +">>> libc = CDLL(\"libc.so.6\") # Linux の場合\n" +">>> libc.time == libc.time\n" +"True\n" +">>> libc['time'] == libc['time']\n" +"False" -#: ../../library/ctypes.rst:1597 msgid "" "The following public attributes are available. Their name starts with an " "underscore to not clash with exported function names:" msgstr "" +"以下の公開属性を利用できます。\n" +"エクスポートされた関数名と衝突しないよう、名前はアンダースコアで始まります:" #: ../../library/ctypes.rst:1602 msgid "The system handle used to access the library." @@ -2689,12 +3262,11 @@ msgstr "ライブラリへのアクセスに用いられるシステムハンド msgid "The name of the library passed in the constructor." msgstr "コンストラクタに渡されたライブラリの名前。" -#: ../../library/ctypes.rst:1612 ../../library/ctypes.rst:1629 -#: ../../library/ctypes.rst:1638 msgid "See :py:class:`~ctypes.CDLL`, the superclass, for common information." msgstr "" +"共通の情報については、スーパークラス :py:class:`~ctypes.CDLL` を参照してくだ" +"さい。" -#: ../../library/ctypes.rst:1614 msgid "" "Functions in this library use the ``stdcall`` calling convention, and are " "assumed to return the windows specific :class:`HRESULT` code. :class:" @@ -2702,32 +3274,41 @@ msgid "" "failed or succeeded, together with additional error code. If the return " "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" +"このライブラリの関数は ``stdcall`` 呼び出し規約を使用し、Windows 固有の :" +"class:`HRESULT` コードを返すと仮定されます。\n" +":class:`HRESULT` の値には、関数呼び出しの成功または失敗を示す情報と、追加のエ" +"ラーコードが含まれます。\n" +"戻り値が失敗を示す場合、:class:`OSError` を自動的に送出します。" msgid "Availability" msgstr "利用可能な環境" -#: ../../library/ctypes.rst:1622 msgid "" ":exc:`WindowsError` used to be raised, which is now an alias of :exc:" "`OSError`." msgstr "" +"以前は :exc:`WindowsError` を送出していましたが、現在は :exc:`OSError` の別名" +"になっています。" -#: ../../library/ctypes.rst:1631 msgid "" "Functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" +"これらのライブラリの関数は ``stdcall`` 呼び出し規約を使用し、デフォルトでは :" +"c:expr:`int` を返すと仮定されます。" -#: ../../library/ctypes.rst:1640 msgid "" "When functions in this library are called, the Python GIL is *not* released " "during the function call, and after the function execution the Python error " "flag is checked. If the error flag is set, a Python exception is raised." msgstr "" +"このライブラリの関数を呼び出す場合、呼び出し中に Python の GIL は解放 *されず" +"*、関数の実行後に Python のエラーフラグを検査します。\n" +"エラーフラグが設定されている場合は、Python の例外を送出します。" -#: ../../library/ctypes.rst:1645 msgid "Thus, this is only useful to call Python C API functions directly." msgstr "" +"したがって、これは Python C API 関数を直接呼び出す場合にのみ役立ちます。" #: ../../library/ctypes.rst:1650 msgid "" @@ -2753,13 +3334,16 @@ msgstr "" "共有ライブラリをロードするために使われるデフォルトモード。 OSX 10.3 では " "*RTLD_GLOBAL* であり、そうでなければ *RTLD_LOCAL* と同じです。" -#: ../../library/ctypes.rst:1666 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " "calling the :meth:`~LibraryLoader.LoadLibrary` method, or by retrieving the " "library as attribute of the loader instance." msgstr "" +"あらかじめ作成されている :class:`LibraryLoader` クラスのインスタンスを使っ" +"て、共有ライブラリをロードすることもできます。\n" +":meth:`~LibraryLoader.LoadLibrary` メソッドを呼び出すか、ローダーインスタンス" +"の属性としてライブラリを取得します。" #: ../../library/ctypes.rst:1673 msgid "" @@ -2769,13 +3353,17 @@ msgstr "" "共有ライブラリをロードするクラス。 *dlltype* は :class:`CDLL` 、 :class:" "`PyDLL` 、 :class:`WinDLL` もしくは :class:`OleDLL` 型の一つであるべきです。" -#: ../../library/ctypes.rst:1676 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " "result is cached, so repeated attribute accesses return the same library " "each time." msgstr "" +":meth:`!__getattr__` には特別な動作があります。\n" +"ライブラリローダーインスタンスの属性にアクセスすると、共有ライブラリをロード" +"できます。\n" +"結果はキャッシュされるため、属性へのアクセスを繰り返しても毎回同じライブラリ" +"を返します。" #: ../../library/ctypes.rst:1682 msgid "" @@ -2793,56 +3381,64 @@ msgstr "これらの前もって作られたライブラリローダーを利用 msgid "Creates :class:`CDLL` instances." msgstr ":class:`CDLL` インスタンスを作ります。" -#: ../../library/ctypes.rst:1695 msgid "Creates :class:`WinDLL` instances." -msgstr "" +msgstr ":class:`WinDLL` インスタンスを作成します。" -#: ../../library/ctypes.rst:1702 msgid "Creates :class:`OleDLL` instances." -msgstr "" +msgstr ":class:`OleDLL` インスタンスを作成します。" #: ../../library/ctypes.rst:1709 msgid "Creates :class:`PyDLL` instances." msgstr ":class:`PyDLL` インスタンスを作ります。" -#: ../../library/ctypes.rst:1714 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" "`int`, which is of course not always the truth, so you have to assign the " "correct :attr:`!restype` attribute to use these functions." msgstr "" +"Python C API 関数を属性として公開する :class:`PyDLL` のインスタンスです。\n" +"すべての関数が C の :c:expr:`int` を返すと仮定していますが、実際には常にそう" +"とは限りません。\n" +"これらの関数を使うには、:attr:`!restype` 属性に正しい型を設定する必要がありま" +"す。" -#: ../../library/ctypes.rst:1721 msgid "If the Python interpreter is statically linked, this may be ``None``." msgstr "" +"Python インタープリタが静的にリンクされている場合、これは ``None`` になること" +"があります。" -#: ../../library/ctypes.rst:1723 ../../library/ctypes.rst:1725 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" +"これらのオブジェクトを通じてライブラリをロードすると、ロードに使うライブラリ" +"名を文字列引数 ``name`` とする :ref:`監査イベント ` ``ctypes." +"dlopen`` が発生します。" -#: ../../library/ctypes.rst:1729 ../../library/ctypes.rst:1731 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" +"ロード済みライブラリの関数にアクセスすると、引数 ``library`` (ライブラリオブ" +"ジェクト) と ``name`` (文字列または整数のシンボル名) を持つ監査イベント " +"``ctypes.dlsym`` が発生します。" -#: ../../library/ctypes.rst:1735 ../../library/ctypes.rst:1737 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" +"ライブラリオブジェクトではなくハンドルだけが利用できる場合、関数にアクセスす" +"ると、引数 ``handle`` (生のライブラリハンドル) と ``name`` を持つ監査イベン" +"ト ``ctypes.dlsym/handle`` が発生します。" #: ../../library/ctypes.rst:1745 msgid "Finding shared libraries" msgstr "共有ライブラリを見つける" -#: ../../library/ctypes.rst:1747 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run. The programmer " @@ -2850,8 +3446,12 @@ msgid "" "loader then interact in system-specific ways to find the filename of the " "library to load." msgstr "" +"コンパイル型の言語でプログラミングする場合、共有ライブラリには、プログラムの" +"コンパイルやリンクの際と、プログラムの実行時にアクセスします。\n" +"プログラマーが短い名前を指定すると、C コンパイラ、リンカー、実行時の動的ライ" +"ブラリローダーがシステム固有の方法で連携し、ロードするライブラリのファイル名" +"を探します。" -#: ../../library/ctypes.rst:1753 msgid "" "While the mapping from short names to filenames is not consistently exposed " "by platforms, the :mod:`!ctypes.util` module provides a function, :func:`!" @@ -2859,8 +3459,12 @@ msgid "" "compatibility concerns make it difficult to adjust its behavior for new " "platforms and configurations, the function is :term:`soft deprecated`." msgstr "" +"短い名前とファイル名の対応は、プラットフォーム間で一貫した形では公開されてい" +"ませんが、:mod:`!ctypes.util` モジュールは、その対応を求めようとする :func:`!" +"find_library` 関数を提供します。\n" +"ただし、後方互換性の問題から新しいプラットフォームや設定に合わせて動作を調整" +"するのは難しいため、この関数は :term:`soft deprecated` です。" -#: ../../library/ctypes.rst:1760 msgid "" "If wrapping a shared library with :mod:`!ctypes`, consider determining the " "shared library name at development time, and hardcoding it into the wrapper " @@ -2869,43 +3473,56 @@ msgid "" "to let users select a library to use, and then perhaps use :func:`!" "find_library` as a default or fallback." msgstr "" +":mod:`!ctypes` で共有ライブラリをラップする場合、実行時に :func:`!" +"find_library` で探す代わりに、開発時に共有ライブラリ名を決めてラッパーモ" +"ジュールに直接記述することを検討してください。\n" +"また、利用するライブラリをユーザーが選べる設定オプションや環境変数を追加し、:" +"func:`!find_library` はデフォルトや代替手段として使うことも検討してください。" -#: ../../library/ctypes.rst:1771 msgid "Try to find a library and return a pathname." -msgstr "" +msgstr "ライブラリを探し、そのパス名を返します。" -#: ../../library/ctypes.rst:1773 msgid "" "*name* is the \"short\" library name without any prefix like ``lib``, suffix " "like ``.so``, ``.dylib`` or version number. (This is the form used for the " "posix linker option :option:`!-l`.) The result is in a format suitable for " "passing to :py:class:`~ctypes.CDLL`." msgstr "" +"*name* は、``lib`` などの接頭辞や、``.so``、``.dylib``、バージョン番号などの" +"接尾辞を含まない、ライブラリの「短い」名前です (POSIX リンカーの :option:`!-" +"l` オプションで使う形式です)。\n" +"結果は :py:class:`~ctypes.CDLL` に渡せる形式になります。" -#: ../../library/ctypes.rst:1778 msgid "If no library can be found, return ``None``." -msgstr "" +msgstr "ライブラリが見つからない場合は ``None`` を返します。" -#: ../../library/ctypes.rst:1780 msgid "" "The exact functionality is system dependent, and is *not guaranteed* to " "match the behavior of the compiler, linker, and loader used for (or by) " "Python. It is recommended to only use this function as a default or fallback," msgstr "" +"厳密な動作はシステムに依存し、Python のために、または Python が使用するコンパ" +"イラ、リンカー、ローダーの動作と一致する *保証はありません*。\n" +"この関数はデフォルトや代替手段としてのみ使うことを推奨します。" -#: ../../library/ctypes.rst:1787 msgid "" "This function is kept for use in cases where it works, but not expected to " "be updated for additional platforms and configurations." msgstr "" +"この関数は、現在動作する環境での使用のために維持されますが、追加のプラット" +"フォームや設定に対応する更新は予定されていません。" -#: ../../library/ctypes.rst:1790 msgid "" "On Linux, :func:`!find_library` tries to run external programs (``/sbin/" "ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. If " "the output of these programs does not correspond to the dynamic linker used " "by Python, the result of this function may be misleading." msgstr "" +"Linux では、:func:`!find_library` は外部プログラム (``/sbin/ldconfig``、" +"``gcc``、``objdump``、``ld``) を実行してライブラリファイルを探そうとしま" +"す。\n" +"これらのプログラムの出力が Python の使う動的リンカーに対応していない場合、こ" +"の関数の結果は誤解を招くことがあります。" #: ../../library/ctypes.rst:1796 msgid "" @@ -2920,7 +3537,6 @@ msgstr "" msgid "Here are some examples::" msgstr "ここに例があります::" -#: ../../library/ctypes.rst:1802 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"m\")\n" @@ -2931,15 +3547,23 @@ msgid "" "'libbz2.so.1.0'\n" ">>>" msgstr "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"m\")\n" +"'libm.so.6'\n" +">>> find_library(\"c\")\n" +"'libc.so.6'\n" +">>> find_library(\"bz2\")\n" +"'libbz2.so.1.0'\n" +">>>" -#: ../../library/ctypes.rst:1811 msgid "" "On macOS and Android, :func:`!find_library` uses the system's standard " "naming schemes and paths to locate the library, and returns a full pathname " "if successful::" msgstr "" +"macOS と Android では、:func:`!find_library` はシステム標準の命名規則とパスを" +"使ってライブラリを探し、成功するとフルパス名を返します。 ::" -#: ../../library/ctypes.rst:1815 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"c\")\n" @@ -2952,26 +3576,42 @@ msgid "" "'/System/Library/Frameworks/AGL.framework/AGL'\n" ">>>" msgstr "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"c\")\n" +"'/usr/lib/libc.dylib'\n" +">>> find_library(\"m\")\n" +"'/usr/lib/libm.dylib'\n" +">>> find_library(\"bz2\")\n" +"'/usr/lib/libbz2.dylib'\n" +">>> find_library(\"AGL\")\n" +"'/System/Library/Frameworks/AGL.framework/AGL'\n" +">>>" -#: ../../library/ctypes.rst:1826 msgid "" "On Windows, :func:`!find_library` searches along the system search path, and " "returns the full pathname, but since there is no predefined naming scheme a " "call like ``find_library(\"c\")`` will fail and return ``None``." msgstr "" +"Windows では、:func:`!find_library` はシステムの検索パスに沿って探し、フルパ" +"ス名を返します。\n" +"ただし、定義済みの命名規則がないため、``find_library(\"c\")`` のような呼び出" +"しは失敗して ``None`` を返します。" -#: ../../library/ctypes.rst:1833 msgid "" "Returns the filename of the VC runtime library used by Python, and by the " "extension modules." msgstr "" +"Python と拡張モジュールが使用する VC ランタイムライブラリのファイル名を返しま" +"す。" -#: ../../library/ctypes.rst:1836 msgid "" "If the name of the library cannot be determined, ``None`` is returned. " "Notably, this will happen for recent versions of the VC runtime library, " "which are not directly loadable." msgstr "" +"ライブラリ名を判定できない場合は ``None`` を返します。\n" +"特に、最近のバージョンの VC ランタイムライブラリは直接ロードできないため、こ" +"の結果になります。" #: ../../library/ctypes.rst:1840 msgid "" @@ -2983,46 +3623,53 @@ msgstr "" "放する必要があるなら、メモリ割り付けを行ったのと同じライブラリの関数を使うこ" "とが重要です。" -#: ../../library/ctypes.rst:1850 msgid "Listing loaded shared libraries" -msgstr "" +msgstr "ロード済み共有ライブラリの一覧取得" -#: ../../library/ctypes.rst:1852 msgid "" "When writing code that relies on code loaded from shared libraries, it can " "be useful to know which shared libraries have already been loaded into the " "current process." msgstr "" +"共有ライブラリからロードしたコードに依存するコードを書く場合、現在のプロセス" +"にどの共有ライブラリがすでにロードされているかを知ると役立つことがあります。" -#: ../../library/ctypes.rst:1856 msgid "" "The :mod:`!ctypes.util` module provides the :func:`~ctypes.util.dllist` " "function, which calls the different APIs provided by the various platforms " "to help determine which shared libraries have already been loaded into the " "current process." msgstr "" +":mod:`!ctypes.util` モジュールの :func:`~ctypes.util.dllist` 関数は、各プラッ" +"トフォームが提供する異なる API を呼び出して、現在のプロセスにすでにロードされ" +"た共有ライブラリを調べます。" -#: ../../library/ctypes.rst:1860 msgid "" "The exact output of this function will be system dependent. On most " "platforms, the first entry of this list represents the current process " "itself, which may be an empty string. For example, on glibc-based Linux, the " "return may look like::" msgstr "" +"この関数の具体的な出力はシステムに依存します。\n" +"ほとんどのプラットフォームでは、リストの最初の要素は現在のプロセス自体を表" +"し、空文字列の場合もあります。\n" +"例えば、glibc を使う Linux では次のような結果を返すことがあります。 ::" -#: ../../library/ctypes.rst:1865 msgid "" ">>> from ctypes.util import dllist\n" ">>> dllist()\n" "['', 'linux-vdso.so.1', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-" "linux-gnu/libc.so.6', ... ]" msgstr "" +">>> from ctypes.util import dllist\n" +">>> dllist()\n" +"['', 'linux-vdso.so.1', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-" +"linux-gnu/libc.so.6', ... ]" #: ../../library/ctypes.rst:1872 msgid "Foreign functions" msgstr "外部関数" -#: ../../library/ctypes.rst:1874 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -3030,14 +3677,20 @@ msgid "" "instances as arguments, and return the default result type specified by the " "library loader." msgstr "" +"前の節で説明したとおり、外部関数にはロード済み共有ライブラリの属性としてアク" +"セスできます。\n" +"この方法で作成した関数オブジェクトは、デフォルトで任意の数の引数を受け付け、" +"任意の ctypes データインスタンスを引数に取ります。\n" +"戻り値の型は、ライブラリローダーが指定するデフォルトの型になります。" -#: ../../library/ctypes.rst:1879 msgid "" "They are instances of a private local class :class:`!_FuncPtr` (not exposed " "in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" msgstr "" +"これらは、非公開の :class:`_CFuncPtr` クラスを継承する、非公開のローカルクラ" +"ス :class:`!_FuncPtr` のインスタンスです (:mod:`!ctypes` では公開されていませ" +"ん)。" -#: ../../library/ctypes.rst:1882 msgid "" ">>> import ctypes\n" ">>> lib = ctypes.CDLL(None)\n" @@ -3046,6 +3699,12 @@ msgid "" ">>> lib._FuncPtr is ctypes._CFuncPtr\n" "False" msgstr "" +">>> import ctypes\n" +">>> lib = ctypes.CDLL(None)\n" +">>> issubclass(lib._FuncPtr, ctypes._CFuncPtr)\n" +"True\n" +">>> lib._FuncPtr is ctypes._CFuncPtr\n" +"False" #: ../../library/ctypes.rst:1893 msgid "Base class for C callable foreign functions." @@ -3075,7 +3734,6 @@ msgstr "" "外部関数の結果の型を指定するために ctypes 型を代入する。何も返さない関数を表" "す :c:expr:`void` に対しては ``None`` を使います。" -#: ../../library/ctypes.rst:1906 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -3084,6 +3742,13 @@ msgid "" "or error checking use a ctypes data type as :attr:`!restype` and assign a " "callable to the :attr:`errcheck` attribute." msgstr "" +"ctypes の型以外の、Python の呼び出し可能オブジェクトを代入することもできま" +"す。\n" +"この場合、関数は C の :c:expr:`int` を返すと仮定され、その整数を渡して呼び出" +"し可能オブジェクトを呼び出すことで、追加の処理やエラー検査を行えます。\n" +"この使い方は非推奨です。\n" +"より柔軟な後処理やエラー検査を行うには、:attr:`!restype` に ctypes のデータ型" +"を設定し、:attr:`errcheck` 属性に呼び出し可能オブジェクトを代入してください。" #: ../../library/ctypes.rst:1915 msgid "" @@ -3107,13 +3772,17 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1928 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " "value usable as argument (integer, string, ctypes instance). This allows " "defining adapters that can adapt custom objects as function parameters." msgstr "" +"新機能: ``argtypes`` に ctypes の型以外の要素も指定できるようになりました。\n" +"ただし、各要素には、引数として使える値 (整数、文字列、ctypes インスタンス) を" +"返す :meth:`~_CData.from_param` メソッドが必要です。\n" +"これにより、独自のオブジェクトを関数の引数に適合させるアダプターを定義できま" +"す。" #: ../../library/ctypes.rst:1935 msgid "" @@ -3123,11 +3792,11 @@ msgstr "" "Python 関数または他の呼び出し可能オブジェクトをこの属性に代入します。呼び出し" "可能オブジェクトは三つ以上の引数とともに呼び出されます。" -#: ../../library/ctypes.rst:1942 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" +"*result* は、:attr:`!restype` 属性で指定された型で外部関数が返す値です。" #: ../../library/ctypes.rst:1945 msgid "" @@ -3157,7 +3826,6 @@ msgstr "" "戻り値をチェックして、外部関数呼び出しが失敗しているなら例外を送出させること" "もできます。" -#: ../../library/ctypes.rst:1958 ../../library/ctypes.rst:1960 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -3165,13 +3833,19 @@ msgid "" "set_exception`` with argument ``code`` will be raised, allowing an audit " "hook to replace the exception with its own." msgstr "" +"Windows では、外部関数呼び出しがアクセス違反などのシステム例外を発生させる" +"と、それを捕捉して適切な Python 例外に置き換えます。\n" +"さらに、引数 ``code`` を持つ監査イベント ``ctypes.set_exception`` が発生し、" +"監査フックが独自の例外に置き換えられるようになります。" -#: ../../library/ctypes.rst:1966 ../../library/ctypes.rst:1968 msgid "" "Some ways to invoke foreign function calls as well as some of the functions " "in this module may raise an auditing event ``ctypes.call_function`` with " "arguments ``function pointer`` and ``arguments``." msgstr "" +"外部関数の呼び出し方によっては、またこのモジュールの一部の関数では、引数 " +"``function pointer`` と ``arguments`` を持つ監査イベント ``ctypes." +"call_function`` が発生する場合があります。" #: ../../library/ctypes.rst:1975 msgid "Function prototypes" @@ -3209,12 +3883,15 @@ msgstr "" "data:`errno` の値と交換されます。 *use_last_error* も Windows エラーコードに" "対するのと同様です。" -#: ../../library/ctypes.rst:1998 msgid "" "The returned function prototype creates functions that use the ``stdcall`` " "calling convention. The function will release the GIL during the call. " "*use_errno* and *use_last_error* have the same meaning as above." msgstr "" +"返された関数プロトタイプは、``stdcall`` 呼び出し規約を使う関数を作成しま" +"す。\n" +"関数は呼び出し中に GIL を解放します。\n" +"*use_errno* と *use_last_error* の意味は上記と同じです。" #: ../../library/ctypes.rst:2008 msgid "" @@ -3269,19 +3946,23 @@ msgstr "" "*iid* はオプションのインターフェイス識別子へのポインタで、拡張されたエラー情" "報の提供のために使われます。" -#: ../../library/ctypes.rst:2047 msgid "" "If *iid* is not specified, an :exc:`OSError` is raised if the COM method " "call fails. If *iid* is specified, a :exc:`~ctypes.COMError` is raised " "instead." msgstr "" +"*iid* を指定しない場合、COM メソッドの呼び出しが失敗すると :exc:`OSError` を" +"送出します。\n" +"*iid* を指定した場合は、代わりに :exc:`~ctypes.COMError` を送出します。" -#: ../../library/ctypes.rst:2051 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`!argtypes` tuple." msgstr "" +"COM メソッドは特別な呼び出し規約を使います。\n" +":attr:`!argtypes` タプルで指定した引数に加えて、第 1 引数として COM インター" +"フェースへのポインタが必要です。" #: ../../library/ctypes.rst:2058 msgid "" @@ -3291,11 +3972,12 @@ msgstr "" "オプションの *paramflags* パラメータは上述した機能より多機能な外部関数ラッ" "パーを作成します。" -#: ../../library/ctypes.rst:2061 msgid "" "*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." "argtypes`." msgstr "" +"*paramflags* は、:attr:`~_CFuncPtr.argtypes` と同じ長さのタプルでなければなり" +"ません。" #: ../../library/ctypes.rst:2063 msgid "" @@ -3347,14 +4029,15 @@ msgstr "" msgid "The optional third item is the default value for this parameter." msgstr "オプションの第三要素はこのパラメータのデフォルト値です。" -#: ../../library/ctypes.rst:2084 msgid "" "The following example demonstrates how to wrap the Windows ``MessageBoxW`` " "function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" +"次の例では、Windows の ``MessageBoxW`` 関数をラップして、引数のデフォルト値と" +"名前付き引数をサポートする方法を示します。\n" +"Windows ヘッダーファイルの C 宣言は次のとおりです。 ::" -#: ../../library/ctypes.rst:2088 msgid "" "WINUSERAPI int WINAPI\n" "MessageBoxW(\n" @@ -3363,12 +4046,16 @@ msgid "" " LPCWSTR lpCaption,\n" " UINT uType);" msgstr "" +"WINUSERAPI int WINAPI\n" +"MessageBoxW(\n" +" HWND hWnd,\n" +" LPCWSTR lpText,\n" +" LPCWSTR lpCaption,\n" +" UINT uType);" -#: ../../library/ctypes.rst:2095 ../../library/ctypes.rst:2118 msgid "Here is the wrapping with :mod:`!ctypes`::" -msgstr "" +msgstr ":mod:`!ctypes` を使ったラップは次のようになります。 ::" -#: ../../library/ctypes.rst:2097 msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" @@ -3377,6 +4064,12 @@ msgid "" "\"Hello from ctypes\"), (1, \"flags\", 0)\n" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" msgstr "" +">>> from ctypes import c_int, WINFUNCTYPE, windll\n" +">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" +">>> prototype = WINFUNCTYPE(c_int, HWND, LPCWSTR, LPCWSTR, UINT)\n" +">>> paramflags = (1, \"hwnd\", 0), (1, \"text\", \"Hi\"), (1, \"caption\", " +"\"Hello from ctypes\"), (1, \"flags\", 0)\n" +">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" #: ../../library/ctypes.rst:2103 msgid "The ``MessageBox`` foreign function can now be called in these ways::" @@ -3384,12 +4077,14 @@ msgstr "" "これで外部関数の ``MessageBox`` を次のような方法で呼び出すことができるように" "なりました::" -#: ../../library/ctypes.rst:2105 msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" msgstr "" +">>> MessageBox()\n" +">>> MessageBox(text=\"Spam, spam, spam\")\n" +">>> MessageBox(flags=2, text=\"foo bar\")" #: ../../library/ctypes.rst:2109 msgid "" @@ -3402,15 +4097,17 @@ msgstr "" "数は、指定されたウィンドウの大きさを呼び出し側が与える ``RECT`` 構造体へコ" "ピーすることで取り出します。 C の宣言はこうです。::" -#: ../../library/ctypes.rst:2113 msgid "" "WINUSERAPI BOOL WINAPI\n" "GetWindowRect(\n" " HWND hWnd,\n" " LPRECT lpRect);" msgstr "" +"WINUSERAPI BOOL WINAPI\n" +"GetWindowRect(\n" +" HWND hWnd,\n" +" LPRECT lpRect);" -#: ../../library/ctypes.rst:2120 msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" ">>> from ctypes.wintypes import BOOL, HWND, RECT\n" @@ -3420,6 +4117,13 @@ msgid "" "paramflags)\n" ">>>" msgstr "" +">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" +">>> from ctypes.wintypes import BOOL, HWND, RECT\n" +">>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))\n" +">>> paramflags = (1, \"hwnd\"), (2, \"lprect\")\n" +">>> GetWindowRect = prototype((\"GetWindowRect\", windll.user32), " +"paramflags)\n" +">>>" #: ../../library/ctypes.rst:2127 msgid "" @@ -3433,7 +4137,6 @@ msgstr "" "れ自動的に返します。そのため、GetWindowRect 関数は呼び出されると RECT インス" "タンスを返します。" -#: ../../library/ctypes.rst:2132 msgid "" "Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -3441,8 +4144,11 @@ msgid "" "failure, so this function could do the error checking, and raises an " "exception when the api call failed::" msgstr "" +"出力引数は :attr:`~_CFuncPtr.errcheck` プロトコルと組み合わせて、出力の追加処" +"理やエラー検査を行えます。\n" +"win32 API の ``GetWindowRect`` 関数は成功か失敗かを ``BOOL`` で返すので、次の" +"関数でエラーを検査し、API 呼び出しが失敗した場合に例外を送出できます。 ::" -#: ../../library/ctypes.rst:2137 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3452,8 +4158,14 @@ msgid "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" msgstr "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... return args\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" -#: ../../library/ctypes.rst:2145 msgid "" "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`!ctypes` continues the normal processing it does " @@ -3462,8 +4174,12 @@ msgid "" "the function and return them instead, the normal processing will no longer " "take place::" msgstr "" +":attr:`~_CFuncPtr.errcheck` 関数が受け取った引数タプルをそのまま返すと、:mod:" +"`!ctypes` は出力引数に対する通常の処理を続けます。\n" +"``RECT`` インスタンスの代わりにウィンドウ座標のタプルを返したい場合は、関数内" +"でフィールドを取得してそれらを返せます。\n" +"この場合、通常の処理は行われなくなります。 ::" -#: ../../library/ctypes.rst:2151 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3474,6 +4190,14 @@ msgid "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" msgstr "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... rc = args[1]\n" +"... return rc.left, rc.top, rc.bottom, rc.right\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" #: ../../library/ctypes.rst:2164 msgid "Utility functions" @@ -3516,9 +4240,8 @@ msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" "``byref(obj, offset)`` は、 C コードとしては、以下のようにみなされます。::" -#: ../../library/ctypes.rst:2188 msgid "(((char *)&obj) + offset)" -msgstr "" +msgstr "(((char *)&obj) + offset)" #: ../../library/ctypes.rst:2190 msgid "" @@ -3528,25 +4251,29 @@ msgstr "" "返されるオブジェクトは外部関数呼び出しのパラメータとしてのみ使用できます。" "``pointer(obj)`` と似たふるまいをしますが、作成が非常に速く行えます。" -#: ../../library/ctypes.rst:2196 msgid "" "Copies a COM pointer from *src* to *dst* and returns the Windows specific :c:" "type:`!HRESULT` value." msgstr "" +"COM ポインタを *src* から *dst* にコピーし、Windows 固有の :c:type:`!" +"HRESULT` 値を返します。" -#: ../../library/ctypes.rst:2199 msgid "" "If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the " "reference count." msgstr "" +"*src* が ``NULL`` でない場合、その ``AddRef`` メソッドを呼び出して参照カウン" +"トを増やします。" -#: ../../library/ctypes.rst:2202 msgid "" "In contrast, the reference count of *dst* will not be decremented before " "assigning the new value. Unless *dst* is ``NULL``, the caller is responsible " "for decrementing the reference count by calling its ``Release`` method when " "necessary." msgstr "" +"一方、新しい値を代入する前に *dst* の参照カウントを減らすことはありません。\n" +"*dst* が ``NULL`` でなければ、呼び出し側が必要に応じてその ``Release`` メソッ" +"ドを呼び出し、参照カウントを減らす責任を持ちます。" #: ../../library/ctypes.rst:2214 msgid "" @@ -3567,41 +4294,46 @@ msgstr "" "この関数は変更可能な文字バッファを作成します。返されるオブジェクトは :class:" "`c_char` の ctypes 配列です。" -#: ../../library/ctypes.rst:2226 msgid "" "If *size* is given (and not ``None``), it must be an :class:`int`. It " "specifies the size of the returned array." msgstr "" +"*size* を指定する場合 (``None`` 以外の場合)、:class:`int` でなければなりませ" +"ん。\n" +"返す配列のサイズを指定します。" -#: ../../library/ctypes.rst:2229 msgid "" "If the *init* argument is given, it must be :class:`bytes`. It is used to " "initialize the array items. Bytes not initialized this way are set to zero " "(NUL)." msgstr "" +"*init* 引数を指定する場合、:class:`bytes` でなければなりません。\n" +"配列の要素の初期化に使います。\n" +"この方法で初期化されないバイトは、ゼロ (NUL) に設定されます。" -#: ../../library/ctypes.rst:2233 msgid "" "If *size* is not given (or if it is ``None``), the buffer is made one " "element larger than *init*, effectively adding a NUL terminator." msgstr "" +"*size* を省略した場合 (または ``None`` の場合)、バッファを *init* より 1 要素" +"分大きくすることで、実質的に NUL 終端文字を追加します。" -#: ../../library/ctypes.rst:2236 msgid "" "If both arguments are given, *size* must not be less than ``len(init)``." msgstr "" +"両方の引数を指定する場合、*size* は ``len(init)`` 以上でなければなりません。" -#: ../../library/ctypes.rst:2240 msgid "" "If *size* is equal to ``len(init)``, a NUL terminator is not added. Do not " "treat such a buffer as a C string." msgstr "" +"*size* が ``len(init)`` と等しい場合、NUL 終端文字は追加されません。\n" +"そのようなバッファを C 文字列として扱わないでください。" #: ../../library/ctypes.rst:2243 msgid "For example::" msgstr "例えば::" -#: ../../library/ctypes.rst:2245 msgid "" ">>> bytes(create_string_buffer(2))\n" "b'\\x00\\x00'\n" @@ -3616,6 +4348,18 @@ msgid "" " ...\n" "ValueError: byte string too long" msgstr "" +">>> bytes(create_string_buffer(2))\n" +"b'\\x00\\x00'\n" +">>> bytes(create_string_buffer(b'ab'))\n" +"b'ab\\x00'\n" +">>> bytes(create_string_buffer(b'ab', 2))\n" +"b'ab'\n" +">>> bytes(create_string_buffer(b'ab', 4))\n" +"b'ab\\x00\\x00'\n" +">>> bytes(create_string_buffer(b'abcdef', 2))\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: byte string too long" msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " @@ -3632,11 +4376,12 @@ msgstr "" "この関数は変更可能な Unicode 文字バッファを作成します。返されるオブジェクト" "は :class:`c_wchar` の ctypes 配列です。" -#: ../../library/ctypes.rst:2267 msgid "" "The function takes the same arguments as :func:`~create_string_buffer` " "except *init* must be a string and *size* counts :class:`c_wchar`." msgstr "" +"この関数は :func:`~create_string_buffer` と同じ引数を取りますが、*init* は文" +"字列である必要があり、*size* は :class:`c_wchar` の個数を表します。" msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " @@ -3645,47 +4390,62 @@ msgstr "" "引数 ``init``, ``size`` を指定して :ref:`監査イベント ` ``ctypes." "create_unicode_buffer`` を送出します。" -#: ../../library/ctypes.rst:2275 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllCanUnloadNow function that the " "_ctypes extension dll exports." msgstr "" +"この関数は、ctypes でプロセス内 COM サーバーを実装するためのフックです。\n" +"``_ctypes`` 拡張 DLL がエクスポートする ``DllCanUnloadNow()`` 関数から呼び出" +"されます。" -#: ../../library/ctypes.rst:2284 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllGetClassObject function that the " "``_ctypes`` extension dll exports." msgstr "" +"この関数は、ctypes でプロセス内 COM サーバーを実装するためのフックです。\n" +"``_ctypes`` 拡張 DLL がエクスポートする ``DllGetClassObject()`` 関数から呼び" +"出されます。" -#: ../../library/ctypes.rst:2294 msgid "" "Try to provide a list of paths of the shared libraries loaded into the " "current process. These paths are not normalized or processed in any way. " "The function can raise :exc:`OSError` if the underlying platform APIs fail. " "The exact functionality is system dependent." msgstr "" +"現在のプロセスにロードされた共有ライブラリのパスの一覧を取得しようとしま" +"す。\n" +"これらのパスには正規化などの処理は一切行いません。\n" +"基盤となるプラットフォーム API が失敗した場合、:exc:`OSError` を送出すること" +"があります。\n" +"厳密な動作はシステムに依存します。" -#: ../../library/ctypes.rst:2299 msgid "" "On most platforms, the first element of the list represents the current " "executable file. It may be an empty string." msgstr "" +"ほとんどのプラットフォームでは、リストの最初の要素は現在の実行ファイルを表し" +"ます。\n" +"空文字列の場合もあります。" -#: ../../library/ctypes.rst:2307 msgid "" "Returns a textual description of the error code *code*. If no error code is " "specified, the last error code is used by calling the Windows API function :" "func:`GetLastError`." msgstr "" +"エラーコード *code* の説明文を返します。\n" +"エラーコードを指定しない場合は、Windows API 関数 :func:`GetLastError` を呼び" +"出して最後のエラーコードを取得し、それを使用します。" -#: ../../library/ctypes.rst:2316 msgid "" "Returns the last error code set by Windows in the calling thread. This " "function calls the Windows ``GetLastError()`` function directly, it does not " "return the ctypes-private copy of the error code." msgstr "" +"呼び出し元スレッドで Windows が設定した最後のエラーコードを返します。\n" +"Windows の ``GetLastError()`` 関数を直接呼び出し、ctypes 内部のエラーコードの" +"コピーは返しません。" #: ../../library/ctypes.rst:2325 msgid "" @@ -3701,11 +4461,12 @@ msgid "" msgstr "" "引数無しで :ref:`監査イベント ` ``ctypes.get_errno`` を送出します。" -#: ../../library/ctypes.rst:2332 msgid "" "Returns the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread." msgstr "" +"呼び出し元スレッドにある、システムの :data:`!LastError` 変数の ctypes 内部の" +"コピーの現在値を返します。" msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " @@ -3734,14 +4495,16 @@ msgstr "" "ロックを値 *c* を *count* バイト分書き込みます。 *dst* はアドレスを指定する整" "数または ctypes インスタンスである必要があります。" -#: ../../library/ctypes.rst:2356 msgid "" "Create or return a ctypes pointer type. Pointer types are cached and reused " "internally, so calling this function repeatedly is cheap. *type* must be a " "ctypes type." msgstr "" +"ctypes のポインタ型を作成するか、既存の型を返します。\n" +"ポインタ型は内部でキャッシュされて再利用されるため、繰り返し呼び出しても負荷" +"は小さくなります。\n" +"*type* は ctypes の型でなければなりません。" -#: ../../library/ctypes.rst:2362 msgid "" "The resulting pointer type is cached in the ``__pointer_type__`` attribute " "of *type*. It is possible to set this attribute before the first call to " @@ -3749,12 +4512,20 @@ msgid "" "discouraged: manually creating a suitable pointer type is difficult without " "relying on implementation details that may change in future Python versions." msgstr "" +"結果のポインタ型は、*type* の ``__pointer_type__`` 属性にキャッシュされま" +"す。\n" +"最初に ``POINTER`` を呼び出す前にこの属性を設定すれば、独自のポインタ型を指定" +"できます。\n" +"ただし、この方法は推奨しません。\n" +"将来の Python バージョンで変わりうる実装の詳細に依存せず、適切なポインタ型を" +"手動で作成することは難しいためです。" -#: ../../library/ctypes.rst:2373 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" +"*obj* を指す新しいポインタインスタンスを作成します。\n" +"返されるオブジェクトの型は ``POINTER(type(obj))`` です。" #: ../../library/ctypes.rst:2376 msgid "" @@ -3791,12 +4562,13 @@ msgstr "" "引数 ``errno`` を指定して :ref:`監査イベント ` ``ctypes." "set_errno`` を送出します。" -#: ../../library/ctypes.rst:2398 msgid "" "Sets the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread to *value* and return the previous " "value." msgstr "" +"呼び出し元スレッドにある、システムの :data:`!LastError` 変数の ctypes 内部の" +"コピーの現在値を *value* に設定し、以前の値を返します。" msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " @@ -3813,59 +4585,72 @@ msgstr "" "ctypes の型やインスタンスのメモリバッファのサイズをバイト数で返します。C の " "``sizeof`` 演算子と同様の動きをします。" -#: ../../library/ctypes.rst:2415 msgid "" "Return the byte string at *void \\*ptr*. If *size* is specified, it is used " "as size, otherwise the string is assumed to be zero-terminated." msgstr "" +"*void \\*ptr* にあるバイト文字列を返します。\n" +"*size* を指定した場合はそのサイズを使い、省略した場合はゼロ終端文字列と仮定し" +"ます。" -#: ../../library/ctypes.rst:2419 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." msgstr "" +"引数 ``ptr``、``size`` を持つ :ref:`監査イベント ` ``ctypes." +"string_at`` が発生します。" -#: ../../library/ctypes.rst:2424 msgid "" "Creates an instance of :exc:`OSError`. If *code* is not specified, :func:" "`GetLastError` is called to determine the error code. If *descr* is not " "specified, :func:`FormatError` is called to get a textual description of the " "error." msgstr "" +":exc:`OSError` のインスタンスを作成します。\n" +"*code* を指定しない場合は、:func:`GetLastError` を呼び出してエラーコードを取" +"得します。\n" +"*descr* を指定しない場合は、:func:`FormatError` を呼び出してエラーの説明文を" +"取得します。" -#: ../../library/ctypes.rst:2431 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" +"以前は :exc:`WindowsError` のインスタンスを作成していましたが、現在は :exc:" +"`OSError` の別名になっています。" -#: ../../library/ctypes.rst:2438 msgid "" "Return the wide-character string at *void \\*ptr*. If *size* is specified, " "it is used as the number of characters of the string, otherwise the string " "is assumed to be zero-terminated." msgstr "" +"*void \\*ptr* にあるワイド文字列を返します。\n" +"*size* を指定した場合は文字数として使い、省略した場合はゼロ終端文字列と仮定し" +"ます。" -#: ../../library/ctypes.rst:2443 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." msgstr "" +"引数 ``ptr``、``size`` を持つ :ref:`監査イベント ` ``ctypes." +"wstring_at`` が発生します。" -#: ../../library/ctypes.rst:2448 msgid "" "Return a :class:`memoryview` object of length *size* that references memory " "starting at *void \\*ptr*." msgstr "" +"*void \\*ptr* から始まるメモリを参照する、長さ *size* の :class:`memoryview` " +"オブジェクトを返します。" -#: ../../library/ctypes.rst:2451 msgid "" "If *readonly* is true, the returned :class:`!memoryview` object can not be " "used to modify the underlying memory. (Changes made by other means will " "still be reflected in the returned object.)" msgstr "" +"*readonly* が真の場合、返される :class:`!memoryview` オブジェクトを使って参照" +"先のメモリを変更することはできません (ほかの方法で行った変更は、返されたオブ" +"ジェクトにも反映されます)。" -#: ../../library/ctypes.rst:2456 msgid "" "This function is similar to :func:`string_at` with the key difference of not " "making a copy of the specified memory. It is a semantically equivalent (but " @@ -3874,12 +4659,19 @@ msgid "" "integers, *ptr* can also be given as a :class:`ctypes.POINTER` or a :func:" "`~ctypes.byref` object.)" msgstr "" +"この関数は :func:`string_at` に似ていますが、指定したメモリのコピーを作成しな" +"い点が大きく異なります。\n" +"``memoryview((c_byte * size).from_address(ptr))`` と意味的に同等で、より効率" +"的な代替手段です。\n" +":meth:`~_CData.from_address` は整数のみを受け付けますが、*ptr* には :class:" +"`ctypes.POINTER` や :func:`~ctypes.byref` のオブジェクトも指定できます。" -#: ../../library/ctypes.rst:2463 msgid "" "Raises an :ref:`auditing event ` ``ctypes.memoryview_at`` with " "arguments ``address``, ``size``, ``readonly``." msgstr "" +"引数 ``address``、``size``、``readonly`` を持つ :ref:`監査イベント " +"` ``ctypes.memoryview_at`` が発生します。" #: ../../library/ctypes.rst:2471 msgid "Data types" @@ -3901,13 +4693,13 @@ msgstr "" "す。これはメモリブロックがポインタを含む場合に存続し続ける必要のある他の " "Python オブジェクトを含んでいます。" -#: ../../library/ctypes.rst:2483 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -"ctypes データ型の共通メソッド、すべてのクラスメソッドが存在します (正確に" -"は、 :term:`メタクラス ` のメソッドです):" +"ctypes データ型に共通のメソッドです。\n" +"すべてクラスメソッドです (正確には :term:`メタクラス ` のメソッド" +"です):" #: ../../library/ctypes.rst:2488 msgid "" @@ -3951,19 +4743,23 @@ msgstr "" "このメソッドは *address* で指定されたメモリを使って ctypes 型のインスタンスを" "返します。 *address* は整数でなければなりません。" -#: ../../library/ctypes.rst:2511 ../../library/ctypes.rst:2513 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" +"このメソッドと、それを間接的に呼び出すメソッドは、引数 ``address`` を持つ :" +"ref:`監査イベント ` ``ctypes.cdata`` を発生させます。" -#: ../../library/ctypes.rst:2519 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " "foreign function's :attr:`~_CFuncPtr.argtypes` tuple; it must return an " "object that can be used as a function call parameter." msgstr "" +"*obj* を ctypes の型に適合させるメソッドです。\n" +"外部関数の :attr:`~_CFuncPtr.argtypes` タプルにその型が含まれている場合、実際" +"の関数呼び出しで使われるオブジェクトを渡して呼び出されます。\n" +"関数呼び出しの引数として使えるオブジェクトを返す必要があります。" #: ../../library/ctypes.rst:2524 msgid "" @@ -3985,16 +4781,17 @@ msgstr "" "ンスを返します。 *name* はエクスポートされたデータの名前で、 *library* はロー" "ドされた共有ライブラリです。" -#: ../../library/ctypes.rst:2534 msgid "Common class variables of ctypes data types:" -msgstr "" +msgstr "ctypes データ型に共通のクラス変数:" -#: ../../library/ctypes.rst:2538 msgid "" "The pointer type that was created by calling :func:`POINTER` for " "corresponding ctypes data type. If a pointer type was not yet created, the " "attribute is missing." msgstr "" +"対応する ctypes データ型に対して :func:`POINTER` を呼び出して作成したポインタ" +"型です。\n" +"まだポインタ型を作成していない場合、この属性は存在しません。" #: ../../library/ctypes.rst:2544 msgid "Common instance variables of ctypes data types:" @@ -4061,17 +4858,20 @@ msgstr "" "整数型とポインタ型では整数、文字型では一文字の bytes オブジェクトまたは文字" "列、文字へのポインタ型では Python の bytes オブジェクトまたは文字列です。" -#: ../../library/ctypes.rst:2588 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`!ctypes` does *not* implement " "original object return, always a new object is constructed. The same is " "true for all other ctypes object instances." msgstr "" +"ctypes インスタンスから ``value`` 属性を取得すると、通常は毎回新しいオブジェ" +"クトが返されます。\n" +":mod:`!ctypes` は元のオブジェクトを返す機能を実装 *しておらず*、常に新しいオ" +"ブジェクトを構築します。\n" +"これは、ほかのすべての ctypes オブジェクトのインスタンスにも当てはまります。" -#: ../../library/ctypes.rst:2593 msgid "Each subclass has a class attribute:" -msgstr "" +msgstr "各サブクラスには、以下のクラス属性があります:" #: ../../library/ctypes.rst:2597 msgid "" @@ -4090,13 +4890,16 @@ msgid "" "code will be unused." msgstr "" -#: ../../library/ctypes.rst:2612 msgid "" "The :mod:`array` and :ref:`struct ` modules, as well as " "third-party modules like `numpy `__, use similar -- but " "slightly different -- type codes." msgstr "" +":mod:`array` モジュールや :ref:`struct ` モジュール、" +"`numpy `__ などのサードパーティー製モジュールでも、似てはいるも" +"のの少し異なる型コードを使用しています。" #: ../../library/ctypes.rst:2617 msgid "" @@ -4108,13 +4911,16 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2625 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " "will receive an instance of this subclass from the function call. Of course, " "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" +"基本データ型のサブクラスは、この動作を継承 *しません*。\n" +"したがって、外部関数の :attr:`!restype` が :class:`c_void_p` のサブクラスの場" +"合、関数呼び出しからそのサブクラスのインスタンスを受け取ります。\n" +"もちろん、``value`` 属性にアクセスすればポインタの値を取得できます。" #: ../../library/ctypes.rst:2630 msgid "These are the fundamental ctypes data types:" @@ -4178,23 +4984,26 @@ msgstr "" "C :c:expr:`float` データ型を表します。コンストラクタはオプションの浮動小数点" "数初期化子を受け取ります。" -#: ../../library/ctypes.rst:2674 msgid "" "Represents the C :c:expr:`double complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" +"利用可能な場合に、C の :c:expr:`double complex` データ型を表します。\n" +"コンストラクタは省略可能な :class:`complex` の初期値を受け付けます。" -#: ../../library/ctypes.rst:2682 msgid "" "Represents the C :c:expr:`float complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" +"利用可能な場合に、C の :c:expr:`float complex` データ型を表します。\n" +"コンストラクタは省略可能な :class:`complex` の初期値を受け付けます。" -#: ../../library/ctypes.rst:2690 msgid "" "Represents the C :c:expr:`long double complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" +"利用可能な場合に、C の :c:expr:`long double complex` データ型を表します。\n" +"コンストラクタは省略可能な :class:`complex` の初期値を受け付けます。" #: ../../library/ctypes.rst:2698 msgid "" @@ -4206,11 +5015,12 @@ msgstr "" "期化子を受け取ります。オーバーフローのチェックは行われません。 ``sizeof(int) " "== sizeof(long)`` であるプラットフォームでは、 :class:`c_long` の別名です。" -#: ../../library/ctypes.rst:2705 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. It is an alias for :" "class:`c_byte`." msgstr "" +"C の 8 ビットの :c:expr:`signed int` データ型を表します。\n" +":class:`c_byte` の別名です。" #: ../../library/ctypes.rst:2711 msgid "" @@ -4244,13 +5054,17 @@ msgstr "" "C :c:expr:`signed long` データ型を表します。コンストラクタはオプションの整数" "初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2735 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done. On " "platforms where ``sizeof(long long) == sizeof(long)`` it is an alias to :" "class:`c_long`." msgstr "" +"C の :c:expr:`signed long long` データ型を表します。\n" +"コンストラクタは省略可能な整数の初期値を受け付けますが、オーバーフローの検査" +"は行いません。\n" +"``sizeof(long long) == sizeof(long)`` となるプラットフォームでは、:class:" +"`c_long` の別名です。" #: ../../library/ctypes.rst:2743 msgid "" @@ -4260,24 +5074,29 @@ msgstr "" "C :c:expr:`signed short` データ型を表します。コンストラクタはオプションの整数" "初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2749 msgid "" "Represents the C :c:type:`size_t` datatype. Usually an alias for another " "unsigned integer type." msgstr "" +"C の :c:type:`size_t` データ型を表します。\n" +"通常は、ほかの符号なし整数型の別名です。" -#: ../../library/ctypes.rst:2755 msgid "" "Represents the :c:type:`Py_ssize_t` datatype. This is a signed version of :c:" "type:`size_t`; that is, the POSIX :c:type:`ssize_t` type. Usually an alias " "for another integer type." msgstr "" +":c:type:`Py_ssize_t` データ型を表します。\n" +"これは :c:type:`size_t` の符号付き版、すなわち POSIX の :c:type:`ssize_t` 型" +"です。\n" +"通常は、ほかの整数型の別名です。" -#: ../../library/ctypes.rst:2765 msgid "" "Represents the C :c:type:`time_t` datatype. Usually an alias for another " "integer type." msgstr "" +"C の :c:type:`time_t` データ型を表します。\n" +"通常は、ほかの整数型の別名です。" #: ../../library/ctypes.rst:2773 msgid "" @@ -4300,11 +5119,12 @@ msgstr "" "``sizeof(int) == sizeof(long)`` であるプラットフォームでは :class:`c_ulong` " "の別名です。" -#: ../../library/ctypes.rst:2787 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. It is an alias for :" "class:`c_ubyte`." msgstr "" +"C の 8 ビットの :c:expr:`unsigned int` データ型を表します。\n" +":class:`c_ubyte` の別名です。" #: ../../library/ctypes.rst:2793 msgid "" @@ -4391,11 +5211,12 @@ msgstr "" "表します。 ``True`` または ``False`` の値を持ち、コンストラクタは真偽値と解釈" "できるオブジェクトを受け取ります。" -#: ../../library/ctypes.rst:2858 msgid "" "Represents a :c:type:`!HRESULT` value, which contains success or error " "information for a function or method call." msgstr "" +"関数やメソッドの呼び出しの成功またはエラーに関する情報を含む :c:type:`!" +"HRESULT` 値を表します。" #: ../../library/ctypes.rst:2866 msgid "" @@ -4405,9 +5226,8 @@ msgstr "" "C :c:expr:`PyObject *` データ型を表します。引数なしでこれを呼び出すと " "``NULL`` :c:expr:`PyObject *` ポインタを作成します。" -#: ../../library/ctypes.rst:2869 msgid ":class:`!py_object` is now a :term:`generic type`." -msgstr "" +msgstr ":class:`!py_object` が :term:`generic type` になりました。" #: ../../library/ctypes.rst:2874 msgid "" @@ -4425,11 +5245,12 @@ msgstr "構造化データ型" msgid "Abstract base class for unions in native byte order." msgstr "ネイティブのバイトオーダーでの共用体のための抽象ベースクラス。" -#: ../../library/ctypes.rst:2890 msgid "" "Unions share common attributes and behavior with structures; see :class:" "`Structure` documentation for details." msgstr "" +"共用体は構造体と共通の属性と動作を持ちます。\n" +"詳細は :class:`Structure` のドキュメントを参照してください。" #: ../../library/ctypes.rst:2895 msgid "Abstract base class for unions in *big endian* byte order." @@ -4510,7 +5331,6 @@ msgstr "" "数を定義することができます。これにより、次のように自身を直接または間接的に参" "照するデータ型を作成できるようになります::" -#: ../../library/ctypes.rst:2945 msgid "" "class List(Structure):\n" " pass\n" @@ -4518,12 +5338,18 @@ msgid "" " ...\n" " ]" msgstr "" +"class List(Structure):\n" +" pass\n" +"List._fields_ = [(\"pnext\", POINTER(List)),\n" +" ...\n" +" ]" -#: ../../library/ctypes.rst:2951 msgid "" "The :attr:`!_fields_` class variable can only be set once. Later assignments " "will raise an :exc:`AttributeError`." msgstr "" +":attr:`!_fields_` クラス変数は 1 回だけ設定できます。\n" +"その後の代入では :exc:`AttributeError` を送出します。" #: ../../library/ctypes.rst:2954 msgid "" @@ -4535,123 +5361,155 @@ msgid "" "fields, as if :attr:`!_fields_` was empty." msgstr "" -#: ../../library/ctypes.rst:2962 msgid "" "Sub-subclasses of structure types inherit the fields of the base class plus " "the :attr:`_fields_` defined in the sub-subclass, if any." msgstr "" +"構造体型のサブクラスのサブクラスは、基底クラスのフィールドを継承し、さらに自" +"身で :attr:`_fields_` を定義していれば、そのフィールドも持ちます。" -#: ../../library/ctypes.rst:2968 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance." msgstr "" +"インスタンス内の構造体フィールドのアラインメントを上書きするための、省略可能" +"な小さな整数です。" -#: ../../library/ctypes.rst:2971 msgid "" "This is only implemented for the MSVC-compatible memory layout (see :attr:" "`_layout_`)." msgstr "" +"これは MSVC 互換のメモリレイアウトでのみ実装されています (:attr:`_layout_` を" +"参照)。" -#: ../../library/ctypes.rst:2974 msgid "" "Setting :attr:`!_pack_` to 0 is the same as not setting it at all. " "Otherwise, the value must be a positive power of two. The effect is " "equivalent to ``#pragma pack(N)`` in C, except :mod:`!ctypes` may allow " "larger *n* than what the compiler accepts." msgstr "" +":attr:`!_pack_` に 0 を設定することは、設定しないことと同じです。\n" +"それ以外の場合、値は 2 のべき乗の正の整数でなければなりません。\n" +"効果は C の ``#pragma pack(N)`` と同じですが、:mod:`!ctypes` はコンパイラが受" +"け付けるより大きな *n* を許可する場合があります。" -#: ../../library/ctypes.rst:2979 msgid "" ":attr:`!_pack_` must already be defined when :attr:`_fields_` is assigned, " "otherwise it will have no effect." msgstr "" +":attr:`_fields_` に代入する時点で :attr:`!_pack_` が定義されていないと、効果" +"はありません。" -#: ../../library/ctypes.rst:2984 msgid "" "For historical reasons, if :attr:`!_pack_` is non-zero, the MSVC-compatible " "layout will be used by default. On non-Windows platforms, this default is " "deprecated and is slated to become an error in Python 3.19. If it is " "intended, set :attr:`~Structure._layout_` to ``'ms'`` explicitly." msgstr "" +"歴史的な理由から、:attr:`!_pack_` がゼロ以外の場合、デフォルトで MSVC 互換の" +"レイアウトを使用します。\n" +"Windows 以外のプラットフォームでは、このデフォルトの動作は非推奨であり、" +"Python 3.19 ではエラーになる予定です。\n" +"このレイアウトを意図している場合は、:attr:`~Structure._layout_` に ``'ms'`` " +"を明示的に設定してください。" -#: ../../library/ctypes.rst:2993 msgid "" "An optional small integer that allows increasing the alignment of the " "structure when being packed or unpacked to/from memory." msgstr "" +"構造体をメモリへパックしたりメモリからアンパックしたりするときのアラインメン" +"トを大きくする、省略可能な小さな整数です。" -#: ../../library/ctypes.rst:2996 msgid "" "The value must not be negative. The effect is equivalent to " "``__attribute__((aligned(N)))`` on GCC or ``#pragma align(N)`` on MSVC, " "except :mod:`!ctypes` may allow values that the compiler would reject." msgstr "" +"値は負であってはなりません。\n" +"効果は GCC の ``__attribute__((aligned(N)))`` や MSVC の ``#pragma " +"align(N)`` と同じですが、:mod:`!ctypes` はコンパイラが拒否する値を許可する場" +"合があります。" -#: ../../library/ctypes.rst:3001 msgid "" ":attr:`!_align_` can only *increase* a structure's alignment requirements. " "Setting it to 0 or 1 has no effect." msgstr "" +":attr:`!_align_` は、構造体のアラインメント要件を *大きくする* ことしかできま" +"せん。\n" +"0 や 1 に設定しても効果はありません。" -#: ../../library/ctypes.rst:3004 msgid "" "Using values that are not powers of two is discouraged and may lead to " "surprising behavior." msgstr "" +"2 のべき乗でない値の使用は推奨されず、予想外の動作を引き起こす場合がありま" +"す。" -#: ../../library/ctypes.rst:3007 msgid "" ":attr:`!_align_` must already be defined when :attr:`_fields_` is assigned, " "otherwise it will have no effect." msgstr "" +":attr:`_fields_` に代入する時点で :attr:`!_align_` が定義されていないと、効果" +"はありません。" -#: ../../library/ctypes.rst:3014 msgid "" "An optional string naming the struct/union layout. It can currently be set " "to:" msgstr "" +"構造体や共用体のレイアウト名を指定する、省略可能な文字列です。\n" +"現在は以下の値を指定できます:" -#: ../../library/ctypes.rst:3017 msgid "" "``\"ms\"``: the layout used by the Microsoft compiler (MSVC). On GCC and " "Clang, this layout can be selected with ``__attribute__((ms_struct))``." msgstr "" +"``\"ms\"``: Microsoft コンパイラ (MSVC) が使うレイアウトです。\n" +"GCC と Clang では、``__attribute__((ms_struct))`` でこのレイアウトを選べま" +"す。" -#: ../../library/ctypes.rst:3020 msgid "" "``\"gcc-sysv\"``: the layout used by GCC with the System V or “SysV-like” " "data model, as used on Linux and macOS. With this layout, :attr:`~Structure." "_pack_` must be unset or zero." msgstr "" +"``\"gcc-sysv\"``: Linux や macOS で使われる、System V または「SysV に似た」" +"データモデルで GCC が使うレイアウトです。\n" +"このレイアウトでは、:attr:`~Structure._pack_` を設定しないか、ゼロにする必要" +"があります。" -#: ../../library/ctypes.rst:3024 msgid "" "If not set explicitly, ``ctypes`` will use a default that matches the " "platform conventions. This default may change in future Python releases (for " "example, when a new platform gains official support, or when a difference " "between similar platforms is found). Currently the default will be:" msgstr "" +"明示的に設定しない場合、``ctypes`` はプラットフォームの慣例に合うデフォルト値" +"を使います。\n" +"このデフォルト値は、例えば新しいプラットフォームが正式にサポートされたり、似" +"たプラットフォーム間の違いが見つかったりした場合など、将来の Python リリース" +"で変わる可能性があります。\n" +"現在のデフォルト値は次のとおりです:" -#: ../../library/ctypes.rst:3030 msgid "On Windows: ``\"ms\"``" -msgstr "" +msgstr "Windows の場合: ``\"ms\"``" -#: ../../library/ctypes.rst:3031 msgid "" "When :attr:`~Structure._pack_` is specified: ``\"ms\"``. (This is " "deprecated; see :attr:`~Structure._pack_` documentation.)" msgstr "" +":attr:`~Structure._pack_` を指定した場合: ``\"ms\"`` (この動作は非推奨で" +"す。\n" +":attr:`~Structure._pack_` のドキュメントを参照してください)。" -#: ../../library/ctypes.rst:3033 msgid "Otherwise: ``\"gcc-sysv\"``" -msgstr "" +msgstr "それ以外の場合: ``\"gcc-sysv\"``" -#: ../../library/ctypes.rst:3035 msgid "" ":attr:`!_layout_` must already be defined when :attr:`~Structure._fields_` " "is assigned, otherwise it will have no effect." msgstr "" +":attr:`~Structure._fields_` に代入する時点で :attr:`!_layout_` が定義されてい" +"ないと、効果はありません。" #: ../../library/ctypes.rst:3042 msgid "" @@ -4663,19 +5521,21 @@ msgstr "" "`_fields_` が代入されたとき、 :attr:`_anonymous_` がすでに定義されていなけれ" "ばなりません。そうでなければ、何ら影響はありません。" -#: ../../library/ctypes.rst:3046 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`!ctypes` will create descriptors in the structure type that allows " "accessing the nested fields directly, without the need to create the " "structure or union field." msgstr "" +"この変数に列挙するフィールドは、構造体型または共用体型のフィールドでなければ" +"なりません。\n" +":mod:`!ctypes` は、構造体型にデスクリプタを作成し、構造体や共用体のフィールド" +"を作成せずに、入れ子のフィールドへ直接アクセスできるようにします。" #: ../../library/ctypes.rst:3051 msgid "Here is an example type (Windows)::" msgstr "型の例です (Windows)::" -#: ../../library/ctypes.rst:3053 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4687,6 +5547,15 @@ msgid "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" msgstr "" +"class _U(Union):\n" +" _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" +" (\"lpadesc\", POINTER(ARRAYDESC)),\n" +" (\"hreftype\", HREFTYPE)]\n" +"\n" +"class TYPEDESC(Structure):\n" +" _anonymous_ = (\"u\",)\n" +" _fields_ = [(\"u\", _U),\n" +" (\"vt\", VARTYPE)]" msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " @@ -4738,13 +5607,13 @@ msgstr "" "解釈され、そのため、同じ名前をもつ :attr:`_fields_` を初期化するか、 :attr:" "`_fields_` に存在しない名前に対しては新しい属性を作ります。" -#: ../../library/ctypes.rst:3091 msgid "" "Descriptor for fields of a :class:`Structure` and :class:`Union`. For " "example::" msgstr "" +":class:`Structure` と :class:`Union` のフィールドのデスクリプタです。\n" +"例えば次のように使います。 ::" -#: ../../library/ctypes.rst:3094 msgid "" ">>> class Color(Structure):\n" "... _fields_ = (\n" @@ -4766,72 +5635,95 @@ msgid "" ">>> Color.blinking.bit_offset\n" "1" msgstr "" +">>> class Color(Structure):\n" +"... _fields_ = (\n" +"... ('red', c_uint8),\n" +"... ('green', c_uint8),\n" +"... ('blue', c_uint8),\n" +"... ('intense', c_bool, 1),\n" +"... ('blinking', c_bool, 1),\n" +"... )\n" +"...\n" +">>> Color.red\n" +"\n" +">>> Color.green.type\n" +"\n" +">>> Color.blue.byte_offset\n" +"2\n" +">>> Color.intense\n" +"\n" +">>> Color.blinking.bit_offset\n" +"1" -#: ../../library/ctypes.rst:3114 msgid "All attributes are read-only." -msgstr "" +msgstr "すべての属性は読み出し専用です。" -#: ../../library/ctypes.rst:3116 msgid "" ":class:`!CField` objects are created via :attr:`~Structure._fields_`; do not " "instantiate the class directly." msgstr "" +":class:`!CField` オブジェクトは :attr:`~Structure._fields_` を通じて作成され" +"ます。\n" +"このクラスを直接インスタンス化しないでください。" -#: ../../library/ctypes.rst:3121 msgid "" "Previously, descriptors only had ``offset`` and ``size`` attributes and a " "readable string representation; the :class:`!CField` class was not available " "directly." msgstr "" +"以前のデスクリプタは ``offset`` と ``size`` 属性、および読みやすい文字列表現" +"だけを持ち、:class:`!CField` クラスは直接利用できませんでした。" -#: ../../library/ctypes.rst:3127 msgid "Name of the field, as a string." -msgstr "" +msgstr "文字列で表したフィールド名です。" -#: ../../library/ctypes.rst:3131 msgid "Type of the field, as a :ref:`ctypes class `." msgstr "" +":ref:`ctypes のクラス ` で表したフィールドの型です。" -#: ../../library/ctypes.rst:3136 msgid "Offset of the field, in bytes." -msgstr "" +msgstr "フィールドのオフセット (バイト単位) です。" -#: ../../library/ctypes.rst:3138 msgid "" "For bitfields, this is the offset of the underlying byte-aligned *storage " "unit*; see :attr:`~CField.bit_offset`." msgstr "" +"ビットフィールドでは、これはバイト境界に整列した、元になる *格納単位* のオフ" +"セットです。\n" +":attr:`~CField.bit_offset` を参照してください。" -#: ../../library/ctypes.rst:3143 msgid "Size of the field, in bytes." -msgstr "" +msgstr "フィールドのサイズ (バイト単位) です。" -#: ../../library/ctypes.rst:3145 msgid "" "For bitfields, this is the size of the underlying *storage unit*. Typically, " "it has the same size as the bitfield's type." msgstr "" +"ビットフィールドでは、これは元になる *格納単位* のサイズです。\n" +"通常はビットフィールドの型と同じサイズです。" -#: ../../library/ctypes.rst:3150 msgid "For non-bitfields, equivalent to :attr:`~CField.byte_size`." -msgstr "" +msgstr "ビットフィールドでない場合は、:attr:`~CField.byte_size` と同じです。" -#: ../../library/ctypes.rst:3152 msgid "" "For bitfields, this contains a backwards-compatible bit-packed value that " "combines :attr:`~CField.bit_size` and :attr:`~CField.bit_offset`. Prefer " "using the explicit attributes instead." msgstr "" +"ビットフィールドでは、:attr:`~CField.bit_size` と :attr:`~CField.bit_offset` " +"をビット単位でまとめた、後方互換性のための値を格納します。\n" +"代わりに、これらの明示的な属性を使ってください。" -#: ../../library/ctypes.rst:3159 msgid "True if this is a bitfield." -msgstr "" +msgstr "ビットフィールドであれば真です。" -#: ../../library/ctypes.rst:3164 msgid "" "The location of a bitfield within its *storage unit*, that is, within :attr:" "`~CField.byte_size` bytes of memory starting at :attr:`~CField.byte_offset`." msgstr "" +"ビットフィールドの *格納単位* 内での位置です。\n" +"つまり、:attr:`~CField.byte_offset` から始まる :attr:`~CField.byte_size` バイ" +"トのメモリ内での位置です。" #: ../../library/ctypes.rst:3168 msgid "" @@ -4840,17 +5732,20 @@ msgid "" "significant bits." msgstr "" -#: ../../library/ctypes.rst:3172 msgid "" "For non-bitfields, :attr:`!bit_offset` is zero and :attr:`!bit_size` is " "equal to ``byte_size * 8``." msgstr "" +"ビットフィールドでない場合、:attr:`!bit_offset` はゼロで、:attr:`!bit_size` " +"は ``byte_size * 8`` に等しくなります。" -#: ../../library/ctypes.rst:3177 msgid "" "True if this field is anonymous, that is, it contains nested sub-fields that " "should be merged into a containing structure or union." msgstr "" +"このフィールドが匿名であれば真です。\n" +"つまり、外側の構造体や共用体に統合される入れ子のサブフィールドを含む場合で" +"す。" #: ../../library/ctypes.rst:3184 msgid "Arrays and pointers" @@ -4860,7 +5755,6 @@ msgstr "配列とポインタ" msgid "Abstract base class for arrays." msgstr "配列のための抽象基底クラスです。" -#: ../../library/ctypes.rst:3190 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`!ctypes` data type with a non-negative integer. Alternatively, you can " @@ -4869,10 +5763,16 @@ msgid "" "and slice accesses; for slice reads, the resulting object is *not* itself " "an :class:`Array`." msgstr "" +"具体的な配列型を作成する推奨の方法は、任意の :mod:`!ctypes` データ型に非負の" +"整数を掛けることです。\n" +"この型をサブクラス化し、:attr:`_length_` と :attr:`_type_` クラス変数を定義す" +"る方法もあります。\n" +"配列の要素は、通常の添字やスライスによるアクセスで読み書きできます。\n" +"スライスを読み出した場合、結果のオブジェクト自体は :class:`Array` では *あり" +"ません*。" -#: ../../library/ctypes.rst:3197 msgid "Arrays are :ref:`generic ` over the type of their elements." -msgstr "" +msgstr "配列は、要素の型について :ref:`ジェネリック ` です。" #: ../../library/ctypes.rst:3202 msgid "" @@ -4895,15 +5795,16 @@ msgstr "" "配列のサブクラスのコンストラクタは、位置引数を受け付けて、配列を順番に初期化" "するために使用します。" -#: ../../library/ctypes.rst:3217 msgid "" "Create an array. Equivalent to ``type * length``, where *type* is a :mod:`!" "ctypes` data type and *length* an integer." msgstr "" +"配列を作成します。\n" +"*type* を :mod:`!ctypes` のデータ型、*length* を整数とした ``type * length`` " +"と同じです。" -#: ../../library/ctypes.rst:3221 msgid "In favor of multiplication." -msgstr "" +msgstr "代わりに乗算を使用してください。" #: ../../library/ctypes.rst:3227 msgid "Private, abstract base class for pointers." @@ -4955,23 +5856,19 @@ msgstr "" "この例外は外部関数呼び出しが渡された引数を変換できなかったときに送出されま" "す。" -#: ../../library/ctypes.rst:3264 msgid "This exception is raised when a COM method call failed." -msgstr "" +msgstr "COM メソッドの呼び出しが失敗した場合に送出される例外です。" -#: ../../library/ctypes.rst:3268 msgid "The integer value representing the error code." -msgstr "" +msgstr "エラーコードを表す整数値です。" -#: ../../library/ctypes.rst:3272 msgid "The error message." -msgstr "" +msgstr "エラーメッセージ。" -#: ../../library/ctypes.rst:3276 msgid "The 5-tuple ``(descr, source, helpfile, helpcontext, progid)``." msgstr "" +"5 要素のタプル ``(descr, source, helpfile, helpcontext, progid)`` です。" -#: ../../library/ctypes.rst:3278 msgid "" "*descr* is the textual description. *source* is the language-dependent " "``ProgID`` for the class or application that raised the error. *helpfile* " @@ -4979,3 +5876,9 @@ msgid "" "identifier. *progid* is the ``ProgID`` of the interface that defined the " "error." msgstr "" +"*descr* は説明文です。\n" +"*source* は、エラーを発生させたクラスやアプリケーションの、言語に依存する " +"``ProgID`` です。\n" +"*helpfile* はヘルプファイルのパスです。\n" +"*helpcontext* はヘルプコンテキスト識別子です。\n" +"*progid* は、エラーを定義したインターフェースの ``ProgID`` です。" diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 222fad33a..3dcc44651 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -30,12 +30,14 @@ msgstr ":mod:`!curses.ascii` --- ASCII 文字のユーティリティー" msgid "**Source code:** :source:`Lib/curses/ascii.py`" msgstr "**ソースコード:** :source:`Lib/curses/ascii.py`" -#: ../../library/curses.ascii.rst:11 msgid "" "The :mod:`!curses.ascii` module supplies name constants for ASCII characters " "and functions to test membership in various ASCII character classes. The " "constants supplied are names for control characters as follows:" msgstr "" +":mod:`!curses.ascii` モジュールは、ASCII 文字の名前を表す定数と、文字がさまざ" +"まな ASCII 文字クラスに属するかどうかを調べる関数を提供します。\n" +"提供する定数は、以下の制御文字の名前です:" #: ../../library/curses.ascii.rst:16 msgid "Name" @@ -153,9 +155,8 @@ msgstr "キャンセル (Cancel)" msgid "End of medium" msgstr "媒体終端" -#: ../../library/curses.ascii.rst:74 msgid "Substitute" -msgstr "代入文字" +msgstr "置換文字" #: ../../library/curses.ascii.rst:76 msgid "Escape" @@ -222,9 +223,8 @@ msgstr "" msgid "Checks for a character value that fits in the 7-bit ASCII set." msgstr "文字が 7 ビット ASCII 文字に合致するかどうかを調べます。" -#: ../../library/curses.ascii.rst:117 msgid "Checks for an ASCII blank character; space or horizontal tab." -msgstr "" +msgstr "ASCII の空白文字 (空白または水平タブ) かどうかを調べます。" #: ../../library/curses.ascii.rst:122 msgid "" @@ -239,9 +239,8 @@ msgstr "" "ASCII 10 進数字、すなわち ``'0'`` から ``'9'`` までの文字かどうかを調べます。" "``c in string.digits`` と等価です。" -#: ../../library/curses.ascii.rst:133 msgid "Checks for any ASCII printable character except space." -msgstr "" +msgstr "空白以外の ASCII 印字可能文字かどうかを調べます。" #: ../../library/curses.ascii.rst:138 msgid "Checks for an ASCII lower-case character." @@ -251,11 +250,10 @@ msgstr "ASCII 小文字かどうかを調べます。" msgid "Checks for any ASCII printable character including space." msgstr "空白文字を含め、ASCII 印字可能文字かどうかを調べます。" -#: ../../library/curses.ascii.rst:148 msgid "" "Checks for any ASCII printable character which is not a space or an " "alphanumeric character." -msgstr "" +msgstr "空白でも英数字でもない ASCII 印字可能文字かどうかを調べます。" #: ../../library/curses.ascii.rst:154 msgid "" @@ -276,11 +274,12 @@ msgid "" msgstr "" "ASCII 16 進数字かどうかを調べます。``c in string.hexdigits`` と等価です。" -#: ../../library/curses.ascii.rst:171 msgid "" "Checks for an ASCII control character (ordinal values 0 to 31). Unlike :" "func:`iscntrl`, this does not include the delete character (0x7f)." msgstr "" +"ASCII 制御文字 (文字コード 0 から 31) かどうかを調べます。\n" +":func:`iscntrl` とは異なり、削除文字 (0x7f) は含みません。" #: ../../library/curses.ascii.rst:177 msgid "Checks for a non-ASCII character (ordinal values 0x80 and above)." diff --git a/library/curses.panel.po b/library/curses.panel.po index 311666040..2bcfa2e00 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -41,29 +41,32 @@ msgstr "" msgid "Functions" msgstr "関数" -#: ../../library/curses.panel.rst:19 msgid "The module :mod:`!curses.panel` defines the following exception:" -msgstr "" +msgstr ":mod:`!curses.panel` モジュールは以下の例外を定義します:" -#: ../../library/curses.panel.rst:24 msgid "Exception raised when a curses panel library function returns an error." msgstr "" +"curses のパネルライブラリの関数がエラーを返した際に送出される例外です。" -#: ../../library/curses.panel.rst:27 msgid "The module :mod:`!curses.panel` defines the following functions:" -msgstr "" +msgstr ":mod:`!curses.panel` モジュールは以下の関数を定義します:" #: ../../library/curses.panel.rst:32 msgid "Returns the bottom panel in the panel stack." msgstr "パネルスタックの最下層のパネルを返します。" -#: ../../library/curses.panel.rst:37 msgid "" "Returns a panel object, associating it with the given window *win* and " "placing the new panel on top of the panel stack. Be aware that you need to " "keep the returned panel object referenced explicitly. If you don't, the " "panel object is garbage collected and removed from the panel stack." msgstr "" +"指定したウィンドウ *win* に関連付けた新しいパネルをパネルスタックの最上層に配" +"置し、パネルオブジェクトを返します。\n" +"返されたパネルオブジェクトへの参照を明示的に保持しておく必要があることに注意" +"してください。\n" +"そうしなければ、パネルオブジェクトはガベージコレクションの対象となり、パネル" +"スタックから取り除かれます。" #: ../../library/curses.panel.rst:45 msgid "Returns the top panel in the panel stack." @@ -77,17 +80,19 @@ msgstr "" "仮想スクリーンをパネルスタック変更後の状態に更新します。この関数では :func:" "`curses.doupdate` を呼ばないので、ユーザは自分で呼び出す必要があります。" -#: ../../library/curses.panel.rst:57 msgid "Panel objects" -msgstr "" +msgstr "パネルオブジェクト" -#: ../../library/curses.panel.rst:77 msgid "" "Panel objects, as returned by :func:`new_panel` above, are windows with a " "stacking order. There's always a window associated with a panel which " "determines the content, while the panel methods are responsible for the " "window's depth in the panel stack." msgstr "" +"上の :func:`new_panel` が返すパネルオブジェクトは、重なり順のあるウィンドウで" +"す。\n" +"パネルには常に、その内容を決めるウィンドウが関連付けられており、パネルのメ" +"ソッドはパネルスタック内でのウィンドウの深さを制御します。" #: ../../library/curses.panel.rst:82 msgid "Panel objects have the following methods:" @@ -136,11 +141,12 @@ msgstr "" "パネルのユーザポインタを *obj* に設定します。このメソッドは任意のデータをパネ" "ルに関連付けるために使われ、任意の Python オブジェクトにすることができます。" -#: ../../library/curses.panel.rst:129 msgid "" "Display the panel (which might have been hidden), placing it on top of the " "panel stack." msgstr "" +"パネル (隠れている場合もあります) をパネルスタックの最上層に配置して表示しま" +"す。" #: ../../library/curses.panel.rst:135 msgid "Push panel to the top of the stack." diff --git a/library/curses.po b/library/curses.po index 246c741a9..9f1dc9f01 100644 --- a/library/curses.po +++ b/library/curses.po @@ -31,11 +31,12 @@ msgstr ":mod:`!curses` --- 文字セル表示のターミナル処理" msgid "**Source code:** :source:`Lib/curses`" msgstr "**ソースコード:** :source:`Lib/curses`" -#: ../../library/curses.rst:12 msgid "" "The :mod:`!curses` module provides an interface to the curses library, the " "de-facto standard for portable advanced terminal handling." msgstr "" +":mod:`!curses` モジュールは、移植可能な高度な端末処理の事実上の標準である " +"curses ライブラリへのインターフェースを提供します。" #: ../../library/curses.rst:15 msgid "" @@ -60,29 +61,35 @@ msgstr "" "このモジュールは :ref:`モバイルプラットフォーム ` と :" "ref:`WebAssemblyプラットフォーム ` をサポートしません。" -#: ../../includes/optional-module.rst:1 msgid "" "This is an :term:`optional module`. If it is missing from your copy of " "CPython, look for documentation from your distributor (that is, whoever " "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" +"これは :term:`オプションモジュール ` です。\n" +"使用している CPython に含まれていない場合は、配布元 (Python を提供した組織な" +"ど) のドキュメントを確認してください。\n" +"配布する立場の場合は :ref:`optional-module-requirements` を参照してください。" -#: ../../library/curses.rst:28 msgid "" "Whenever the documentation mentions a *character* it can be specified as an " "integer, a one-character Unicode string or a one-byte byte string. An " "integer is the code of a single encoded byte, optionally combined with " "attributes and a color pair, as returned by :meth:`window.inch`." msgstr "" +"このドキュメントで *文字* と記されている箇所では、整数、1 文字の Unicode 文字" +"列、または 1 バイトのバイト文字列を指定できます。\n" +"整数はエンコードされた 1 バイトのコードであり、:meth:`window.inch` の返り値の" +"ように、属性や色ペアを組み合わせたものでも構いません。" -#: ../../library/curses.rst:33 msgid "" "Whenever the documentation mentions a *character string* it can be specified " "as a Unicode string or a byte string." msgstr "" +"このドキュメントで *文字列* と記されている箇所では、Unicode 文字列またはバイ" +"ト文字列を指定できます。" -#: ../../library/curses.rst:38 msgid "" "Whether curses may be used from several threads depends on the underlying " "library and how it was built. In many implementations, including the default " @@ -91,6 +98,14 @@ msgid "" "`~window.refresh`) release the :term:`GIL`, unsynchronized use from several " "threads can then crash the interpreter. Serialize the calls." msgstr "" +"複数のスレッドから curses を使用できるかどうかは、基盤となるライブラリとその" +"ビルド方法に依存します。\n" +"ncurses のデフォルトビルドを含む多くの実装では、スクリーンの状態が共有され、" +"スレッドセーフではありません。\n" +"ブロックや更新を行うメソッド (:meth:`~window.getch` や :meth:`~window." +"refresh` など) は :term:`GIL` を解放するため、複数のスレッドから同期せずに使" +"用するとインタープリタがクラッシュする可能性があります。\n" +"呼び出しを直列化してください。" #: ../../library/curses.rst:50 msgid "Module :mod:`curses.ascii`" @@ -138,9 +153,8 @@ msgstr "" msgid "Functions" msgstr "関数" -#: ../../library/curses.rst:69 msgid "The module :mod:`!curses` defines the following exception:" -msgstr "" +msgstr ":mod:`!curses` モジュールは以下の例外を定義します:" #: ../../library/curses.rst:74 msgid "Exception raised when a curses library function returns an error." @@ -156,31 +170,32 @@ msgstr "" "値は常に現在のカーソルになります。オプションの *attr* がある場合、デフォルト" "値は :const:`A_NORMAL` です。" -#: ../../library/curses.rst:82 msgid "The module :mod:`!curses` defines the following functions:" -msgstr "" +msgstr ":mod:`!curses` モジュールは以下の関数を定義します:" -#: ../../library/curses.rst:87 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application." msgstr "" +"この機能をサポートする端末で、色のデフォルト値を使用できるようにします。\n" +"アプリケーションで透過表示をサポートするには、この関数を使用してください。" -#: ../../library/curses.rst:90 msgid "" "Assign terminal default foreground/background colors to color number ``-1``. " "So ``init_pair(x, COLOR_RED, -1)`` will initialize pair *x* as red on " "default background and ``init_pair(x, -1, COLOR_BLUE)`` will initialize pair " "*x* as default foreground on blue." msgstr "" +"端末のデフォルトの前景色と背景色を色番号 ``-1`` に割り当てます。\n" +"したがって、``init_pair(x, COLOR_RED, -1)`` はペア *x* をデフォルトの背景色に" +"赤の前景色として初期化し、``init_pair(x, -1, COLOR_BLUE)`` はペア *x* を青の" +"背景色にデフォルトの前景色として初期化します。" -#: ../../library/curses.rst:95 msgid "Change the definition of the color-pair ``0`` to ``(fg, bg)``." -msgstr "" +msgstr "色ペア ``0`` の定義を ``(fg, bg)`` に変更します。" -#: ../../library/curses.rst:97 msgid "This is an ncurses extension." -msgstr "" +msgstr "これは ncurses の拡張機能です。" #: ../../library/curses.rst:104 msgid "" @@ -223,7 +238,6 @@ msgstr "" "出し側のプログラムに対する通常の効果をもっています。まず :func:`raw` を呼び出" "し、次いで :func:`cbreak` を呼び出すと、端末を cbreak モードにします。" -#: ../../library/curses.rst:132 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " "color *color_number*, which must be between ``0`` and ``COLORS - 1``. " @@ -231,8 +245,12 @@ msgid "" "will be between ``0`` (no component) and ``1000`` (maximum amount of " "component). Raise an exception if the color is not supported." msgstr "" +"色 *color_number* の赤、緑、青 (RGB) 成分の強度を返します。\n" +"*color_number* は ``0`` から ``COLORS - 1`` の範囲でなければなりません。\n" +"指定した色の R、G、B の値を含む 3 要素のタプルを返します。\n" +"各値は ``0`` (成分なし) から ``1000`` (成分の最大量) の範囲です。\n" +"その色がサポートされていない場合は例外を送出します。" -#: ../../library/curses.rst:141 msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " @@ -240,6 +258,11 @@ msgid "" "`!A_\\*` attributes. :func:`pair_number` is the counterpart to this " "function." msgstr "" +"指定した色ペアでテキストを表示するための属性値を返します。\n" +"最初の 256 個の色ペアだけがサポートされています。\n" +"この属性値は :const:`A_STANDOUT`、:const:`A_REVERSE`、その他の :const:`!" +"A_\\*` 属性と組み合わせることができます。\n" +":func:`pair_number` はこの関数と逆の処理を行います。" msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " @@ -282,13 +305,17 @@ msgstr "" msgid "Insert an *ms* millisecond pause in output." msgstr "出力に *ms* ミリ秒の一時停止を入れます。" -#: ../../library/curses.rst:180 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " "representing the desired next state. The :func:`doupdate` function updates " "the physical screen to match the virtual screen." msgstr "" +"物理スクリーンを更新します。\n" +"curses ライブラリは、現在の物理スクリーンの内容を表すものと、次に表示したい状" +"態を表す仮想スクリーンという 2 つのデータ構造を保持しています。\n" +":func:`doupdate` 関数は、仮想スクリーンに一致するように物理スクリーンを更新し" +"ます。" #: ../../library/curses.rst:185 msgid "" @@ -330,7 +357,6 @@ msgstr "" "ます。Unix オペレーティングシステムでは、この値は curses プログラムが制御して" "いる端末の属性であり、curses ライブラリ自体では設定されません。" -#: ../../library/curses.rst:213 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " "is called. The effect is that, during the initialization, :envvar:`LINES` " @@ -340,6 +366,14 @@ msgid "" "current line, and so are screen updates. This may be used for enabling " "character-at-a-time line editing without touching the rest of the screen." msgstr "" +":func:`.filter` ルーチンを使用する場合は、:func:`initscr` より前に呼び出す必" +"要があります。\n" +"これにより、初期化時に :envvar:`LINES` が ``1`` に設定され、機能 ``clear``、" +"``cup``、``cud``、``cud1``、``cuu1``、``cuu``、``vpa`` が無効になり、" +"``home`` 文字列が ``cr`` の値に設定されます。\n" +"その結果、カーソルもスクリーンの更新も現在の行に限定されます。\n" +"これを利用すると、スクリーンの他の部分に触れずに、1 文字ずつ行を編集できるよ" +"うになります。" #: ../../library/curses.rst:223 msgid "" @@ -386,11 +420,12 @@ msgstr "" "`BUTTONn_DOUBLE_CLICKED`, :const:`BUTTONn_TRIPLE_CLICKED`, :const:" "`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :const:`BUTTON_ALT`。" -#: ../../library/curses.rst:247 ../../library/curses.rst:1920 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." msgstr "" +"基盤となる curses ライブラリが ``BUTTON5_*`` 定数を提供する場合に、それらが公" +"開されるようになりました。" #: ../../library/curses.rst:254 msgid "" @@ -401,13 +436,18 @@ msgstr "" "仮想スクリーンにおける現在のカーソル位置をタプル ``(y, x)`` で返します。 :" "meth:`leaveok` が ``True`` に設定されていれば、 ``(-1, -1)`` が返されます。" -#: ../../library/curses.rst:260 msgid "" "Read window-related data stored in the file by an earlier :meth:`window." "putwin` call. The routine then creates and initializes a new window using " "that data, returning the new window object. The *file* argument must be a " "file object opened for reading in binary mode." msgstr "" +"以前の :meth:`window.putwin` 呼び出しでファイルに保存したウィンドウ関連のデー" +"タを読み込みます。\n" +"続いて、そのデータを使用して新しいウィンドウを作成して初期化し、新しいウィン" +"ドウオブジェクトを返します。\n" +"*file* 引数は、バイナリモードで読み込み用に開いたファイルオブジェクトでなけれ" +"ばなりません。" #: ../../library/curses.rst:268 msgid "" @@ -417,16 +457,18 @@ msgstr "" "端末が色表示を行える場合には ``True`` を返します。そうでない場合には " "``False`` を返します。" -#: ../../library/curses.rst:272 msgid "" "Return ``True`` if the module supports extended colors; otherwise, return " "``False``. Extended color support allows more than 256 color pairs for " "terminals that support more than 16 colors (for example, xterm-256color)." msgstr "" +"モジュールが拡張カラーをサポートしている場合は ``True`` を、そうでない場合は " +"``False`` を返します。\n" +"拡張カラーのサポートにより、16 色を超える色をサポートする端末 (例えば " +"xterm-256color) で 256 個を超える色ペアを使用できます。" -#: ../../library/curses.rst:276 msgid "Extended color support requires ncurses version 6.1 or later." -msgstr "" +msgstr "拡張カラーのサポートには ncurses バージョン 6.1 以降が必要です。" #: ../../library/curses.rst:282 msgid "" @@ -490,7 +532,6 @@ msgstr "" "で何も行いません; :func:`can_change_color` が ``True`` を返す場合にのみ動作し" "ます。" -#: ../../library/curses.rst:323 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " @@ -503,6 +544,17 @@ msgid "" "refreshed and all occurrences of that color-pair are changed to the new " "definition." msgstr "" +"色ペアの定義を変更します。\n" +"変更する色ペアの番号、前景色の番号、背景色の番号という 3 つの引数を取りま" +"す。\n" +"*pair_number* の値は ``1`` から ``COLOR_PAIRS - 1`` の範囲でなければなりませ" +"ん (色ペア ``0`` は :func:`use_default_colors` と :func:" +"`assume_default_colors` でのみ変更できます)。\n" +"引数 *fg* と *bg* の値は ``0`` から ``COLORS - 1`` の範囲か、:func:`!" +"use_default_colors` または :func:`!assume_default_colors` を呼び出した後であ" +"れば ``-1`` でなければなりません。\n" +"色ペアが以前に初期化されていた場合、スクリーンが更新され、その色ペアを使用し" +"ているすべての箇所が新しい定義に変わります。" #: ../../library/curses.rst:338 msgid "" @@ -512,10 +564,11 @@ msgstr "" "ライブラリを初期化します。スクリーン全体をあらわす :ref:`ウィンドウ ` オブジェクトを返します。" -#: ../../library/curses.rst:341 msgid "" "See :func:`setupterm` for a caveat about calling it before this function." msgstr "" +"この関数より先に :func:`setupterm` を呼び出す際の注意事項は、その関数の説明を" +"参照してください。" #: ../../library/curses.rst:345 msgid "" @@ -525,12 +578,14 @@ msgstr "" "端末のオープン時にエラーが発生した場合、curses ライブラリによってインタープリ" "タが終了される場合があります。" -#: ../../library/curses.rst:351 msgid "" "If *flag* is ``True``, pressing an interrupt key (interrupt, break, or quit) " "will flush all output in the terminal driver queue. If *flag* is ``False``, " "no flushing is done." msgstr "" +"*flag* が ``True`` の場合、割り込みキー (interrupt、break、quit) を押すと端末" +"ドライバのキュー内の出力がすべてフラッシュされます。\n" +"*flag* が ``False`` の場合、フラッシュは行われません。" msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " @@ -563,16 +618,17 @@ msgstr "" "Alt キーと組み合わせたキー (128--255) の名前は、先頭に ``b'M-'`` が付き、その" "後に対応する ASCII 文字の名前が続く bytes オブジェクトになります。" -#: ../../library/curses.rst:377 msgid "Raise a :exc:`ValueError` if *k* is negative." -msgstr "" +msgstr "*k* が負の場合は :exc:`ValueError` を送出します。" -#: ../../library/curses.rst:382 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" +"ユーザの現在の行消去文字を、1 バイトの bytes オブジェクトとして返します。\n" +"Unix オペレーティングシステムでは、これは curses プログラムの制御端末の属性で" +"あり、curses ライブラリ自体が設定するものではありません。" #: ../../library/curses.rst:389 msgid "" @@ -592,7 +648,6 @@ msgstr "" "*flag* が ``True`` の場合、8 ビット文字の入力を許可します。*flag* が " "``False`` の場合、7 ビット文字だけを許可します。" -#: ../../library/curses.rst:402 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " @@ -600,8 +655,11 @@ msgid "" "sixth of a second. Use a negative *interval* to obtain the interval value " "without changing it." msgstr "" +"ボタンを押してから離すまでのイベントをクリックと認識する最大時間をミリ秒で設" +"定し、以前の時間間隔を返します。\n" +"デフォルト値は 166 ミリ秒、すなわち 6 分の 1 秒です。\n" +"時間間隔を変更せずに取得するには、負の *interval* を使用してください。" -#: ../../library/curses.rst:410 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " @@ -609,6 +667,12 @@ msgid "" "previous value of the mouse event mask. If this function is never called, " "no mouse events are ever reported." msgstr "" +"通知するマウスイベントを設定し、タプル ``(availmask, oldmask)`` を返しま" +"す。\n" +"*availmask* は、指定したマウスイベントのうち通知可能なものを示し、完全に失敗" +"した場合は ``0`` になります。\n" +"*oldmask* は以前のマウスイベントマスクの値です。\n" +"この関数を一度も呼び出さない場合、マウスイベントは一切通知されません。" #: ../../library/curses.rst:419 msgid "Sleep for *ms* milliseconds." @@ -622,7 +686,6 @@ msgstr "" "与えられた行とカラム数を持つパッド (pad) データ構造を生成し、そのポインタを返" "します。パッドはウィンドウオブジェクトとして返されます。" -#: ../../library/curses.rst:427 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -637,6 +700,19 @@ msgid "" "arguments define a clipping box on the screen within which the pad region is " "to be displayed." msgstr "" +"パッドはウィンドウに似ていますが、スクリーンの大きさによる制限がなく、スク" +"リーンの特定の部分に関連付けられるとは限りません。\n" +"大きなウィンドウが必要で、一度にスクリーンに表示するのはその一部だけという場" +"合にパッドを使用できます。\n" +"パッドでは、スクロールや入力のエコーバックなどによる自動更新は行われませ" +"ん。\n" +"パッドの :meth:`~window.refresh` と :meth:`~window.noutrefresh` メソッドに" +"は、表示するパッドの部分とスクリーン上の表示位置を指定する 6 つの引数が必要で" +"す。\n" +"これらの引数は *pminrow*、*pmincol*、*sminrow*、*smincol*、*smaxrow*、" +"*smaxcol* です。\n" +"*p* で始まる引数は表示するパッド領域の左上隅を示し、*s* で始まる引数はパッド" +"領域を表示するスクリーン上の切り取り矩形を定義します。" #: ../../library/curses.rst:443 msgid "" @@ -664,9 +740,9 @@ msgstr "" "し、出力時に改行文字を復帰 (return) と改行 (line-feed) に変換します。newline " "モードは初期化時にはオンになっています。" -#: ../../library/curses.rst:456 msgid "If *flag* is ``False``, the effect is the same as calling :func:`nonl`." msgstr "" +"*flag* が ``False`` の場合、:func:`nonl` の呼び出しと同じ効果があります。" #: ../../library/curses.rst:461 msgid "" @@ -730,18 +806,19 @@ msgstr "" "*attr* に対する色ペアセットの番号を返します。:func:`color_pair` はこの関数の" "逆に相当します。" -#: ../../library/curses.rst:506 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability, a bytes object, for the current terminal. Note that the " "output of :func:`putp` always goes to standard output." msgstr "" +"``tputs(str, 1, putchar)`` と等価です。\n" +"現在の端末に対し、指定した terminfo 機能の値である bytes オブジェクトを出力し" +"ます。\n" +":func:`putp` の出力先は常に標準出力であることに注意してください。" -#: ../../library/curses.rst:510 ../../library/curses.rst:653 -#: ../../library/curses.rst:663 ../../library/curses.rst:673 -#: ../../library/curses.rst:683 msgid ":func:`setupterm` (or :func:`initscr`) must be called first." msgstr "" +"先に :func:`setupterm` (または :func:`initscr`) を呼び出す必要があります。" #: ../../library/curses.rst:515 msgid "" @@ -819,26 +896,27 @@ msgstr "" ":func:`resetty` で使用される、バッファ内の端末モードの現在の状態を保存しま" "す。" -#: ../../library/curses.rst:569 msgid "Retrieves the value set by :func:`set_escdelay`." -msgstr "" +msgstr ":func:`set_escdelay` で設定した値を取得します。" -#: ../../library/curses.rst:575 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" +"キーボードで入力した単独のエスケープ文字と、カーソルキーやファンクションキー" +"が送信するエスケープシーケンスを区別するため、エスケープ文字を読み込んだ後に" +"待機する時間をミリ秒で設定します。" -#: ../../library/curses.rst:583 msgid "Retrieves the value set by :func:`set_tabsize`." -msgstr "" +msgstr ":func:`set_tabsize` で設定した値を取得します。" -#: ../../library/curses.rst:589 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" +"curses ライブラリがウィンドウにタブ文字を追加する際、タブ文字を空白に変換する" +"ために使用する桁数を設定します。" msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " @@ -860,19 +938,24 @@ msgstr "" "れる初期化シーケンスへのファイル記述子です。指定されないまたは ``-1`` の場" "合、``sys.stdout`` のファイル記述子が使用されます。" -#: ../../library/curses.rst:608 msgid "" "Raise a :exc:`curses.error` if the terminal could not be found or its " "terminfo database entry could not be read. If the terminal has already been " "initialized, this function has no effect." msgstr "" +"端末が見つからないか、その terminfo データベースのエントリーを読み込めない場" +"合、:exc:`curses.error` を送出します。\n" +"端末がすでに初期化されている場合、この関数は何もしません。" -#: ../../library/curses.rst:614 msgid "" "Calling :func:`initscr` after :func:`setupterm` leaks the terminal that :" "func:`setupterm` allocated: the curses library keeps only a single current " "terminal and does not free the previously allocated one." msgstr "" +":func:`setupterm` の後に :func:`initscr` を呼び出すと、:func:`setupterm` が確" +"保した端末がリークします。\n" +"curses ライブラリは現在の端末を 1 つだけ保持し、それまでに確保した端末を解放" +"しないためです。" #: ../../library/curses.rst:622 msgid "" @@ -884,7 +967,6 @@ msgstr "" "び出す前に呼び出さなくてはなりません。この関数は :func:`initscr` を呼んだ直後" "に呼ぶようにしておくとよいでしょう。" -#: ../../library/curses.rst:626 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -893,6 +975,11 @@ msgid "" "also restores the colors on the terminal to the values they had when the " "terminal was just turned on." msgstr "" +":func:`start_color` は 8 つの基本色 (黒、赤、緑、黄、青、マゼンタ、シアン、" +"白) と、:mod:`!curses` モジュールの 2 つのグローバル変数 :const:`COLORS` およ" +"び :const:`COLOR_PAIRS` を初期化します。\n" +"これらの変数には、端末がサポートできる色と色ペアの最大数が格納されます。\n" +"また、端末の色を端末の電源投入直後の値に戻します。" #: ../../library/curses.rst:635 msgid "" @@ -934,15 +1021,17 @@ msgstr "" "が数値で表せる機能値でない場合 ``-2`` を返し、機能がキャンセルされているか、" "端末記述上に見つからない場合 ``-1`` を返します。" -#: ../../library/curses.rst:668 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " "is not a terminfo \"string capability\", or is canceled or absent from the " "terminal description." msgstr "" +"terminfo の機能名 *capname* に対応する文字列機能の値を bytes オブジェクトとし" +"て返します。\n" +"*capname* が terminfo の「文字列機能」でない場合や、端末の記述で取り消されて" +"いるか存在しない場合は、``None`` を返します。" -#: ../../library/curses.rst:678 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " "should be a parameterized byte string obtained from the terminfo database. " @@ -950,6 +1039,12 @@ msgid "" "``b'\\033[6;4H'``, the exact result depending on terminal type. Up to nine " "integer parameters may be supplied." msgstr "" +"bytes オブジェクト *str* に指定したパラメータを適用します。\n" +"*str* は terminfo データベースから取得した、パラメータを含むバイト文字列でな" +"ければなりません。\n" +"例えば、``tparm(tigetstr(\"cup\"), 5, 3)`` は ``b'\\033[6;4H'`` を返すことが" +"ありますが、正確な結果は端末の種類によって異なります。\n" +"整数のパラメータを最大 9 個指定できます。" #: ../../library/curses.rst:688 msgid "" @@ -974,13 +1069,16 @@ msgstr "" "や doupdate を再度呼び出すまで先送りにします。この関数は異なるファイル記述子" "で先読みチェックを行うように指定することができます。" -#: ../../library/curses.rst:700 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*; any attributes and color pair are ignored. Control characters are " "represented as a caret followed by the character, for example as ``b'^C'``. " "Printing characters are left as they are." msgstr "" +"文字 *ch* の印字可能な表現を bytes オブジェクトとして返します。\n" +"属性と色ペアは無視されます。\n" +"制御文字は、``b'^C'`` のようにキャレットの後に文字を続けた形で表されます。\n" +"印字可能な文字はそのままです。" #: ../../library/curses.rst:708 msgid "Push *ch* so the next :meth:`~window.getch` will return it." @@ -988,21 +1086,23 @@ msgstr "" "*ch* をプッシュし、次に :meth:`~window.getch` を呼び出した時にその値が返るよ" "うにします。" -#: ../../library/curses.rst:710 msgid "" "*ch* may be an integer (a key code or the code of an encoded byte), a byte, " "or a string of length 1 which encodes to a single byte." msgstr "" +"*ch* には、整数 (キーコードまたはエンコードされたバイトのコード)、1 バイト、" +"またはエンコードすると 1 バイトになる長さ 1 の文字列を指定できます。" #: ../../library/curses.rst:715 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr ":meth:`!getch` を呼び出すまでは *ch* は一つしかプッシュできません。" -#: ../../library/curses.rst:720 msgid "" "Update the :const:`LINES` and :const:`COLS` module variables. Useful for " "detecting manual screen resize." msgstr "" +"モジュール変数 :const:`LINES` と :const:`COLS` を更新します。\n" +"手動によるスクリーンのサイズ変更を検出する際に役立ちます。" #: ../../library/curses.rst:728 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." @@ -1010,11 +1110,12 @@ msgstr "" "*ch* をプッシュし、次に :meth:`~window.get_wch` を呼び出した時にその値が返る" "ようにします。" -#: ../../library/curses.rst:730 msgid "" "*ch* may be an integer (a character code, not a key code) or a string of " "length 1." msgstr "" +"*ch* には、整数 (キーコードではなく文字コード) または長さ 1 の文字列を指定で" +"きます。" #: ../../library/curses.rst:735 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." @@ -1044,9 +1145,8 @@ msgstr "" "`COLUMNS` が設定されていないとウィンドウのサイズを使います) いても、" "terminfo データベースに指定された lines および columns の値を使います。" -#: ../../library/curses.rst:758 msgid "Equivalent to ``assume_default_colors(-1, -1)``." -msgstr "" +msgstr "``assume_default_colors(-1, -1)`` と等価です。" #: ../../library/curses.rst:763 msgid "" @@ -1071,9 +1171,8 @@ msgstr "" "期化します。終了時 (通常終了、例外による終了のどちらでも)、cooked モードに戻" "し、エコーをオンにし、端末キーパッドを無効にします。" -#: ../../library/curses.rst:777 msgid "Window objects" -msgstr "" +msgstr "ウィンドウオブジェクト" #: ../../library/curses.rst:781 msgid "" @@ -1093,12 +1192,15 @@ msgstr "" "描画された文字は上書きされます。デフォルトでは、文字の位置および属性はウィン" "ドウオブジェクトにおける現在の設定になります。" -#: ../../library/curses.rst:794 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower-right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" +"ウィンドウ、サブウィンドウ、パッドの外側に書き込むと :exc:`curses.error` が送" +"出されます。\n" +"ウィンドウ、サブウィンドウ、パッドの右下隅に書き込もうとすると、文字を表示し" +"た後に例外が送出されます。" #: ../../library/curses.rst:802 msgid "" @@ -1116,14 +1218,16 @@ msgstr "" "``(y, x)`` に文字列 *str* を属性 *attr* で描画します。以前ディスプレイにあっ" "た内容はすべて上書きされます。" -#: ../../library/curses.rst:815 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower-right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" +"ウィンドウ、サブウィンドウ、パッドの外側に書き込むと :exc:`curses.error` が送" +"出されます。\n" +"ウィンドウ、サブウィンドウ、パッドの右下隅に書き込もうとすると、文字列を表示" +"した後に例外が送出されます。" -#: ../../library/curses.rst:819 msgid "" "A bug in ncurses, the backend for this Python module, could cause segfaults " "when resizing windows. This was fixed in ncurses-6.1-20190511. If you are " @@ -1131,6 +1235,12 @@ msgid "" "meth:`!addstr` with a *str* that has embedded newlines; instead, call :meth:" "`!addstr` separately for each line." msgstr "" +"この Python モジュールのバックエンドである ncurses のバグにより、ウィンドウの" +"サイズ変更時にセグメンテーション違反が発生することがありました。\n" +"このバグは ncurses-6.1-20190511 で修正されました。\n" +"それ以前の ncurses を使用せざるを得ない場合は、改行を含む *str* で :meth:`!" +"addstr` を呼び出さず、代わりに各行に対して個別に :meth:`!addstr` を呼び出すこ" +"とで回避できます。" msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " @@ -1139,11 +1249,12 @@ msgstr "" "現在のウィンドウへのすべての書き込みに適用される \"バックグラウンド\" の属性" "セットから *attr* を取り除きます。" -#: ../../library/curses.rst:834 msgid "" "Add attribute *attr* to the \"background\" set applied to all writes to the " "current window." msgstr "" +"現在のウィンドウへのすべての書き込みに適用される「背景」の属性の集合に、属性 " +"*attr* を追加します。" #: ../../library/curses.rst:840 msgid "" @@ -1319,7 +1430,6 @@ msgstr "" "び *bs* は共に *horch* です。この関数では、角に使われるデフォルト文字が常に使" "用されます。" -#: ../../library/curses.rst:911 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -1328,6 +1438,13 @@ msgid "" "will be touched using the :meth:`touchline` method so that the contents will " "be redisplayed by the next window refresh." msgstr "" +"現在のカーソル位置、または指定した位置 ``(y, x)`` にある *num* 文字の属性を設" +"定します。\n" +"*num* を指定しないか ``-1`` にした場合は、行末までのすべての文字に属性が設定" +"されます。\n" +"``(y, x)`` を指定した場合、この関数はカーソルをその位置に移動します。\n" +"変更した行は :meth:`touchline` メソッドで変更済みと記録され、次回のウィンドウ" +"更新時に内容が再表示されます。" msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " @@ -1364,11 +1481,12 @@ msgstr "" "ウィンドウのすべての親ウィンドウについて、現在のカーソル位置を反映するよう更" "新します。" -#: ../../library/curses.rst:950 msgid "" "Delete the character under the cursor, or at ``(y, x)`` if specified. All " "characters to the right on the same line are shifted one position left." msgstr "" +"カーソルの下、または指定した ``(y, x)`` の位置の文字を削除します。\n" +"同じ行の右側にある文字はすべて 1 文字分左に移動します。" #: ../../library/curses.rst:956 msgid "" @@ -1407,11 +1525,11 @@ msgstr "" "含まれるかを調べて、``True`` または ``False`` を返します。スクリーン上のウィ" "ンドウの一部がマウスイベントの発生場所を含むかどうかを調べる上で便利です。" -#: ../../library/curses.rst:981 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" +"以前は ``True`` または ``False`` ではなく、``1`` または ``0`` を返していまし" +"た。" -#: ../../library/curses.rst:987 msgid "" "Encoding used to encode the string arguments of the methods and to decode " "their results on a build without wide-character support. The encoding " @@ -1419,22 +1537,27 @@ msgid "" "for example with :meth:`window.subwin`. By default, current locale encoding " "is used (see :func:`locale.getencoding`)." msgstr "" +"メソッドの文字列の引数をエンコードする際、およびワイド文字をサポートしないビ" +"ルドで結果をデコードする際に使用するエンコーディングです。\n" +"例えば :meth:`window.subwin` でサブウィンドウを作成すると、encoding 属性は親" +"ウィンドウから継承されます。\n" +"デフォルトでは現在のロケールのエンコーディングが使用されます (:func:`locale." +"getencoding` を参照)。" #: ../../library/curses.rst:998 msgid "Clear the window." msgstr "ウィンドウをクリアします。" -#: ../../library/curses.rst:1003 msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." -msgstr "" +msgstr "左上隅の座標をタプル ``(y, x)`` として返します。" -#: ../../library/curses.rst:1008 msgid "" "Return the given window's current background character/attribute pair. Its " "components can be extracted like those of :meth:`inch`." msgstr "" +"指定したウィンドウの現在の背景の文字と属性のペアを返します。\n" +"各成分は :meth:`inch` の返り値と同様に取り出せます。" -#: ../../library/curses.rst:1014 msgid "" "Read a key press, after moving the cursor to *y*, *x* if specified, and " "return it as an integer. The window is refreshed first if it is not a pad " @@ -1442,16 +1565,26 @@ msgid "" "return ``-1`` if the read is non-blocking or times out (see :meth:`nodelay` " "and :meth:`timeout`)." msgstr "" +"*y*、*x* が指定されていればカーソルをそこに移動してからキー入力を読み取り、整" +"数として返します。\n" +"ウィンドウがパッドではなく、前回の更新以降に変更されていれば、まず更新しま" +"す。\n" +"キーが押されるまで待機しますが、読み取りが非ブロッキングの場合やタイムアウト" +"した場合は ``-1`` を返します (:meth:`nodelay` と :meth:`timeout` を参照)。" -#: ../../library/curses.rst:1021 msgid "" "An ordinary key is returned as the code of a single byte of its encoding in " "the current locale, so a character encoded with several bytes takes several " "calls. For example, in a UTF-8 locale ``'é'`` is read as ``195``, then " "``169``. Use :meth:`get_wch` to read it as a single character." msgstr "" +"通常のキーは、現在のロケールのエンコーディングで表した 1 バイトのコードとして" +"返されるため、複数バイトでエンコードされる文字を読み取るには複数回の呼び出し" +"が必要です。\n" +"例えば UTF-8 ロケールでは、``'é'`` は ``195``、続いて ``169`` として読み取ら" +"れます。\n" +"1 文字として読み取るには :meth:`get_wch` を使用してください。" -#: ../../library/curses.rst:1027 msgid "" "In keypad mode (see :meth:`keypad`) function keys and other special keys are " "returned as one of the :ref:`KEY_* constants `, which " @@ -1459,14 +1592,21 @@ msgid "" "sequence does not arrive in time (see :meth:`notimeout` and :func:" "`set_escdelay`), their bytes are returned one at a time." msgstr "" +"キーパッドモード (:meth:`keypad` を参照) では、ファンクションキーやその他の特" +"殊キーは、通常のキーと区別できる :ref:`KEY_* 定数 ` の" +"いずれかとして返されます。\n" +"それ以外の場合、またはエスケープシーケンスが時間内に到着しなかった場合 (:" +"meth:`notimeout` と :func:`set_escdelay` を参照)、バイトが 1 つずつ返されま" +"す。" -#: ../../library/curses.rst:1034 ../../library/curses.rst:1054 msgid "" "In echo mode (see :func:`echo`) the key is added to the window as by :meth:" "`addch`; special keys are not echoed." msgstr "" +"echo モード (:func:`echo` を参照) では、:meth:`addch` と同様にキーがウィンド" +"ウに追加されます。\n" +"特殊キーはエコーバックされません。" -#: ../../library/curses.rst:1040 msgid "" "Read a key press, after moving the cursor to *y*, *x* if specified, and " "return it as a one-character :class:`str`. The window is refreshed first if " @@ -1474,8 +1614,14 @@ msgid "" "pressed, or raise :exc:`error` if the read is non-blocking or times out " "(see :meth:`nodelay` and :meth:`timeout`)." msgstr "" +"*y*、*x* が指定されていればカーソルをそこに移動してからキー入力を読み取り、1 " +"文字の :class:`str` として返します。\n" +"ウィンドウがパッドではなく、前回の更新以降に変更されていれば、まず更新しま" +"す。\n" +"キーが押されるまで待機しますが、読み取りが非ブロッキングの場合やタイムアウト" +"した場合は :exc:`error` を送出します (:meth:`nodelay` と :meth:`timeout` を参" +"照)。" -#: ../../library/curses.rst:1047 msgid "" "In keypad mode (see :meth:`keypad`) function keys and other special keys are " "returned as one of the :ref:`KEY_* constants `, an " @@ -1483,14 +1629,23 @@ msgid "" "(see :meth:`notimeout` and :func:`set_escdelay`), their characters are " "returned one at a time." msgstr "" +"キーパッドモード (:meth:`keypad` を参照) では、ファンクションキーやその他の特" +"殊キーは、整数である :ref:`KEY_* 定数 ` のいずれかとし" +"て返されます。\n" +"それ以外の場合、またはエスケープシーケンスが時間内に到着しなかった場合 (:" +"meth:`notimeout` と :func:`set_escdelay` を参照)、文字が 1 つずつ返されます。" -#: ../../library/curses.rst:1062 msgid "" "Read a key press as :meth:`getch` does, but return it as a :class:`str`: an " "ordinary key as a one-character string, the byte decoded as Latin-1, and a " "special key as its name, such as ``'KEY_UP'`` (see :func:`keyname`). Raise :" "exc:`error` instead of returning ``-1`` if there is no input." msgstr "" +":meth:`getch` と同様にキー入力を読み取りますが、:class:`str` として返しま" +"す。\n" +"通常のキーはバイトを Latin-1 でデコードした 1 文字の文字列として、特殊キーは " +"``'KEY_UP'`` のような名前として返します (:func:`keyname` を参照)。\n" +"入力がない場合、``-1`` を返す代わりに :exc:`error` を送出します。" #: ../../library/curses.rst:1070 msgid "Return a tuple ``(y, x)`` of the height and width of the window." @@ -1505,17 +1660,21 @@ msgstr "" "親ウィンドウ中におけるウィンドウの開始位置をタプル ``(y, x)`` で返します。" "ウィンドウに親ウィンドウがない場合 ``(-1, -1)`` を返します。" -#: ../../library/curses.rst:1085 msgid "" "Read a line of input from the user, with primitive line editing capacity, " "after moving the cursor to *y*, *x* if specified. Return it as a bytes " "object, in the encoding of the current locale and without the terminating " "newline. At most *n* bytes are read; *n* defaults to and cannot exceed 2047." msgstr "" +"*y*、*x* が指定されていればカーソルをそこに移動してから、基本的な行編集機能を" +"使ってユーザの入力を 1 行読み取ります。\n" +"末尾の改行を除き、現在のロケールのエンコーディングの bytes オブジェクトとして" +"返します。\n" +"最大 *n* バイトを読み取ります。\n" +"*n* のデフォルト値は 2047 で、この値を超えることはできません。" -#: ../../library/curses.rst:1092 ../../library/curses.rst:1197 msgid "The maximum value for *n* was increased from 1023 to 2047." -msgstr "" +msgstr "*n* の最大値が 1023 から 2047 に増えました。" #: ../../library/curses.rst:1098 msgid "" @@ -1525,12 +1684,14 @@ msgstr "" "ウィンドウの左上角からの相対で表した現在のカーソル位置をタプル ``(y, x)`` で" "返します。" -#: ../../library/curses.rst:1105 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch* with attributes *attr*. The line stops at the right " "edge of the window if fewer than *n* cells are available." msgstr "" +"``(y, x)`` を始点として、属性 *attr* の文字 *ch* からなる長さ *n* の水平線を" +"表示します。\n" +"使用できるセルが *n* 個に満たない場合、線はウィンドウの右端で止まります。" #: ../../library/curses.rst:1112 msgid "" @@ -1544,11 +1705,13 @@ msgstr "" "されます。curses が最初に初期化された際には文字挿入/削除はデフォルトで有効に" "なっています。" -#: ../../library/curses.rst:1120 msgid "" "If *flag* is ``True``, :mod:`!curses` will try to use hardware line editing " "facilities. Otherwise, curses will not use them." msgstr "" +"*flag* が ``True`` の場合、:mod:`!curses` はハードウェアの行編集機能を使用し" +"ようとします。\n" +"それ以外の場合、curses はその機能を使用しません。" #: ../../library/curses.rst:1126 msgid "" @@ -1562,7 +1725,6 @@ msgstr "" "くても良くなります。とはいえ、wrefresh を繰り返し呼び出すことになるため、この" "操作はかなりパフォーマンスを低下させます。デフォルトでは無効になっています。" -#: ../../library/curses.rst:1134 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper and the upper bits are the attributes; extract them " @@ -1573,6 +1735,15 @@ msgid "" "current locale has a character byte of ``0``; use :meth:`instr` to read such " "characters." msgstr "" +"ウィンドウ内の指定した位置の文字を返します。\n" +"下位 8 ビットが文字自体で、上位ビットが属性です。\n" +":data:`A_CHARTEXT` と :data:`A_ATTRIBUTES` のビットマスクでそれぞれを取り出" +"し、:func:`pair_number` で色ペアを取り出せます。\n" +"文字のバイトは、:meth:`instr` と同様に、セルの文字をロケールのエンコーディン" +"グで表したバイトです。\n" +"ワイド文字をサポートするビルドでは、現在のロケールで 1 バイトに収まらない文字" +"の文字バイトは ``0`` になります。\n" +"そのような文字を読み取るには :meth:`instr` を使用してください。" #: ../../library/curses.rst:1148 msgid "" @@ -1629,13 +1800,18 @@ msgstr "" "側にある文字はすべて右にシフトし、行の右端の文字は失われます。カーソル位置は " "(*y*, *x* が指定されていた場合はそこに移動しますが、その後は) 変化しません。" -#: ../../library/curses.rst:1191 msgid "" "Read the text of the window from the current cursor position, or from *y*, " "*x* if specified, to the end of the line, and return it as a bytes object, " "in the encoding of the current locale. Attributes and color pairs are " "stripped. At most *n* bytes are read; *n* defaults to and cannot exceed 2047." msgstr "" +"現在のカーソル位置、または指定した *y*、*x* から行末までのウィンドウ内のテキ" +"ストを読み取り、現在のロケールのエンコーディングの bytes オブジェクトとして返" +"します。\n" +"属性と色ペアは取り除かれます。\n" +"最大 *n* バイトを読み取ります。\n" +"*n* のデフォルト値は 2047 で、この値を超えることはできません。" #: ../../library/curses.rst:1203 msgid "" @@ -1655,7 +1831,6 @@ msgstr "" "指定したウィンドウが、最後に :meth:`refresh` を呼んだ時から変更されている場合" "に ``True`` を返します; そうでない場合には ``False`` を返します。" -#: ../../library/curses.rst:1216 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`!curses`. If *flag* is " @@ -1663,12 +1838,20 @@ msgid "" "mode is disabled by default, but :func:`wrapper` enables it for the main " "window." msgstr "" +"*flag* が ``True`` の場合、一部のキー (キーパッド、ファンクションキー) が生成" +"するエスケープシーケンスを :mod:`!curses` が解釈します。\n" +"*flag* が ``False`` の場合、エスケープシーケンスは入力ストリーム内にそのまま" +"残されます。\n" +"キーパッドモードはデフォルトでは無効ですが、:func:`wrapper` はメインウィンド" +"ウに対して有効にします。" -#: ../../library/curses.rst:1225 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible." msgstr "" +"*flag* が ``True`` の場合、更新時にカーソルを「カーソル位置」に移動せず、その" +"ままの位置に残します。\n" +"これにより、可能な限りカーソルの移動を減らします。" #: ../../library/curses.rst:1228 msgid "" @@ -1696,11 +1879,12 @@ msgstr "" msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "ウィンドウの左上角が ``(new_y, new_x)`` になるように移動します。" -#: ../../library/curses.rst:1247 msgid "" "Moving the window so that any part of it would be off the screen is an " "error: the window is not moved and :exc:`curses.error` is raised." msgstr "" +"ウィンドウの一部でもスクリーンの外に出る位置への移動はエラーです。\n" +"ウィンドウは移動せず、:exc:`curses.error` が送出されます。" #: ../../library/curses.rst:1253 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." @@ -1729,12 +1913,14 @@ msgstr "" "い内容を反映するように更新しますが、物理スクリーン上に反映させるための強制更" "新を行いません。更新を行うためには :func:`doupdate` を呼び出します。" -#: ../../library/curses.rst:1271 msgid "" "The 6 arguments can only be specified, and are then required, when the " "window is a pad created with :func:`newpad`; they have the same meaning as " "for :meth:`refresh`." msgstr "" +"6 つの引数を指定できるのは、ウィンドウが :func:`newpad` で作成されたパッドで" +"ある場合だけで、その場合はすべて必須です。\n" +"意味は :meth:`refresh` のものと同じです。" #: ../../library/curses.rst:1278 msgid "" @@ -1813,7 +1999,6 @@ msgstr "" "ディスプレイを即時更新し (実際のウィンドウとこれまでの描画/削除メソッドの内容" "とを同期し) ます。" -#: ../../library/curses.rst:1325 msgid "" "The 6 arguments can only be specified, and are then required, when the " "window is a pad created with :func:`newpad`. The additional parameters are " @@ -1827,6 +2012,17 @@ msgid "" "Negative values of *pminrow*, *pmincol*, *sminrow*, or *smincol* are treated " "as if they were zero." msgstr "" +"6 つの引数を指定できるのは、ウィンドウが :func:`newpad` で作成されたパッドで" +"ある場合だけで、その場合はすべて必須です。\n" +"これらの追加のパラメータは、パッドとスクリーンのどの部分を使用するかを示すた" +"めに必要です。\n" +"*pminrow* と *pmincol* はパッド内の表示する矩形の左上隅を指定します。\n" +"*sminrow*、*smincol*、*smaxrow*、*smaxcol* はスクリーン上に表示する矩形の端を" +"指定します。\n" +"両方の矩形は同じ大きさでなければならないため、パッド内の表示する矩形の右下隅" +"はスクリーン座標から計算されます。\n" +"両方の矩形は、それぞれの構造の内部に完全に収まっていなければなりません。\n" +"*pminrow*、*pmincol*、*sminrow*、*smincol* の負の値はゼロとして扱われます。" #: ../../library/curses.rst:1339 msgid "" @@ -1882,20 +2078,25 @@ msgstr "" msgid "Turn on attribute *A_STANDOUT*." msgstr "*A_STANDOUT* 属性をオンにします。" -#: ../../library/curses.rst:1382 msgid "" "Return a sub-pad, whose upper-left corner is at ``(begin_y, begin_x)``, and " "whose width/height is *ncols*/*nlines*. The coordinates are relative to the " "parent pad (unlike :meth:`subwin`, which uses screen coordinates). This " "method is only available for pads created with :func:`newpad`." msgstr "" +"左上隅が ``(begin_y, begin_x)`` にあり、幅が *ncols*、高さが *nlines* のサブ" +"パッドを返します。\n" +"座標は親パッドからの相対座標です (スクリーン座標を使う :meth:`subwin` とは異" +"なります)。\n" +"このメソッドは :func:`newpad` で作成したパッドでのみ利用できます。" -#: ../../library/curses.rst:1391 msgid "" "Return a sub-window, whose upper-left corner is at the screen-relative " "coordinates ``(begin_y, begin_x)``, and whose width/height is *ncols*/" "*nlines*." msgstr "" +"左上隅がスクリーンからの相対座標 ``(begin_y, begin_x)`` にあり、幅が " +"*ncols*、高さが *nlines* のサブウィンドウを返します。" #: ../../library/curses.rst:1394 msgid "" @@ -1970,19 +2171,19 @@ msgstr "" "ウィンドウ内のすべての行を、最後に :meth:`refresh` を呼んだ際から変更されてい" "ないものとしてマークします。" -#: ../../library/curses.rst:1449 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch* with attributes *attr*." msgstr "" +"``(y, x)`` を始点として、属性 *attr* の文字 *ch* からなる長さ *n* の垂直線を" +"表示します。" #: ../../library/curses.rst:1454 msgid "Constants" msgstr "定数" -#: ../../library/curses.rst:1456 msgid "The :mod:`!curses` module defines the following data members:" -msgstr "" +msgstr ":mod:`!curses` モジュールは以下のデータメンバを定義します:" #: ../../library/curses.rst:1461 msgid "" @@ -2000,53 +2201,64 @@ msgstr "" ":func:`napms` のような整数を返す curses ルーチンのいくつかは、成功した際に :" "const:`OK` を返します。" -#: ../../library/curses.rst:1473 msgid "A bytes object representing the current version of the module." -msgstr "" +msgstr "モジュールの現在のバージョンを表す bytes オブジェクトです。" -#: ../../library/curses.rst:1478 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " "components can also be accessed by name, so ``curses.ncurses_version[0]`` " "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" +"ncurses ライブラリのバージョンの 3 つの成分 *major*、*minor*、*patch* を含む" +"名前付きタプルです。\n" +"値はすべて整数です。\n" +"各成分には名前でもアクセスできるため、例えば ``curses.ncurses_version[0]`` " +"は ``curses.ncurses_version.major`` と等価です。" -#: ../../library/curses.rst:1483 msgid "Availability: if the ncurses library is used." -msgstr "" +msgstr "利用可能な環境: ncurses ライブラリが使用されている場合。" -#: ../../library/curses.rst:1489 msgid "" "The maximum number of colors the terminal can support. It is defined only " "after the call to :func:`start_color`." msgstr "" +"端末がサポートできる色の最大数です。\n" +":func:`start_color` の呼び出し後にのみ定義されます。" -#: ../../library/curses.rst:1494 msgid "" "The maximum number of color pairs the terminal can support. It is defined " "only after the call to :func:`start_color`." msgstr "" +"端末がサポートできる色ペアの最大数です。\n" +":func:`start_color` の呼び出し後にのみ定義されます。" -#: ../../library/curses.rst:1499 msgid "" "The width of the screen, that is, the number of columns. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" +"スクリーンの幅、すなわち列数です。\n" +":func:`initscr` の呼び出し後にのみ定義されます。\n" +":func:`update_lines_cols`、:func:`resizeterm`、:func:`resize_term` により更新" +"されます。" -#: ../../library/curses.rst:1506 msgid "" "The height of the screen, that is, the number of lines. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" +"スクリーンの高さ、すなわち行数です。\n" +":func:`initscr` の呼び出し後にのみ定義されます。\n" +":func:`update_lines_cols`、:func:`resizeterm`、:func:`resize_term` により更新" +"されます。" -#: ../../library/curses.rst:1512 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" +"文字セルの属性を指定するための定数が用意されています。\n" +"実際に利用できる定数はシステムによって異なります。" #: ../../library/curses.rst:1516 msgid "Attribute" @@ -2073,9 +2285,8 @@ msgstr "太字モード" msgid "Dim mode" msgstr "低輝度モード" -#: ../../library/curses.rst:1526 msgid "Invisible or blank mode" -msgstr "" +msgstr "非表示または空白モード" #: ../../library/curses.rst:1528 msgid "Italic mode" @@ -2085,13 +2296,11 @@ msgstr "イタリックモード" msgid "Normal attribute" msgstr "通常の属性" -#: ../../library/curses.rst:1532 msgid "Protected mode" -msgstr "" +msgstr "保護モード" -#: ../../library/curses.rst:1534 msgid "Reverse background and foreground colors" -msgstr "" +msgstr "背景色と前景色を反転" #: ../../library/curses.rst:1537 msgid "Standout mode" @@ -2101,55 +2310,46 @@ msgstr "強調モード" msgid "Underline mode" msgstr "下線モード" -#: ../../library/curses.rst:1541 msgid "Horizontal highlight" -msgstr "" +msgstr "水平強調" -#: ../../library/curses.rst:1543 msgid "Left highlight" -msgstr "" +msgstr "左強調" -#: ../../library/curses.rst:1545 msgid "Low highlight" -msgstr "" +msgstr "下強調" -#: ../../library/curses.rst:1547 msgid "Right highlight" -msgstr "" +msgstr "右強調" -#: ../../library/curses.rst:1549 msgid "Top highlight" -msgstr "" +msgstr "上強調" -#: ../../library/curses.rst:1551 msgid "Vertical highlight" -msgstr "" +msgstr "垂直強調" #: ../../library/curses.rst:1554 msgid "``A_ITALIC`` was added." msgstr "``A_ITALIC`` が追加されました。" -#: ../../library/curses.rst:1557 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" +"一部のメソッドが返す値から対応する属性を取り出すための定数が用意されていま" +"す。" -#: ../../library/curses.rst:1561 msgid "Bit-mask" -msgstr "" +msgstr "ビットマスク" -#: ../../library/curses.rst:1563 msgid "Bit-mask to extract attributes" -msgstr "" +msgstr "属性を取り出すビットマスク" -#: ../../library/curses.rst:1566 msgid "Bit-mask to extract a character" -msgstr "" +msgstr "文字を取り出すビットマスク" -#: ../../library/curses.rst:1569 msgid "Bit-mask to extract color-pair field information" -msgstr "" +msgstr "色ペアフィールドの情報を取り出すビットマスク" #: ../../library/curses.rst:1575 msgid "" @@ -2543,7 +2743,6 @@ msgstr "端末リサイズイベント" msgid "Maximum key value" msgstr "最大キー値" -#: ../../library/curses.rst:1773 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2554,6 +2753,15 @@ msgid "" "(older PC keyboards may have only ten function keys); also, the following " "keypad mappings are standard:" msgstr "" +"VT100 とそのソフトウェアエミュレーション (X 端末エミュレータなど) では、通常" +"は少なくとも 4 つのファンクションキー (:const:`KEY_F1 `、:const:" +"`KEY_F2 `、:const:`KEY_F3 `、:const:`KEY_F4 `) が利用" +"でき、矢印キーはそれぞれ :const:`KEY_UP`、:const:`KEY_DOWN`、:const:" +"`KEY_LEFT`、:const:`KEY_RIGHT` に対応付けられています。\n" +"PC キーボードのあるマシンでは、矢印キーと 12 個のファンクションキーがあると考" +"えてよいでしょう (古い PC キーボードにはファンクションキーが 10 個しかない場" +"合もあります)。\n" +"また、以下のキーパッドの対応付けが標準です:" #: ../../library/curses.rst:1782 msgid "Keycap" @@ -2632,9 +2840,8 @@ msgstr "これらは :func:`initscr` が呼び出された後でしか利用で msgid "ACS code" msgstr "ACS コード" -#: ../../library/curses.rst:1811 msgid "alternate name for upper-right corner" -msgstr "" +msgstr "右上隅の別名" #: ../../library/curses.rst:1813 msgid "solid square block" @@ -2648,9 +2855,8 @@ msgstr "白四角ブロック" msgid "alternate name for horizontal line" msgstr "水平線の別名" -#: ../../library/curses.rst:1819 msgid "alternate name for upper-left corner" -msgstr "" +msgstr "左上隅の別名" #: ../../library/curses.rst:1821 msgid "alternate name for top tee" @@ -2700,13 +2906,11 @@ msgstr "左向き矢印" msgid "less-than-or-equal-to" msgstr "小なりイコール" -#: ../../library/curses.rst:1845 msgid "lower-left corner" -msgstr "" +msgstr "左下隅" -#: ../../library/curses.rst:1847 msgid "lower-right corner" -msgstr "" +msgstr "右下隅" #: ../../library/curses.rst:1849 msgid "left tee" @@ -2752,9 +2956,8 @@ msgstr "スキャンライン 7" msgid "scan line 9" msgstr "スキャンライン 9" -#: ../../library/curses.rst:1871 msgid "alternate name for lower-right corner" -msgstr "" +msgstr "右下隅の別名" #: ../../library/curses.rst:1873 msgid "alternate name for vertical line" @@ -2764,9 +2967,8 @@ msgstr "垂直線の別名" msgid "alternate name for right tee" msgstr "右向き T 字罫線の別名" -#: ../../library/curses.rst:1877 msgid "alternate name for lower-left corner" -msgstr "" +msgstr "左下隅の別名" #: ../../library/curses.rst:1879 msgid "alternate name for bottom tee" @@ -2792,58 +2994,46 @@ msgstr "上向き T 字罫線" msgid "up arrow" msgstr "上向き矢印" -#: ../../library/curses.rst:1891 msgid "upper-left corner" -msgstr "" +msgstr "左上隅" -#: ../../library/curses.rst:1893 msgid "upper-right corner" -msgstr "" +msgstr "右上隅" #: ../../library/curses.rst:1895 msgid "vertical line" msgstr "垂直線" -#: ../../library/curses.rst:1898 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" -msgstr "" +msgstr ":meth:`getmouse` で使用するマウスボタン定数を以下の表に示します:" -#: ../../library/curses.rst:1901 msgid "Mouse button constant" -msgstr "" +msgstr "マウスボタン定数" -#: ../../library/curses.rst:1903 msgid "Mouse button *n* pressed" -msgstr "" +msgstr "マウスボタン *n* が押された" -#: ../../library/curses.rst:1905 msgid "Mouse button *n* released" -msgstr "" +msgstr "マウスボタン *n* が離された" -#: ../../library/curses.rst:1907 msgid "Mouse button *n* clicked" -msgstr "" +msgstr "マウスボタン *n* がクリックされた" -#: ../../library/curses.rst:1909 msgid "Mouse button *n* double clicked" -msgstr "" +msgstr "マウスボタン *n* がダブルクリックされた" -#: ../../library/curses.rst:1911 msgid "Mouse button *n* triple clicked" -msgstr "" +msgstr "マウスボタン *n* がトリプルクリックされた" -#: ../../library/curses.rst:1913 msgid "Shift was down during button state change" -msgstr "" +msgstr "ボタンの状態変更時に Shift が押されていた" -#: ../../library/curses.rst:1915 msgid "Control was down during button state change" -msgstr "" +msgstr "ボタンの状態変更時に Control が押されていた" -#: ../../library/curses.rst:1917 msgid "Alt was down during button state change" -msgstr "" +msgstr "ボタンの状態変更時に Alt が押されていた" #: ../../library/curses.rst:1924 msgid "The following table lists the predefined colors:" @@ -2885,11 +3075,10 @@ msgstr "白" msgid "Yellow" msgstr "黄色" -#: ../../library/curses.rst:1948 msgid ":mod:`!curses.textpad` --- Text input widget for curses programs" msgstr "" +":mod:`!curses.textpad` --- curses プログラム用のテキスト入力ウィジェット" -#: ../../library/curses.rst:1953 msgid "" "The :mod:`!curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2898,12 +3087,16 @@ msgid "" "a rectangle-drawing function useful for framing text boxes or for other " "purposes." msgstr "" +":mod:`!curses.textpad` モジュールは、curses ウィンドウで基本的なテキスト編集" +"を行う :class:`Textbox` クラスを提供します。\n" +"このクラスは Emacs (したがって Netscape Navigator、BBedit 6.x、FrameMaker、そ" +"の他多くのプログラム) に似たキーバインディングをサポートします。\n" +"このモジュールは、テキストボックスの枠を描く場合などに役立つ、矩形を描画する" +"関数も提供します。" -#: ../../library/curses.rst:1959 msgid "The module :mod:`!curses.textpad` defines the following function:" -msgstr "" +msgstr ":mod:`!curses.textpad` モジュールは以下の関数を定義します:" -#: ../../library/curses.rst:1964 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2914,6 +3107,14 @@ msgid "" "(including xterm and most other software terminal emulators). Otherwise it " "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" +"矩形を描画します。\n" +"最初の引数はウィンドウオブジェクトでなければならず、残りの引数はそのウィンド" +"ウからの相対座標です。\n" +"2 番目と 3 番目の引数は描画する矩形の左上隅の y 座標と x 座標、4 番目と 5 番" +"目は右下隅の y 座標と x 座標です。\n" +"対応する端末 (xterm やその他の大半のソフトウェア端末エミュレータを含む) で" +"は、VT100/IBM PC の罫線文字を使用して矩形を描画します。\n" +"それ以外の場合は、ASCII のダッシュ、縦棒、プラス記号で描画します。" #: ../../library/curses.rst:1977 msgid "Textbox objects" @@ -2925,7 +3126,6 @@ msgstr "" "以下のような :class:`Textbox` オブジェクトをインスタンス生成することができま" "す:" -#: ../../library/curses.rst:1984 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2935,12 +3135,19 @@ msgid "" "containing window, with coordinates ``(0, 0)``. The instance's :attr:" "`stripspaces` flag is initially on." msgstr "" +"テキストボックスウィジェットオブジェクトを返します。\n" +"*win* 引数には、テキストボックスを配置する curses の :ref:`ウィンドウ " +"` オブジェクトを指定する必要があります。\n" +"*insert_mode* が真の場合、テキストボックスは入力した文字で既存のテキストを上" +"書きせず、右にずらして挿入します。\n" +"テキストボックスの編集カーソルは、初期状態では配置先のウィンドウの左上隅、座" +"標 ``(0, 0)`` にあります。\n" +"インスタンスの :attr:`stripspaces` フラグは、初期状態ではオンです。" #: ../../library/curses.rst:1992 msgid ":class:`Textbox` objects have the following methods:" msgstr ":class:`Textbox` オブジェクトは以下のメソッドを持ちます:" -#: ../../library/curses.rst:1997 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2950,13 +3157,24 @@ msgid "" "This method returns the window contents as a string; whether blanks in the " "window are included is affected by the :attr:`stripspaces` attribute." msgstr "" +"これは通常使用するエントリーポイントです。\n" +"終了用のキー操作が入力されるまで、編集のキー操作を受け付けます。\n" +"*validate* を指定する場合は関数でなければなりません。\n" +"入力されたキー操作ごとに、そのキー操作をパラメータとしてこの関数を呼び出し、" +"結果に基づいて実行するコマンドを決めます。\n" +"関数が偽の値を返した場合、そのキー操作は無視されます。\n" +"このメソッドはウィンドウの内容を文字列として返します。\n" +"ウィンドウ内の空白を含むかどうかは :attr:`stripspaces` 属性に左右されます。" -#: ../../library/curses.rst:2009 msgid "" "Process a single command keystroke. Returns ``1`` to continue editing, or " "``0`` if a termination keystroke was processed. Here are the supported " "special keystrokes:" msgstr "" +"コマンドのキー操作を 1 つ処理します。\n" +"編集を継続する場合は ``1`` を、終了用のキー操作を処理した場合は ``0`` を返し" +"ます。\n" +"サポートする特殊なキー操作は以下のとおりです:" #: ../../library/curses.rst:2014 ../../library/curses.rst:2053 msgid "Keystroke" @@ -3028,11 +3246,11 @@ msgstr "逆方向に文字を削除します。" msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:2033 msgid "" "Terminate if the window is 1 line, otherwise move to the start of the next " "line." msgstr "" +"ウィンドウが 1 行の場合は終了し、それ以外の場合は次の行の先頭に移動します。" #: ../../library/curses.rst:2037 msgid ":kbd:`Control-K`" @@ -3084,25 +3302,20 @@ msgstr "" "移動操作は、カーソルがウィンドウの縁にあって移動ができない場合には何も行いま" "せん。場合によっては、以下のような同義のキーストロークがサポートされています:" -#: ../../library/curses.rst:2055 msgid ":const:`~curses.KEY_LEFT`" -msgstr "" +msgstr ":const:`~curses.KEY_LEFT`" -#: ../../library/curses.rst:2057 msgid ":const:`~curses.KEY_RIGHT`" -msgstr "" +msgstr ":const:`~curses.KEY_RIGHT`" -#: ../../library/curses.rst:2059 msgid ":const:`~curses.KEY_UP`" -msgstr "" +msgstr ":const:`~curses.KEY_UP`" -#: ../../library/curses.rst:2061 msgid ":const:`~curses.KEY_DOWN`" -msgstr "" +msgstr ":const:`~curses.KEY_DOWN`" -#: ../../library/curses.rst:2063 msgid ":const:`~curses.KEY_BACKSPACE`" -msgstr "" +msgstr ":const:`~curses.KEY_BACKSPACE`" #: ../../library/curses.rst:2063 msgid ":kbd:`Control-h`" diff --git a/library/dataclasses.po b/library/dataclasses.po index b5466be0a..56ec933a0 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -50,7 +50,6 @@ msgstr "" "これらの生成されたメソッドで利用されるメンバー変数は :pep:`526` 型アノテー" "ションを用いて定義されます。例えば、このコードでは::" -#: ../../library/dataclasses.rst:19 msgid "" "from dataclasses import dataclass\n" "\n" @@ -64,12 +63,22 @@ msgid "" " def total_cost(self) -> float:\n" " return self.unit_price * self.quantity_on_hand" msgstr "" +"from dataclasses import dataclass\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" \"\"\"在庫内の品目を管理するクラス。\"\"\"\n" +" name: str\n" +" unit_price: float\n" +" quantity_on_hand: int = 0\n" +"\n" +" def total_cost(self) -> float:\n" +" return self.unit_price * self.quantity_on_hand" #: ../../library/dataclasses.rst:31 msgid "will add, among other things, a :meth:`!__init__` that looks like::" msgstr "とりわけ、以下のような :meth:`!__init__` が追加されます::" -#: ../../library/dataclasses.rst:33 msgid "" "def __init__(self, name: str, unit_price: float, quantity_on_hand: int = " "0):\n" @@ -77,6 +86,11 @@ msgid "" " self.unit_price = unit_price\n" " self.quantity_on_hand = quantity_on_hand" msgstr "" +"def __init__(self, name: str, unit_price: float, quantity_on_hand: int = " +"0):\n" +" self.name = name\n" +" self.unit_price = unit_price\n" +" self.quantity_on_hand = quantity_on_hand" #: ../../library/dataclasses.rst:38 msgid "" @@ -133,14 +147,15 @@ msgstr "" "合の動作は、後述する引数によって異なります。デコレータは呼び出した際に指定し" "たクラスと同じクラスを返します。新しいクラスは生成されません。" -#: ../../library/dataclasses.rst:66 msgid "" "If ``@dataclass`` is used just as a simple decorator with no parameters, it " "acts as if it has the default values documented in this signature. That is, " "these three uses of ``@dataclass`` are equivalent::" msgstr "" +"``@dataclass`` をパラメータなしの単純なデコレータとして使用すると、このシグネ" +"チャに記載されたデフォルト値を指定した場合と同じ動作になります。\n" +"つまり、以下の 3 通りの ``@dataclass`` の使い方は等価です。 ::" -#: ../../library/dataclasses.rst:71 msgid "" "@dataclass\n" "class C:\n" @@ -156,23 +171,36 @@ msgid "" "class C:\n" " ..." msgstr "" +"@dataclass\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass()\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, " +"frozen=False,\n" +" match_args=True, kw_only=False, slots=False, weakref_slot=False)\n" +"class C:\n" +" ..." -#: ../../library/dataclasses.rst:84 msgid "The parameters to ``@dataclass`` are:" -msgstr "" +msgstr "``@dataclass`` のパラメータは以下のとおりです:" -#: ../../library/dataclasses.rst:86 msgid "" "*init*: If true (the default), a :meth:`~object.__init__` method will be " "generated." msgstr "" +"*init*: 真の場合 (デフォルト)、:meth:`~object.__init__` メソッドを生成しま" +"す。" -#: ../../library/dataclasses.rst:89 msgid "" "If the class already defines :meth:`!__init__`, this parameter is ignored." msgstr "" +"クラスがすでに :meth:`!__init__` を定義している場合、このパラメータは無視され" +"ます。" -#: ../../library/dataclasses.rst:92 msgid "" "*repr*: If true (the default), a :meth:`~object.__repr__` method will be " "generated. The generated repr string will have the class name and the name " @@ -181,51 +209,65 @@ msgid "" "example: ``InventoryItem(name='widget', unit_price=3.0, " "quantity_on_hand=10)``." msgstr "" +"*repr*: 真の場合 (デフォルト)、:meth:`~object.__repr__` メソッドを生成しま" +"す。\n" +"生成される repr 文字列にはクラス名と、クラスで定義した順に各フィールドの名前" +"と repr が含まれます。\n" +"repr から除外すると指定されたフィールドは含まれません。\n" +"例えば、``InventoryItem(name='widget', unit_price=3.0, " +"quantity_on_hand=10)`` となります。" -#: ../../library/dataclasses.rst:99 msgid "" "If the class already defines :meth:`!__repr__`, this parameter is ignored." msgstr "" +"クラスがすでに :meth:`!__repr__` を定義している場合、このパラメータは無視され" +"ます。" -#: ../../library/dataclasses.rst:102 msgid "" "*eq*: If true (the default), an :meth:`~object.__eq__` method will be " "generated." msgstr "" +"*eq*: 真の場合 (デフォルト)、:meth:`~object.__eq__` メソッドを生成します。" -#: ../../library/dataclasses.rst:105 msgid "" "This method compares the class by comparing each field in order. Both " "instances in the comparison must be of the identical type." msgstr "" +"このメソッドは各フィールドを順に比較することでこのクラスのインスタンスを比較" +"します。\n" +"比較する両方のインスタンスは、まったく同じ型でなければなりません。" -#: ../../library/dataclasses.rst:108 msgid "" "If the class already defines :meth:`!__eq__`, this parameter is ignored." msgstr "" +"クラスがすでに :meth:`!__eq__` を定義している場合、このパラメータは無視されま" +"す。" -#: ../../library/dataclasses.rst:110 msgid "" "The generated ``__eq__`` method now compares each field individually (for " "example, ``self.a == other.a and self.b == other.b``), rather than comparing " "tuples of fields as in previous versions." msgstr "" +"生成される ``__eq__`` メソッドは、以前のバージョンのようにフィールドのタプル" +"を比較する代わりに、各フィールドを個別に比較するようになりました (例えば " +"``self.a == other.a and self.b == other.b``)。" -#: ../../library/dataclasses.rst:115 msgid "" "This change makes the comparison faster but it may alter results in cases " "where attributes compare equal by identity but not by value (such as " "``float('nan')``)." msgstr "" +"この変更によって比較が高速になりますが、属性が同一性では等しくても値では等し" +"くない場合 (``float('nan')`` など)、結果が変わる可能性があります。" -#: ../../library/dataclasses.rst:119 msgid "" "In Python 3.12 and earlier, the comparison was performed by creating tuples " "of the fields and comparing them (for example, ``(self.a, self.b) == (other." "a, other.b)``)." msgstr "" +"Python 3.12 以前では、フィールドのタプルを作成し、それらを比較していました " +"(例えば ``(self.a, self.b) == (other.a, other.b)``)。" -#: ../../library/dataclasses.rst:123 msgid "" "*order*: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" "`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods " @@ -233,22 +275,33 @@ msgid "" "fields, in order. Both instances in the comparison must be of the identical " "type. If *order* is true and *eq* is false, a :exc:`ValueError` is raised." msgstr "" +"*order*: 真の場合 (デフォルトは ``False``)、:meth:`~object.__lt__`、:meth:" +"`~object.__le__`、:meth:`~object.__gt__`、:meth:`~object.__ge__` メソッドを生" +"成します。\n" +"これらのメソッドは、フィールドを順に並べたタプルのようにこのクラスのインスタ" +"ンスを比較します。\n" +"比較する両方のインスタンスは、まったく同じ型でなければなりません。\n" +"*order* が真で *eq* が偽の場合は、:exc:`ValueError` を送出します。" -#: ../../library/dataclasses.rst:130 msgid "" "If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:" "`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised." msgstr "" +"クラスがすでに :meth:`!__lt__`、:meth:`!__le__`、:meth:`!__gt__`、:meth:`!" +"__ge__` のいずれかを定義している場合は、:exc:`TypeError` を送出します。" -#: ../../library/dataclasses.rst:134 msgid "" "*unsafe_hash*: If true, force ``dataclasses`` to create a :meth:`~object." "__hash__` method, even though it may not be safe to do so. Otherwise, " "generate a :meth:`~object.__hash__` method according to how *eq* and " "*frozen* are set. The default value is ``False``." msgstr "" +"*unsafe_hash*: 真の場合、安全でない可能性があっても、``dataclasses`` に :" +"meth:`~object.__hash__` メソッドを強制的に作成させます。\n" +"それ以外の場合、*eq* と *frozen* の設定に従って :meth:`~object.__hash__` メ" +"ソッドを生成します。\n" +"デフォルト値は ``False`` です。" -#: ../../library/dataclasses.rst:140 msgid "" ":meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are " "added to hashed collections such as dictionaries and sets. Having a :meth:`!" @@ -257,8 +310,14 @@ msgid "" "and behavior of :meth:`!__eq__`, and the values of the *eq* and *frozen* " "flags in the ``@dataclass`` decorator." msgstr "" +":meth:`!__hash__` は組み込みの :meth:`hash` で使用されるほか、辞書や集合のよ" +"うなハッシュを使用するコレクションにオブジェクトを追加する際にも使用されま" +"す。\n" +":meth:`!__hash__` があることは、そのクラスのインスタンスが不変であることを示" +"唆します。\n" +"可変性は複雑な性質で、プログラマの意図、:meth:`!__eq__` の有無と動作、" +"``@dataclass`` デコレータの *eq* と *frozen* フラグの値に依存します。" -#: ../../library/dataclasses.rst:147 msgid "" "By default, ``@dataclass`` will not implicitly add a :meth:`~object." "__hash__` method unless it is safe to do so. Neither will it add or change " @@ -266,8 +325,13 @@ msgid "" "attribute ``__hash__ = None`` has a specific meaning to Python, as described " "in the :meth:`!__hash__` documentation." msgstr "" +"デフォルトでは、安全な場合を除き、``@dataclass`` は :meth:`~object.__hash__` " +"メソッドを暗黙的に追加しません。\n" +"また、明示的に定義済みの :meth:`!__hash__` メソッドを追加したり変更したりしま" +"せん。\n" +"クラス属性を ``__hash__ = None`` に設定することには、:meth:`!__hash__` のド" +"キュメントで説明されているように、Python における特定の意味があります。" -#: ../../library/dataclasses.rst:153 msgid "" "If :meth:`!__hash__` is not explicitly defined, or if it is set to ``None``, " "then ``@dataclass`` *may* add an implicit :meth:`!__hash__` method. Although " @@ -276,16 +340,26 @@ msgid "" "logically immutable but can still be mutated. This is a specialized use case " "and should be considered carefully." msgstr "" +":meth:`!__hash__` が明示的に定義されていないか、``None`` に設定されている場" +"合、``@dataclass`` は暗黙的な :meth:`!__hash__` メソッドを追加する *ことがあ" +"ります*。\n" +"推奨されませんが、``unsafe_hash=True`` を指定して、``@dataclass`` に :meth:`!" +"__hash__` メソッドを強制的に作成させることができます。\n" +"論理的には不変でも変更可能なクラスの場合に、この方法を使うことが考えられま" +"す。\n" +"これは特殊な用途であり、慎重に検討する必要があります。" -#: ../../library/dataclasses.rst:160 msgid "" "Here are the rules governing implicit creation of a :meth:`!__hash__` " "method. Note that you cannot both have an explicit :meth:`!__hash__` method " "in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:" "`TypeError`." msgstr "" +":meth:`!__hash__` メソッドの暗黙的な作成には、以下の規則が適用されます。\n" +"データクラスに明示的な :meth:`!__hash__` メソッドを定義し、同時に " +"``unsafe_hash=True`` を設定することはできません。\n" +"この場合は :exc:`TypeError` が発生します。" -#: ../../library/dataclasses.rst:165 msgid "" "If *eq* and *frozen* are both true, by default ``@dataclass`` will generate " "a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is false, :" @@ -295,21 +369,31 @@ msgid "" "used (if the superclass is :class:`object`, this means it will fall back to " "id-based hashing)." msgstr "" +"*eq* と *frozen* がともに真の場合、デフォルトでは ``@dataclass`` は :meth:`!" +"__hash__` メソッドを生成します。\n" +"*eq* が真で *frozen* が偽の場合、:meth:`!__hash__` は ``None`` に設定され、" +"ハッシュ不可能であることを示します (可変なので実際にハッシュ不可能です)。\n" +"*eq* が偽の場合、:meth:`!__hash__` は変更されないため、スーパークラスの :" +"meth:`!__hash__` メソッドが使用されます (スーパークラスが :class:`object` の" +"場合、id に基づくハッシュが使われます)。" -#: ../../library/dataclasses.rst:173 msgid "" "*frozen*: If true (the default is ``False``), assigning to fields will " "generate an exception. This emulates read-only frozen instances. See the :" "ref:`discussion ` below." msgstr "" +"*frozen*: 真の場合 (デフォルトは ``False``)、フィールドへの代入で例外が発生し" +"ます。\n" +"これにより、読み取り専用の凍結されたインスタンスをエミュレートします。\n" +"後述の :ref:`説明 ` を参照してください。" -#: ../../library/dataclasses.rst:177 msgid "" "If :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in " "the class and *frozen* is true, then :exc:`TypeError` is raised." msgstr "" +"クラスで :meth:`~object.__setattr__` または :meth:`~object.__delattr__` が定" +"義されており、*frozen* が真の場合、:exc:`TypeError` を送出します。" -#: ../../library/dataclasses.rst:180 msgid "" "*match_args*: If true (the default is ``True``), the :attr:`~object." "__match_args__` tuple will be created from the list of non keyword-only " @@ -318,8 +402,14 @@ msgid "" "__match_args__` is already defined in the class, then :attr:`!" "__match_args__` will not be generated." msgstr "" +"*match_args*: 真の場合 (デフォルトは ``True``)、生成される :meth:`~object." +"__init__` メソッドのキーワード専用でないパラメータのリストから :attr:" +"`~object.__match_args__` タプルを作成します (:meth:`!__init__` が生成されない" +"場合も同様です。\n" +"上記を参照)。\n" +"偽の場合、またはクラスに :attr:`!__match_args__` がすでに定義されている場合" +"は、:attr:`!__match_args__` を生成しません。" -#: ../../library/dataclasses.rst:189 msgid "" "*kw_only*: If true (the default value is ``False``), then all fields will be " "marked as keyword-only. If a field is marked as keyword-only, then the only " @@ -328,28 +418,40 @@ msgid "" "is called. See the :term:`parameter` glossary entry for details. Also see " "the :const:`KW_ONLY` section." msgstr "" +"*kw_only*: 真の場合 (デフォルト値は ``False``)、すべてのフィールドをキーワー" +"ド専用に指定します。\n" +"フィールドをキーワード専用にすることの唯一の効果は、そのフィールドから生成さ" +"れる :meth:`~object.__init__` のパラメータを、:meth:`!__init__` の呼び出し時" +"にキーワードで指定する必要があるという点です。\n" +"詳細は用語集の :term:`parameter` を参照してください。\n" +":const:`KW_ONLY` の節も参照してください。" -#: ../../library/dataclasses.rst:197 msgid "Keyword-only fields are not included in :attr:`!__match_args__`." -msgstr "" +msgstr "キーワード専用フィールドは :attr:`!__match_args__` に含まれません。" -#: ../../library/dataclasses.rst:201 msgid "" "*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " "attribute will be generated and new class will be returned instead of the " "original one. If :attr:`!__slots__` is already defined in the class, then :" "exc:`TypeError` is raised." msgstr "" +"*slots*: 真の場合 (デフォルトは ``False``)、:attr:`~object.__slots__` 属性を" +"生成し、元のクラスの代わりに新しいクラスを返します。\n" +"クラスに :attr:`!__slots__` がすでに定義されている場合は、:exc:`TypeError` を" +"送出します。" -#: ../../library/dataclasses.rst:207 msgid "" "Passing parameters to a base class :meth:`~object.__init_subclass__` when " "using ``slots=True`` will result in a :exc:`TypeError`. Either use " "``__init_subclass__`` with no parameters or use default values as a " "workaround. See :gh:`91126` for full details." msgstr "" +"``slots=True`` を使用する際に基底クラスの :meth:`~object.__init_subclass__` " +"にパラメータを渡すと、:exc:`TypeError` が発生します。\n" +"回避するには、パラメータなしの ``__init_subclass__`` を使用するか、デフォルト" +"値を使用してください。\n" +"詳細は :gh:`91126` を参照してください。" -#: ../../library/dataclasses.rst:215 msgid "" "If a field name is already included in the :attr:`!__slots__` of a base " "class, it will not be included in the generated :attr:`!__slots__` to " @@ -358,14 +460,26 @@ msgid "" "`fields` instead. To be able to determine inherited slots, base class :attr:" "`!__slots__` may be any iterable, but *not* an iterator." msgstr "" +"基底クラスの :attr:`!__slots__` にフィールド名がすでに含まれている場合、:ref:" +"`オーバーライド ` を防ぐため、生成される :attr:`!" +"__slots__` には含まれません。\n" +"したがって、データクラスのフィールド名を取得するために :attr:`!__slots__` を" +"使用しないでください。\n" +"代わりに :func:`fields` を使用してください。\n" +"継承するスロットを判定できるように、基底クラスの :attr:`!__slots__` には任意" +"のイテラブルを使用できますが、イテレータは使用 *できません*。" -#: ../../library/dataclasses.rst:225 msgid "" "*weakref_slot*: If true (the default is ``False``), add a slot named " "\"__weakref__\", which is required to make an instance :func:`weakref-able " "`. It is an error to specify ``weakref_slot=True`` without also " "specifying ``slots=True``." msgstr "" +"*weakref_slot*: 真の場合 (デフォルトは ``False``)、インスタンスを :func:`弱参" +"照可能 ` にするために必要な \"__weakref__\" という名前のスロット" +"を追加します。\n" +"``slots=True`` を指定せずに ``weakref_slot=True`` を指定するとエラーになりま" +"す。" #: ../../library/dataclasses.rst:233 msgid "" @@ -374,23 +488,26 @@ msgid "" msgstr "" "``フィールド`` には、通常の Python の文法でデフォルト値を指定できます。" -#: ../../library/dataclasses.rst:236 msgid "" "@dataclass\n" "class C:\n" " a: int # 'a' has no default value\n" " b: int = 0 # assign a default value for 'b'" msgstr "" +"@dataclass\n" +"class C:\n" +" a: int # 'a' にはデフォルト値がない\n" +" b: int = 0 # 'b' にデフォルト値を割り当てる" -#: ../../library/dataclasses.rst:241 msgid "" "In this example, both :attr:`!a` and :attr:`!b` will be included in the " "added :meth:`~object.__init__` method, which will be defined as::" msgstr "" +"この例では、:attr:`!a` と :attr:`!b` の両方が、次のように定義される :meth:" +"`~object.__init__` メソッドに含まれます。 ::" -#: ../../library/dataclasses.rst:244 msgid "def __init__(self, a: int, b: int = 0):" -msgstr "" +msgstr "def __init__(self, a: int, b: int = 0):" #: ../../library/dataclasses.rst:246 msgid "" @@ -402,7 +519,6 @@ msgstr "" "に定義すると、 :exc:`TypeError` が送出されます。これは、単一のクラスであって" "も、クラス継承の結果でも起きえます。" -#: ../../library/dataclasses.rst:252 msgid "" "For common and simple use cases, no other functionality is required. There " "are, however, some dataclass features that require additional per-field " @@ -410,8 +526,13 @@ msgid "" "replace the default field value with a call to the provided :func:`!field` " "function. For example::" msgstr "" +"一般的で単純な用途では、これ以外の機能は必要ありません。\n" +"ただし、データクラスの機能には、フィールドごとの追加情報を必要とするものもあ" +"ります。\n" +"追加情報を指定するために、フィールドのデフォルト値を、提供されている :func:`!" +"field` 関数の呼び出しに置き換えられます。\n" +"例えば次のようにします。 ::" -#: ../../library/dataclasses.rst:258 msgid "" "@dataclass\n" "class C:\n" @@ -420,27 +541,37 @@ msgid "" "c = C()\n" "c.mylist += [1, 2, 3]" msgstr "" +"@dataclass\n" +"class C:\n" +" mylist: list[int] = field(default_factory=list)\n" +"\n" +"c = C()\n" +"c.mylist += [1, 2, 3]" -#: ../../library/dataclasses.rst:265 msgid "" "As shown above, the :const:`MISSING` value is a :class:`sentinel` object " "used to detect if some parameters are provided by the user. This sentinel is " "used because ``None`` is a valid value for some parameters with a distinct " "meaning. No code should directly use the :const:`MISSING` value." msgstr "" +"上記の :const:`MISSING` 値は、ユーザーが一部のパラメータを指定したかどうかを" +"検出するための :class:`sentinel` オブジェクトです。\n" +"一部のパラメータでは ``None`` が固有の意味を持つ有効な値なので、このセンチネ" +"ルを使用しています。\n" +":const:`MISSING` 値を直接使用するコードを書いてはいけません。" -#: ../../library/dataclasses.rst:270 msgid "The parameters to :func:`!field` are:" -msgstr "" +msgstr ":func:`!field` のパラメータは以下のとおりです:" -#: ../../library/dataclasses.rst:272 msgid "" "*default*: If provided, this will be the default value for this field. This " "is needed because the :func:`!field` call itself replaces the normal " "position of the default value." msgstr "" +"*default*: 指定した場合、このフィールドのデフォルト値になります。\n" +"通常デフォルト値を指定する位置が :func:`!field` 呼び出しで置き換わるため、こ" +"のパラメータが必要になります。" -#: ../../library/dataclasses.rst:276 msgid "" "*default_factory*: If provided, it must be a zero-argument callable that " "will be called when a default value is needed for this field. Among other " @@ -448,20 +579,27 @@ msgid "" "discussed below. It is an error to specify both *default* and " "*default_factory*." msgstr "" +"*default_factory*: 指定する場合、引数を取らない呼び出し可能オブジェクトでなけ" +"ればなりません。\n" +"このフィールドのデフォルト値が必要なときに呼び出されます。\n" +"用途の一例として、後述するように、可変なデフォルト値を持つフィールドの指定に" +"使用できます。\n" +"*default* と *default_factory* を両方指定するとエラーになります。" -#: ../../library/dataclasses.rst:282 msgid "" "*init*: If true (the default), this field is included as a parameter to the " "generated :meth:`~object.__init__` method." msgstr "" +"*init*: 真の場合 (デフォルト)、このフィールドを、生成される :meth:`~object." +"__init__` メソッドのパラメータに含めます。" -#: ../../library/dataclasses.rst:285 msgid "" "*repr*: If true (the default), this field is included in the string returned " "by the generated :meth:`~object.__repr__` method." msgstr "" +"*repr*: 真の場合 (デフォルト)、このフィールドを、生成される :meth:`~object." +"__repr__` メソッドが返す文字列に含めます。" -#: ../../library/dataclasses.rst:288 msgid "" "*hash*: This can be a bool or ``None``. If true, this field is included in " "the generated :meth:`~object.__hash__` method. If false, this field is " @@ -471,6 +609,15 @@ msgid "" "comparisons. Setting this value to anything other than ``None`` is " "discouraged." msgstr "" +"*hash*: bool または ``None`` を指定できます。\n" +"真の場合、このフィールドを、生成される :meth:`~object.__hash__` メソッドに含" +"めます。\n" +"偽の場合、このフィールドを、生成される :meth:`~object.__hash__` から除外しま" +"す。\n" +"``None`` の場合 (デフォルト)、*compare* の値を使用します。\n" +"比較に使用するフィールドはハッシュにも含めるべきなので、通常はこれが期待され" +"る動作です。\n" +"この値を ``None`` 以外に設定することは推奨されません。" #: ../../library/dataclasses.rst:296 msgid "" @@ -485,14 +632,15 @@ msgstr "" "要かつ、その型のハッシュ値を計算するのに他のフィールドも使われることです。\n" "フィールドがハッシュから除外されていたとしても、比較には使えます。" -#: ../../library/dataclasses.rst:302 msgid "" "*compare*: If true (the default), this field is included in the generated " "equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." "__gt__`, et al.)." msgstr "" +"*compare*: 真の場合 (デフォルト)、このフィールドを、生成される等価比較および" +"順序比較のメソッド (:meth:`~object.__eq__`、:meth:`~object.__gt__` など) に含" +"めます。" -#: ../../library/dataclasses.rst:306 msgid "" "*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " "empty dict. This value is wrapped in :func:`~types.MappingProxyType` to " @@ -501,22 +649,29 @@ msgid "" "mechanism. Multiple third-parties can each have their own key, to use as a " "namespace in the metadata." msgstr "" +"*metadata*: マッピングまたは ``None`` を指定できます。\n" +"``None`` は空の辞書として扱われます。\n" +"この値は :func:`~types.MappingProxyType` でラップして読み取り専用にし、:" +"class:`Field` オブジェクト上で公開します。\n" +"データクラス自体はこの値を一切使用せず、サードパーティの拡張機構として提供し" +"ています。\n" +"複数のサードパーティがそれぞれ独自のキーを持ち、メタデータ内の名前空間として" +"使用できます。" -#: ../../library/dataclasses.rst:314 msgid "" "*kw_only*: If true, this field will be marked as keyword-only. This is used " "when the generated :meth:`~object.__init__` method's parameters are computed." msgstr "" +"*kw_only*: 真の場合、このフィールドをキーワード専用に指定します。\n" +"これは、生成される :meth:`~object.__init__` メソッドのパラメータを算出する際" +"に使用されます。" -#: ../../library/dataclasses.rst:318 msgid "Keyword-only fields are also not included in :attr:`!__match_args__`." -msgstr "" +msgstr "キーワード専用フィールドは :attr:`!__match_args__` にも含まれません。" -#: ../../library/dataclasses.rst:322 msgid "*doc*: optional docstring for this field." -msgstr "" +msgstr "*doc*: このフィールドの省略可能な docstring です。" -#: ../../library/dataclasses.rst:326 msgid "" "If the default value of a field is specified by a call to :func:`!field`, " "then the class attribute for this field will be replaced by the specified " @@ -526,8 +681,14 @@ msgid "" "fields, just as if the default value itself were specified. For example, " "after::" msgstr "" +"フィールドのデフォルト値を :func:`!field` の呼び出しで指定した場合、その" +"フィールドのクラス属性は、指定した *default* 値で置き換えられます。\n" +"*default* を指定しなかった場合、クラス属性は削除されます。\n" +"これは、:deco:`dataclass` デコレータの実行後、デフォルト値そのものを指定した" +"場合と同じように、クラス属性がすべてフィールドのデフォルト値を持つようにする" +"ためです。\n" +"例えば、次のコードを実行すると、 ::" -#: ../../library/dataclasses.rst:335 msgid "" "@dataclass\n" "class C:\n" @@ -536,42 +697,56 @@ msgid "" " z: int = field(repr=False, default=10)\n" " t: int = 20" msgstr "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: int = field(repr=False)\n" +" z: int = field(repr=False, default=10)\n" +" t: int = 20" -#: ../../library/dataclasses.rst:342 msgid "" "The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!" "C.t` will be ``20``, and the class attributes :attr:`!C.x` and :attr:`!C.y` " "will not be set." msgstr "" +"クラス属性 :attr:`!C.z` は ``10``、クラス属性 :attr:`!C.t` は ``20`` になり、" +"クラス属性 :attr:`!C.x` と :attr:`!C.y` は設定されません。" -#: ../../library/dataclasses.rst:346 msgid "" "If *metadata* is ``None``, use an empty :class:`frozendict`, instead of a :" "func:`~types.MappingProxyType` of an empty :class:`dict`." msgstr "" +"*metadata* が ``None`` の場合、空の :class:`dict` を包んだ :func:`~types." +"MappingProxyType` の代わりに、空の :class:`frozendict` を使用するようになりま" +"した。" -#: ../../library/dataclasses.rst:352 msgid "" ":class:`!Field` objects describe each defined field. These objects are " "created internally, and are returned by the :func:`fields` module-level " "method (see below). Users should never instantiate a :class:`!Field` object " "directly. Its documented attributes are:" msgstr "" +":class:`!Field` オブジェクトは、定義された各フィールドを記述します。\n" +"これらのオブジェクトは内部で作成され、モジュールレベルの :func:`fields` 関数 " +"(後述) から返されます。\n" +"ユーザーが :class:`!Field` オブジェクトを直接インスタンス化してはいけませ" +"ん。\n" +"公開されている属性は以下のとおりです:" -#: ../../library/dataclasses.rst:357 msgid ":attr:`!name`: The name of the field." -msgstr "" +msgstr ":attr:`!name`: フィールドの名前。" -#: ../../library/dataclasses.rst:358 msgid ":attr:`!type`: The type of the field." -msgstr "" +msgstr ":attr:`!type`: フィールドの型。" -#: ../../library/dataclasses.rst:359 msgid "" ":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" "attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` have " "the identical meaning and values as they do in the :func:`field` function." msgstr "" +":attr:`!default`、:attr:`!default_factory`、:attr:`!init`、:attr:`!repr`、:" +"attr:`!hash`、:attr:`!compare`、:attr:`!metadata`、:attr:`!kw_only` の意味と" +"値は、:func:`field` 関数のものと同じです。" #: ../../library/dataclasses.rst:363 msgid "" @@ -581,7 +756,6 @@ msgstr "" "他の属性があることもありますが、それらはプライベートであり、調べたり、依存し" "たりしてはなりません。" -#: ../../library/dataclasses.rst:368 msgid "" "``InitVar[T]`` type annotations describe variables that are :ref:`init-only " "`. Fields annotated with :class:`!InitVar` " @@ -589,6 +763,13 @@ msgid "" "`fields` function nor used in any way except adding them as parameters to :" "meth:`~object.__init__` and an optional :meth:`__post_init__`." msgstr "" +"``InitVar[T]`` 型アノテーションは、:ref:`初期化限定 ` の変数を記述します。\n" +":class:`!InitVar` でアノテーションされたフィールドは疑似フィールドとみなされ" +"ます。\n" +"そのため、:func:`fields` 関数から返されず、:meth:`~object.__init__` および存" +"在する場合は :meth:`__post_init__` のパラメータとして追加する以外の用途には使" +"われません。" #: ../../library/dataclasses.rst:377 msgid "" @@ -604,19 +785,23 @@ msgstr "" "`TypeError` を送出します。\n" "``ClassVar`` や ``InitVar`` といった疑似フィールドは返しません。" -#: ../../library/dataclasses.rst:384 msgid "" "Converts the dataclass *obj* to a dict (by using the factory function " "*dict_factory*). Each dataclass is converted to a dict of its fields, as " "``name: value`` pairs. dataclasses, dicts, frozendicts, lists, and tuples " "are recursed into. Other objects are copied with :func:`copy.deepcopy`." msgstr "" +"データクラス *obj* を (ファクトリ関数 *dict_factory* を使用して) 辞書に変換し" +"ます。\n" +"各データクラスは、フィールドを ``name: value`` のペアとする辞書に変換されま" +"す。\n" +"データクラス、辞書、frozendict、リスト、タプルの内部は再帰的に処理されま" +"す。\n" +"その他のオブジェクトは :func:`copy.deepcopy` でコピーされます。" -#: ../../library/dataclasses.rst:390 msgid "Example of using :func:`!asdict` on nested dataclasses::" -msgstr "" +msgstr "入れ子になったデータクラスに :func:`!asdict` を使用する例です。 ::" -#: ../../library/dataclasses.rst:392 msgid "" "@dataclass\n" "class Point:\n" @@ -633,49 +818,67 @@ msgid "" "c = C([Point(0, 0), Point(10, 4)])\n" "assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" msgstr "" +"@dataclass\n" +"class Point:\n" +" x: int\n" +" y: int\n" +"\n" +"@dataclass\n" +"class C:\n" +" mylist: list[Point]\n" +"\n" +"p = Point(10, 20)\n" +"assert asdict(p) == {'x': 10, 'y': 20}\n" +"\n" +"c = C([Point(0, 0), Point(10, 4)])\n" +"assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" -#: ../../library/dataclasses.rst:407 ../../library/dataclasses.rst:427 msgid "To create a shallow copy, the following workaround may be used::" -msgstr "" +msgstr "浅いコピーを作成するには、以下の方法が使えます。 ::" -#: ../../library/dataclasses.rst:409 msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" -msgstr "" +msgstr "{field.name: getattr(obj, field.name) for field in fields(obj)}" -#: ../../library/dataclasses.rst:411 msgid "" ":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." msgstr "" +"*obj* がデータクラスのインスタンスでない場合、:func:`!asdict` は :exc:" +"`TypeError` を送出します。" -#: ../../library/dataclasses.rst:416 msgid "" "Converts the dataclass *obj* to a tuple (by using the factory function " "*tuple_factory*). Each dataclass is converted to a tuple of its field " "values. dataclasses, dicts, frozendicts, lists, and tuples are recursed " "into. Other objects are copied with :func:`copy.deepcopy`." msgstr "" +"データクラス *obj* を (ファクトリ関数 *tuple_factory* を使用して) タプルに変" +"換します。\n" +"各データクラスは、そのフィールドの値からなるタプルに変換されます。\n" +"データクラス、辞書、frozendict、リスト、タプルの内部は再帰的に処理されま" +"す。\n" +"その他のオブジェクトは :func:`copy.deepcopy` でコピーされます。" #: ../../library/dataclasses.rst:422 msgid "Continuing from the previous example::" msgstr "1つ前の例の続きです::" -#: ../../library/dataclasses.rst:424 msgid "" "assert astuple(p) == (10, 20)\n" "assert astuple(c) == ([(0, 0), (10, 4)],)" msgstr "" +"assert astuple(p) == (10, 20)\n" +"assert astuple(c) == ([(0, 0), (10, 4)],)" -#: ../../library/dataclasses.rst:429 msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" -msgstr "" +msgstr "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" -#: ../../library/dataclasses.rst:431 msgid "" ":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " "instance." msgstr "" +"*obj* がデータクラスのインスタンスでない場合、:func:`!astuple` は :exc:" +"`TypeError` を送出します。" -#: ../../library/dataclasses.rst:436 msgid "" "Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " "base classes as given in *bases*, and initialized with a namespace as given " @@ -686,30 +889,49 @@ msgid "" "*slots*, and *weakref_slot* have the same meaning as they do in :deco:" "`dataclass`." msgstr "" +"名前を *cls_name*、フィールドを *fields* の定義、基底クラスを *bases* に指定" +"したものとする新しいデータクラスを作成し、*namespace* に指定した名前空間で初" +"期化します。\n" +"*fields* は、各要素が ``name``、``(name, type)``、``(name, type, Field)`` の" +"いずれかであるイテラブルです。\n" +"``name`` だけを指定した場合、``type`` には :data:`typing.Any` が使用されま" +"す。\n" +"*init*、*repr*、*eq*、*order*、*unsafe_hash*、*frozen*、*match_args*、" +"*kw_only*、*slots*、*weakref_slot* の値の意味は :deco:`dataclass` のものと同" +"じです。" -#: ../../library/dataclasses.rst:446 msgid "" "If *module* is defined, the :attr:`!__module__` attribute of the dataclass " "is set to that value. By default, it is set to the module name of the caller." msgstr "" +"*module* を指定した場合、データクラスの :attr:`!__module__` 属性はその値に設" +"定されます。\n" +"デフォルトでは、呼び出し元のモジュール名に設定されます。" -#: ../../library/dataclasses.rst:450 msgid "" "The *decorator* parameter is a callable that will be used to create the " "dataclass. It should take the class object as a first argument and the same " "keyword arguments as :deco:`dataclass`. By default, the :deco:`dataclass` " "function is used." msgstr "" +"*decorator* パラメータは、データクラスの作成に使用する呼び出し可能オブジェク" +"トです。\n" +"最初の引数としてクラスオブジェクトを取り、:deco:`dataclass` と同じキーワード" +"引数を受け付ける必要があります。\n" +"デフォルトでは :deco:`dataclass` 関数を使用します。" -#: ../../library/dataclasses.rst:455 msgid "" "This function is not strictly required, because any Python mechanism for " "creating a new class with :attr:`~object.__annotations__` can then apply " "the :deco:`dataclass` function to convert that class to a dataclass. This " "function is provided as a convenience. For example::" msgstr "" +":attr:`~object.__annotations__` を持つ新しいクラスを作成する Python の機構で" +"あれば、どれでもその後 :deco:`dataclass` 関数を適用してデータクラスに変換でき" +"るため、この関数は必須ではありません。\n" +"利便性のために提供されています。\n" +"例えば、次のコードは、 ::" -#: ../../library/dataclasses.rst:461 msgid "" "C = make_dataclass('C',\n" " [('x', int),\n" @@ -717,12 +939,16 @@ msgid "" " ('z', int, field(default=5))],\n" " namespace={'add_one': lambda self: self.x + 1})" msgstr "" +"C = make_dataclass('C',\n" +" [('x', int),\n" +" 'y',\n" +" ('z', int, field(default=5))],\n" +" namespace={'add_one': lambda self: self.x + 1})" #: ../../library/dataclasses.rst:467 msgid "Is equivalent to::" msgstr "は、次のコードと等しいです::" -#: ../../library/dataclasses.rst:469 msgid "" "@dataclass\n" "class C:\n" @@ -733,38 +959,56 @@ msgid "" " def add_one(self):\n" " return self.x + 1" msgstr "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: 'typing.Any'\n" +" z: int = 5\n" +"\n" +" def add_one(self):\n" +" return self.x + 1" -#: ../../library/dataclasses.rst:478 msgid "Added the *decorator* parameter." -msgstr "" +msgstr "*decorator* パラメータを追加しました。" -#: ../../library/dataclasses.rst:483 msgid "" "Creates a new object of the same type as *obj*, replacing fields with values " "from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If " "keys in *changes* are not field names of the given dataclass, raises :exc:" "`TypeError`." msgstr "" +"*obj* と同じ型の新しいオブジェクトを作成し、フィールドを *changes* の値で置き" +"換えます。\n" +"*obj* がデータクラスでない場合は :exc:`TypeError` を送出します。\n" +"*changes* のキーが指定したデータクラスのフィールド名でない場合は :exc:" +"`TypeError` を送出します。" -#: ../../library/dataclasses.rst:488 msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " "method of the dataclass. This ensures that :meth:`__post_init__`, if " "present, is also called." msgstr "" +"新たに返すオブジェクトは、データクラスの :meth:`~object.__init__` メソッドを" +"呼び出して作成します。\n" +"これにより、:meth:`__post_init__` が存在する場合は、それも確実に呼び出されま" +"す。" -#: ../../library/dataclasses.rst:492 msgid "" "Init-only variables without default values, if any exist, must be specified " "on the call to :func:`!replace` so that they can be passed to :meth:`!" "__init__` and :meth:`__post_init__`." msgstr "" +"デフォルト値を持たない初期化限定変数がある場合は、:meth:`!__init__` と :meth:" +"`__post_init__` に渡せるように、:func:`!replace` の呼び出し時に指定する必要が" +"あります。" -#: ../../library/dataclasses.rst:496 msgid "" "It is an error for *changes* to contain any fields that are defined as " "having ``init=False``. A :exc:`ValueError` will be raised in this case." msgstr "" +"*changes* に ``init=False`` で定義されたフィールドが含まれているとエラーにな" +"ります。\n" +"この場合は :exc:`ValueError` を送出します。" #: ../../library/dataclasses.rst:500 msgid "" @@ -777,18 +1021,21 @@ msgid "" "instance copying." msgstr "" -#: ../../library/dataclasses.rst:509 msgid "" "Dataclass instances are also supported by generic function :func:`copy." "replace`." msgstr "" +"データクラスのインスタンスは、汎用関数 :func:`copy.replace` でもサポートされ" +"ています。" -#: ../../library/dataclasses.rst:513 msgid "" "Return ``True`` if its parameter is a dataclass (including subclasses of a " "dataclass, but not including :ref:`generic aliases `) or " "an instance of one, otherwise return ``False``." msgstr "" +"パラメータがデータクラス (データクラスのサブクラスを含みますが、:ref:`ジェネ" +"リックエイリアス ` は含みません) またはそのインスタンスで" +"あれば ``True`` を、そうでなければ ``False`` を返します。" #: ../../library/dataclasses.rst:517 msgid "" @@ -800,22 +1047,22 @@ msgstr "" "い) かどうかを知る必要がある場合は、 ``not isinstance(obj, type)`` で追加の" "チェックをしてください::" -#: ../../library/dataclasses.rst:521 msgid "" "def is_dataclass_instance(obj):\n" " return is_dataclass(obj) and not isinstance(obj, type)" msgstr "" +"def is_dataclass_instance(obj):\n" +" return is_dataclass(obj) and not isinstance(obj, type)" -#: ../../library/dataclasses.rst:526 msgid "" "A :class:`sentinel` object signifying a missing default or *default_factory*." msgstr "" +"デフォルト値または *default_factory* が指定されていないことを示す :class:" +"`sentinel` オブジェクトです。" -#: ../../library/dataclasses.rst:528 msgid ":const:`!MISSING` is now a :class:`sentinel` object." -msgstr "" +msgstr ":const:`!MISSING` は :class:`sentinel` オブジェクトになりました。" -#: ../../library/dataclasses.rst:533 msgid "" "A :class:`sentinel` object used as a type annotation. Any fields after a " "pseudo-field with the type of :const:`!KW_ONLY` are marked as keyword-only " @@ -825,6 +1072,15 @@ msgid "" "signify :meth:`~object.__init__` parameters that must be specified as " "keywords when the class is instantiated." msgstr "" +"型アノテーションとして使用する :class:`sentinel` オブジェクトです。\n" +"型が :const:`!KW_ONLY` の疑似フィールドより後のフィールドは、すべてキーワード" +"専用フィールドとして指定されます。\n" +"型が :const:`!KW_ONLY` の疑似フィールドは、それ以外の点では完全に無視されま" +"す。\n" +"そのフィールドの名前も無視されます。\n" +"慣例では、:const:`!KW_ONLY` フィールドの名前に ``_`` を使用します。\n" +"キーワード専用フィールドは、クラスのインスタンス化時にキーワードで指定する必" +"要がある :meth:`~object.__init__` パラメータを表します。" #: ../../library/dataclasses.rst:542 msgid "" @@ -832,7 +1088,6 @@ msgid "" "fields::" msgstr "このサンプルでは ``y`` と ``z`` がキーワード専用フィールドとなります::" -#: ../../library/dataclasses.rst:544 msgid "" "@dataclass\n" "class Point:\n" @@ -843,16 +1098,24 @@ msgid "" "\n" "p = Point(0, y=1.5, z=2.0)" msgstr "" +"@dataclass\n" +"class Point:\n" +" x: float\n" +" _: KW_ONLY\n" +" y: float\n" +" z: float\n" +"\n" +"p = Point(0, y=1.5, z=2.0)" -#: ../../library/dataclasses.rst:553 msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`!KW_ONLY`." msgstr "" +"単一のデータクラス内で、型が :const:`!KW_ONLY` のフィールドを複数指定するとエ" +"ラーになります。" -#: ../../library/dataclasses.rst:558 msgid ":const:`!KW_ONLY` is now a :class:`sentinel` object." -msgstr "" +msgstr ":const:`!KW_ONLY` は :class:`sentinel` オブジェクトになりました。" #: ../../library/dataclasses.rst:563 msgid "" @@ -868,7 +1131,6 @@ msgstr "" msgid "Post-init processing" msgstr "初期化後の処理" -#: ../../library/dataclasses.rst:574 msgid "" "When defined on the class, it will be called by the generated :meth:`~object." "__init__`, normally as :meth:`!self.__post_init__`. However, if any " @@ -877,6 +1139,12 @@ msgid "" "__init__` method is generated, then :meth:`!__post_init__` will not " "automatically be called." msgstr "" +"クラスに定義されている場合、生成された :meth:`~object.__init__` から、通常" +"は :meth:`!self.__post_init__` として呼び出されます。\n" +"ただし、``InitVar`` フィールドが定義されている場合、それらもクラスで定義され" +"た順に :meth:`!__post_init__` に渡されます。\n" +":meth:`!__init__` メソッドが生成されない場合、:meth:`!__post_init__` は自動的" +"には呼び出されません。" msgid "" "Among other uses, this allows for initializing field values that depend on " @@ -886,7 +1154,6 @@ msgstr "" "きます。\n" "例えば次のようにできます。 ::" -#: ../../library/dataclasses.rst:584 msgid "" "@dataclass\n" "class C:\n" @@ -897,16 +1164,26 @@ msgid "" " def __post_init__(self):\n" " self.c = self.a + self.b" msgstr "" +"@dataclass\n" +"class C:\n" +" a: float\n" +" b: float\n" +" c: float = field(init=False)\n" +"\n" +" def __post_init__(self):\n" +" self.c = self.a + self.b" -#: ../../library/dataclasses.rst:593 msgid "" "The :meth:`~object.__init__` method generated by :deco:`dataclass` does not " "call base class :meth:`!__init__` methods. If the base class has an :meth:`!" "__init__` method that has to be called, it is common to call this method in " "a :meth:`__post_init__` method::" msgstr "" +":deco:`dataclass` が生成する :meth:`~object.__init__` メソッドは、基底クラス" +"の :meth:`!__init__` メソッドを呼び出しません。\n" +"基底クラスに呼び出す必要のある :meth:`!__init__` メソッドがある場合、通常は :" +"meth:`__post_init__` メソッド内で呼び出します。 ::" -#: ../../library/dataclasses.rst:598 msgid "" "class Rectangle:\n" " def __init__(self, height, width):\n" @@ -920,13 +1197,26 @@ msgid "" " def __post_init__(self):\n" " super().__init__(self.side, self.side)" msgstr "" +"class Rectangle:\n" +" def __init__(self, height, width):\n" +" self.height = height\n" +" self.width = width\n" +"\n" +"@dataclass\n" +"class Square(Rectangle):\n" +" side: float\n" +"\n" +" def __post_init__(self):\n" +" super().__init__(self.side, self.side)" -#: ../../library/dataclasses.rst:610 msgid "" "Note, however, that in general the dataclass-generated :meth:`!__init__` " "methods don't need to be called, since the derived dataclass will take care " "of initializing all fields of any base class that is a dataclass itself." msgstr "" +"ただし、基底クラス自体がデータクラスであれば、派生データクラスがそのすべての" +"フィールドを初期化するため、一般にデータクラスが生成した :meth:`!__init__` メ" +"ソッドを呼び出す必要はありません。" #: ../../library/dataclasses.rst:614 msgid "" @@ -943,7 +1233,6 @@ msgstr "" msgid "Class variables" msgstr "クラス変数" -#: ../../library/dataclasses.rst:623 msgid "" "One of the few places where :deco:`dataclass` actually inspects the type of " "a field is to determine if a field is a class variable as defined in :pep:" @@ -952,12 +1241,18 @@ msgid "" "as a field and is ignored by the dataclass mechanisms. Such ``ClassVar`` " "pseudo-fields are not returned by the module-level :func:`fields` function." msgstr "" +":deco:`dataclass` が実際にフィールドの型を調べる数少ない場面の 1 つは、フィー" +"ルドが :pep:`526` で定義されるクラス変数かどうかを判定する場合です。\n" +"これは、フィールドの型が :data:`typing.ClassVar` かどうかを調べて行います。\n" +"``ClassVar`` であれば、フィールドとしての処理から除外され、データクラスの機構" +"では無視されます。\n" +"このような ``ClassVar`` 疑似フィールドは、モジュールレベルの :func:`fields` " +"関数から返されません。" #: ../../library/dataclasses.rst:634 msgid "Init-only variables" msgstr "初期化限定変数" -#: ../../library/dataclasses.rst:636 msgid "" "Another place where :deco:`dataclass` inspects a type annotation is to " "determine if a field is an init-only variable. It does this by seeing if " @@ -968,16 +1263,25 @@ msgid "" "`~object.__init__` method, and are passed to the optional :meth:" "`__post_init__` method. They are not otherwise used by dataclasses." msgstr "" +":deco:`dataclass` が型アノテーションを調べるもう 1 つの場面は、フィールドが初" +"期化限定変数かどうかを判定する場合です。\n" +"これは、フィールドの型が :class:`InitVar` かどうかを調べて行います。\n" +":class:`InitVar` であれば、初期化限定フィールドという疑似フィールドとみなされ" +"ます。\n" +"本当のフィールドではないため、モジュールレベルの :func:`fields` 関数から返さ" +"れません。\n" +"初期化限定フィールドは、生成される :meth:`~object.__init__` メソッドのパラ" +"メータとして追加され、:meth:`__post_init__` メソッドがあればそこに渡されま" +"す。\n" +"データクラスは、それ以外の用途には使用しません。" -#: ../../library/dataclasses.rst:646 msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "" -"例えば、あるフィールドがデータベースから初期化されると仮定して、クラスを作成" -"するときには値が与えられない次の場合を考えます::" +"例えば、インスタンスの作成時に値が渡されなかった場合に、フィールドをデータ" +"ベースから初期化するものとします。 ::" -#: ../../library/dataclasses.rst:649 msgid "" "@dataclass\n" "class C:\n" @@ -991,18 +1295,29 @@ msgid "" "\n" "c = C(10, database=my_database)" msgstr "" +"@dataclass\n" +"class C:\n" +" i: int\n" +" j: int | None = None\n" +" database: InitVar[DatabaseType | None] = None\n" +"\n" +" def __post_init__(self, database):\n" +" if self.j is None and database is not None:\n" +" self.j = database.lookup('j')\n" +"\n" +"c = C(10, database=my_database)" -#: ../../library/dataclasses.rst:661 msgid "" "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" "i` and :attr:`!j`, but not for :attr:`!database`." msgstr "" +"この場合、:func:`fields` は :attr:`!i` と :attr:`!j` の :class:`Field` オブ" +"ジェクトを返しますが、:attr:`!database` のものは返しません。" #: ../../library/dataclasses.rst:667 msgid "Frozen instances" msgstr "凍結されたインスタンス" -#: ../../library/dataclasses.rst:669 msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :deco:`dataclass` decorator you can emulate " @@ -1010,19 +1325,26 @@ msgid "" "__setattr__` and :meth:`~object.__delattr__` methods to the class. These " "methods will raise a :exc:`FrozenInstanceError` when invoked." msgstr "" +"真に不変な Python オブジェクトを作成することはできません。\n" +"ただし、:deco:`dataclass` デコレータに ``frozen=True`` を渡すことで、不変性を" +"エミュレートできます。\n" +"この場合、データクラスは :meth:`~object.__setattr__` と :meth:`~object." +"__delattr__` メソッドをクラスに追加します。\n" +"これらのメソッドは呼び出されると :exc:`FrozenInstanceError` を送出します。" -#: ../../library/dataclasses.rst:675 msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`~object.__init__` cannot use simple assignment to initialize fields, and " "must use :meth:`!object.__setattr__`." msgstr "" +"``frozen=True`` を使用すると、パフォーマンスがわずかに低下します。\n" +":meth:`~object.__init__` がフィールドの初期化に単純な代入を使えず、:meth:`!" +"object.__setattr__` を使用しなければならないためです。" #: ../../library/dataclasses.rst:684 msgid "Inheritance" msgstr "継承" -#: ../../library/dataclasses.rst:686 msgid "" "When the dataclass is being created by the :deco:`dataclass` decorator, it " "looks through all of the class's base classes in reverse MRO (that is, " @@ -1033,8 +1355,18 @@ msgid "" "ordered mapping of fields. Because the fields are in insertion order, " "derived classes override base classes. An example::" msgstr "" +":deco:`dataclass` デコレータによるデータクラスの作成時には、クラスのすべての" +"基底クラスを MRO の逆順 (つまり :class:`object` から始まる順序) に調べ、見つ" +"かった各データクラスのフィールドを、順序付きのフィールドのマッピングに追加し" +"ます。\n" +"すべての基底クラスのフィールドを追加した後、自身のフィールドをその順序付き" +"マッピングに追加します。\n" +"生成されるすべてのメソッドは、このように計算して統合した順序付きのフィールド" +"のマッピングを使用します。\n" +"フィールドは挿入順に並ぶため、派生クラスが基底クラスをオーバーライドしま" +"す。\n" +"例えば次のようになります。 ::" -#: ../../library/dataclasses.rst:696 msgid "" "@dataclass\n" "class Base:\n" @@ -1046,27 +1378,38 @@ msgid "" " z: int = 10\n" " x: int = 15" msgstr "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" y: int = 0\n" +"\n" +"@dataclass\n" +"class C(Base):\n" +" z: int = 10\n" +" x: int = 15" -#: ../../library/dataclasses.rst:706 msgid "" "The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " "The final type of :attr:`!x` is :class:`int`, as specified in class :class:`!" "C`." msgstr "" +"最終的なフィールドのリストは、順に :attr:`!x`、:attr:`!y`、:attr:`!z` となり" +"ます。\n" +":attr:`!x` の最終的な型は、クラス :class:`!C` で指定された :class:`int` で" +"す。" -#: ../../library/dataclasses.rst:709 msgid "" "The generated :meth:`~object.__init__` method for :class:`!C` will look " "like::" msgstr "" +":class:`!C` に生成される :meth:`~object.__init__` メソッドは、次のようになり" +"ます。 ::" -#: ../../library/dataclasses.rst:711 msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" -msgstr "" +msgstr "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" -#: ../../library/dataclasses.rst:714 msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" -msgstr "" +msgstr ":meth:`!__init__` のキーワード専用パラメータの並べ替え" #: ../../library/dataclasses.rst:716 msgid "" @@ -1080,14 +1423,14 @@ msgstr "" "のキーワード専用引数は、非キーワード専用パラメータの末尾にこなければならない" "という、キーワード専用パラメータのPythonの実装の都合で必要なことです。" -#: ../../library/dataclasses.rst:722 msgid "" "In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " "keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular " "fields::" msgstr "" +"この例では、:attr:`!Base.y`、:attr:`!Base.w`、:attr:`!D.t` はキーワード専用" +"フィールドで、:attr:`!Base.x` と :attr:`!D.z` は通常のフィールドです。 ::" -#: ../../library/dataclasses.rst:725 msgid "" "@dataclass\n" "class Base:\n" @@ -1101,16 +1444,29 @@ msgid "" " z: int = 10\n" " t: int = field(kw_only=True, default=0)" msgstr "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" _: KW_ONLY\n" +" y: int = 0\n" +" w: int = 1\n" +"\n" +"@dataclass\n" +"class D(Base):\n" +" z: int = 10\n" +" t: int = field(kw_only=True, default=0)" -#: ../../library/dataclasses.rst:737 msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" msgstr "" +":class:`!D` に生成される :meth:`!__init__` メソッドは、次のようになりま" +"す。 ::" -#: ../../library/dataclasses.rst:739 msgid "" "def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " "int = 0):" msgstr "" +"def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " +"int = 0):" msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1121,28 +1477,29 @@ msgstr "" "通常のフィールドに対応する引数の後に、キーワード専用フィールドに対応する引数" "が続きます。" -#: ../../library/dataclasses.rst:745 msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`!__init__` parameter list." msgstr "" +"並べ替え後の :meth:`!__init__` のパラメータリストでは、キーワード専用パラメー" +"タ同士の相対的な順序は保持されます。" #: ../../library/dataclasses.rst:750 msgid "Default factory functions" msgstr "デフォルトファクトリ関数" -#: ../../library/dataclasses.rst:752 msgid "" "If a :func:`field` specifies a *default_factory*, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" +":func:`field` に *default_factory* が指定されている場合、フィールドのデフォル" +"ト値が必要になると、引数なしで呼び出されます。\n" +"例えば、リストの新しいインスタンスを作成するには、次のようにします。 ::" -#: ../../library/dataclasses.rst:756 msgid "mylist: list = field(default_factory=list)" -msgstr "" +msgstr "mylist: list = field(default_factory=list)" -#: ../../library/dataclasses.rst:758 msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " "and the field also specifies *default_factory*, then the default factory " @@ -1150,6 +1507,10 @@ msgid "" "function. This happens because there is no other way to give the field an " "initial value." msgstr "" +"フィールドが (``init=False`` によって) :meth:`~object.__init__` から除外され" +"ており、そのフィールドに *default_factory* も指定されている場合、生成された :" +"meth:`!__init__` 関数からデフォルトファクトリ関数が常に呼び出されます。\n" +"これは、フィールドに初期値を与える方法が他にないためです。" #: ../../library/dataclasses.rst:765 msgid "Mutable default values" @@ -1163,7 +1524,6 @@ msgstr "" "Python はメンバ変数のデフォルト値をクラス属性に保持します。\n" "データクラスを使っていない、この例を考えてみましょう::" -#: ../../library/dataclasses.rst:770 msgid "" "class C:\n" " x = []\n" @@ -1177,18 +1537,29 @@ msgid "" "assert o1.x == [1, 2]\n" "assert o1.x is o2.x" msgstr "" +"class C:\n" +" x = []\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"o1 = C()\n" +"o2 = C()\n" +"o1.add(1)\n" +"o2.add(2)\n" +"assert o1.x == [1, 2]\n" +"assert o1.x is o2.x" -#: ../../library/dataclasses.rst:782 msgid "" "Note that the two instances of class :class:`!C` share the same class " "variable :attr:`!x`, as expected." msgstr "" +"想定どおり、クラス :class:`!C` の 2 つのインスタンスが同じクラス変数 :attr:`!" +"x` を共有していることに注意してください。" #: ../../library/dataclasses.rst:785 msgid "Using dataclasses, *if* this code was valid::" msgstr "データクラスを使っているこのコードが *もし仮に* 有効なものだとしたら::" -#: ../../library/dataclasses.rst:787 msgid "" "@dataclass\n" "class D:\n" @@ -1196,12 +1567,16 @@ msgid "" " def add(self, element):\n" " self.x.append(element)" msgstr "" +"@dataclass\n" +"class D:\n" +" x: list = [] # このコードは ValueError を送出する\n" +" def add(self, element):\n" +" self.x.append(element)" #: ../../library/dataclasses.rst:793 msgid "it would generate code similar to::" msgstr "データクラスは次のようなコードを生成するでしょう::" -#: ../../library/dataclasses.rst:795 msgid "" "class D:\n" " x = []\n" @@ -1212,8 +1587,15 @@ msgid "" "\n" "assert D().x is D().x" msgstr "" +"class D:\n" +" x = []\n" +" def __init__(self, x=x):\n" +" self.x = x\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"assert D().x is D().x" -#: ../../library/dataclasses.rst:804 msgid "" "This has the same issue as the original example using class :class:`!C`. " "That is, two instances of class :class:`!D` that do not specify a value for :" @@ -1225,6 +1607,16 @@ msgid "" "is that if a value is unhashable, it is mutable. This is a partial " "solution, but it does protect against many common errors." msgstr "" +"これには、クラス :class:`!C` を使用した最初の例と同じ問題があります。\n" +"つまり、クラスインスタンスを作成する際に :attr:`!x` の値を指定しなかったクラ" +"ス :class:`!D` の 2 つのインスタンスは、同じ :attr:`!x` を共有します。\n" +"データクラスも通常の Python のクラス作成を使用するだけなので、この動作を共有" +"します。\n" +"データクラスがこの状況を検出する一般的な方法はありません。\n" +"代わりに、:deco:`dataclass` デコレータは、ハッシュ不可能なデフォルトのパラ" +"メータを検出すると :exc:`ValueError` を送出します。\n" +"これは、ハッシュ不可能な値は可変であるという仮定に基づきます。\n" +"部分的な解決策ですが、よくある多くの誤りを防げます。" #: ../../library/dataclasses.rst:815 msgid "" @@ -1234,7 +1626,6 @@ msgstr "" "デフォルトファクトリ関数を使うのが、フィールドのデフォルト値として可変な型の" "新しいインスタンスを作成する手段です::" -#: ../../library/dataclasses.rst:818 msgid "" "@dataclass\n" "class D:\n" @@ -1242,39 +1633,50 @@ msgid "" "\n" "assert D().x is not D().x" msgstr "" +"@dataclass\n" +"class D:\n" +" x: list = field(default_factory=list)\n" +"\n" +"assert D().x is not D().x" -#: ../../library/dataclasses.rst:824 msgid "" "Instead of looking for and disallowing objects of type :class:`list`, :class:" "`dict`, or :class:`set`, unhashable objects are now not allowed as default " "values. Unhashability is used to approximate mutability." msgstr "" +":class:`list`、:class:`dict`、:class:`set` 型のオブジェクトを検出して禁止する" +"代わりに、ハッシュ不可能なオブジェクトをデフォルト値として禁止するようになり" +"ました。\n" +"ハッシュ不可能かどうかを、可変かどうかの近似的な判定に使用しています。" -#: ../../library/dataclasses.rst:831 msgid "Descriptor-typed fields" -msgstr "" +msgstr "デスクリプタ型のフィールド" -#: ../../library/dataclasses.rst:833 msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " "default value have the following special behaviors:" msgstr "" +"デフォルト値として :ref:`デスクリプタオブジェクト ` が代入された" +"フィールドは、以下のような特別な動作をします:" -#: ../../library/dataclasses.rst:836 msgid "" "The value for the field passed to the dataclass's :meth:`~object.__init__` " "method is passed to the descriptor's :meth:`~object.__set__` method rather " "than overwriting the descriptor object." msgstr "" +"データクラスの :meth:`~object.__init__` メソッドに渡されたフィールドの値は、" +"デスクリプタオブジェクトを上書きするのではなく、デスクリプタの :meth:" +"`~object.__set__` メソッドに渡されます。" -#: ../../library/dataclasses.rst:840 msgid "" "Similarly, when getting or setting the field, the descriptor's :meth:" "`~object.__get__` or :meth:`!__set__` method is called rather than returning " "or overwriting the descriptor object." msgstr "" +"同様に、フィールドを取得または設定すると、デスクリプタオブジェクトを返したり" +"上書きしたりする代わりに、デスクリプタの :meth:`~object.__get__` または :" +"meth:`!__set__` メソッドを呼び出します。" -#: ../../library/dataclasses.rst:844 msgid "" "To determine whether a field contains a default value, :deco:`dataclass` " "will call the descriptor's :meth:`!__get__` method using its class access " @@ -1283,8 +1685,14 @@ msgid "" "hand, if the descriptor raises :exc:`AttributeError` in this situation, no " "default value will be provided for the field." msgstr "" +"フィールドがデフォルト値を持つかどうかを判定するため、:deco:`dataclass` はデ" +"スクリプタの :meth:`!__get__` メソッドを、クラスからアクセスする形式 " +"``descriptor.__get__(obj=None, type=cls)`` で呼び出します。\n" +"この場合にデスクリプタが値を返せば、その値をフィールドのデフォルト値として使" +"用します。\n" +"一方、この状況でデスクリプタが :exc:`AttributeError` を送出した場合、フィール" +"ドにはデフォルト値が設定されません。" -#: ../../library/dataclasses.rst:854 msgid "" "class IntConversionDescriptor:\n" " def __init__(self, *, default):\n" @@ -1312,10 +1720,37 @@ msgid "" "i.quantity_on_hand = 2.5 # calls __set__ with 2.5\n" "print(i.quantity_on_hand) # 2" msgstr "" +"class IntConversionDescriptor:\n" +" def __init__(self, *, default):\n" +" self._default = default\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self._name = \"_\" + name\n" +"\n" +" def __get__(self, obj, type):\n" +" if obj is None:\n" +" return self._default\n" +"\n" +" return getattr(obj, self._name, self._default)\n" +"\n" +" def __set__(self, obj, value):\n" +" setattr(obj, self._name, int(value))\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" quantity_on_hand: IntConversionDescriptor = " +"IntConversionDescriptor(default=100)\n" +"\n" +"i = InventoryItem()\n" +"print(i.quantity_on_hand) # 100\n" +"i.quantity_on_hand = 2.5 # 2.5 を渡して __set__ を呼び出す\n" +"print(i.quantity_on_hand) # 2" -#: ../../library/dataclasses.rst:879 msgid "" "Note that if a field is annotated with a descriptor type, but is not " "assigned a descriptor object as its default value, the field will act like a " "normal field." msgstr "" +"フィールドにデスクリプタ型のアノテーションが付いていても、デフォルト値として" +"デスクリプタオブジェクトが代入されていなければ、通常のフィールドと同じように" +"動作することに注意してください。" diff --git a/library/datatypes.po b/library/datatypes.po index 460bc4813..3573da9b0 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -35,7 +35,6 @@ msgstr "" "この章で解説されるモジュールは日付や時間、型が固定された配列、ヒープキュー、" "両端キュー、列挙型のような種々の特殊なデータ型を提供します。" -#: ../../library/datatypes.rst:11 msgid "" "Python also provides :ref:`some built-in data types `, in " "particular, :class:`list`, :class:`tuple`, :class:`dict`, :class:" @@ -43,6 +42,11 @@ msgid "" "is used to hold Unicode strings, and the :class:`bytes` and :class:" "`bytearray` classes are used to hold binary data." msgstr "" +"Python は :ref:`組み込みデータ型 ` も提供しており、主なものに" +"は :class:`list`、:class:`tuple`、:class:`dict`、:class:`frozendict`、:class:" +"`set`、:class:`frozenset` があります。\n" +":class:`str` クラスは Unicode 文字列を保持するために、:class:`bytes` と :" +"class:`bytearray` クラスはバイナリデータを保持するために使用されます。" #: ../../library/datatypes.rst:18 msgid "The following modules are documented in this chapter:" diff --git a/library/datetime.po b/library/datetime.po index f08d366f3..4b98b7b70 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -87,16 +87,17 @@ msgstr "拡張タイムゾーンと構文解析サポートのあるサードパ msgid "Package :pypi:`DateType`" msgstr ":pypi:`DateType` パッケージ" -#: ../../library/datetime.rst:35 msgid "" "Third-party library that introduces distinct static types to for example, " "allow :term:`static type checkers ` to differentiate " "between naive and aware datetimes." msgstr "" +"異なる静的な型を導入するサードパーティライブラリです。\n" +"例えば、:term:`静的型チェッカー ` が naive な日時と " +"aware な日時を区別できるようになります。" -#: ../../library/datetime.rst:43 msgid "Aware and naive objects" -msgstr "" +msgstr "aware オブジェクトと naive オブジェクト" #: ../../library/datetime.rst:45 msgid "" @@ -137,7 +138,6 @@ msgstr "" "を無視してしまうというコストを無視すれば、簡単に理解でき、うまく利用すること" "ができます。" -#: ../../library/datetime.rst:61 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -146,6 +146,13 @@ msgid "" "offset from UTC time, the time zone name, and whether daylight saving time " "is in effect." msgstr "" +"aware オブジェクトが必要なアプリケーションのために、:class:`.datetime` と :" +"class:`.time` オブジェクトには、省略可能なタイムゾーン情報の属性 :attr:`!" +"tzinfo` があります。\n" +"この属性には、抽象クラス :class:`!tzinfo` のサブクラスのインスタンスを設定で" +"きます。\n" +"これらの :class:`tzinfo` オブジェクトは、UTC 時刻からのオフセット、タイムゾー" +"ン名、夏時間が適用されているかどうかの情報を保持します。" msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " @@ -193,9 +200,8 @@ msgstr "" msgid "Alias for the UTC time zone singleton :attr:`datetime.timezone.utc`." msgstr "UTCタイムゾーンシングルトン :attr:`datetime.timezone.utc` の別名。" -#: ../../library/datetime.rst:101 msgid "Available types" -msgstr "" +msgstr "利用可能な型" #: ../../library/datetime.rst:106 msgid "" @@ -260,19 +266,18 @@ msgstr "" msgid "Objects of these types are immutable." msgstr "これらの型のオブジェクトは変更不可能 (immutable) です。" -#: ../../library/datetime.rst:155 msgid "Subclass relationships:" -msgstr "" +msgstr "サブクラスの関係:" -#: ../../library/datetime.rst:157 msgid "" "timedelta, tzinfo, time, and date inherit from object; timezone inherits\n" "from tzinfo; and datetime inherits from date." msgstr "" +"timedelta、tzinfo、time、date は object を継承し、timezone は tzinfo を継承" +"し、datetime は date を継承します。" -#: ../../library/datetime.rst:165 msgid "Common properties" -msgstr "" +msgstr "共通の性質" #: ../../library/datetime.rst:167 msgid "" @@ -298,9 +303,8 @@ msgstr "" "これらの型のオブジェクトは :mod:`pickle` モジュールを利用して効率的な pickle " "化をサポートしています。" -#: ../../library/datetime.rst:177 msgid "Determining if an object is aware or naive" -msgstr "" +msgstr "オブジェクトが aware か naive かの判定" #: ../../library/datetime.rst:179 msgid "Objects of the :class:`date` type are always naive." @@ -358,9 +362,8 @@ msgstr "" "aware なオブジェクトと naive なオブジェクトの区別は :class:`timedelta` オブ" "ジェクトにはあてはまりません。" -#: ../../library/datetime.rst:204 msgid ":class:`!timedelta` objects" -msgstr "" +msgstr ":class:`!timedelta` オブジェクト" #: ../../library/datetime.rst:206 msgid "" @@ -431,7 +434,6 @@ msgstr "" "次の例は、 *days*, *seconds*, *microseconds* に加えて任意の引数がどう \"集約" "\" され、最終的に3つの属性に正規化されるかの説明をしています::" -#: ../../library/datetime.rst:233 msgid "" ">>> import datetime as dt\n" ">>> delta = dt.timedelta(\n" @@ -447,14 +449,30 @@ msgid "" ">>> delta\n" "datetime.timedelta(days=64, seconds=29156, microseconds=10)" msgstr "" +">>> import datetime as dt\n" +">>> delta = dt.timedelta(\n" +"... days=50,\n" +"... seconds=27,\n" +"... microseconds=10,\n" +"... milliseconds=29000,\n" +"... minutes=5,\n" +"... hours=8,\n" +"... weeks=2\n" +"... )\n" +">>> # days、seconds、microseconds だけが残る\n" +">>> delta\n" +"datetime.timedelta(days=64, seconds=29156, microseconds=10)" -#: ../../library/datetime.rst:248 msgid "" "``import datetime as dt`` instead of ``import datetime`` or ``from datetime " "import datetime`` to avoid confusion between the module and the class. See " "`How I Import Python’s datetime Module `__." msgstr "" +"モジュールとクラスの混同を避けるため、``import datetime`` や ``from datetime " +"import datetime`` ではなく ``import datetime as dt`` を使用します。\n" +"`How I Import Python’s datetime Module `__ を参照してください。" msgid "" "If any argument is a float and there are fractional microseconds, the " @@ -483,21 +501,24 @@ msgid "" "example::" msgstr "負の値を正規化すると、最初は混乱するような値になります。例えば::" -#: ../../library/datetime.rst:266 msgid "" ">>> import datetime as dt\n" ">>> d = dt.timedelta(microseconds=-1)\n" ">>> (d.days, d.seconds, d.microseconds)\n" "(-1, 86399, 999999)" msgstr "" +">>> import datetime as dt\n" +">>> d = dt.timedelta(microseconds=-1)\n" +">>> (d.days, d.seconds, d.microseconds)\n" +"(-1, 86399, 999999)" -#: ../../library/datetime.rst:271 msgid "" "Since the string representation of :class:`!timedelta` objects can be " "confusing, use the following recipe to produce a more readable format:" msgstr "" +":class:`!timedelta` オブジェクトの文字列表現は分かりにくいことがあるため、以" +"下のレシピで読みやすい形式にできます:" -#: ../../library/datetime.rst:274 msgid "" ">>> def pretty_timedelta(td):\n" "... if td.days >= 0:\n" @@ -510,6 +531,16 @@ msgid "" ">>> pretty_timedelta(d)\n" "'-(1:00:00)'" msgstr "" +">>> def pretty_timedelta(td):\n" +"... if td.days >= 0:\n" +"... return str(td)\n" +"... return f'-({-td!s})'\n" +"...\n" +">>> d = timedelta(hours=-1)\n" +">>> str(d) # 人には分かりにくい\n" +"'-1 day, 23:00:00'\n" +">>> pretty_timedelta(d)\n" +"'-(1:00:00)'" #: ../../library/datetime.rst:288 ../../library/datetime.rst:628 #: ../../library/datetime.rst:1201 ../../library/datetime.rst:1850 @@ -563,14 +594,14 @@ msgstr "両端値を含む-999,999,999 から 999,999,999 の間" msgid "Between 0 and 86,399 inclusive." msgstr "両端値を含む 0 から 86,399 の間" -#: ../../library/datetime.rst:324 msgid "" "It is a somewhat common bug for code to unintentionally use this attribute " "when it is actually intended to get a :meth:`~timedelta.total_seconds` value " "instead:" msgstr "" +"本来は :meth:`~timedelta.total_seconds` の値を取得するつもりで、誤ってこの属" +"性を使用してしまうバグは比較的よくあります:" -#: ../../library/datetime.rst:328 msgid "" ">>> import datetime as dt\n" ">>> duration = dt.timedelta(seconds=11235813)\n" @@ -579,6 +610,12 @@ msgid "" ">>> duration.total_seconds()\n" "11235813.0" msgstr "" +">>> import datetime as dt\n" +">>> duration = dt.timedelta(seconds=11235813)\n" +">>> duration.days, duration.seconds\n" +"(130, 3813)\n" +">>> duration.total_seconds()\n" +"11235813.0" #: ../../library/datetime.rst:340 msgid "Between 0 and 999,999 inclusive." @@ -794,13 +831,16 @@ msgstr "" ":class:`timedelta` オブジェクトの文字列表現は内部表現に類似した形に正規化され" "ます。そのため負の timedelta は少し変な結果になります。例えば::" -#: ../../library/datetime.rst:425 msgid "" ">>> timedelta(hours=-5)\n" "datetime.timedelta(days=-1, seconds=68400)\n" ">>> print(_)\n" "-1 day, 19:00:00" msgstr "" +">>> timedelta(hours=-5)\n" +"datetime.timedelta(days=-1, seconds=68400)\n" +">>> print(_)\n" +"-1 day, 19:00:00" #: ../../library/datetime.rst:431 msgid "" @@ -822,13 +862,17 @@ msgstr "" "び :class:`.datetime` オブジェクトとの間で加減算をサポートしています (下を参" "照してください)。" -#: ../../library/datetime.rst:439 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`!timedelta` object are now supported, as are remainder operations and " "the :func:`divmod` function. True division and multiplication of a :class:`!" "timedelta` object by a :class:`float` object are now supported." msgstr "" +":class:`timedelta` オブジェクトを別の :class:`!timedelta` オブジェクトで割る" +"切り捨て除算と真の除算、および剰余演算と :func:`divmod` 関数がサポートされる" +"ようになりました。\n" +":class:`!timedelta` オブジェクトと :class:`float` オブジェクトの真の除算およ" +"び乗算もサポートされるようになりました。" #: ../../library/datetime.rst:445 msgid ":class:`timedelta` objects support equality and order comparisons." @@ -847,12 +891,15 @@ msgstr "" msgid "Instance methods:" msgstr "インスタンスメソッド:" -#: ../../library/datetime.rst:454 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (for example, ``td / timedelta(microseconds=1)``)." msgstr "" +"経過時間に含まれる秒数の合計を返します。\n" +"``td / timedelta(seconds=1)`` と等価です。\n" +"秒以外の時間単位には、除算の形式を直接使用してください (例えば ``td / " +"timedelta(microseconds=1)``)。" #: ../../library/datetime.rst:458 msgid "" @@ -862,15 +909,13 @@ msgstr "" "非常に長い期間 (多くのプラットフォームでは270年以上) については、このメソッド" "はマイクロ秒の精度を失うことがあることに注意してください。" -#: ../../library/datetime.rst:465 msgid "Examples of usage: :class:`!timedelta`" -msgstr "" +msgstr "使用例: :class:`!timedelta`" #: ../../library/datetime.rst:467 msgid "An additional example of normalization::" msgstr "正規化の追加の例です::" -#: ../../library/datetime.rst:469 msgid "" ">>> # Components of another_year add up to exactly 365 days\n" ">>> import datetime as dt\n" @@ -882,12 +927,20 @@ msgid "" ">>> year.total_seconds()\n" "31536000.0" msgstr "" +">>> # another_year の各成分の合計はちょうど 365 日になる\n" +">>> import datetime as dt\n" +">>> year = dt.timedelta(days=365)\n" +">>> another_year = dt.timedelta(weeks=40, days=84, hours=23,\n" +"... minutes=50, seconds=600)\n" +">>> year == another_year\n" +"True\n" +">>> year.total_seconds()\n" +"31536000.0" #: ../../library/datetime.rst:479 msgid "Examples of :class:`timedelta` arithmetic::" msgstr ":class:`timedelta` の計算の例です::" -#: ../../library/datetime.rst:481 msgid "" ">>> import datetime as dt\n" ">>> year = dt.timedelta(days=365)\n" @@ -903,10 +956,22 @@ msgid "" ">>> three_years, three_years.days // 365\n" "(datetime.timedelta(days=1095), 3)" msgstr "" +">>> import datetime as dt\n" +">>> year = dt.timedelta(days=365)\n" +">>> ten_years = 10 * year\n" +">>> ten_years\n" +"datetime.timedelta(days=3650)\n" +">>> ten_years.days // 365\n" +"10\n" +">>> nine_years = ten_years - year\n" +">>> nine_years\n" +"datetime.timedelta(days=3285)\n" +">>> three_years = nine_years // 3\n" +">>> three_years, three_years.days // 365\n" +"(datetime.timedelta(days=1095), 3)" -#: ../../library/datetime.rst:499 msgid ":class:`!date` objects" -msgstr "" +msgstr ":class:`!date` オブジェクト" #: ../../library/datetime.rst:501 msgid "" @@ -950,9 +1015,8 @@ msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "範囲を超えた引数を与えた場合、 :exc:`ValueError` が送出されます。" -#: ../../library/datetime.rst:520 ../../library/datetime.rst:954 msgid "Other constructors, all class methods:" -msgstr "他のコンストラクタ、および全てのクラスメソッドを以下に示します:" +msgstr "その他のコンストラクタ (すべてクラスメソッド):" #: ../../library/datetime.rst:524 msgid "Return the current local date." @@ -962,11 +1026,12 @@ msgstr "現在のローカルな日付を返します。" msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "``date.fromtimestamp(time.time())`` と等価です。" -#: ../../library/datetime.rst:531 msgid "" "Return the local date corresponding to the POSIX *timestamp*, such as is " "returned by :func:`time.time`." msgstr "" +":func:`time.time` の返り値などの POSIX *timestamp* に対応するローカルな日付を" +"返します。" #: ../../library/datetime.rst:534 msgid "" @@ -996,16 +1061,17 @@ msgstr "" "出するようになりました。 :c:func:`localtime` の呼び出し失敗で :exc:" "`ValueError` ではなく :exc:`OSError` を送出するようになりました。" -#: ../../library/datetime.rst:547 ../../library/datetime.rst:1042 -#: ../../library/datetime.rst:1082 msgid "Accepts any real number as *timestamp*, not only integer or float." msgstr "" +"*timestamp* として、整数や浮動小数点数だけでなく任意の実数を受け付けるように" +"なりました。" -#: ../../library/datetime.rst:553 msgid "" "Return the date corresponding to the proleptic Gregorian *ordinal*, where " "January 1 of year 1 has ordinal 1." msgstr "" +"先発グレゴリオ暦の序数 *ordinal* に対応する日付を返します。\n" +"1 年 1 月 1 日の序数を 1 とします。" #: ../../library/datetime.rst:556 msgid "" @@ -1045,7 +1111,6 @@ msgstr "序数の日付は現在サポートされていません(``YYYY-OOO``) msgid "Examples::" msgstr "例::" -#: ../../library/datetime.rst:574 msgid "" ">>> import datetime as dt\n" ">>> dt.date.fromisoformat('2019-12-04')\n" @@ -1055,24 +1120,35 @@ msgid "" ">>> dt.date.fromisoformat('2021-W01-1')\n" "datetime.date(2021, 1, 4)" msgstr "" +">>> import datetime as dt\n" +">>> dt.date.fromisoformat('2019-12-04')\n" +"datetime.date(2019, 12, 4)\n" +">>> dt.date.fromisoformat('20191204')\n" +"datetime.date(2019, 12, 4)\n" +">>> dt.date.fromisoformat('2021-W01-1')\n" +"datetime.date(2021, 1, 4)" #: ../../library/datetime.rst:583 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" "以前はこのメソッドは ``YYYY-MM-DD`` フォーマットのみをサポートしていました。" -#: ../../library/datetime.rst:589 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "*year*, *week* and *day*. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" +"*year*、*week*、*day* で指定した ISO 暦の日付に対応する :class:`date` を返し" +"ます。\n" +"これは :meth:`date.isocalendar` 関数の逆操作です。" -#: ../../library/datetime.rst:597 msgid "" "Return a :class:`.date` corresponding to *date_string*, parsed according to " "*format*. This is equivalent to::" msgstr "" +"*format* に従って *date_string* を解析し、対応する :class:`.date` を返しま" +"す。\n" +"次の式と等価です。 ::" #: ../../library/datetime.rst:600 msgid "date(*(time.strptime(date_string, format)[0:3]))" @@ -1089,7 +1165,6 @@ msgstr "" "`strftime-strptime-behavior` および :meth:`date.fromisoformat` も参照してくだ" "さい。" -#: ../../library/datetime.rst:609 ../../library/datetime.rst:1184 msgid "" "If *format* specifies a day of month (``%d``) without a year, :exc:" "`ValueError` is raised. This is to avoid a quadrennial leap year bug in " @@ -1098,8 +1173,16 @@ msgid "" "include a year in your *format*. If parsing *date_string* values that do " "not have a year, explicitly add a year that is a leap year before parsing:" msgstr "" +"*format* が年を指定せずに日 (``%d``) を指定している場合、:exc:`ValueError` を" +"送出します。\n" +"これは、月と日だけを解析しようとするコードで 4 年ごとに起きるうるう年のバグを" +"避けるためです。\n" +"書式に年がない場合に使用するデフォルトの年が、うるう年ではないことが原因で" +"す。\n" +"回避するには、*format* に常に年を含めてください。\n" +"年を持たない *date_string* の値を解析する場合は、解析する前にうるう年の年を明" +"示的に追加してください:" -#: ../../library/datetime.rst:617 msgid "" ">>> import datetime as dt\n" ">>> date_string = \"02/29\"\n" @@ -1108,6 +1191,12 @@ msgid "" ">>> when.strftime(\"%B %d\")\n" "'February 29'" msgstr "" +">>> import datetime as dt\n" +">>> date_string = \"02/29\"\n" +">>> when = dt.date.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # うるう" +"年のバグを回避する。\n" +">>> when.strftime(\"%B %d\")\n" +"'February 29'" #: ../../library/datetime.rst:632 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." @@ -1233,18 +1322,22 @@ msgstr "" "日を表していても、:class:`!datetime` オブジェクトとは決して等価にはなりませ" "ん。" -#: ../../library/datetime.rst:709 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < " "date2.toordinal()``." msgstr "" +"*date1* が時間的に *date2* より前にある場合、*date1* は *date2* より小さいと" +"みなされます。\n" +"言い換えると、``date1.toordinal() < date2.toordinal()`` の場合に限り ``date1 " +"< date2`` となります。" -#: ../../library/datetime.rst:713 msgid "" "Order comparison between a :class:`date` object that is not also a :class:`." "datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." msgstr "" +":class:`.datetime` のインスタンスではない :class:`date` オブジェクトと、:" +"class:`!datetime` オブジェクトとの順序比較は、:exc:`TypeError` を送出します。" #: ../../library/datetime.rst:717 ../../library/datetime.rst:1357 msgid "" @@ -1260,29 +1353,34 @@ msgid "" msgstr "" "ブール値の文脈では、すべての :class:`date` オブジェクトは真とみなされます。" -#: ../../library/datetime.rst:731 msgid "" "Return a new :class:`date` object with the same values, but with specified " "parameters updated." msgstr "" +"指定したパラメータだけを更新し、それ以外は同じ値を持つ新しい :class:`date` オ" +"ブジェクトを返します。" #: ../../library/datetime.rst:734 ../../library/datetime.rst:2041 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/datetime.rst:736 msgid "" ">>> import datetime as dt\n" ">>> d = dt.date(2002, 12, 31)\n" ">>> d.replace(day=26)\n" "datetime.date(2002, 12, 26)" msgstr "" +">>> import datetime as dt\n" +">>> d = dt.date(2002, 12, 31)\n" +">>> d.replace(day=26)\n" +"datetime.date(2002, 12, 26)" -#: ../../library/datetime.rst:741 msgid "" "The generic function :func:`copy.replace` also supports :class:`date` " "objects." msgstr "" +"汎用関数 :func:`copy.replace` も :class:`date` オブジェクトをサポートしていま" +"す。" #: ../../library/datetime.rst:747 ../../library/datetime.rst:1482 msgid "" @@ -1299,10 +1397,10 @@ msgstr "時分秒が 0 で、 DST フラグが -1 です。" msgid "``d.timetuple()`` is equivalent to::" msgstr "``d.timetuple()`` は次の式と等価です::" -#: ../../library/datetime.rst:753 msgid "" "time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" msgstr "" +"time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" #: ../../library/datetime.rst:755 msgid "" @@ -1376,7 +1474,6 @@ msgstr "" "例えば、2004 年は木曜日から始まるため、ISO 年の最初の週は 2003 年 12 月 29 " "日、月曜日から始まり、2004 年 1 月 4 日、日曜日に終わります ::" -#: ../../library/datetime.rst:795 msgid "" ">>> import datetime as dt\n" ">>> dt.date(2003, 12, 29).isocalendar()\n" @@ -1384,6 +1481,11 @@ msgid "" ">>> dt.date(2004, 1, 4).isocalendar()\n" "datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" msgstr "" +">>> import datetime as dt\n" +">>> dt.date(2003, 12, 29).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=1)\n" +">>> dt.date(2004, 1, 4).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" #: ../../library/datetime.rst:801 msgid "Result changed from a tuple to a :term:`named tuple`." @@ -1394,12 +1496,14 @@ msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "日付を ISO 8601 書式の ``YYYY-MM-DD`` で表した文字列を返します::" -#: ../../library/datetime.rst:809 msgid "" ">>> import datetime as dt\n" ">>> dt.date(2002, 12, 4).isoformat()\n" "'2002-12-04'" msgstr "" +">>> import datetime as dt\n" +">>> dt.date(2002, 12, 4).isoformat()\n" +"'2002-12-04'" #: ../../library/datetime.rst:816 msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." @@ -1411,20 +1515,21 @@ msgstr "" msgid "Return a string representing the date::" msgstr "日付を表す文字列を返します::" -#: ../../library/datetime.rst:823 msgid "" ">>> import datetime as dt\n" ">>> dt.date(2002, 12, 4).ctime()\n" "'Wed Dec 4 00:00:00 2002'" msgstr "" +">>> import datetime as dt\n" +">>> dt.date(2002, 12, 4).ctime()\n" +"'Wed Dec 4 00:00:00 2002'" #: ../../library/datetime.rst:827 ../../library/datetime.rst:1675 msgid "``d.ctime()`` is equivalent to::" msgstr "``d.ctime()`` は次の式と等価です::" -#: ../../library/datetime.rst:829 ../../library/datetime.rst:1677 msgid "time.ctime(time.mktime(d.timetuple()))" -msgstr "" +msgstr "time.ctime(time.mktime(d.timetuple()))" #: ../../library/datetime.rst:831 msgid "" @@ -1462,15 +1567,13 @@ msgstr "" ":ref:`strftime-strptime-behavior` および :meth:`date.isoformat` も参照してく" "ださい。" -#: ../../library/datetime.rst:852 msgid "Examples of usage: :class:`!date`" -msgstr "" +msgstr "使用例: :class:`!date`" #: ../../library/datetime.rst:854 msgid "Example of counting days to an event::" msgstr "イベントまでの日数を数える例を示します::" -#: ../../library/datetime.rst:856 msgid "" ">>> import time\n" ">>> import datetime as dt\n" @@ -1489,12 +1592,27 @@ msgid "" ">>> time_to_birthday.days\n" "202" msgstr "" +">>> import time\n" +">>> import datetime as dt\n" +">>> today = dt.date.today()\n" +">>> today\n" +"datetime.date(2007, 12, 5)\n" +">>> today == dt.date.fromtimestamp(time.time())\n" +"True\n" +">>> my_birthday = dt.date(today.year, 6, 24)\n" +">>> if my_birthday < today:\n" +"... my_birthday = my_birthday.replace(year=today.year + 1)\n" +"...\n" +">>> my_birthday\n" +"datetime.date(2008, 6, 24)\n" +">>> time_to_birthday = abs(my_birthday - today)\n" +">>> time_to_birthday.days\n" +"202" #: ../../library/datetime.rst:873 msgid "More examples of working with :class:`date`:" msgstr "さらなる :class:`date` を使う例:" -#: ../../library/datetime.rst:875 msgid "" ">>> import datetime as dt\n" ">>> d = dt.date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" @@ -1537,10 +1655,51 @@ msgid "" ">>> d.replace(year=2005)\n" "datetime.date(2005, 3, 11)" msgstr "" +">>> import datetime as dt\n" +">>> d = dt.date.fromordinal(730920) # 0001 年 1 月 1 日から数えて 730920 日" +"目\n" +">>> d\n" +"datetime.date(2002, 3, 11)\n" +"\n" +">>> # 文字列出力の書式に関するメソッド\n" +">>> d.isoformat()\n" +"'2002-03-11'\n" +">>> d.strftime(\"%d/%m/%y\")\n" +"'11/03/02'\n" +">>> d.strftime(\"%A %d. %B %Y\")\n" +"'Monday 11. March 2002'\n" +">>> d.ctime()\n" +"'Mon Mar 11 00:00:00 2002'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}.'.format(d, \"day\", \"month\")\n" +"'The day is 11, the month is March.'\n" +"\n" +">>> # さまざまな暦の「成分」を取り出すメソッド\n" +">>> t = d.timetuple()\n" +">>> for i in t:\n" +"... print(i)\n" +"2002 # 年\n" +"3 # 月\n" +"11 # 日\n" +"0\n" +"0\n" +"0\n" +"0 # 曜日 (0 = 月曜日)\n" +"70 # 年内の 70 日目\n" +"-1\n" +">>> ic = d.isocalendar()\n" +">>> for i in ic:\n" +"... print(i)\n" +"2002 # ISO の年\n" +"11 # ISO の週番号\n" +"1 # ISO の曜日番号 (1 = 月曜日)\n" +"\n" +">>> # date オブジェクトは不変であり、すべての操作は新しいオブジェクトを生成す" +"る\n" +">>> d.replace(year=2005)\n" +"datetime.date(2005, 3, 11)" -#: ../../library/datetime.rst:922 msgid ":class:`!datetime` objects" -msgstr "" +msgstr ":class:`!datetime` オブジェクト" #: ../../library/datetime.rst:924 msgid "" @@ -1550,13 +1709,16 @@ msgstr "" ":class:`.datetime` オブジェクトは :class:`date` オブジェクトおよび :class:`." "time` オブジェクトの全ての情報が入っている単一のオブジェクトです。" -#: ../../library/datetime.rst:927 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " "object, :class:`!datetime` assumes there are exactly 3600\\*24 seconds in " "every day." msgstr "" +":class:`date` オブジェクトと同様に、:class:`.datetime` は現在のグレゴリオ暦を" +"過去と未来の両方向に拡張した暦を仮定します。\n" +"また、:class:`.time` オブジェクトと同様に、:class:`!datetime` は毎日が厳密に " +"3600\\*24 秒であると仮定します。" #: ../../library/datetime.rst:931 msgid "Constructor:" @@ -1618,9 +1780,8 @@ msgstr "" msgid "Equivalent to::" msgstr "次と等価です::" -#: ../../library/datetime.rst:962 msgid "datetime.fromtimestamp(time.time())" -msgstr "" +msgstr "datetime.fromtimestamp(time.time())" #: ../../library/datetime.rst:964 msgid "See also :meth:`now`, :meth:`fromtimestamp`." @@ -1664,11 +1825,12 @@ msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" ":meth:`today` および :meth:`utcnow` よりもこの関数を使う方が好ましいです。" -#: ../../library/datetime.rst:987 msgid "" "Subsequent calls to :meth:`!datetime.now` may return the same instant " "depending on the precision of the underlying clock." msgstr "" +"基盤となる時計の精度によっては、:meth:`!datetime.now` を続けて呼び出しても同" +"じ時点を返すことがあります。" #: ../../library/datetime.rst:993 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." @@ -1700,9 +1862,9 @@ msgstr "" "そのため、 UTC での現在の時刻を表すオブジェクトの作成では ``datetime." "now(timezone.utc)`` を呼び出す方法が推奨されます。" -#: ../../library/datetime.rst:1008 msgid "Use :meth:`datetime.now` with :const:`UTC` instead." msgstr "" +"代わりに :const:`UTC` を指定して :meth:`datetime.now` を使用してください。" #: ../../library/datetime.rst:1013 msgid "" @@ -1791,9 +1953,8 @@ msgstr "" "aware な :class:`.datetime` オブジェクトを得るには :meth:`fromtimestamp` を呼" "んでください::" -#: ../../library/datetime.rst:1058 msgid "datetime.fromtimestamp(timestamp, timezone.utc)" -msgstr "" +msgstr "datetime.fromtimestamp(timestamp, timezone.utc)" #: ../../library/datetime.rst:1060 msgid "" @@ -1801,10 +1962,10 @@ msgid "" "expression::" msgstr "POSIX 互換プラットフォームでは、これは以下の表現と等価です::" -#: ../../library/datetime.rst:1063 msgid "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" +"datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgid "" "except the latter formula always supports the full years range: between :" @@ -1840,9 +2001,10 @@ msgstr "" "るようになりました。 :c:func:`gmtime` の呼び出し失敗で :exc:`ValueError` では" "なく :exc:`OSError` を送出するようになりました。" -#: ../../library/datetime.rst:1087 msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." msgstr "" +"代わりに :const:`UTC` を指定して :meth:`datetime.fromtimestamp` を使用してく" +"ださい。" #: ../../library/datetime.rst:1092 msgid "" @@ -1859,7 +2021,6 @@ msgstr "" "返されるオブジェクトの時間、分、秒、およびマイクロ秒はすべて 0 で、 :attr:" "`tzinfo` は ``None`` となっています。" -#: ../../library/datetime.rst:1100 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " @@ -1869,12 +2030,21 @@ msgid "" "*date* argument is a :class:`!datetime` object, its time components and :" "attr:`.tzinfo` attributes are ignored." msgstr "" +"日付の各成分が指定した :class:`date` オブジェクトと等しく、時刻の各成分が指定" +"した :class:`.time` オブジェクトと等しい、新しい :class:`.datetime` オブジェ" +"クトを返します。\n" +"*tzinfo* 引数が指定されていれば、その値を結果の :attr:`.tzinfo` 属性に設定し" +"ます。\n" +"それ以外の場合、*time* 引数の :attr:`~.time.tzinfo` 属性を使用します。\n" +"*date* 引数が :class:`!datetime` オブジェクトの場合、その時刻の各成分と :" +"attr:`.tzinfo` 属性は無視されます。" -#: ../../library/datetime.rst:1108 msgid "" "For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``." msgstr "" +"任意の :class:`.datetime` オブジェクト ``d`` について、``d == datetime." +"combine(d.date(), d.time(), d.tzinfo)`` となります。" #: ../../library/datetime.rst:1111 msgid "Added the *tzinfo* argument." @@ -1900,7 +2070,6 @@ msgstr "``T`` セパレーターを他の1文字のユニコードに置き換 msgid "Fractional hours and minutes are not supported." msgstr "少数の時と分はサポートされていません。" -#: ../../library/datetime.rst:1131 msgid "" ">>> import datetime as dt\n" ">>> dt.datetime.fromisoformat('2011-11-04')\n" @@ -1924,20 +2093,45 @@ msgid "" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime.fromisoformat('2011-11-04')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> dt.datetime.fromisoformat('20111104')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> dt.datetime.fromisoformat('2011-11-04T00:05:23')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> dt.datetime.fromisoformat('2011-11-04T00:05:23Z')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, tzinfo=datetime.timezone.utc)\n" +">>> dt.datetime.fromisoformat('20111104T000523')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> dt.datetime.fromisoformat('2011-W01-2T00:05:23.283')\n" +"datetime.datetime(2011, 1, 4, 0, 5, 23, 283000)\n" +">>> dt.datetime.fromisoformat('2011-11-04 00:05:23.283')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" +">>> dt.datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone." +"utc)\n" +">>> dt.datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23,\n" +" tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" -#: ../../library/datetime.rst:1153 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" +"以前は、このメソッドは :meth:`date.isoformat` または :meth:`datetime." +"isoformat` が出力できる形式だけをサポートしていました。" -#: ../../library/datetime.rst:1160 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by *year*, *week* and *day*. The non-date components of the datetime are " "populated with their normal default values. This is the inverse of the " "function :meth:`datetime.isocalendar`." msgstr "" +"*year*、*week*、*day* で指定した ISO 暦の日付に対応する :class:`.datetime` を" +"返します。\n" +"日時の日付以外の成分には、通常のデフォルト値が設定されます。\n" +"これは :meth:`datetime.isocalendar` 関数の逆操作です。" #: ../../library/datetime.rst:1170 msgid "" @@ -1954,9 +2148,8 @@ msgid "" msgstr "" "*format* がマイクロ秒やタイムゾーン情報を含まない場合は、以下と等価です::" -#: ../../library/datetime.rst:1175 ../../library/datetime.rst:2776 msgid "datetime(*(time.strptime(date_string, format)[0:6]))" -msgstr "" +msgstr "datetime(*(time.strptime(date_string, format)[0:6]))" #: ../../library/datetime.rst:1177 msgid "" @@ -1970,7 +2163,6 @@ msgstr "" "`strftime-strptime-behavior` および :meth:`datetime.fromisoformat` も参照して" "ください。" -#: ../../library/datetime.rst:1192 msgid "" ">>> import datetime as dt\n" ">>> date_string = \"02/29\"\n" @@ -1979,6 +2171,12 @@ msgid "" ">>> when.strftime(\"%B %d\")\n" "'February 29'" msgstr "" +">>> import datetime as dt\n" +">>> date_string = \"02/29\"\n" +">>> when = dt.datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # う" +"るう年のバグを回避する。\n" +">>> when.strftime(\"%B %d\")\n" +"'February 29'" #: ../../library/datetime.rst:1205 msgid "" @@ -2119,22 +2317,26 @@ msgstr "" "ちなみに、結果は入力の datetime と同じ :attr:`~.datetime.tzinfo` 属性を持ち、" "入力が aware だとしてもタイムゾーン修正は全く行われません。" -#: ../../library/datetime.rst:1310 msgid "" "Subtraction of a :class:`.datetime` from a :class:`!datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" +":class:`!datetime` から :class:`.datetime` を引く減算は、両方のオペランドが " +"naive であるか、両方が aware である場合にのみ定義されます。\n" +"一方が aware で他方が naive の場合は、:exc:`TypeError` を送出します。" -#: ../../library/datetime.rst:1314 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " "the result is a :class:`timedelta` object ``t`` such that ``datetime2 + t == " "datetime1``. No time zone adjustments are done in this case." msgstr "" +"両方が naive の場合、または両方が aware で同じ :attr:`~.datetime.tzinfo` 属性" +"を持つ場合、:attr:`~.datetime.tzinfo` 属性は無視され、結果は ``datetime2 + t " +"== datetime1`` を満たす :class:`timedelta` オブジェクト ``t`` となります。\n" +"この場合、タイムゾーンの調整は行われません。" -#: ../../library/datetime.rst:1319 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " @@ -2142,6 +2344,11 @@ msgid "" "replace(tzinfo=None) - b.utcoffset())`` except that the implementation never " "overflows." msgstr "" +"両方が aware で異なる :attr:`~.datetime.tzinfo` 属性を持つ場合、``a-b`` は、" +"先に ``a`` と ``b`` を naive な UTC の日時に変換したかのように動作します。\n" +"結果は ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) " +"- b.utcoffset())`` となりますが、実装ではオーバーフローが起きない点が異なりま" +"す。" #: ../../library/datetime.rst:1325 msgid "" @@ -2151,11 +2358,11 @@ msgstr "" ":class:`.datetime` オブジェクトはタイムゾーンを考慮して同じ日付と時刻を表す場" "合、等しいです。" -#: ../../library/datetime.rst:1328 msgid "Naive and aware :class:`.datetime` objects are never equal." msgstr "" +"naive な :class:`.datetime` オブジェクトと aware なものが等しくなることはあり" +"ません。" -#: ../../library/datetime.rst:1330 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -2165,6 +2372,13 @@ msgid "" "implementation never overflows. :class:`.datetime` instances in a repeated " "interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" +"比較対象が両方とも aware で同じ :attr:`!tzinfo` 属性を持つ場合、:attr:`!" +"tzinfo` と :attr:`~.datetime.fold` 属性を無視して、元の日時を比較します。\n" +"比較対象が両方とも aware で異なる :attr:`~.datetime.tzinfo` 属性を持つ場合、" +"先に UTC の日時に変換したかのように比較しますが、実装ではオーバーフローが起き" +"ない点が異なります。\n" +"繰り返される時間帯にある :class:`.datetime` インスタンスが、別のタイムゾーン" +"の :class:`!datetime` インスタンスと等しくなることはありません。" #: ../../library/datetime.rst:1340 msgid "" @@ -2174,13 +2388,13 @@ msgstr "" "タイムゾーンを考慮して、*datetime1* が時刻として *datetime2* よりも前を表す場" "合に、*datetime1* は *datetime2* よりも小さいと見なされます。" -#: ../../library/datetime.rst:1343 msgid "" "Order comparison between naive and aware :class:`.datetime` objects raises :" "exc:`TypeError`." msgstr "" +"naive な :class:`.datetime` オブジェクトと aware なものの順序比較は、:exc:" +"`TypeError` を送出します。" -#: ../../library/datetime.rst:1346 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -2189,6 +2403,11 @@ msgid "" "comparands were first converted to UTC datetimes except that the " "implementation never overflows." msgstr "" +"比較対象が両方とも aware で同じ :attr:`!tzinfo` 属性を持つ場合、:attr:`!" +"tzinfo` と :attr:`~.datetime.fold` 属性を無視して、元の日時を比較します。\n" +"比較対象が両方とも aware で異なる :attr:`~.datetime.tzinfo` 属性を持つ場合、" +"先に UTC の日時に変換したかのように比較しますが、実装ではオーバーフローが起き" +"ない点が異なります。" #: ../../library/datetime.rst:1353 msgid "" @@ -2223,13 +2442,16 @@ msgstr "" "同じhour、minute、second、microsecond、fold および tzinfo 属性を持つ :class:" "`.time` オブジェクトを返します。 :meth:`time` メソッドも参照してください。" -#: ../../library/datetime.rst:1395 msgid "" "Return a new :class:`datetime` object with the same attributes, but with " "specified parameters updated. Note that ``tzinfo=None`` can be specified to " "create a naive datetime from an aware datetime with no conversion of date " "and time data." msgstr "" +"指定したパラメータだけを更新し、それ以外は同じ属性を持つ新しい :class:" +"`datetime` オブジェクトを返します。\n" +"``tzinfo=None`` を指定すると、日付と時刻のデータを変換せずに、aware な日時か" +"ら naive な日時を作成できます。" #: ../../library/datetime.rst:1400 msgid "" @@ -2312,7 +2534,6 @@ msgstr "" "上書きして, :meth:`astimezone` が返す結果に影響を及ぼすことができます。エラー" "の場合を無視すると、 :meth:`astimezone` は以下のように動作します::" -#: ../../library/datetime.rst:1437 msgid "" "def astimezone(self, tz):\n" " if self.tzinfo is tz:\n" @@ -2322,6 +2543,13 @@ msgid "" " # Convert from UTC to tz's local time.\n" " return tz.fromutc(utc)" msgstr "" +"def astimezone(self, tz):\n" +" if self.tzinfo is tz:\n" +" return self\n" +" # self を UTC に変換し、新しい timezone オブジェクトを設定する。\n" +" utc = (self - self.utcoffset()).replace(tzinfo=tz)\n" +" # UTC から tz のローカル時刻に変換する。\n" +" return tz.fromutc(utc)" #: ../../library/datetime.rst:1445 msgid "*tz* now can be omitted." @@ -2379,12 +2607,14 @@ msgstr "" "後者の式が ``None`` か文字列オブジェクトのいずれかを返さない場合には例外を送" "出します。" -#: ../../library/datetime.rst:1486 msgid "" "time.struct_time((d.year, d.month, d.day,\n" " d.hour, d.minute, d.second,\n" " d.weekday(), yday, dst))" msgstr "" +"time.struct_time((d.year, d.month, d.day,\n" +" d.hour, d.minute, d.second,\n" +" d.weekday(), yday, dst))" #: ../../library/datetime.rst:1490 msgid "" @@ -2404,15 +2634,17 @@ msgstr "" "場合、 :meth:`dst` がゼロでない値を返すと :attr:`!tm_isdst` は1となります; そ" "れ以外の場合には :attr:`!tm_isdst` は0に設定されます。" -#: ../../library/datetime.rst:1501 msgid "" "If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " "regardless of what ``d.dst()`` returns. DST is never in effect for a UTC " "time." msgstr "" +":class:`.datetime` インスタンス ``d`` が naive の場合、``d.dst()`` の返り値に" +"関係なく :attr:`~.time.struct_time.tm_isdst` が強制的に 0 になる点を除き、" +"``d.timetuple()`` と同じです。\n" +"UTC 時刻に DST が適用されることはありません。" -#: ../../library/datetime.rst:1505 msgid "" "If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -2420,6 +2652,11 @@ msgid "" "`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` " "and UTC adjustment spills over a year boundary." msgstr "" +"``d`` が aware の場合、``d.utcoffset()`` を引いて ``d`` を UTC 時刻に正規化" +"し、その時刻の :class:`time.struct_time` を返します。\n" +":attr:`!tm_isdst` は強制的に 0 になります。\n" +"``d.year`` が ``MINYEAR`` または ``MAXYEAR`` で、UTC への調整が年の境界を越え" +"る場合、:exc:`OverflowError` を送出することがあります。" msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " @@ -2454,7 +2691,6 @@ msgstr "" ":class:`.datetime` インスタンスに対応する POSIX タイムスタンプを返します。\n" ":func:`time.time` の返り値と同様に、返り値は :class:`float` です。" -#: ../../library/datetime.rst:1534 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on platform C functions to perform the conversion. Since :" @@ -2462,6 +2698,11 @@ msgid "" "functions on many platforms, this method may raise :exc:`OverflowError` or :" "exc:`OSError` for times far in the past or far in the future." msgstr "" +"naive な :class:`.datetime` インスタンスはローカル時刻を表すものとみなされ、" +"このメソッドはプラットフォームの C 関数を使用して変換を行います。\n" +"多くのプラットフォームでは、:class:`!datetime` はプラットフォームの C 関数よ" +"り広い範囲の値をサポートするため、遠い過去や未来の時刻に対して、このメソッド" +"は :exc:`OverflowError` または :exc:`OSError` を送出することがあります。" #: ../../library/datetime.rst:1541 msgid "" @@ -2470,9 +2711,8 @@ msgstr "" "aware な :class:`.datetime` インスタンスに対しては以下のように返り値が計算さ" "れます::" -#: ../../library/datetime.rst:1544 msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -msgstr "" +msgstr "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" #: ../../library/datetime.rst:1548 msgid "" @@ -2487,17 +2727,15 @@ msgstr "" "れていなかった場合、 ``tzinfo=timezone.utc`` を引数に与えることで POSIX タイ" "ムスタンプを取得できます::" -#: ../../library/datetime.rst:1554 msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" -msgstr "" +msgstr "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" #: ../../library/datetime.rst:1556 msgid "or by calculating the timestamp directly::" msgstr "もしくは直接タイムスタンプを計算することもできます::" -#: ../../library/datetime.rst:1558 msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -msgstr "" +msgstr "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" #: ../../library/datetime.rst:1562 msgid "" @@ -2507,11 +2745,12 @@ msgstr "" " :meth:`timestamp` メソッドは :attr:`.fold` 属性を繰り返し時間での曖昧さ回避" "に使用します。" -#: ../../library/datetime.rst:1566 msgid "" "This method no longer relies on the platform C :c:func:`mktime` function to " "perform conversions." msgstr "" +"このメソッドは、変換にプラットフォームの C 関数 :c:func:`mktime` を使用しなく" +"なりました。" #: ../../library/datetime.rst:1573 msgid "" @@ -2573,7 +2812,6 @@ msgid "" msgstr "" ":attr:`microsecond` が 0 の場合は ``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``" -#: ../../library/datetime.rst:1606 msgid "" ">>> import datetime as dt\n" ">>> dt.datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" @@ -2581,6 +2819,11 @@ msgid "" ">>> dt.datetime(2019, 5, 18, 15, 17, tzinfo=dt.timezone.utc).isoformat()\n" "'2019-05-18T15:17:00+00:00'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" +"'2019-05-18T15:17:08.132263'\n" +">>> dt.datetime(2019, 5, 18, 15, 17, tzinfo=dt.timezone.utc).isoformat()\n" +"'2019-05-18T15:17:00+00:00'" #: ../../library/datetime.rst:1612 msgid "" @@ -2590,7 +2833,6 @@ msgstr "" "オプションの引数 *sep* (デフォルトでは ``'T'`` です) は 1 文字のセパレータ" "で、結果の文字列の日付と時刻の間に置かれます。例えば::" -#: ../../library/datetime.rst:1615 msgid "" ">>> import datetime as dt\n" ">>> class TZ(dt.tzinfo):\n" @@ -2603,6 +2845,16 @@ msgid "" ">>> dt.datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat()\n" "'2009-11-27T00:00:00.000100-06:39'" msgstr "" +">>> import datetime as dt\n" +">>> class TZ(dt.tzinfo):\n" +"... \"\"\"任意の固定オフセット -06:39 を持つタイムゾーン。\"\"\"\n" +"... def utcoffset(self, when):\n" +"... return dt.timedelta(hours=-6, minutes=-39)\n" +"...\n" +">>> dt.datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ')\n" +"'2002-12-25 00:00:00-06:39'\n" +">>> dt.datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat()\n" +"'2009-11-27T00:00:00.000100-06:39'" #: ../../library/datetime.rst:1626 ../../library/datetime.rst:2021 msgid "" @@ -2660,7 +2912,6 @@ msgstr "除外された要素は丸め込みではなく、切り捨てされま msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "不正な *timespec* 引数には :exc:`ValueError` があげられます::" -#: ../../library/datetime.rst:1647 msgid "" ">>> import datetime as dt\n" ">>> dt.datetime.now().isoformat(timespec='minutes')\n" @@ -2669,27 +2920,36 @@ msgid "" ">>> my_datetime.isoformat(timespec='microseconds')\n" "'2015-01-01T12:30:59.000000'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime.now().isoformat(timespec='minutes')\n" +"'2002-12-25T00:00'\n" +">>> my_datetime = dt.datetime(2015, 1, 1, 12, 30, 59, 0)\n" +">>> my_datetime.isoformat(timespec='microseconds')\n" +"'2015-01-01T12:30:59.000000'" #: ../../library/datetime.rst:1654 ../../library/datetime.rst:2052 msgid "Added the *timespec* parameter." msgstr "*timespec* パラメータを追加しました." -#: ../../library/datetime.rst:1660 msgid "" "For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" +":class:`.datetime` インスタンス ``d`` について、``str(d)`` は ``d." +"isoformat(' ')`` と等価です。" #: ../../library/datetime.rst:1666 msgid "Return a string representing the date and time::" msgstr "日付および時刻を表す文字列を返します::" -#: ../../library/datetime.rst:1668 msgid "" ">>> import datetime as dt\n" ">>> dt.datetime(2002, 12, 4, 20, 30, 40).ctime()\n" "'Wed Dec 4 20:30:40 2002'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime(2002, 12, 4, 20, 30, 40).ctime()\n" +"'Wed Dec 4 20:30:40 2002'" #: ../../library/datetime.rst:1672 msgid "" @@ -2733,15 +2993,13 @@ msgstr "" ":ref:`strftime-strptime-behavior` および :meth:`datetime.isoformat` も参照し" "てください。" -#: ../../library/datetime.rst:1700 msgid "Examples of usage: :class:`!datetime`" -msgstr "" +msgstr "使用例: :class:`!datetime`" #: ../../library/datetime.rst:1702 msgid "Examples of working with :class:`.datetime` objects:" msgstr ":class:`.datetime` オブジェクトを使う例::" -#: ../../library/datetime.rst:1704 msgid "" ">>> import datetime as dt\n" "\n" @@ -2795,6 +3053,57 @@ msgid "" "format(my_datetime, \"day\", \"month\", \"time\")\n" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" +">>> import datetime as dt\n" +"\n" +">>> # datetime.combine() の使用\n" +">>> d = dt.date(2005, 7, 14)\n" +">>> t = dt.time(12, 30)\n" +">>> dt.datetime.combine(d, t)\n" +"datetime.datetime(2005, 7, 14, 12, 30)\n" +"\n" +">>> # datetime.now() の使用\n" +">>> dt.datetime.now()\n" +"datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" +">>> dt.datetime.now(dt.timezone.utc)\n" +"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone." +"utc)\n" +"\n" +">>> # datetime.strptime() の使用\n" +">>> my_datetime = dt.datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:" +"%M\")\n" +">>> my_datetime\n" +"datetime.datetime(2006, 11, 21, 16, 30)\n" +"\n" +">>> # datetime.timetuple() で全属性のタプルを取得する\n" +">>> tt = my_datetime.timetuple()\n" +">>> for it in tt:\n" +"... print(it)\n" +"...\n" +"2006 # 年\n" +"11 # 月\n" +"21 # 日\n" +"16 # 時\n" +"30 # 分\n" +"0 # 秒\n" +"1 # 曜日 (0 = 月曜日)\n" +"325 # 1 月 1 日から数えた日数\n" +"-1 # dst - メソッド tzinfo.dst() が None を返した\n" +"\n" +">>> # ISO 形式の日付\n" +">>> ic = my_datetime.isocalendar()\n" +">>> for it in ic:\n" +"... print(it)\n" +"...\n" +"2006 # ISO の年\n" +"47 # ISO の週\n" +"2 # ISO の曜日\n" +"\n" +">>> # datetime の書式設定\n" +">>> my_datetime.strftime(\"%A, %d. %B %Y %I:%M%p\")\n" +"'Tuesday, 21. November 2006 04:30PM'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'." +"format(my_datetime, \"day\", \"month\", \"time\")\n" +"'The day is 21, the month is November, the time is 04:30PM.'" #: ../../library/datetime.rst:1755 msgid "" @@ -2857,7 +3166,6 @@ msgstr "" msgid "Usage of ``KabulTz`` from above::" msgstr "上に出てきた ``KabulTz`` の使い方::" -#: ../../library/datetime.rst:1804 msgid "" ">>> tz1 = KabulTz()\n" "\n" @@ -2880,20 +3188,39 @@ msgid "" ">>> dt2 == dt3\n" "True" msgstr "" +">>> tz1 = KabulTz()\n" +"\n" +">>> # 変更前の日時\n" +">>> dt1 = dt.datetime(1900, 11, 21, 16, 30, tzinfo=tz1)\n" +">>> print(dt1.utcoffset())\n" +"4:00:00\n" +"\n" +">>> # 変更後の日時\n" +">>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1)\n" +">>> print(dt2.utcoffset())\n" +"4:30:00\n" +"\n" +">>> # 日時を別のタイムゾーンに変換する\n" +">>> dt3 = dt2.astimezone(dt.timezone.utc)\n" +">>> dt3\n" +"datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)\n" +">>> dt2\n" +"datetime.datetime(2006, 6, 14, 13, 0, tzinfo=KabulTz())\n" +">>> dt2 == dt3\n" +"True" + +msgid ":class:`!time` objects" +msgstr ":class:`!time` オブジェクト" + +#: ../../library/datetime.rst:1831 +msgid "" +"A :class:`.time` object represents a (local) time of day, independent of any " +"particular day, and subject to adjustment via a :class:`tzinfo` object." +msgstr "" +":class:`.time` オブジェクトは (ローカルの) 日中時刻を表現します。\n" +"この時刻表現は特定の日の影響を受けず、 :class:`tzinfo` オブジェクトを介した修" +"正の対象となります。" -#: ../../library/datetime.rst:1829 -msgid ":class:`!time` objects" -msgstr "" - -#: ../../library/datetime.rst:1831 -msgid "" -"A :class:`.time` object represents a (local) time of day, independent of any " -"particular day, and subject to adjustment via a :class:`tzinfo` object." -msgstr "" -":class:`.time` オブジェクトは (ローカルの) 日中時刻を表現します。\n" -"この時刻表現は特定の日の影響を受けず、 :class:`tzinfo` オブジェクトを介した修" -"正の対象となります。" - #: ../../library/datetime.rst:1836 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" @@ -2939,17 +3266,22 @@ msgstr "" ":class:`.time` コンストラクタに *tzinfo* 引数として与えられたオブジェクトにな" "り、何も渡されなかった場合には ``None`` になります。" -#: ../../library/datetime.rst:1909 msgid "" ":class:`.time` objects support equality and order comparisons, where ``a`` " "is considered less than ``b`` when ``a`` precedes ``b`` in time." msgstr "" +":class:`.time` オブジェクトは等価比較と順序比較をサポートします。\n" +"``a`` が時刻として ``b`` より前を表す場合、``a`` は ``b`` より小さいとみなさ" +"れます。" -#: ../../library/datetime.rst:1912 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" +"naive な :class:`!time` オブジェクトと aware なものが等しくなることはありませ" +"ん。\n" +"naive な :class:`!time` オブジェクトと aware なものの順序比較は、:exc:" +"`TypeError` を送出します。" #: ../../library/datetime.rst:1916 msgid "" @@ -2979,17 +3311,20 @@ msgid "" msgstr "" "ブール値の文脈では、 :class:`.time` オブジェクトは常に真とみなされます。" -#: ../../library/datetime.rst:1928 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" "prone and has been removed in Python 3.5. See :issue:`13936` for more " "information." msgstr "" +"Python 3.5 より前では、:class:`.time` オブジェクトが UTC の午前 0 時を表す場" +"合、偽とみなされていました。\n" +"この動作は分かりにくく誤りを招きやすいと判断され、Python 3.5 で削除されまし" +"た。\n" +"詳細は :issue:`13936` を参照してください。" -#: ../../library/datetime.rst:1935 msgid "Other constructors:" -msgstr "" +msgstr "その他のコンストラクタ:" #: ../../library/datetime.rst:1939 msgid "" @@ -2999,23 +3334,22 @@ msgstr "" "以下の例外を除く、有効な ISO 8601 フォーマットで与えられた *time_string* に対" "応する :class:`.time` を返します :" -#: ../../library/datetime.rst:1943 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" +"日付と時刻の区別が曖昧になる可能性がある場合に通常必要となる、先頭の ``T`` は" +"必須ではありません。" -#: ../../library/datetime.rst:1945 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." -msgstr "" +msgstr "秒の小数部分の桁数は任意です (6 桁を超える部分は切り捨てられます)。" #: ../../library/datetime.rst:1949 msgid "Examples:" msgstr "例:" -#: ../../library/datetime.rst:1951 msgid "" ">>> import datetime as dt\n" ">>> dt.time.fromisoformat('04:23:01')\n" @@ -3036,18 +3370,38 @@ msgid "" ">>> dt.time.fromisoformat('04:23:01+00:00')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" msgstr "" +">>> import datetime as dt\n" +">>> dt.time.fromisoformat('04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> dt.time.fromisoformat('T04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> dt.time.fromisoformat('T042301')\n" +"datetime.time(4, 23, 1)\n" +">>> dt.time.fromisoformat('04:23:01.000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> dt.time.fromisoformat('04:23:01,000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> dt.time.fromisoformat('04:23:01+04:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime." +"timedelta(seconds=14400)))\n" +">>> dt.time.fromisoformat('04:23:01Z')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" +">>> dt.time.fromisoformat('04:23:01+00:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" -#: ../../library/datetime.rst:1973 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat`." msgstr "" +"以前は、このメソッドは :meth:`time.isoformat` が出力できる形式だけをサポート" +"していました。" -#: ../../library/datetime.rst:1980 msgid "" "Return a :class:`.time` corresponding to *date_string*, parsed according to " "*format*." msgstr "" +"*format* に従って *date_string* を解析し、対応する :class:`.time` を返しま" +"す。" #: ../../library/datetime.rst:1983 msgid "" @@ -3056,25 +3410,30 @@ msgid "" msgstr "" "*format* がマイクロ秒やタイムゾーン情報を含まない場合は、以下と等価です::" -#: ../../library/datetime.rst:1985 msgid "time(*(time.strptime(date_string, format)[3:6]))" -msgstr "" +msgstr "time(*(time.strptime(date_string, format)[3:6]))" -#: ../../library/datetime.rst:1987 msgid "" ":exc:`ValueError` is raised if the *date_string* and *format* cannot be " "parsed by :func:`time.strptime` or if it returns a value which is not a time " "tuple. See also :ref:`strftime-strptime-behavior` and :meth:`time." "fromisoformat`." msgstr "" +"*date_string* と *format* を :func:`time.strptime` で解析できない場合、または" +"その返り値が時刻タプルでない場合、:exc:`ValueError` を送出します。\n" +":ref:`strftime-strptime-behavior` と :meth:`time.fromisoformat` も参照してく" +"ださい。" -#: ../../library/datetime.rst:2000 msgid "" "Return a new :class:`.time` with the same values, but with specified " "parameters updated. Note that ``tzinfo=None`` can be specified to create a " "naive :class:`!time` from an aware :class:`!time`, without conversion of the " "time data." msgstr "" +"指定したパラメータだけを更新し、それ以外は同じ値を持つ新しい :class:`.time` " +"を返します。\n" +"``tzinfo=None`` を指定すると、時刻のデータを変換せずに、aware な :class:`!" +"time` から naive な :class:`!time` を作成できます。" #: ../../library/datetime.rst:2005 msgid "" @@ -3116,7 +3475,6 @@ msgstr "" msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "不正な *timespec* 引数には :exc:`ValueError` があげられます。" -#: ../../library/datetime.rst:2043 msgid "" ">>> import datetime as dt\n" ">>> dt.time(hour=12, minute=34, second=56, microsecond=123456)." @@ -3128,10 +3486,18 @@ msgid "" ">>> my_time.isoformat(timespec='auto')\n" "'12:34:56'" msgstr "" +">>> import datetime as dt\n" +">>> dt.time(hour=12, minute=34, second=56, microsecond=123456)." +"isoformat(timespec='minutes')\n" +"'12:34'\n" +">>> my_time = dt.time(hour=12, minute=34, second=56, microsecond=0)\n" +">>> my_time.isoformat(timespec='microseconds')\n" +"'12:34:56.000000'\n" +">>> my_time.isoformat(timespec='auto')\n" +"'12:34:56'" -#: ../../library/datetime.rst:2058 msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." -msgstr "" +msgstr "時刻 ``t`` について、``str(t)`` は ``t.isoformat()`` と等価です。" #: ../../library/datetime.rst:2063 msgid "" @@ -3189,15 +3555,13 @@ msgstr "" "後者の式が ``None`` か文字列オブジェクトのいずれかを返さない場合には例外を送" "出します。" -#: ../../library/datetime.rst:2103 msgid "Examples of usage: :class:`!time`" -msgstr "" +msgstr "使用例: :class:`!time`" #: ../../library/datetime.rst:2105 msgid "Examples of working with a :class:`.time` object::" msgstr ":class:`.time` オブジェクトを使う例::" -#: ../../library/datetime.rst:2107 msgid "" ">>> import datetime as dt\n" ">>> class TZ1(dt.tzinfo):\n" @@ -3224,19 +3588,44 @@ msgid "" ">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" "'The time is 12:10.'" msgstr "" +">>> import datetime as dt\n" +">>> class TZ1(dt.tzinfo):\n" +"... def utcoffset(self, when):\n" +"... return dt.timedelta(hours=1)\n" +"... def dst(self, when):\n" +"... return dt.timedelta(0)\n" +"... def tzname(self, when):\n" +"... return \"+01:00\"\n" +"... def __repr__(self):\n" +"... return f\"{self.__class__.__name__}()\"\n" +"...\n" +">>> t = dt.time(12, 10, 30, tzinfo=TZ1())\n" +">>> t\n" +"datetime.time(12, 10, 30, tzinfo=TZ1())\n" +">>> t.isoformat()\n" +"'12:10:30+01:00'\n" +">>> t.dst()\n" +"datetime.timedelta(0)\n" +">>> t.tzname()\n" +"'+01:00'\n" +">>> t.strftime(\"%H:%M:%S %Z\")\n" +"'12:10:30 +01:00'\n" +">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" +"'The time is 12:10.'" -#: ../../library/datetime.rst:2136 msgid ":class:`!tzinfo` objects" -msgstr "" +msgstr ":class:`!tzinfo` オブジェクト" -#: ../../library/datetime.rst:2140 msgid "" "This is an :term:`abstract base class`, meaning that this class should not " "be instantiated directly. Define a subclass of :class:`tzinfo` to capture " "information about a particular time zone." msgstr "" +"これは :term:`abstract base class` であり、直接インスタンス化すべきではないク" +"ラスです。\n" +"特定のタイムゾーンについての情報を保持するには、:class:`tzinfo` のサブクラス" +"を定義してください。" -#: ../../library/datetime.rst:2144 msgid "" "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " "constructors for :class:`.datetime` and :class:`.time` objects. The latter " @@ -3245,8 +3634,13 @@ msgid "" "name of the time zone, and DST offset, all relative to a date or time object " "passed to them." msgstr "" +":class:`tzinfo` (の具象サブクラス) のインスタンスは、:class:`.datetime` と :" +"class:`.time` オブジェクトのコンストラクタに渡せます。\n" +"これらの日時オブジェクトは自分の属性をローカル時刻とみなします。\n" +":class:`!tzinfo` オブジェクトは、渡された日付または時刻オブジェクトに応じて、" +"ローカル時刻の UTC からのオフセット、タイムゾーン名、DST オフセットを返すメ" +"ソッドをサポートします。" -#: ../../library/datetime.rst:2150 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -3255,6 +3649,12 @@ msgid "" "represent time zones with fixed offset from UTC such as UTC itself or North " "American EST and EDT." msgstr "" +"具象サブクラスを派生させ、少なくとも使用する :class:`.datetime` のメソッドが" +"必要とする標準の :class:`tzinfo` メソッドを実装する必要があります。\n" +":mod:`!datetime` モジュールは、:class:`!tzinfo` の単純な具象サブクラス :" +"class:`timezone` を提供します。\n" +"これは UTC 自体や北米の EST と EDT など、UTC からのオフセットが固定されたタイ" +"ムゾーンを表現できます。" #: ../../library/datetime.rst:2157 msgid "" @@ -3310,11 +3710,12 @@ msgstr "" "ほとんどの :meth:`utcoffset` 実装は、おそらく以下の二つのうちの一つに似たもの" "になるでしょう::" -#: ../../library/datetime.rst:2181 msgid "" "return CONSTANT # fixed-offset class\n" "return CONSTANT + self.dst(dt) # daylight-aware class" msgstr "" +"return CONSTANT # 固定オフセットのクラス\n" +"return CONSTANT + self.dst(dt) # 夏時間を考慮するクラス" #: ../../library/datetime.rst:2184 msgid "" @@ -3375,7 +3776,6 @@ msgstr "" msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2215 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz``. For sane :class:`!tzinfo` subclasses, this expression yields " @@ -3387,6 +3787,16 @@ msgid "" "of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime." "astimezone` regardless." msgstr "" +"が ``dt.tzinfo == tz`` を満たすすべての :class:`.datetime` *dt* に対して同じ" +"結果を返す、という意味で一貫している必要があります。\n" +"適切な :class:`!tzinfo` サブクラスでは、この式はタイムゾーンの「標準オフセッ" +"ト」を返します。\n" +"これは日時には依存せず、地理的な位置のみに依存するべきです。\n" +":meth:`datetime.astimezone` の実装はこの性質に依存しますが、違反を検出できな" +"いため、保証するのはプログラマの責任です。\n" +":class:`!tzinfo` サブクラスがこの性質を保証できない場合でも、:meth:`tzinfo." +"fromutc` のデフォルト実装をオーバーライドすれば、:meth:`~.datetime." +"astimezone` と正しく動作できる場合があります。" #: ../../library/datetime.rst:2224 msgid "" @@ -3396,7 +3806,6 @@ msgstr "" "ほとんどの :meth:`dst` 実装は、おそらく以下の二つのうちの一つに似たものになる" "でしょう::" -#: ../../library/datetime.rst:2226 msgid "" "import datetime as dt\n" "\n" @@ -3404,12 +3813,16 @@ msgid "" " # a fixed-offset class: doesn't account for DST\n" " return dt.timedelta(0)" msgstr "" +"import datetime as dt\n" +"\n" +"def dst(self, when):\n" +" # 固定オフセットのクラス: DST を考慮しない\n" +" return dt.timedelta(0)" #: ../../library/datetime.rst:2232 msgid "or::" msgstr "もしくは::" -#: ../../library/datetime.rst:2234 msgid "" "import datetime as dt\n" "\n" @@ -3423,6 +3836,17 @@ msgid "" " else:\n" " return dt.timedelta(0)" msgstr "" +"import datetime as dt\n" +"\n" +"def dst(self, when):\n" +" # 入力の when.year に基づいて、そのタイムゾーンの DST の\n" +" # 開始時刻と終了時刻を標準のローカル時刻で表し、\n" +" # dston と dstoff に設定するコード。\n" +"\n" +" if dston <= when.replace(tzinfo=None) < dstoff:\n" +" return dt.timedelta(hours=1)\n" +" else:\n" +" return dt.timedelta(0)" #: ../../library/datetime.rst:2246 msgid "" @@ -3430,7 +3854,6 @@ msgid "" msgstr "" "デフォルトの :meth:`dst` 実装は :exc:`NotImplementedError` を送出します。" -#: ../../library/datetime.rst:2254 msgid "" "Return the time zone name corresponding to the :class:`.datetime` object " "*dt*, as a string. Nothing about string names is defined by the :mod:`!" @@ -3443,6 +3866,17 @@ msgid "" "specific value of *dt* passed, especially if the :class:`!tzinfo` class is " "accounting for daylight time." msgstr "" +":class:`.datetime` オブジェクト *dt* に対応するタイムゾーン名を文字列として返" +"します。\n" +":mod:`!datetime` モジュールは名前の文字列について何も定義しておらず、特定の意" +"味を持つ必要もありません。\n" +"例えば、``\"GMT\"``、``\"UTC\"``、``\"-500\"``、``\"-5:00\"``、``\"EDT\"``、" +"``\"US/Eastern\"``、``\"America/New York\"`` はすべて有効な返り値です。\n" +"名前の文字列が不明な場合は ``None`` を返します。\n" +"固定文字列ではなくメソッドになっている主な理由は、一部の :class:`tzinfo` サブ" +"クラスが、渡された *dt* の具体的な値に応じて異なる名前を返したい場合があるた" +"めです。\n" +"特に、:class:`!tzinfo` クラスが夏時間を考慮する場合が当てはまります。" #: ../../library/datetime.rst:2264 msgid "" @@ -3451,7 +3885,6 @@ msgid "" msgstr "" "デフォルトの :meth:`tzname` 実装は :exc:`NotImplementedError` を送出します。" -#: ../../library/datetime.rst:2267 msgid "" "These methods are called by a :class:`.datetime` or :class:`.time` object, " "in response to their methods of the same names. A :class:`!datetime` object " @@ -3460,8 +3893,14 @@ msgid "" "prepared to accept a *dt* argument of ``None``, or of class :class:`!" "datetime`." msgstr "" +"これらのメソッドは、:class:`.datetime` または :class:`.time` オブジェクトの同" +"名のメソッドに応じて呼び出されます。\n" +":class:`!datetime` オブジェクトは引数として自身を渡し、:class:`!time` オブ" +"ジェクトは ``None`` を渡します。\n" +"したがって、:class:`tzinfo` サブクラスのメソッドは、*dt* 引数として ``None`` " +"または :class:`!datetime` クラスのオブジェクトを受け付けられるようにする必要" +"があります。" -#: ../../library/datetime.rst:2273 msgid "" "When ``None`` is passed, it's up to the class designer to decide the best " "response. For example, returning ``None`` is appropriate if the class wishes " @@ -3469,13 +3908,12 @@ msgid "" "It may be more useful for ``utcoffset(None)`` to return the standard UTC " "offset, as there is no other convention for discovering the standard offset." msgstr "" -"``None`` が渡された場合、最良の応答方法を決めるのはクラス設計者次第です。例え" -"ば、このクラスが :class:`tzinfo` プロトコルと関係をもたないということを表明さ" -"せたければ、 ``None`` が適切です。標準時のオフセットを見つける他の手段がない" -"場合には、標準 UTC オフセットを返すために ``utcoffset(None)`` を使うともっと" -"便利かもしれません。" +"``None`` が渡された場合、最良の応答方法を決めるのはクラス設計者です。\n" +"例えば、時刻オブジェクトが :class:`tzinfo` プロトコルに関与しないことを表した" +"い場合は、``None`` を返すのが適切です。\n" +"標準オフセットを調べる方法は他に定められていないため、``utcoffset(None)`` が" +"標準の UTC オフセットを返す方が便利な場合もあります。" -#: ../../library/datetime.rst:2279 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`!" "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -3484,6 +3922,12 @@ msgid "" "*dt* as being in local time, and not need worry about objects in other time " "zones." msgstr "" +":class:`!datetime` のメソッドに応じて :class:`.datetime` オブジェクトが渡され" +"る場合、``dt.tzinfo`` は *self* と同じオブジェクトです。\n" +"ユーザーコードが :class:`!tzinfo` メソッドを直接呼び出さない限り、:class:" +"`tzinfo` メソッドはこの性質に依存できます。\n" +"これは、:class:`!tzinfo` メソッドが *dt* をローカル時刻と解釈し、他のタイム" +"ゾーンのオブジェクトを気にする必要がないようにするためです。" #: ../../library/datetime.rst:2285 msgid "" @@ -3539,7 +3983,6 @@ msgstr "" "エラーの場合のためのコードを除き、デフォルトの :meth:`fromutc` の実装は以下の" "ように動作します::" -#: ../../library/datetime.rst:2310 msgid "" "import datetime as dt\n" "\n" @@ -3558,6 +4001,22 @@ msgid "" " else:\n" " return when" msgstr "" +"import datetime as dt\n" +"\n" +"def fromutc(self, when):\n" +" # when.tzinfo is not self の場合は ValueError を送出する\n" +" dtoff = when.utcoffset()\n" +" dtdst = when.dst()\n" +" # dtoff is None または dtdst is None の場合は ValueError を送出する\n" +" delta = dtoff - dtdst # これは self の標準オフセット\n" +" if delta:\n" +" when += delta # 標準のローカル時刻に変換する\n" +" dtdst = when.dst()\n" +" # dtdst is None の場合は ValueError を送出する\n" +" if dtdst:\n" +" return when + dtdst\n" +" else:\n" +" return when" #: ../../library/datetime.rst:2327 msgid "" @@ -3567,7 +4026,6 @@ msgstr "" "次の :download:`tzinfo_examples.py <../includes/tzinfo_examples.py>` ファイル" "には、 :class:`tzinfo` クラスの例がいくつか載っています:" -#: ../../library/datetime.rst:2331 msgid "" "import datetime as dt\n" "\n" @@ -3749,6 +4207,185 @@ msgid "" "Mountain = USTimeZone(-7, \"Mountain\", \"MST\", \"MDT\")\n" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" +"import datetime as dt\n" +"\n" +"# プラットフォームが認識するローカル時刻を表すクラス。\n" +"# (UTC オフセットや DST の規則が過去に変更された\n" +"# タイムゾーンでは、過去の時刻に対して\n" +"# 誤った値になる場合がある。)\n" +"import time\n" +"\n" +"ZERO = dt.timedelta(0)\n" +"HOUR = dt.timedelta(hours=1)\n" +"SECOND = dt.timedelta(seconds=1)\n" +"\n" +"STDOFFSET = dt.timedelta(seconds=-time.timezone)\n" +"if time.daylight:\n" +" DSTOFFSET = dt.timedelta(seconds=-time.altzone)\n" +"else:\n" +" DSTOFFSET = STDOFFSET\n" +"\n" +"DSTDIFF = DSTOFFSET - STDOFFSET\n" +"\n" +"\n" +"class LocalTimezone(dt.tzinfo):\n" +"\n" +" def fromutc(self, when):\n" +" assert when.tzinfo is self\n" +" stamp = (when - dt.datetime(1970, 1, 1, tzinfo=self)) // SECOND\n" +" args = time.localtime(stamp)[:6]\n" +" dst_diff = DSTDIFF // SECOND\n" +" # 折り返しを検出する\n" +" fold = (args == time.localtime(stamp - dst_diff))\n" +" return dt.datetime(*args, microsecond=when.microsecond,\n" +" tzinfo=self, fold=fold)\n" +"\n" +" def utcoffset(self, when):\n" +" if self._isdst(when):\n" +" return DSTOFFSET\n" +" else:\n" +" return STDOFFSET\n" +"\n" +" def dst(self, when):\n" +" if self._isdst(when):\n" +" return DSTDIFF\n" +" else:\n" +" return ZERO\n" +"\n" +" def tzname(self, when):\n" +" return time.tzname[self._isdst(when)]\n" +"\n" +" def _isdst(self, when):\n" +" tt = (when.year, when.month, when.day,\n" +" when.hour, when.minute, when.second,\n" +" when.weekday(), 0, 0)\n" +" stamp = time.mktime(tt)\n" +" tt = time.localtime(stamp)\n" +" return tt.tm_isdst > 0\n" +"\n" +"\n" +"Local = LocalTimezone()\n" +"\n" +"\n" +"# 米国の主要なタイムゾーンについて、現在の DST 規則を完全に実装する。\n" +"\n" +"def first_sunday_on_or_after(when):\n" +" days_to_go = 6 - when.weekday()\n" +" if days_to_go:\n" +" when += dt.timedelta(days_to_go)\n" +" return when\n" +"\n" +"\n" +"# 米国の DST 規則\n" +"#\n" +"# これは米国の DST の開始時刻と終了時刻について簡略化した\n" +"# (つまり一部のケースでは誤った) 規則である。完全で最新の DST 規則と\n" +"# タイムゾーン定義は Olson Database を参照 (または pytz を試すこと):\n" +"# http://www.twinsun.com/tz/tz-link.htm\n" +"# https://sourceforge.net/projects/pytz/ (最新でない場合がある)\n" +"#\n" +"# 米国では 2007 年以降、DST は 3 月の第 2 日曜日、\n" +"# つまり 3 月 8 日以降の最初の日曜日の午前 2 時 (標準時) に始まる。\n" +"DSTSTART_2007 = dt.datetime(1, 3, 8, 2)\n" +"# 11 月の第 1 日曜日の午前 2 時 (夏時間) に終わる。\n" +"DSTEND_2007 = dt.datetime(1, 11, 1, 2)\n" +"# 1987 年から 2006 年まで、DST は 4 月の第 1 日曜日の午前 2 時 (標準時)\n" +"# に始まり、10 月の最後の日曜日、つまり 10 月 25 日以降の\n" +"# 最初の日曜日の午前 2 時 (夏時間) に終わっていた。\n" +"DSTSTART_1987_2006 = dt.datetime(1, 4, 1, 2)\n" +"DSTEND_1987_2006 = dt.datetime(1, 10, 25, 2)\n" +"# 1967 年から 1986 年まで、DST は 4 月の最後の日曜日 (4 月 24 日以降の\n" +"# 日曜日) の午前 2 時 (標準時) に始まり、10 月の最後の日曜日、\n" +"# つまり 10 月 25 日以降の最初の日曜日の\n" +"# 午前 2 時 (夏時間) に終わっていた。\n" +"DSTSTART_1967_1986 = dt.datetime(1, 4, 24, 2)\n" +"DSTEND_1967_1986 = DSTEND_1987_2006\n" +"\n" +"\n" +"def us_dst_range(year):\n" +" # 米国の DST の開始時刻と終了時刻を求める。1967 年より前の年は\n" +" # DST がないため start = end を返す。\n" +" if 2006 < year:\n" +" dststart, dstend = DSTSTART_2007, DSTEND_2007\n" +" elif 1986 < year < 2007:\n" +" dststart, dstend = DSTSTART_1987_2006, DSTEND_1987_2006\n" +" elif 1966 < year < 1987:\n" +" dststart, dstend = DSTSTART_1967_1986, DSTEND_1967_1986\n" +" else:\n" +" return (dt.datetime(year, 1, 1), ) * 2\n" +"\n" +" start = first_sunday_on_or_after(dststart.replace(year=year))\n" +" end = first_sunday_on_or_after(dstend.replace(year=year))\n" +" return start, end\n" +"\n" +"\n" +"class USTimeZone(dt.tzinfo):\n" +"\n" +" def __init__(self, hours, reprname, stdname, dstname):\n" +" self.stdoffset = dt.timedelta(hours=hours)\n" +" self.reprname = reprname\n" +" self.stdname = stdname\n" +" self.dstname = dstname\n" +"\n" +" def __repr__(self):\n" +" return self.reprname\n" +"\n" +" def tzname(self, when):\n" +" if self.dst(when):\n" +" return self.dstname\n" +" else:\n" +" return self.stdname\n" +"\n" +" def utcoffset(self, when):\n" +" return self.stdoffset + self.dst(when)\n" +"\n" +" def dst(self, when):\n" +" if when is None or when.tzinfo is None:\n" +" # ここでは、一方または両方の場合に例外を送出するのが妥当かもしれ" +"ない。\n" +" # どのように扱いたいかによる。デフォルトの fromutc() の実装\n" +" # (デフォルトの astimezone() の実装から呼び出される) は、\n" +" # when.tzinfo is self である datetime を渡す。\n" +" return ZERO\n" +" assert when.tzinfo is self\n" +" start, end = us_dst_range(when.year)\n" +" # naive と aware のオブジェクトは比較できないため、先に when から\n" +" # タイムゾーンを取り除く。\n" +" when = when.replace(tzinfo=None)\n" +" if start + HOUR <= when < end - HOUR:\n" +" # DST が適用されている。\n" +" return HOUR\n" +" if end - HOUR <= when < end:\n" +" # 折り返し (曖昧な 1 時間): when.fold で曖昧さを解消する。\n" +" return ZERO if when.fold else HOUR\n" +" if start <= when < start + HOUR:\n" +" # 欠落 (存在しない 1 時間): 折り返しの規則を逆にする。\n" +" return HOUR if when.fold else ZERO\n" +" # DST は適用されていない。\n" +" return ZERO\n" +"\n" +" def fromutc(self, when):\n" +" assert when.tzinfo is self\n" +" start, end = us_dst_range(when.year)\n" +" start = start.replace(tzinfo=self)\n" +" end = end.replace(tzinfo=self)\n" +" std_time = when + self.stdoffset\n" +" dst_time = std_time + HOUR\n" +" if end <= dst_time < end + HOUR:\n" +" # 繰り返される 1 時間\n" +" return std_time.replace(fold=1)\n" +" if std_time < start or dst_time >= end:\n" +" # 標準時\n" +" return std_time\n" +" if start <= std_time < end - HOUR:\n" +" # 夏時間\n" +" return dst_time\n" +"\n" +"\n" +"Eastern = USTimeZone(-5, \"Eastern\", \"EST\", \"EDT\")\n" +"Central = USTimeZone(-6, \"Central\", \"CST\", \"CDT\")\n" +"Mountain = USTimeZone(-7, \"Mountain\", \"MST\", \"MDT\")\n" +"Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" @@ -3763,7 +4400,6 @@ msgstr "" "EDT は 3 月の第二日曜日の 1:59 (EST) の 1 分後に開始し、11 月の最初の日曜日" "の 1:59 (EDT) の 1 分後に終了します。 ::" -#: ../../library/datetime.rst:2339 msgid "" " UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" " EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" @@ -3773,6 +4409,13 @@ msgid "" "\n" " end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" msgstr "" +" UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" +" EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" +" EDT 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM\n" +"\n" +"start 22:MM 23:MM 0:MM 1:MM 3:MM 4:MM\n" +"\n" +" end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" #: ../../library/datetime.rst:2347 msgid "" @@ -3789,7 +4432,6 @@ msgstr "" "ん。\n" "例として、 2016 年の春方向の移行では、次のような結果になります::" -#: ../../library/datetime.rst:2352 msgid "" ">>> import datetime as dt\n" ">>> from tzinfo_examples import HOUR, Eastern\n" @@ -3804,6 +4446,18 @@ msgid "" "07:00:00 UTC = 03:00:00 EDT\n" "08:00:00 UTC = 04:00:00 EDT" msgstr "" +">>> import datetime as dt\n" +">>> from tzinfo_examples import HOUR, Eastern\n" +">>> u0 = dt.datetime(2016, 3, 13, 5, tzinfo=dt.timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname())\n" +"...\n" +"05:00:00 UTC = 00:00:00 EST\n" +"06:00:00 UTC = 01:00:00 EST\n" +"07:00:00 UTC = 03:00:00 EDT\n" +"08:00:00 UTC = 04:00:00 EDT" #: ../../library/datetime.rst:2366 msgid "" @@ -3833,7 +4487,6 @@ msgstr "" "fold` 属性を 0 にし、以降の時間では 1 にします。例えば、 2016 年での秋方向の" "移行では、次のような結果になります::" -#: ../../library/datetime.rst:2377 msgid "" ">>> import datetime as dt\n" ">>> from tzinfo_examples import HOUR, Eastern\n" @@ -3848,6 +4501,18 @@ msgid "" "06:00:00 UTC = 01:00:00 EST 1\n" "07:00:00 UTC = 02:00:00 EST 0" msgstr "" +">>> import datetime as dt\n" +">>> from tzinfo_examples import HOUR, Eastern\n" +">>> u0 = dt.datetime(2016, 11, 6, 4, tzinfo=dt.timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname(), t.fold)\n" +"...\n" +"04:00:00 UTC = 00:00:00 EDT 0\n" +"05:00:00 UTC = 01:00:00 EDT 0\n" +"06:00:00 UTC = 01:00:00 EST 1\n" +"07:00:00 UTC = 02:00:00 EST 0" #: ../../library/datetime.rst:2390 msgid "" @@ -3857,7 +4522,6 @@ msgstr "" ":attr:`~.datetime.fold` 属性が異なるだけの :class:`.datetime` インスタンスは" "比較において等しいとみなされることに注意してください。" -#: ../../library/datetime.rst:2393 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" @@ -3866,6 +4530,12 @@ msgid "" "class representing only EST (fixed offset -5 hours), or only EDT (fixed " "offset -4 hours))." msgstr "" +"時計が示す時刻の曖昧さを許容できないアプリケーションは、:attr:`~.datetime." +"fold` 属性の値を明示的に調べるか、標準時と夏時間を組み合わせた :class:" +"`tzinfo` サブクラスの使用を避けるべきです。\n" +":class:`timezone` や、その他の固定オフセットの :class:`!tzinfo` サブクラス " +"(EST だけを表すクラス (固定オフセット -5 時間) や、EDT だけを表すクラス (固定" +"オフセット -4 時間) など) を使用する場合、曖昧さはありません。" #: ../../library/datetime.rst:2401 msgid ":mod:`zoneinfo`" @@ -3907,9 +4577,8 @@ msgstr "" "時刻の履歴を表しています。政治団体によるタイムゾーンの境界、UTC オフセット、" "夏時間のルールの変更を反映するため、定期的にデータベースが更新されます。" -#: ../../library/datetime.rst:2420 msgid ":class:`!timezone` objects" -msgstr "" +msgstr ":class:`!timezone` オブジェクト" #: ../../library/datetime.rst:2422 msgid "" @@ -4003,9 +4672,8 @@ msgstr "" msgid "The UTC time zone, ``timezone(timedelta(0))``." msgstr "UTC タイムゾーン ``timezone(timedelta(0))`` です。" -#: ../../library/datetime.rst:2499 msgid ":meth:`!strftime` and :meth:`!strptime` behavior" -msgstr "" +msgstr ":meth:`!strftime` と :meth:`!strptime` の動作" #: ../../library/datetime.rst:2501 msgid "" @@ -4017,12 +4685,14 @@ msgstr "" "``strftime(format)`` メソッドをサポートし、時刻を表現する文字列を明示的な書式" "文字列で統制して作成しています。" -#: ../../library/datetime.rst:2505 msgid "" "Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and :meth:" "`time.strptime` class methods create an object from a string representing " "the time and a corresponding format string." msgstr "" +"逆に、クラスメソッド :meth:`date.strptime`、:meth:`datetime.strptime`、:meth:" +"`time.strptime` は、時刻を表す文字列と対応する書式文字列からオブジェクトを作" +"成します。" #: ../../library/datetime.rst:2509 msgid "" @@ -4048,9 +4718,8 @@ msgstr "使用法" msgid "Convert object to a string according to a given format" msgstr "オブジェクトを与えられた書式に従って文字列に変換する" -#: ../../library/datetime.rst:2515 msgid "Parse a string into an object given a corresponding format" -msgstr "" +msgstr "対応する書式を指定して文字列を解析し、オブジェクトに変換する" #: ../../library/datetime.rst:2517 msgid "Type of method" @@ -4076,17 +4745,16 @@ msgstr "``strftime(format)``" msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2526 msgid ":meth:`!strftime` and :meth:`!strptime` format codes" -msgstr "" +msgstr ":meth:`!strftime` と :meth:`!strptime` の書式コード" -#: ../../library/datetime.rst:2528 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" +"これらのメソッドは、日付の解析と書式設定に使用できる書式コードを受け付けま" +"す。 ::" -#: ../../library/datetime.rst:2530 msgid "" ">>> import datetime as dt\n" ">>> dt.datetime.strptime('31/01/22 23:59:59.999999',\n" @@ -4095,12 +4763,19 @@ msgid "" ">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" "'Mon 31 Jan 2022, 11:59PM'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime.strptime('31/01/22 23:59:59.999999',\n" +"... '%d/%m/%y %H:%M:%S.%f')\n" +"datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)\n" +">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" +"'Mon 31 Jan 2022, 11:59PM'" -#: ../../library/datetime.rst:2537 msgid "" "The following is a list of all the format codes that the 2011 C standard " "requires, and these work on all supported platforms." msgstr "" +"以下は、2011 年の C 標準で必須とされるすべての書式コードの一覧であり、サポー" +"トされるすべてのプラットフォームで動作します。" #: ../../library/datetime.rst:2541 ../../library/datetime.rst:2696 msgid "Directive" @@ -4198,24 +4873,19 @@ msgstr "Tue Aug 16 21:30:00 1988 (en_US);" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "Di 16 Aug 21:30:00 1988 (de_DE)" -#: ../../library/datetime.rst:2569 msgid "``%C``" -msgstr "" +msgstr "``%C``" -#: ../../library/datetime.rst:2569 msgid "" "The year divided by 100 and truncated to an integer as a zero-padded decimal " "number." -msgstr "" +msgstr "年を 100 で割り、小数部分を切り捨てた整数をゼロ埋めした 10 進数。" -#: ../../library/datetime.rst:2569 msgid "01, 02, ..., 99" -msgstr "" +msgstr "01, 02, ..., 99" -#: ../../library/datetime.rst:2569 ../../library/datetime.rst:2585 -#: ../../library/datetime.rst:2595 msgid "\\(0)" -msgstr "" +msgstr "\\(0)" #: ../../library/datetime.rst:2573 msgid "``%d``" @@ -4229,21 +4899,17 @@ msgstr "0埋めした10進数で表記した月中の日にち。" msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2573 msgid "\\(9), \\(10)" -msgstr "" +msgstr "\\(9), \\(10)" -#: ../../library/datetime.rst:2576 msgid "``%D``" -msgstr "" +msgstr "``%D``" -#: ../../library/datetime.rst:2576 msgid "Equivalent to ``%m/%d/%y``." -msgstr "" +msgstr "``%m/%d/%y`` と等価。" -#: ../../library/datetime.rst:2576 msgid "11/28/25" -msgstr "" +msgstr "11/28/25" #: ../../library/datetime.rst:2576 ../../library/datetime.rst:2597 #: ../../library/datetime.rst:2600 ../../library/datetime.rst:2603 @@ -4252,43 +4918,36 @@ msgstr "" msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2579 msgid "``%e``" -msgstr "" +msgstr "``%e``" -#: ../../library/datetime.rst:2579 msgid "The day of the month as a space-padded decimal number." -msgstr "" +msgstr "月内の日を空白埋めした 10 進数。" -#: ../../library/datetime.rst:2579 msgid "␣1, ␣2, ..., 31" -msgstr "" +msgstr "␣1, ␣2, ..., 31" -#: ../../library/datetime.rst:2579 msgid "\\(10)" -msgstr "" +msgstr "\\(10)" #: ../../library/datetime.rst:2582 msgid "``%F``" msgstr "``%F``" -#: ../../library/datetime.rst:2582 msgid "Equivalent to ``%Y-%m-%d``, the ISO 8601 format." -msgstr "" +msgstr "ISO 8601 形式の ``%Y-%m-%d`` と等価。" -#: ../../library/datetime.rst:2582 msgid "2025-10-11, 1001-12-30" -msgstr "" +msgstr "2025-10-11, 1001-12-30" #: ../../library/datetime.rst:2585 msgid "``%g``" msgstr "``%g``" -#: ../../library/datetime.rst:2585 msgid "" "Last 2 digits of ISO 8601 year representing the year that contains the " "greater part of the ISO week (``%V``)." -msgstr "" +msgstr "ISO 週 (``%V``) の大半が属する年を表す ISO 8601 年の下 2 桁。" #: ../../library/datetime.rst:2585 ../../library/datetime.rst:2671 msgid "00, 01, ..., 99" @@ -4312,17 +4971,14 @@ msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2595 msgid "``%h``" -msgstr "" +msgstr "``%h``" -#: ../../library/datetime.rst:2595 msgid "Equivalent to ``%b``." -msgstr "" +msgstr "``%b`` と等価。" -#: ../../library/datetime.rst:2595 msgid "See ``%b``." -msgstr "" +msgstr "``%b`` を参照。" #: ../../library/datetime.rst:2597 msgid "``%H``" @@ -4380,15 +5036,15 @@ msgstr "0埋めした10進数で表記した分。" msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2612 msgid "``%n``" -msgstr "" +msgstr "``%n``" -#: ../../library/datetime.rst:2612 msgid "" "The newline character (``'\\n'``). For :meth:`!strptime`, zero or more " "whitespace." msgstr "" +"改行文字 (``'\\n'``)。\n" +":meth:`!strptime` では 0 個以上の空白文字。" #: ../../library/datetime.rst:2612 msgid "``\\n``" @@ -4414,33 +5070,26 @@ msgstr "am, pm (de_DE)" msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2620 msgid "``%r``" -msgstr "" +msgstr "``%r``" -#: ../../library/datetime.rst:2620 msgid "Locale's 12-hour clock time." -msgstr "" +msgstr "ロケールの 12 時間制の時刻。" -#: ../../library/datetime.rst:2620 msgid "12:00:00 AM" -msgstr "" +msgstr "12:00:00 AM" -#: ../../library/datetime.rst:2620 msgid "\\(1), \\(0)" -msgstr "" +msgstr "\\(1), \\(0)" -#: ../../library/datetime.rst:2623 msgid "``%R``" -msgstr "" +msgstr "``%R``" -#: ../../library/datetime.rst:2623 msgid "Equivalent to ``%H:%M``." -msgstr "" +msgstr "``%H:%M`` と等価。" -#: ../../library/datetime.rst:2623 msgid "10:01" -msgstr "" +msgstr "10:01" #: ../../library/datetime.rst:2625 msgid "``%S``" @@ -4454,31 +5103,28 @@ msgstr "0埋めした10進数で表記した秒。" msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2628 msgid "``%t``" -msgstr "" +msgstr "``%t``" -#: ../../library/datetime.rst:2628 msgid "" "The tab character (``'\\t'``). For :meth:`!strptime`, zero or more " "whitespace." msgstr "" +"タブ文字 (``'\\t'``)。\n" +":meth:`!strptime` では 0 個以上の空白文字。" #: ../../library/datetime.rst:2628 msgid "``\\t``" msgstr "``\\t``" -#: ../../library/datetime.rst:2632 msgid "``%T``" -msgstr "" +msgstr "``%T``" -#: ../../library/datetime.rst:2632 msgid "ISO 8601 time format, equivalent to ``%H:%M:%S``." -msgstr "" +msgstr "ISO 8601 の時刻形式で、``%H:%M:%S`` と等価。" -#: ../../library/datetime.rst:2632 msgid "10:01:59" -msgstr "" +msgstr "10:01:59" #: ../../library/datetime.rst:2635 msgid "``%u``" @@ -4656,19 +5302,23 @@ msgstr "文字 ``'%'`` を表します。" msgid "%" msgstr "%" -#: ../../library/datetime.rst:2688 msgid "" "The ISO 8601 year and ISO 8601 week directives are not interchangeable with " "the year and week number directives above. Calling :meth:`~.datetime." "strptime` with incomplete or ambiguous ISO 8601 directives will raise a :exc:" "`ValueError`." msgstr "" +"ISO 8601 の年と週の指定子は、上記の年と週番号の指定子と交換可能ではありませ" +"ん。\n" +"不完全または曖昧な ISO 8601 指定子を指定して :meth:`~.datetime.strptime` を呼" +"び出すと、:exc:`ValueError` を送出します。" -#: ../../library/datetime.rst:2692 msgid "" "Several additional directives not required by the C11 standard are included " "for convenience." msgstr "" +"利便性のために、C11 標準で必須とされていない追加の指定子もいくつか含まれてい" +"ます。" #: ../../library/datetime.rst:2698 msgid "``%f``" @@ -4723,19 +5373,18 @@ msgstr "" msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "``%G``, ``%u`` および ``%V`` が追加されました。" -#: ../../library/datetime.rst:2717 msgid "``%:z`` was added for :meth:`~.datetime.strftime`." -msgstr "" +msgstr ":meth:`~.datetime.strftime` に ``%:z`` が追加されました。" -#: ../../library/datetime.rst:2720 msgid "" "``%D``, ``%F``, ``%n``, ``%t``, and ``%:z`` were added for :meth:`~.datetime." "strptime`." msgstr "" +":meth:`~.datetime.strptime` に ``%D``、``%F``、``%n``、``%t``、``%:z`` が追加" +"されました。" -#: ../../library/datetime.rst:2726 msgid "Technical detail" -msgstr "" +msgstr "技術的な詳細" #: ../../library/datetime.rst:2728 msgid "" @@ -4747,30 +5396,38 @@ msgstr "" "strftime(fmt, d.timetuple())`` のように動作します。ただし全てのオブジェクト" "が :meth:`~date.timetuple` メソッドをサポートしているわけではありません。" -#: ../../library/datetime.rst:2732 msgid "" "For the :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods, " "the default value is ``1900-01-01T00:00:00.000``: any components not " "specified in the format string will be pulled from the default value." msgstr "" +"クラスメソッド :meth:`.datetime.strptime` と :meth:`.date.strptime` のデフォ" +"ルト値は ``1900-01-01T00:00:00.000`` です。\n" +"書式文字列で指定されていない成分には、このデフォルト値が使われます。" -#: ../../library/datetime.rst:2737 msgid "" "Format strings without separators can be ambiguous for parsing. For example, " "with ``%Y%m%d``, the string ``2026111`` may be parsed either as " "``2026-11-01`` or as ``2026-01-11``. Use separators to ensure the input is " "parsed as intended." msgstr "" +"区切り文字を含まない書式文字列は、解析時に曖昧になる場合があります。\n" +"例えば、``%Y%m%d`` を使うと、文字列 ``2026111`` は ``2026-11-01`` とも " +"``2026-01-11`` とも解析できます。\n" +"入力が意図どおりに解析されるよう、区切り文字を使用してください。" -#: ../../library/datetime.rst:2743 msgid "" "When used to parse partial dates lacking a year, :meth:`.datetime.strptime` " "and :meth:`.date.strptime` will raise when encountering February 29 because " "the default year of 1900 is *not* a leap year. Always add a default leap " "year to partial date strings before parsing." msgstr "" +"年を欠いた日付の一部を解析する際、:meth:`.datetime.strptime` と :meth:`.date." +"strptime` は 2 月 29 日に対して例外を送出します。\n" +"デフォルトの年である 1900 年がうるう年 *ではない* ためです。\n" +"日付の一部を表す文字列には、解析する前に必ずデフォルトのうるう年を追加してく" +"ださい。" -#: ../../library/datetime.rst:2763 msgid "" ">>> import datetime as dt\n" ">>> value = \"2/29\"\n" @@ -4781,30 +5438,38 @@ msgid "" ">>> dt.datetime.strptime(f\"1904 {value}\", \"%Y %m/%d\")\n" "datetime.datetime(1904, 2, 29, 0, 0)" msgstr "" +">>> import datetime as dt\n" +">>> value = \"2/29\"\n" +">>> dt.datetime.strptime(value, \"%m/%d\")\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: day 29 must be in range 1..28 for month 2 in year 1900\n" +">>> dt.datetime.strptime(f\"1904 {value}\", \"%Y %m/%d\")\n" +"datetime.datetime(1904, 2, 29, 0, 0)" #: ../../library/datetime.rst:2774 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "``datetime.strptime(date_string, format)`` は次の式と等価です::" -#: ../../library/datetime.rst:2778 msgid "" "except when the format includes sub-second components or time zone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -"ただし、 ``datetime.strptime`` はサポートしているが ``time.strptime`` には無" -"い、秒未満の単位やタイムゾーンオフセットの情報が format に 含まれているときは" -"除きます。" +"ただし、書式 ``format`` に秒未満の成分やタイムゾーンオフセットの情報が含まれ" +"る場合は除きます。\n" +"これらの情報は ``datetime.strptime`` ではサポートされますが、``time." +"strptime`` では破棄されます。" -#: ../../library/datetime.rst:2782 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`!time` objects have no such values. If they're used " "anyway, 1900 is substituted for the year, and 1 for the month and day." msgstr "" -":class:`.time` オブジェクトには、年、月、日の値がないため、それらを書式コード" -"を使うことができません。\n" -"無理矢理使った場合、年は1900に置き換えられ、月と日は1に置き換えられます。" +":class:`.time` オブジェクトでは、年、月、日の書式コードは使用すべきではありま" +"せん。\n" +":class:`!time` オブジェクトはこれらの値を持たないためです。\n" +"使用した場合、年には 1900、月と日には 1 が代入されます。" #: ../../library/datetime.rst:2786 msgid "" @@ -4830,18 +5495,22 @@ msgstr "" "方、他のプラットフォームでは ``strftime`` が :exc:`UnicodeError` を送出した" "り、その代わりに空文字列を返したりするかもしれません。" -#: ../../library/datetime.rst:2799 msgid "" "This format code is currently unsupported by :meth:`~.datetime.strptime`." msgstr "" +"この書式コードは、現在 :meth:`~.datetime.strptime` ではサポートされていませ" +"ん。" -#: ../../library/datetime.rst:2802 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " "example, \"month/day/year\" versus \"day/month/year\"), and the output may " "contain non-ASCII characters." msgstr "" +"書式は現在のロケールに依存するため、出力値について仮定する際は注意してくださ" +"い。\n" +"フィールドの順序は (例えば「月/日/年」と「日/月/年」のように) 異なり、出力に" +"非 ASCII 文字が含まれる場合があります。" #: ../../library/datetime.rst:2808 msgid "" @@ -4931,7 +5600,6 @@ msgstr "" "例えば、 :meth:`~.datetime.utcoffset` が ``timedelta(hours=-3, " "minutes=-30)`` を返す場合、 ``%z`` は文字列 ``'-0330'`` に置き換えられます。" -#: ../../library/datetime.rst:2855 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, the UTC offsets can have a colon as a separator between hours, " @@ -4939,20 +5607,30 @@ msgid "" "will be parsed as an offset of one hour. In addition, providing ``'Z'`` is " "identical to ``'+00:00'``." msgstr "" +":meth:`~.datetime.strptime` メソッドに ``%z`` 指定子を指定した場合、UTC オフ" +"セットの時、分、秒の区切りにコロンを使えるようになりました。\n" +"例えば、``'+010000'`` と ``'+01:00:00'`` はどちらも 1 時間のオフセットとして" +"解析されます。\n" +"また、``'Z'`` の指定は ``'+00:00'`` と等価です。" -#: ../../library/datetime.rst:2863 msgid "" "When used with :meth:`~.datetime.strftime`, behaves exactly as ``%z``, " "except that a colon separator is added between hours, minutes and seconds." msgstr "" +":meth:`~.datetime.strftime` で使用すると、時、分、秒の間にコロン区切りが追加" +"される点を除き、``%z`` とまったく同じように動作します。" -#: ../../library/datetime.rst:2866 msgid "" "When used with :meth:`~.datetime.strptime`, the UTC offset is *required* to " "have a colon as a separator between hours, minutes and seconds. For example, " "``'+01:00:00'`` (but *not* ``'+010000'``) will be parsed as an offset of one " "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" +":meth:`~.datetime.strptime` で使用する場合、UTC オフセットの時、分、秒の区切" +"りにはコロンが *必須* です。\n" +"例えば、``'+01:00:00'`` は 1 時間のオフセットとして解析されますが、" +"``'+010000'`` は解析 *されません*。\n" +"また、``'Z'`` の指定は ``'+00:00'`` と等価です。" #: ../../library/datetime.rst:2873 msgid "" @@ -5028,7 +5706,6 @@ msgstr "" "任意です。\n" "書式 ``%y`` では先行ゼロは必須です。" -#: ../../library/datetime.rst:2908 msgid "" "When parsing a month and day using :meth:`~.datetime.strptime`, always " "include a year in the format. If the value you need to parse lacks a year, " @@ -5036,32 +5713,41 @@ msgid "" "exception when it encounters leap day because the default year used by the " "parser (1900) is not a leap year. Users run into that bug every leap year." msgstr "" +":meth:`~.datetime.strptime` で月と日を解析する場合は、常に書式に年を含めてく" +"ださい。\n" +"解析する値に年がない場合は、ダミーのうるう年を明示的に追加してください。\n" +"そうしないと、パーサが使用するデフォルトの年 (1900 年) はうるう年ではないた" +"め、コードがうるう日に対して例外を送出します。\n" +"ユーザーはうるう年ごとにこのバグに遭遇します。" -#: ../../library/datetime.rst:2914 msgid "" ">>> month_day = \"02/29\"\n" ">>> dt.datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap " "year bug.\n" "datetime.datetime(1984, 2, 29, 0, 0)" msgstr "" +">>> month_day = \"02/29\"\n" +">>> dt.datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # うるう年のバ" +"グは起きない。\n" +"datetime.datetime(1984, 2, 29, 0, 0)" -#: ../../library/datetime.rst:2920 msgid "Using ``%d`` without a year now raises :exc:`ValueError`." msgstr "" +"年なしで ``%d`` を使用すると、:exc:`ValueError` を送出するようになりました。" -#: ../../library/datetime.rst:2923 msgid "" ":meth:`~.datetime.strptime` calls using a format string containing ``%e`` " "without a year now emit a :exc:`DeprecationWarning`." msgstr "" +"年なしで ``%e`` を含む書式文字列を使用して :meth:`~.datetime.strptime` を呼び" +"出すと、:exc:`DeprecationWarning` を出すようになりました。" #: ../../library/datetime.rst:2928 msgid "Footnotes" msgstr "脚注" -#: ../../library/datetime.rst:2929 msgid "If, that is, we ignore the effects of relativity." -msgstr "" +msgstr "ただし、相対論の効果を無視した場合です。" #: ../../library/datetime.rst:2931 msgid "" @@ -5091,6 +5777,5 @@ msgstr "" msgid "% (percent)" msgstr "% (パーセント)" -#: ../../library/datetime.rst:2493 msgid "datetime format" -msgstr "" +msgstr "日時の書式" diff --git a/library/dbm.po b/library/dbm.po index 4f01d6eef..fc8e283d2 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -31,36 +31,39 @@ msgstr ":mod:`!dbm` --- Unix \"データベース\" へのインターフェー msgid "**Source code:** :source:`Lib/dbm/__init__.py`" msgstr "**ソースコード:** :source:`Lib/dbm/__init__.py`" -#: ../../library/dbm.rst:11 msgid ":mod:`!dbm` is a generic interface to variants of the DBM database:" msgstr "" +":mod:`!dbm` は DBM データベースの各種実装に対する汎用インターフェースです:" -#: ../../library/dbm.rst:13 msgid ":mod:`dbm.sqlite3`" -msgstr "" +msgstr ":mod:`dbm.sqlite3`" -#: ../../library/dbm.rst:14 msgid ":mod:`dbm.gnu`" -msgstr "" +msgstr ":mod:`dbm.gnu`" -#: ../../library/dbm.rst:15 msgid ":mod:`dbm.ndbm`" -msgstr "" +msgstr ":mod:`dbm.ndbm`" -#: ../../library/dbm.rst:17 msgid "" "If none of these modules are installed, the slow-but-simple implementation " "in module :mod:`dbm.dumb` will be used. There is a `third party interface " "`_ to the Oracle Berkeley DB." msgstr "" +"これらのモジュールがどれもインストールされていない場合は、低速ながら単純な :" +"mod:`dbm.dumb` モジュールの実装を使います。\n" +"Oracle Berkeley DB には `サードパーティー製インターフェース `_ があります。" -#: ../../library/dbm.rst:23 msgid "" "None of the underlying modules will automatically shrink the disk space used " "by the database file. However, :mod:`dbm.sqlite3`, :mod:`dbm.gnu` and :mod:" "`dbm.dumb` provide a :meth:`!reorganize` method that can be used for this " "purpose." msgstr "" +"内部で使うモジュールはどれも、データベースファイルが使うディスク領域を自動で" +"は縮小しません。\n" +"ただし :mod:`dbm.sqlite3`、:mod:`dbm.gnu`、:mod:`dbm.dumb` には、領域の縮小に" +"使える :meth:`!reorganize` メソッドがあります。" #: ../../library/dbm.rst:30 msgid "" @@ -73,99 +76,90 @@ msgstr "" "error` という名前の例外が含まれます --- :exc:`dbm.error` が送出される場合、後" "者(訳注:タプルの ``dbm.error`` ではなく例外 ``dbm.error``)が使用されます。" -#: ../../library/dbm.rst:37 msgid "" "This function attempts to guess which of the several simple database modules " "available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or :mod:" "`dbm.dumb` --- should be used to open a given file." msgstr "" +"指定されたファイルを開くために、利用可能な単純なデータベースモジュール :mod:" +"`dbm.sqlite3`、:mod:`dbm.gnu`、:mod:`dbm.ndbm`、:mod:`dbm.dumb` のどれを使う" +"べきか推測します。" -#: ../../library/dbm.rst:41 msgid "Return one of the following values:" -msgstr "" +msgstr "次のいずれかの値を返します:" -#: ../../library/dbm.rst:43 msgid "" "``None`` if the file can't be opened because it's unreadable or doesn't exist" -msgstr "" +msgstr "ファイルが読み取り不能か存在しないため開けない場合は ``None``" -#: ../../library/dbm.rst:44 msgid "the empty string (``''``) if the file's format can't be guessed" -msgstr "" +msgstr "ファイル形式を推測できない場合は空文字列 (``''``)" -#: ../../library/dbm.rst:45 msgid "" "a string containing the required module name, such as ``'dbm.ndbm'`` or " "``'dbm.gnu'``" -msgstr "" +msgstr "``'dbm.ndbm'`` や ``'dbm.gnu'`` など、必要なモジュール名の文字列" -#: ../../library/dbm.rst:47 ../../library/dbm.rst:288 ../../library/dbm.rst:499 msgid "*filename* accepts a :term:`path-like object`." -msgstr "" +msgstr "*filename* に :term:`path-like object` を渡せるようになりました。" -#: ../../library/dbm.rst:71 msgid "Open a database and return the corresponding database object." -msgstr "" +msgstr "データベースを開き、対応するデータベースオブジェクトを返します。" #: ../../library/dbm.rst:0 msgid "Parameters" msgstr "パラメーター" -#: ../../library/dbm.rst:73 msgid "" "The database file to open. If the database file already exists, the :func:" "`whichdb` function is used to determine its type and the appropriate module " "is used; if it does not exist, the first submodule listed above that can be " "imported is used." msgstr "" +"開くデータベースファイル。\n" +"データベースファイルがすでに存在する場合は :func:`whichdb` 関数で種類を判定" +"し、適切なモジュールを使います。\n" +"存在しない場合は、上に挙げたサブモジュールのうち最初にインポートできたものを" +"使います。" -#: ../../library/dbm.rst:74 ../../library/dbm.rst:260 msgid "The database file to open." -msgstr "" +msgstr "開くデータベースファイル。" -#: ../../library/dbm.rst:76 msgid "" "If the database file already exists, the :func:`whichdb` function is used to " "determine its type and the appropriate module is used; if it does not exist, " "the first submodule listed above that can be imported is used." msgstr "" +"データベースファイルがすでに存在する場合は :func:`whichdb` 関数で種類を判定" +"し、適切なモジュールを使います。\n" +"存在しない場合は、上に挙げたサブモジュールのうち最初にインポートできたものを" +"使います。" -#: ../../library/dbm.rst:81 ../../library/dbm.rst:187 ../../library/dbm.rst:397 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" msgstr "" +"* ``'r'`` (デフォルト): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n|" -#: ../../library/dbm.rst:82 ../../library/dbm.rst:189 ../../library/dbm.rst:265 -#: ../../library/dbm.rst:398 msgid "``'r'`` (default): |flag_r|" -msgstr "" +msgstr "``'r'`` (デフォルト): |flag_r|" -#: ../../library/dbm.rst:83 ../../library/dbm.rst:190 ../../library/dbm.rst:266 -#: ../../library/dbm.rst:399 ../../library/dbm.rst:475 msgid "``'w'``: |flag_w|" -msgstr "" +msgstr "``'w'``: |flag_w|" -#: ../../library/dbm.rst:84 ../../library/dbm.rst:191 ../../library/dbm.rst:267 -#: ../../library/dbm.rst:400 msgid "``'c'``: |flag_c|" -msgstr "" +msgstr "``'c'``: |flag_c|" -#: ../../library/dbm.rst:85 ../../library/dbm.rst:192 ../../library/dbm.rst:268 -#: ../../library/dbm.rst:401 ../../library/dbm.rst:477 msgid "``'n'``: |flag_n|" -msgstr "" +msgstr "``'n'``: |flag_n|" -#: ../../library/dbm.rst:87 ../../library/dbm.rst:282 ../../library/dbm.rst:403 -#: ../../library/dbm.rst:479 msgid "|mode_param_doc|" -msgstr "" +msgstr "|mode_param_doc|" -#: ../../library/dbm.rst:90 msgid "*file* accepts a :term:`path-like object`." -msgstr "" +msgstr "*file* に :term:`path-like object` を渡せるようになりました。" -#: ../../library/dbm.rst:93 msgid "" "The object returned by :func:`~dbm.open` supports the basic functionality of " "mutable :term:`mappings `; keys and their corresponding values can " @@ -174,6 +168,13 @@ msgid "" "clear` are available. The :meth:`!keys` method returns a list instead of a " "view object. The :meth:`!setdefault` method requires two arguments." msgstr "" +":func:`~dbm.open` が返すオブジェクトは、ミュータブルな :term:`マッピング " +"` の基本的な機能に対応しています。\n" +"キーとそれに対応する値の保存、取得、削除に加え、イテレーション、:keyword:" +"`in` 演算子、:meth:`!keys`、:meth:`!get`、:meth:`!setdefault`、:meth:`!" +"clear` メソッドを利用できます。\n" +":meth:`!keys` メソッドはビューオブジェクトではなくリストを返します。\n" +":meth:`!setdefault` メソッドには引数が 2 つ必要です。" #: ../../library/dbm.rst:101 msgid "" @@ -190,27 +191,31 @@ msgstr "" "これらのオブジェクトは、 :keyword:`with` 文での使用にも対応しています。with " "文を使用した場合、終了時に自動的に閉じられます。" -#: ../../library/dbm.rst:108 msgid "" ":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" "`!dbm` backends." msgstr "" +"すべての :mod:`!dbm` バックエンドで :meth:`!get` と :meth:`!setdefault` メ" +"ソッドが使えるようになりました。" -#: ../../library/dbm.rst:112 msgid "" "Added native support for the context management protocol to the objects " "returned by :func:`~dbm.open`." msgstr "" +":func:`~dbm.open` が返すオブジェクトに、コンテキスト管理プロトコルのネイティ" +"ブサポートを追加しました。" -#: ../../library/dbm.rst:116 msgid "" "Deleting a key from a read-only database raises a database module specific " "exception instead of :exc:`KeyError`." msgstr "" +"読み取り専用データベースからキーを削除すると、:exc:`KeyError` ではなくデータ" +"ベースモジュール固有の例外を送出するようになりました。" -#: ../../library/dbm.rst:120 msgid ":meth:`!clear` methods are now available for all :mod:`!dbm` backends." msgstr "" +"すべての :mod:`!dbm` バックエンドで :meth:`!clear` メソッドが使えるようになり" +"ました。" #: ../../library/dbm.rst:124 msgid "" @@ -259,21 +264,22 @@ msgstr "非文字列データを記録する永続化モジュール。" msgid "The individual submodules are described in the following sections." msgstr "個々のサブモジュールは以降の節で説明されます。" -#: ../../library/dbm.rst:161 msgid ":mod:`!dbm.sqlite3` --- SQLite backend for dbm" -msgstr "" +msgstr ":mod:`!dbm.sqlite3` --- dbm の SQLite バックエンド" -#: ../../library/dbm.rst:168 msgid "**Source code:** :source:`Lib/dbm/sqlite3.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/dbm/sqlite3.py`" -#: ../../library/dbm.rst:172 msgid "" "This module uses the standard library :mod:`sqlite3` module to provide an " "SQLite backend for the :mod:`!dbm` module. The files created by :mod:`!dbm." "sqlite3` can thus be opened by :mod:`sqlite3`, or any other SQLite browser, " "including the SQLite CLI." msgstr "" +"このモジュールは標準ライブラリの :mod:`sqlite3` モジュールを使い、:mod:`!" +"dbm` モジュール用の SQLite バックエンドを提供します。\n" +"したがって :mod:`!dbm.sqlite3` で作成したファイルは :mod:`sqlite3` や、" +"SQLite CLI を含む他の SQLite ブラウザーで開けます。" msgid "Availability" msgstr "利用可能な環境" @@ -286,72 +292,80 @@ msgstr "" "このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" "`wasm-availability` を見てください。" -#: ../../library/dbm.rst:181 msgid "Open an SQLite database." -msgstr "" +msgstr "SQLite データベースを開きます。" -#: ../../library/dbm.rst:183 msgid "The path to the database to be opened." -msgstr "" +msgstr "開くデータベースのパス。" -#: ../../library/dbm.rst:194 msgid "" "The Unix file access mode of the file (default: octal ``0o666``), used only " "when the database has to be created." msgstr "" +"ファイルの Unix アクセスモード (デフォルトは 8 進数の ``0o666``)。\n" +"データベースを新規作成する必要がある場合にのみ使います。" -#: ../../library/dbm.rst:198 msgid "" "The returned database object behaves similar to a mutable :term:`mapping`, " "but the :meth:`!keys` method returns a list, and the :meth:`!setdefault` " "method requires two arguments. It also supports a \"closing\" context " "manager via the :keyword:`with` keyword." msgstr "" +"返されるデータベースオブジェクトはミュータブルな :term:`mapping` に似ています" +"が、:meth:`!keys` メソッドはリストを返し、:meth:`!setdefault` メソッドには引" +"数が 2 つ必要です。\n" +"また :keyword:`with` キーワードによって、終了時にデータベースを閉じるコンテキ" +"ストマネージャとして使えます。" -#: ../../library/dbm.rst:203 ../../library/dbm.rst:304 -#: ../../library/dbm.rst:507 msgid "The following methods are also provided:" -msgstr "" +msgstr "次のメソッドも提供します:" -#: ../../library/dbm.rst:207 msgid "Close the SQLite database." -msgstr "" +msgstr "SQLite データベースを閉じます。" -#: ../../library/dbm.rst:211 msgid "" "If you have carried out a lot of deletions and would like to shrink the " "space used on disk, this method will reorganize the database; otherwise, " "deleted file space will be kept and reused as new (key, value) pairs are " "added." msgstr "" +"多数の削除を行った後、ディスク上の使用領域を縮小したい場合に、このメソッドで" +"データベースを再編成できます。\n" +"再編成しない場合、削除されたファイル領域はそのまま残り、新しい (key, value) " +"ペアを追加したときに再利用されます。" -#: ../../library/dbm.rst:216 msgid "" "While reorganizing, as much as two times the size of the original database " "is required in free disk space. However, be aware that this factor changes " "for each :mod:`!dbm` submodule." msgstr "" +"再編成中は、元のデータベースのサイズの最大 2 倍の空きディスク領域が必要で" +"す。\n" +"ただし、この倍率は :mod:`!dbm` のサブモジュールごとに異なります。" -#: ../../library/dbm.rst:223 msgid ":mod:`!dbm.gnu` --- GNU database manager" -msgstr "" +msgstr ":mod:`!dbm.gnu` --- GNU データベースマネージャ" #: ../../library/dbm.rst:228 msgid "**Source code:** :source:`Lib/dbm/gnu.py`" msgstr "**ソースコード:** :source:`Lib/dbm/gnu.py`" -#: ../../library/dbm.rst:232 msgid "" "The :mod:`!dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " "dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " "functionality like crash tolerance." msgstr "" +":mod:`!dbm.gnu` モジュールは :abbr:`GDBM (GNU dbm)` ライブラリへのインター" +"フェースを提供します。\n" +":mod:`dbm.ndbm` モジュールに似ていますが、クラッシュへの耐性などの機能が追加" +"されています。" -#: ../../library/dbm.rst:238 msgid "" "The file formats created by :mod:`!dbm.gnu` and :mod:`dbm.ndbm` are " "incompatible and can not be used interchangeably." msgstr "" +":mod:`!dbm.gnu` と :mod:`dbm.ndbm` が作成するファイル形式には互換性がなく、相" +"互に利用できません。" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" @@ -361,24 +375,24 @@ msgstr "" "このモジュールは :ref:`モバイルプラットフォーム ` と :" "ref:`WebAssemblyプラットフォーム ` をサポートしません。" -#: ../../library/dbm.rst:247 msgid "" "Raised on :mod:`!dbm.gnu`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" +"I/O エラーなど、:mod:`!dbm.gnu` 固有のエラーで送出されます。\n" +"不正なキーの指定など、一般的なマッピングのエラーでは :exc:`KeyError` を送出し" +"ます。" -#: ../../library/dbm.rst:253 msgid "" "A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " "supports." msgstr "" +":meth:`~dbm.gnu.open` の *flag* パラメーターが受け付ける文字を並べた文字列。" -#: ../../library/dbm.rst:258 msgid "Open a GDBM database and return a :class:`!gdbm` object." -msgstr "" +msgstr "GDBM データベースを開き、:class:`!gdbm` オブジェクトを返します。" -#: ../../library/dbm.rst:264 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n| The following additional characters may be appended to " @@ -389,44 +403,57 @@ msgid "" "versions of GDBM. See the :data:`open_flags` member for a list of supported " "flag characters." msgstr "" +"* ``'r'`` (デフォルト): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n|\n" +"\n" +"次の文字を追加して、データベースを開く方法を制御できます:\n" +"\n" +"* ``'f'``: 高速モードでデータベースを開きます。\n" +" データベースへの書き込みは同期されません。\n" +"* ``'s'``: 同期モード。\n" +" データベースへの変更は直ちにファイルに書き込まれます。\n" +"* ``'u'``: データベースをロックしません。\n" +"\n" +"すべてのフラグが GDBM のすべてのバージョンで有効とは限りません。\n" +"サポートするフラグ文字の一覧は :data:`open_flags` メンバーを参照してくださ" +"い。" -#: ../../library/dbm.rst:270 msgid "" "The following additional characters may be appended to control how the " "database is opened:" -msgstr "" +msgstr "次の文字を追加して、データベースを開く方法を制御できます:" -#: ../../library/dbm.rst:273 msgid "" "``'f'``: Open the database in fast mode. Writes to the database will not be " "synchronized." msgstr "" +"``'f'``: 高速モードでデータベースを開きます。\n" +"データベースへの書き込みは同期されません。" -#: ../../library/dbm.rst:275 msgid "" "``'s'``: Synchronized mode. Changes to the database will be written " "immediately to the file." msgstr "" +"``'s'``: 同期モード。\n" +"データベースへの変更は直ちにファイルに書き込まれます。" -#: ../../library/dbm.rst:277 msgid "``'u'``: Do not lock database." -msgstr "" +msgstr "``'u'``: データベースをロックしません。" -#: ../../library/dbm.rst:279 msgid "" "Not all flags are valid for all versions of GDBM. See the :data:`open_flags` " "member for a list of supported flag characters." msgstr "" +"すべてのフラグが GDBM のすべてのバージョンで有効とは限りません。\n" +"サポートするフラグ文字の一覧は :data:`open_flags` メンバーを参照してくださ" +"い。" -#: ../../library/dbm.rst:0 msgid "Raises" -msgstr "" +msgstr "送出される例外" -#: ../../library/dbm.rst:285 msgid "If an invalid *flag* argument is passed." -msgstr "" +msgstr "不正な *flag* 引数が渡された場合。" -#: ../../library/dbm.rst:291 msgid "" ":class:`!gdbm` objects behave similar to mutable :term:`mappings `, " "but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, :meth:`!popitem`, " @@ -434,26 +461,33 @@ msgid "" "list, and the :meth:`!setdefault` method requires two arguments. It also " "supports a \"closing\" context manager via the :keyword:`with` keyword." msgstr "" +":class:`!gdbm` オブジェクトはミュータブルな :term:`マッピング ` に似" +"ていますが、:meth:`!items`、:meth:`!values`、:meth:`!pop`、:meth:`!" +"popitem`、:meth:`!update` メソッドはサポートしていません。\n" +":meth:`!keys` メソッドはリストを返し、:meth:`!setdefault` メソッドには引数が " +"2 つ必要です。\n" +"また :keyword:`with` キーワードによって、終了時にデータベースを閉じるコンテキ" +"ストマネージャとして使えます。" -#: ../../library/dbm.rst:298 ../../library/dbm.rst:416 msgid "Added the :meth:`!get` and :meth:`!setdefault` methods." -msgstr "" +msgstr ":meth:`!get` と :meth:`!setdefault` メソッドを追加しました。" -#: ../../library/dbm.rst:301 ../../library/dbm.rst:419 msgid "Added the :meth:`!clear` method." -msgstr "" +msgstr ":meth:`!clear` メソッドを追加しました。" -#: ../../library/dbm.rst:308 msgid "Close the GDBM database." -msgstr "" +msgstr "GDBM データベースを閉じます。" -#: ../../library/dbm.rst:312 msgid "" "It's possible to loop over every key in the database using this method and " "the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " "hash values, and won't be sorted by the key values. This method returns the " "starting key." msgstr "" +"このメソッドと :meth:`nextkey` メソッドを使って、データベースのすべてのキーを" +"順にたどれます。\n" +"走査の順序は GDBM 内部のハッシュ値に基づき、キーの値の順には並びません。\n" +"このメソッドは最初のキーを返します。" #: ../../library/dbm.rst:319 msgid "" @@ -465,15 +499,17 @@ msgstr "" "コードはデータベース ``db`` について、キー全てを含むリストをメモリ上に生成す" "ることなく全てのキーを出力します::" -#: ../../library/dbm.rst:323 msgid "" "k = db.firstkey()\n" "while k is not None:\n" " print(k)\n" " k = db.nextkey(k)" msgstr "" +"k = db.firstkey()\n" +"while k is not None:\n" +" print(k)\n" +" k = db.nextkey(k)" -#: ../../library/dbm.rst:330 msgid "" "If you have carried out a lot of deletions and would like to shrink the " "space used by the GDBM file, this routine will reorganize the database. :" @@ -481,13 +517,21 @@ msgid "" "by using this reorganization; otherwise, deleted file space will be kept and " "reused as new (key, value) pairs are added." msgstr "" +"多数の削除を行った後、GDBM ファイルの使用領域を縮小したい場合に、このルーチン" +"でデータベースを再編成できます。\n" +":class:`!gdbm` オブジェクトは、この再編成以外の方法ではデータベースファイルの" +"長さを縮めません。\n" +"再編成しない場合、削除されたファイル領域はそのまま残り、新しい (key, value) " +"ペアを追加したときに再利用されます。" -#: ../../library/dbm.rst:337 msgid "" "While reorganizing, as much as one time the size of the original database is " "required in free disk space. However, be aware that this factor changes for " "each :mod:`!dbm` submodule." msgstr "" +"再編成中は、元のデータベースと同じサイズの空きディスク領域が必要になる場合が" +"あります。\n" +"ただし、この倍率は :mod:`!dbm` のサブモジュールごとに異なります。" #: ../../library/dbm.rst:342 msgid "" @@ -497,61 +541,69 @@ msgstr "" "データベースが高速モードで開かれていた場合、このメソッドはディスクにまだ書き" "込まれていないデータを全て書き込ませます。" -#: ../../library/dbm.rst:347 msgid ":mod:`!dbm.ndbm` --- New Database Manager" -msgstr "" +msgstr ":mod:`!dbm.ndbm` --- New Database Manager" #: ../../library/dbm.rst:352 msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" msgstr "**ソースコード:** :source:`Lib/dbm/ndbm.py`" -#: ../../library/dbm.rst:356 msgid "" "The :mod:`!dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " "Database Manager)` library. This module can be used with the \"classic\" " "NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." msgstr "" +":mod:`!dbm.ndbm` モジュールは :abbr:`NDBM (New Database Manager)` ライブラリ" +"へのインターフェースを提供します。\n" +"このモジュールは「従来の」NDBM インターフェースでも :abbr:`GDBM (GNU dbm)` の" +"互換インターフェースでも利用できます。" -#: ../../library/dbm.rst:363 msgid "" "The file formats created by :mod:`dbm.gnu` and :mod:`!dbm.ndbm` are " "incompatible and can not be used interchangeably." msgstr "" +":mod:`dbm.gnu` と :mod:`!dbm.ndbm` が作成するファイル形式には互換性がなく、相" +"互に利用できません。" -#: ../../library/dbm.rst:368 msgid "" "The NDBM library shipped as part of macOS has an undocumented limitation on " "the size of values, which can result in corrupted database files when " "storing values larger than this limit. Reading such corrupted files can " "result in a hard crash (segmentation fault)." msgstr "" +"macOS に付属する NDBM ライブラリには、値のサイズに関する文書化されていない制" +"限があります。\n" +"この制限より大きな値を保存すると、データベースファイルが破損することがありま" +"す。\n" +"破損したファイルを読み取ると、プログラムがクラッシュ (セグメンテーション" +"フォールト) することがあります。" -#: ../../library/dbm.rst:379 msgid "" "Raised on :mod:`!dbm.ndbm`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" +"I/O エラーなど、:mod:`!dbm.ndbm` 固有のエラーで送出されます。\n" +"不正なキーの指定など、一般的なマッピングのエラーでは :exc:`KeyError` を送出し" +"ます。" -#: ../../library/dbm.rst:385 msgid "Name of the NDBM implementation library used." -msgstr "" +msgstr "使用している NDBM 実装ライブラリの名前。" -#: ../../library/dbm.rst:390 msgid "Open an NDBM database and return an :class:`!ndbm` object." -msgstr "" +msgstr "NDBM データベースを開き、:class:`!ndbm` オブジェクトを返します。" -#: ../../library/dbm.rst:392 msgid "" "The basename of the database file (without the :file:`.dir` or :file:`.pag` " "extensions)." msgstr "" +"データベースファイルのベース名 (:file:`.dir` や :file:`.pag` 拡張子は含めませ" +"ん)。" -#: ../../library/dbm.rst:406 msgid "Accepts :term:`path-like object` for filename." msgstr "" +"ファイル名として :term:`path-like object` を受け付けるようになりました。" -#: ../../library/dbm.rst:409 msgid "" ":class:`!ndbm` objects behave similar to mutable :term:`mappings `, " "but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, :meth:`!popitem`, " @@ -559,87 +611,100 @@ msgid "" "list, and the :meth:`!setdefault` method requires two arguments. It also " "supports a \"closing\" context manager via the :keyword:`with` keyword." msgstr "" +":class:`!ndbm` オブジェクトはミュータブルな :term:`マッピング ` に似" +"ていますが、:meth:`!items`、:meth:`!values`、:meth:`!pop`、:meth:`!" +"popitem`、:meth:`!update` メソッドはサポートしていません。\n" +":meth:`!keys` メソッドはリストを返し、:meth:`!setdefault` メソッドには引数が " +"2 つ必要です。\n" +"また :keyword:`with` キーワードによって、終了時にデータベースを閉じるコンテキ" +"ストマネージャとして使えます。" #: ../../library/dbm.rst:422 msgid "The following method is also provided:" msgstr "次のメソッドを提供しています:" -#: ../../library/dbm.rst:426 msgid "Close the NDBM database." -msgstr "" +msgstr "NDBM データベースを閉じます。" -#: ../../library/dbm.rst:430 msgid ":mod:`!dbm.dumb` --- Portable DBM implementation" -msgstr "" +msgstr ":mod:`!dbm.dumb` --- 移植性のある DBM 実装" #: ../../library/dbm.rst:435 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "**ソースコード:** :source:`Lib/dbm/dumb.py`" -#: ../../library/dbm.rst:441 msgid "" "The :mod:`!dbm.dumb` module is intended as a last resort fallback for the :" "mod:`!dbm` module when a more robust module is not available. The :mod:`!dbm." "dumb` module is not written for speed and is not nearly as heavily used as " "the other database modules." msgstr "" +":mod:`!dbm.dumb` モジュールは、より堅牢なモジュールを利用できないときに :mod:" +"`!dbm` モジュールが最後の手段として使うためのものです。\n" +":mod:`!dbm.dumb` モジュールは速度を重視しておらず、他のデータベースモジュール" +"ほど広く利用されていません。" -#: ../../library/dbm.rst:448 msgid "" "The :mod:`!dbm.dumb` module provides a persistent :class:`dict`-like " "interface which is written entirely in Python. Unlike other :mod:`!dbm` " "backends, such as :mod:`dbm.gnu`, no external library is required." msgstr "" +":mod:`!dbm.dumb` モジュールは、すべて Python で書かれた、永続的な :class:" +"`dict` に似たインターフェースを提供します。\n" +":mod:`dbm.gnu` などの他の :mod:`!dbm` バックエンドとは異なり、外部ライブラリ" +"は不要です。" -#: ../../library/dbm.rst:453 msgid "The :mod:`!dbm.dumb` module defines the following:" -msgstr "" +msgstr ":mod:`!dbm.dumb` モジュールは以下を定義しています:" -#: ../../library/dbm.rst:457 msgid "" "Raised on :mod:`!dbm.dumb`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" +"I/O エラーなど、:mod:`!dbm.dumb` 固有のエラーで送出されます。\n" +"不正なキーの指定など、一般的なマッピングのエラーでは :exc:`KeyError` を送出し" +"ます。" -#: ../../library/dbm.rst:463 msgid "Open a :mod:`!dbm.dumb` database." -msgstr "" +msgstr ":mod:`!dbm.dumb` データベースを開きます。" -#: ../../library/dbm.rst:465 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files: - :file:`{filename}.dat` - :file:`{filename}." "dir`" msgstr "" +"データベースファイルのベース名 (拡張子は含めません)。\n" +"新しいデータベースを作ると、次のファイルが作成されます:\n" +"\n" +"- :file:`{filename}.dat`\n" +"- :file:`{filename}.dir`" -#: ../../library/dbm.rst:466 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files:" msgstr "" +"データベースファイルのベース名 (拡張子は含めません)。\n" +"新しいデータベースを作ると、次のファイルが作成されます:" -#: ../../library/dbm.rst:469 msgid ":file:`{filename}.dat`" -msgstr "" +msgstr ":file:`{filename}.dat`" -#: ../../library/dbm.rst:470 msgid ":file:`{filename}.dir`" -msgstr "" +msgstr ":file:`{filename}.dir`" -#: ../../library/dbm.rst:473 msgid "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" msgstr "" +"* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (デフォルト): |flag_c| * " +"``'n'``: |flag_n|" -#: ../../library/dbm.rst:474 msgid "``'r'``: |flag_r|" -msgstr "" +msgstr "``'r'``: |flag_r|" -#: ../../library/dbm.rst:476 msgid "``'c'`` (default): |flag_c|" -msgstr "" +msgstr "``'c'`` (デフォルト): |flag_c|" #: ../../library/dbm.rst:483 msgid "" @@ -651,54 +716,67 @@ msgstr "" "るときに、 Python の抽象構文木コンパイラのスタックの深さの限界を越えるせい" "で、 Python インタプリタをクラッシュさせることができます。" -#: ../../library/dbm.rst:488 msgid "" ":mod:`!dbm.dumb` does not support concurrent read/write access. (Multiple " "simultaneous read accesses are safe.) When a program has the database open " "for writing, no other program should have it open for reading or writing." msgstr "" +":mod:`!dbm.dumb` は読み書きの同時アクセスをサポートしていません (複数の読み取" +"りアクセスを同時に行うのは安全です)。\n" +"あるプログラムが書き込み用にデータベースを開いている間は、他のプログラムでそ" +"のデータベースを読み取り用にも書き込み用にも開かないでください。" -#: ../../library/dbm.rst:492 msgid "" ":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." msgstr "" +"*flag* が ``'n'`` の場合、:func:`~dbm.dumb.open` は常に新しいデータベースを作" +"成するようになりました。" -#: ../../library/dbm.rst:495 msgid "" "A database opened read-only if *flag* is ``'r'``. A database is not created " "if it does not exist if *flag* is ``'r'`` or ``'w'``." msgstr "" +"*flag* が ``'r'`` の場合は読み取り専用でデータベースを開きます。\n" +"*flag* が ``'r'`` または ``'w'`` でデータベースが存在しない場合、新規作成しな" +"くなりました。" -#: ../../library/dbm.rst:502 msgid "" "The returned database object behaves similar to a mutable :term:`mapping`, " "but the :meth:`!keys` and :meth:`!items` methods return lists, and the :meth:" "`!setdefault` method requires two arguments. It also supports a \"closing\" " "context manager via the :keyword:`with` keyword." msgstr "" +"返されるデータベースオブジェクトはミュータブルな :term:`mapping` に似ています" +"が、:meth:`!keys` と :meth:`!items` メソッドはリストを返し、:meth:`!" +"setdefault` メソッドには引数が 2 つ必要です。\n" +"また :keyword:`with` キーワードによって、終了時にデータベースを閉じるコンテキ" +"ストマネージャとして使えます。" -#: ../../library/dbm.rst:511 msgid "Close the database." -msgstr "" +msgstr "データベースを閉じます。" -#: ../../library/dbm.rst:515 msgid "" "If you have carried out a lot of deletions and would like to shrink the " "space used on disk, this method will reorganize the database; otherwise, " "deleted file space will not be reused." msgstr "" +"多数の削除を行った後、ディスク上の使用領域を縮小したい場合に、このメソッドで" +"データベースを再編成できます。\n" +"再編成しない場合、削除されたファイル領域は再利用されません。" -#: ../../library/dbm.rst:520 msgid "" "While reorganizing, no additional free disk space is required. However, be " "aware that this factor changes for each :mod:`!dbm` submodule." msgstr "" +"再編成中も追加の空きディスク領域は不要です。\n" +"ただし、この条件は :mod:`!dbm` のサブモジュールごとに異なります。" -#: ../../library/dbm.rst:527 msgid "" "Synchronize the on-disk directory and data files. This method is called by " "the :meth:`shelve.Shelf.sync` method." msgstr "" +"ディスク上のディレクトリファイルとデータファイルを同期します。\n" +"このメソッドは :meth:`shelve.Shelf.sync` メソッドから呼び出されます。" #: ../../library/dbm.rst:437 msgid "databases" diff --git a/library/debug.po b/library/debug.po index e252e5140..201acab37 100644 --- a/library/debug.po +++ b/library/debug.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/debug.rst:3 msgid "Debugging and profiling" -msgstr "" +msgstr "デバッグとプロファイリング" msgid "" "These libraries help you with Python development: the debugger enables you " diff --git a/library/decimal.po b/library/decimal.po index 40a402814..b5409752a 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -30,14 +30,15 @@ msgstr ":mod:`!decimal` --- 10進固定小数点と浮動小数点の演算" msgid "**Source code:** :source:`Lib/decimal.py`" msgstr "**ソースコード:** :source:`Lib/decimal.py`" -#: ../../library/decimal.rst:25 msgid "" "The :mod:`!decimal` module provides support for fast correctly rounded " "decimal floating-point arithmetic. It offers several advantages over the :" "class:`float` datatype:" msgstr "" +":mod:`!decimal` モジュールは、高速で正しく丸められる 10 進浮動小数点演算をサ" +"ポートします。\n" +":class:`float` データ型に比べて次のような利点があります:" -#: ../../library/decimal.rst:29 msgid "" "Decimal \"is based on a `floating-point model `__ which was designed with people in mind, " @@ -45,6 +46,11 @@ msgid "" "an arithmetic that works in the same way as the arithmetic that people learn " "at school.\" -- excerpt from the decimal arithmetic specification." msgstr "" +"Decimal は「人間を念頭に設計された `浮動小数点モデル `__ に基づいており、当然ながら次の最重要の" +"指針に従っています。\n" +"コンピューターは、人間が学校で習う算術と同じように動作する算術を提供しなけれ" +"ばならない」— 十進数演算仕様からの抜粋。" #: ../../library/decimal.rst:36 msgid "" @@ -202,9 +208,8 @@ msgstr "" "IBM による汎用十進演算仕様、`The General Decimal Arithmetic Specification " "`_。" -#: ../../library/decimal.rst:119 msgid "Quick-start tutorial" -msgstr "" +msgstr "入門チュートリアル" #: ../../library/decimal.rst:121 msgid "" @@ -216,7 +221,6 @@ msgstr "" "キストを :func:`getcontext` で調べ、必要なら、精度、丸め、有効なトラップを設" "定します::" -#: ../../library/decimal.rst:125 msgid "" ">>> from decimal import *\n" ">>> getcontext()\n" @@ -226,6 +230,13 @@ msgid "" "\n" ">>> getcontext().prec = 7 # Set a new precision" msgstr "" +">>> from decimal import *\n" +">>> getcontext()\n" +"Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,\n" +" InvalidOperation])\n" +"\n" +">>> getcontext().prec = 7 # 新しい精度を設定します" #: ../../library/decimal.rst:133 msgid "" @@ -240,7 +251,6 @@ msgstr "" "します。 ``Decimal`` は \"非数 (Not a Number)\" を表す ``NaN`` や正負の " "``Infinity`` (無限大)、 ``-0`` といった特殊な値も表現できます::" -#: ../../library/decimal.rst:139 msgid "" ">>> getcontext().prec = 28\n" ">>> Decimal(10)\n" @@ -260,6 +270,23 @@ msgid "" ">>> Decimal('-Infinity')\n" "Decimal('-Infinity')" msgstr "" +">>> getcontext().prec = 28\n" +">>> Decimal(10)\n" +"Decimal('10')\n" +">>> Decimal('3.14')\n" +"Decimal('3.14')\n" +">>> Decimal(3.14)\n" +"Decimal('3.140000000000000124344978758017532527446746826171875')\n" +">>> Decimal((0, (3, 1, 4), -2))\n" +"Decimal('3.14')\n" +">>> Decimal(str(2.0 ** 0.5))\n" +"Decimal('1.4142135623730951')\n" +">>> Decimal(2) ** Decimal('0.5')\n" +"Decimal('1.414213562373095048801688724')\n" +">>> Decimal('NaN')\n" +"Decimal('NaN')\n" +">>> Decimal('-Infinity')\n" +"Decimal('-Infinity')" #: ../../library/decimal.rst:157 msgid "" @@ -270,7 +297,6 @@ msgstr "" ":exc:`FloatOperation` シグナルがトラップされる場合、コンストラクタや順序比較" "において誤って decimal と float が混ざると、例外が送出されます::" -#: ../../library/decimal.rst:161 msgid "" ">>> c = getcontext()\n" ">>> c.traps[FloatOperation] = True\n" @@ -285,6 +311,18 @@ msgid "" ">>> Decimal('3.5') == 3.5\n" "True" msgstr "" +">>> c = getcontext()\n" +">>> c.traps[FloatOperation] = True\n" +">>> Decimal(3.14)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') < 3.7\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') == 3.5\n" +"True" #: ../../library/decimal.rst:176 msgid "" @@ -295,7 +333,6 @@ msgstr "" "新たな ``Decimal`` の有効桁数は入力の桁数だけで決まります。演算コンテキストに" "おける精度や値丸めの設定が影響するのは算術演算の間だけです。" -#: ../../library/decimal.rst:180 msgid "" ">>> getcontext().prec = 6\n" ">>> Decimal('3.0')\n" @@ -308,6 +345,16 @@ msgid "" ">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" "Decimal('5.85988')" msgstr "" +">>> getcontext().prec = 6\n" +">>> Decimal('3.0')\n" +"Decimal('3.0')\n" +">>> Decimal('3.1415926535')\n" +"Decimal('3.1415926535')\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85987')\n" +">>> getcontext().rounding = ROUND_UP\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85988')" #: ../../library/decimal.rst:193 msgid "" @@ -317,21 +364,24 @@ msgstr "" "C バージョンの内部制限を超えた場合、decimal の構成は :class:" "`InvalidOperation` を送出します::" -#: ../../library/decimal.rst:196 msgid "" ">>> Decimal(\"1e9999999999999999999\")\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "decimal.InvalidOperation: []" msgstr "" +">>> Decimal(\"1e9999999999999999999\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.InvalidOperation: []" -#: ../../library/decimal.rst:203 msgid "" "Decimals interact well with much of the rest of Python. Here is a small " "decimal floating-point flying circus:" msgstr "" +"Decimal は Python の他の多くの機能とうまく連携します。\n" +"10 進浮動小数点数を使った、ちょっとした実演を見てみましょう:" -#: ../../library/decimal.rst:206 msgid "" ">>> data = list(map(Decimal, '1.34 1.87 3.45 2.35 1.00 0.03 9.25'.split()))\n" ">>> max(data)\n" @@ -359,15 +409,42 @@ msgid "" ">>> c % a\n" "Decimal('0.77')" msgstr "" +">>> data = list(map(Decimal, '1.34 1.87 3.45 2.35 1.00 0.03 9.25'.split()))\n" +">>> max(data)\n" +"Decimal('9.25')\n" +">>> min(data)\n" +"Decimal('0.03')\n" +">>> sorted(data)\n" +"[Decimal('0.03'), Decimal('1.00'), Decimal('1.34'), Decimal('1.87'),\n" +" Decimal('2.35'), Decimal('3.45'), Decimal('9.25')]\n" +">>> sum(data)\n" +"Decimal('19.29')\n" +">>> a,b,c = data[:3]\n" +">>> str(a)\n" +"'1.34'\n" +">>> float(a)\n" +"1.34\n" +">>> round(a, 1)\n" +"Decimal('1.3')\n" +">>> int(a)\n" +"1\n" +">>> a * 5\n" +"Decimal('6.70')\n" +">>> a * b\n" +"Decimal('2.5058')\n" +">>> c % a\n" +"Decimal('0.77')" -#: ../../library/decimal.rst:235 msgid "" "Decimals can be formatted (with :func:`format` built-in or :ref:`f-strings`) " "in fixed-point or scientific notation, using the same formatting syntax " "(see :ref:`formatspec`) as builtin :class:`float` type:" msgstr "" +"Decimal は、組み込みの :func:`format` や :ref:`f-strings` を使って、固定小数" +"点表記や科学表記に書式化できます。\n" +"書式指定の構文 (:ref:`formatspec` を参照) は組み込みの :class:`float` 型と同" +"じです:" -#: ../../library/decimal.rst:239 msgid "" ">>> format(Decimal('2.675'), \"f\")\n" "'2.675'\n" @@ -383,6 +460,19 @@ msgid "" "...\n" "2.67" msgstr "" +">>> format(Decimal('2.675'), \"f\")\n" +"'2.675'\n" +">>> format(Decimal('2.675'), \".2f\")\n" +"'2.68'\n" +">>> f\"{Decimal('2.675'):.2f}\"\n" +"'2.68'\n" +">>> format(Decimal('2.675'), \".2e\")\n" +"'2.68e+0'\n" +">>> with localcontext() as ctx:\n" +"... ctx.rounding = ROUND_DOWN\n" +"... print(format(Decimal('2.675'), \".2f\"))\n" +"...\n" +"2.67" #: ../../library/decimal.rst:255 msgid "And some mathematical functions are also available to Decimal:" @@ -407,22 +497,25 @@ msgstr "" "スでき、設定を変更できます。ほとんどのアプリケーションはこのアプローチで十分" "です。" -#: ../../library/decimal.rst:280 msgid "" "For more advanced work, it may be useful to create alternate contexts using " "the :meth:`Context` constructor. To make an alternate active, use the :func:" "`setcontext` function." msgstr "" +"より高度な処理では、:meth:`Context` コンストラクタで別のコンテキストを作ると" +"便利な場合があります。\n" +"別のコンテキストを有効にするには :func:`setcontext` 関数を使います。" -#: ../../library/decimal.rst:284 msgid "" "In accordance with the standard, the :mod:`!decimal` module provides two " "ready to use standard contexts, :const:`BasicContext` and :const:" "`ExtendedContext`. The former is especially useful for debugging because " "many of the traps are enabled:" msgstr "" +":mod:`!decimal` モジュールは仕様に従い、そのまま使える 2 つの標準コンテキス" +"ト :const:`BasicContext` と :const:`ExtendedContext` を提供します。\n" +"前者は多くのトラップが有効になっているので、特にデバッグに便利です:" -#: ../../library/decimal.rst:289 msgid "" ">>> myothercontext = Context(prec=60, rounding=ROUND_HALF_DOWN)\n" ">>> setcontext(myothercontext)\n" @@ -445,6 +538,26 @@ msgid "" " Decimal(42) / Decimal(0)\n" "DivisionByZero: x / 0" msgstr "" +">>> myothercontext = Context(prec=60, rounding=ROUND_HALF_DOWN)\n" +">>> setcontext(myothercontext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857142857142857142857142857142857142857142857142857142857')\n" +"\n" +">>> ExtendedContext\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[])\n" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857143')\n" +">>> Decimal(42) / Decimal(0)\n" +"Decimal('Infinity')\n" +"\n" +">>> setcontext(BasicContext)\n" +">>> Decimal(42) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(42) / Decimal(0)\n" +"DivisionByZero: x / 0" #: ../../library/decimal.rst:313 msgid "" @@ -458,7 +571,6 @@ msgstr "" "す。そのため、フラグのモニタを行いたいような演算の前には :meth:`~Context." "clear_flags` メソッドでフラグをクリアしておくのがベストです。 ::" -#: ../../library/decimal.rst:318 msgid "" ">>> setcontext(ExtendedContext)\n" ">>> getcontext().clear_flags()\n" @@ -468,6 +580,13 @@ msgid "" "Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" " capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])" msgstr "" +">>> setcontext(ExtendedContext)\n" +">>> getcontext().clear_flags()\n" +">>> Decimal(355) / Decimal(113)\n" +"Decimal('3.14159292')\n" +">>> getcontext()\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])" #: ../../library/decimal.rst:326 msgid "" @@ -487,7 +606,6 @@ msgstr "" "コンテキストの :attr:`~Context.traps` 属性に入っている辞書を使うと、個々のト" "ラップをセットできます:" -#: ../../library/decimal.rst:333 msgid "" ">>> setcontext(ExtendedContext)\n" ">>> Decimal(1) / Decimal(0)\n" @@ -499,6 +617,15 @@ msgid "" " Decimal(1) / Decimal(0)\n" "DivisionByZero: x / 0" msgstr "" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(0)\n" +"Decimal('Infinity')\n" +">>> getcontext().traps[DivisionByZero] = 1\n" +">>> Decimal(1) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(1) / Decimal(0)\n" +"DivisionByZero: x / 0" #: ../../library/decimal.rst:345 msgid "" @@ -535,7 +662,6 @@ msgstr "" "す。 *value* が文字列の場合、先頭と末尾の空白および全てのアンダースコアを取り" "除いた後には以下の 10進数文字列の文法に従わなければなりません::" -#: ../../library/decimal.rst:369 msgid "" "sign ::= '+' | '-'\n" "digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | " @@ -549,8 +675,18 @@ msgid "" "numeric-value ::= decimal-part [exponent-part] | infinity\n" "numeric-string ::= [sign] numeric-value | [sign] nan" msgstr "" +"sign ::= '+' | '-'\n" +"digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | " +"'9'\n" +"indicator ::= 'e' | 'E'\n" +"digits ::= digit [digit]...\n" +"decimal-part ::= digits '.' [digits] | ['.'] digits\n" +"exponent-part ::= indicator [sign] digits\n" +"infinity ::= 'Infinity' | 'Inf'\n" +"nan ::= 'NaN' [digits] | 'sNaN' [digits]\n" +"numeric-value ::= decimal-part [exponent-part] | infinity\n" +"numeric-string ::= [sign] numeric-value | [sign] nan" -#: ../../library/decimal.rst:380 msgid "" "Other Unicode decimal digits are also permitted where ``digit`` appears " "above. These include decimal digits from various other alphabets (for " @@ -559,6 +695,11 @@ msgid "" "example, ``inf``, ``Inf``, ``INFINITY``, and ``iNfINity`` are all acceptable " "spellings for positive infinity." msgstr "" +"上記の ``digit`` には、他の Unicode の 10 進数字も使えます。\n" +"例えばアラビア・インド数字やデーヴァナーガリー数字など、さまざまな文字体系の " +"10 進数字や、全角数字 ``'\\uff10'`` から ``'\\uff19'`` が含まれます。\n" +"大文字・小文字は区別しないので、例えば ``inf``、``Inf``、``INFINITY``、" +"``iNfINity`` はすべて正の無限大を表す表記として使えます。" #: ../../library/decimal.rst:387 msgid "" @@ -572,7 +713,6 @@ msgstr "" "を表す整数でなければなりません。例えば、 ``Decimal((0, (1, 4, 1, 4), -3))`` " "は ``Decimal('1.414')`` を返します。" -#: ../../library/decimal.rst:392 msgid "" "If *value* is a :class:`float`, the binary floating-point value is " "losslessly converted to its exact decimal equivalent. This conversion can " @@ -580,6 +720,12 @@ msgid "" "``Decimal(float('1.1'))`` converts to " "``Decimal('1.100000000000000088817841970012523233890533447265625')``." msgstr "" +"*value* が :class:`float` の場合、その 2 進浮動小数点数の値を、損失なく正確に" +"対応する 10 進数へ変換します。\n" +"この変換には 53 桁以上の精度が必要になることもよくあります。\n" +"例えば ``Decimal(float('1.1'))`` は " +"``Decimal('1.100000000000000088817841970012523233890533447265625')`` に変換さ" +"れます。" #: ../../library/decimal.rst:398 msgid "" @@ -635,7 +781,6 @@ msgstr "" "コード中の整数リテラルや浮動小数点リテラルと同様に、アンダースコアを用いて桁" "をグルーピングできます。" -#: ../../library/decimal.rst:422 msgid "" "Decimal floating-point objects share many properties with the other built-in " "numeric types such as :class:`float` and :class:`int`. All of the usual " @@ -644,6 +789,11 @@ msgid "" "compared, sorted, and coerced to another type (such as :class:`float` or :" "class:`int`)." msgstr "" +"10 進浮動小数点オブジェクトは、:class:`float` や :class:`int` などの他の組み" +"込み数値型と多くの性質を共有しています。\n" +"通常の数学演算や特殊メソッドはすべて利用できます。\n" +"また、コピー、pickle 化、表示、辞書のキーや集合の要素としての利用、比較、ソー" +"ト、他の型 (:class:`float` や :class:`int` など) への変換もできます。" #: ../../library/decimal.rst:429 msgid "" @@ -656,13 +806,16 @@ msgstr "" "す。十進オブジェクトに対して剰余演算を適用すると、計算結果の符号は除数の符号" "ではなく *被除数* の符号と一致します::" -#: ../../library/decimal.rst:434 msgid "" ">>> (-7) % 4\n" "1\n" ">>> Decimal(-7) % Decimal(4)\n" "Decimal('-3')" msgstr "" +">>> (-7) % 4\n" +"1\n" +">>> Decimal(-7) % Decimal(4)\n" +"Decimal('-3')" #: ../../library/decimal.rst:439 msgid "" @@ -674,13 +827,16 @@ msgstr "" "めた) 整数部分を返します。そのため通常の恒等式 ``x == (x // y) * y + x % y`` " "が維持されます::" -#: ../../library/decimal.rst:443 msgid "" ">>> -7 // 4\n" "-2\n" ">>> Decimal(-7) // Decimal(4)\n" "Decimal('-1')" msgstr "" +">>> -7 // 4\n" +"-2\n" +">>> Decimal(-7) // Decimal(4)\n" +"Decimal('-1')" #: ../../library/decimal.rst:448 msgid "" @@ -715,11 +871,12 @@ msgstr "" ":class:`Decimal` インスタンスと他の数値型が混在する比較が完全にサポートされる" "ようになりました。" -#: ../../library/decimal.rst:464 msgid "" "In addition to the standard numeric properties, decimal floating-point " "objects also have a number of specialized methods:" msgstr "" +"10 進浮動小数点オブジェクトには、標準的な数値の性質に加えて、次のような専用メ" +"ソッドがあります:" #: ../../library/decimal.rst:470 msgid "" @@ -741,11 +898,12 @@ msgstr "" "与えられた :class:`Decimal` インスタンスを、既約分数で分母が正数の分数として" "表現した整数のペア ``(n, d)`` を返します。" -#: ../../library/decimal.rst:481 msgid "" ">>> Decimal('-3.14').as_integer_ratio()\n" "(-157, 50)" msgstr "" +">>> Decimal('-3.14').as_integer_ratio()\n" +"(-157, 50)" #: ../../library/decimal.rst:484 msgid "" @@ -780,13 +938,16 @@ msgstr "" "二つの Decimal インスタンスの値を比較します。 :meth:`compare` は Decimal イン" "スタンスを返し、被演算子のどちらかが NaN ならば結果は NaN です::" -#: ../../library/decimal.rst:507 msgid "" "a or b is a NaN ==> Decimal('NaN')\n" "a < b ==> Decimal('-1')\n" "a == b ==> Decimal('0')\n" "a > b ==> Decimal('1')" msgstr "" +"a または b が NaN ==> Decimal('NaN')\n" +"a < b ==> Decimal('-1')\n" +"a == b ==> Decimal('0')\n" +"a > b ==> Decimal('1')" #: ../../library/decimal.rst:514 msgid "" @@ -886,11 +1047,12 @@ msgstr "" "与えられた数での(自然)指数関数 ``e**x`` の値を返します。結果は :const:" "`ROUND_HALF_EVEN` 丸めモードで正しく丸められます。" -#: ../../library/decimal.rst:592 msgid "" "Alternative constructor that only accepts instances of :class:`float` or :" "class:`int`." msgstr "" +":class:`float` または :class:`int` のインスタンスだけを受け付ける、別形式のコ" +"ンストラクタです。" msgid "" "Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``. " @@ -914,7 +1076,6 @@ msgstr "" "Python 3.2 以降では、 :class:`Decimal` インスタンスは :class:`float` から直接" "構成できるようになりました。" -#: ../../library/decimal.rst:604 msgid "" ">>> Decimal.from_float(0.1)\n" "Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" @@ -925,14 +1086,22 @@ msgid "" ">>> Decimal.from_float(float('-inf'))\n" "Decimal('-Infinity')" msgstr "" +">>> Decimal.from_float(0.1)\n" +"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" +">>> Decimal.from_float(float('nan'))\n" +"Decimal('NaN')\n" +">>> Decimal.from_float(float('inf'))\n" +"Decimal('Infinity')\n" +">>> Decimal.from_float(float('-inf'))\n" +"Decimal('-Infinity')" -#: ../../library/decimal.rst:619 msgid "" "Alternative constructor that only accepts instances of :class:`float`, :" "class:`int` or :class:`Decimal`, but not strings or tuples." msgstr "" +":class:`float`、:class:`int`、:class:`Decimal` のインスタンスだけを受け付け、" +"文字列やタプルは受け付けない、別形式のコンストラクタです。" -#: ../../library/decimal.rst:623 msgid "" ">>> Decimal.from_number(314)\n" "Decimal('314')\n" @@ -941,6 +1110,12 @@ msgid "" ">>> Decimal.from_number(Decimal('3.14'))\n" "Decimal('3.14')" msgstr "" +">>> Decimal.from_number(314)\n" +"Decimal('314')\n" +">>> Decimal.from_number(0.1)\n" +"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" +">>> Decimal.from_number(Decimal('3.14'))\n" +"Decimal('3.14')" #: ../../library/decimal.rst:636 msgid "" @@ -1155,13 +1330,13 @@ msgstr "" "向の数を返します。もし両者が数値的に等しければ、二つめの対象の符号を採った一" "つめの対象のコピーを返します。" -#: ../../library/decimal.rst:779 msgid "" "Used for producing canonical values of an equivalence class within either " "the current context or the specified context." msgstr "" +"現在のコンテキストまたは指定したコンテキスト内で、同値類の標準形となる値を生" +"成するために使います。" -#: ../../library/decimal.rst:782 msgid "" "This has the same semantics as the unary plus operation, except that if the " "final result is finite it is reduced to its simplest form, with all trailing " @@ -1170,22 +1345,27 @@ msgid "" "exponent is incremented by 1. Otherwise (the coefficient is zero) the " "exponent is set to 0. In all cases the sign is unchanged." msgstr "" +"単項プラス演算と同じ意味を持ちますが、最終結果が有限の場合は、末尾のゼロをす" +"べて取り除き、符号を保ったまま最も単純な形にします。\n" +"具体的には、係数がゼロでない 10 の倍数である間、係数を 10 で割って指数を 1 増" +"やします。\n" +"それ以外 (係数がゼロ) の場合は指数を 0 にします。\n" +"いずれの場合も符号は変わりません。" -#: ../../library/decimal.rst:789 msgid "" "For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both " "normalize to the equivalent value ``Decimal('32.1')``." msgstr "" +"例えば ``Decimal('32.100')`` と ``Decimal('0.321000e+2')`` は、どちらも同じ値" +"を持つ ``Decimal('32.1')`` に正規化されます。" -#: ../../library/decimal.rst:792 msgid "Note that rounding is applied *before* reducing to simplest form." -msgstr "" +msgstr "最も単純な形にする *前に* 丸めが適用されます。" -#: ../../library/decimal.rst:794 msgid "" "In the latest versions of the specification, this operation is also known as " "``reduce``." -msgstr "" +msgstr "この演算は、新しい版の仕様では ``reduce`` とも呼ばれています。" #: ../../library/decimal.rst:799 msgid "" @@ -1425,17 +1605,21 @@ msgstr "" "値を丸めます。 *rounding* が指定されていれば適用されます; それ以外の場合、値" "丸めの方法は *context* の設定か現在のコンテキストの設定になります。" -#: ../../library/decimal.rst:933 msgid "Decimal numbers can be rounded using the :func:`.round` function:" -msgstr "" +msgstr "Decimal の数値は :func:`.round` 関数で丸められます:" -#: ../../library/decimal.rst:938 msgid "" "If *ndigits* is not given or ``None``, returns the nearest :class:`int` to " "*number*, rounding ties to even, and ignoring the rounding mode of the :" "class:`Decimal` context. Raises :exc:`OverflowError` if *number* is an " "infinity or :exc:`ValueError` if it is a (quiet or signaling) NaN." msgstr "" +"*ndigits* を指定しないか ``None`` にすると、*number* に最も近い :class:`int` " +"を返します。\n" +"ちょうど中間なら偶数に丸め、:class:`Decimal` のコンテキストの丸めモードは無視" +"します。\n" +"*number* が無限大なら :exc:`OverflowError` を、無言 NaN または発信 NaN なら :" +"exc:`ValueError` を送出します。" #: ../../library/decimal.rst:944 msgid "" @@ -1449,27 +1633,26 @@ msgid "" "the current context's precision. In other words, for the non-corner cases:" msgstr "" -#: ../../library/decimal.rst:954 msgid "" "if *ndigits* is positive, return *number* rounded to *ndigits* decimal " "places;" msgstr "" +"*ndigits* が正なら、*number* を小数点以下 *ndigits* 桁に丸めて返します。" -#: ../../library/decimal.rst:956 msgid "if *ndigits* is zero, return *number* rounded to the nearest integer;" -msgstr "" +msgstr "*ndigits* がゼロなら、*number* を最も近い整数に丸めて返します。" -#: ../../library/decimal.rst:957 msgid "" "if *ndigits* is negative, return *number* rounded to the nearest multiple of " "``10**abs(ndigits)``." msgstr "" +"*ndigits* が負なら、*number* を最も近い ``10**abs(ndigits)`` の倍数に丸めて返" +"します。" #: ../../library/decimal.rst:960 msgid "For example::" msgstr "例えば::" -#: ../../library/decimal.rst:962 msgid "" ">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" ">>> getcontext().rounding = ROUND_DOWN\n" @@ -1484,6 +1667,18 @@ msgid "" ">>> round(Decimal('3.75'), -1)\n" "Decimal('0E+1')" msgstr "" +">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" +">>> getcontext().rounding = ROUND_DOWN\n" +">>> round(Decimal('3.75')) # コンテキストの丸めモードは無視します\n" +"4\n" +">>> round(Decimal('3.5')) # 中間値は偶数に丸めます\n" +"4\n" +">>> round(Decimal('3.75'), 0) # コンテキストの丸めモードを使います\n" +"Decimal('3')\n" +">>> round(Decimal('3.75'), 1)\n" +"Decimal('3.7')\n" +">>> round(Decimal('3.75'), -1)\n" +"Decimal('0E+1')" #: ../../library/decimal.rst:979 msgid "Logical operands" @@ -1564,7 +1759,6 @@ msgstr "" "たとえば、以下のコードでは精度を42桁に設定し、計算を実行し、そして元のコンテ" "キストに復帰します::" -#: ../../library/decimal.rst:1026 msgid "" "from decimal import localcontext\n" "\n" @@ -1573,12 +1767,16 @@ msgid "" " s = calculate_something()\n" "s = +s # Round the final result back to the default precision" msgstr "" +"from decimal import localcontext\n" +"\n" +"with localcontext() as ctx:\n" +" ctx.prec = 42 # 高精度で計算します\n" +" s = calculate_something()\n" +"s = +s # 最終結果をデフォルトの精度に丸めます" -#: ../../library/decimal.rst:1033 msgid "Using keyword arguments, the code would be the following::" -msgstr "" +msgstr "キーワード引数を使うと、次のように書けます。 ::" -#: ../../library/decimal.rst:1035 msgid "" "from decimal import localcontext\n" "\n" @@ -1586,35 +1784,45 @@ msgid "" " s = calculate_something()\n" "s = +s" msgstr "" +"from decimal import localcontext\n" +"\n" +"with localcontext(prec=42) as ctx:\n" +" s = calculate_something()\n" +"s = +s" -#: ../../library/decimal.rst:1041 msgid "" "Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:" "`Context` doesn't support. Raises either :exc:`TypeError` or :exc:" "`ValueError` if *kwargs* supplies an invalid value for an attribute." msgstr "" +"*kwargs* に :class:`Context` がサポートしない属性を渡すと :exc:`TypeError` を" +"送出します。\n" +"*kwargs* に属性の不正な値を渡すと :exc:`TypeError` または :exc:`ValueError` " +"を送出します。" -#: ../../library/decimal.rst:1045 msgid "" ":meth:`localcontext` now supports setting context attributes through the use " "of keyword arguments." msgstr "" +":meth:`localcontext` でキーワード引数を使ってコンテキストの属性を設定できるよ" +"うになりました。" -#: ../../library/decimal.rst:1050 msgid "" "Return a context object initialized to the proper values for one of the IEEE " "interchange formats. The argument must be a multiple of 32 and less than :" "const:`IEEE_CONTEXT_MAX_BITS`." msgstr "" +"IEEE の交換形式のいずれかに適した値で初期化したコンテキストオブジェクトを返し" +"ます。\n" +"引数は 32 の倍数で、:const:`IEEE_CONTEXT_MAX_BITS` 未満でなければなりません。" -#: ../../library/decimal.rst:1056 msgid "" "New contexts can also be created using the :class:`Context` constructor " "described below. In addition, the module provides three pre-made contexts:" msgstr "" "新たなコンテキストは、以下で説明する :class:`Context` コンストラクタを使って" -"生成できます。その他にも、 ``decimal`` モジュールでは作成済みのコンテキストを" -"提供しています:" +"作成できます。\n" +"このほか、モジュールは作成済みのコンテキストを 3 つ提供しています。" #: ../../library/decimal.rst:1062 msgid "" @@ -1722,37 +1930,42 @@ msgstr "" "*flags* フィールドが指定されていないか :const:`None` の場合には、全てのフラグ" "がクリアされます。" -#: ../../library/decimal.rst:1115 msgid "" "An integer in the range [``1``, :const:`MAX_PREC`] that sets the precision " "for arithmetic operations in the context." msgstr "" +"コンテキスト内の算術演算の精度を設定する、[``1``, :const:`MAX_PREC`] の範囲の" +"整数。" -#: ../../library/decimal.rst:1120 msgid "One of the constants listed in the section `Rounding Modes`_." -msgstr "" +msgstr "`Rounding Modes`_ 節に挙げられた定数のいずれか。" -#: ../../library/decimal.rst:1125 msgid "" "Lists of any signals to be set. Generally, new contexts should only set " "traps and leave the flags clear." msgstr "" +"設定するシグナルのリスト。\n" +"通常、新しいコンテキストではトラップだけを設定し、フラグはクリアしたままにし" +"てください。" -#: ../../library/decimal.rst:1131 msgid "" "Integers specifying the outer limits allowable for exponents. *Emin* must be " "in the range [:const:`MIN_EMIN`, ``0``], *Emax* in the range [``0``, :const:" "`MAX_EMAX`]." msgstr "" +"指数に許される範囲の上下限を指定する整数。\n" +"*Emin* は [:const:`MIN_EMIN`, ``0``]、*Emax* は [``0``, :const:`MAX_EMAX`] の" +"範囲でなければなりません。" -#: ../../library/decimal.rst:1137 msgid "" "Either ``0`` or ``1`` (the default). If set to ``1``, exponents are printed " "with a capital ``E``; otherwise, a lowercase ``e`` is used: " "``Decimal('6.02e+23')``." msgstr "" +"``0`` または ``1`` (デフォルト)。\n" +"``1`` にすると指数を大文字の ``E`` で表示し、それ以外では小文字の ``e`` を使" +"います: ``Decimal('6.02e+23')``。" -#: ../../library/decimal.rst:1143 msgid "" "Either ``0`` (the default) or ``1``. If set to ``1``, the exponent ``e`` of " "a :class:`Decimal` instance representable in this context is strictly " @@ -1764,12 +1977,24 @@ msgid "" "exponent constraints; this preserves the value of the number but loses " "information about significant trailing zeros. For example::" msgstr "" +":class:`Decimal` インスタンスをこのコンテキストで表現するときの指数の制約を指" +"定する、``0`` (デフォルト) または ``1``。\n" +"``1`` にすると指数 ``e`` は ``Emin - prec + 1 <= e <= Emax - prec + 1`` の範" +"囲に厳しく制限されます。\n" +"*clamp* が ``0`` の場合は制約が緩く、:class:`Decimal` インスタンスの調整済み" +"指数が :attr:`~Context.Emax` 以下であればよいことになります。\n" +"*clamp* が ``1`` のときは、指数の制約を満たすよう、大きな正規数の指数を可能な" +"限り減らし、その分のゼロを係数に追加します。\n" +"この変換で数値は保たれますが、末尾のゼロの有効桁数に関する情報は失われま" +"す。\n" +"例えば次のようになります。 ::" -#: ../../library/decimal.rst:1154 msgid "" ">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" "Decimal('1.23000E+999')" msgstr "" +">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" +"Decimal('1.23000E+999')" #: ../../library/decimal.rst:1157 msgid "" @@ -1842,7 +2067,6 @@ msgstr "" "もあります。以下の例は、丸められていない入力を使うということは和にゼロを加え" "ると結果が変わり得るという見本です:" -#: ../../library/decimal.rst:1201 msgid "" ">>> getcontext().prec = 3\n" ">>> Decimal('3.4445') + Decimal('1.0023')\n" @@ -1850,6 +2074,11 @@ msgid "" ">>> Decimal('3.4445') + Decimal(0) + Decimal('1.0023')\n" "Decimal('4.44')" msgstr "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.4445') + Decimal('1.0023')\n" +"Decimal('4.45')\n" +">>> Decimal('3.4445') + Decimal(0) + Decimal('1.0023')\n" +"Decimal('4.44')" #: ../../library/decimal.rst:1209 msgid "" @@ -1873,7 +2102,6 @@ msgstr "" "い、変換にコンテキストの精度、丸めメソッド、フラグ、そしてトラップが適用され" "ます。" -#: ../../library/decimal.rst:1220 msgid "" ">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" ">>> context.create_decimal_from_float(math.pi)\n" @@ -1884,6 +2112,14 @@ msgid "" " ...\n" "decimal.Inexact: None" msgstr "" +">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Decimal('3.1415')\n" +">>> context = Context(prec=5, traps=[Inexact])\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Traceback (most recent call last):\n" +" ...\n" +"decimal.Inexact: None" msgid "" "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " @@ -2123,11 +2359,12 @@ msgstr "" "ンテキストの丸めモードを使って丸められます。結果は常に、Python バージョンにお" "いて正しく丸められます。" -#: ../../library/decimal.rst:1483 msgid "" "``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " "``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." msgstr "" +"``Decimal(0) ** Decimal(0)`` は ``InvalidOperation`` を発生させます。\n" +"``InvalidOperation`` をトラップしない場合は ``Decimal('NaN')`` になります。" #: ../../library/decimal.rst:1486 msgid "" @@ -2236,18 +2473,20 @@ msgstr "数値を科学表記で文字列に変換します。" msgid "Constants" msgstr "定数" -#: ../../library/decimal.rst:1588 msgid "" "The highest version of the General Decimal Arithmetic Specification that " "this implementation complies with. See https://speleotrove.com/decimal/" "decarith.html for the specification." msgstr "" +"この実装が準拠する汎用十進演算仕様の最新のバージョン。\n" +"仕様は https://speleotrove.com/decimal/decarith.html を参照してください。" -#: ../../library/decimal.rst:1595 msgid "" "The following constants are only relevant for the C module. They are also " "included in the pure Python version for compatibility." msgstr "" +"次の定数は C モジュールにのみ関係します。\n" +"互換性のため、純 Python 版にも含まれています。" #: ../../library/decimal.rst:1599 msgid "32-bit" @@ -2281,13 +2520,11 @@ msgstr "``-849999999``" msgid "``-1999999999999999997``" msgstr "``-1999999999999999997``" -#: ../../library/decimal.rst:1609 msgid "``256``" -msgstr "" +msgstr "``256``" -#: ../../library/decimal.rst:1609 msgid "``512``" -msgstr "" +msgstr "``512``" #: ../../library/decimal.rst:1614 msgid "" @@ -2296,7 +2533,6 @@ msgstr "" "値は ``True`` です。現在のPythonは常にスレッドを持っているので、非推奨になり" "ました。" -#: ../../library/decimal.rst:1620 msgid "" "The default value is ``True``. If Python is :option:`configured using the --" "without-decimal-contextvar option <--without-decimal-contextvar>`, the C " @@ -2304,6 +2540,11 @@ msgid "" "value is ``False``. This is slightly faster in some nested context " "scenarios." msgstr "" +"デフォルト値は ``True`` です。\n" +"Python を :option:`--without-decimal-contextvar オプションで構成 <--without-" +"decimal-contextvar>` した場合、C 版はコルーチンローカルではなくスレッドローカ" +"ルのコンテキストを使い、値は ``False`` になります。\n" +"コンテキストを入れ子にする一部の状況では、こちらの方がわずかに高速です。" #: ../../library/decimal.rst:1629 msgid "Rounding modes" @@ -2547,7 +2788,6 @@ msgstr "" msgid "The following table summarizes the hierarchy of signals::" msgstr "これらのシグナルの階層構造をまとめると、以下の表のようになります::" -#: ../../library/decimal.rst:1789 msgid "" "exceptions.ArithmeticError(exceptions.Exception)\n" " DecimalException\n" @@ -2561,10 +2801,20 @@ msgid "" " Subnormal\n" " FloatOperation(DecimalException, exceptions.TypeError)" msgstr "" +"exceptions.ArithmeticError(exceptions.Exception)\n" +" DecimalException\n" +" Clamped\n" +" DivisionByZero(DecimalException, exceptions.ZeroDivisionError)\n" +" Inexact\n" +" Overflow(Inexact, Rounded)\n" +" Underflow(Inexact, Rounded, Subnormal)\n" +" InvalidOperation\n" +" Rounded\n" +" Subnormal\n" +" FloatOperation(DecimalException, exceptions.TypeError)" -#: ../../library/decimal.rst:1808 msgid "Floating-point notes" -msgstr "" +msgstr "浮動小数点に関する注意点" #: ../../library/decimal.rst:1812 msgid "Mitigating round-off error with increased precision" @@ -2581,7 +2831,6 @@ msgstr "" "に表現できるようになります); しかし、ゼロでない桁が一定の精度を越えている場合" "には、演算によっては依然として値丸めによる誤差を引き起こします。" -#: ../../library/decimal.rst:1818 msgid "" "The effects of round-off error can be amplified by the addition or " "subtraction of nearly offsetting quantities resulting in loss of " @@ -2589,8 +2838,11 @@ msgid "" "floating-point arithmetic with insufficient precision causes the breakdown " "of the associative and distributive properties of addition:" msgstr "" +"ほぼ相殺する量を加減算すると、丸め誤差の影響が増幅され、桁落ちが生じることが" +"あります。\n" +"Knuth は、精度の足りない浮動小数点演算の丸めによって、加算の結合法則や分配法" +"則が成り立たなくなる 2 つの示唆に富む例を挙げています:" -#: ../../library/decimal.rst:1824 msgid "" "# Examples from Seminumerical Algorithms, Section 4.2.2.\n" ">>> from decimal import Decimal, getcontext\n" @@ -2608,14 +2860,29 @@ msgid "" ">>> u * (v+w)\n" "Decimal('0.0060000')" msgstr "" +"# Seminumerical Algorithms の 4.2.2 節の例。\n" +">>> from decimal import Decimal, getcontext\n" +">>> getcontext().prec = 8\n" +"\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.5111111')\n" +">>> u + (v + w)\n" +"Decimal('10')\n" +"\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.01')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" -#: ../../library/decimal.rst:1842 msgid "" "The :mod:`!decimal` module makes it possible to restore the identities by " "expanding the precision sufficiently to avoid loss of significance:" msgstr "" +":mod:`!decimal` モジュールでは、桁落ちを避けるのに十分な精度まで拡張すること" +"で、これらの等式を成り立たせることができます:" -#: ../../library/decimal.rst:1845 msgid "" ">>> getcontext().prec = 20\n" ">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" @@ -2630,17 +2897,30 @@ msgid "" ">>> u * (v+w)\n" "Decimal('0.0060000')" msgstr "" +">>> getcontext().prec = 20\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.51111111')\n" +">>> u + (v + w)\n" +"Decimal('9.51111111')\n" +">>>\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.0060000')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" #: ../../library/decimal.rst:1862 msgid "Special values" msgstr "特殊値" -#: ../../library/decimal.rst:1864 msgid "" "The number system for the :mod:`!decimal` module provides special values " "including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " "``+0`` and ``-0``." msgstr "" +":mod:`!decimal` モジュールの数体系には、``NaN``、``sNaN``、``-Infinity``、" +"``Infinity``、そして 2 つのゼロ ``+0`` と ``-0`` という特殊な値があります。" #: ../../library/decimal.rst:1868 msgid "" @@ -2734,7 +3014,6 @@ msgstr "" "ロの大きさはやはりゼロなので、正のゼロと負のゼロは等しいとみなされ、符号は単" "なる参考にすぎません。" -#: ../../library/decimal.rst:1907 msgid "" "In addition to the two signed zeros which are distinct yet equal, there are " "various representations of zero with differing precisions yet equivalent in " @@ -2742,6 +3021,11 @@ msgid "" "normalized floating-point representations, it is not immediately obvious " "that the following calculation returns a value equal to zero:" msgstr "" +"表現が異なっても値が等しいこの 2 つの符号付きゼロに加え、精度は異なっても値は" +"等しいゼロの表現がさまざまにあります。\n" +"これには少し慣れが必要です。\n" +"正規化された浮動小数点表現に慣れていると、次の計算がゼロに等しい値を返すこと" +"は一見して分からないかもしれません:" #: ../../library/decimal.rst:1922 msgid "Working with threads" @@ -2767,15 +3051,17 @@ msgstr "" "同様に、:func:`setcontext` 関数は自動的に引数のコンテキストを現在のスレッドの" "コンテキストに設定します。" -#: ../../library/decimal.rst:1931 msgid "" "If :func:`setcontext` has not been called before :func:`getcontext`, then :" "func:`getcontext` will automatically create a new context for use in the " "current thread. New context objects have default values set from the :data:" "`decimal.DefaultContext` object." msgstr "" +":func:`setcontext` を呼ばずに :func:`getcontext` を呼ぶと、:func:" +"`getcontext` は現在のスレッドで使う新しいコンテキストを自動的に作成します。\n" +"新しいコンテキストオブジェクトのデフォルト値は :data:`decimal." +"DefaultContext` オブジェクトから設定されます。" -#: ../../library/decimal.rst:1936 msgid "" "The :data:`sys.flags.thread_inherit_context` flag affects the context for " "new threads. If the flag is false, new threads will start with an empty " @@ -2784,16 +3070,26 @@ msgid "" "is true, new threads will start with a copy of context from the caller of :" "meth:`threading.Thread.start`." msgstr "" +":data:`sys.flags.thread_inherit_context` フラグは、新しいスレッドのコンテキス" +"トに影響します。\n" +"フラグが偽なら、新しいスレッドは空のコンテキストで開始します。\n" +"この場合、:func:`getcontext` を呼ぶと新しいコンテキストオブジェクトを作成し、" +"*DefaultContext* のデフォルト値を使います。\n" +"フラグが真なら、新しいスレッドは :meth:`threading.Thread.start` の呼び出し元" +"のコンテキストのコピーで開始します。" -#: ../../library/decimal.rst:1943 msgid "" "To control the defaults so that each thread will use the same values " "throughout the application, directly modify the *DefaultContext* object. " "This should be done *before* any threads are started so that there won't be " "a race condition between threads calling :func:`getcontext`. For example::" msgstr "" +"アプリケーション全体で各スレッドが同じデフォルト値を使うようにするには、" +"*DefaultContext* オブジェクトを直接変更してください。\n" +"スレッド間で :func:`getcontext` の呼び出しが競合しないように、どのスレッドも" +"開始する *前に* 変更してください。\n" +"例えば次のようにします。 ::" -#: ../../library/decimal.rst:1948 msgid "" "# Set applicationwide defaults for all threads about to be launched\n" "DefaultContext.prec = 12\n" @@ -2808,6 +3104,19 @@ msgid "" "t3.start()\n" " . . ." msgstr "" +"# これから起動する全スレッドに対するアプリケーション共通のデフォルト値を設定" +"します\n" +"DefaultContext.prec = 12\n" +"DefaultContext.rounding = ROUND_DOWN\n" +"DefaultContext.traps = ExtendedContext.traps.copy()\n" +"DefaultContext.traps[InvalidOperation] = 1\n" +"setcontext(DefaultContext)\n" +"\n" +"# その後、スレッドを開始できます\n" +"t1.start()\n" +"t2.start()\n" +"t3.start()\n" +" . . ." #: ../../library/decimal.rst:1967 msgid "Recipes" @@ -2974,43 +3283,50 @@ msgstr "" msgid "Decimal FAQ" msgstr "Decimal FAQ" -#: ../../library/decimal.rst:2126 msgid "" "Q: It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " "to minimize typing when using the interactive interpreter?" msgstr "" +"Q: ``decimal.Decimal('1234.5')`` と入力するのは面倒です。\n" +"対話型インタープリタを使うときに入力を減らす方法はありますか?" -#: ../../library/decimal.rst:2129 msgid "A: Some users abbreviate the constructor to just a single letter:" -msgstr "" +msgstr "A: コンストラクタを 1 文字に省略して使う人もいます:" -#: ../../library/decimal.rst:2135 msgid "" "Q: In a fixed-point application with two decimal places, some inputs have " "many places and need to be rounded. Others are not supposed to have excess " "digits and need to be validated. What methods should be used?" msgstr "" +"Q: 小数点以下 2 桁を扱う固定小数点のアプリケーションで、桁数が多くて丸める必" +"要がある入力があります。\n" +"一方、余分な桁がないはずなので検証が必要な入力もあります。\n" +"どのメソッドを使えばよいですか?" -#: ../../library/decimal.rst:2139 msgid "" "A: The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " "places. If the :const:`Inexact` trap is set, it is also useful for " "validation:" msgstr "" +"A: :meth:`~Decimal.quantize` メソッドは小数点以下の桁数を固定して丸めます。\n" +":const:`Inexact` トラップを設定すれば、検証にも使えます:" -#: ../../library/decimal.rst:2157 msgid "" "Q: Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" msgstr "" +"Q: 小数点以下 2 桁の有効な入力を得た後、アプリケーション全体でこの条件を保つ" +"にはどうすればよいですか?" -#: ../../library/decimal.rst:2160 msgid "" "A: Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " "division and non-integer multiplication, will change the number of decimal " "places and need to be followed-up with a :meth:`~Decimal.quantize` step:" msgstr "" +"A: 加算、減算、整数との乗算などは、自動的に小数点の位置を保ちます。\n" +"除算や整数以外との乗算などは小数点以下の桁数を変えるので、その後に :meth:" +"`~Decimal.quantize` を適用する必要があります:" #: ../../library/decimal.rst:2178 msgid "" @@ -3020,25 +3336,27 @@ msgstr "" "固定小数点のアプリケーションを開発する際は、 :meth:`~Decimal.quantize` の段階" "を扱う関数を定義しておくと便利です:" -#: ../../library/decimal.rst:2192 msgid "" "Q: There are many ways to express the same value. The numbers ``200``, " "``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " "precisions. Is there a way to transform them to a single recognizable " "canonical value?" msgstr "" +"Q: 同じ値を表す方法がたくさんあります。\n" +"``200``、``200.000``、``2E2``、``.02E+4`` はすべて、精度は異なりますが同じ値" +"です。\n" +"これらを 1 つの分かりやすい標準形に変換する方法はありますか?" -#: ../../library/decimal.rst:2197 msgid "" "A: The :meth:`~Decimal.normalize` method maps all equivalent values to a " "single representative:" msgstr "" +"A: :meth:`~Decimal.normalize` メソッドは、等しい値をすべて 1 つの代表値に変換" +"します:" -#: ../../library/decimal.rst:2204 msgid "Q: When does rounding occur in a computation?" -msgstr "" +msgstr "Q: 計算のどの段階で丸めが行われますか?" -#: ../../library/decimal.rst:2206 msgid "" "A: It occurs *after* the computation. The philosophy of the decimal " "specification is that numbers are considered exact and are created " @@ -3047,6 +3365,12 @@ msgid "" "rounding (or other context operations) is applied to the *result* of the " "computation::" msgstr "" +"A: 計算の *後に* 行われます。\n" +"十進演算仕様の考え方では、数値は正確なものとみなし、現在のコンテキストとは無" +"関係に作成します。\n" +"現在のコンテキストより高い精度を持つこともあります。\n" +"計算はこれらの正確な入力を使って行い、その *結果* に丸めなどのコンテキストの" +"操作を適用します。 ::" #: ../../library/decimal.rst:2213 msgid "" @@ -3062,19 +3386,22 @@ msgid "" "Decimal('3.1416')" msgstr "" -#: ../../library/decimal.rst:2224 msgid "" "Q: Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" msgstr "" +"Q: 10 進数の中には常に指数表記で表示される値があります。\n" +"指数を使わない表現にする方法はありますか?" -#: ../../library/decimal.rst:2227 msgid "" "A: For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing " "``5.0E+3`` as ``5000`` keeps the value constant but cannot show the " "original's two-place significance." msgstr "" +"A: 値によっては、係数の有効桁数を表現するには指数表記が必要です。\n" +"例えば ``5.0E+3`` を ``5000`` と表しても値は変わりませんが、元の数値の有効桁" +"数が 2 桁であることは示せません。" #: ../../library/decimal.rst:2232 msgid "" @@ -3085,45 +3412,52 @@ msgstr "" "もしアプリケーションが有効数字の追跡を等閑視するならば、指数部や末尾のゼロを" "取り除き、有効数字を忘れ、しかし値を変えずにおくことは容易です:" -#: ../../library/decimal.rst:2242 msgid "Q: Is there a way to convert a regular float to a :class:`Decimal`?" -msgstr "" +msgstr "Q: 通常の float を :class:`Decimal` に変換する方法はありますか?" -#: ../../library/decimal.rst:2244 msgid "" "A: Yes, any binary floating-point number can be exactly expressed as a " "Decimal though an exact conversion may take more precision than intuition " "would suggest:" msgstr "" +"A: はい。\n" +"どの 2 進浮動小数点数も Decimal で正確に表現できます。\n" +"ただし、正確な変換には直感的に思う以上の精度が必要になることがあります:" -#: ../../library/decimal.rst:2248 msgid "" ">>> Decimal(math.pi)\n" "Decimal('3.141592653589793115997963468544185161590576171875')" msgstr "" +">>> Decimal(math.pi)\n" +"Decimal('3.141592653589793115997963468544185161590576171875')" -#: ../../library/decimal.rst:2253 msgid "" "Q: Within a complex calculation, how can I make sure that I haven't gotten a " "spurious result because of insufficient precision or rounding anomalies." msgstr "" +"Q: 複雑な計算で、精度不足や丸めの異常によって誤った結果が出ていないかを確認す" +"るにはどうすればよいですか?" -#: ../../library/decimal.rst:2256 msgid "" "A: The decimal module makes it easy to test results. A best practice is to " "re-run calculations using greater precision and with various rounding modes. " "Widely differing results indicate insufficient precision, rounding mode " "issues, ill-conditioned inputs, or a numerically unstable algorithm." msgstr "" +"A: decimal モジュールを使うと、結果を簡単に検証できます。\n" +"より高い精度とさまざまな丸めモードで再計算するのがよい方法です。\n" +"結果が大きく異なる場合は、精度の不足、丸めモードの問題、条件の悪い入力、また" +"は数値的に不安定なアルゴリズムが疑われます。" -#: ../../library/decimal.rst:2261 msgid "" "Q: I noticed that context precision is applied to the results of operations " "but not to the inputs. Is there anything to watch out for when mixing " "values of different precisions?" msgstr "" +"Q: コンテキストの精度は演算結果に適用され、入力には適用されないことが分かりま" +"した。\n" +"精度の異なる値を混ぜて使うときに、注意することはありますか?" -#: ../../library/decimal.rst:2265 msgid "" "A: Yes. The principle is that all values are considered to be exact and so " "is the arithmetic on those values. Only the results are rounded. The " @@ -3131,8 +3465,14 @@ msgid "" "disadvantage is that the results can look odd if you forget that the inputs " "haven't been rounded:" msgstr "" +"A: はい。\n" +"原則としてすべての値は正確なものとみなし、それらに対する算術演算も正確に行い" +"ます。\n" +"丸めるのは結果だけです。\n" +"入力については、入力したとおりの値が得られるという利点があります。\n" +"一方、入力が丸められていないことを忘れると、結果が奇妙に見えるという欠点があ" +"ります:" -#: ../../library/decimal.rst:2270 msgid "" ">>> getcontext().prec = 3\n" ">>> Decimal('3.104') + Decimal('2.104')\n" @@ -3140,6 +3480,11 @@ msgid "" ">>> Decimal('3.104') + Decimal('0.000') + Decimal('2.104')\n" "Decimal('5.20')" msgstr "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.104') + Decimal('2.104')\n" +"Decimal('5.21')\n" +">>> Decimal('3.104') + Decimal('0.000') + Decimal('2.104')\n" +"Decimal('5.20')" #: ../../library/decimal.rst:2278 msgid "" @@ -3149,12 +3494,14 @@ msgstr "" "解決策は、精度を増やすか、単項プラス演算子を使って入力の丸めを強制することで" "す:" -#: ../../library/decimal.rst:2281 msgid "" ">>> getcontext().prec = 3\n" ">>> +Decimal('1.23456789') # unary plus triggers rounding\n" "Decimal('1.23')" msgstr "" +">>> getcontext().prec = 3\n" +">>> +Decimal('1.23456789') # 単項プラスで丸めます\n" +"Decimal('1.23')" #: ../../library/decimal.rst:2287 msgid "" @@ -3164,11 +3511,9 @@ msgstr "" "もしくは、入力を :meth:`Context.create_decimal` を使って生成時に丸めてしまう" "こともできます:" -#: ../../library/decimal.rst:2293 msgid "Q: Is the CPython implementation fast for large numbers?" -msgstr "" +msgstr "Q: CPython の実装は大きな数でも高速ですか?" -#: ../../library/decimal.rst:2295 msgid "" "A: Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " "the decimal module integrate the high speed `libmpdec `_ for very " "large numbers." msgstr "" +"A: はい。\n" +"CPython と PyPy3 の実装では、decimal モジュールの C/CFFI 版に、任意精度で正し" +"く丸められる 10 進浮動小数点演算の高速ライブラリ `libmpdec `_ を組み込んでいます [#]_。\n" +"``libmpdec`` は中程度の大きさの数に `Karatsuba 法による乗算 `_ を、非常に大きな数に `数論変換 " +"`_ を使います。" -#: ../../library/decimal.rst:2305 msgid "" "The context must be adapted for exact arbitrary precision arithmetic. :attr:" "`~Context.Emin` and :attr:`~Context.Emax` should always be set to the " "maximum values, :attr:`~Context.clamp` should always be 0 (the default). " "Setting :attr:`~Context.prec` requires some care." msgstr "" +"正確な任意精度演算を行うには、コンテキストを調整する必要があります。\n" +":attr:`~Context.Emin` と :attr:`~Context.Emax` は常に範囲が最大になる値に設定" +"し、:attr:`~Context.clamp` は常に 0 (デフォルト) にしてください。\n" +":attr:`~Context.prec` の設定には少し注意が必要です。" -#: ../../library/decimal.rst:2309 msgid "" "The easiest approach for trying out bignum arithmetic is to use the maximum " "value for :attr:`~Context.prec` as well [#]_::" msgstr "" +"多倍長整数の演算を試す最も簡単な方法は、:attr:`~Context.prec` にも最大値を使" +"うことです [#]_。 ::" -#: ../../library/decimal.rst:2312 msgid "" ">>> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" ">>> x = Decimal(2) ** 256\n" ">>> x / 128\n" "Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" msgstr "" +">>> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" +">>> x = Decimal(2) ** 256\n" +">>> x / 128\n" +"Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" -#: ../../library/decimal.rst:2318 msgid "" "For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms " "and the available memory will be insufficient::" msgstr "" +"結果が不正確な場合、64 ビットプラットフォームでは :const:`MAX_PREC` が大きす" +"ぎるため、利用可能なメモリが足りなくなります。 ::" -#: ../../library/decimal.rst:2321 msgid "" ">>> Decimal(1) / 3\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "MemoryError" msgstr "" +">>> Decimal(1) / 3\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"MemoryError" -#: ../../library/decimal.rst:2326 msgid "" "On systems with overallocation (e.g. Linux), a more sophisticated approach " "is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose " "that you have 8GB of RAM and expect 10 simultaneous operands using a maximum " "of 500MB each::" msgstr "" +"メモリの過剰割り当てを行うシステム (Linux など) では、利用可能な RAM の容量に" +"合わせて :attr:`~Context.prec` を調整する方が適切です。\n" +"RAM が 8 GB あり、それぞれ最大 500 MB の演算対象を同時に 10 個使うことを想定" +"しているとします。 ::" -#: ../../library/decimal.rst:2330 msgid "" ">>> import sys\n" ">>>\n" @@ -3248,15 +3614,37 @@ msgid "" " File \"\", line 1, in \n" " decimal.Inexact: []" msgstr "" +">>> import sys\n" +">>>\n" +">>> # 1 つの演算対象が 8 バイトのワード単位で 500 MB を使う場合の最大桁数\n" +">>> # 1 ワードは 19 桁 (32 ビットビルドでは 4 バイトで 9 桁):\n" +">>> maxdigits = 19 * ((500 * 1024**2) // 8)\n" +">>>\n" +">>> # 動作を確認します:\n" +">>> c = Context(prec=maxdigits, Emax=MAX_EMAX, Emin=MIN_EMIN)\n" +">>> c.traps[Inexact] = True\n" +">>> setcontext(c)\n" +">>>\n" +">>> # 利用可能な精度を 9 で埋めます:\n" +">>> x = Decimal(0).logical_invert() * 9\n" +">>> sys.getsizeof(x)\n" +"524288112\n" +">>> x + 2\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" decimal.Inexact: []" -#: ../../library/decimal.rst:2350 msgid "" "In general (and especially on systems without overallocation), it is " "recommended to estimate even tighter bounds and set the :attr:`Inexact` trap " "if all calculations are expected to be exact." msgstr "" +"すべての計算が正確になるはずなら、一般に (特に過剰割り当てを行わないシステム" +"では)、さらに厳密な上限を見積もり、:attr:`Inexact` トラップを設定することを推" +"奨します。" -#: ../../library/decimal.rst:2359 msgid "" "This approach now works for all exact results except for non-integer powers." msgstr "" +"この方法は、指数が整数でないべき乗を除くすべての正確な結果で使えるようになり" +"ました。" diff --git a/library/devmode.po b/library/devmode.po index cad45ed5d..df1e7aeaa 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -27,23 +27,27 @@ msgstr "" msgid "Python Development Mode" msgstr "Python 開発モード" -#: ../../library/devmode.rst:8 msgid "" "The Python Development Mode introduces additional runtime checks that are " "too expensive to be enabled by default. It should not be more verbose than " "the default if the code is correct; new warnings are only emitted when an " "issue is detected." msgstr "" +"Python 開発モードは、コストが高すぎてデフォルトでは有効にできない追加の実行時" +"チェックを行います。\n" +"コードが正しければ、デフォルトより多くのメッセージが表示されることはないはず" +"です。\n" +"問題を検出したときだけ新たな警告を出します。" -#: ../../library/devmode.rst:13 msgid "" "It can be enabled using the :option:`-X dev <-X>` command line option or by " "setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``." msgstr "" +":option:`-X dev <-X>` コマンドラインオプションを使うか、:envvar:" +"`PYTHONDEVMODE` 環境変数を ``1`` に設定すると有効にできます。" -#: ../../library/devmode.rst:16 msgid "See also :ref:`Python debug build `." -msgstr "" +msgstr ":ref:`Python のデバッグビルド ` も参照してください。" #: ../../library/devmode.rst:19 msgid "Effects of the Python Development Mode" @@ -99,107 +103,117 @@ msgstr "" "通常、上記の警告は デフォルトの :ref:`警告フィルタ ` によりフィルタリングされます。" -#: ../../library/devmode.rst:39 msgid "" "It behaves as if the :option:`-W default <-W>` command line option is used." msgstr "" +":option:`-W default <-W>` コマンドラインオプションを使った場合と同じ動作にな" +"ります。" -#: ../../library/devmode.rst:41 msgid "" "Use the :option:`-W error <-W>` command line option or set the :envvar:" "`PYTHONWARNINGS` environment variable to ``error`` to treat warnings as " "errors." msgstr "" +"警告をエラーとして扱うには、:option:`-W error <-W>` コマンドラインオプション" +"を使うか、:envvar:`PYTHONWARNINGS` 環境変数を ``error`` に設定してください。" -#: ../../library/devmode.rst:45 msgid "Install debug hooks on memory allocators to check for:" -msgstr "" +msgstr "メモリアロケーターにデバッグフックを設定し、次の問題をチェックします:" -#: ../../library/devmode.rst:47 msgid "Buffer underflow" -msgstr "" +msgstr "バッファーアンダーフロー" -#: ../../library/devmode.rst:48 msgid "Buffer overflow" -msgstr "" +msgstr "バッファーオーバーフロー" -#: ../../library/devmode.rst:49 msgid "Memory allocator API violation" -msgstr "" +msgstr "メモリアロケーター API の規則違反" -#: ../../library/devmode.rst:50 msgid "Unsafe usage of the GIL" -msgstr "" +msgstr "GIL の安全でない使用" -#: ../../library/devmode.rst:52 msgid "See the :c:func:`PyMem_SetupDebugHooks` C function." -msgstr "" +msgstr "C 関数 :c:func:`PyMem_SetupDebugHooks` を参照してください。" -#: ../../library/devmode.rst:54 msgid "" "It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to " "``debug``." msgstr "" +":envvar:`PYTHONMALLOC` 環境変数を ``debug`` に設定した場合と同じ動作になりま" +"す。" -#: ../../library/devmode.rst:57 msgid "" "To enable the Python Development Mode without installing debug hooks on " "memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to " "``default``." msgstr "" +"メモリアロケーターにデバッグフックを設定せずに Python 開発モードを有効にする" +"には、:envvar:`PYTHONMALLOC` 環境変数を ``default`` に設定してください。" -#: ../../library/devmode.rst:61 msgid "" "Call :func:`faulthandler.enable` at Python startup to install handlers for " "the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal." "SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to " "dump the Python traceback on a crash." msgstr "" +"Python 起動時に :func:`faulthandler.enable` を呼び、:const:`~signal." +"SIGSEGV`、:const:`~signal.SIGFPE`、:const:`~signal.SIGABRT`、:const:`~signal." +"SIGBUS`、:const:`~signal.SIGILL` シグナルのハンドラーを設定して、クラッシュ時" +"に Python のトレースバックを出力します。" -#: ../../library/devmode.rst:66 msgid "" "It behaves as if the :option:`-X faulthandler <-X>` command line option is " "used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to " "``1``." msgstr "" +":option:`-X faulthandler <-X>` コマンドラインオプションを使うか、:envvar:" +"`PYTHONFAULTHANDLER` 環境変数を ``1`` に設定した場合と同じ動作になります。" -#: ../../library/devmode.rst:70 msgid "" "Enable :ref:`asyncio debug mode `. For example, :mod:" "`asyncio` checks for coroutines that were not awaited and logs them." msgstr "" +":ref:`asyncio のデバッグモード ` を有効にします。\n" +"例えば :mod:`asyncio` は await されなかったコルーチンを検出してログに記録しま" +"す。" -#: ../../library/devmode.rst:73 msgid "" "It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is " "set to ``1``." msgstr "" +":envvar:`PYTHONASYNCIODEBUG` 環境変数を ``1`` に設定した場合と同じ動作になり" +"ます。" -#: ../../library/devmode.rst:76 msgid "" "Check the *encoding* and *errors* arguments for string encoding and decoding " "operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes." "decode`." msgstr "" +"文字列のエンコードとデコードで *encoding* と *errors* 引数をチェックしま" +"す。\n" +"対象の例として :func:`open`、:meth:`str.encode`、:meth:`bytes.decode` があり" +"ます。" -#: ../../library/devmode.rst:80 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings." msgstr "" +"デフォルトでは性能を優先するため、*errors* 引数は最初のエンコードまたはデコー" +"ドのエラー時にだけチェックし、空文字列では *encoding* 引数を無視する場合があ" +"ります。" -#: ../../library/devmode.rst:84 msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." msgstr "" +":class:`io.IOBase` のデストラクタが ``close()`` の例外をログに記録します。" -#: ../../library/devmode.rst:85 msgid "" "Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " "``True``." msgstr "" +":data:`sys.flags` の :attr:`~sys.flags.dev_mode` 属性を ``True`` に設定しま" +"す。" -#: ../../library/devmode.rst:88 msgid "" "The Python Development Mode does not enable the :mod:`tracemalloc` module by " "default, because the overhead cost (to performance and memory) would be too " @@ -209,39 +223,51 @@ msgid "" "buffer overflow error logs the traceback where the memory block was " "allocated." msgstr "" +"Python 開発モードでは、性能とメモリのオーバーヘッドが大きすぎるため、:mod:" +"`tracemalloc` モジュールをデフォルトでは有効にしません。\n" +":mod:`tracemalloc` モジュールを有効にすると、一部のエラーの発生元に関する追加" +"情報が得られます。\n" +"例えば :exc:`ResourceWarning` はリソース割り当て時のトレースバックを記録し、" +"バッファーオーバーフローのエラーはメモリブロック割り当て時のトレースバックを" +"記録します。" -#: ../../library/devmode.rst:95 msgid "" "The Python Development Mode does not prevent the :option:`-O` command line " "option from removing :keyword:`assert` statements nor from setting :const:" "`__debug__` to ``False``." msgstr "" +"Python 開発モードを有効にしても、:option:`-O` コマンドラインオプションによ" +"る :keyword:`assert` 文の削除や、:const:`__debug__` の ``False`` への設定は妨" +"げられません。" -#: ../../library/devmode.rst:99 msgid "" "The Python Development Mode can only be enabled at the Python startup. Its " "value can be read from :data:`sys.flags.dev_mode `." msgstr "" +"Python 開発モードは Python 起動時にのみ有効にできます。\n" +"その値は :data:`sys.flags.dev_mode ` から取得できます。" -#: ../../library/devmode.rst:102 msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." msgstr "" +":class:`io.IOBase` のデストラクタが ``close()`` の例外をログに記録するように" +"なりました。" -#: ../../library/devmode.rst:105 msgid "" "The *encoding* and *errors* arguments are now checked for string encoding " "and decoding operations." msgstr "" +"文字列のエンコードとデコードで *encoding* と *errors* 引数をチェックするよう" +"になりました。" #: ../../library/devmode.rst:111 msgid "ResourceWarning Example" msgstr "ResourceWarning の例" -#: ../../library/devmode.rst:113 msgid "" "Example of a script counting the number of lines of the text file specified " "in the command line::" msgstr "" +"コマンドラインで指定したテキストファイルの行数を数えるスクリプトの例です。 ::" #: ../../library/devmode.rst:116 msgid "" @@ -267,11 +293,13 @@ msgstr "" "if __name__ == \"__main__\":\n" " main()" -#: ../../library/devmode.rst:127 msgid "" "The script does not close the file explicitly. By default, Python does not " "emit any warning. Example using README.txt, which has 269 lines:" msgstr "" +"このスクリプトはファイルを明示的に閉じていません。\n" +"デフォルトでは Python は警告を出しません。\n" +"269 行の README.txt を使った例です:" #: ../../library/devmode.rst:130 msgid "" @@ -281,11 +309,11 @@ msgstr "" "$ python script.py README.txt\n" "269" -#: ../../library/devmode.rst:135 msgid "" "Enabling the Python Development Mode displays a :exc:`ResourceWarning` " "warning:" msgstr "" +"Python 開発モードを有効にすると :exc:`ResourceWarning` 警告が表示されます:" #: ../../library/devmode.rst:137 msgid "" @@ -303,11 +331,11 @@ msgstr "" " main()\n" "ResourceWarning: Enable tracemalloc to get the object allocation traceback" -#: ../../library/devmode.rst:145 msgid "" "In addition, enabling :mod:`tracemalloc` shows the line where the file was " "opened:" msgstr "" +"さらに :mod:`tracemalloc` を有効にすると、ファイルを開いた行が表示されます:" #: ../../library/devmode.rst:148 msgid "" @@ -333,10 +361,11 @@ msgstr "" " File \"script.py\", lineno 4\n" " fp = open(sys.argv[1])" -#: ../../library/devmode.rst:160 msgid "" "The fix is to close explicitly the file. Example using a context manager::" msgstr "" +"ファイルを明示的に閉じれば修正できます。\n" +"コンテキストマネージャを使った例です。 ::" #: ../../library/devmode.rst:162 msgid "" @@ -352,21 +381,23 @@ msgstr "" " nlines = len(fp.readlines())\n" " print(nlines)" -#: ../../library/devmode.rst:168 msgid "" "Not closing a resource explicitly can leave a resource open for way longer " "than expected; it can cause severe issues upon exiting Python. It is bad in " "CPython, but it is even worse in PyPy. Closing resources explicitly makes an " "application more deterministic and more reliable." msgstr "" +"リソースを明示的に閉じないと、予想よりずっと長い間開いたままになり、Python 終" +"了時に重大な問題を起こすことがあります。\n" +"CPython でも問題ですが、PyPy ではさらに深刻です。\n" +"リソースを明示的に閉じることで、アプリケーションの動作がより確定的になり、信" +"頼性も高まります。" -#: ../../library/devmode.rst:175 msgid "Bad file descriptor error example" -msgstr "" +msgstr "Bad file descriptor エラーの例" -#: ../../library/devmode.rst:177 msgid "Script displaying the first line of itself::" -msgstr "" +msgstr "自分自身の最初の行を表示するスクリプトです。 ::" #: ../../library/devmode.rst:179 msgid "" @@ -392,9 +423,8 @@ msgstr "" "\n" "main()" -#: ../../library/devmode.rst:190 msgid "By default, Python does not emit any warning:" -msgstr "" +msgstr "デフォルトでは Python は警告を出しません:" #: ../../library/devmode.rst:192 msgid "" @@ -404,11 +434,12 @@ msgstr "" "$ python script.py\n" "import os" -#: ../../library/devmode.rst:197 msgid "" "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " "file descriptor\" error when finalizing the file object:" msgstr "" +"Python 開発モードでは :exc:`ResourceWarning` が表示され、ファイルオブジェクト" +"のファイナライズ時に \"Bad file descriptor\" エラーがログに記録されます:" #: ../../library/devmode.rst:200 msgid "" @@ -438,7 +469,6 @@ msgstr "" " main()\n" "OSError: [Errno 9] Bad file descriptor" -#: ../../library/devmode.rst:213 msgid "" "``os.close(fp.fileno())`` closes the file descriptor. When the file object " "finalizer tries to close the file descriptor again, it fails with the ``Bad " @@ -446,9 +476,16 @@ msgid "" "worst case scenario, closing it twice can lead to a crash (see :issue:" "`18748` for an example)." msgstr "" +"``os.close(fp.fileno())`` はファイル記述子を閉じます。\n" +"ファイルオブジェクトのファイナライザーがそのファイル記述子を再度閉じようとす" +"ると、``Bad file descriptor`` エラーで失敗します。\n" +"ファイル記述子は 1 回だけ閉じなければなりません。\n" +"2 回閉じると、最悪の場合クラッシュすることがあります (例として :issue:" +"`18748` を参照してください)。" -#: ../../library/devmode.rst:219 msgid "" "The fix is to remove the ``os.close(fp.fileno())`` line, or open the file " "with ``closefd=False``." msgstr "" +"``os.close(fp.fileno())`` の行を削除するか、``closefd=False`` を指定してファ" +"イルを開けば修正できます。" diff --git a/library/dialog.po b/library/dialog.po index 2047e04e4..a058e3ef5 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -22,31 +22,30 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/dialog.rst:2 msgid "Tkinter dialogs" -msgstr "" +msgstr "Tkinter のダイアログ" -#: ../../library/dialog.rst:5 msgid ":mod:`!tkinter.simpledialog` --- Standard Tkinter input dialogs" -msgstr "" +msgstr ":mod:`!tkinter.simpledialog` --- Tkinter の標準入力ダイアログ" #: ../../library/dialog.rst:10 msgid "**Source code:** :source:`Lib/tkinter/simpledialog.py`" msgstr "**ソースコード:** :source:`Lib/tkinter/simpledialog.py`" -#: ../../library/dialog.rst:14 msgid "" "The :mod:`!tkinter.simpledialog` module contains convenience classes and " "functions for creating simple modal dialogs to get a value from the user." msgstr "" +":mod:`!tkinter.simpledialog` モジュールには、ユーザーから値を受け取るための単" +"純なモーダルダイアログを作る便利なクラスと関数があります。" -#: ../../library/dialog.rst:22 msgid "" "Prompt the user to enter a value of the desired type and return it, or " "``None`` if the dialog is cancelled." msgstr "" +"指定した型の値を入力するようユーザーに促し、その値を返します。\n" +"ダイアログをキャンセルした場合は ``None`` を返します。" -#: ../../library/dialog.rst:25 msgid "" "*title* is the dialog title and *prompt* the message shown above the entry. " "*initialvalue* is the value initially placed in the entry. *parent* is the " @@ -55,26 +54,38 @@ msgid "" "value. :func:`askstring` also accepts *show*, a character used to mask the " "entered text, for example ``'*'`` to hide a password." msgstr "" +"*title* はダイアログのタイトル、*prompt* は入力欄の上に表示するメッセージで" +"す。\n" +"*initialvalue* は入力欄の初期値です。\n" +"*parent* はダイアログの背後に置くウィンドウです。\n" +":func:`askinteger` と :func:`askfloat` は、入力値の範囲を制限する *minvalue* " +"と *maxvalue* も受け付けます。\n" +":func:`askstring` は、入力されたテキストを隠す文字を指定する *show* も受け付" +"けます。\n" +"例えばパスワードを隠すには ``'*'`` を指定します。" -#: ../../library/dialog.rst:35 msgid "" "The base class for custom dialogs. Instantiating it shows the dialog modally " "and returns once the user closes it; the entered value is then available in " "the :attr:`!result` attribute." msgstr "" +"独自のダイアログの基底クラスです。\n" +"インスタンス化するとダイアログをモーダルに表示し、ユーザーが閉じると戻りま" +"す。\n" +"入力された値は :attr:`!result` 属性から取得できます。" -#: ../../library/dialog.rst:41 msgid "" "The value produced by :meth:`apply`, or ``None`` if the dialog was cancelled." msgstr "" +":meth:`apply` が生成した値、またはダイアログがキャンセルされた場合は " +"``None``。" -#: ../../library/dialog.rst:46 msgid "" "Override to construct the dialog's interface and return the widget that " "should have initial focus." msgstr "" -"ダイアログインターフェースの構築をオーバーライドし、初期フォーカスを持つべき" -"ウィジットを返します。" +"このメソッドをオーバーライドしてダイアログのインターフェースを構築し、初期" +"フォーカスを持たせるウィジェットを返してください。" #: ../../library/dialog.rst:51 msgid "" @@ -84,29 +95,37 @@ msgstr "" "デフォルト動作はOKとCancelボタンを追加します。カスタムのボタンレイアウトが必" "要であればオーバーライドします。" -#: ../../library/dialog.rst:56 msgid "" "Validate the data entered by the user. Return true if it is valid, in which " "case the dialog proceeds to :meth:`apply`; return false to keep the dialog " "open. The default implementation always returns true; override it to check " "the input." msgstr "" +"ユーザーが入力したデータを検証します。\n" +"有効なら真を返し、ダイアログは :meth:`apply` の処理に進みます。\n" +"偽を返すとダイアログを開いたままにします。\n" +"デフォルトの実装は常に真を返します。\n" +"入力をチェックするにはオーバーライドしてください。" -#: ../../library/dialog.rst:64 msgid "" "Process the data entered by the user, for example by storing it in the :attr:" "`!result` attribute. Called after :meth:`validate` succeeds and just before " "the dialog is destroyed. The default implementation does nothing; override " "it to act on or store the result." msgstr "" +"ユーザーが入力したデータを、例えば :attr:`!result` 属性に保存するなどして処理" +"します。\n" +":meth:`validate` が成功した後、ダイアログが破棄される直前に呼ばれます。\n" +"デフォルトの実装は何もしません。\n" +"結果を使って処理したり保存したりするにはオーバーライドしてください。" -#: ../../library/dialog.rst:73 msgid "" "Destroy the dialog window, clearing the reference to the widget that had the " "initial focus." msgstr "" +"ダイアログウィンドウを破棄し、初期フォーカスを持っていたウィジェットへの参照" +"をクリアします。" -#: ../../library/dialog.rst:79 msgid "" "A simple modal dialog that displays the message *text* above a row of push " "buttons whose labels are given by *buttons*, and returns the index of the " @@ -115,30 +134,36 @@ msgid "" "through the window manager, *title* the window title, and *class_* the Tk " "class name of the window." msgstr "" +"*buttons* でラベルを指定したボタンを横に並べ、その上にメッセージ *text* を表" +"示する単純なモーダルダイアログです。\n" +"ユーザーが押したボタンのインデックスを返します。\n" +"*default* は Return キーで作動するボタンのインデックス、*cancel* はウィンドウ" +"マネージャからウィンドウを閉じたときに返すインデックス、*title* はウィンドウ" +"のタイトル、*class_* はウィンドウの Tk クラス名です。" -#: ../../library/dialog.rst:88 msgid "" "Display the dialog, wait until the user presses a button or closes the " "window, and return the index of the chosen button." msgstr "" +"ダイアログを表示し、ユーザーがボタンを押すかウィンドウを閉じるまで待って、選" +"択されたボタンのインデックスを返します。" -#: ../../library/dialog.rst:94 msgid ":mod:`!tkinter.filedialog` --- File selection dialogs" -msgstr "" +msgstr ":mod:`!tkinter.filedialog` --- ファイル選択ダイアログ" #: ../../library/dialog.rst:99 msgid "**Source code:** :source:`Lib/tkinter/filedialog.py`" msgstr "**ソースコード:** :source:`Lib/tkinter/filedialog.py`" -#: ../../library/dialog.rst:103 msgid "" "The :mod:`!tkinter.filedialog` module provides classes and factory functions " "for creating file/directory selection windows." msgstr "" +":mod:`!tkinter.filedialog` モジュールは、ファイルやディレクトリの選択ウィンド" +"ウを作るクラスとファクトリ関数を提供します。" -#: ../../library/dialog.rst:107 msgid "Native load/save dialogs" -msgstr "" +msgstr "ネイティブの読み込み・保存ダイアログ" #: ../../library/dialog.rst:109 msgid "" @@ -188,7 +213,6 @@ msgstr "*multiple* - 真の場合、複数要素の選択を許可します" msgid "**Static factory functions**" msgstr "**静的なファクトリ関数**" -#: ../../library/dialog.rst:131 msgid "" "The below functions when called create a modal, native look-and-feel dialog, " "wait for the user's selection, and return it. The exact return value depends " @@ -197,192 +221,208 @@ msgid "" "vary between platforms and Tk versions, so test the result for truth rather " "than comparing it with a specific value." msgstr "" +"以下の関数を呼ぶと、ネイティブのルックアンドフィールを持つモーダルダイアログ" +"を作り、ユーザーの選択を待って、その結果を返します。\n" +"具体的な返り値は関数によって異なります (以下を参照)。\n" +"ダイアログをキャンセルした場合は空文字列、空タプル、または ``None`` になりま" +"す。\n" +"この空の値の型はプラットフォームや Tk のバージョンによって異なる場合があるた" +"め、特定の値と比較するのではなく、結果の真偽値を調べてください。" -#: ../../library/dialog.rst:142 msgid "" "Create an :class:`Open` dialog. :func:`askopenfile` returns the opened file " "object, or ``None`` if the dialog is cancelled. :func:`askopenfiles` returns " "a list of the opened file objects, or an empty tuple if cancelled. The files " "are opened in mode *mode* (read-only ``'r'`` by default)." msgstr "" +":class:`Open` ダイアログを作ります。\n" +":func:`askopenfile` は開いたファイルオブジェクトを返し、ダイアログをキャンセ" +"ルした場合は ``None`` を返します。\n" +":func:`askopenfiles` は開いたファイルオブジェクトのリストを返し、キャンセルし" +"た場合は空タプルを返します。\n" +"ファイルは *mode* で指定したモード (デフォルトは読み取り専用の ``'r'``) で開" +"きます。" -#: ../../library/dialog.rst:151 msgid "" "Create a :class:`SaveAs` dialog and return the opened file object, or " "``None`` if the dialog is cancelled. The file is opened in mode *mode* " "(``'w'`` by default)." msgstr "" +":class:`SaveAs` ダイアログを作り、開いたファイルオブジェクトを返します。\n" +"ダイアログをキャンセルした場合は ``None`` を返します。\n" +"ファイルは *mode* で指定したモード (デフォルトは ``'w'``) で開きます。" -#: ../../library/dialog.rst:158 msgid "" "Create an :class:`Open` dialog. :func:`askopenfilename` returns the selected " "filename as a string, or an empty string if the dialog is cancelled. :func:" "`askopenfilenames` returns a tuple of the selected filenames, or an empty " "tuple if cancelled." msgstr "" +":class:`Open` ダイアログを作ります。\n" +":func:`askopenfilename` は選択したファイル名を文字列として返し、ダイアログを" +"キャンセルした場合は空文字列を返します。\n" +":func:`askopenfilenames` は選択したファイル名のタプルを返し、キャンセルした場" +"合は空タプルを返します。" -#: ../../library/dialog.rst:166 msgid "" "Create a :class:`SaveAs` dialog and return the selected filename as a " "string, or an empty string if the dialog is cancelled." msgstr "" +":class:`SaveAs` ダイアログを作り、選択したファイル名を文字列として返しま" +"す。\n" +"ダイアログをキャンセルした場合は空文字列を返します。" -#: ../../library/dialog.rst:171 msgid "" "Prompt the user to select a directory, and return its path as a string, or " "an empty string if the dialog is cancelled. Additional keyword option: " "*mustexist* - if true, the user may only select an existing directory (false " "by default)." msgstr "" +"ユーザーにディレクトリを選択するよう促し、そのパスを文字列として返します。\n" +"ダイアログをキャンセルした場合は空文字列を返します。\n" +"追加のキーワードオプション *mustexist* を真にすると、ユーザーは既存のディレク" +"トリだけを選択できます (デフォルトは偽)。" -#: ../../library/dialog.rst:180 msgid "" "The above three classes provide native dialog windows for loading and saving " "files and for selecting a directory." msgstr "" +"上記の 3 つのクラスは、ファイルの読み込み・保存とディレクトリの選択に使うネイ" +"ティブのダイアログウィンドウを提供します。" #: ../../library/dialog.rst:183 msgid "**Convenience classes**" msgstr "**便利なクラス**" -#: ../../library/dialog.rst:185 msgid "" "The below classes are used for creating file/directory windows from scratch. " "These do not emulate the native look-and-feel of the platform." msgstr "" +"以下のクラスは、ファイルやディレクトリのウィンドウを一から作るために使いま" +"す。\n" +"プラットフォームのネイティブのルックアンドフィールは再現しません。" -#: ../../library/dialog.rst:188 msgid "" "The *FileDialog* class should be subclassed for custom event handling and " "behaviour." msgstr "" +"イベント処理や動作をカスタマイズするには、*FileDialog* クラスをサブクラス化し" +"てください。" -#: ../../library/dialog.rst:193 msgid "Create a basic file selection dialog." -msgstr "" +msgstr "基本的なファイル選択ダイアログを作ります。" -#: ../../library/dialog.rst:197 msgid "Trigger the termination of the dialog window." -msgstr "" +msgstr "ダイアログウィンドウの終了を開始します。" -#: ../../library/dialog.rst:201 msgid "Event handler for double-click event on directory." -msgstr "" +msgstr "ディレクトリのダブルクリックイベントのハンドラー。" -#: ../../library/dialog.rst:205 msgid "Event handler for click event on directory." -msgstr "" +msgstr "ディレクトリのクリックイベントのハンドラー。" -#: ../../library/dialog.rst:209 msgid "Event handler for double-click event on file." -msgstr "" +msgstr "ファイルのダブルクリックイベントのハンドラー。" -#: ../../library/dialog.rst:213 msgid "Event handler for single-click event on file." -msgstr "" +msgstr "ファイルのシングルクリックイベントのハンドラー。" -#: ../../library/dialog.rst:217 msgid "Filter the files by directory." -msgstr "" +msgstr "ディレクトリでファイルを絞り込みます。" -#: ../../library/dialog.rst:221 msgid "Retrieve the file filter currently in use." -msgstr "" +msgstr "現在使っているファイルフィルターを取得します。" -#: ../../library/dialog.rst:225 msgid "Retrieve the currently selected item." -msgstr "" +msgstr "現在選択されている項目を取得します。" -#: ../../library/dialog.rst:229 msgid "Render dialog and start event loop." -msgstr "" +msgstr "ダイアログを表示し、イベントループを開始します。" -#: ../../library/dialog.rst:233 msgid "Exit dialog returning current selection." -msgstr "" +msgstr "現在の選択を返してダイアログを終了します。" -#: ../../library/dialog.rst:237 msgid "" "Called when the user confirms the current selection. The base implementation " "accepts the selection and closes the dialog; :class:`LoadFileDialog` and :" "class:`SaveFileDialog` override it to check the selection first." msgstr "" +"ユーザーが現在の選択を確定したときに呼ばれます。\n" +"基底クラスの実装は選択を受け入れてダイアログを閉じます。\n" +":class:`LoadFileDialog` と :class:`SaveFileDialog` はこれをオーバーライドし、" +"先に選択をチェックします。" -#: ../../library/dialog.rst:244 msgid "Exit dialog returning filename, if any." -msgstr "" +msgstr "ダイアログを終了し、ファイル名があれば返します。" -#: ../../library/dialog.rst:248 msgid "Set the file filter." -msgstr "" +msgstr "ファイルフィルターを設定します。" -#: ../../library/dialog.rst:252 msgid "Update the current file selection to *file*." -msgstr "" +msgstr "現在のファイルの選択を *file* に更新します。" -#: ../../library/dialog.rst:257 msgid "" "A subclass of FileDialog that creates a dialog window for selecting an " "existing file." msgstr "" +"既存のファイルを選択するダイアログウィンドウを作る FileDialog のサブクラスで" +"す。" -#: ../../library/dialog.rst:262 msgid "" "Test that a file is provided and that the selection indicates an already " "existing file." msgstr "" +"ファイルが指定されていて、選択が既存のファイルを指していることを確認します。" -#: ../../library/dialog.rst:267 msgid "" "A subclass of FileDialog that creates a dialog window for selecting a " "destination file." msgstr "" +"保存先のファイルを選択するダイアログウィンドウを作る FileDialog のサブクラス" +"です。" -#: ../../library/dialog.rst:272 msgid "" "Test whether or not the selection points to a valid file that is not a " "directory. Confirmation is required if an already existing file is selected." msgstr "" +"選択がディレクトリではなく、有効なファイルを指しているかを確認します。\n" +"既存のファイルを選択した場合は確認を求めます。" -#: ../../library/dialog.rst:277 msgid ":mod:`!tkinter.commondialog` --- Dialog window templates" -msgstr "" +msgstr ":mod:`!tkinter.commondialog` --- ダイアログウィンドウのテンプレート" -#: ../../library/dialog.rst:282 msgid "**Source code:** :source:`Lib/tkinter/commondialog.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/tkinter/commondialog.py`" -#: ../../library/dialog.rst:286 msgid "" "The :mod:`!tkinter.commondialog` module provides the :class:`Dialog` class " "that is the base class for dialogs defined in other supporting modules." msgstr "" +":mod:`!tkinter.commondialog` モジュールは、他の関連モジュールで定義するダイア" +"ログの基底クラスとなる :class:`Dialog` クラスを提供します。" -#: ../../library/dialog.rst:293 msgid "Render the Dialog window." -msgstr "" +msgstr "Dialog ウィンドウを表示します。" -#: ../../library/dialog.rst:297 msgid ":mod:`!tkinter.dialog` --- Classic Tk dialog boxes" -msgstr "" +msgstr ":mod:`!tkinter.dialog` --- 従来の Tk ダイアログボックス" -#: ../../library/dialog.rst:302 msgid "**Source code:** :source:`Lib/tkinter/dialog.py`" -msgstr "" +msgstr "**ソースコード:** :source:`Lib/tkinter/dialog.py`" -#: ../../library/dialog.rst:306 msgid "" "The :mod:`!tkinter.dialog` module provides a simple modal dialog box built " "on the classic (non-themed) Tk widgets." msgstr "" +":mod:`!tkinter.dialog` モジュールは、従来の (テーマを使わない) Tk ウィジェッ" +"トで作った単純なモーダルダイアログボックスを提供します。" -#: ../../library/dialog.rst:311 msgid "" "The name of a bitmap (``'questhead'``) suitable for use as the *bitmap* of " "a :class:`Dialog`." msgstr "" +":class:`Dialog` の *bitmap* に適したビットマップの名前 (``'questhead'``)。" -#: ../../library/dialog.rst:316 msgid "" "Display a modal dialog box built from the classic (non-themed) Tk widgets " "and wait for the user to press one of its buttons. The options, given " @@ -392,13 +432,21 @@ msgid "" "*strings* (the sequence of button labels). After construction, the :attr:`!" "num` attribute holds the index of the button the user pressed." msgstr "" +"従来の (テーマを使わない) Tk ウィジェットで作ったモーダルダイアログボックスを" +"表示し、ユーザーがいずれかのボタンを押すまで待ちます。\n" +"*cnf* またはキーワード引数で渡すオプションはすべて必須です。\n" +"*title* (ウィンドウのタイトル)、*text* (メッセージ)、*bitmap* (:data:" +"`DIALOG_ICON` などのビットマップアイコンの名前)、*default* (デフォルトのボタ" +"ンのインデックス)、*strings* (ボタンのラベルのシーケンス) を指定します。\n" +"構築後、:attr:`!num` 属性にユーザーが押したボタンのインデックスが入ります。" -#: ../../library/dialog.rst:327 msgid "" "Do nothing. The dialog window is destroyed automatically before the " "constructor returns, so there is nothing left for this method to do." msgstr "" +"何もしません。\n" +"コンストラクタから戻る前にダイアログウィンドウは自動的に破棄されるため、この" +"メソッドが行うことは残っていません。" -#: ../../library/dialog.rst:334 msgid "Modules :mod:`tkinter.messagebox`, :ref:`tut-files`" -msgstr "" +msgstr ":mod:`tkinter.messagebox` モジュール、:ref:`tut-files`" diff --git a/library/difflib.po b/library/difflib.po index 768aea7f0..cd3bf627e 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -30,7 +30,6 @@ msgstr ":mod:`!difflib` --- 差分の計算の補助" msgid "**Source code:** :source:`Lib/difflib.py`" msgstr "**ソースコード:** :source:`Lib/difflib.py`" -#: ../../library/difflib.rst:16 msgid "" "This module provides classes and functions for comparing sequences. Most of " "them compare sequences of text lines (for example lists of strings, or :term:" @@ -39,46 +38,64 @@ msgid "" "context and unified diffs -- formats produced by tools like :manpage:`diff " "` and :manpage:`git diff `." msgstr "" +"このモジュールはシーケンスを比較するクラスと関数を提供します。\n" +"その多くは、テキスト行のシーケンス (文字列のリストや :term:`ファイルオブジェ" +"クト ` など) を比較し、相違点を報告する :dfn:`差分 (diff)` を生" +"成します。\n" +"HTML のほか、:manpage:`diff ` や :manpage:`git diff ` " +"などのツールが生成するコンテキスト形式やユニファイド形式など、さまざまな形式" +"の差分を生成できます。" -#: ../../library/difflib.rst:24 msgid "" "Comparisons are done using a matching algorithm implemented in :class:" "`SequenceMatcher` -- a flexible class for comparing pairs of sequences of " "any type, not just text, so long as the sequence elements are :term:" "`hashable`." msgstr "" +"比較には :class:`SequenceMatcher` に実装されたマッチングアルゴリズムを使いま" +"す。\n" +"この柔軟なクラスは、要素が :term:`hashable` であれば、テキストに限らず任意の" +"型のシーケンスのペアを比較できます。" -#: ../../library/difflib.rst:33 msgid "Junk heuristic" -msgstr "" +msgstr "junk ヒューリスティック" -#: ../../library/difflib.rst:35 msgid "" ":mod:`!difflib` uses a :dfn:`junk` heuristic: some items are deemed to be :" "dfn:`junk`, and ignored when searching for similarities. Ideally, these are " "uninteresting or common items, such as blank lines or whitespace." msgstr "" +":mod:`!difflib` は :dfn:`junk` ヒューリスティックを使います。\n" +"一部の要素を :dfn:`junk` とみなし、共通部分を探す際に無視します。\n" +"理想的には、空行や空白など、重要でない要素や頻出する要素がこれに当たります。" -#: ../../library/difflib.rst:40 msgid "" "This heuristic can speed the algorithm up (because it reduces the number of " "possible combinations) and it can produce results that are more " "understandable for humans (typically breaking on whitespace). But it can " "also cause pathological cases:" msgstr "" +"このヒューリスティックは、組み合わせの候補を減らすためアルゴリズムを高速化で" +"き、人間に理解しやすい結果を生成することもあります (通常は空白で区切りま" +"す)。\n" +"ただし、次のような不都合が起きる場合もあります:" -#: ../../library/difflib.rst:45 msgid "" "Inappropriately chosen junk items can cause an unexpectedly **large** (but " "still correct) result." msgstr "" +"junk とする要素を不適切に選ぶと、正しいものの予想外に **大きな** 差分になる場" +"合があります。" -#: ../../library/difflib.rst:47 msgid "" "The default heuristic is **asymmetric**: only the second sequence is " "inspected when determining what is considered junk, so comparing A to B can " "give different results than comparing B to A and reversing the result." msgstr "" +"デフォルトのヒューリスティックは **非対称** です。\n" +"junk とみなす要素を決めるときは、2 つ目のシーケンスだけを調べます。\n" +"そのため、A を B と比較した結果と、B を A と比較した結果を反転したものが異な" +"る場合があります。" #: ../../library/difflib.rst:51 msgid "" @@ -86,19 +103,21 @@ msgid "" "that account for more than 1% it are considered *junk*." msgstr "" -#: ../../library/difflib.rst:54 msgid "" "Depending on your data, you should consider turning this heuristic off " "(setting :class:`~difflib.SequenceMatcher`'s *autojunk* argument to " "``False``) or tuning it (using the *isjunk* argument, perhaps to one of the :" "ref:`predefined functions `)." msgstr "" +"データによっては、このヒューリスティックを無効にする (:class:`~difflib." +"SequenceMatcher` の *autojunk* 引数を ``False`` にする) か、*isjunk* 引数で調" +"整することを検討してください。\n" +"*isjunk* には :ref:`定義済みの関数 ` のいずれかを指" +"定することもできます。" -#: ../../library/difflib.rst:61 msgid "The :mod:`!difflib` algorithm" -msgstr "" +msgstr ":mod:`!difflib` のアルゴリズム" -#: ../../library/difflib.rst:63 msgid "" "The algorithm used in :class:`SequenceMatcher` predates, and is a little " "fancier than, an algorithm published in the late 1980s by Ratcliff and " @@ -107,31 +126,38 @@ msgid "" "recursively handle the pieces of the sequences to the left and to the right " "of the matching subsequence." msgstr "" +":class:`SequenceMatcher` のアルゴリズムは、Ratcliff と Obershelp が 1980 年代" +"後半に「ゲシュタルトパターンマッチング」という大げさな名前で発表したアルゴリ" +"ズムよりも古く、少し高度なものです。\n" +"両方の入力に共通する最長の連続部分シーケンスを見つけ、その左右に残ったシーケ" +"ンスを再帰的に処理するという考え方です。" -#: ../../library/difflib.rst:72 msgid "" "`Pattern Matching: The Gestalt Approach `_" msgstr "" +"`Pattern Matching: The Gestalt Approach `_" -#: ../../library/difflib.rst:73 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " "This was published in Dr. Dobb's Journal in July, 1988." msgstr "" +"John W. Ratcliff と D. E. Metzener による、類似のアルゴリズムの解説です。\n" +"1988 年 7 月の Dr. Dobb's Journal に掲載されました。" -#: ../../library/difflib.rst:76 msgid "" "As an extension to the Ratcliff and Obershelp algorithm, :mod:`!difflib` " "searches for the longest *junk-free* contiguous subsequence. See the :ref:" "`difflib-junk` section for details." msgstr "" +"Ratcliff と Obershelp のアルゴリズムを拡張し、:mod:`!difflib` は *junk を含ま" +"ない* 最長の連続部分シーケンスを探します。\n" +"詳しくは :ref:`difflib-junk` 節を参照してください。" -#: ../../library/difflib.rst:80 msgid "Timing" -msgstr "" +msgstr "時間計算量" -#: ../../library/difflib.rst:82 msgid "" "The basic Ratcliff-Obershelp algorithm is cubic time in the worst case and " "quadratic time in the expected case. :mod:`difflib`'s algorithm is quadratic " @@ -139,10 +165,14 @@ msgid "" "complicated way on how many elements the sequences have in common; best case " "time is linear." msgstr "" +"基本的な Ratcliff-Obershelp アルゴリズムの時間計算量は、最悪の場合は 3 次、期" +"待される場合は 2 次です。\n" +":mod:`difflib` のアルゴリズムは最悪の場合が 2 次で、期待される場合の振る舞い" +"は、シーケンスの共通要素数に複雑に依存します。\n" +"最良の場合の時間計算量は線形です。" -#: ../../library/difflib.rst:93 msgid "Diff generation" -msgstr "" +msgstr "差分の生成" #: ../../library/difflib.rst:99 msgid "" @@ -199,15 +229,17 @@ msgstr "``'? '``" msgid "line not present in either input sequence" msgstr "行は入力シーケンスのどちらにも存在しない" -#: ../../library/difflib.rst:118 msgid "" "Lines beginning with '``?``' attempt to guide the eye to intraline " "differences, and were not present in either input sequence. These lines can " "be confusing if the sequences contain whitespace characters, such as spaces, " "tabs or line breaks." msgstr "" +"'``?``' で始まる行は、行内の相違点を見つけやすくするためのもので、どちらの入" +"力シーケンスにも存在しません。\n" +"シーケンスにスペース、タブ、改行などの空白文字が含まれる場合、これらの行は分" +"かりにくくなることがあります。" -#: ../../library/difflib.rst:122 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" @@ -216,6 +248,11 @@ msgid "" "matches preserves some notion of locality, at the occasional cost of " "producing a longer diff." msgstr "" +":class:`Differ` が生成する差分は、**最小** の差分であることを保証しません。\n" +"むしろ最小の差分は、100 ページ離れた偶然の一致など、対応付けられるところをす" +"べて対応付けるため、人間の直感に反することがよくあります。\n" +"対応付ける箇所を連続する一致部分に限ると、差分が長くなる場合はありますが、位" +"置的な近さをある程度保てます。" #: ../../library/difflib.rst:129 msgid "The :class:`Differ` class has this constructor:" @@ -249,17 +286,16 @@ msgstr "" "あるときに真を返します。デフォルトは ``None`` であり、どんな文字も junk とは" "見なされません。" -#: ../../library/difflib.rst:144 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " "description of the :meth:`~SequenceMatcher.find_longest_match` method's " "*isjunk* parameter for an explanation." msgstr "" -"これらの junk フィルター関数により、差分を発見するマッチングが高速化し、差分" -"の行や文字が無視されることがなくなります。説明については、 :meth:" -"`~SequenceMatcher.find_longest_match` メソッドの *isjunk* 引数の説明をご覧く" -"ださい。" +"これらの junk フィルター関数は、相違点を探すマッチングを高速化しますが、相違" +"のある行や文字そのものを無視するわけではありません。\n" +"詳しくは :meth:`~SequenceMatcher.find_longest_match` メソッドの *isjunk* パラ" +"メーターの説明を参照してください。" #: ../../library/difflib.rst:150 msgid "" @@ -275,7 +311,6 @@ msgstr "" "文字列からなる2つのシーケンスを比較し、差分(を表す文字列からなるシーケンス)" "を生成します。" -#: ../../library/difflib.rst:157 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." @@ -283,6 +318,12 @@ msgid "" "of newline-terminated strings, ready to be printed as-is via the :meth:`~io." "IOBase.writelines` method of a file-like object." msgstr "" +"各シーケンスは、末尾に改行のある 1 行ずつの文字列で構成されていなければなりま" +"せん。\n" +"このようなシーケンスは、ファイル類似オブジェクトの :meth:`~io.IOBase." +"readlines` メソッドで取得できます。\n" +"生成される差分も末尾に改行のある文字列で構成され、ファイル類似オブジェクト" +"の :meth:`~io.IOBase.writelines` メソッドでそのまま出力できます。" #: ../../library/difflib.rst:166 msgid "" @@ -296,11 +337,12 @@ msgstr "" "イル) を生成するために使います。テーブルは完全差分モード、コンテキスト差分" "モードのいずれでも生成できます。" -#: ../../library/difflib.rst:173 msgid "" "The trailing newlines get stripped before the diff, so the result can be " "incomplete. See :gh:`71896` for details." msgstr "" +"差分の計算前に末尾の改行を取り除くため、結果が不完全になる場合があります。\n" +"詳しくは :gh:`71896` を参照してください。" #: ../../library/difflib.rst:176 msgid "The constructor for this class is:" @@ -522,7 +564,6 @@ msgstr "" "オプションのキーワード引数 *linejunk* と *charjunk* には、フィルタ関数 (また" "は ``None``) を渡します。" -#: ../../library/difflib.rst:315 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " @@ -532,6 +573,14 @@ msgid "" "dynamic analysis of which lines are so frequent as to constitute noise, and " "this usually works better than using this function." msgstr "" +"*linejunk*: 文字列を 1 つ受け取り、その文字列が junk なら真、それ以外なら偽を" +"返す関数です。\n" +"デフォルトは ``None`` です。\n" +"モジュールレベルの :func:`IS_LINE_JUNK` 関数もあり、最大 1 つのハッシュ文字 " +"(``'#'``) を除いて可視文字のない行を除外します。\n" +"ただし、内部で使う :class:`SequenceMatcher` クラスは、どの行がノイズとなるほ" +"ど頻出するかを動的に分析するため、通常はこの関数を使うよりよい結果が得られま" +"す。" #: ../../library/difflib.rst:323 msgid "" @@ -597,14 +646,15 @@ msgstr "" "writelines` で扱うのに適した diff になるので (なぜなら入力と出力の両方が改行" "付きのため) 、これは有用です。" -#: ../../library/difflib.rst:384 msgid "" "Set *color* to ``True`` to enable output in color, similar to :program:`git " "diff --color`. Even if enabled, it can be :ref:`controlled using environment " "variables `." msgstr "" +"*color* を ``True`` にすると、:program:`git diff --color` と同様に色付きで出" +"力します。\n" +"有効にしても :ref:`環境変数で制御できます `。" -#: ../../library/difflib.rst:388 msgid "" "The unified diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " @@ -612,10 +662,14 @@ msgid "" "normally expressed in the ISO 8601 format. If not specified, the strings " "default to blanks." msgstr "" +"ユニファイド形式の差分は、通常、ファイル名と更新日時のヘッダーを持ちます。\n" +"これらは *fromfile*、*tofile*、*fromfiledate*、*tofiledate* に文字列を渡し" +"て、必要なものだけでもすべてでも指定できます。\n" +"更新日時は通常 ISO 8601 形式で表します。\n" +"指定しない場合は空文字列になります。" -#: ../../library/difflib.rst:410 msgid "Added the *color* parameter." -msgstr "" +msgstr "*color* パラメーターを追加しました。" #: ../../library/difflib.rst:416 msgid "" @@ -645,9 +699,8 @@ msgstr "" "行のエンコーディングは、*a* と *b* の未知または一貫性のないエンコーディングと" "同一になります。" -#: ../../library/difflib.rst:434 msgid "Junk definition functions" -msgstr "" +msgstr "junk を定義する関数" #: ../../library/difflib.rst:438 msgid "" @@ -669,9 +722,8 @@ msgstr "" "ときには無視できます。それ以外の時には無視できません。 :func:`ndiff` の引数 " "*charjunk* としてデフォルトで使用されます。" -#: ../../library/difflib.rst:453 msgid "SequenceMatcher objects" -msgstr "" +msgstr "SequenceMatcher オブジェクト" #: ../../library/difflib.rst:457 msgid "" @@ -688,9 +740,8 @@ msgstr "" "じになります; すなわち、いかなる要素も無視しなくなります。例えば以下のような" "引数を渡すと::" -#: ../../library/difflib.rst:463 msgid "lambda x: x in \" \\t\"" -msgstr "" +msgstr "lambda x: x in \" \\t\"" msgid "" "if you're comparing lines as sequences of characters, and don't want to " @@ -717,9 +768,8 @@ msgstr "" "オプションの引数 *autojunk* は、自動 junk ヒューリスティックを無効にするため" "に使えます。" -#: ../../library/difflib.rst:474 msgid "Added the *autojunk* parameter." -msgstr "" +msgstr "*autojunk* パラメーターを追加しました。" #: ../../library/difflib.rst:477 msgid "" @@ -859,12 +909,14 @@ msgstr "" "``j+n < j'`` です。言い換えると並んでいる3つ組は常に隣接していない同じブロッ" "クを表しています。" -#: ../../library/difflib.rst:567 msgid "" ">>> s = SequenceMatcher(None, \"abxcd\", \"abcd\")\n" ">>> s.get_matching_blocks()\n" "[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" msgstr "" +">>> s = SequenceMatcher(None, \"abxcd\", \"abcd\")\n" +">>> s.get_matching_blocks()\n" +"[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " @@ -925,7 +977,6 @@ msgstr "``a[i1:i2] == b[j1:j2]`` (サブシーケンスは等しい)." msgid "For example::" msgstr "例えば::" -#: ../../library/difflib.rst:602 msgid "" ">>> a = \"qabxcd\"\n" ">>> b = \"abycdf\"\n" @@ -939,6 +990,17 @@ msgid "" "equal a[4:6] --> b[3:5] 'cd' --> 'cd'\n" "insert a[6:6] --> b[5:6] '' --> 'f'" msgstr "" +">>> a = \"qabxcd\"\n" +">>> b = \"abycdf\"\n" +">>> s = SequenceMatcher(None, a, b)\n" +">>> for tag, i1, i2, j1, j2 in s.get_opcodes():\n" +"... print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format(\n" +"... tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2]))\n" +"delete a[0:1] --> b[0:0] 'q' --> ''\n" +"equal a[1:3] --> b[0:2] 'ab' --> 'ab'\n" +"replace a[3:4] --> b[2:3] 'x' --> 'y'\n" +"equal a[4:6] --> b[3:5] 'cd' --> 'cd'\n" +"insert a[6:6] --> b[5:6] '' --> 'f'" #: ../../library/difflib.rst:617 msgid "Return a :term:`generator` of groups with up to *n* lines of context." @@ -946,14 +1008,13 @@ msgstr "" "最大 *n* 行までのコンテキストを含むグループを生成するような、 :term:`ジェネ" "レータ ` を返します。" -#: ../../library/difflib.rst:619 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " "changes." msgstr "" -"このメソッドは、 :meth:`get_opcodes` で返されるグループの中から、似たような差" -"異のかたまりに分け、間に挟まっている変更の無い部分を省きます。" +":meth:`get_opcodes` が返すグループをもとに、変更箇所をより小さなまとまりに分" +"割し、間に挟まる変更のない範囲を除きます。" #: ../../library/difflib.rst:623 msgid "The groups are returned in the same format as :meth:`get_opcodes`." @@ -993,7 +1054,6 @@ msgstr ":meth:`ratio` の上界を、より高速に計算します。" msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr ":meth:`ratio` の上界を、非常に高速に計算します。" -#: ../../library/difflib.rst:651 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" @@ -1001,45 +1061,55 @@ msgid "" "real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher." "ratio`:" msgstr "" +"一致した文字数の総文字数に対する比率を返す 3 つのメソッドは、近似の程度が異な" +"るため、結果も異なる場合があります。\n" +"ただし :meth:`~SequenceMatcher.quick_ratio` と :meth:`~SequenceMatcher." +"real_quick_ratio` の結果は、常に :meth:`~SequenceMatcher.ratio` 以上です:" #: ../../library/difflib.rst:666 msgid "Examples" msgstr "使用例" -#: ../../library/difflib.rst:671 msgid "SequenceMatcher examples" -msgstr "" +msgstr "SequenceMatcher の例" #: ../../library/difflib.rst:673 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "この例は2つの文字列を比較します。空白を \"junk\" とします:" -#: ../../library/difflib.rst:679 msgid "" ":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " "similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." "ratio` value over 0.6 means the sequences are close matches:" msgstr "" +":meth:`~SequenceMatcher.ratio` は [0, 1] の範囲の浮動小数点数を返し、シーケン" +"スの類似度を示します。\n" +"目安として、:meth:`~SequenceMatcher.ratio` の値が 0.6 を超えていれば、シーケ" +"ンスはよく似ています:" -#: ../../library/difflib.rst:686 msgid "" "If you're only interested in where the sequences match, :meth:" "`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" +"シーケンスのどこが一致するかだけを知りたい場合は、:meth:`~SequenceMatcher." +"get_matching_blocks` が便利です:" -#: ../../library/difflib.rst:695 msgid "" "Note that the last tuple returned by :meth:`~SequenceMatcher." "get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " "the only case in which the last tuple element (number of elements matched) " "is ``0``." msgstr "" +":meth:`~SequenceMatcher.get_matching_blocks` が返す最後のタプルは、常にダミー" +"の ``(len(a), len(b), 0)`` です。\n" +"タプルの最後の要素 (一致した要素数) が ``0`` になるのは、このタプルだけです。" -#: ../../library/difflib.rst:699 msgid "" "If you want to know how to change the first sequence into the second, use :" "meth:`~SequenceMatcher.get_opcodes`:" msgstr "" +"最初のシーケンスを 2 つ目に変える方法を知るには、:meth:`~SequenceMatcher." +"get_opcodes` を使います:" #: ../../library/difflib.rst:710 msgid "" @@ -1049,24 +1119,28 @@ msgstr "" ":class:`SequenceMatcher` を使った、シンプルで使えるコードを知るには、このモ" "ジュールの関数 :func:`get_close_matches` を参照してください。" -#: ../../library/difflib.rst:714 msgid "" "`Simple version control recipe `_ for a small application built with :class:" "`SequenceMatcher`." msgstr "" +":class:`SequenceMatcher` で作った小さなアプリケーションについては、`簡単な" +"バージョン管理のレシピ `_ を参照してください。" -#: ../../library/difflib.rst:722 msgid "Differ example" -msgstr "" +msgstr "Differ の例" -#: ../../library/difflib.rst:724 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " "be obtained from the :meth:`~io.IOBase.readlines` method of file-like " "objects):" msgstr "" +"この例では 2 つのテキストを比較します。\n" +"まず、末尾に改行のある 1 行ずつの文字列のシーケンスとしてテキストを用意しま" +"す (ファイル類似オブジェクトの :meth:`~io.IOBase.readlines` メソッドでも取得" +"できます):" #: ../../library/difflib.rst:743 msgid "Next we instantiate a Differ object:" @@ -1098,12 +1172,12 @@ msgstr "これは、複数行の文字列として、次のように出力され msgid "A command-line interface to difflib" msgstr "difflib のコマンドラインインターフェース" -#: ../../library/difflib.rst:791 msgid "" "This example shows how to use difflib to create a ``diff``-like utility." msgstr "" +"この例では、difflib を使って ``diff`` のようなユーティリティを作る方法を示し" +"ます。" -#: ../../library/difflib.rst:793 msgid "" "\"\"\" Command-line interface to difflib.py providing diffs in four " "formats:\n" @@ -1169,14 +1243,75 @@ msgid "" "if __name__ == '__main__':\n" " main()\n" msgstr "" +"\"\"\" 4 つの形式の差分を提供する difflib.py のコマンドラインインターフェー" +"ス:\n" +"\n" +"* ndiff: 全行を列挙し、行間の変更を強調表示します。\n" +"* context: まとまった変更を変更前/変更後の形式で強調表示します。\n" +"* unified: まとまった変更をインライン形式で強調表示します。\n" +"* html: 左右に並べた比較を生成し、変更点を強調表示します。\n" +"\n" +"\"\"\"\n" +"\n" +"import sys, os, difflib, argparse\n" +"import datetime as dt\n" +"\n" +"def file_mtime(path):\n" +" t = dt.datetime.fromtimestamp(os.stat(path).st_mtime,\n" +" dt.timezone.utc)\n" +" return t.astimezone().isoformat()\n" +"\n" +"def main():\n" +"\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-c', action='store_true', default=False,\n" +" help='Produce a context format diff (default)')\n" +" parser.add_argument('-u', action='store_true', default=False,\n" +" help='Produce a unified format diff')\n" +" parser.add_argument('-m', action='store_true', default=False,\n" +" help='Produce HTML side by side diff '\n" +" '(can use -c and -l in conjunction)')\n" +" parser.add_argument('-n', action='store_true', default=False,\n" +" help='Produce a ndiff format diff')\n" +" parser.add_argument('-l', '--lines', type=int, default=3,\n" +" help='Set number of context lines (default 3)')\n" +" parser.add_argument('fromfile')\n" +" parser.add_argument('tofile')\n" +" options = parser.parse_args()\n" +"\n" +" n = options.lines\n" +" fromfile = options.fromfile\n" +" tofile = options.tofile\n" +"\n" +" fromdate = file_mtime(fromfile)\n" +" todate = file_mtime(tofile)\n" +" with open(fromfile) as ff:\n" +" fromlines = ff.readlines()\n" +" with open(tofile) as tf:\n" +" tolines = tf.readlines()\n" +"\n" +" if options.u:\n" +" diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +" elif options.n:\n" +" diff = difflib.ndiff(fromlines, tolines)\n" +" elif options.m:\n" +" diff = difflib.HtmlDiff().make_file(fromlines,tolines,fromfile," +"tofile,context=options.c,numlines=n)\n" +" else:\n" +" diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +"\n" +" sys.stdout.writelines(diff)\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" -#: ../../library/difflib.rst:796 msgid "ndiff example" -msgstr "" +msgstr "ndiff の例" -#: ../../library/difflib.rst:798 msgid "This example shows how to use :func:`difflib.ndiff`." -msgstr "" +msgstr "この例では :func:`difflib.ndiff` の使い方を示します。" #: ../../library/difflib.rst:800 msgid "" diff --git a/library/dis.po b/library/dis.po index 20e180eab..054cabeca 100644 --- a/library/dis.po +++ b/library/dis.po @@ -30,13 +30,16 @@ msgstr ":mod:`!dis` --- Python バイトコードの逆アセンブラー" msgid "**Source code:** :source:`Lib/dis.py`" msgstr "**ソースコード:** :source:`Lib/dis.py`" -#: ../../library/dis.rst:17 msgid "" "The :mod:`!dis` module supports the analysis of CPython :term:`bytecode` by " "disassembling it. The CPython bytecode which this module takes as an input " "is defined in the file :file:`Include/opcode.h` and used by the compiler and " "the interpreter." msgstr "" +":mod:`!dis` モジュールは、CPython の :term:`bytecode` を逆アセンブルして解析" +"するためのものです。\n" +"このモジュールが入力として受け取る CPython のバイトコードは :file:`Include/" +"opcode.h` で定義され、コンパイラとインタープリタで使われます。" #: ../../library/dis.rst:24 msgid "" @@ -58,13 +61,13 @@ msgstr "" "従来は使用されるバイト数は命令ごとに異なりましたが、このモジュールでは各々一" "つの命令につき2バイト使用することとなっています。" -#: ../../library/dis.rst:33 msgid "" "The argument of jump, exception handling and loop instructions is now the " "instruction offset rather than the byte offset." msgstr "" +"ジャンプ、例外処理、ループ命令の引数が、バイトオフセットではなく命令のオフ" +"セットになりました。" -#: ../../library/dis.rst:37 msgid "" "Some instructions are accompanied by one or more inline cache entries, which " "take the form of :opcode:`CACHE` instructions. These instructions are hidden " @@ -73,55 +76,65 @@ msgid "" "specialize it for different runtime conditions. The adaptive bytecode can be " "shown by passing ``adaptive=True``." msgstr "" +"一部の命令には、:opcode:`CACHE` 命令の形をした 1 つ以上のインラインキャッシュ" +"エントリーが付随するようになりました。\n" +"これらの命令はデフォルトでは非表示ですが、:mod:`!dis` の各ユーティリティに " +"``show_caches=True`` を渡すと表示できます。\n" +"また、インタープリタは実行時の状況に応じてバイトコードを特殊化するようになり" +"ました。\n" +"この適応的なバイトコードは ``adaptive=True`` を渡すと表示できます。" -#: ../../library/dis.rst:45 msgid "" "The argument of a jump is the offset of the target instruction relative to " "the instruction that appears immediately after the jump instruction's :" "opcode:`CACHE` entries." msgstr "" +"ジャンプの引数は、ジャンプ命令の :opcode:`CACHE` エントリーの直後にある命令を" +"基準とした、ジャンプ先の命令への相対オフセットになりました。" -#: ../../library/dis.rst:50 msgid "" "As a consequence, the presence of the :opcode:`CACHE` instructions is " "transparent for forward jumps but needs to be taken into account when " "reasoning about backward jumps." msgstr "" +"このため、前方ジャンプでは :opcode:`CACHE` 命令の存在を意識する必要はありませ" +"んが、後方ジャンプを考える際は考慮する必要があります。" -#: ../../library/dis.rst:54 msgid "" "The output shows logical labels rather than instruction offsets for jump " "targets and exception handlers. The ``-O`` command line option and the " "``show_offsets`` argument were added." msgstr "" +"ジャンプ先と例外ハンドラーの出力に、命令オフセットではなく論理ラベルを表示す" +"るようになりました。\n" +"``-O`` コマンドラインオプションと ``show_offsets`` 引数を追加しました。" -#: ../../library/dis.rst:59 msgid "" "The :option:`-P ` command-line option and the " "``show_positions`` argument were added." msgstr "" +":option:`-P ` コマンドラインオプションと " +"``show_positions`` 引数を追加しました。" -#: ../../library/dis.rst:63 msgid "The :option:`-S ` command-line option is added." msgstr "" +":option:`-S ` コマンドラインオプションを追加しました。" -#: ../../library/dis.rst:65 msgid "Example: Given the function :func:`!myfunc`::" -msgstr "" +msgstr "例として、次の :func:`!myfunc` 関数があるとします。 ::" -#: ../../library/dis.rst:67 msgid "" "def myfunc(alist):\n" " return len(alist)" msgstr "" +"def myfunc(alist):\n" +" return len(alist)" -#: ../../library/dis.rst:70 msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" -msgstr "" +msgstr "次のコマンドで :func:`!myfunc` の逆アセンブル結果を表示できます:" -#: ../../library/dis.rst:73 msgid "" ">>> dis.dis(myfunc)\n" " 2 RESUME 0\n" @@ -131,6 +144,13 @@ msgid "" " CALL 1\n" " RETURN_VALUE" msgstr "" +">>> dis.dis(myfunc)\n" +" 2 RESUME 0\n" +"\n" +" 3 LOAD_GLOBAL 1 (len + NULL)\n" +" LOAD_FAST_BORROW 0 (alist)\n" +" CALL 1\n" +" RETURN_VALUE" #: ../../library/dis.rst:83 msgid "(The \"2\" is a line number)." @@ -140,14 +160,13 @@ msgstr "(\"2\" は行番号です)。" msgid "Command-line interface" msgstr "コマンドライン・インターフェース" -#: ../../library/dis.rst:90 msgid "" "The :mod:`!dis` module can be invoked as a script from the command line:" msgstr "" +":mod:`!dis` モジュールはコマンドラインからスクリプトとして実行できます:" -#: ../../library/dis.rst:92 msgid "python -m dis [-h] [-C] [-O] [-P] [-S] [infile]" -msgstr "" +msgstr "python -m dis [-h] [-C] [-O] [-P] [-S] [infile]" #: ../../library/dis.rst:96 msgid "The following options are accepted:" @@ -157,28 +176,26 @@ msgstr "以下のオプションが使用できます:" msgid "Display usage and exit." msgstr "使い方を表示して終了します。" -#: ../../library/dis.rst:106 msgid "Show inline caches." -msgstr "" +msgstr "インラインキャッシュを表示します。" -#: ../../library/dis.rst:112 msgid "Show offsets of instructions." -msgstr "" +msgstr "命令のオフセットを表示します。" -#: ../../library/dis.rst:118 msgid "Show positions of instructions in the source code." -msgstr "" +msgstr "ソースコード内の命令の位置を表示します。" -#: ../../library/dis.rst:124 msgid "Show specialized bytecode." -msgstr "" +msgstr "特殊化されたバイトコードを表示します。" -#: ../../library/dis.rst:128 msgid "" "If :file:`infile` is specified, its disassembled code will be written to " "stdout. Otherwise, disassembly is performed on compiled source code received " "from stdin." msgstr "" +":file:`infile` を指定すると、その逆アセンブル結果を標準出力に書き出します。\n" +"指定しなければ、標準入力から受け取ったソースコードをコンパイルして逆アセンブ" +"ルします。" #: ../../library/dis.rst:132 msgid "Bytecode analysis" @@ -238,29 +255,34 @@ msgstr "" "これを設定すると、 :meth:`.dis` の出力において、指定された命令コード " "(opcode) に \"現在の命令 (instruction)\" を表す印が表示されます。" -#: ../../library/dis.rst:161 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" +"*show_caches* が ``True`` なら、:meth:`.dis` はインタープリタがバイトコードの" +"特殊化に使うインラインキャッシュエントリーを表示します。" -#: ../../library/dis.rst:164 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" +"*adaptive* が ``True`` なら、:meth:`.dis` は特殊化されたバイトコードを表示し" +"ます。\n" +"これは元のバイトコードと異なる場合があります。" -#: ../../library/dis.rst:167 msgid "" "If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets " "in the output." msgstr "" +"*show_offsets* が ``True`` なら、:meth:`.dis` の出力に命令オフセットを含めま" +"す。" -#: ../../library/dis.rst:170 msgid "" "If *show_positions* is ``True``, :meth:`.dis` will include instruction " "source code positions in the output." msgstr "" +"*show_positions* が ``True`` なら、:meth:`.dis` の出力にソースコード内の命令" +"の位置を含めます。" #: ../../library/dis.rst:175 msgid "" @@ -294,31 +316,24 @@ msgstr "" ":func:`code_info` のようなコードオブジェクトの詳細を含んだ整形された複数行文" "字列を返します。" -#: ../../library/dis.rst:196 ../../library/dis.rst:242 -#: ../../library/dis.rst:295 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" +"コルーチンオブジェクトと非同期ジェネレーターオブジェクトも扱えるようになりま" +"した。" -#: ../../library/dis.rst:199 ../../library/dis.rst:298 -#: ../../library/dis.rst:320 ../../library/dis.rst:356 -#: ../../library/dis.rst:382 msgid "Added the *show_caches* and *adaptive* parameters." -msgstr "" +msgstr "*show_caches* と *adaptive* パラメーターを追加しました。" -#: ../../library/dis.rst:202 msgid "Added the *show_offsets* parameter" -msgstr "" +msgstr "*show_offsets* パラメーターを追加しました。" -#: ../../library/dis.rst:205 ../../library/dis.rst:304 -#: ../../library/dis.rst:326 ../../library/dis.rst:362 msgid "Added the *show_positions* parameter." -msgstr "" +msgstr "*show_positions* パラメーターを追加しました。" #: ../../library/dis.rst:208 msgid "Example:" msgstr "例:" -#: ../../library/dis.rst:210 msgid "" ">>> bytecode = dis.Bytecode(myfunc)\n" ">>> for instr in bytecode:\n" @@ -330,18 +345,29 @@ msgid "" "CALL\n" "RETURN_VALUE" msgstr "" +">>> bytecode = dis.Bytecode(myfunc)\n" +">>> for instr in bytecode:\n" +"... print(instr.opname)\n" +"...\n" +"RESUME\n" +"LOAD_GLOBAL\n" +"LOAD_FAST_BORROW\n" +"CALL\n" +"RETURN_VALUE" #: ../../library/dis.rst:224 msgid "Analysis functions" msgstr "解析関数" -#: ../../library/dis.rst:226 msgid "" "The :mod:`!dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " "a single operation is being performed, so the intermediate analysis object " "isn't useful:" msgstr "" +":mod:`!dis` モジュールは、入力を目的の出力に直接変換する、次の解析関数も定義" +"しています。\n" +"1 つの操作だけを行うなど、中間の解析オブジェクトが不要な場合に便利です:" #: ../../library/dis.rst:232 msgid "" @@ -385,7 +411,6 @@ msgstr "" msgid "Added *file* parameter." msgstr "*file* 引数が追加されました。" -#: ../../library/dis.rst:264 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -400,6 +425,20 @@ msgid "" "before being disassembled. If no object is provided, this function " "disassembles the last traceback." msgstr "" +"オブジェクト *x* を逆アセンブルします。\n" +"*x* にはモジュール、クラス、メソッド、関数、ジェネレーター、非同期ジェネレー" +"ター、コルーチン、コードオブジェクト、ソースコード文字列、生のバイトコードの" +"バイト列を指定できます。\n" +"モジュールの場合はすべての関数を、クラスの場合はクラスメソッドと静的メソッド" +"を含むすべてのメソッドを逆アセンブルします。\n" +"コードオブジェクトや生のバイトコードの列の場合は、バイトコード命令ごとに 1 行" +"を表示します。\n" +"入れ子のコードオブジェクトも再帰的に逆アセンブルします。\n" +"これには、ジェネレーター式、入れ子の関数やクラスの本体、:ref:`アノテーション" +"スコープ ` で使うコードオブジェクトなどが含まれます。\n" +"文字列は、組み込み関数 :func:`compile` でコードオブジェクトにコンパイルしてか" +"ら逆アセンブルします。\n" +"オブジェクトを指定しない場合は、最後のトレースバックを逆アセンブルします。" #: ../../library/dis.rst:277 ../../library/dis.rst:314 #: ../../library/dis.rst:350 @@ -410,32 +449,32 @@ msgstr "" "*file* 引数が渡された場合は、アセンブリをそこに書き込みます。\n" "そうでない場合は ``sys.stdout`` に出力します。" -#: ../../library/dis.rst:280 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" +"*depth* が ``None`` でなければ、再帰の最大の深さをその値に制限します。\n" +"``depth=0`` は再帰しないことを意味します。" -#: ../../library/dis.rst:283 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" +"*show_caches* が ``True`` なら、インタープリタがバイトコードの特殊化に使うイ" +"ンラインキャッシュエントリーを表示します。" -#: ../../library/dis.rst:286 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" +"*adaptive* が ``True`` なら、特殊化されたバイトコードを表示します。\n" +"これは元のバイトコードと異なる場合があります。" -#: ../../library/dis.rst:292 msgid "Implemented recursive disassembling and added *depth* parameter." -msgstr "" +msgstr "再帰的な逆アセンブルを実装し、*depth* パラメーターを追加しました。" -#: ../../library/dis.rst:301 ../../library/dis.rst:323 -#: ../../library/dis.rst:359 msgid "Added the *show_offsets* parameter." -msgstr "" +msgstr "*show_offsets* パラメーターを追加しました。" #: ../../library/dis.rst:310 msgid "" @@ -454,12 +493,14 @@ msgstr "" "コードオブジェクトを逆アセンブルします。*lasti* が与えられた場合は、最後の命" "令を示します。出力は次のようなカラムに分割されます:" -#: ../../library/dis.rst:337 msgid "" "the source code location of the instruction. Complete location information " "is shown if *show_positions* is true. Otherwise (the default) only the line " "number is displayed." msgstr "" +"ソースコード内の命令の位置。\n" +"*show_positions* が真なら完全な位置情報を表示します。\n" +"それ以外 (デフォルト) では行番号だけを表示します。" #: ../../library/dis.rst:340 msgid "the current instruction, indicated as ``-->``," @@ -509,71 +550,87 @@ msgstr "" "イテレータは、与えられたコードの各命令の詳細情報を保持する名前付きタプル :" "class:`Instruction` からなる列を生成します。" -#: ../../library/dis.rst:378 msgid "The *adaptive* parameter works as it does in :func:`dis`." -msgstr "" +msgstr "*adaptive* パラメーターは :func:`dis` のものと同じように動作します。" -#: ../../library/dis.rst:385 msgid "" "The *show_caches* parameter is deprecated and has no effect. The iterator " "generates the :class:`Instruction` instances with the *cache_info* field " "populated (regardless of the value of *show_caches*) and it no longer " "generates separate items for the cache entries." msgstr "" +"*show_caches* パラメーターは非推奨となり、効果がなくなりました。\n" +"イテレーターは、*show_caches* の値にかかわらず *cache_info* フィールドを設定" +"した :class:`Instruction` インスタンスを生成し、キャッシュエントリーを個別の" +"項目として生成しなくなりました。" -#: ../../library/dis.rst:393 msgid "" "This generator function uses the :meth:`~codeobject.co_lines` method of the :" "ref:`code object ` *code* to find the offsets which are starts " "of lines in the source code. They are generated as ``(offset, lineno)`` " "pairs." msgstr "" +"このジェネレーター関数は、:ref:`コードオブジェクト ` *code* " +"の :meth:`~codeobject.co_lines` メソッドを使い、ソースコードの各行が始まるオ" +"フセットを調べます。\n" +"結果は ``(offset, lineno)`` ペアとして生成されます。" -#: ../../library/dis.rst:398 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" +"行番号が減少する場合もあるようになりました。\n" +"以前は常に増加していました。" -#: ../../library/dis.rst:401 msgid "" "The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :" "attr:`~codeobject.co_firstlineno` and :attr:`!codeobject.co_lnotab` " "attributes of the :ref:`code object `." msgstr "" +":ref:`コードオブジェクト ` の :attr:`~codeobject." +"co_firstlineno` と :attr:`!codeobject.co_lnotab` 属性に代わり、:pep:`626` " +"の :meth:`~codeobject.co_lines` メソッドを使うようになりました。" -#: ../../library/dis.rst:406 msgid "" "Line numbers can be ``None`` for bytecode that does not map to source lines." msgstr "" +"ソース行に対応しないバイトコードでは、行番号が ``None`` になる場合がありま" +"す。" -#: ../../library/dis.rst:412 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" +"生のコンパイル済みバイトコード文字列 *code* 内でジャンプ先となるすべてのオフ" +"セットを検出し、そのリストを返します。" #: ../../library/dis.rst:418 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "*opcode* と引数 *oparg* がスタックに与える影響を計算します。" -#: ../../library/dis.rst:420 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " "return the stack effect of not jumping. And if *jump* is ``None`` (default), " "it will return the maximal stack effect of both cases." msgstr "" +"命令にジャンプ先があり、*jump* が ``True`` なら、:func:`~stack_effect` はジャ" +"ンプした場合のスタックへの影響を返します。\n" +"*jump* が ``False`` なら、ジャンプしない場合の影響を返します。\n" +"*jump* が ``None`` (デフォルト) なら、両者のうち大きい方を返します。" -#: ../../library/dis.rst:427 msgid "Added *jump* parameter." -msgstr "" +msgstr "*jump* パラメーターを追加しました。" -#: ../../library/dis.rst:430 msgid "" "If ``oparg`` is omitted (or ``None``), the stack effect is now returned for " "``oparg=0``. Previously this was an error for opcodes that use their arg. It " "is also no longer an error to pass an integer ``oparg`` when the ``opcode`` " "does not use it; the ``oparg`` in this case is ignored." msgstr "" +"``oparg`` を省略するか ``None`` にすると、``oparg=0`` の場合のスタックへの影" +"響を返すようになりました。\n" +"以前は、引数を使うオペコードに対してはエラーでした。\n" +"また、``opcode`` が引数を使わない場合に整数の ``oparg`` を渡してもエラーにな" +"らず、``oparg`` を無視するようになりました。" #: ../../library/dis.rst:440 msgid "Python Bytecode Instructions" @@ -603,107 +660,116 @@ msgstr "" msgid "human readable name for operation" msgstr "人間が読むための命令名" -#: ../../library/dis.rst:462 msgid "" "numeric code for the base operation if operation is specialized; otherwise " "equal to :data:`opcode`" msgstr "" +"特殊化された命令の場合は基となる命令の数値コード。\n" +"それ以外は :data:`opcode` と同じです。" -#: ../../library/dis.rst:468 msgid "" "human readable name for the base operation if operation is specialized; " "otherwise equal to :data:`opname`" msgstr "" +"特殊化された命令の場合は基となる命令の、人間が読める名前。\n" +"それ以外は :data:`opname` と同じです。" #: ../../library/dis.rst:474 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "(ある場合は) 命令の数値引数、無ければ ``None``" -#: ../../library/dis.rst:478 msgid "alias for :data:`arg`" -msgstr "" +msgstr ":data:`arg` の別名" -#: ../../library/dis.rst:482 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" +"解決済みの引数値 (ある場合)。\n" +"ない場合は ``None``" -#: ../../library/dis.rst:487 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" +"命令の引数の、人間が読める説明 (ある場合)。\n" +"ない場合は空文字列。" #: ../../library/dis.rst:493 msgid "start index of operation within bytecode sequence" msgstr "バイトコード列の中での命令の開始位置" -#: ../../library/dis.rst:498 msgid "" "start index of operation within bytecode sequence, including prefixed " "``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`" msgstr "" +"バイトコード列内で命令が始まるインデックス。\n" +"前に ``EXTENDED_ARG`` 命令が付く場合はそれを含め、付かない場合は :data:" +"`offset` と同じです。" -#: ../../library/dis.rst:504 msgid "start index of the cache entries following the operation" -msgstr "" +msgstr "命令に続くキャッシュエントリーの開始インデックス" -#: ../../library/dis.rst:509 msgid "end index of the cache entries following the operation" -msgstr "" +msgstr "命令に続くキャッシュエントリーの終了インデックス" -#: ../../library/dis.rst:514 msgid "``True`` if this opcode starts a source line, otherwise ``False``" -msgstr "" +msgstr "このオペコードがソース行の先頭なら ``True``、それ以外なら ``False``" -#: ../../library/dis.rst:519 msgid "" "source line number associated with this opcode (if any), otherwise ``None``" msgstr "" +"このオペコードに対応するソースの行番号 (ある場合)。\n" +"ない場合は ``None``" #: ../../library/dis.rst:524 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" "他のコードからここへジャンプする場合は ``True`` 、そうでない場合は ``False``" -#: ../../library/dis.rst:529 msgid "" "bytecode index of the jump target if this is a jump operation, otherwise " "``None``" msgstr "" +"ジャンプ命令の場合はジャンプ先のバイトコードのインデックス。\n" +"それ以外は ``None``" -#: ../../library/dis.rst:535 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" +"この命令が対応する範囲の開始位置と終了位置を保持する :class:`dis.Positions` " +"オブジェクト。" -#: ../../library/dis.rst:540 msgid "" "Information about the cache entries of this instruction, as triplets of the " "form ``(name, size, data)``, where the ``name`` and ``size`` describe the " "cache format and data is the contents of the cache. ``cache_info`` is " "``None`` if the instruction does not have caches." msgstr "" +"``(name, size, data)`` 形式の 3 要素タプルで表した、この命令のキャッシュエン" +"トリーの情報。\n" +"``name`` と ``size`` はキャッシュの形式を表し、``data`` はキャッシュの内容で" +"す。\n" +"命令にキャッシュがなければ ``cache_info`` は ``None`` です。" -#: ../../library/dis.rst:550 msgid "Field ``positions`` is added." -msgstr "" +msgstr "``positions`` フィールドを追加しました。" -#: ../../library/dis.rst:554 msgid "Changed field ``starts_line``." -msgstr "" +msgstr "``starts_line`` フィールドを変更しました。" -#: ../../library/dis.rst:556 msgid "" "Added fields ``start_offset``, ``cache_offset``, ``end_offset``, " "``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` " "and ``cache_info``." msgstr "" +"``start_offset``、``cache_offset``、``end_offset``、``baseopname``、" +"``baseopcode``、``jump_target``、``oparg``、``line_number``、``cache_info`` " +"フィールドを追加しました。" -#: ../../library/dis.rst:563 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" +"情報が取得できない場合、一部のフィールドは ``None`` になることがあります。" #: ../../library/dis.rst:573 msgid "" @@ -714,89 +780,102 @@ msgstr "現在 Python コンパイラは次のバイトコード命令を生成 msgid "**General instructions**" msgstr "**一般的な命令**" -#: ../../library/dis.rst:578 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" +"以下ではインタープリタのスタックを ``STACK`` と呼び、Python のリストのように" +"扱って操作を説明します。\n" +"この表記ではスタックの先頭は ``STACK[-1]`` に相当します。" -#: ../../library/dis.rst:584 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" +"何もしない命令です。\n" +"バイトコード最適化器のプレースホルダーや、行トレースイベントの生成に使いま" +"す。" -#: ../../library/dis.rst:590 msgid "" "Do nothing code. Used by the interpreter to record :monitoring-event:" "`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events for :mod:`sys." "monitoring`." msgstr "" +"何もしない命令です。\n" +"インタープリタが :mod:`sys.monitoring` の :monitoring-event:`BRANCH_LEFT` " +"と :monitoring-event:`BRANCH_RIGHT` イベントを記録するために使います。" -#: ../../library/dis.rst:599 msgid "Removes the iterator from the top of the stack." -msgstr "" +msgstr "スタックの先頭からイテレーターを取り除きます。" -#: ../../library/dis.rst:606 msgid "Removes the top-of-stack item::" -msgstr "" +msgstr "スタックの先頭の要素を取り除きます。 ::" -#: ../../library/dis.rst:608 msgid "STACK.pop()" -msgstr "" +msgstr "STACK.pop()" -#: ../../library/dis.rst:613 msgid "" "Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up " "at the end of loops, hence the name." msgstr "" +"スタックの先頭の要素を取り除きます。\n" +"``POP_TOP`` と同じです。\n" +"ループの終わりの後始末に使うことが名前の由来です。" -#: ../../library/dis.rst:622 msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" +"``del STACK[-2]`` を実行します。\n" +"ジェネレーターの終了時の後始末に使います。" -#: ../../library/dis.rst:630 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" +"先頭から ``i`` 番目の要素を元の位置から取り除かず、スタックの先頭にプッシュし" +"ます。 ::" -#: ../../library/dis.rst:633 msgid "" "assert i > 0\n" "STACK.append(STACK[-i])" msgstr "" +"assert i > 0\n" +"STACK.append(STACK[-i])" -#: ../../library/dis.rst:641 msgid "Swap the top of the stack with the i-th element::" -msgstr "" +msgstr "スタックの先頭と、先頭から ``i`` 番目の要素を交換します。 ::" -#: ../../library/dis.rst:643 msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" -msgstr "" +msgstr "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" -#: ../../library/dis.rst:650 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " "itself. It is automatically hidden by all ``dis`` utilities, but can be " "viewed with ``show_caches=True``." msgstr "" +"このオペコードは実際の命令ではなく、インタープリタが有用なデータをバイトコー" +"ド自体にキャッシュするための追加領域を示します。\n" +"すべての ``dis`` ユーティリティで自動的に非表示になりますが、" +"``show_caches=True`` にすると表示できます。" -#: ../../library/dis.rst:655 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" +"論理的には、この領域は直前の命令の一部です。\n" +"多くのオペコードは決まった数のキャッシュが後続することを想定し、実行時にはイ" +"ンタープリタにそれらを読み飛ばさせます。" -#: ../../library/dis.rst:659 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" +"データの入ったキャッシュは任意の命令に見えることがあるため、高速化用データを" +"含む生の適応的バイトコードを読み取ったり変更したりするときは、十分な注意が必" +"要です。" #: ../../library/dis.rst:666 msgid "**Unary operations**" @@ -810,107 +889,110 @@ msgstr "" "1オペランド命令はスタックの先頭を取り出して操作を適用し、結果をスタックへプッ" "シュし戻します。" -#: ../../library/dis.rst:674 msgid "Implements ``STACK[-1] = -STACK[-1]``." -msgstr "" +msgstr "``STACK[-1] = -STACK[-1]`` を実行します。" -#: ../../library/dis.rst:679 msgid "Implements ``STACK[-1] = not STACK[-1]``." -msgstr "" +msgstr "``STACK[-1] = not STACK[-1]`` を実行します。" -#: ../../library/dis.rst:681 ../../library/dis.rst:1383 -#: ../../library/dis.rst:1399 msgid "This instruction now requires an exact :class:`bool` operand." msgstr "" +"この命令は、厳密に :class:`bool` 型の演算対象を要求するようになりました。" -#: ../../library/dis.rst:687 msgid "Implements ``STACK[-1] = ~STACK[-1]``." -msgstr "" +msgstr "``STACK[-1] = ~STACK[-1]`` を実行します。" -#: ../../library/dis.rst:692 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." -msgstr "" +msgstr "``STACK[-1] = iter(STACK[-1])`` を実行します。" -#: ../../library/dis.rst:697 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" +"``STACK[-1]`` が :term:`generator iterator` または :term:`coroutine` オブジェ" +"クトなら、そのままにします。\n" +"それ以外は ``STACK[-1] = iter(STACK[-1])`` を実行します。" -#: ../../library/dis.rst:705 msgid "Implements ``STACK[-1] = bool(STACK[-1])``." -msgstr "" +msgstr "``STACK[-1] = bool(STACK[-1])`` を実行します。" -#: ../../library/dis.rst:710 msgid "**Binary and in-place operations**" -msgstr "" +msgstr "**2 オペランド命令とインプレース命令**" -#: ../../library/dis.rst:712 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" +"2 オペランド命令は、スタックの先頭 2 要素 (``STACK[-1]`` と ``STACK[-2]``) を" +"取り出し、演算を行って結果をスタックに戻します。" -#: ../../library/dis.rst:715 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" +"インプレース命令は 2 オペランド命令に似ていますが、``STACK[-2]`` が対応してい" +"る場合はその場で演算を行います。\n" +"結果の ``STACK[-1]`` は元の ``STACK[-2]`` と同じオブジェクトになる場合があり" +"ますが、必ずそうなるわけではありません。" -#: ../../library/dis.rst:722 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" +"*op* の値に応じた 2 オペランド演算子またはインプレース演算子を実装します。 ::" -#: ../../library/dis.rst:725 msgid "" "rhs = STACK.pop()\n" "lhs = STACK.pop()\n" "STACK.append(lhs op rhs)" msgstr "" +"rhs = STACK.pop()\n" +"lhs = STACK.pop()\n" +"STACK.append(lhs op rhs)" -#: ../../library/dis.rst:730 msgid "" "With oparg :``NB_SUBSCR``, implements binary subscript (replaces opcode " "``BINARY_SUBSCR``)" msgstr "" +"``oparg`` が ``NB_SUBSCR`` の場合は、2 オペランドの添字参照を実行します (オペ" +"コード ``BINARY_SUBSCR`` に代わるものです)。" -#: ../../library/dis.rst:736 ../../library/dis.rst:746 -#: ../../library/dis.rst:754 ../../library/dis.rst:766 -#: ../../library/dis.rst:844 ../../library/dis.rst:854 -#: ../../library/dis.rst:864 ../../library/dis.rst:1070 -#: ../../library/dis.rst:1081 ../../library/dis.rst:1226 -#: ../../library/dis.rst:1238 ../../library/dis.rst:1250 msgid "Implements::" -msgstr "" +msgstr "次の処理を実行します。 ::" -#: ../../library/dis.rst:738 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" "value = STACK.pop()\n" "container[key] = value" msgstr "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"value = STACK.pop()\n" +"container[key] = value" -#: ../../library/dis.rst:748 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" "del container[key]" msgstr "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"del container[key]" -#: ../../library/dis.rst:756 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "container = STACK.pop()\n" "STACK.append(container[start:end])" msgstr "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"STACK.append(container[start:end])" -#: ../../library/dis.rst:768 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" @@ -918,113 +1000,127 @@ msgid "" "value = STACK.pop()\n" "container[start:end] = value" msgstr "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"value = STACK.pop()\n" +"container[start:end] = value" #: ../../library/dis.rst:777 msgid "**Coroutine opcodes**" msgstr "**コルーチン命令コード**" -#: ../../library/dis.rst:781 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " "generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or " "resolves ``o.__await__``." msgstr "" +"``STACK[-1] = get_awaitable(STACK[-1])`` を実行します。\n" +"ここで ``get_awaitable(o)`` は、``o`` がコルーチンオブジェクトか :data:" +"`~inspect.CO_ITERABLE_COROUTINE` フラグのあるジェネレーターオブジェクトなら " +"``o`` を返し、それ以外は ``o.__await__`` を解決します。" -#: ../../library/dis.rst:786 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" -msgstr "" +msgstr "``where`` オペランドがゼロでなければ、命令が現れる場所を示します:" -#: ../../library/dis.rst:789 msgid "``1``: After a call to ``__aenter__``" -msgstr "" +msgstr "``1``: ``__aenter__`` の呼び出しの後" -#: ../../library/dis.rst:790 msgid "``2``: After a call to ``__aexit__``" -msgstr "" +msgstr "``2``: ``__aexit__`` の呼び出しの後" -#: ../../library/dis.rst:794 msgid "Previously, this instruction did not have an oparg." -msgstr "" +msgstr "以前は、この命令に ``oparg`` はありませんでした。" -#: ../../library/dis.rst:800 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." -msgstr "" +msgstr "``STACK[-1] = STACK[-1].__aiter__()`` を実行します。" -#: ../../library/dis.rst:803 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" +"``__aiter__`` から awaitable オブジェクトを返すことは、サポートされなくなりま" +"した。" -#: ../../library/dis.rst:810 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" +"``STACK.append(get_awaitable(STACK[-1].__anext__()))`` を実行してスタックに追" +"加します。\n" +"``get_awaitable`` の詳細は ``GET_AWAITABLE`` を参照してください。" -#: ../../library/dis.rst:818 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " "and the raised exception in ``STACK[-1]``. Both are popped. If the exception " "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" +":keyword:`async for` ループを終了します。\n" +"次の要素を await するときに送出された例外を処理します。\n" +"スタックの ``STACK[-2]`` には非同期イテラブル、``STACK[-1]`` には送出された例" +"外があり、両方をポップします。\n" +"例外が :exc:`StopAsyncIteration` でなければ再送出します。" -#: ../../library/dis.rst:825 ../../library/dis.rst:916 -#: ../../library/dis.rst:927 msgid "" "Exception representation on the stack now consist of one, not three, items." -msgstr "" +msgstr "スタック上の例外の表現が、3 要素ではなく 1 要素になりました。" -#: ../../library/dis.rst:831 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " "instance of :exc:`StopIteration`, pop three values from the stack and push " "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" +"現在のフレームを通じた :meth:`~generator.throw` または :meth:`~generator." +"close` の呼び出し中に送出された例外を処理します。\n" +"``STACK[-1]`` が :exc:`StopIteration` のインスタンスなら、スタックから 3 つの" +"値をポップして、その ``value`` メンバーをプッシュします。\n" +"それ以外は ``STACK[-1]`` を再送出します。" #: ../../library/dis.rst:840 msgid "**Miscellaneous opcodes**" msgstr "**その他の命令コード**" -#: ../../library/dis.rst:846 msgid "" "item = STACK.pop()\n" "set.add(STACK[-i], item)" msgstr "" +"item = STACK.pop()\n" +"set.add(STACK[-i], item)" -#: ../../library/dis.rst:849 msgid "Used to implement set comprehensions." -msgstr "" +msgstr "集合内包表記の実装に使います。" -#: ../../library/dis.rst:856 msgid "" "item = STACK.pop()\n" "list.append(STACK[-i], item)" msgstr "" +"item = STACK.pop()\n" +"list.append(STACK[-i], item)" -#: ../../library/dis.rst:859 msgid "Used to implement list comprehensions." -msgstr "" +msgstr "リスト内包表記の実装に使います。" -#: ../../library/dis.rst:866 msgid "" "value = STACK.pop()\n" "key = STACK.pop()\n" "dict.__setitem__(STACK[-i], key, value)" msgstr "" +"value = STACK.pop()\n" +"key = STACK.pop()\n" +"dict.__setitem__(STACK[-i], key, value)" -#: ../../library/dis.rst:870 msgid "Used to implement dict comprehensions." -msgstr "" +msgstr "辞書内包表記の実装に使います。" -#: ../../library/dis.rst:873 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" +"マッピングの値が ``STACK[-1]``、キーが ``STACK[-2]`` になりました。\n" +"以前は逆でした。" #: ../../library/dis.rst:877 msgid "" @@ -1037,120 +1133,142 @@ msgstr "" "たは key/value ペアをスタックから取り除きますが、コンテナオブジェクトはループ" "の次のイテレーションで利用できるようにスタックに残しておきます。" -#: ../../library/dis.rst:885 msgid "Returns with ``STACK[-1]`` to the caller of the function." -msgstr "" +msgstr "``STACK[-1]`` を返り値として、関数の呼び出し元に戻ります。" -#: ../../library/dis.rst:890 msgid "Yields ``STACK.pop()`` from a :term:`generator`." -msgstr "" +msgstr ":term:`generator` から ``STACK.pop()`` を yield します。" -#: ../../library/dis.rst:892 msgid "oparg set to be the stack depth." -msgstr "" +msgstr "``oparg`` にスタックの深さを設定するようになりました。" -#: ../../library/dis.rst:895 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" +"ジェネレーターを効率よく閉じるため、``oparg`` に例外ブロックの深さを設定する" +"ようになりました。" -#: ../../library/dis.rst:898 msgid "" "oparg is ``1`` if this instruction is part of a yield-from or await, and " "``0`` otherwise." msgstr "" +"``oparg`` は、この命令が yield from または await の一部なら ``1``、それ以外" +"は ``0`` になりました。" -#: ../../library/dis.rst:904 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " "module body contains :term:`variable annotations ` " "statically." msgstr "" +"``locals()`` に ``__annotations__`` が定義されているかを確認し、なければ空の " +"``dict`` に設定します。\n" +"このオペコードは、クラスやモジュールの本体に :term:`変数アノテーション " +"` が静的に含まれる場合にのみ生成されます。" -#: ../../library/dis.rst:914 msgid "" "Pops a value from the stack, which is used to restore the exception state." -msgstr "" +msgstr "スタックから値をポップし、例外の状態を復元するために使います。" -#: ../../library/dis.rst:921 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set :attr:`~frame." "f_lasti` of the current frame." msgstr "" +"現在スタックの先頭にある例外を再送出します。\n" +"``oparg`` がゼロでなければ、さらに値を 1 つポップし、現在のフレームの :attr:" +"`~frame.f_lasti` を設定するために使います。" -#: ../../library/dis.rst:932 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" +"スタックから値を 1 つポップします。\n" +"現在の例外をスタックの先頭にプッシュし、最初にポップした値をスタックに戻しま" +"す。\n" +"例外ハンドラーで使います。" -#: ../../library/dis.rst:940 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" +"``except`` の例外の照合を行います。\n" +"``STACK[-2]`` が ``STACK[-1]`` に一致する例外かを調べます。\n" +"``STACK[-1]`` をポップし、照合結果の真偽値をプッシュします。" -#: ../../library/dis.rst:948 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" +"``except*`` の例外の照合を行います。\n" +"``STACK[-2]`` が表す例外グループに ``split(STACK[-1])`` を適用します。" -#: ../../library/dis.rst:951 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " "subgroup. When there is no match, pops one item (the match type) and pushes " "``None``." msgstr "" +"一致した場合は、スタックから 2 要素をポップし、一致しないサブグループ (すべて" +"一致した場合は ``None``)、一致するサブグループの順にプッシュします。\n" +"一致しない場合は、1 要素 (照合する型) をポップし、``None`` をプッシュします。" -#: ../../library/dis.rst:960 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " "call ``context_manager.__exit__(*exc_info())`` when an exception has " "occurred in a :keyword:`with` statement." msgstr "" +"スタックの先頭から 4 番目にある関数を、先頭の例外を表す引数 (type, val, tb) " +"で呼び出します。\n" +":keyword:`with` 文で例外が起きたときの ``context_manager." +"__exit__(*exc_info())`` の呼び出しを実装するために使います。" -#: ../../library/dis.rst:967 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" +"``__exit__`` 関数の位置が、スタックの先頭から 7 番目ではなく 4 番目になりまし" +"た。\n" +"スタック上の例外の表現が、3 要素ではなく 1 要素になりました。" -#: ../../library/dis.rst:974 msgid "" "Pushes a common constant onto the stack. The interpreter contains a " "hardcoded list of constants supported by this instruction. Used by the :" "keyword:`assert` statement to load :exc:`AssertionError`." msgstr "" +"よく使う定数をスタックにプッシュします。\n" +"インタープリタには、この命令がサポートする定数の固定のリストがあります。\n" +":keyword:`assert` 文で :exc:`AssertionError` をロードするために使います。" -#: ../../library/dis.rst:983 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" +":func:`!builtins.__build_class__` をスタックにプッシュします。\n" +"これは後でクラスを構築するために呼び出されます。" -#: ../../library/dis.rst:988 msgid "" "Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " "statements where comparison with structure of pattern is needed." msgstr "" +"``STACK.append(len(STACK[-1]))`` を実行します。\n" +"パターンの構造との比較が必要な :keyword:`match` 文で使います。" -#: ../../library/dis.rst:996 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " "its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " "Otherwise, push ``False``." msgstr "" +"``STACK[-1]`` が :class:`collections.abc.Mapping` のインスタンスなら (より厳" +"密には、:c:member:`~PyTypeObject.tp_flags` に :c:macro:`Py_TPFLAGS_MAPPING` " +"フラグが設定されていれば)、スタックに ``True`` をプッシュします。\n" +"それ以外は ``False`` をプッシュします。" -#: ../../library/dis.rst:1006 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -1158,59 +1276,80 @@ msgid "" "its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " "Otherwise, push ``False``." msgstr "" +"``STACK[-1]`` が :class:`collections.abc.Sequence` のインスタンスで、:class:" +"`str`/:class:`bytes`/:class:`bytearray` のインスタンスでは *ない* 場合 (より" +"厳密には、:c:member:`~PyTypeObject.tp_flags` に :c:macro:" +"`Py_TPFLAGS_SEQUENCE` フラグが設定されていれば)、スタックに ``True`` をプッ" +"シュします。\n" +"それ以外は ``False`` をプッシュします。" -#: ../../library/dis.rst:1016 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" +"``STACK[-1]`` はマッピングのキーのタプル、``STACK[-2]`` は照合対象です。\n" +"``STACK[-2]`` が ``STACK[-1]`` のすべてのキーを含んでいれば、対応する値を含" +"む :class:`tuple` をプッシュします。\n" +"それ以外は ``None`` をプッシュします。" -#: ../../library/dis.rst:1022 ../../library/dis.rst:1768 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" +"以前は、成功 (``True``) または失敗 (``False``) を示す真偽値もプッシュしていま" +"した。" -#: ../../library/dis.rst:1029 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`~codeobject.co_names` of the :ref:`code object `. The compiler tries to use :opcode:`STORE_FAST` or :opcode:" "`STORE_GLOBAL` if possible." msgstr "" +"``name = STACK.pop()`` を実行します。\n" +"*namei* は、:ref:`コードオブジェクト ` の :attr:`~codeobject." +"co_names` 属性内の ``name`` のインデックスです。\n" +"コンパイラは、可能なら :opcode:`STORE_FAST` または :opcode:`STORE_GLOBAL` を" +"使おうとします。" -#: ../../library/dis.rst:1036 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`~codeobject." "co_names` attribute of the :ref:`code object `." msgstr "" +"``del name`` を実行します。\n" +"*namei* は :ref:`コードオブジェクト ` の :attr:`~codeobject." +"co_names` 属性内のインデックスです。" -#: ../../library/dis.rst:1042 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" +"``STACK[-1]`` を *count* 個の値にアンパックし、右から左の順にスタックに置きま" +"す。\n" +"値はちょうど *count* 個でなければなりません。 ::" -#: ../../library/dis.rst:1045 msgid "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" msgstr "" +"assert(len(STACK[-1]) == count)\n" +"STACK.extend(STACK.pop()[:-count-1:-1])" -#: ../../library/dis.rst:1051 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " "be smaller than the number of items in the iterable: one of the new values " "will be a list of all leftover items." msgstr "" +"星付きの代入先への代入を実装します。\n" +"``STACK[-1]`` のイテラブルを個別の値にアンパックしますが、値の総数はイテラブ" +"ルの要素数より少なくてもかまいません。\n" +"新しい値の 1 つは、残りの要素をすべて含むリストになります。" -#: ../../library/dis.rst:1056 msgid "The number of values before and after the list value is limited to 255." msgstr "" +"リストとなる値の前後の値の数は、それぞれ 255 個までに制限されています。" -#: ../../library/dis.rst:1058 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -1218,6 +1357,12 @@ msgid "" "values where the low byte of *counts* is the number of values before the " "list value, the high byte of *counts* the number of values after it." msgstr "" +"リストとなる値より前の値の数はオペコードの引数に符号化されます。\n" +"リストより後にも値がある場合、その数は ``EXTENDED_ARG`` を使って符号化されま" +"す。\n" +"したがって、引数は 2 バイトの値とみなせます。\n" +"*counts* の下位バイトがリストより前の値の数、上位バイトがリストより後の値の数" +"です。" #: ../../library/dis.rst:1064 msgid "" @@ -1225,30 +1370,35 @@ msgid "" "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:1072 msgid "" "obj = STACK.pop()\n" "value = STACK.pop()\n" "obj.name = value" msgstr "" +"obj = STACK.pop()\n" +"value = STACK.pop()\n" +"obj.name = value" -#: ../../library/dis.rst:1076 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" +"ここで *namei* は :ref:`コードオブジェクト ` の :attr:" +"`~codeobject.co_names` 内の ``name`` のインデックスです。" -#: ../../library/dis.rst:1083 msgid "" "obj = STACK.pop()\n" "del obj.name" msgstr "" +"obj = STACK.pop()\n" +"del obj.name" -#: ../../library/dis.rst:1086 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" +"ここで *namei* は :ref:`コードオブジェクト ` の :attr:" +"`~codeobject.co_names` 内の ``name`` のインデックスです。" #: ../../library/dis.rst:1092 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." @@ -1266,25 +1416,28 @@ msgstr "" msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "``co_consts[consti]`` をスタックにプッシュします。" -#: ../../library/dis.rst:1107 msgid "" "Pushes the integer ``i`` onto the stack. ``i`` must be in ``range(256)``" msgstr "" +"整数 ``i`` をスタックにプッシュします。\n" +"``i`` は ``range(256)`` の範囲内でなければなりません。" -#: ../../library/dis.rst:1115 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" +"``co_names[namei]`` に対応する値をスタックにプッシュします。\n" +"名前はローカル、グローバル、組み込みの順に探します。" -#: ../../library/dis.rst:1121 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" +"ローカル変数の辞書への参照をスタックにプッシュします。\n" +":opcode:`LOAD_FROM_DICT_OR_DEREF` と :opcode:`LOAD_FROM_DICT_OR_GLOBALS` に渡" +"す名前空間の辞書を準備するために使います。" -#: ../../library/dis.rst:1130 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -1292,48 +1445,59 @@ msgid "" "variables in :ref:`annotation scopes ` within class " "bodies." msgstr "" +"スタックからマッピングをポップし、``co_names[namei]`` の値を探します。\n" +"そこに名前がなければ、:opcode:`LOAD_GLOBAL` と同様にグローバル、組み込みの順" +"に探します。\n" +"クラス本体の :ref:`アノテーションスコープ ` でグローバル変" +"数をロードするために使います。" -#: ../../library/dis.rst:1141 msgid "" "Constructs a new :class:`~string.templatelib.Template` instance from a tuple " "of strings and a tuple of interpolations and pushes the resulting object " "onto the stack::" msgstr "" +"文字列のタプルと補間のタプルから、新しい :class:`~string.templatelib." +"Template` インスタンスを構築し、結果のオブジェクトをスタックにプッシュしま" +"す。 ::" -#: ../../library/dis.rst:1145 msgid "" "interpolations = STACK.pop()\n" "strings = STACK.pop()\n" "STACK.append(_build_template(strings, interpolations))" msgstr "" +"interpolations = STACK.pop()\n" +"strings = STACK.pop()\n" +"STACK.append(_build_template(strings, interpolations))" -#: ../../library/dis.rst:1154 msgid "" "Constructs a new :class:`~string.templatelib.Interpolation` instance from a " "value and its source expression and pushes the resulting object onto the " "stack." msgstr "" +"値とそのソースの式から新しい :class:`~string.templatelib.Interpolation` イン" +"スタンスを構築し、結果のオブジェクトをスタックにプッシュします。" -#: ../../library/dis.rst:1158 msgid "" "If no conversion or format specification is present, ``format`` is set to " "``2``." -msgstr "" +msgstr "変換も書式指定もなければ、``format`` は ``2`` に設定されます。" -#: ../../library/dis.rst:1161 msgid "" "If the low bit of ``format`` is set, it indicates that the interpolation " "contains a format specification." msgstr "" +"``format`` の最下位ビットが立っていれば、補間に書式指定が含まれることを示しま" +"す。" -#: ../../library/dis.rst:1164 msgid "" "If ``format >> 2`` is non-zero, it indicates that the interpolation contains " "a conversion. The value of ``format >> 2`` is the conversion type (``0`` for " "no conversion, ``1`` for ``!s``, ``2`` for ``!r``, and ``3`` for ``!a``)::" msgstr "" +"``format >> 2`` がゼロでなければ、補間に変換が含まれることを示します。\n" +"``format >> 2`` の値は変換の種類を表します (``0`` は変換なし、``1`` は ``!" +"s``、``2`` は ``!r``、``3`` は ``!a``)。 ::" -#: ../../library/dis.rst:1169 msgid "" "conversion = format >> 2\n" "if format & 1:\n" @@ -1345,14 +1509,23 @@ msgid "" "STACK.append(_build_interpolation(value, expression, conversion, " "format_spec))" msgstr "" +"conversion = format >> 2\n" +"if format & 1:\n" +" format_spec = STACK.pop()\n" +"else:\n" +" format_spec = None\n" +"expression = STACK.pop()\n" +"value = STACK.pop()\n" +"STACK.append(_build_interpolation(value, expression, conversion, " +"format_spec))" -#: ../../library/dis.rst:1183 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack::" msgstr "" +"スタックから *count* 個の要素を取り出してタプルを作り、そのタプルをスタックに" +"プッシュします。 ::" -#: ../../library/dis.rst:1186 msgid "" "if count == 0:\n" " value = ()\n" @@ -1362,6 +1535,13 @@ msgid "" "\n" "STACK.append(value)" msgstr "" +"if count == 0:\n" +" value = ()\n" +"else:\n" +" value = tuple(STACK[-count:])\n" +" STACK = STACK[:-count]\n" +"\n" +"STACK.append(value)" #: ../../library/dis.rst:1197 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." @@ -1375,64 +1555,68 @@ msgstr "" ":opcode:`BUILD_TUPLE` と同じように動作しますが、この命令は set を作り出しま" "す。" -#: ../../library/dis.rst:1207 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" +"新しい辞書オブジェクトをスタックにプッシュします。\n" +"辞書が ``{..., STACK[-4]: STACK[-3], STACK[-2]: STACK[-1]}`` という *count* " +"個のエントリーを持つように、``2 * count`` 個の要素をポップします。" -#: ../../library/dis.rst:1211 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" +"*count* 個の要素を収容するサイズの空の辞書を作るのではなく、スタックの要素か" +"ら辞書を作るようになりました。" -#: ../../library/dis.rst:1218 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" +"スタックから *count* 個の文字列を連結し、結果の文字列をスタックにプッシュしま" +"す。" -#: ../../library/dis.rst:1228 msgid "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" msgstr "" +"seq = STACK.pop()\n" +"list.extend(STACK[-i], seq)" -#: ../../library/dis.rst:1231 msgid "Used to build lists." -msgstr "" +msgstr "リストの構築に使います。" -#: ../../library/dis.rst:1240 msgid "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" msgstr "" +"seq = STACK.pop()\n" +"set.update(STACK[-i], seq)" -#: ../../library/dis.rst:1243 msgid "Used to build sets." -msgstr "" +msgstr "集合の構築に使います。" -#: ../../library/dis.rst:1252 msgid "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" msgstr "" +"map = STACK.pop()\n" +"dict.update(STACK[-i], map)" -#: ../../library/dis.rst:1255 msgid "Used to build dicts." -msgstr "" +msgstr "辞書の構築に使います。" -#: ../../library/dis.rst:1262 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." -msgstr "" +msgstr ":opcode:`DICT_UPDATE` と同じですが、キーが重複すると例外を送出します。" -#: ../../library/dis.rst:1269 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" +"``namei`` の最下位ビットが立っていなければ、``STACK[-1]`` を " +"``getattr(STACK[-1], co_names[namei>>1])`` に置き換えます。" #: ../../library/dis.rst:1272 msgid "" @@ -1446,34 +1630,33 @@ msgid "" "pushed." msgstr "" -#: ../../library/dis.rst:1281 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" +"``namei`` の最下位ビットが立っている場合、属性または非束縛メソッドより先に、" +"それぞれ ``NULL`` または ``self`` をスタックにプッシュするようになりました。" -#: ../../library/dis.rst:1288 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" +"このオペコードは、引数なしと引数 2 つの両方の :func:`super` を実装します (例" +"えば ``super().method()``、``super().attr``、``super(cls, self).method()``、" +"``super(cls, self).attr``)。" -#: ../../library/dis.rst:1292 msgid "It pops three values from the stack (from top of stack down):" -msgstr "" +msgstr "スタックの先頭から順に、次の 3 つの値をポップします:" -#: ../../library/dis.rst:1294 msgid "``self``: the first argument to the current method" -msgstr "" +msgstr "``self``: 現在のメソッドの最初の引数" -#: ../../library/dis.rst:1295 msgid "``cls``: the class within which the current method was defined" -msgstr "" +msgstr "``cls``: 現在のメソッドを定義したクラス" -#: ../../library/dis.rst:1296 msgid "the global ``super``" -msgstr "" +msgstr "グローバルの ``super``" #: ../../library/dis.rst:1298 msgid "" @@ -1488,11 +1671,12 @@ msgid "" "it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1305 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" +"``namei`` の下から 2 番目のビットが立っていれば、引数 2 つの :func:`super` 呼" +"び出しであることを示します (立っていなければ引数なしです)。" #: ../../library/dis.rst:1313 msgid "" @@ -1501,21 +1685,23 @@ msgid "" "(``opname & 16``), the result should be coerced to ``bool``." msgstr "" -#: ../../library/dis.rst:1317 msgid "" "The fifth-lowest bit of the oparg now indicates a forced conversion to :" "class:`bool`." msgstr "" +"``oparg`` の下から 5 番目のビットが、:class:`bool` への強制変換を表すようにな" +"りました。" -#: ../../library/dis.rst:1324 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" +"``is`` による比較を行います。\n" +"``invert`` が 1 なら ``is not`` による比較を行います。" -#: ../../library/dis.rst:1331 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" +"``in`` による比較を行います。\n" +"``invert`` が 1 なら ``not in`` による比較を行います。" -#: ../../library/dis.rst:1338 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1523,73 +1709,94 @@ msgid "" "namespace is not affected: for a proper import statement, a subsequent :" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" +"モジュール ``co_names[namei]`` をインポートします。\n" +"``STACK[-1]`` と ``STACK[-2]`` をポップし、:func:`__import__` の *fromlist* " +"と *level* 引数として使います。\n" +"モジュールオブジェクトをスタックにプッシュします。\n" +"現在の名前空間は変わりません。\n" +"通常の import 文では、後続の :opcode:`STORE_FAST` 命令が名前空間を変更しま" +"す。" -#: ../../library/dis.rst:1346 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" +"``STACK[-1]`` にあるモジュールから属性 ``co_names[namei]`` をロードします。\n" +"結果のオブジェクトをスタックにプッシュし、その後の :opcode:`STORE_FAST` 命令" +"で保存できるようにします。" #: ../../library/dis.rst:1353 msgid "Increments bytecode counter by *delta*." msgstr "バイトコードカウンタを *delta* だけ増加させます。" -#: ../../library/dis.rst:1358 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" +"バイトコードカウンターを *delta* だけ減らします。\n" +"割り込みをチェックします。" -#: ../../library/dis.rst:1365 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" +"バイトコードカウンターを *delta* だけ減らします。\n" +"割り込みはチェックしません。" -#: ../../library/dis.rst:1372 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" +"``STACK[-1]`` が真なら、バイトコードカウンターを *delta* だけ増やします。\n" +"``STACK[-1]`` はポップします。" -#: ../../library/dis.rst:1375 ../../library/dis.rst:1391 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" +"``oparg`` は絶対位置のジャンプ先ではなく、相対的な差分になりました。\n" +"このオペコードは疑似命令となり、最終的なバイトコードでは方向 (前方/後方) ごと" +"の命令に置き換えられます。" -#: ../../library/dis.rst:1380 ../../library/dis.rst:1396 -#: ../../library/dis.rst:1409 ../../library/dis.rst:1420 msgid "This is no longer a pseudo-instruction." -msgstr "" +msgstr "疑似命令ではなくなりました。" -#: ../../library/dis.rst:1388 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" +"``STACK[-1]`` が偽なら、バイトコードカウンターを *delta* だけ増やします。\n" +"``STACK[-1]`` はポップします。" -#: ../../library/dis.rst:1404 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" +"``STACK[-1]`` が ``None`` でなければ、バイトコードカウンターを *delta* だけ増" +"やします。\n" +"``STACK[-1]`` はポップします。" -#: ../../library/dis.rst:1415 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" +"``STACK[-1]`` が ``None`` なら、バイトコードカウンターを *delta* だけ増やしま" +"す。\n" +"``STACK[-1]`` はポップします。" -#: ../../library/dis.rst:1425 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " "iterator below it). If the iterator indicates it is :term:`exhausted` then " "the byte code counter is incremented by *delta*." msgstr "" +"``STACK[-1]`` は :term:`iterator` です。\n" +"その :meth:`~iterator.__next__` メソッドを呼び出します。\n" +"新しい値が得られれば、イテレーターを下に残したまま値をスタックにプッシュしま" +"す。\n" +"イテレーターが :term:`exhausted` になったことを示した場合は、バイトコードカウ" +"ンターを *delta* だけ増やします。" -#: ../../library/dis.rst:1430 msgid "Up until 3.11 the iterator was popped when it was exhausted." -msgstr "" +msgstr "3.11 までは、要素を使い切るとイテレーターをポップしていました。" #: ../../library/dis.rst:1435 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." @@ -1608,84 +1815,94 @@ msgid "" msgstr "" "ローカルな ``co_varnames[var_num]`` への参照をスタックにプッシュします。" -#: ../../library/dis.rst:1445 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" +"このオペコードは、ローカル変数が初期化されていることが保証される場合にのみ使" +"うようになりました。\n" +":exc:`UnboundLocalError` を送出することはありません。" -#: ../../library/dis.rst:1451 msgid "" "Pushes a borrowed reference to the local ``co_varnames[var_num]`` onto the " "stack." msgstr "" +"ローカル変数 ``co_varnames[var_num]`` への借用参照をスタックにプッシュしま" +"す。" -#: ../../library/dis.rst:1458 msgid "" "Pushes references to ``co_varnames[var_nums >> 4]`` and " "``co_varnames[var_nums & 15]`` onto the stack." msgstr "" +"``co_varnames[var_nums >> 4]`` と ``co_varnames[var_nums & 15]`` への参照をス" +"タックにプッシュします。" -#: ../../library/dis.rst:1466 msgid "" "Pushes borrowed references to ``co_varnames[var_nums >> 4]`` and " "``co_varnames[var_nums & 15]`` onto the stack." msgstr "" +"``co_varnames[var_nums >> 4]`` と ``co_varnames[var_nums & 15]`` への借用参照" +"をスタックにプッシュします。" -#: ../../library/dis.rst:1473 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" +"ローカル変数 ``co_varnames[var_num]`` への参照をスタックにプッシュします。\n" +"変数が初期化されていなければ :exc:`UnboundLocalError` を送出します。" -#: ../../library/dis.rst:1481 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" +"ローカル変数 ``co_varnames[var_num]`` への参照をスタックにプッシュします (変" +"数が初期化されていなければ ``NULL`` をプッシュします)。\n" +"そして ``co_varnames[var_num]`` を ``NULL`` に設定します。" -#: ../../library/dis.rst:1489 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." -msgstr "" +msgstr "``STACK.pop()`` をローカル変数 ``co_varnames[var_num]`` に保存します。" -#: ../../library/dis.rst:1493 msgid "" "Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " "into ``co_varnames[var_nums & 15]``." msgstr "" +"``STACK[-1]`` を ``co_varnames[var_nums >> 4]`` に、``STACK[-2]`` を " +"``co_varnames[var_nums & 15]`` に保存します。" -#: ../../library/dis.rst:1500 msgid "" "Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " "pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the " "stack." msgstr "" +"``STACK.pop()`` をローカル変数 ``co_varnames[var_nums >> 4]`` に保存し、ロー" +"カル変数 ``co_varnames[var_nums & 15]`` への参照をスタックにプッシュします。" #: ../../library/dis.rst:1508 msgid "Deletes local ``co_varnames[var_num]``." msgstr "ローカルな ``co_varnames[var_num]`` を削除します。" -#: ../../library/dis.rst:1513 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" +"スロット ``i`` に新しいセルを作ります。\n" +"スロットが空でなければ、その値を新しいセルに保存します。" -#: ../../library/dis.rst:1521 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" +"\"fast locals\" 領域のスロット ``i`` にあるセルをロードします。\n" +"セルに入っているオブジェクトへの参照をスタックにプッシュします。" -#: ../../library/dis.rst:1524 ../../library/dis.rst:1546 -#: ../../library/dis.rst:1557 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" +"``i`` に :attr:`~codeobject.co_varnames` の長さをオフセットとして加えなくなり" +"ました。" -#: ../../library/dis.rst:1530 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1695,113 +1912,126 @@ msgid "" "LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " "class bodies." msgstr "" +"スタックからマッピングをポップし、その中で \"fast locals\" 領域のスロット " +"``i`` に対応する名前を探します。\n" +"名前がなければ、:opcode:`LOAD_DEREF` と同様にスロット ``i`` のセルからロード" +"します。\n" +"クラス本体 (以前は :opcode:`!LOAD_CLASSDEREF` を使用) や、クラス本体の :ref:`" +"アノテーションスコープ ` で :term:`クロージャ変数 " +"` をロードするために使います。" -#: ../../library/dis.rst:1543 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" +"``STACK.pop()`` を \"fast locals\" 領域のスロット ``i`` にあるセルに保存しま" +"す。" -#: ../../library/dis.rst:1552 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" +"\"fast locals\" 領域のスロット ``i`` にあるセルを空にします。\n" +":keyword:`del` 文で使います。" -#: ../../library/dis.rst:1563 msgid "" "Copies the ``n`` :term:`free (closure) variables ` from " "the closure into the frame. Removes the need for special code on the " "caller's side when calling closures." msgstr "" +"クロージャからフレームへ、``n`` 個の :term:`自由 (クロージャ) 変数 ` をコピーします。\n" +"これにより、クロージャの呼び出し元で特別なコードを用意する必要がなくなりま" +"す。" -#: ../../library/dis.rst:1572 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" +"*argc* の値に応じて、``raise`` 文の 3 つの形式のいずれかで例外を送出します:" -#: ../../library/dis.rst:1575 msgid "0: ``raise`` (re-raise previous exception)" -msgstr "" +msgstr "0: ``raise`` (直前の例外を再送出)" -#: ../../library/dis.rst:1576 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" +"1: ``raise STACK[-1]`` (``STACK[-1]`` の例外インスタンスまたは例外型を送出)" -#: ../../library/dis.rst:1577 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" +"2: ``raise STACK[-2] from STACK[-1]`` (``__cause__`` を ``STACK[-1]`` に設定" +"し、``STACK[-2]`` の例外インスタンスまたは例外型を送出)" -#: ../../library/dis.rst:1583 msgid "" "Calls a callable object with the number of arguments specified by ``argc``. " "On the stack are (in ascending order):" msgstr "" +"``argc`` で指定した数の引数で呼び出し可能オブジェクトを呼び出します。\n" +"スタックには下から上の順に次のものがあります:" -#: ../../library/dis.rst:1586 ../../library/dis.rst:1610 msgid "The callable" -msgstr "" +msgstr "呼び出し可能オブジェクト" -#: ../../library/dis.rst:1587 ../../library/dis.rst:1611 msgid "``self`` or ``NULL``" -msgstr "" +msgstr "``self`` または ``NULL``" -#: ../../library/dis.rst:1588 ../../library/dis.rst:1612 msgid "The remaining positional arguments" -msgstr "" +msgstr "残りの位置引数" -#: ../../library/dis.rst:1590 msgid "``argc`` is the total of the positional arguments, excluding ``self``." -msgstr "" +msgstr "``argc`` は ``self`` を除いた位置引数の総数です。" -#: ../../library/dis.rst:1592 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" +"``CALL`` はすべての引数と呼び出し可能オブジェクトをスタックからポップし、それ" +"らの引数でオブジェクトを呼び出して、その返り値をスタックにプッシュします。" -#: ../../library/dis.rst:1598 msgid "The callable now always appears at the same position on the stack." msgstr "" +"呼び出し可能オブジェクトが、常にスタック上の同じ位置に現れるようになりまし" +"た。" -#: ../../library/dis.rst:1601 msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" +"キーワード引数のある呼び出しは :opcode:`CALL_KW` で処理するようになりました。" -#: ../../library/dis.rst:1607 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including one or more named arguments. On the stack are (in ascending order):" msgstr "" +"1 つ以上の名前付き引数を含む、``argc`` で指定した数の引数で呼び出し可能オブ" +"ジェクトを呼び出します。\n" +"スタックには下から上の順に次のものがあります:" -#: ../../library/dis.rst:1613 msgid "The named arguments" -msgstr "" +msgstr "名前付き引数" -#: ../../library/dis.rst:1614 msgid "A :class:`tuple` of keyword argument names" -msgstr "" +msgstr "キーワード引数名の :class:`tuple`" -#: ../../library/dis.rst:1616 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self``. The length of the tuple of keyword argument names is the number of " "named arguments." msgstr "" +"``argc`` は ``self`` を除いた位置引数と名前付き引数の総数です。\n" +"キーワード引数名のタプルの長さが、名前付き引数の数です。" -#: ../../library/dis.rst:1619 msgid "" "``CALL_KW`` pops all arguments, the keyword names, and the callable object " "off the stack, calls the callable object with those arguments, and pushes " "the return value returned by the callable object." msgstr "" +"``CALL_KW`` はすべての引数、キーワード名、呼び出し可能オブジェクトをスタック" +"からポップし、それらの引数でオブジェクトを呼び出して、その返り値をスタックに" +"プッシュします。" -#: ../../library/dis.rst:1628 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1812,454 +2042,474 @@ msgid "" "callable object off the stack, calls the callable object with those " "arguments, and pushes the return value returned by the callable object." msgstr "" +"可変個の位置引数とキーワード引数で呼び出し可能オブジェクトを呼び出します。\n" +"*flags* の最下位ビットが立っている場合、スタックの先頭には追加のキーワード引" +"数を含むマッピングオブジェクトがあります。\n" +"呼び出し前に、マッピングオブジェクトとイテラブルをそれぞれアンパックし、内容" +"をキーワード引数と位置引数として渡します。\n" +"``CALL_FUNCTION_EX`` はすべての引数と呼び出し可能オブジェクトをスタックから" +"ポップし、それらの引数でオブジェクトを呼び出して、その返り値をスタックにプッ" +"シュします。" -#: ../../library/dis.rst:1643 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_ATTR` for non-method calls." msgstr "" +"スタックに ``NULL`` をプッシュします。\n" +"メソッド以外の呼び出しで :opcode:`LOAD_ATTR` がプッシュする ``NULL`` と呼び出" +"し手順を揃えるために使います。" -#: ../../library/dis.rst:1652 msgid "" "Pushes a new function object on the stack built from the code object at " "``STACK[-1]``." msgstr "" +"``STACK[-1]`` にあるコードオブジェクトから新しい関数オブジェクトを作り、ス" +"タックにプッシュします。" -#: ../../library/dis.rst:1654 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" -msgstr "" +msgstr "フラグ値 ``0x04`` は、辞書ではなく文字列のタプルになりました。" -#: ../../library/dis.rst:1657 msgid "Qualified name at ``STACK[-1]`` was removed." -msgstr "" +msgstr "``STACK[-1]`` にあった修飾名を取り除きました。" -#: ../../library/dis.rst:1660 msgid "" "Extra function attributes on the stack, signaled by oparg flags, were " "removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" +"``oparg`` のフラグで指定していた、スタック上の追加の関数属性を取り除きまし" +"た。\n" +"これらには :opcode:`SET_FUNCTION_ATTRIBUTE` を使うようになりました。" -#: ../../library/dis.rst:1667 msgid "" "Sets an attribute on a function object. Expects the function at " "``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " "and leaves the function at ``STACK[-1]``. The flag determines which " "attribute to set:" msgstr "" +"関数オブジェクトの属性を設定します。\n" +"``STACK[-1]`` に関数、``STACK[-2]`` に設定する属性値があることを想定し、両方" +"を取り出して関数を ``STACK[-1]`` に残します。\n" +"設定する属性はフラグで決まります:" -#: ../../library/dis.rst:1671 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" +"``0x01`` 位置専用パラメーターと位置またはキーワードのパラメーターのデフォルト" +"値を、位置の順に並べたタプル" -#: ../../library/dis.rst:1673 msgid "``0x02`` a dictionary of keyword-only parameters' default values" -msgstr "" +msgstr "``0x02`` キーワード専用パラメーターのデフォルト値の辞書" #: ../../library/dis.rst:1674 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1675 msgid "``0x08`` a tuple containing cells for free variables, making a closure" -msgstr "" +msgstr "``0x08`` 自由変数のセルを含み、クロージャを構成するタプル" -#: ../../library/dis.rst:1676 msgid "``0x10`` the :term:`annotate function` for the function object" -msgstr "" +msgstr "``0x10`` 関数オブジェクトの :term:`annotate function`" -#: ../../library/dis.rst:1680 msgid "" "Added ``0x10`` to indicate the annotate function for the function object." -msgstr "" +msgstr "関数オブジェクトのアノテーション関数を示す ``0x10`` を追加しました。" -#: ../../library/dis.rst:1688 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" +"スライスオブジェクトをスタックにプッシュします。\n" +"*argc* は 2 または 3 でなければなりません。\n" +"2 の場合は次の処理を行います。 ::" -#: ../../library/dis.rst:1690 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end))" -#: ../../library/dis.rst:1694 msgid "if it is 3, implements::" -msgstr "" +msgstr "3 の場合は次の処理を行います。 ::" -#: ../../library/dis.rst:1696 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" msgstr "" +"step = STACK.pop()\n" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end, step))" -#: ../../library/dis.rst:1701 msgid "See the :func:`slice` built-in function for more information." -msgstr "" +msgstr "詳しくは組み込み関数 :func:`slice` を参照してください。" -#: ../../library/dis.rst:1706 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " "argument. For each opcode, at most three prefixal ``EXTENDED_ARG`` are " "allowed, forming an argument from two-byte to four-byte." msgstr "" +"デフォルトの 1 バイトに収まらない大きさの引数を持つオペコードの前に付けま" +"す。\n" +"*ext* は、引数の上位ビットとなる追加の 1 バイトを保持します。\n" +"各オペコードの前には最大 3 つの ``EXTENDED_ARG`` を付けられ、2 バイトから 4 " +"バイトの引数を構成できます。" -#: ../../library/dis.rst:1714 msgid "Convert value to a string, depending on ``oparg``::" -msgstr "" +msgstr "``oparg`` に応じて値を文字列に変換します。 ::" -#: ../../library/dis.rst:1716 msgid "" "value = STACK.pop()\n" "result = func(value)\n" "STACK.append(result)" msgstr "" +"value = STACK.pop()\n" +"result = func(value)\n" +"STACK.append(result)" -#: ../../library/dis.rst:1720 msgid "``oparg == 1``: call :func:`str` on *value*" -msgstr "" +msgstr "``oparg == 1``: *value* に :func:`str` を適用します" -#: ../../library/dis.rst:1721 msgid "``oparg == 2``: call :func:`repr` on *value*" -msgstr "" +msgstr "``oparg == 2``: *value* に :func:`repr` を適用します" -#: ../../library/dis.rst:1722 msgid "``oparg == 3``: call :func:`ascii` on *value*" -msgstr "" +msgstr "``oparg == 3``: *value* に :func:`ascii` を適用します" -#: ../../library/dis.rst:1724 ../../library/dis.rst:1737 -#: ../../library/dis.rst:1750 msgid "Used for implementing formatted string literals (f-strings)." -msgstr "" +msgstr "フォーマット済み文字列リテラル (f-string) の実装に使います。" -#: ../../library/dis.rst:1731 msgid "Formats the value on top of stack::" -msgstr "" +msgstr "スタックの先頭の値を書式化します。 ::" -#: ../../library/dis.rst:1733 msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" "STACK.append(result)" msgstr "" +"value = STACK.pop()\n" +"result = value.__format__(\"\")\n" +"STACK.append(result)" -#: ../../library/dis.rst:1743 msgid "Formats the given value with the given format spec::" -msgstr "" +msgstr "指定された値を、指定された書式指定で書式化します。 ::" -#: ../../library/dis.rst:1745 msgid "" "spec = STACK.pop()\n" "value = STACK.pop()\n" "result = value.__format__(spec)\n" "STACK.append(result)" msgstr "" +"spec = STACK.pop()\n" +"value = STACK.pop()\n" +"result = value.__format__(spec)\n" +"STACK.append(result)" -#: ../../library/dis.rst:1757 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" +"``STACK[-1]`` はキーワード属性名のタプル、``STACK[-2]`` は照合に使うクラス、" +"``STACK[-3]`` は照合対象です。\n" +"*count* は位置によるサブパターンの数です。" -#: ../../library/dis.rst:1761 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " "required by *count* and ``STACK[-1]``, push a tuple of extracted attributes. " "Otherwise, push ``None``." msgstr "" +"``STACK[-1]``、``STACK[-2]``、``STACK[-3]`` をポップします。\n" +"``STACK[-3]`` が ``STACK[-2]`` のインスタンスで、*count* と ``STACK[-1]`` が" +"要求する位置属性とキーワード属性を持っていれば、取り出した属性のタプルをプッ" +"シュします。\n" +"それ以外は ``None`` をプッシュします。" -#: ../../library/dis.rst:1775 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" +"何もしない命令です。\n" +"内部のトレース、デバッグ、最適化のためのチェックを行います。" -#: ../../library/dis.rst:1777 msgid "" "The ``context`` operand consists of two parts. The lowest two bits indicate " "where the ``RESUME`` occurs:" msgstr "" +"``context`` オペランドは 2 つの部分で構成されます。\n" +"下位 2 ビットは ``RESUME`` が現れる位置を示します:" -#: ../../library/dis.rst:1780 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" +"``0`` ジェネレーター、コルーチン、非同期ジェネレーターのいずれでもない関数の" +"開始位置" -#: ../../library/dis.rst:1782 msgid "``1`` After a ``yield`` expression" -msgstr "" +msgstr "``1`` ``yield`` 式の後" -#: ../../library/dis.rst:1783 msgid "``2`` After a ``yield from`` expression" -msgstr "" +msgstr "``2`` ``yield from`` 式の後" -#: ../../library/dis.rst:1784 msgid "``3`` After an ``await`` expression" -msgstr "" +msgstr "``3`` ``await`` 式の後" -#: ../../library/dis.rst:1786 msgid "" "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " "otherwise." msgstr "" +"その次のビットは、RESUME の例外処理の深さが ``1`` なら ``1``、それ以外なら " +"``0`` です。" -#: ../../library/dis.rst:1791 msgid "The oparg value changed to include information about except-depth" -msgstr "" +msgstr "``oparg`` の値に例外処理の深さの情報を含めるようになりました。" -#: ../../library/dis.rst:1797 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" +"現在のフレームからジェネレーター、コルーチン、非同期ジェネレーターを作成しま" +"す。\n" +"これらの呼び出し可能オブジェクトのコードオブジェクトで、最初のオペコードとし" +"て使います。\n" +"現在のフレームをクリアし、新しく作ったジェネレーターを返します。" -#: ../../library/dis.rst:1806 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" +"``STACK[-1] = STACK[-2].send(STACK[-1])`` と同じです。\n" +"``yield from`` と ``await`` 文で使います。" -#: ../../library/dis.rst:1809 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" +"呼び出しが :exc:`StopIteration` を送出した場合、スタックの先頭の値をポップ" +"し、例外の ``value`` 属性をプッシュして、バイトコードカウンターを *delta* だ" +"け増やします。" -#: ../../library/dis.rst:1818 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" +"これは実際にはオペコードではありません。\n" +"[0,255] の範囲のオペコードについて、引数を使わないもの (``< HAVE_ARGUMENT``) " +"と使うもの (``>= HAVE_ARGUMENT``) の境界を示します。" -#: ../../library/dis.rst:1822 msgid "" "If your application uses pseudo instructions or specialized instructions, " "use the :data:`hasarg` collection instead." msgstr "" +"アプリケーションで疑似命令や特殊化された命令を扱う場合は、代わりに :data:" +"`hasarg` コレクションを使ってください。" -#: ../../library/dis.rst:1825 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" +"すべての命令が引数を持つようになりましたが、``< HAVE_ARGUMENT`` のオペコード" +"は引数を無視します。\n" +"以前は ``>= HAVE_ARGUMENT`` のオペコードだけが引数を持っていました。" -#: ../../library/dis.rst:1829 msgid "" "Pseudo instructions were added to the :mod:`!dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" +":mod:`!dis` モジュールに疑似命令を追加しました。\n" +"疑似命令では、``HAVE_ARGUMENT`` との比較で引数を使うかどうかを判定することは" +"できません。" -#: ../../library/dis.rst:1834 msgid "Use :data:`hasarg` instead." -msgstr "" +msgstr "代わりに :data:`hasarg` を使ってください。" -#: ../../library/dis.rst:1839 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" +"引数を 1 つ取る内部関数を呼び出します。\n" +"``STACK[-1]`` を引数として渡し、結果を ``STACK[-1]`` に設定します。\n" +"性能が重要ではない機能の実装に使います。" -#: ../../library/dis.rst:1843 ../../library/dis.rst:1897 msgid "The operand determines which intrinsic function is called:" -msgstr "" +msgstr "どの内部関数を呼び出すかはオペランドで決まります:" -#: ../../library/dis.rst:1846 ../../library/dis.rst:1900 msgid "Operand" -msgstr "" +msgstr "オペランド" #: ../../library/dis.rst:1846 ../../library/dis.rst:1900 msgid "Description" msgstr "説明" -#: ../../library/dis.rst:1848 msgid "``INTRINSIC_1_INVALID``" -msgstr "" +msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1848 ../../library/dis.rst:1902 msgid "Not valid" -msgstr "" +msgstr "無効" -#: ../../library/dis.rst:1850 msgid "``INTRINSIC_PRINT``" -msgstr "" +msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1850 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" +"引数を標準出力に表示します。\n" +"REPL で使います。" -#: ../../library/dis.rst:1853 msgid "``INTRINSIC_IMPORT_STAR``" -msgstr "" +msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1853 msgid "Performs ``import *`` for the named module." -msgstr "" +msgstr "指定された名前のモジュールに対して ``import *`` を実行します。" -#: ../../library/dis.rst:1856 msgid "``INTRINSIC_STOPITERATION_ERROR``" -msgstr "" +msgstr "``INTRINSIC_STOPITERATION_ERROR``" #: ../../library/dis.rst:1856 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1859 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" -msgstr "" +msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1859 msgid "Wraps an async generator value" -msgstr "" +msgstr "非同期ジェネレーターの値をラップします" -#: ../../library/dis.rst:1861 msgid "``INTRINSIC_UNARY_POSITIVE``" -msgstr "" +msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1861 msgid "Performs the unary ``+`` operation" -msgstr "" +msgstr "単項 ``+`` 演算を行います" -#: ../../library/dis.rst:1864 msgid "``INTRINSIC_LIST_TO_TUPLE``" -msgstr "" +msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1864 msgid "Converts a list to a tuple" -msgstr "" +msgstr "リストをタプルに変換します" -#: ../../library/dis.rst:1866 msgid "``INTRINSIC_TYPEVAR``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1866 msgid "Creates a :class:`typing.TypeVar`" -msgstr "" +msgstr ":class:`typing.TypeVar` を作成します" -#: ../../library/dis.rst:1868 msgid "``INTRINSIC_PARAMSPEC``" -msgstr "" +msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1868 msgid "Creates a :class:`typing.ParamSpec`" -msgstr "" +msgstr ":class:`typing.ParamSpec` を作成します" -#: ../../library/dis.rst:1871 msgid "``INTRINSIC_TYPEVARTUPLE``" -msgstr "" +msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1871 msgid "Creates a :class:`typing.TypeVarTuple`" -msgstr "" +msgstr ":class:`typing.TypeVarTuple` を作成します" -#: ../../library/dis.rst:1874 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" -msgstr "" +msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1874 msgid "Returns :class:`typing.Generic` subscripted with the argument" -msgstr "" +msgstr "引数を添字とした :class:`typing.Generic` を返します" -#: ../../library/dis.rst:1877 msgid "``INTRINSIC_TYPEALIAS``" -msgstr "" +msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1877 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" +":class:`typing.TypeAliasType` を作成します。\n" +":keyword:`type` 文で使います。\n" +"引数は、型エイリアスの名前、型パラメーター、値のタプルです。" -#: ../../library/dis.rst:1889 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" +"引数を 2 つ取る内部関数を呼び出します。\n" +"性能が重要ではない機能の実装に使います。 ::" -#: ../../library/dis.rst:1892 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" msgstr "" +"arg2 = STACK.pop()\n" +"arg1 = STACK.pop()\n" +"result = intrinsic2(arg1, arg2)\n" +"STACK.append(result)" -#: ../../library/dis.rst:1902 msgid "``INTRINSIC_2_INVALID``" -msgstr "" +msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1904 msgid "``INTRINSIC_PREP_RERAISE_STAR``" -msgstr "" +msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1904 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." -msgstr "" +msgstr "``try-except*`` から送出する :exc:`ExceptionGroup` を計算します。" -#: ../../library/dis.rst:1908 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1908 msgid "Creates a :class:`typing.TypeVar` with a bound." -msgstr "" +msgstr "上限付きの :class:`typing.TypeVar` を作成します。" -#: ../../library/dis.rst:1911 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1911 msgid "Creates a :class:`typing.TypeVar` with constraints." -msgstr "" +msgstr "制約付きの :class:`typing.TypeVar` を作成します。" -#: ../../library/dis.rst:1915 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -msgstr "" +msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1915 msgid "Sets the ``__type_params__`` attribute of a function." -msgstr "" +msgstr "関数の ``__type_params__`` 属性を設定します。" -#: ../../library/dis.rst:1924 msgid "" "Performs special method lookup on ``STACK[-1]``. If ``type(STACK[-1])." "__xxx__`` is a method, leave ``type(STACK[-1]).__xxx__; STACK[-1]`` on the " "stack. If ``type(STACK[-1]).__xxx__`` is not a method, leave ``STACK[-1]." "__xxx__; NULL`` on the stack." msgstr "" +"``STACK[-1]`` の特殊メソッドを検索します。\n" +"``type(STACK[-1]).__xxx__`` がメソッドなら、``type(STACK[-1]).__xxx__; " +"STACK[-1]`` をスタックに残します。\n" +"メソッドでなければ、``STACK[-1].__xxx__; NULL`` をスタックに残します。" -#: ../../library/dis.rst:1933 msgid "**Pseudo-instructions**" -msgstr "" +msgstr "**疑似命令**" -#: ../../library/dis.rst:1935 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" +"これらのオペコードは Python のバイトコードには現れません。\n" +"コンパイラが使用しますが、バイトコードを生成する前に実際のオペコードに置き換" +"えられるか、取り除かれます。" -#: ../../library/dis.rst:1940 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" +"後続のコードブロックの例外ハンドラーを設定します。\n" +"例外が発生すると、値スタックの深さを現在の状態に戻し、``target`` の例外ハンド" +"ラーに制御を移します。" -#: ../../library/dis.rst:1947 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -2267,53 +2517,62 @@ msgid "" "frame are restored to their current state, and control is transferred to the " "exception handler at ``target``." msgstr "" +"``SETUP_FINALLY`` と同じですが、例外発生時に最後の命令 (``lasti``) もスタック" +"にプッシュし、``RERAISE`` で復元できるようにします。\n" +"例外が発生すると、値スタックの深さとフレーム内の最後の命令を現在の状態に戻" +"し、``target`` の例外ハンドラーに制御を移します。" -#: ../../library/dis.rst:1956 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" +"``SETUP_CLEANUP`` と同じですが、例外発生時にスタックからさらに 1 要素をポップ" +"してから、``target`` の例外ハンドラーに制御を移します。" -#: ../../library/dis.rst:1960 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" +"この変種は :keyword:`with` と :keyword:`async with` で使います。\n" +"これらの構文は、コンテキストマネージャの :meth:`~object.__enter__` または :" +"meth:`~object.__aenter__` の返り値をスタックにプッシュします。" -#: ../../library/dis.rst:1967 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" +"直前の ``SETUP_FINALLY``、``SETUP_CLEANUP``、``SETUP_WITH`` に対応するコード" +"ブロックの終わりを示します。" -#: ../../library/dis.rst:1974 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" +"方向の指定のない相対ジャンプ命令です。\n" +"アセンブラーが、対応する方向 (前方/後方) の命令に置き換えます。" -#: ../../library/dis.rst:1980 msgid "" "Conditional jumps which do not impact the stack. Replaced by the sequence " "``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``." msgstr "" +"スタックを変更しない条件付きジャンプです。\n" +"``COPY 1``、``TO_BOOL``、``POP_JUMP_IF_TRUE/FALSE`` の並びに置き換えます。" -#: ../../library/dis.rst:1985 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" +"\"fast locals\" 領域のスロット ``i`` にあるセルへの参照をスタックにプッシュし" +"ます。" -#: ../../library/dis.rst:1988 msgid "" "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." -msgstr "" +msgstr "``LOAD_CLOSURE`` はアセンブラーで ``LOAD_FAST`` に置き換えられます。" -#: ../../library/dis.rst:1990 msgid "This opcode is now a pseudo-instruction." -msgstr "" +msgstr "このオペコードは疑似命令になりました。" #: ../../library/dis.rst:1997 msgid "Opcode collections" @@ -2327,12 +2586,14 @@ msgstr "" "これらのコレクションは、自動でバイトコード命令を解析するために提供されていま" "す:" -#: ../../library/dis.rst:2002 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" +"これらのコレクションは、疑似命令と計測用命令も含むようになりました。\n" +"これらは、それぞれ ``>= MIN_PSEUDO_OPCODE`` と ``>= " +"MIN_INSTRUMENTED_OPCODE`` の値を持つオペコードです。" #: ../../library/dis.rst:2009 msgid "Sequence of operation names, indexable using the bytecode." @@ -2348,15 +2609,13 @@ msgstr "命令コード名をバイトコードに対応づける辞書。" msgid "Sequence of all compare operation names." msgstr "すべての比較命令の名前のリスト。" -#: ../../library/dis.rst:2024 msgid "Sequence of bytecodes that use their argument." -msgstr "" +msgstr "引数を使うバイトコードのシーケンス。" #: ../../library/dis.rst:2031 msgid "Sequence of bytecodes that access a constant." msgstr "定数にアクセスするバイトコードのリスト。" -#: ../../library/dis.rst:2036 msgid "" "Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " @@ -2364,14 +2623,20 @@ msgid "" "from this scope. It does *not* include references to global or builtin " "scopes." msgstr "" +":term:`自由 (クロージャ) 変数 ` にアクセスするバイトコード" +"のシーケンス。\n" +"ここで「自由」とは、内側のスコープから参照される現在のスコープの名前、または" +"現在のスコープから参照される外側のスコープの名前を指します。\n" +"グローバルや組み込みのスコープへの参照は *含みません*。" #: ../../library/dis.rst:2044 msgid "Sequence of bytecodes that access an attribute by name." msgstr "名前によって属性にアクセスするバイトコードのリスト。" -#: ../../library/dis.rst:2049 msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" +"ジャンプ先を持つバイトコードのシーケンス。\n" +"ジャンプはすべて相対ジャンプです。" #: ../../library/dis.rst:2056 msgid "Sequence of bytecodes that access a local variable." @@ -2381,25 +2646,26 @@ msgstr "ローカル変数にアクセスするバイトコードのリスト。 msgid "Sequence of bytecodes of Boolean operations." msgstr "ブール命令のバイトコードのリスト。" -#: ../../library/dis.rst:2065 msgid "Sequence of bytecodes that set an exception handler." -msgstr "" +msgstr "例外ハンドラーを設定するバイトコードのシーケンス。" #: ../../library/dis.rst:2072 msgid "Sequence of bytecodes that have a relative jump target." msgstr "相対ジャンプ先を持つバイトコードのリスト。" -#: ../../library/dis.rst:2074 msgid "All jumps are now relative. Use :data:`hasjump`." msgstr "" +"すべてのジャンプが相対ジャンプになりました。\n" +":data:`hasjump` を使ってください。" #: ../../library/dis.rst:2080 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "絶対ジャンプ先を持つバイトコードのリスト。" -#: ../../library/dis.rst:2082 msgid "All jumps are now relative. This list is empty." msgstr "" +"すべてのジャンプが相対ジャンプになりました。\n" +"このリストは空です。" #: ../../library/dis.rst:1686 msgid "built-in function" diff --git a/library/distutils.po b/library/distutils.po index b46c8877c..f61f86d25 100644 --- a/library/distutils.po +++ b/library/distutils.po @@ -18,20 +18,24 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/distutils.rst:2 msgid ":mod:`!distutils` --- Building and installing Python modules" -msgstr "" +msgstr ":mod:`!distutils` --- Python モジュールのビルドとインストール" -#: ../../library/distutils.rst:10 msgid "" "This module is no longer part of the Python standard library. It was :ref:" "`removed in Python 3.12 ` after being " "deprecated in Python 3.10. The removal was decided in :pep:`632`, which has " "`migration advice `_." msgstr "" +"このモジュールは Python 標準ライブラリから削除されました。\n" +"Python 3.10 で非推奨となった後、:ref:`Python 3.12 で削除されました " +"`。\n" +"削除は :pep:`632` で決定され、この PEP には `移行に関する助言 `_ も記載されています。" -#: ../../library/distutils.rst:16 msgid "" "The last version of Python that provided the :mod:`!distutils` module was " "`Python 3.11 `_." msgstr "" +":mod:`!distutils` モジュールを提供していた最後の Python バージョンは `Python " +"3.11 `_ です。" diff --git a/library/doctest.po b/library/doctest.po index 1c1e2e56b..7b6291543 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -31,12 +31,14 @@ msgstr ":mod:`!doctest` --- 対話型の Python の例をテストする" msgid "**Source code:** :source:`Lib/doctest.py`" msgstr "**ソースコード:** :source:`Lib/doctest.py`" -#: ../../library/doctest.rst:11 msgid "" "The :mod:`!doctest` module searches for pieces of text that look like " "interactive Python sessions, and then executes those sessions to verify that " "they work exactly as shown. There are several common ways to use doctest:" msgstr "" +":mod:`!doctest` モジュールは Python の対話セッションに見えるテキストを探し、" +"そのセッションを実行して記載どおりに動作するか検証します。\n" +"主な使い方は次のとおりです。" #: ../../library/doctest.rst:15 msgid "" @@ -70,7 +72,6 @@ msgstr "" msgid "Here's a complete but small example module::" msgstr "以下に完全かつ短い実行例を示します::" -#: ../../library/doctest.rst:28 msgid "" "\"\"\"\n" "This is the \"example\" module.\n" @@ -127,12 +128,69 @@ msgid "" " import doctest\n" " doctest.testmod()" msgstr "" +"\"\"\"\n" +"これは \"example\" モジュールです。\n" +"\n" +"example モジュールは factorial() という関数を一つ提供します。\n" +"例えば、\n" +"\n" +">>> factorial(5)\n" +"120\n" +"\"\"\"\n" +"\n" +"def factorial(n):\n" +" \"\"\"0 以上の整数 n の階乗を返します。\n" +"\n" +" >>> [factorial(n) for n in range(6)]\n" +" [1, 1, 2, 6, 24, 120]\n" +" >>> factorial(30)\n" +" 265252859812191058636308480000000\n" +" >>> factorial(-1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be >= 0\n" +"\n" +" 浮動小数点数でも階乗を求められますが、その値は厳密に整数でなければなりま" +"せん:\n" +" >>> factorial(30.1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be exact integer\n" +" >>> factorial(30.0)\n" +" 265252859812191058636308480000000\n" +"\n" +" また、極端に大きな値も使えません:\n" +" >>> factorial(1e100)\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +" \"\"\"\n" +"\n" +" import math\n" +" if not n >= 0:\n" +" raise ValueError(\"n must be >= 0\")\n" +" if math.floor(n) != n:\n" +" raise ValueError(\"n must be exact integer\")\n" +" if n+1 == n: # 1e300 のような値を検出\n" +" raise OverflowError(\"n too large\")\n" +" result = 1\n" +" factor = 2\n" +" while factor <= n:\n" +" result *= factor\n" +" factor += 1\n" +" return result\n" +"\n" +"\n" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" -#: ../../library/doctest.rst:83 msgid "" "If you run :file:`example.py` directly from the command line, :mod:`!" "doctest` works its magic:" msgstr "" +":file:`example.py` をコマンドラインから直接実行すると、:mod:`!doctest` が働き" +"ます。" #: ../../library/doctest.rst:86 msgid "" @@ -142,14 +200,16 @@ msgstr "" "$ python example.py\n" "$" -#: ../../library/doctest.rst:91 msgid "" "There's no output! That's normal, and it means all the examples worked. " "Pass ``-v`` to the script, and :mod:`!doctest` prints a detailed log of what " "it's trying, and prints a summary at the end:" msgstr "" +"何も出力されません!これは正常で、すべての実行例が動作したことを意味しま" +"す。\n" +"スクリプトに ``-v`` を渡すと、:mod:`!doctest` は試している内容の詳細なログを" +"出力し、最後に結果をまとめて表示します。" -#: ../../library/doctest.rst:95 msgid "" "$ python example.py -v\n" "Trying:\n" @@ -163,12 +223,22 @@ msgid "" " [1, 1, 2, 6, 24, 120]\n" "ok" msgstr "" +"$ python example.py -v\n" +"Trying:\n" +" factorial(5)\n" +"Expecting:\n" +" 120\n" +"ok\n" +"Trying:\n" +" [factorial(n) for n in range(6)]\n" +"Expecting:\n" +" [1, 1, 2, 6, 24, 120]\n" +"ok" #: ../../library/doctest.rst:109 msgid "And so on, eventually ending with:" msgstr "といった具合で、最後には:" -#: ../../library/doctest.rst:111 msgid "" "Trying:\n" " factorial(1e100)\n" @@ -185,8 +255,21 @@ msgid "" "Test passed.\n" "$" msgstr "" +"Trying:\n" +" factorial(1e100)\n" +"Expecting:\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +"ok\n" +"2 items passed all tests:\n" +" 1 test in __main__\n" +" 6 tests in __main__.factorial\n" +"7 tests in 2 items.\n" +"7 passed.\n" +"Test passed.\n" +"$" -#: ../../library/doctest.rst:128 msgid "" "That's all you need to know to start making productive use of :mod:`!" "doctest`! Jump in. The following sections provide full details. Note that " @@ -194,12 +277,19 @@ msgid "" "libraries. Especially useful examples can be found in the standard test " "file :file:`Lib/test/test_doctest/test_doctest.py`." msgstr "" +":mod:`!doctest` を役立てるには、これだけ知っていれば十分です!さっそく使って" +"みましょう。\n" +"以下の節では詳細を説明します。\n" +"Python 標準のテストスイートやライブラリには、doctest の例が数多くあります。\n" +"特に参考になる例は、標準のテストファイル :file:`Lib/test/test_doctest/" +"test_doctest.py` にあります。" -#: ../../library/doctest.rst:134 msgid "" "Output is colorized by default and can be :ref:`controlled using environment " "variables `." msgstr "" +"出力はデフォルトで色付きになり、:ref:`環境変数で制御できます `。" #: ../../library/doctest.rst:142 msgid "Simple Usage: Checking Examples in Docstrings" @@ -213,12 +303,14 @@ msgstr "" "doctest を試す簡単な方法 (とはいえ、いつもそうする必要はないのですが) は、各" "モジュール :mod:`!M` の最後を、以下のようにして締めくくることです::" -#: ../../library/doctest.rst:147 msgid "" "if __name__ == \"__main__\":\n" " import doctest\n" " doctest.testmod()" msgstr "" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" #: ../../library/doctest.rst:151 msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`." @@ -277,11 +369,12 @@ msgstr "" "func:`testmod` は :data:`sys.argv` 上のスイッチを調べません。(したがって、 " "``-v`` をつけても効果はありません)。" -#: ../../library/doctest.rst:175 msgid "" "There is also a command line shortcut for running :func:`testmod`, see " "section :ref:`doctest-cli`." msgstr "" +":func:`testmod` をコマンドラインから簡単に実行する方法もあります。\n" +":ref:`doctest-cli` 節を参照してください。" #: ../../library/doctest.rst:178 msgid "" @@ -324,7 +417,6 @@ msgstr "" "ラムである必要はありません!例えば、 :file:`example.txt` には以下のような内容" "が入っているとします:" -#: ../../library/doctest.rst:197 msgid "" "The ``example`` module\n" "======================\n" @@ -342,6 +434,21 @@ msgid "" " >>> factorial(6)\n" " 120" msgstr "" +"``example`` モジュール\n" +"=====================\n" +"\n" +"``factorial`` の使い方\n" +"---------------------\n" +"\n" +"これは reStructuredText 形式のテキストファイルの例です。\n" +"まず ``example`` モジュールから ``factorial`` をインポートします:\n" +"\n" +" >>> from example import factorial\n" +"\n" +"次に、使ってみましょう:\n" +"\n" +" >>> factorial(6)\n" +" 120" #: ../../library/doctest.rst:215 msgid "" @@ -351,7 +458,6 @@ msgstr "" "``doctest.testfile(\"example.txt\")`` を実行すると、このドキュメント内のエ" "ラーを見つけ出します::" -#: ../../library/doctest.rst:218 msgid "" "File \"./example.txt\", line 14, in example.txt\n" "Failed example:\n" @@ -361,6 +467,13 @@ msgid "" "Got:\n" " 720" msgstr "" +"File \"./example.txt\", line 14, in example.txt\n" +"Failed example:\n" +" factorial(6)\n" +"Expected:\n" +" 120\n" +"Got:\n" +" 720" #: ../../library/doctest.rst:226 msgid "" @@ -394,11 +507,12 @@ msgstr "" "ンスイッチ ``-v`` またはオプションのキーワード引数 *verbose* によって指定でき" "ます。" -#: ../../library/doctest.rst:239 msgid "" "There is also a command line shortcut for running :func:`testfile`, see " "section :ref:`doctest-cli`." msgstr "" +":func:`testfile` をコマンドラインから簡単に実行する方法もあります。\n" +":ref:`doctest-cli` 節を参照してください。" #: ../../library/doctest.rst:242 msgid "" @@ -411,20 +525,21 @@ msgstr "" msgid "Command-line Usage" msgstr "コマンドラインでの使用" -#: ../../library/doctest.rst:250 msgid "" "The :mod:`!doctest` module can be invoked as a script from the command line:" msgstr "" +":mod:`!doctest` モジュールはコマンドラインからスクリプトとして実行できます。" #: ../../library/doctest.rst:252 msgid "python -m doctest [-v] [-o OPTION] [-f] file [file ...]" msgstr "python -m doctest [-v] [-o OPTION] [-f] file [file ...]" -#: ../../library/doctest.rst:260 msgid "" "Detailed report of all examples tried is printed to standard output, along " "with assorted summaries at the end::" msgstr "" +"試したすべての実行例の詳細な報告を標準出力に表示し、最後に各種の結果をまとめ" +"ます。 ::" #: ../../library/doctest.rst:263 msgid "python -m doctest -v example.py" @@ -441,25 +556,26 @@ msgstr "" "ジュールをそのパッケージからインポートしている場合はうまく動かないことに注意" "してください。" -#: ../../library/doctest.rst:269 msgid "" "If the file name does not end with :file:`.py`, :mod:`!doctest` infers that " "it must be run with :func:`testfile` instead::" msgstr "" +"ファイル名が :file:`.py` で終わっていない場合、:mod:`!doctest` は代わりに :" +"func:`testfile` で実行すべきだと判断します。 ::" #: ../../library/doctest.rst:272 msgid "python -m doctest -v example.txt" msgstr "python -m doctest -v example.txt" -#: ../../library/doctest.rst:276 msgid "" "Option flags control various aspects of doctest's behavior, see section :ref:" "`doctest-options`." msgstr "" +"オプションフラグで doctest のさまざまな動作を制御できます。\n" +":ref:`doctest-options` 節を参照してください。" -#: ../../library/doctest.rst:283 msgid "This is shorthand for ``-o FAIL_FAST``." -msgstr "" +msgstr "``-o FAIL_FAST`` の短縮形です。" #: ../../library/doctest.rst:291 msgid "How It Works" @@ -493,7 +609,6 @@ msgstr "" "モジュールの docstring と、すべての関数、クラスおよびメソッドの docstring が" "検索されます。モジュールに import されたオブジェクトは検索されません。" -#: ../../library/doctest.rst:316 msgid "" "In addition, there are cases when you want tests to be part of a module but " "not part of the help text, which requires that the tests not be included in " @@ -505,12 +620,21 @@ msgid "" "docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." "__test__.K``." msgstr "" +"テストをモジュールに含めつつ、ヘルプテキストには表示したくない場合もありま" +"す。\n" +"その場合、テストを docstring に含めることはできません。\n" +"Doctest はモジュールレベルの変数 ``__test__`` を探し、それを使って他のテスト" +"を見つけます。\n" +"``M.__test__`` が存在する場合、その値は辞書でなければならず、各項目は名前 (文" +"字列) を関数オブジェクト、クラスオブジェクト、または文字列に対応付けます。\n" +"``M.__test__`` から見つかった関数やクラスの docstring が検索され、文字列は " +"docstring として扱われます。\n" +"出力では、``M.__test__`` のキー ``K`` は ``M.__test__.K`` という名前で表示さ" +"れます。" -#: ../../library/doctest.rst:325 msgid "For example, place this block of code at the top of :file:`example.py`:" -msgstr "" +msgstr "例えば、次のコードブロックを :file:`example.py` の先頭に置きます。" -#: ../../library/doctest.rst:327 msgid "" "__test__ = {\n" " 'numbers': \"\"\"\n" @@ -522,8 +646,16 @@ msgid "" "\"\"\"\n" "}" msgstr "" +"__test__ = {\n" +" 'numbers': \"\"\"\n" +">>> factorial(6)\n" +"720\n" +"\n" +">>> [factorial(n) for n in range(6)]\n" +"[1, 1, 2, 6, 24, 120]\n" +"\"\"\"\n" +"}" -#: ../../library/doctest.rst:339 msgid "" "The value of ``example.__test__[\"numbers\"]`` will be treated as a " "docstring and all the tests inside it will be run. It is important to note " @@ -531,6 +663,11 @@ msgid "" "mod:`!doctest` searches them recursively for docstrings, which are then " "scanned for tests." msgstr "" +"``example.__test__[\"numbers\"]`` の値は docstring として扱われ、その中のテス" +"トがすべて実行されます。\n" +"辞書の値には関数、クラスオブジェクト、モジュールを指定することもできます。\n" +"その場合、:mod:`!doctest` はそれらから docstring を再帰的に探し、見つかった " +"docstring からテストを検索します。" #: ../../library/doctest.rst:345 msgid "" @@ -540,17 +677,20 @@ msgstr "" "検索中に見つかったクラスも同様に再帰的に検索が行われ、クラスに含まれているメ" "ソッドおよびネストされたクラスについて docstring のテストが行われます。" -#: ../../library/doctest.rst:350 msgid "" "``doctest`` can only automatically discover classes and functions that are " "defined at the module level or inside other classes." msgstr "" +"``doctest`` が自動的に見つけられるのは、モジュールレベルまたは他のクラス内で" +"定義されたクラスと関数だけです。" -#: ../../library/doctest.rst:353 msgid "" "Since nested classes and functions only exist when an outer function is " "called, they cannot be discovered. Define them outside to make them visible." msgstr "" +"関数内にネストされたクラスや関数は、外側の関数が呼ばれたときにしか存在しない" +"ため、見つけることができません。\n" +"見つけられるようにするには、関数の外で定義してください。" #: ../../library/doctest.rst:359 msgid "How are Docstring Examples Recognized?" @@ -566,7 +706,6 @@ msgstr "" "ます。とはいえ、 ``doctest`` は特定の Python シェルの振る舞いを正確にエミュ" "レーションしようとするわけではありません。" -#: ../../library/doctest.rst:366 msgid "" ">>> # comments are ignored\n" ">>> x = 12\n" @@ -584,6 +723,21 @@ msgid "" "NO!!!\n" ">>>" msgstr "" +">>> # コメントは無視されます\n" +">>> x = 12\n" +">>> x\n" +"12\n" +">>> if x == 13:\n" +"... print(\"yes\")\n" +"... else:\n" +"... print(\"no\")\n" +"... print(\"NO\")\n" +"... print(\"NO!!!\")\n" +"...\n" +"no\n" +"NO\n" +"NO!!!\n" +">>>" #: ../../library/doctest.rst:386 msgid "" @@ -654,7 +808,6 @@ msgstr "" "の理由でバックスラッシュを用いる場合、raw docstring を使ってバックスラッシュ" "を入力どおりに扱わせるようにしなければなりません::" -#: ../../library/doctest.rst:416 msgid "" ">>> def f(x):\n" "... r'''Backslashes in a raw docstring: m\\n'''\n" @@ -662,6 +815,11 @@ msgid "" ">>> print(f.__doc__)\n" "Backslashes in a raw docstring: m\\n" msgstr "" +">>> def f(x):\n" +"... r'''Backslashes in a raw docstring: m\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" #: ../../library/doctest.rst:422 msgid "" @@ -675,7 +833,6 @@ msgstr "" "doctest にあるバックスラッシュを二重にする (そして raw string を使わない) と" "いう方法もあります::" -#: ../../library/doctest.rst:426 msgid "" ">>> def f(x):\n" "... '''Backslashes in a raw docstring: m\\\\n'''\n" @@ -683,18 +840,26 @@ msgid "" ">>> print(f.__doc__)\n" "Backslashes in a raw docstring: m\\n" msgstr "" +">>> def f(x):\n" +"... '''Backslashes in a raw docstring: m\\\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" #: ../../library/doctest.rst:432 msgid "The starting column doesn't matter::" msgstr "開始カラムはどこでもかまいません::" -#: ../../library/doctest.rst:434 msgid "" ">>> assert \"Easy!\"\n" " >>> import math\n" " >>> math.floor(1.9)\n" " 1" msgstr "" +">>> assert \"Easy!\"\n" +" >>> import math\n" +" >>> math.floor(1.9)\n" +" 1" #: ../../library/doctest.rst:439 msgid "" @@ -708,7 +873,6 @@ msgstr "" msgid "What's the Execution Context?" msgstr "実行コンテキストとは何か?" -#: ../../library/doctest.rst:448 msgid "" "By default, each time :mod:`!doctest` finds a docstring to test, it uses a " "*shallow copy* of :mod:`!M`'s globals, so that running tests doesn't change " @@ -718,6 +882,14 @@ msgid "" "names defined earlier in the docstring being run. Examples cannot see names " "defined in other docstrings." msgstr "" +"デフォルトでは、:mod:`!doctest` はテストする docstring を見つけるたびに :mod:" +"`!M` のグローバル変数の *浅いコピー* を使います。\n" +"これにより、テストの実行でモジュールの実際のグローバル変数が変更されるのを防" +"ぐとともに、:mod:`!M` のあるテストが残した状態によって別のテストが偶然成功す" +"るのを防ぎます。\n" +"したがって、実行例では :mod:`!M` のトップレベルで定義された名前や、実行中の " +"docstring 内でそれ以前に定義された名前を自由に使えます。\n" +"他の docstring 内で定義された名前は参照できません。" #: ../../library/doctest.rst:456 msgid "" @@ -748,13 +920,16 @@ msgstr "" msgid "Simple example::" msgstr "簡単な例を示しましょう::" -#: ../../library/doctest.rst:473 msgid "" ">>> [1, 2, 3].remove(42)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" "ValueError: list.remove(x): x not in list" msgstr "" +">>> [1, 2, 3].remove(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: list.remove(x): x not in list" #: ../../library/doctest.rst:478 msgid "" @@ -774,11 +949,12 @@ msgstr "" "なりません。トレースバックの形式は以下の二通りの行のいずれかで、実行例の最初" "の行と同じインデントでなければりません::" -#: ../../library/doctest.rst:485 msgid "" "Traceback (most recent call last):\n" "Traceback (innermost last):" msgstr "" +"Traceback (most recent call last):\n" +"Traceback (innermost last):" #: ../../library/doctest.rst:488 msgid "" @@ -801,7 +977,6 @@ msgstr "" "入った行があります。これは通常トレースバックの最後の行ですが、例外が複数行の" "詳細情報を持っている場合、複数の行にわたることもあります::" -#: ../../library/doctest.rst:497 msgid "" ">>> raise ValueError('multi\\n line\\ndetail')\n" "Traceback (most recent call last):\n" @@ -810,6 +985,12 @@ msgid "" " line\n" "detail" msgstr "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: multi\n" +" line\n" +"detail" #: ../../library/doctest.rst:504 msgid "" @@ -829,7 +1010,6 @@ msgstr "" "ない限り、トレースバックスタックは省略する、ということです。したがって、先ほ" "どの例は以下のように書くべきでしょう::" -#: ../../library/doctest.rst:510 msgid "" ">>> raise ValueError('multi\\n line\\ndetail')\n" "Traceback (most recent call last):\n" @@ -838,6 +1018,12 @@ msgid "" " line\n" "detail" msgstr "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: multi\n" +" line\n" +"detail" msgid "" "Note that tracebacks are treated very specially. In particular, in the " @@ -911,13 +1097,13 @@ msgstr "" "な :exc:`!SyntaxError` をテストする必要があるというごく稀なケースでは、実行例" "にトレースバックヘッダを手作業で追加する必要があるでしょう。" -#: ../../library/doctest.rst:550 msgid "" "For some exceptions, Python displays the position of the error using ``^`` " "markers and tildes::" msgstr "" +"一部の例外では、Python は ``^`` マーカとチルダを使ってエラーの位置を示しま" +"す。 ::" -#: ../../library/doctest.rst:553 msgid "" ">>> 1 + None\n" " File \"\", line 1\n" @@ -925,6 +1111,11 @@ msgid "" " ~~^~~~~~\n" "TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" msgstr "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ~~^~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" #: ../../library/doctest.rst:559 msgid "" @@ -937,7 +1128,6 @@ msgstr "" "ません。例えば、以下の例では、間違った場所に ``^`` マーカを入れても成功してし" "まいます::" -#: ../../library/doctest.rst:563 msgid "" ">>> 1 + None\n" " File \"\", line 1\n" @@ -945,6 +1135,11 @@ msgid "" " ^~~~~~~~\n" "TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" msgstr "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ^~~~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" #: ../../library/doctest.rst:574 msgid "Option Flags" @@ -1039,14 +1234,15 @@ msgstr "" "ように \"しまった、マッチしすぎた! (match too much!)\" と驚くことになりかね" "ません。" -#: ../../library/doctest.rst:629 msgid "" "When specified, doctests expecting exceptions pass so long as an exception " "of the expected type is raised, even if the details (message and fully " "qualified exception name) don't match." msgstr "" +"このフラグを指定すると、例外を期待する doctest は、期待した型の例外が送出され" +"れば成功します。\n" +"詳細 (メッセージと例外の完全修飾名) が一致していなくてもかまいません。" -#: ../../library/doctest.rst:633 msgid "" "For example, an example expecting ``ValueError: 42`` will pass if the actual " "exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:" @@ -1055,8 +1251,14 @@ msgid "" "and versions of Python and the code/libraries in use. Hence, all three of " "these variations will work with the flag specified:" msgstr "" +"例えば、``ValueError: 42`` を期待する実行例は、実際に送出された例外が " +"``ValueError: 3*14`` でも成功しますが、代わりに :exc:`TypeError` などが送出さ" +"れると失敗します。\n" +"例外クラスの前に付いた完全修飾名も無視します。\n" +"この部分は Python の実装やバージョン、使用するコードやライブラリによって異な" +"ることがあります。\n" +"したがって、このフラグを指定すると、次の 3 通りはいずれも成功します。" -#: ../../library/doctest.rst:641 msgid "" ">>> raise Exception('message')\n" "Traceback (most recent call last):\n" @@ -1070,13 +1272,26 @@ msgid "" "Traceback (most recent call last):\n" "__main__.Exception: message" msgstr "" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"builtins.Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"__main__.Exception: message" -#: ../../library/doctest.rst:655 msgid "" "Note that :const:`ELLIPSIS` can also be used to ignore the details of the " "exception message, but such a test may still fail based on whether the " "module name is present or matches exactly." msgstr "" +":const:`ELLIPSIS` を使って例外メッセージの詳細を無視することもできますが、そ" +"の場合はモジュール名の有無や完全一致するかどうかによってテストが失敗する可能" +"性があります。" #: ../../library/doctest.rst:659 msgid "" @@ -1180,11 +1395,12 @@ msgstr "" msgid "A bitmask or'ing together all the reporting flags above." msgstr "上記のエラー報告に関するフラグすべての論理和をとったビットマスクです。" -#: ../../library/doctest.rst:727 msgid "" "There is also a way to register new option flag names, though this isn't " "useful unless you intend to extend :mod:`!doctest` internals via subclassing:" msgstr "" +"新しいオプションフラグ名を登録する方法もありますが、サブクラス化によって :" +"mod:`!doctest` の内部機能を拡張する場合以外には役立ちません。" #: ../../library/doctest.rst:733 msgid "" @@ -1200,9 +1416,8 @@ msgstr "" "トさせる際に使います。 :func:`register_optionflag` は以下のような定形文で呼び" "出さなければなりません::" -#: ../../library/doctest.rst:739 msgid "MY_FLAG = register_optionflag('MY_FLAG')" -msgstr "" +msgstr "MY_FLAG = register_optionflag('MY_FLAG')" #: ../../library/doctest.rst:749 msgid "Directives" @@ -1240,29 +1455,31 @@ msgstr "" msgid "For example, this test passes:" msgstr "例えば、以下のテストは成功します:" -#: ../../library/doctest.rst:771 msgid "" ">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n" "10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n" +"10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" -#: ../../library/doctest.rst:778 msgid "" "Without the directive it would fail, both because the actual output doesn't " "have two blanks before the single-digit list elements, and because the " "actual output is on a single line. This test also passes, and also requires " "a directive to do so:" msgstr "" -"ディレクティブがない場合、実際の出力には一桁の数字の間に二つスペースが入って" -"いないこと、実際の出力は 1 行になることから、テストは成功しないはずです。別の" -"ディレクティブを使って、このテストを成功させることもできます:" +"ディレクティブがない場合、実際の出力では 1 桁のリスト要素の前に空白が 2 つ入" +"らず、出力全体が 1 行になるため、テストは失敗します。\n" +"次のテストも成功しますが、やはりディレクティブが必要です。" -#: ../../library/doctest.rst:783 msgid "" ">>> print(list(range(20))) # doctest: +ELLIPSIS\n" "[0, 1, ..., 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"[0, 1, ..., 18, 19]" #: ../../library/doctest.rst:789 msgid "" @@ -1271,11 +1488,12 @@ msgid "" msgstr "" "複数のディレクティブは、一つの物理行の中にコンマで区切って指定できます:" -#: ../../library/doctest.rst:792 msgid "" ">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n" "[0, 1, ..., 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" #: ../../library/doctest.rst:798 msgid "" @@ -1285,12 +1503,14 @@ msgstr "" "一つの実行例中で複数のディレクティブコメントを使った場合、それらは組み合わさ" "れます:" -#: ../../library/doctest.rst:801 msgid "" ">>> print(list(range(20))) # doctest: +ELLIPSIS\n" "... # doctest: +NORMALIZE_WHITESPACE\n" "[0, 1, ..., 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"... # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" #: ../../library/doctest.rst:808 msgid "" @@ -1302,12 +1522,14 @@ msgstr "" "することができます。この書きかたは、実行例が長すぎるためにディレクティブを同" "じ行に入れると収まりが悪い場合に便利です:" -#: ../../library/doctest.rst:812 msgid "" ">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n" "... # doctest: +ELLIPSIS\n" "[0, ..., 4, 10, ..., 19, 30, ..., 39]" msgstr "" +">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n" +"... # doctest: +ELLIPSIS\n" +"[0, ..., 4, 10, ..., 19, 30, ..., 39]" #: ../../library/doctest.rst:819 msgid "" @@ -1328,7 +1550,6 @@ msgstr "" msgid "Warnings" msgstr "警告" -#: ../../library/doctest.rst:831 msgid "" ":mod:`!doctest` is serious about requiring exact matches in expected " "output. If even a single character doesn't match, the test fails. This " @@ -1337,33 +1558,43 @@ msgid "" "Python doesn't guarantee that the element is printed in any particular " "order, so a test like ::" msgstr "" +":mod:`!doctest` は期待する出力との厳密な一致を求めます。\n" +"1 文字でも一致しなければテストは失敗します。\n" +"Python が出力について何を保証し、何を保証しないのかを知るにつれて、意外に思う" +"こともあるでしょう。\n" +"例えば、集合を表示するときに要素が特定の順序で表示されることは保証されていな" +"いため、次のようなテストは ::" -#: ../../library/doctest.rst:837 msgid "" ">>> foo()\n" "{\"spam\", \"eggs\"}" msgstr "" +">>> foo()\n" +"{\"spam\", \"eggs\"}" #: ../../library/doctest.rst:840 msgid "is vulnerable! One workaround is to do ::" msgstr "は失敗するかもしれないのです! 回避するには ::" -#: ../../library/doctest.rst:842 msgid "" ">>> foo() == {\"spam\", \"eggs\"}\n" "True" msgstr "" +">>> foo() == {\"spam\", \"eggs\"}\n" +"True" #: ../../library/doctest.rst:845 msgid "instead. Another is to do ::" msgstr "とするのが一つのやり方です。別のやり方は ::" -#: ../../library/doctest.rst:847 msgid "" ">>> d = sorted(foo())\n" ">>> d\n" "['eggs', 'spam']" msgstr "" +">>> d = sorted(foo())\n" +">>> d\n" +"['eggs', 'spam']" #: ../../library/doctest.rst:851 msgid "There are others, but you get the idea." @@ -1375,7 +1606,6 @@ msgstr "" "以下のように、オブジェクトアドレスを埋め込むような結果を print するのもよくあ" "りません :" -#: ../../library/doctest.rst:855 msgid "" ">>> id(1.0) # certain to fail some of the time\n" "7948648\n" @@ -1383,6 +1613,11 @@ msgid "" ">>> C() # the default repr() for instances embeds an address\n" "" msgstr "" +">>> id(1.0) # いつか必ず失敗します\n" +"7948648\n" +">>> class C: pass\n" +">>> C() # インスタンスのデフォルトの repr() にはアドレスが含まれます\n" +"" #: ../../library/doctest.rst:863 msgid "" @@ -1390,20 +1625,23 @@ msgid "" msgstr "" ":const:`ELLIPSIS` ディレクティブを使うと、上のような例をうまく解決できます:" -#: ../../library/doctest.rst:865 msgid "" ">>> C() # doctest: +ELLIPSIS\n" "" msgstr "" +">>> C() # doctest: +ELLIPSIS\n" +"" -#: ../../library/doctest.rst:871 msgid "" "Floating-point numbers are also subject to small output variations across " "platforms, because Python defers to the platform C library for some floating-" "point calculations, and C libraries vary widely in quality here. ::" msgstr "" +"浮動小数点数も、プラットフォームによって出力がわずかに変わることがありま" +"す。\n" +"Python は一部の浮動小数点演算をプラットフォームの C ライブラリに任せており、" +"その品質には大きな違いがあるためです。 ::" -#: ../../library/doctest.rst:875 msgid "" ">>> 1000**0.1 # risky\n" "1.9952623149688797\n" @@ -1412,6 +1650,12 @@ msgid "" ">>> print(f'{1000**0.1:.4f}') # much safer\n" "1.9953" msgstr "" +">>> 1000**0.1 # 危険\n" +"1.9952623149688797\n" +">>> round(1000**0.1, 9) # より安全\n" +"1.995262315\n" +">>> print(f'{1000**0.1:.4f}') # さらに安全\n" +"1.9953" #: ../../library/doctest.rst:882 msgid "" @@ -1421,11 +1665,12 @@ msgstr "" "``I/2.**J`` の形式になる数値はどのプラットフォームでもうまく動作するので、私" "はこの形式の数値を生成するように doctest の実行例を工夫しています::" -#: ../../library/doctest.rst:885 msgid "" ">>> 3./4 # utterly safe\n" "0.75" msgstr "" +">>> 3./4 # 完全に安全\n" +"0.75" #: ../../library/doctest.rst:888 msgid "" @@ -1439,17 +1684,16 @@ msgstr "" msgid "Basic API" msgstr "基本 API" -#: ../../library/doctest.rst:897 msgid "" "The functions :func:`testmod` and :func:`testfile` provide a simple " "interface to doctest that should be sufficient for most basic uses. For a " "less formal introduction to these two functions, see sections :ref:`doctest-" "simple-testmod` and :ref:`doctest-simple-testfile`." msgstr "" -"数 :func:`testmod` と :func:`testfile` は、ほとんどの基本的な用途に十分な " -"doctest インターフェースを提供しています。これら二つの関数についてあまり形式" -"的でない入門が読みたければ、 :ref:`doctest-simple-testmod` 節や :ref:" -"`doctest-simple-testfile` 節を参照してください。" +"関数 :func:`testmod` と :func:`testfile` は、基本的な用途の大半に十分な、" +"doctest の簡単なインターフェースを提供します。\n" +"この 2 つの関数の平易な入門については、:ref:`doctest-simple-testmod` 節と :" +"ref:`doctest-simple-testfile` 節を参照してください。" #: ../../library/doctest.rst:905 msgid "" @@ -1635,13 +1879,17 @@ msgstr "" "から到達可能な関数およびクラスの docstring 内にある実行例をテストします。 " "``m.__doc__`` 内の実行例からテストを開始します。" -#: ../../library/doctest.rst:982 msgid "" "Also test examples reachable from dict ``m.__test__``, if it exists. ``m." "__test__`` maps names (strings) to functions, classes and strings; function " "and class docstrings are searched for examples; strings are searched " "directly, as if they were docstrings." msgstr "" +"辞書 ``m.__test__`` が存在する場合、そこから到達可能な実行例もテストしま" +"す。\n" +"``m.__test__`` は名前 (文字列) を関数、クラス、文字列に対応付けます。\n" +"関数やクラスでは docstring から実行例を検索し、文字列は docstring とみなして" +"直接検索します。" #: ../../library/doctest.rst:987 msgid "" @@ -1743,7 +1991,6 @@ msgstr "" msgid "Unittest API" msgstr "単体テスト API" -#: ../../library/doctest.rst:1032 msgid "" "As your collection of doctest'ed modules grows, you'll want a way to run all " "their doctests systematically. :mod:`!doctest` provides two functions that " @@ -1752,8 +1999,13 @@ msgid "" "discovery, include a :ref:`load_tests ` function in " "your test module::" msgstr "" +"doctest を使うモジュールが増えると、すべての doctest を体系的に実行したくなる" +"でしょう。\n" +":mod:`!doctest` は、doctest を含むモジュールやテキストファイルから :mod:" +"`unittest` のテストスイートを作成するための関数を 2 つ提供します。\n" +":mod:`unittest` のテストディスカバリと統合するには、テストモジュールに :ref:" +"`load_tests ` 関数を含めます。 ::" -#: ../../library/doctest.rst:1038 msgid "" "import unittest\n" "import doctest\n" @@ -1763,6 +2015,13 @@ msgid "" " tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n" " return tests" msgstr "" +"import unittest\n" +"import doctest\n" +"import my_module_with_doctests\n" +"\n" +"def load_tests(loader, tests, ignore):\n" +" tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n" +" return tests" #: ../../library/doctest.rst:1046 msgid "" @@ -1780,7 +2039,6 @@ msgstr "" "単一または複数のテキストファイルに入っている doctest 形式のテストを、 :class:" "`unittest.TestSuite` インスタンスに変換します。" -#: ../../library/doctest.rst:1055 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs the interactive examples in each file. Each file is run " @@ -1791,6 +2049,15 @@ msgid "" "the examples in a file are skipped, then the synthesized unit test is also " "marked as skipped." msgstr "" +"返された :class:`unittest.TestSuite` は unittest フレームワークで実行するもの" +"で、各ファイルの対話実行例を実行します。\n" +"各ファイルが個別の単体テストとして実行され、ファイル内の各実行例が :ref:`サブ" +"テスト ` として実行されます。\n" +"ファイル内の実行例が一つでも失敗すると、生成された単体テストも失敗します。\n" +"失敗やエラーのトレースバックには、テストを含むファイルの名前と行番号 (おおよ" +"その行番号になることもあります) が含まれます。\n" +"ファイル内の実行例がすべてスキップされると、生成された単体テストもスキップと" +"して扱われます。" #: ../../library/doctest.rst:1065 msgid "Pass one or more paths (as strings) to text files to be examined." @@ -1908,15 +2175,13 @@ msgstr "" ":func:`DocFileSuite` を使用してテキストファイルからロードされた doctests に提" "供される globals に、グローバル変数 ``__file__`` が追加されます。" -#: ../../library/doctest.rst:1121 ../../library/doctest.rst:1162 msgid "Run each example as a :ref:`subtest `." -msgstr "" +msgstr "各実行例を :ref:`サブテスト ` として実行します。" #: ../../library/doctest.rst:1127 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "doctest のテストを :class:`unittest.TestSuite` に変換します。" -#: ../../library/doctest.rst:1129 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs each doctest in the module. Each docstring is run as a " @@ -1927,6 +2192,15 @@ msgid "" "examples in a docstring are skipped, then the synthesized unit test is also " "marked as skipped." msgstr "" +"返された :class:`unittest.TestSuite` は unittest フレームワークで実行するもの" +"で、モジュール内の各 doctest を実行します。\n" +"各 docstring が個別の単体テストとして実行され、docstring 内の各実行例が :ref:" +"`サブテスト ` として実行されます。\n" +"doctest が一つでも失敗すると、生成された単体テストも失敗します。\n" +"失敗やエラーのトレースバックには、テストを含むファイルの名前と行番号 (おおよ" +"その行番号になることもあります) が含まれます。\n" +"docstring 内の実行例がすべてスキップされると、生成された単体テストもスキップ" +"として扱われます。" #: ../../library/doctest.rst:1139 msgid "" @@ -1939,12 +2213,14 @@ msgstr "" "きます。*module* を指定しない場合、この関数を呼び出しているモジュールになりま" "す。" -#: ../../library/doctest.rst:1143 msgid "" "Optional argument *globs* is a dictionary containing the initial global " "variables for the tests. A new copy of this dictionary is created for each " "test. By default, *globs* is the module's :attr:`~module.__dict__`." msgstr "" +"オプション引数 *globs* は、テスト用のグローバル変数の初期値を含む辞書です。\n" +"各テストに対してこの辞書の新しいコピーが作成されます。\n" +"デフォルトでは、*globs* はモジュールの :attr:`~module.__dict__` です。" #: ../../library/doctest.rst:1147 msgid "" @@ -1963,12 +2239,14 @@ msgstr "" "オプション引数 *test_finder* は、モジュールから doctest を抽出するための :" "class:`DocTestFinder` オブジェクト (またはその代替となるオブジェクト) です。" -#: ../../library/doctest.rst:1153 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above, but they are called for each " "docstring." msgstr "" +"オプション引数 *setUp*、*tearDown*、*optionflags* は上記の :func:" +"`DocFileSuite` と同じですが、準備と後片付けの関数は docstring ごとに呼び出さ" +"れます。" #: ../../library/doctest.rst:1156 msgid "This function uses the same search technique as :func:`testmod`." @@ -1983,7 +2261,6 @@ msgstr "" "`DocTestSuite` は :exc:`ValueError` を送出するのではなく空の :class:" "`unittest.TestSuite` を返します。" -#: ../../library/doctest.rst:1165 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " "out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is " @@ -1991,15 +2268,21 @@ msgid "" "documented here (it's an internal detail), but studying its code can answer " "questions about the exact details of :mod:`unittest` integration." msgstr "" +"内部では、:func:`DocTestSuite` は :class:`!doctest.DocTestCase` インスタンス" +"から :class:`unittest.TestSuite` を作成します。\n" +":class:`!DocTestCase` は :class:`unittest.TestCase` のサブクラスです。\n" +":class:`!DocTestCase` は実装の詳細にあたるため、ここでは説明しませんが、その" +"コードを読むと :mod:`unittest` との統合の詳しい仕組みが分かります。" -#: ../../library/doctest.rst:1171 msgid "" "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " "of :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a " "subclass of :class:`!DocTestCase`." msgstr "" +"同様に、:func:`DocFileSuite` は :class:`!doctest.DocFileCase` インスタンスか" +"ら :class:`unittest.TestSuite` を作成します。\n" +":class:`!DocFileCase` は :class:`!DocTestCase` のサブクラスです。" -#: ../../library/doctest.rst:1175 msgid "" "So both ways of creating a :class:`unittest.TestSuite` run instances of :" "class:`!DocTestCase`. This is important for a subtle reason: when you run :" @@ -2011,16 +2294,27 @@ msgid "" "(perhaps, e.g., specified by command line options), but there's no way to " "pass options through :mod:`!unittest` to :mod:`!doctest` test runners." msgstr "" +"したがって、どちらの方法で :class:`unittest.TestSuite` を作成しても、:class:" +"`!DocTestCase` のインスタンスが実行されます。\n" +"この点が重要なのには、少し分かりにくい理由があります。\n" +"自分で :mod:`!doctest` の関数を実行するときは、:mod:`!doctest` の関数にオプ" +"ションフラグを渡すことで、使う :mod:`!doctest` のオプションを直接制御できま" +"す。\n" +"しかし、:mod:`unittest` のフレームワークを書く場合、テストをいつどのように実" +"行するかは最終的に :mod:`!unittest` が制御します。\n" +"フレームワークの作者は通常、例えばコマンドラインオプションによって :mod:`!" +"doctest` の報告オプションを制御したいと考えますが、:mod:`!unittest` を通し" +"て :mod:`!doctest` のテストランナーにオプションを渡す方法はありません。" -#: ../../library/doctest.rst:1185 msgid "" "For this reason, :mod:`!doctest` also supports a notion of :mod:`!doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" +"このため、:mod:`!doctest` は次の関数によって、:mod:`unittest` との連携専用" +"の :mod:`!doctest` 報告フラグも提供します。" -#: ../../library/doctest.rst:1191 msgid "Set the :mod:`!doctest` reporting flags to use." -msgstr "" +msgstr "使用する :mod:`!doctest` の報告フラグを設定します。" #: ../../library/doctest.rst:1193 msgid "" @@ -2031,7 +2325,6 @@ msgstr "" "す。 :ref:`doctest-options` 節を参照してください。「レポートフラグ」しか使え" "ません。" -#: ../../library/doctest.rst:1196 msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`!runTest` method of :class:`!" @@ -2044,6 +2337,17 @@ msgid "" "were specified when the :class:`!DocTestCase` instance was constructed, :mod:" "`!doctest`'s :mod:`!unittest` reporting flags are ignored." msgstr "" +"これはモジュール全体の設定で、以後 :mod:`unittest` モジュールで実行するすべて" +"の doctest に影響します。\n" +":class:`!DocTestCase` の :meth:`!runTest` メソッドは、:class:`!DocTestCase` " +"インスタンスの作成時にそのテストケースに指定されたオプションフラグを調べま" +"す。\n" +"報告フラグが指定されていない場合 (通常はこの使い方を想定しています)、:mod:`!" +"doctest` の :mod:`!unittest` 用報告フラグをオプションフラグに :ref:`ビット単" +"位論理和で加え `、doctest の実行用に作成した :class:`DocTestRunner` " +"インスタンスに渡します。\n" +":class:`!DocTestCase` インスタンスの作成時に報告フラグが一つでも指定されてい" +"る場合、:mod:`!doctest` の :mod:`!unittest` 用報告フラグは無視されます。" #: ../../library/doctest.rst:1207 msgid "" @@ -2141,7 +2445,6 @@ msgid "" "following diagram::" msgstr "これらの処理クラスの関係を図にまとめると、以下のようになります::" -#: ../../library/doctest.rst:1249 msgid "" " list of:\n" "+------+ +---------+\n" @@ -2152,6 +2455,14 @@ msgid "" " DocTestParser | Example | OutputChecker\n" " +---------+" msgstr "" +" list of:\n" +"+------+ +---------+\n" +"|module| --DocTestFinder-> | DocTest | --DocTestRunner-> results\n" +"+------+ | ^ +---------+ | ^ (printed)\n" +" | | | Example | | |\n" +" v | | ... | v |\n" +" DocTestParser | Example | OutputChecker\n" +" +---------+" #: ../../library/doctest.rst:1262 msgid "DocTest Objects" @@ -2202,12 +2513,14 @@ msgstr "" ":class:`DocTest` を識別する名前の文字列です。通常、この値はテストを取り出した" "オブジェクトかファイルの名前になります。" -#: ../../library/doctest.rst:1297 msgid "" "The name of the file that this :class:`DocTest` was extracted from; or " "``None`` if the filename is unknown, or if the :class:`!DocTest` was not " "extracted from a file." msgstr "" +"この :class:`DocTest` の抽出元のファイル名です。\n" +"ファイル名が不明な場合、または :class:`!DocTest` をファイルから抽出したのでは" +"ない場合は ``None`` です。" #: ../../library/doctest.rst:1304 msgid "" @@ -2250,14 +2563,14 @@ msgstr "" ":class:`Example` では、以下の属性を定義しています。これらの変数はコンストラク" "タで初期化されます。直接変更してはなりません。" -#: ../../library/doctest.rst:1334 msgid "" "A string containing the example's source code. This source code consists of " "a single Python statement, and always ends with a newline; the constructor " "adds a newline when necessary." msgstr "" -"実行例のソースコードが入った文字列です。ソースコードは単一の Python で、末尾" -"は常に改行です。コンストラクタは必要に応じて改行を追加します。" +"実行例のソースコードを含む文字列です。\n" +"ソースコードは単一の Python 文で、末尾は常に改行です。\n" +"コンストラクタは必要に応じて改行を追加します。" #: ../../library/doctest.rst:1341 msgid "" @@ -2302,7 +2615,6 @@ msgstr "" "実行例の入っている文字列のインデント、すなわち実行例の最初のプロンプトより前" "にある空白文字の数です。" -#: ../../library/doctest.rst:1371 msgid "" "A dictionary mapping from option flags to ``True`` or ``False``, which is " "used to override default options for this example. Any option flags not " @@ -2310,6 +2622,11 @@ msgid "" "by the :class:`DocTestRunner`'s :ref:`optionflags `). By " "default, no options are set." msgstr "" +"オプションフラグを ``True`` または ``False`` に対応付ける辞書で、この実行例の" +"デフォルトのオプションを上書きするために使われます。\n" +"この辞書に含まれないオプションフラグは、:class:`DocTestRunner` の :ref:" +"`optionflags ` で指定されたデフォルト値のままになります。\n" +"デフォルトではオプションは設定されていません。" #: ../../library/doctest.rst:1381 msgid "DocTestFinder objects" @@ -2433,7 +2750,6 @@ msgstr "" "みなします。\n" "そのため、内部のすべてのオブジェクトから doctest を再帰的に検索します。" -#: ../../library/doctest.rst:1436 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -2442,6 +2758,13 @@ msgid "" "attr:`~module.__dict__`, if specified, or ``{}`` otherwise. If *extraglobs* " "is not specified, then it defaults to ``{}``." msgstr "" +"各 :class:`DocTest` のグローバル変数は、*globs* と *extraglobs* を組み合わせ" +"て作られます (*extraglobs* の束縛が *globs* の束縛を上書きします)。\n" +"各 :class:`!DocTest` に対して、グローバル変数の辞書の新しい浅いコピーが作成さ" +"れます。\n" +"*globs* を指定しない場合、モジュールが指定されていればその :attr:`~module." +"__dict__` を、そうでなければ ``{}`` を使います。\n" +"*extraglobs* を指定しない場合のデフォルトは ``{}`` です。" #: ../../library/doctest.rst:1447 msgid "DocTestParser objects" @@ -2467,12 +2790,14 @@ msgstr "" "指定した文字列からすべての doctest 実行例を抽出し、 :class:`DocTest` オブジェ" "クト内に集めます。" -#: ../../library/doctest.rst:1464 msgid "" "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" "`!DocTest` object. See the documentation for :class:`DocTest` for more " "information." msgstr "" +"*globs*、*name*、*filename*、*lineno* は、新しい :class:`!DocTest` オブジェク" +"トの属性です。\n" +"詳しくは :class:`DocTest` のドキュメントを参照してください。" #: ../../library/doctest.rst:1471 msgid "" @@ -2486,29 +2811,29 @@ msgstr "" "オプション引数 *name* はこの文字列につける名前で、エラーメッセージにしか使わ" "れません。" -#: ../../library/doctest.rst:1478 msgid "" "Divide the given string into examples and intervening text, and return them " "as a list of alternating :class:`Example`\\ s and strings. Line numbers for " "the :class:`!Example`\\ s are 0-based. The optional argument *name* is a " "name identifying this string, and is only used for error messages." msgstr "" +"指定した文字列を実行例とその間のテキストに分割し、:class:`Example` と文字列が" +"交互に並ぶリストとして返します。\n" +":class:`!Example` の行番号は 0 から数えます。\n" +"オプション引数 *name* はこの文字列を識別する名前で、エラーメッセージにのみ使" +"われます。" -#: ../../library/doctest.rst:1485 msgid "TestResults objects" -msgstr "" +msgstr "TestResults オブジェクト" -#: ../../library/doctest.rst:1492 msgid "Number of failed tests." -msgstr "" +msgstr "失敗したテストの数。" -#: ../../library/doctest.rst:1496 msgid "Number of attempted tests." -msgstr "" +msgstr "実行を試みたテストの数。" -#: ../../library/doctest.rst:1500 msgid "Number of skipped tests." -msgstr "" +msgstr "スキップしたテストの数。" #: ../../library/doctest.rst:1508 msgid "DocTestRunner objects" @@ -2522,7 +2847,6 @@ msgstr "" ":class:`DocTest` 内の対話モード実行例を実行し、検証する際に用いられる処理クラ" "スです。" -#: ../../library/doctest.rst:1516 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -2531,8 +2855,12 @@ msgid "" "customized by passing a subclass of :class:`!OutputChecker` to the " "constructor." msgstr "" +"期待する出力と実際の出力は :class:`OutputChecker` が比較します。\n" +"この比較はさまざまなオプションフラグでカスタマイズできます。\n" +"詳しくは :ref:`doctest-options` 節を参照してください。\n" +"オプションフラグだけでは不十分な場合、コンストラクタに :class:`!" +"OutputChecker` のサブクラスを渡して比較をカスタマイズすることもできます。" -#: ../../library/doctest.rst:1522 msgid "" "The test runner's display output can be controlled in two ways. First, an " "output function can be passed to :meth:`run`; this function will be called " @@ -2542,6 +2870,14 @@ msgid "" "methods :meth:`report_skip`, :meth:`report_start`, :meth:`report_success`, :" "meth:`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" +"テストランナーの表示出力は 2 通りの方法で制御できます。\n" +"まず、:meth:`run` に出力用の関数を渡せます。\n" +"この関数には、表示する文字列が渡されます。\n" +"デフォルトは ``sys.stdout.write`` です。\n" +"出力を取り込むだけでは不十分な場合、``DocTestRunner`` のサブクラスを作り、:" +"meth:`report_skip`、:meth:`report_start`、:meth:`report_success`、:meth:" +"`report_unexpected_exception`、:meth:`report_failure` メソッドをオーバーライ" +"ドして、表示出力をカスタマイズすることもできます。" #: ../../library/doctest.rst:1530 msgid "" @@ -2578,31 +2914,39 @@ msgstr "" "出力と実際の出力を比較する方法や、テストの失敗を表示する方法を制御できます。" "詳しくは :ref:`doctest-options` 節を参照してください。" -#: ../../library/doctest.rst:1544 msgid "" "The test runner accumulates statistics. The aggregated number of attempted, " "failed and skipped examples is also available via the :attr:`tries`, :attr:" "`failures` and :attr:`skips` attributes. The :meth:`run` and :meth:" "`summarize` methods return a :class:`TestResults` instance." msgstr "" +"テストランナーは統計情報を蓄積します。\n" +"実行を試みた実行例、失敗した実行例、スキップした実行例の累計は、それぞれ :" +"attr:`tries`、:attr:`failures`、:attr:`skips` 属性でも参照できます。\n" +":meth:`run` と :meth:`summarize` メソッドは :class:`TestResults` インスタンス" +"を返します。" -#: ../../library/doctest.rst:1549 msgid ":class:`DocTestRunner` defines the following methods:" -msgstr "" +msgstr ":class:`DocTestRunner` は以下のメソッドを定義しています。" -#: ../../library/doctest.rst:1554 msgid "" "Report that the given example was skipped. This method is provided to allow " "subclasses of :class:`DocTestRunner` to customize their output; it should " "not be called directly." msgstr "" +"指定した実行例がスキップされたことを報告します。\n" +"このメソッドは :class:`DocTestRunner` のサブクラスで出力をカスタマイズするた" +"めに提供されています。\n" +"直接呼び出さないでください。" -#: ../../library/doctest.rst:1558 ../../library/doctest.rst:1571 msgid "" "*example* is the example about to be processed. *test* is the test " "containing *example*. *out* is the output function that was passed to :meth:" "`DocTestRunner.run`." msgstr "" +"*example* は処理しようとしている実行例です。\n" +"*test* は *example* を含むテストです。\n" +"*out* は :meth:`DocTestRunner.run` に渡された出力用の関数です。" #: ../../library/doctest.rst:1567 msgid "" @@ -2666,12 +3010,14 @@ msgstr "" "*example* の入っているテストです。 *out* は出力用の関数で、 :meth:" "`DocTestRunner.run` に渡されます。" -#: ../../library/doctest.rst:1612 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " "results using the writer function *out*. Return a :class:`TestResults` " "instance." msgstr "" +"*test* (:class:`DocTest` オブジェクト) 内の実行例を実行し、書き込み用の関数 " +"*out* で結果を表示します。\n" +":class:`TestResults` インスタンスを返します。" #: ../../library/doctest.rst:1616 msgid "" @@ -2695,18 +3041,20 @@ msgstr "" "セットを指定します。*compileflags* を指定しない場合、デフォルト値は *globs* " "で適用されている future-import フラグセットになります。" -#: ../../library/doctest.rst:1625 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " "output checker, and the results are formatted by the :meth:`!DocTestRunner." "report_\\*` methods." msgstr "" +"各実行例の出力は :class:`DocTestRunner` の出力チェッカーで検証され、結果は :" +"meth:`!DocTestRunner.report_\\*` メソッドで書式化されます。" -#: ../../library/doctest.rst:1632 msgid "" "Print a summary of all the test cases that have been run by this " "DocTestRunner, and return a :class:`TestResults` instance." msgstr "" +"この ``DocTestRunner`` が実行したすべてのテストケースの結果をまとめて表示" +"し、:class:`TestResults` インスタンスを返します。" #: ../../library/doctest.rst:1635 msgid "" @@ -2722,17 +3070,14 @@ msgstr "" msgid ":class:`DocTestParser` has the following attributes:" msgstr "" -#: ../../library/doctest.rst:1643 msgid "Number of attempted examples." -msgstr "" +msgstr "実行を試みた実行例の数。" -#: ../../library/doctest.rst:1647 msgid "Number of failed examples." -msgstr "" +msgstr "失敗した実行例の数。" -#: ../../library/doctest.rst:1651 msgid "Number of skipped examples." -msgstr "" +msgstr "スキップした実行例の数。" #: ../../library/doctest.rst:1659 msgid "OutputChecker objects" @@ -2830,7 +3175,6 @@ msgstr "" "の現在の値などを調べられます。たとえば、以下のようなモジュールレベルの " "docstring の入ったファイル :file:`a.py` があるとします::" -#: ../../library/doctest.rst:1712 msgid "" "\"\"\"\n" ">>> def f(x):\n" @@ -2842,12 +3186,20 @@ msgid "" "9\n" "\"\"\"" msgstr "" +"\"\"\"\n" +">>> def f(x):\n" +"... g(x*2)\n" +">>> def g(x):\n" +"... print(x+3)\n" +"... import pdb; pdb.set_trace()\n" +">>> f(3)\n" +"9\n" +"\"\"\"" #: ../../library/doctest.rst:1722 msgid "Then an interactive Python session may look like this::" msgstr "対話セッションは以下のようになるでしょう::" -#: ../../library/doctest.rst:1724 msgid "" ">>> import a, doctest\n" ">>> doctest.testmod(a)\n" @@ -2879,6 +3231,35 @@ msgid "" "(0, 3)\n" ">>>" msgstr "" +">>> import a, doctest\n" +">>> doctest.testmod(a)\n" +"--Return--\n" +"> (3)g()->None\n" +"-> import pdb; pdb.set_trace()\n" +"(Pdb) list\n" +" 1 def g(x):\n" +" 2 print(x+3)\n" +" 3 -> import pdb; pdb.set_trace()\n" +"[EOF]\n" +"(Pdb) p x\n" +"6\n" +"(Pdb) step\n" +"--Return--\n" +"> (2)f()->None\n" +"-> g(x*2)\n" +"(Pdb) list\n" +" 1 def f(x):\n" +" 2 -> g(x*2)\n" +"[EOF]\n" +"(Pdb) p x\n" +"3\n" +"(Pdb) step\n" +"--Return--\n" +"> (1)?()->None\n" +"-> f(3)\n" +"(Pdb) cont\n" +"(0, 3)\n" +">>>" #: ../../library/doctest.rst:1755 msgid "" @@ -2904,7 +3285,6 @@ msgstr "" "Python のコメント文になります。生成したスクリプトを文字列で返します。例え" "ば、 ::" -#: ../../library/doctest.rst:1768 msgid "" "import doctest\n" "print(doctest.script_from_examples(r\"\"\"\n" @@ -2916,12 +3296,20 @@ msgid "" " 3\n" "\"\"\"))" msgstr "" +"import doctest\n" +"print(doctest.script_from_examples(r\"\"\"\n" +" Set x and y to 1 and 2.\n" +" >>> x, y = 1, 2\n" +"\n" +" Print their sum:\n" +" >>> print(x+y)\n" +" 3\n" +"\"\"\"))" #: ../../library/doctest.rst:1778 msgid "displays::" msgstr "は::" -#: ../../library/doctest.rst:1780 msgid "" "# Set x and y to 1 and 2.\n" "x, y = 1, 2\n" @@ -2931,6 +3319,13 @@ msgid "" "# Expected:\n" "## 3" msgstr "" +"# Set x and y to 1 and 2.\n" +"x, y = 1, 2\n" +"#\n" +"# Print their sum:\n" +"print(x+y)\n" +"# Expected:\n" +"## 3" #: ../../library/doctest.rst:1788 msgid "" @@ -2945,7 +3340,6 @@ msgstr "" msgid "Convert the doctest for an object to a script." msgstr "あるオブジェクトの doctest をスクリプトに変換します。" -#: ../../library/doctest.rst:1797 msgid "" "Argument *module* is a module object, or dotted name of a module, containing " "the object whose doctests are of interest. Argument *name* is the name " @@ -2954,18 +3348,28 @@ msgid "" "as described for :func:`script_from_examples` above. For example, if " "module :file:`a.py` contains a top-level function :func:`!f`, then ::" msgstr "" +"引数 *module* は、対象の doctest を持つオブジェクトを含むモジュールのオブジェ" +"クト、またはドット区切りのモジュール名です。\n" +"引数 *name* は、対象の doctest を持つオブジェクトのモジュール内での名前で" +"す。\n" +"戻り値は、上記の :func:`script_from_examples` と同じ方法で、オブジェクトの " +"docstring を Python スクリプトに変換した文字列です。\n" +"例えば、モジュール :file:`a.py` のトップレベルに関数 :func:`!f` がある場合、" +"次のコードは ::" -#: ../../library/doctest.rst:1804 msgid "" "import a, doctest\n" "print(doctest.testsource(a, \"a.f\"))" msgstr "" +"import a, doctest\n" +"print(doctest.testsource(a, \"a.f\"))" -#: ../../library/doctest.rst:1807 msgid "" "prints a script version of function :func:`!f`'s docstring, with doctests " "converted to code, and the rest placed in comments." msgstr "" +"関数 :func:`!f` の docstring をスクリプトに変換して表示します。\n" +"doctest はコードに変換され、残りはコメントになります。" #: ../../library/doctest.rst:1813 msgid "Debug the doctests for an object." @@ -3134,11 +3538,12 @@ msgstr "" msgid "Soapbox" msgstr "アドバイス" -#: ../../library/doctest.rst:1921 msgid "" "As mentioned in the introduction, :mod:`!doctest` has grown to have three " "primary uses:" msgstr "" +"導入で述べたように、:mod:`!doctest` は主に次の 3 つの用途で使われるようになり" +"ました。" #: ../../library/doctest.rst:1924 msgid "Checking examples in docstrings." @@ -3162,7 +3567,6 @@ msgstr "" "に、docstring を曖昧なテストケースに埋もれさせてしまうとドキュメントとしては" "最悪です。" -#: ../../library/doctest.rst:1934 msgid "" "When writing a docstring, choose docstring examples with care. There's an " "art to this that needs to be learned---it may not be natural at first. " @@ -3173,8 +3577,15 @@ msgid "" "at how often one of my :mod:`!doctest` examples stops working after a " "\"harmless\" change." msgstr "" +"docstring を書くときは、そこに載せる実行例を慎重に選んでください。\n" +"これには身につけるべきこつがあり、最初は自然にはできないかもしれません。\n" +"実行例はドキュメントに確かな価値を加えるものであるべきです。\n" +"よい実行例は、多くの言葉による説明に匹敵することがあります。\n" +"注意深く作れば、実行例はユーザーにとって非常に役立ち、年月が過ぎて物事が変" +"わっても、集めるのにかけた時間に何倍もの価値を返してくれるでしょう。\n" +"「無害な」はずの変更の後で自分の :mod:`!doctest` の実行例が動かなくなること" +"が、今でも驚くほどよくあります。" -#: ../../library/doctest.rst:1942 msgid "" "Doctest also makes an excellent tool for regression testing, especially if " "you don't skimp on explanatory text. By interleaving prose and examples, it " @@ -3194,21 +3605,27 @@ msgid "" "functionality seemingly at random. It's a different attitude, and produces " "different results, blurring the distinction between testing and explaining." msgstr "" -"説明テキストの作成をけちらなければ、 ``doctest`` は回帰テストの優れたツールに" -"もなり得ます。説明文と実行例を交互に記述していけば、実際に何をどうしてテスト" -"しているのかもっと簡単に把握できるようになるでしょう。もちろん、コードベース" -"のテストに詳しくコメントを入れるのも手ですが、そんなことをするプログラマはほ" -"とんどいません。多くの人々が、 ``doctest`` のアプローチをとった方がきれいにテ" -"ストを書けると気づいています。おそらく、これは単にコード中にコメントを書くの" -"が少し面倒だからという理由でしょう。私はもう少し穿った見方もしています。" -"doctest ベースのテストを書くときの自然な態度は、自分のソフトウェアのよい点を" -"説明しようとして、実行例を使って説明しようとするときの態度そのものだからだ、" -"という理由です。それゆえに、テストファイルは自然と単純な機能の解説から始め、" -"論理的により複雑で境界条件的なケースに進むような形になります。結果的に、一見" -"ランダムに見えるような個別の機能をテストしている個別の関数の集まりではなく、" -"首尾一貫した説明ができるようになるのです。 ``doctest`` によるテストの作成は" -"まったく別の取り組み方であり、テストと説明の区別をなくして、まったく違う結果" -"を生み出すのです。" +"Doctest は回帰テストの優れたツールにもなります。\n" +"説明文を惜しまず書けば、特に役立ちます。\n" +"説明文と実行例を交互に記述すると、実際に何を、なぜテストしているのかを把握し" +"やすくなります。\n" +"テストが失敗したときにも、よい説明文があれば問題と修正方法が分かりやすくなり" +"ます。\n" +"確かに、コードで書くテストにも詳しいコメントを付けられますが、そうするプログ" +"ラマーは少数です。\n" +"代わりに doctest を使うと、はるかに分かりやすいテストになると感じる人は多くい" +"ます。\n" +"単に、doctest ではコードよりも説明文が少し書きやすく、コード中ではコメントが" +"少し書きにくいからかもしれません。\n" +"私はそれよりも深い理由があると考えています。\n" +"doctest ベースのテストを書くときは、ソフトウェアの細かな点を説明し、実行例で" +"示そうという姿勢に自然となります。\n" +"すると、最も単純な機能から始まり、複雑な場合や境界条件へと論理的に進むテスト" +"ファイルになります。\n" +"結果として、個々の機能の断片をばらばらにテストする関数の集まりではなく、筋の" +"通った説明ができます。\n" +"取り組む姿勢が違うため、テストと説明の区別が薄れるという違った結果を生むので" +"す。" #: ../../library/doctest.rst:1960 msgid "" @@ -3242,11 +3659,12 @@ msgstr "" "ジュールと同じファイルの中にも置けますし、別のテストファイルに分けてもかまい" "ません。" -#: ../../library/doctest.rst:1972 msgid "" "Define a :attr:`~module.__test__` dictionary mapping from regression test " "topics to docstrings containing test cases." msgstr "" +"回帰テストのトピックを、テストケースを含む docstring に対応付ける :attr:" +"`~module.__test__` 辞書を定義します。" msgid "" "When you have placed your tests in a module, the module can itself be the " @@ -3260,7 +3678,6 @@ msgstr "" "るようにテストランナーを設定できます。\n" "次に、そのようなテストランナーの最小限の例を示します。 ::" -#: ../../library/doctest.rst:1980 msgid "" "if __name__ == '__main__':\n" " import doctest\n" @@ -3277,6 +3694,20 @@ msgid "" " fail, total = doctest.testmod(optionflags=flags)\n" " print(f\"{fail} failures out of {total} tests\")" msgstr "" +"if __name__ == '__main__':\n" +" import doctest\n" +" flags = doctest.REPORT_NDIFF|doctest.FAIL_FAST\n" +" if len(sys.argv) > 1:\n" +" name = sys.argv[1]\n" +" if name in globals():\n" +" obj = globals()[name]\n" +" else:\n" +" obj = __test__[name]\n" +" doctest.run_docstring_examples(obj, globals(), name=name,\n" +" optionflags=flags)\n" +" else:\n" +" fail, total = doctest.testmod(optionflags=flags)\n" +" print(f\"{fail} failures out of {total} tests\")" #: ../../library/doctest.rst:1997 msgid "Footnotes" @@ -3296,9 +3727,8 @@ msgstr "" msgid ">>>" msgstr ">>>" -#: ../../library/doctest.rst:382 msgid "interpreter prompt" -msgstr "" +msgstr "インタープリタのプロンプト" #: ../../library/doctest.rst:382 ../../library/doctest.rst:617 msgid "..." @@ -3308,17 +3738,14 @@ msgstr "..." msgid "^ (caret)" msgstr "^ (キャレット)" -#: ../../library/doctest.rst:548 msgid "marker" -msgstr "" +msgstr "マーカー" -#: ../../library/doctest.rst:597 msgid "" -msgstr "" +msgstr "" -#: ../../library/doctest.rst:617 ../../library/doctest.rst:742 msgid "in doctests" -msgstr "" +msgstr "doctest 内" #: ../../library/doctest.rst:742 msgid "# (hash)" diff --git a/library/email.charset.po b/library/email.charset.po index 4310ad077..8590a7985 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -58,9 +58,9 @@ msgstr "" ":class:`Charset` インスタンスは :mod:`email` パッケージ中にある他のいくつかの" "モジュールで使用されます。" -#: ../../library/email.charset.rst:22 msgid "Import this class from the :mod:`!email.charset` module." msgstr "" +"このクラスは :mod:`!email.charset` モジュールからインポートしてください。" #: ../../library/email.charset.rst:27 msgid "Map character sets to their email properties." @@ -298,11 +298,12 @@ msgstr "" "このメソッドは、2つの :class:`Charset` インスタンスが異なるかどうかをチェック" "するのに使います。" -#: ../../library/email.charset.rst:167 msgid "" "The :mod:`!email.charset` module also provides the following functions for " "adding new entries to the global character set, alias, and codec registries:" msgstr "" +":mod:`!email.charset` モジュールは、文字集合、別名、コーデックのグローバルレ" +"ジストリに新しい項目を追加するための以下の関数も提供します。" #: ../../library/email.charset.rst:173 msgid "Add character properties to the global registry." diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index b9982a72d..42ae59d7a 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -30,7 +30,6 @@ msgstr "" ":mod:`email.message.Message`: :data:`~email.policy.compat32` API を使用した電" "子メールメッセージの表現" -#: ../../library/email.compat32-message.rst:13 msgid "" "The :class:`Message` class is very similar to the :class:`~email.message." "EmailMessage` class, without the methods added by that class, and with the " @@ -39,20 +38,26 @@ msgid "" "message.EmailMessage` class, are not recommended unless you are dealing with " "legacy code." msgstr "" +":class:`Message` クラスは :class:`~email.message.EmailMessage` クラスによく似" +"ていますが、後者で追加されたメソッドはなく、一部の他のメソッドでもデフォルト" +"の動作が少し異なります。\n" +"ここでは、:class:`~email.message.EmailMessage` クラスでもサポートされているも" +"のの、従来のコードを扱う場合以外には推奨されないメソッドも説明します。" -#: ../../library/email.compat32-message.rst:20 msgid "The philosophy and structure of the two classes is otherwise the same." -msgstr "" +msgstr "それ以外の点では、両クラスの設計思想と構造は同じです。" -#: ../../library/email.compat32-message.rst:22 msgid "" "This document describes the behavior under the default (for :class:" "`Message`) policy :attr:`~email.policy.Compat32`. If you are going to use " "another policy, you should be using the :class:`~email.message.EmailMessage` " "class instead." msgstr "" +"このドキュメントは、:class:`Message` のデフォルトのポリシーである :attr:" +"`~email.policy.Compat32` での動作を説明します。\n" +"別のポリシーを使う場合は、代わりに :class:`~email.message.EmailMessage` クラ" +"スを使ってください。" -#: ../../library/email.compat32-message.rst:26 msgid "" "An email message consists of *headers* and a *payload*. Headers must be :" "rfc:`5322` style names and values, where the field name and value are " @@ -63,8 +68,16 @@ msgid "" "message having a MIME type such as :mimetype:`multipart/\\*` or :mimetype:" "`message/rfc822`." msgstr "" +"電子メールメッセージは *ヘッダー* と *ペイロード* からなります。\n" +"ヘッダーの名前と値は :rfc:`5322` の形式に従い、フィールド名と値をコロンで区切" +"る必要があります。\n" +"コロンはフィールド名にも値にも含まれません。\n" +"ペイロードには、単純なテキストメッセージ、バイナリオブジェクト、または各々が" +"独自のヘッダーとペイロードを持つサブメッセージを構造化して並べたものを使えま" +"す。\n" +"最後の形式のペイロードは、メッセージの MIME 型が :mimetype:`multipart/\\*` " +"や :mimetype:`message/rfc822` などの場合に使われます。" -#: ../../library/email.compat32-message.rst:35 msgid "" "The conceptual model provided by a :class:`Message` object is that of an " "ordered dictionary of headers with additional methods for accessing both " @@ -73,8 +86,12 @@ msgid "" "over the object tree. Note that duplicate headers are supported but special " "methods must be used to access them." msgstr "" +":class:`Message` オブジェクトは概念的にはヘッダーの順序付き辞書であり、ヘッ" +"ダーの特定の情報やペイロードへのアクセス、メッセージの直列化、オブジェクトツ" +"リーの再帰的な巡回のためのメソッドが追加されています。\n" +"同名のヘッダーを複数持てますが、それらへのアクセスには専用のメソッドが必要で" +"す。" -#: ../../library/email.compat32-message.rst:42 msgid "" "The :class:`Message` pseudo-dictionary is indexed by the header names, which " "must be ASCII values. The values of the dictionary are strings that are " @@ -87,12 +104,23 @@ msgid "" "list of :class:`Message` objects, for MIME container documents (e.g. :" "mimetype:`multipart/\\*` and :mimetype:`message/rfc822`)." msgstr "" +":class:`Message` は辞書に似たインターフェースを持ち、ASCII 値でなければならな" +"いヘッダー名をキーとします。\n" +"辞書の値は文字列で、ASCII 文字だけを含むことを想定しています。\n" +"非 ASCII 入力には特別な処理がありますが、常に正しい結果になるとは限りませ" +"ん。\n" +"ヘッダーの格納時と取得時には大文字・小文字が保持されますが、フィールド名の照" +"合では区別されません。\n" +"*Unix-From* ヘッダーまたは ``From_`` ヘッダーとも呼ばれるエンベロープヘッダー" +"を一つ持つこともできます。\n" +"*ペイロード* は、単純なメッセージオブジェクトでは文字列またはバイト列であり、" +"MIME コンテナ文書 (:mimetype:`multipart/\\*` や :mimetype:`message/rfc822` な" +"ど) では :class:`Message` オブジェクトのリストです。" #: ../../library/email.compat32-message.rst:53 msgid "Here are the methods of the :class:`Message` class:" msgstr ":class:`Message` クラスのメソッドは以下のとおりです:" -#: ../../library/email.compat32-message.rst:58 msgid "" "If *policy* is specified (it must be an instance of a :mod:`~email.policy` " "class) use the rules it specifies to update and serialize the representation " @@ -101,12 +129,16 @@ msgid "" "Python 3.2 version of the email package. For more information see the :mod:" "`~email.policy` documentation." msgstr "" +"*policy* を指定した場合 (:mod:`~email.policy` のクラスのインスタンスでなけれ" +"ばなりません)、その規則に従ってメッセージの表現を更新し、直列化します。\n" +"*policy* を指定しない場合、Python 3.2 版の email パッケージとの後方互換性を維" +"持する :class:`compat32 ` ポリシーを使います。\n" +"詳しくは :mod:`~email.policy` のドキュメントを参照してください。" #: ../../library/email.compat32-message.rst:65 msgid "The *policy* keyword argument was added." msgstr "キーワード引数 *policy* が追加されました。" -#: ../../library/email.compat32-message.rst:70 msgid "" "Return the entire message flattened as a string. When optional *unixfrom* " "is true, the envelope header is included in the returned string. *unixfrom* " @@ -118,6 +150,17 @@ msgid "" "control some of the formatting produced by the method, since the specified " "*policy* will be passed to the ``Generator``." msgstr "" +"メッセージ全体をフラット化した文字列を返します。\n" +"オプションの *unixfrom* が真の場合、戻り値にはエンベロープヘッダーが含まれま" +"す。\n" +"*unixfrom* のデフォルトは ``False`` です。\n" +"後方互換性のため *maxheaderlen* のデフォルトは ``0`` なので、別の値を使うには" +"明示的に指定する必要があります (このメソッドはポリシーの *max_line_length* を" +"無視します)。\n" +"*policy* 引数で、メッセージインスタンスから取得するデフォルトのポリシーを上書" +"きできます。\n" +"指定した *policy* は ``Generator`` に渡されるため、メソッドが生成する書式の一" +"部を制御できます。" #: ../../library/email.compat32-message.rst:80 #: ../../library/email.compat32-message.rst:122 @@ -130,7 +173,6 @@ msgstr "" "メッセージのフラット化は :class:`Message` の変更を引き起こす可能性があります " "(例えば、MIME の境界が生成される、変更される等)。" -#: ../../library/email.compat32-message.rst:84 msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " @@ -139,8 +181,15 @@ msgid "" "Generator` instance and use its :meth:`~email.generator.Generator.flatten` " "method directly. For example::" msgstr "" +"このメソッドは便利な補助機能として提供されており、常に希望どおりの書式になる" +"とは限りません。\n" +"例えば、デフォルトでは Unix mbox 形式に必要な、``From`` で始まる行の書き換え" +"を行いません。\n" +"より柔軟に制御するには、:class:`~email.generator.Generator` のインスタンスを" +"作成し、その :meth:`~email.generator.Generator.flatten` メソッドを直接使って" +"ください。\n" +"例えば次のようにします。 ::" -#: ../../library/email.compat32-message.rst:91 msgid "" "from io import StringIO\n" "from email.generator import Generator\n" @@ -149,26 +198,36 @@ msgid "" "g.flatten(msg)\n" "text = fp.getvalue()" msgstr "" +"from io import StringIO\n" +"from email.generator import Generator\n" +"fp = StringIO()\n" +"g = Generator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" -#: ../../library/email.compat32-message.rst:98 msgid "" "If the message object contains binary data that is not encoded according to " "RFC standards, the non-compliant data will be replaced by Unicode \"unknown " "character\" code points. (See also :meth:`.as_bytes` and :class:`~email." "generator.BytesGenerator`.)" msgstr "" +"メッセージオブジェクトに RFC の規定どおりにエンコードされていないバイナリデー" +"タが含まれる場合、そのデータは Unicode の「不明な文字」を示すコードポイントに" +"置き換えられます。\n" +"(:meth:`.as_bytes` と :class:`~email.generator.BytesGenerator` も参照してくだ" +"さい。)" #: ../../library/email.compat32-message.rst:103 msgid "the *policy* keyword argument was added." msgstr "*policy* キーワード引数が追加されました。" -#: ../../library/email.compat32-message.rst:108 msgid "" "Equivalent to :meth:`.as_string`. Allows ``str(msg)`` to produce a string " "containing the formatted message." msgstr "" +":meth:`.as_string` と同じです。\n" +"``str(msg)`` で、書式化されたメッセージを含む文字列を生成できるようにします。" -#: ../../library/email.compat32-message.rst:114 msgid "" "Return the entire message flattened as a bytes object. When optional " "*unixfrom* is true, the envelope header is included in the returned string. " @@ -177,8 +236,15 @@ msgid "" "used to control some of the formatting produced by the method, since the " "specified *policy* will be passed to the ``BytesGenerator``." msgstr "" +"メッセージ全体をフラット化した bytes オブジェクトを返します。\n" +"オプションの *unixfrom* が真の場合、戻り値にはエンベロープヘッダーが含まれま" +"す。\n" +"*unixfrom* のデフォルトは ``False`` です。\n" +"*policy* 引数で、メッセージインスタンスから取得するデフォルトのポリシーを上書" +"きできます。\n" +"指定した *policy* は ``BytesGenerator`` に渡されるため、メソッドが生成する書" +"式の一部を制御できます。" -#: ../../library/email.compat32-message.rst:126 msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " @@ -187,8 +253,15 @@ msgid "" "BytesGenerator` instance and use its :meth:`~email.generator.BytesGenerator." "flatten` method directly. For example::" msgstr "" +"このメソッドは便利な補助機能として提供されており、常に希望どおりの書式になる" +"とは限りません。\n" +"例えば、デフォルトでは Unix mbox 形式に必要な、``From`` で始まる行の書き換え" +"を行いません。\n" +"より柔軟に制御するには、:class:`~email.generator.BytesGenerator` のインスタン" +"スを作成し、その :meth:`~email.generator.BytesGenerator.flatten` メソッドを直" +"接使ってください。\n" +"例えば次のようにします。 ::" -#: ../../library/email.compat32-message.rst:134 msgid "" "from io import BytesIO\n" "from email.generator import BytesGenerator\n" @@ -197,14 +270,21 @@ msgid "" "g.flatten(msg)\n" "text = fp.getvalue()" msgstr "" +"from io import BytesIO\n" +"from email.generator import BytesGenerator\n" +"fp = BytesIO()\n" +"g = BytesGenerator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" -#: ../../library/email.compat32-message.rst:146 msgid "" "Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " "object containing the formatted message." msgstr "" +":meth:`.as_bytes` と同じです。\n" +"``bytes(msg)`` で、書式化されたメッセージを含む bytes オブジェクトを生成でき" +"るようにします。" -#: ../../library/email.compat32-message.rst:154 msgid "" "Return ``True`` if the message's payload is a list of sub-\\ :class:" "`Message` objects, otherwise return ``False``. When :meth:`is_multipart` " @@ -214,6 +294,14 @@ msgid "" "'multipart'\" will return the ``True``. For example, ``is_multipart`` will " "return ``True`` when the :class:`Message` is of type ``message/rfc822``.)" msgstr "" +"メッセージのペイロードがサブメッセージの :class:`Message` オブジェクトのリス" +"トなら ``True`` を、それ以外なら ``False`` を返します。\n" +":meth:`is_multipart` が ``False`` を返す場合、ペイロードは文字列オブジェクト" +"のはずです (CTE でエンコードされたバイナリのペイロードの場合もあります)。\n" +":meth:`is_multipart` が ``True`` を返しても、``msg.get_content_maintype() == " +"'multipart'`` が ``True`` を返すとは限りません。\n" +"例えば、:class:`Message` の型が ``message/rfc822`` の場合も " +"``is_multipart()`` は ``True`` を返します。" #: ../../library/email.compat32-message.rst:166 msgid "" @@ -244,12 +332,15 @@ msgstr "" "のリストになります。ペイロードにスカラーオブジェクト (文字列など) を格納した" "い場合は、かわりに :meth:`set_payload` を使ってください。" -#: ../../library/email.compat32-message.rst:183 msgid "" "This is a legacy method. On the :class:`~email.message.EmailMessage` class " "its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content` and the related ``make`` and ``add`` methods." msgstr "" +"これは従来の API のメソッドです。\n" +":class:`~email.message.EmailMessage` クラスでは、:meth:`~email.message." +"EmailMessage.set_content` と関連する ``make`` および ``add`` メソッドがこの機" +"能を置き換えています。" #: ../../library/email.compat32-message.rst:191 msgid "" @@ -279,7 +370,6 @@ msgstr "" "が ``False``) にもかかわらず *i* が与えられたときは :exc:`TypeError` が発生し" "ます。" -#: ../../library/email.compat32-message.rst:203 msgid "" "Optional *decode* is a flag indicating whether the payload should be decoded " "or not, according to the :mailheader:`Content-Transfer-Encoding` header. " @@ -294,8 +384,20 @@ msgid "" "message's defect property (:class:`~email.errors.InvalidBase64PaddingDefect` " "or :class:`~email.errors.InvalidBase64CharactersDefect`, respectively)." msgstr "" +"オプションの *decode* は、:mailheader:`Content-Transfer-Encoding` ヘッダーに" +"従ってペイロードをデコードするかどうかを指定するフラグです。\n" +"``True`` で、メッセージがマルチパートでない場合、このヘッダーの値が ``quoted-" +"printable`` または ``base64`` ならペイロードをデコードします。\n" +"別のエンコーディングを使っている場合や :mailheader:`Content-Transfer-" +"Encoding` ヘッダーがない場合は、ペイロードをデコードせずそのまま返します。\n" +"いずれの場合も戻り値はバイナリデータです。\n" +"メッセージがマルチパートで *decode* が ``True`` の場合は ``None`` を返しま" +"す。\n" +"base64 のペイロードにパディングの欠落や base64 の文字集合にない文字がある場合" +"は、それぞれ :class:`~email.errors.InvalidBase64PaddingDefect` または :class:" +"`~email.errors.InvalidBase64CharactersDefect` がメッセージの欠陥を記録するプ" +"ロパティに追加されます。" -#: ../../library/email.compat32-message.rst:217 msgid "" "When *decode* is ``False`` (the default) the body is returned as a string " "without decoding the :mailheader:`Content-Transfer-Encoding`. However, for " @@ -305,13 +407,23 @@ msgid "" "``charset`` is specified, or if the ``charset`` given is not recognized by " "the email package, the body is decoded using the default ASCII charset." msgstr "" +"*decode* が ``False`` (デフォルト) の場合、:mailheader:`Content-Transfer-" +"Encoding` をデコードせず、本体を文字列として返します。\n" +"ただし、:mailheader:`Content-Transfer-Encoding` が 8bit の場合は、:" +"mailheader:`Content-Type` ヘッダーで指定された ``charset`` と ``replace`` エ" +"ラーハンドラーを使って、元のバイト列のデコードを試みます。\n" +"``charset`` が指定されていない場合、または email パッケージが認識できない場合" +"は、デフォルトの ASCII 文字セットで本体をデコードします。" -#: ../../library/email.compat32-message.rst:226 msgid "" "This is a legacy method. On the :class:`~email.message.EmailMessage` class " "its functionality is replaced by :meth:`~email.message.EmailMessage." "get_content` and :meth:`~email.message.EmailMessage.iter_parts`." msgstr "" +"これは従来の API のメソッドです。\n" +":class:`~email.message.EmailMessage` クラスでは、:meth:`~email.message." +"EmailMessage.get_content` と :meth:`~email.message.EmailMessage.iter_parts` " +"がこの機能を置き換えています。" msgid "" "Set the entire message object's payload to *payload*. It is the client's " @@ -323,12 +435,14 @@ msgstr "" "省略可能な *charset* はメッセージのデフォルトの文字セットを設定します。\n" "詳しくは :meth:`set_charset` を参照してください。" -#: ../../library/email.compat32-message.rst:238 msgid "" "This is a legacy method. On the :class:`~email.message.EmailMessage` class " "its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content`." msgstr "" +"これは従来の API のメソッドです。\n" +":class:`~email.message.EmailMessage` クラスでは、:meth:`~email.message." +"EmailMessage.set_content` がこの機能を置き換えています。" #: ../../library/email.compat32-message.rst:245 msgid "" @@ -376,12 +490,15 @@ msgstr "" "ば、ペイロードはすでにその :mailheader:`Content-Transfer-Encoding` によって正" "しくエンコードされたものと見なされ、変形されません。" -#: ../../library/email.compat32-message.rst:267 msgid "" "This is a legacy method. On the :class:`~email.message.EmailMessage` class " "its functionality is replaced by the *charset* parameter of the :meth:`email." "message.EmailMessage.set_content` method." msgstr "" +"これは従来の API のメソッドです。\n" +":class:`~email.message.EmailMessage` クラスでは、:meth:`email.message." +"EmailMessage.set_content` メソッドの *charset* 引数がこの機能を置き換えていま" +"す。" #: ../../library/email.compat32-message.rst:275 msgid "" @@ -391,11 +508,12 @@ msgstr "" "そのメッセージ中のペイロードの :class:`~email.charset.Charset` インスタンスを" "返します。" -#: ../../library/email.compat32-message.rst:278 msgid "" "This is a legacy method. On the :class:`~email.message.EmailMessage` class " "it always returns ``None``." msgstr "" +"これは従来の API のメソッドです。\n" +":class:`~email.message.EmailMessage` クラスでは常に ``None`` を返します。" #: ../../library/email.compat32-message.rst:283 msgid "" @@ -435,13 +553,15 @@ msgstr "" "注意: どんな場合も、メッセージ中のエンベロープヘッダはこのマップ形式のインタ" "フェイスには含まれません。" -#: ../../library/email.compat32-message.rst:299 msgid "" "In a model generated from bytes, any header values that (in contravention of " "the RFCs) contain non-ASCII bytes will, when retrieved through this " "interface, be represented as :class:`~email.header.Header` objects with a " "charset of ``unknown-8bit``." msgstr "" +"バイト列から生成されたモデルでは、RFC に反して非 ASCII バイトを含むヘッダー値" +"をこのインターフェースから取得すると、文字セットが ``unknown-8bit`` の :" +"class:`~email.header.Header` オブジェクトとして返されます。" #: ../../library/email.compat32-message.rst:307 msgid "Return the total number of headers, including duplicates." @@ -458,11 +578,12 @@ msgstr "" "は最後にコロンをふくんでいてはいけません。このメソッドは以下のように ``in`` " "演算子で使われます::" -#: ../../library/email.compat32-message.rst:316 msgid "" "if 'message-id' in myMessage:\n" " print('Message-ID:', myMessage['message-id'])" msgstr "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" #: ../../library/email.compat32-message.rst:322 msgid "" @@ -504,11 +625,12 @@ msgstr "" "せん*。もしメッセージが名前 *name* をもつフィールドをひとつしか持たないように" "したければ、最初にそれを除去してください。たとえば::" -#: ../../library/email.compat32-message.rst:341 msgid "" "del msg['subject']\n" "msg['subject'] = 'Python roolz!'" msgstr "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" #: ../../library/email.compat32-message.rst:347 msgid "" @@ -535,12 +657,14 @@ msgstr "" "メッセージ中にあるすべてのヘッダのフィールド名とその値を 2-タプルのリストとし" "て返します。" -#: ../../library/email.compat32-message.rst:370 msgid "" "Return the value of the named header field. This is identical to :meth:" "`~object.__getitem__` except that optional *failobj* is returned if the " "named header is missing (defaults to ``None``)." msgstr "" +"指定した名前のヘッダーフィールドの値を返します。\n" +":meth:`~object.__getitem__` と同じですが、ヘッダーがない場合にオプションの " +"*failobj* (デフォルトは ``None``) を返す点が異なります。" #: ../../library/email.compat32-message.rst:374 msgid "Here are some additional useful methods:" @@ -601,36 +725,36 @@ msgstr "" msgid "Here's an example::" msgstr "以下はこの使用例です::" -#: ../../library/email.compat32-message.rst:407 msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" msgstr "" +"msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" #: ../../library/email.compat32-message.rst:409 msgid "This will add a header that looks like ::" msgstr "こうするとヘッダには以下のように追加されます ::" -#: ../../library/email.compat32-message.rst:411 msgid "Content-Disposition: attachment; filename=\"bud.gif\"" -msgstr "" +msgstr "Content-Disposition: attachment; filename=\"bud.gif\"" #: ../../library/email.compat32-message.rst:413 msgid "An example with non-ASCII characters::" msgstr "非 ASCII 文字を使った例::" -#: ../../library/email.compat32-message.rst:415 msgid "" "msg.add_header('Content-Disposition', 'attachment',\n" " filename=('iso-8859-1', '', 'Fußballer.ppt'))" msgstr "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" #: ../../library/email.compat32-message.rst:418 msgid "Which produces ::" msgstr "は、以下のようになります ::" -#: ../../library/email.compat32-message.rst:420 msgid "" "Content-Disposition: attachment; filename*=\"iso-8859-1''Fu%DFballer.ppt\"" msgstr "" +"Content-Disposition: attachment; filename*=\"iso-8859-1''Fu%DFballer.ppt\"" #: ../../library/email.compat32-message.rst:425 msgid "" @@ -741,13 +865,15 @@ msgstr "" "た場合に返すオブジェクトです。オプション引数 *header* には :mailheader:" "`Content-Type` のかわりに検索すべきヘッダを指定します。" -#: ../../library/email.compat32-message.rst:488 -#: ../../library/email.compat32-message.rst:526 msgid "" "This is a legacy method. On the :class:`~email.message.EmailMessage` class " "its functionality is replaced by the *params* property of the individual " "header objects returned by the header access methods." msgstr "" +"これは従来の API のメソッドです。\n" +":class:`~email.message.EmailMessage` クラスでは、ヘッダーへのアクセス用メソッ" +"ドが返す個々のヘッダーオブジェクトの *params* プロパティがこの機能を置き換え" +"ています。" msgid "" "Return the value of the :mailheader:`Content-Type` header's parameter " @@ -801,11 +927,12 @@ msgstr "" "は適切にデコードされた Unicode 文字列を返し、そうでない場合は unquote された" "元の文字列を返します。たとえば::" -#: ../../library/email.compat32-message.rst:519 msgid "" "rawparam = msg.get_param('foo')\n" "param = email.utils.collapse_rfc2231_value(rawparam)" msgstr "" +"rawparam = msg.get_param('foo')\n" +"param = email.utils.collapse_rfc2231_value(rawparam)" #: ../../library/email.compat32-message.rst:522 msgid "" @@ -831,15 +958,15 @@ msgstr "" "合、 :rfc:`2045` にしたがいこの値には :mimetype:`text/plain` が設定され、新し" "いパラメータ値が末尾に追加されます。" -#: ../../library/email.compat32-message.rst:541 msgid "" "Optional *header* specifies an alternative header to :mailheader:`Content-" "Type`, and all parameters will be quoted as necessary unless optional " "*requote* is ``False`` (the default is ``True``)." msgstr "" -"オプション引数 *header* が与えられた場合、 :mailheader:`Content-Type` のかわ" -"りにそのヘッダが使用されます。オプション引数 *requote* が ``False`` でない限" -"り、この値は quote されます (デフォルトは ``True``)。" +"オプションの *header* は、:mailheader:`Content-Type` の代わりに使うヘッダーを" +"指定します。\n" +"オプションの *requote* が ``False`` でない限り、すべてのパラメータは必要に応" +"じて引用符で囲まれます (*requote* のデフォルトは ``True`` です)。" #: ../../library/email.compat32-message.rst:545 msgid "" @@ -853,12 +980,14 @@ msgstr "" "すが、デフォルトではこれは空文字列となります。 *charset* と *language* はどち" "らも文字列である必要があります。" -#: ../../library/email.compat32-message.rst:550 msgid "" "If *replace* is ``False`` (the default) the header is moved to the end of " "the list of headers. If *replace* is ``True``, the header will be updated " "in place." msgstr "" +"*replace* が ``False`` (デフォルト) の場合、ヘッダーはヘッダー一覧の末尾に移" +"動します。\n" +"*replace* が ``True`` の場合は、元の位置で更新されます。" #: ../../library/email.compat32-message.rst:554 msgid "``replace`` keyword was added." @@ -910,11 +1039,13 @@ msgstr "" "りにそのヘッダが使用されます。 :mailheader:`Content-Type` ヘッダが設定される" "場合には、 :mailheader:`MIME-Version` ヘッダも同時に付加されます。" -#: ../../library/email.compat32-message.rst:581 msgid "" "This is a legacy method. On the :class:`~email.message.EmailMessage` class " "its functionality is replaced by the ``make_`` and ``add_`` methods." msgstr "" +"これは従来の API のメソッドです。\n" +":class:`~email.message.EmailMessage` クラスでは、``make_`` と ``add_`` メソッ" +"ドがこの機能を置き換えています。" #: ../../library/email.compat32-message.rst:588 msgid "" @@ -1017,13 +1148,16 @@ msgstr "" "あるいは MIME maintype が :mimetype:`text` でないいずれかの場合には、リストの" "要素として *failobj* が返されます。" -#: ../../library/email.compat32-message.rst:646 msgid "" "Return the lowercased value (without parameters) of the message's :" "mailheader:`Content-Disposition` header if it has one, or ``None``. The " "possible values for this method are *inline*, *attachment* or ``None`` if " "the message follows :rfc:`2183`." msgstr "" +"メッセージに :mailheader:`Content-Disposition` ヘッダーがあれば、パラメータを" +"除いた値を小文字で返し、なければ ``None`` を返します。\n" +"メッセージが :rfc:`2183` に準拠していれば、戻り値は *inline*、*attachment*、" +"``None`` のいずれかです。" #: ../../library/email.compat32-message.rst:655 msgid "" @@ -1046,7 +1180,6 @@ msgstr "" "以下の例は、 multipart メッセージのすべての part において、その MIME タイプを" "表示していくものです。 :" -#: ../../library/email.compat32-message.rst:674 msgid "" ">>> for part in msg.walk():\n" "... print(part.get_content_type())\n" @@ -1058,16 +1191,29 @@ msgid "" "message/rfc822\n" "text/plain" msgstr "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" -#: ../../library/email.compat32-message.rst:686 msgid "" "``walk`` iterates over the subparts of any part where :meth:`is_multipart` " "returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " "may return ``False``. We can see this in our example by making use of the " "``_structure`` debug helper function:" msgstr "" +"``walk()`` は、:meth:`is_multipart` が ``True`` を返すパートのサブパートを反" +"復処理します。\n" +"``msg.get_content_maintype() == 'multipart'`` が ``False`` を返す場合も同様で" +"す。\n" +"デバッグ用の補助関数 ``_structure()`` を使うと、この例でその様子を確認できま" +"す。" -#: ../../library/email.compat32-message.rst:692 msgid "" ">>> for part in msg.walk():\n" "... print(part.get_content_maintype() == 'multipart',\n" @@ -1088,13 +1234,34 @@ msgid "" " message/rfc822\n" " text/plain" msgstr "" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" -#: ../../library/email.compat32-message.rst:713 msgid "" "Here the ``message`` parts are not ``multiparts``, but they do contain " "subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the " "subparts." msgstr "" +"ここでは ``message`` パートは ``multipart`` ではありませんが、サブパートを含" +"んでいます。\n" +"``is_multipart()`` は ``True`` を返し、``walk()`` はサブパートの中へ進みま" +"す。" #: ../../library/email.compat32-message.rst:718 msgid "" diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index be1ba60a3..a796e9cd9 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.contentmanager.rst:2 msgid ":mod:`!email.contentmanager`: Managing MIME Content" -msgstr "" +msgstr ":mod:`!email.contentmanager`: MIME コンテンツの管理" #: ../../library/email.contentmanager.rst:7 msgid "**Source code:** :source:`Lib/email/contentmanager.py`" @@ -34,26 +33,32 @@ msgstr "**ソースコード:** :source:`Lib/email/contentmanager.py`" msgid "[1]_" msgstr "[1]_" -#: ../../library/email.contentmanager.rst:16 msgid "" "Base class for content managers. Provides the standard registry mechanisms " "to register converters between MIME content and other representations, as " "well as the ``get_content`` and ``set_content`` dispatch methods." msgstr "" +"コンテンツマネージャーの基底クラスです。\n" +"MIME コンテンツと他の表現との変換処理を登録する標準のレジストリ機構と、処理を" +"振り分ける ``get_content()``、``set_content()`` メソッドを提供します。" -#: ../../library/email.contentmanager.rst:23 msgid "" "Look up a handler function based on the ``mimetype`` of *msg* (see next " "paragraph), call it, passing through all arguments, and return the result of " "the call. The expectation is that the handler will extract the payload from " "*msg* and return an object that encodes information about the extracted data." msgstr "" +"*msg* の ``mimetype`` に基づいてハンドラー関数を探し (次の段落を参照)、すべて" +"の引数をそのまま渡して呼び出し、その結果を返します。\n" +"ハンドラーは *msg* からペイロードを抽出し、抽出したデータの情報を表すオブジェ" +"クトを返すことを想定しています。" -#: ../../library/email.contentmanager.rst:29 msgid "" "To find the handler, look for the following keys in the registry, stopping " "with the first one found:" msgstr "" +"ハンドラーを見つけるには、レジストリで次のキーを順に探し、最初に見つかったも" +"のを使います。" #: ../../library/email.contentmanager.rst:32 msgid "the string representing the full MIME type (``maintype/subtype``)" @@ -67,13 +72,13 @@ msgstr "``maintype`` を表す文字列" msgid "the empty string" msgstr "空の文字列" -#: ../../library/email.contentmanager.rst:36 msgid "" "If none of these keys produce a handler, raise a :exc:`KeyError` for the " "full MIME type." msgstr "" +"どのキーでもハンドラーが見つからない場合、完全な MIME 型を示す :exc:" +"`KeyError` を送出します。" -#: ../../library/email.contentmanager.rst:42 msgid "" "If the ``maintype`` is ``multipart``, raise a :exc:`TypeError`; otherwise " "look up a handler function based on the type of *obj* (see next paragraph), " @@ -83,13 +88,21 @@ msgid "" "making other changes to *msg* as well, such as adding various MIME headers " "to encode information needed to interpret the stored data." msgstr "" +"``maintype`` が ``multipart`` の場合は :exc:`TypeError` を送出します。\n" +"そうでなければ、*obj* の型に基づいてハンドラー関数を探し (次の段落を参照)、" +"*msg* の :meth:`~email.message.EmailMessage.clear_content` を呼び出してから、" +"すべての引数をそのまま渡してハンドラー関数を呼び出します。\n" +"ハンドラーは *obj* を変換して *msg* に格納することを想定しています。\n" +"格納したデータの解釈に必要な情報を表す MIME ヘッダーを追加するなど、*msg* に" +"他の変更を加えることもあります。" -#: ../../library/email.contentmanager.rst:51 msgid "" "To find the handler, obtain the type of *obj* (``typ = type(obj)``), and " "look for the following keys in the registry, stopping with the first one " "found:" msgstr "" +"ハンドラーを見つけるには、*obj* の型を取得し (``typ = type(obj)``)、レジスト" +"リで次のキーを順に探して最初に見つかったものを使います。" #: ../../library/email.contentmanager.rst:55 msgid "the type itself (``typ``)" @@ -101,15 +114,12 @@ msgid "" "__qualname__``)." msgstr "型の完全修飾名 (``typ.__module__ + '.' + typ.__qualname__``)." -#: ../../library/email.contentmanager.rst:58 msgid "the type's :attr:`qualname ` (``typ.__qualname__``)" -msgstr "" +msgstr "型の :attr:`qualname ` (``typ.__qualname__``)" -#: ../../library/email.contentmanager.rst:59 msgid "the type's :attr:`name ` (``typ.__name__``)." -msgstr "" +msgstr "型の :attr:`name ` (``typ.__name__``)。" -#: ../../library/email.contentmanager.rst:61 msgid "" "If none of the above match, repeat all of the checks above for each of the " "types in the :term:`MRO` (:attr:`typ.__mro__ `). Finally, if " @@ -117,6 +127,12 @@ msgid "" "there is no handler for ``None``, raise a :exc:`KeyError` for the fully " "qualified name of the type." msgstr "" +"いずれも一致しない場合、:term:`MRO` (:attr:`typ.__mro__ `) 内の" +"各型について、上記の確認をすべて繰り返します。\n" +"それでもハンドラーが見つからない場合、最後にキー ``None`` のハンドラーを探し" +"ます。\n" +"``None`` のハンドラーもなければ、型の完全修飾名を示す :exc:`KeyError` を送出" +"します。" #: ../../library/email.contentmanager.rst:68 msgid "" @@ -124,32 +140,36 @@ msgid "" "also :class:`.MIMEPart`)." msgstr "" -#: ../../library/email.contentmanager.rst:74 msgid "" "Record the function *handler* as the handler for *key*. For the possible " "values of *key*, see :meth:`get_content`." msgstr "" +"関数 *handler* を *key* のハンドラーとして登録します。\n" +"*key* に指定できる値は :meth:`get_content` を参照してください。" -#: ../../library/email.contentmanager.rst:80 msgid "" "Record *handler* as the function to call when an object of a type matching " "*typekey* is passed to :meth:`set_content`. For the possible values of " "*typekey*, see :meth:`set_content`." msgstr "" +"*typekey* に一致する型のオブジェクトが :meth:`set_content` に渡されたときに呼" +"び出す関数として、*handler* を登録します。\n" +"*typekey* に指定できる値は :meth:`set_content` を参照してください。" -#: ../../library/email.contentmanager.rst:86 msgid "Content Manager Instances" -msgstr "" +msgstr "コンテンツマネージャーのインスタンス" -#: ../../library/email.contentmanager.rst:88 msgid "" "Currently the email package provides only one concrete content manager, :" "data:`raw_data_manager`, although more may be added in the future. :data:" "`raw_data_manager` is the :attr:`~email.policy.EmailPolicy.content_manager` " "provided by :attr:`~email.policy.EmailPolicy` and its derivatives." msgstr "" +"現在、email パッケージが提供する具体的なコンテンツマネージャーは :data:" +"`raw_data_manager` だけですが、将来さらに追加される可能性があります。\n" +":data:`raw_data_manager` は :attr:`~email.policy.EmailPolicy` とその派生クラ" +"スが提供する :attr:`~email.policy.EmailPolicy.content_manager` です。" -#: ../../library/email.contentmanager.rst:97 msgid "" "This content manager provides only a minimum interface beyond that provided " "by :class:`~email.message.Message` itself: it deals only with text, raw " @@ -161,6 +181,16 @@ msgid "" "and it enables the use of the various ``add_`` methods, thereby simplifying " "the creation of multipart messages." msgstr "" +"このコンテンツマネージャーが :class:`~email.message.Message` 自体に加えて提供" +"するインターフェースは最小限で、テキスト、生のバイト列、:class:`~email." +"message.Message` オブジェクトだけを扱います。\n" +"それでも、基本の API と比べて大きな利点があります。\n" +"テキストパートの ``get_content()`` は文字列を返すため、アプリケーションで手動" +"デコードする必要がありません。\n" +"``set_content()`` には、パートに追加するヘッダーやコンテンツ転送エンコーディ" +"ングを制御する豊富なオプションがあります。\n" +"また、各種の ``add_`` メソッドを利用でき、マルチパートメッセージを簡単に作成" +"できます。" #: ../../library/email.contentmanager.rst:109 msgid "" @@ -172,44 +202,55 @@ msgid "" "to a string. The default error handler is ``replace``." msgstr "" -#: ../../library/email.contentmanager.rst:128 msgid "Add headers and payload to *msg*:" -msgstr "" +msgstr "*msg* にヘッダーとペイロードを追加します。" -#: ../../library/email.contentmanager.rst:130 msgid "" "Add a :mailheader:`Content-Type` header with a ``maintype/subtype`` value." msgstr "" +"``maintype/subtype`` の値を持つ :mailheader:`Content-Type` ヘッダーを追加しま" +"す。" -#: ../../library/email.contentmanager.rst:133 msgid "" "For ``str``, set the MIME ``maintype`` to ``text``, and set the subtype to " "*subtype* if it is specified, or ``plain`` if it is not." msgstr "" +"``str`` の場合、MIME の ``maintype`` を ``text`` に設定します。\n" +"サブタイプは *subtype* が指定されていればその値に、そうでなければ ``plain`` " +"に設定します。" -#: ../../library/email.contentmanager.rst:135 msgid "" "For ``bytes``, use the specified *maintype* and *subtype*, or raise a :exc:" "`TypeError` if they are not specified." msgstr "" +"``bytes`` の場合、指定された *maintype* と *subtype* を使います。\n" +"指定されていなければ :exc:`TypeError` を送出します。" -#: ../../library/email.contentmanager.rst:137 msgid "" "For :class:`~email.message.EmailMessage` objects, set the maintype to " "``message``, and set the subtype to *subtype* if it is specified or " "``rfc822`` if it is not. If *subtype* is ``partial``, raise an error " "(``bytes`` objects must be used to construct ``message/partial`` parts)." msgstr "" +":class:`~email.message.EmailMessage` オブジェクトの場合、メインタイプを " +"``message`` に設定します。\n" +"サブタイプは *subtype* が指定されていればその値に、そうでなければ ``rfc822`` " +"に設定します。\n" +"*subtype* が ``partial`` の場合はエラーを送出します (``message/partial`` パー" +"トの作成には ``bytes`` オブジェクトを使う必要があります)。" -#: ../../library/email.contentmanager.rst:143 msgid "" "If *charset* is provided (which is valid only for ``str``), encode the " "string to bytes using the specified character set. The default is " "``utf-8``. If the specified *charset* is a known alias for a standard MIME " "charset name, use the standard charset instead." msgstr "" +"*charset* が指定されている場合 (``str`` でのみ有効)、指定された文字セットで文" +"字列をバイト列にエンコードします。\n" +"デフォルトは ``utf-8`` です。\n" +"指定された *charset* が標準の MIME 文字セット名の既知の別名であれば、標準の文" +"字セット名を使います。" -#: ../../library/email.contentmanager.rst:148 msgid "" "If *cte* is set, encode the payload using the specified content transfer " "encoding, and set the :mailheader:`Content-Transfer-Encoding` header to that " @@ -218,8 +259,14 @@ msgid "" "specified encoding (for example, specifying a *cte* of ``7bit`` for an input " "that contains non-ASCII values), raise a :exc:`ValueError`." msgstr "" +"*cte* が設定されている場合、指定されたコンテンツ転送エンコーディングでペイ" +"ロードをエンコードし、:mailheader:`Content-Transfer-Encoding` ヘッダーをその" +"値に設定します。\n" +"*cte* に指定できる値は ``quoted-printable``、``base64``、``7bit``、``8bit``、" +"``binary`` です。\n" +"非 ASCII 値を含む入力に *cte* として ``7bit`` を指定するなど、入力を指定され" +"た形式でエンコードできない場合は :exc:`ValueError` を送出します。" -#: ../../library/email.contentmanager.rst:156 msgid "" "For ``str`` objects, if *cte* is not set use heuristics to determine the " "most compact encoding. Prior to encoding, :meth:`str.splitlines` is used to " @@ -227,14 +274,19 @@ msgid "" "terminated by the current policy's :data:`~email.policy.Policy.linesep` " "property (even if the original string did not end with one)." msgstr "" +"``str`` オブジェクトで *cte* を設定していない場合、ヒューリスティックによって" +"最もコンパクトなエンコーディングを決めます。\n" +"エンコード前に :meth:`str.splitlines` ですべての行境界を正規化し、ペイロード" +"の各行が現在のポリシーの :data:`~email.policy.Policy.linesep` プロパティで終" +"わるようにします (元の文字列が改行で終わっていなくても同様です)。" -#: ../../library/email.contentmanager.rst:162 msgid "" "For ``bytes`` objects, *cte* is taken to be base64 if not set, and the " "aforementioned newline translation is not performed." msgstr "" +"``bytes`` オブジェクトの場合、*cte* を設定していなければ base64 とみなし、上" +"記の改行変換は行いません。" -#: ../../library/email.contentmanager.rst:164 msgid "" "For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if " "a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* " @@ -242,15 +294,22 @@ msgid "" "body``. For ``message/rfc822``, use ``8bit`` if *cte* is not specified. " "For all other values of *subtype*, use ``7bit``." msgstr "" +":class:`~email.message.EmailMessage` の場合、:rfc:`2046` に従い、*subtype* " +"が ``rfc822`` で *cte* に ``quoted-printable`` または ``base64`` を指定した場" +"合と、*subtype* が ``external-body`` で *cte* に ``7bit`` 以外を指定した場合" +"にはエラーを送出します。\n" +"``message/rfc822`` で *cte* が指定されていなければ ``8bit`` を使います。\n" +"それ以外の *subtype* では ``7bit`` を使います。" -#: ../../library/email.contentmanager.rst:171 msgid "" "A *cte* of ``binary`` does not actually work correctly yet. The " "``EmailMessage`` object as modified by ``set_content`` is correct, but :" "class:`~email.generator.BytesGenerator` does not serialize it correctly." msgstr "" +"*cte* の ``binary`` は、まだ正しく動作しません。\n" +"``set_content()`` によって変更された ``EmailMessage`` オブジェクトは正しいも" +"のの、:class:`~email.generator.BytesGenerator` が正しく直列化しません。" -#: ../../library/email.contentmanager.rst:176 msgid "" "If *disposition* is set, use it as the value of the :mailheader:`Content-" "Disposition` header. If not specified, and *filename* is specified, add the " @@ -258,38 +317,52 @@ msgid "" "*filename* is also not specified, do not add the header. The only valid " "values for *disposition* are ``attachment`` and ``inline``." msgstr "" +"*disposition* が設定されていれば、:mailheader:`Content-Disposition` ヘッダー" +"の値として使います。\n" +"指定されておらず、*filename* が指定されている場合は、値を ``attachment`` とし" +"てヘッダーを追加します。\n" +"*disposition* も *filename* も指定されていなければ、ヘッダーは追加しませ" +"ん。\n" +"*disposition* に有効な値は ``attachment`` と ``inline`` だけです。" -#: ../../library/email.contentmanager.rst:183 msgid "" "If *filename* is specified, use it as the value of the ``filename`` " "parameter of the :mailheader:`Content-Disposition` header." msgstr "" +"*filename* が指定されている場合、:mailheader:`Content-Disposition` ヘッダー" +"の ``filename`` パラメータの値として使います。" -#: ../../library/email.contentmanager.rst:186 msgid "" "If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as " "its value." msgstr "" +"*cid* が指定されている場合、その値を持つ :mailheader:`Content-ID` ヘッダーを" +"追加します。" -#: ../../library/email.contentmanager.rst:189 msgid "" "If *params* is specified, iterate its ``items`` method and use the resulting " "``(key, value)`` pairs to set additional parameters on the :mailheader:" "`Content-Type` header." msgstr "" +"*params* が指定されている場合、その ``items()`` メソッドの結果を反復処理し、" +"得られた ``(key, value)`` ペアを使って :mailheader:`Content-Type` ヘッダーに" +"追加のパラメータを設定します。" -#: ../../library/email.contentmanager.rst:193 msgid "" "If *headers* is specified and is a list of strings of the form ``headername: " "headervalue`` or a list of ``header`` objects (distinguished from strings by " "having a ``name`` attribute), add the headers to *msg*." msgstr "" +"*headers* が指定されていて、``headername: headervalue`` 形式の文字列のリス" +"ト、または ``header`` オブジェクトのリスト (``name`` 属性を持つことで文字列と" +"区別します) である場合、そのヘッダーを *msg* に追加します。" #: ../../library/email.contentmanager.rst:200 msgid "Footnotes" msgstr "脚注" -#: ../../library/email.contentmanager.rst:201 msgid "" "Originally added in 3.4 as a :term:`provisional module `" msgstr "" +"当初は 3.4 で :term:`暫定モジュール ` として追加されまし" +"た。" diff --git a/library/email.encoders.po b/library/email.encoders.po index f13a26c4c..9adc5bb49 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -70,7 +70,6 @@ msgstr "" "はとくにバイナリデータを含んだ :mimetype:`image/\\*` や :mimetype:`text/\\*` " "タイプのメッセージで必要です。" -#: ../../library/email.encoders.rst:27 msgid "" "The :mod:`email` package provides some convenient encoders in its :mod:`!" "encoders` module. These encoders are actually used by the :class:`~email." @@ -81,6 +80,17 @@ msgid "" "They should also set the :mailheader:`Content-Transfer-Encoding` header as " "appropriate." msgstr "" +":mod:`email` パッケージは :mod:`!encoders` モジュールで便利なエンコーダーをい" +"くつか提供しています。\n" +"これらは :class:`~email.mime.audio.MIMEAudio` と :class:`~email.mime.image." +"MIMEImage` のコンストラクタでも、デフォルトのエンコーディングを行うために使わ" +"れています。\n" +"すべてのエンコーダー関数は、エンコードするメッセージオブジェクトを唯一の引数" +"として受け取ります。\n" +"通常はペイロードを取り出してエンコードし、その新しい値をペイロードに設定し直" +"します。\n" +"また、:mailheader:`Content-Transfer-Encoding` ヘッダーも適切に設定する必要が" +"あります。" #: ../../library/email.encoders.rst:35 msgid "" diff --git a/library/email.errors.po b/library/email.errors.po index c34afa260..e3d8c0f0d 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -22,19 +22,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.errors.rst:2 msgid ":mod:`!email.errors`: Exception and Defect classes" -msgstr "" +msgstr ":mod:`!email.errors`: 例外クラスと障害クラス" #: ../../library/email.errors.rst:7 msgid "**Source code:** :source:`Lib/email/errors.py`" msgstr "**ソースコード:** :source:`Lib/email/errors.py`" -#: ../../library/email.errors.rst:11 msgid "" "The following exception classes are defined in the :mod:`!email.errors` " "module:" msgstr "" +":mod:`!email.errors` モジュールでは、以下の例外クラスが定義されています。" #: ../../library/email.errors.rst:16 msgid "" @@ -46,14 +45,15 @@ msgstr "" "は標準の :exc:`Exception` クラスから派生しており、追加のメソッドは定義されて" "いません。" -#: ../../library/email.errors.rst:23 msgid "" "This is the base class for exceptions raised by the :class:`~email.parser." "Parser` class. It is derived from :exc:`MessageError`. This class is also " "used internally by the parser used by :mod:`~email.headerregistry`." msgstr "" +":class:`~email.parser.Parser` クラスが送出する例外の基底クラスで、:exc:" +"`MessageError` から派生しています。\n" +":mod:`~email.headerregistry` のパーサーでも内部的に使われています。" -#: ../../library/email.errors.rst:31 msgid "" "Raised under some error conditions when parsing the :rfc:`5322` headers of a " "message, this class is derived from :exc:`MessageParseError`. The :meth:" @@ -64,12 +64,19 @@ msgid "" "header (that is, there is what is supposed to be a continuation line that " "has no leading whitespace and looks like a header)." msgstr "" +"メッセージの :rfc:`5322` ヘッダーを解析する際の、一部のエラー条件で送出されま" +"す。\n" +"このクラスは :exc:`MessageParseError` から派生しています。\n" +":meth:`~email.message.EmailMessage.set_boundary` は、呼び出し時にコンテントタ" +"イプが不明な場合にこのエラーを送出します。\n" +":class:`~email.header.Header` は、一部の base64 デコードエラーや、別のヘッ" +"ダーが埋め込まれているように見えるヘッダーを作成しようとした場合にこのエラー" +"を送出することがあります (継続行のはずの行の先頭に空白がなく、ヘッダーのよう" +"に見える場合です)。" -#: ../../library/email.errors.rst:43 msgid "Deprecated and no longer used." -msgstr "" +msgstr "非推奨となっており、現在は使われていません。" -#: ../../library/email.errors.rst:48 msgid "" "Raised if the :meth:`~email.message.Message.attach` method is called on an " "instance of a class derived from :class:`~email.mime.nonmultipart." @@ -77,23 +84,31 @@ msgid "" "`MultipartConversionError` multiply inherits from :exc:`MessageError` and " "the built-in :exc:`TypeError`." msgstr "" +":class:`~email.mime.nonmultipart.MIMENonMultipart` から派生したクラス (:" +"class:`~email.mime.image.MIMEImage` など) のインスタンスで :meth:`~email." +"message.Message.attach` を呼び出すと送出されます。\n" +":exc:`MultipartConversionError` は :exc:`MessageError` と組み込みの :exc:" +"`TypeError` を多重継承しています。" -#: ../../library/email.errors.rst:58 msgid "" "Raised when an error occurs when the :mod:`~email.generator` outputs headers." msgstr "" +":mod:`~email.generator` がヘッダーを出力するときにエラーが発生すると送出され" +"ます。" -#: ../../library/email.errors.rst:64 msgid "" "This is the base class for all defects found when parsing email messages. It " "is derived from :exc:`ValueError`." msgstr "" +"電子メールメッセージの解析中に見つかったすべての障害の基底クラスです。\n" +":exc:`ValueError` から派生しています。" -#: ../../library/email.errors.rst:69 msgid "" "This is the base class for all defects found when parsing email headers. It " "is derived from :exc:`MessageDefect`." msgstr "" +"電子メールヘッダーの解析中に見つかったすべての障害の基底クラスです。\n" +":exc:`MessageDefect` から派生しています。" #: ../../library/email.errors.rst:72 msgid "" @@ -116,79 +131,90 @@ msgid "" msgstr "" "すべての障害クラスは :class:`email.errors.MessageDefect` のサブクラスです。" -#: ../../library/email.errors.rst:82 msgid "" "A message claimed to be a multipart, but had no :mimetype:`boundary` " "parameter." msgstr "" +"メッセージはマルチパートと宣言されていますが、:mimetype:`boundary` パラメータ" +"がありません。" -#: ../../library/email.errors.rst:87 msgid "" "The start boundary claimed in the :mailheader:`Content-Type` header was " "never found." msgstr "" +":mailheader:`Content-Type` ヘッダーで宣言された開始境界が見つかりませんでし" +"た。" -#: ../../library/email.errors.rst:92 msgid "" "A start boundary was found, but no corresponding close boundary was ever " "found." -msgstr "" +msgstr "開始境界は見つかりましたが、対応する終了境界が見つかりませんでした。" -#: ../../library/email.errors.rst:99 msgid "The message had a continuation line as its first header line." -msgstr "" +msgstr "メッセージの最初のヘッダー行が継続行になっています。" -#: ../../library/email.errors.rst:103 msgid "A \"Unix From\" header was found in the middle of a header block." -msgstr "" +msgstr "ヘッダーブロックの途中に \"Unix From\" ヘッダーが見つかりました。" -#: ../../library/email.errors.rst:107 msgid "" "A line was found while parsing headers that had no leading white space but " "contained no ':'. Parsing continues assuming that the line represents the " "first line of the body." msgstr "" +"ヘッダーの解析中に、先頭に空白がなく、コロンも含まない行が見つかりました。\n" +"その行を本文の最初の行とみなして解析を続けます。" -#: ../../library/email.errors.rst:115 msgid "" "A header was found that was missing a colon, or was otherwise malformed." -msgstr "" +msgstr "コロンがないなど、形式が不正なヘッダーが見つかりました。" -#: ../../library/email.errors.rst:117 msgid "This defect has not been used for several Python versions." -msgstr "この欠陥が使われていないPythonバージョンがいくつかあります。" +msgstr "この障害は、ここ数バージョンの Python では使われていません。" -#: ../../library/email.errors.rst:122 msgid "" "A message claimed to be a :mimetype:`multipart`, but no subparts were found. " "Note that when a message has this defect, its :meth:`~email.message.Message." "is_multipart` method may return ``False`` even though its content type " "claims to be :mimetype:`multipart`." msgstr "" +"メッセージは :mimetype:`multipart` と宣言されていますが、サブパートが見つかり" +"ませんでした。\n" +"この障害があるメッセージでは、コンテントタイプが :mimetype:`multipart` であっ" +"ても :meth:`~email.message.Message.is_multipart` が ``False`` を返すことがあ" +"ります。" -#: ../../library/email.errors.rst:129 msgid "" "When decoding a block of base64 encoded bytes, the padding was not correct. " "Enough padding is added to perform the decode, but the resulting decoded " "bytes may be invalid." msgstr "" +"base64 でエンコードされたバイト列のブロックをデコードするときに、パディングの" +"不正が見つかりました。\n" +"デコードに必要なパディングは補われますが、結果のバイト列が不正になる可能性が" +"あります。" -#: ../../library/email.errors.rst:135 msgid "" "When decoding a block of base64 encoded bytes, characters outside the base64 " "alphabet were encountered. The characters are ignored, but the resulting " "decoded bytes may be invalid." msgstr "" +"base64 でエンコードされたバイト列のブロックをデコードするときに、base64 の文" +"字集合にない文字が見つかりました。\n" +"その文字は無視されますが、結果のバイト列が不正になる可能性があります。" -#: ../../library/email.errors.rst:141 msgid "" "When decoding a block of base64 encoded bytes, the number of non-padding " "base64 characters was invalid (1 more than a multiple of 4). The encoded " "block was kept as-is." msgstr "" +"base64 でエンコードされたバイト列のブロックをデコードするときに、パディングを" +"除く base64 文字の数が不正でした (4 の倍数より 1 多い数でした)。\n" +"エンコードされたブロックはそのまま保持されます。" -#: ../../library/email.errors.rst:147 msgid "" "When decoding an invalid or unparsable date field. The original value is " "kept as-is." msgstr "" +"不正な日付フィールド、または解析できない日付フィールドをデコードするときに発" +"生します。\n" +"元の値はそのまま保持されます。" diff --git a/library/email.examples.po b/library/email.examples.po index 1348d152d..3eee3e3b7 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -35,13 +35,13 @@ msgstr "" "信するいくつかの例を紹介します。より複雑な MIME メッセージについても扱いま" "す。" -#: ../../library/email.examples.rst:9 msgid "" "First, let's see how to create and send a simple text message (both the text " "content and the addresses may contain Unicode characters):" msgstr "" +"まず、単純なテキストメッセージを作成して送信する方法を見てみましょう (テキス" +"トの内容にもアドレスにも Unicode 文字を含められます)。" -#: ../../library/email.examples.rst:12 msgid "" "# Import smtplib for the actual sending function\n" "import smtplib\n" @@ -66,6 +66,29 @@ msgid "" "s.send_message(msg)\n" "s.quit()\n" msgstr "" +"# 実際の送信に使う smtplib をインポートします\n" +"import smtplib\n" +"\n" +"# 必要な email モジュールをインポートします\n" +"from email.message import EmailMessage\n" +"\n" +"# textfile に名前が入っているプレーンテキストファイルを読み込み用に開きま" +"す。\n" +"with open(textfile) as fp:\n" +" # text/plain メッセージを作成します\n" +" msg = EmailMessage()\n" +" msg.set_content(fp.read())\n" +"\n" +"# me == 送信者のメールアドレス\n" +"# you == 受信者のメールアドレス\n" +"msg['Subject'] = f'The contents of {textfile}'\n" +"msg['From'] = me\n" +"msg['To'] = you\n" +"\n" +"# 自分の SMTP サーバー経由でメッセージを送信します。\n" +"s = smtplib.SMTP('localhost')\n" +"s.send_message(msg)\n" +"s.quit()\n" #: ../../library/email.examples.rst:15 msgid "" @@ -75,7 +98,6 @@ msgstr "" ":rfc:`822` ヘッダーの解析は、 :mod:`~email.parser` モジュールにあるクラスを使" "用することにより、簡単に実現できます:" -#: ../../library/email.examples.rst:18 msgid "" "# Import the email modules we'll need\n" "#from email.parser import BytesParser\n" @@ -103,6 +125,32 @@ msgid "" "print('Recipient username: {}'.format(headers['to'].addresses[0].username))\n" "print('Sender name: {}'.format(headers['from'].addresses[0].display_name))\n" msgstr "" +"# 必要な email モジュールをインポートします\n" +"#from email.parser import BytesParser\n" +"from email.parser import Parser\n" +"from email.policy import default\n" +"\n" +"# 電子メールのヘッダーがファイルにある場合、次の 2 行のコメントを外します:\n" +"# with open(messagefile, 'rb') as fp:\n" +"# headers = BytesParser(policy=default).parse(fp)\n" +"\n" +"# 文字列中のヘッダーを解析する場合 (一般的ではありません) は、次のようにしま" +"す:\n" +"headers = Parser(policy=default).parsestr(\n" +" 'From: Foo Bar \\n'\n" +" 'To: \\n'\n" +" 'Subject: Test message\\n'\n" +" '\\n'\n" +" 'Body would go here\\n')\n" +"\n" +"# これで、辞書としてヘッダーの各項目にアクセスできます:\n" +"print('To: {}'.format(headers['to']))\n" +"print('From: {}'.format(headers['from']))\n" +"print('Subject: {}'.format(headers['subject']))\n" +"\n" +"# アドレスの各部分にもアクセスできます:\n" +"print('Recipient username: {}'.format(headers['to'].addresses[0].username))\n" +"print('Sender name: {}'.format(headers['from'].addresses[0].display_name))\n" #: ../../library/email.examples.rst:21 msgid "" @@ -150,7 +198,6 @@ msgstr "" "つぎはあるディレクトリに含まれている内容全体をひとつの電子メールメッセージと" "して送信するやり方です: [1]_" -#: ../../library/email.examples.rst:30 msgid "" "#!/usr/bin/env python3\n" "\n" @@ -237,6 +284,90 @@ msgid "" "if __name__ == '__main__':\n" " main()\n" msgstr "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"ディレクトリの内容を MIME メッセージとして送信します。\"\"\"\n" +"\n" +"import os\n" +"import smtplib\n" +"# ファイル名の拡張子から MIME 型を推測するために使います\n" +"import mimetypes\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"from email.message import EmailMessage\n" +"from email.policy import SMTP\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Send the contents of a directory as a MIME message.\n" +"Unless the -o option is given, the email is sent by forwarding to your " +"local\n" +"SMTP server, which then does the normal delivery process. Your local " +"machine\n" +"must be running an SMTP server.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory',\n" +" help=\"\"\"Mail the contents of the specified " +"directory,\n" +" otherwise use the current directory. Only the " +"regular\n" +" files in the directory are sent, and we don't " +"recurse to\n" +" subdirectories.\"\"\")\n" +" parser.add_argument('-o', '--output',\n" +" metavar='FILE',\n" +" help=\"\"\"Print the composed message to FILE " +"instead of\n" +" sending the message to the SMTP server.\"\"\")\n" +" parser.add_argument('-s', '--sender', required=True,\n" +" help='The value of the From: header (required)')\n" +" parser.add_argument('-r', '--recipient', required=True,\n" +" action='append', metavar='RECIPIENT',\n" +" default=[], dest='recipients',\n" +" help='A To: header value (at least one required)')\n" +" args = parser.parse_args()\n" +" directory = args.directory\n" +" if not directory:\n" +" directory = '.'\n" +" # メッセージを作成します\n" +" msg = EmailMessage()\n" +" msg['Subject'] = f'Contents of directory {os.path.abspath(directory)}'\n" +" msg['To'] = ', '.join(args.recipients)\n" +" msg['From'] = args.sender\n" +" msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" +"\n" +" for filename in os.listdir(directory):\n" +" path = os.path.join(directory, filename)\n" +" if not os.path.isfile(path):\n" +" continue\n" +" # ファイルの拡張子からコンテントタイプを推測します。\n" +" # エンコーディングは無視しますが、本来は gzip などで圧縮された\n" +" # ファイルのような単純なケースを確認する必要があります。\n" +" ctype, encoding = mimetypes.guess_file_type(path)\n" +" if ctype is None or encoding is not None:\n" +" # 推測できなかったか、ファイルがエンコード (圧縮) されているの" +"で、\n" +" # 汎用のバイナリデータ型を使います。\n" +" ctype = 'application/octet-stream'\n" +" maintype, subtype = ctype.split('/', 1)\n" +" with open(path, 'rb') as fp:\n" +" msg.add_attachment(fp.read(),\n" +" maintype=maintype,\n" +" subtype=subtype,\n" +" filename=filename)\n" +" # メッセージを送信または保存します\n" +" if args.output:\n" +" with open(args.output, 'wb') as fp:\n" +" fp.write(msg.as_bytes(policy=SMTP))\n" +" else:\n" +" with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" #: ../../library/email.examples.rst:33 msgid "" @@ -246,7 +377,6 @@ msgstr "" "つぎに、上のような MIME メッセージをどうやって展開してひとつのディレクトリ上" "の複数ファイルにするかを示します:" -#: ../../library/email.examples.rst:36 msgid "" "#!/usr/bin/env python3\n" "\n" @@ -303,6 +433,61 @@ msgid "" "if __name__ == '__main__':\n" " main()\n" msgstr "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"MIME メッセージをディレクトリ内のファイルに展開します。\"\"\"\n" +"\n" +"import os\n" +"import email\n" +"import mimetypes\n" +"\n" +"from email.policy import default\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Unpack a MIME message into a directory of files.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory', required=True,\n" +" help=\"\"\"Unpack the MIME message into the named\n" +" directory, which will be created if it doesn't " +"already\n" +" exist.\"\"\")\n" +" parser.add_argument('msgfile')\n" +" args = parser.parse_args()\n" +"\n" +" with open(args.msgfile, 'rb') as fp:\n" +" msg = email.message_from_binary_file(fp, policy=default)\n" +"\n" +" try:\n" +" os.mkdir(args.directory)\n" +" except FileExistsError:\n" +" pass\n" +"\n" +" counter = 1\n" +" for part in msg.walk():\n" +" # multipart/* は単なるコンテナです\n" +" if part.get_content_maintype() == 'multipart':\n" +" continue\n" +" # メールメッセージによって重要なファイルが上書きされないように、\n" +" # 実際のアプリケーションではファイル名を安全なものにする必要がありま" +"す\n" +" filename = part.get_filename()\n" +" if not filename:\n" +" ext = mimetypes.guess_extension(part.get_content_type())\n" +" if not ext:\n" +" # 汎用のバイナリデータ用拡張子を使います\n" +" ext = '.bin'\n" +" filename = f'part-{counter:03d}{ext}'\n" +" counter += 1\n" +" with open(os.path.join(args.directory, filename), 'wb') as fp:\n" +" fp.write(part.get_payload(decode=True))\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" #: ../../library/email.examples.rst:39 msgid "" @@ -315,7 +500,6 @@ msgstr "" "す。もう少し面白くするために、 HTML 部分に関連する画像を追加し、さらに送信だ" "けでなく、送信しようとしているもののコピーをディスクにも保存してみます。" -#: ../../library/email.examples.rst:44 msgid "" "#!/usr/bin/env python3\n" "\n" @@ -377,6 +561,65 @@ msgid "" "with smtplib.SMTP('localhost') as s:\n" " s.send_message(msg)\n" msgstr "" +"#!/usr/bin/env python3\n" +"\n" +"import smtplib\n" +"\n" +"from email.message import EmailMessage\n" +"from email.headerregistry import Address\n" +"from email.utils import make_msgid\n" +"\n" +"# 基本のテキストメッセージを作成します。\n" +"msg = EmailMessage()\n" +"msg['Subject'] = \"Pourquoi pas des asperges pour ce midi ?\"\n" +"msg['From'] = Address(\"Pepé Le Pew\", \"pepe\", \"example.com\")\n" +"msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", \"example.com\"),\n" +" Address(\"Fabrette Pussycat\", \"fabrette\", \"example.com\"))\n" +"msg.set_content(\"\"\"\\\n" +"Salut!\n" +"\n" +"Cette recette [1] sera sûrement un très bon repas.\n" +"\n" +"[1] http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718\n" +"\n" +"--Pepé\n" +"\"\"\")\n" +"\n" +"# HTML 版を追加します。\n" +"# メッセージは multipart/alternative コンテナになり、\n" +"# 最初のパートが元のテキストメッセージ、\n" +"# 2 番目のパートが新しい HTML メッセージになります。\n" +"asparagus_cid = make_msgid()\n" +"msg.add_alternative(\"\"\"\\\n" +"\n" +" \n" +" \n" +"

Salut!

\n" +"

Cette\n" +" \n" +" recette\n" +" sera sûrement un très bon repas.\n" +"

\n" +" \n" +" \n" +"\n" +"\"\"\".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')\n" +"# HTML で使うために msgid から <> を取り除く必要がある点に注意してくださ" +"い。\n" +"\n" +"# HTML パートに関連する画像を追加します。\n" +"with open(\"roasted-asparagus.jpg\", 'rb') as img:\n" +" msg.get_payload()[1].add_related(img.read(), 'image', 'jpeg',\n" +" cid=asparagus_cid)\n" +"\n" +"# 送信する内容のローカルコピーを作成します。\n" +"with open('outgoing.msg', 'wb') as f:\n" +" f.write(bytes(msg))\n" +"\n" +"# ローカル SMTP サーバー経由でメッセージを送信します。\n" +"with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" #: ../../library/email.examples.rst:47 msgid "" @@ -386,7 +629,6 @@ msgstr "" "前の例のメッセージが送信されてきたら、これを処理する方法の一つは次のようなも" "のです:" -#: ../../library/email.examples.rst:50 msgid "" "import os\n" "import sys\n" @@ -476,12 +718,95 @@ msgid "" "# Of course, there are lots of email messages that could break this simple\n" "# minded program, but it will handle the most common ones.\n" msgstr "" +"import os\n" +"import sys\n" +"import tempfile\n" +"import mimetypes\n" +"import webbrowser\n" +"\n" +"# 必要な email モジュールをインポートします\n" +"from email import policy\n" +"from email.parser import BytesParser\n" +"\n" +"\n" +"def magic_html_parser(html_text, partfiles):\n" +" \"\"\"安全性に配慮して処理し、partfiles にリンクする HTML を返します。\n" +"\n" +" href=\"cid:....\" 属性を書き換え、partfiles 内のファイル名を指すようにし" +"ます。\n" +" 簡単ではありませんが、html.parser を使えば実現できるはずです。\n" +" \"\"\"\n" +" raise NotImplementedError(\"Add the magic needed\")\n" +"\n" +"\n" +"# 実際のプログラムでは、引数からファイル名を取得します。\n" +"with open('outgoing.msg', 'rb') as fp:\n" +" msg = BytesParser(policy=policy.default).parse(fp)\n" +"\n" +"# これでヘッダーの各項目に辞書としてアクセスでき、\n" +"# 非 ASCII 文字は Unicode に変換されます:\n" +"print('To:', msg['to'])\n" +"print('From:', msg['from'])\n" +"print('Subject:', msg['subject'])\n" +"\n" +"# メッセージ内容のプレビューを表示するには、最も書式の少ないペイロードを\n" +"# 取り出して最初の 3 行を表示できます。\n" +"# もちろん、プレーンテキストのパートが\n" +"# なければ HTML の最初の 3 行を表示してもあまり役に立ちませんが、\n" +"# ここでは考え方を示すための例としています。\n" +"simplest = msg.get_body(preferencelist=('plain', 'html'))\n" +"print()\n" +"print(''.join(simplest.get_content().splitlines(keepends=True)[:3]))\n" +"\n" +"ans = input(\"View full message?\")\n" +"if ans.lower()[0] == 'n':\n" +" sys.exit()\n" +"\n" +"# 表示のために最も情報の豊かな代替パートを取り出せます:\n" +"richest = msg.get_body()\n" +"partfiles = {}\n" +"if richest['content-type'].maintype == 'text':\n" +" if richest['content-type'].subtype == 'plain':\n" +" for line in richest.get_content().splitlines():\n" +" print(line)\n" +" sys.exit()\n" +" elif richest['content-type'].subtype == 'html':\n" +" body = richest\n" +" else:\n" +" print(\"Don't know how to display {}\".format(richest." +"get_content_type()))\n" +" sys.exit()\n" +"elif richest['content-type'].content_type == 'multipart/related':\n" +" body = richest.get_body(preferencelist=('html'))\n" +" for part in richest.iter_attachments():\n" +" fn = part.get_filename()\n" +" if fn:\n" +" extension = os.path.splitext(part.get_filename())[1]\n" +" else:\n" +" extension = mimetypes.guess_extension(part.get_content_type())\n" +" with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as " +"f:\n" +" f.write(part.get_content())\n" +" # ここでも <> を除いて、メール形式の cid を HTML 形式にします。\n" +" partfiles[part['content-id'][1:-1]] = f.name\n" +"else:\n" +" print(\"Don't know how to display {}\".format(richest." +"get_content_type()))\n" +" sys.exit()\n" +"with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:\n" +" f.write(magic_html_parser(body.get_content(), partfiles))\n" +"webbrowser.open(f.name)\n" +"os.remove(f.name)\n" +"for fn in partfiles.values():\n" +" os.remove(fn)\n" +"\n" +"# もちろん、この単純なプログラムでは扱えないメッセージも数多くありますが、\n" +"# よくあるメッセージには対応できます。\n" #: ../../library/email.examples.rst:52 msgid "Up to the prompt, the output from the above is:" msgstr "プロンプトまでの、上記のプログラムの出力はこうなります:" -#: ../../library/email.examples.rst:54 msgid "" "To: Penelope Pussycat , Fabrette Pussycat " "\n" @@ -492,6 +817,14 @@ msgid "" "\n" "Cette recette [1] sera sûrement un très bon repas." msgstr "" +"To: Penelope Pussycat , Fabrette Pussycat " +"\n" +"From: Pepé Le Pew \n" +"Subject: Pourquoi pas des asperges pour ce midi ?\n" +"\n" +"Salut!\n" +"\n" +"Cette recette [1] sera sûrement un très bon repas." #: ../../library/email.examples.rst:66 msgid "Footnotes" diff --git a/library/email.generator.po b/library/email.generator.po index 148fe72e3..9b6d80516 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -22,15 +22,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.generator.rst:2 msgid ":mod:`!email.generator`: Generating MIME documents" -msgstr "" +msgstr ":mod:`!email.generator`: MIME 文書の生成" #: ../../library/email.generator.rst:7 msgid "**Source code:** :source:`Lib/email/generator.py`" msgstr "**ソースコード:** :source:`Lib/email/generator.py`" -#: ../../library/email.generator.rst:11 msgid "" "One of the most common tasks is to generate the flat (serialized) version of " "the email message represented by a message object structure. You will need " @@ -39,8 +37,13 @@ msgid "" "structure and producing a serialized representation is the job of the " "generator classes." msgstr "" +"メッセージオブジェクトの構造で表された電子メールメッセージから、フラットな " +"(直列化された) 表現を生成することは、よく行う処理の一つです。\n" +":meth:`smtplib.SMTP.sendmail` で送信したり、コンソールに表示したりするには、" +"この処理が必要です。\n" +"メッセージオブジェクトの構造を受け取り、直列化された表現を作成するのがジェネ" +"レータークラスの役割です。" -#: ../../library/email.generator.rst:18 msgid "" "As with the :mod:`email.parser` module, you aren't limited to the " "functionality of the bundled generator; you could write one from scratch " @@ -56,8 +59,19 @@ msgid "" "changes to the :class:`~email.message.EmailMessage` object as defaults are " "filled in.)" msgstr "" +":mod:`email.parser` モジュールと同様に、付属のジェネレーターの機能だけを使う" +"必要はなく、自分で一から実装することもできます。\n" +"ただし、付属のジェネレーターはほとんどの電子メールを標準に準拠して生成でき、" +"MIME メッセージも非 MIME メッセージも適切に扱えるはずです。\n" +"また、変換を行わない同じ :mod:`~email.policy` を両方に使えば、バイト列の解析" +"と生成が互いに逆の操作になるよう設計されています。\n" +"つまり、直列化されたバイトストリームを :class:`~email.parser.BytesParser` で" +"解析し、:class:`BytesGenerator` で再生成すると、入力と同じ出力が得られるはず" +"です [#]_。\n" +"(一方、プログラムで構築した :class:`~email.message.EmailMessage` にジェネレー" +"ターを使うと、デフォルト値が補われる際に :class:`~email.message." +"EmailMessage` オブジェクトが変更されることがあります。)" -#: ../../library/email.generator.rst:32 msgid "" "The :class:`Generator` class can be used to flatten a message into a text " "(as opposed to binary) serialized representation, but since Unicode cannot " @@ -66,23 +80,36 @@ msgid "" "Content Transfer Encoding techniques for encoding email messages for " "transport over channels that are not \"8 bit clean\"." msgstr "" +":class:`Generator` クラスを使うと、メッセージをバイナリではなくテキストの直列" +"化表現にフラット化できます。\n" +"ただし、Unicode はバイナリデータを直接表現できないため、メッセージを ASCII 文" +"字だけからなる形式に変換する必要があります。\n" +"そのために、8 ビットデータをそのまま通せない経路で電子メールを送信するため" +"の、標準の電子メール RFC に定められたコンテンツ転送エンコーディングを使いま" +"す。" -#: ../../library/email.generator.rst:39 msgid "" "To accommodate reproducible processing of SMIME-signed messages :class:" "`Generator` disables header folding for message parts of type ``multipart/" "signed`` and all subparts." msgstr "" +"SMIME で署名されたメッセージを再現可能な形で処理できるよう、:class:" +"`Generator` は ``multipart/signed`` 型のパートとそのすべてのサブパートで、" +"ヘッダーの折り返しを無効にします。" -#: ../../library/email.generator.rst:47 msgid "" "Return a :class:`BytesGenerator` object that will write any message provided " "to the :meth:`flatten` method, or any surrogateescape encoded text provided " "to the :meth:`write` method, to the :term:`file-like object` *outfp*. " "*outfp* must support a ``write`` method that accepts binary data." msgstr "" +":meth:`flatten` に渡されたメッセージ、または :meth:`write` に渡された " +"surrogateescape でエンコードされたテキストを、:term:`ファイルライクオブジェク" +"ト ` *outfp* に書き込む :class:`BytesGenerator` オブジェク" +"トを返します。\n" +"*outfp* は、バイナリデータを受け取る ``write()`` メソッドを持つ必要がありま" +"す。" -#: ../../library/email.generator.rst:52 ../../library/email.generator.rst:153 msgid "" "If optional *mangle_from_* is ``True``, put a ``>`` character in front of " "any line in the body that starts with the exact string ``\"From \"``, that " @@ -94,6 +121,15 @@ msgid "" "`WHY THE CONTENT-LENGTH FORMAT IS BAD `_)." msgstr "" +"オプションの *mangle_from_* が ``True`` の場合、本体中で正確に文字列 " +"``\"From \"`` から始まる行、つまり行頭の ``From`` の後に空白がある行の先頭に " +"``>`` を追加します。\n" +"*mangle_from_* のデフォルトは、*policy* の :attr:`~email.policy.Policy." +"mangle_from_` 設定の値です (:data:`~email.policy.compat32` ポリシーでは " +"``True``、それ以外では ``False`` です)。\n" +"*mangle_from_* は、メッセージを Unix mbox 形式で保存する場合を想定しています " +"(:mod:`mailbox` と `WHY THE CONTENT-LENGTH FORMAT IS BAD `_ を参照してください)。" #: ../../library/email.generator.rst:62 ../../library/email.generator.rst:163 msgid "" @@ -103,7 +139,6 @@ msgid "" "lines according to the *policy* settings." msgstr "" -#: ../../library/email.generator.rst:67 ../../library/email.generator.rst:168 msgid "" "If *policy* is specified, use that policy to control message generation. If " "*policy* is ``None`` (the default), use the policy associated with the :" @@ -111,16 +146,22 @@ msgid "" "object passed to ``flatten`` to control the message generation. See :mod:" "`email.policy` for details on what *policy* controls." msgstr "" +"*policy* が指定されていれば、そのポリシーでメッセージの生成を制御します。\n" +"*policy* が ``None`` (デフォルト) であれば、``flatten()`` に渡された :class:" +"`~email.message.Message` または :class:`~email.message.EmailMessage` オブジェ" +"クトに関連付けられたポリシーを使います。\n" +"*policy* が制御する内容については :mod:`email.policy` を参照してください。" #: ../../library/email.generator.rst:75 ../../library/email.generator.rst:174 msgid "Added the *policy* keyword." msgstr "キーワード引数 *policy* が追加されました。" -#: ../../library/email.generator.rst:77 ../../library/email.generator.rst:176 msgid "" "The default behavior of the *mangle_from_* and *maxheaderlen* parameters is " "to follow the policy." msgstr "" +"*mangle_from_* と *maxheaderlen* 引数のデフォルトの動作が、ポリシーに従うよう" +"になりました。" #: ../../library/email.generator.rst:83 msgid "" @@ -132,7 +173,6 @@ msgstr "" "のファイルにはこの :class:`BytesGenerator` インスタンスが作成されたときに指定" "されたものが使われます。" -#: ../../library/email.generator.rst:87 msgid "" "If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is " "``8bit`` (the default), copy any headers in the original parsed message that " @@ -147,8 +187,21 @@ msgid "" "bytes in headers using the MIME ``unknown-8bit`` character set, thus " "rendering them RFC-compliant." msgstr "" +":mod:`~email.policy` の :attr:`~email.policy.Policy.cte_type` が ``8bit`` (デ" +"フォルト) の場合、解析した元のメッセージのうち変更されていないヘッダーを出力" +"へコピーします。\n" +"その際、最上位ビットが立っているバイトも元どおりに再現し、非 ASCII の :" +"mailheader:`Content-Transfer-Encoding` を持つ本文パートではそれを保持しま" +"す。\n" +"``cte_type`` が ``7bit`` の場合は、ASCII 互換の :mailheader:`Content-" +"Transfer-Encoding` を使い、最上位ビットが立っているバイトを必要に応じて変換し" +"ます。\n" +"つまり、非 ASCII の :mailheader:`Content-Transfer-Encoding` (:mailheader:" +"`Content-Transfer-Encoding: 8bit`) を持つパートを ASCII 互換の :mailheader:" +"`Content-Transfer-Encoding` に変換し、ヘッダー中の RFC に反する非 ASCII バイ" +"トを MIME の ``unknown-8bit`` 文字セットでエンコードして、RFC に準拠させま" +"す。" -#: ../../library/email.generator.rst:104 ../../library/email.generator.rst:197 msgid "" "If *unixfrom* is ``True``, print the envelope header delimiter used by the " "Unix mailbox format (see :mod:`mailbox`) before the first of the :rfc:`5322` " @@ -156,28 +209,40 @@ msgid "" "header, craft a standard one. The default is ``False``. Note that for " "subparts, no envelope header is ever printed." msgstr "" +"*unixfrom* が ``True`` の場合、最上位のメッセージオブジェクトの最初の :rfc:" +"`5322` ヘッダーより前に、Unix メールボックス形式で使うエンベロープヘッダーの" +"区切りを出力します (:mod:`mailbox` を参照)。\n" +"最上位のオブジェクトにエンベロープヘッダーがなければ、標準的なものを作成しま" +"す。\n" +"デフォルトは ``False`` です。\n" +"サブパートではエンベロープヘッダーは出力されません。" -#: ../../library/email.generator.rst:110 ../../library/email.generator.rst:203 msgid "" "If *linesep* is not ``None``, use it as the separator character between all " "the lines of the flattened message. If *linesep* is ``None`` (the default), " "use the value specified in the *policy*." msgstr "" +"*linesep* が ``None`` でない場合、フラット化されたメッセージのすべての行を区" +"切る文字として使います。\n" +"*linesep* が ``None`` (デフォルト) の場合、*policy* で指定された値を使いま" +"す。" -#: ../../library/email.generator.rst:119 msgid "" "Return an independent clone of this :class:`BytesGenerator` instance with " "the exact same option settings, and *fp* as the new *outfp*." msgstr "" +"この :class:`BytesGenerator` インスタンスとまったく同じオプション設定で、新し" +"い *outfp* を *fp* とした、独立した複製を返します。" -#: ../../library/email.generator.rst:125 msgid "" "Encode *s* using the ``ASCII`` codec and the ``surrogateescape`` error " "handler, and pass it to the *write* method of the *outfp* passed to the :" "class:`BytesGenerator`'s constructor." msgstr "" +"*s* を ``ASCII`` コーデックと ``surrogateescape`` エラーハンドラーでエンコー" +"ドし、:class:`BytesGenerator` のコンストラクタに渡された *outfp* の " +"``write()`` メソッドに渡します。" -#: ../../library/email.generator.rst:130 msgid "" "As a convenience, :class:`~email.message.EmailMessage` provides the methods :" "meth:`~email.message.EmailMessage.as_bytes` and ``bytes(aMessage)`` (a.k.a. :" @@ -185,6 +250,11 @@ msgid "" "of a serialized binary representation of a message object. For more detail, " "see :mod:`email.message`." msgstr "" +":class:`~email.message.EmailMessage` には、メッセージオブジェクトを直列化した" +"バイナリ表現を簡単に生成するための :meth:`~email.message.EmailMessage." +"as_bytes` と ``bytes(aMessage)`` (すなわち :meth:`~email.message." +"EmailMessage.__bytes__`) が用意されています。\n" +"詳しくは :mod:`email.message` を参照してください。" #: ../../library/email.generator.rst:137 msgid "" @@ -197,13 +267,16 @@ msgid "" "using :class:`BytesGenerator`, and not :class:`Generator`." msgstr "" -#: ../../library/email.generator.rst:148 msgid "" "Return a :class:`Generator` object that will write any message provided to " "the :meth:`flatten` method, or any text provided to the :meth:`write` " "method, to the :term:`file-like object` *outfp*. *outfp* must support a " "``write`` method that accepts string data." msgstr "" +":meth:`flatten` に渡されたメッセージ、または :meth:`write` に渡されたテキスト" +"を、:term:`ファイルライクオブジェクト ` *outfp* に書き込" +"む :class:`Generator` オブジェクトを返します。\n" +"*outfp* は、文字列データを受け取る ``write()`` メソッドを持つ必要があります。" #: ../../library/email.generator.rst:182 msgid "" @@ -215,7 +288,6 @@ msgstr "" "のファイルにはこの :class:`Generator` インスタンスが作成されたときに指定され" "たものが使われます。" -#: ../../library/email.generator.rst:186 msgid "" "If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is " "``8bit``, generate the message as if the option were set to ``7bit``. (This " @@ -227,6 +299,16 @@ msgid "" "Encoding`, and encode RFC-invalid non-ASCII bytes in headers using the MIME " "``unknown-8bit`` character set, thus rendering them RFC-compliant." msgstr "" +":mod:`~email.policy` の :attr:`~email.policy.Policy.cte_type` が ``8bit`` の" +"場合、``7bit`` に設定されているものとしてメッセージを生成します。\n" +"(文字列では非 ASCII バイトを表せないため、この処理が必要です。)\n" +"最上位ビットが立っているバイトは、ASCII 互換の :mailheader:`Content-Transfer-" +"Encoding` を使って必要に応じて変換します。\n" +"つまり、非 ASCII の :mailheader:`Content-Transfer-Encoding` (:mailheader:" +"`Content-Transfer-Encoding: 8bit`) を持つパートを ASCII 互換の :mailheader:" +"`Content-Transfer-Encoding` に変換し、ヘッダー中の RFC に反する非 ASCII バイ" +"トを MIME の ``unknown-8bit`` 文字セットでエンコードして、RFC に準拠させま" +"す。" #: ../../library/email.generator.rst:209 msgid "" @@ -236,20 +318,23 @@ msgstr "" "``8bit`` メッセージ本体の再エンコードがサポートされました。*linesep* 引数が追" "加されました。" -#: ../../library/email.generator.rst:216 msgid "" "Return an independent clone of this :class:`Generator` instance with the " "exact same options, and *fp* as the new *outfp*." msgstr "" +"この :class:`Generator` インスタンスとまったく同じオプションで、新しい " +"*outfp* を *fp* とした、独立した複製を返します。" -#: ../../library/email.generator.rst:222 msgid "" "Write *s* to the *write* method of the *outfp* passed to the :class:" "`Generator`'s constructor. This provides just enough file-like API for :" "class:`Generator` instances to be used in the :func:`print` function." msgstr "" +":class:`Generator` のコンストラクタに渡された *outfp* の ``write()`` メソッド" +"に *s* を書き込みます。\n" +"これにより、:class:`Generator` インスタンスを :func:`print` 関数で使うために" +"必要な、最小限のファイルライク API を提供します。" -#: ../../library/email.generator.rst:228 msgid "" "As a convenience, :class:`~email.message.EmailMessage` provides the methods :" "meth:`~email.message.EmailMessage.as_string` and ``str(aMessage)`` (a.k.a. :" @@ -257,8 +342,12 @@ msgid "" "of a formatted string representation of a message object. For more detail, " "see :mod:`email.message`." msgstr "" +":class:`~email.message.EmailMessage` には、メッセージオブジェクトの書式化され" +"た文字列表現を簡単に生成するための :meth:`~email.message.EmailMessage." +"as_string` と ``str(aMessage)`` (すなわち :meth:`~email.message.EmailMessage." +"__str__`) が用意されています。\n" +"詳しくは :mod:`email.message` を参照してください。" -#: ../../library/email.generator.rst:235 msgid "" "The :mod:`!email.generator` module also provides a derived class, :class:" "`DecodedGenerator`, which is like the :class:`Generator` base class, except " @@ -266,8 +355,12 @@ msgid "" "represented in the output stream by a string derived from a template filled " "in with information about the part." msgstr "" +":mod:`!email.generator` モジュールは派生クラス :class:`DecodedGenerator` も提" +"供します。\n" +"基底クラスの :class:`Generator` と似ていますが、:mimetype:`text` 以外のパート" +"は直列化せず、そのパートの情報をテンプレートに埋め込んだ文字列として出力スト" +"リームに表す点が異なります。" -#: ../../library/email.generator.rst:244 msgid "" "Act like :class:`Generator`, except that for any subpart of the message " "passed to :meth:`Generator.flatten`, if the subpart is of main type :" @@ -276,12 +369,18 @@ msgid "" "*fmt* using information from the part and print the resulting filled-in " "string." msgstr "" +":class:`Generator` と同様に動作しますが、:meth:`Generator.flatten` に渡された" +"メッセージのサブパートについて、メインタイプが :mimetype:`text` ならデコード" +"したペイロードを出力します。\n" +"メインタイプが :mimetype:`text` でなければ、パートをそのまま出力する代わり" +"に、その情報を文字列 *fmt* に埋め込み、結果の文字列を出力します。" -#: ../../library/email.generator.rst:251 msgid "" "To fill in *fmt*, execute ``fmt % part_info``, where ``part_info`` is a " "dictionary composed of the following keys and values:" msgstr "" +"*fmt* への埋め込みには ``fmt % part_info`` を使います。\n" +"``part_info`` は以下のキーと値からなる辞書です。" #: ../../library/email.generator.rst:254 msgid "``type`` -- Full MIME type of the non-\\ :mimetype:`text` part" @@ -313,14 +412,13 @@ msgid "" msgstr "" "``encoding`` -- 非 :mimetype:`text` 型 subpart の Content-transfer-encoding" -#: ../../library/email.generator.rst:266 msgid "If *fmt* is ``None``, use the following default *fmt*:" -msgstr "" +msgstr "*fmt* が ``None`` の場合、次のデフォルトの *fmt* を使います。" -#: ../../library/email.generator.rst:268 msgid "" "\"[Non-text (%(type)s) part of message omitted, filename %(filename)s]\"" msgstr "" +"\"[Non-text (%(type)s) part of message omitted, filename %(filename)s]\"" #: ../../library/email.generator.rst:270 msgid "" @@ -332,7 +430,6 @@ msgstr "" msgid "Footnotes" msgstr "脚注" -#: ../../library/email.generator.rst:276 msgid "" "This statement assumes that you use the appropriate setting for " "``unixfrom``, and that there are no :mod:`email.policy` settings calling for " @@ -343,3 +440,10 @@ msgid "" "parsing error recovery. It is a goal to fix these latter edge cases when " "possible." msgstr "" +"この説明は、``unixfrom`` が適切に設定され、:mod:`email.policy` に自動調整を要" +"求する設定がないことを前提としています (例えば :attr:`~email.policy." +"EmailPolicy.refold_source` は ``none`` でなければなりませんが、これはデフォル" +"トでは *ありません*)。\n" +"また、メッセージが RFC に準拠していないと、解析エラーからの回復中に元のテキス" +"トの正確な情報が失われることがあるため、常に成り立つわけでもありません。\n" +"このような例外的な場合は、可能な限り修正していくことを目指しています。" diff --git a/library/email.header.po b/library/email.header.po index f663e9450..12e6f8705 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -64,7 +64,6 @@ msgstr "" "ら発展したものです。 :rfc:`2822` は電子メールがすべて 7-bit ASCII 文字のみか" "ら構成されていると仮定して作られた仕様です。" -#: ../../library/email.header.rst:24 msgid "" "Of course, as email has been deployed worldwide, it has become " "internationalized, such that language specific character sets can now be " @@ -75,8 +74,16 @@ msgid "" "`2046`, :rfc:`2047`, and :rfc:`2231`. The :mod:`email` package supports " "these standards in its :mod:`!email.header` and :mod:`email.charset` modules." msgstr "" +"電子メールが世界中に普及するにつれ、国際化が進み、各言語固有の文字集合を電子" +"メールメッセージで使えるようになりました。\n" +"基本規格では今も 7 ビットの ASCII 文字だけでの転送が求められるため、非 ASCII " +"文字を含む電子メールを :rfc:`2822` に準拠する形式にエンコードする方法を定め" +"た RFC が多数書かれています。\n" +"これには :rfc:`2045`、:rfc:`2046`、:rfc:`2047`、:rfc:`2231` などがありま" +"す。\n" +":mod:`email` パッケージは :mod:`!email.header` と :mod:`email.charset` モ" +"ジュールでこれらの規格をサポートします。" -#: ../../library/email.header.rst:33 msgid "" "If you want to include non-ASCII characters in your email headers, say in " "the :mailheader:`Subject` or :mailheader:`To` fields, you should use the :" @@ -85,8 +92,14 @@ msgid "" "for the header value. Import the :class:`Header` class from the :mod:`!" "email.header` module. For example::" msgstr "" +":mailheader:`Subject` や :mailheader:`To` などの電子メールヘッダーに非 ASCII " +"文字を含めたい場合は、:class:`Header` クラスを使ってください。\n" +":class:`~email.message.Message` オブジェクトのフィールドには、文字列ではな" +"く :class:`Header` インスタンスをヘッダー値として代入します。\n" +":class:`Header` クラスは :mod:`!email.header` モジュールからインポートしてく" +"ださい。\n" +"例えば次のようにします。 ::" -#: ../../library/email.header.rst:40 msgid "" ">>> from email.message import Message\n" ">>> from email.header import Header\n" @@ -96,8 +109,14 @@ msgid "" ">>> msg.as_string()\n" "'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'" msgstr "" +">>> from email.message import Message\n" +">>> from email.header import Header\n" +">>> msg = Message()\n" +">>> h = Header('p\\xf6stal', 'iso-8859-1')\n" +">>> msg['Subject'] = h\n" +">>> msg.as_string()\n" +"'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'" -#: ../../library/email.header.rst:50 msgid "" "Notice here how we wanted the :mailheader:`Subject` field to contain a non-" "ASCII character? We did this by creating a :class:`Header` instance and " @@ -106,6 +125,13 @@ msgid "" "`Subject` field was properly :rfc:`2047` encoded. MIME-aware mail readers " "would show this header using the embedded ISO-8859-1 character." msgstr "" +"ここでは :mailheader:`Subject` フィールドに非 ASCII 文字を含めています。\n" +":class:`Header` インスタンスを作成し、エンコードに使う文字集合を渡すことで実" +"現しました。\n" +"その後 :class:`~email.message.Message` インスタンスをフラット化すると、:" +"mailheader:`Subject` フィールドは正しく :rfc:`2047` でエンコードされます。\n" +"MIME 対応のメールソフトでは、埋め込まれた ISO-8859-1 の文字を使ってこのヘッ" +"ダーが表示されます。" #: ../../library/email.header.rst:57 msgid "Here is the :class:`Header` class description:" @@ -297,7 +323,6 @@ msgstr "" ":class:`Header` クラスは、標準の演算子や組み込み関数をサポートするためのメ" "ソッドもいくつか提供しています。" -#: ../../library/email.header.rst:152 msgid "" "Returns an approximation of the :class:`Header` as a string, using an " "unlimited line length. All pieces are decoded using the specified encoding " @@ -305,6 +330,10 @@ msgid "" "``'unknown-8bit'`` are decoded as ASCII using the ``'replace'`` error " "handler." msgstr "" +":class:`Header` の内容に近い文字列を、行長の制限なしで返します。\n" +"すべての部分を指定されたエンコーディングでデコードし、適切に結合します。\n" +"文字セットが ``'unknown-8bit'`` の部分は、``'replace'`` エラーハンドラーを" +"使って ASCII としてデコードします。" #: ../../library/email.header.rst:158 msgid "Added handling for the ``'unknown-8bit'`` charset." @@ -325,11 +354,10 @@ msgstr "" "このメソッドは、ふたつの :class:`Header` インスタンスどうしが異なっているかど" "うかを判定するのに使えます。" -#: ../../library/email.header.rst:173 msgid "" "The :mod:`!email.header` module also provides the following convenient " "functions." -msgstr "" +msgstr ":mod:`!email.header` モジュールは、以下の便利な関数も提供します。" #: ../../library/email.header.rst:178 msgid "" @@ -339,46 +367,49 @@ msgstr "" "文字集合を変換せずにメッセージのヘッダをデコードします。ヘッダの値は " "*header* にあります。" -#: ../../library/email.header.rst:181 msgid "For historical reasons, this function may return either:" -msgstr "" +msgstr "歴史的な理由から、この関数は次のいずれかを返します。" -#: ../../library/email.header.rst:183 msgid "" "A list of pairs containing each of the decoded parts of the header, " "``(decoded_bytes, charset)``, where *decoded_bytes* is always an instance " "of :class:`bytes`, and *charset* is either:" msgstr "" +"ヘッダーの各部分をデコードした結果を含む ``(decoded_bytes, charset)`` ペアの" +"リスト。\n" +"*decoded_bytes* は常に :class:`bytes` インスタンスで、*charset* は次のいずれ" +"かです。" -#: ../../library/email.header.rst:187 msgid "A lower case string containing the name of the character set specified." -msgstr "" +msgstr "指定された文字集合の名前を含む小文字の文字列。" -#: ../../library/email.header.rst:189 msgid "``None`` for non-encoded parts of the header." -msgstr "" +msgstr "エンコードされていないヘッダー部分では ``None``。" -#: ../../library/email.header.rst:191 msgid "" "A list of length 1 containing a pair ``(string, None)``, where *string* is " "always an instance of :class:`str`." msgstr "" +"``(string, None)`` ペアを一つ含む長さ 1 のリスト。\n" +"*string* は常に :class:`str` インスタンスです。" -#: ../../library/email.header.rst:194 msgid "" "An :exc:`email.errors.HeaderParseError` may be raised when certain decoding " "errors occur (e.g. a base64 decoding exception)." msgstr "" +"一部のデコードエラー (base64 のデコード例外など) が起きると、:exc:`email." +"errors.HeaderParseError` が送出されることがあります。" -#: ../../library/email.header.rst:197 msgid "Here are examples:" -msgstr "" +msgstr "以下に例を示します。" -#: ../../library/email.header.rst:209 msgid "" "This function exists for backwards compatibility only. For new code, we " "recommend using :class:`email.headerregistry.HeaderRegistry`." msgstr "" +"この関数は後方互換性のためだけに存在します。\n" +"新しいコードでは :class:`email.headerregistry.HeaderRegistry` の使用を推奨し" +"ます。" #: ../../library/email.header.rst:215 msgid "" @@ -408,8 +439,8 @@ msgstr "" "省略可能な *maxlinelen*、*header_name*、*continuation_ws* は :class:`Header` " "コンストラクタと同じです。" -#: ../../library/email.header.rst:228 msgid "" "This function exists for backwards compatibility only, and is not " "recommended for use in new code." msgstr "" +"この関数は後方互換性のためだけに存在し、新しいコードでの使用は推奨しません。" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 61b7b974f..e4dada936 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.headerregistry.rst:2 msgid ":mod:`!email.headerregistry`: Custom Header Objects" -msgstr "" +msgstr ":mod:`!email.headerregistry`: カスタムヘッダーオブジェクト" #: ../../library/email.headerregistry.rst:7 msgid "**Source code:** :source:`Lib/email/headerregistry.py`" @@ -90,12 +89,15 @@ msgstr "" "class:`.HeaderRegistry` の動作を変更するための API、そして最後に構造化ヘッ" "ダーからパースされたデータを表現するためのサポートクラスについて説明します。" -#: ../../library/email.headerregistry.rst:41 msgid "" "*name* and *value* are passed to ``BaseHeader`` from the :attr:`~email." "policy.EmailPolicy.header_factory` call. The string value of any header " "object is the *value* fully decoded to a string." msgstr "" +"*name* と *value* は、:attr:`~email.policy.EmailPolicy.header_factory` の呼び" +"出しから ``BaseHeader`` に渡されます。\n" +"ヘッダーオブジェクトの文字列としての値は、*value* を完全にデコードした文字列" +"です。" #: ../../library/email.headerregistry.rst:45 msgid "This base class defines the following read-only properties:" @@ -175,11 +177,9 @@ msgstr "" "``parse`` という名前の :func:`classmethod` を特殊化されたクラスが提供すること" "を要求しています。このメソッドは以下のように呼び出されます::" -#: ../../library/email.headerregistry.rst:91 msgid "parse(string, kwds)" -msgstr "" +msgstr "parse(string, kwds)" -#: ../../library/email.headerregistry.rst:93 msgid "" "``kwds`` is a dictionary containing one pre-initialized key, ``defects``. " "``defects`` is an empty list. The parse method should append any detected " @@ -192,6 +192,17 @@ msgid "" "handle all valid Unicode characters as well so that it can parse un-encoded " "header values." msgstr "" +"``kwds`` は、あらかじめ初期化されたキー ``defects`` を一つ含む辞書です。\n" +"``defects`` の値は空のリストです。\n" +"``parse()`` メソッドは、検出した欠陥をこのリストに追加する必要があります。\n" +"戻る際には、``kwds`` 辞書に少なくとも ``decoded``、``defects``、" +"``parse_tree`` の各キーの値が *なければなりません*。\n" +"``decoded`` はヘッダーの文字列値、つまりヘッダー値を完全にデコードした文字列" +"にします。\n" +"``parse_tree`` には、ヘッダーを解析して得た構文木を設定します。\n" +"``parse()`` メソッドは、*string* にコンテンツ転送エンコーディングが適用された" +"部分が含まれる可能性を考慮するとともに、エンコードされていないヘッダー値も解" +"析できるよう、すべての有効な Unicode 文字を正しく扱う必要があります。" msgid "" "``BaseHeader``'s ``__new__`` then creates the header instance, and calls its " @@ -205,12 +216,14 @@ msgstr "" "``init`` メソッドを提供する必要があります。\n" "このような ``init`` メソッドは以下のようなものです。 ::" -#: ../../library/email.headerregistry.rst:108 msgid "" "def init(self, /, *args, **kw):\n" " self._myattr = kw.pop('myattr')\n" " super().init(*args, **kw)" msgstr "" +"def init(self, /, *args, **kw):\n" +" self._myattr = kw.pop('myattr')\n" +" super().init(*args, **kw)" msgid "" "That is, anything extra that the specialized class puts in to the ``kwds`` " @@ -232,7 +245,6 @@ msgstr "" "す。指定された構文を持たないすべてのヘッダは、unstructuredとして扱われます。 " "構造化されていないヘッダの典型的な例は :mailheader:`Subject` ヘッダです。" -#: ../../library/email.headerregistry.rst:124 msgid "" "In :rfc:`5322`, an unstructured header is a run of arbitrary text in the " "ASCII character set. :rfc:`2047`, however, has an :rfc:`5322` compatible " @@ -244,29 +256,39 @@ msgid "" "words. Defects are registered in such cases, as well as defects for issues " "such as invalid characters within the encoded words or the non-encoded text." msgstr "" +":rfc:`5322` では、非構造化ヘッダーは ASCII 文字集合による任意のテキストの並び" +"です。\n" +"ただし、:rfc:`2047` は、ヘッダー値の中で非 ASCII テキストを ASCII 文字にエン" +"コードする、:rfc:`5322` と互換性のある仕組みを定めています。\n" +"エンコードされた語を含む *value* がコンストラクタに渡されると、" +"``UnstructuredHeader`` のパーサーは、非構造化テキストに関する :rfc:`2047` の" +"規則に従ってそれらを文字列に変換します。\n" +"パーサーは、一部の規格に準拠しないエンコードされた語についても、ヒューリス" +"ティックによってデコードを試みます。\n" +"その場合には欠陥が記録されます。\n" +"エンコードされた語やエンコードされていないテキストに不正な文字がある場合など" +"も同様です。" #: ../../library/email.headerregistry.rst:134 msgid "This header type provides no additional attributes." msgstr "このヘッダ型には追加の属性はありません。" -#: ../../library/email.headerregistry.rst:139 msgid "" ":rfc:`5322` specifies a very specific format for dates within email headers. " "The ``DateHeader`` parser recognizes that date format, as well as " "recognizing a number of variant forms that are sometimes found \"in the " "wild\"." msgstr "" -":rfc:`5322` specifies a very specific format for dates within email headers. " -"The ``DateHeader`` parser recognizes that date format, as well as " -"recognizing a number of variant forms that are sometimes found \"in the " -"wild\"." +":rfc:`5322` は、電子メールヘッダー内の日付について厳密な形式を定めていま" +"す。\n" +"``DateHeader`` のパーサーはその形式に加え、実際のメールで見かけるさまざまな変" +"形も認識します。" #: ../../library/email.headerregistry.rst:144 #: ../../library/email.headerregistry.rst:186 msgid "This header type provides the following additional attributes:" msgstr "このヘッダ型は以下の属性も提供しています:" -#: ../../library/email.headerregistry.rst:148 msgid "" "If the header value can be recognized as a valid date of one form or " "another, this attribute will contain a :class:`~datetime.datetime` instance " @@ -277,6 +299,14 @@ msgid "" "then :attr:`.datetime` will contain an aware ``datetime`` that uses :class:" "`datetime.timezone` to record the timezone offset." msgstr "" +"ヘッダー値を何らかの有効な日付形式として認識できた場合、この属性にはその日時" +"を表す :class:`~datetime.datetime` インスタンスが入ります。\n" +"入力のタイムゾーンが ``-0000`` (UTC だが送信元のタイムゾーン情報はないことを" +"示します) の場合、:attr:`.datetime` は naive な :class:`~datetime.datetime` " +"になります。\n" +"``+0000`` を含む特定のタイムゾーンオフセットが見つかった場合、:attr:`." +"datetime` は :class:`datetime.timezone` でオフセットを記録した aware な " +"``datetime`` になります。" msgid "" "The ``decoded`` value of the header is determined by formatting the " @@ -286,9 +316,8 @@ msgstr "" "したものです。\n" "つまり、次のように設定されます。 ::" -#: ../../library/email.headerregistry.rst:161 msgid "email.utils.format_datetime(self.datetime)" -msgstr "" +msgstr "email.utils.format_datetime(self.datetime)" #: ../../library/email.headerregistry.rst:163 msgid "" @@ -300,9 +329,8 @@ msgstr "" "タンスである可能性があります。 これは、例えば、次のようなコードは有効であり、" "期待通りの動作をすることを意味します::" -#: ../../library/email.headerregistry.rst:167 msgid "msg['Date'] = datetime(2011, 7, 15, 21)" -msgstr "" +msgstr "msg['Date'] = datetime(2011, 7, 15, 21)" msgid "" "Because this is a naive ``datetime`` it will be interpreted as a UTC " @@ -315,9 +343,8 @@ msgstr "" "もっと便利なのは :mod:`~email.utils` モジュールの :func:`~email.utils." "localtime` 関数を使用することです。 ::" -#: ../../library/email.headerregistry.rst:174 msgid "msg['Date'] = utils.localtime()" -msgstr "" +msgstr "msg['Date'] = utils.localtime()" #: ../../library/email.headerregistry.rst:176 msgid "" @@ -368,7 +395,6 @@ msgid "" "class:`str` value of the elements of the ``groups`` attribute with ``', '``." msgstr "" -#: ../../library/email.headerregistry.rst:211 msgid "" "A list of :class:`.Address` and :class:`.Group` objects in any combination " "may be used to set the value of an address header. ``Group`` objects whose " @@ -376,28 +402,38 @@ msgid "" "allows an address list to be copied with groups intact by using the list " "obtained from the ``groups`` attribute of the source header." msgstr "" +"アドレスヘッダーの値の設定には、:class:`.Address` と :class:`.Group` オブジェ" +"クトを自由に組み合わせたリストを使えます。\n" +"``display_name`` が ``None`` の ``Group`` オブジェクトは単独のアドレスとして" +"解釈されます。\n" +"このため、元のヘッダーの ``groups`` 属性から得たリストを使えば、グループを保" +"持したままアドレス一覧をコピーできます。" #: ../../library/email.headerregistry.rst:220 msgid "" "A subclass of :class:`.AddressHeader` that adds one additional attribute:" msgstr "追加の属性を 1 つ持つ、:class:`.AddressHeader` の派生クラスです:" -#: ../../library/email.headerregistry.rst:226 msgid "" "The single address encoded by the header value. If the header value " "actually contains more than one address (which would be a violation of the " "RFC under the default :mod:`~email.policy`), accessing this attribute will " "result in a :exc:`ValueError`." msgstr "" +"ヘッダー値で表された単一のアドレスです。\n" +"ヘッダー値に複数のアドレスが含まれる場合 (デフォルトの :mod:`~email.policy` " +"では RFC 違反です)、この属性にアクセスすると :exc:`ValueError` が発生します。" -#: ../../library/email.headerregistry.rst:232 msgid "" "Many of the above classes also have a ``Unique`` variant (for example, " "``UniqueUnstructuredHeader``). The only difference is that in the " "``Unique`` variant, :attr:`~.BaseHeader.max_count` is set to 1." msgstr "" +"上記のクラスの多くには、``Unique`` 版もあります (例えば " +"``UniqueUnstructuredHeader``)。\n" +"違いは、``Unique`` 版では :attr:`~.BaseHeader.max_count` が 1 に設定されるこ" +"とだけです。" -#: ../../library/email.headerregistry.rst:239 msgid "" "There is really only one valid value for the :mailheader:`MIME-Version` " "header, and that is ``1.0``. For future proofing, this header class " @@ -405,6 +441,10 @@ msgid "" "per :rfc:`2045`, then the header object will have non-``None`` values for " "the following attributes:" msgstr "" +":mailheader:`MIME-Version` ヘッダーの有効な値は実際には ``1.0`` だけです。\n" +"将来に備え、このヘッダークラスは他の有効なバージョン番号もサポートします。\n" +"バージョン番号が :rfc:`2045` に照らして有効であれば、ヘッダーオブジェクトの以" +"下の属性は ``None`` 以外の値になります。" #: ../../library/email.headerregistry.rst:247 msgid "" @@ -419,22 +459,24 @@ msgstr "メジャーバージョン番号 (整数)" msgid "The minor version number as an integer" msgstr "マイナーバージョン番号 (整数)" -#: ../../library/email.headerregistry.rst:261 msgid "" "MIME headers all start with the prefix 'Content-'. Each specific header has " "a certain value, described under the class for that header. Some can also " "take a list of supplemental parameters, which have a common format. This " "class serves as a base for all the MIME headers that take parameters." msgstr "" +"MIME ヘッダーはすべて接頭辞 ``Content-`` で始まります。\n" +"各ヘッダーにはそれぞれの値があり、対応するクラスの説明に記載されています。\n" +"また、共通形式の補助パラメータの一覧を持てるものもあります。\n" +"このクラスは、パラメータを持つすべての MIME ヘッダーの基底クラスです。" -#: ../../library/email.headerregistry.rst:268 msgid "A dictionary mapping parameter names to parameter values." -msgstr "" +msgstr "パラメータ名をパラメータ値に対応付ける辞書です。" -#: ../../library/email.headerregistry.rst:270 msgid "" "It is now a :class:`frozendict` instead of a :class:`types.MappingProxyType`." msgstr "" +":class:`types.MappingProxyType` ではなく :class:`frozendict` になりました。" #: ../../library/email.headerregistry.rst:277 msgid "" @@ -444,9 +486,8 @@ msgstr "" ":mailheader:`Content-Type` ヘッダを扱う :class:`ParameterizedMIMEHeader` クラ" "スです。" -#: ../../library/email.headerregistry.rst:282 msgid "The content type string, in the form ``maintype/subtype``." -msgstr "" +msgstr "``maintype/subtype`` 形式のコンテントタイプ文字列。" #: ../../library/email.headerregistry.rst:291 msgid "" @@ -456,9 +497,8 @@ msgstr "" ":mailheader:`Content-Disposition` ヘッダを扱う :class:" "`ParameterizedMIMEHeader` クラスです。" -#: ../../library/email.headerregistry.rst:296 msgid "``inline`` and ``attachment`` are the only valid values in common use." -msgstr "" +msgstr "一般的に使われる有効な値は ``inline`` と ``attachment`` だけです。" #: ../../library/email.headerregistry.rst:301 msgid "Handles the :mailheader:`Content-Transfer-Encoding` header." @@ -472,7 +512,6 @@ msgstr "" "有効な値は ``7bit``、``8bit``、``base64``、``quoted-printable`` です。詳細に" "ついては :rfc:`2045` を参照してください。" -#: ../../library/email.headerregistry.rst:314 msgid "" "This is the factory used by :class:`~email.policy.EmailPolicy` by default. " "``HeaderRegistry`` builds the class used to create a header instance " @@ -484,6 +523,16 @@ msgid "" "initialization. *base_class* is always the last class in the generated " "class's :class:`~type.__bases__` list." msgstr "" +"これは :class:`~email.policy.EmailPolicy` がデフォルトで使うファクトリで" +"す。\n" +"``HeaderRegistry`` は、*base_class* と自身のレジストリから取得した専用クラス" +"を使って、ヘッダーインスタンスを作成するためのクラスを動的に構築します。\n" +"ヘッダー名がレジストリにない場合、*default_class* で指定されたクラスを専用ク" +"ラスとして使います。\n" +"*use_default_map* が ``True`` (デフォルト) の場合、初期化時にヘッダー名からク" +"ラスへの標準の対応付けをレジストリにコピーします。\n" +"*base_class* は常に、生成されたクラスの :class:`~type.__bases__` 一覧の最後の" +"クラスになります。" #: ../../library/email.headerregistry.rst:324 msgid "The default mappings are:" @@ -526,9 +575,8 @@ msgstr "sender" msgid "UniqueSingleAddressHeader" msgstr "UniqueSingleAddressHeader" -#: ../../library/email.headerregistry.rst:0 msgid "resent-sender" -msgstr "" +msgstr "resent-sender" #: ../../library/email.headerregistry.rst:331 msgid "SingleAddressHeader" @@ -565,13 +613,11 @@ msgstr "cc" msgid "resent-cc" msgstr "resent-cc" -#: ../../library/email.headerregistry.rst:0 msgid "bcc" -msgstr "" +msgstr "bcc" -#: ../../library/email.headerregistry.rst:0 msgid "resent-bcc" -msgstr "" +msgstr "resent-bcc" #: ../../library/email.headerregistry.rst:0 msgid "from" @@ -585,63 +631,54 @@ msgstr "resent-from" msgid "reply-to" msgstr "reply-to" -#: ../../library/email.headerregistry.rst:0 msgid "mime-version" -msgstr "" +msgstr "mime-version" -#: ../../library/email.headerregistry.rst:341 msgid "MIMEVersionHeader" -msgstr "" +msgstr "MIMEVersionHeader" -#: ../../library/email.headerregistry.rst:0 msgid "content-type" -msgstr "" +msgstr "content-type" -#: ../../library/email.headerregistry.rst:342 msgid "ContentTypeHeader" -msgstr "" +msgstr "ContentTypeHeader" -#: ../../library/email.headerregistry.rst:0 msgid "content-disposition" -msgstr "" +msgstr "content-disposition" -#: ../../library/email.headerregistry.rst:343 msgid "ContentDispositionHeader" -msgstr "" +msgstr "ContentDispositionHeader" -#: ../../library/email.headerregistry.rst:0 msgid "content-transfer-encoding" -msgstr "" +msgstr "content-transfer-encoding" -#: ../../library/email.headerregistry.rst:344 msgid "ContentTransferEncodingHeader" -msgstr "" +msgstr "ContentTransferEncodingHeader" -#: ../../library/email.headerregistry.rst:0 msgid "message-id" -msgstr "" +msgstr "message-id" -#: ../../library/email.headerregistry.rst:345 msgid "MessageIDHeader" -msgstr "" +msgstr "MessageIDHeader" #: ../../library/email.headerregistry.rst:347 msgid "``HeaderRegistry`` has the following methods:" msgstr "``HeaderRegistry`` には以下のメソッドがあります:" -#: ../../library/email.headerregistry.rst:352 msgid "" "*name* is the name of the header to be mapped. It will be converted to " "lower case in the registry. *cls* is the specialized class to be used, " "along with *base_class*, to create the class used to instantiate headers " "that match *name*." msgstr "" +"*name* は対応付けるヘッダーの名前です。\n" +"レジストリ内では小文字に変換されます。\n" +"*cls* は専用クラスで、*base_class* と組み合わせて、*name* に一致するヘッダー" +"をインスタンス化するクラスの作成に使われます。" -#: ../../library/email.headerregistry.rst:360 msgid "Construct and return a class to handle creating a *name* header." -msgstr "" +msgstr "*name* ヘッダーの作成を担当するクラスを構築して返します。" -#: ../../library/email.headerregistry.rst:365 msgid "" "Retrieves the specialized header associated with *name* from the registry " "(using *default_class* if *name* does not appear in the registry) and " @@ -649,13 +686,19 @@ msgid "" "class's constructor, passing it the same argument list, and finally returns " "the class instance created thereby." msgstr "" +"*name* に関連付けられた専用ヘッダークラスをレジストリから取得します (*name* " +"がレジストリになければ *default_class* を使います)。\n" +"それを *base_class* と組み合わせてクラスを作成し、同じ引数リストを渡してその" +"コンストラクタを呼び出し、生成されたインスタンスを返します。" -#: ../../library/email.headerregistry.rst:372 msgid "" "The following classes are the classes used to represent data parsed from " "structured headers and can, in general, be used by an application program to " "construct structured values to assign to specific headers." msgstr "" +"以下のクラスは、構造化ヘッダーから解析したデータの表現に使われます。\n" +"通常、アプリケーションからも、特定のヘッダーに代入する構造化された値の作成に" +"使えます。" #: ../../library/email.headerregistry.rst:379 msgid "" @@ -665,25 +708,21 @@ msgstr "" "このクラスは電子メールのアドレスを表すのに使われます。アドレスの一般的な形式" "は::" -#: ../../library/email.headerregistry.rst:382 msgid "[display_name] " -msgstr "" +msgstr "[display_name] " #: ../../library/email.headerregistry.rst:384 msgid "or::" msgstr "もしくは::" -#: ../../library/email.headerregistry.rst:386 msgid "username@domain" -msgstr "" +msgstr "username@domain" -#: ../../library/email.headerregistry.rst:388 msgid "" "where each part must conform to specific syntax rules spelled out in :rfc:" "`5322`." -msgstr "" +msgstr "各部分は :rfc:`5322` で定められた構文規則に従う必要があります。" -#: ../../library/email.headerregistry.rst:391 msgid "" "As a convenience *addr_spec* can be specified instead of *username* and " "*domain*, in which case *username* and *domain* will be parsed from the " @@ -692,13 +731,22 @@ msgid "" "will be property encoded when serialized. However, per the RFCs, Unicode is " "*not* allowed in the username portion of the address." msgstr "" +"便利な方法として、*username* と *domain* の代わりに *addr_spec* を指定できま" +"す。\n" +"この場合、*username* と *domain* は *addr_spec* から解析されます。\n" +"*addr_spec* は RFC に従って正しく引用符を付けた文字列でなければならず、そうで" +"なければ ``Address`` はエラーを送出します。\n" +"Unicode 文字も使用でき、直列化時に適切にエンコードされます。\n" +"ただし、RFC に従い、アドレスのユーザー名部分では Unicode は許可 *されません" +"*。" -#: ../../library/email.headerregistry.rst:400 msgid "" "The display name portion of the address, if any, with all quoting removed. " "If the address does not have a display name, this attribute will be an empty " "string." msgstr "" +"アドレスの表示名部分で、引用符はすべて取り除かれます。\n" +"アドレスに表示名がなければ、空文字列になります。" #: ../../library/email.headerregistry.rst:406 msgid "The ``username`` portion of the address, with all quoting removed." @@ -708,25 +756,31 @@ msgstr "アドレスの ``username`` 部分、クォートは取り除かれま msgid "The ``domain`` portion of the address." msgstr "アドレスの ``domain`` 部分。" -#: ../../library/email.headerregistry.rst:414 msgid "" "The ``username@domain`` portion of the address, correctly quoted for use as " "a bare address (the second form shown above). This attribute is not mutable." msgstr "" +"アドレスの ``username@domain`` 部分で、表示名のないアドレス (上記の 2 番目の" +"形式) として使えるよう正しく引用符が付けられます。\n" +"この属性は変更できません。" -#: ../../library/email.headerregistry.rst:420 msgid "" "The ``str`` value of the object is the address quoted according to :rfc:" "`5322` rules, but with no Content Transfer Encoding of any non-ASCII " "characters." msgstr "" +"オブジェクトの ``str`` 値は、:rfc:`5322` の規則に従って引用符を付けたアドレス" +"ですが、非 ASCII 文字にコンテンツ転送エンコーディングは適用されません。" -#: ../../library/email.headerregistry.rst:424 msgid "" "To support SMTP (:rfc:`5321`), ``Address`` handles one special case: if " "``username`` and ``domain`` are both the empty string (or ``None``), then " "the string value of the ``Address`` is ``<>``." msgstr "" +"SMTP (:rfc:`5321`) をサポートするため、``Address`` は一つの特殊な場合を扱いま" +"す。\n" +"``username`` と ``domain`` が両方とも空文字列 (または ``None``) の場合、" +"``Address`` の文字列値は ``<>`` になります。" #: ../../library/email.headerregistry.rst:431 msgid "" @@ -736,32 +790,36 @@ msgstr "" "このクラスはアドレスグループを表すのに使われます。アドレスグループの一般的な" "形式は::" -#: ../../library/email.headerregistry.rst:434 msgid "display_name: [address-list];" -msgstr "" +msgstr "display_name: [address-list];" -#: ../../library/email.headerregistry.rst:436 msgid "" "As a convenience for processing lists of addresses that consist of a mixture " "of groups and single addresses, a ``Group`` may also be used to represent " "single addresses that are not part of a group by setting *display_name* to " "``None`` and providing a list of the single address as *addresses*." msgstr "" +"グループと単独のアドレスが混在する一覧を扱いやすくするため、``Group`` でグ" +"ループに属さない単独のアドレスを表すこともできます。\n" +"その場合、*display_name* を ``None`` にし、*addresses* にそのアドレスだけを含" +"むリストを渡します。" -#: ../../library/email.headerregistry.rst:443 msgid "" "The ``display_name`` of the group. If it is ``None`` and there is exactly " "one ``Address`` in ``addresses``, then the ``Group`` represents a single " "address that is not in a group." msgstr "" +"グループの ``display_name`` です。\n" +"値が ``None`` で、``addresses`` に ``Address`` がちょうど一つある場合、その " +"``Group`` はグループに属さない単独のアドレスを表します。" -#: ../../library/email.headerregistry.rst:449 msgid "" "A possibly empty tuple of :class:`.Address` objects representing the " "addresses in the group." msgstr "" +"グループ内のアドレスを表す :class:`.Address` オブジェクトのタプルです。\n" +"空の場合もあります。" -#: ../../library/email.headerregistry.rst:454 msgid "" "The ``str`` value of a ``Group`` is formatted according to :rfc:`5322`, but " "with no Content Transfer Encoding of any non-ASCII characters. If " @@ -769,12 +827,17 @@ msgid "" "``addresses`` list, the ``str`` value will be the same as the ``str`` of " "that single ``Address``." msgstr "" +"``Group`` の ``str`` 値は :rfc:`5322` に従って書式化されますが、非 ASCII 文字" +"にコンテンツ転送エンコーディングは適用されません。\n" +"``display_name`` が ``None`` で、``addresses`` リストに ``Address`` が一つだ" +"けある場合、``str`` 値はその ``Address`` の ``str`` 値と同じになります。" #: ../../library/email.headerregistry.rst:462 msgid "Footnotes" msgstr "脚注" -#: ../../library/email.headerregistry.rst:463 msgid "" "Originally added in 3.3 as a :term:`provisional module `" msgstr "" +"当初は 3.3 で :term:`暫定モジュール ` として追加されまし" +"た。" diff --git a/library/email.iterators.po b/library/email.iterators.po index 5377a24be..d760b27bf 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -30,13 +30,16 @@ msgstr ":mod:`!email.iterators`: イテレータ" msgid "**Source code:** :source:`Lib/email/iterators.py`" msgstr "**ソースコード:** :source:`Lib/email/iterators.py`" -#: ../../library/email.iterators.rst:11 msgid "" "Iterating over a message object tree is fairly easy with the :meth:`Message." "walk ` method. The :mod:`!email.iterators` " "module provides some useful higher level iterations over message object " "trees." msgstr "" +":meth:`Message.walk ` を使うと、メッセージオブ" +"ジェクトのツリーを簡単に反復処理できます。\n" +":mod:`!email.iterators` モジュールは、メッセージオブジェクトのツリーに対する" +"便利な高水準の反復処理を提供します。" #: ../../library/email.iterators.rst:19 msgid "" @@ -104,7 +107,6 @@ msgstr "" "そのメッセージオブジェクト構造の content-type をインデントつきで表示します。" "例えば:" -#: ../../library/email.iterators.rst:57 msgid "" ">>> msg = email.message_from_file(somefile)\n" ">>> _structure(msg)\n" @@ -124,6 +126,23 @@ msgid "" " text/plain\n" " text/plain" msgstr "" +">>> msg = email.message_from_file(somefile)\n" +">>> _structure(msg)\n" +"multipart/mixed\n" +" text/plain\n" +" text/plain\n" +" multipart/digest\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" text/plain" #: ../../library/email.iterators.rst:81 msgid "" diff --git a/library/email.message.po b/library/email.message.po index 6a1a29fff..51fc9e214 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.message.rst:2 msgid ":mod:`!email.message`: Representing an email message" -msgstr "" +msgstr ":mod:`!email.message`: 電子メールメッセージの表現" #: ../../library/email.message.rst:7 msgid "**Source code:** :source:`Lib/email/message.py`" @@ -34,7 +33,6 @@ msgstr "**ソースコード:** :source:`Lib/email/message.py`" msgid "[1]_" msgstr "[1]_" -#: ../../library/email.message.rst:13 msgid "" "The central class in the :mod:`email` package is the :class:`EmailMessage` " "class, imported from the :mod:`!email.message` module. It is the base class " @@ -42,8 +40,12 @@ msgid "" "functionality for setting and querying header fields, for accessing message " "bodies, and for creating or modifying structured messages." msgstr "" +":mod:`email` パッケージの中心となるクラスは、:mod:`!email.message` モジュール" +"からインポートする :class:`EmailMessage` です。\n" +"これは :mod:`email` のオブジェクトモデルの基底クラスです。\n" +":class:`EmailMessage` は、ヘッダーフィールドの設定と参照、メッセージ本体への" +"アクセス、構造化されたメッセージの作成や変更に関する中核の機能を提供します。" -#: ../../library/email.message.rst:19 msgid "" "An email message consists of *headers* and a *payload* (which is also " "referred to as the *content*). Headers are :rfc:`5322` or :rfc:`6532` style " @@ -55,8 +57,17 @@ msgid "" "having a MIME type such as :mimetype:`multipart/\\*` or :mimetype:`message/" "rfc822`." msgstr "" +"電子メールメッセージは *ヘッダー* と *ペイロード* (*コンテンツ* とも呼ばれま" +"す) からなります。\n" +"ヘッダーは :rfc:`5322` または :rfc:`6532` 形式のフィールド名と値で、両者はコ" +"ロンで区切られます。\n" +"コロンはフィールド名にも値にも含まれません。\n" +"ペイロードには、単純なテキストメッセージ、バイナリオブジェクト、または各々が" +"独自のヘッダーとペイロードを持つサブメッセージを構造化して並べたものを使えま" +"す。\n" +"最後の形式のペイロードは、メッセージの MIME 型が :mimetype:`multipart/\\*` " +"や :mimetype:`message/rfc822` などの場合に使われます。" -#: ../../library/email.message.rst:28 msgid "" "The conceptual model provided by an :class:`EmailMessage` object is that of " "an ordered dictionary of headers coupled with a *payload* that represents " @@ -67,8 +78,14 @@ msgid "" "type), for operating on the payload, for generating a serialized version of " "the message, and for recursively walking over the object tree." msgstr "" +":class:`EmailMessage` オブジェクトは概念的には、ヘッダーの順序付き辞書と、:" +"rfc:`5322` のメッセージ本体を表す *ペイロード* を組み合わせたものです。\n" +"ペイロードはサブメッセージの ``EmailMessage`` オブジェクトのリストになること" +"もあります。\n" +"ヘッダーの名前と値にアクセスする通常の辞書メソッドに加え、MIME コンテントタイ" +"プなどのヘッダーの特定の情報へのアクセス、ペイロードの操作、メッセージの直列" +"化、オブジェクトツリーの再帰的な巡回のためのメソッドがあります。" -#: ../../library/email.message.rst:37 msgid "" "The :class:`EmailMessage` dictionary-like interface is indexed by the header " "names, which must be ASCII values. The values of the dictionary are strings " @@ -77,16 +94,25 @@ msgid "" "but unlike a real dict, there can be duplicates. Additional methods are " "provided for working with headers that have duplicate keys." msgstr "" +":class:`EmailMessage` の辞書に似たインターフェースは、ASCII 値でなければなら" +"ないヘッダー名をキーとします。\n" +"辞書の値は、追加のメソッドを持つ文字列です。\n" +"ヘッダーの格納時と取得時には大文字・小文字が保持されますが、フィールド名の照" +"合では区別されません。\n" +"キーには順序がありますが、通常の辞書と異なり重複できます。\n" +"キーが重複するヘッダーを扱うための追加のメソッドも用意されています。" -#: ../../library/email.message.rst:44 msgid "" "The *payload* is either a string or bytes object, in the case of simple " "message objects, or a list of :class:`EmailMessage` objects, for MIME " "container documents such as :mimetype:`multipart/\\*` and :mimetype:`message/" "rfc822` message objects." msgstr "" +"*ペイロード* は、単純なメッセージオブジェクトでは文字列または bytes オブジェ" +"クトです。\n" +":mimetype:`multipart/\\*` や :mimetype:`message/rfc822` などの MIME コンテナ" +"文書では、:class:`EmailMessage` オブジェクトのリストです。" -#: ../../library/email.message.rst:52 msgid "" "If *policy* is specified use the rules it specifies to update and serialize " "the representation of the message. If *policy* is not set, use the :class:" @@ -95,8 +121,13 @@ msgid "" "Python standard ``\\n`` line endings). For more information see the :mod:" "`~email.policy` documentation. [2]_" msgstr "" +"*policy* が指定されていれば、その規則に従ってメッセージの表現を更新し、直列化" +"します。\n" +"指定されていなければ :class:`~email.policy.default` ポリシーを使います。\n" +"このポリシーは電子メールの RFC の規則に従いますが、行末だけは RFC が要求する " +"``\\r\\n`` の代わりに Python 標準の ``\\n`` を使います。\n" +"詳しくは :mod:`~email.policy` のドキュメントを参照してください。[2]_" -#: ../../library/email.message.rst:61 msgid "" "Return the entire message flattened as a string. When optional *unixfrom* " "is true, the envelope header is included in the returned string. *unixfrom* " @@ -109,6 +140,18 @@ msgid "" "produced by the method, since the specified *policy* will be passed to the :" "class:`~email.generator.Generator`." msgstr "" +"メッセージ全体をフラット化した文字列を返します。\n" +"オプションの *unixfrom* が真の場合、戻り値にはエンベロープヘッダーが含まれま" +"す。\n" +"*unixfrom* のデフォルトは ``False`` です。\n" +"基底クラス :class:`~email.message.Message` との後方互換性のため " +"*maxheaderlen* を受け取りますが、デフォルトは ``None`` です。\n" +"したがって、デフォルトではポリシーの :attr:`~email.policy.Policy." +"max_line_length` が行長を制御します。\n" +"*policy* 引数で、メッセージインスタンスから取得するデフォルトのポリシーを上書" +"きできます。\n" +"指定した *policy* は :class:`~email.generator.Generator` に渡されるため、メ" +"ソッドが生成する書式の一部を制御できます。" #: ../../library/email.message.rst:73 ../../library/email.message.rst:111 msgid "" @@ -120,7 +163,6 @@ msgstr "" "メッセージのフラット化は :class:`EmailMessage` の変更を引き起こす可能性があり" "ます (例えば、MIME の境界が生成される、変更される等)。" -#: ../../library/email.message.rst:77 msgid "" "Note that this method is provided as a convenience and may not be the most " "useful way to serialize messages in your application, especially if you are " @@ -129,29 +171,39 @@ msgid "" "restricted to producing messages serialized as \"7 bit clean\" when :attr:" "`~email.policy.EmailPolicy.utf8` is ``False``, which is the default." msgstr "" +"このメソッドは便利な補助機能として提供されており、特に複数のメッセージを扱う" +"場合には、アプリケーションに最適な直列化方法とは限りません。\n" +"より柔軟な直列化 API については :class:`email.generator.Generator` を参照して" +"ください。\n" +"また、:attr:`~email.policy.EmailPolicy.utf8` が ``False`` (デフォルト) の場" +"合、このメソッドが生成できるのは 7 ビットだけを使う形式に直列化されたメッセー" +"ジに限られます。" -#: ../../library/email.message.rst:85 msgid "" "the default behavior when *maxheaderlen* is not specified was changed from " "defaulting to 0 to defaulting to the value of *max_line_length* from the " "policy." msgstr "" +"*maxheaderlen* を指定しない場合のデフォルトの動作が、値 0 を使う動作から、ポ" +"リシーの *max_line_length* の値を使う動作に変わりました。" -#: ../../library/email.message.rst:92 msgid "" "Equivalent to ``as_string(policy=self.policy.clone(utf8=True))``. Allows " "``str(msg)`` to produce a string containing the serialized message in a " "readable format." msgstr "" +"``as_string(policy=self.policy.clone(utf8=True))`` と同じです。\n" +"``str(msg)`` で、読みやすい形式に直列化されたメッセージを含む文字列を生成でき" +"るようにします。" -#: ../../library/email.message.rst:96 msgid "" "the method was changed to use ``utf8=True``, thus producing an :rfc:`6531`-" "like message representation, instead of being a direct alias for :meth:" "`as_string`." msgstr "" +":meth:`as_string` の単なる別名ではなく、``utf8=True`` を使って :rfc:`6531` に" +"似たメッセージ表現を生成するように変わりました。" -#: ../../library/email.message.rst:103 msgid "" "Return the entire message flattened as a bytes object. When optional " "*unixfrom* is true, the envelope header is included in the returned string. " @@ -161,22 +213,34 @@ msgid "" "specified *policy* will be passed to the :class:`~email.generator." "BytesGenerator`." msgstr "" +"メッセージ全体をフラット化した bytes オブジェクトを返します。\n" +"オプションの *unixfrom* が真の場合、戻り値にはエンベロープヘッダーが含まれま" +"す。\n" +"*unixfrom* のデフォルトは ``False`` です。\n" +"*policy* 引数で、メッセージインスタンスから取得するデフォルトのポリシーを上書" +"きできます。\n" +"指定した *policy* は :class:`~email.generator.BytesGenerator` に渡されるた" +"め、メソッドが生成する書式の一部を制御できます。" -#: ../../library/email.message.rst:115 msgid "" "Note that this method is provided as a convenience and may not be the most " "useful way to serialize messages in your application, especially if you are " "dealing with multiple messages. See :class:`email.generator.BytesGenerator` " "for a more flexible API for serializing messages." msgstr "" +"このメソッドは便利な補助機能として提供されており、特に複数のメッセージを扱う" +"場合には、アプリケーションに最適な直列化方法とは限りません。\n" +"より柔軟な直列化 API については :class:`email.generator.BytesGenerator` を参" +"照してください。" -#: ../../library/email.message.rst:124 msgid "" "Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " "object containing the serialized message." msgstr "" +":meth:`.as_bytes` と同じです。\n" +"``bytes(msg)`` で、直列化されたメッセージを含む bytes オブジェクトを生成でき" +"るようにします。" -#: ../../library/email.message.rst:130 msgid "" "Return ``True`` if the message's payload is a list of sub-\\ :class:" "`EmailMessage` objects, otherwise return ``False``. When :meth:" @@ -187,12 +251,23 @@ msgid "" "example, ``is_multipart`` will return ``True`` when the :class:" "`EmailMessage` is of type ``message/rfc822``." msgstr "" +"メッセージのペイロードがサブメッセージの :class:`EmailMessage` オブジェクトの" +"リストなら ``True`` を、それ以外なら ``False`` を返します。\n" +":meth:`is_multipart` が ``False`` を返す場合、ペイロードは文字列オブジェクト" +"のはずです (CTE でエンコードされたバイナリのペイロードの場合もあります)。\n" +":meth:`is_multipart` が ``True`` を返しても、``msg.get_content_maintype() == " +"'multipart'`` が ``True`` を返すとは限りません。\n" +"例えば、:class:`EmailMessage` の型が ``message/rfc822`` の場合も " +"``is_multipart()`` は ``True`` を返します。" -#: ../../library/email.message.rst:142 msgid "" "Set the message's envelope header to *unixfrom*, which should be a string. " "(See :class:`~mailbox.mboxMessage` for a brief description of this header.)" msgstr "" +"メッセージのエンベロープヘッダーを *unixfrom* に設定します。\n" +"*unixfrom* は文字列でなければなりません。\n" +"(このヘッダーの簡単な説明は :class:`~mailbox.mboxMessage` を参照してくださ" +"い。)" #: ../../library/email.message.rst:149 msgid "" @@ -216,11 +291,12 @@ msgid "" "list." msgstr "" -#: ../../library/email.message.rst:164 msgid "" "These semantic differences are intentional and are biased toward convenience " "in the most common use cases." msgstr "" +"このような意味の違いは意図的なもので、一般的な用途で便利になるように設計され" +"ています。" #: ../../library/email.message.rst:167 msgid "" @@ -234,39 +310,50 @@ msgstr "" msgid "Return the total number of headers, including duplicates." msgstr "複製されたものもふくめてヘッダ数の合計を返します。" -#: ../../library/email.message.rst:178 msgid "" "Return ``True`` if the message object has a field named *name*. Matching is " "done without regard to case and *name* does not include the trailing colon. " "Used for the ``in`` operator. For example::" msgstr "" +"メッセージオブジェクトに *name* という名前のフィールドがあれば ``True`` を返" +"します。\n" +"照合では大文字・小文字を区別せず、*name* に末尾のコロンは含めません。\n" +"``in`` 演算子で使われます。\n" +"例えば次のようにします。 ::" -#: ../../library/email.message.rst:182 msgid "" "if 'message-id' in myMessage:\n" " print('Message-ID:', myMessage['message-id'])" msgstr "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" -#: ../../library/email.message.rst:188 msgid "" "Return the value of the named header field. *name* does not include the " "colon field separator. If the header is missing, ``None`` is returned; a :" "exc:`KeyError` is never raised." msgstr "" +"指定した名前のヘッダーフィールドの値を返します。\n" +"*name* にフィールド区切りのコロンは含めません。\n" +"ヘッダーがなければ ``None`` を返し、:exc:`KeyError` は送出しません。" -#: ../../library/email.message.rst:192 msgid "" "Note that if the named field appears more than once in the message's " "headers, exactly which of those field values will be returned is undefined. " "Use the :meth:`get_all` method to get the values of all the extant headers " "named *name*." msgstr "" +"指定した名前のフィールドがメッセージのヘッダーに複数ある場合、どの値を返すか" +"は未定義です。\n" +"*name* という名前の既存のヘッダーの値をすべて取得するには、:meth:`get_all` を" +"使ってください。" -#: ../../library/email.message.rst:197 msgid "" "Using the standard (non-``compat32``) policies, the returned value is an " "instance of a subclass of :class:`email.headerregistry.BaseHeader`." msgstr "" +"標準の (``compat32`` 以外の) ポリシーでは、戻り値は :class:`email." +"headerregistry.BaseHeader` のサブクラスのインスタンスです。" #: ../../library/email.message.rst:203 msgid "" @@ -287,13 +374,13 @@ msgstr "" "せん*。もしメッセージが名前 *name* をもつフィールドをひとつしか持たないように" "したければ、最初にそれを除去してください。たとえば::" -#: ../../library/email.message.rst:210 msgid "" "del msg['subject']\n" "msg['subject'] = 'Python roolz!'" msgstr "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" -#: ../../library/email.message.rst:213 msgid "" "If the :mod:`policy ` defines certain headers to be unique (as " "the standard policies do), this method may raise a :exc:`ValueError` when an " @@ -302,6 +389,12 @@ msgid "" "as we may choose to make such assignments do an automatic deletion of the " "existing header in the future." msgstr "" +"標準のポリシーのように、:mod:`ポリシー ` が特定のヘッダーを一つ" +"しか許さないと定めている場合、そのヘッダーがすでにある状態で値を代入しようと" +"すると、このメソッドは :exc:`ValueError` を送出することがあります。\n" +"一貫性を保つための意図的な動作ですが、将来はこのような代入で既存のヘッダーを" +"自動的に削除するよう変更する可能性があるため、この動作に依存しないでくださ" +"い。" #: ../../library/email.message.rst:223 msgid "" @@ -328,16 +421,17 @@ msgstr "" "メッセージ中にあるすべてのヘッダのフィールド名とその値を 2-タプルのリストとし" "て返します。" -#: ../../library/email.message.rst:246 msgid "" "Return the value of the named header field. This is identical to :meth:" "`~object.__getitem__` except that optional *failobj* is returned if the " "named header is missing (*failobj* defaults to ``None``)." msgstr "" +"指定した名前のヘッダーフィールドの値を返します。\n" +":meth:`~object.__getitem__` と同じですが、ヘッダーがない場合にオプションの " +"*failobj* (デフォルトは ``None``) を返す点が異なります。" -#: ../../library/email.message.rst:251 msgid "Here are some additional useful header related methods:" -msgstr "" +msgstr "ヘッダーに関する便利な追加のメソッドを以下に示します。" #: ../../library/email.message.rst:256 msgid "" @@ -361,7 +455,6 @@ msgstr "" "*_name* に追加するヘッダフィールドを、 *_value* にそのヘッダの *主たる* 値を" "渡します。" -#: ../../library/email.message.rst:268 msgid "" "For each item in the keyword argument dictionary *_params*, the key is taken " "as the parameter name, with underscores converted to dashes (since dashes " @@ -369,8 +462,12 @@ msgid "" "as ``key=\"value\"`` unless the value is ``None``, in which case only the " "key will be added." msgstr "" +"キーワード引数の辞書 *_params* の各項目では、キーをパラメータ名として使い、ア" +"ンダースコアをハイフンに変換します (Python の識別子ではハイフンを使えないため" +"です)。\n" +"通常は ``key=\"value\"`` の形式でパラメータを追加しますが、値が ``None`` の場" +"合はキーだけを追加します。" -#: ../../library/email.message.rst:274 msgid "" "If the value contains non-ASCII characters, the charset and language may be " "explicitly controlled by specifying the value as a three tuple in the format " @@ -382,41 +479,51 @@ msgid "" "automatically encoded in :rfc:`2231` format using a ``CHARSET`` of ``utf-8`` " "and a ``LANGUAGE`` of ``None``." msgstr "" +"値に非 ASCII 文字が含まれる場合、``(CHARSET, LANGUAGE, VALUE)`` 形式の 3 要素" +"タプルを指定することで、文字セットと言語を明示的に制御できます。\n" +"``CHARSET`` は値のエンコードに使う文字セットの名前です。\n" +"``LANGUAGE`` は通常 ``None`` または空文字列にできます (他の指定については :" +"rfc:`2231` を参照してください)。\n" +"``VALUE`` は非 ASCII コードポイントを含む文字列値です。\n" +"3 要素タプルを渡さず、値に非 ASCII 文字が含まれている場合は、``CHARSET`` を " +"``utf-8``、``LANGUAGE`` を ``None`` として :rfc:`2231` 形式で自動的にエンコー" +"ドされます。" #: ../../library/email.message.rst:284 msgid "Here is an example::" msgstr "以下に例を示します。::" -#: ../../library/email.message.rst:286 msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" msgstr "" +"msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" #: ../../library/email.message.rst:288 msgid "This will add a header that looks like ::" msgstr "こうするとヘッダには以下のように追加されます ::" -#: ../../library/email.message.rst:290 msgid "Content-Disposition: attachment; filename=\"bud.gif\"" -msgstr "" +msgstr "Content-Disposition: attachment; filename=\"bud.gif\"" -#: ../../library/email.message.rst:292 msgid "An example of the extended interface with non-ASCII characters::" -msgstr "" +msgstr "拡張インターフェースで非 ASCII 文字を使う例です。 ::" -#: ../../library/email.message.rst:294 msgid "" "msg.add_header('Content-Disposition', 'attachment',\n" " filename=('iso-8859-1', '', 'Fußballer.ppt'))" msgstr "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" -#: ../../library/email.message.rst:300 msgid "" "Replace a header. Replace the first header found in the message that " "matches *_name*, retaining header order and field name case of the original " "header. If no matching header is found, raise a :exc:`KeyError`." msgstr "" +"ヘッダーを置き換えます。\n" +"*_name* に一致する最初のヘッダーを、元のヘッダーの順序とフィールド名の大文" +"字・小文字を保ったまま置き換えます。\n" +"一致するヘッダーがなければ :exc:`KeyError` を送出します。" -#: ../../library/email.message.rst:308 msgid "" "Return the message's content type, coerced to lower case of the form :" "mimetype:`maintype/subtype`. If there is no :mailheader:`Content-Type` " @@ -424,8 +531,12 @@ msgid "" "`get_default_type`. If the :mailheader:`Content-Type` header is invalid, " "return ``text/plain``." msgstr "" +"メッセージのコンテントタイプを、小文字の :mimetype:`maintype/subtype` 形式で" +"返します。\n" +"メッセージに :mailheader:`Content-Type` ヘッダーがない場合は、:meth:" +"`get_default_type` の戻り値を返します。\n" +":mailheader:`Content-Type` ヘッダーが不正な場合は ``text/plain`` を返します。" -#: ../../library/email.message.rst:314 msgid "" "(According to :rfc:`2045`, messages always have a default type, :meth:" "`get_content_type` will always return a value. :rfc:`2045` defines a " @@ -435,6 +546,13 @@ msgid "" "invalid type specification, :rfc:`2045` mandates that the default type be :" "mimetype:`text/plain`.)" msgstr "" +"(:rfc:`2045` によると、メッセージは常にデフォルトの型を持つため、:meth:" +"`get_content_type` は常に値を返します。\n" +":rfc:`2045` はデフォルトの型を :mimetype:`text/plain` と定めていますが、:" +"mimetype:`multipart/digest` コンテナ内では :mimetype:`message/rfc822` と定め" +"ています。\n" +":mailheader:`Content-Type` ヘッダーの型指定が不正な場合、:rfc:`2045` はデフォ" +"ルトの型を :mimetype:`text/plain` とするよう要求しています。)" #: ../../library/email.message.rst:325 msgid "" @@ -465,7 +583,6 @@ msgstr "" "`multipart/digest` コンテナに含まれているときだけ例外的に :mimetype:`message/" "rfc822` になります。" -#: ../../library/email.message.rst:345 msgid "" "Set the default content type. *ctype* should either be :mimetype:`text/" "plain` or :mimetype:`message/rfc822`, although this is not enforced. The " @@ -473,8 +590,13 @@ msgid "" "so it only affects the return value of the ``get_content_type`` methods when " "no :mailheader:`Content-Type` header is present in the message." msgstr "" +"デフォルトのコンテントタイプを設定します。\n" +"強制はされませんが、*ctype* は :mimetype:`text/plain` または :mimetype:" +"`message/rfc822` にしてください。\n" +"デフォルトのコンテントタイプは :mailheader:`Content-Type` ヘッダーには格納さ" +"れないため、メッセージに :mailheader:`Content-Type` ヘッダーがない場合の " +"``get_content_type()`` の戻り値にだけ影響します。" -#: ../../library/email.message.rst:356 msgid "" "Set a parameter in the :mailheader:`Content-Type` header. If the parameter " "already exists in the header, replace its value with *value*. When *header* " @@ -483,6 +605,13 @@ msgid "" "parameter value. Optional *header* specifies an alternative header to :" "mailheader:`Content-Type`." msgstr "" +":mailheader:`Content-Type` ヘッダーにパラメータを設定します。\n" +"パラメータがすでにあれば、その値を *value* に置き換えます。\n" +"*header* が ``Content-Type`` (デフォルト) で、そのヘッダーがメッセージにまだ" +"ない場合、値を :mimetype:`text/plain` としてヘッダーを追加し、新しいパラメー" +"タ値を付け加えます。\n" +"オプションの *header* は、:mailheader:`Content-Type` の代わりに使うヘッダーを" +"指定します。" #: ../../library/email.message.rst:363 msgid "" @@ -494,25 +623,29 @@ msgid "" "*language*." msgstr "" -#: ../../library/email.message.rst:370 msgid "" "If *replace* is ``False`` (the default) the header is moved to the end of " "the list of headers. If *replace* is ``True``, the header will be updated " "in place." msgstr "" +"*replace* が ``False`` (デフォルト) の場合、ヘッダーはヘッダー一覧の末尾に移" +"動します。\n" +"*replace* が ``True`` の場合は、元の位置で更新されます。" -#: ../../library/email.message.rst:374 ../../library/email.message.rst:391 msgid "" "Use of the *requote* parameter with :class:`EmailMessage` objects is " "deprecated." msgstr "" +":class:`EmailMessage` オブジェクトでの *requote* 引数の使用は非推奨です。" -#: ../../library/email.message.rst:377 msgid "" "Note that existing parameter values of headers may be accessed through the :" "attr:`~email.headerregistry.ParameterizedMIMEHeader.params` attribute of the " "header value (for example, ``msg['Content-Type'].params['charset']``)." msgstr "" +"ヘッダーの既存のパラメータ値には、ヘッダー値の :attr:`~email.headerregistry." +"ParameterizedMIMEHeader.params` 属性からアクセスできます (例えば " +"``msg['Content-Type'].params['charset']``)。" #: ../../library/email.message.rst:381 msgid "``replace`` keyword was added." @@ -569,13 +702,16 @@ msgstr "" "quote します。そのメッセージが :mailheader:`Content-Type` ヘッダを含んでいな" "い場合、 :exc:`~email.errors.HeaderParseError` が発生します。" -#: ../../library/email.message.rst:421 msgid "" "Note that using this method is subtly different from deleting the old :" "mailheader:`Content-Type` header and adding a new one with the new boundary " "via :meth:`add_header`, because :meth:`set_boundary` preserves the order of " "the :mailheader:`Content-Type` header in the list of headers." msgstr "" +":meth:`set_boundary` は、ヘッダー一覧内の :mailheader:`Content-Type` ヘッダー" +"の順序を保持します。\n" +"そのため、古い :mailheader:`Content-Type` ヘッダーを削除し、:meth:" +"`add_header` で新しい境界を持つヘッダーを追加する方法とは少し異なります。" msgid "" "Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " @@ -630,19 +766,23 @@ msgstr "" ":meth:`~email.message.Message.is_multipart` との一貫性のために、" "is_attachment が属性からメソッドになりました。" -#: ../../library/email.message.rst:460 msgid "" "Return the lowercased value (without parameters) of the message's :" "mailheader:`Content-Disposition` header if it has one, or ``None``. The " "possible values for this method are *inline*, *attachment* or ``None`` if " "the message follows :rfc:`2183`." msgstr "" +"メッセージに :mailheader:`Content-Disposition` ヘッダーがあれば、パラメータを" +"除いた値を小文字で返し、なければ ``None`` を返します。\n" +"メッセージが :rfc:`2183` に準拠していれば、戻り値は *inline*、*attachment*、" +"``None`` のいずれかです。" -#: ../../library/email.message.rst:468 msgid "" "The following methods relate to interrogating and manipulating the content " "(payload) of the message." msgstr "" +"以下のメソッドは、メッセージのコンテンツ (ペイロード) の情報取得と操作に関す" +"るものです。" #: ../../library/email.message.rst:474 msgid "" @@ -665,7 +805,6 @@ msgstr "" "以下の例は、 multipart メッセージのすべての part において、その MIME タイプを" "表示していくものです。 :" -#: ../../library/email.message.rst:488 msgid "" ">>> for part in msg.walk():\n" "... print(part.get_content_type())\n" @@ -677,16 +816,29 @@ msgid "" "message/rfc822\n" "text/plain" msgstr "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" -#: ../../library/email.message.rst:500 msgid "" "``walk`` iterates over the subparts of any part where :meth:`is_multipart` " "returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " "may return ``False``. We can see this in our example by making use of the " "``_structure`` debug helper function:" msgstr "" +"``walk()`` は、:meth:`is_multipart` が ``True`` を返すパートのサブパートを反" +"復処理します。\n" +"``msg.get_content_maintype() == 'multipart'`` が ``False`` を返す場合も同様で" +"す。\n" +"デバッグ用の補助関数 ``_structure()`` を使うと、この例でその様子を確認できま" +"す。" -#: ../../library/email.message.rst:506 msgid "" ">>> from email.iterators import _structure\n" ">>> for part in msg.walk():\n" @@ -708,13 +860,35 @@ msgid "" " message/rfc822\n" " text/plain" msgstr "" +">>> from email.iterators import _structure\n" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" -#: ../../library/email.message.rst:528 msgid "" "Here the ``message`` parts are not ``multiparts``, but they do contain " "subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the " "subparts." msgstr "" +"ここでは ``message`` パートは ``multipart`` ではありませんが、サブパートを含" +"んでいます。\n" +"``is_multipart()`` は ``True`` を返し、``walk()`` はサブパートの中へ進みま" +"す。" #: ../../library/email.message.rst:535 msgid "" @@ -722,47 +896,56 @@ msgid "" "message." msgstr "メッセージの \"本体\" の最有力候補となる MIME 部を返します。" -#: ../../library/email.message.rst:538 msgid "" "*preferencelist* must be a sequence of strings from the set ``related``, " "``html``, and ``plain``, and indicates the order of preference for the " "content type of the part returned." msgstr "" +"*preferencelist* は ``related``、``html``、``plain`` の中から選んだ文字列の" +"シーケンスでなければならず、返されるパートのコンテントタイプの優先順位を示し" +"ます。" -#: ../../library/email.message.rst:542 msgid "" "Start looking for candidate matches with the object on which the " "``get_body`` method is called." msgstr "" +"``get_body()`` を呼び出したオブジェクトから、一致する候補の検索を始めます。" -#: ../../library/email.message.rst:545 msgid "" "If ``related`` is not included in *preferencelist*, consider the root part " "(or subpart of the root part) of any related encountered as a candidate if " "the (sub-)part matches a preference." msgstr "" +"*preferencelist* に ``related`` が含まれていない場合、見つかった related パー" +"トのルートパート (またはそのサブパート) が優先候補のいずれかに一致すれば、候" +"補として扱います。" -#: ../../library/email.message.rst:549 msgid "" "When encountering a ``multipart/related``, check the ``start`` parameter and " "if a part with a matching :mailheader:`Content-ID` is found, consider only " "it when looking for candidate matches. Otherwise consider only the first " "(default root) part of the ``multipart/related``." msgstr "" +"``multipart/related`` を見つけると ``start`` パラメータを調べ、:mailheader:" +"`Content-ID` が一致するパートがあれば、それだけを一致候補の検索対象としま" +"す。\n" +"なければ、``multipart/related`` の最初のパート (デフォルトのルート) だけを対" +"象とします。" -#: ../../library/email.message.rst:554 msgid "" "If a part has a :mailheader:`Content-Disposition` header, only consider the " "part a candidate match if the value of the header is ``inline``." msgstr "" +"パートに :mailheader:`Content-Disposition` ヘッダーがある場合、その値が " +"``inline`` のときだけ一致候補とします。" -#: ../../library/email.message.rst:557 msgid "" "If none of the candidates matches any of the preferences in " "*preferencelist*, return ``None``." msgstr "" +"どの候補も *preferencelist* のいずれの優先候補にも一致しなければ、``None`` を" +"返します。" -#: ../../library/email.message.rst:560 msgid "" "Notes: (1) For most applications the only *preferencelist* combinations that " "really make sense are ``('plain',)``, ``('html', 'plain')``, and the default " @@ -774,8 +957,17 @@ msgid "" "invalid will be treated as if they are of type ``text/plain``, which may " "occasionally cause ``get_body`` to return unexpected results." msgstr "" +"注意: (1) ほとんどのアプリケーションで意味のある *preferencelist* の組み合わ" +"せは、``('plain',)``、``('html', 'plain')``、デフォルトの ``('related', " +"'html', 'plain')`` だけです。\n" +"(2) 一致の検索は ``get_body()`` を呼び出したオブジェクトから始まるため、" +"``multipart/related`` に対する ``get_body()`` は、*preferencelist* がデフォル" +"ト以外の値でない限り、そのオブジェクト自身を返します。\n" +"(3) :mailheader:`Content-Type` が指定されていないメッセージ (またはパート) " +"や、:mailheader:`Content-Type` ヘッダーが不正なものは、``text/plain`` とみな" +"されます。\n" +"そのため、``get_body()`` が予想外の結果を返すことがあります。" -#: ../../library/email.message.rst:574 msgid "" "Return an iterator over all of the immediate sub-parts of the message that " "are not candidate \"body\" parts. That is, skip the first occurrence of " @@ -789,15 +981,28 @@ msgid "" "ID` of any of the parts). When applied directly to a ``multipart/" "alternative`` or a non-``multipart``, return an empty iterator." msgstr "" +"メッセージの直下のサブパートのうち、「本体」の候補でないものすべてを反復処理" +"するイテレーターを返します。\n" +"つまり、``text/plain``、``text/html``、``multipart/related``、``multipart/" +"alternative`` のそれぞれ最初のパートを除き、残りのパートをすべて返します。\n" +"ただし、:mailheader:`Content-Disposition: attachment` で明示的に添付ファイル" +"とされているパートは除きません。\n" +"``multipart/related`` に直接適用した場合、ルートパート以外の関連パートすべて" +"を反復処理するイテレーターを返します。\n" +"ルートパートは ``start`` パラメータが指すパートで、``start`` がない場合や、ど" +"のパートの :mailheader:`Content-ID` にも一致しない場合は最初のパートです。\n" +"``multipart/alternative`` または ``multipart`` 以外に直接適用すると、空のイテ" +"レーターを返します。" -#: ../../library/email.message.rst:590 msgid "" "Return an iterator over all of the immediate sub-parts of the message, which " "will be empty for a non-``multipart``. (See also :meth:`~email.message." "EmailMessage.walk`.)" msgstr "" +"メッセージの直下のサブパートすべてを反復処理するイテレーターを返します。\n" +"``multipart`` でなければ空になります。\n" +"(:meth:`~email.message.EmailMessage.walk` も参照してください。)" -#: ../../library/email.message.rst:597 msgid "" "Call the :meth:`~email.contentmanager.ContentManager.get_content` method of " "the *content_manager*, passing self as the message object, and passing along " @@ -805,8 +1010,13 @@ msgid "" "*content_manager* is not specified, use the ``content_manager`` specified by " "the current :mod:`~email.policy`." msgstr "" +"*content_manager* の :meth:`~email.contentmanager.ContentManager." +"get_content` を呼び出します。\n" +"メッセージオブジェクトとして ``self`` を渡し、他の引数やキーワード引数も追加" +"の引数としてそのまま渡します。\n" +"*content_manager* が指定されていなければ、現在の :mod:`~email.policy` で指定" +"された ``content_manager`` を使います。" -#: ../../library/email.message.rst:606 msgid "" "Call the :meth:`~email.contentmanager.ContentManager.set_content` method of " "the *content_manager*, passing self as the message object, and passing along " @@ -814,8 +1024,13 @@ msgid "" "*content_manager* is not specified, use the ``content_manager`` specified by " "the current :mod:`~email.policy`." msgstr "" +"*content_manager* の :meth:`~email.contentmanager.ContentManager." +"set_content` を呼び出します。\n" +"メッセージオブジェクトとして ``self`` を渡し、他の引数やキーワード引数も追加" +"の引数としてそのまま渡します。\n" +"*content_manager* が指定されていなければ、現在の :mod:`~email.policy` で指定" +"された ``content_manager`` を使います。" -#: ../../library/email.message.rst:615 msgid "" "Convert a non-``multipart`` message into a ``multipart/related`` message, " "moving any existing :mailheader:`Content-` headers and payload into a (new) " @@ -824,8 +1039,13 @@ msgid "" "automatically created when it is needed (for example, when the message is " "serialized)." msgstr "" +"``multipart`` でないメッセージを ``multipart/related`` に変換し、既存の :" +"mailheader:`Content-` ヘッダーとペイロードを、``multipart`` の新しい最初の" +"パートに移します。\n" +"*boundary* が指定されていれば、マルチパートの境界文字列として使います。\n" +"指定されていなければ、直列化時など、必要になったときに自動的に生成されるよう" +"にします。" -#: ../../library/email.message.rst:625 msgid "" "Convert a non-``multipart`` or a ``multipart/related`` into a ``multipart/" "alternative``, moving any existing :mailheader:`Content-` headers and " @@ -834,6 +1054,12 @@ msgid "" "the boundary to be automatically created when it is needed (for example, " "when the message is serialized)." msgstr "" +"``multipart`` でないメッセージ、または ``multipart/related`` を ``multipart/" +"alternative`` に変換し、既存の :mailheader:`Content-` ヘッダーとペイロード" +"を、``multipart`` の新しい最初のパートに移します。\n" +"*boundary* が指定されていれば、マルチパートの境界文字列として使います。\n" +"指定されていなければ、直列化時など、必要になったときに自動的に生成されるよう" +"にします。" #: ../../library/email.message.rst:635 msgid "" @@ -845,7 +1071,6 @@ msgid "" "it is needed (for example, when the message is serialized)." msgstr "" -#: ../../library/email.message.rst:645 msgid "" "If the message is a ``multipart/related``, create a new message object, pass " "all of the arguments to its :meth:`set_content` method, and :meth:`~email." @@ -856,8 +1081,17 @@ msgid "" "the current :mod:`~email.policy`. If the added part has no :mailheader:" "`Content-Disposition` header, add one with the value ``inline``." msgstr "" +"メッセージが ``multipart/related`` の場合、新しいメッセージオブジェクトを作成" +"し、すべての引数をその :meth:`set_content` に渡して、:meth:`~email.message." +"Message.attach` で ``multipart`` に追加します。\n" +"メッセージが ``multipart`` でなければ、:meth:`make_related` を呼び出してから" +"同じ処理を行います。\n" +"他の型の ``multipart`` の場合は :exc:`TypeError` を送出します。\n" +"*content_manager* が指定されていなければ、現在の :mod:`~email.policy` で指定" +"された ``content_manager`` を使います。\n" +"追加したパートに :mailheader:`Content-Disposition` ヘッダーがなければ、値を " +"``inline`` として追加します。" -#: ../../library/email.message.rst:658 msgid "" "If the message is a ``multipart/alternative``, create a new message object, " "pass all of the arguments to its :meth:`set_content` method, and :meth:" @@ -868,8 +1102,15 @@ msgid "" "specified, use the ``content_manager`` specified by the current :mod:`~email." "policy`." msgstr "" +"メッセージが ``multipart/alternative`` の場合、新しいメッセージオブジェクトを" +"作成し、すべての引数をその :meth:`set_content` に渡して、:meth:`~email." +"message.Message.attach` で ``multipart`` に追加します。\n" +"メッセージが ``multipart`` でない場合、または ``multipart/related`` の場合" +"は、:meth:`make_alternative` を呼び出してから同じ処理を行います。\n" +"他の型の ``multipart`` の場合は :exc:`TypeError` を送出します。\n" +"*content_manager* が指定されていなければ、現在の :mod:`~email.policy` で指定" +"された ``content_manager`` を使います。" -#: ../../library/email.message.rst:670 msgid "" "If the message is a ``multipart/mixed``, create a new message object, pass " "all of the arguments to its :meth:`set_content` method, and :meth:`~email." @@ -883,16 +1124,30 @@ msgid "" "``inline`` attachments (:mailheader:`Content-Disposition: inline`), by " "passing appropriate options to the ``content_manager``." msgstr "" +"メッセージが ``multipart/mixed`` の場合、新しいメッセージオブジェクトを作成" +"し、すべての引数をその :meth:`set_content` に渡して、:meth:`~email.message." +"Message.attach` で ``multipart`` に追加します。\n" +"メッセージが ``multipart`` でない場合、または ``multipart/related`` や " +"``multipart/alternative`` の場合は、:meth:`make_mixed` を呼び出してから同じ処" +"理を行います。\n" +"*content_manager* が指定されていなければ、現在の :mod:`~email.policy` で指定" +"された ``content_manager`` を使います。\n" +"追加したパートに :mailheader:`Content-Disposition` ヘッダーがなければ、値を " +"``attachment`` として追加します。\n" +"``content_manager`` に適切なオプションを渡すことで、明示的な添付ファイル (:" +"mailheader:`Content-Disposition: attachment`) にも、``inline`` の添付ファイ" +"ル (:mailheader:`Content-Disposition: inline`) にも使えます。" #: ../../library/email.message.rst:686 msgid "Remove the payload and all of the headers." msgstr "ペイロードとヘッダの全てを削除します。" -#: ../../library/email.message.rst:691 msgid "" "Remove the payload and all of the :mailheader:`!Content-` headers, leaving " "all other headers intact and in their original order." msgstr "" +"ペイロードとすべての :mailheader:`!Content-` ヘッダーを削除し、他のヘッダーは" +"内容も順序もそのまま残します。" #: ../../library/email.message.rst:695 msgid ":class:`EmailMessage` objects have the following instance attributes:" @@ -943,13 +1198,16 @@ msgstr "" "注意: そのメッセージに preamble がない場合、*preamble* 属性には ``None`` が格" "納されます。" -#: ../../library/email.message.rst:723 msgid "" "The *epilogue* attribute acts the same way as the *preamble* attribute, " "except that it contains text that appears between the last boundary and the " "end of the message. As with the :attr:`~EmailMessage.preamble`, if there is " "no epilog text this attribute will be ``None``." msgstr "" +"*epilogue* 属性は *preamble* 属性と同様に働きますが、最後の境界からメッセージ" +"の末尾までのテキストを含む点が異なります。\n" +":attr:`~EmailMessage.preamble` と同様に、末尾のテキストがなければ ``None`` に" +"なります。" #: ../../library/email.message.rst:731 msgid "" @@ -961,25 +1219,30 @@ msgstr "" "障害) のリストを保持しています。解析中に発見されうる障害についてのより詳細な" "説明は :mod:`email.errors` を参照してください。" -#: ../../library/email.message.rst:738 msgid "" "This class represents a subpart of a MIME message. It is identical to :" "class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are " "added when :meth:`~EmailMessage.set_content` is called, since sub-parts do " "not need their own :mailheader:`MIME-Version` headers." msgstr "" +"このクラスは MIME メッセージのサブパートを表します。\n" +":class:`EmailMessage` と同じですが、サブパートには独自の :mailheader:`MIME-" +"Version` ヘッダーが不要なため、:meth:`~EmailMessage.set_content` を呼び出して" +"も :mailheader:`MIME-Version` ヘッダーが追加されない点が異なります。" #: ../../library/email.message.rst:745 msgid "Footnotes" msgstr "脚注" -#: ../../library/email.message.rst:746 msgid "" "Originally added in 3.4 as a :term:`provisional module `. Docs for legacy message class moved to :ref:`compat32_message`." msgstr "" +"当初は 3.4 で :term:`暫定モジュール ` として追加されまし" +"た。\n" +"従来のメッセージクラスのドキュメントは :ref:`compat32_message` に移動しまし" +"た。" -#: ../../library/email.message.rst:750 msgid "" "The :class:`EmailMessage` class requires a policy that provides a " "``content_manager`` attribute for content management methods like " @@ -987,3 +1250,8 @@ msgid "" "policy.compat32` policy does not support these methods and should not be " "used with :class:`EmailMessage`." msgstr "" +":class:`EmailMessage` の ``set_content()`` や ``get_content()`` などのコンテ" +"ンツ管理メソッドを動作させるには、``content_manager`` 属性を提供するポリシー" +"が必要です。\n" +"従来の :const:`~email.policy.compat32` ポリシーはこれらのメソッドをサポートし" +"ていないため、:class:`EmailMessage` では使わないでください。" diff --git a/library/email.mime.po b/library/email.mime.po index 8bc9ba362..485141050 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -22,21 +22,22 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.mime.rst:2 msgid ":mod:`!email.mime`: Creating email and MIME objects from scratch" -msgstr "" +msgstr ":mod:`!email.mime`: 電子メールと MIME オブジェクトを一から作成する" #: ../../library/email.mime.rst:7 msgid "**Source code:** :source:`Lib/email/mime/`" msgstr "**ソースコード:** :source:`Lib/email/mime/`" -#: ../../library/email.mime.rst:11 msgid "" "This module is part of the legacy (``Compat32``) email API. Its " "functionality is partially replaced by the :mod:`~email.contentmanager` in " "the new API, but in certain applications these classes may still be useful, " "even in non-legacy code." msgstr "" +"このモジュールは従来の (``Compat32``) email API の一部です。\n" +"新しい API では機能の一部が :mod:`~email.contentmanager` に置き換えられていま" +"すが、用途によっては新しいコードでもこれらのクラスが役立ちます。" #: ../../library/email.mime.rst:16 msgid "" @@ -58,18 +59,16 @@ msgstr "" "す。これは MIME メッセージを切ったりおろしたりするために非常に便利なインター" "フェイスを提供します。" -#: ../../library/email.mime.rst:24 msgid "" "You can create a new object structure by creating :class:`~email.message." "Message` instances, adding attachments and all the appropriate headers " "manually. For MIME messages though, the :mod:`email` package provides some " "convenient subclasses to make things easier." msgstr "" -"新しいメッセージオブジェクト構造は :class:`~email.message.Message` インスタン" -"スを作成することにより作れます。ここに添付ファイルやその他適切なものをすべて" -"手で加えてやればよいのです。MIME メッセージの場合、 :mod:`email` パッケージは" -"これらを簡単におこなえるようにするためにいくつかの便利なサブクラスを提供して" -"います。" +"新しいオブジェクト構造は :class:`~email.message.Message` インスタンスを作成" +"し、添付ファイルと必要なヘッダをすべて手動で追加することで作れます。\n" +"ただし MIME メッセージについては、:mod:`email` パッケージにこの作業を簡単にす" +"る便利なサブクラスが用意されています。" #: ../../library/email.mime.rst:29 msgid "Here are the classes:" @@ -106,11 +105,12 @@ msgstr "" "など)。 *_params* は各パラメータのキーと値を格納した辞書であり、これは直接 :" "meth:`Message.add_header ` に渡されます。" -#: ../../library/email.mime.rst:49 msgid "" "If *policy* is specified, (defaults to the :class:`compat32 ` policy) it will be passed to :class:`~email.message.Message`." msgstr "" +"*policy* を指定すると :class:`~email.message.Message` に渡されます (デフォル" +"トは :class:`compat32 ` ポリシーです)。" #: ../../library/email.mime.rst:53 msgid "" @@ -192,13 +192,12 @@ msgstr "" "はつねに :meth:`Message.attach ` メソッドを使っ" "てそのメッセージに追加できるようになっています。" -#: ../../library/email.mime.rst:98 ../../library/email.mime.rst:131 -#: ../../library/email.mime.rst:165 ../../library/email.mime.rst:200 -#: ../../library/email.mime.rst:223 ../../library/email.mime.rst:254 msgid "" "Optional *policy* argument defaults to :class:`compat32 `." msgstr "" +"オプション引数 *policy* のデフォルトは :class:`compat32 ` です。" #: ../../library/email.mime.rst:100 msgid "" @@ -214,7 +213,6 @@ msgstr "" msgid "Module: :mod:`email.mime.application`" msgstr "モジュール: :mod:`email.mime.application`" -#: ../../library/email.mime.rst:115 msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEApplication` class is used to represent MIME message objects of major " @@ -222,6 +220,12 @@ msgid "" "application data. Optional *_subtype* specifies the MIME subtype and " "defaults to :mimetype:`octet-stream`." msgstr "" +":class:`MIMEApplication` クラスは :class:`~email.mime.nonmultipart." +"MIMENonMultipart` のサブクラスで、主形式が :mimetype:`application` の MIME " +"メッセージオブジェクトを表します。\n" +"*_data* は未加工のアプリケーションデータのバイト列です。\n" +"オプション引数 *_subtype* は MIME の副形式を指定し、デフォルトは :mimetype:" +"`octet-stream` です。" #: ../../library/email.mime.rst:121 msgid "" @@ -251,7 +255,6 @@ msgstr "*_params* は基底クラスのコンストラクタにそのまま渡 msgid "Module: :mod:`email.mime.audio`" msgstr "モジュール: :mod:`email.mime.audio`" -#: ../../library/email.mime.rst:146 msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEAudio` class is used to create MIME message objects of major type :" @@ -262,6 +265,15 @@ msgid "" "argument. If the minor type could not be guessed and *_subtype* was not " "given, then :exc:`TypeError` is raised." msgstr "" +":class:`MIMEAudio` クラスは :class:`~email.mime.nonmultipart." +"MIMENonMultipart` のサブクラスで、主形式が :mimetype:`audio` の MIME メッセー" +"ジオブジェクトを作成します。\n" +"*_audiodata* は未加工の音声データのバイト列です。\n" +"このデータを au、wav、aiff、aifc としてデコードできる場合、副形式は自動的に :" +"mailheader:`Content-Type` ヘッダに含められます。\n" +"それ以外の場合は *_subtype* 引数で音声の副形式を明示的に指定できます。\n" +"副形式を推測できず、*_subtype* も指定されていない場合は :exc:`TypeError` が送" +"出されます。" #: ../../library/email.mime.rst:155 msgid "" @@ -287,7 +299,6 @@ msgstr "" msgid "Module: :mod:`email.mime.image`" msgstr "モジュール: :mod:`email.mime.image`" -#: ../../library/email.mime.rst:180 msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEImage` class is used to create MIME message objects of major type :" @@ -299,6 +310,16 @@ msgid "" "the minor type could not be guessed and *_subtype* was not given, then :exc:" "`TypeError` is raised." msgstr "" +":class:`MIMEImage` クラスは :class:`~email.mime.nonmultipart." +"MIMENonMultipart` のサブクラスで、主形式が :mimetype:`image` の MIME メッセー" +"ジオブジェクトを作成します。\n" +"*_imagedata* は未加工の画像データのバイト列です。\n" +"このデータの形式を検出できる場合 (jpeg、png、gif、tiff、rgb、pbm、pgm、ppm、" +"rast、xbm、bmp、webp、exr の検出を試みます)、副形式は自動的に :mailheader:" +"`Content-Type` ヘッダに含められます。\n" +"それ以外の場合は *_subtype* 引数で画像の副形式を明示的に指定できます。\n" +"副形式を推測できず、*_subtype* も指定されていない場合は :exc:`TypeError` が送" +"出されます。" #: ../../library/email.mime.rst:190 msgid "" diff --git a/library/email.parser.po b/library/email.parser.po index c87af83a8..ea1e32e02 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -22,15 +22,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.parser.rst:2 msgid ":mod:`!email.parser`: Parsing email messages" -msgstr "" +msgstr ":mod:`!email.parser`: 電子メールメッセージの解析" #: ../../library/email.parser.rst:7 msgid "**Source code:** :source:`Lib/email/parser.py`" msgstr "**ソースコード:** :source:`Lib/email/parser.py`" -#: ../../library/email.parser.rst:11 msgid "" "Message object structures can be created in one of two ways: they can be " "created from whole cloth by creating an :class:`~email.message.EmailMessage` " @@ -39,8 +37,12 @@ msgid "" "or they can be created by parsing a serialized representation of the email " "message." msgstr "" +"メッセージオブジェクトの構造を作成する方法は 2 つあります。\n" +":class:`~email.message.EmailMessage` オブジェクトを作成し、辞書インターフェイ" +"スでヘッダを追加し、:meth:`~email.message.EmailMessage.set_content` や関連メ" +"ソッドでペイロードを追加して一から組み立てる方法と、シリアライズされた電子" +"メールメッセージを解析する方法です。" -#: ../../library/email.parser.rst:18 msgid "" "The :mod:`email` package provides a standard parser that understands most " "email document structures, including MIME documents. You can pass the " @@ -54,8 +56,19 @@ msgid "" "meth:`~email.message.EmailMessage.iter_parts`, and :meth:`~email.message." "EmailMessage.walk`." msgstr "" +":mod:`email` パッケージには、MIME 文書を含むほとんどの電子メール文書の構造を" +"解釈できる標準のパーザがあります。\n" +"パーザにバイト列、文字列、またはファイルオブジェクトを渡すと、オブジェクト構" +"造のルートに当たる :class:`~email.message.EmailMessage` インスタンスが返され" +"ます。\n" +"MIME 形式でない単純なメッセージでは、通常、このルートオブジェクトのペイロード" +"はメッセージのテキストを含む文字列になります。\n" +"MIME メッセージではルートオブジェクトの :meth:`~email.message.EmailMessage." +"is_multipart` メソッドが ``True`` を返し、:meth:`~email.message.EmailMessage." +"get_body`、:meth:`~email.message.EmailMessage.iter_parts`、:meth:`~email." +"message.EmailMessage.walk` などのペイロード操作用メソッドで各部分にアクセスで" +"きます。" -#: ../../library/email.parser.rst:30 msgid "" "There are actually two parser interfaces available for use, the :class:" "`Parser` API and the incremental :class:`FeedParser` API. The :class:" @@ -67,8 +80,17 @@ msgid "" "message incrementally, and only returns the root object when you close the " "parser." msgstr "" +"利用できるパーザインターフェイスは、:class:`Parser` API と逐次解析を行う :" +"class:`FeedParser` API の 2 つです。\n" +":class:`Parser` API は、メッセージ全体のテキストがメモリ内にある場合や、メッ" +"セージ全体がファイルシステム上のファイルに格納されている場合に適していま" +"す。\n" +"追加の入力を待ってブロックする可能性があるストリームからメッセージを読む場合 " +"(例えばソケットから電子メールメッセージを読む場合) は、:class:`FeedParser` の" +"方が適しています。\n" +":class:`FeedParser` はメッセージを少しずつ取り込んで解析でき、パーザを閉じた" +"ときに初めてルートオブジェクトを返します。" -#: ../../library/email.parser.rst:39 msgid "" "Note that the parser can be extended in limited ways, and of course you can " "implement your own parser completely from scratch. All of the logic that " @@ -78,12 +100,18 @@ msgid "" "necessary by implementing custom versions of the appropriate :class:`!" "Policy` methods." msgstr "" +"パーザは限られた範囲で拡張でき、もちろん独自のパーザを一から実装することもで" +"きます。\n" +":mod:`email` パッケージに付属するパーザと :class:`~email.message." +"EmailMessage` クラスを結び付けるロジックはすべて :class:`~email.policy." +"Policy` クラスにまとめられています。\n" +"そのため独自のパーザは、適切な :class:`!Policy` メソッドを独自に実装すること" +"で、必要な方法でメッセージオブジェクトのツリーを作成できます。" #: ../../library/email.parser.rst:49 msgid "FeedParser API" msgstr "FeedParser API" -#: ../../library/email.parser.rst:51 msgid "" "The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` " "module, provides an API that is conducive to incremental parsing of email " @@ -94,6 +122,15 @@ msgid "" "`BytesParser` API may be more convenient for such use cases. The semantics " "and results of the two parser APIs are identical." msgstr "" +":mod:`email.feedparser` モジュールからインポートする :class:" +"`BytesFeedParser` は、電子メールメッセージを逐次解析するための API を提供しま" +"す。\n" +"これはソケットなど、ブロックする可能性がある入力元から電子メールメッセージの" +"テキストを読む場合に必要になるものです。\n" +":class:`BytesFeedParser` はもちろん、全体が :term:`bytes-like object`、文字" +"列、またはファイルに格納されている電子メールメッセージも解析できますが、その" +"場合は :class:`BytesParser` API の方が便利かもしれません。\n" +"この 2 つのパーザ API の意味と解析結果は同じです。" msgid "" "The :class:`BytesFeedParser`'s API is simple; you create an instance, feed " @@ -124,15 +161,18 @@ msgstr "" msgid "Here is the API for the :class:`BytesFeedParser`:" msgstr "以下は :class:`BytesFeedParser` の API です:" -#: ../../library/email.parser.rst:75 msgid "" "Create a :class:`BytesFeedParser` instance. Optional *_factory* is a no-" "argument callable; if not specified use the :attr:`~email.policy.Policy." "message_factory` from the *policy*. Call *_factory* whenever a new message " "object is needed." msgstr "" +":class:`BytesFeedParser` インスタンスを作成します。\n" +"オプション引数 *_factory* は引数を取らない呼び出し可能オブジェクトです。\n" +"指定しなければ *policy* の :attr:`~email.policy.Policy.message_factory` を使" +"います。\n" +"新しいメッセージオブジェクトが必要になるたびに *_factory* を呼び出します。" -#: ../../library/email.parser.rst:80 msgid "" "If *policy* is specified use the rules it specifies to update the " "representation of the message. If *policy* is not set, use the :class:" @@ -143,20 +183,30 @@ msgid "" "more information on what else *policy* controls, see the :mod:`~email." "policy` documentation." msgstr "" +"*policy* を指定した場合、そのルールに従ってメッセージの表現を更新します。\n" +"指定しない場合は :class:`compat32 ` ポリシーを使いま" +"す。\n" +"このポリシーは Python 3.2 の email パッケージとの後方互換性を維持し、デフォル" +"トのファクトリとして :class:`~email.message.Message` を提供します。\n" +"その他のポリシーはすべて、デフォルトの *_factory* として :class:`~email." +"message.EmailMessage` を提供します。\n" +"*policy* が制御するその他の内容は :mod:`~email.policy` のドキュメントを参照し" +"てください。" -#: ../../library/email.parser.rst:89 ../../library/email.parser.rst:145 msgid "" "Note: **The policy keyword should always be specified**; The default will " "change to :data:`email.policy.default` in a future version of Python." msgstr "" +"注意: キーワード引数 ``policy`` は **常に指定してください**。\n" +"将来の Python バージョンでは、デフォルトが :data:`email.policy.default` に変" +"更されます。" #: ../../library/email.parser.rst:94 ../../library/email.parser.rst:122 msgid "Added the *policy* keyword." msgstr "キーワード引数 *policy* が追加されました。" -#: ../../library/email.parser.rst:95 msgid "*_factory* defaults to the policy ``message_factory``." -msgstr "" +msgstr "*_factory* のデフォルトがポリシーの ``message_factory`` になりました。" #: ../../library/email.parser.rst:100 msgid "" @@ -172,14 +222,16 @@ msgstr "" "(復帰 CR、改行 LF、または CR+LF) どれかの組み合わせでよく、これらが混在しても" "かまいません。" -#: ../../library/email.parser.rst:109 msgid "" "Complete the parsing of all previously fed data and return the root message " "object. It is undefined what happens if :meth:`~feed` is called after this " "method has been called." msgstr "" +"それまでに渡されたすべてのデータの解析を完了し、ルートのメッセージオブジェク" +"トを返します。\n" +"このメソッドを呼び出した後で :meth:`~feed` を呼び出した場合の動作は未定義で" +"す。" -#: ../../library/email.parser.rst:116 msgid "" "Works like :class:`BytesFeedParser` except that the input to the :meth:" "`~BytesFeedParser.feed` method must be a string. This is of limited " @@ -187,12 +239,15 @@ msgid "" "contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is " "``True``, no binary attachments." msgstr "" +":class:`BytesFeedParser` と同様に動作しますが、:meth:`~BytesFeedParser.feed` " +"メソッドへの入力は文字列でなければなりません。\n" +"このようなメッセージが有効となるのは、ASCII テキストのみを含む場合、または :" +"attr:`~email.policy.EmailPolicy.utf8` が ``True`` でバイナリの添付ファイルを" +"含まない場合に限られるため、用途は限定されます。" -#: ../../library/email.parser.rst:126 msgid "Parser API" -msgstr "" +msgstr "Parser API" -#: ../../library/email.parser.rst:128 msgid "" "The :class:`BytesParser` class, imported from the :mod:`!email.parser` " "module, provides an API that can be used to parse a message when the " @@ -205,13 +260,24 @@ msgid "" "do not attempt to parse the message body, instead setting the payload to the " "raw body." msgstr "" +":mod:`!email.parser` モジュールからインポートする :class:`BytesParser` クラス" +"は、メッセージ全体が :term:`bytes-like object` やファイルに格納されている場合" +"に解析するための API を提供します。\n" +":mod:`!email.parser` モジュールには、文字列を解析する :class:`Parser` と、" +"メッセージのヘッダだけが必要な場合に使えるヘッダ専用パーザ :class:" +"`BytesHeaderParser` および :class:`HeaderParser` もあります。\n" +":class:`BytesHeaderParser` と :class:`HeaderParser` はメッセージ本体を解析せ" +"ず、そのままペイロードに設定するため、このような場合には大幅に高速になること" +"があります。" -#: ../../library/email.parser.rst:141 msgid "" "Create a :class:`BytesParser` instance. The *_class* and *policy* arguments " "have the same meaning and semantics as the *_factory* and *policy* arguments " "of :class:`BytesFeedParser`." msgstr "" +":class:`BytesParser` インスタンスを作成します。\n" +"*_class* 引数と *policy* 引数の意味と動作は、:class:`BytesFeedParser` の " +"*_factory* 引数と *policy* 引数と同じです。" #: ../../library/email.parser.rst:148 msgid "" @@ -220,19 +286,19 @@ msgid "" msgstr "" "2.4 で非推奨になった *strict* 引数の削除。キーワード引数 *policy* の追加。" -#: ../../library/email.parser.rst:151 ../../library/email.parser.rst:200 -#: ../../library/email.parser.rst:280 msgid "*_class* defaults to the policy ``message_factory``." -msgstr "" +msgstr "*_class* のデフォルトがポリシーの ``message_factory`` になりました。" -#: ../../library/email.parser.rst:156 msgid "" "Read all the data from the binary file-like object *fp*, parse the resulting " "bytes, and return the message object. *fp* must support both the :meth:`~io." "IOBase.readline` and the :meth:`~io.BufferedIOBase.read` methods." msgstr "" +"バイナリのファイル類似オブジェクト *fp* からすべてのデータを読み込み、得られ" +"たバイト列を解析してメッセージオブジェクトを返します。\n" +"*fp* は :meth:`~io.IOBase.readline` と :meth:`~io.BufferedIOBase.read` の両方" +"のメソッドをサポートしなければなりません。" -#: ../../library/email.parser.rst:161 msgid "" "The bytes contained in *fp* must be formatted as a block of :rfc:`5322` (or, " "if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`) style " @@ -242,6 +308,14 @@ msgid "" "may contain MIME-encoded subparts, including subparts with a :mailheader:" "`Content-Transfer-Encoding` of ``8bit``)." msgstr "" +"*fp* 内のバイト列は、:rfc:`5322` (または :attr:`~email.policy.EmailPolicy." +"utf8` が ``True`` の場合は :rfc:`6532`) 形式のヘッダとヘッダの継続行からなる" +"ブロックで始まらなければなりません。\n" +"その前にエンベロープヘッダがあってもかまいません。\n" +"ヘッダブロックはデータの終端または空行で終わります。\n" +"ヘッダブロックの後にはメッセージ本体が続きます (本体には、:mailheader:" +"`Content-Transfer-Encoding` が ``8bit`` の部分を含め、MIME エンコードされた部" +"分が含まれていることがあります)。" #: ../../library/email.parser.rst:169 msgid "" @@ -252,28 +326,32 @@ msgstr "" "オプション引数 *headersonly* はヘッダを読み終えた後にパースを止めるかを指定す" "るフラグです。デフォルトは ``False`` で、ファイルの内容全体をパースします。" -#: ../../library/email.parser.rst:176 msgid "" "Similar to the :meth:`parse` method, except it takes a :term:`bytes-like " "object` instead of a file-like object. Calling this method on a :term:" "`bytes-like object` is equivalent to wrapping *bytes* in a :class:`~io." "BytesIO` instance first and calling :meth:`parse`." msgstr "" +":meth:`parse` メソッドと似ていますが、ファイル類似オブジェクトではなく :term:" +"`bytes-like object` を受け取ります。\n" +":term:`bytes-like object` に対してこのメソッドを呼び出すことは、*bytes* を :" +"class:`~io.BytesIO` インスタンスに包んで :meth:`parse` を呼び出すことと同じで" +"す。" #: ../../library/email.parser.rst:181 ../../library/email.parser.rst:221 msgid "Optional *headersonly* is as with the :meth:`parse` method." msgstr "オプション引数 *headersonly* は :meth:`parse` メソッドと同じです。" -#: ../../library/email.parser.rst:188 msgid "" "Exactly like :class:`BytesParser`, except that *headersonly* defaults to " "``True``." msgstr "" +"*headersonly* のデフォルトが ``True`` である点を除き、:class:`BytesParser` と" +"まったく同じです。" -#: ../../library/email.parser.rst:196 msgid "" "This class is parallel to :class:`BytesParser`, but handles string input." -msgstr "" +msgstr ":class:`BytesParser` に対応するクラスですが、文字列の入力を扱います。" #: ../../library/email.parser.rst:198 ../../library/email.parser.rst:245 #: ../../library/email.parser.rst:258 ../../library/email.parser.rst:268 @@ -294,11 +372,12 @@ msgstr "" "`~io.TextIOBase.readline` および :meth:`~io.TextIOBase.read` 両方のメソッドを" "サポートしている必要があります。" -#: ../../library/email.parser.rst:210 msgid "" "Other than the text mode requirement, this method operates like :meth:" "`BytesParser.parse`." msgstr "" +"テキストモードが必要な点を除き、このメソッドは :meth:`BytesParser.parse` と同" +"様に動作します。" #: ../../library/email.parser.rst:216 msgid "" @@ -312,10 +391,11 @@ msgstr "" "は、 *text* を :class:`~io.StringIO` インスタンスとして作成して :meth:" "`parse` を適用するのと同じです。" -#: ../../library/email.parser.rst:226 msgid "" "Exactly like :class:`Parser`, except that *headersonly* defaults to ``True``." msgstr "" +"*headersonly* のデフォルトが ``True`` である点を除き、:class:`Parser` とまっ" +"たく同じです。" #: ../../library/email.parser.rst:230 msgid "" @@ -379,11 +459,12 @@ msgstr "" "対話的な Python プロンプトで :func:`message_from_bytes` を使用するとすれば、" "このようになります::" -#: ../../library/email.parser.rst:286 msgid "" ">>> import email\n" ">>> msg = email.message_from_bytes(myBytes)" msgstr "" +">>> import email\n" +">>> msg = email.message_from_bytes(myBytes)" #: ../../library/email.parser.rst:291 msgid "Additional notes" diff --git a/library/email.po b/library/email.po index f407f483a..47844856f 100644 --- a/library/email.po +++ b/library/email.po @@ -30,7 +30,6 @@ msgstr ":mod:`!email` --- 電子メールと MIME 処理のためのパッケー msgid "**Source code:** :source:`Lib/email/__init__.py`" msgstr "**ソースコード:** :source:`Lib/email/__init__.py`" -#: ../../library/email.rst:12 msgid "" "The :mod:`!email` package is a library for managing email messages. It is " "specifically *not* designed to do any sending of email messages to SMTP (:" @@ -40,15 +39,22 @@ msgid "" "related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :rfc:`2183`, and :rfc:" "`2231`." msgstr "" +":mod:`!email` パッケージは電子メールメッセージを管理するライブラリです。\n" +"SMTP (:rfc:`2821`)、NNTP などのサーバーへ電子メールを送信するためのものでは *" +"ありません*。\n" +"送信は :mod:`smtplib` などのモジュールが担当します。\n" +":mod:`!email` パッケージは、:rfc:`5322` と :rfc:`6532` に加え、:rfc:`2045`、:" +"rfc:`2046`、:rfc:`2047`、:rfc:`2183`、:rfc:`2231` などの MIME 関連 RFC をサ" +"ポートし、できる限り RFC に準拠することを目指しています。" -#: ../../library/email.rst:20 msgid "" "The overall structure of the email package can be divided into three major " "components, plus a fourth component that controls the behavior of the other " "components." msgstr "" +"email パッケージの全体構造は、主要な 3 つの構成要素と、それらの動作を制御す" +"る 4 つ目の構成要素に分けられます。" -#: ../../library/email.rst:24 msgid "" "The central component of the package is an \"object model\" that represents " "email messages. An application interacts with the package primarily through " @@ -60,8 +66,17 @@ msgid "" "model is a tree structure of objects that all provide the :class:`~email." "message.EmailMessage` API." msgstr "" +"パッケージの中心となる構成要素は、電子メールメッセージを表現する「オブジェク" +"トモデル」です。\n" +"アプリケーションは主に :mod:`~email.message` サブモジュールで定義されたオブ" +"ジェクトモデルのインターフェースを通じて、このパッケージを利用します。\n" +"この API で、既存の電子メールの情報を調べたり、新しい電子メールを作成したり、" +"同じオブジェクトモデルのインターフェースを持つ構成部分を追加・削除したりでき" +"ます。\n" +"つまり、電子メールメッセージとその MIME 構成部分の性質に合わせて、email のオ" +"ブジェクトモデルは、すべてのオブジェクトが :class:`~email.message." +"EmailMessage` API を提供するツリー構造になっています。" -#: ../../library/email.rst:34 msgid "" "The other two major components of the package are the :mod:`~email.parser` " "and the :mod:`~email.generator`. The parser takes the serialized version of " @@ -72,8 +87,15 @@ msgid "" "but this usage is discouraged as it is too easy to end up with messages that " "are not valid in one way or another.)" msgstr "" +"他の 2 つの主要な構成要素は :mod:`~email.parser` と :mod:`~email.generator` " +"です。\n" +"パーサーは、直列化された電子メールメッセージ (バイトストリーム) を受け取り、:" +"class:`~email.message.EmailMessage` オブジェクトのツリーに変換します。\n" +"ジェネレーターは :class:`~email.message.EmailMessage` を受け取り、直列化され" +"たバイトストリームに戻します。\n" +"(パーサーとジェネレーターはテキストの文字ストリームも扱えますが、何らかの点で" +"不正なメッセージができてしまいやすいため、この使い方は推奨しません。)" -#: ../../library/email.rst:43 msgid "" "The control component is the :mod:`~email.policy` module. Every :class:" "`~email.message.EmailMessage`, every :mod:`~email.generator`, and every :mod:" @@ -87,8 +109,20 @@ msgid "" "from disk, but to serialize it using standard SMTP settings when sending it " "to an email server." msgstr "" +"制御を担当する構成要素は :mod:`~email.policy` モジュールです。\n" +"各 :class:`~email.message.EmailMessage`、:mod:`~email.generator`、:mod:" +"`~email.parser` には、それぞれの動作を制御する :mod:`~email.policy` オブジェ" +"クトが関連付けられています。\n" +"通常、アプリケーションがポリシーを指定する必要があるのは :class:`~email." +"message.EmailMessage` の作成時だけです。\n" +"これには、新しい電子メールのために :class:`~email.message.EmailMessage` を直" +"接インスタンス化する場合と、:mod:`~email.parser` で入力ストリームを解析する場" +"合があります。\n" +"ただし、:mod:`~email.generator` でメッセージを直列化するときにポリシーを変更" +"することもできます。\n" +"例えば、ディスク上の一般的な電子メールメッセージを解析し、メールサーバーへ送" +"信するときは標準の SMTP 設定で直列化できます。" -#: ../../library/email.rst:55 msgid "" "The email package does its best to hide the details of the various governing " "RFCs from the application. Conceptually the application should be able to " @@ -104,8 +138,20 @@ msgid "" "modern internet software (not just email), this will be a familiar concept " "to many programmers." msgstr "" +"email パッケージは、関連する各種 RFC の詳細をできるだけアプリケーションから隠" +"します。\n" +"概念的には、アプリケーションは直列化時の表現を気にせず、電子メールメッセージ" +"を Unicode テキストとバイナリ添付ファイルのツリー構造として扱えるはずです。\n" +"しかし実際には、MIME メッセージとその構造を定める規則の少なくとも一部を知って" +"おく必要がよくあります。\n" +"特に、MIME の「コンテントタイプ」の名前や性質と、それによってマルチパート文書" +"を識別する方法です。\n" +"この知識が必要になるのは主に複雑なアプリケーションであり、その場合でも必要な" +"のは通常、構造の大枠についての知識であって、構造の表現方法の詳細ではありませ" +"ん。\n" +"MIME コンテントタイプは、現在のインターネットソフトウェアで電子メール以外にも" +"広く使われているため、多くのプログラマーにはなじみのある概念でしょう。" -#: ../../library/email.rst:68 msgid "" "The following sections describe the functionality of the :mod:`!email` " "package. We start with the :mod:`~email.message` object model, which is the " @@ -114,8 +160,13 @@ msgid "" "mod:`~email.policy` controls, which completes the treatment of the main " "components of the library." msgstr "" +"以下の節では :mod:`!email` パッケージの機能を説明します。\n" +"まず、アプリケーションが主に使うインターフェースである :mod:`~email.message` " +"オブジェクトモデルを説明し、続いて :mod:`~email.parser` と :mod:`~email." +"generator` を取り上げます。\n" +"その後、:mod:`~email.policy` による制御を説明し、ライブラリの主要な構成要素の" +"説明を終えます。" -#: ../../library/email.rst:75 msgid "" "The next three sections cover the exceptions the package may raise and the " "defects (non-compliance with the RFCs) that the :mod:`~email.parser` may " @@ -126,14 +177,18 @@ msgid "" "messages, but also document their extensibility APIs, which will be of " "interest to advanced applications." msgstr "" +"続く 3 つの節では、パッケージが送出する可能性のある例外と、:mod:`~email." +"parser` が検出する可能性のある欠陥 (RFC に準拠していない点) を説明します。\n" +"その後、ヘッダーとペイロードをそれぞれより細かく操作するための :mod:`~email." +"headerregistry` と :mod:`~email.contentmanager` を取り上げます。\n" +"どちらにも複雑なメッセージの処理や作成に役立つ機能がありますが、高度なアプリ" +"ケーション向けの拡張用 API についても説明します。" -#: ../../library/email.rst:84 msgid "" "Following those is a set of examples of using the fundamental parts of the " "APIs covered in the preceding sections." -msgstr "" +msgstr "続いて、それまでの節で説明した API の基本部分を使う例を示します。" -#: ../../library/email.rst:87 msgid "" "The foregoing represent the modern (Unicode friendly) API of the email " "package. The remaining sections, starting with the :class:`~email.message." @@ -145,16 +200,24 @@ msgid "" "relevant for applications that are still using the :mod:`~email.policy." "compat32` API for backward compatibility reasons." msgstr "" +"ここまでが、email パッケージの現代的な、Unicode を扱いやすい API です。\n" +":class:`~email.message.Message` クラスから始まる残りの節では、電子メールメッ" +"セージの表現方法の詳細をより直接的に扱う、従来の :data:`~email.policy." +"compat32` API を説明します。\n" +":data:`~email.policy.compat32` API は RFC の詳細をアプリケーションから隠し *" +"ません* が、その水準で操作する必要があるアプリケーションには役立ちます。\n" +"この説明は、後方互換性のために引き続き :mod:`~email.policy.compat32` API を使" +"用しているアプリケーションにも関係します。" -#: ../../library/email.rst:97 msgid "" "Docs reorganized and rewritten to promote the new :class:`~email.message." "EmailMessage`/:class:`~email.policy.EmailPolicy` API." msgstr "" +"新しい :class:`~email.message.EmailMessage`/:class:`~email.policy." +"EmailPolicy` API の利用を促すため、ドキュメントを再構成し、書き直しました。" -#: ../../library/email.rst:102 msgid "Contents of the :mod:`!email` package documentation:" -msgstr "" +msgstr ":mod:`!email` パッケージのドキュメントの目次:" #: ../../library/email.rst:117 msgid "Legacy API:" @@ -188,8 +251,9 @@ msgstr "IMAP (Internet Message Access Protocol) クライアント" msgid "Module :mod:`mailbox`" msgstr ":mod:`mailbox` モジュール" -#: ../../library/email.rst:142 msgid "" "Tools for creating, reading, and managing collections of messages on disk " "using a variety standard formats." msgstr "" +"さまざまな標準形式でディスク上のメッセージの集まりを作成、読み込み、管理する" +"ためのツール。" diff --git a/library/email.policy.po b/library/email.policy.po index 4b8fd3e19..8ff76113b 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -22,9 +22,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.policy.rst:2 msgid ":mod:`!email.policy`: Policy Objects" -msgstr "" +msgstr ":mod:`!email.policy`: ポリシーオブジェクト" #: ../../library/email.policy.rst:9 msgid "**Source code:** :source:`Lib/email/policy.py`" @@ -63,7 +62,6 @@ msgstr "" "これらのばらばらな用途に対応するためPolicyオブジェクトはEメールパッケージに対" "して柔軟性を提供します。" -#: ../../library/email.policy.rst:28 msgid "" "A :class:`Policy` object encapsulates a set of attributes and methods that " "control the behavior of various components of the email package during use. :" @@ -71,8 +69,12 @@ msgid "" "email package to alter the default behavior. The settable values and their " "defaults are described below." msgstr "" +":class:`Policy` オブジェクトは、email パッケージの各部の動作を制御する属性と" +"メソッドをまとめたものです。\n" +"email パッケージの各種クラスやメソッドに :class:`Policy` インスタンスを渡すこ" +"とで、デフォルトの動作を変更できます。\n" +"設定できる値とそのデフォルト値を以下で説明します。" -#: ../../library/email.policy.rst:34 msgid "" "There is a default policy used by all classes in the email package. For all " "of the :mod:`~email.parser` classes and the related convenience functions, " @@ -82,15 +84,22 @@ msgid "" "some cases, including bug compatibility) with the pre-Python3.3 version of " "the email package." msgstr "" +"email パッケージの各クラスにはデフォルトのポリシーがあります。\n" +":mod:`~email.parser` のすべてのクラスと関連する便利な関数、および :class:" +"`~email.message.Message` クラスでは、:class:`Compat32` ポリシーの定義済みイン" +"スタンス :const:`compat32` が使われます。\n" +"このポリシーは Python 3.3 より前の email パッケージと完全な後方互換性を提供し" +"ます (場合によってはバグとの互換性も含みます)。" -#: ../../library/email.policy.rst:41 msgid "" "This default value for the *policy* keyword to :class:`~email.message." "EmailMessage` is the :class:`EmailPolicy` policy, via its pre-defined " "instance :data:`~default`." msgstr "" +":class:`~email.message.EmailMessage` のキーワード引数 *policy* のデフォルト" +"は、:class:`EmailPolicy` ポリシーの定義済みインスタンス :data:`~default` で" +"す。" -#: ../../library/email.policy.rst:45 msgid "" "When a :class:`~email.message.Message` or :class:`~email.message." "EmailMessage` object is created, it acquires a policy. If the message is " @@ -101,8 +110,15 @@ msgid "" "policy from the message by default, but you can also pass a specific policy " "to the generator that will override the one stored on the message object." msgstr "" +":class:`~email.message.Message` または :class:`~email.message.EmailMessage` " +"オブジェクトには、作成時にポリシーが設定されます。\n" +":mod:`~email.parser` でメッセージを作成する場合は、パーザに渡したポリシーがそ" +"のメッセージに使われます。\n" +"プログラムでメッセージを作成する場合は、作成時にポリシーを指定できます。\n" +"メッセージを :mod:`~email.generator` に渡すと、デフォルトではメッセージのポリ" +"シーが使われますが、ジェネレータに特定のポリシーを渡してメッセージオブジェク" +"トに格納されたポリシーの代わりに使うこともできます。" -#: ../../library/email.policy.rst:54 msgid "" "The default value for the *policy* keyword for the :mod:`email.parser` " "classes and the parser convenience functions **will be changing** in a " @@ -110,8 +126,11 @@ msgid "" "which policy you want to use** when calling any of the classes and functions " "described in the :mod:`~email.parser` module." msgstr "" +":mod:`email.parser` のクラスとパーザ用の便利な関数のキーワード引数 *policy* " +"のデフォルト値は、将来の Python バージョンで **変更される予定です**。\n" +"このため :mod:`~email.parser` モジュールで説明するクラスや関数を呼び出すとき" +"は、**使用するポリシーを常に明示的に指定してください**。" -#: ../../library/email.policy.rst:60 msgid "" "The first part of this documentation covers the features of :class:`Policy`, " "an :term:`abstract base class` that defines the features that are common to " @@ -122,21 +141,33 @@ msgid "" "which implement the hooks that provide the standard behavior and the " "backward compatible behavior and features, respectively." msgstr "" +"このドキュメントの前半では、:const:`compat32` を含むすべてのポリシーオブジェ" +"クトに共通の機能を定義する :term:`抽象基底クラス `、:" +"class:`Policy` の機能を説明します。\n" +"これには email パッケージが内部で呼び出すフックメソッドも含まれ、独自のポリ" +"シーでオーバーライドすると動作を変更できます。\n" +"後半では具象クラス :class:`EmailPolicy` と :class:`Compat32` を説明します。\n" +"これらはそれぞれ、標準の動作を提供するフックと、後方互換の動作や機能を提供す" +"るフックを実装します。" -#: ../../library/email.policy.rst:69 msgid "" ":class:`Policy` instances are immutable, but they can be cloned, accepting " "the same keyword arguments as the class constructor and returning a new :" "class:`Policy` instance that is a copy of the original but with the " "specified attributes values changed." msgstr "" +":class:`Policy` インスタンスはイミュータブルですが、複製できます。\n" +"クラスのコンストラクタと同じキーワード引数を受け取り、元のインスタンスをコ" +"ピーして指定された属性の値を変更した新しい :class:`Policy` インスタンスを返し" +"ます。" -#: ../../library/email.policy.rst:74 msgid "" "As an example, the following code could be used to read an email message " "from a file on disk and pass it to the system ``sendmail`` program on a Unix " "system:" msgstr "" +"例えば次のコードは、ディスク上のファイルから電子メールメッセージを読み込み、" +"Unix システムの ``sendmail`` プログラムに渡します:" #: ../../library/email.policy.rst:89 msgid "" @@ -154,15 +185,17 @@ msgid "" ">>> rc = p.wait()" msgstr "" -#: ../../library/email.policy.rst:111 msgid "" "Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC " "correct line separator characters when creating the binary string to feed " "into ``sendmail's`` ``stdin``, where the default policy would use ``\\n`` " "line separators." msgstr "" +"ここでは、``sendmail`` の ``stdin`` に渡すバイナリ文字列を作成するときに、" +"RFC に従った改行文字を使うよう :class:`~email.generator.BytesGenerator` に指" +"定しています。\n" +"デフォルトのポリシーでは改行文字に ``\\n`` を使います。" -#: ../../library/email.policy.rst:116 msgid "" "Some email package methods accept a *policy* keyword argument, allowing the " "policy to be overridden for that method. For example, the following code " @@ -170,14 +203,22 @@ msgid "" "from the previous example and writes the message to a file using the native " "line separators for the platform on which it is running::" msgstr "" +"email パッケージの一部のメソッドはキーワード引数 *policy* を受け取り、そのメ" +"ソッドで使うポリシーを変更できます。\n" +"例えば次のコードは、前の例の *msg* オブジェクトの :meth:`~email.message." +"Message.as_bytes` メソッドを使い、実行しているプラットフォーム固有の改行文字" +"でメッセージをファイルに書き込みます。 ::" -#: ../../library/email.policy.rst:122 msgid "" ">>> import os\n" ">>> with open('converted.txt', 'wb') as f:\n" "... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))\n" "17" msgstr "" +">>> import os\n" +">>> with open('converted.txt', 'wb') as f:\n" +"... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))\n" +"17" #: ../../library/email.policy.rst:127 msgid "" @@ -189,12 +230,14 @@ msgstr "" "のオブジェクトの非デフォルト値を組み合わせた設定を持つPolicyオブジェクトを生" "成します::" -#: ../../library/email.policy.rst:131 msgid "" ">>> compat_SMTP = policy.compat32.clone(linesep='\\r\\n')\n" ">>> compat_strict = policy.compat32.clone(raise_on_defect=True)\n" ">>> compat_strict_SMTP = compat_SMTP + compat_strict" msgstr "" +">>> compat_SMTP = policy.compat32.clone(linesep='\\r\\n')\n" +">>> compat_strict = policy.compat32.clone(raise_on_defect=True)\n" +">>> compat_strict_SMTP = compat_SMTP + compat_strict" #: ../../library/email.policy.rst:135 msgid "" @@ -204,7 +247,6 @@ msgstr "" "この操作には交換法則が成り立ちません。つまり、オブジェクトを加える順番に結果" "が依存します。次のように説明できます::" -#: ../../library/email.policy.rst:138 msgid "" ">>> policy100 = policy.compat32.clone(max_line_length=100)\n" ">>> policy80 = policy.compat32.clone(max_line_length=80)\n" @@ -215,16 +257,26 @@ msgid "" ">>> apolicy.max_line_length\n" "100" msgstr "" +">>> policy100 = policy.compat32.clone(max_line_length=100)\n" +">>> policy80 = policy.compat32.clone(max_line_length=80)\n" +">>> apolicy = policy100 + policy80\n" +">>> apolicy.max_line_length\n" +"80\n" +">>> apolicy = policy80 + policy100\n" +">>> apolicy.max_line_length\n" +"100" -#: ../../library/email.policy.rst:150 msgid "" "This is the :term:`abstract base class` for all policy classes. It provides " "default implementations for a couple of trivial methods, as well as the " "implementation of the immutability property, the :meth:`clone` method, and " "the constructor semantics." msgstr "" +"すべてのポリシークラスの :term:`抽象基底クラス ` で" +"す。\n" +"いくつかの単純なメソッドのデフォルト実装に加え、イミュータブルにする仕組み、:" +"meth:`clone` メソッド、コンストラクタの動作を実装しています。" -#: ../../library/email.policy.rst:155 msgid "" "The constructor of a policy class can be passed various keyword arguments. " "The arguments that may be specified are any non-method properties on this " @@ -232,12 +284,18 @@ msgid "" "value specified in the constructor will override the default value for the " "corresponding attribute." msgstr "" +"ポリシークラスのコンストラクタには、さまざまなキーワード引数を渡せます。\n" +"指定できる引数は、このクラスと具象クラスにあるメソッド以外のすべてのプロパ" +"ティです。\n" +"コンストラクタに値を指定すると、対応する属性のデフォルト値が置き換えられま" +"す。" -#: ../../library/email.policy.rst:161 msgid "" "This class defines the following properties, and thus values for the " "following may be passed in the constructor of any policy class:" msgstr "" +"このクラスは以下のプロパティを定義しているため、どのポリシークラスのコンスト" +"ラクタでもこれらの値を指定できます:" #: ../../library/email.policy.rst:167 msgid "" @@ -249,72 +307,91 @@ msgstr "" "トは :rfc:`5322` に従い78となっています。値が ``0`` または :const:`None` の場" "合は行の折り返しを全くしないべきであるということを示します。" -#: ../../library/email.policy.rst:175 msgid "" "The string to be used to terminate lines in serialized output. The default " "is ``\\n`` because that's the internal end-of-line discipline used by " "Python, though ``\\r\\n`` is required by the RFCs." msgstr "" +"シリアライズした出力の行末に使う文字列です。\n" +"RFC では ``\\r\\n`` が必要ですが、Python が内部で使う改行規則に合わせ、デフォ" +"ルトは ``\\n`` です。" -#: ../../library/email.policy.rst:182 msgid "" "Controls the type of Content Transfer Encodings that may be or are required " "to be used. The possible values are:" msgstr "" +"使用可能な、または使用が必要な Content Transfer Encoding の種類を制御しま" +"す。\n" +"指定できる値は次のとおりです:" #: ../../library/email.policy.rst:188 msgid "``7bit``" msgstr "``7bit``" -#: ../../library/email.policy.rst:188 msgid "" "all data must be \"7 bit clean\" (ASCII-only). This means that where " "necessary data will be encoded using either quoted-printable or base64 " "encoding." msgstr "" +"すべてのデータを「7 ビットクリーン」(ASCII のみ) にする必要があります。\n" +"このため必要に応じて quoted-printable または base64 でデータをエンコードしま" +"す。" #: ../../library/email.policy.rst:192 msgid "``8bit``" msgstr "``8bit``" -#: ../../library/email.policy.rst:192 msgid "" "data is not constrained to be 7 bit clean. Data in headers is still " "required to be ASCII-only and so will be encoded (see :meth:`fold_binary` " "and :attr:`~EmailPolicy.utf8` below for exceptions), but body parts may use " "the ``8bit`` CTE." msgstr "" +"データを 7 ビットクリーンにする必要はありません。\n" +"ヘッダ内のデータは依然として ASCII のみに制限されるためエンコードされますが " +"(例外については以下の :meth:`fold_binary` と :attr:`~EmailPolicy.utf8` を参" +"照)、本体の各部分では ``8bit`` の CTE を使えます。" -#: ../../library/email.policy.rst:198 msgid "" "A ``cte_type`` value of ``8bit`` only works with ``BytesGenerator``, not " "``Generator``, because strings cannot contain binary data. If a " "``Generator`` is operating under a policy that specifies ``cte_type=8bit``, " "it will act as if ``cte_type`` is ``7bit``." msgstr "" +"文字列はバイナリデータを含められないため、``cte_type`` の値 ``8bit`` は " +"``BytesGenerator`` でのみ機能し、``Generator`` では機能しません。\n" +"``Generator`` が ``cte_type=8bit`` を指定したポリシーで動作する場合は、" +"``cte_type`` が ``7bit`` であるかのように動作します。" -#: ../../library/email.policy.rst:206 msgid "" "If :const:`True`, any defects encountered will be raised as errors. If :" "const:`False` (the default), defects will be passed to the :meth:" "`register_defect` method." msgstr "" +":const:`True` の場合、見つかった不具合はすべてエラーとして送出されます。\n" +":const:`False` (デフォルト) の場合、不具合は :meth:`register_defect` メソッド" +"に渡されます。" -#: ../../library/email.policy.rst:213 msgid "" "If :const:`True`, lines starting with *\"From \"* in the body are escaped by " "putting a ``>`` in front of them. This parameter is used when the message is " "being serialized by a generator. Default: :const:`False`." msgstr "" +":const:`True` の場合、本体内で *\"From \"* で始まる行は先頭に ``>`` を付けて" +"エスケープされます。\n" +"このパラメータはジェネレータがメッセージをシリアライズするときに使います。\n" +"デフォルトは :const:`False` です。" -#: ../../library/email.policy.rst:223 msgid "" "A factory function for constructing a new empty message object. Used by the " "parser when building messages. Defaults to ``None``, in which case :class:" "`~email.message.Message` is used." msgstr "" +"新しい空のメッセージオブジェクトを作成するファクトリ関数です。\n" +"パーザがメッセージを組み立てるときに使います。\n" +"デフォルトは ``None`` で、この場合は :class:`~email.message.Message` を使いま" +"す。" -#: ../../library/email.policy.rst:232 msgid "" "If ``True`` (the default), the generator will raise :exc:`~email.errors." "HeaderWriteError` instead of writing a header that is improperly folded or " @@ -322,33 +399,47 @@ msgid "" "adjacent data. Such headers can be generated by custom header classes or " "bugs in the ``email`` module." msgstr "" +"``True`` (デフォルト) の場合、折り返しや区切りが不適切で、複数のヘッダとして" +"解析されたり隣接するデータと結合されたりするヘッダを書き込む代わりに、ジェネ" +"レータは :exc:`~email.errors.HeaderWriteError` を送出します。\n" +"このようなヘッダは独自のヘッダクラスや ``email`` モジュールのバグによって生成" +"される可能性があります。" -#: ../../library/email.policy.rst:239 msgid "" "As it's a security feature, this defaults to ``True`` even in the :class:" "`~email.policy.Compat32` policy. For backwards compatible, but unsafe, " "behavior, it must be set to ``False`` explicitly." msgstr "" +"セキュリティ機能であるため、:class:`~email.policy.Compat32` ポリシーでもデ" +"フォルトは ``True`` です。\n" +"安全ではありませんが後方互換の動作にするには、明示的に ``False`` に設定しなけ" +"ればなりません。" -#: ../../library/email.policy.rst:247 msgid "" "The following :class:`Policy` method is intended to be called by code using " "the email library to create policy instances with custom settings:" msgstr "" +"次の :class:`Policy` メソッドは、email ライブラリを使うコードから呼び出して、" +"設定を変更したポリシーのインスタンスを作成するためのものです:" -#: ../../library/email.policy.rst:253 msgid "" "Return a new :class:`Policy` instance whose attributes have the same values " "as the current instance, except where those attributes are given new values " "by the keyword arguments." msgstr "" +"現在のインスタンスと同じ属性値を持つ新しい :class:`Policy` インスタンスを返し" +"ます。\n" +"ただし、キーワード引数で指定された属性は新しい値になります。" -#: ../../library/email.policy.rst:258 msgid "" "The remaining :class:`Policy` methods are called by the email package code, " "and are not intended to be called by an application using the email package. " "A custom policy must implement all of these methods." msgstr "" +"残りの :class:`Policy` メソッドは email パッケージのコードから呼び出すもの" +"で、email パッケージを使うアプリケーションから呼び出すためのものではありませ" +"ん。\n" +"独自のポリシーはこれらのメソッドをすべて実装しなければなりません。" #: ../../library/email.policy.rst:265 msgid "" @@ -356,12 +447,15 @@ msgid "" "*defect* will always be a subclass of :class:`~email.errors.MessageDefect`." msgstr "" -#: ../../library/email.policy.rst:269 msgid "" "The default implementation checks the :attr:`raise_on_defect` flag. If it " "is ``True``, *defect* is raised as an exception. If it is ``False`` (the " "default), *obj* and *defect* are passed to :meth:`register_defect`." msgstr "" +"デフォルトの実装は :attr:`raise_on_defect` フラグを調べます。\n" +"``True`` の場合、*defect* を例外として送出します。\n" +"``False`` (デフォルト) の場合、*obj* と *defect* を :meth:`register_defect` " +"に渡します。" #: ../../library/email.policy.rst:276 msgid "" @@ -369,7 +463,6 @@ msgid "" "a subclass of :class:`~email.errors.MessageDefect`." msgstr "" -#: ../../library/email.policy.rst:279 msgid "" "The default implementation calls the ``append`` method of the ``defects`` " "attribute of *obj*. When the email package calls :attr:`handle_defect`, " @@ -378,20 +471,29 @@ msgid "" "custom ``Message`` objects) should also provide such an attribute, otherwise " "defects in parsed messages will raise unexpected errors." msgstr "" +"デフォルトの実装は、*obj* の ``defects`` 属性の ``append`` メソッドを呼び出し" +"ます。\n" +"email パッケージが :attr:`handle_defect` を呼び出すとき、通常 *obj* には " +"``append`` メソッドを持つ ``defects`` 属性があります。\n" +"email パッケージとともに使う独自のオブジェクト型 (例えば独自の ``Message`` オ" +"ブジェクト) もこの属性を提供する必要があります。\n" +"そうしないと、解析したメッセージの不具合が予期しないエラーを引き起こします。" #: ../../library/email.policy.rst:289 msgid "Return the maximum allowed number of headers named *name*." msgstr "*name* というヘッダに許される最大の数を返します。" -#: ../../library/email.policy.rst:291 msgid "" "Called when a header is added to an :class:`~email.message.EmailMessage` or :" "class:`~email.message.Message` object. If the returned value is not ``0`` " "or ``None``, and there are already a number of headers with the name *name* " "greater than or equal to the value returned, a :exc:`ValueError` is raised." msgstr "" +":class:`~email.message.EmailMessage` または :class:`~email.message.Message` " +"オブジェクトにヘッダを追加するときに呼び出されます。\n" +"返り値が ``0`` でも ``None`` でもなく、*name* という名前のヘッダがすでに返り" +"値以上の個数存在する場合、:exc:`ValueError` が送出されます。" -#: ../../library/email.policy.rst:297 msgid "" "Because the default behavior of ``Message.__setitem__`` is to append the " "value to the list of headers, it is easy to create duplicate headers without " @@ -400,12 +502,17 @@ msgid "" "programmatically. (The limit is not observed by the parser, which will " "faithfully produce as many headers as exist in the message being parsed.)" msgstr "" +"``Message.__setitem__`` のデフォルトの動作はヘッダのリストへの追加であるた" +"め、気付かないうちにヘッダを重複させてしまいがちです。\n" +"このメソッドを使うと、特定のヘッダについて、プログラムから ``Message`` に追加" +"できる個数を制限できます。\n" +"(パーザはこの制限に従わず、解析対象のメッセージにあるヘッダをその個数のまま忠" +"実に生成します。)" #: ../../library/email.policy.rst:305 msgid "The default implementation returns ``None`` for all header names." msgstr "デフォルトの実装は全てのヘッダ名に ``None`` を返します。" -#: ../../library/email.policy.rst:310 msgid "" "The email package calls this method with a list of strings, each string " "ending with the line separation characters found in the source being " @@ -414,8 +521,13 @@ msgid "" "``(name, value)`` tuple that is to be stored in the ``Message`` to represent " "the parsed header." msgstr "" +"email パッケージは文字列のリストを渡してこのメソッドを呼び出します。\n" +"各文字列は解析対象の入力にあった改行文字で終わります。\n" +"最初の行にはヘッダのフィールド名と区切り文字が含まれます。\n" +"入力中の空白文字はすべて保持されます。\n" +"このメソッドは、解析したヘッダを表すために ``Message`` に格納する ``(name, " +"value)`` タプルを返す必要があります。" -#: ../../library/email.policy.rst:317 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, *name* should be the case preserved name (all characters " @@ -423,6 +535,11 @@ msgid "" "(all line separator characters removed, but whitespace kept intact), " "stripped of leading whitespace." msgstr "" +"既存の email パッケージのポリシーとの互換性を維持するには、*name* は大文字・" +"小文字を保持した名前 (区切り文字「``:``」より前のすべての文字) にしてくださ" +"い。\n" +"*value* は折り返しを解除した値 (すべての改行文字を削除し、空白文字は保持した" +"もの) から先頭の空白文字を取り除いたものにしてください。" #: ../../library/email.policy.rst:323 msgid "*sourcelines* may contain surrogateescaped binary data." @@ -435,7 +552,6 @@ msgstr "" msgid "There is no default implementation" msgstr "デフォルトの実装はありません。" -#: ../../library/email.policy.rst:330 msgid "" "The email package calls this method with the name and value provided by the " "application program when the application program is modifying a ``Message`` " @@ -443,15 +559,21 @@ msgid "" "method should return the ``(name, value)`` tuple that is to be stored in the " "``Message`` to represent the header." msgstr "" +"アプリケーションプログラムが ``Message`` をプログラムで変更する場合 (パーザに" +"よる作成とは異なります)、email パッケージはそのプログラムが指定した名前と値を" +"渡してこのメソッドを呼び出します。\n" +"このメソッドは、ヘッダを表すために ``Message`` に格納する ``(name, value)`` " +"タプルを返す必要があります。" -#: ../../library/email.policy.rst:336 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, the *name* and *value* should be strings or string " "subclasses that do not change the content of the passed in arguments." msgstr "" +"既存の email パッケージのポリシーとの互換性を維持するには、*name* と *value* " +"は文字列または文字列のサブクラスで、渡された引数の内容を変更しないものにして" +"ください。" -#: ../../library/email.policy.rst:346 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` when that header is requested by the application " @@ -461,6 +583,13 @@ msgid "" "method is passed the specific name and value of the header destined to be " "returned to the application." msgstr "" +"アプリケーションプログラムがヘッダを要求すると、email パッケージは現在 " +"``Message`` に格納されている *name* と *value* を渡してこのメソッドを呼び出し" +"ます。\n" +"このメソッドの返り値が、取得するヘッダの値としてアプリケーションに渡されま" +"す。\n" +"``Message`` には同名のヘッダが複数格納されていることがあります。\n" +"このメソッドには、アプリケーションに返す対象のヘッダの名前と値が渡されます。" #: ../../library/email.policy.rst:354 msgid "" @@ -471,7 +600,6 @@ msgstr "" "のメソッドの返り値にはサロゲートエスケープされたバイナリーデータはありませ" "ん。" -#: ../../library/email.policy.rst:362 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` for a given header. The method should return a " @@ -480,6 +608,12 @@ msgid "" "attr:`linesep` characters at the appropriate places. See :rfc:`5322` for a " "discussion of the rules for folding email headers." msgstr "" +"email パッケージは、対象のヘッダについて現在 ``Message`` に格納されている " +"*name* と *value* を渡してこのメソッドを呼び出します。\n" +"このメソッドは *name* と *value* を組み合わせ、適切な位置に :attr:`linesep` " +"の文字を挿入して、ポリシーの設定に従って正しく「折り返した」ヘッダを表す文字" +"列を返す必要があります。\n" +"電子メールのヘッダの折り返し規則については :rfc:`5322` を参照してください。" #: ../../library/email.policy.rst:369 msgid "" @@ -506,38 +640,45 @@ msgstr "" "*value* はサロゲートエスケープされたバイナリデータを持つことがあります。これ" "らは返されたbytesオブジェクト内でバイナリデータに変換されることがあります。" -#: ../../library/email.policy.rst:385 msgid "" "This concrete :class:`Policy` provides behavior that is intended to be fully " "compliant with the current email RFCs. These include (but are not limited " "to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." msgstr "" +"この具象 :class:`Policy` は、現行の電子メールの RFC に完全に準拠することを意" +"図した動作を提供します。\n" +"対象には :rfc:`5322`、:rfc:`2047`、現行の MIME の RFC などが含まれます。" -#: ../../library/email.policy.rst:389 msgid "" "This policy adds new header parsing and folding algorithms. Instead of " "simple strings, headers are ``str`` subclasses with attributes that depend " "on the type of the field. The parsing and folding algorithm fully " "implement :rfc:`2047` and :rfc:`5322`." msgstr "" +"このポリシーはヘッダの解析と折り返しに新しいアルゴリズムを導入します。\n" +"ヘッダは単純な文字列ではなく、フィールドの種類に応じた属性を持つ ``str`` のサ" +"ブクラスになります。\n" +"解析と折り返しのアルゴリズムは :rfc:`2047` と :rfc:`5322` を完全に実装してい" +"ます。" -#: ../../library/email.policy.rst:394 msgid "" "The default value for the :attr:`~email.policy.Policy.message_factory` " "attribute is :class:`~email.message.EmailMessage`." msgstr "" +":attr:`~email.policy.Policy.message_factory` 属性のデフォルト値は :class:" +"`~email.message.EmailMessage` です。" -#: ../../library/email.policy.rst:397 msgid "" "In addition to the settable attributes listed above that apply to all " "policies, this policy adds the following additional attributes:" msgstr "" +"すべてのポリシーに適用される、上記の設定可能な属性に加え、このポリシーには以" +"下の属性があります:" #: ../../library/email.policy.rst:400 msgid "[1]_" msgstr "[1]_" -#: ../../library/email.policy.rst:405 msgid "" "If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers " "by encoding them as :rfc:`2047` \"encoded words\". If ``True``, follow :rfc:" @@ -545,8 +686,13 @@ msgid "" "way may be passed to SMTP servers that support the ``SMTPUTF8`` extension (:" "rfc:`6531`)." msgstr "" +"``False`` の場合は :rfc:`5322` に従い、ヘッダ内の非 ASCII 文字を :rfc:`2047` " +"の \"encoded words\" としてエンコードします。\n" +"``True`` の場合は :rfc:`6532` に従い、ヘッダに ``utf-8`` エンコーディングを使" +"います。\n" +"この形式のメッセージは ``SMTPUTF8`` 拡張 (:rfc:`6531`) をサポートする SMTP " +"サーバーに渡せます。" -#: ../../library/email.policy.rst:411 msgid "" "When ``False``, the generator will raise :exc:`~email.errors." "HeaderWriteError` if any header includes non-ASCII characters in a context " @@ -558,53 +704,66 @@ msgid "" "idna`. It is not possible to use a non-ASCII username (\"local-part\") in a " "mailbox when ``utf8=False``." msgstr "" +"``False`` の場合、:rfc:`2047` で encoded words が許可されていない位置に非 " +"ASCII 文字を含むヘッダがあると、ジェネレータは :exc:`~email.errors." +"HeaderWriteError` を送出します。\n" +"特に、:class:`~email.headerregistry.Address` で作成できる、非 ASCII 文字を含" +"むメールボックス (\"addr-spec\") がこれに該当します。\n" +"``utf8=False`` で非 ASCII のドメイン名を持つメールボックスを使うには、まず" +"サードパーティーの :pypi:`idna` や :pypi:`uts46` モジュール、または :mod:" +"`encodings.idna` でドメイン名をエンコードしてください。\n" +"``utf8=False`` の場合、メールボックスに非 ASCII のユーザー名 (\"local-" +"part\") は使えません。" -#: ../../library/email.policy.rst:422 msgid "" "Can trigger the raising of :exc:`~email.errors.HeaderWriteError`. (Earlier " "versions incorrectly applied :rfc:`2047` in certain contexts, mostly notably " "in addr-specs.)" msgstr "" +":exc:`~email.errors.HeaderWriteError` が送出されることがあります。\n" +"(以前のバージョンでは、特に addr-spec などの一部の位置で :rfc:`2047` が誤って" +"適用されていました。)" -#: ../../library/email.policy.rst:429 msgid "" "If the value for a header in the ``Message`` object originated from a :mod:" "`~email.parser` (as opposed to being set by a program), this attribute " "indicates whether or not a generator should refold that value when " "transforming the message back into serialized form. The possible values are:" msgstr "" +"``Message`` オブジェクト内のヘッダの値が、プログラムによる設定ではなく :mod:" +"`~email.parser` による解析で得られた場合、この属性はメッセージをシリアライズ" +"された形式に戻す際にジェネレータがその値を折り返し直すかどうかを示します。\n" +"指定できる値は次のとおりです:" #: ../../library/email.policy.rst:436 msgid "``none``" msgstr "``none``" -#: ../../library/email.policy.rst:436 msgid "all source values use original folding" -msgstr "" +msgstr "入力から得られたすべての値について、元の折り返しを使います。" #: ../../library/email.policy.rst:438 msgid "``long``" msgstr "``long``" -#: ../../library/email.policy.rst:438 msgid "" "source values that have any line that is longer than ``max_line_length`` " "will be refolded" msgstr "" +"入力から得られた値に ``max_line_length`` を超える長さの行がある場合、その値を" +"折り返し直します。" #: ../../library/email.policy.rst:441 msgid "``all``" msgstr "``all``" -#: ../../library/email.policy.rst:441 msgid "all values are refolded." -msgstr "" +msgstr "すべての値を折り返し直します。" #: ../../library/email.policy.rst:444 msgid "The default is ``long``." msgstr "デフォルトは ``long`` です。" -#: ../../library/email.policy.rst:449 msgid "" "A callable that takes two arguments, ``name`` and ``value``, where ``name`` " "is a header field name and ``value`` is an unfolded header field value, and " @@ -614,8 +773,14 @@ msgid "" "field types, and the major MIME header field stypes. Support for additional " "custom parsing will be added in the future." msgstr "" +"ヘッダのフィールド名 ``name`` と折り返しを解除したフィールド値 ``value`` の " +"2 つの引数を取り、そのヘッダを表す文字列のサブクラスを返す呼び出し可能オブ" +"ジェクトです。\n" +"デフォルトの ``header_factory`` (:mod:`~email.headerregistry` を参照) は、:" +"RFC:`5322` の各種アドレス・日付ヘッダフィールドと、主要な MIME ヘッダフィール" +"ドに応じた解析をサポートしています。\n" +"今後、さらに独自の解析への対応が追加される予定です。" -#: ../../library/email.policy.rst:460 msgid "" "An object with at least two methods: get_content and set_content. When the :" "meth:`~email.message.EmailMessage.get_content` or :meth:`~email.message." @@ -625,6 +790,16 @@ msgid "" "that were passed to it as additional arguments. By default " "``content_manager`` is set to :data:`~email.contentmanager.raw_data_manager`." msgstr "" +"少なくとも ``get_content`` と ``set_content`` の 2 つのメソッドを持つオブジェ" +"クトです。\n" +":class:`~email.message.EmailMessage` オブジェクトの :meth:`~email.message." +"EmailMessage.get_content` または :meth:`~email.message.EmailMessage." +"set_content` メソッドが呼び出されると、このオブジェクトの対応するメソッドを呼" +"び出します。\n" +"その際、最初の引数としてメッセージオブジェクトを渡し、元の呼び出しで渡された" +"引数やキーワード引数を追加の引数として渡します。\n" +"デフォルトでは ``content_manager`` は :data:`~email.contentmanager." +"raw_data_manager` に設定されています。" #: ../../library/email.policy.rst:472 ../../library/email.policy.rst:630 msgid "" @@ -632,22 +807,24 @@ msgid "" "methods of :class:`Policy`:" msgstr "このクラスは :class:`Policy` の抽象メソッドの具象実装を提供します:" -#: ../../library/email.policy.rst:478 msgid "" "Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` " "attribute of the specialized class used to represent the header with the " "given name." msgstr "" +"指定された名前のヘッダを表す専用クラスの :attr:`~email.headerregistry." +"BaseHeader.max_count` 属性の値を返します。" -#: ../../library/email.policy.rst:486 ../../library/email.policy.rst:636 msgid "" "The name is parsed as everything up to the '``:``' and returned unmodified. " "The value is determined by stripping leading whitespace off the remainder of " "the first line, joining all subsequent lines together, and stripping any " "trailing carriage return or linefeed characters." msgstr "" +"名前は「``:``」より前のすべての文字として解析され、そのまま返されます。\n" +"値は、最初の行の残りから先頭の空白文字を取り除き、その後のすべての行を連結" +"し、末尾の復帰文字や改行文字を取り除いて求めます。" -#: ../../library/email.policy.rst:494 msgid "" "The name is returned unchanged. If the input value has a ``name`` attribute " "and it matches *name* ignoring case, the value is returned unchanged. " @@ -655,8 +832,14 @@ msgid "" "resulting header object is returned as the value. In this case a " "``ValueError`` is raised if the input value contains CR or LF characters." msgstr "" +"名前は変更せずに返します。\n" +"入力値に ``name`` 属性があり、大文字・小文字を区別せずに *name* と一致する場" +"合、値はそのまま返します。\n" +"それ以外の場合は *name* と *value* を ``header_factory`` に渡し、得られたヘッ" +"ダオブジェクトを値として返します。\n" +"この場合、入力値に CR または LF 文字が含まれていると ``ValueError`` を送出し" +"ます。" -#: ../../library/email.policy.rst:504 msgid "" "If the value has a ``name`` attribute, it is returned to unmodified. " "Otherwise the *name*, and the *value* with any CR or LF characters removed, " @@ -664,8 +847,12 @@ msgid "" "returned. Any surrogateescaped bytes get turned into the Unicode unknown-" "character glyph." msgstr "" +"値に ``name`` 属性がある場合は、そのまま返します。\n" +"それ以外の場合は、*name* と、CR や LF 文字を取り除いた *value* を " +"``header_factory`` に渡し、得られたヘッダオブジェクトを返します。\n" +"サロゲートエスケープされたバイトは Unicode の不明な文字を表す記号に置き換えら" +"れます。" -#: ../../library/email.policy.rst:513 msgid "" "Header folding is controlled by the :attr:`refold_source` policy setting. A " "value is considered to be a 'source value' if and only if it does not have a " @@ -676,8 +863,15 @@ msgid "" "Folding of a header object is done by calling its ``fold`` method with the " "current policy." msgstr "" +"ヘッダの折り返しはポリシーの :attr:`refold_source` 設定で制御します。\n" +"``name`` 属性を持たない値だけを「入力から得られた値」とみなします (``name`` " +"属性がある場合は何らかのヘッダオブジェクトです)。\n" +"ポリシーに従って入力から得られた値を折り返し直す必要がある場合は、*name* と、" +"CR や LF 文字を取り除いた *value* を ``header_factory`` に渡し、ヘッダオブ" +"ジェクトに変換します。\n" +"ヘッダオブジェクトの折り返しは、現在のポリシーを渡してその ``fold`` メソッド" +"を呼び出すことで行います。" -#: ../../library/email.policy.rst:522 msgid "" "Source values are split into lines using :meth:`~str.splitlines`. If the " "value is not to be refolded, the lines are rejoined using the ``linesep`` " @@ -686,6 +880,12 @@ msgid "" "``refold_source`` setting, which causes the binary data to be CTE encoded " "using the ``unknown-8bit`` charset." msgstr "" +"入力から得られた値は :meth:`~str.splitlines` で行に分割されます。\n" +"折り返し直さない場合は、ポリシーの ``linesep`` を使って行を再び連結し、返しま" +"す。\n" +"ただし非 ASCII のバイナリデータを含む行は例外です。\n" +"この場合は ``refold_source`` の設定にかかわらず値を折り返し直し、" +"``unknown-8bit`` 文字セットを使ってバイナリデータを CTE エンコードします。" #: ../../library/email.policy.rst:532 msgid "" @@ -703,13 +903,16 @@ msgid "" "binary data consists of single byte characters or multibyte characters." msgstr "" -#: ../../library/email.policy.rst:542 msgid "" "The following instances of :class:`EmailPolicy` provide defaults suitable " "for specific application domains. Note that in the future the behavior of " "these instances (in particular the ``HTTP`` instance) may be adjusted to " "conform even more closely to the RFCs relevant to their domains." msgstr "" +"以下の :class:`EmailPolicy` インスタンスは、特定の用途に適したデフォルト値を" +"提供します。\n" +"今後、各用途に関係する RFC にさらに厳密に準拠するよう、これらのインスタンス " +"(特に ``HTTP`` インスタンス) の動作が調整される可能性があります。" #: ../../library/email.policy.rst:550 msgid "" @@ -720,13 +923,14 @@ msgstr "" "デフォルト値を変更していない ``EmailPolicy`` のインスタンスです。このポリシー" "の行末は、 RFC で正しい ``\\r\\n`` ではなく Python の標準の ``\\n`` です。" -#: ../../library/email.policy.rst:557 msgid "" "Suitable for serializing messages in conformance with the email RFCs. Like " "``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." msgstr "" +"電子メールの RFC に準拠してメッセージをシリアライズするのに適しています。\n" +"``default`` と同様ですが、``linesep`` は RFC に準拠した ``\\r\\n`` に設定され" +"ています。" -#: ../../library/email.policy.rst:564 msgid "" "The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. " "Useful for serializing messages to a message store without using encoded " @@ -734,51 +938,65 @@ msgid "" "sender or recipient addresses have non-ASCII characters (the :meth:`smtplib." "SMTP.send_message` method handles this automatically)." msgstr "" +":attr:`~EmailPolicy.utf8` が ``True`` である点を除き、``SMTP`` と同じです。\n" +"ヘッダに encoded words を使わず、メッセージの保存先にシリアライズするのに便利" +"です。\n" +"SMTP 送信では、送信者または受信者のアドレスに非 ASCII 文字が含まれる場合だけ" +"使ってください (:meth:`smtplib.SMTP.send_message` メソッドはこれを自動的に処" +"理します)。" -#: ../../library/email.policy.rst:573 msgid "" "Suitable for serializing headers with for use in HTTP traffic. Like " "``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." msgstr "" +"HTTP 通信で使うヘッダのシリアライズに適しています。\n" +"``SMTP`` と同様ですが、``max_line_length`` は ``None`` (無制限) に設定されて" +"います。" -#: ../../library/email.policy.rst:579 msgid "" "Convenience instance. The same as ``default`` except that " "``raise_on_defect`` is set to ``True``. This allows any policy to be made " "strict by writing::" msgstr "" +"便宜的に用意されたインスタンスです。\n" +"``raise_on_defect`` が ``True`` に設定されている点を除き、``default`` と同じ" +"です。\n" +"次のように書くと、任意のポリシーを厳格にできます。 ::" -#: ../../library/email.policy.rst:583 msgid "somepolicy + policy.strict" -msgstr "" +msgstr "somepolicy + policy.strict" -#: ../../library/email.policy.rst:586 msgid "" "With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API " "of the email package is changed from the Python 3.2 API in the following " "ways:" msgstr "" +"これらの :class:`EmailPolicy <.EmailPolicy>` では、email パッケージの実際の " +"API は Python 3.2 の API から以下のように変わります:" -#: ../../library/email.policy.rst:589 msgid "" "Setting a header on a :class:`~email.message.Message` results in that header " "being parsed and a header object created." msgstr "" +":class:`~email.message.Message` にヘッダを設定すると、そのヘッダが解析されて" +"ヘッダオブジェクトが作成されます。" -#: ../../library/email.policy.rst:592 msgid "" "Fetching a header value from a :class:`~email.message.Message` results in " "that header being parsed and a header object created and returned." msgstr "" +":class:`~email.message.Message` からヘッダの値を取得すると、そのヘッダが解析" +"されてヘッダオブジェクトが作成され、返されます。" -#: ../../library/email.policy.rst:596 msgid "" "Any header object, or any header that is refolded due to the policy " "settings, is folded using an algorithm that fully implements the RFC folding " "algorithms, including knowing where encoded words are required and allowed." msgstr "" +"すべてのヘッダオブジェクトと、ポリシー設定によって折り返し直されるヘッダに" +"は、RFC の折り返しアルゴリズムを完全に実装したアルゴリズムが使われます。\n" +"このアルゴリズムは encoded words が必要な位置と許可される位置も判断します。" -#: ../../library/email.policy.rst:601 msgid "" "From the application view, this means that any header obtained through the :" "class:`~email.message.EmailMessage` is a header object with extra " @@ -787,6 +1005,12 @@ msgid "" "using a string, and the policy will take care of converting the string into " "the correct RFC encoded form." msgstr "" +"アプリケーション側から見ると、:class:`~email.message.EmailMessage` から取得す" +"るヘッダはすべて追加の属性を持つヘッダオブジェクトになり、その文字列の値は完" +"全にデコードされたヘッダの値になります。\n" +"同様に、文字列を使ってヘッダに新しい値を代入したり、新しいヘッダを作成したり" +"できます。\n" +"ポリシーがその文字列を RFC に従う正しいエンコード形式に変換します。" #: ../../library/email.policy.rst:608 msgid "" @@ -796,7 +1020,6 @@ msgstr "" "ヘッダオブジェクトとその属性は :mod:`~email.headerregistry` で述べられていま" "す。" -#: ../../library/email.policy.rst:615 msgid "" "This concrete :class:`Policy` is the backward compatibility policy. It " "replicates the behavior of the email package in Python 3.2. The :mod:`!" @@ -804,6 +1027,12 @@ msgid "" "that is used as the default policy. Thus the default behavior of the email " "package is to maintain compatibility with Python 3.2." msgstr "" +"この具象 :class:`Policy` は後方互換性のためのポリシーです。\n" +"Python 3.2 の email パッケージの動作を再現します。\n" +":mod:`!policy` モジュールには、このクラスのインスタンス :const:`compat32` も" +"定義されており、デフォルトのポリシーとして使われます。\n" +"このため email パッケージはデフォルトでは Python 3.2 との互換性を維持するよう" +"に動作します。" #: ../../library/email.policy.rst:621 msgid "" @@ -819,22 +1048,28 @@ msgstr "デフォルトは ``True`` です。" msgid "The name and value are returned unmodified." msgstr "名前と値は変更されずに返されます。" -#: ../../library/email.policy.rst:649 msgid "" "If the value contains binary data, it is converted into a :class:`~email." "header.Header` object using the ``unknown-8bit`` charset. Otherwise it is " "returned unmodified." msgstr "" +"値にバイナリデータが含まれる場合、``unknown-8bit`` 文字セットを使って :class:" +"`~email.header.Header` オブジェクトに変換します。\n" +"それ以外の場合はそのまま返します。" -#: ../../library/email.policy.rst:656 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " "resulting line to the ``max_line_length``. Non-ASCII binary data are CTE " "encoded using the ``unknown-8bit`` charset." msgstr "" +"ヘッダは :class:`~email.header.Header` の折り返しアルゴリズムで折り返しま" +"す。\n" +"このアルゴリズムは値に含まれる既存の改行を保持し、各行を ``max_line_length`` " +"に収まるように折り返します。\n" +"非 ASCII のバイナリデータは ``unknown-8bit`` 文字セットを使って CTE エンコー" +"ドされます。" -#: ../../library/email.policy.rst:664 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -843,6 +1078,14 @@ msgid "" "Otherwise the original source header is used, with its existing line breaks " "and any (RFC invalid) binary data it may contain." msgstr "" +"ヘッダは :class:`~email.header.Header` の折り返しアルゴリズムで折り返しま" +"す。\n" +"このアルゴリズムは値に含まれる既存の改行を保持し、各行を ``max_line_length`` " +"に収まるように折り返します。\n" +"``cte_type`` が ``7bit`` の場合、非 ASCII のバイナリデータは " +"``unknown-8bit`` 文字セットを使って CTE エンコードされます。\n" +"それ以外の場合は入力のヘッダをそのまま使い、既存の改行と、含まれていればバイ" +"ナリデータ (RFC では無効です) を保持します。" #: ../../library/email.policy.rst:674 msgid "" @@ -852,19 +1095,23 @@ msgstr "" ":class:`Compat32` のインスタンスで、Python 3.2 の email パッケージの挙動との" "後方互換性を提供します。" -#: ../../library/email.policy.rst:679 msgid "" "The :const:`compat32` policy should not be used as a policy for :class:" "`~email.message.EmailMessage` objects, and should only be used to serialize " "messages that were created using the :const:`compat32` policy." msgstr "" +":const:`compat32` ポリシーは :class:`~email.message.EmailMessage` オブジェク" +"トのポリシーとして使わないでください。\n" +":const:`compat32` ポリシーで作成されたメッセージをシリアライズする場合だけ" +"使ってください。" #: ../../library/email.policy.rst:686 msgid "Footnotes" msgstr "脚注" -#: ../../library/email.policy.rst:687 msgid "" "Originally added in 3.3 as a :term:`provisional feature `." msgstr "" +"当初は 3.3 で :term:`暫定的な機能 ` として追加されまし" +"た。" diff --git a/library/email.utils.po b/library/email.utils.po index 1d946c2e8..88c5d493f 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -22,19 +22,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/email.utils.rst:2 msgid ":mod:`!email.utils`: Miscellaneous utilities" -msgstr "" +msgstr ":mod:`!email.utils`: 各種ユーティリティ" #: ../../library/email.utils.rst:7 msgid "**Source code:** :source:`Lib/email/utils.py`" msgstr "**ソースコード:** :source:`Lib/email/utils.py`" -#: ../../library/email.utils.rst:11 msgid "" "There are a couple of useful utilities provided in the :mod:`!email.utils` " "module:" msgstr "" +":mod:`!email.utils` モジュールには、いくつかの便利なユーティリティがあります:" #: ../../library/email.utils.rst:16 msgid "" @@ -45,9 +44,8 @@ msgid "" "``None``), it is assumed to be in local time." msgstr "" -#: ../../library/email.utils.rst:24 msgid "The *isdst* parameter." -msgstr "" +msgstr "*isdst* パラメータ。" #: ../../library/email.utils.rst:29 msgid "" @@ -64,13 +62,15 @@ msgstr "" msgid "Added the *domain* keyword." msgstr "*domain* キーワードが追加されました。" -#: ../../library/email.utils.rst:41 msgid "" "The remaining functions are part of the legacy (``Compat32``) email API. " "There is no need to directly use these with the new API, since the parsing " "and formatting they provide is done automatically by the header parsing " "machinery of the new API." msgstr "" +"以下の関数は従来の (``Compat32``) email API の一部です。\n" +"新しい API ではヘッダの解析機構がこれらの解析や書式化を自動的に行うため、直接" +"使う必要はありません。" #: ../../library/email.utils.rst:49 msgid "" @@ -104,14 +104,14 @@ msgstr "" "解析に成功した場合はこれらの情報をタプルで返し、失敗した場合は 2 要素タプル " "``('', '')`` を返します。" -#: ../../library/email.utils.rst:67 ../../library/email.utils.rst:95 msgid "" "If *strict* is true, use a strict parser which rejects malformed inputs." -msgstr "" +msgstr "*strict* が真の場合、不正な入力を拒否する厳格なパーザを使います。" -#: ../../library/email.utils.rst:69 ../../library/email.utils.rst:107 msgid "Add *strict* optional parameter and reject malformed inputs by default." msgstr "" +"オプションのパラメータ *strict* が追加され、デフォルトで不正な入力を拒否する" +"ようになりました。" #: ../../library/email.utils.rst:75 msgid "" @@ -146,11 +146,9 @@ msgid "" "be returned by :meth:`Message.get_all `." msgstr "" -#: ../../library/email.utils.rst:97 msgid "Here's a simple example that gets all the recipients of a message::" -msgstr "" +msgstr "メッセージのすべての受信者を取得する簡単な例を示します。 ::" -#: ../../library/email.utils.rst:99 msgid "" "from email.utils import getaddresses\n" "\n" @@ -160,6 +158,13 @@ msgid "" "resent_ccs = msg.get_all('resent-cc', [])\n" "all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" msgstr "" +"from email.utils import getaddresses\n" +"\n" +"tos = msg.get_all('to', [])\n" +"ccs = msg.get_all('cc', [])\n" +"resent_tos = msg.get_all('resent-to', [])\n" +"resent_ccs = msg.get_all('resent-cc', [])\n" +"all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" #: ../../library/email.utils.rst:113 msgid "" @@ -181,7 +186,6 @@ msgstr "" "失敗した場合は ``None`` を返します。\n" "返されるタプルの 6、7、8番目の添字は使用不可なので注意してください。" -#: ../../library/email.utils.rst:124 msgid "" "Performs the same function as :func:`parsedate`, but returns either ``None`` " "or a 10-tuple; the first 9 elements make up a tuple that can be passed " @@ -191,6 +195,15 @@ msgid "" "returned is ``0``, which represents UTC. Note that indexes 6, 7, and 8 of " "the result tuple are not usable." msgstr "" +":func:`parsedate` と同じ処理を行いますが、``None`` または 10 要素タプルを返し" +"ます。\n" +"最初の 9 要素は :func:`time.mktime` に直接渡せるタプルを構成し、10 番目の要素" +"は日付のタイムゾーンの UTC (グリニッジ標準時の正式名称) からのオフセットです " +"[#]_。\n" +"入力文字列にタイムゾーンがなければ、返されるタプルの最後の要素は UTC を表す " +"``0`` です。\n" +"返されたタプルのインデックス 6、7、8 の要素は使用できないことに注意してくださ" +"い。" #: ../../library/email.utils.rst:134 msgid "" @@ -220,9 +233,8 @@ msgstr "" msgid "Returns a date string as per :rfc:`2822`, e.g.::" msgstr "日付を :rfc:`2822` 形式の文字列で返します。例::" -#: ../../library/email.utils.rst:159 msgid "Fri, 09 Nov 2001 01:08:47 -0000" -msgstr "" +msgstr "Fri, 09 Nov 2001 01:08:47 -0000" #: ../../library/email.utils.rst:161 msgid "" diff --git a/library/ensurepip.po b/library/ensurepip.po index 274c377b6..56f5e16bb 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -31,7 +31,6 @@ msgstr ":mod:`!ensurepip` --- ``pip`` インストーラーのブートストラ msgid "**Source code:** :source:`Lib/ensurepip`" msgstr "**ソースコード:** :source:`Lib/ensurepip`" -#: ../../library/ensurepip.rst:14 msgid "" "The :mod:`!ensurepip` package provides support for bootstrapping the ``pip`` " "installer into an existing Python installation or virtual environment. This " @@ -40,6 +39,12 @@ msgid "" "is bundled with maintenance and feature releases of the CPython reference " "interpreter." msgstr "" +":mod:`!ensurepip` パッケージは、既存の Python 環境や仮想環境に ``pip`` インス" +"トーラーをブートストラップする機能を提供します。\n" +"この方式は、``pip`` が独自のリリース周期を持つ独立したプロジェクトであること" +"を反映しています。\n" +"CPython 参照インタープリターのメンテナンスリリースと機能リリースには、利用可" +"能な最新の安定版が同梱されます。" msgid "" "In most cases, end users of Python shouldn't need to invoke this module " @@ -61,13 +66,16 @@ msgstr "" "このモジュールはインターネットに *アクセスしません*。``pip`` のブートストラッ" "プに必要な全てはこのパッケージの一部として含まれています。" -#: ../../includes/optional-module.rst:1 msgid "" "This is an :term:`optional module`. If it is missing from your copy of " "CPython, look for documentation from your distributor (that is, whoever " "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" +"これは :term:`オプションモジュール ` です。\n" +"使用している CPython に含まれていない場合は、配布元 (Python を提供した組織な" +"ど) のドキュメントを確認してください。\n" +"配布する立場の場合は :ref:`optional-module-requirements` を参照してください。" #: ../../library/ensurepip.rst:37 msgid ":ref:`installing-index`" @@ -111,9 +119,8 @@ msgstr "" msgid "The simplest possible invocation is::" msgstr "最も簡単な起動方法は::" -#: ../../library/ensurepip.rst:56 msgid "python -m ensurepip" -msgstr "" +msgstr "python -m ensurepip" msgid "" "This invocation will install ``pip`` if it is not already installed, but " @@ -126,9 +133,8 @@ msgstr "" "インストールされている ``pip`` を、``ensurepip`` に同梱されたものと同じかそれ" "より新しいバージョンにするには、``--upgrade`` オプションを指定します。 ::" -#: ../../library/ensurepip.rst:63 msgid "python -m ensurepip --upgrade" -msgstr "" +msgstr "python -m ensurepip --upgrade" #: ../../library/ensurepip.rst:65 msgid "" @@ -141,19 +147,23 @@ msgstr "" "イトパッケージ(もしアクティブな仮想環境がなければ)にインストールされます。イ" "ンストール先は2つの追加コマンドラインオプションで制御できます:" -#: ../../library/ensurepip.rst:72 msgid "" "Installs ``pip`` relative to the given root directory rather than the root " "of the currently active virtual environment (if any) or the default root for " "the current Python installation." msgstr "" +"現在有効な仮想環境があればそのルート、なければ現在の Python のデフォルトの" +"ルートではなく、指定されたルートディレクトリを基準に ``pip`` をインストールし" +"ます。" -#: ../../library/ensurepip.rst:78 msgid "" "Installs ``pip`` into the user site packages directory rather than globally " "for the current Python installation (this option is not permitted inside an " "active virtual environment)." msgstr "" +"現在の Python 環境全体ではなく、ユーザーの site-packages ディレクトリに " +"``pip`` をインストールします (有効な仮想環境内ではこのオプションは使えませ" +"ん)。" #: ../../library/ensurepip.rst:82 msgid "" @@ -165,17 +175,19 @@ msgstr "" "``ensurepip`` を起動したPythonのバージョン)。インストールされるスクリプトは2" "つの追加コマンドラインオプションで制御できます:" -#: ../../library/ensurepip.rst:89 msgid "" "If an alternate installation is requested, the ``pipX`` script will *not* be " "installed." msgstr "" +"代替インストールを指定すると、``pipX`` スクリプトはインストール *されません" +"*。" -#: ../../library/ensurepip.rst:94 msgid "" "If a \"default pip\" installation is requested, the ``pip`` script will be " "installed in addition to the two regular scripts." msgstr "" +"「デフォルトの pip」のインストールを指定すると、通常の 2 つのスクリプトに加え" +"て ``pip`` スクリプトもインストールされます。" #: ../../library/ensurepip.rst:97 msgid "" @@ -186,9 +198,8 @@ msgstr "2つのスクリプト選択オプションを指定すると例外が msgid "Module API" msgstr "モジュール API" -#: ../../library/ensurepip.rst:102 msgid ":mod:`!ensurepip` exposes two functions for programmatic use:" -msgstr "" +msgstr ":mod:`!ensurepip` には、プログラムから使うための関数が 2 つあります:" #: ../../library/ensurepip.rst:106 msgid "" diff --git a/library/enum.po b/library/enum.po index 517e46efa..4936b07b5 100644 --- a/library/enum.po +++ b/library/enum.po @@ -82,7 +82,6 @@ msgstr "" "列挙型は、:keyword:`class` 構文を使用するか、関数呼び出し構文を使用して作成さ" "れます::" -#: ../../library/enum.rst:33 msgid "" ">>> from enum import Enum\n" "\n" @@ -95,6 +94,16 @@ msgid "" ">>> # functional syntax\n" ">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])" msgstr "" +">>> from enum import Enum\n" +"\n" +">>> # class 構文\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"\n" +">>> # 関数呼び出し構文\n" +">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])" #: ../../library/enum.rst:44 msgid "" @@ -239,13 +248,13 @@ msgstr "" " ``STRICT``、``CONFORM``、``EJECT``、``KEEP`` の値を持つ列挙型です。列挙型で" "の無効な値の扱いについて、より細かい制御が可能です。" -#: ../../library/enum.rst:108 msgid ":class:`EnumDict`" -msgstr "" +msgstr ":class:`EnumDict`" -#: ../../library/enum.rst:110 msgid "A subclass of :class:`dict` for use when subclassing :class:`EnumType`." msgstr "" +":class:`EnumType` のサブクラスを作成するときに使う :class:`dict` のサブクラス" +"です。" #: ../../library/enum.rst:112 msgid ":class:`auto`" @@ -261,9 +270,8 @@ msgstr "" "ではデフォルトの値がメンバー名を小文字にしたものですが、その他の列挙型のデ" "フォルトは1から連番で増加する値となります。" -#: ../../library/enum.rst:118 msgid ":deco:`~enum.property`" -msgstr "" +msgstr ":deco:`~enum.property`" #: ../../library/enum.rst:120 msgid "" @@ -274,9 +282,8 @@ msgstr "" "メンバー名との競合を避けながら :class:`Enum` メンバーに属性を持たせます。" "``value`` 属性と ``name`` 属性はこの方法で実装されます。" -#: ../../library/enum.rst:124 msgid ":deco:`unique`" -msgstr "" +msgstr ":deco:`unique`" #: ../../library/enum.rst:126 msgid "" @@ -285,42 +292,41 @@ msgstr "" "一つの名前だけがひとつの値に束縛されていることを保証する Enum クラスのデコ" "レーターです。" -#: ../../library/enum.rst:128 msgid ":deco:`verify`" -msgstr "" +msgstr ":deco:`verify`" -#: ../../library/enum.rst:130 msgid "" "Enum class decorator that checks user-selectable constraints on an " "enumeration." msgstr "" +"列挙型が、利用者の選択した制約を満たすか確認する Enum クラスのデコレータで" +"す。" -#: ../../library/enum.rst:133 msgid ":deco:`member`" -msgstr "" +msgstr ":deco:`member`" #: ../../library/enum.rst:135 msgid "Make ``obj`` a member. Can be used as a decorator." msgstr "``obj`` をメンバーにします。デコレータとして使用できます。" -#: ../../library/enum.rst:137 msgid ":deco:`nonmember`" -msgstr "" +msgstr ":deco:`nonmember`" #: ../../library/enum.rst:139 msgid "Do not make ``obj`` a member. Can be used as a decorator." msgstr "``obj`` をメンバーにしません。デコレータとして使用できます。" -#: ../../library/enum.rst:141 msgid ":deco:`global_enum`" -msgstr "" +msgstr ":deco:`global_enum`" -#: ../../library/enum.rst:143 msgid "" "Modify the :class:`str() ` and :func:`repr` of an enum to show its " "members as belonging to the module instead of its class, and export the enum " "members to the global namespace." msgstr "" +"列挙型の :class:`str() ` と :func:`repr` を変更し、メンバーがクラスでは" +"なくモジュールに属するように表示します。\n" +"また、列挙型のメンバーをグローバル名前空間に公開します。" #: ../../library/enum.rst:147 msgid ":func:`show_flag_values`" @@ -330,16 +336,16 @@ msgstr ":func:`show_flag_values`" msgid "Return a list of all power-of-two integers contained in a flag." msgstr "フラグに含まれる、全ての2の累乗の整数のリストを返します。" -#: ../../library/enum.rst:151 msgid ":func:`enum.bin`" -msgstr "" +msgstr ":func:`enum.bin`" -#: ../../library/enum.rst:153 ../../library/enum.rst:1076 msgid "" "Like built-in :func:`bin`, except negative values are represented in two's " "complement, and the leading bit always indicates sign (``0`` implies " "positive, ``1`` implies negative)." msgstr "" +"組み込みの :func:`bin` と似ていますが、負の値は 2 の補数で表し、先頭のビット" +"は常に符号を示します (``0`` は正、``1`` は負を示します)。" #: ../../library/enum.rst:158 msgid "``Flag``, ``IntFlag``, ``auto``" @@ -353,9 +359,8 @@ msgstr "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" -#: ../../library/enum.rst:160 msgid "``EnumDict``" -msgstr "" +msgstr "``EnumDict``" #: ../../library/enum.rst:165 msgid "Data types" @@ -371,19 +376,23 @@ msgstr "" "*EnumType* のサブクラスを作成することが可能です -- 詳細は :ref:`EnumTypeのサ" "ブクラスを作る ` を参照してください。" -#: ../../library/enum.rst:174 msgid "" "``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:" "`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the " "final *enum*, as well as creating the enum members, properly handling " "duplicates, providing iteration over the enum class, etc." msgstr "" +"``EnumType`` は、最終的な *enum* に正しい :meth:`!__repr__`、:meth:`!" +"__str__`、:meth:`!__format__`、:meth:`!__reduce__` メソッドを設定します。\n" +"また、列挙型のメンバーの作成、重複の適切な処理、列挙型クラスの反復処理の提供" +"なども担当します。" -#: ../../library/enum.rst:181 msgid "" "Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available " "as an alias." msgstr "" +"3.11 より前は ``EnumType`` は ``EnumMeta`` と呼ばれていました。\n" +"この名前は現在もエイリアスとして使えます。" #: ../../library/enum.rst:185 msgid "This method is called in two different ways:" @@ -441,9 +450,8 @@ msgstr "新しく作成するEnumの属するモジュール名。" msgid "qualname" msgstr "qualname" -#: ../../library/enum.rst:199 msgid "The actual location in the module where this Enum can be found." -msgstr "" +msgstr "この Enum がモジュール内にある実際の位置。" #: ../../library/enum.rst:0 msgid "type" @@ -474,7 +482,6 @@ msgstr "bit演算での範囲外の値の扱い方(:class:`Flag` のみ)。" msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "メンバーが ``cls`` に属している場合は ``True`` を返します::" -#: ../../library/enum.rst:208 msgid "" ">>> some_var = Color.RED\n" ">>> some_var in Color\n" @@ -482,6 +489,11 @@ msgid "" ">>> Color.RED.value in Color\n" "True" msgstr "" +">>> some_var = Color.RED\n" +">>> some_var in Color\n" +"True\n" +">>> Color.RED.value in Color\n" +"True" msgid "" "Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " @@ -498,13 +510,16 @@ msgstr "" "``['__class__', '__doc__', '__members__', '__module__']`` と、 *cls* に属する" "メンバー名を返します::" -#: ../../library/enum.rst:224 msgid "" ">>> dir(Color)\n" "['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " "'__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', " "'__module__', '__name__', '__qualname__']" msgstr "" +">>> dir(Color)\n" +"['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " +"'__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', " +"'__module__', '__name__', '__qualname__']" msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" @@ -513,44 +528,48 @@ msgstr "" "*cls* 内で *name* に一致する Enum メンバーを返します。\n" "見つからなければ :exc:`KeyError` を送出します。 ::" -#: ../../library/enum.rst:231 msgid "" ">>> Color['BLUE']\n" "" msgstr "" +">>> Color['BLUE']\n" +"" msgid "Returns each member in *cls* in definition order::" msgstr "*cls* 内の各メンバー を定義順に返します::" -#: ../../library/enum.rst:238 msgid "" ">>> list(Color)\n" "[, , ]" msgstr "" +">>> list(Color)\n" +"[, , ]" -#: ../../library/enum.rst:243 msgid "Returns the number of members in *cls*::" -msgstr "" +msgstr "*cls* のメンバー数を返します。 ::" -#: ../../library/enum.rst:245 msgid "" ">>> len(Color)\n" "3" msgstr "" +">>> len(Color)\n" +"3" -#: ../../library/enum.rst:250 msgid "Returns a mapping of every enum name to its member, including aliases" msgstr "" +"エイリアスも含め、列挙型のすべての名前を対応するメンバーに結び付けるマッピン" +"グを返します。" #: ../../library/enum.rst:254 msgid "Returns each member in *cls* in reverse definition order::" msgstr "*cls* 内の各メンバー を定義順の逆順で返します::" -#: ../../library/enum.rst:256 msgid "" ">>> list(reversed(Color))\n" "[, , ]" msgstr "" +">>> list(reversed(Color))\n" +"[, , ]" #: ../../library/enum.rst:262 msgid "*Enum* is the base class for all *enum* enumerations." @@ -560,25 +579,28 @@ msgstr "*Enum* は全ての *enum* 列挙型の基底クラスです。" msgid "The name used to define the ``Enum`` member::" msgstr "``Enum`` メンバーを定義するために使用される名前::" -#: ../../library/enum.rst:268 msgid "" ">>> Color.BLUE.name\n" "'BLUE'" msgstr "" +">>> Color.BLUE.name\n" +"'BLUE'" #: ../../library/enum.rst:273 msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` メンバーに与えられた値::" -#: ../../library/enum.rst:275 msgid "" ">>> Color.RED.value\n" "1" msgstr "" +">>> Color.RED.value\n" +"1" -#: ../../library/enum.rst:278 ../../library/enum.rst:298 msgid "Value of the member, can be set in :meth:`~Enum.__new__`." msgstr "" +"メンバーの値です。\n" +":meth:`~Enum.__new__` で設定できます。" #: ../../library/enum.rst:280 msgid "Enum member values" @@ -595,17 +617,19 @@ msgstr "" "値が選ばれます。\n" "詳細は :class:`auto` を参照してください。" -#: ../../library/enum.rst:287 msgid "" "While mutable/unhashable values, such as :class:`dict`, :class:`list` or a " "mutable :class:`~dataclasses.dataclass`, can be used, they will have a " "quadratic performance impact during creation relative to the total number of " "mutable/unhashable values in the enum." msgstr "" +":class:`dict`、:class:`list`、ミュータブルな :class:`~dataclasses.dataclass` " +"など、ミュータブルまたはハッシュ不可能な値も使えます。\n" +"ただし作成時の処理時間には、列挙型内のそのような値の総数に対して二次的に増大" +"する影響があります。" -#: ../../library/enum.rst:294 msgid "Name of the member." -msgstr "" +msgstr "メンバーの名前。" #: ../../library/enum.rst:302 msgid "" @@ -613,14 +637,15 @@ msgid "" "during class creation)." msgstr "" -#: ../../library/enum.rst:305 msgid "" "The :attr:`~Enum._order_` attribute can be provided to help keep Python 2 / " "Python 3 code in sync. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" +":attr:`~Enum._order_` 属性を指定すると、Python 2 と Python 3 のコードを揃えて" +"おくのに役立ちます。\n" +"この属性を列挙型の実際の順序と照合し、一致しない場合はエラーを送出します。 ::" -#: ../../library/enum.rst:308 msgid "" ">>> class Color(Enum):\n" "... _order_ = 'RED GREEN BLUE'\n" @@ -634,12 +659,24 @@ msgid "" " ['RED', 'BLUE', 'GREEN']\n" " ['RED', 'GREEN', 'BLUE']" msgstr "" +">>> class Color(Enum):\n" +"... _order_ = 'RED GREEN BLUE'\n" +"... RED = 1\n" +"... BLUE = 3\n" +"... GREEN = 2\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: member order does not match _order_:\n" +" ['RED', 'BLUE', 'GREEN']\n" +" ['RED', 'GREEN', 'BLUE']" -#: ../../library/enum.rst:322 msgid "" "In Python 2 code the :attr:`~Enum._order_` attribute is necessary as " "definition order is lost before it can be recorded." msgstr "" +"Python 2 では、記録する前に定義の順序が失われるため、:attr:`~Enum._order_` 属" +"性が必要です。" #: ../../library/enum.rst:329 msgid "" @@ -665,7 +702,6 @@ msgstr "" " ``['__class__', '__doc__', '__module__', 'name', 'value']`` と *self." "__class__* に定義されたpublicなメソッドを返します::" -#: ../../library/enum.rst:343 msgid "" ">>> from enum import Enum\n" ">>> import datetime as dt\n" @@ -685,6 +721,23 @@ msgid "" "['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', " "'today', 'value']" msgstr "" +">>> from enum import Enum\n" +">>> import datetime as dt\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... @classmethod\n" +"... def today(cls):\n" +"... print(f'today is {cls(dt.date.today().isoweekday()).name}')\n" +"...\n" +">>> dir(Weekday.SATURDAY)\n" +"['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', " +"'today', 'value']" #: ../../library/enum.rst:0 msgid "name" @@ -714,11 +767,10 @@ msgstr "last_values" msgid "A list of the previous values." msgstr "定義済みの値のリスト。" -#: ../../library/enum.rst:367 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`." -msgstr "" +msgstr ":class:`auto` が次に返す値を決めるための *staticmethod* です。" #: ../../library/enum.rst:371 msgid "" @@ -735,11 +787,11 @@ msgid "" msgstr "" ":class:`Flag` クラスでは、次に選ばれる値は、次の最大の2のべき乗となります。" -#: ../../library/enum.rst:377 msgid "This method may be overridden, e.g.::" msgstr "" +"このメソッドはオーバーライドできます。\n" +"例えば次のようにします。 ::" -#: ../../library/enum.rst:379 msgid "" ">>> from enum import auto, Enum\n" ">>> class PowersOfThree(Enum):\n" @@ -752,6 +804,16 @@ msgid "" ">>> PowersOfThree.SECOND.value\n" "9" msgstr "" +">>> from enum import auto, Enum\n" +">>> class PowersOfThree(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return 3 ** (count + 1)\n" +"... FIRST = auto()\n" +"... SECOND = auto()\n" +"...\n" +">>> PowersOfThree.SECOND.value\n" +"9" #: ../../library/enum.rst:391 msgid "" @@ -792,7 +854,6 @@ msgstr "" "しませんが、カスタムの検索の振る舞いを実装するためにオーバーライドすることが" "できます::" -#: ../../library/enum.rst:415 msgid "" ">>> from enum import auto, StrEnum\n" ">>> class Build(StrEnum):\n" @@ -811,6 +872,22 @@ msgid "" ">>> Build('deBUG')\n" "" msgstr "" +">>> from enum import auto, StrEnum\n" +">>> class Build(StrEnum):\n" +"... DEBUG = auto()\n" +"... OPTIMIZED = auto()\n" +"... @classmethod\n" +"... def _missing_(cls, value):\n" +"... value = value.lower()\n" +"... for member in cls:\n" +"... if member.value == value:\n" +"... return member\n" +"... return None\n" +"...\n" +">>> Build.DEBUG.value\n" +"'debug'\n" +">>> Build('deBUG')\n" +"" #: ../../library/enum.rst:436 msgid "" @@ -822,16 +899,17 @@ msgstr "" "ラス(例えば ``int`` など)のいずれかで、メンバーに代入されたすべての値が渡さ" "れます。例::" -#: ../../library/enum.rst:444 msgid "" "results in the call ``int('1a', 16)`` and a value of ``26`` for the member." msgstr "" +"この場合は ``int('1a', 16)`` が呼び出され、メンバーの値は ``26`` になります。" -#: ../../library/enum.rst:448 msgid "" "When writing a custom ``__new__``, do not use ``super().__new__`` -- call " "the appropriate ``__new__`` instead." msgstr "" +"独自の ``__new__`` を書く場合、``super().__new__`` を使わず、適切な " +"``__new__`` を直接呼び出してください。" #: ../../library/enum.rst:453 msgid "" @@ -841,7 +919,6 @@ msgstr "" "*repr()* の呼び出しに使用される文字列を返します。デフォルトでは、 *Enum* 名、" "メンバー名、および値を返しますが、オーバーライドすることもできます::" -#: ../../library/enum.rst:456 msgid "" ">>> from enum import auto, Enum\n" ">>> class OtherStyle(Enum):\n" @@ -856,6 +933,18 @@ msgid "" "ALTERNATE}\"\n" "(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" msgstr "" +">>> from enum import auto, Enum\n" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __repr__(self):\n" +"... cls_name = self.__class__.__name__\n" +"... return f'{cls_name}.{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" #: ../../library/enum.rst:470 msgid "" @@ -865,7 +954,6 @@ msgstr "" "*str()* の呼び出しに使用される文字列を返します。デフォルトでは、 *Enum* の名" "前とメンバーの名前を返しますが、オーバーライドすることもできます::" -#: ../../library/enum.rst:473 msgid "" ">>> from enum import auto, Enum\n" ">>> class OtherStyle(Enum):\n" @@ -879,6 +967,17 @@ msgid "" "ALTERNATE}\"\n" "(, 'ALTERNATE', 'ALTERNATE')" msgstr "" +">>> from enum import auto, Enum\n" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __str__(self):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(, 'ALTERNATE', 'ALTERNATE')" #: ../../library/enum.rst:486 msgid "" @@ -889,7 +988,6 @@ msgstr "" "トでは、:meth:`__str__` の戻り値を返しますが、オーバーライドすることもできま" "す。::" -#: ../../library/enum.rst:489 msgid "" ">>> from enum import auto, Enum\n" ">>> class OtherStyle(Enum):\n" @@ -903,6 +1001,17 @@ msgid "" "ALTERNATE}\"\n" "(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" msgstr "" +">>> from enum import auto, Enum\n" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __format__(self, spec):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" #: ../../library/enum.rst:502 msgid "" @@ -912,55 +1021,60 @@ msgstr "" ":class:`Enum` で :class:`auto` を使用すると、 ``1`` から始まりインクリメント" "する整数が値となります。" -#: ../../library/enum.rst:505 msgid "Added :ref:`enum-dataclass-support`." -msgstr "" +msgstr ":ref:`enum-dataclass-support` が追加されました。" -#: ../../library/enum.rst:509 msgid "Adds a new name as an alias to an existing member::" -msgstr "" +msgstr "既存のメンバーのエイリアスとして新しい名前を追加します。 ::" -#: ../../library/enum.rst:511 msgid "" ">>> Color.RED._add_alias_(\"ERROR\")\n" ">>> Color.ERROR\n" "" msgstr "" +">>> Color.RED._add_alias_(\"ERROR\")\n" +">>> Color.ERROR\n" +"" -#: ../../library/enum.rst:515 msgid "" "Raises a :exc:`NameError` if the name is already assigned to a different " "member." msgstr "" +"その名前がすでに別のメンバーに割り当てられている場合、:exc:`NameError` を送出" +"します。" -#: ../../library/enum.rst:521 msgid "Adds a new value as an alias to an existing member::" -msgstr "" +msgstr "既存のメンバーのエイリアスとして新しい値を追加します。 ::" -#: ../../library/enum.rst:523 msgid "" ">>> Color.RED._add_value_alias_(42)\n" ">>> Color(42)\n" "" msgstr "" +">>> Color.RED._add_value_alias_(42)\n" +">>> Color(42)\n" +"" -#: ../../library/enum.rst:527 msgid "" "Raises a :exc:`ValueError` if the value is already linked with a different " "member." msgstr "" +"その値がすでに別のメンバーに結び付けられている場合、:exc:`ValueError` を送出" +"します。" -#: ../../library/enum.rst:528 msgid "See :ref:`multi-value-enum` for an example." -msgstr "" +msgstr "例は :ref:`multi-value-enum` を参照してください。" -#: ../../library/enum.rst:535 msgid "" "*IntEnum* is the same as :class:`Enum`, but its members are also integers " "and can be used anywhere that an integer can be used. If any integer " "operation is performed with an *IntEnum* member, the resulting value loses " "its enumeration status." msgstr "" +"*IntEnum* は :class:`Enum` と同様ですが、メンバーは整数でもあり、整数が使える" +"場所ならどこでも使えます。\n" +"*IntEnum* のメンバーを使って整数演算を行うと、結果の値は列挙型ではなくなりま" +"す。" #: ../../library/enum.rst:556 msgid "" @@ -980,21 +1094,27 @@ msgstr "" "ポートするために :meth:`!int.__str__` に変更されました。同じ理由で、:meth:" "`~object.__format__` は既に :meth:`!int.__format__` に変更されています。" -#: ../../library/enum.rst:566 msgid "" "*StrEnum* is the same as :class:`Enum`, but its members are also strings and " "can be used in most of the same places that a string can be used. The result " "of any string operation performed on or with a *StrEnum* member is not part " "of the enumeration." msgstr "" +"*StrEnum* は :class:`Enum` と同様ですが、メンバーは文字列でもあり、文字列が使" +"える場所のほとんどで使えます。\n" +"*StrEnum* のメンバーに対して、またはそれを使って文字列操作を行った結果は、列" +"挙型のメンバーにはなりません。" -#: ../../library/enum.rst:587 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " "``isinstance(unknown, str)``), and in those locations you will need to use " "``str(MyStrEnum.MY_MEMBER)``." msgstr "" +"標準ライブラリには :class:`str` のサブクラスを受け付けず、型が厳密に :class:" +"`str` かどうかを調べる箇所があります (つまり ``isinstance(unknown, str)`` で" +"はなく ``type(unknown) == str`` を使います)。\n" +"そのような箇所では ``str(MyStrEnum.MY_MEMBER)`` を使う必要があります。" #: ../../library/enum.rst:594 msgid "" @@ -1014,18 +1134,19 @@ msgstr "" "するために :meth:`!str.__str__` となりました。 :meth:`~object.__format__` も" "同様に、同じ理由で :meth:`!str.__format__` となりました。" -#: ../../library/enum.rst:607 msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " "operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " "the results of those operations are (aliases of) members of the enumeration." msgstr "" +"``Flag`` は :class:`Enum` と同様ですが、メンバーはビット演算子 ``&`` " +"(*AND*)、``|`` (*OR*)、``^`` (*XOR*)、``~`` (*INVERT*) をサポートします。\n" +"これらの演算結果は列挙型のメンバー (のエイリアス) になります。" #: ../../library/enum.rst:613 msgid "Returns *True* if value is in self::" msgstr "値を含む場合に *True* を返します::" -#: ../../library/enum.rst:615 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1044,30 +1165,52 @@ msgid "" ">>> white in purple\n" "False" msgstr "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> purple = Color.RED | Color.BLUE\n" +">>> white = Color.RED | Color.GREEN | Color.BLUE\n" +">>> Color.GREEN in purple\n" +"False\n" +">>> Color.GREEN in white\n" +"True\n" +">>> purple in white\n" +"True\n" +">>> white in purple\n" +"False" msgid "Returns all contained non-alias members::" msgstr "" "このフラグに含まれるメンバーのうち、エイリアスでないものをすべて返します。 ::" -#: ../../library/enum.rst:636 msgid "" ">>> list(Color.RED)\n" "[]\n" ">>> list(purple)\n" "[, ]" msgstr "" +">>> list(Color.RED)\n" +"[]\n" +">>> list(purple)\n" +"[, ]" #: ../../library/enum.rst:645 msgid "Returns number of members in flag::" msgstr "flag 内のメンバーの数を返します::" -#: ../../library/enum.rst:647 msgid "" ">>> len(Color.GREEN)\n" "1\n" ">>> len(white)\n" "3" msgstr "" +">>> len(Color.GREEN)\n" +"1\n" +">>> len(white)\n" +"3" #: ../../library/enum.rst:656 msgid "Returns *True* if any members in flag, *False* otherwise::" @@ -1075,7 +1218,6 @@ msgstr "" "メンバーがflagに含まれている場合は *True* を返し、それ以外の場合は *False* を" "返します::" -#: ../../library/enum.rst:658 msgid "" ">>> bool(Color.GREEN)\n" "True\n" @@ -1085,46 +1227,60 @@ msgid "" ">>> bool(black)\n" "False" msgstr "" +">>> bool(Color.GREEN)\n" +"True\n" +">>> bool(white)\n" +"True\n" +">>> black = Color(0)\n" +">>> bool(black)\n" +"False" #: ../../library/enum.rst:668 msgid "Returns current flag binary or'ed with other::" msgstr "現在のフラグと他のフラグの論理和となるフラグを返します::" -#: ../../library/enum.rst:670 msgid "" ">>> Color.RED | Color.GREEN\n" "" msgstr "" +">>> Color.RED | Color.GREEN\n" +"" #: ../../library/enum.rst:675 msgid "Returns current flag binary and'ed with other::" msgstr "現在のフラグと他のフラグの論理積となるフラグを返します::" -#: ../../library/enum.rst:677 msgid "" ">>> purple & white\n" "\n" ">>> purple & Color.GREEN\n" "" msgstr "" +">>> purple & white\n" +"\n" +">>> purple & Color.GREEN\n" +"" #: ../../library/enum.rst:684 msgid "Returns current flag binary xor'ed with other::" msgstr "現在のフラグと他のフラグの排他的論理和となるフラグを返します::" -#: ../../library/enum.rst:686 msgid "" ">>> purple ^ white\n" "\n" ">>> purple ^ Color.GREEN\n" "" msgstr "" +">>> purple ^ white\n" +"\n" +">>> purple ^ Color.GREEN\n" +"" -#: ../../library/enum.rst:693 msgid "Returns all the flags in *type(self)* that are not in *self*::" msgstr "" +"*type(self)* に含まれるフラグのうち、*self* に含まれないものをすべて返しま" +"す。 ::" -#: ../../library/enum.rst:695 msgid "" ">>> ~white\n" "\n" @@ -1133,12 +1289,20 @@ msgid "" ">>> ~Color.RED\n" "" msgstr "" +">>> ~white\n" +"\n" +">>> ~purple\n" +"\n" +">>> ~Color.RED\n" +"" -#: ../../library/enum.rst:704 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" +"名前のない残りの数値を書式化する関数です。\n" +"デフォルトは値の ``repr()`` 結果です。\n" +"よく使われる選択肢は :func:`hex` と :func:`oct` です。" #: ../../library/enum.rst:709 msgid "" @@ -1148,15 +1312,17 @@ msgstr "" ":class:`auto` と :class:`Flag` を一緒に使うと、``1`` から始まる2の累乗の整数" "になります。" -#: ../../library/enum.rst:712 msgid "The *repr()* of zero-valued flags has changed. It is now:" msgstr "" +"値がゼロのフラグの *repr()* が変更されました。\n" +"現在は次のようになります:" -#: ../../library/enum.rst:720 msgid "" "``IntFlag`` is the same as :class:`Flag`, but its members are also integers " "and can be used anywhere that an integer can be used." msgstr "" +"``IntFlag`` は :class:`Flag` と同様ですが、メンバーは整数でもあり、整数が使え" +"る場所ならどこでも使えます。" #: ../../library/enum.rst:734 msgid "" @@ -1166,35 +1332,38 @@ msgstr "" "*IntFlag* のメンバーと整数の演算が行われた場合、結果は *IntFlag* ではありませ" "ん::" -#: ../../library/enum.rst:737 msgid "" ">>> Color.RED + 2\n" "3" msgstr "" +">>> Color.RED + 2\n" +"3" -#: ../../library/enum.rst:740 msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" -msgstr "" +msgstr "*IntFlag* のメンバーに対して :class:`Flag` の演算を行うと:" #: ../../library/enum.rst:742 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果が有効な *IntFlag*: *IntFlag* が返されます" -#: ../../library/enum.rst:743 msgid "" "the result is not a valid *IntFlag*: the result depends on the :class:" "`FlagBoundary` setting" msgstr "" +"結果が有効な *IntFlag* でない場合、結果は :class:`FlagBoundary` の設定によっ" +"て決まります。" -#: ../../library/enum.rst:745 msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now::" msgstr "" +"名前がなく値がゼロのフラグの :func:`repr` が変更されました。\n" +"現在は次のようになります。 ::" -#: ../../library/enum.rst:747 msgid "" ">>> Color(0)\n" "" msgstr "" +">>> Color(0)\n" +"" #: ../../library/enum.rst:752 msgid "" @@ -1224,19 +1393,18 @@ msgstr "" "正の値を返すようになりました。これは既存の :class:`Flag` の振る舞いに一致しま" "す。" -#: ../../library/enum.rst:767 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" +":class:`!ReprEnum` は :class:`Enum` の :meth:`repr() ` を使い" +"ますが、:class:`str() ` には混ぜ込まれたデータ型のものを使います:" -#: ../../library/enum.rst:770 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" -msgstr "" +msgstr ":class:`IntEnum` と :class:`IntFlag` では :meth:`!int.__str__`" -#: ../../library/enum.rst:771 msgid ":meth:`!str.__str__` for :class:`StrEnum`" -msgstr "" +msgstr ":class:`StrEnum` では :meth:`!str.__str__`" #: ../../library/enum.rst:773 msgid "" @@ -1248,20 +1416,18 @@ msgstr "" "` を使用する代わりに、mix-inされたデータ型の :class:`str() " "` / :func:`format` を使用します。" -#: ../../library/enum.rst:782 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -"*EnumCheck* には :func:`verify` デコレータやさまざまな制約を保証するために使" -"用されるオプションが含まれています。制約に違反すると :exc:`ValueError` が発生" -"します。" +"*EnumCheck* には、:func:`verify` デコレータが各種の制約を確認するために使うオ" +"プションが含まれています。\n" +"制約を満たさない場合は :exc:`ValueError` が送出されます。" #: ../../library/enum.rst:787 msgid "Ensure that each value has only one name::" msgstr "それぞれの値が1つの名前しか持たないことを確認します::" -#: ../../library/enum.rst:789 msgid "" ">>> from enum import Enum, verify, UNIQUE\n" ">>> @verify(UNIQUE)\n" @@ -1274,6 +1440,16 @@ msgid "" "...\n" "ValueError: aliases found in : CRIMSON -> RED" msgstr "" +">>> from enum import Enum, verify, UNIQUE\n" +">>> @verify(UNIQUE)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... CRIMSON = 1\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: aliases found in : CRIMSON -> RED" #: ../../library/enum.rst:803 msgid "" @@ -1281,7 +1457,6 @@ msgid "" "the highest-valued member::" msgstr "最小値のメンバーと最大値のメンバーの間に欠損値がないことを確認します::" -#: ../../library/enum.rst:806 msgid "" ">>> from enum import Enum, verify, CONTINUOUS\n" ">>> @verify(CONTINUOUS)\n" @@ -1293,6 +1468,15 @@ msgid "" "...\n" "ValueError: invalid enum 'Color': missing values 3, 4" msgstr "" +">>> from enum import Enum, verify, CONTINUOUS\n" +">>> @verify(CONTINUOUS)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 5\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid enum 'Color': missing values 3, 4" msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " @@ -1302,7 +1486,6 @@ msgstr "" "す。\n" ":func:`auto` で値を生成する代わりに、値を直接指定する場合に便利です。 ::" -#: ../../library/enum.rst:821 msgid "" ">>> from enum import Flag, verify, NAMED_FLAGS\n" ">>> @verify(NAMED_FLAGS)\n" @@ -1317,6 +1500,18 @@ msgid "" "ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " "combined values of 0x18 [use enum.show_flag_values(value) for details]" msgstr "" +">>> from enum import Flag, verify, NAMED_FLAGS\n" +">>> @verify(NAMED_FLAGS)\n" +"... class Color(Flag):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... WHITE = 15\n" +"... NEON = 31\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " +"combined values of 0x18 [use enum.show_flag_values(value) for details]" #: ../../library/enum.rst:835 msgid "" @@ -1325,11 +1520,12 @@ msgstr "" "CONTINUOUSとNAMED_FLAGSは整数値のメンバーとともに動作するように設計されていま" "す。" -#: ../../library/enum.rst:841 msgid "" "``FlagBoundary`` controls how out-of-range values are handled in :class:" "`Flag` and its subclasses." msgstr "" +"``FlagBoundary`` は :class:`Flag` とそのサブクラスで範囲外の値をどう扱うかを" +"制御します。" #: ../../library/enum.rst:846 msgid "" @@ -1339,7 +1535,6 @@ msgstr "" "範囲外の値は :exc:`ValueError` を送出します。これは :class:`Flag` のデフォル" "トです::" -#: ../../library/enum.rst:849 msgid "" ">>> from enum import Flag, STRICT, auto\n" ">>> class StrictFlag(Flag, boundary=STRICT):\n" @@ -1354,14 +1549,25 @@ msgid "" " given 0b0 10100\n" " allowed 0b0 00111" msgstr "" +">>> from enum import Flag, STRICT, auto\n" +">>> class StrictFlag(Flag, boundary=STRICT):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> StrictFlag(2**2 + 2**4)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid value 20\n" +" given 0b0 10100\n" +" allowed 0b0 00111" -#: ../../library/enum.rst:864 msgid "" "Out-of-range values have invalid values removed, leaving a valid :class:" "`Flag` value::" msgstr "" +"範囲外の値から無効な部分を取り除き、有効な :class:`Flag` の値を残します。 ::" -#: ../../library/enum.rst:867 msgid "" ">>> from enum import Flag, CONFORM, auto\n" ">>> class ConformFlag(Flag, boundary=CONFORM):\n" @@ -1372,20 +1578,29 @@ msgid "" ">>> ConformFlag(2**2 + 2**4)\n" "" msgstr "" +">>> from enum import Flag, CONFORM, auto\n" +">>> class ConformFlag(Flag, boundary=CONFORM):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> ConformFlag(2**2 + 2**4)\n" +"" -#: ../../library/enum.rst:878 msgid "" "Out-of-range values lose their :class:`Flag` membership and revert to :class:" "`int`." msgstr "" +"範囲外の値は :class:`Flag` のメンバーではなくなり、:class:`int` に戻ります。" -#: ../../library/enum.rst:891 msgid "" "Out-of-range values are kept, and the :class:`Flag` membership is kept. This " "is the default for :class:`IntFlag`::" msgstr "" +"範囲外の値をそのまま保持し、:class:`Flag` のメンバーであることも維持しま" +"す。\n" +"これは :class:`IntFlag` のデフォルトです。 ::" -#: ../../library/enum.rst:894 msgid "" ">>> from enum import Flag, KEEP, auto\n" ">>> class KeepFlag(Flag, boundary=KEEP):\n" @@ -1396,8 +1611,15 @@ msgid "" ">>> KeepFlag(2**2 + 2**4)\n" "" msgstr "" +">>> from enum import Flag, KEEP, auto\n" +">>> class KeepFlag(Flag, boundary=KEEP):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> KeepFlag(2**2 + 2**4)\n" +"" -#: ../../library/enum.rst:907 msgid "" "*EnumDict* is a subclass of :class:`dict` that is used as the namespace for " "defining enum classes (see :ref:`prepare`). It is exposed to allow " @@ -1406,18 +1628,27 @@ msgid "" "created, otherwise private names and internal classes will not be handled " "correctly." msgstr "" +"*EnumDict* は :class:`dict` のサブクラスで、列挙型クラスを定義する名前空間と" +"して使います (:ref:`prepare` を参照)。\n" +"メンバーごとに複数の値を持たせるなど、高度な動作を持つ :class:`EnumType` のサ" +"ブクラスを作成できるように公開されています。\n" +"作成する列挙型クラスの名前を渡して呼び出してください。\n" +"そうしないと、プライベートな名前や内部クラスが正しく処理されません。" -#: ../../library/enum.rst:914 msgid "" "Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:" "`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be " "possible to bypass the checks using other :class:`!dict` operations like :" "meth:`|= `." msgstr "" +"オーバーライドされているのは :class:`~collections.abc.MutableMapping` のイン" +"ターフェイス (:meth:`~object.__setitem__` と :meth:`~dict.update`) だけである" +"ことに注意してください。\n" +":meth:`|= ` など、ほかの :class:`!dict` の操作では検査を回避" +"できる場合があります。" -#: ../../library/enum.rst:921 msgid "A list of member names." -msgstr "" +msgstr "メンバー名のリスト。" #: ../../library/enum.rst:930 msgid "Supported ``__dunder__`` names" @@ -1431,13 +1662,16 @@ msgstr "" ":attr:`~EnumType.__members__` は読み込み専用の、 ``member_name``:``member`` " "を要素とする順序付きマッピングです。これはクラスでのみ利用可能です。" -#: ../../library/enum.rst:935 msgid "" ":meth:`~Enum.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`~Enum." "_value_` appropriately. Once all the members are created it is no longer " "used." msgstr "" +":meth:`~Enum.__new__` を指定する場合は、列挙型のメンバーを作成して返す必要が" +"あります。\n" +"メンバーの :attr:`~Enum._value_` を適切に設定することも強く推奨します。\n" +"すべてのメンバーの作成が終わると、このメソッドは使われなくなります。" #: ../../library/enum.rst:941 msgid "Supported ``_sunder_`` names" @@ -1482,28 +1716,32 @@ msgstr "" "に使われます。\n" "オーバーライドできます。" -#: ../../library/enum.rst:956 msgid "" ":meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing " "member." msgstr "" +":meth:`~Enum._add_alias_` -- 既存のメンバーのエイリアスとして新しい名前を追加" +"します。" -#: ../../library/enum.rst:958 msgid "" ":meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an " "existing member." msgstr "" +":meth:`~Enum._add_value_alias_` -- 既存のメンバーのエイリアスとして新しい値を" +"追加します。" -#: ../../library/enum.rst:961 msgid "" "While ``_sunder_`` names are generally reserved for the further development " "of the :class:`Enum` class and can not be used, some are explicitly allowed:" msgstr "" +"``_sunder_`` 名は通常、:class:`Enum` クラスの今後の開発のために予約されており" +"使えませんが、明示的に許可されているものもあります:" -#: ../../library/enum.rst:964 msgid "" "``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" msgstr "" +"`IPython のリッチな表示機能 `_ で使われる " +"``_repr_*`` (``_repr_html_`` など)" #: ../../library/enum.rst:966 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" @@ -1513,15 +1751,12 @@ msgstr "``_missing_``, ``_order_``, ``_generate_next_value_``" msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:968 msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" -msgstr "" +msgstr "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" -#: ../../library/enum.rst:974 msgid "Utilities and decorators" -msgstr "" +msgstr "ユーティリティとデコレータ" -#: ../../library/enum.rst:978 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an " @@ -1532,12 +1767,22 @@ msgid "" "member's name. Care must be taken if mixing *auto()* with manually " "specified values." msgstr "" +"値の代わりに *auto* を使えます。\n" +"使った場合、*Enum* の仕組みが :class:`Enum` の :meth:`~Enum." +"_generate_next_value_` を呼び出し、適切な値を取得します。\n" +":class:`Enum` と :class:`IntEnum` では、それまでの最大値に 1 を加えた値になり" +"ます。\n" +":class:`Flag` と :class:`IntFlag` では、それまでの最大値を超える最小の 2 の累" +"乗になります。\n" +":class:`StrEnum` ではメンバー名を小文字にした値になります。\n" +"*auto()* と手動で指定した値を混在させる場合は注意が必要です。" -#: ../../library/enum.rst:986 msgid "" "*auto* instances are only resolved when at the top level of an assignment, " "either by itself or as part of a tuple:" msgstr "" +"*auto* インスタンスが値に置き換えられるのは、代入の最上位に単独で置くか、タプ" +"ルの要素として置く場合だけです:" #: ../../library/enum.rst:989 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" @@ -1551,11 +1796,12 @@ msgstr "" "``SECOND = auto(), -2`` は動作します(auto は ``2`` に置き換えられるため、 " "``SECOND`` 列挙型のメンバーには ``2, -2`` が使用されます)" -#: ../../library/enum.rst:992 msgid "" "``THIRD = [auto(), -3]`` will *not* work (``[, -3]`` is used " "to create the ``THIRD`` enum member)" msgstr "" +"``THIRD = [auto(), -3]`` は意図どおりには動作 *しません* (``[, -3]`` を使って列挙型のメンバー ``THIRD`` が作成されます)。" #: ../../library/enum.rst:997 msgid "" @@ -1580,20 +1826,23 @@ msgid "" "incompatible type." msgstr "" -#: ../../library/enum.rst:1009 msgid "" "A decorator similar to the built-in :deco:`property`, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" +"組み込みの :deco:`property` に似ていますが、列挙型専用のデコレータです。\n" +"メンバーの属性に、メンバー自体と同じ名前を使えるようにします。" -#: ../../library/enum.rst:1013 msgid "" "The *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " "and *Enum* subclasses can define members with the names ``value`` and " "``name``." msgstr "" +"*property* とメンバーは別々のクラスで定義する必要があります。\n" +"例えば *value* と *name* 属性は *Enum* クラスで定義されていますが、*Enum* の" +"サブクラスでは ``value`` や ``name`` という名前のメンバーを定義できます。" #: ../../library/enum.rst:1022 msgid "" @@ -1647,13 +1896,16 @@ msgstr "列挙型で使用するデコレータ: 対象は列挙型のメンバ msgid "A decorator for use in enums: its target will not become a member." msgstr "列挙型で使用するデコレータ: 対象は列挙型のメンバー になりません。" -#: ../../library/enum.rst:1060 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " "only be used when the enum members are exported to the module global " "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" +"列挙型の :class:`str() ` と :func:`repr` を変更して、メンバーがクラスで" +"はなくモジュールに属するように表示するデコレータです。\n" +"列挙型のメンバーをモジュールのグローバル名前空間に公開している場合だけ使って" +"ください (例は :class:`re.RegexFlag` を参照)。" #: ../../library/enum.rst:1070 msgid "Return a list of all power-of-two integers contained in a flag *value*." @@ -1695,20 +1947,24 @@ msgstr "" "もし、そのような制限が必要でない/望まない場合は、``int`` または ``str`` タイ" "プを継承して、カスタムの基底クラスを作成することができます::" -#: ../../library/enum.rst:1106 msgid "" ">>> from enum import Enum\n" ">>> class MyIntEnum(int, Enum):\n" "... pass" msgstr "" +">>> from enum import Enum\n" +">>> class MyIntEnum(int, Enum):\n" +"... pass" #: ../../library/enum.rst:1110 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "または列挙型の中で適切な :meth:`str` などを再代入することもできます::" -#: ../../library/enum.rst:1112 msgid "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" "... __str__ = Enum.__str__" msgstr "" +">>> from enum import Enum, IntEnum\n" +">>> class MyIntEnum(IntEnum):\n" +"... __str__ = Enum.__str__" diff --git a/library/errno.po b/library/errno.po index b5d241b87..64a807294 100644 --- a/library/errno.po +++ b/library/errno.po @@ -65,29 +65,33 @@ msgstr "" "errorcode.keys()`` として取得することができます。取得できるシンボルには以下の" "ようなものがあります:" -#: ../../library/errno.rst:30 msgid "" "Operation not permitted. This error is mapped to the exception :exc:" "`PermissionError`." msgstr "" +"操作が許可されていません (Operation not permitted)。\n" +"このエラーは例外 :exc:`PermissionError` に対応します。" -#: ../../library/errno.rst:36 msgid "" "No such file or directory. This error is mapped to the exception :exc:" "`FileNotFoundError`." msgstr "" +"そのようなファイルやディレクトリはありません (No such file or directory)。\n" +"このエラーは例外 :exc:`FileNotFoundError` に対応します。" -#: ../../library/errno.rst:42 msgid "" "No such process. This error is mapped to the exception :exc:" "`ProcessLookupError`." msgstr "" +"そのようなプロセスはありません (No such process)。\n" +"このエラーは例外 :exc:`ProcessLookupError` に対応します。" -#: ../../library/errno.rst:48 msgid "" "Interrupted system call. This error is mapped to the exception :exc:" "`InterruptedError`." msgstr "" +"システムコールが割り込まれました (Interrupted system call)。\n" +"このエラーは例外 :exc:`InterruptedError` に対応します。" #: ../../library/errno.rst:54 msgid "I/O error" @@ -110,26 +114,29 @@ msgstr "実行形式にエラーがあります (Exec format error)" msgid "Bad file number" msgstr "ファイル番号が間違っています (Bad file number)" -#: ../../library/errno.rst:79 msgid "" "No child processes. This error is mapped to the exception :exc:" "`ChildProcessError`." msgstr "" +"子プロセスがありません (No child processes)。\n" +"このエラーは例外 :exc:`ChildProcessError` に対応します。" -#: ../../library/errno.rst:85 msgid "" "Try again. This error is mapped to the exception :exc:`BlockingIOError`." msgstr "" +"再試行してください (Try again)。\n" +"このエラーは例外 :exc:`BlockingIOError` に対応します。" #: ../../library/errno.rst:90 msgid "Out of memory" msgstr "空きメモリがありません (Out of memory)" -#: ../../library/errno.rst:95 msgid "" "Permission denied. This error is mapped to the exception :exc:" "`PermissionError`." msgstr "" +"アクセスが拒否されました (Permission denied)。\n" +"このエラーは例外 :exc:`PermissionError` に対応します。" #: ../../library/errno.rst:101 msgid "Bad address" @@ -143,10 +150,11 @@ msgstr "ブロックデバイスが必要です (Block device required)" msgid "Device or resource busy" msgstr "そのデバイスまたはリソースは使用中です (Device or resource busy)" -#: ../../library/errno.rst:116 msgid "" "File exists. This error is mapped to the exception :exc:`FileExistsError`." msgstr "" +"ファイルが存在します (File exists)。\n" +"このエラーは例外 :exc:`FileExistsError` に対応します。" #: ../../library/errno.rst:122 msgid "Cross-device link" @@ -156,17 +164,19 @@ msgstr "デバイスをまたいだリンクです (Cross-device link)" msgid "No such device" msgstr "そのようなデバイスはありません (No such device)" -#: ../../library/errno.rst:132 msgid "" "Not a directory. This error is mapped to the exception :exc:" "`NotADirectoryError`." msgstr "" +"ディレクトリではありません (Not a directory)。\n" +"このエラーは例外 :exc:`NotADirectoryError` に対応します。" -#: ../../library/errno.rst:138 msgid "" "Is a directory. This error is mapped to the exception :exc:" "`IsADirectoryError`." msgstr "" +"ディレクトリです (Is a directory)。\n" +"このエラーは例外 :exc:`IsADirectoryError` に対応します。" #: ../../library/errno.rst:144 msgid "Invalid argument" @@ -208,10 +218,11 @@ msgstr "リードオンリーのファイルシステムです (Read-only file s msgid "Too many links" msgstr "リンクが多すぎます (Too many links)" -#: ../../library/errno.rst:194 msgid "" "Broken pipe. This error is mapped to the exception :exc:`BrokenPipeError`." msgstr "" +"パイプが壊れています (Broken pipe)。\n" +"このエラーは例外 :exc:`BrokenPipeError` に対応します。" #: ../../library/errno.rst:200 msgid "Math argument out of domain of func" @@ -248,11 +259,12 @@ msgstr "" "これ以上シンボリックリンクを追跡できません (Too many symbolic links " "encountered)" -#: ../../library/errno.rst:240 msgid "" "Operation would block. This error is mapped to the exception :exc:" "`BlockingIOError`." msgstr "" +"操作を進めるにはブロックする必要があります (Operation would block)。\n" +"このエラーは例外 :exc:`BlockingIOError` に対応します。" #: ../../library/errno.rst:246 msgid "No message of desired type" @@ -306,9 +318,8 @@ msgstr "無効な要求記述子です (Invalid request descriptor)" msgid "Exchange full" msgstr "変換テーブルが一杯です (Exchange full)" -#: ../../library/errno.rst:311 msgid "No anode" -msgstr "陰極がありません (No anode)" +msgstr "anode がありません (No anode)。" #: ../../library/errno.rst:316 msgid "Invalid request code" @@ -486,9 +497,8 @@ msgstr "" "通信端点に対してサポートされていない操作です (Operation not supported on " "transport endpoint)" -#: ../../library/errno.rst:516 msgid "Operation not supported" -msgstr "" +msgstr "操作がサポートされていません (Operation not supported)。" #: ../../library/errno.rst:523 msgid "Protocol family not supported" @@ -524,17 +534,20 @@ msgstr "" "リセットによってネットワーク接続が切られました (Network dropped connection " "because of reset)" -#: ../../library/errno.rst:558 msgid "" "Software caused connection abort. This error is mapped to the exception :exc:" "`ConnectionAbortedError`." msgstr "" +"ソフトウェアによって接続が中断されました (Software caused connection " +"abort)。\n" +"このエラーは例外 :exc:`ConnectionAbortedError` に対応します。" -#: ../../library/errno.rst:564 msgid "" "Connection reset by peer. This error is mapped to the exception :exc:" "`ConnectionResetError`." msgstr "" +"接続相手によって接続がリセットされました (Connection reset by peer)。\n" +"このエラーは例外 :exc:`ConnectionResetError` に対応します。" #: ../../library/errno.rst:570 msgid "No buffer space available" @@ -549,27 +562,31 @@ msgstr "" msgid "Transport endpoint is not connected" msgstr "通信端点が接続されていません (Transport endpoint is not connected)" -#: ../../library/errno.rst:585 msgid "" "Cannot send after transport endpoint shutdown. This error is mapped to the " "exception :exc:`BrokenPipeError`." msgstr "" +"通信端点をシャットダウンした後は送信できません (Cannot send after transport " +"endpoint shutdown)。\n" +"このエラーは例外 :exc:`BrokenPipeError` に対応します。" #: ../../library/errno.rst:591 msgid "Too many references: cannot splice" msgstr "参照が多すぎます: 接続できません (Too many references: cannot splice)" -#: ../../library/errno.rst:596 msgid "" "Connection timed out. This error is mapped to the exception :exc:" "`TimeoutError`." msgstr "" +"接続がタイムアウトしました (Connection timed out)。\n" +"このエラーは例外 :exc:`TimeoutError` に対応します。" -#: ../../library/errno.rst:602 msgid "" "Connection refused. This error is mapped to the exception :exc:" "`ConnectionRefusedError`." msgstr "" +"接続が拒否されました (Connection refused)。\n" +"このエラーは例外 :exc:`ConnectionRefusedError` に対応します。" #: ../../library/errno.rst:608 msgid "Host is down" @@ -579,21 +596,23 @@ msgstr "ホストはシステムダウンしています (Host is down)" msgid "No route to host" msgstr "ホストへの経路がありません (No route to host)" -#: ../../library/errno.rst:618 msgid "Memory page has hardware error." msgstr "" +"メモリページにハードウェアエラーがあります (Memory page has hardware error)。" -#: ../../library/errno.rst:625 msgid "" "Operation already in progress. This error is mapped to the exception :exc:" "`BlockingIOError`." msgstr "" +"操作はすでに進行中です (Operation already in progress)。\n" +"このエラーは例外 :exc:`BlockingIOError` に対応します。" -#: ../../library/errno.rst:631 msgid "" "Operation now in progress. This error is mapped to the exception :exc:" "`BlockingIOError`." msgstr "" +"操作は現在進行中です (Operation now in progress)。\n" +"このエラーは例外 :exc:`BlockingIOError` に対応します。" #: ../../library/errno.rst:637 msgid "Stale NFS file handle" @@ -623,131 +642,109 @@ msgstr "遠隔側の I/O エラーです (Remote I/O error)" msgid "Quota exceeded" msgstr "ディスククオータを超えました (Quota exceeded)" -#: ../../library/errno.rst:671 msgid "Interface output queue is full" msgstr "" +"インターフェイスの出力キューがいっぱいです (Interface output queue is full)。" -#: ../../library/errno.rst:678 msgid "No medium found" -msgstr "" +msgstr "媒体が見つかりません (No medium found)。" -#: ../../library/errno.rst:683 msgid "Wrong medium type" -msgstr "" +msgstr "媒体の種類が違います (Wrong medium type)。" -#: ../../library/errno.rst:688 msgid "Required key not available" -msgstr "" +msgstr "必要な鍵が利用できません (Required key not available)。" -#: ../../library/errno.rst:693 msgid "Key has expired" -msgstr "" +msgstr "鍵の有効期限が切れています (Key has expired)。" -#: ../../library/errno.rst:698 msgid "Key has been revoked" -msgstr "" +msgstr "鍵が取り消されています (Key has been revoked)。" -#: ../../library/errno.rst:703 msgid "Key was rejected by service" -msgstr "" +msgstr "サービスが鍵を拒否しました (Key was rejected by service)。" -#: ../../library/errno.rst:708 msgid "Operation not possible due to RF-kill" msgstr "" +"RF-kill によって操作できません (Operation not possible due to RF-kill)。" -#: ../../library/errno.rst:713 msgid "Locked lock was unmapped" msgstr "" +"ロック中のロックがマッピング解除されました (Locked lock was unmapped)。" -#: ../../library/errno.rst:718 msgid "Facility is not active" -msgstr "" +msgstr "機能が有効ではありません (Facility is not active)。" -#: ../../library/errno.rst:723 msgid "Authentication error" -msgstr "" +msgstr "認証エラーです (Authentication error)。" -#: ../../library/errno.rst:730 msgid "Bad CPU type in executable" -msgstr "" +msgstr "実行可能ファイルの CPU 型が不正です (Bad CPU type in executable)。" -#: ../../library/errno.rst:737 msgid "Bad executable (or shared library)" msgstr "" +"実行可能ファイルまたは共有ライブラリが不正です (Bad executable (or shared " +"library))。" -#: ../../library/errno.rst:744 msgid "Malformed Mach-o file" -msgstr "" +msgstr "Mach-o ファイルの形式が不正です (Malformed Mach-o file)。" -#: ../../library/errno.rst:751 msgid "Device error" -msgstr "" +msgstr "デバイスエラーです (Device error)。" -#: ../../library/errno.rst:758 msgid "Inappropriate file type or format" msgstr "" +"ファイルの種類または形式が不適切です (Inappropriate file type or format)。" -#: ../../library/errno.rst:765 msgid "Need authenticator" -msgstr "" +msgstr "認証機構が必要です (Need authenticator)。" -#: ../../library/errno.rst:772 msgid "Attribute not found" -msgstr "" +msgstr "属性が見つかりません (Attribute not found)。" -#: ../../library/errno.rst:779 msgid "Policy not found" -msgstr "" +msgstr "ポリシーが見つかりません (Policy not found)。" -#: ../../library/errno.rst:786 msgid "Too many processes" -msgstr "" +msgstr "プロセスが多すぎます (Too many processes)。" -#: ../../library/errno.rst:793 msgid "Bad procedure for program" -msgstr "" +msgstr "プログラムに対する手続きが不正です (Bad procedure for program)。" -#: ../../library/errno.rst:800 msgid "Program version wrong" -msgstr "" +msgstr "プログラムのバージョンが違います (Program version wrong)。" -#: ../../library/errno.rst:807 msgid "RPC prog. not avail" -msgstr "" +msgstr "RPC プログラムが利用できません (RPC prog. not avail)。" -#: ../../library/errno.rst:814 msgid "Device power is off" -msgstr "" +msgstr "デバイスの電源が切れています (Device power is off)。" -#: ../../library/errno.rst:821 msgid "RPC struct is bad" -msgstr "" +msgstr "RPC 構造体が不正です (RPC struct is bad)。" -#: ../../library/errno.rst:828 msgid "RPC version wrong" -msgstr "" +msgstr "RPC のバージョンが違います (RPC version wrong)。" -#: ../../library/errno.rst:835 msgid "Shared library version mismatch" msgstr "" +"共有ライブラリのバージョンが一致しません (Shared library version mismatch)。" -#: ../../library/errno.rst:842 msgid "" "Capabilities insufficient. This error is mapped to the exception :exc:" "`PermissionError`." msgstr "" +"ケーパビリティが不足しています (Capabilities insufficient)。\n" +"このエラーは例外 :exc:`PermissionError` に対応します。" msgid "Availability" msgstr "利用可能な環境" -#: ../../library/errno.rst:852 msgid "Operation canceled" -msgstr "" +msgstr "操作がキャンセルされました (Operation canceled)。" -#: ../../library/errno.rst:859 msgid "Owner died" -msgstr "" +msgstr "所有者が終了しました (Owner died)。" -#: ../../library/errno.rst:866 msgid "State not recoverable" -msgstr "" +msgstr "状態を回復できません (State not recoverable)。" diff --git a/library/exceptions.po b/library/exceptions.po index 96c8026e4..fb9497c49 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -1394,9 +1394,8 @@ msgstr "" "この警告は通常、Python ソースコードのコンパイル時に発生し、コンパイル済みの" "コードの実行時には通常は報告されません。" -#: ../../library/exceptions.rst:912 msgid "Base class for warnings about dubious runtime behavior." -msgstr "あいまいなランタイム挙動に対する警告の基底クラスです。" +msgstr "疑わしい実行時の動作についての警告の基底クラスです。" #: ../../library/exceptions.rst:917 msgid "" diff --git a/library/faulthandler.po b/library/faulthandler.po index b966597e9..716b19874 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -90,11 +90,12 @@ msgid "" msgstr "" "ファイル名、関数名、行番号だけを表示します (ソースコードは表示しません)。" -#: ../../library/faulthandler.rst:34 msgid "" "It is limited to 100 frames per thread, and 100 threads (configurable via " "*max_threads*)." msgstr "" +"1 スレッドあたり 100 フレーム、合計 100 スレッドに制限されています (スレッド" +"数は *max_threads* で設定できます)。" msgid "The order is reversed: the most recent call is shown first." msgstr "順序は逆で、最も新しい呼び出しから表示します。" @@ -118,101 +119,102 @@ msgstr "" "モジュールはC言語で実装されているので、アプリのクラッシュ時でもPythonがデッド" "ロックした場合でもダンプができます。" -#: ../../library/faulthandler.rst:45 msgid "" "The :ref:`Python Development Mode ` calls :func:`faulthandler." "enable` at Python startup." msgstr "" +":ref:`Python 開発モード ` は Python の起動時に :func:`faulthandler." +"enable` を呼び出します。" #: ../../library/faulthandler.rst:50 msgid "Module :mod:`pdb`" msgstr ":mod:`pdb` モジュール" -#: ../../library/faulthandler.rst:51 msgid "Interactive source code debugger for Python programs." -msgstr "" +msgstr "Python プログラム用の対話的なソースコードデバッガです。" #: ../../library/faulthandler.rst:53 msgid "Module :mod:`traceback`" msgstr ":mod:`traceback` モジュール" -#: ../../library/faulthandler.rst:54 msgid "" "Standard interface to extract, format and print stack traces of Python " "programs." msgstr "" +"Python プログラムのスタックトレースを抽出・整形・表示する標準インターフェー" +"ス。" #: ../../library/faulthandler.rst:57 msgid "Dumping the traceback" msgstr "tracebackのダンプ" -#: ../../library/faulthandler.rst:61 msgid "" "Dump the tracebacks of all threads into *file*. If *all_threads* is " "``False``, dump only the current thread. *max_threads* caps the number of " "threads dumped." msgstr "" +"すべてのスレッドのトレースバックを *file* にダンプします。\n" +"*all_threads* が ``False`` の場合は現在のスレッドだけをダンプします。\n" +"*max_threads* はダンプするスレッド数の上限です。" -#: ../../library/faulthandler.rst:65 msgid "" ":func:`traceback.print_tb`, which can be used to print a traceback object." -msgstr "" +msgstr "トレースバックオブジェクトの表示に使える :func:`traceback.print_tb`。" -#: ../../library/faulthandler.rst:67 ../../library/faulthandler.rst:126 -#: ../../library/faulthandler.rst:175 ../../library/faulthandler.rst:204 msgid "Added support for passing file descriptor to this function." -msgstr "" +msgstr "この関数にファイル記述子を渡せるようになりました。" -#: ../../library/faulthandler.rst:70 ../../library/faulthandler.rst:143 -#: ../../library/faulthandler.rst:181 ../../library/faulthandler.rst:207 msgid "Added the *max_threads* keyword argument." -msgstr "" +msgstr "キーワード引数 *max_threads* が追加されました。" -#: ../../library/faulthandler.rst:75 msgid "Dumping the C stack" -msgstr "" +msgstr "C スタックのダンプ" -#: ../../library/faulthandler.rst:81 msgid "Dump the C stack trace of the current thread into *file*." -msgstr "" +msgstr "現在のスレッドの C スタックトレースを *file* にダンプします。" -#: ../../library/faulthandler.rst:83 msgid "" "If the Python build does not support it or the operating system does not " "provide a stack trace, then this prints an error in place of a dumped C " "stack." msgstr "" +"Python のビルドが対応していない場合や、OS がスタックトレースを提供しない場合" +"は、C スタックのダンプの代わりにエラーを表示します。" -#: ../../library/faulthandler.rst:90 msgid "C Stack Compatibility" -msgstr "" +msgstr "C スタックの互換性" -#: ../../library/faulthandler.rst:92 msgid "" "If the system does not support the C-level :manpage:`backtrace(3)` or :" "manpage:`dladdr1(3)`, then C stack dumps will not work. An error will be " "printed instead of the stack." msgstr "" +"システムが C レベルの :manpage:`backtrace(3)` または :manpage:`dladdr1(3)` を" +"サポートしない場合、C スタックのダンプは機能しません。\n" +"スタックの代わりにエラーを表示します。" -#: ../../library/faulthandler.rst:96 msgid "" "Additionally, some compilers do not support :term:`CPython's ` " "implementation of C stack dumps. As a result, a different error may be " "printed instead of the stack, even if the operating system supports dumping " "stacks." msgstr "" +"また、一部のコンパイラは :term:`CPython` の C スタックのダンプ実装をサポート" +"しません。\n" +"そのため OS がスタックのダンプをサポートしていても、スタックの代わりに別のエ" +"ラーが表示される場合があります。" -#: ../../library/faulthandler.rst:102 msgid "" "Dumping C stacks can be arbitrarily slow, depending on the DWARF level of " "the binaries in the call stack." msgstr "" +"C スタックのダンプは、呼び出しスタック内のバイナリの DWARF レベルによっては非" +"常に時間がかかる場合があります。" #: ../../library/faulthandler.rst:106 msgid "Fault handler state" msgstr "フォールトハンドラの状態" -#: ../../library/faulthandler.rst:110 msgid "" "Enable the fault handler: install handlers for the :const:`~signal." "SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal." @@ -220,44 +222,56 @@ msgid "" "*all_threads* is ``True``, produce tracebacks for every running thread. " "Otherwise, dump only the current thread." msgstr "" +"フォールトハンドラを有効にします。\n" +"Python のトレースバックをダンプするために、:const:`~signal.SIGSEGV`、:const:" +"`~signal.SIGFPE`、:const:`~signal.SIGABRT`、:const:`~signal.SIGBUS`、:const:" +"`~signal.SIGILL` シグナルのハンドラを登録します。\n" +"*all_threads* が ``True`` の場合は、実行中のすべてのスレッドのトレースバック" +"を出力します。\n" +"それ以外の場合は現在のスレッドだけをダンプします。" -#: ../../library/faulthandler.rst:117 msgid "" "The *file* must be kept open until the fault handler is disabled: see :ref:" "`issue with file descriptors `." msgstr "" +"フォールトハンドラを無効にするまで *file* を開いたままにしておく必要がありま" +"す。\n" +":ref:`ファイル記述子の問題 ` を参照してください。" -#: ../../library/faulthandler.rst:120 msgid "" "If *c_stack* is ``True``, then the C stack trace is printed after the Python " "traceback, unless the system does not support it. See :func:`dump_c_stack` " "for more information on compatibility." msgstr "" +"*c_stack* が ``True`` の場合、システムがサポートしていれば Python のトレース" +"バックの後に C スタックトレースを表示します。\n" +"互換性の詳細は :func:`dump_c_stack` を参照してください。" -#: ../../library/faulthandler.rst:124 msgid "" "*max_threads* caps the number of threads dumped when a fatal signal fires." msgstr "" +"*max_threads* は、致命的なシグナルの発生時にダンプするスレッド数の上限です。" -#: ../../library/faulthandler.rst:129 msgid "On Windows, a handler for Windows exception is also installed." -msgstr "" +msgstr "Windows では、Windows 例外のハンドラも登録するようになりました。" -#: ../../library/faulthandler.rst:132 msgid "" "The dump now mentions if a garbage collector collection is running if " "*all_threads* is true." msgstr "" +"*all_threads* が真で、ガベージコレクタが回収処理を実行中の場合、そのこともダ" +"ンプに表示するようになりました。" -#: ../../library/faulthandler.rst:136 msgid "" "Only the current thread is dumped if the :term:`GIL` is disabled to prevent " "the risk of data races." msgstr "" +"データ競合の危険を防ぐため、:term:`GIL` が無効の場合は現在のスレッドだけをダ" +"ンプするようになりました。" -#: ../../library/faulthandler.rst:140 msgid "The dump now displays the C stack trace if *c_stack* is true." msgstr "" +"*c_stack* が真の場合、ダンプに C スタックトレースも表示するようになりました。" #: ../../library/faulthandler.rst:148 msgid "" @@ -275,7 +289,6 @@ msgstr "フォールトハンドラが有効かどうかチェックします。 msgid "Dumping the tracebacks after a timeout" msgstr "タイムアウト後にtracebackをダンプする" -#: ../../library/faulthandler.rst:161 msgid "" "Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or " "every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, " @@ -285,21 +298,31 @@ msgid "" "new call replaces previous parameters and resets the timeout. The timer has " "a sub-second resolution. *max_threads* caps the number of threads dumped." msgstr "" +"*timeout* 秒後に、または *repeat* が ``True`` の場合は *timeout* 秒ごとに、す" +"べてのスレッドのトレースバックをダンプします。\n" +"*exit* が ``True`` の場合、トレースバックをダンプした後に終了ステータス 1 " +"で :c:func:`!_exit` を呼び出します。\n" +"(:c:func:`!_exit` はプロセスを直ちに終了するため、ファイルバッファのフラッ" +"シュなどの後処理は行いません。)\n" +"この関数を 2 回呼び出すと、新しい呼び出しで以前のパラメータを置き換え、タイム" +"アウトをリセットします。\n" +"タイマーの分解能は 1 秒未満です。\n" +"*max_threads* はダンプするスレッド数の上限です。" -#: ../../library/faulthandler.rst:169 msgid "" "The *file* must be kept open until the traceback is dumped or :func:" "`cancel_dump_traceback_later` is called: see :ref:`issue with file " "descriptors `." msgstr "" +"トレースバックがダンプされるか :func:`cancel_dump_traceback_later` が呼び出さ" +"れるまで、*file* を開いたままにしておく必要があります。\n" +":ref:`ファイル記述子の問題 ` を参照してください。" -#: ../../library/faulthandler.rst:173 msgid "This function is implemented using a watchdog thread." -msgstr "" +msgstr "この関数は監視用のスレッドを使って実装されています。" -#: ../../library/faulthandler.rst:178 msgid "This function is now always available." -msgstr "" +msgstr "この関数は常に利用可能になりました。" #: ../../library/faulthandler.rst:186 msgid "Cancel the last call to :func:`dump_traceback_later`." @@ -309,19 +332,26 @@ msgstr ":func:`dump_traceback_later` の最新の呼び出しをキャンセル msgid "Dumping the traceback on a user signal" msgstr "ユーザシグナルに対してtracebackをダンプする" -#: ../../library/faulthandler.rst:194 msgid "" "Register a user signal: install a handler for the *signum* signal to dump " "the traceback of all threads, or of the current thread if *all_threads* is " "``False``, into *file*. Call the previous handler if chain is ``True``. " "*max_threads* caps the number of threads dumped." msgstr "" +"ユーザーシグナルを登録します。\n" +"*signum* シグナルのハンドラを登録し、すべてのスレッド、または *all_threads* " +"が ``False`` の場合は現在のスレッドのトレースバックを *file* にダンプしま" +"す。\n" +"``chain`` が ``True`` の場合は以前のハンドラも呼び出します。\n" +"*max_threads* はダンプするスレッド数の上限です。" -#: ../../library/faulthandler.rst:199 msgid "" "The *file* must be kept open until the signal is unregistered by :func:" "`unregister`: see :ref:`issue with file descriptors `." msgstr "" +":func:`unregister` でシグナルの登録を解除するまで、*file* を開いたままにして" +"おく必要があります。\n" +":ref:`ファイル記述子の問題 ` を参照してください。" #: ../../library/faulthandler.rst:202 ../../library/faulthandler.rst:216 msgid "Not available on Windows." @@ -367,7 +397,6 @@ msgstr "" "フォールトハンドラを有効化・無効化したときの Linuxでのセグメンテーション" "フォールトの例:" -#: ../../library/faulthandler.rst:237 msgid "" "$ python -c \"import ctypes; ctypes.string_at(0)\"\n" "Segmentation fault\n" @@ -428,3 +457,61 @@ msgid "" " \n" "Segmentation fault" msgstr "" +"$ python -c \"import ctypes; ctypes.string_at(0)\"\n" +"Segmentation fault\n" +"\n" +"$ python -q -X faulthandler\n" +">>> import ctypes\n" +">>> ctypes.string_at(0)\n" +"Fatal Python error: Segmentation fault\n" +"\n" +"Current thread 0x00007fb899f39700 (most recent call first):\n" +" File \"/opt/python/Lib/ctypes/__init__.py\", line 486 in string_at\n" +" File \"\", line 1 in \n" +"\n" +"Current thread's C stack trace (most recent call first):\n" +" Binary file \"/opt/python/python\", at _Py_DumpStack+0x42 " +"[0x5b27f7d7147e]\n" +" Binary file \"/opt/python/python\", at +0x32dcbd [0x5b27f7d85cbd]\n" +" Binary file \"/opt/python/python\", at +0x32df8a [0x5b27f7d85f8a]\n" +" Binary file \"/usr/lib/libc.so.6\", at +0x3def0 [0x77b73226bef0]\n" +" Binary file \"/usr/lib/libc.so.6\", at +0x17ef9c [0x77b7323acf9c]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-" +"x86_64-linux-gnu.so\", at +0xcdf6 [0x77b7315dddf6]\n" +" Binary file \"/usr/lib/libffi.so.8\", at +0x7976 [0x77b73158f976]\n" +" Binary file \"/usr/lib/libffi.so.8\", at +0x413c [0x77b73158c13c]\n" +" Binary file \"/usr/lib/libffi.so.8\", at ffi_call+0x12e [0x77b73158ef0e]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-" +"x86_64-linux-gnu.so\", at +0x15a33 [0x77b7315e6a33]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-" +"x86_64-linux-gnu.so\", at +0x164fa [0x77b7315e74fa]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.15/_ctypes.cpython-315d-" +"x86_64-linux-gnu.so\", at +0xc624 [0x77b7315dd624]\n" +" Binary file \"/opt/python/python\", at _PyObject_MakeTpCall+0xce " +"[0x5b27f7b73883]\n" +" Binary file \"/opt/python/python\", at +0x11bab6 [0x5b27f7b73ab6]\n" +" Binary file \"/opt/python/python\", at PyObject_Vectorcall+0x23 " +"[0x5b27f7b73b04]\n" +" Binary file \"/opt/python/python\", at _PyEval_EvalFrameDefault+0x490c " +"[0x5b27f7cbb302]\n" +" Binary file \"/opt/python/python\", at +0x2818e6 [0x5b27f7cd98e6]\n" +" Binary file \"/opt/python/python\", at +0x281aab [0x5b27f7cd9aab]\n" +" Binary file \"/opt/python/python\", at PyEval_EvalCode+0xc5 " +"[0x5b27f7cd9ba3]\n" +" Binary file \"/opt/python/python\", at +0x255957 [0x5b27f7cad957]\n" +" Binary file \"/opt/python/python\", at +0x255ab4 [0x5b27f7cadab4]\n" +" Binary file \"/opt/python/python\", at _PyEval_EvalFrameDefault+0x6c3e " +"[0x5b27f7cbd634]\n" +" Binary file \"/opt/python/python\", at +0x2818e6 [0x5b27f7cd98e6]\n" +" Binary file \"/opt/python/python\", at +0x281aab [0x5b27f7cd9aab]\n" +" Binary file \"/opt/python/python\", at +0x11b6e1 [0x5b27f7b736e1]\n" +" Binary file \"/opt/python/python\", at +0x11d348 [0x5b27f7b75348]\n" +" Binary file \"/opt/python/python\", at +0x11d626 [0x5b27f7b75626]\n" +" Binary file \"/opt/python/python\", at PyObject_Call+0x20 " +"[0x5b27f7b7565e]\n" +" Binary file \"/opt/python/python\", at +0x32a67a [0x5b27f7d8267a]\n" +" Binary file \"/opt/python/python\", at +0x32a7f8 [0x5b27f7d827f8]\n" +" Binary file \"/opt/python/python\", at +0x32ac1b [0x5b27f7d82c1b]\n" +" Binary file \"/opt/python/python\", at Py_RunMain+0x31 [0x5b27f7d82ebe]\n" +" \n" +"Segmentation fault" diff --git a/library/fcntl.po b/library/fcntl.po index 492f1642b..e12aa67ce 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -26,13 +26,17 @@ msgstr "" msgid ":mod:`!fcntl` --- The ``fcntl`` and ``ioctl`` system calls" msgstr ":mod:`!fcntl` --- ``fcntl`` および ``ioctl`` システムコール" -#: ../../library/fcntl.rst:13 msgid "" "This module performs file and I/O control on file descriptors. It is an " "interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See the :" "manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full " "details." msgstr "" +"このモジュールはファイル記述子に対するファイル制御と I/O 制御を行います。\n" +"Unix の :c:func:`fcntl` と :c:func:`ioctl` ルーチンへのインターフェイスで" +"す。\n" +"詳細は Unix のマニュアルページ :manpage:`fcntl(2)` と :manpage:`ioctl(2)` を" +"参照してください。" msgid "Availability" msgstr "利用可能な環境" @@ -59,14 +63,15 @@ msgstr "" "以前は :exc:`IOError` を送出していたこのモジュールの操作が、 :exc:`OSError` " "を送出するようになりました。" -#: ../../library/fcntl.rst:30 msgid "" "The :mod:`!fcntl` module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and " "``F_SEAL_*`` constants for sealing of :func:`os.memfd_create` file " "descriptors." msgstr "" +":mod:`!fcntl` モジュールに、:func:`os.memfd_create` のファイル記述子にシール" +"を設定するための定数 ``F_ADD_SEALS``、``F_GET_SEALS``、``F_SEAL_*`` が追加さ" +"れました。" -#: ../../library/fcntl.rst:35 msgid "" "On macOS, the :mod:`!fcntl` module exposes the ``F_GETPATH`` constant, which " "obtains the path of a file from a file descriptor. On Linux(>=3.15), the :" @@ -74,6 +79,11 @@ msgid "" "``F_OFD_SETLKW`` constants, which are used when working with open file " "description locks." msgstr "" +"macOS では、:mod:`!fcntl` モジュールにファイル記述子からファイルのパスを取得" +"する定数 ``F_GETPATH`` が追加されました。\n" +"Linux 3.15 以降では、:mod:`!fcntl` モジュールにオープンファイル記述のロックを" +"扱う定数 ``F_OFD_GETLK``、``F_OFD_SETLK``、``F_OFD_SETLKW`` が追加されまし" +"た。" #: ../../library/fcntl.rst:42 msgid "" @@ -82,22 +92,27 @@ msgid "" "size respectively." msgstr "" -#: ../../library/fcntl.rst:47 msgid "" "On FreeBSD, the :mod:`!fcntl` module exposes the ``F_DUP2FD`` and " "``F_DUP2FD_CLOEXEC`` constants, which allow to duplicate a file descriptor, " "the latter setting ``FD_CLOEXEC`` flag in addition." msgstr "" +"FreeBSD では、:mod:`!fcntl` モジュールにファイル記述子を複製する定数 " +"``F_DUP2FD`` と ``F_DUP2FD_CLOEXEC`` が追加されました。\n" +"後者は ``FD_CLOEXEC`` フラグも設定します。" -#: ../../library/fcntl.rst:52 msgid "" "On Linux >= 4.5, the :mod:`!fcntl` module exposes the ``FICLONE`` and " "``FICLONERANGE`` constants, which allow to share some data of one file with " "another file by reflinking on some filesystems (e.g., btrfs, OCFS2, and " "XFS). This behavior is commonly referred to as \"copy-on-write\"." msgstr "" +"Linux 4.5 以降では、:mod:`!fcntl` モジュールに定数 ``FICLONE`` と " +"``FICLONERANGE`` が追加されました。\n" +"一部のファイルシステム (btrfs、OCFS2、XFS など) で reflink を使い、あるファイ" +"ルのデータの一部を別のファイルと共有できます。\n" +"この動作は一般に「コピーオンライト」と呼ばれます。" -#: ../../library/fcntl.rst:58 msgid "" "On Linux >= 2.6.32, the :mod:`!fcntl` module exposes the ``F_GETOWN_EX``, " "``F_SETOWN_EX``, ``F_OWNER_TID``, ``F_OWNER_PID``, ``F_OWNER_PGRP`` " @@ -117,6 +132,27 @@ msgid "" "macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE`` " "and ``F_SETNOSIGPIPE`` constant." msgstr "" +"Linux 2.6.32 以降では、:mod:`!fcntl` モジュールに定数 ``F_GETOWN_EX``、" +"``F_SETOWN_EX``、``F_OWNER_TID``、``F_OWNER_PID``、``F_OWNER_PGRP`` が追加さ" +"れました。\n" +"これらを使うと、I/O が可能になったことを知らせるシグナルを特定のスレッド、プ" +"ロセス、プロセスグループに送れます。\n" +"Linux 4.13 以降では、:mod:`!fcntl` モジュールに定数 ``F_GET_RW_HINT``、" +"``F_SET_RW_HINT``、``F_GET_FILE_RW_HINT``、``F_SET_FILE_RW_HINT``、" +"``RWH_WRITE_LIFE_*`` が追加されました。\n" +"これらを使うと、指定した inode や特定のオープンファイル記述を介して書き込む" +"データについて、予想される寿命の相対的な長さをカーネルに伝えられます。\n" +"Linux 5.1 以降と NetBSD では、:mod:`!fcntl` モジュールに ``F_ADD_SEALS`` や " +"``F_GET_SEALS`` 操作で使う定数 ``F_SEAL_FUTURE_WRITE`` が追加されました。\n" +"FreeBSD では、:mod:`!fcntl` モジュールに定数 ``F_READAHEAD``、" +"``F_ISUNIONSTACK``、``F_KINFO`` が追加されました。\n" +"macOS と FreeBSD では、:mod:`!fcntl` モジュールに定数 ``F_RDAHEAD`` が追加さ" +"れました。\n" +"NetBSD と AIX では、:mod:`!fcntl` モジュールに定数 ``F_CLOSEM`` が追加されま" +"した。\n" +"NetBSD では、:mod:`!fcntl` モジュールに定数 ``F_MAXFD`` が追加されました。\n" +"macOS と NetBSD では、:mod:`!fcntl` モジュールに定数 ``F_GETNOSIGPIPE`` と " +"``F_SETNOSIGPIPE`` が追加されました。" #: ../../library/fcntl.rst:79 msgid "" @@ -128,7 +164,6 @@ msgstr "" msgid "The module defines the following functions:" msgstr "このモジュールには、以下の関数が定義されています:" -#: ../../library/fcntl.rst:88 msgid "" "Perform the operation *cmd* on file descriptor *fd* (file objects providing " "a :meth:`~io.IOBase.fileno` method are accepted as well). The values used " @@ -139,14 +174,21 @@ msgid "" "type and size of the argument of the operation as specified in the relevant " "C documentation." msgstr "" +"ファイル記述子 *fd* に対して操作 *cmd* を実行します (:meth:`~io.IOBase." +"fileno` メソッドを持つファイルオブジェクトも受け取れます)。\n" +"*cmd* に使う値は OS に依存し、関連する C ヘッダファイルと同じ名前の定数とし" +"て :mod:`!fcntl` モジュールに用意されています。\n" +"*arg* 引数には整数値、:term:`bytes-like object`、文字列のいずれかを指定できま" +"す。\n" +"*arg* の型とサイズは、関連する C のドキュメントで指定された操作の引数の型とサ" +"イズに一致しなければなりません。" -#: ../../library/fcntl.rst:97 msgid "" "When *arg* is an integer, the function returns the integer return value of " "the C :c:func:`fcntl` call." msgstr "" +"*arg* が整数の場合、C の :c:func:`fcntl` 呼び出しの整数の返り値を返します。" -#: ../../library/fcntl.rst:100 msgid "" "When the argument is bytes-like object, it represents a binary structure, " "for example, created by :func:`struct.pack`. A string value is encoded to " @@ -156,12 +198,18 @@ msgid "" "object. The length of the returned object will be the same as the length of " "the *arg* argument." msgstr "" +"引数が bytes-like オブジェクトの場合、:func:`struct.pack` で作成したものなど" +"のバイナリ構造体を表します。\n" +"文字列の値は UTF-8 でバイナリにエンコードされます。\n" +"バイナリデータはバッファにコピーされ、そのアドレスが C の :c:func:`fcntl` 呼" +"び出しに渡されます。\n" +"呼び出しが成功すると、バッファの内容を :class:`bytes` オブジェクトに変換して" +"返します。\n" +"返されるオブジェクトの長さは *arg* 引数の長さと同じです。" -#: ../../library/fcntl.rst:109 msgid "If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised." -msgstr "" +msgstr ":c:func:`fcntl` の呼び出しに失敗すると :exc:`OSError` を送出します。" -#: ../../library/fcntl.rst:112 ../../library/fcntl.rst:161 msgid "" "If the type or size of *arg* does not match the type or size of the " "operation's argument (for example, if an integer is passed when a pointer is " @@ -169,6 +217,10 @@ msgid "" "is larger than the size of *arg*), this is most likely to result in a " "segmentation violation or a more subtle data corruption." msgstr "" +"*arg* の型やサイズが操作の引数の型やサイズに一致しない場合 (例えば、ポインタ" +"が必要なところに整数を渡した場合や、OS がバッファに返す情報のサイズが *arg* " +"より大きい場合)、セグメンテーション違反や、より分かりにくいデータ破損が起きる" +"可能性が非常に高くなります。" msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " @@ -177,15 +229,16 @@ msgstr "" "引数 ``fd``, ``cmd``, ``arg`` を指定して :ref:`監査イベント ` " "``fcntl.fcntl`` を送出します。" -#: ../../library/fcntl.rst:121 msgid "" "Add support of arbitrary :term:`bytes-like objects `, not " "only :class:`bytes`." msgstr "" +":class:`bytes` だけでなく、任意の :term:`bytes-like オブジェクト ` をサポートするようになりました。" -#: ../../library/fcntl.rst:125 msgid "The size of bytes-like objects is no longer limited to 1024 bytes." msgstr "" +"bytes-like オブジェクトのサイズが 1024 バイトに制限されなくなりました。" #: ../../library/fcntl.rst:131 msgid "" @@ -195,28 +248,35 @@ msgstr "" "この関数は :func:`~fcntl.fcntl` 関数と同じですが、引数の扱いがより複雑である" "ところが異なります。" -#: ../../library/fcntl.rst:134 msgid "" "The *request* parameter is limited to values that can fit in 32-bits or 64-" "bits, depending on the platform. Additional constants of interest for use as " "the *request* argument can be found in the :mod:`termios` module, under the " "same names as used in the relevant C header files." msgstr "" +"*request* パラメータは、プラットフォームに応じて 32 ビットまたは 64 ビットに" +"収まる値に制限されます。\n" +"*request* 引数に使えるその他の定数は :mod:`termios` モジュールに、関連する C " +"ヘッダファイルと同じ名前で用意されています。" -#: ../../library/fcntl.rst:140 msgid "" "The parameter *arg* can be an integer, a :term:`bytes-like object`, or a " "string. The type and size of *arg* must match the type and size of the " "argument of the operation as specified in the relevant C documentation." msgstr "" +"*arg* パラメータには整数、:term:`bytes-like object`、文字列のいずれかを指定で" +"きます。\n" +"*arg* の型とサイズは、関連する C のドキュメントで指定された操作の引数の型とサ" +"イズに一致しなければなりません。" -#: ../../library/fcntl.rst:145 msgid "" "If *arg* does not support the read-write buffer interface or the " "*mutate_flag* is false, behavior is as for the :func:`~fcntl.fcntl` function." msgstr "" +"*arg* が読み書き可能なバッファインターフェイスをサポートしていない場合、また" +"は *mutate_flag* が偽の場合は、:func:`~fcntl.fcntl` 関数と同じ動作になりま" +"す。" -#: ../../library/fcntl.rst:149 msgid "" "If *arg* supports the read-write buffer interface (like :class:`bytearray`) " "and *mutate_flag* is true (the default), then the buffer is (in effect) " @@ -227,17 +287,24 @@ msgid "" "copied into a static buffer 1024 bytes long which is then passed to :func:" "`ioctl` and copied back into the supplied buffer." msgstr "" +"*arg* が :class:`bytearray` のように読み書き可能なバッファインターフェイスを" +"サポートし、*mutate_flag* が真 (デフォルト) の場合、実質的にはそのバッファが" +"基になる :c:func:`!ioctl` システムコールに渡されます。\n" +"システムコールの返り値が呼び出し元の Python に返され、バッファの新しい内容に" +"は :c:func:`ioctl` の処理が反映されます。\n" +"これは少し単純化した説明です。\n" +"実際には、渡したバッファの長さが 1024 バイト未満の場合は、まず長さ 1024 バイ" +"トの静的バッファにコピーしてから :func:`ioctl` に渡し、その後で元のバッファに" +"コピーし直します。" -#: ../../library/fcntl.rst:158 msgid "" "If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." -msgstr "" +msgstr ":c:func:`ioctl` の呼び出しに失敗すると :exc:`OSError` を送出します。" #: ../../library/fcntl.rst:168 msgid "An example::" msgstr "以下に例を示します::" -#: ../../library/fcntl.rst:170 msgid "" ">>> import array, fcntl, struct, termios, os\n" ">>> os.getpgrp()\n" @@ -250,6 +317,16 @@ msgid "" ">>> buf\n" "array('h', [13341])" msgstr "" +">>> import array, fcntl, struct, termios, os\n" +">>> os.getpgrp()\n" +"13341\n" +">>> struct.unpack('h', fcntl.ioctl(0, termios.TIOCGPGRP, \" \"))[0]\n" +"13341\n" +">>> buf = array.array('h', [0])\n" +">>> fcntl.ioctl(0, termios.TIOCGPGRP, buf, 1)\n" +"0\n" +">>> buf\n" +"array('h', [13341])" msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " @@ -258,17 +335,19 @@ msgstr "" "引数 ``fd``, ``request``, ``arg`` を指定して :ref:`監査イベント ` " "``fcntl.ioctl`` を送出します。" -#: ../../library/fcntl.rst:183 msgid "" "The GIL is always released during a system call. System calls failing with " "EINTR are automatically retried." msgstr "" +"システムコール中は常に GIL を解放するようになりました。\n" +"EINTR で失敗したシステムコールは自動的に再試行します。" -#: ../../library/fcntl.rst:187 msgid "" "The size of not mutated bytes-like objects is no longer limited to 1024 " "bytes." msgstr "" +"変更されない bytes-like オブジェクトのサイズが 1024 バイトに制限されなくなり" +"ました。" #: ../../library/fcntl.rst:193 msgid "" @@ -282,10 +361,9 @@ msgstr "" "Unix マニュアルの :manpage:`flock(2)` を参照してください (システムによって" "は、この関数は :c:func:`fcntl` を使ってエミュレーションされています)。" -#: ../../library/fcntl.rst:198 msgid "" "If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." -msgstr "" +msgstr ":c:func:`flock` の呼び出しに失敗すると :exc:`OSError` を送出します。" msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " @@ -306,25 +384,22 @@ msgstr "" "IOBase.fileno` メソッドを提供するファイルオブジェクトも受け付けられます) " "で、 *cmd* は以下の値のうちいずれかになります:" -#: ../../library/fcntl.rst:212 msgid "Release an existing lock." -msgstr "" +msgstr "既存のロックを解放します。" -#: ../../library/fcntl.rst:216 msgid "Acquire a shared lock." -msgstr "" +msgstr "共有ロックを取得します。" -#: ../../library/fcntl.rst:220 msgid "Acquire an exclusive lock." -msgstr "" +msgstr "排他ロックを取得します。" -#: ../../library/fcntl.rst:224 msgid "" "Bitwise OR with any of the other three ``LOCK_*`` constants to make the " "request non-blocking." msgstr "" +"ほかの 3 つの ``LOCK_*`` 定数のいずれかとビット単位の OR を取り、要求を非ブ" +"ロッキングにします。" -#: ../../library/fcntl.rst:227 msgid "" "If :const:`!LOCK_NB` is used and the lock cannot be acquired, an :exc:" "`OSError` will be raised and the exception will have an *errno* attribute " @@ -333,6 +408,13 @@ msgid "" "systems, :const:`!LOCK_EX` can only be used if the file descriptor refers to " "a file opened for writing." msgstr "" +":const:`!LOCK_NB` を使い、ロックを取得できなかった場合は :exc:`OSError` を送" +"出します。\n" +"例外の *errno* 属性には :const:`~errno.EACCES` または :const:`~errno.EAGAIN` " +"が設定されます (OS に依存するため、可搬性を保つには両方の値を確認してくださ" +"い)。\n" +"少なくとも一部のシステムでは、:const:`!LOCK_EX` を使えるのは、書き込み用に開" +"いたファイルを指すファイル記述子の場合だけです。" #: ../../library/fcntl.rst:234 msgid "" @@ -344,17 +426,14 @@ msgstr "" "相対的なバイトオフセット、 *whence* は :func:`io.IOBase.seek` と同じで、具体" "的には:" -#: ../../library/fcntl.rst:238 msgid "``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)" -msgstr "" +msgstr "``0`` -- ファイルの先頭を基準にします (:const:`os.SEEK_SET`)。" -#: ../../library/fcntl.rst:239 msgid "``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" -msgstr "" +msgstr "``1`` -- 現在のバッファ位置を基準にします (:const:`os.SEEK_CUR`)。" -#: ../../library/fcntl.rst:240 msgid "``2`` -- relative to the end of the file (:const:`os.SEEK_END`)" -msgstr "" +msgstr "``2`` -- ファイルの末尾を基準にします (:const:`os.SEEK_END`)。" #: ../../library/fcntl.rst:242 msgid "" @@ -378,7 +457,6 @@ msgstr "" "以下に例を示します。\n" "いずれも SVR4 準拠のシステムで実行したものです。 ::" -#: ../../library/fcntl.rst:250 msgid "" "import struct, fcntl, os\n" "\n" @@ -388,6 +466,13 @@ msgid "" "lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)\n" "rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" msgstr "" +"import struct, fcntl, os\n" +"\n" +"f = open(...)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)\n" +"\n" +"lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" #: ../../library/fcntl.rst:258 msgid "" @@ -404,20 +489,21 @@ msgstr "" msgid "Module :mod:`os`" msgstr ":mod:`os` モジュール" -#: ../../library/fcntl.rst:267 msgid "" "If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " "provides an alternative to the :func:`lockf` and :func:`flock` functions." msgstr "" +"ロック用のフラグ :const:`~os.O_SHLOCK` と :const:`~os.O_EXLOCK` が :mod:`os` " +"モジュールにある場合 (BSD のみ)、:func:`os.open` 関数を :func:`lockf` や :" +"func:`flock` の代わりに使えます。" #: ../../library/fcntl.rst:7 msgid "UNIX" msgstr "UNIX" -#: ../../library/fcntl.rst:7 msgid "file control" -msgstr "" +msgstr "ファイル制御" #: ../../library/fcntl.rst:7 msgid "I/O control" diff --git a/library/filecmp.po b/library/filecmp.po index da18a69a0..9253041ff 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -30,16 +30,18 @@ msgstr ":mod:`!filecmp` --- ファイルとディレクトリの比較" msgid "**Source code:** :source:`Lib/filecmp.py`" msgstr "**ソースコード:** :source:`Lib/filecmp.py`" -#: ../../library/filecmp.rst:11 msgid "" "The :mod:`!filecmp` module defines functions to compare files and " "directories, with various optional time/correctness trade-offs. For " "comparing files, see also the :mod:`difflib` module." msgstr "" +":mod:`!filecmp` モジュールはファイルとディレクトリを比較する関数を定義してい" +"ます。\n" +"オプションによって、処理時間と正確性のさまざまなバランスを選べます。\n" +"ファイルの比較については :mod:`difflib` モジュールも参照してください。" -#: ../../library/filecmp.rst:15 msgid "The :mod:`!filecmp` module defines the following functions:" -msgstr "" +msgstr ":mod:`!filecmp` モジュールは以下の関数を定義しています:" #: ../../library/filecmp.rst:20 msgid "" @@ -49,18 +51,20 @@ msgstr "" "名前が *f1* および *f2* のファイルを比較し、二つのファイルが同じらしければ " "``True`` を返し、そうでなければ ``False`` を返します。" -#: ../../library/filecmp.rst:23 msgid "" "If *shallow* is true and the :func:`os.stat` signatures (file type, size, " "and modification time) of both files are identical, the files are taken to " "be equal." msgstr "" +"*shallow* が真で、両方のファイルの :func:`os.stat` による特徴 (ファイルの種" +"類、サイズ、更新時刻) が同一であれば、ファイルは同じとみなされます。" -#: ../../library/filecmp.rst:27 msgid "" "Otherwise, the files are treated as different if their sizes or contents " "differ." msgstr "" +"それ以外の場合は、サイズまたは内容が異なればファイルを異なるものとして扱いま" +"す。" #: ../../library/filecmp.rst:29 msgid "" @@ -80,11 +84,12 @@ msgstr "" "stat` 情報が変更された場合、キャッシュの項目は無効化されます。:func:" "`clear_cache` を使用して全キャッシュを削除することが出来ます。" -#: ../../library/filecmp.rst:39 msgid "" "Compare the files in the two directories *a* and *b* whose names are given " "by *common*." msgstr "" +"ディレクトリ *a* と *b* の間で、*common* に名前を指定したファイルを比較しま" +"す。" #: ../../library/filecmp.rst:42 msgid "" @@ -132,23 +137,27 @@ msgstr "" msgid "The :class:`dircmp` class" msgstr ":class:`dircmp` クラス" -#: ../../library/filecmp.rst:73 msgid "" "Construct a new directory comparison object, to compare the directories *a* " "and *b*. *ignore* is a list of names to ignore, and defaults to :const:" "`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and defaults " "to ``[os.curdir, os.pardir]``." msgstr "" +"ディレクトリ *a* と *b* を比較する、新しいディレクトリ比較オブジェクトを作成" +"します。\n" +"*ignore* は無視する名前のリストで、デフォルトは :const:`filecmp." +"DEFAULT_IGNORES` です。\n" +"*hide* は隠す名前のリストで、デフォルトは ``[os.curdir, os.pardir]`` です。" -#: ../../library/filecmp.rst:78 msgid "" "The :class:`dircmp` class compares files by doing *shallow* comparisons as " "described for :func:`filecmp.cmp` by default using the *shallow* parameter." msgstr "" +":class:`dircmp` クラスは *shallow* パラメータを使い、デフォルトでは :func:" +"`filecmp.cmp` で説明した浅い比較を行います。" -#: ../../library/filecmp.rst:84 msgid "Added the *shallow* parameter." -msgstr "" +msgstr "*shallow* パラメータが追加されました。" #: ../../library/filecmp.rst:86 msgid "The :class:`dircmp` class provides the following methods:" @@ -173,21 +182,22 @@ msgstr "" "*a* および *b* およびそれらの共通のサブディレクトリ間での比較結果を (再帰的に" "比較して) 出力します。" -#: ../../library/filecmp.rst:102 msgid "" "The :class:`dircmp` class offers a number of interesting attributes that may " "be used to get various bits of information about the directory trees being " "compared." msgstr "" -":class:`dircmp` クラスは、比較されているディレクトリ階層に関する様々な情報の" -"ビットを得るために使用することのできる、興味深い属性を数多く提供しています。" +":class:`dircmp` クラスには、比較するディレクトリツリーについてさまざまな情報" +"を取得できる便利な属性が用意されています。" -#: ../../library/filecmp.rst:106 msgid "" "Note that via :meth:`~object.__getattr__` hooks, all attributes are computed " "lazily, so there is no speed penalty if only those attributes which are " "lightweight to compute are used." msgstr "" +":meth:`~object.__getattr__` フックによって、すべての属性は必要になるまで計算" +"されません。\n" +"そのため計算が軽い属性だけを使う場合、重い計算による速度の低下はありません。" #: ../../library/filecmp.rst:113 msgid "The directory *a*." @@ -256,18 +266,22 @@ msgstr "" msgid "Files which are in both *a* and *b*, but could not be compared." msgstr "*a* と *b* の両方に存在するものの、比較できなかったファイルです。" -#: ../../library/filecmp.rst:181 msgid "" "A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` " "instances (or MyDirCmp instances if this instance is of type MyDirCmp, a " "subclass of :class:`dircmp`)." msgstr "" +":attr:`common_dirs` 内の名前を :class:`dircmp` インスタンスに対応付ける辞書で" +"す (このインスタンスの型が :class:`dircmp` のサブクラス ``MyDirCmp`` であれ" +"ば、値も ``MyDirCmp`` インスタンスになります)。" -#: ../../library/filecmp.rst:185 msgid "" "Previously entries were always :class:`dircmp` instances. Now entries are " "the same type as *self*, if *self* is a subclass of :class:`dircmp`." msgstr "" +"以前は各項目が常に :class:`dircmp` インスタンスでした。\n" +"現在は *self* が :class:`dircmp` のサブクラスのインスタンスであれば、各項目" +"も *self* と同じ型になります。" #: ../../library/filecmp.rst:194 msgid "List of directories ignored by :class:`dircmp` by default." @@ -281,7 +295,6 @@ msgstr "" "これは ``subdirs`` 属性を使用して 2 つのディレクトリを再帰的に探索して、共通" "の異なるファイルを示すための単純化された例です::" -#: ../../library/filecmp.rst:200 msgid "" ">>> from filecmp import dircmp\n" ">>> def print_diff_files(dcmp):\n" @@ -294,3 +307,13 @@ msgid "" ">>> dcmp = dircmp('dir1', 'dir2')\n" ">>> print_diff_files(dcmp)" msgstr "" +">>> from filecmp import dircmp\n" +">>> def print_diff_files(dcmp):\n" +"... for name in dcmp.diff_files:\n" +"... print(\"diff_file %s found in %s and %s\" % (name, dcmp.left,\n" +"... dcmp.right))\n" +"... for sub_dcmp in dcmp.subdirs.values():\n" +"... print_diff_files(sub_dcmp)\n" +"...\n" +">>> dcmp = dircmp('dir1', 'dir2')\n" +">>> print_diff_files(dcmp)" diff --git a/library/fileinput.po b/library/fileinput.po index 85aa18714..bdf468be0 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -44,12 +44,14 @@ msgstr "" msgid "The typical use is::" msgstr "典型的な使い方は以下の通りです::" -#: ../../library/fileinput.rst:17 msgid "" "import fileinput\n" "for line in fileinput.input(encoding=\"utf-8\"):\n" " process(line)" msgstr "" +"import fileinput\n" +"for line in fileinput.input(encoding=\"utf-8\"):\n" +" process(line)" #: ../../library/fileinput.rst:21 msgid "" @@ -114,7 +116,6 @@ msgstr "" "ファイルの各行は、各種改行文字まで含めて返されます。ファイルの最後が改行文字" "で終っていない場合には、改行文字で終わらない行が返されます。" -#: ../../library/fileinput.rst:46 msgid "" "You can control how files are opened by providing an opening hook via the " "*openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The " @@ -124,6 +125,14 @@ msgid "" "keyword arguments. This module provides a :func:`hook_compressed` to support " "compressed files." msgstr "" +":func:`fileinput.input` または :func:`FileInput` の *openhook* パラメータに" +"オープン時のフックを渡すと、ファイルの開き方を制御できます。\n" +"フックは *filename* と *mode* の 2 つの引数を受け取り、それに従って開いたファ" +"イル類似オブジェクトを返す関数でなければなりません。\n" +"*encoding* や *errors* を指定すると、追加のキーワード引数としてフックに渡され" +"ます。\n" +"このモジュールには圧縮ファイルに対応する :func:`hook_compressed` が用意されて" +"います。" #: ../../library/fileinput.rst:53 msgid "The following function is the primary interface of this module:" @@ -151,13 +160,16 @@ msgstr "" "次の例では、仮に例外が生じたとしても :keyword:`!with` 文から抜けた後で " "*input* は閉じられます::" -#: ../../library/fileinput.rst:67 msgid "" "with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as " "f:\n" " for line in f:\n" " process(line)" msgstr "" +"with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as " +"f:\n" +" for line in f:\n" +" process(line)" #: ../../library/fileinput.rst:71 ../../library/fileinput.rst:167 msgid "Can be used as a context manager." @@ -168,10 +180,8 @@ msgid "The keyword parameters *mode* and *openhook* are now keyword-only." msgstr "" "キーワード引数 *mode* と *openhook* は、キーワード専用引数になりました。" -#: ../../library/fileinput.rst:77 ../../library/fileinput.rst:173 -#: ../../library/fileinput.rst:207 msgid "The keyword-only parameter *encoding* and *errors* are added." -msgstr "" +msgstr "キーワード専用引数 *encoding* と *errors* が追加されました。" #: ../../library/fileinput.rst:81 msgid "" @@ -299,11 +309,11 @@ msgstr "" "ければなりません。この関数の返り値は、オープンしたファイルオブジェクトとなり" "ます。*inplace* と *openhook* を同時に使うことはできません。" -#: ../../library/fileinput.rst:158 msgid "" "You can specify *encoding* and *errors* that is passed to :func:`open` or " "*openhook*." msgstr "" +":func:`open` または *openhook* に渡す *encoding* と *errors* を指定できます。" #: ../../library/fileinput.rst:160 msgid "" @@ -316,22 +326,24 @@ msgstr "" "次の例では、仮に例外が生じたとしても :keyword:`!with` 文から抜けた後で " "*input* は閉じられます::" -#: ../../library/fileinput.rst:164 msgid "" "with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n" " process(input)" msgstr "" +"with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n" +" process(input)" #: ../../library/fileinput.rst:170 msgid "The keyword parameter *mode* and *openhook* are now keyword-only." msgstr "" "キーワード引数 *mode* と *openhook* は、キーワード専用引数になりました。" -#: ../../library/fileinput.rst:176 msgid "" "The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been " "removed." msgstr "" +"``'rU'`` と ``'U'`` モード、および :meth:`!__getitem__` メソッドが削除されま" +"した。" #: ../../library/fileinput.rst:181 msgid "" @@ -374,11 +386,12 @@ msgstr "" "ます。ファイルの拡張子が ``'.gz'`` や ``'.bz2'`` でない場合は、通常通りファイ" "ルをオープンします (つまり、 :func:`open` をコールする際に伸長を行いません)。" -#: ../../library/fileinput.rst:202 msgid "" "The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` " "for compressed files and open for normal files." msgstr "" +"*encoding* と *errors* の値は、圧縮ファイルの場合は :class:`io." +"TextIOWrapper` に、通常のファイルの場合は ``open()`` に渡されます。" #: ../../library/fileinput.rst:205 msgid "" @@ -408,8 +421,9 @@ msgstr "" msgid "Added the optional *errors* parameter." msgstr "オプションの *errors* 引数が追加されました。" -#: ../../library/fileinput.rst:223 msgid "" "This function is deprecated since :func:`fileinput.input` and :class:" "`FileInput` now have *encoding* and *errors* parameters." msgstr "" +":func:`fileinput.input` と :class:`FileInput` に *encoding* と *errors* パラ" +"メータが追加されたため、この関数は非推奨になりました。" diff --git a/library/fnmatch.po b/library/fnmatch.po index c3c590425..0311e8835 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -102,21 +102,27 @@ msgstr "" "同様に、ピリオドで始まるファイル名も特別扱いされず、``*`` や ``?`` のパターン" "にマッチします。" -#: ../../library/fnmatch.rst:49 msgid "" "Unless stated otherwise, \"filename string\" and \"pattern string\" either " "refer to :class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note " "that the functions documented below do not allow to mix a :class:`!bytes` " "pattern with a :class:`!str` filename, and vice-versa." msgstr "" +"特に断りがなければ、「ファイル名文字列」と「パターン文字列」は :class:`str` " +"または ``ISO-8859-1`` でエンコードされた :class:`bytes` オブジェクトを指しま" +"す。\n" +"以下の関数では、:class:`!bytes` のパターンと :class:`!str` のファイル名を混在" +"させることはできず、その逆も同様です。" -#: ../../library/fnmatch.rst:54 msgid "" "Finally, note that :deco:`functools.lru_cache` with a *maxsize* of 32768 is " "used to cache the (typed) compiled regex patterns in the following " "functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, :func:`." "filterfalse`." msgstr "" +"なお、:func:`fnmatch`、:func:`fnmatchcase`、:func:`.filter`、:func:`." +"filterfalse` では、*maxsize* が 32768 の :deco:`functools.lru_cache` を使い、" +"コンパイル済みの正規表現パターンを型別にキャッシュしています。" #: ../../library/fnmatch.rst:61 msgid "" @@ -140,7 +146,6 @@ msgstr "" "次の例では、カレントディレクトリにある、拡張子が ``.txt`` である全てのファイ" "ルを表示しています::" -#: ../../library/fnmatch.rst:70 msgid "" "import fnmatch\n" "import os\n" @@ -149,6 +154,12 @@ msgid "" " if fnmatch.fnmatch(file, '*.txt'):\n" " print(file)" msgstr "" +"import fnmatch\n" +"import os\n" +"\n" +"for file in os.listdir('.'):\n" +" if fnmatch.fnmatch(file, '*.txt'):\n" +" print(file)" #: ../../library/fnmatch.rst:80 msgid "" @@ -160,27 +171,35 @@ msgstr "" "``True`` または ``False`` を返します。比較は大文字、小文字を区別し、 :func:" "`os.path.normcase` は適用しません。" -#: ../../library/fnmatch.rst:87 msgid "" "Construct a list from those elements of the :term:`iterable` of filename " "strings *names* that match the pattern string *pat*. It is the same as ``[n " "for n in names if fnmatch(n, pat)]``, but implemented more efficiently." msgstr "" +"ファイル名文字列の :term:`イテラブル ` *names* のうち、パターン文字" +"列 *pat* にマッチする要素からリストを作成します。\n" +"``[n for n in names if fnmatch(n, pat)]`` と同じですが、より効率的に実装され" +"ています。" -#: ../../library/fnmatch.rst:95 msgid "" "Construct a list from those elements of the :term:`iterable` of filename " "strings *names* that do not match the pattern string *pat*. It is the same " "as ``[n for n in names if not fnmatch(n, pat)]``, but implemented more " "efficiently." msgstr "" +"ファイル名文字列の :term:`イテラブル ` *names* のうち、パターン文字" +"列 *pat* にマッチしない要素からリストを作成します。\n" +"``[n for n in names if not fnmatch(n, pat)]`` と同じですが、より効率的に実装" +"されています。" -#: ../../library/fnmatch.rst:105 msgid "" "Return the shell-style pattern *pat* converted to a regular expression for " "using with :func:`re.prefixmatch`. The pattern is expected to be a :class:" "`str`." msgstr "" +"シェル形式のパターン *pat* を :func:`re.prefixmatch` で使う正規表現に変換して" +"返します。\n" +"パターンは :class:`str` でなければなりません。" #: ../../library/fnmatch.rst:109 msgid "Example:" diff --git a/library/fractions.po b/library/fractions.po index d6e808bc1..4c088d102 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -30,26 +30,28 @@ msgstr ":mod:`!fractions` --- 有理数" msgid "**Source code:** :source:`Lib/fractions.py`" msgstr "**ソースコード:** :source:`Lib/fractions.py`" -#: ../../library/fractions.rst:11 msgid "" "The :mod:`!fractions` module provides support for rational number arithmetic." -msgstr "" +msgstr ":mod:`!fractions` モジュールは有理数の演算をサポートします。" -#: ../../library/fractions.rst:14 msgid "" "A Fraction instance can be constructed from a pair of rational numbers, from " "a single number, or from a string." msgstr "" +"Fraction インスタンスは、2 つの有理数、1 つの数値、または文字列から作成できま" +"す。" -#: ../../library/fractions.rst:23 msgid "" "The first version requires that *numerator* and *denominator* are instances " "of :class:`numbers.Rational` and returns a new :class:`Fraction` instance " "with a value equal to ``numerator/denominator``. If *denominator* is zero, " "it raises a :exc:`ZeroDivisionError`." msgstr "" +"最初の形式では *numerator* と *denominator* が :class:`numbers.Rational` のイ" +"ンスタンスである必要があり、``numerator/denominator`` と等しい値を持つ新し" +"い :class:`Fraction` インスタンスを返します。\n" +"*denominator* がゼロの場合は :exc:`ZeroDivisionError` を送出します。" -#: ../../library/fractions.rst:28 msgid "" "The second version requires that *number* is an instance of :class:`numbers." "Rational` or has the :meth:`!as_integer_ratio` method (this includes :class:" @@ -62,16 +64,26 @@ msgid "" "one might expect. (But see the documentation for the :meth:" "`limit_denominator` method below.)" msgstr "" +"2 番目の形式では *number* が :class:`numbers.Rational` のインスタンスである" +"か、:meth:`!as_integer_ratio` メソッドを持つ必要があります (:class:`float` " +"と :class:`decimal.Decimal` はこれに含まれます)。\n" +"まったく同じ値を持つ :class:`Fraction` インスタンスを返します。\n" +":meth:`!as_integer_ratio` メソッドは互いに素な整数のペアを返し、後者が正であ" +"ることを前提としています。\n" +"二進浮動小数点に伴う一般的な問題 (:ref:`tut-fp-issues` を参照) により、" +"``Fraction(1.1)`` の引数は厳密には 11/10 と等しくないため、``Fraction(1.1)`` " +"は期待するかもしれない ``Fraction(11, 10)`` を返すわけでは *ありません*。\n" +"(ただし、以下の :meth:`limit_denominator` メソッドの説明を参照してください。)" -#: ../../library/fractions.rst:40 msgid "" "The last version of the constructor expects a string. The usual form for " "this instance is::" msgstr "" +"最後の形式のコンストラクタは文字列を受け取ります。\n" +"通常は次の形式です。 ::" -#: ../../library/fractions.rst:43 msgid "[sign] numerator ['/' denominator]" -msgstr "" +msgstr "[sign] numerator ['/' denominator]" #: ../../library/fractions.rst:45 msgid "" @@ -90,7 +102,6 @@ msgstr "" "class:`Fraction` コンストラクタでも受け付けられます。どちらの形式でも、入力さ" "れる文字列は前後に空白があって構いません。以下に、いくつかの例を示します::" -#: ../../library/fractions.rst:54 msgid "" ">>> from fractions import Fraction\n" ">>> Fraction(16, -10)\n" @@ -117,6 +128,30 @@ msgid "" ">>> Fraction(Decimal('1.1'))\n" "Fraction(11, 10)" msgstr "" +">>> from fractions import Fraction\n" +">>> Fraction(16, -10)\n" +"Fraction(-8, 5)\n" +">>> Fraction(123)\n" +"Fraction(123, 1)\n" +">>> Fraction()\n" +"Fraction(0, 1)\n" +">>> Fraction('3/7')\n" +"Fraction(3, 7)\n" +">>> Fraction(' -3/7 ')\n" +"Fraction(-3, 7)\n" +">>> Fraction('1.414213 \\t\\n')\n" +"Fraction(1414213, 1000000)\n" +">>> Fraction('-.125')\n" +"Fraction(-1, 8)\n" +">>> Fraction('7e-6')\n" +"Fraction(7, 1000000)\n" +">>> Fraction(2.25)\n" +"Fraction(9, 4)\n" +">>> Fraction(1.1)\n" +"Fraction(2476979795053773, 2251799813685248)\n" +">>> from decimal import Decimal\n" +">>> Fraction(Decimal('1.1'))\n" +"Fraction(11, 10)" #: ../../library/fractions.rst:80 msgid "" @@ -139,29 +174,35 @@ msgstr "" ":class:`Fraction` のコンストラクタが :class:`float` および :class:`decimal." "Decimal` インスタンスを受け付けるようになりました。" -#: ../../library/fractions.rst:90 msgid "" "The :func:`math.gcd` function is now used to normalize the *numerator* and " "*denominator*. :func:`math.gcd` always returns an :class:`int` type. " "Previously, the GCD type depended on *numerator* and *denominator*." msgstr "" +"*numerator* と *denominator* の正規化に :func:`math.gcd` 関数を使うようになり" +"ました。\n" +":func:`math.gcd` は常に :class:`int` 型を返します。\n" +"以前は最大公約数の型が *numerator* と *denominator* に依存していました。" -#: ../../library/fractions.rst:95 msgid "" "Underscores are now permitted when creating a :class:`Fraction` instance " "from a string, following :PEP:`515` rules." msgstr "" +"文字列から :class:`Fraction` インスタンスを作成する際に、:PEP:`515` の規則に" +"従ってアンダースコアを使えるようになりました。" -#: ../../library/fractions.rst:99 msgid "" ":class:`Fraction` implements ``__int__`` now to satisfy ``typing." "SupportsInt`` instance checks." msgstr "" +":class:`Fraction` は、``typing.SupportsInt`` のインスタンス検査を満たすよう " +"``__int__`` を実装しました。" -#: ../../library/fractions.rst:103 msgid "" "Space is allowed around the slash for string inputs: ``Fraction('2 / 3')``." msgstr "" +"文字列の入力で、``Fraction('2 / 3')`` のようにスラッシュの前後に空白を入れら" +"れるようになりました。" #: ../../library/fractions.rst:106 msgid "" @@ -170,42 +211,48 @@ msgid "" "``\"G\"`` and ``\"%\"\"``." msgstr "" -#: ../../library/fractions.rst:111 msgid "" "Formatting of :class:`Fraction` instances without a presentation type now " "supports fill, alignment, sign handling, minimum width and grouping." msgstr "" +"表現型を指定せずに :class:`Fraction` インスタンスを書式化する場合に、埋め文" +"字、配置、符号の処理、最小幅、桁のグループ化をサポートするようになりました。" -#: ../../library/fractions.rst:115 msgid "" "The :class:`Fraction` constructor now accepts any objects with the :meth:`!" "as_integer_ratio` method." msgstr "" +":class:`Fraction` コンストラクタが :meth:`!as_integer_ratio` メソッドを持つ任" +"意のオブジェクトを受け取れるようになりました。" #: ../../library/fractions.rst:121 msgid "Numerator of the Fraction in lowest term." msgstr "有理数を既約分数で表したときの分子。" -#: ../../library/fractions.rst:125 msgid "Denominator of the Fraction in lowest terms. Guaranteed to be positive." msgstr "" +"有理数を既約分数で表したときの分母です。\n" +"正であることが保証されています。" -#: ../../library/fractions.rst:131 msgid "" "Return a tuple of two integers, whose ratio is equal to the original " "Fraction. The ratio is in lowest terms and has a positive denominator." msgstr "" +"元の Fraction と等しい比を表す、2 つの整数のタプルを返します。\n" +"この比は既約で、分母は正です。" -#: ../../library/fractions.rst:139 msgid "Return ``True`` if the Fraction is an integer." -msgstr "" +msgstr "Fraction が整数なら ``True`` を返します。" -#: ../../library/fractions.rst:145 msgid "" "Alternative constructor which only accepts instances of :class:`float` or :" "class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " "the same value as ``Fraction(3, 10)``." msgstr "" +":class:`float` または :class:`numbers.Integral` のインスタンスだけを受け取る" +"代替コンストラクタです。\n" +"``Fraction.from_float(0.3)`` は ``Fraction(3, 10)`` と同じ値ではないことに注" +"意してください。" #: ../../library/fractions.rst:151 msgid "" @@ -215,11 +262,12 @@ msgstr "" "Python 3.2 以降では、 :class:`float` から直接 :class:`Fraction` インスタンス" "を構築できるようになりました。" -#: ../../library/fractions.rst:157 msgid "" "Alternative constructor which only accepts instances of :class:`decimal." "Decimal` or :class:`numbers.Integral`." msgstr "" +":class:`decimal.Decimal` または :class:`numbers.Integral` のインスタンスだけ" +"を受け取る代替コンストラクタです。" #: ../../library/fractions.rst:162 msgid "" @@ -229,13 +277,16 @@ msgstr "" "Python 3.2 以降では、 :class:`decimal.Decimal` インスタンスから直接 :class:" "`Fraction` インスタンスを構築できるようになりました。" -#: ../../library/fractions.rst:169 msgid "" "Alternative constructor which only accepts instances of :class:`numbers." "Integral`, :class:`numbers.Rational`, :class:`float` or :class:`decimal." "Decimal`, and objects with the :meth:`!as_integer_ratio` method, but not " "strings." msgstr "" +":class:`numbers.Integral`、:class:`numbers.Rational`、:class:`float`、:class:" +"`decimal.Decimal` のインスタンス、および :meth:`!as_integer_ratio` メソッドを" +"持つオブジェクトだけを受け取る代替コンストラクタです。\n" +"文字列は受け取りません。" #: ../../library/fractions.rst:179 msgid "" @@ -280,14 +331,15 @@ msgstr "" "10**ndigits)`` の倍数 (論理的に、 ``ndigits`` が負なら) を、これも偶数丸めで" "丸めます。 :func:`round` 関数からでもアクセスできます。" -#: ../../library/fractions.rst:225 msgid "" "Provides support for formatting of :class:`Fraction` instances via the :meth:" "`str.format` method, the :func:`format` built-in function, or :ref:" "`Formatted string literals `." msgstr "" +":meth:`str.format` メソッド、組み込み関数 :func:`format`、:ref:`フォーマット" +"済み文字列リテラル ` による :class:`Fraction` インスタンスの書式化" +"をサポートします。" -#: ../../library/fractions.rst:229 msgid "" "If the ``format_spec`` format specification string does not end with one of " "the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` " @@ -298,20 +350,29 @@ msgid "" "include an explicit denominator, even when the value being formatted is an " "exact integer. The zero-fill flag ``'0'`` is not supported." msgstr "" +"書式指定文字列 ``format_spec`` が表現型 ``'e'``、``'E'``、``'f'``、``'F'``、" +"``'g'``、``'G'``、``'%'`` のいずれでも終わらない場合は、:ref:`書式指定ミニ言" +"語 ` で説明する埋め文字、配置、符号の処理、最小幅、桁のグループ化" +"の一般的な規則に従って書式化します。\n" +"「別形式」のフラグ ``'#'`` をサポートします。\n" +"これを指定すると、書式化する値が厳密に整数であっても、出力文字列に常に分母を" +"明示します。\n" +"ゼロ埋めのフラグ ``'0'`` はサポートしません。" -#: ../../library/fractions.rst:239 msgid "" "If the ``format_spec`` format specification string ends with one of the " "presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or " "``'%'`` then formatting follows the rules outlined for the :class:`float` " "type in the :ref:`formatspec` section." msgstr "" +"書式指定文字列 ``format_spec`` が表現型 ``'e'``、``'E'``、``'f'``、``'F'``、" +"``'g'``、``'G'``、``'%'`` のいずれかで終わる場合は、:ref:`formatspec` 節に記" +"載された :class:`float` 型の規則に従って書式化します。" #: ../../library/fractions.rst:244 msgid "Here are some examples::" msgstr "ここに例があります::" -#: ../../library/fractions.rst:246 msgid "" ">>> from fractions import Fraction\n" ">>> format(Fraction(103993, 33102), '_')\n" @@ -332,6 +393,24 @@ msgid "" ">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" "'34.67% price increase'" msgstr "" +">>> from fractions import Fraction\n" +">>> format(Fraction(103993, 33102), '_')\n" +"'103_993/33_102'\n" +">>> format(Fraction(1, 7), '.^+10')\n" +"'...+1/7...'\n" +">>> format(Fraction(3, 1), '')\n" +"'3'\n" +">>> format(Fraction(3, 1), '#')\n" +"'3/1'\n" +">>> format(Fraction(1, 7), '.40g')\n" +"'0.1428571428571428571428571428571428571429'\n" +">>> format(Fraction('1234567.855'), '_.2f')\n" +"'1_234_567.86'\n" +">>> f\"{Fraction(355, 113):*>20.6e}\"\n" +"'********3.141593e+00'\n" +">>> old_price, new_price = 499, 672\n" +">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" +"'34.67% price increase'" #: ../../library/fractions.rst:268 msgid "Module :mod:`numbers`" @@ -341,6 +420,5 @@ msgstr ":mod:`numbers` モジュール" msgid "The abstract base classes making up the numeric tower." msgstr "数値の塔を作り上げる抽象基底クラス。" -#: ../../library/fractions.rst:17 msgid "as_integer_ratio()" -msgstr "" +msgstr "as_integer_ratio()" diff --git a/library/frameworks.po b/library/frameworks.po index e7310a77d..f0f17cea5 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -18,24 +18,23 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/frameworks.rst:7 msgid "Program frameworks" -msgstr "" +msgstr "プログラムフレームワーク" -#: ../../library/frameworks.rst:9 msgid "" "This chapter is no longer maintained, and the modules it contained have been " "moved to their respective topical documentation." msgstr "" +"この章はメンテナンスされなくなり、ここに含まれていたモジュールはそれぞれの分" +"野のドキュメントに移動しました。" -#: ../../library/frameworks.rst:11 msgid ":mod:`cmd` — :doc:`Command Line Interface Libraries <./cmdlinelibs>`" msgstr "" +":mod:`cmd` — :doc:`コマンドラインインターフェースライブラリ <./cmdlinelibs>`" -#: ../../library/frameworks.rst:12 msgid ":mod:`shlex` — :doc:`Unix Specific Services <./unix>`" -msgstr "" +msgstr ":mod:`shlex` — :doc:`Unix 固有のサービス <./unix>`" -#: ../../library/frameworks.rst:13 msgid ":mod:`turtle` — :doc:`Graphical User Interfaces with Tk <./tk>`" msgstr "" +":mod:`turtle` — :doc:`Tk を用いたグラフィカルユーザーインターフェース <./tk>`" diff --git a/library/ftplib.po b/library/ftplib.po index bb7411bd9..6bb838ce1 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -47,9 +47,8 @@ msgstr "" "使っています。 FTP (File Transfer Protocol)についての詳しい情報はinternet :" "rfc:`959` を参照して下さい。" -#: ../../library/ftplib.rst:22 msgid "The default encoding is UTF-8, following :rfc:`2640`." -msgstr "" +msgstr "デフォルトのエンコーディングは :rfc:`2640` に従い UTF-8 です。" msgid "Availability" msgstr "利用可能な環境" @@ -62,11 +61,9 @@ msgstr "" "このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" "`wasm-availability` を見てください。" -#: ../../library/ftplib.rst:26 msgid "Here's a sample session using the :mod:`!ftplib` module::" -msgstr "" +msgstr ":mod:`!ftplib` モジュールを使ったセッションの例を示します。 ::" -#: ../../library/ftplib.rst:28 msgid "" ">>> from ftplib import FTP\n" ">>> ftp = FTP('ftp.us.debian.org') # connect to host, default port\n" @@ -87,6 +84,25 @@ msgid "" ">>> ftp.quit()\n" "'221 Goodbye.'" msgstr "" +">>> from ftplib import FTP\n" +">>> ftp = FTP('ftp.us.debian.org') # デフォルトのポートでホストに接続\n" +">>> ftp.login() # ユーザー名 anonymous、パスワード " +"anonymous@\n" +"'230 Login successful.'\n" +">>> ftp.cwd('debian') # \"debian\" ディレクトリに移動\n" +"'250 Directory successfully changed.'\n" +">>> ftp.retrlines('LIST') # ディレクトリの内容を一覧表示\n" +"-rw-rw-r-- 1 1176 1176 1063 Jun 15 10:18 README\n" +"...\n" +"drwxr-sr-x 5 1176 1176 4096 Dec 19 2000 pool\n" +"drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project\n" +"drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools\n" +"'226 Directory send OK.'\n" +">>> with open('README', 'wb') as fp:\n" +">>> ftp.retrbinary('RETR README', fp.write)\n" +"'226 Transfer complete.'\n" +">>> ftp.quit()\n" +"'221 Goodbye.'" #: ../../library/ftplib.rst:51 msgid "Reference" @@ -96,19 +112,19 @@ msgstr "リファレンス" msgid "FTP objects" msgstr "FTP オブジェクト" -#: ../../library/ftplib.rst:87 msgid "Return a new instance of the :class:`FTP` class." -msgstr "" +msgstr ":class:`FTP` クラスの新しいインスタンスを返します。" #: ../../library/ftplib.rst:0 msgid "Parameters" msgstr "パラメーター" -#: ../../library/ftplib.rst:89 ../../library/ftplib.rst:461 msgid "" "The hostname to connect to. If given, :code:`connect(host)` is implicitly " "called by the constructor." msgstr "" +"接続先のホスト名。\n" +"指定した場合、コンストラクタが暗黙に :code:`connect(host)` を呼び出します。" #: ../../library/ftplib.rst:93 ../../library/ftplib.rst:465 msgid "" @@ -116,30 +132,24 @@ msgid "" "called by the constructor." msgstr "" -#: ../../library/ftplib.rst:98 ../../library/ftplib.rst:212 -#: ../../library/ftplib.rst:470 msgid "|param_doc_passwd|" -msgstr "" +msgstr "|param_doc_passwd|" -#: ../../library/ftplib.rst:101 ../../library/ftplib.rst:215 -#: ../../library/ftplib.rst:473 msgid "|param_doc_acct|" -msgstr "" +msgstr "|param_doc_acct|" -#: ../../library/ftplib.rst:104 msgid "" "A timeout in seconds for blocking operations like :meth:`connect` (default: " "the global default timeout setting)." msgstr "" +":meth:`connect` などのブロックする操作のタイムアウトを秒単位で指定します (デ" +"フォルト: グローバルなデフォルトのタイムアウト設定)。" -#: ../../library/ftplib.rst:109 ../../library/ftplib.rst:183 -#: ../../library/ftplib.rst:488 msgid "|param_doc_source_address|" -msgstr "" +msgstr "|param_doc_source_address|" -#: ../../library/ftplib.rst:113 ../../library/ftplib.rst:492 msgid "|param_doc_encoding|" -msgstr "" +msgstr "|param_doc_encoding|" #: ../../library/ftplib.rst:116 msgid "The :class:`FTP` class supports the :keyword:`with` statement, e.g.:" @@ -153,72 +163,86 @@ msgstr ":keyword:`with` 構文のサポートが追加されました。" msgid "*source_address* parameter was added." msgstr "*source_address* 引数が追加されました。" -#: ../../library/ftplib.rst:136 ../../library/ftplib.rst:505 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" "`ValueError` to prevent the creation of a non-blocking socket. The " "*encoding* parameter was added, and the default was changed from Latin-1 to " "UTF-8 to follow :rfc:`2640`." msgstr "" +"*timeout* 引数にゼロを指定すると、非ブロッキングソケットの作成を防ぐために :" +"class:`ValueError` を送出するようになりました。\n" +"*encoding* 引数が追加され、:rfc:`2640` に従ってデフォルトが Latin-1 から " +"UTF-8 に変更されました。" -#: ../../library/ftplib.rst:142 msgid "" "Several :class:`!FTP` methods are available in two flavors: one for handling " "text files and another for binary files. The methods are named for the " "command which is used followed by ``lines`` for the text version or " "``binary`` for the binary version." msgstr "" +":class:`!FTP` のいくつかのメソッドには、テキストファイル用とバイナリファイル" +"用の 2 種類があります。\n" +"メソッド名は、使用するコマンドに、テキスト用では ``lines``、バイナリ用では " +"``binary`` を付けたものです。" #: ../../library/ftplib.rst:147 msgid ":class:`FTP` instances have the following methods:" msgstr ":class:`FTP` インスタンスには以下のメソッドがあります:" -#: ../../library/ftplib.rst:151 msgid "" "Set the instance's debugging level as an :class:`int`. This controls the " "amount of debugging output printed. The debug levels are:" msgstr "" +"インスタンスのデバッグレベルを :class:`int` で設定します。\n" +"この値はデバッグ出力の量を制御します。\n" +"デバッグレベルは次のとおりです。" -#: ../../library/ftplib.rst:155 msgid "``0`` (default): No debug output." -msgstr "" +msgstr "``0`` (デフォルト): デバッグ出力を行いません。" -#: ../../library/ftplib.rst:156 msgid "" "``1``: Produce a moderate amount of debug output, generally a single line " "per request." msgstr "" +"``1``: 適度な量のデバッグ出力を行います。\n" +"通常はリクエストごとに 1 行です。" -#: ../../library/ftplib.rst:158 msgid "" "``2`` or higher: Produce the maximum amount of debugging output, logging " "each line sent and received on the control connection." msgstr "" +"``2`` 以上: 最大量のデバッグ出力を行い、制御接続で送受信する各行を記録しま" +"す。" -#: ../../library/ftplib.rst:163 msgid "" "Connect to the given host and port. This function should be called only once " "for each instance; it should not be called if a *host* argument was given " "when the :class:`FTP` instance was created. All other :class:`!FTP` methods " "can only be called after a connection has successfully been made." msgstr "" +"指定したホストとポートに接続します。\n" +"この関数はインスタンスごとに 1 回だけ呼び出してください。\n" +":class:`FTP` インスタンスの作成時に *host* 引数を指定した場合は呼び出さないで" +"ください。\n" +"ほかのすべての :class:`!FTP` メソッドは、接続が成功してから呼び出せます。" -#: ../../library/ftplib.rst:170 msgid "The host to connect to." -msgstr "" +msgstr "接続先のホスト。" -#: ../../library/ftplib.rst:173 msgid "" "The TCP port to connect to (default: ``21``, as specified by the FTP " "protocol specification). It is rarely needed to specify a different port " "number." msgstr "" +"接続先の TCP ポート (デフォルト: FTP プロトコルの仕様で定められた ``21``)。\n" +"別のポート番号を指定する必要はほとんどありません。" -#: ../../library/ftplib.rst:178 msgid "" "A timeout in seconds for the connection attempt (default: the global default " "timeout setting)." msgstr "" +"接続試行のタイムアウトを秒単位で指定します (デフォルト: グローバルなデフォル" +"トのタイムアウト設定)。" msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " @@ -237,7 +261,6 @@ msgstr "" "(このメッセージには時に、ユーザにとって重要な免責事項や ヘルプ情報が入ってい" "ます。)" -#: ../../library/ftplib.rst:202 msgid "" "Log on to the connected FTP server. This function should be called only once " "for each instance, after a connection has been established; it should not be " @@ -245,10 +268,14 @@ msgid "" "instance was created. Most FTP commands are only allowed after the client " "has logged in." msgstr "" +"接続中の FTP サーバーにログインします。\n" +"この関数は接続が確立した後、インスタンスごとに 1 回だけ呼び出してください。\n" +":class:`FTP` インスタンスの作成時に *host* と *user* 引数を指定した場合は呼び" +"出さないでください。\n" +"ほとんどの FTP コマンドは、クライアントがログインした後でのみ使用できます。" -#: ../../library/ftplib.rst:209 msgid "|param_doc_user|" -msgstr "" +msgstr "|param_doc_user|" #: ../../library/ftplib.rst:221 msgid "" @@ -270,41 +297,46 @@ msgstr "" "引数 ``self``, ``cmd`` を指定して :ref:`監査イベント ` ``ftplib." "sendcmd`` を送出します。" -#: ../../library/ftplib.rst:234 msgid "" "Send a simple command string to the server and handle the response. Return " "the response string if the response code corresponds to success (codes in " "the range 200--299). Raise :exc:`error_reply` otherwise." msgstr "" +"単純なコマンド文字列をサーバーに送信し、応答を処理します。\n" +"応答コードが成功を表す場合 (200〜299 のコード) は応答文字列を返します。\n" +"それ以外の場合は :exc:`error_reply` を送出します。" -#: ../../library/ftplib.rst:243 msgid "Retrieve a file in binary transfer mode." -msgstr "" +msgstr "バイナリ転送モードでファイルを取得します。" -#: ../../library/ftplib.rst:245 msgid "An appropriate ``RETR`` command: :samp:`\"RETR {filename}\"`." -msgstr "" +msgstr "適切な ``RETR`` コマンド: :samp:`\"RETR {filename}\"`。" -#: ../../library/ftplib.rst:248 msgid "" "A single parameter callable that is called for each block of data received, " "with its single argument being the data as :class:`bytes`." msgstr "" +"受信したデータのブロックごとに呼び出される、引数を 1 つ取る呼び出し可能オブ" +"ジェクト。\n" +"その引数には :class:`bytes` としてデータが渡されます。" -#: ../../library/ftplib.rst:254 msgid "" "The maximum chunk size to read on the low-level :class:`~socket.socket` " "object created to do the actual transfer. This also corresponds to the " "largest size of data that will be passed to *callback*. Defaults to ``8192``." msgstr "" +"実際の転送用に作成される低水準の :class:`~socket.socket` オブジェクトから読み" +"取るチャンクの最大サイズ。\n" +"*callback* に渡すデータの最大サイズでもあります。\n" +"デフォルトは ``8192`` です。" -#: ../../library/ftplib.rst:261 ../../library/ftplib.rst:308 msgid "" "A ``REST`` command to be sent to the server. See the documentation for the " "*rest* parameter of the :meth:`transfercmd` method." msgstr "" +"サーバーに送信する ``REST`` コマンド。\n" +":meth:`transfercmd` メソッドの *rest* 引数の説明を参照してください。" -#: ../../library/ftplib.rst:268 msgid "" "Retrieve a file or directory listing in the encoding specified by the " "*encoding* parameter at initialization. *cmd* should be an appropriate " @@ -315,6 +347,16 @@ msgid "" "argument containing the line with the trailing CRLF stripped. The default " "*callback* prints the line to :data:`sys.stdout`." msgstr "" +"初期化時に *encoding* 引数で指定したエンコーディングで、ファイルまたはディレ" +"クトリ一覧を取得します。\n" +"*cmd* には適切な ``RETR`` コマンド (:meth:`retrbinary` を参照)、または " +"``LIST`` や ``NLST`` などのコマンドを指定してください (通常は単に文字列 " +"``'LIST'``)。\n" +"``LIST`` はファイルの一覧とそれらのファイルに関する情報を取得します。\n" +"``NLST`` はファイル名の一覧を取得します。\n" +"各行について *callback* 関数を呼び出し、末尾の CRLF を除いた行を文字列の引数" +"として渡します。\n" +"デフォルトの *callback* は、その行を :data:`sys.stdout` に出力します。" #: ../../library/ftplib.rst:281 msgid "" @@ -324,36 +366,37 @@ msgstr "" "*val* が真の場合 \"パッシブ\" モードを有効化し、偽の場合は無効化します。 デ" "フォルトではパッシブモードです。" -#: ../../library/ftplib.rst:287 msgid "Store a file in binary transfer mode." -msgstr "" +msgstr "バイナリ転送モードでファイルを保存します。" -#: ../../library/ftplib.rst:289 msgid "An appropriate ``STOR`` command: :samp:`\"STOR {filename}\"`." -msgstr "" +msgstr "適切な ``STOR`` コマンド: :samp:`\"STOR {filename}\"`。" -#: ../../library/ftplib.rst:292 msgid "" "A file object (opened in binary mode) which is read until EOF, using its :" "meth:`~io.RawIOBase.read` method in blocks of size *blocksize* to provide " "the data to be stored." msgstr "" +"バイナリモードで開かれたファイルオブジェクト。\n" +":meth:`~io.RawIOBase.read` メソッドで *blocksize* サイズのブロックごとに EOF " +"まで読み取り、保存するデータを供給します。" -#: ../../library/ftplib.rst:298 msgid "The read block size. Defaults to ``8192``." msgstr "" +"読み取るブロックのサイズ。\n" +"デフォルトは ``8192`` です。" -#: ../../library/ftplib.rst:302 msgid "" "A single parameter callable that is called for each block of data sent, with " "its single argument being the data as :class:`bytes`." msgstr "" +"データのブロックを送信するたびに呼び出される、引数を 1 つ取る呼び出し可能オブ" +"ジェクト。\n" +"その引数には :class:`bytes` としてデータが渡されます。" -#: ../../library/ftplib.rst:312 msgid "The *rest* parameter was added." -msgstr "" +msgstr "*rest* 引数が追加されました。" -#: ../../library/ftplib.rst:318 msgid "" "Store a file in line mode. *cmd* should be an appropriate ``STOR`` command " "(see :meth:`storbinary`). Lines are read until EOF from the :term:`file " @@ -361,6 +404,14 @@ msgid "" "method to provide the data to be stored. *callback* is an optional single " "parameter callable that is called on each line after it is sent." msgstr "" +"行モードでファイルを保存します。\n" +"*cmd* には適切な ``STOR`` コマンドを指定してください (:meth:`storbinary` を参" +"照)。\n" +"バイナリモードで開かれた :term:`file object` *fp* の :meth:`~io.IOBase." +"readline` メソッドを使い、EOF まで行を読み取って保存するデータを供給しま" +"す。\n" +"*callback* は引数を 1 つ取る省略可能な呼び出し可能オブジェクトで、各行の送信" +"後に呼び出されます。" msgid "" "Initiate a transfer over the data connection. If the transfer is active, " @@ -376,7 +427,6 @@ msgstr "" "接続し、転送コマンドを開始します。\n" "どちらの場合も、その接続のソケットを返します。" -#: ../../library/ftplib.rst:333 msgid "" "If optional *rest* is given, a ``REST`` command is sent to the server, " "passing *rest* as an argument. *rest* is usually a byte offset into the " @@ -388,6 +438,15 @@ msgid "" "command, an :exc:`error_reply` exception will be raised. If this happens, " "simply call :meth:`transfercmd` without a *rest* argument." msgstr "" +"省略可能な *rest* を指定すると、その値を引数として ``REST`` コマンドをサー" +"バーに送信します。\n" +"通常、*rest* は要求するファイル内のバイトオフセットであり、ファイルの先頭部分" +"を飛ばして、指定した位置から送信を再開するようサーバーに指示します。\n" +"ただし :meth:`transfercmd` メソッドは、初期化時の *encoding* 引数を使って " +"*rest* を文字列に変換するだけで、その内容は検査しません。\n" +"サーバーが ``REST`` コマンドを認識しない場合は :exc:`error_reply` 例外を送出" +"します。\n" +"その場合は *rest* 引数を指定せずに :meth:`transfercmd` を呼び出してください。" msgid "" "Like :meth:`transfercmd`, but returns a tuple of the data connection and the " @@ -400,7 +459,6 @@ msgstr "" "予想サイズを計算できない場合、その要素は ``None`` になります。\n" "*cmd* と *rest* の意味は :meth:`transfercmd` と同じです。" -#: ../../library/ftplib.rst:354 msgid "" "List a directory in a standardized format by using ``MLSD`` command (:rfc:" "`3659`). If *path* is omitted the current directory is assumed. *facts* is " @@ -411,6 +469,16 @@ msgid "" "name. Content of this dictionary might be limited by the *facts* argument " "but server is not guaranteed to return all requested facts." msgstr "" +"``MLSD`` コマンド (:rfc:`3659`) を使い、標準化された形式でディレクトリを一覧" +"表示します。\n" +"*path* を省略するとカレントディレクトリを対象とします。\n" +"*facts* は必要な情報の種類を表す文字列のリストです (例: ``[\"type\", " +"\"size\", \"perm\"]``)。\n" +"``path`` に見つかったファイルごとに 2 要素のタプルを yield するジェネレータオ" +"ブジェクトを返します。\n" +"最初の要素はファイル名、2 番目の要素はそのファイルの情報を含む辞書です。\n" +"この辞書の内容は *facts* 引数で制限できる場合がありますが、要求したすべての情" +"報をサーバーが返す保証はありません。" #: ../../library/ftplib.rst:368 msgid "" @@ -424,11 +492,11 @@ msgstr "" "トディレクトリです)。 ``NLST`` コマンドに非標準である複数の引数を渡すことが" "できます。" -#: ../../library/ftplib.rst:373 ../../library/ftplib.rst:385 msgid "If your server supports the command, :meth:`mlsd` offers a better API." msgstr "" +"サーバーがこのコマンドをサポートしている場合は、:meth:`mlsd` の方が優れた " +"API を提供します。" -#: ../../library/ftplib.rst:378 msgid "" "Produce a directory listing as returned by the ``LIST`` command, printing it " "to standard output. The optional *argument* is a directory to list (default " @@ -437,6 +505,14 @@ msgid "" "function, it is used as a *callback* function as for :meth:`retrlines`; the " "default prints to :data:`sys.stdout`. This method returns ``None``." msgstr "" +"``LIST`` コマンドが返すディレクトリ一覧を標準出力に表示します。\n" +"省略可能な *argument* は一覧表示するディレクトリです (デフォルトはサーバーの" +"カレントディレクトリ)。\n" +"複数の引数を使って、非標準のオプションを ``LIST`` コマンドに渡せます。\n" +"最後の引数が関数の場合は、:meth:`retrlines` と同様に *callback* 関数として使" +"います。\n" +"デフォルトでは :data:`sys.stdout` に表示します。\n" +"このメソッドは ``None`` を返します。" #: ../../library/ftplib.rst:390 msgid "Rename file *fromname* on the server to *toname*." @@ -510,35 +586,40 @@ msgstr "" msgid "FTP_TLS objects" msgstr "FTP_TLS オブジェクト" -#: ../../library/ftplib.rst:452 msgid "" "An :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" "`4217`. Connect to port 21 implicitly securing the FTP control connection " "before authenticating." msgstr "" +":rfc:`4217` に従って FTP に TLS サポートを追加する :class:`FTP` のサブクラス" +"です。\n" +"ポート 21 に接続し、認証前に FTP の制御接続を暗黙に保護します。" -#: ../../library/ftplib.rst:458 msgid "" "The user must explicitly secure the data connection by calling the :meth:" "`prot_p` method." msgstr "" +"データ接続は、利用者が :meth:`prot_p` メソッドを呼び出して明示的に保護する必" +"要があります。" -#: ../../library/ftplib.rst:476 msgid "" "An SSL context object which allows bundling SSL configuration options, " "certificates and private keys into a single, potentially long-lived, " "structure. Please read :ref:`ssl-security` for best practices." msgstr "" +"SSL の設定オプション、証明書、秘密鍵を、長期間使用できる単一の構造にまとめる " +"SSL コンテキストオブジェクトです。\n" +"推奨される使用方法については :ref:`ssl-security` を参照してください。" -#: ../../library/ftplib.rst:483 msgid "" "A timeout in seconds for blocking operations like :meth:`~FTP.connect` " "(default: the global default timeout setting)." msgstr "" +":meth:`~FTP.connect` などのブロックする操作のタイムアウトを秒単位で指定しま" +"す (デフォルト: グローバルなデフォルトのタイムアウト設定)。" -#: ../../library/ftplib.rst:497 msgid "Added the *source_address* parameter." -msgstr "" +msgstr "*source_address* 引数が追加されました。" msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." @@ -554,7 +635,6 @@ msgstr "非推奨の *keyfile* と *certfile* 引数を削除しました。" msgid "Here's a sample session using the :class:`FTP_TLS` class::" msgstr ":class:`FTP_TLS` クラスを使ったセッションの例を示します。 ::" -#: ../../library/ftplib.rst:516 msgid "" ">>> ftps = FTP_TLS('ftp.pureftpd.org')\n" ">>> ftps.login()\n" @@ -570,33 +650,49 @@ msgid "" "'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', " "'sound', 'tmp', 'ucarp']" msgstr "" +">>> ftps = FTP_TLS('ftp.pureftpd.org')\n" +">>> ftps.login()\n" +"'230 Anonymous user logged in'\n" +">>> ftps.prot_p()\n" +"'200 Data protection level set to \"private\"'\n" +">>> ftps.nlst()\n" +"['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', " +"'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', " +"'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-" +"global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', " +"'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', " +"'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', " +"'sound', 'tmp', 'ucarp']" -#: ../../library/ftplib.rst:524 msgid "" ":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these " "additional methods and attributes:" msgstr "" +":class:`!FTP_TLS` クラスは :class:`FTP` を継承し、次のメソッドと属性を追加で" +"定義します。" -#: ../../library/ftplib.rst:529 msgid "Set up a secure control connection by using TLS." -msgstr "" +msgstr "TLS を使って安全な制御接続を確立します。" -#: ../../library/ftplib.rst:531 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" +"このメソッドは :attr:`ssl.SSLContext.check_hostname` によるホスト名の検証と、" +"*Server Name Indication* (:const:`ssl.HAS_SNI` を参照) をサポートするようにな" +"りました。" -#: ../../library/ftplib.rst:538 msgid "" "Revert control channel back to plaintext. This can be useful to take " "advantage of firewalls that know how to handle NAT with non-secure FTP " "without opening fixed ports." msgstr "" +"制御チャネルを平文に戻します。\n" +"暗号化されていない FTP の NAT を処理できるファイアウォールで、固定ポートを開" +"かずにその機能を利用する場合に役立ちます。" -#: ../../library/ftplib.rst:546 msgid "Set up secure data connection by using TLS." -msgstr "" +msgstr "TLS を使って安全なデータ接続を確立します。" #: ../../library/ftplib.rst:550 msgid "Set up clear text data connection." @@ -668,6 +764,5 @@ msgstr "FTP" msgid "protocol" msgstr "プロトコル" -#: ../../library/ftplib.rst:9 msgid "ftplib (standard module)" -msgstr "" +msgstr "ftplib (標準モジュール)" diff --git a/library/functools.po b/library/functools.po index 872d69ff4..1ce9fa97f 100644 --- a/library/functools.po +++ b/library/functools.po @@ -32,16 +32,18 @@ msgstr ":mod:`!functools` --- 高階関数と呼び出し可能オブジェク msgid "**Source code:** :source:`Lib/functools.py`" msgstr "**ソースコード:** :source:`Lib/functools.py`" -#: ../../library/functools.rst:16 msgid "" "The :mod:`!functools` module is for higher-order functions: functions that " "act on or return other functions. In general, any callable object can be " "treated as a function for the purposes of this module." msgstr "" +":mod:`!functools` モジュールは、ほかの関数を操作したり返したりする高階関数の" +"ためのモジュールです。\n" +"一般に、このモジュールではあらゆる呼び出し可能オブジェクトを関数として扱えま" +"す。" -#: ../../library/functools.rst:20 msgid "The :mod:`!functools` module defines the following functions:" -msgstr "" +msgstr ":mod:`!functools` モジュールは次の関数を定義しています。" #: ../../library/functools.rst:24 msgid "" @@ -51,19 +53,21 @@ msgstr "" "簡単で軽量な無制限の関数キャッシュです。 `\"メモ化 (memoize)\" `_ とも呼ばれることがあります。" -#: ../../library/functools.rst:27 msgid "" "Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper " "around a dictionary lookup for the function arguments. Because it never " "needs to evict old values, this is smaller and faster than :deco:`lru_cache` " "with a size limit." msgstr "" +"``lru_cache(maxsize=None)`` と同じものを返します。\n" +"関数の引数を辞書で検索する処理を薄いラッパーで包んだものです。\n" +"古い値を削除する必要がないため、サイズ制限付きの :deco:`lru_cache` より小さく" +"高速です。" #: ../../library/functools.rst:32 ../../library/functools.rst:294 msgid "For example::" msgstr "例えば::" -#: ../../library/functools.rst:34 msgid "" "@cache\n" "def factorial(n):\n" @@ -76,42 +80,64 @@ msgid "" ">>> factorial(12) # two new recursive calls, factorial(10) is cached\n" "479001600" msgstr "" +"@cache\n" +"def factorial(n):\n" +" return n * factorial(n-1) if n else 1\n" +"\n" +">>> factorial(10) # キャッシュ済みの結果がないため、11 回再帰呼び出しする\n" +"3628800\n" +">>> factorial(5) # 新たな呼び出しをせず、キャッシュ済みの結果を返す\n" +"120\n" +">>> factorial(12) # 2 回新たに再帰呼び出しする。factorial(10) はキャッシュ" +"済み\n" +"479001600" -#: ../../library/functools.rst:45 ../../library/functools.rst:155 msgid "" "The cache is threadsafe so that the wrapped function can be used in multiple " "threads. This means that the underlying data structure will remain coherent " "during concurrent updates." msgstr "" +"キャッシュはスレッドセーフなので、ラップされた関数を複数のスレッドで使用でき" +"ます。\n" +"これは、同時に更新が行われても、内部のデータ構造の整合性が保たれるという意味" +"です。" -#: ../../library/functools.rst:49 ../../library/functools.rst:159 msgid "" "It is possible for the wrapped function to be called more than once if " "another thread makes an additional call before the initial call has been " "completed and cached." msgstr "" +"最初の呼び出しが完了して結果がキャッシュされるまでに別のスレッドから呼び出さ" +"れた場合、ラップされた関数が複数回呼び出される可能性があります。" -#: ../../library/functools.rst:53 msgid "" "Call-once behavior is not guaranteed because locks are not held during the " "function call. Potentially another call with the same arguments could occur " "while the first call is still running." msgstr "" +"関数の呼び出し中はロックを保持しないため、呼び出しが 1 回だけになる保証はあり" +"ません。\n" +"最初の呼び出しがまだ実行中でも、同じ引数で別の呼び出しが行われる可能性があり" +"ます。" -#: ../../library/functools.rst:62 msgid "" "Transform a method of a class into a property whose value is computed once " "and then cached as a normal attribute for the life of the instance. Similar " "to :deco:`property`, with the addition of caching. Useful for expensive " "computed properties of instances that are otherwise effectively immutable." msgstr "" +"クラスのメソッドをプロパティに変換します。\n" +"その値は一度だけ計算され、インスタンスが存続する間は通常の属性としてキャッ" +"シュされます。\n" +":deco:`property` にキャッシュ機能を追加したようなものです。\n" +"それ以外の点では実質的にイミュータブルなインスタンスで、計算に時間のかかるプ" +"ロパティに役立ちます。" #: ../../library/functools.rst:67 ../../library/functools.rst:139 #: ../../library/functools.rst:435 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/functools.rst:69 msgid "" "class DataSet:\n" "\n" @@ -122,13 +148,24 @@ msgid "" " def stdev(self):\n" " return statistics.stdev(self._data)" msgstr "" +"class DataSet:\n" +"\n" +" def __init__(self, sequence_of_numbers):\n" +" self._data = tuple(sequence_of_numbers)\n" +"\n" +" @cached_property\n" +" def stdev(self):\n" +" return statistics.stdev(self._data)" -#: ../../library/functools.rst:78 msgid "" "The mechanics of :deco:`cached_property` are somewhat different from :deco:" "`property`. A regular property blocks attribute writes unless a setter is " "defined. In contrast, a *cached_property* allows writes." msgstr "" +":deco:`cached_property` の仕組みは :deco:`property` と少し異なります。\n" +"通常のプロパティでは、セッターが定義されていない限り属性への書き込みができま" +"せん。\n" +"これに対して *cached_property* は書き込みを許可します。" msgid "" "The *cached_property* decorator only runs on lookups and only when an " @@ -151,7 +188,6 @@ msgstr "" "キャッシュされた値は属性を削除することで取り除くことができます。これにより " "*cached_property* メソッドを再度実行することが可能になります。" -#: ../../library/functools.rst:91 msgid "" "The *cached_property* does not prevent a possible race condition in multi-" "threaded usage. The getter function could run more than once on the same " @@ -161,6 +197,14 @@ msgid "" "necessary locking inside the decorated getter function or around the cached " "property access." msgstr "" +"*cached_property* は、複数スレッドで使用する際に起こり得る競合状態を防ぎませ" +"ん。\n" +"同じインスタンスに対してゲッター関数が複数回実行され、最後の実行がキャッシュ" +"の値を設定する場合があります。\n" +"キャッシュされるプロパティが冪等であるなど、同じインスタンスで複数回実行して" +"も害がなければ問題ありません。\n" +"同期が必要な場合は、デコレートしたゲッター関数内か、キャッシュされるプロパ" +"ティにアクセスする箇所の前後で、必要なロックを実装してください。" msgid "" "Note, this decorator interferes with the operation of :pep:`412` key-sharing " @@ -187,7 +231,6 @@ msgstr "" "``__dict__`` を含まない型 (それ自体が ``__dict__`` 属性を提供しないため) に対" "しては動作しないことを意味します。" -#: ../../library/functools.rst:110 msgid "" "If a mutable mapping is not available or if space-efficient key sharing is " "desired, an effect similar to :deco:`cached_property` can also be achieved " @@ -195,8 +238,12 @@ msgid "" "cache-method-calls` for more details on how this differs from :deco:" "`cached_property`." msgstr "" +"ミュータブルなマッピングを利用できない場合や、キーを共有してメモリを節約した" +"い場合は、:deco:`lru_cache` の上に :deco:`property` を重ねることでも :deco:" +"`cached_property` に似た効果を得られます。\n" +":deco:`cached_property` との違いについては :ref:`faq-cache-method-calls` を参" +"照してください。" -#: ../../library/functools.rst:117 msgid "" "Prior to Python 3.12, :deco:`!cached_property` included an undocumented lock " "to ensure that in multi-threaded usage the getter function was guaranteed to " @@ -204,6 +251,12 @@ msgid "" "instance, which could result in unacceptably high lock contention. In Python " "3.12+ this locking is removed." msgstr "" +"Python 3.12 より前の :deco:`!cached_property` にはドキュメントに記載されてい" +"ないロックがあり、複数スレッドで使用してもゲッター関数がインスタンスごとに 1 " +"回だけ実行されるよう保証していました。\n" +"しかし、このロックはインスタンス単位ではなくプロパティ単位だったため、ロック" +"の競合が許容できないほど多くなる場合がありました。\n" +"Python 3.12 以降では、このロックは削除されています。" #: ../../library/functools.rst:127 msgid "" @@ -232,10 +285,11 @@ msgstr "" "し可能オブジェクトです。key 関数は呼び出し可能オブジェクトで、1つの引数を受け" "取り、ソートキーとして使われる値を返します。" -#: ../../library/functools.rst:141 msgid "" "sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order" msgstr "" +"sorted(iterable, key=cmp_to_key(locale.strcoll)) # ロケールに応じた順序で" +"ソート" #: ../../library/functools.rst:143 msgid "" @@ -282,12 +336,14 @@ msgstr "" "れにより *lru_cache* デコレータがユーザー関数に直接適用できるようになります。" "このとき *maxsize* の値はデフォルトの 128 となります::" -#: ../../library/functools.rst:175 msgid "" "@lru_cache\n" "def count_vowels(word):\n" " return sum(word.count(vowel) for vowel in 'AEIOUaeiou')" msgstr "" +"@lru_cache\n" +"def count_vowels(word):\n" +" return sum(word.count(vowel) for vowel in 'AEIOUaeiou')" #: ../../library/functools.rst:179 msgid "" @@ -297,15 +353,17 @@ msgstr "" "*maxsize* が ``None`` に設定された場合は、LRU 機能は無効化され、キャッシュは" "際限無く大きくなります。" -#: ../../library/functools.rst:182 msgid "" "If *typed* is set to true, function arguments of different types will be " "cached separately. If *typed* is false, the implementation will usually " "regard them as equivalent calls and only cache a single result. (Some types " "such as *str* and *int* may be cached separately even when *typed* is false.)" msgstr "" +"*typed* を真にすると、型の異なる関数の引数は別々にキャッシュされます。\n" +"*typed* が偽の場合、通常は同等の呼び出しとして扱われ、結果は 1 つだけキャッ" +"シュされます。\n" +"(*str* や *int* など、*typed* が偽でも別々にキャッシュされる型もあります。)" -#: ../../library/functools.rst:188 msgid "" "Note, type specificity applies only to the function's immediate arguments " "rather than their contents. The scalar arguments, ``Decimal(42)`` and " @@ -313,28 +371,40 @@ msgid "" "contrast, the tuple arguments ``('answer', Decimal(42))`` and ``('answer', " "Fraction(42))`` are treated as equivalent." msgstr "" +"型の区別は関数に直接渡す引数にだけ適用され、その内容には適用されない点に注意" +"してください。\n" +"スカラーの引数 ``Decimal(42)`` と ``Fraction(42)`` は、結果の異なる別々の呼び" +"出しとして扱われます。\n" +"一方、タプルの引数 ``('answer', Decimal(42))`` と ``('answer', " +"Fraction(42))`` は同等として扱われます。" -#: ../../library/functools.rst:194 msgid "" "The wrapped function is instrumented with a :func:`!cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " "and *typed*. This is for information purposes only. Mutating the values " "has no effect." msgstr "" +"ラップされた関数には、*maxsize* と *typed* の値を示す新しい :class:`dict` を" +"返す :func:`!cache_parameters` 関数が追加されます。\n" +"これは情報を得るためだけのもので、値を変更しても効果はありません。" -#: ../../library/functools.rst:202 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " "parameter, the wrapped function is instrumented with a :func:`!cache_info` " "function that returns a :term:`named tuple` showing *hits*, *misses*, " "*maxsize* and *currsize*." msgstr "" +"キャッシュの効果の測定や *maxsize* 引数の調整に役立つように、ラップされた関数" +"には :func:`!cache_info` 関数が追加されます。\n" +"この関数は *hits*、*misses*、*maxsize*、*currsize* を示す :term:`名前付きタプ" +"ル ` を返します。" -#: ../../library/functools.rst:210 msgid "" "The decorator also provides a :func:`!cache_clear` function for clearing or " "invalidating the cache." msgstr "" +"このデコレータはキャッシュを消去または無効化するための :func:`!cache_clear` " +"関数も提供します。" msgid "" "The original underlying function is accessible through the :attr:" @@ -345,19 +415,21 @@ msgstr "" "これは内観やキャッシュの回避、別のキャッシュによる関数のラップし直しに便利で" "す。" -#: ../../library/functools.rst:217 msgid "" "The cache keeps references to the arguments and return values until they age " "out of the cache or until the cache is cleared." msgstr "" +"引数と戻り値への参照は、古くなってキャッシュから削除されるか、キャッシュが消" +"去されるまで保持されます。" -#: ../../library/functools.rst:220 msgid "" "If a method is cached, the ``self`` instance argument is included in the " "cache. See :ref:`faq-cache-method-calls`" msgstr "" +"メソッドをキャッシュする場合、インスタンスの引数 ``self`` もキャッシュに含ま" +"れます。\n" +":ref:`faq-cache-method-calls` を参照してください。" -#: ../../library/functools.rst:223 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -366,8 +438,13 @@ msgid "" "cache's size limit assures that the cache does not grow without bound on " "long-running processes such as web servers." msgstr "" +"`LRU (least recently used) キャッシュ `_ は、最近の呼び出しか" +"ら今後の呼び出しをよく予測できる場合に最も効果を発揮します (例えば、ニュース" +"サーバーで人気の記事は日ごとに変わる傾向があります)。\n" +"キャッシュのサイズ制限により、ウェブサーバーなど長時間実行するプロセスでも" +"キャッシュが際限なく増えることを防ぎます。" -#: ../../library/functools.rst:230 msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " @@ -375,12 +452,16 @@ msgid "" "objects on each call (such as generators and async functions), or impure " "functions such as time() or random()." msgstr "" +"一般に LRU キャッシュは、以前計算した値を再利用したい場合にのみ使ってくださ" +"い。\n" +"したがって、副作用のある関数、呼び出すたびに別のミュータブルなオブジェクトを" +"作る必要のある関数 (ジェネレータや非同期関数など)、time() や random() のよう" +"な純粋でない関数をキャッシュしても意味がありません。" #: ../../library/functools.rst:236 msgid "Example of an LRU cache for static web content::" msgstr "静的 web コンテンツ の LRU キャッシュの例::" -#: ../../library/functools.rst:238 msgid "" "@lru_cache(maxsize=32)\n" "def get_pep(num):\n" @@ -399,6 +480,22 @@ msgid "" ">>> get_pep.cache_info()\n" "CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" msgstr "" +"@lru_cache(maxsize=32)\n" +"def get_pep(num):\n" +" 'Python Enhancement Proposal のテキストを取得する'\n" +" resource = f'https://peps.python.org/pep-{num:04d}'\n" +" try:\n" +" with urllib.request.urlopen(resource) as s:\n" +" return s.read()\n" +" except urllib.error.HTTPError:\n" +" return 'Not Found'\n" +"\n" +">>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:\n" +"... pep = get_pep(n)\n" +"... print(n, len(pep))\n" +"\n" +">>> get_pep.cache_info()\n" +"CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" #: ../../library/functools.rst:255 msgid "" @@ -410,7 +507,6 @@ msgstr "" "の技法を実装し、`フィボナッチ数 `_ を効率よく計算する例::" -#: ../../library/functools.rst:261 msgid "" "@lru_cache(maxsize=None)\n" "def fib(n):\n" @@ -424,6 +520,17 @@ msgid "" ">>> fib.cache_info()\n" "CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" msgstr "" +"@lru_cache(maxsize=None)\n" +"def fib(n):\n" +" if n < 2:\n" +" return n\n" +" return fib(n-1) + fib(n-2)\n" +"\n" +">>> [fib(n) for n in range(16)]\n" +"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\n" +"\n" +">>> fib.cache_info()\n" +"CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" #: ../../library/functools.rst:275 msgid "Added the *typed* option." @@ -433,9 +540,8 @@ msgstr "*typed* オプションが追加されました。" msgid "Added the *user_function* option." msgstr "*user_function* オプションが追加されました。" -#: ../../library/functools.rst:281 msgid "Added the function :func:`!cache_parameters`" -msgstr "" +msgstr ":func:`!cache_parameters` 関数が追加されました。" #: ../../library/functools.rst:286 msgid "" @@ -447,14 +553,15 @@ msgstr "" "たクラスを受け取り、残りを実装するクラスデコレータです。このデコレータは全て" "の拡張順序比較演算をサポートするための労力を軽減します:" -#: ../../library/functools.rst:290 msgid "" "The class must define one of :meth:`~object.__lt__`, :meth:`~object." "__le__`, :meth:`~object.__gt__`, or :meth:`~object.__ge__`. In addition, the " "class should supply an :meth:`~object.__eq__` method." msgstr "" +"クラスには :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object." +"__gt__`、:meth:`~object.__ge__` のいずれかを定義する必要があります。\n" +"加えて :meth:`~object.__eq__` メソッドも用意してください。" -#: ../../library/functools.rst:296 msgid "" "@total_ordering\n" "class Student:\n" @@ -472,6 +579,21 @@ msgid "" " return ((self.lastname.lower(), self.firstname.lower()) <\n" " (other.lastname.lower(), other.firstname.lower()))" msgstr "" +"@total_ordering\n" +"class Student:\n" +" def _is_valid_operand(self, other):\n" +" return (hasattr(other, \"lastname\") and\n" +" hasattr(other, \"firstname\"))\n" +" def __eq__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) ==\n" +" (other.lastname.lower(), other.firstname.lower()))\n" +" def __lt__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) <\n" +" (other.lastname.lower(), other.firstname.lower()))" #: ../../library/functools.rst:314 msgid "" @@ -488,25 +610,30 @@ msgstr "" "つの拡張比較メソッドをすべて実装すれば、簡単にスピードアップを図れるでしょ" "う。" -#: ../../library/functools.rst:323 msgid "" "This decorator makes no attempt to override methods that have been declared " "in the class *or its superclasses*. Meaning that if a superclass defines a " "comparison operator, *total_ordering* will not implement it again, even if " "the original method is abstract." msgstr "" +"このデコレータは、クラス *またはそのスーパークラス* で宣言されているメソッド" +"をオーバーライドしません。\n" +"つまり、スーパークラスが比較演算子を定義している場合は、元のメソッドが抽象メ" +"ソッドであっても *total_ordering* はそれを再実装しません。" -#: ../../library/functools.rst:330 msgid "" "Returning ``NotImplemented`` from the underlying comparison function for " "unrecognised types is now supported." msgstr "" +"認識できない型に対して、元の比較関数が ``NotImplemented`` を返すことをサポー" +"トしました。" -#: ../../library/functools.rst:336 msgid "" "A singleton object used as a sentinel to reserve a place for positional " "arguments when calling :func:`partial` and :func:`partialmethod`." msgstr "" +":func:`partial` や :func:`partialmethod` の呼び出し時に、位置引数の場所を確保" +"するための番兵として使うシングルトンオブジェクトです。" #: ../../library/functools.rst:344 msgid "" @@ -523,7 +650,6 @@ msgstr "" "は、それらで *keywords* を拡張または上書きします。おおよそ次のコードと等価で" "す::" -#: ../../library/functools.rst:351 msgid "" "def partial(func, /, *args, **keywords):\n" " def newfunc(*more_args, **more_keywords):\n" @@ -533,8 +659,14 @@ msgid "" " newfunc.keywords = keywords\n" " return newfunc" msgstr "" +"def partial(func, /, *args, **keywords):\n" +" def newfunc(*more_args, **more_keywords):\n" +" return func(*args, *more_args, **(keywords | more_keywords))\n" +" newfunc.func = func\n" +" newfunc.args = args\n" +" newfunc.keywords = keywords\n" +" return newfunc" -#: ../../library/functools.rst:359 msgid "" "The :func:`!partial` function is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -542,16 +674,24 @@ msgid "" "can be used to create a callable that behaves like the :func:`int` function " "where the *base* argument defaults to ``2``:" msgstr "" +":func:`!partial` 関数は関数の部分適用に使います。\n" +"関数の位置引数やキーワード引数の一部を「固定」し、より単純なシグネチャの新し" +"いオブジェクトを作ります。\n" +"例えば :func:`partial` を使うと、*base* 引数のデフォルトが ``2`` である点を除" +"いて :func:`int` 関数と同じように動作する、呼び出し可能オブジェクトを作れま" +"す。" -#: ../../library/functools.rst:365 msgid "" ">>> basetwo = partial(int, base=2)\n" ">>> basetwo.__doc__ = 'Convert base 2 string to an int.'\n" ">>> basetwo('10010')\n" "18" msgstr "" +">>> basetwo = partial(int, base=2)\n" +">>> basetwo.__doc__ = '2 進数の文字列を int に変換する。'\n" +">>> basetwo('10010')\n" +"18" -#: ../../library/functools.rst:372 msgid "" "If :data:`Placeholder` sentinels are present in *args*, they will be filled " "first when :func:`!partial` is called. This makes it possible to pre-fill " @@ -559,28 +699,38 @@ msgid "" "Placeholder`, only the chosen number of leading positional arguments can be " "pre-filled." msgstr "" +"*args* に :data:`Placeholder` の番兵が含まれている場合、:func:`!partial` の呼" +"び出し時にはその位置が先に埋められます。\n" +"これにより、:func:`!partial` の呼び出しで任意の位置引数をあらかじめ埋められま" +"す。\n" +":data:`!Placeholder` がなければ、先頭から指定した個数の位置引数しか埋められま" +"せん。" -#: ../../library/functools.rst:377 msgid "" "If any :data:`!Placeholder` sentinels are present, all must be filled at " "call time:" msgstr "" +":data:`!Placeholder` の番兵が含まれる場合、呼び出し時にすべてを埋める必要があ" +"ります。" -#: ../../library/functools.rst:379 msgid "" ">>> say_to_world = partial(print, Placeholder, Placeholder, \"world!\")\n" ">>> say_to_world('Hello', 'dear')\n" "Hello dear world!" msgstr "" +">>> say_to_world = partial(print, Placeholder, Placeholder, \"world!\")\n" +">>> say_to_world('Hello', 'dear')\n" +"Hello dear world!" -#: ../../library/functools.rst:385 msgid "" "Calling ``say_to_world('Hello')`` raises a :exc:`TypeError`, because only " "one positional argument is provided, but there are two placeholders that " "must be filled in." msgstr "" +"``say_to_world('Hello')`` を呼び出すと :exc:`TypeError` を送出します。\n" +"埋めるべきプレースホルダーが 2 つあるのに、位置引数が 1 つしか渡されていない" +"ためです。" -#: ../../library/functools.rst:389 msgid "" "If :func:`!partial` is applied to an existing :ref:`partial object `, :data:`!Placeholder` sentinels of the input object are filled in " @@ -588,8 +738,12 @@ msgid "" "new :data:`!Placeholder` sentinel to the place held by a previous :data:`!" "Placeholder`:" msgstr "" +"既存の :ref:`partial オブジェクト ` に :func:`!partial` を適" +"用すると、入力オブジェクトの :data:`!Placeholder` の番兵が新しい位置引数で埋" +"められます。\n" +"元の :data:`!Placeholder` の位置に新しい :data:`!Placeholder` の番兵を入れる" +"と、プレースホルダーを維持できます。" -#: ../../library/functools.rst:395 msgid "" ">>> from functools import partial, Placeholder as _\n" ">>> remove = partial(str.replace, _, _, '')\n" @@ -603,16 +757,27 @@ msgid "" ">>> remove_first_dear(message)\n" "'Hello, dear world!'" msgstr "" +">>> from functools import partial, Placeholder as _\n" +">>> remove = partial(str.replace, _, _, '')\n" +">>> message = 'Hello, dear dear world!'\n" +">>> remove(message, ' dear')\n" +"'Hello, world!'\n" +">>> remove_dear = partial(remove, _, ' dear')\n" +">>> remove_dear(message)\n" +"'Hello, world!'\n" +">>> remove_first_dear = partial(remove_dear, _, 1)\n" +">>> remove_first_dear(message)\n" +"'Hello, dear world!'" -#: ../../library/functools.rst:409 msgid "" ":data:`!Placeholder` cannot be passed to :func:`!partial` as a keyword " "argument." msgstr "" +":data:`!Placeholder` をキーワード引数として :func:`!partial` に渡すことはでき" +"ません。" -#: ../../library/functools.rst:411 msgid "Added support for :data:`Placeholder` in positional arguments." -msgstr "" +msgstr "位置引数での :data:`Placeholder` のサポートが追加されました。" #: ../../library/functools.rst:416 msgid "" @@ -632,7 +797,6 @@ msgstr "" "*func* は、:term:`descriptor` または呼び出し可能オブジェクトである必要があり" "ます (通常の関数など、両方の性質を持つオブジェクトは記述子として扱われます。)" -#: ../../library/functools.rst:423 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` or another " @@ -640,6 +804,10 @@ msgid "" "the underlying descriptor, and an appropriate :ref:`partial object` returned as the result." msgstr "" +"*func* がデスクリプタ (通常の Python 関数、:func:`classmethod`、:func:" +"`staticmethod`、:func:`~abc.abstractmethod`、別の :class:`partialmethod` イン" +"スタンスなど) の場合、``__get__`` の呼び出しは元のデスクリプタに委譲され、適" +"切な :ref:`partial オブジェクト ` が返されます。" msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " @@ -654,7 +822,6 @@ msgstr "" "*self* 引数は、:class:`partialmethod` コンストラクタに渡した *args* や " "*keywords* よりも前に、最初の位置引数として挿入されます。" -#: ../../library/functools.rst:437 msgid "" ">>> class Cell:\n" "... def __init__(self):\n" @@ -674,8 +841,24 @@ msgid "" ">>> c.alive\n" "True" msgstr "" +">>> class Cell:\n" +"... def __init__(self):\n" +"... self._alive = False\n" +"... @property\n" +"... def alive(self):\n" +"... return self._alive\n" +"... def set_state(self, state):\n" +"... self._alive = bool(state)\n" +"... set_alive = partialmethod(set_state, True)\n" +"... set_dead = partialmethod(set_state, False)\n" +"...\n" +">>> c = Cell()\n" +">>> c.alive\n" +"False\n" +">>> c.set_alive()\n" +">>> c.alive\n" +"True" -#: ../../library/functools.rst:460 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -687,12 +870,21 @@ msgid "" "*initial* is not given and *iterable* contains only one item, the first item " "is returned." msgstr "" +"2 つの引数を取る *function* を、*iterable* の要素に左から右へ累積的に適用し、" +"単一の値にまとめます。\n" +"例えば ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` は " +"``((((1+2)+3)+4)+5)`` を計算します。\n" +"左の引数 *x* は累積した値、右の引数 *y* は *iterable* から得た、更新に使う値" +"です。\n" +"省略可能な *initial* を指定すると、計算時に ``iterable`` の要素より前に置か" +"れ、``iterable`` が空の場合のデフォルト値にもなります。\n" +"*initial* を指定せず、*iterable* に要素が 1 つしかない場合は、その要素を返し" +"ます。" #: ../../library/functools.rst:469 msgid "Roughly equivalent to::" msgstr "およそ次と等価です::" -#: ../../library/functools.rst:471 msgid "" "initial_missing = sentinel('initial_missing')\n" "\n" @@ -706,6 +898,17 @@ msgid "" " value = function(value, element)\n" " return value" msgstr "" +"initial_missing = sentinel('initial_missing')\n" +"\n" +"def reduce(function, iterable, /, initial=initial_missing):\n" +" it = iter(iterable)\n" +" if initial is initial_missing:\n" +" value = next(it)\n" +" else:\n" +" value = initial\n" +" for element in it:\n" +" value = function(value, element)\n" +" return value" #: ../../library/functools.rst:483 msgid "" @@ -715,9 +918,8 @@ msgstr "" "全ての中間値を返すイテレータについては :func:`itertools.accumulate` を参照し" "てください。" -#: ../../library/functools.rst:486 msgid "*initial* is now supported as a keyword argument." -msgstr "" +msgstr "*initial* をキーワード引数として指定できるようになりました。" #: ../../library/functools.rst:491 msgid "" @@ -727,14 +929,15 @@ msgstr "" "関数を :term:`シングルディスパッチ ` :term:`ジェネリック関" "数 ` に変換します。" -#: ../../library/functools.rst:494 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" +"ジェネリック関数を定義するには、``@singledispatch`` デコレータを付けます。\n" +"``@singledispatch`` で関数を定義する場合、ディスパッチは最初の引数の型に基づ" +"く点に注意してください。 ::" -#: ../../library/functools.rst:498 msgid "" ">>> from functools import singledispatch\n" ">>> @singledispatch\n" @@ -743,16 +946,25 @@ msgid "" "... print(\"Let me just say,\", end=\" \")\n" "... print(arg)" msgstr "" +">>> from functools import singledispatch\n" +">>> @singledispatch\n" +"... def fun(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Let me just say,\", end=\" \")\n" +"... print(arg)" -#: ../../library/functools.rst:508 msgid "" "To add overloaded implementations to the function, use the :func:`!register` " "attribute of the generic function, which can be used as a decorator. For " "functions annotated with types, the decorator will infer the type of the " "first argument automatically::" msgstr "" +"関数にオーバーロードした実装を追加するには、ジェネリック関数の :func:`!" +"register` 属性を使います。\n" +"この属性はデコレータとして使用できます。\n" +"型アノテーションのある関数の場合、デコレータは最初の引数の型を自動的に推論し" +"ます。 ::" -#: ../../library/functools.rst:513 msgid "" ">>> @fun.register\n" "... def _(arg: int, verbose=False):\n" @@ -767,12 +979,22 @@ msgid "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" msgstr "" +">>> @fun.register\n" +"... def _(arg: int, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> @fun.register\n" +"... def _(arg: list, verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" -#: ../../library/functools.rst:526 msgid ":class:`typing.Union` can also be used::" -msgstr "" +msgstr ":class:`typing.Union` も使えます。 ::" -#: ../../library/functools.rst:528 msgid "" ">>> @fun.register\n" "... def _(arg: int | float, verbose=False):\n" @@ -789,6 +1011,20 @@ msgid "" "... print(i, elem)\n" "..." msgstr "" +">>> @fun.register\n" +"... def _(arg: int | float, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> from typing import Union\n" +">>> @fun.register\n" +"... def _(arg: Union[list, set], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)\n" +"..." #: ../../library/functools.rst:543 msgid "" @@ -798,7 +1034,6 @@ msgstr "" "型アノテーションを使っていないコードについては、デコレータに適切な型引数を明" "示的に渡せます::" -#: ../../library/functools.rst:546 msgid "" ">>> @fun.register(complex)\n" "... def _(arg, verbose=False):\n" @@ -807,16 +1042,23 @@ msgid "" "... print(arg.real, arg.imag)\n" "..." msgstr "" +">>> @fun.register(complex)\n" +"... def _(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Better than complicated.\", end=\" \")\n" +"... print(arg.real, arg.imag)\n" +"..." -#: ../../library/functools.rst:553 msgid "" "For code that dispatches on a collections type (e.g., ``list``), but wants " "to typehint the items of the collection (e.g., ``list[int]``), the dispatch " "type should be passed explicitly to the decorator itself with the typehint " "going into the function definition::" msgstr "" +"コレクションの型 (例: ``list``) に基づいてディスパッチし、その要素には型ヒン" +"ト (例: ``list[int]``) を付けたい場合は、ディスパッチに使う型をデコレータに明" +"示的に渡し、型ヒントは関数定義に記述してください。 ::" -#: ../../library/functools.rst:558 msgid "" ">>> @fun.register(list)\n" "... def _(arg: list[int], verbose=False):\n" @@ -825,38 +1067,54 @@ msgid "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" msgstr "" +">>> @fun.register(list)\n" +"... def _(arg: list[int], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" -#: ../../library/functools.rst:567 msgid "" "At runtime the function will dispatch on an instance of a list regardless of " "the type contained within the list i.e. ``[1,2,3]`` will be dispatched the " "same as ``[\"foo\", \"bar\", \"baz\"]``. The annotation provided in this " "example is for static type checkers only and has no runtime impact." msgstr "" +"実行時には、リストに含まれる要素の型に関係なく、リストのインスタンスに対して" +"同じ実装を選びます。\n" +"つまり、``[1,2,3]`` と ``[\"foo\", \"bar\", \"baz\"]`` は同じようにディスパッ" +"チされます。\n" +"この例のアノテーションは静的型チェッカーのためだけのもので、実行時には影響し" +"ません。" -#: ../../library/functools.rst:573 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`~singledispatch.register` attribute can also be used in a " "functional form::" msgstr "" +":term:`ラムダ式 ` や既存の関数を登録できるように、:func:" +"`~singledispatch.register` 属性は関数として呼び出すこともできます。 ::" -#: ../../library/functools.rst:576 msgid "" ">>> def nothing(arg, verbose=False):\n" "... print(\"Nothing.\")\n" "...\n" ">>> fun.register(type(None), nothing)" msgstr "" +">>> def nothing(arg, verbose=False):\n" +"... print(\"Nothing.\")\n" +"...\n" +">>> fun.register(type(None), nothing)" -#: ../../library/functools.rst:581 msgid "" "The :func:`~singledispatch.register` attribute returns the undecorated " "function. This enables decorator stacking, :mod:`pickling`, and the " "creation of unit tests for each variant independently::" msgstr "" +":func:`~singledispatch.register` 属性は、デコレートする前の関数を返します。\n" +"これにより、デコレータを重ねたり、:mod:`pickle 化 ` したり、実装ごと" +"に独立した単体テストを作成したりできます。 ::" -#: ../../library/functools.rst:585 msgid "" ">>> @fun.register(float)\n" "... @fun.register(Decimal)\n" @@ -868,6 +1126,15 @@ msgid "" ">>> fun_num is fun\n" "False" msgstr "" +">>> @fun.register(float)\n" +"... @fun.register(Decimal)\n" +"... def fun_num(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Half of your number:\", end=\" \")\n" +"... print(arg / 2)\n" +"...\n" +">>> fun_num is fun\n" +"False" #: ../../library/functools.rst:595 msgid "" @@ -875,7 +1142,6 @@ msgid "" "argument::" msgstr "汎用関数は、呼び出されると 1 つ目の引数の型でディスパッチします::" -#: ../../library/functools.rst:598 msgid "" ">>> fun(\"Hello, world.\")\n" "Hello, world.\n" @@ -894,6 +1160,22 @@ msgid "" ">>> fun(1.23)\n" "0.615" msgstr "" +">>> fun(\"Hello, world.\")\n" +"Hello, world.\n" +">>> fun(\"test.\", verbose=True)\n" +"Let me just say, test.\n" +">>> fun(42, verbose=True)\n" +"Strength in numbers, eh? 42\n" +">>> fun(['spam', 'spam', 'eggs', 'spam'], verbose=True)\n" +"Enumerate this:\n" +"0 spam\n" +"1 spam\n" +"2 eggs\n" +"3 spam\n" +">>> fun(None)\n" +"Nothing.\n" +">>> fun(1.23)\n" +"0.615" msgid "" "Where there is no registered implementation for a specific type, its method " @@ -917,7 +1199,6 @@ msgstr "" "抽象基底クラス (:term:`abstract base class`) に対して実装が登録されると、基底" "クラスの仮想サブクラスに対してもその実装がディスパッチされます::" -#: ../../library/functools.rst:625 msgid "" ">>> from collections.abc import Mapping\n" ">>> @fun.register\n" @@ -930,6 +1211,16 @@ msgid "" ">>> fun({\"a\": \"b\"})\n" "a => b" msgstr "" +">>> from collections.abc import Mapping\n" +">>> @fun.register\n" +"... def _(arg: Mapping, verbose=False):\n" +"... if verbose:\n" +"... print(\"Keys & Values\")\n" +"... for key, value in arg.items():\n" +"... print(key, \"=>\", value)\n" +"...\n" +">>> fun({\"a\": \"b\"})\n" +"a => b" #: ../../library/functools.rst:636 msgid "" @@ -967,17 +1258,19 @@ msgid "" "" msgstr "" -#: ../../library/functools.rst:658 msgid "" "The :func:`~singledispatch.register` attribute now supports using type " "annotations." msgstr "" +":func:`~singledispatch.register` 属性が型アノテーションの使用をサポートしまし" +"た。" -#: ../../library/functools.rst:661 msgid "" "The :func:`~singledispatch.register` attribute now supports :class:`typing." "Union` as a type annotation." msgstr "" +":func:`~singledispatch.register` 属性が型アノテーションとして :class:`typing." +"Union` をサポートしました。" #: ../../library/functools.rst:668 msgid "" @@ -987,15 +1280,17 @@ msgstr "" "メソッドを :term:`シングルディスパッチ ` :term:`ジェネリック" "関数 ` に変換します。" -#: ../../library/functools.rst:671 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a method using ``@singledispatchmethod``, note that " "the dispatch happens on the type of the first non-*self* or non-*cls* " "argument::" msgstr "" +"ジェネリックメソッドを定義するには、``@singledispatchmethod`` デコレータを付" +"けます。\n" +"``@singledispatchmethod`` でメソッドを定義する場合、*self* と *cls* を除いた" +"最初の引数の型に基づいてディスパッチされる点に注意してください。 ::" -#: ../../library/functools.rst:676 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1010,8 +1305,19 @@ msgid "" " def _(self, arg: bool):\n" " return not arg" msgstr "" +"class Negator:\n" +" @singledispatchmethod\n" +" def neg(self, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" def _(self, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" def _(self, arg: bool):\n" +" return not arg" -#: ../../library/functools.rst:689 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "deco:`classmethod`. Note that to allow for ``dispatcher.register``, " @@ -1019,8 +1325,13 @@ msgid "" "``Negator`` class with the ``neg`` methods bound to the class, rather than " "an instance of the class::" msgstr "" +"``@singledispatchmethod`` は :deco:`classmethod` などのデコレータと重ねて使え" +"ます。\n" +"ただし ``dispatcher.register`` を使うには、``singledispatchmethod`` が *最も" +"外側* のデコレータでなければなりません。\n" +"次の ``Negator`` クラスでは、``neg`` メソッドをインスタンスではなくクラスに束" +"縛しています。 ::" -#: ../../library/functools.rst:695 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1038,18 +1349,34 @@ msgid "" " def _(cls, arg: bool):\n" " return not arg" msgstr "" +"class Negator:\n" +" @singledispatchmethod\n" +" @classmethod\n" +" def neg(cls, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: bool):\n" +" return not arg" -#: ../../library/functools.rst:711 msgid "" "The same pattern can be used for other similar decorators: :deco:" "`staticmethod`, :deco:`~abc.abstractmethod`, and others." msgstr "" +":deco:`staticmethod`、:deco:`~abc.abstractmethod` など、同様のデコレータにも" +"この方法を使えます。" -#: ../../library/functools.rst:716 msgid "Added support of non-:term:`descriptor` callables." msgstr "" +":term:`descriptor` ではない呼び出し可能オブジェクトのサポートが追加されまし" +"た。" -#: ../../library/functools.rst:722 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -1064,14 +1391,28 @@ msgid "" "the wrapper function's :attr:`~function.__dict__`, i.e. the instance " "dictionary)." msgstr "" +"*wrapper* 関数を更新し、*wrapped* 関数と同じ属性を持つようにします。\n" +"省略可能な引数はタプルで、元の関数のどの属性をラッパー関数の同名の属性に直接" +"代入するか、またラッパー関数のどの属性を元の関数の同名の属性で更新するかを指" +"定します。\n" +"これらの引数のデフォルト値はモジュールレベルの定数 ``WRAPPER_ASSIGNMENTS`` " +"と ``WRAPPER_UPDATES`` です。\n" +"前者はラッパー関数の :attr:`~function.__module__`、:attr:`~function." +"__name__`、:attr:`~function.__qualname__`、:attr:`~function." +"__annotations__`、:attr:`~function.__type_params__`、およびドキュメンテーショ" +"ン文字列 :attr:`~function.__doc__` に代入し、後者は :attr:`~function." +"__dict__` (インスタンスの辞書) を更新します。" -#: ../../library/functools.rst:734 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :deco:`lru_cache`), " "this function automatically adds a ``__wrapped__`` attribute to the wrapper " "that refers to the function being wrapped." msgstr "" +"内観などの目的で元の関数にアクセスできるように (例えば :deco:`lru_cache` のよ" +"うなキャッシュ用デコレータを回避できるように)、この関数はラッパーに " +"``__wrapped__`` 属性を自動的に追加します。\n" +"この属性はラップされた元の関数を参照します。" #: ../../library/functools.rst:739 msgid "" @@ -1100,12 +1441,15 @@ msgstr "" "とは試みられません)。しかし、 *updated* で指名された属性がラッパー関数自身に" "存在しないなら :exc:`AttributeError` が送出されます。" -#: ../../library/functools.rst:751 msgid "" "The ``__wrapped__`` attribute is now automatically added. The :attr:" "`~function.__annotations__` attribute is now copied by default. Missing " "attributes no longer trigger an :exc:`AttributeError`." msgstr "" +"``__wrapped__`` 属性が自動的に追加されるようになりました。\n" +":attr:`~function.__annotations__` 属性がデフォルトでコピーされるようになりま" +"した。\n" +"属性が欠けていても :exc:`AttributeError` を送出しなくなりました。" msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " @@ -1116,10 +1460,11 @@ msgstr "" "が常にラップされた関数を参照するようになりました。\n" "(:issue:`17482` を参照)" -#: ../../library/functools.rst:761 msgid "" "The :attr:`~function.__type_params__` attribute is now copied by default." msgstr "" +":attr:`~function.__type_params__` 属性がデフォルトでコピーされるようになりま" +"した。" #: ../../library/functools.rst:767 msgid "" @@ -1132,7 +1477,6 @@ msgstr "" "して呼び出す便宜関数です。これは ``partial(update_wrapper, wrapped=wrapped, " "assigned=assigned, updated=updated)`` と等価です。例えば::" -#: ../../library/functools.rst:772 msgid "" ">>> from functools import wraps\n" ">>> def my_decorator(f):\n" @@ -1155,13 +1499,35 @@ msgid "" ">>> example.__doc__\n" "'Docstring'" msgstr "" +">>> from functools import wraps\n" +">>> def my_decorator(f):\n" +"... @wraps(f)\n" +"... def wrapper(*args, **kwds):\n" +"... print('Calling decorated function')\n" +"... return f(*args, **kwds)\n" +"... return wrapper\n" +"...\n" +">>> @my_decorator\n" +"... def example():\n" +"... \"\"\"Docstring\"\"\"\n" +"... print('Called example function')\n" +"...\n" +">>> example()\n" +"Calling decorated function\n" +"Called example function\n" +">>> example.__name__\n" +"'example'\n" +">>> example.__doc__\n" +"'Docstring'" -#: ../../library/functools.rst:793 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:`!" "example` would have been lost." msgstr "" +"このデコレータファクトリを使わなければ、例の関数の名前は ``'wrapper'`` にな" +"り、元の :func:`!example` のドキュメンテーション文字列は失われていたはずで" +"す。" #: ../../library/functools.rst:801 msgid ":class:`partial` Objects" @@ -1198,7 +1564,6 @@ msgid "" msgstr "" ":class:`partial` オブジェクトの呼び出し時に渡されるキーワード引数です。" -#: ../../library/functools.rst:824 msgid "" ":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " @@ -1206,3 +1571,8 @@ msgid "" "`~definition.__name__` and :attr:`~definition.__doc__` attributes are not " "created automatically." msgstr "" +":class:`partial` オブジェクトは、呼び出し可能で、弱参照でき、属性を持てるとい" +"う点で :ref:`関数オブジェクト ` に似ています。\n" +"ただし重要な違いもあります。\n" +"例えば :attr:`~definition.__name__` と :attr:`~definition.__doc__` 属性は自動" +"的には作成されません。" diff --git a/library/gc.po b/library/gc.po index ebc09feea..f5d8f98f4 100644 --- a/library/gc.po +++ b/library/gc.po @@ -49,9 +49,8 @@ msgstr "" "DEBUG_SAVEALL`` を含んでいることに注意しましょう。ガベージとして検出されたオ" "ブジェクトは、インスペクション用に gc.garbage に保存されます。" -#: ../../library/gc.rst:20 msgid "The :mod:`!gc` module provides the following functions:" -msgstr "" +msgstr ":mod:`!gc` モジュールは次の関数を提供します。" #: ../../library/gc.rst:25 msgid "Enable automatic garbage collection." @@ -65,13 +64,17 @@ msgstr "自動ガベージコレクションを無効にします。" msgid "Return ``True`` if automatic collection is enabled." msgstr "自動ガベージコレクションが有効なら ``True`` を返します。" -#: ../../library/gc.rst:40 msgid "" "With no arguments, run a full collection. The optional argument " "*generation* may be an integer specifying which generation to collect (from " "0 to 2). A :exc:`ValueError` is raised if the generation number is invalid. " "The sum of collected objects and uncollectable objects is returned." msgstr "" +"引数を指定しない場合は完全な回収を行います。\n" +"省略可能な引数 *generation* には、回収する世代を整数 (0〜2) で指定できま" +"す。\n" +"世代の番号が不正な場合は :exc:`ValueError` を送出します。\n" +"回収したオブジェクト数と回収不能だったオブジェクト数の合計を返します。" #: ../../library/gc.rst:45 msgid "" @@ -84,19 +87,18 @@ msgstr "" "れます。 :class:`float` など、実装によって幾つかの free list では全ての要素が" "解放されるわけではありません。" -#: ../../library/gc.rst:50 msgid "" "The effect of calling ``gc.collect()`` while the interpreter is already " "performing a collection is undefined." msgstr "" +"インタープリタがすでに回収を行っている間に ``gc.collect()`` を呼び出した場合" +"の動作は未定義です。" -#: ../../library/gc.rst:53 msgid "``generation=1`` performs an increment of collection." -msgstr "" +msgstr "``generation=1`` は回収を段階的に進めるようになりました。" -#: ../../library/gc.rst:56 msgid "``generation=1`` performs collection of the middle generation." -msgstr "" +msgstr "``generation=1`` は中間の世代を回収するようになりました。" #: ../../library/gc.rst:62 msgid "" @@ -112,24 +114,25 @@ msgstr "" msgid "Return the debugging flags currently set." msgstr "現在のデバッグフラグを返します。" -#: ../../library/gc.rst:74 msgid "" "Returns a list of all objects tracked by the collector, excluding the list " "returned. If *generation* is not ``None``, return only the objects tracked " "by the collector that are in that generation." msgstr "" +"ガベージコレクタが追跡しているすべてのオブジェクトのリストを返します。\n" +"返すリスト自体は含まれません。\n" +"*generation* が ``None`` でない場合は、その世代に属する追跡対象のオブジェクト" +"だけを返します。" #: ../../library/gc.rst:78 msgid "New *generation* parameter." msgstr "新しい *generation* パラメータ。" -#: ../../library/gc.rst:81 msgid "Generation 1 is removed" -msgstr "" +msgstr "世代 1 が削除されました。" -#: ../../library/gc.rst:84 msgid "Generation 1 is reintroduced to maintain GC behavior from 3.13." -msgstr "" +msgstr "3.13 の GC の動作を維持するために、世代 1 が再導入されました。" msgid "" "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " @@ -158,28 +161,28 @@ msgid "" "generation;" msgstr "``collected`` は、この世代内で回収されたオブジェクトの総数です;" -#: ../../library/gc.rst:101 msgid "" "``uncollectable`` is the total number of objects which were found to be " "uncollectable (and were therefore moved to the :data:`garbage` list) inside " "this generation;" msgstr "" +"``uncollectable`` は、この世代で回収不能と判定された (そのため :data:" +"`garbage` リストに移された) オブジェクトの総数です。" -#: ../../library/gc.rst:105 msgid "" "``candidates`` is the total number of objects in this generation which were " "considered for collection and traversed;" msgstr "" +"``candidates`` は、この世代で回収の候補として参照をたどったオブジェクトの総数" +"です。" -#: ../../library/gc.rst:108 msgid "" "``duration`` is the total time in seconds spent in collections for this " "generation." -msgstr "" +msgstr "``duration`` は、この世代の回収に費やした合計時間 (秒) です。" -#: ../../library/gc.rst:113 msgid "Add ``duration`` and ``candidates``." -msgstr "" +msgstr "``duration`` と ``candidates`` が追加されました。" #: ../../library/gc.rst:119 msgid "" @@ -189,7 +192,6 @@ msgstr "" "ガベージコレクションの閾値(検出頻度)を指定します。 *threshold0* を 0 にする" "と、検出は行われません。" -#: ../../library/gc.rst:122 msgid "" "The GC classifies objects into three generations depending on how many " "collection sweeps they have survived. New objects are placed in the " @@ -208,20 +210,35 @@ msgid "" "garbage_collector.md#collecting-the-oldest-generation>`_ for more " "information." msgstr "" +"GC は、何回の回収を生き残ったかに応じてオブジェクトを 3 つの世代に分類しま" +"す。\n" +"新しいオブジェクトは最も若い世代 (世代 ``0``) に置かれます。\n" +"回収を生き残ったオブジェクトは、1 つ古い世代に移されます。\n" +"世代 ``2`` が最も古い世代なので、その世代のオブジェクトは回収後も同じ世代に残" +"ります。\n" +"ガベージコレクタは、実行する時期を決めるために、前回の回収以降のオブジェクト" +"の割り当て数と解放数を記録しています。\n" +"割り当て数から解放数を引いた値が *threshold0* を超えると回収を開始します。\n" +"最初は世代 ``0`` だけを調べます。\n" +"世代 ``1`` を最後に調べてから世代 ``0`` を調べた回数が *threshold1* を超える" +"と、世代 ``1`` も調べます。\n" +"3 番目の世代の処理は少し複雑です。\n" +"詳しくは `最も古い世代の回収 `_ を参照してください。" -#: ../../library/gc.rst:136 msgid "" "See `Garbage collector design `_ for more information." msgstr "" +"詳しくは `ガベージコレクタの設計 `_ を参照してください。" -#: ../../library/gc.rst:138 msgid "*threshold2* is ignored" -msgstr "" +msgstr "*threshold2* が無視されるようになりました。" -#: ../../library/gc.rst:141 msgid "*threshold2* is restored to match Python 3.13 behavior." -msgstr "" +msgstr "Python 3.13 の動作に合わせて *threshold2* が復活しました。" #: ../../library/gc.rst:147 msgid "" @@ -338,13 +355,13 @@ msgid "" "True" msgstr "" -#: ../../library/gc.rst:215 msgid "" "Returns ``True`` if the given object has been finalized by the garbage " "collector, ``False`` otherwise. ::" msgstr "" +"指定したオブジェクトがガベージコレクタによってファイナライズ済みの場合は " +"``True``、そうでなければ ``False`` を返します。 ::" -#: ../../library/gc.rst:218 msgid "" ">>> x = None\n" ">>> class Lazarus:\n" @@ -359,14 +376,26 @@ msgid "" ">>> gc.is_finalized(x)\n" "True" msgstr "" +">>> x = None\n" +">>> class Lazarus:\n" +"... def __del__(self):\n" +"... global x\n" +"... x = self\n" +"...\n" +">>> lazarus = Lazarus()\n" +">>> gc.is_finalized(lazarus)\n" +"False\n" +">>> del lazarus\n" +">>> gc.is_finalized(x)\n" +"True" -#: ../../library/gc.rst:236 msgid "" "Freeze all the objects tracked by the garbage collector; move them to a " "permanent generation and ignore them in all the future collections." msgstr "" +"ガベージコレクタが追跡しているすべてのオブジェクトを凍結します。\n" +"これらのオブジェクトは永続世代に移され、以降のすべての回収で無視されます。" -#: ../../library/gc.rst:239 msgid "" "If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-" "on-write in child processes will maximize memory sharing and reduce overall " @@ -377,6 +406,14 @@ msgid "" "early in the parent process, ``gc.freeze()`` right before ``fork()``, and " "``gc.enable()`` early in child processes." msgstr "" +"プロセスが ``exec()`` を行わずに ``fork()`` する場合、子プロセスで不要なコ" +"ピーオンライトを避けることで、メモリ共有を最大限に活用し、全体のメモリ使用量" +"を減らせます。\n" +"そのためには、親プロセスのメモリページ内に解放済みの「穴」ができることを避け" +"るとともに、子プロセスの GC が、親プロセス由来の長寿命オブジェクトの " +"``gc_refs`` カウンタに触れないようにする必要があります。\n" +"両方を実現するには、親プロセスの早い段階で ``gc.disable()``、``fork()`` の直" +"前に ``gc.freeze()``、子プロセスの早い段階で ``gc.enable()`` を呼び出します。" #: ../../library/gc.rst:253 msgid "" @@ -429,11 +466,12 @@ msgstr "" "す。 :const:`DEBUG_UNCOLLECTABLE` がセットされていると、加えて回収不能オブ" "ジェクトを出力します。" -#: ../../library/gc.rst:285 msgid "" "Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " "end up in :data:`gc.garbage` anymore." msgstr "" +":pep:`442` に従い、:meth:`~object.__del__` メソッドを持つオブジェクトが :" +"data:`gc.garbage` に入らなくなりました。" #: ../../library/gc.rst:291 msgid "" @@ -483,17 +521,17 @@ msgstr "" "\"uncollectable\": *phase* が \"stop\" のとき、回収出来ずに :data:`garbage` " "リストに入れられたオブジェクトの数。" -#: ../../library/gc.rst:312 msgid "" "\"candidates\": When *phase* is \"stop\", the total number of objects in " "this generation which were considered for collection and traversed." msgstr "" +"\"candidates\": *phase* が \"stop\" の場合、この世代で回収の候補として参照を" +"たどったオブジェクトの総数。" -#: ../../library/gc.rst:315 msgid "" "\"duration\": When *phase* is \"stop\", the time in seconds spent in the " "collection." -msgstr "" +msgstr "\"duration\": *phase* が \"stop\" の場合、回収に費やした時間 (秒)。" #: ../../library/gc.rst:318 msgid "" @@ -519,9 +557,8 @@ msgstr "" ":data:`garbage` に回収できない独自の型のオブジェクトが現れたとき、アプリケー" "ションがそれらを特定し消去できるようにする。" -#: ../../library/gc.rst:330 msgid "Add \"duration\" and \"candidates\"." -msgstr "" +msgstr "\"duration\" と \"candidates\" が追加されました。" #: ../../library/gc.rst:334 msgid "The following constants are provided for use with :func:`set_debug`:" diff --git a/library/getopt.po b/library/getopt.po index e2a24a15a..f8ce51ad5 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -22,15 +22,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/getopt.rst:2 msgid ":mod:`!getopt` --- C-style parser for command line options" -msgstr "" +msgstr ":mod:`!getopt` --- C 形式のコマンドラインオプション解析" #: ../../library/getopt.rst:8 msgid "**Source code:** :source:`Lib/getopt.py`" msgstr "**ソースコード:** :source:`Lib/getopt.py`" -#: ../../library/getopt.rst:12 msgid "" "This module is considered feature complete. A more declarative and " "extensible alternative to this API is provided in the :mod:`optparse` " @@ -38,8 +36,12 @@ msgid "" "processing are provided either as third party modules on PyPI, or else as " "features in the :mod:`argparse` module." msgstr "" +"このモジュールは機能が完成したものとされています。\n" +"この API より宣言的で拡張しやすい代替手段として、:mod:`optparse` モジュールが" +"あります。\n" +"コマンドライン引数処理のさらなる機能拡張は、PyPI のサードパーティーモジュール" +"か、:mod:`argparse` モジュールの機能として提供されます。" -#: ../../library/getopt.rst:20 msgid "" "This module helps scripts to parse the command line arguments in ``sys." "argv``. It supports the same conventions as the Unix :c:func:`!getopt` " @@ -47,8 +49,13 @@ msgid "" "and '``--``'). Long options similar to those supported by GNU software may " "be used as well via an optional third argument." msgstr "" +"このモジュールは、スクリプトで ``sys.argv`` のコマンドライン引数を解析する際" +"に役立ちます。\n" +"Unix の :c:func:`!getopt` 関数と同じ規則をサポートします (引数 \"``-``\" と " +"\"``--``\" の特別な意味も含みます)。\n" +"省略可能な第 3 引数により、GNU ソフトウェアがサポートするものと同様の長形式の" +"オプションも使えます。" -#: ../../library/getopt.rst:26 msgid "" "Users who are unfamiliar with the Unix :c:func:`!getopt` function should " "consider using the :mod:`argparse` module instead. Users who are familiar " @@ -57,12 +64,17 @@ msgid "" "should consider using the :mod:`optparse` module. See :ref:`choosing-an-" "argument-parser` for additional details." msgstr "" +"Unix の :c:func:`!getopt` 関数に不慣れな場合は、代わりに :mod:`argparse` モ" +"ジュールの使用を検討してください。\n" +"Unix の :c:func:`!getopt` 関数に慣れていて、同等の動作をより少ないコードで実" +"現し、より適切なヘルプやエラーメッセージを得たい場合は、:mod:`optparse` モ" +"ジュールの使用を検討してください。\n" +"詳しくは :ref:`choosing-an-argument-parser` を参照してください。" #: ../../library/getopt.rst:33 msgid "This module provides two functions and an exception:" msgstr "このモジュールは2つの関数と1つの例外を提供しています:" -#: ../../library/getopt.rst:39 msgid "" "Parses command line options and parameter list. *args* is the argument list " "to be parsed, without the leading reference to the running program. " @@ -72,15 +84,24 @@ msgid "" "argument followed by two colons (``'::'``); i.e., the same format that Unix :" "c:func:`!getopt` uses." msgstr "" +"コマンドラインのオプションと引数のリストを解析します。\n" +"*args* は解析する引数のリストで、先頭にある実行中のプログラムを示す要素は除き" +"ます。\n" +"通常は ``sys.argv[1:]`` です。\n" +"*shortopts* はスクリプトが認識するオプションの文字を並べた文字列です。\n" +"引数が必須のオプションの後ろにはコロン (``':'``) を 1 つ、省略可能な引数を取" +"るオプションの後ろには 2 つ (``'::'``) 付けます。\n" +"これは Unix の :c:func:`!getopt` が使うのと同じ形式です。" -#: ../../library/getopt.rst:48 msgid "" "Unlike GNU :c:func:`!getopt`, after a non-option argument, all further " "arguments are considered also non-options. This is similar to the way non-" "GNU Unix systems work." msgstr "" +"GNU の :c:func:`!getopt` とは異なり、オプションでない引数が現れると、それ以降" +"のすべての引数もオプションではないものとして扱います。\n" +"これは GNU 以外の Unix システムと同様の動作です。" -#: ../../library/getopt.rst:52 msgid "" "*longopts*, if specified, must be a list of strings with the names of the " "long options which should be supported. The leading ``'--'`` characters " @@ -94,11 +115,21 @@ msgid "" "fo`` will match as ``--foo``, but ``--f`` will not match uniquely, so :exc:" "`GetoptError` will be raised." msgstr "" +"*longopts* を指定する場合は、サポートする長形式のオプション名を文字列のリスト" +"として渡してください。\n" +"オプション名には先頭の ``'--'`` を含めません。\n" +"引数が必須の長形式オプションの後ろには等号 (``'='``) を、省略可能な引数を取る" +"ものには等号と疑問符 (``'=?'``) を付けます。\n" +"長形式のオプションだけを受け付けるには、*shortopts* を空文字列にします。\n" +"コマンドライン上の長形式オプションは、その名前の先頭部分だけでも、受け付ける" +"オプションのうちちょうど 1 つに一致すれば認識されます。\n" +"例えば *longopts* が ``['foo', 'frob']`` の場合、``--fo`` は ``--foo`` として" +"認識されますが、``--f`` は一意に決まらないため :exc:`GetoptError` を送出しま" +"す。" -#: ../../library/getopt.rst:65 msgid "" "If *longopts* is a string it gets treated as a list of a single element." -msgstr "" +msgstr "*longopts* が文字列の場合は、要素が 1 つのリストとして扱います。" #: ../../library/getopt.rst:67 msgid "" @@ -121,9 +152,8 @@ msgstr "" "順に並んでいて、複数回同じオプションを指定できます。長形式と短形式のオプショ" "ンは混在できます。" -#: ../../library/getopt.rst:77 msgid "Optional arguments are supported." -msgstr "" +msgstr "省略可能な引数がサポートされました。" #: ../../library/getopt.rst:83 msgid "" @@ -137,14 +167,15 @@ msgstr "" "混在させることができます。:func:`getopt` 関数はオプションでない引数を見つける" "と解析を停止します。" -#: ../../library/getopt.rst:88 msgid "" "If the first character of the option string is ``'+'``, or if the " "environment variable :envvar:`!POSIXLY_CORRECT` is set, then option " "processing stops as soon as a non-option argument is encountered." msgstr "" +"オプション文字列の最初の文字が ``'+'`` の場合、または環境変数 :envvar:`!" +"POSIXLY_CORRECT` が設定されている場合は、オプションでない引数が現れた時点でオ" +"プションの処理を停止します。" -#: ../../library/getopt.rst:92 msgid "" "If the first character of the option string is ``'-'``, non-option arguments " "that are followed by options are added to the list of option-and-value pairs " @@ -152,13 +183,19 @@ msgid "" "arguments as its second element. The second element of the :func:`!" "gnu_getopt` result is a list of program arguments after the last option." msgstr "" +"オプション文字列の最初の文字が ``'-'`` の場合、後ろにオプションが続く非オプ" +"ション引数は、オプションと値のペアのリストに追加されます。\n" +"このペアの最初の要素は ``None``、2 番目の要素は非オプション引数のリストで" +"す。\n" +":func:`!gnu_getopt` の戻り値の 2 番目の要素は、最後のオプションより後にあるプ" +"ログラム引数のリストになります。" -#: ../../library/getopt.rst:99 msgid "" "Support for returning intermixed options and non-option arguments in order." msgstr "" +"混在するオプションと非オプション引数を順序どおりに返すことをサポートしまし" +"た。" -#: ../../library/getopt.rst:105 msgid "" "This is raised when an unrecognized option is found in the argument list or " "when an option requiring an argument is given none. The argument to the " @@ -168,6 +205,14 @@ msgid "" "give the error message and related option; if there is no specific option to " "which the exception relates, :attr:`!opt` is an empty string." msgstr "" +"引数リストに認識できないオプションがある場合、または必須の引数がオプションに" +"指定されていない場合に送出されます。\n" +"例外の引数はエラーの原因を示す文字列です。\n" +"長形式のオプションでは、引数を取らないオプションに引数が指定された場合もこの" +"例外を送出します。\n" +":attr:`!msg` と :attr:`!opt` 属性は、それぞれエラーメッセージと関連するオプ" +"ションを表します。\n" +"エラーに関連する特定のオプションがなければ、:attr:`!opt` は空文字列です。" #: ../../library/getopt.rst:116 msgid "Alias for :exc:`GetoptError`; for backward compatibility." @@ -178,7 +223,6 @@ msgstr "" msgid "An example using only Unix style options:" msgstr "Unix スタイルのオプションを使った例です:" -#: ../../library/getopt.rst:120 msgid "" ">>> import getopt\n" ">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" @@ -190,12 +234,20 @@ msgid "" ">>> args\n" "['a1', 'a2']" msgstr "" +">>> import getopt\n" +">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" +">>> args\n" +"['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']\n" +">>> optlist, args = getopt.getopt(args, 'abc:d:')\n" +">>> optlist\n" +"[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]\n" +">>> args\n" +"['a1', 'a2']" #: ../../library/getopt.rst:132 msgid "Using long option names is equally easy:" msgstr "長形式のオプションを使っても同様です:" -#: ../../library/getopt.rst:134 msgid "" ">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" ">>> args = s.split()\n" @@ -210,12 +262,22 @@ msgid "" ">>> args\n" "['a1', 'a2']" msgstr "" +">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" +">>> args = s.split()\n" +">>> args\n" +"['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', " +"'a2']\n" +">>> optlist, args = getopt.getopt(args, 'x', [\n" +"... 'condition=', 'output-file=', 'testing'])\n" +">>> optlist\n" +"[('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-" +"x', '')]\n" +">>> args\n" +"['a1', 'a2']" -#: ../../library/getopt.rst:147 msgid "Optional arguments should be specified explicitly:" -msgstr "" +msgstr "省略可能な引数は、次のように明示的に指定してください。" -#: ../../library/getopt.rst:149 msgid "" ">>> s = '-Con -C --color=off --color a1 a2'\n" ">>> args = s.split()\n" @@ -227,12 +289,19 @@ msgid "" ">>> args\n" "['a1', 'a2']" msgstr "" +">>> s = '-Con -C --color=off --color a1 a2'\n" +">>> args = s.split()\n" +">>> args\n" +"['-Con', '-C', '--color=off', '--color', 'a1', 'a2']\n" +">>> optlist, args = getopt.getopt(args, 'C::', ['color=?'])\n" +">>> optlist\n" +"[('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')]\n" +">>> args\n" +"['a1', 'a2']" -#: ../../library/getopt.rst:161 msgid "The order of options and non-option arguments can be preserved:" -msgstr "" +msgstr "オプションと非オプション引数の順序を保持できます。" -#: ../../library/getopt.rst:163 msgid "" ">>> s = 'a1 -x a2 a3 a4 --long a5 a6'\n" ">>> args = s.split()\n" @@ -244,12 +313,19 @@ msgid "" ">>> args\n" "['a6']" msgstr "" +">>> s = 'a1 -x a2 a3 a4 --long a5 a6'\n" +">>> args = s.split()\n" +">>> args\n" +"['a1', '-x', 'a2', 'a3', 'a4', '--long', 'a5', 'a6']\n" +">>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long='])\n" +">>> optlist\n" +"[(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')]\n" +">>> args\n" +"['a6']" -#: ../../library/getopt.rst:175 msgid "In a script, typical usage is something like this:" -msgstr "" +msgstr "スクリプトでの典型的な使用例は次のようになります。" -#: ../../library/getopt.rst:177 msgid "" "import getopt, sys\n" "\n" @@ -280,15 +356,42 @@ msgid "" "if __name__ == \"__main__\":\n" " main()" msgstr "" +"import getopt, sys\n" +"\n" +"def main():\n" +" try:\n" +" opts, args = getopt.getopt(sys.argv[1:], \"ho:v\", [\"help\", " +"\"output=\"])\n" +" except getopt.GetoptError as err:\n" +" # ヘルプ情報を表示して終了する:\n" +" print(err) # \"option -a not recognized\" などと表示する\n" +" usage()\n" +" sys.exit(2)\n" +" output = None\n" +" verbose = False\n" +" for o, a in opts:\n" +" if o == \"-v\":\n" +" verbose = True\n" +" elif o in (\"-h\", \"--help\"):\n" +" usage()\n" +" sys.exit()\n" +" elif o in (\"-o\", \"--output\"):\n" +" output = a\n" +" else:\n" +" assert False, \"unhandled option\"\n" +" process(args, output=output, verbose=verbose)\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" -#: ../../library/getopt.rst:206 msgid "" "Note that an equivalent command line interface could be produced with less " "code and more informative help and error messages by using the :mod:" "`optparse` module:" msgstr "" +":mod:`optparse` モジュールを使うと、同等のコマンドラインインターフェースをよ" +"り少ないコードで作成でき、ヘルプやエラーメッセージもより詳しくなります。" -#: ../../library/getopt.rst:209 msgid "" "import optparse\n" "\n" @@ -299,14 +402,22 @@ msgid "" " opts, args = parser.parse_args()\n" " process(args, output=opts.output, verbose=opts.verbose)" msgstr "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" -#: ../../library/getopt.rst:220 msgid "" "A roughly equivalent command line interface for this case can also be " "produced by using the :mod:`argparse` module:" msgstr "" +"この場合は :mod:`argparse` モジュールを使っても、ほぼ同等のコマンドラインイン" +"ターフェースを作成できます。" -#: ../../library/getopt.rst:223 msgid "" "import argparse\n" "\n" @@ -318,26 +429,35 @@ msgid "" " args = parser.parse_args()\n" " process(args.rest, output=args.output, verbose=args.verbose)" msgstr "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" +" args = parser.parse_args()\n" +" process(args.rest, output=args.output, verbose=args.verbose)" -#: ../../library/getopt.rst:235 msgid "" "See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` " "version of this code differs in behaviour from the ``optparse`` (and " "``getopt``) version." msgstr "" +"このコードの ``argparse`` 版と ``optparse`` (および ``getopt``) 版の動作の違" +"いについては、:ref:`choosing-an-argument-parser` を参照してください。" -#: ../../library/getopt.rst:241 msgid "Module :mod:`optparse`" -msgstr "" +msgstr ":mod:`optparse` モジュール" -#: ../../library/getopt.rst:242 msgid "Declarative command line option parsing." -msgstr "" +msgstr "宣言的なコマンドラインオプション解析。" #: ../../library/getopt.rst:244 msgid "Module :mod:`argparse`" msgstr ":mod:`argparse` モジュール" -#: ../../library/getopt.rst:245 msgid "More opinionated command line option and argument parsing library." msgstr "" +"コマンドラインのオプションと引数を、より明確な方針に沿って解析するライブラ" +"リ。" diff --git a/library/getpass.po b/library/getpass.po index 9290e3d56..537f7ea54 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -41,9 +41,8 @@ msgstr "" "このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" "`wasm-availability` を見てください。" -#: ../../library/getpass.rst:13 msgid "The :mod:`!getpass` module provides two functions:" -msgstr "" +msgstr ":mod:`!getpass` モジュールは 2 つの関数を提供します。" msgid "" "Prompt the user for a password without echoing. The user is prompted using " @@ -61,7 +60,6 @@ msgstr "" "*stream* のデフォルトは、制御端末(:file:`/dev/tty`)か、それが利用できない場合" "は ``sys.stderr`` です (この引数は Windowsでは無視されます)。" -#: ../../library/getpass.rst:24 msgid "" "The *echo_char* argument controls how user input is displayed while typing. " "If *echo_char* is ``None`` (default), input remains hidden. Otherwise, " @@ -69,6 +67,12 @@ msgid "" "character is replaced by it. For example, ``echo_char='*'`` will display " "asterisks instead of the actual input." msgstr "" +"*echo_char* 引数は、入力中の文字をどのように表示するかを制御します。\n" +"*echo_char* が ``None`` (デフォルト) の場合、入力は表示されません。\n" +"それ以外の場合、*echo_char* は表示可能な ASCII 文字 1 文字でなければならず、" +"入力した各文字はその文字で置き換えられます。\n" +"例えば ``echo_char='*'`` を指定すると、実際の入力の代わりにアスタリスクを表示" +"します。" #: ../../library/getpass.rst:30 msgid "" @@ -87,58 +91,58 @@ msgstr "" "IDLE 内から ``getpass()`` を呼び出すと、IDLE のウィンドウではなく、IDLE を起" "動したターミナルで入力することになる場合があります。" -#: ../../library/getpass.rst:39 msgid "" "On Unix systems, when *echo_char* is set, the terminal will be configured to " "operate in :manpage:`noncanonical mode " "`. Common terminal control " "characters are supported:" msgstr "" +"Unix システムで *echo_char* を設定すると、端末は :manpage:`非カノニカルモー" +"ド ` で動作するよう設定されま" +"す。\n" +"一般的な端末制御文字がサポートされます。" -#: ../../library/getpass.rst:44 msgid ":kbd:`Ctrl+A` - Move cursor to beginning of line" -msgstr "" +msgstr ":kbd:`Ctrl+A` - カーソルを行頭に移動" -#: ../../library/getpass.rst:45 msgid ":kbd:`Ctrl+E` - Move cursor to end of line" -msgstr "" +msgstr ":kbd:`Ctrl+E` - カーソルを行末に移動" -#: ../../library/getpass.rst:46 msgid ":kbd:`Ctrl+K` - Kill (delete) from cursor to end of line" -msgstr "" +msgstr ":kbd:`Ctrl+K` - カーソルから行末までを削除" -#: ../../library/getpass.rst:47 msgid ":kbd:`Ctrl+U` - Kill (delete) entire line" -msgstr "" +msgstr ":kbd:`Ctrl+U` - 行全体を削除" -#: ../../library/getpass.rst:48 msgid ":kbd:`Ctrl+W` - Erase previous word" -msgstr "" +msgstr ":kbd:`Ctrl+W` - 直前の単語を削除" -#: ../../library/getpass.rst:49 msgid ":kbd:`Ctrl+V` - Insert next character literally (quote)" -msgstr "" +msgstr ":kbd:`Ctrl+V` - 次の文字をそのまま挿入 (クォート)" -#: ../../library/getpass.rst:50 msgid ":kbd:`Backspace`/:kbd:`DEL` - Delete character before cursor" -msgstr "" +msgstr ":kbd:`Backspace`/:kbd:`DEL` - カーソルの直前の文字を削除" -#: ../../library/getpass.rst:52 msgid "" "These shortcuts work by reading the terminal's configured control character " "mappings from termios settings." msgstr "" +"これらのショートカットは、termios の設定から端末の制御文字の割り当てを読み" +"取って動作します。" -#: ../../library/getpass.rst:55 msgid "Added the *echo_char* parameter for keyboard feedback." msgstr "" +"キーボード入力に視覚的なフィードバックを与える *echo_char* 引数が追加されまし" +"た。" -#: ../../library/getpass.rst:58 msgid "" "When using non-empty *echo_char* on Unix, keyboard shortcuts (including " "cursor movement and line editing) are now properly handled using the " "terminal's control character configuration." msgstr "" +"Unix で空でない *echo_char* を使うとき、端末の制御文字の設定に従ってキーボー" +"ドショートカット (カーソルの移動や行の編集を含む) を適切に処理するようになり" +"ました。" msgid "A :exc:`UserWarning` subclass issued when password input may be echoed." msgstr "" @@ -163,9 +167,8 @@ msgstr "" "ム上のパスワードデータベースから返します。それ以外の場合は、 :exc:" "`OSError` が送出されます。" -#: ../../library/getpass.rst:79 msgid "In general, this function should be preferred over :func:`os.getlogin`." -msgstr "" +msgstr "一般に、:func:`os.getlogin` よりもこの関数を使うことを推奨します。" #: ../../library/getpass.rst:81 msgid "Previously, various exceptions beyond just :exc:`OSError` were raised." diff --git a/library/gettext.po b/library/gettext.po index 2a79dd0e8..8cf3f0608 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -30,7 +30,6 @@ msgstr ":mod:`!gettext` --- 多言語国際化サービス" msgid "**Source code:** :source:`Lib/gettext.py`" msgstr "**ソースコード:** :source:`Lib/gettext.py`" -#: ../../library/gettext.rst:11 msgid "" "The :mod:`!gettext` module provides internationalization (I18N) and " "localization (L10N) services for your Python modules and applications. It " @@ -40,6 +39,13 @@ msgid "" "messages in one natural language, and provide a catalog of translated " "messages for running under different natural languages." msgstr "" +":mod:`!gettext` モジュールは、Python のモジュールやアプリケーションに国際化 " +"(I18N) と地域化 (L10N) の機能を提供します。\n" +"GNU :program:`gettext` のメッセージカタログ API と、Python ファイルにはより適" +"している場合がある、クラス形式の高水準 API の両方をサポートしています。\n" +"以下のインターフェースを使うと、モジュールやアプリケーションのメッセージを 1 " +"つの自然言語で書き、ほかの自然言語で実行するための翻訳済みメッセージのカタロ" +"グを用意できます。" #: ../../library/gettext.rst:19 msgid "" @@ -52,7 +58,6 @@ msgstr "" msgid "GNU :program:`gettext` API" msgstr "GNU :program:`gettext` API" -#: ../../library/gettext.rst:25 msgid "" "The :mod:`!gettext` module defines the following API, which is very similar " "to the GNU :program:`gettext` API. If you use this API you will affect the " @@ -62,8 +67,14 @@ msgid "" "module, or if your application needs to switch languages on the fly, you " "probably want to use the class-based API instead." msgstr "" +":mod:`!gettext` モジュールは、GNU :program:`gettext` API によく似た次の API " +"を定義しています。\n" +"この API を使うと、アプリケーション全体の翻訳に影響します。\n" +"ユーザーのロケールに応じて 1 つの言語を選択するアプリケーションでは、多くの場" +"合これが望ましい動作です。\n" +"Python モジュールを地域化する場合や、実行中に言語を切り替える必要がある場合" +"は、クラス形式の API を使う方が適しています。" -#: ../../library/gettext.rst:36 msgid "" "Bind the *domain* to the locale directory *localedir*. More concretely, :" "mod:`!gettext` will look for binary :file:`.mo` files for the given domain " @@ -72,6 +83,12 @@ msgid "" "`LANGUAGE`, :envvar:`LC_ALL`, :envvar:`LC_MESSAGES`, and :envvar:`LANG` " "respectively." msgstr "" +"*domain* をロケールディレクトリ *localedir* に結び付けます。\n" +"具体的には、:mod:`!gettext` は指定したドメインのバイナリ :file:`.mo` ファイル" +"を、Unix では :file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo` というパ" +"スで探します。\n" +"ここで *language* は、環境変数 :envvar:`LANGUAGE`、:envvar:`LC_ALL`、:envvar:" +"`LC_MESSAGES`、:envvar:`LANG` から順に探します。" #: ../../library/gettext.rst:42 msgid "" @@ -92,12 +109,15 @@ msgstr "" "場合には、グローバルドメインに *domain* を設定し、その設定されたグローバルド" "メインを返します。" -#: ../../library/gettext.rst:56 msgid "" "Return the localized translation of *message*, based on the current global " "domain, language, and locale directory. This function is usually aliased " "as :func:`!_` in the local namespace (see examples below)." msgstr "" +"現在のグローバルドメイン、言語、ロケールディレクトリに基づいて、*message* の" +"翻訳を返します。\n" +"通常、この関数はローカル名前空間で :func:`!_` という別名で使います (以下の例" +"を参照)。" #: ../../library/gettext.rst:63 msgid "" @@ -105,18 +125,17 @@ msgid "" msgstr "" ":func:`.gettext` と同様ですが、指定された *domain* からメッセージを探します。" -#: ../../library/gettext.rst:68 msgid "" "Like :func:`.gettext`, but consider plural forms. If a translation is found, " "apply the plural formula to *n*, and return the resulting message (some " "languages have more than two plural forms). If no translation is found, " "return *singular* if *n* is 1; return *plural* otherwise." msgstr "" -":func:`.gettext` と同様ですが、複数形を考慮しています。\n" -"翻訳が見つかった場合、複数形の選択公式を *n* に適用し、その結果得られたメッ" -"セージを返します (言語によっては二つ以上の複数形があります)。\n" -"翻訳が見つからなかった場合、 *n* が 1 なら *singular* を返します; そうでない" -"場合 *plural* を返します。" +":func:`.gettext` と同様ですが、複数形を考慮します。\n" +"翻訳が見つかった場合は、複数形の選択公式を *n* に適用し、その結果に対応する" +"メッセージを返します (言語によっては複数形が 3 種類以上あります)。\n" +"翻訳が見つからなかった場合は、*n* が 1 なら *singular*、それ以外なら " +"*plural* を返します。" #: ../../library/gettext.rst:73 msgid "" @@ -140,24 +159,26 @@ msgid "" msgstr "" ":func:`ngettext` と同様ですが、指定された *domain* からメッセージを探します。" -#: ../../library/gettext.rst:91 msgid "" "Similar to the corresponding functions without the ``p`` in the prefix (that " "is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, :func:`dngettext`), " "but the translation is restricted to the given message *context*." msgstr "" +"接頭辞 ``p`` のない対応する関数 (:func:`gettext`、:func:`dgettext`、:func:" +"`ngettext`、:func:`dngettext`) と同様ですが、翻訳対象が指定したメッセージの " +"*context* に限定されます。" -#: ../../library/gettext.rst:98 msgid "" "Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, " "but this was deemed not useful and so it is currently unimplemented." msgstr "" +"GNU :program:`gettext` は :func:`!dcgettext` メソッドも定義していますが、有用" +"ではないと判断されたため、現在は実装されていません。" #: ../../library/gettext.rst:101 msgid "Here's an example of typical usage for this API::" msgstr "以下にこの API の典型的な使用法を示します::" -#: ../../library/gettext.rst:103 msgid "" "import gettext\n" "gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')\n" @@ -166,12 +187,17 @@ msgid "" "# ...\n" "print(_('This is a translatable string.'))" msgstr "" +"import gettext\n" +"gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')\n" +"gettext.textdomain('myapplication')\n" +"_ = gettext.gettext\n" +"# ...\n" +"print(_('This is a translatable string.'))" #: ../../library/gettext.rst:112 msgid "Class-based API" msgstr "クラス形式の API" -#: ../../library/gettext.rst:114 msgid "" "The class-based API of the :mod:`!gettext` module gives you more flexibility " "and greater convenience than the GNU :program:`gettext` API. It is the " @@ -181,6 +207,15 @@ msgid "" "strings. Instances of this class can also install themselves in the built-in " "namespace as the function :func:`!_`." msgstr "" +":mod:`!gettext` モジュールのクラス形式の API は、GNU :program:`gettext` API " +"より柔軟で便利です。\n" +"Python のアプリケーションやモジュールの地域化には、この API の使用を推奨しま" +"す。\n" +":mod:`!gettext` は :class:`GNUTranslations` クラスを定義しています。\n" +"このクラスは GNU :file:`.mo` 形式のファイルの解析を実装し、文字列を返すメソッ" +"ドを持ちます。\n" +"このクラスのインスタンスは、組み込み名前空間に :func:`!_` 関数として自身をイ" +"ンストールすることもできます。" #: ../../library/gettext.rst:124 msgid "" @@ -212,32 +247,28 @@ msgstr "" "ればなりません。 ``find()`` はこの文字列をコロンで分割し、言語コードの候補リ" "ストを生成します。" -#: ../../library/gettext.rst:137 msgid "" ":func:`find` then expands and normalizes the languages, and then iterates " "through them, searching for an existing file built of these components:" msgstr "" -":func:`find` は次に言語コードを展開および正規化し、リストの各要素について、以" -"下のパス構成:" +":func:`find` は言語コードを展開して正規化し、それらを順にたどりながら、次の要" +"素からなるパスにファイルが存在するか調べます。" #: ../../library/gettext.rst:140 msgid ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" msgstr ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" -#: ../../library/gettext.rst:142 msgid "" "The first such file name that exists is returned by :func:`find`. If no such " "file is found, then ``None`` is returned. If *all* is given, it returns a " "list of all file names, in the order in which they appear in the languages " "list or the environment variables." msgstr "" -"からなる実在するファイルの探索を反復的に行います。 :func:`find` は上記のよう" -"な実在するファイルで最初に見つかったものを返します。該当するファイルが見つか" -"らなかった場合、 ``None`` が返されます。 *all* が与えられていれば、全ファイル" -"名のリストが言語リストまたは環境変数で指定されている順番に並べられたものを返" -"します。" +":func:`find` は最初に見つかったファイル名を返します。\n" +"ファイルが見つからなければ ``None`` を返します。\n" +"*all* を指定した場合は、見つかったすべてのファイル名のリストを、言語リストま" +"たは環境変数での順序で返します。" -#: ../../library/gettext.rst:150 msgid "" "Return a ``*Translations`` instance based on the *domain*, *localedir*, and " "*languages*, which are first passed to :func:`find` to get a list of the " @@ -246,6 +277,15 @@ msgid "" "provided, otherwise :class:`GNUTranslations`. The class's constructor must " "take a single :term:`file object` argument." msgstr "" +"*domain*、*localedir*、*languages* に基づいて ``*Translations`` インスタンス" +"を返します。\n" +"これらの引数を最初に :func:`find` に渡し、関連する :file:`.mo` ファイルのパス" +"のリストを取得します。\n" +"同じ :file:`.mo` ファイル名を持つインスタンスはキャッシュされます。\n" +"実際にインスタンス化するクラスは、*class_* が指定されていればそのクラス、そう" +"でなければ :class:`GNUTranslations` です。\n" +"クラスのコンストラクタは :term:`file object` を引数として 1 つ受け取る必要が" +"あります。" #: ../../library/gettext.rst:157 msgid "" @@ -276,16 +316,16 @@ msgstr "" "以前は :exc:`IOError` が送出されました; それは現在 :exc:`OSError` のエイリア" "スです。" -#: ../../library/gettext.rst:169 msgid "*codeset* parameter is removed." -msgstr "" +msgstr "*codeset* 引数が削除されました。" -#: ../../library/gettext.rst:174 msgid "" "This installs the function :func:`!_` in Python's builtins namespace, based " "on *domain* and *localedir* which are passed to the function :func:" "`translation`." msgstr "" +"*domain* と *localedir* を :func:`translation` 関数に渡し、それに基づいて " +"Python の組み込み名前空間に :func:`!_` 関数をインストールします。" #: ../../library/gettext.rst:177 msgid "" @@ -295,27 +335,27 @@ msgstr "" "*names* パラメータについては、翻訳オブジェクトの :meth:`~NullTranslations." "install` メソッドの説明を参照ください。" -#: ../../library/gettext.rst:180 msgid "" "As seen below, you usually mark the strings in your application that are " "candidates for translation, by wrapping them in a call to the :func:`!_` " "function, like this::" msgstr "" +"以下のように、アプリケーションで翻訳候補の文字列をマークするには、通常 :func:" +"`!_` 関数の呼び出しで囲みます。 ::" -#: ../../library/gettext.rst:184 msgid "print(_('This string will be translated.'))" -msgstr "" +msgstr "print(_('This string will be translated.'))" -#: ../../library/gettext.rst:186 msgid "" "For convenience, you want the :func:`!_` function to be installed in " "Python's builtins namespace, so it is easily accessible in all modules of " "your application." msgstr "" +"アプリケーションのすべてのモジュールから簡単にアクセスできるように、:func:`!" +"_` 関数を Python の組み込み名前空間にインストールすると便利です。" -#: ../../library/gettext.rst:190 msgid "*names* is now a keyword-only parameter." -msgstr "" +msgstr "*names* がキーワード専用引数になりました。" #: ../../library/gettext.rst:194 msgid "The :class:`NullTranslations` class" @@ -414,11 +454,10 @@ msgstr "" "転送します。そうでない場合、翻訳されたメッセージを返します。派生クラスで上書" "きするメソッドです。" -#: ../../library/gettext.rst:257 msgid "" "Return a dictionary containing the metadata found in the message catalog " "file." -msgstr "" +msgstr "メッセージカタログファイルから取得したメタデータを含む辞書を返します。" #: ../../library/gettext.rst:263 msgid "Return the encoding of the message catalog file." @@ -432,15 +471,17 @@ msgstr "" "このメソッドは :meth:`.gettext` を組み込み名前空間にインストールし、変数 " "``_`` に束縛します。" -#: ../../library/gettext.rst:271 msgid "" "If the *names* parameter is given, it must be a sequence containing the " "names of functions you want to install in the builtins namespace in addition " "to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, " "``'pgettext'``, and ``'npgettext'``." msgstr "" +"*names* 引数を指定する場合は、:func:`!_` に加えて組み込み名前空間にインストー" +"ルする関数名のシーケンスを渡してください。\n" +"サポートされる名前は ``'gettext'``、``'ngettext'``、``'pgettext'``、" +"``'npgettext'`` です。" -#: ../../library/gettext.rst:276 msgid "" "Note that this is only one way, albeit the most convenient way, to make the :" "func:`!_` function available to your application. Because it affects the " @@ -448,19 +489,27 @@ msgid "" "localized modules should never install :func:`!_`. Instead, they should use " "this code to make :func:`!_` available to their module::" msgstr "" +"これは :func:`!_` 関数をアプリケーションで利用可能にする最も便利な方法です" +"が、唯一の方法ではありません。\n" +"アプリケーション全体、特に組み込み名前空間に影響するため、地域化したモジュー" +"ルでは決して :func:`!_` をインストールしないでください。\n" +"代わりに次のコードで、そのモジュール内で :func:`!_` を利用可能にします。 ::" -#: ../../library/gettext.rst:282 msgid "" "import gettext\n" "t = gettext.translation('mymodule', ...)\n" "_ = t.gettext" msgstr "" +"import gettext\n" +"t = gettext.translation('mymodule', ...)\n" +"_ = t.gettext" -#: ../../library/gettext.rst:286 msgid "" "This puts :func:`!_` only in the module's global namespace and so only " "affects calls within this module." msgstr "" +"これにより :func:`!_` はモジュールのグローバル名前空間だけに置かれるので、こ" +"のモジュール内の呼び出しにだけ影響します。" #: ../../library/gettext.rst:289 msgid "Added ``'pgettext'`` and ``'npgettext'``." @@ -470,15 +519,18 @@ msgstr "``'pgettext'`` と ``'npgettext'`` が追加されました。" msgid "The :class:`GNUTranslations` class" msgstr ":class:`GNUTranslations` クラス" -#: ../../library/gettext.rst:296 msgid "" "The :mod:`!gettext` module provides one additional class derived from :class:" "`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:`!" "_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files in " "both big-endian and little-endian format." msgstr "" +":mod:`!gettext` モジュールは、:class:`NullTranslations` の派生クラスとして :" +"class:`GNUTranslations` も提供します。\n" +"このクラスは :meth:`!_parse` をオーバーライドし、ビッグエンディアンとリトルエ" +"ンディアンの両方の GNU :program:`gettext` 形式の :file:`.mo` ファイルを読み取" +"れるようにします。" -#: ../../library/gettext.rst:301 msgid "" ":class:`GNUTranslations` parses optional metadata out of the translation " "catalog. It is convention with GNU :program:`gettext` to include metadata as " @@ -490,18 +542,34 @@ msgid "" "then all message ids and message strings read from the catalog are converted " "to Unicode using this encoding, else ASCII is assumed." msgstr "" +":class:`GNUTranslations` は翻訳カタログから省略可能なメタデータを解析しま" +"す。\n" +"GNU :program:`gettext` では、空文字列の翻訳としてメタデータを格納する慣習があ" +"ります。\n" +"このメタデータは :rfc:`822` 形式の ``key: value`` ペアで、``Project-Id-" +"Version`` キーを含める必要があります。\n" +"``Content-Type`` キーがあれば、その ``charset`` プロパティを使って「保護され" +"た」インスタンス変数 :attr:`!_charset` を初期化します。\n" +"見つからなければデフォルトの ``None`` になります。\n" +"文字セットのエンコーディングが指定されていれば、カタログから読み取ったすべて" +"のメッセージ ID とメッセージ文字列をそのエンコーディングで Unicode に変換しま" +"す。\n" +"指定されていなければ ASCII と見なします。" -#: ../../library/gettext.rst:311 msgid "" "Since message ids are read as Unicode strings too, all ``*gettext()`` " "methods will assume message ids as Unicode strings, not byte strings." msgstr "" +"メッセージ ID も Unicode 文字列として読み取るため、すべての ``*gettext()`` メ" +"ソッドは、メッセージ ID がバイト文字列ではなく Unicode 文字列であることを前提" +"とします。" -#: ../../library/gettext.rst:314 msgid "" "The entire set of key/value pairs are placed into a dictionary and set as " "the \"protected\" :attr:`!_info` instance variable." msgstr "" +"キーと値のペア全体を辞書に格納し、「保護された」インスタンス変数 :attr:`!" +"_info` に設定します。" #: ../../library/gettext.rst:317 msgid "" @@ -533,15 +601,15 @@ msgstr "" "ソッドに移譲します。\n" "それ以外の場合は、 *message* id 自体が返されます。" -#: ../../library/gettext.rst:336 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use. The returned message string is a Unicode string." msgstr "" -"メッセージ id に対する複数形を検索します。カタログに対する検索では " -"*singular* がメッセージ id として用いられ、 *n* にはどの複数形を用いるかを指" -"定します。返されるメッセージ文字列は Unicode 文字列です。" +"メッセージ ID に対して複数形の検索を行います。\n" +"カタログの検索では *singular* をメッセージ ID として使い、*n* をもとに使う複" +"数形を決定します。\n" +"返されるメッセージ文字列は Unicode 文字列です。" #: ../../library/gettext.rst:340 msgid "" @@ -560,7 +628,6 @@ msgstr "" msgid "Here is an example::" msgstr "以下に例を示します。::" -#: ../../library/gettext.rst:347 msgid "" "n = len(os.listdir('.'))\n" "cat = GNUTranslations(somefile)\n" @@ -569,6 +636,12 @@ msgid "" " 'There are %(num)d files in this directory',\n" " n) % {'num': n}" msgstr "" +"n = len(os.listdir('.'))\n" +"cat = GNUTranslations(somefile)\n" +"message = cat.ngettext(\n" +" 'There is %(num)d file in this directory',\n" +" 'There are %(num)d files in this directory',\n" +" n) % {'num': n}" msgid "" "Look up the *context* and *message* id in the catalog and return the " @@ -584,15 +657,14 @@ msgstr "" "す。\n" "そうでなければ *message* ID 自体を返します。" -#: ../../library/gettext.rst:368 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use." msgstr "" -"メッセージ id に対する複数形を検索します。カタログに対する検索では " -"*singular* がメッセージ id として用いられ、 *n* にはどの複数形を用いるかを指" -"定します。" +"メッセージ ID に対して複数形の検索を行います。\n" +"カタログの検索では *singular* をメッセージ ID として使い、*n* をもとに使う複" +"数形を決定します。" #: ../../library/gettext.rst:372 msgid "" @@ -624,25 +696,31 @@ msgstr "" msgid "The Catalog constructor" msgstr "Catalog コンストラクタ" -#: ../../library/gettext.rst:393 msgid "" "GNOME uses a version of the :mod:`!gettext` module by James Henstridge, but " "this version has a slightly different API. Its documented usage was::" msgstr "" +"GNOME は James Henstridge による :mod:`!gettext` モジュールを使っていますが、" +"このバージョンの API は少し異なります。\n" +"ドキュメントに記載されていた使い方は次のとおりです。 ::" -#: ../../library/gettext.rst:396 msgid "" "import gettext\n" "cat = gettext.Catalog(domain, localedir)\n" "_ = cat.gettext\n" "print(_('hello world'))" msgstr "" +"import gettext\n" +"cat = gettext.Catalog(domain, localedir)\n" +"_ = cat.gettext\n" +"print(_('hello world'))" -#: ../../library/gettext.rst:401 msgid "" "For compatibility with this older module, the function :func:`!Catalog` is " "an alias for the :func:`translation` function described above." msgstr "" +"この古いモジュールとの互換性のために、:func:`!Catalog` 関数は、上記の :func:" +"`translation` 関数の別名になっています。" #: ../../library/gettext.rst:404 msgid "" @@ -688,27 +766,35 @@ msgstr "" msgid "create language-specific translations of the message catalogs" msgstr "特定の言語へのメッセージカタログの翻訳を作成します" -#: ../../library/gettext.rst:425 msgid "" "use the :mod:`!gettext` module so that message strings are properly " "translated" msgstr "" +":mod:`!gettext` モジュールを使って、メッセージ文字列が適切に翻訳されるように" +"します。" -#: ../../library/gettext.rst:427 msgid "" "In order to prepare your code for I18N, you need to look at all the strings " "in your files. Any string that needs to be translated should be marked by " "wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ " "`. For example::" msgstr "" +"コードを国際化に対応させるには、ファイル内のすべての文字列を調べる必要があり" +"ます。\n" +"翻訳が必要な文字列は ``_('...')``、つまり :func:`_ ` 関数の呼び出し" +"で囲んでマークしてください。\n" +"例えば次のようにします。 ::" -#: ../../library/gettext.rst:431 msgid "" "filename = 'mylog.txt'\n" "message = _('writing a log message')\n" "with open(filename, 'w') as fp:\n" " fp.write(message)" msgstr "" +"filename = 'mylog.txt'\n" +"message = _('writing a log message')\n" +"with open(filename, 'w') as fp:\n" +" fp.write(message)" #: ../../library/gettext.rst:436 msgid "" @@ -779,7 +865,6 @@ msgstr "" "このファイルは人間が判読可能な構造をしていて、ソースコード中のマークが着けら" "れた文字列と、その文字列の仮置きの訳文が一緒に書き込まれています。" -#: ../../library/gettext.rst:467 msgid "" "Copies of these :file:`.po` files are then handed over to the individual " "human translators who write translations for every supported natural " @@ -789,13 +874,22 @@ msgid "" "mo` files are used by the :mod:`!gettext` module for the actual translation " "processing at run-time." msgstr "" +"次に、これらの :file:`.po` ファイルのコピーを各翻訳者に渡し、サポートする自然" +"言語ごとに翻訳してもらいます。\n" +"完成した各言語の :file:`.po` ファイルが返されたら、:program:" +"`msgfmt` プログラムで、機械が読み取れるバイナリカタログファイル :file:`.mo` " +"にコンパイルします。\n" +"実行時の翻訳処理では、:mod:`!gettext` モジュールがこの :file:`.mo` ファイルを" +"使います。" -#: ../../library/gettext.rst:476 msgid "" "How you use the :mod:`!gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " "two sections will discuss each case." msgstr "" +"コードでの :mod:`!gettext` モジュールの使い方は、単一のモジュールを国際化する" +"のか、アプリケーション全体を国際化するのかによって異なります。\n" +"次の 2 つの節では、それぞれの場合について説明します。" #: ../../library/gettext.rst:482 msgid "Localizing your module" @@ -823,24 +917,30 @@ msgstr "" "`gettext` 形式で置かれているとします。この場合、モジュールの最初で以下のよう" "にします::" -#: ../../library/gettext.rst:493 msgid "" "import gettext\n" "t = gettext.translation('spam', '/usr/share/locale')\n" "_ = t.gettext" msgstr "" +"import gettext\n" +"t = gettext.translation('spam', '/usr/share/locale')\n" +"_ = t.gettext" #: ../../library/gettext.rst:499 msgid "Localizing your application" msgstr "アプリケーションを地域化する" -#: ../../library/gettext.rst:501 msgid "" "If you are localizing your application, you can install the :func:`!_` " "function globally into the built-in namespace, usually in the main driver " "file of your application. This will let all your application-specific files " "just use ``_('...')`` without having to explicitly install it in each file." msgstr "" +"アプリケーションを地域化する場合は、:func:`!_` 関数を組み込み名前空間にグロー" +"バルにインストールできます。\n" +"通常はアプリケーションのメインの実行ファイルで行います。\n" +"これにより、アプリケーション固有のすべてのファイルで、ファイルごとに明示的に" +"インストールせずに ``_('...')`` を使えます。" #: ../../library/gettext.rst:506 msgid "" @@ -850,11 +950,12 @@ msgstr "" "単純な場合では、単に以下の短いコードをアプリケーションの主ドライバファイルに" "追加するだけです::" -#: ../../library/gettext.rst:509 msgid "" "import gettext\n" "gettext.install('myapplication')" msgstr "" +"import gettext\n" +"gettext.install('myapplication')" msgid "" "If you need to set the locale directory, you can pass it into the :func:" @@ -863,11 +964,12 @@ msgstr "" "ロケールのディレクトリを設定する必要がある場合は、:func:`install` 関数に渡す" "ことができます。 ::" -#: ../../library/gettext.rst:515 msgid "" "import gettext\n" "gettext.install('myapplication', '/usr/share/locale')" msgstr "" +"import gettext\n" +"gettext.install('myapplication', '/usr/share/locale')" #: ../../library/gettext.rst:520 msgid "Changing languages on the fly" @@ -883,7 +985,6 @@ msgstr "" "て、例えば以下のコードのように、インスタンスを明示的に切り替えてもかまいませ" "ん。::" -#: ../../library/gettext.rst:526 msgid "" "import gettext\n" "\n" @@ -900,6 +1001,20 @@ msgid "" "# ... more time goes by, user selects language 3\n" "lang3.install()" msgstr "" +"import gettext\n" +"\n" +"lang1 = gettext.translation('myapplication', languages=['en'])\n" +"lang2 = gettext.translation('myapplication', languages=['fr'])\n" +"lang3 = gettext.translation('myapplication', languages=['de'])\n" +"\n" +"# 最初は language1 を使う\n" +"lang1.install()\n" +"\n" +"# ... 時間がたち、ユーザーが言語 2 を選ぶ\n" +"lang2.install()\n" +"\n" +"# ... さらに時間がたち、ユーザーが言語 3 を選ぶ\n" +"lang3.install()" #: ../../library/gettext.rst:543 msgid "Deferred translations" @@ -916,7 +1031,6 @@ msgstr "" "が行われるように遅延させる必要が生じます。古典的な例は以下のようなコートで" "す::" -#: ../../library/gettext.rst:549 msgid "" "animals = ['mollusk',\n" " 'albatross',\n" @@ -927,6 +1041,14 @@ msgid "" "for a in animals:\n" " print(a)" msgstr "" +"animals = ['mollusk',\n" +" 'albatross',\n" +" 'rat',\n" +" 'penguin',\n" +" 'python', ]\n" +"# ...\n" +"for a in animals:\n" +" print(a)" #: ../../library/gettext.rst:558 msgid "" @@ -941,7 +1063,6 @@ msgstr "" msgid "Here is one way you can handle this situation::" msgstr "こうした状況を処理する一つの方法を以下に示します::" -#: ../../library/gettext.rst:564 msgid "" "def _(message): return message\n" "\n" @@ -957,8 +1078,20 @@ msgid "" "for a in animals:\n" " print(_(a))" msgstr "" +"def _(message): return message\n" +"\n" +"animals = [_('mollusk'),\n" +" _('albatross'),\n" +" _('rat'),\n" +" _('penguin'),\n" +" _('python'), ]\n" +"\n" +"del _\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" -#: ../../library/gettext.rst:578 msgid "" "This works because the dummy definition of :func:`!_` simply returns the " "string unchanged. And this dummy definition will temporarily override any " @@ -966,19 +1099,25 @@ msgid "" "command). Take care, though if you have a previous definition of :func:`!_` " "in the local namespace." msgstr "" +":func:`!_` の仮の定義は文字列を変更せずに返すだけなので、この方法でうまくいき" +"ます。\n" +"この仮の定義は、組み込み名前空間にある :func:`!_` の定義を一時的に (:keyword:" +"`del` コマンドまで) 覆い隠します。\n" +"ただし、ローカル名前空間ですでに :func:`!_` を定義している場合には注意してく" +"ださい。" -#: ../../library/gettext.rst:584 msgid "" "Note that the second use of :func:`!_` will not identify \"a\" as being " "translatable to the :program:`gettext` program, because the parameter is not " "a string literal." msgstr "" +"2 回目の :func:`!_` の使用では、引数が文字列リテラルではないため、:program:" +"`gettext` プログラムは \"a\" を翻訳対象として認識しません。" #: ../../library/gettext.rst:588 msgid "Another way to handle this is with the following example::" msgstr "もう一つの処理法は、以下の例のようなやり方です::" -#: ../../library/gettext.rst:590 msgid "" "def N_(message): return message\n" "\n" @@ -992,8 +1131,18 @@ msgid "" "for a in animals:\n" " print(_(a))" msgstr "" +"def N_(message): return message\n" +"\n" +"animals = [N_('mollusk'),\n" +" N_('albatross'),\n" +" N_('rat'),\n" +" N_('penguin'),\n" +" N_('python'), ]\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" -#: ../../library/gettext.rst:602 msgid "" "In this case, you are marking translatable strings with the function :func:`!" "N_`, which won't conflict with any definition of :func:`!_`. However, you " @@ -1004,6 +1153,15 @@ msgid "" "totally arbitrary; it could have just as easily been :func:`!" "MarkThisStringForTranslation`." msgstr "" +"この場合は :func:`!N_` 関数で翻訳対象の文字列をマークするため、:func:`!_` の" +"定義と衝突しません。\n" +"ただし、メッセージ抽出プログラムに、:func:`!N_` でマークされた文字列を探すよ" +"う指定する必要があります。\n" +":program:`xgettext`、:program:`pygettext`、``pybabel extract``、:program:" +"`xpot` は、いずれも :option:`!-k` コマンドラインオプションでこの指定をサポー" +"トします。\n" +"ここで :func:`!N_` という名前を選んだことに特別な意味はありません。\n" +":func:`!MarkThisStringForTranslation` でも同様に使えます。" #: ../../library/gettext.rst:613 msgid "Acknowledgements" @@ -1054,7 +1212,6 @@ msgstr "Gustavo Niemeyer" msgid "Footnotes" msgstr "脚注" -#: ../../library/gettext.rst:636 msgid "" "The default locale directory is system dependent; for example, on Red Hat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" @@ -1064,6 +1221,14 @@ msgid "" "call :func:`bindtextdomain` with an explicit absolute path at the start of " "your application." msgstr "" +"デフォルトのロケールディレクトリはシステムに依存します。\n" +"例えば Red Hat Linux では :file:`/usr/share/locale`、Solaris では :file:`/" +"usr/lib/locale` です。\n" +":mod:`!gettext` モジュールはこうしたシステムごとのデフォルト値には対応せず、" +"代わりに :file:`{sys.base_prefix}/share/locale` をデフォルトとして使います (:" +"data:`sys.base_prefix` を参照)。\n" +"このため、アプリケーションの開始時に明示的な絶対パスを指定して :func:" +"`bindtextdomain` を呼び出すのが最善です。" #: ../../library/gettext.rst:644 msgid "See the footnote for :func:`bindtextdomain` above." diff --git a/library/glob.po b/library/glob.po index 9e7ba9b95..a1a91f4f1 100644 --- a/library/glob.po +++ b/library/glob.po @@ -30,7 +30,6 @@ msgstr ":mod:`!glob` --- Unix 形式のパス名のパターン展開" msgid "**Source code:** :source:`Lib/glob.py`" msgstr "**ソースコード:** :source:`Lib/glob.py`" -#: ../../library/glob.rst:21 msgid "" "The :mod:`!glob` module finds pathnames using pattern matching rules similar " "to the Unix shell. No tilde expansion is done, but ``*``, ``?``, and " @@ -38,20 +37,32 @@ msgid "" "done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions " "in concert, and not by actually invoking a subshell." msgstr "" +":mod:`!glob` モジュールは、Unix シェルに似たパターンマッチの規則を使ってパス" +"名を探します。\n" +"チルダ展開は行いませんが、``*``、``?``、``[]`` で表す文字の範囲は正しくマッチ" +"します。\n" +"実際にサブシェルを起動するのではなく、:func:`os.scandir` と :func:`fnmatch." +"fnmatch` を組み合わせて処理します。" -#: ../../library/glob.rst:29 msgid "" "The pathnames are returned in no particular order. If you need a specific " "order, sort the results." msgstr "" +"パス名が返される順序は決まっていません。\n" +"特定の順序が必要な場合は、結果をソートしてください。" -#: ../../library/glob.rst:32 msgid "" "By default, files beginning with a dot (``.``) can only be matched by " "patterns that also start with a dot, unlike :func:`fnmatch.fnmatch` or :func:" "`pathlib.Path.glob`. For tilde and shell variable expansion, use :func:`os." "path.expanduser` and :func:`os.path.expandvars`." msgstr "" +"デフォルトでは、ドット (``.``) で始まるファイルは、同じくドットで始まるパター" +"ンにしかマッチしません。\n" +"この点は :func:`fnmatch.fnmatch` や :func:`pathlib.Path.glob` と異なりま" +"す。\n" +"チルダやシェル変数の展開には :func:`os.path.expanduser` と :func:`os.path." +"expandvars` を使ってください。" #: ../../library/glob.rst:38 msgid "" @@ -61,9 +72,8 @@ msgstr "" "リテラルにマッチさせるには、メタ文字を括弧に入れてください。例えば、" "``'[?]'`` は文字 ``'?'`` にマッチします。" -#: ../../library/glob.rst:41 msgid "The :mod:`!glob` module defines the following functions:" -msgstr "" +msgstr ":mod:`!glob` モジュールは次の関数を定義しています。" #: ../../library/glob.rst:47 msgid "" @@ -86,13 +96,17 @@ msgstr "" "合、それらのファイルに対するパス名が結果に含まれるかどうかはの動作は不定で" "す。" -#: ../../library/glob.rst:56 msgid "" "If *root_dir* is not ``None``, it should be a :term:`path-like object` " "specifying the root directory for searching. It has the same effect on :" "func:`!glob` as changing the current directory before calling it. If " "*pathname* is relative, the result will contain paths relative to *root_dir*." msgstr "" +"*root_dir* が ``None`` でない場合は、検索のルートディレクトリを指定する :" +"term:`path-like object` でなければなりません。\n" +":func:`!glob` の呼び出し前にカレントディレクトリを変更するのと同じ効果があり" +"ます。\n" +"*pathname* が相対パスの場合、結果には *root_dir* からの相対パスが含まれます。" #: ../../library/glob.rst:62 msgid "" @@ -114,11 +128,12 @@ msgstr "" "ます。パターンの末尾が :data:`os.sep` または :data:`os.altsep` の場合、ファイ" "ルは一致しません。" -#: ../../library/glob.rst:73 msgid "" "If *include_hidden* is true, wildcards can match path segments that begin " "with a dot (``.``)." msgstr "" +"*include_hidden* が真の場合、ワイルドカードはドット (``.``) で始まるパスのセ" +"グメントにもマッチします。" msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " @@ -150,12 +165,14 @@ msgstr "" "*pathname* が複数の \"``**``\" パターンを含み、かつ *recursive* が真の場合、" "この関数は同じパスを重複して返す可能性があります。" -#: ../../library/glob.rst:88 ../../library/glob.rst:116 msgid "" "Any :exc:`OSError` exceptions raised from scanning the filesystem are " "suppressed. This includes :exc:`PermissionError` when accessing directories " "without read permission." msgstr "" +"ファイルシステムの走査中に発生した :exc:`OSError` 例外はすべて抑制します。\n" +"これには、読み取り権限のないディレクトリへのアクセスで発生する :exc:" +"`PermissionError` も含まれます。" #: ../../library/glob.rst:92 ../../library/glob.rst:120 msgid "Support for recursive globs using \"``**``\"." @@ -177,7 +194,6 @@ msgstr "" "実際には一度にすべてを格納せずに、:func:`glob` と同じ値を順に生成する :term:`" "イテレーター ` を返します。" -#: ../../library/glob.rst:132 msgid "" "Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful " "if you want to match an arbitrary literal string that may have special " @@ -185,13 +201,21 @@ msgid "" "escaped, for example on Windows ``escape('//?/c:/Quo vadis?.txt')`` returns " "``'//?/c:/Quo vadis[?].txt'``." msgstr "" +"すべての特殊文字 (``'?'``、``'*'``、``'['``) をエスケープします。\n" +"特殊文字を含む可能性がある任意の文字列に、そのままマッチさせたい場合に便利で" +"す。\n" +"ドライブ名や UNC 共有ポイントの特殊文字はエスケープしません。\n" +"例えば Windows では、``escape('//?/c:/Quo vadis?.txt')`` は ``'//?/c:/Quo " +"vadis[?].txt'`` を返します。" -#: ../../library/glob.rst:143 msgid "" "Convert the given path specification to a regular expression for use with :" "func:`re.prefixmatch`. The path specification can contain shell-style " "wildcards." msgstr "" +"指定したパスのパターンを、:func:`re.prefixmatch` で使う正規表現に変換しま" +"す。\n" +"パスのパターンにはシェル形式のワイルドカードを含められます。" #: ../../library/glob.rst:147 msgid "For example:" diff --git a/library/graphlib.po b/library/graphlib.po index 507aa2861..7bd32c85f 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -115,13 +115,16 @@ msgstr "" "すぐにグラフのノードをソートした結果が必要で、並行性が不要な場合、便利なメ" "ソッド :meth:`TopologicalSorter.static_order` を直接呼び出すことができます:" -#: ../../library/graphlib.rst:53 msgid "" ">>> graph = {\"D\": {\"B\", \"C\"}, \"C\": {\"A\"}, \"B\": {\"A\"}}\n" ">>> ts = TopologicalSorter(graph)\n" ">>> tuple(ts.static_order())\n" "('A', 'C', 'B', 'D')" msgstr "" +">>> graph = {\"D\": {\"B\", \"C\"}, \"C\": {\"A\"}, \"B\": {\"A\"}}\n" +">>> ts = TopologicalSorter(graph)\n" +">>> tuple(ts.static_order())\n" +"('A', 'C', 'B', 'D')" #: ../../library/graphlib.rst:60 msgid "" @@ -131,7 +134,6 @@ msgstr "" "このクラスは、簡単に準備が整ったノードの並列処理を行えるよう設計されていま" "す。例えば::" -#: ../../library/graphlib.rst:63 msgid "" "topological_sorter = TopologicalSorter()\n" "\n" @@ -155,6 +157,29 @@ msgid "" " node = finalized_tasks_queue.get()\n" " topological_sorter.done(node)" msgstr "" +"topological_sorter = TopologicalSorter()\n" +"\n" +"# 'topological_sorter' にノードを追加する...\n" +"\n" +"topological_sorter.prepare()\n" +"while topological_sorter.is_active():\n" +" for node in topological_sorter.get_ready():\n" +" # ワーカースレッドやプロセスが 'task_queue' キューから\n" +" # 処理するノードを取り出す。\n" +" task_queue.put(node)\n" +"\n" +" # ノードの処理が終わると、ワーカーはそのノードを\n" +" # 'finalized_tasks_queue' に入れる。\n" +" # それによって次の処理対象を得られる。\n" +" # 'is_active()' の定義により、この時点で 'task_queue' に入っていて\n" +" # まだ 'done()' に渡されていないノードが少なくとも 1 つある。\n" +" # したがって、ここでブロックする 'get()' は最終的には成功する。\n" +" # 'done()' の呼び出し後はループの先頭に戻り、再び 'get_ready()' を呼" +"ぶ。\n" +" # これにより、新たに処理可能になったノードを論理的に可能な限り早く\n" +" # 'task_queue' に入れられる。\n" +" node = finalized_tasks_queue.get()\n" +" topological_sorter.done(node)" #: ../../library/graphlib.rst:87 msgid "" @@ -172,13 +197,16 @@ msgstr "" "同じ node 引数で複数回呼び出した場合、依存関係の集合は、それまでに指定した依" "存関係の和集合になります。" -#: ../../library/graphlib.rst:93 msgid "" "It is possible to add a node with no dependencies (*predecessors* is not " "provided) or to provide a dependency twice. If a node that has not been " "provided before is included among *predecessors* it will be automatically " "added to the graph with no predecessors of its own." msgstr "" +"依存先のないノードを追加することも (*predecessors* を指定しない場合)、同じ依" +"存関係を 2 回指定することもできます。\n" +"*predecessors* に、まだ追加していないノードが含まれる場合、そのノードは自身の" +"先行ノードを持たないものとしてグラフに自動的に追加されます。" #: ../../library/graphlib.rst:98 msgid "" @@ -187,7 +215,6 @@ msgstr "" ":meth:`~TopologicalSorter.prepare` を呼び出した後にこのメソッドを呼び出す" "と、:exc:`ValueError` を送出します。" -#: ../../library/graphlib.rst:102 msgid "" "Mark the graph as finished and check for cycles in the graph. If any cycle " "is detected, :exc:`CycleError` will be raised, but :meth:`~TopologicalSorter." @@ -196,20 +223,28 @@ msgid "" "be modified, and therefore no more nodes can be added using :meth:" "`~TopologicalSorter.add`." msgstr "" +"グラフの構築を完了したものとして印を付け、閉路がないか調べます。\n" +"閉路が見つかると :exc:`CycleError` を送出しますが、:meth:`~TopologicalSorter." +"get_ready` は引き続き使えるため、閉路によってそれ以上進めなくなるまで可能な限" +"りノードを取得できます。\n" +"この関数を呼び出した後はグラフを変更できず、:meth:`~TopologicalSorter.add` で" +"ノードを追加することもできません。" -#: ../../library/graphlib.rst:109 msgid "" "A :exc:`ValueError` will be raised if the sort has been started by :meth:`~." "static_order` or :meth:`~.get_ready`." msgstr "" +":meth:`~.static_order` または :meth:`~.get_ready` によってソートが開始されて" +"いる場合は :exc:`ValueError` を送出します。" -#: ../../library/graphlib.rst:114 msgid "" "``prepare()`` can now be called more than once as long as the sort has not " "started. Previously this raised :exc:`ValueError`." msgstr "" +"ソートが開始されていなければ、``prepare()`` を複数回呼び出せるようになりまし" +"た。\n" +"以前は :exc:`ValueError` が送出されていました。" -#: ../../library/graphlib.rst:119 msgid "" "Returns ``True`` if more progress can be made and ``False`` otherwise. " "Progress can be made if cycles do not block the resolution and either there " @@ -218,27 +253,35 @@ msgid "" "`TopologicalSorter.done` is less than the number that have been returned by :" "meth:`TopologicalSorter.get_ready`." msgstr "" +"処理を進められる場合は ``True``、そうでなければ ``False`` を返します。\n" +"閉路によって処理が妨げられておらず、:meth:`TopologicalSorter.get_ready` がま" +"だ返していない処理可能なノードがあるか、:meth:`TopologicalSorter.done` で処理" +"済みとしたノード数が :meth:`TopologicalSorter.get_ready` の返したノード数より" +"少ない場合に、処理を進められます。" -#: ../../library/graphlib.rst:126 msgid "" "The :meth:`~object.__bool__` method of this class defers to this function, " "so instead of::" msgstr "" +"このクラスの :meth:`~object.__bool__` メソッドはこの関数に処理を委ねます。\n" +"そのため、次の書き方は置き換えられます。 ::" -#: ../../library/graphlib.rst:129 msgid "" "if ts.is_active():\n" " ..." msgstr "" +"if ts.is_active():\n" +" ..." msgid "it is possible to simply do::" msgstr "次のように簡単に書けます。 ::" -#: ../../library/graphlib.rst:134 msgid "" "if ts:\n" " ..." msgstr "" +"if ts:\n" +" ..." #: ../../library/graphlib.rst:137 ../../library/graphlib.rst:160 msgid "" @@ -248,14 +291,17 @@ msgstr "" "前もって :meth:`~TopologicalSorter.prepare` を呼び出さずにこの関数を呼び出す" "と :exc:`ValueError` を送出します。" -#: ../../library/graphlib.rst:142 msgid "" "Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as " "processed, unblocking any successor of each node in *nodes* for being " "returned in the future by a call to :meth:`TopologicalSorter.get_ready`." msgstr "" +":meth:`TopologicalSorter.get_ready` が返した一連のノードを処理済みとしま" +"す。\n" +"これにより、*nodes* の各ノードの後続ノードが、それ以降の :meth:" +"`TopologicalSorter.get_ready` の呼び出しで返されるための依存条件が解消されま" +"す。" -#: ../../library/graphlib.rst:146 msgid "" "Raises :exc:`ValueError` if any node in *nodes* has already been marked as " "processed by a previous call to this method or if a node was not added to " @@ -263,8 +309,12 @@ msgid "" "meth:`~TopologicalSorter.prepare` or if node has not yet been returned by :" "meth:`~TopologicalSorter.get_ready`." msgstr "" +"*nodes* のいずれかのノードが、このメソッドの以前の呼び出しですでに処理済みに" +"なっている場合や、:meth:`TopologicalSorter.add` でグラフに追加されていない場" +"合は :exc:`ValueError` を送出します。\n" +":meth:`~TopologicalSorter.prepare` を呼び出す前に呼び出した場合や、ノードがま" +"だ :meth:`~TopologicalSorter.get_ready` から返されていない場合も同様です。" -#: ../../library/graphlib.rst:154 msgid "" "Returns a ``tuple`` with all the nodes that are ready. Initially it returns " "all nodes with no predecessors, and once those are marked as processed by " @@ -272,16 +322,23 @@ msgid "" "nodes that have all their predecessors already processed. Once no more " "progress can be made, empty tuples are returned." msgstr "" +"処理の準備が整ったすべてのノードを ``tuple`` で返します。\n" +"最初は先行ノードのないすべてのノードを返します。\n" +"それらを :meth:`TopologicalSorter.done` で処理済みとすると、以降の呼び出しで" +"は、すべての先行ノードの処理が終わった新たなノードをすべて返します。\n" +"それ以上処理を進められなくなると、空のタプルを返します。" -#: ../../library/graphlib.rst:165 msgid "" "Returns an iterator object which will iterate over nodes in a topological " "order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:" "`~TopologicalSorter.done` should not be called. This method is equivalent " "to::" msgstr "" +"ノードをトポロジカル順序でたどるイテレータオブジェクトを返します。\n" +"このメソッドを使う場合は、:meth:`~TopologicalSorter.prepare` と :meth:" +"`~TopologicalSorter.done` を呼び出さないでください。\n" +"このメソッドは次と等価です。 ::" -#: ../../library/graphlib.rst:170 msgid "" "def static_order(self):\n" " self.prepare()\n" @@ -290,14 +347,21 @@ msgid "" " yield from node_group\n" " self.done(*node_group)" msgstr "" +"def static_order(self):\n" +" self.prepare()\n" +" while self.is_active():\n" +" node_group = self.get_ready()\n" +" yield from node_group\n" +" self.done(*node_group)" -#: ../../library/graphlib.rst:177 msgid "" "The particular order that is returned may depend on the specific order in " "which the items were inserted in the graph. For example:" msgstr "" +"返される具体的な順序は、グラフに要素を挿入した順序に依存する場合がありま" +"す。\n" +"例えば次のようになります。" -#: ../../library/graphlib.rst:180 msgid "" ">>> ts = TopologicalSorter()\n" ">>> ts.add(3, 2, 1)\n" @@ -311,35 +375,49 @@ msgid "" ">>> print([*ts2.static_order()])\n" "[0, 2, 1, 3]" msgstr "" +">>> ts = TopologicalSorter()\n" +">>> ts.add(3, 2, 1)\n" +">>> ts.add(1, 0)\n" +">>> print([*ts.static_order()])\n" +"[2, 0, 1, 3]\n" +"\n" +">>> ts2 = TopologicalSorter()\n" +">>> ts2.add(1, 0)\n" +">>> ts2.add(3, 2, 1)\n" +">>> print([*ts2.static_order()])\n" +"[0, 2, 1, 3]" -#: ../../library/graphlib.rst:194 msgid "" "This is due to the fact that \"0\" and \"2\" are in the same level in the " "graph (they would have been returned in the same call to :meth:" "`~TopologicalSorter.get_ready`) and the order between them is determined by " "the order of insertion." msgstr "" +"これは、\"0\" と \"2\" がグラフの同じ階層にあり (同じ :meth:" +"`~TopologicalSorter.get_ready` の呼び出しで返される)、両者の間の順序が挿入順" +"で決まるためです。" -#: ../../library/graphlib.rst:200 msgid "If any cycle is detected, :exc:`CycleError` will be raised." -msgstr "" +msgstr "閉路が見つかると :exc:`CycleError` を送出します。" #: ../../library/graphlib.rst:206 msgid "Exceptions" msgstr "例外" -#: ../../library/graphlib.rst:207 msgid "The :mod:`!graphlib` module defines the following exception classes:" -msgstr "" +msgstr ":mod:`!graphlib` モジュールは次の例外クラスを定義しています。" -#: ../../library/graphlib.rst:211 msgid "" "Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if " "cycles exist in the working graph. If multiple cycles exist, only one " "undefined choice among them will be reported and included in the exception." msgstr "" +"処理対象のグラフに閉路がある場合に :meth:`TopologicalSorter.prepare` が送出す" +"る、:exc:`ValueError` のサブクラスです。\n" +"閉路が複数ある場合は、そのうち 1 つだけが選ばれて報告され、例外に含まれま" +"す。\n" +"どれが選ばれるかは未定義です。" -#: ../../library/graphlib.rst:215 msgid "" "The detected cycle can be accessed via the second element in the :attr:" "`~BaseException.args` attribute of the exception instance and consists in a " @@ -347,3 +425,9 @@ msgid "" "predecessor of the next node in the list. In the reported list, the first " "and the last node will be the same, to make it clear that it is cyclic." msgstr "" +"検出された閉路には、例外インスタンスの :attr:`~BaseException.args` 属性の 2 " +"番目の要素からアクセスできます。\n" +"これはノードのリストで、各ノードはグラフ上でリストの次のノードの直接の先行" +"ノードになっています。\n" +"閉路であることが分かるように、報告されるリストの最初と最後のノードは同じで" +"す。" diff --git a/library/grp.po b/library/grp.po index 4e08c675e..36028cc01 100644 --- a/library/grp.po +++ b/library/grp.po @@ -152,9 +152,10 @@ msgstr "" "与えられたグループ名に対するグループデータベースエントリを返します。要求した" "エントリが見つからなかった場合、 :exc:`KeyError` が送出されます。" -#: ../../library/grp.rst:58 msgid "Return a list of all available group entries, in arbitrary order." -msgstr "全ての入手可能なグループエントリを返します。順番は決まっていません。" +msgstr "" +"利用可能なすべてのグループエントリーを、順序の決まっていないリストとして返し" +"ます。" #: ../../library/grp.rst:63 msgid "Module :mod:`pwd`" diff --git a/library/gzip.po b/library/gzip.po index 90f152c28..2ad62ca10 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -39,19 +39,21 @@ msgstr "" "このモジュールは、GNU の :program:`gzip` や :program:`gunzip` のようにファイ" "ルを圧縮、展開するシンプルなインターフェイスを提供しています。" -#: ../../includes/optional-module.rst:1 msgid "" "This is an :term:`optional module`. If it is missing from your copy of " "CPython, look for documentation from your distributor (that is, whoever " "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" +"これは :term:`オプションモジュール ` です。\n" +"使用している CPython に含まれていない場合は、配布元 (Python を提供した組織な" +"ど) のドキュメントを確認してください。\n" +"配布する立場の場合は :ref:`optional-module-requirements` を参照してください。" #: ../../library/gzip.rst:16 msgid "The data compression is provided by the :mod:`zlib` module." msgstr "データ圧縮は :mod:`zlib` モジュールで提供されています。" -#: ../../library/gzip.rst:18 msgid "" "The :mod:`!gzip` module provides the :class:`GzipFile` class, as well as " "the :func:`.open`, :func:`compress` and :func:`decompress` convenience " @@ -59,6 +61,11 @@ msgid "" "format files, automatically compressing or decompressing the data so that it " "looks like an ordinary :term:`file object`." msgstr "" +":mod:`!gzip` モジュールは :class:`GzipFile` クラスと、便利な関数 :func:`." +"open`、:func:`compress`、:func:`decompress` を提供します。\n" +":class:`GzipFile` クラスは :program:`gzip` 形式のファイルを読み書きし、データ" +"を自動的に圧縮・展開するため、通常の :term:`file object` と同じように扱えま" +"す。" #: ../../library/gzip.rst:24 msgid "" @@ -145,20 +152,24 @@ msgstr " ``'x'``、``'xb'``、``'xt'`` モードのサポートが追加され msgid "Accepts a :term:`path-like object`." msgstr ":term:`path-like object` を受け入れるようになりました。" -#: ../../library/gzip.rst:64 ../../library/gzip.rst:195 -#: ../../library/gzip.rst:225 msgid "" "The default compression level was reduced to 6 (down from 9). It is the " "default level used by most compression tools and a better tradeoff between " "speed and performance." msgstr "" +"デフォルトの圧縮レベルが 9 から 6 に下がりました。\n" +"これはほとんどの圧縮ツールのデフォルトで、速度と性能のバランスがよりよいレベ" +"ルです。" -#: ../../library/gzip.rst:71 msgid "" "An exception raised for invalid gzip files. It inherits from :exc:" "`OSError`. :exc:`EOFError` and :exc:`zlib.error` can also be raised for " "invalid gzip files." msgstr "" +"不正な gzip ファイルに対して送出される例外です。\n" +":exc:`OSError` を継承します。\n" +"不正な gzip ファイルに対しては :exc:`EOFError` や :exc:`zlib.error` が送出さ" +"れる場合もあります。" msgid "" "Constructor for the :class:`GzipFile` class, which simulates most of the " @@ -199,7 +210,6 @@ msgstr "" "認識可能な場合、規定値は *fileobj* のファイル名です。そうでない場合、規定値は" "空の文字列で、元のファイル名はヘッダにはインクルードされません。" -#: ../../library/gzip.rst:95 msgid "" "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " "``'w'``, ``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will " @@ -208,6 +218,12 @@ msgid "" "*fileobj* will not be used. It is better to always specify *mode* for " "writing." msgstr "" +"*mode* 引数には、読み取りか書き込みかに応じて ``'r'``、``'rb'``、``'a'``、" +"``'ab'``、``'w'``、``'wb'``、``'x'``、``'xb'`` のいずれかを指定できます。\n" +"デフォルトは、*fileobj* のモードが分かる場合はそのモード、そうでなければ " +"``'rb'`` です。\n" +"今後の Python のリリースでは *fileobj* のモードを使わなくなります。\n" +"書き込みの場合は、常に *mode* を指定することを推奨します。" #: ../../library/gzip.rst:101 msgid "" @@ -230,7 +246,6 @@ msgstr "" "す; ``1`` は最も高速で最小限の圧縮を行い、``9`` は最も低速ですが最大限の圧縮" "を行います。``0`` は圧縮しません。デフォルトは ``9`` です。" -#: ../../library/gzip.rst:110 msgid "" "The optional *mtime* argument is the timestamp requested by gzip. The time " "is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. Set " @@ -241,11 +256,20 @@ msgid "" "argument is outside the range ``0`` to ``2**32-1``, then the value ``0`` is " "used instead." msgstr "" +"省略可能な *mtime* 引数は、gzip が要求するタイムスタンプです。\n" +"時刻は Unix 形式、つまり 1970 年 1 月 1 日 00:00:00 UTC からの秒数で指定しま" +"す。\n" +"作成時刻に依存しない圧縮ストリームを生成するには、*mtime* を ``0`` にしてくだ" +"さい。\n" +"*mtime* を省略するか ``None`` にすると、現在時刻を使います。\n" +"ただし、現在時刻が 1970 年 1 月 1 日 00:00:00 UTC から 2106 年 2 月 7 日 " +"06:28:15 UTC までの範囲外の場合や、明示的に渡した *mtime* 引数が ``0`` から " +"``2**32-1`` の範囲外の場合は、代わりに ``0`` を使います。" -#: ../../library/gzip.rst:119 msgid "" "See below for the :attr:`mtime` attribute that is set when decompressing." msgstr "" +"展開時に設定される :attr:`mtime` 属性については、以下を参照してください。" #: ../../library/gzip.rst:121 msgid "" @@ -297,24 +321,29 @@ msgstr "" msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "``'rb'`` は読み込み用、 ``'wb'`` は書き込み用です。" -#: ../../library/gzip.rst:149 msgid "In previous versions it was an integer ``1`` or ``2``." -msgstr "" +msgstr "以前のバージョンでは整数の ``1`` または ``2`` でした。" -#: ../../library/gzip.rst:154 msgid "" "When decompressing, this attribute is set to the last timestamp in the most " "recently read header. It is an integer, holding the number of seconds since " "the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before " "reading any headers is ``None``." msgstr "" +"展開時、この属性には最後に読み取ったヘッダーのタイムスタンプが設定されま" +"す。\n" +"Unix エポック (1970 年 1 月 1 日 00:00:00 UTC) からの秒数を表す整数です。\n" +"ヘッダーを読み取る前の初期値は ``None`` です。" -#: ../../library/gzip.rst:161 msgid "" "The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " "Equivalent to the output of :func:`os.fspath` on the original input path, " "with no other normalization, resolution or expansion." msgstr "" +"ディスク上の gzip ファイルへのパスを表す :class:`str` または :class:`bytes` " +"です。\n" +"元の入力パスに :func:`os.fspath` を適用した結果と等しく、それ以外の正規化、解" +"決、展開は行いません。" #: ../../library/gzip.rst:165 msgid "" @@ -347,31 +376,33 @@ msgstr "" "ポートされました。 :meth:`~io.BufferedIOBase.read` メソッドが ``None`` を引数" "として受け取るようになりました。" -#: ../../library/gzip.rst:187 msgid "" "Opening :class:`GzipFile` for writing without specifying the *mode* argument " "is deprecated." msgstr "" +"*mode* 引数を指定せずに :class:`GzipFile` を書き込み用に開くことは非推奨にな" +"りました。" -#: ../../library/gzip.rst:191 msgid "" "Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " "instead." msgstr "" +"``filename`` 属性が削除されました。\n" +"代わりに :attr:`~GzipFile.name` 属性を使ってください。" -#: ../../library/gzip.rst:203 msgid "" "Compress the *data*, returning a :class:`bytes` object containing the " "compressed data. *compresslevel* and *mtime* have the same meaning as in " "the :class:`GzipFile` constructor above, but *mtime* defaults to 0 for " "reproducible output." msgstr "" +"*data* を圧縮し、圧縮データを含む :class:`bytes` オブジェクトを返します。\n" +"*compresslevel* と *mtime* は上記の :class:`GzipFile` コンストラクタと同じ意" +"味ですが、再現可能な出力を得るために *mtime* のデフォルトは 0 です。" -#: ../../library/gzip.rst:209 msgid "Added the *mtime* parameter for reproducible output." -msgstr "" +msgstr "再現可能な出力を得るための *mtime* 引数が追加されました。" -#: ../../library/gzip.rst:211 msgid "" "Speed is improved by compressing all data at once instead of in a streamed " "fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." @@ -379,20 +410,27 @@ msgid "" "header \"OS\" byte value other than 255 \"unknown\" as supplied by the " "underlying zlib implementation." msgstr "" +"ストリームとして処理する代わりにすべてのデータを一度に圧縮することで、高速化" +"しました。\n" +"*mtime* が ``0`` の呼び出しは、速度を上げるために :func:`zlib.compress` に委" +"譲されます。\n" +"この場合、内部で使う zlib 実装が設定する値により、出力の gzip ヘッダーの " +"\"OS\" バイトが、255 (\"unknown\") 以外になることがあります。" -#: ../../library/gzip.rst:218 msgid "" "The gzip header OS byte is guaranteed to be set to 255 when this function is " "used as was the case in 3.10 and earlier." msgstr "" +"この関数を使った場合、3.10 以前と同様に、gzip ヘッダーの OS バイトが 255 に設" +"定されることを保証するようになりました。" -#: ../../library/gzip.rst:221 msgid "" "The *mtime* parameter now defaults to 0 for reproducible output. For the " "previous behaviour of using the current time, pass ``None`` to *mtime*." msgstr "" +"再現可能な出力を得るために、*mtime* 引数のデフォルトが 0 になりました。\n" +"以前のように現在時刻を使うには、*mtime* に ``None`` を渡してください。" -#: ../../library/gzip.rst:232 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " "uncompressed data. This function is capable of decompressing multi-member " @@ -400,12 +438,19 @@ msgid "" "certain to contain only one member the :func:`zlib.decompress` function with " "*wbits* set to 31 is faster." msgstr "" +"*data* を展開し、展開したデータを含む :class:`bytes` オブジェクトを返しま" +"す。\n" +"この関数は、複数のメンバーからなる gzip データ (複数の gzip ブロックを連結し" +"たもの) を展開できます。\n" +"データにメンバーが 1 つしか含まれないことが確実な場合は、*wbits* を 31 に設定" +"した :func:`zlib.decompress` 関数の方が高速です。" -#: ../../library/gzip.rst:239 msgid "" "Speed is improved by decompressing members at once in memory instead of in a " "streamed fashion." msgstr "" +"ストリームとして処理する代わりに、メモリ内でメンバーを一度に展開することで高" +"速化しました。" #: ../../library/gzip.rst:246 msgid "Examples of usage" @@ -415,30 +460,34 @@ msgstr "使い方の例" msgid "Example of how to read a compressed file::" msgstr "圧縮されたファイルを読み込む例::" -#: ../../library/gzip.rst:250 msgid "" "import gzip\n" "with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" " file_content = f.read()" msgstr "" +"import gzip\n" +"with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" +" file_content = f.read()" #: ../../library/gzip.rst:254 msgid "Example of how to create a compressed GZIP file::" msgstr "GZIP 圧縮されたファイルを作成する例::" -#: ../../library/gzip.rst:256 msgid "" "import gzip\n" "content = b\"Lots of content here\"\n" "with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" " f.write(content)" msgstr "" +"import gzip\n" +"content = b\"Lots of content here\"\n" +"with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" +" f.write(content)" #: ../../library/gzip.rst:261 msgid "Example of how to GZIP compress an existing file::" msgstr "既存のファイルを GZIP 圧縮する例::" -#: ../../library/gzip.rst:263 msgid "" "import gzip\n" "import shutil\n" @@ -446,17 +495,24 @@ msgid "" " with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" " shutil.copyfileobj(f_in, f_out)" msgstr "" +"import gzip\n" +"import shutil\n" +"with open('/home/joe/file.txt', 'rb') as f_in:\n" +" with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)" #: ../../library/gzip.rst:269 msgid "Example of how to GZIP compress a binary string::" msgstr "バイナリ文字列を GZIP 圧縮する例::" -#: ../../library/gzip.rst:271 msgid "" "import gzip\n" "s_in = b\"Lots of content here\"\n" "s_out = gzip.compress(s_in)" msgstr "" +"import gzip\n" +"s_in = b\"Lots of content here\"\n" +"s_out = gzip.compress(s_in)" #: ../../library/gzip.rst:277 msgid "Module :mod:`zlib`" @@ -470,51 +526,49 @@ msgstr "" ":program:`gzip` ファイル形式のサポートを行うために必要な基本ライブラリモ" "ジュール。" -#: ../../library/gzip.rst:281 msgid "" "In case gzip (de)compression is a bottleneck, the `python-isal`_ package " "speeds up (de)compression with a mostly compatible API." msgstr "" +"gzip の圧縮や展開がボトルネックとなる場合、`python-isal`_ パッケージを使う" +"と、ほぼ互換性のある API で圧縮や展開を高速化できます。" #: ../../library/gzip.rst:291 msgid "Command-line interface" msgstr "コマンドライン・インターフェース" -#: ../../library/gzip.rst:293 msgid "" "The :mod:`!gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" +":mod:`!gzip` モジュールは、ファイルを圧縮・展開するための簡単なコマンドライン" +"インターフェースを提供します。" -#: ../../library/gzip.rst:296 msgid "Once executed the :mod:`!gzip` module keeps the input file(s)." -msgstr "" +msgstr ":mod:`!gzip` モジュールは、実行後も入力ファイルを残します。" -#: ../../library/gzip.rst:300 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" +"使用方法を表示する新しいコマンドラインインターフェースが追加されました。\n" +"CLI 実行時のデフォルトの圧縮レベルは 6 です。" #: ../../library/gzip.rst:304 msgid "Command-line options" msgstr "コマンドラインオプション" -#: ../../library/gzip.rst:308 msgid "If *file* is not specified, read from :data:`sys.stdin`." -msgstr "" +msgstr "*file* を指定しない場合は、:data:`sys.stdin` から読み取ります。" -#: ../../library/gzip.rst:312 msgid "Indicates the fastest compression method (less compression)." -msgstr "" +msgstr "最速の圧縮方法 (低い圧縮率) を指定します。" -#: ../../library/gzip.rst:316 msgid "Indicates the slowest compression method (best compression)." -msgstr "" +msgstr "最も遅い圧縮方法 (最も高い圧縮率) を指定します。" -#: ../../library/gzip.rst:320 msgid "Decompress the given file." -msgstr "" +msgstr "指定したファイルを展開します。" #: ../../library/gzip.rst:324 msgid "Show the help message." diff --git a/library/hashlib.po b/library/hashlib.po index 66c4fefc7..8ad34bc2b 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -32,7 +32,6 @@ msgstr ":mod:`!hashlib` --- セキュアハッシュとメッセージダイジ msgid "**Source code:** :source:`Lib/hashlib.py`" msgstr "**ソースコード:** :source:`Lib/hashlib.py`" -#: ../../library/hashlib.rst:20 msgid "" "This module implements a common interface to many different hash algorithms. " "Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512, " @@ -40,6 +39,12 @@ msgid "" "FIPS 202 standard`_) as well as the legacy algorithms SHA1 (`formerly part " "of FIPS`_) and the MD5 algorithm (defined in internet :rfc:`1321`)." msgstr "" +"このモジュールは、多くの異なるハッシュアルゴリズムに共通のインターフェースを" +"実装しています。\n" +"FIPS のセキュアハッシュアルゴリズム SHA224、SHA256、SHA384、SHA512 (`the " +"FIPS 180-4 standard`_ で定義)、SHA-3 系列 (`the FIPS 202 standard`_ で定義)、" +"および旧来の SHA1 (`formerly part of FIPS`_) と MD5 (インターネット :rfc:" +"`1321` で定義) が含まれます。" #: ../../library/hashlib.rst:28 msgid "" @@ -72,14 +77,15 @@ msgstr "" "て、それまでに渡したデータを連結したものの :dfn:`digest` をいつでも要求するこ" "とができます。" -#: ../../library/hashlib.rst:45 msgid "" "To allow multithreading, the Python :term:`GIL` is released while computing " "a hash supplied more than 2047 bytes of data at once in its constructor or :" "meth:`.update` method." msgstr "" +"複数のスレッドを動作させるため、コンストラクタまたは :meth:`.update ` メソッドに一度に 2047 バイトを超えるデータを渡すと、ハッシュの計算中" +"は Python の :term:`GIL` を解放します。" -#: ../../library/hashlib.rst:52 msgid "" "Constructors for hash algorithms that are always present in this module are :" "func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :" @@ -87,8 +93,13 @@ msgid "" "`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, and :func:" "`blake2s`. These correspond to :data:`algorithms_guaranteed`." msgstr "" +"このモジュールに常に含まれるハッシュアルゴリズムのコンストラクタは、:func:" +"`md5`、:func:`sha1`、:func:`sha224`、:func:`sha256`、:func:`sha384`、:func:" +"`sha512`、:func:`sha3_224`、:func:`sha3_256`、:func:`sha3_384`、:func:" +"`sha3_512`、:func:`shake_128`、:func:`shake_256`、:func:`blake2b`、:func:" +"`blake2s` です。\n" +"これらは :data:`algorithms_guaranteed` に対応します。" -#: ../../library/hashlib.rst:58 msgid "" "Any of these may nonetheless be missing or blocked in unusual environments, " "such as a rare \"FIPS compliant\" build of Python or when OpenSSL's \"FIPS " @@ -96,30 +107,46 @@ msgid "" "Calling the constructor of an algorithm that is unavailable raises :exc:" "`ValueError`." msgstr "" +"ただし、まれに見られる「FIPS 準拠」の Python ビルドや、OpenSSL の「FIPS モー" +"ド」でデフォルトのプロバイダから一部のアルゴリズムを除外する設定など、通常と" +"異なる環境では、これらのいずれも欠けていたり使用を制限されていたりする場合が" +"あります。\n" +"利用できないアルゴリズムのコンストラクタを呼び出すと :exc:`ValueError` を送出" +"します。" -#: ../../library/hashlib.rst:63 msgid "" "Additional algorithms may also be available if your Python distribution's :" "mod:`!hashlib` was linked against a build of OpenSSL that provides others. " "Others *are not guaranteed available* on all installations and will only be " "accessible by name via :func:`new`. See :data:`algorithms_available`." msgstr "" +"使用している Python ディストリビューションの :mod:`!hashlib` が、ほかのアルゴ" +"リズムを提供する OpenSSL ビルドにリンクされている場合は、それらも利用できるこ" +"とがあります。\n" +"これらは *すべての環境での利用が保証されているわけではなく*、:func:`new` に名" +"前を渡す方法でのみアクセスできます。\n" +":data:`algorithms_available` を参照してください。" -#: ../../library/hashlib.rst:70 msgid "" "Some algorithms have known hash collision weaknesses (including MD5 and " "SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-" "seealso`_ section at the end of this document." msgstr "" +"一部のアルゴリズム (MD5 と SHA1 を含む) には、ハッシュの衝突に関する既知の弱" +"点があります。\n" +"`Attacks on cryptographic hash algorithms`_ と、このドキュメントの末尾の " +"`hashlib-seealso`_ 節を参照してください。" -#: ../../library/hashlib.rst:74 msgid "" "SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :" "func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " "added. :func:`blake2b` and :func:`blake2s` were added." msgstr "" +"SHA3 (Keccak) と SHAKE のコンストラクタ :func:`sha3_224`、:func:`sha3_256`、:" +"func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:`shake_256` が追" +"加されました。\n" +":func:`blake2b` と :func:`blake2s` も追加されました。" -#: ../../library/hashlib.rst:82 msgid "" "All hashlib constructors take a keyword-only argument *usedforsecurity* with " "default value ``True``. A false value allows the use of insecure and blocked " @@ -127,25 +154,37 @@ msgid "" "hashing algorithm is not used in a security context, e.g. as a non-" "cryptographic one-way compression function." msgstr "" +"hashlib のすべてのコンストラクタが、デフォルト値 ``True`` のキーワード専用引" +"数 *usedforsecurity* を受け取るようになりました。\n" +"偽の値を指定すると、制限のある環境で、安全でないアルゴリズムや使用を制限され" +"たハッシュアルゴリズムを使えます。\n" +"``False`` は、例えば暗号用途でない一方向圧縮関数として使う場合など、そのハッ" +"シュアルゴリズムをセキュリティ目的で使わないことを示します。" -#: ../../library/hashlib.rst:89 msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." msgstr "" +"OpenSSL が SHA3 と SHAKE を提供する場合、hashlib はそれらを使うようになりまし" +"た。" -#: ../../library/hashlib.rst:92 msgid "" "For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL " "does not provide we fall back to a verified implementation from the `HACL\\* " "project`_." msgstr "" +"MD5、SHA1、SHA2、SHA3 の各アルゴリズムを、リンク先の OpenSSL が提供していない" +"場合は、`HACL\\* project`_ の検証済み実装にフォールバックするようになりまし" +"た。" -#: ../../library/hashlib.rst:97 msgid "" "The undocumented ``string`` keyword parameter in :func:`!_hashlib.new` and " "hash-named constructors such as :func:`!_md5.md5` is deprecated. Prefer " "passing the initial data as a positional argument for maximum backwards " "compatibility." msgstr "" +":func:`!_hashlib.new` と :func:`!_md5.md5` などのハッシュ名を持つコンストラク" +"タで、ドキュメントに記載されていないキーワード引数 ``string`` が非推奨になり" +"ました。\n" +"後方互換性を最大限に保つには、初期データを位置引数として渡してください。" #: ../../library/hashlib.rst:105 msgid "Usage" @@ -159,7 +198,6 @@ msgstr "" "``b\"Nobody inspects the spammish repetition\"`` というバイト文字列のダイジェ" "ストを取得するには次のようにします::" -#: ../../library/hashlib.rst:110 msgid "" ">>> import hashlib\n" ">>> m = hashlib.sha256()\n" @@ -172,6 +210,16 @@ msgid "" ">>> m.hexdigest()\n" "'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" msgstr "" +">>> import hashlib\n" +">>> m = hashlib.sha256()\n" +">>> m.update(b\"Nobody inspects\")\n" +">>> m.update(b\" the spammish repetition\")\n" +">>> m.digest()\n" +"b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" +"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:" +"\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" +">>> m.hexdigest()\n" +"'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" #: ../../library/hashlib.rst:119 msgid "More condensed:" @@ -192,23 +240,22 @@ msgstr "" "ます。他にも、前述のハッシュアルゴリズムだけでなく OpenSSL ライブラリーが提供" "するような他のアルゴリズムにアクセスすることができます。" -#: ../../library/hashlib.rst:134 msgid "Using :func:`new` with an algorithm name:" -msgstr "" +msgstr ":func:`new` にアルゴリズム名を渡す例です。" -#: ../../library/hashlib.rst:153 msgid "" "Named constructors such as these are faster than passing an algorithm name " "to :func:`new`." msgstr "" +"このような名前付きコンストラクタは、:func:`new` にアルゴリズム名を渡すより高" +"速です。" #: ../../library/hashlib.rst:157 msgid "Attributes" msgstr "属性" -#: ../../library/hashlib.rst:159 msgid "Hashlib provides the following constant module attributes:" -msgstr "" +msgstr "hashlib は次の定数をモジュール属性として提供します。" #: ../../library/hashlib.rst:163 msgid "" @@ -235,9 +282,8 @@ msgstr "" "`algorithms_guaranteed` は常にサブセットです。この set の中に同じアルゴリズム" "が違う名前で複数回現れることがあります (OpenSSL 由来)。" -#: ../../library/hashlib.rst:181 msgid "Hash Objects" -msgstr "" +msgstr "ハッシュオブジェクト" #: ../../library/hashlib.rst:183 msgid "" @@ -323,13 +369,18 @@ msgstr "" msgid "SHAKE variable length digests" msgstr "SHAKE 可変長ダイジェスト" -#: ../../library/hashlib.rst:243 msgid "" "The :func:`shake_128` and :func:`shake_256` algorithms provide variable " "length digests with length_in_bits//2 up to 128 or 256 bits of security. As " "such, their digest methods require a length. Maximum length is not limited " "by the SHAKE algorithm." msgstr "" +":func:`shake_128` と :func:`shake_256` アルゴリズムは、可変長のダイジェストを" +"提供します。\n" +"安全性の強度は、ビット単位のダイジェスト長の半分 (length_in_bits//2) で、それ" +"ぞれ最大 128 ビットまたは 256 ビットです。\n" +"そのため、これらの ``digest()`` メソッドには長さの指定が必要です。\n" +"SHAKE アルゴリズム自体には長さの上限はありません。" #: ../../library/hashlib.rst:250 msgid "" @@ -358,18 +409,18 @@ msgstr "使用例:" msgid "File hashing" msgstr "ファイルのハッシュ化" -#: ../../library/hashlib.rst:270 msgid "" "The hashlib module provides a helper function for efficient hashing of a " "file or file-like object." msgstr "" +"hashlib モジュールは、ファイルやファイルに似たオブジェクトのハッシュを効率よ" +"く計算するための補助関数を提供します。" -#: ../../library/hashlib.rst:275 msgid "" "Return a digest object that has been updated with contents of file object." msgstr "" +"ファイルオブジェクトの内容で更新されたダイジェストオブジェクトを返します。" -#: ../../library/hashlib.rst:277 msgid "" "*fileobj* must be a file-like object opened for reading in binary mode. It " "accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " @@ -377,30 +428,45 @@ msgid "" "similar. *fileobj* must be opened in blocking mode, otherwise a :exc:" "`BlockingIOError` may be raised." msgstr "" +"*fileobj* はバイナリモードで読み取り用に開かれた、ファイルに似たオブジェクト" +"でなければなりません。\n" +"組み込みの :func:`open` が返すファイルオブジェクト、:class:`~io.BytesIO` イン" +"スタンス、:meth:`socket.socket.makefile` が返す SocketIO オブジェクトなどを受" +"け付けます。\n" +"*fileobj* はブロッキングモードで開いておく必要があり、そうでなければ :exc:" +"`BlockingIOError` が送出される場合があります。" -#: ../../library/hashlib.rst:283 msgid "" "The function may bypass Python's I/O and use the file descriptor from :meth:" "`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in an unknown " "state after this function returns or raises. It is up to the caller to close " "*fileobj*." msgstr "" +"この関数は Python の I/O を経由せず、:meth:`~io.IOBase.fileno` から得たファイ" +"ル記述子を直接使う場合があります。\n" +"この関数が値を返したり例外を送出したりした後の *fileobj* の状態は、不明なもの" +"として扱ってください。\n" +"*fileobj* を閉じるのは呼び出し側の責任です。" -#: ../../library/hashlib.rst:288 msgid "" "*digest* must either be a hash algorithm name as a *str*, a hash " "constructor, or a callable that returns a hash object." msgstr "" +"*digest* には、*str* で表したハッシュアルゴリズム名、ハッシュのコンストラク" +"タ、ハッシュオブジェクトを返す呼び出し可能オブジェクトのいずれかを指定する必" +"要があります。" #: ../../library/hashlib.rst:291 msgid "Example:" msgstr "例:" -#: ../../library/hashlib.rst:312 msgid "" "Now raises a :exc:`BlockingIOError` if the file is opened in non-blocking " "mode. Previously, spurious null bytes were added to the digest." msgstr "" +"ファイルが非ブロッキングモードで開かれている場合は :exc:`BlockingIOError` を" +"送出するようになりました。\n" +"以前は、余分なヌルバイトがダイジェストの計算に加わっていました。" #: ../../library/hashlib.rst:318 msgid "Key derivation" @@ -442,7 +508,6 @@ msgstr "" "長さ (例えば 1024) に制限すべきです。 *salt* は :func:`os.urandom` のような適" "切なソースからの、およそ 16 バイトかそれ以上のバイト列にするべきです。" -#: ../../library/hashlib.rst:337 msgid "" "The number of *iterations* should be chosen based on the hash algorithm and " "computing power. As of 2022, hundreds of thousands of iterations of SHA-256 " @@ -450,6 +515,12 @@ msgid "" "your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on " "the `stackexchange pbkdf2 iterations question`_ explain in detail." msgstr "" +"*iterations* の回数は、ハッシュアルゴリズムと計算能力に基づいて選んでくださ" +"い。\n" +"2022 年時点では、SHA-256 で数十万回の反復が推奨されています。\n" +"アプリケーションに最適な値を選ぶ方法とその根拠については、NIST-SP-800-132_ " +"の *付録 A.2.2* を参照してください。\n" +"`stackexchange pbkdf2 iterations question`_ の回答にも詳しい説明があります。" #: ../../library/hashlib.rst:343 msgid "" @@ -461,15 +532,18 @@ msgstr "" "ハッシュアルゴリズム *hash_name* のダイジェストサイズが使われます。例えば " "SHA-512 では 64 です。" -#: ../../library/hashlib.rst:352 msgid "Function only available when Python is compiled with OpenSSL." msgstr "" +"この関数は、Python が OpenSSL を使ってコンパイルされている場合にのみ利用でき" +"ます。" -#: ../../library/hashlib.rst:356 msgid "" "Function now only available when Python is built with OpenSSL. The slow pure " "Python implementation has been removed." msgstr "" +"この関数は、Python が OpenSSL を使ってビルドされている場合にのみ利用できるよ" +"うになりました。\n" +"低速な純 Python 実装は削除されました。" #: ../../library/hashlib.rst:362 msgid "" @@ -491,46 +565,54 @@ msgstr "" "きです。 *salt* は :func:`os.urandom` のような適切なソースからの、およそ 16 " "バイトかそれ以上のバイト列にするべきです。" -#: ../../library/hashlib.rst:370 msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " "*dklen* is the length of the derived key in bytes." msgstr "" +"*n* は CPU とメモリのコスト係数、*r* はブロックサイズ、*p* は並列化係数で" +"す。\n" +"*maxmem* はメモリ使用量を制限します (OpenSSL 1.1.0 のデフォルトは 32 MiB)。\n" +"*dklen* は導出する鍵のバイト単位の長さです。" #: ../../library/hashlib.rst:380 msgid "BLAKE2" msgstr "BLAKE2" -#: ../../library/hashlib.rst:385 msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" msgstr "" +"BLAKE2_ は :rfc:`7693` で定義された暗号学的ハッシュ関数で、次の 2 種類があり" +"ます。" -#: ../../library/hashlib.rst:388 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" +"**BLAKE2b** は 64 ビットプラットフォーム向けに最適化されており、1〜64 バイト" +"の任意の長さのダイジェストを生成します。" -#: ../../library/hashlib.rst:391 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" +"**BLAKE2s** は 8〜32 ビットプラットフォーム向けに最適化されており、1〜32 バイ" +"トの任意の長さのダイジェストを生成します。" -#: ../../library/hashlib.rst:394 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" +"BLAKE2 は **鍵付きモード** (HMAC_ より高速で単純な代替手段)、**ソルト付きハッ" +"シュ化**、**パーソナライズ**、**ツリーハッシング** をサポートします。" -#: ../../library/hashlib.rst:397 msgid "" "Hash objects from this module follow the API of standard library's :mod:`!" "hashlib` objects." msgstr "" +"このモジュールのハッシュオブジェクトは、標準ライブラリの :mod:`!hashlib` オブ" +"ジェクトの API に従います。" #: ../../library/hashlib.rst:402 msgid "Creating hash objects" @@ -541,39 +623,46 @@ msgid "New hash objects are created by calling constructor functions:" msgstr "" "新しいハッシュオブジェクトは、コンストラクタ関数を呼び出すことで生成されます:" -#: ../../library/hashlib.rst:418 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" +"これらの関数は、BLAKE2b または BLAKE2s を計算するための、対応するハッシュオブ" +"ジェクトを返します。\n" +"次の一般的な引数を任意に指定できます。" -#: ../../library/hashlib.rst:421 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" +"*data*: 最初にハッシュ計算に使うデータのチャンクで、:term:`bytes-like " +"object` でなければなりません。\n" +"位置引数としてのみ渡せます。" #: ../../library/hashlib.rst:424 msgid "*digest_size*: size of output digest in bytes." msgstr "*digest_size*: 出力するダイジェストのバイト数。" -#: ../../library/hashlib.rst:426 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" +"*key*: 鍵付きハッシュ化のための鍵 (BLAKE2b では最大 64 バイト、BLAKE2s では最" +"大 32 バイト)。" -#: ../../library/hashlib.rst:429 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" +"*salt*: ランダム化ハッシュ化のためのソルト (BLAKE2b では最大 16 バイト、" +"BLAKE2s では最大 8 バイト)。" -#: ../../library/hashlib.rst:432 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" +"*person*: パーソナライズ用の文字列 (BLAKE2b では最大 16 バイト、BLAKE2s では" +"最大 8 バイト)。" #: ../../library/hashlib.rst:435 msgid "The following table shows limits for general parameters (in bytes):" @@ -623,7 +712,6 @@ msgstr "32" msgid "8" msgstr "8" -#: ../../library/hashlib.rst:446 msgid "" "BLAKE2 specification defines constant lengths for salt and personalization " "parameters, however, for convenience, this implementation accepts byte " @@ -632,6 +720,11 @@ msgid "" "example, ``b'salt'`` and ``b'salt\\x00'`` is the same value. (This is not " "the case for *key*.)" msgstr "" +"BLAKE2 の仕様はソルトとパーソナライズ引数の長さを固定していますが、この実装で" +"は利便性のため、規定の長さまでの任意のサイズのバイト文字列を受け付けます。\n" +"引数の長さが規定より短ければゼロで埋めるため、例えば ``b'salt'`` と " +"``b'salt\\x00'`` は同じ値になります。\n" +"(*key* はこのようには扱いません。)" #: ../../library/hashlib.rst:453 msgid "These sizes are available as module `constants`_ described below." @@ -642,56 +735,63 @@ msgid "" "Constructor functions also accept the following tree hashing parameters:" msgstr "コンストラクタ関数は以下のツリーハッシングパラメタを受け付けます:" -#: ../../library/hashlib.rst:457 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" +"*fanout*: ファンアウト (0〜255。\n" +"無制限なら 0、逐次モードでは 1)。\n" -#: ../../library/hashlib.rst:459 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." msgstr "" -"*depth*: ツリーの深さの最大値(1から255までの値で、無制限であれば255、シーケ" -"ンスモードでは1)。" +"*depth*: ツリーの深さの最大値 (1〜255。\n" +"無制限なら 255、逐次モードでは 1)。\n" -#: ../../library/hashlib.rst:462 msgid "" "*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " "or in sequential mode)." msgstr "" +"*leaf_size*: 葉の最大バイト長 (0〜``2**32-1``。\n" +"無制限の場合や逐次モードでは 0)。\n" -#: ../../library/hashlib.rst:465 msgid "" "*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " "for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" +"*node_offset*: ノードのオフセット (BLAKE2b では 0〜``2**64-1``、BLAKE2s では " +"0〜``2**48-1``。\n" +"最初の、つまり最も左の葉や、逐次モードでは 0)。\n" -#: ../../library/hashlib.rst:468 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." msgstr "" +"*node_depth*: ノードの深さ (0〜255。\n" +"葉や逐次モードでは 0)。\n" -#: ../../library/hashlib.rst:470 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" +"*inner_size*: 内部ダイジェストのサイズ (BLAKE2b では 0〜64、BLAKE2s では 0〜" +"32。\n" +"逐次モードでは 0)。\n" -#: ../../library/hashlib.rst:473 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " "(``False`` for sequential mode)." msgstr "" +"*last_node*: 処理中のノードが最後のノードかどうかを示すブール値 (逐次モードで" +"は ``False``)。" -#: ../../library/hashlib.rst:476 msgid "Explanation of tree mode parameters." -msgstr "" +msgstr "ツリーモードのパラメータの説明。" -#: ../../library/hashlib.rst:480 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" +"ツリーハッシングの詳しい説明については、`BLAKE2 の仕様 `_ の 2.10 節を参照してください。" #: ../../library/hashlib.rst:486 msgid "Constants" @@ -701,10 +801,9 @@ msgstr "定数" msgid "Salt length (maximum length accepted by constructors)." msgstr "ソルト長(コンストラクタが受け付けれる最大長)" -#: ../../library/hashlib.rst:497 msgid "" "Personalization string length (maximum length accepted by constructors)." -msgstr "" +msgstr "パーソナライズ用の文字列の長さ (コンストラクタが受け付ける最大長)。" #: ../../library/hashlib.rst:503 msgid "Maximum key size." @@ -722,7 +821,6 @@ msgstr "使用例" msgid "Simple hashing" msgstr "簡単なハッシュ化" -#: ../../library/hashlib.rst:518 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" @@ -730,22 +828,27 @@ msgid "" "the object, and, finally, get the digest out of the object by calling :meth:" "`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." msgstr "" +"データのハッシュを計算するには、まず適切なコンストラクタ関数 (:func:" +"`blake2b` または :func:`blake2s`) でハッシュオブジェクトを作成します。\n" +"次にオブジェクトの :meth:`~hash.update` を呼び出してデータで更新し、最後に :" +"meth:`~hash.digest` (16 進数の文字列を得る場合は :meth:`~hash.hexdigest`) を" +"呼び出してダイジェストを取得します。" -#: ../../library/hashlib.rst:531 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" +"手順を短くするために、最初のデータのチャンクをコンストラクタに位置引数として" +"直接渡すこともできます。" -#: ../../library/hashlib.rst:538 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" +":meth:`hash.update` を必要な回数だけ呼び出して、ハッシュを順次更新できます。" -#: ../../library/hashlib.rst:552 msgid "Using different digest sizes" -msgstr "" +msgstr "異なるダイジェストサイズの使用" #: ../../library/hashlib.rst:554 msgid "" @@ -758,32 +861,37 @@ msgstr "" "BLAKE2bで置き換えるには、BLAKE2bに20バイトのダイジェストを生成するように指示" "できます:" -#: ../../library/hashlib.rst:568 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" +"ダイジェストサイズが異なるハッシュオブジェクトは、まったく異なる出力を生成し" +"ます (短いハッシュは長いハッシュの先頭部分では *ありません*)。\n" +"BLAKE2b と BLAKE2s は、出力の長さが同じでも異なる出力を生成します。" -#: ../../library/hashlib.rst:584 msgid "Keyed hashing" -msgstr "" +msgstr "鍵付きハッシュ化" -#: ../../library/hashlib.rst:586 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 can be securely used in prefix-MAC " "mode thanks to the indifferentiability property inherited from BLAKE." msgstr "" +"鍵付きハッシュ化は、`ハッシュベースのメッセージ認証コード `_ (HMAC) より高速で単純な代替手段として、認証に使え" +"ます。\n" +"BLAKE から受け継いだ強強強識別不可能性 (indifferentiability) により、BLAKE2 " +"は prefix-MAC モードで安全に使えます。" -#: ../../library/hashlib.rst:592 msgid "" "This example shows how to get a (hex-encoded) 128-bit authentication code " "for message ``b'message data'`` with key ``b'pseudorandom key'``::" msgstr "" +"この例では、鍵 ``b'pseudorandom key'`` を使って、メッセージ ``b'message " +"data'`` の 128 ビット認証コードを 16 進数形式で取得します。 ::" -#: ../../library/hashlib.rst:595 msgid "" ">>> from hashlib import blake2b\n" ">>> h = blake2b(key=b'pseudorandom key', digest_size=16)\n" @@ -791,14 +899,19 @@ msgid "" ">>> h.hexdigest()\n" "'3d363ff7401e02026f4a4687d4863ced'" msgstr "" +">>> from hashlib import blake2b\n" +">>> h = blake2b(key=b'pseudorandom key', digest_size=16)\n" +">>> h.update(b'message data')\n" +">>> h.hexdigest()\n" +"'3d363ff7401e02026f4a4687d4863ced'" -#: ../../library/hashlib.rst:602 msgid "" "As a practical example, a web application can symmetrically sign cookies " "sent to users and later verify them to make sure they weren't tampered with::" msgstr "" +"実用例として、ウェブアプリケーションがユーザーに送る Cookie に共通鍵で署名" +"し、後で検証して改ざんされていないことを確認できます。 ::" -#: ../../library/hashlib.rst:605 msgid "" ">>> from hashlib import blake2b\n" ">>> from hmac import compare_digest\n" @@ -826,14 +939,39 @@ msgid "" ">>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00')\n" "False" msgstr "" +">>> from hashlib import blake2b\n" +">>> from hmac import compare_digest\n" +">>>\n" +">>> SECRET_KEY = b'pseudorandomly generated server secret key'\n" +">>> AUTH_SIZE = 16\n" +">>>\n" +">>> def sign(cookie):\n" +"... h = blake2b(digest_size=AUTH_SIZE, key=SECRET_KEY)\n" +"... h.update(cookie)\n" +"... return h.hexdigest().encode('utf-8')\n" +">>>\n" +">>> def verify(cookie, sig):\n" +"... good_sig = sign(cookie)\n" +"... return compare_digest(good_sig, sig)\n" +">>>\n" +">>> cookie = b'user-alice'\n" +">>> sig = sign(cookie)\n" +">>> print(\"{0},{1}\".format(cookie.decode('utf-8'), sig))\n" +"user-alice,b'43b3c982cf697e0c5ab22172d1ca7421'\n" +">>> verify(cookie, sig)\n" +"True\n" +">>> verify(b'user-bob', sig)\n" +"False\n" +">>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00')\n" +"False" -#: ../../library/hashlib.rst:631 msgid "" "Even though there's a native keyed hashing mode, BLAKE2 can, of course, be " "used in HMAC construction with :mod:`hmac` module::" msgstr "" +"BLAKE2 には専用の鍵付きハッシュ化モードがありますが、もちろん :mod:`hmac` モ" +"ジュールを使って HMAC を構成することもできます。 ::" -#: ../../library/hashlib.rst:634 msgid "" ">>> import hmac, hashlib\n" ">>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)\n" @@ -841,19 +979,24 @@ msgid "" ">>> m.hexdigest()\n" "'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" msgstr "" +">>> import hmac, hashlib\n" +">>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)\n" +">>> m.update(b'message')\n" +">>> m.hexdigest()\n" +"'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" -#: ../../library/hashlib.rst:642 msgid "Randomized hashing" -msgstr "" +msgstr "ランダム化ハッシュ化" -#: ../../library/hashlib.rst:644 msgid "" "By setting *salt* parameter users can introduce randomization to the hash " "function. Randomized hashing is useful for protecting against collision " "attacks on the hash function used in digital signatures." msgstr "" +"*salt* 引数を設定すると、ハッシュ関数にランダム性を導入できます。\n" +"ランダム化ハッシュ化は、デジタル署名で使うハッシュ関数への衝突攻撃を防ぐのに" +"役立ちます。" -#: ../../library/hashlib.rst:648 msgid "" "Randomized hashing is designed for situations where one party, the message " "preparer, generates all or part of a message to be signed by a second party, " @@ -873,39 +1016,58 @@ msgid "" "hashing may reduce the amount of security provided by a digital signature " "when all portions of the message are prepared by the signer." msgstr "" +"ランダム化ハッシュ化は、メッセージ作成者がメッセージの全体または一部を作成" +"し、別の当事者である署名者が署名する状況を想定して設計されています。\n" +"作成者が暗号学的ハッシュ関数の衝突 (同じハッシュ値を生成する 2 つのメッセー" +"ジ) を見つけられる場合、同じハッシュ値とデジタル署名を生成しながら異なる結果" +"をもたらす、意味の通る複数のメッセージを用意できるかもしれません (例えば、口" +"座への送金額を 10 ドルではなく 100 万ドルにするなど)。\n" +"暗号学的ハッシュ関数は衝突耐性を主要な目標として設計されていますが、暗号学的" +"ハッシュ関数への攻撃が現在集中的に研究されているため、特定の関数の衝突耐性が" +"期待を下回る可能性があります。\n" +"ランダム化ハッシュ化は、ハッシュ関数の衝突を現実的に見つけられる場合でも、デ" +"ジタル署名の生成過程で最終的に同じハッシュ値になるメッセージを作成者が複数作" +"れる可能性を減らし、署名者をさらに保護します。\n" +"ただし、メッセージのすべてを署名者自身が作成する場合には、ランダム化ハッシュ" +"化の使用によりデジタル署名の安全性が下がることがあります。" -#: ../../library/hashlib.rst:667 msgid "" "(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" msgstr "" +"(`NIST SP-800-106「デジタル署名のためのランダム化ハッシュ化」 `_)" -#: ../../library/hashlib.rst:670 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" +"BLAKE2 では、ソルトを圧縮関数の毎回の入力としてではなく、初期化時にハッシュ関" +"数への一度だけの入力として処理します。" -#: ../../library/hashlib.rst:675 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " "passwords. See `BLAKE2 FAQ `_ for more " "information." msgstr "" +"BLAKE2 や SHA-256 などの汎用の暗号学的ハッシュ関数による *ソルト付きハッシュ" +"化* (あるいは単なるハッシュ化) は、パスワードのハッシュ化には適していませ" +"ん。\n" +"詳しくは `BLAKE2 FAQ `_ を参照してください。" -#: ../../library/hashlib.rst:698 msgid "Personalization" -msgstr "" +msgstr "パーソナライズ" -#: ../../library/hashlib.rst:700 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" +"同じ入力でも用途ごとに異なるダイジェストを生成するようにハッシュ関数を設定す" +"ると、役立つ場合があります。\n" +"Skein ハッシュ関数の作者は次のように述べています。" -#: ../../library/hashlib.rst:704 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -914,18 +1076,25 @@ msgid "" "force the application to make the hash inputs the same. Personalizing each " "hash function used in the protocol summarily stops this type of attack." msgstr "" +"すべてのアプリケーション設計者に、この方法を真剣に検討することを勧めます。\n" +"私たちは、プロトコルのある部分で計算したハッシュを、まったく別の部分で使えて" +"しまうプロトコルを数多く見てきました。\n" +"これは、2 つのハッシュ計算が似たデータや関連したデータに対して行われ、攻撃者" +"がアプリケーションに同じデータを入力させられるためです。\n" +"プロトコルで使う各ハッシュ関数をパーソナライズすれば、この種の攻撃を完全に防" +"げます。" -#: ../../library/hashlib.rst:711 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" +"(`The Skein Hash Function Family `_、21 ページ)" #: ../../library/hashlib.rst:715 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "BLAKE2は *person* 引数にバイト列を渡すことでパーソナライズできます::" -#: ../../library/hashlib.rst:717 msgid "" ">>> from hashlib import blake2b\n" ">>> FILES_HASH_PERSON = b'MyApp Files Hash'\n" @@ -939,12 +1108,24 @@ msgid "" ">>> h.hexdigest()\n" "'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" msgstr "" +">>> from hashlib import blake2b\n" +">>> FILES_HASH_PERSON = b'MyApp Files Hash'\n" +">>> BLOCK_HASH_PERSON = b'MyApp Block Hash'\n" +">>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4'\n" +">>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" -#: ../../library/hashlib.rst:729 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" +"パーソナライズと鍵付きモードを組み合わせることで、1 つの鍵から異なる鍵を導出" +"することもできます。" #: ../../library/hashlib.rst:743 msgid "Tree mode" @@ -954,12 +1135,14 @@ msgstr "ツリーモード" msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "これが二つの葉ノードからなる最小の木をハッシュする例です::" -#: ../../library/hashlib.rst:747 msgid "" " 10\n" " / \\\n" "00 01" msgstr "" +" 10\n" +" / \\\n" +"00 01" msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " @@ -968,7 +1151,6 @@ msgstr "" "この例では 64 バイトの内部ダイジェストを使い、32 バイトの最終ダイジェストを返" "します。 ::" -#: ../../library/hashlib.rst:754 msgid "" ">>> from hashlib import blake2b\n" ">>>\n" @@ -996,6 +1178,31 @@ msgid "" ">>> h10.hexdigest()\n" "'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" msgstr "" +">>> from hashlib import blake2b\n" +">>>\n" +">>> FANOUT = 2\n" +">>> DEPTH = 2\n" +">>> LEAF_SIZE = 4096\n" +">>> INNER_SIZE = 64\n" +">>>\n" +">>> buf = bytearray(6000)\n" +">>>\n" +">>> # 左の葉\n" +"... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=0, last_node=False)\n" +">>> # 右の葉\n" +"... h01 = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=1, node_depth=0, last_node=True)\n" +">>> # 根ノード\n" +"... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=1, last_node=True)\n" +">>> h10.update(h00.digest())\n" +">>> h10.update(h01.digest())\n" +">>> h10.hexdigest()\n" +"'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" #: ../../library/hashlib.rst:781 msgid "Credits" @@ -1046,26 +1253,33 @@ msgstr "" "以下の public domain dedicationが、Cのハッシュ関数実装と、拡張コードと、この" "ドキュメントに適用されます:" -#: ../../library/hashlib.rst:799 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" +"法律上可能な範囲で、著作者は、このソフトウェアに関するすべての著作権および関" +"連する権利・著作隣接権を、世界中でパブリックドメインに提供しています。\n" +"このソフトウェアは、いかなる保証もなく配布されています。" -#: ../../library/hashlib.rst:803 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" +"このソフトウェアには CC0 Public Domain Dedication のコピーが同梱されているは" +"ずです。\n" +"ない場合は https://creativecommons.org/publicdomain/zero/1.0/ を参照してくだ" +"さい。" -#: ../../library/hashlib.rst:807 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" +"以下の人々は開発を支援し、または Creative Commons Public Domain Dedication " +"1.0 Universal に従って、変更内容をプロジェクトおよびパブリックドメインに提供" +"しました。" #: ../../library/hashlib.rst:811 msgid "*Alexandr Sokolovskiy*" @@ -1088,33 +1302,27 @@ msgid "Another way to encode binary hashes for non-binary environments." msgstr "" "バイナリハッシュを非バイナリ環境用にエンコードするもうひとつの方法です。" -#: ../../library/hashlib.rst:838 msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" -msgstr "" +msgstr "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" -#: ../../library/hashlib.rst:839 msgid "The FIPS 180-4 publication on Secure Hash Algorithms." -msgstr "" +msgstr "セキュアハッシュアルゴリズムに関する FIPS 180-4 の刊行物。" -#: ../../library/hashlib.rst:841 msgid "https://csrc.nist.gov/pubs/fips/202/final" -msgstr "" +msgstr "https://csrc.nist.gov/pubs/fips/202/final" -#: ../../library/hashlib.rst:842 msgid "The FIPS 202 publication on the SHA-3 Standard." -msgstr "" +msgstr "SHA-3 標準に関する FIPS 202 の刊行物。" -#: ../../library/hashlib.rst:844 msgid "https://www.blake2.net/" -msgstr "" +msgstr "https://www.blake2.net/" #: ../../library/hashlib.rst:845 msgid "Official BLAKE2 website." msgstr "BLAKE2 の公式ウェブサイト" -#: ../../library/hashlib.rst:847 msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" -msgstr "" +msgstr "https://en.wikipedia.org/wiki/Cryptographic_hash_function" #: ../../library/hashlib.rst:848 msgid "" @@ -1128,9 +1336,8 @@ msgstr "" msgid "https://www.ietf.org/rfc/rfc8018.txt" msgstr "https://www.ietf.org/rfc/rfc8018.txt" -#: ../../library/hashlib.rst:852 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" -msgstr "" +msgstr "PKCS #5: パスワードに基づく暗号仕様 バージョン 2.1" #: ../../library/hashlib.rst:854 msgid "" @@ -1138,28 +1345,25 @@ msgid "" msgstr "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" -#: ../../library/hashlib.rst:855 msgid "NIST Recommendation for Password-Based Key Derivation." -msgstr "" +msgstr "パスワードに基づく鍵導出についての NIST の推奨事項。" -#: ../../library/hashlib.rst:9 msgid "message digest, MD5" -msgstr "" +msgstr "メッセージダイジェスト、MD5" -#: ../../library/hashlib.rst:9 msgid "" "secure hash algorithm, SHA1, SHA2, SHA224, SHA256, SHA384, SHA512, SHA3, " "Shake, Blake2" msgstr "" +"セキュアハッシュアルゴリズム、SHA1、SHA2、SHA224、SHA256、SHA384、SHA512、" +"SHA3、Shake、Blake2" #: ../../library/hashlib.rst:50 msgid "OpenSSL" msgstr "OpenSSL" -#: ../../library/hashlib.rst:50 msgid "(use in module hashlib)" -msgstr "" +msgstr "(hashlib モジュールでの使用)" -#: ../../library/hashlib.rst:382 msgid "blake2b, blake2s" -msgstr "" +msgstr "blake2b, blake2s" diff --git a/library/heapq.po b/library/heapq.po index 5e7947087..aa41ee046 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -38,14 +38,14 @@ msgstr "" "このモジュールではヒープキューアルゴリズムの一実装を提供しています。優先度" "キューアルゴリズムとしても知られています。" -#: ../../library/heapq.rst:14 msgid "" "Min-heaps are binary trees for which every parent node has a value less than " "or equal to any of its children. We refer to this condition as the heap " "invariant." msgstr "" +"最小ヒープは、各親ノードの値がそのどの子ノードの値以下でもある二分木です。\n" +"この条件をヒープ不変式と呼びます。" -#: ../../library/heapq.rst:18 msgid "" "For min-heaps, this implementation uses lists for which ``heap[k] <= " "heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]`` for all *k* for which the " @@ -53,6 +53,11 @@ msgid "" "property of a min-heap is that its smallest element is always the root, " "``heap[0]``." msgstr "" +"この実装では最小ヒープをリストで表し、比較する要素が存在するすべての *k* につ" +"いて ``heap[k] <= heap[2*k+1]`` および ``heap[k] <= heap[2*k+2]`` が成り立ち" +"ます。\n" +"要素は 0 から数えます。\n" +"最小ヒープの興味深い性質は、最小の要素が常に根の ``heap[0]`` にあることです。" #: ../../library/heapq.rst:24 msgid "" @@ -64,7 +69,6 @@ msgid "" "max-heap invariant." msgstr "" -#: ../../library/heapq.rst:31 msgid "" "The :mod:`!heapq` API differs from textbook heap algorithms in two aspects: " "(a) We use zero-based indexing. This makes the relationship between the " @@ -74,53 +78,71 @@ msgid "" "implementation favors min-heaps as they better correspond to Python :class:" "`lists `." msgstr "" +":mod:`!heapq` の API は、教科書に載っているヒープアルゴリズムと 2 つの点で異" +"なります。\n" +"(a) インデックスを 0 から数えます。\n" +"これにより、あるノードのインデックスとその子のインデックスの関係がやや分かり" +"にくくなりますが、Python のインデックスは 0 から始まるため、この方が適してい" +"ます。\n" +"(b) 教科書では、その場でのソートに適した最大ヒープを中心に扱うことがよくあり" +"ます。\n" +"この実装では Python の :class:`リスト ` によりよく対応する最小ヒープを" +"中心に扱います。" -#: ../../library/heapq.rst:38 msgid "" "These two aspects make it possible to view the heap as a regular Python list " "without surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` " "maintains the heap invariant!" msgstr "" +"この 2 つの特徴により、ヒープを通常の Python リストとして自然に扱えます。\n" +"``heap[0]`` が最小の要素で、``heap.sort()`` を実行してもヒープ不変式が保たれ" +"ます!" -#: ../../library/heapq.rst:42 msgid "" "Like :meth:`list.sort`, this implementation uses only the ``<`` operator for " "comparisons, for both min-heaps and max-heaps." msgstr "" +":meth:`list.sort` と同様、この実装では最小ヒープと最大ヒープのどちらでも、比" +"較に ``<`` 演算子だけを使います。" -#: ../../library/heapq.rst:45 msgid "" "In the API below, and in this documentation, the unqualified term *heap* " "generally refers to a min-heap. The API for max-heaps is named using a " "``_max`` suffix." msgstr "" +"以下の API とこのドキュメントでは、単に *ヒープ* と呼ぶ場合は一般に最小ヒープ" +"を指します。\n" +"最大ヒープの API の名前には ``_max`` 接尾辞が付いています。" -#: ../../library/heapq.rst:49 msgid "" "To create a heap, use a list initialized as ``[]``, or transform an existing " "list into a min-heap or max-heap using the :func:`heapify` or :func:" "`heapify_max` functions, respectively." msgstr "" +"ヒープを作るには、``[]`` で初期化したリストを使うか、既存のリストを :func:" +"`heapify` または :func:`heapify_max` 関数でそれぞれ最小ヒープまたは最大ヒープ" +"に変換します。" -#: ../../library/heapq.rst:53 msgid "The following functions are provided for min-heaps:" -msgstr "" +msgstr "最小ヒープには次の関数が用意されています。" -#: ../../library/heapq.rst:58 msgid "Transform list *x* into a min-heap, in-place, in linear time." msgstr "" +"リスト *x* をその場で最小ヒープに変換します。\n" +"処理時間は要素数に比例します。" -#: ../../library/heapq.rst:63 msgid "" "Push the value *item* onto the *heap*, maintaining the min-heap invariant." -msgstr "" +msgstr "最小ヒープの不変式を保ちながら、値 *item* を *heap* に追加します。" -#: ../../library/heapq.rst:68 msgid "" "Pop and return the smallest item from the *heap*, maintaining the min-heap " "invariant. If the heap is empty, :exc:`IndexError` is raised. To access " "the smallest item without popping it, use ``heap[0]``." msgstr "" +"最小ヒープの不変式を保ちながら、*heap* の最小の要素を取り出して返します。\n" +"ヒープが空の場合は :exc:`IndexError` を送出します。\n" +"最小の要素を削除せずに参照するには ``heap[0]`` を使ってください。" msgid "" "Push *item* on the heap, then pop and return the smallest item from the " @@ -140,16 +162,16 @@ msgstr "" "*heap* から最小の要素を pop して返し、新たに *item* を push します。ヒープの" "サイズは変更されません。ヒープが空の場合、 :exc:`IndexError` が送出されます。" -#: ../../library/heapq.rst:85 msgid "" "This one step operation is more efficient than a :func:`heappop` followed " "by :func:`heappush` and can be more appropriate when using a fixed-size " "heap. The pop/push combination always returns an element from the heap and " "replaces it with *item*." msgstr "" -"この一息の演算は :func:`heappop` に次いで :func:`heappush` を送出するよりも効" -"率的で、固定サイズのヒープを用いている場合にはより適しています。 pop/push の" -"組み合わせは必ずヒープから要素を一つ返し、それを *item* と置き換えます。" +"この 1 回の操作は、:func:`heappop` に続けて :func:`heappush` を呼び出すより効" +"率的で、固定サイズのヒープを使う場合により適していることがあります。\n" +"pop/push の組み合わせは常にヒープから要素を返し、その要素を *item* で置き換え" +"ます。" #: ../../library/heapq.rst:90 msgid "" @@ -162,46 +184,57 @@ msgstr "" "なら、代わりに :func:`heappushpop` を使うことを考えてください。この push/pop " "の組み合わせは二つの値の小さい方を返し、大きい方の値をヒープに残します。" -#: ../../library/heapq.rst:96 msgid "For max-heaps, the following functions are provided:" -msgstr "" +msgstr "最大ヒープには次の関数が用意されています。" -#: ../../library/heapq.rst:101 msgid "Transform list *x* into a max-heap, in-place, in linear time." msgstr "" +"リスト *x* をその場で最大ヒープに変換します。\n" +"処理時間は要素数に比例します。" -#: ../../library/heapq.rst:108 msgid "" "Push the value *item* onto the max-heap *heap*, maintaining the max-heap " "invariant." msgstr "" +"最大ヒープの不変式を保ちながら、値 *item* を最大ヒープ *heap* に追加します。" -#: ../../library/heapq.rst:116 msgid "" "Pop and return the largest item from the max-heap *heap*, maintaining the " "max-heap invariant. If the max-heap is empty, :exc:`IndexError` is raised. " "To access the largest item without popping it, use ``maxheap[0]``." msgstr "" +"最大ヒープの不変式を保ちながら、最大ヒープ *heap* の最大の要素を取り出して返" +"します。\n" +"最大ヒープが空の場合は :exc:`IndexError` を送出します。\n" +"最大の要素を削除せずに参照するには ``maxheap[0]`` を使ってください。" -#: ../../library/heapq.rst:125 msgid "" "Push *item* on the max-heap *heap*, then pop and return the largest item " "from *heap*. The combined action runs more efficiently than :func:" "`heappush_max` followed by a separate call to :func:`heappop_max`." msgstr "" +"*item* を最大ヒープ *heap* に追加し、その後で *heap* の最大の要素を取り出して" +"返します。\n" +"この操作は、:func:`heappush_max` に続けて :func:`heappop_max` を個別に呼び出" +"すより効率的です。" -#: ../../library/heapq.rst:135 msgid "" "Pop and return the largest item from the max-heap *heap* and also push the " "new *item*. The max-heap size doesn't change. If the max-heap is empty, :exc:" "`IndexError` is raised." msgstr "" +"最大ヒープ *heap* の最大の要素を取り出して返すとともに、新たに *item* を追加" +"します。\n" +"最大ヒープのサイズは変わりません。\n" +"最大ヒープが空の場合は :exc:`IndexError` を送出します。" -#: ../../library/heapq.rst:140 msgid "" "The value returned may be smaller than the *item* added. Refer to the " "analogous function :func:`heapreplace` for detailed usage notes." msgstr "" +"返される値は、追加した *item* より小さい場合があります。\n" +"詳しい使い方の注意点については、対応する関数 :func:`heapreplace` を参照してく" +"ださい。" #: ../../library/heapq.rst:146 msgid "The module also offers three general purpose functions based on heaps." @@ -312,7 +345,6 @@ msgstr "" "ソート `_ を実装できます::" -#: ../../library/heapq.rst:205 msgid "" ">>> def heapsort(iterable):\n" "... h = []\n" @@ -323,6 +355,14 @@ msgid "" ">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" msgstr "" +">>> def heapsort(iterable):\n" +"... h = []\n" +"... for value in iterable:\n" +"... heappush(h, value)\n" +"... return [heappop(h) for i in range(len(h))]\n" +"...\n" +">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" #: ../../library/heapq.rst:214 msgid "" @@ -340,7 +380,6 @@ msgstr "" "ヒープの要素はタプルに出来ます。これは、追跡される主レコードとは別に (タスク" "の優先度のような) 比較値を指定するときに便利です::" -#: ../../library/heapq.rst:220 msgid "" ">>> h = []\n" ">>> heappush(h, (5, 'write code'))\n" @@ -350,12 +389,17 @@ msgid "" ">>> heappop(h)\n" "(1, 'write spec')" msgstr "" +">>> h = []\n" +">>> heappush(h, (5, 'write code'))\n" +">>> heappush(h, (7, 'release product'))\n" +">>> heappush(h, (1, 'write spec'))\n" +">>> heappush(h, (3, 'create tests'))\n" +">>> heappop(h)\n" +"(1, 'write spec')" -#: ../../library/heapq.rst:230 msgid "Other Applications" -msgstr "" +msgstr "その他の用途" -#: ../../library/heapq.rst:232 msgid "" "`Medians `_ are a measure of central " "tendency for a set of numbers. In distributions skewed by outliers, the " @@ -363,8 +407,13 @@ msgid "" "running median is an `online algorithm `_ that updates continuously as new data arrives." msgstr "" +"`中央値 `_ は、数値の集まりの中心傾向を" +"表す指標です。\n" +"外れ値によって歪んだ分布では、中央値は平均値 (算術平均) より安定した推定値に" +"なります。\n" +"逐次中央値は、新しいデータが届くたびに中央値を更新する `オンラインアルゴリズ" +"ム `_ です。" -#: ../../library/heapq.rst:239 msgid "" "A running median can be efficiently implemented by balancing two heaps, a " "max-heap for values at or below the midpoint and a min-heap for values above " @@ -372,8 +421,13 @@ msgid "" "average of the tops of the two heaps; otherwise, the median is at the top of " "the larger heap::" msgstr "" +"逐次中央値は、中央値以下の値を保持する最大ヒープと、中央値より大きな値を保持" +"する最小ヒープという 2 つのヒープのサイズを釣り合わせることで効率的に実装でき" +"ます。\n" +"2 つのヒープのサイズが同じなら、新しい中央値は両ヒープの先頭の値の平均になり" +"ます。\n" +"そうでなければ、大きい方のヒープの先頭の値が中央値になります。 ::" -#: ../../library/heapq.rst:245 msgid "" "def running_median(iterable):\n" " \"Yields the cumulative median of values seen so far.\"\n" @@ -389,16 +443,30 @@ msgid "" " heappush(hi, heappushpop_max(lo, x))\n" " yield (lo[0] + hi[0]) / 2" msgstr "" +"def running_median(iterable):\n" +" \"それまでに得られた値全体の中央値を yield します。\"\n" +"\n" +" lo = [] # 最大ヒープ\n" +" hi = [] # 最小ヒープ (lo と同じサイズか、1 つ小さいサイズ)\n" +"\n" +" for x in iterable:\n" +" if len(lo) == len(hi):\n" +" heappush_max(lo, heappushpop(hi, x))\n" +" yield lo[0]\n" +" else:\n" +" heappush(hi, heappushpop_max(lo, x))\n" +" yield (lo[0] + hi[0]) / 2" #: ../../library/heapq.rst:259 msgid "For example::" msgstr "例えば::" -#: ../../library/heapq.rst:261 msgid "" ">>> list(running_median([5.0, 9.0, 4.0, 12.0, 8.0, 9.0]))\n" "[5.0, 7.0, 5.0, 7.0, 8.0, 8.5]" msgstr "" +">>> list(running_median([5.0, 9.0, 4.0, 12.0, 8.0, 9.0]))\n" +"[5.0, 7.0, 5.0, 7.0, 8.0, 8.5]" #: ../../library/heapq.rst:266 msgid "Priority Queue Implementation Notes" @@ -437,13 +505,12 @@ msgstr "" "あるタスクの優先度が変化したら、どうやってそれをヒープの新しい位置に移動させ" "るのでしょうか?" -#: ../../library/heapq.rst:280 msgid "" "Or if a pending task needs to be deleted, how do you find it and remove it " "from the queue?" msgstr "" -"未解決のタスクが削除される必要があるとき、どのようにそれをキューから探して削" -"除するのでしょうか?" +"処理待ちのタスクを削除する必要がある場合、キュー内でどのように見つけて削除す" +"ればよいでしょうか?" #: ../../library/heapq.rst:283 msgid "" @@ -468,7 +535,6 @@ msgstr "" "比較できないタスク問題のもう一つの解決法は、タスクアイテムを無視して優先順序" "フィールドだけで比較するラッパークラスです::" -#: ../../library/heapq.rst:292 msgid "" "from dataclasses import dataclass, field\n" "from typing import Any\n" @@ -478,16 +544,22 @@ msgid "" " priority: int\n" " item: Any=field(compare=False)" msgstr "" +"from dataclasses import dataclass, field\n" +"from typing import Any\n" +"\n" +"@dataclass(order=True)\n" +"class PrioritizedItem:\n" +" priority: int\n" +" item: Any=field(compare=False)" -#: ../../library/heapq.rst:300 msgid "" "The remaining challenges revolve around finding a pending task and making " "changes to its priority or removing it entirely. Finding a task can be done " "with a dictionary pointing to an entry in the queue." msgstr "" -"残りの困難は主に、未解決のタスクを探して、その優先度を変更したり、完全に削除" -"することです。タスクを探すことは、キュー内の項目を指し示す辞書によってなされ" -"ます。" +"残る課題は、処理待ちのタスクを見つけて優先度を変更したり、完全に削除したりす" +"ることです。\n" +"キュー内の項目を参照する辞書を使えば、タスクを見つけられます。" #: ../../library/heapq.rst:304 msgid "" @@ -499,7 +571,6 @@ msgstr "" "るので、もっと難しいです。ですから、可能な解決策は、その項目が無効であるもの" "としてマークし、必要なら変更された優先度の項目を加えることです::" -#: ../../library/heapq.rst:308 msgid "" "pq = [] # list of entries arranged in a heap\n" "entry_finder = {} # mapping of tasks to entries\n" @@ -529,6 +600,37 @@ msgid "" " return task\n" " raise KeyError('pop from an empty priority queue')" msgstr "" +"pq = [] # 項目をヒープ順に並べたリスト\n" +"entry_finder = {} # タスクから項目へのマッピング\n" +"REMOVED = '' # 削除したタスクのプレースホルダー\n" +"counter = itertools.count() # 重複しない連番\n" +"\n" +"def add_task(task, priority=0):\n" +" '新しいタスクを追加するか、既存のタスクの優先度を更新します'\n" +" if task in entry_finder:\n" +" remove_task(task)\n" +" count = next(counter)\n" +" entry = [priority, count, task]\n" +" entry_finder[task] = entry\n" +" heappush(pq, entry)\n" +"\n" +"def remove_task(task):\n" +" \"\"\"既存のタスクを REMOVED とマークします。\n" +" 見つからない場合は KeyError を送出します。\n" +" \"\"\"\n" +" entry = entry_finder.pop(task)\n" +" entry[-1] = REMOVED\n" +"\n" +"def pop_task():\n" +" \"\"\"優先度の値が最小のタスクを削除して返します。\n" +" 空の場合は KeyError を送出します。\n" +" \"\"\"\n" +" while pq:\n" +" priority, count, task = heappop(pq)\n" +" if task is not REMOVED:\n" +" del entry_finder[task]\n" +" return task\n" +" raise KeyError('pop from an empty priority queue')" #: ../../library/heapq.rst:338 msgid "Theory" @@ -546,15 +648,16 @@ msgstr "" "い要素を無限大と考えます。ヒープの興味深い属性は ``a[0]`` が常に最小の要素に" "なることです。" -#: ../../library/heapq.rst:345 msgid "" "The strange invariant above is meant to be an efficient memory " "representation for a tournament. The numbers below are *k*, not ``a[k]``:" msgstr "" +"上の一風変わった不変式は、勝ち抜き戦をメモリ上で効率的に表すためのもので" +"す。\n" +"下の数値は ``a[k]`` ではなく *k* です。" -#: ../../library/heapq.rst:348 msgid "Example (min-heap) binary tree." -msgstr "" +msgstr "二分木 (最小ヒープ) の例。" msgid "" "In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a " diff --git a/library/hmac.po b/library/hmac.po index fe9aa84b2..18d52b0bc 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -30,15 +30,19 @@ msgstr ":mod:`!hmac` --- メッセージ認証のための鍵付きハッシュ msgid "**Source code:** :source:`Lib/hmac.py`" msgstr "**ソースコード:** :source:`Lib/hmac.py`" -#: ../../library/hmac.rst:11 msgid "" "This module implements the HMAC algorithm as described by :rfc:`2104`. The " "interface allows to use any hash function with a *fixed* digest size. In " "particular, extendable output functions such as SHAKE-128 or SHAKE-256 " "cannot be used with HMAC." msgstr "" +"このモジュールは :rfc:`2104` で記述された HMAC アルゴリズムを実装していま" +"す。\n" +"このインターフェースでは、ダイジェストのサイズが *固定* された任意のハッシュ" +"関数を使えます。\n" +"特に、SHAKE-128 や SHAKE-256 などの出力長を拡張できる関数は HMAC では使えませ" +"ん。" -#: ../../library/hmac.rst:19 msgid "" "Return a new hmac object. *key* is a bytes or bytearray object giving the " "secret key. If *msg* is present, the method call ``update(msg)`` is made. " @@ -46,6 +50,13 @@ msgid "" "object to use. It may be any name suitable to :func:`hashlib.new`. Despite " "its argument position, it is required." msgstr "" +"新しい hmac オブジェクトを返します。\n" +"*key* は秘密鍵を指定する bytes または bytearray オブジェクトです。\n" +"*msg* が指定されていれば、メソッド ``update(msg)`` を呼び出します。\n" +"*digestmod* は HMAC オブジェクトで使うダイジェストの名前、コンストラクタ、ま" +"たはモジュールです。\n" +"名前には :func:`hashlib.new` に指定できるものを使えます。\n" +"引数の位置にかかわらず、指定は必須です。" #: ../../library/hmac.rst:25 msgid "" @@ -57,13 +68,14 @@ msgstr "" "数 *msg* に :mod:`hashlib` がサポートする全てのタイプを渡せるようになりまし" "た。引数 *digestmod* にハッシュアルゴリズム名を渡せるようになりました。" -#: ../../library/hmac.rst:30 msgid "" "The *digestmod* argument is now required. Pass it as a keyword argument to " "avoid awkwardness when you do not have an initial *msg*." msgstr "" +"*digestmod* 引数の指定が必須になりました。\n" +"初期値の *msg* がない場合は、呼び出しが煩雑になるのを避けるためにキーワード引" +"数として渡してください。" -#: ../../library/hmac.rst:37 msgid "" "Return digest of *msg* for given secret *key* and *digest*. The function is " "equivalent to ``HMAC(key, msg, digest).digest()``, but uses an optimized C " @@ -71,11 +83,12 @@ msgid "" "The parameters *key*, *msg*, and *digest* have the same meaning as in :func:" "`~hmac.new`." msgstr "" -"与えられたsecret *key* と *digest* の *msg* のダイジェストを返します。この関" -"数は ``HMAC(key, msg, digest).digest()`` に似ていますが、最適化されたCやイン" -"ラインの実装を使用しており、メモリに収まるメッセージに対しては高速です。パラ" -"メータ *key* 、 *msg* 、および *digest* は、 :func:`~hmac.new` と同じ意味を持" -"ちます。" +"指定された秘密鍵 *key* と *digest* を使って *msg* のダイジェストを返しま" +"す。\n" +"この関数は ``HMAC(key, msg, digest).digest()`` と同等ですが、最適化された C " +"の実装またはインライン実装を使うため、メモリに収まるメッセージではより高速で" +"す。\n" +"引数 *key*、*msg*、*digest* の意味は :func:`~hmac.new` と同じです。" msgid "" "CPython implementation detail, the optimized C implementation is only used " @@ -117,13 +130,15 @@ msgstr "" "*digest_size* と同じです。\n" "NUL バイトを含め、非 ASCII のバイトが含まれることがあります。" -#: ../../library/hmac.rst:73 msgid "" "When comparing the output of :meth:`digest` to an externally supplied digest " "during a verification routine, it is recommended to use the :func:" "`compare_digest` function instead of the ``==`` operator to reduce the " "vulnerability to timing attacks." msgstr "" +"検証処理で :meth:`digest` の出力を外部から与えられたダイジェストと比較すると" +"きは、タイミング攻撃に対する脆弱性を軽減するため、\n" +"``==`` 演算子の代わりに :func:`compare_digest` 関数を使うことを推奨します。" #: ../../library/hmac.rst:81 msgid "" @@ -134,13 +149,15 @@ msgstr "" ":meth:`digest` と似ていますが、返される文字列は倍の長さとなり、16進形式となり" "ます。これは、電子メールなどの非バイナリ環境で値を交換する場合に便利です。" -#: ../../library/hmac.rst:87 msgid "" "When comparing the output of :meth:`hexdigest` to an externally supplied " "digest during a verification routine, it is recommended to use the :func:" "`compare_digest` function instead of the ``==`` operator to reduce the " "vulnerability to timing attacks." msgstr "" +"検証処理で :meth:`hexdigest` の出力を外部から与えられたダイジェストと比較する" +"ときは、タイミング攻撃に対する脆弱性を軽減するため、\n" +"``==`` 演算子の代わりに :func:`compare_digest` 関数を使うことを推奨します。" #: ../../library/hmac.rst:95 msgid "" @@ -168,11 +185,12 @@ msgstr "内部で使われるハッシュアルゴリズムのブロックのバ msgid "The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``." msgstr "このHMAC の正規名で、例えば ``hmac-md5`` のように常に小文字です。" -#: ../../library/hmac.rst:118 msgid "" "Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, " "and ``HMAC.outer``." msgstr "" +"ドキュメントに記載されていなかった属性 ``HMAC.digest_cons``、``HMAC.inner``、" +"``HMAC.outer`` を削除しました。" #: ../../library/hmac.rst:122 msgid "This module also provides the following helper function:" @@ -201,10 +219,11 @@ msgstr "" "よって *a* と *b* の型や長さに関する情報が漏れる可能性がありますが、値は漏れ" "ません。" -#: ../../library/hmac.rst:142 msgid "" "The function uses OpenSSL's ``CRYPTO_memcmp()`` internally when available." msgstr "" +"OpenSSL の ``CRYPTO_memcmp()`` が利用可能な場合、この関数は内部でそれを使いま" +"す。" #: ../../library/hmac.rst:148 msgid "Module :mod:`hashlib`" diff --git a/library/html.parser.po b/library/html.parser.po index cd746a1e0..f4621c59c 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -44,19 +44,22 @@ msgstr "" msgid "Create a parser instance able to parse invalid markup." msgstr "不正なマークアップをパースできるパーサーインスタンスを作成します。" -#: ../../library/html.parser.rst:22 msgid "" "If *convert_charrefs* is true (the default), all character references " "(except the ones in elements like ``script`` and ``style``) are " "automatically converted to the corresponding Unicode characters." msgstr "" +"*convert_charrefs* が真 (デフォルト) の場合、``script`` や ``style`` などの要" +"素内を除くすべての文字参照を、対応する Unicode 文字に自動で変換します。" -#: ../../library/html.parser.rst:26 msgid "" "If *scripting* is false (the default), the content of the ``noscript`` " "element is parsed normally; if it's true, it's returned as is without being " "parsed." msgstr "" +"*scripting* が偽 (デフォルト) の場合、``noscript`` 要素の内容を通常どおり解析" +"します。\n" +"真の場合は解析せずにそのまま返します。" msgid "" "An :class:`.HTMLParser` instance is fed HTML data and calls handler methods " @@ -88,22 +91,21 @@ msgstr "キーワード引数 *convert_charrefs* を追加。" msgid "The default value for argument *convert_charrefs* is now ``True``." msgstr "*convert_charrefs* のデフォルト値は ``True`` になりました。" -#: ../../library/html.parser.rst:44 msgid "Added the *scripting* parameter." -msgstr "" +msgstr "*scripting* 引数を追加しました。" #: ../../library/html.parser.rst:49 msgid "Example HTML Parser Application" msgstr "HTML パーサーアプリケーションの例" -#: ../../library/html.parser.rst:51 msgid "" "As a basic example, below is a simple HTML parser that uses the :class:" "`HTMLParser` class to print out start tags, end tags, and data as they are " "encountered:" msgstr "" +"基本的な例として、以下は :class:`HTMLParser` クラスを使い、開始タグ、終了タ" +"グ、データを見つけるたびに表示するシンプルな HTML パーサーです。" -#: ../../library/html.parser.rst:55 msgid "" "from html.parser import HTMLParser\n" "\n" @@ -121,12 +123,26 @@ msgid "" "parser.feed('Test'\n" " '

Parse me!

')" msgstr "" +"from html.parser import HTMLParser\n" +"\n" +"class MyHTMLParser(HTMLParser):\n" +" def handle_starttag(self, tag, attrs):\n" +" print(\"Encountered a start tag:\", tag)\n" +"\n" +" def handle_endtag(self, tag):\n" +" print(\"Encountered an end tag :\", tag)\n" +"\n" +" def handle_data(self, data):\n" +" print(\"Encountered some data :\", data)\n" +"\n" +"parser = MyHTMLParser()\n" +"parser.feed('Test'\n" +" '

Parse me!

')" #: ../../library/html.parser.rst:73 msgid "The output will then be:" msgstr "出力は以下のようになります:" -#: ../../library/html.parser.rst:75 msgid "" "Encountered a start tag: html\n" "Encountered a start tag: head\n" @@ -141,6 +157,18 @@ msgid "" "Encountered an end tag : body\n" "Encountered an end tag : html" msgstr "" +"Encountered a start tag: html\n" +"Encountered a start tag: head\n" +"Encountered a start tag: title\n" +"Encountered some data : Test\n" +"Encountered an end tag : title\n" +"Encountered an end tag : head\n" +"Encountered a start tag: body\n" +"Encountered a start tag: h1\n" +"Encountered some data : Parse me!\n" +"Encountered an end tag : h1\n" +"Encountered an end tag : body\n" +"Encountered an end tag : html" #: ../../library/html.parser.rst:92 msgid ":class:`.HTMLParser` Methods" @@ -185,17 +213,16 @@ msgstr "" msgid "Return current line number and offset." msgstr "現在の行番号およびオフセット値を返します。" -#: ../../library/html.parser.rst:125 msgid "" "Return the text of the most recently opened start tag. This should not " "normally be needed for structured processing, but may be useful in dealing " "with HTML \"as deployed\" or for re-generating input with minimal changes " "(whitespace between attributes can be preserved, etc.)." msgstr "" -"最も最近開かれた開始タグのテキスト部分を返します。このテキストは必ずしも元" -"データを構造化する上で必須ではありませんが、 \"広く知られている (as " -"deployed)\" HTML を扱ったり、入力を最小限の変更で再生成 (属性間の空白をそのま" -"まにする、など) したりする場合に便利なことがあります。" +"最後に読み込んだ開始タグのテキストを返します。\n" +"構造に基づく処理では通常は不要ですが、実際に使われている HTML を扱ったり、入" +"力を最小限の変更で再生成したりする場合に役立つことがあります (属性間の空白な" +"どを保持できます)。" #: ../../library/html.parser.rst:131 msgid "" @@ -216,7 +243,6 @@ msgstr "" "このメソッドは要素の開始タグを扱うために呼び出されます (例: ``
``)。" -#: ../../library/html.parser.rst:140 msgid "" "The *tag* argument is the name of the tag converted to lower case. The " "*attrs* argument is a list of ``(name, value)`` pairs containing the " @@ -225,6 +251,12 @@ msgid "" "character and entity references have been replaced. For empty attributes, " "*value* is ``None``." msgstr "" +"*tag* 引数は、小文字に変換したタグの名前です。\n" +"*attrs* 引数は、タグの ``<>`` 内にある属性を表す ``(name, value)`` ペアのリス" +"トです。\n" +"*name* は小文字に変換され、*value* を囲む引用符は削除され、文字参照と実体参照" +"は置換されています。\n" +"値のない属性では *value* は ``None`` です。" #: ../../library/html.parser.rst:146 msgid "" @@ -266,20 +298,23 @@ msgstr "" "合にこのメソッドをサブクラスで上書きすることができます; 既定の実装では、単" "に :meth:`handle_starttag` および :meth:`handle_endtag` を呼び出します。" -#: ../../library/html.parser.rst:170 msgid "" "This method is called to process arbitrary data (e.g. text nodes and the " "content of elements like ``script`` and ``style``)." msgstr "" +"このメソッドは、任意のデータ (テキストノードや ``script``、``style`` などの要" +"素の内容) を処理するために呼び出されます。" -#: ../../library/html.parser.rst:176 msgid "" "This method is called to process a named character reference of the form " "``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. " "``'gt'``). This method is only called if *convert_charrefs* is false." msgstr "" +"このメソッドは、``&name;`` 形式の名前付き文字参照 (``>`` など) を処理する" +"ために呼び出されます。\n" +"*name* は一般実体参照 (``'gt'`` など) です。\n" +"このメソッドは *convert_charrefs* が偽の場合にだけ呼び出されます。" -#: ../../library/html.parser.rst:184 msgid "" "This method is called to process decimal and hexadecimal numeric character " "references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " @@ -287,6 +322,12 @@ msgid "" "``>``; in this case the method will receive ``'62'`` or ``'x3E'``. This " "method is only called if *convert_charrefs* is false." msgstr "" +"このメソッドは、:samp:`&#{NNN};` 形式と :samp:`&#x{NNN};` 形式の、それぞれ " +"10 進数と 16 進数による数値文字参照を処理するために呼び出されます。\n" +"例えば ``>`` に対応する表記は、10 進数では ``>``、16 進数では ``>" +"`` です。\n" +"この場合、メソッドは ``'62'`` または ``'x3E'`` を受け取ります。\n" +"このメソッドは *convert_charrefs* が偽の場合にだけ呼び出されます。" #: ../../library/html.parser.rst:193 msgid "" @@ -304,16 +345,16 @@ msgstr "" "例えば、コメント ```` があると。このメソッドを引数 ``' " "comment '`` で呼び出されます。" -#: ../../library/html.parser.rst:198 msgid "" "The content of Internet Explorer conditional comments (condcoms) will also " "be sent to this method, so, for ````, this method will receive ``'[if IE 9]>IE9-specific contentIE9-specific content`` の場合、こ" -"のメソッドは ``'[if IE 9]>IE9-specific contentIE9-specific content`` に対しては、``'[if " +"IE 9]>IE9-specific content>> parser.feed('')\n" "Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." "org/TR/html4/strict.dtd\"" msgstr "" +">>> parser.feed('')\n" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." +"org/TR/html4/strict.dtd\"" -#: ../../library/html.parser.rst:288 msgid "Parsing an element with a few attributes and a title:" -msgstr "" +msgstr "属性を持つ要素と見出しの解析:" -#: ../../library/html.parser.rst:290 msgid "" ">>> parser.feed('\"The')\n" "Start tag: img\n" @@ -445,14 +517,23 @@ msgid "" "Data : Python\n" "End tag : h1" msgstr "" +">>> parser.feed('\"The')\n" +"Start tag: img\n" +" attr: ('src', 'python-logo.png')\n" +" attr: ('alt', 'The Python logo')\n" +">>>\n" +">>> parser.feed('

Python

')\n" +"Start tag: h1\n" +"Data : Python\n" +"End tag : h1" -#: ../../library/html.parser.rst:302 msgid "" "The content of elements like ``script`` and ``style`` is returned as is, " "without further parsing:" msgstr "" +"``script`` や ``style`` などの要素の内容は、さらに解析せずにそのまま返しま" +"す。" -#: ../../library/html.parser.rst:305 msgid "" ">>> parser.feed('