Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
...locale coercion Dropping official support for ASCII based text handling in the legacy C locale Providing implicit locale coercion only when running standalone Allowing restoration of the legacy behaviour Querying LC_CTYPE for C locale detection Explicitly setting LC_CTYPE for UTF-8 locale coercion Avoiding setting LANG for UTF-8 locale coercion Avoiding setting LC_ALL for UTF-8 locale coercion Skipping locale coercion if LC_ALL is set in the current environment Considering locale coercion indepe...
...locale open() locale/strict UTF-8/strict os.fsdecode(), os.fsencode() locale/surrogateescape UTF-8/surrogateescape sys.stdin, sys.stdout locale/strict UTF-8/surrogateescape sys.stderr locale/backslashreplace UTF-8/backslashreplace By comparison, Python 3.6 uses: Function Default POSIX locale open() locale/strict locale/strict os.fsdecode(), os.fsencode() locale/surrogateescape locale/surrogateescape sys.stdin, sys.stdout locale/strict locale/surrogateescape sys.stderr local...
...Locals_GetCopy(); PyLocals_GetCopy() returns a new dict instance populated from the current locals namespace. Roughly equivalent to dict(locals()) in Python code, but avoids the double-copy in the case where locals() already returns a shallow copy. Akin to the following code, but doesn't assume there will only ever be two kinds of locals result: locals = PyLocals_Get(); if (PyLocals_GetKind() == PyLocals_DIRECT_REFERENCE) { locals = PyDict_Copy(locals); } The existing PyEval_GetLocals() A...
...Locals(void) PyObject *PyFrame_GetLocals(PyFrameObject *f) PyEval_Locals() is equivalent to: locals(). PyFrame_GetLocals(f) is equivalent to: f.f_locals. Both functions will return a new reference. Changes to existing APIs The C-API function PyEval_GetLocals() will be deprecated. PyEval_Locals() should be used instead. The following three functions will become no-ops, and will be deprecated: PyFrame_FastToLocalsWithError() PyFrame_FastToLocals() PyFrame_LocalsToFast() The above four depreca...
...locale-specific encoding open(filename) isn't explicit about which encoding is expected: If ASCII is assumed, this isn't a bug, but may result in decreased performance on Windows, particularly with non-Latin-1 locale encodings If UTF-8 is assumed, this may be a bug or a platform-specific script If the locale encoding is assumed, the behavior is as expected (but could change if future versions of Python modify the default) From this point of view, open(filename) is not readable code. encoding=l...
...locale-agnostic functions as necessary. Introduction Python provides generic localization services through the locale module, which among other things allows localizing the display and conversion process of numeric types. Locale categories, such as LC_TIME and LC_COLLATE, allow configuring precisely what aspects of the application are to be localized. The LC_NUMERIC category specifies formatting for non-monetary numeric information, such as the decimal separator in float and fixed-precision n...
...local namespace or an import * will introduce name bindings that shadow the global y. Thus, it is not possible to tell whether the reference to y in g() should refer to the global or to a local name in f(). In discussion of the python-list, people argued for both possible interpretations. On the one hand, some thought that the reference in g() should be bound to a local y if one exists. One problem with this interpretation is that it is impossible for a human reader of the code to determine t...
...locale approach to be frustrating, arcane and non-obvious. The locale module presents two other challenges. First, it is a global setting and not suitable for multi-threaded apps that need to serve-up requests in multiple locales. Second, the name of a relevant locale (such as "de_DE") can vary from platform to platform or may not be defined at all. The docs for the locale module describe these and many other challenges in detail. It is not the goal to replace the locale module, to perform in...
mostly meant for conferences and larger local events
meant for user group events and other smaller local events
...local variables (and globals and thread-locals) have nothing to do with the kind of context-bound information passing that this proposal intends to enable, even if task-locals can be used to emulate the desired semantics. Therefore, in the following, this proposal describes the semantics and the outlines of an implementation for context-local variables (or context variables, contextvars). In fact, as a side effect of this PEP, an async framework can use the proposed feature to implement task-loc...
...Local version identifiers Local version identifiers MUST comply with the following scheme: <public version identifier>[+<local version label>] They consist of a normal public version identifier (as defined in the previous section), along with an arbitrary "local version label", separated from the public version identifier by a plus. Local version labels have no specific semantics assigned, but some syntactic restrictions are imposed. Local version identifiers are used to denote ful...
...localcontext, or numpy.errstate in async/await-using code. So there's clearly a real problem to solve here, and the growing prominence of async code makes it increasingly urgent. Alternative approaches The main alternative that has been proposed is to create some kind of "task-local storage", analogous to "thread-local storage" [1]. In essence, the idea would be that the event loop would take care to allocate a new "task namespace" for each task it schedules, and provide an API to at any given...
...localns=None) function correctly evaluates expressions back from its string form. Note that all valid code currently using __annotations__ should already be doing that since a type annotation can be expressed as a string literal. For code which uses annotations for other purposes, a regular eval(ann, globals, locals) call is enough to resolve the annotation. In both cases it's important to consider how globals and locals affect the postponed evaluation. An annotation is no longer evaluated at ...
...locals[n]) The eggs object strips the leading eggs., stores the (ham, &fastlocals[n]) info, locates the object in its namespace called ham and calls _PyObject_TrackName once again: _PyObject_TrackName(ham, "ham", &fastlocals[n]) The ham object strips the leading string (no "." this time, but that's a minor point), sees that the result is empty, then uses its own value (self, probably) to update the location it was handed: Py_XDECREF(&fastlocals[n]); &fastlocals[n] = self; P...
...locale set to the same value as when the file was created. Most machines are set up as one locale and rarely if ever changed from this locale. For some users, locale is changed more often and on servers there are often files saved by users using different locales. On Windows NT and descendent operating systems, including Windows 2000 and Windows XP, wide-character APIs are available that provide direct access to all file names, including those that are not representable using the current locale...
07 June from 12am UTC , 2014
Location: Av. Assis Brasil, 7765, in the FTEC-Faculdades building, localized at Porto Alegre, RS, Brasil
PyPOA Python Conference
...local administrator for more information. [13] Unix Notes On Unix ~/.local was chosen in favor over ~/.python because the directory is already used by several other programs in analogy to /usr/local. [7] [11] Mac OS X Notes On Mac OS X Python uses ~/.local directory as well. [12] Framework builds of Python include ~/Library/Python/2.6/site-packages as an additional search path. Implementation The site module gets a new method adduserpackage() which adds the appropriate directory to the se...
...local to the function, or else an explicit global or nonlocal declaration. TargetNameError, a new SyntaxError subclass, will be raised at compile time if no such binding or declaration is present. For example, the following code would compile and run as it does today: x = 0 x += 1 # Sets global "x" to 1 class C: x += 1 # Sets local "x" to 2, leaves global "x" alone def local_target(): x = 0 x += 1 # Sets local "x" to 1, leaves global "x" alone def global_target(): global x ...
...locally developed modules. The "expected" location appears to be the directory containing the Python executable itself. This is also the location where distutils (and distutils-generated installers) installs packages. Including locally developed code in the same directory as installed executables is not good practice. Clearly, users can manipulate sys.path, either in a locally modified site.py, or in a suitable sitecustomize.py, or even via .pth files. However, there should be a standard loc...