chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
147ce10e-9c09-4fef-b224-7d05bf8bdaff | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,748 | supabase-export-v2 | 256d84a3e535e3d8 | which they were registered; if you register ``A``, ``B``, and ``C``, at interpreter termination time they will be run in the order ``C``, ``B``, ``A``.
**Note:** The functions registered via this module are not called when the
program is killed by a signal not handled by Python, when a Python fatal
internal error is de... | trusted_official_docs | CPython Docs | which they were registered; if you register ``A``, ``B``, and ``C``, at interpreter termination time they will be run in the order ``C``, ``B``, ``A``.
**Note:** The functions registered via this module are not called when the
program is killed by a signal not handled by Python, when a Python fatal
internal error is de... | which they were registered; if you register ``A``, ``B``, and ``C``, at interpreter termination time they will be run in the order ``C``, ``B``, ``A``.
**Note:** The functions registered via this module are not called when the
program is killed by a signal not handled by Python, when a Python fatal
internal error is de... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15150e41-90ad-4812-83ec-ad6d70f4c3a9 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,749 | supabase-export-v2 | c59079aada3bb364 | 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.
**Note:** The effect of registering or unregistering functions from within
a cleanup function is undefined. | trusted_official_docs | CPython Docs | 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.
**Note:** The effect of registering or unregistering functions from within
a cleanup function is undefined. | 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.
**Note:** The effect of registering or unregistering functions from within
a cleanup function is undefined. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23aad2bd-b498-441c-928c-3a9b62b055e3 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,764 | supabase-export-v2 | 1132c4338761d159 | :mod:`!atexit` Example ----------------------
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 term... | trusted_official_docs | CPython Docs | :mod:`!atexit` Example ----------------------
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 term... | :mod:`!atexit` Example ----------------------
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 term... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
25c5c2c2-fa86-4670-be44-f2bdf03af038 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,754 | supabase-export-v2 | 73e21af8ccaee047 | first out order. The assumption is that lower level modules will normally be imported before higher level modules and thus must be cleaned up later.
If an exception is raised during execution of the exit handlers, a traceback is
printed (unless :exc:`SystemExit` is raised) and the exception information is
saved. Afte... | trusted_official_docs | CPython Docs | first out order. The assumption is that lower level modules will normally be imported before higher level modules and thus must be cleaned up later.
If an exception is raised during execution of the exit handlers, a traceback is
printed (unless :exc:`SystemExit` is raised) and the exception information is
saved. Afte... | first out order. The assumption is that lower level modules will normally be imported before higher level modules and thus must be cleaned up later.
If an exception is raised during execution of the exit handlers, a traceback is
printed (unless :exc:`SystemExit` is raised) and the exception information is
saved. Afte... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fa5485b-d303-44d5-af35-8188fa65562c | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,756 | supabase-export-v2 | 3b97330b0df24562 | This function returns *func*, which makes it possible to use it as a decorator.
.. warning::
Starting new threads or calling :func:`os.fork` from a registered
function can lead to race condition between the main Python
runtime thread freeing thread states while internal :mod:`threading`
routines or the new process ... | trusted_official_docs | CPython Docs | This function returns *func*, which makes it possible to use it as a decorator.
.. warning::
Starting new threads or calling :func:`os.fork` from a registered
function can lead to race condition between the main Python
runtime thread freeing thread states while internal :mod:`threading`
routines or the new process ... | This function returns *func*, which makes it possible to use it as a decorator.
.. warning::
Starting new threads or calling :func:`os.fork` from a registered
function can lead to race condition between the main Python
runtime thread freeing thread states while internal :mod:`threading`
routines or the new process ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4c8928d5-6dff-4940-9966-81e8dc9218b5 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,750 | supabase-export-v2 | 58c94502774e2fbc | **Note:** The effect of registering or unregistering functions from within a cleanup function is undefined.
.. versionchanged:: 3.7
When used with C-API subinterpreters, registered functions
are local to the interpreter they were registered in. | trusted_official_docs | CPython Docs | **Note:** The effect of registering or unregistering functions from within a cleanup function is undefined.
.. versionchanged:: 3.7
When used with C-API subinterpreters, registered functions
are local to the interpreter they were registered in. | **Note:** The effect of registering or unregistering functions from within a cleanup function is undefined.
.. versionchanged:: 3.7
When used with C-API subinterpreters, registered functions
are local to the interpreter they were registered in. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5845726f-19a7-42ed-942b-2fcaebeb882e | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,759 | supabase-export-v2 | 794108544e3fdd59 | .. function:: unregister(func)
Remove *func* from the list of functions to be run at interpreter shutdown. :func:`unregister` silently does nothing if *func* was not previously
registered. If *func* has been registered more than once, every occurrence
of that function in the :mod:`!atexit` call stack will be removed.... | trusted_official_docs | CPython Docs | .. function:: unregister(func)
Remove *func* from the list of functions to be run at interpreter shutdown. :func:`unregister` silently does nothing if *func* was not previously
registered. If *func* has been registered more than once, every occurrence
of that function in the :mod:`!atexit` call stack will be removed.... | .. function:: unregister(func)
Remove *func* from the list of functions to be run at interpreter shutdown. :func:`unregister` silently does nothing if *func* was not previously
registered. If *func* has been registered more than once, every occurrence
of that function in the :mod:`!atexit` call stack will be removed.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
58e94562-4771-4711-b199-f42e522cdef0 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,765 | supabase-export-v2 | 1ee74bf0a73e5f8e | 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. ::
try:
with open('counterfile') as infile:
_count = int(infile.read())
except FileNotFoundError:
_count = 0 | trusted_official_docs | CPython Docs | 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. ::
try:
with open('counterfile') as infile:
_count = int(infile.read())
except FileNotFoundError:
_count = 0 | 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. ::
try:
with open('counterfile') as infile:
_count = int(infile.read())
except FileNotFoundError:
_count = 0 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
68769c36-bcd2-4de6-aee7-be080b08d52c | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,752 | supabase-export-v2 | 871b174842373693 | .. function:: register(func, *args, **kwargs)
Register *func* as a function to be executed at termination. 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. | trusted_official_docs | CPython Docs | .. function:: register(func, *args, **kwargs)
Register *func* as a function to be executed at termination. 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. | .. function:: register(func, *args, **kwargs)
Register *func* as a function to be executed at termination. 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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
696c285f-c411-43aa-885d-c8201e5d453d | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,770 | supabase-export-v2 | 46165a84d9d3acf8 | Positional and keyword arguments may also be passed to :func:`register` to be passed along to the registered function when it is called::
def goodbye(name, adjective):
print('Goodbye %s, it was %s to meet you.' % (name, adjective)) | trusted_official_docs | CPython Docs | Positional and keyword arguments may also be passed to :func:`register` to be passed along to the registered function when it is called::
def goodbye(name, adjective):
print('Goodbye %s, it was %s to meet you.' % (name, adjective)) | Positional and keyword arguments may also be passed to :func:`register` to be passed along to the registered function when it is called::
def goodbye(name, adjective):
print('Goodbye %s, it was %s to meet you.' % (name, adjective)) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
87591ace-ac55-4bf9-acdf-1887803afb29 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,755 | supabase-export-v2 | 30aa07742883aeb6 | raised) and the exception information is saved. After all exit handlers have had a chance to run, the last exception to be raised is re-raised.
This function returns *func*, which makes it possible to use it as a
decorator. | trusted_official_docs | CPython Docs | raised) and the exception information is saved. After all exit handlers have had a chance to run, the last exception to be raised is re-raised.
This function returns *func*, which makes it possible to use it as a
decorator. | raised) and the exception information is saved. After all exit handlers have had a chance to run, the last exception to be raised is re-raised.
This function returns *func*, which makes it possible to use it as a
decorator. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ad836a3f-753c-4b50-8ec0-b5156f8fccd5 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,757 | supabase-export-v2 | 6b54a38c5287e9ce | freeing thread states while internal :mod:`threading` routines or the new process try to use that state. This can lead to crashes rather than clean shutdown.
.. versionchanged:: 3.12
Attempts to start a new thread or :func:`os.fork` a new process
in a registered function now leads to :exc:`RuntimeError`. | trusted_official_docs | CPython Docs | freeing thread states while internal :mod:`threading` routines or the new process try to use that state. This can lead to crashes rather than clean shutdown.
.. versionchanged:: 3.12
Attempts to start a new thread or :func:`os.fork` a new process
in a registered function now leads to :exc:`RuntimeError`. | freeing thread states while internal :mod:`threading` routines or the new process try to use that state. This can lead to crashes rather than clean shutdown.
.. versionchanged:: 3.12
Attempts to start a new thread or :func:`os.fork` a new process
in a registered function now leads to :exc:`RuntimeError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b1990fad-14ff-4e5b-b594-2d58da0cfb03 | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,753 | supabase-export-v2 | a12f523c45798978 | 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.
At normal program termination (for instance, if :func:`sys.exit` is called or
the main module's execution completes), all functions registered are called in
last in, first... | trusted_official_docs | CPython Docs | 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.
At normal program termination (for instance, if :func:`sys.exit` is called or
the main module's execution completes), all functions registered are called in
last in, first... | 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.
At normal program termination (for instance, if :func:`sys.exit` is called or
the main module's execution completes), all functions registered are called in
last in, first... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f16f6a07-99b2-45be-b85e-a81a96c8f67d | CPython Docs | file://datasets/cpython/Doc/library/atexit.rst | unknown | 782152a5-ee0b-4ced-afe0-96ee614b71b3 | 24,747 | supabase-export-v2 | bdd415f9d56e1e6b | --------------
The :mod:`!atexit` module defines functions to register and unregister cleanup
functions. Functions thus registered are automatically executed upon normal
interpreter termination. :mod:`!atexit` runs these functions in the *reverse*
order in which they were registered; if you register ``A``, ``B``, and `... | trusted_official_docs | CPython Docs | --------------
The :mod:`!atexit` module defines functions to register and unregister cleanup
functions. Functions thus registered are automatically executed upon normal
interpreter termination. :mod:`!atexit` runs these functions in the *reverse*
order in which they were registered; if you register ``A``, ``B``, and `... | --------------
The :mod:`!atexit` module defines functions to register and unregister cleanup
functions. Functions thus registered are automatically executed upon normal
interpreter termination. :mod:`!atexit` runs these functions in the *reverse*
order in which they were registered; if you register ``A``, ``B``, and `... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0582217b-d665-409e-b9f0-4a5f7654fe90 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-policy.rst | unknown | 946f0de9-6df2-4c79-9f15-94c6cb81370b | 24,779 | supabase-export-v2 | ec5a4e5e49880e35 | The :ref:`policy object <asyncio-policy-objects>` gets and sets a separate event loop per *context*. This is per-thread by default, though custom policies could define *context* differently.
Custom event loop policies can control the behavior of
:func:`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`... | trusted_official_docs | CPython Docs | The :ref:`policy object <asyncio-policy-objects>` gets and sets a separate event loop per *context*. This is per-thread by default, though custom policies could define *context* differently.
Custom event loop policies can control the behavior of
:func:`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`... | The :ref:`policy object <asyncio-policy-objects>` gets and sets a separate event loop per *context*. This is per-thread by default, though custom policies could define *context* differently.
Custom event loop policies can control the behavior of
:func:`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0bc32674-b1bf-4bab-8f6f-31cba53554f2 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-policy.rst | unknown | 946f0de9-6df2-4c79-9f15-94c6cb81370b | 24,777 | supabase-export-v2 | cf06c46aa2445b79 | 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.
An event loop policy is a global object
used to get and set the current :ref:`event loop <asyncio-event-loop>`,
as well as create new ev... | trusted_official_docs | CPython Docs | 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.
An event loop policy is a global object
used to get and set the current :ref:`event loop <asyncio-event-loop>`,
as well as create new ev... | 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.
An event loop policy is a global object
used to get and set the current :ref:`event loop <asyncio-event-loop>`,
as well as create new ev... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
41526b10-0455-4006-8a36-317277819e6d | CPython Docs | file://datasets/cpython/Doc/library/asyncio-policy.rst | unknown | 946f0de9-6df2-4c79-9f15-94c6cb81370b | 24,778 | supabase-export-v2 | 2f8a7039f8ded28e | be :ref:`replaced <asyncio-policy-get-set>` with :ref:`built-in alternatives <asyncio-policy-builtin>` to use different event loop implementations, or substituted by a :ref:`custom policy <asyncio-custom-policies>` that can override these behaviors.
The :ref:`policy object <asyncio-policy-objects>`
gets and sets a sepa... | trusted_official_docs | CPython Docs | be :ref:`replaced <asyncio-policy-get-set>` with :ref:`built-in alternatives <asyncio-policy-builtin>` to use different event loop implementations, or substituted by a :ref:`custom policy <asyncio-custom-policies>` that can override these behaviors.
The :ref:`policy object <asyncio-policy-objects>`
gets and sets a sepa... | be :ref:`replaced <asyncio-policy-get-set>` with :ref:`built-in alternatives <asyncio-policy-builtin>` to use different event loop implementations, or substituted by a :ref:`custom policy <asyncio-custom-policies>` that can override these behaviors.
The :ref:`policy object <asyncio-policy-objects>`
gets and sets a sepa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
730be907-6296-4ebd-a699-7b19f2503f7a | CPython Docs | file://datasets/cpython/Doc/library/asyncio-policy.rst | unknown | 946f0de9-6df2-4c79-9f15-94c6cb81370b | 24,814 | supabase-export-v2 | 34c1b6fb2efe6ee7 | On Windows, :class:`ProactorEventLoop` is now used by default.
.. versionchanged:: 3.14
The :meth:`get_event_loop` method of the default asyncio policy now
raises a :exc:`RuntimeError` if there is no set event loop. | trusted_official_docs | CPython Docs | On Windows, :class:`ProactorEventLoop` is now used by default.
.. versionchanged:: 3.14
The :meth:`get_event_loop` method of the default asyncio policy now
raises a :exc:`RuntimeError` if there is no set event loop. | On Windows, :class:`ProactorEventLoop` is now used by default.
.. versionchanged:: 3.14
The :meth:`get_event_loop` method of the default asyncio policy now
raises a :exc:`RuntimeError` if there is no set event loop. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a6d8a94e-6c6d-4f99-bb63-8b4d8d3006db | CPython Docs | file://datasets/cpython/Doc/library/asyncio-policy.rst | unknown | 946f0de9-6df2-4c79-9f15-94c6cb81370b | 24,776 | supabase-export-v2 | ac464a3de8ad1623 | .. warning::
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. | trusted_official_docs | CPython Docs | .. warning::
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. | .. warning::
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ad5f4525-965f-4b2f-a178-26c2c6a1452e | CPython Docs | file://datasets/cpython/Doc/library/asyncio-policy.rst | unknown | 946f0de9-6df2-4c79-9f15-94c6cb81370b | 24,811 | supabase-export-v2 | 7e6e99b42d32cf40 | The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :class:`ProactorEventLoop` on Windows.
There is no need to install the default policy manually. asyncio
is configured to use the default policy automatically. | trusted_official_docs | CPython Docs | The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :class:`ProactorEventLoop` on Windows.
There is no need to install the default policy manually. asyncio
is configured to use the default policy automatically. | The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :class:`ProactorEventLoop` on Windows.
There is no need to install the default policy manually. asyncio
is configured to use the default policy automatically. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
db223c10-1152-40fe-b142-c1f167ce6867 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-policy.rst | unknown | 946f0de9-6df2-4c79-9f15-94c6cb81370b | 24,815 | supabase-export-v2 | 0b9db3fe6d20842c | .. versionchanged:: 3.14 The :meth:`get_event_loop` method of the default asyncio policy now raises a :exc:`RuntimeError` if there is no set event loop.
.. deprecated:: 3.14
The :class:`DefaultEventLoopPolicy` class is deprecated and
will be removed in Python 3.16. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.14 The :meth:`get_event_loop` method of the default asyncio policy now raises a :exc:`RuntimeError` if there is no set event loop.
.. deprecated:: 3.14
The :class:`DefaultEventLoopPolicy` class is deprecated and
will be removed in Python 3.16. | .. versionchanged:: 3.14 The :meth:`get_event_loop` method of the default asyncio policy now raises a :exc:`RuntimeError` if there is no set event loop.
.. deprecated:: 3.14
The :class:`DefaultEventLoopPolicy` class is deprecated and
will be removed in Python 3.16. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
02115481-7c8e-4ea9-b603-909ed9306d60 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,848 | supabase-export-v2 | b637d19501cb2cab | UUID('{12345678-1234-5678-1234-567812345678}') UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes=b'\x12\x34\x56\x78'*4) UUID(bytes_le=b'\x78\x56\x34\x12\x34\x12\x78\x56' + b'\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x... | trusted_official_docs | CPython Docs | UUID('{12345678-1234-5678-1234-567812345678}') UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes=b'\x12\x34\x56\x78'*4) UUID(bytes_le=b'\x78\x56\x34\x12\x34\x12\x78\x56' + b'\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x... | UUID('{12345678-1234-5678-1234-567812345678}') UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes=b'\x12\x34\x56\x78'*4) UUID(bytes_le=b'\x78\x56\x34\x12\x34\x12\x78\x56' + b'\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
06b436df-219e-4275-87d7-fe23e81f7e41 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,891 | supabase-export-v2 | 49df4a56dc5c351a | .. function:: uuid3(namespace, name)
Generate a UUID based on the MD5 hash of a namespace identifier (which is a
UUID) and a name (which is a :class:`bytes` object or a string
that will be encoded using UTF-8)
according to :rfc:`RFC 9562, §5.3 <9562#section-5.3>`. | trusted_official_docs | CPython Docs | .. function:: uuid3(namespace, name)
Generate a UUID based on the MD5 hash of a namespace identifier (which is a
UUID) and a name (which is a :class:`bytes` object or a string
that will be encoded using UTF-8)
according to :rfc:`RFC 9562, §5.3 <9562#section-5.3>`. | .. function:: uuid3(namespace, name)
Generate a UUID based on the MD5 hash of a namespace identifier (which is a
UUID) and a name (which is a :class:`bytes` object or a string
that will be encoded using UTF-8)
according to :rfc:`RFC 9562, §5.3 <9562#section-5.3>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ef182b7-e7a1-4815-b558-95a817ccee04 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,883 | supabase-export-v2 | 3222cd76e2560fae | .. function:: getnode()
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
attempts to obtain the hardware address fail, we choose a random 48-bit
number with the multicast bit (least significant bit of the first octet)... | trusted_official_docs | CPython Docs | .. function:: getnode()
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
attempts to obtain the hardware address fail, we choose a random 48-bit
number with the multicast bit (least significant bit of the first octet)... | .. function:: getnode()
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
attempts to obtain the hardware address fail, we choose a random 48-bit
number with the multicast bit (least significant bit of the first octet)... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
30605cf9-32c3-4aa5-a10a-8f63b4d90dd5 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,835 | supabase-export-v2 | 985a534dfc25dfb4 | --------------
This module provides immutable :class:`UUID` objects (the :class:`UUID` class)
and :ref:`functions <uuid-factory-functions>` for generating UUIDs corresponding
to a specific UUID version as specified in :rfc:`9562` (which supersedes :rfc:`4122`),
for example, :func:`uuid1` for UUID version 1, :func:`uuid... | trusted_official_docs | CPython Docs | --------------
This module provides immutable :class:`UUID` objects (the :class:`UUID` class)
and :ref:`functions <uuid-factory-functions>` for generating UUIDs corresponding
to a specific UUID version as specified in :rfc:`9562` (which supersedes :rfc:`4122`),
for example, :func:`uuid1` for UUID version 1, :func:`uuid... | --------------
This module provides immutable :class:`UUID` objects (the :class:`UUID` class)
and :ref:`functions <uuid-factory-functions>` for generating UUIDs corresponding
to a specific UUID version as specified in :rfc:`9562` (which supersedes :rfc:`4122`),
for example, :func:`uuid1` for UUID version 1, :func:`uuid... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
34849a05-086b-47da-83ae-23f2fda96882 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,934 | supabase-export-v2 | 1689d0ad315fb49b | .. seealso::
:rfc:`9562` - A Universally Unique IDentifier (UUID) URN Namespace
This specification defines a Uniform Resource Name namespace for UUIDs, the
internal format of UUIDs, and methods of generating UUIDs. | trusted_official_docs | CPython Docs | .. seealso::
:rfc:`9562` - A Universally Unique IDentifier (UUID) URN Namespace
This specification defines a Uniform Resource Name namespace for UUIDs, the
internal format of UUIDs, and methods of generating UUIDs. | .. seealso::
:rfc:`9562` - A Universally Unique IDentifier (UUID) URN Namespace
This specification defines a Uniform Resource Name namespace for UUIDs, the
internal format of UUIDs, and methods of generating UUIDs. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38d2ed9b-cf42-4a46-8111-4c62e8aa9153 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,895 | supabase-export-v2 | 62030899b73e87e1 | .. function:: uuid5(namespace, name)
Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a
UUID) and a name (which is a :class:`bytes` object or a string
that will be encoded using UTF-8)
according to :rfc:`RFC 9562, §5.5 <9562#section-5.5>`. | trusted_official_docs | CPython Docs | .. function:: uuid5(namespace, name)
Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a
UUID) and a name (which is a :class:`bytes` object or a string
that will be encoded using UTF-8)
according to :rfc:`RFC 9562, §5.5 <9562#section-5.5>`. | .. function:: uuid5(namespace, name)
Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a
UUID) and a name (which is a :class:`bytes` object or a string
that will be encoded using UTF-8)
according to :rfc:`RFC 9562, §5.5 <9562#section-5.5>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f853b75-c96e-487d-9cf5-27a6b0c7e3ff | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,866 | supabase-export-v2 | 14566fe58aac709e | intervals since Gregorian epoch (1582-10-15 00:00:00) for versions 1 and 6, or the 48-bit timestamp in milliseconds since Unix epoch (1970-01-01 00:00:00) for version 7.
* - .. attribute:: UUID.clock_seq
- The 14-bit sequence number. Only relevant to versions 1 and 6. | trusted_official_docs | CPython Docs | intervals since Gregorian epoch (1582-10-15 00:00:00) for versions 1 and 6, or the 48-bit timestamp in milliseconds since Unix epoch (1970-01-01 00:00:00) for version 7.
* - .. attribute:: UUID.clock_seq
- The 14-bit sequence number. Only relevant to versions 1 and 6. | intervals since Gregorian epoch (1582-10-15 00:00:00) for versions 1 and 6, or the 48-bit timestamp in milliseconds since Unix epoch (1970-01-01 00:00:00) for version 7.
* - .. attribute:: UUID.clock_seq
- The 14-bit sequence number. Only relevant to versions 1 and 6. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
40e7d19c-6658-47e7-8904-ca1ed2db706a | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,846 | supabase-export-v2 | df8a5e6c3556f335 | .. class:: UUID(hex=None, bytes=None, bytes_le=None, fields=None, int=None, version=None, *, is_safe=SafeUUID.unknown)
Create a UUID from either a string of 32 hexadecimal digits, a string of 16
bytes in big-endian order as the *bytes* argument, a string of 16 bytes in
little-endian order as the *bytes_le* argument, ... | trusted_official_docs | CPython Docs | .. class:: UUID(hex=None, bytes=None, bytes_le=None, fields=None, int=None, version=None, *, is_safe=SafeUUID.unknown)
Create a UUID from either a string of 32 hexadecimal digits, a string of 16
bytes in big-endian order as the *bytes* argument, a string of 16 bytes in
little-endian order as the *bytes_le* argument, ... | .. class:: UUID(hex=None, bytes=None, bytes_le=None, fields=None, int=None, version=None, *, is_safe=SafeUUID.unknown)
Create a UUID from either a string of 32 hexadecimal digits, a string of 16
bytes in big-endian order as the *bytes* argument, a string of 16 bytes in
little-endian order as the *bytes_le* argument, ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4186223d-4b4f-4765-b85f-97dcf2f80a6c | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,863 | supabase-export-v2 | e9cc5b98727d5b58 | * - .. attribute:: UUID.clock_seq_hi_variant - The next 8 bits of the UUID. Only relevant to versions 1 and 6.
* - .. attribute:: UUID.clock_seq_low
- The next 8 bits of the UUID. Only relevant to versions 1 and 6. | trusted_official_docs | CPython Docs | * - .. attribute:: UUID.clock_seq_hi_variant - The next 8 bits of the UUID. Only relevant to versions 1 and 6.
* - .. attribute:: UUID.clock_seq_low
- The next 8 bits of the UUID. Only relevant to versions 1 and 6. | * - .. attribute:: UUID.clock_seq_hi_variant - The next 8 bits of the UUID. Only relevant to versions 1 and 6.
* - .. attribute:: UUID.clock_seq_low
- The next 8 bits of the UUID. Only relevant to versions 1 and 6. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
44f6f7b5-80cc-41f2-a982-973bbfe8aa72 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,967 | supabase-export-v2 | f10bf0e978d24920 | >>> # same as UUIDv1 but with fields reordered to improve DB locality >>> uuid.uuid6() # doctest: +SKIP UUID('1f0799c0-98b9-62db-92c6-a0d365b91053')
>>> # get UUIDv7 creation (local) time as a timestamp in milliseconds
>>> u = uuid.uuid7()
>>> u.time # doctest: +SKIP
1743936859822 | trusted_official_docs | CPython Docs | >>> # same as UUIDv1 but with fields reordered to improve DB locality >>> uuid.uuid6() # doctest: +SKIP UUID('1f0799c0-98b9-62db-92c6-a0d365b91053')
>>> # get UUIDv7 creation (local) time as a timestamp in milliseconds
>>> u = uuid.uuid7()
>>> u.time # doctest: +SKIP
1743936859822 | >>> # same as UUIDv1 but with fields reordered to improve DB locality >>> uuid.uuid6() # doctest: +SKIP UUID('1f0799c0-98b9-62db-92c6-a0d365b91053')
>>> # get UUIDv7 creation (local) time as a timestamp in milliseconds
>>> u = uuid.uuid7()
>>> u.time # doctest: +SKIP
1743936859822 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
480f458f-ad92-413d-a045-40dd234040e1 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,919 | supabase-export-v2 | e574fa6202f9681a | When this namespace is specified, the *name* string is an X.500 DN in DER or a text output format.
The :mod:`!uuid` module defines the following constants for the possible values
of the :attr:`~UUID.variant` attribute: | trusted_official_docs | CPython Docs | When this namespace is specified, the *name* string is an X.500 DN in DER or a text output format.
The :mod:`!uuid` module defines the following constants for the possible values
of the :attr:`~UUID.variant` attribute: | When this namespace is specified, the *name* string is an X.500 DN in DER or a text output format.
The :mod:`!uuid` module defines the following constants for the possible values
of the :attr:`~UUID.variant` attribute: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4960dd65-326b-4ebe-b409-6fe1b7a18930 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,908 | supabase-export-v2 | e179ce221312605e | If they exceed their expected bit count, only their least significant bits are kept; non-specified arguments are substituted for a pseudo-random integer of appropriate size.
By default, *a*, *b* and *c* are not generated by a cryptographically
secure pseudo-random number generator (CSPRNG). Use :func:`uuid4` when
a U... | trusted_official_docs | CPython Docs | If they exceed their expected bit count, only their least significant bits are kept; non-specified arguments are substituted for a pseudo-random integer of appropriate size.
By default, *a*, *b* and *c* are not generated by a cryptographically
secure pseudo-random number generator (CSPRNG). Use :func:`uuid4` when
a U... | If they exceed their expected bit count, only their least significant bits are kept; non-specified arguments are substituted for a pseudo-random integer of appropriate size.
By default, *a*, *b* and *c* are not generated by a cryptographically
secure pseudo-random number generator (CSPRNG). Use :func:`uuid4` when
a U... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4a2bc4b3-c82b-42b3-8faf-2ed8142b9fc8 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,861 | supabase-export-v2 | 2313a8852c5a9aa0 | * - .. attribute:: UUID.time_mid - The next 16 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time_hi_version
- The next 16 bits of the UUID. Only relevant to version 1. | trusted_official_docs | CPython Docs | * - .. attribute:: UUID.time_mid - The next 16 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time_hi_version
- The next 16 bits of the UUID. Only relevant to version 1. | * - .. attribute:: UUID.time_mid - The next 16 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time_hi_version
- The next 16 bits of the UUID. Only relevant to version 1. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4fca8abe-d2bd-47fd-b564-f7bf3c0f85ea | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,836 | supabase-export-v2 | c1004a49995c989d | :func:`uuid3` for UUID version 3, and so on. Note that UUID version 2 is deliberately omitted as it is outside the scope of the RFC.
If all you want is a unique ID, you should probably call :func:`uuid1` or
:func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates
a UUID containing the computer's n... | trusted_official_docs | CPython Docs | :func:`uuid3` for UUID version 3, and so on. Note that UUID version 2 is deliberately omitted as it is outside the scope of the RFC.
If all you want is a unique ID, you should probably call :func:`uuid1` or
:func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates
a UUID containing the computer's n... | :func:`uuid3` for UUID version 3, and so on. Note that UUID version 2 is deliberately omitted as it is outside the scope of the RFC.
If all you want is a unique ID, you should probably call :func:`uuid1` or
:func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates
a UUID containing the computer's n... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56e18589-4202-4b32-b83e-abd7719573d0 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,968 | supabase-export-v2 | 44f8c82b99ce5dda | >>> # get UUIDv7 creation (local) time as a timestamp in milliseconds >>> u = uuid.uuid7() >>> u.time # doctest: +SKIP 1743936859822
>>> # get UUIDv7 creation (local) time as a datetime object
>>> import datetime as dt
>>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP
datetime.datetime(...) | trusted_official_docs | CPython Docs | >>> # get UUIDv7 creation (local) time as a timestamp in milliseconds >>> u = uuid.uuid7() >>> u.time # doctest: +SKIP 1743936859822
>>> # get UUIDv7 creation (local) time as a datetime object
>>> import datetime as dt
>>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP
datetime.datetime(...) | >>> # get UUIDv7 creation (local) time as a timestamp in milliseconds >>> u = uuid.uuid7() >>> u.time # doctest: +SKIP 1743936859822
>>> # get UUIDv7 creation (local) time as a datetime object
>>> import datetime as dt
>>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP
datetime.datetime(...) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
59b545a0-ddb5-402a-9d34-b4ee3ae1890f | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,962 | supabase-export-v2 | 83ba3b75163d49c5 | >>> # convert a UUID to a string of hex digits in standard form >>> str(x) '00010203-0405-0607-0809-0a0b0c0d0e0f'
>>> # get the raw 16 bytes of the UUID
>>> x.bytes
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f' | trusted_official_docs | CPython Docs | >>> # convert a UUID to a string of hex digits in standard form >>> str(x) '00010203-0405-0607-0809-0a0b0c0d0e0f'
>>> # get the raw 16 bytes of the UUID
>>> x.bytes
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f' | >>> # convert a UUID to a string of hex digits in standard form >>> str(x) '00010203-0405-0607-0809-0a0b0c0d0e0f'
>>> # get the raw 16 bytes of the UUID
>>> x.bytes
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7175da9f-a8ad-47c4-b375-5600113de8fa | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,850 | supabase-export-v2 | e1f5d814594b5ee0 | Comparison of UUID objects are made by way of comparing their :attr:`UUID.int` attributes. Comparison with a non-UUID object raises a :exc:`TypeError`.
``str(uuid)`` returns a string in the form
``12345678-1234-5678-1234-567812345678`` where the 32 hexadecimal digits
represent the UUID. | trusted_official_docs | CPython Docs | Comparison of UUID objects are made by way of comparing their :attr:`UUID.int` attributes. Comparison with a non-UUID object raises a :exc:`TypeError`.
``str(uuid)`` returns a string in the form
``12345678-1234-5678-1234-567812345678`` where the 32 hexadecimal digits
represent the UUID. | Comparison of UUID objects are made by way of comparing their :attr:`UUID.int` attributes. Comparison with a non-UUID object raises a :exc:`TypeError`.
``str(uuid)`` returns a string in the form
``12345678-1234-5678-1234-567812345678`` where the 32 hexadecimal digits
represent the UUID. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
74e087bb-9890-4129-875d-12c4402ac0f1 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,849 | supabase-export-v2 | 7933bf9b3ab6dbd3 | the resulting UUID will have its variant and version number set according to :rfc:`9562`, overriding bits in the given *hex*, *bytes*, *bytes_le*, *fields*, or *int*.
Comparison of UUID objects are made by way of comparing their
:attr:`UUID.int` attributes. Comparison with a non-UUID object
raises a :exc:`TypeError`. | trusted_official_docs | CPython Docs | the resulting UUID will have its variant and version number set according to :rfc:`9562`, overriding bits in the given *hex*, *bytes*, *bytes_le*, *fields*, or *int*.
Comparison of UUID objects are made by way of comparing their
:attr:`UUID.int` attributes. Comparison with a non-UUID object
raises a :exc:`TypeError`. | the resulting UUID will have its variant and version number set according to :rfc:`9562`, overriding bits in the given *hex*, *bytes*, *bytes_le*, *fields*, or *int*.
Comparison of UUID objects are made by way of comparing their
:attr:`UUID.int` attributes. Comparison with a non-UUID object
raises a :exc:`TypeError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
771763f7-03e0-4aa1-b6ff-9c59101e2e52 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,860 | supabase-export-v2 | d0ecf71fd4a14c6e | * - .. attribute:: UUID.time_low - The first 32 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time_mid
- The next 16 bits of the UUID. Only relevant to version 1. | trusted_official_docs | CPython Docs | * - .. attribute:: UUID.time_low - The first 32 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time_mid
- The next 16 bits of the UUID. Only relevant to version 1. | * - .. attribute:: UUID.time_low - The first 32 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time_mid
- The next 16 bits of the UUID. Only relevant to version 1. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7be3f875-95e1-4dc0-9e25-ca29390772c7 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,862 | supabase-export-v2 | e699ce2d9fb0dfe4 | * - .. attribute:: UUID.time_hi_version - The next 16 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.clock_seq_hi_variant
- The next 8 bits of the UUID. Only relevant to versions 1 and 6. | trusted_official_docs | CPython Docs | * - .. attribute:: UUID.time_hi_version - The next 16 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.clock_seq_hi_variant
- The next 8 bits of the UUID. Only relevant to versions 1 and 6. | * - .. attribute:: UUID.time_hi_version - The next 16 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.clock_seq_hi_variant
- The next 8 bits of the UUID. Only relevant to versions 1 and 6. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
809f5f66-328f-449b-a92f-09731f49e054 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,907 | supabase-export-v2 | b8c9cfae617317fc | Generate a pseudo-random UUID according to :rfc:`RFC 9562, §5.8 <9562#section-5.8>`.
When specified, the parameters *a*, *b* and *c* are expected to be
positive integers of 48, 12 and 62 bits respectively. If they exceed
their expected bit count, only their least significant bits are kept;
non-specified arguments ar... | trusted_official_docs | CPython Docs | Generate a pseudo-random UUID according to :rfc:`RFC 9562, §5.8 <9562#section-5.8>`.
When specified, the parameters *a*, *b* and *c* are expected to be
positive integers of 48, 12 and 62 bits respectively. If they exceed
their expected bit count, only their least significant bits are kept;
non-specified arguments ar... | Generate a pseudo-random UUID according to :rfc:`RFC 9562, §5.8 <9562#section-5.8>`.
When specified, the parameters *a*, *b* and *c* are expected to be
positive integers of 48, 12 and 62 bits respectively. If they exceed
their expected bit count, only their least significant bits are kept;
non-specified arguments ar... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8650c210-205a-4f2e-9910-4c1562786ce6 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,847 | supabase-export-v2 | 0da37b674352aaab | string of hex digits is given, curly braces, hyphens, and a URN prefix are all optional. For example, these expressions all yield the same UUID::
UUID('{12345678-1234-5678-1234-567812345678}')
UUID('12345678123456781234567812345678')
UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
UUID(bytes=b'\x12\x34\x56\x78... | trusted_official_docs | CPython Docs | string of hex digits is given, curly braces, hyphens, and a URN prefix are all optional. For example, these expressions all yield the same UUID::
UUID('{12345678-1234-5678-1234-567812345678}')
UUID('12345678123456781234567812345678')
UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
UUID(bytes=b'\x12\x34\x56\x78... | string of hex digits is given, curly braces, hyphens, and a URN prefix are all optional. For example, these expressions all yield the same UUID::
UUID('{12345678-1234-5678-1234-567812345678}')
UUID('12345678123456781234567812345678')
UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
UUID(bytes=b'\x12\x34\x56\x78... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8aa62661-1103-4a6b-8fc4-d5edf458548f | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,960 | supabase-export-v2 | 1e2020c271424e28 | >>> # make a UUID using a SHA-1 hash of a namespace UUID and a name >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
>>> # make a UUID from a string of hex digits (braces and hyphens ignored)
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}') | trusted_official_docs | CPython Docs | >>> # make a UUID using a SHA-1 hash of a namespace UUID and a name >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
>>> # make a UUID from a string of hex digits (braces and hyphens ignored)
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}') | >>> # make a UUID using a SHA-1 hash of a namespace UUID and a name >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
>>> # make a UUID from a string of hex digits (braces and hyphens ignored)
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}') | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
99a483e7-763a-4164-a48b-1be689bdfe25 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,884 | supabase-export-v2 | fd6e750df8b3c696 | the second least significant bit of the first octet is *unset*) will be preferred over locally administered MAC addresses, but with no other ordering guarantees.
.. versionchanged:: 3.7
Universally administered MAC addresses are preferred over locally
administered MAC addresses, since the former are guaranteed to be
... | trusted_official_docs | CPython Docs | the second least significant bit of the first octet is *unset*) will be preferred over locally administered MAC addresses, but with no other ordering guarantees.
.. versionchanged:: 3.7
Universally administered MAC addresses are preferred over locally
administered MAC addresses, since the former are guaranteed to be
... | the second least significant bit of the first octet is *unset*) will be preferred over locally administered MAC addresses, but with no other ordering guarantees.
.. versionchanged:: 3.7
Universally administered MAC addresses are preferred over locally
administered MAC addresses, since the former are guaranteed to be
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aaf75386-c945-4ecb-b6d6-0f68420fd253 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,949 | supabase-export-v2 | c3dce4d620d8b3a0 | where ``ns`` is a well-known predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, ``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` functions.
.. option:: -N <name>
--name <name> | trusted_official_docs | CPython Docs | where ``ns`` is a well-known predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, ``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` functions.
.. option:: -N <name>
--name <name> | where ``ns`` is a well-known predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, ``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` functions.
.. option:: -N <name>
--name <name> | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b52943fb-0c3a-4cf6-a1d6-4bd9c9191a37 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,837 | supabase-export-v2 | 3cf2f6669223ee05 | call :func:`uuid1` or :func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates a UUID containing the computer's network address. :func:`uuid4` creates a random UUID.
Depending on support from the underlying platform, :func:`uuid1` may or may
not return a "safe" UUID. A safe UUID is one which is ge... | trusted_official_docs | CPython Docs | call :func:`uuid1` or :func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates a UUID containing the computer's network address. :func:`uuid4` creates a random UUID.
Depending on support from the underlying platform, :func:`uuid1` may or may
not return a "safe" UUID. A safe UUID is one which is ge... | call :func:`uuid1` or :func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates a UUID containing the computer's network address. :func:`uuid4` creates a random UUID.
Depending on support from the underlying platform, :func:`uuid1` may or may
not return a "safe" UUID. A safe UUID is one which is ge... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8a20ad7-df0d-4214-a8a9-15e5f1b8605a | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,957 | supabase-export-v2 | a77c4da539fb15c6 | >>> # make a UUID based on the host ID and current time >>> uuid.uuid1() # doctest: +SKIP UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')
>>> # make a UUID using an MD5 hash of a namespace UUID and a name
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e') | trusted_official_docs | CPython Docs | >>> # make a UUID based on the host ID and current time >>> uuid.uuid1() # doctest: +SKIP UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')
>>> # make a UUID using an MD5 hash of a namespace UUID and a name
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e') | >>> # make a UUID based on the host ID and current time >>> uuid.uuid1() # doctest: +SKIP UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')
>>> # make a UUID using an MD5 hash of a namespace UUID and a name
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e') | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c7762d00-aa7a-4af6-84ad-589c8d01d3f6 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,899 | supabase-export-v2 | 7469822547440ef7 | This is an alternative to :func:`uuid1` to improve database locality.
When *node* is not specified, :func:`getnode` is used to obtain the hardware
address as a 48-bit positive integer. When a sequence number *clock_seq* is
not specified, a pseudo-random 14-bit positive integer is generated. | trusted_official_docs | CPython Docs | This is an alternative to :func:`uuid1` to improve database locality.
When *node* is not specified, :func:`getnode` is used to obtain the hardware
address as a 48-bit positive integer. When a sequence number *clock_seq* is
not specified, a pseudo-random 14-bit positive integer is generated. | This is an alternative to :func:`uuid1` to improve database locality.
When *node* is not specified, :func:`getnode` is used to obtain the hardware
address as a 48-bit positive integer. When a sequence number *clock_seq* is
not specified, a pseudo-random 14-bit positive integer is generated. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c79da565-c40f-4c67-a413-d2d2c93f4cee | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,865 | supabase-export-v2 | bb9dbdadf5911275 | * - .. attribute:: UUID.node - The last 48 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time
- The 60-bit timestamp as a count of 100-nanosecond intervals since
Gregorian epoch (1582-10-15 00:00:00) for versions 1 and 6, or the
48-bit timestamp in milliseconds since Unix epoch (1970-01-01 00... | trusted_official_docs | CPython Docs | * - .. attribute:: UUID.node - The last 48 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time
- The 60-bit timestamp as a count of 100-nanosecond intervals since
Gregorian epoch (1582-10-15 00:00:00) for versions 1 and 6, or the
48-bit timestamp in milliseconds since Unix epoch (1970-01-01 00... | * - .. attribute:: UUID.node - The last 48 bits of the UUID. Only relevant to version 1.
* - .. attribute:: UUID.time
- The 60-bit timestamp as a count of 100-nanosecond intervals since
Gregorian epoch (1582-10-15 00:00:00) for versions 1 and 6, or the
48-bit timestamp in milliseconds since Unix epoch (1970-01-01 00... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c8db42ee-b1e7-45fa-ba40-dacb90e04c16 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,888 | supabase-export-v2 | 01460a29bac49301 | Generate a UUID from a host ID, sequence number, and the current time according to :rfc:`RFC 9562, §5.1 <9562#section-5.1>`.
When *node* is not specified, :func:`getnode` is used to obtain the hardware
address as a 48-bit positive integer. When a sequence number *clock_seq* is
not specified, a pseudo-random 14-bit po... | trusted_official_docs | CPython Docs | Generate a UUID from a host ID, sequence number, and the current time according to :rfc:`RFC 9562, §5.1 <9562#section-5.1>`.
When *node* is not specified, :func:`getnode` is used to obtain the hardware
address as a 48-bit positive integer. When a sequence number *clock_seq* is
not specified, a pseudo-random 14-bit po... | Generate a UUID from a host ID, sequence number, and the current time according to :rfc:`RFC 9562, §5.1 <9562#section-5.1>`.
When *node* is not specified, :func:`getnode` is used to obtain the hardware
address as a 48-bit positive integer. When a sequence number *clock_seq* is
not specified, a pseudo-random 14-bit po... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d6020d74-489f-4ae9-84dc-c8f46b5513f2 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,969 | supabase-export-v2 | 346ddc1dcd3ee92c | >>> # get UUIDv7 creation (local) time as a datetime object >>> import datetime as dt >>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP datetime.datetime(...)
>>> # make a UUID with custom blocks
>>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344)
UUID('00001234-5678-8ef0-8000-000011223344') | trusted_official_docs | CPython Docs | >>> # get UUIDv7 creation (local) time as a datetime object >>> import datetime as dt >>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP datetime.datetime(...)
>>> # make a UUID with custom blocks
>>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344)
UUID('00001234-5678-8ef0-8000-000011223344') | >>> # get UUIDv7 creation (local) time as a datetime object >>> import datetime as dt >>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP datetime.datetime(...)
>>> # make a UUID with custom blocks
>>> uuid.uuid8(0x12345678, 0x9abcdef0, 0x11223344)
UUID('00001234-5678-8ef0-8000-000011223344') | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d9e87ff8-48ca-4320-b1c2-a17a97d2dcff | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,961 | supabase-export-v2 | 5895e21d11e57771 | >>> # make a UUID from a string of hex digits (braces and hyphens ignored) >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
>>> # convert a UUID to a string of hex digits in standard form
>>> str(x)
'00010203-0405-0607-0809-0a0b0c0d0e0f' | trusted_official_docs | CPython Docs | >>> # make a UUID from a string of hex digits (braces and hyphens ignored) >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
>>> # convert a UUID to a string of hex digits in standard form
>>> str(x)
'00010203-0405-0607-0809-0a0b0c0d0e0f' | >>> # make a UUID from a string of hex digits (braces and hyphens ignored) >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
>>> # convert a UUID to a string of hex digits in standard form
>>> str(x)
'00010203-0405-0607-0809-0a0b0c0d0e0f' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc3e39a0-0b30-4f7e-952e-30428383a843 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,889 | supabase-export-v2 | 29259942f8216345 | to obtain the hardware address as a 48-bit positive integer. When a sequence number *clock_seq* is not specified, a pseudo-random 14-bit positive integer is generated.
If *node* or *clock_seq* exceed their expected bit count,
only their least significant bits are kept. | trusted_official_docs | CPython Docs | to obtain the hardware address as a 48-bit positive integer. When a sequence number *clock_seq* is not specified, a pseudo-random 14-bit positive integer is generated.
If *node* or *clock_seq* exceed their expected bit count,
only their least significant bits are kept. | to obtain the hardware address as a 48-bit positive integer. When a sequence number *clock_seq* is not specified, a pseudo-random 14-bit positive integer is generated.
If *node* or *clock_seq* exceed their expected bit count,
only their least significant bits are kept. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc45914c-982f-4317-b0ea-7090ea589db2 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,903 | supabase-export-v2 | 1e34a21a28b624bc | Generate a time-based UUID according to :rfc:`RFC 9562, §5.7 <9562#section-5.7>`.
For portability across platforms lacking sub-millisecond precision, UUIDs
produced by this function embed a 48-bit timestamp and use a 42-bit counter
to guarantee monotonicity within a millisecond. | trusted_official_docs | CPython Docs | Generate a time-based UUID according to :rfc:`RFC 9562, §5.7 <9562#section-5.7>`.
For portability across platforms lacking sub-millisecond precision, UUIDs
produced by this function embed a 48-bit timestamp and use a 42-bit counter
to guarantee monotonicity within a millisecond. | Generate a time-based UUID according to :rfc:`RFC 9562, §5.7 <9562#section-5.7>`.
For portability across platforms lacking sub-millisecond precision, UUIDs
produced by this function embed a 48-bit timestamp and use a 42-bit counter
to guarantee monotonicity within a millisecond. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc94b02f-ddbe-4a84-8637-15bdb8bd0015 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,948 | supabase-export-v2 | 8a9182f0e43e788d | .. option:: -n <namespace> --namespace <namespace>
The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known predefined UUID
addressed by namespace name. Such as ``@dns``, ``@url``, ``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` functions. | trusted_official_docs | CPython Docs | .. option:: -n <namespace> --namespace <namespace>
The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known predefined UUID
addressed by namespace name. Such as ``@dns``, ``@url``, ``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` functions. | .. option:: -n <namespace> --namespace <namespace>
The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known predefined UUID
addressed by namespace name. Such as ``@dns``, ``@url``, ``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` functions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dd996c2c-49e5-4179-a3e9-a9bfac22d5b2 | CPython Docs | file://datasets/cpython/Doc/library/uuid.rst | unknown | abc659a4-13a6-4143-9f09-ca0ae7e21136 | 24,864 | supabase-export-v2 | 1b49068cb2fdc11d | * - .. attribute:: UUID.clock_seq_low - The next 8 bits of the UUID. Only relevant to versions 1 and 6.
* - .. attribute:: UUID.node
- The last 48 bits of the UUID. Only relevant to version 1. | trusted_official_docs | CPython Docs | * - .. attribute:: UUID.clock_seq_low - The next 8 bits of the UUID. Only relevant to versions 1 and 6.
* - .. attribute:: UUID.node
- The last 48 bits of the UUID. Only relevant to version 1. | * - .. attribute:: UUID.clock_seq_low - The next 8 bits of the UUID. Only relevant to versions 1 and 6.
* - .. attribute:: UUID.node
- The last 48 bits of the UUID. Only relevant to version 1. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
053ad333-e694-4a65-a199-89d030f5a1fe | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,093 | supabase-export-v2 | 108c93afa18a4c59 | that needs to be translated should be marked by wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ <gettext>`. For example::
filename = 'mylog.txt'
message = _('writing a log message')
with open(filename, 'w') as fp:
fp.write(message) | trusted_official_docs | CPython Docs | that needs to be translated should be marked by wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ <gettext>`. For example::
filename = 'mylog.txt'
message = _('writing a log message')
with open(filename, 'w') as fp:
fp.write(message) | that needs to be translated should be marked by wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ <gettext>`. For example::
filename = 'mylog.txt'
message = _('writing a log message')
with open(filename, 'w') as fp:
fp.write(message) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a57012f-54be-4e48-a4ed-215235cc6605 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,015 | supabase-export-v2 | e07e5fe4fd98ca27 | .. function:: translation(domain, localedir=None, languages=None, class_=None, fallback=False)
Return a ``*Translations`` instance based on the *domain*, *localedir*,
and *languages*, which are first passed to :func:`find` to get a list of the
associated :file:`.mo` file paths. Instances with identical :file:`.mo` fi... | trusted_official_docs | CPython Docs | .. function:: translation(domain, localedir=None, languages=None, class_=None, fallback=False)
Return a ``*Translations`` instance based on the *domain*, *localedir*,
and *languages*, which are first passed to :func:`find` to get a list of the
associated :file:`.mo` file paths. Instances with identical :file:`.mo` fi... | .. function:: translation(domain, localedir=None, languages=None, class_=None, fallback=False)
Return a ``*Translations`` instance based on the *domain*, *localedir*,
and *languages*, which are first passed to :func:`find` to get a list of the
associated :file:`.mo` file paths. Instances with identical :file:`.mo` fi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0acb7b2d-95c6-4baa-8354-fe91af5b2680 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,028 | supabase-export-v2 | 20ed87374df0da25 | The :class:`NullTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Translation classes are what actually implement the translation of original
source file message strings to translated message strings. The base class used
by all translation classes is :class:`NullTranslations`; this provides the basic
interface yo... | trusted_official_docs | CPython Docs | The :class:`NullTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Translation classes are what actually implement the translation of original
source file message strings to translated message strings. The base class used
by all translation classes is :class:`NullTranslations`; this provides the basic
interface yo... | The :class:`NullTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Translation classes are what actually implement the translation of original
source file message strings to translated message strings. The base class used
by all translation classes is :class:`NullTranslations`; this provides the basic
interface yo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
10e71e5d-2d05-4af9-9589-19fb2e3b78b2 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,034 | supabase-export-v2 | 324b7a2e5f3cf73c | .. method:: add_fallback(fallback)
Add *fallback* as the fallback object for the current translation object. A translation object should consult the fallback if it cannot provide a
translation for a given message. | trusted_official_docs | CPython Docs | .. method:: add_fallback(fallback)
Add *fallback* as the fallback object for the current translation object. A translation object should consult the fallback if it cannot provide a
translation for a given message. | .. method:: add_fallback(fallback)
Add *fallback* as the fallback object for the current translation object. A translation object should consult the fallback if it cannot provide a
translation for a given message. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11861636-a050-4e30-9fc3-890ac0ccbb2d | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,105 | supabase-export-v2 | 331f5503c60887b4 | Localizing your application ^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 exp... | trusted_official_docs | CPython Docs | Localizing your application ^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 exp... | Localizing your application ^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 exp... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11c79e29-d9a5-4a7d-9a2a-92cd2f009610 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,069 | supabase-export-v2 | 889f5f9f49a78f05 | Here is an example::
n = len(os.listdir('.'))
cat = GNUTranslations(somefile)
message = cat.ngettext(
'There is %(num)d file in this directory',
'There are %(num)d files in this directory',
n) % {'num': n} | trusted_official_docs | CPython Docs | Here is an example::
n = len(os.listdir('.'))
cat = GNUTranslations(somefile)
message = cat.ngettext(
'There is %(num)d file in this directory',
'There are %(num)d files in this directory',
n) % {'num': n} | Here is an example::
n = len(os.listdir('.'))
cat = GNUTranslations(somefile)
message = cat.ngettext(
'There is %(num)d file in this directory',
'There are %(num)d files in this directory',
n) % {'num': n} | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11de237a-7973-44df-8158-bcd266933442 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,078 | supabase-export-v2 | 662b001a96c40f57 | Solaris message catalog support ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Solaris operating system defines its own binary :file:`.mo` file format, but
since no documentation can be found on this format, it is not supported at this
time. | trusted_official_docs | CPython Docs | Solaris message catalog support ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Solaris operating system defines its own binary :file:`.mo` file format, but
since no documentation can be found on this format, it is not supported at this
time. | Solaris message catalog support ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Solaris operating system defines its own binary :file:`.mo` file format, but
since no documentation can be found on this format, it is not supported at this
time. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
13289546-8db3-4f7d-acc0-f94fcd2ce926 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,050 | supabase-export-v2 | 4ac2d9ffc55b0e04 | This method installs :meth:`.gettext` into the built-in namespace, binding it to ``_``.
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'``... | trusted_official_docs | CPython Docs | This method installs :meth:`.gettext` into the built-in namespace, binding it to ``_``.
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'``... | This method installs :meth:`.gettext` into the built-in namespace, binding it to ``_``.
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'``... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1591c53a-cb26-4109-862c-82e61a2d935f | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,025 | supabase-export-v2 | 69326c98c7e5edef | print(_('This string will be translated.'))
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. | trusted_official_docs | CPython Docs | print(_('This string will be translated.'))
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. | print(_('This string will be translated.'))
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16841d05-3039-42eb-8b61-dcc2b0f92293 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,084 | supabase-export-v2 | 4d4391e8b436aab6 | For compatibility with this older module, the function :func:`!Catalog` is an alias for the :func:`translation` function described above.
One difference between this module and Henstridge's: his catalog objects
supported access through a mapping API, but this appears to be unused and so is
not currently supported. | trusted_official_docs | CPython Docs | For compatibility with this older module, the function :func:`!Catalog` is an alias for the :func:`translation` function described above.
One difference between this module and Henstridge's: his catalog objects
supported access through a mapping API, but this appears to be unused and so is
not currently supported. | For compatibility with this older module, the function :func:`!Catalog` is an alias for the :func:`translation` function described above.
One difference between this module and Henstridge's: his catalog objects
supported access through a mapping API, but this appears to be unused and so is
not currently supported. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16a98cc3-9b03-4031-811a-ba1ab80203c0 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,082 | supabase-export-v2 | 156a1789c9d3dfd4 | GNOME uses a version of the :mod:`!gettext` module by James Henstridge, but this version has a slightly different API. Its documented usage was::
import gettext
cat = gettext.Catalog(domain, localedir)
_ = cat.gettext
print(_('hello world')) | trusted_official_docs | CPython Docs | GNOME uses a version of the :mod:`!gettext` module by James Henstridge, but this version has a slightly different API. Its documented usage was::
import gettext
cat = gettext.Catalog(domain, localedir)
_ = cat.gettext
print(_('hello world')) | GNOME uses a version of the :mod:`!gettext` module by James Henstridge, but this version has a slightly different API. Its documented usage was::
import gettext
cat = gettext.Catalog(domain, localedir)
_ = cat.gettext
print(_('hello world')) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16c72f1a-8e23-48d1-a900-226344940794 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,127 | supabase-export-v2 | ecd3fb0406b74a53 | 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.
Another way to handle this is with the following example:: | trusted_official_docs | CPython Docs | 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.
Another way to handle this is with the following example:: | 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.
Another way to handle this is with the following example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1cbc3dc7-597c-4e79-9cc8-b9a2b90d689f | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,065 | supabase-export-v2 | abe8ea303da17a27 | the *message* id, and a fallback has been set, the look up is forwarded to the fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the *message* id is returned.
.. method:: ngettext(singular, plural, n) | trusted_official_docs | CPython Docs | the *message* id, and a fallback has been set, the look up is forwarded to the fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the *message* id is returned.
.. method:: ngettext(singular, plural, n) | the *message* id, and a fallback has been set, the look up is forwarded to the fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the *message* id is returned.
.. method:: ngettext(singular, plural, n) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1da2988f-19b5-4f33-90af-0534137202e1 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,067 | supabase-export-v2 | bf61000ac5fa9a32 | 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.
If the message id is not found in the catalog, and a fallback is specified,
the request is forwarded to the fallback's :meth:`~NullTranslations.ngettext`
method. Otherwise, when... | trusted_official_docs | CPython Docs | 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.
If the message id is not found in the catalog, and a fallback is specified,
the request is forwarded to the fallback's :meth:`~NullTranslations.ngettext`
method. Otherwise, when... | 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.
If the message id is not found in the catalog, and a fallback is specified,
the request is forwarded to the fallback's :meth:`~NullTranslations.ngettext`
method. Otherwise, when... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2038d12b-48da-4c2d-9c7a-5f4fd8e48942 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,087 | supabase-export-v2 | 3bb82658c0bb1c0d | Internationalizing your programs and modules --------------------------------------------
Internationalization (I18N) refers to the operation by which a program is made
aware of multiple languages. Localization (L10N) refers to the adaptation of
your program, once internationalized, to the local language and cultural h... | trusted_official_docs | CPython Docs | Internationalizing your programs and modules --------------------------------------------
Internationalization (I18N) refers to the operation by which a program is made
aware of multiple languages. Localization (L10N) refers to the adaptation of
your program, once internationalized, to the local language and cultural h... | Internationalizing your programs and modules --------------------------------------------
Internationalization (I18N) refers to the operation by which a program is made
aware of multiple languages. Localization (L10N) refers to the adaptation of
your program, once internationalized, to the local language and cultural h... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
222c3db3-de01-4158-b669-411da0e60dfc | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,000 | supabase-export-v2 | d026ab8fe8b1861b | Like :func:`ngettext`, but look the message up in the specified *domain*.
.. function:: pgettext(context, message)
.. function:: dpgettext(domain, context, message)
.. function:: npgettext(context, singular, plural, n)
.. function:: dnpgettext(domain, context, singular, plural, n) | trusted_official_docs | CPython Docs | Like :func:`ngettext`, but look the message up in the specified *domain*.
.. function:: pgettext(context, message)
.. function:: dpgettext(domain, context, message)
.. function:: npgettext(context, singular, plural, n)
.. function:: dnpgettext(domain, context, singular, plural, n) | Like :func:`ngettext`, but look the message up in the specified *domain*.
.. function:: pgettext(context, message)
.. function:: dpgettext(domain, context, message)
.. function:: npgettext(context, singular, plural, n)
.. function:: dnpgettext(domain, context, singular, plural, n) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24bd1ca7-9f0f-41f8-8f4a-d15e8098a5e2 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,092 | supabase-export-v2 | 1839cd3dff1b5705 | #. use the :mod:`!gettext` module so that message strings are properly translated
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:`_ <gettext>`. For... | trusted_official_docs | CPython Docs | #. use the :mod:`!gettext` module so that message strings are properly translated
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:`_ <gettext>`. For... | #. use the :mod:`!gettext` module so that message strings are properly translated
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:`_ <gettext>`. For... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2a763170-1f15-4983-ada2-66db91d80234 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,118 | supabase-export-v2 | bab17da56ca35650 | Deferred translations ^^^^^^^^^^^^^^^^^^^^^
In most coding situations, strings are translated where they are coded. Occasionally however, you need to mark strings for translation, but defer actual
translation until later. A classic example is:: | trusted_official_docs | CPython Docs | Deferred translations ^^^^^^^^^^^^^^^^^^^^^
In most coding situations, strings are translated where they are coded. Occasionally however, you need to mark strings for translation, but defer actual
translation until later. A classic example is:: | Deferred translations ^^^^^^^^^^^^^^^^^^^^^
In most coding situations, strings are translated where they are coded. Occasionally however, you need to mark strings for translation, but defer actual
translation until later. A classic example is:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b644f54-5ced-4ea2-9d1e-b72a06dd7af5 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,121 | supabase-export-v2 | 7098f078b6b4f566 | you want to mark the strings in the ``animals`` list as being translatable, but you don't actually want to translate them until they are printed.
Here is one way you can handle this situation:: | trusted_official_docs | CPython Docs | you want to mark the strings in the ``animals`` list as being translatable, but you don't actually want to translate them until they are printed.
Here is one way you can handle this situation:: | you want to mark the strings in the ``animals`` list as being translatable, but you don't actually want to translate them until they are printed.
Here is one way you can handle this situation:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c04123b-d1db-488a-ab0f-ff908227fdf8 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,018 | supabase-export-v2 | 8e629529ffd355bd | :file:`.mo` file is found, this function raises :exc:`OSError` if *fallback* is false (which is the default), and returns a :class:`NullTranslations` instance if *fallback* is true.
.. versionchanged:: 3.3
:exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`. | trusted_official_docs | CPython Docs | :file:`.mo` file is found, this function raises :exc:`OSError` if *fallback* is false (which is the default), and returns a :class:`NullTranslations` instance if *fallback* is true.
.. versionchanged:: 3.3
:exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`. | :file:`.mo` file is found, this function raises :exc:`OSError` if *fallback* is false (which is the default), and returns a :class:`NullTranslations` instance if *fallback* is true.
.. versionchanged:: 3.3
:exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2cd7bdc8-b818-4e6c-8073-820d061834a9 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,060 | supabase-export-v2 | a2dff188d2d54151 | The entire set of key/value pairs are placed into a dictionary and set as the "protected" :attr:`!_info` instance variable.
If the :file:`.mo` file's magic number is invalid, the major version number is
unexpected, or if other problems occur while reading the file, instantiating a
:class:`GNUTranslations` class can rai... | trusted_official_docs | CPython Docs | The entire set of key/value pairs are placed into a dictionary and set as the "protected" :attr:`!_info` instance variable.
If the :file:`.mo` file's magic number is invalid, the major version number is
unexpected, or if other problems occur while reading the file, instantiating a
:class:`GNUTranslations` class can rai... | The entire set of key/value pairs are placed into a dictionary and set as the "protected" :attr:`!_info` instance variable.
If the :file:`.mo` file's magic number is invalid, the major version number is
unexpected, or if other problems occur while reading the file, instantiating a
:class:`GNUTranslations` class can rai... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e3566ac-c353-400f-8be0-a73ad06da656 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,120 | supabase-export-v2 | 262b1b5621c5354e | animals = ['mollusk', 'albatross', 'rat', 'penguin', 'python', ] # ... for a in animals: print(a)
Here, you want to mark the strings in the ``animals`` list as being
translatable, but you don't actually want to translate them until they are
printed. | trusted_official_docs | CPython Docs | animals = ['mollusk', 'albatross', 'rat', 'penguin', 'python', ] # ... for a in animals: print(a)
Here, you want to mark the strings in the ``animals`` list as being
translatable, but you don't actually want to translate them until they are
printed. | animals = ['mollusk', 'albatross', 'rat', 'penguin', 'python', ] # ... for a in animals: print(a)
Here, you want to mark the strings in the ``animals`` list as being
translatable, but you don't actually want to translate them until they are
printed. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
30199b73-f00c-44f2-a36c-d482e50ca48c | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,135 | supabase-export-v2 | 408495168ef405c0 | .. rubric:: Footnotes
.. [#] 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/locale`. The :mod:`!gettext` module does not try to support these system dependent
defaults; instead its default is :file:`{sys.base_prefix... | trusted_official_docs | CPython Docs | .. rubric:: Footnotes
.. [#] 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/locale`. The :mod:`!gettext` module does not try to support these system dependent
defaults; instead its default is :file:`{sys.base_prefix... | .. rubric:: Footnotes
.. [#] 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/locale`. The :mod:`!gettext` module does not try to support these system dependent
defaults; instead its default is :file:`{sys.base_prefix... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
36bc3bea-5332-4154-85f4-eed3d264577f | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 24,991 | supabase-export-v2 | 5a348649ab683360 | current global domain. If *domain* is ``None``, then the current global domain is returned, otherwise the global domain is set to *domain*, which is returned.
.. index:: single: _ (underscore); gettext
.. function:: gettext(message) | trusted_official_docs | CPython Docs | current global domain. If *domain* is ``None``, then the current global domain is returned, otherwise the global domain is set to *domain*, which is returned.
.. index:: single: _ (underscore); gettext
.. function:: gettext(message) | current global domain. If *domain* is ``None``, then the current global domain is returned, otherwise the global domain is set to *domain*, which is returned.
.. index:: single: _ (underscore); gettext
.. function:: gettext(message) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3cf229bc-d48d-4cd4-91f6-93a1efb0ef4c | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,125 | supabase-export-v2 | 708d087c5aa4b333 | # ... for a in animals: print(_(a))
This works because the dummy definition of :func:`!_` simply returns the string
unchanged. And this dummy definition will temporarily override any definition
of :func:`!_` in the built-in namespace (until the :keyword:`del` command). Take
care, though if you have a previous definitio... | trusted_official_docs | CPython Docs | # ... for a in animals: print(_(a))
This works because the dummy definition of :func:`!_` simply returns the string
unchanged. And this dummy definition will temporarily override any definition
of :func:`!_` in the built-in namespace (until the :keyword:`del` command). Take
care, though if you have a previous definitio... | # ... for a in animals: print(_(a))
This works because the dummy definition of :func:`!_` simply returns the string
unchanged. And this dummy definition will temporarily override any definition
of :func:`!_` in the built-in namespace (until the :keyword:`del` command). Take
care, though if you have a previous definitio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
47efa468-62be-450c-8152-bf26c3dd7f84 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,058 | supabase-export-v2 | 02150dc4c5577930 | encoding is specified, then all message ids and message strings read from the catalog are converted to Unicode using this encoding, else ASCII is assumed.
Since message ids are read as Unicode strings too, all ``*gettext()`` methods
will assume message ids as Unicode strings, not byte strings. | trusted_official_docs | CPython Docs | encoding is specified, then all message ids and message strings read from the catalog are converted to Unicode using this encoding, else ASCII is assumed.
Since message ids are read as Unicode strings too, all ``*gettext()`` methods
will assume message ids as Unicode strings, not byte strings. | encoding is specified, then all message ids and message strings read from the catalog are converted to Unicode using this encoding, else ASCII is assumed.
Since message ids are read as Unicode strings too, all ``*gettext()`` methods
will assume message ids as Unicode strings, not byte strings. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49297407-c38d-4b16-8122-31f4afd4588d | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,111 | supabase-export-v2 | 51805704639b8d30 | Changing languages on the fly ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If your program needs to support many languages at the same time, you may want
to create multiple translation instances and then switch between them
explicitly, like so:: | trusted_official_docs | CPython Docs | Changing languages on the fly ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If your program needs to support many languages at the same time, you may want
to create multiple translation instances and then switch between them
explicitly, like so:: | Changing languages on the fly ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If your program needs to support many languages at the same time, you may want
to create multiple translation instances and then switch between them
explicitly, like so:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4c112d27-39d3-41e9-bb30-75b5970df64c | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 24,983 | supabase-export-v2 | f36cf33f84c9bbaa | you to write your module and application messages in one natural language, and provide a catalog of translated messages for running under different natural languages.
Some hints on localizing your Python modules and applications are also given. | trusted_official_docs | CPython Docs | you to write your module and application messages in one natural language, and provide a catalog of translated messages for running under different natural languages.
Some hints on localizing your Python modules and applications are also given. | you to write your module and application messages in one natural language, and provide a catalog of translated messages for running under different natural languages.
Some hints on localizing your Python modules and applications are also given. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
531f0e49-2bf4-4f7e-9b6f-199f966b8cf6 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,052 | supabase-export-v2 | 6e1aa1dd8ac54377 | globally, and specifically the built-in namespace, localized modules should never install :func:`!_`. Instead, they should use this code to make :func:`!_` available to their module::
import gettext
t = gettext.translation('mymodule', ...)
_ = t.gettext | trusted_official_docs | CPython Docs | globally, and specifically the built-in namespace, localized modules should never install :func:`!_`. Instead, they should use this code to make :func:`!_` available to their module::
import gettext
t = gettext.translation('mymodule', ...)
_ = t.gettext | globally, and specifically the built-in namespace, localized modules should never install :func:`!_`. Instead, they should use this code to make :func:`!_` available to their module::
import gettext
t = gettext.translation('mymodule', ...)
_ = t.gettext | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
54abcb35-f840-414b-b9d3-7ab9904db049 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,106 | supabase-export-v2 | 06fa687c17195b62 | 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.
In the simple case then, you need only add the following bit of code to the main
driver file of your application:: | trusted_official_docs | CPython Docs | 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.
In the simple case then, you need only add the following bit of code to the main
driver file of your application:: | 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.
In the simple case then, you need only add the following bit of code to the main
driver file of your application:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5ba500b3-9421-43d2-9d25-4751e3b0f672 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,071 | supabase-export-v2 | f732897a8a483c21 | .. method:: pgettext(context, message)
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 the catalog for the *message* id and *context*, and a fallback
has been set, the look up is forwarded to the fallback's
:meth:`pgette... | trusted_official_docs | CPython Docs | .. method:: pgettext(context, message)
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 the catalog for the *message* id and *context*, and a fallback
has been set, the look up is forwarded to the fallback's
:meth:`pgette... | .. method:: pgettext(context, message)
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 the catalog for the *message* id and *context*, and a fallback
has been set, the look up is forwarded to the fallback's
:meth:`pgette... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
65830816-fb21-4d2f-9ef5-0884eb030b30 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,096 | supabase-export-v2 | e6e53036a1ca0b94 | to extract and compile message catalogs. François Pinard's program called :program:`xpot` does a similar job and is available as part of his `po-utils package <https://github.com/pinard/po-utils>`__.
(Python also includes pure-Python versions of these programs, called
:program:`pygettext.py` and :program:`msgfmt.py`; s... | trusted_official_docs | CPython Docs | to extract and compile message catalogs. François Pinard's program called :program:`xpot` does a similar job and is available as part of his `po-utils package <https://github.com/pinard/po-utils>`__.
(Python also includes pure-Python versions of these programs, called
:program:`pygettext.py` and :program:`msgfmt.py`; s... | to extract and compile message catalogs. François Pinard's program called :program:`xpot` does a similar job and is available as part of his `po-utils package <https://github.com/pinard/po-utils>`__.
(Python also includes pure-Python versions of these programs, called
:program:`pygettext.py` and :program:`msgfmt.py`; s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
665aebc4-c2e1-46f8-933e-4c0645b9fe73 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,056 | supabase-export-v2 | db291fa91345bbf1 | The :class:`GNUTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 l... | trusted_official_docs | CPython Docs | The :class:`GNUTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 l... | The :class:`GNUTranslations` class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 l... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
66807bd7-6954-4cd3-b208-064e127e684d | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 24,990 | supabase-export-v2 | fd9204bfa6d7bf62 | .. function:: textdomain(domain=None)
Change or query the current global domain. If *domain* is ``None``, then the
current global domain is returned, otherwise the global domain is set to
*domain*, which is returned. | trusted_official_docs | CPython Docs | .. function:: textdomain(domain=None)
Change or query the current global domain. If *domain* is ``None``, then the
current global domain is returned, otherwise the global domain is set to
*domain*, which is returned. | .. function:: textdomain(domain=None)
Change or query the current global domain. If *domain* is ``None``, then the
current global domain is returned, otherwise the global domain is set to
*domain*, which is returned. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
68a8818e-66c5-483f-9769-1312c2b3993d | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,102 | supabase-export-v2 | 14db3cc1ea580318 | take care not to make global changes, e.g. to the built-in namespace. You should not use the GNU :program:`gettext` API but instead the class-based API.
Let's say your module is called "spam" and the module's various natural language
translation :file:`.mo` files reside in :file:`/usr/share/locale` in GNU
:program:`get... | trusted_official_docs | CPython Docs | take care not to make global changes, e.g. to the built-in namespace. You should not use the GNU :program:`gettext` API but instead the class-based API.
Let's say your module is called "spam" and the module's various natural language
translation :file:`.mo` files reside in :file:`/usr/share/locale` in GNU
:program:`get... | take care not to make global changes, e.g. to the built-in namespace. You should not use the GNU :program:`gettext` API but instead the class-based API.
Let's say your module is called "spam" and the module's various natural language
translation :file:`.mo` files reside in :file:`/usr/share/locale` in GNU
:program:`get... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
691cb021-1aa8-4f0c-be6b-32153c9bc434 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 24,992 | supabase-export-v2 | cf8ba9be32fad484 | .. index:: single: _ (underscore); gettext .. function:: gettext(message)
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). | trusted_official_docs | CPython Docs | .. index:: single: _ (underscore); gettext .. function:: gettext(message)
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). | .. index:: single: _ (underscore); gettext .. function:: gettext(message)
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). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
75a03fd6-2ce5-40d9-b788-47d0b372a2f5 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 24,998 | supabase-export-v2 | b13f4ee32491dbed | catalog. See `the GNU gettext documentation <https://www.gnu.org/software/gettext/manual/gettext.html>`__ for the precise syntax to be used in :file:`.po` files and the formulas for a variety of languages.
.. function:: dngettext(domain, singular, plural, n) | trusted_official_docs | CPython Docs | catalog. See `the GNU gettext documentation <https://www.gnu.org/software/gettext/manual/gettext.html>`__ for the precise syntax to be used in :file:`.po` files and the formulas for a variety of languages.
.. function:: dngettext(domain, singular, plural, n) | catalog. See `the GNU gettext documentation <https://www.gnu.org/software/gettext/manual/gettext.html>`__ for the precise syntax to be used in :file:`.po` files and the formulas for a variety of languages.
.. function:: dngettext(domain, singular, plural, n) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ccd60b9-321c-4716-ad0b-0525f1bbef91 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 24,996 | supabase-export-v2 | 0c0a79a52943bb7a | .. function:: ngettext(singular, plural, n)
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* other... | trusted_official_docs | CPython Docs | .. function:: ngettext(singular, plural, n)
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* other... | .. function:: ngettext(singular, plural, n)
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* other... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
82d15d48-bf1d-4bcc-8917-c4623b45ed1b | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,010 | supabase-export-v2 | 1cf06fbe9b8c6740 | identical to what :func:`textdomain` takes. Optional *localedir* is as in :func:`bindtextdomain`. Optional *languages* is a list of strings, where each string is a language code.
If *localedir* is not given, then the default system locale directory is used. [#]_ If *languages* is not given, then the following environme... | trusted_official_docs | CPython Docs | identical to what :func:`textdomain` takes. Optional *localedir* is as in :func:`bindtextdomain`. Optional *languages* is a list of strings, where each string is a language code.
If *localedir* is not given, then the default system locale directory is used. [#]_ If *languages* is not given, then the following environme... | identical to what :func:`textdomain` takes. Optional *localedir* is as in :func:`bindtextdomain`. Optional *languages* is a list of strings, where each string is a language code.
If *localedir* is not given, then the default system locale directory is used. [#]_ If *languages* is not given, then the following environme... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8eeed9eb-2b4d-4b30-8519-294ef00bab50 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 24,985 | supabase-export-v2 | ff2e199b06fd79e3 | GNU :program:`gettext` API --------------------------
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
translation of your entire application globally. Often this is what you want if
your application is monolingual, wi... | trusted_official_docs | CPython Docs | GNU :program:`gettext` API --------------------------
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
translation of your entire application globally. Often this is what you want if
your application is monolingual, wi... | GNU :program:`gettext` API --------------------------
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
translation of your entire application globally. Often this is what you want if
your application is monolingual, wi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8ff2126e-0e1e-4059-b399-050e88b584f5 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,051 | supabase-export-v2 | f568fd62776f2267 | 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'``.
Note that this is only one way, albeit the most convenient way, to make
the :func:`!_` function available to your applicatio... | trusted_official_docs | CPython Docs | 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'``.
Note that this is only one way, albeit the most convenient way, to make
the :func:`!_` function available to your applicatio... | 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'``.
Note that this is only one way, albeit the most convenient way, to make
the :func:`!_` function available to your applicatio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
913677a8-7771-42fa-9408-69bd6cdb6b9f | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,094 | supabase-export-v2 | dca9a63929090471 | filename = 'mylog.txt' message = _('writing a log message') with open(filename, 'w') as fp: fp.write(message)
In this example, the string ``'writing a log message'`` is marked as a candidate
for translation, while the strings ``'mylog.txt'`` and ``'w'`` are not. | trusted_official_docs | CPython Docs | filename = 'mylog.txt' message = _('writing a log message') with open(filename, 'w') as fp: fp.write(message)
In this example, the string ``'writing a log message'`` is marked as a candidate
for translation, while the strings ``'mylog.txt'`` and ``'w'`` are not. | filename = 'mylog.txt' message = _('writing a log message') with open(filename, 'w') as fp: fp.write(message)
In this example, the string ``'writing a log message'`` is marked as a candidate
for translation, while the strings ``'mylog.txt'`` and ``'w'`` are not. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
944c1ece-6b5a-4ab7-86bb-3e089a7003c6 | CPython Docs | file://datasets/cpython/Doc/library/gettext.rst | unknown | 1df3231a-dda0-4d56-a7df-7d26149f77b7 | 25,007 | supabase-export-v2 | 93da6d1273ddf4ef | Class-based API ---------------
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 recommended
way of localizing your Python applications and modules. :mod:`!gettext` defines
a :class:`GNUTranslations` class which implement... | trusted_official_docs | CPython Docs | Class-based API ---------------
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 recommended
way of localizing your Python applications and modules. :mod:`!gettext` defines
a :class:`GNUTranslations` class which implement... | Class-based API ---------------
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 recommended
way of localizing your Python applications and modules. :mod:`!gettext` defines
a :class:`GNUTranslations` class which implement... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.