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.
...heuristic computed over allocation statistics, whenever a new allocation is requested. Details of the heuristic are not relevant to this PEP, as it does not propose to change it. An "explicit" GC run (or "explicit" collection) is one that is requested programmatically by an API call such as gc.collect. "Threaded" refers to the fact that GC runs happen in a dedicated thread separate from sequential execution of application code. It does not mean "concurrent" (the Global Interpreter Lock, or GIL...
...heuristical buffer size, and then grow or shrink if the heuristics failed. With this PEP, this is now less practical, as you need not only a heuristics for the length of the string, but also for the maximum character. In order to avoid heuristics, you need to make two passes over the input: once to determine the output length, and the maximum character; then allocate the target string with PyUnicode_New and iterate over the input a second time to produce the final output. While this may sound ex...
...Heuristics currently suffice in dateutil and pytz for all known time zones, historical and present, and it is not very likely that new time zones will appear that cannot be captured by heuristics — though it is somewhat more likely that new rules that are not captured by the current generation of heuristics will appear; in that case, bugfixes would be required to accommodate the changed situation. The dst() method's utility (and in fact the isdst parameter in TZif) is somewhat questionable to st...
...heuristic hyperlinking of identifier names, no formatting of the docstrings is done. They are presented within <p><small><tt> tags to avoid unwanted line wrapping. Unfortunately, the result is not attractive. PyDoc extracts docstrings and structural information (class identifiers, method signatures, etc.) from imported module objects. There are security issues involved with importing untrusted code. Also, information from the source is lost when importing, such as comments, "...
...heuristic check below pass # Check glibc version. CentOS 7 uses glibc 2.17. # PEP 513 contains an implementation of this function. return have_compatible_glibc(2, 17) Backwards compatibility with manylinux2010 wheels As explained in PEP 513, the specified symbol versions for manylinux1 allowed libraries constitute an upper bound. The same is true for the symbol versions defined for manylinux2014 in this PEP. As a result, manylinux1 and manylinux2010 wheels are considere...
...heuristics to locate a Python executable and launch it with a specified command line. Rationale Windows provides "file associations" so an executable can be associated with an extension, allowing for scripts to be executed directly in some contexts (eg., double-clicking the file in Windows Explorer.) Until now, a strategy of "last installed Python wins" has been used and while not ideal, has generally been workable due to the conservative changes in Python 2.x releases. As Python 3.x scripts...
...heuristics to make sense of. It would be nice if we could allow this protocol to protect us from this complexity, but we cannot do so reliably while still providing to application writers a level of control commensurate with reality. Python applications must often deal with data embedded in the environment which not only must be parsed by legacy heuristics, but does not conform even to any existing HTTP specification. While these eventualities are unpleasant, they crop up with regularity, makin...
...heuristic for the design has been to focus on introducing an abstraction without requiring development not strictly tied to the abstraction. Where the gap is small to improvements, or the cost of using the existing interface is very high, then we've taken on having the improvement as a dependency, but otherwise deferred such to future iterations. We chose wheel METADATA files rather than defining a new specification, because pip can already handle wheel .dist-info directories which encode all th...
...heuristics in the future – for example, we could have manylinux_glibc_$VERSION and manylinux_alpine_$VERSION. But "manylinux" has always been a synonym for "broad compatibility with mainstream glibc-based distros"; reusing it for unrelated build profiles like alpine is more confusing than helpful. Also, some early reviewers who aren't steeped in the details of packaging found the word glibc actively misleading, jumping to the conclusion that it meant they needed a system with exactly that glibc ...
...heuristics, we therefore settled on the .add_note()-and-__notes__ API. Allow any object, and convert to string for display We have not identified any scenario where libraries would want to do anything but either concatenate or replace notes, and so the additional complexity and interoperability challenges do not seem justified. We also note that converting an object to a string may raise an exception. It's more helpful for the traceback to point to the location where the note is attached to th...
...heuristic check below pass # Check glibc version. CentOS 6 uses glibc 2.12. # PEP 513 contains an implementation of this function. return have_compatible_glibc(2, 12) Backwards compatibility with manylinux1 wheels As explained in PEP 513, the specified symbol versions for manylinux1 whitelisted libraries constitute an upper bound. The same is true for the symbol versions defined for manylinux2010 in this PEP. As a result, manylinux1 wheels are considered manylinux2010 w...
...heuristics to decide if a function should be inlined or not. When a C compiler decides to not inline, there is likely a good reason. For example, inlining would reuse a register which requires to save/restore the register value on the stack and so increases the stack memory usage, or be less efficient. Debug build Benchmarks must not be run on a Python debug build, only on release build. Moreover, using LTO and PGO optimizations is recommended for best performances and reliable benchmarks. PGO ...
...heuristic check below pass # Check glibc version. CentOS 5 uses glibc 2.5. return have_compatible_glibc(2, 5) def have_compatible_glibc(major, minimum_minor): import ctypes process_namespace = ctypes.CDLL(None) try: gnu_get_libc_version = process_namespace.gnu_get_libc_version except AttributeError: # Symbol doesn't exist -> therefore, we are not linked to # glibc. return False # Call gnu_get_libc_version, which returns a...
...heuristics, while keyword-only parameters are exposed directly in the AST. In order for tools to correctly identify positional-only parameters, they would need to execute the module to access any metadata the decorator is setting. Any error with the declaration will be reported only at runtime. It may be more difficult to identify positional-only parameters in long function definitions, as it forces the user to count them to know which is the last one that is impacted by the decorator. The / sy...
...heuristics, such as regex-filtering for obviously malicious payloads, there will always be a way to work around them (perfectly distinguishing good and bad queries reduces to the halting problem). Static approaches, such as checking the AST to see if the query string is a literal string expression, cannot tell when a string is assigned to an intermediate variable or when it is transformed by a benign function. This makes them overly restrictive. The type checker, surprisingly, does better than b...
...heuristics for filtering out imported names. Patch #941486: added os.path.lexists(), which returns True for broken symlinks, unlike os.path.exists(). the random module now uses os.urandom() for seeding if it is available. Added a new generator based on os.urandom(). difflib and diff.py can now generate HTML. bdist_rpm now includes version and release in the BuildRoot, and replaces - by _ in version and release. distutils build/build_scripts now has an -e option to specify the path to the Python ...
...heuristics (including checking for the VIRTUAL_ENV environment variable), largely so that the directory used in a virtual environment remains site-packages and not dist-packages. This does not particularly affect this proposal, because the implementation of that patch does not actually change the default sysconfig scheme, and notably does not change the result of sysconfig.get_path("stdlib"). Fedora currently carries a patch to change the default install location when not running inside rpmbuild...
...heuristic to tie in whether a change warranted a news entry would be used, e.g., whether an issue number is listed. This idea has been rejected due to some core developers preferring to write a news entry separate from the commit message. The argument is the first line of a commit message compared to that of a news entry have different requirements in terms of brevity, what should be said, etc. Deriving Misc/NEWS from bugs.python.org A rejected solution to the NEWS file problem was to specify ...
...heuristics, and allows tools to easily and unambiguously detect invalid content. This avoids both false positive (License values that a package author didn't explicitly intend as an explicit SPDX identifier, but that happen to validate as one), and false negatives (expressions the author intended to be valid SPDX, but due to a typo or mistake are not), which are otherwise not clearly distinguishable from true positives and negatives, an ambiguity at odds with the goals of this PEP. Furthermore, ...
...heuristic is used to assess how hot a given function is. Once the hotness value for a function crosses a given threshold, it is selected for compilation and optimization. Until a function is judged hot, however, it runs in the standard CPython eval loop, which in Unladen Swallow has been instrumented to record interesting data about each bytecode executed. This runtime data is used to reduce the flexibility of the generated machine code, allowing us to optimize for the common case. For example, ...