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.
...subclass of your type, Py_TYPE(self) will refer to that subclass, which may be defined in different module than yours. Note The following Python code can illustrate the concept. Base.get_defining_class returns Base even if type(self) == Sub: class Base: def get_defining_class(self): return __class__ class Sub(Base): pass For a method to get its “defining class”, it must use the METH_METHOD | METH_FASTCALL | METH_KEYWORDS calling convention and the corresponding PyCMethod sig...
...submitted, however GitHub does not have a way to submit Pull Requests against a repository that is not hosted on GitHub. This PEP also proposes that in addition to GitHub Pull Requests Phabricator's Differential app can also be used to submit proposed changes and Phabricator does allow submitting changes against a repository that is not hosted on Phabricator. For this reason this PEP proposes using GitHub as the canonical location of the repository with a read-only mirror located in Phabricator....
...subject: Houston, we have a problem. in the configuration, the string 'cfg://handlers' would resolve to the dict with key handlers, the string 'cfg://handlers.email would resolve to the dict with key email in the handlers dict, and so on. The string 'cfg://handlers.email.toaddrs[1] would resolve to 'dev_team.domain.tld' and the string 'cfg://handlers.email.toaddrs[0]' would resolve to the value 'support_team@domain.tld'. The subject value could be accessed using either 'cfg://handlers.email.su...
...sub domain of pypi.python.org means that the mirror operators will never be able to get a SSL certificate of their own, and giving them one for a python.org domain name is unlikely to happen. The auto discovery uses an unauthenticated protocol (DNS). The lack of a TLS certificate on these domains means that clients can not be sure that they have not been a victim of DNS poisoning or a MITM attack. The auto discovery protocol was designed to enable a client to automatically select a mirror for us...
...Substantial changes in a given interest area require a PEP. This includes: Any semantic or syntactic change to the language. Backwards-incompatible changes to the standard library or the C API. Additions to the standard library, including substantial new functionality within an existing library. Removing language, standard library, or C API features. Failure to get a substantial change through the PEP process might result with the change being reverted. Changes that are bug fixes can be exemp...
...sub-packages. Each sub-package has an official maintainer as well as one or more deputies, who are responsible for ensuring code is reviewed and generally architecting the subpackage. Code-level decisions are therefore made in GitHub issues or pull requests (PRs), usually on the basis of consensus, moderated by the maintainer and deputies of that sub-package. When there is specific disagreement, majority vote of those who are involved in the discussion (e.g. PR) determines the winner, with the...
...sub-table's name is an entry point group. The key and value semantics are the same as [project.scripts]. Users MUST NOT create nested sub-tables but instead keep the entry point groups to only one level deep. Build back-ends MUST raise an error if the metadata defines a [project.entry-points.console_scripts] or [project.entry-points.gui_scripts] table, as they would be ambiguous in the face of [project.scripts] and [project.gui-scripts], respectively. dependencies/optional-dependencies Format...
...sub-optimal, due to the necessary conversions). Moreover, not one type would be needed, but two: one immutable type (to allow for hashing), and one mutable type (as efficient accumulation is often necessary when working with network messages). Resolution This PEP is made obsolete by the acceptance of PEP 461, which introduces a more extended formatting language for bytes objects in conjunction with the modulo operator. References Issue #3982: support .format for bytes Mercurial project Twi...
...sub-second resolutions. os.stat() uses float timestamps by default since Python 2.5. Python 3.3 introduced functions supporting nanosecond resolutions: os module: futimens(), utimensat() time module: clock_gettime(), clock_getres(), monotonic(), wallclock() os.stat() reads nanosecond timestamps but returns timestamps as float. The Python float type uses binary64 format of the IEEE 754 standard. With a resolution of one nanosecond (10-9), float timestamps lose precision for values bigger than 2...
...subroutines (which here refers to functions, sub-generators or sub-coroutines) without affecting the semantics of context variables. Regarding implementation, this proposal aims at simplicity and minimum changes to the CPython interpreter and to other Python interpreters. Rationale Consider a modern Python call chain (or call tree), which in this proposal refers to any chained (nested) execution of subroutines, using any possible combinations of normal function calls, or expressions using awai...
...subclasses The second step of the resolution is to extend the hierarchy by defining subclasses which will be raised, rather than their parent, for specific errno values. Which errno values is subject to discussion, but a survey of existing exception matching practices (see Appendix A) helps us propose a reasonable subset of all values. Trying to map all errno mnemonics, indeed, seems foolish, pointless, and would pollute the root namespace. Furthermore, in a couple of cases, different errno va...
...subclass overrides the __call__ method. If callables could be sub-classed then any call to a function or a method_descriptor would need an additional check that the __call__ method had not been overridden. By exposing an additional call mechanism, the potential for errors becomes greater. As a consequence, any third-party class implementing the addition call interface will not be usable as a base class. New classes and changes to existing classes Python visible changes A new built-in clas...
...sub-table within [tool], e.g. the flit tool would store its configuration in [tool.flit]. We need some mechanism to allocate names within the tool.* namespace, to make sure that different projects don't attempt to use the same sub-table and collide. Our rule is that a project can use the subtable tool.$NAME if, and only if, they own the entry for $NAME in the Cheeseshop/PyPI. JSON Schema To provide a type-specific representation of the resulting data from the TOML file for illustrative purpose...
...Sub-package renamings where the package name may or may not be renamed, such as email.MIMEText to email.mime.text; Extension module renaming, such as cStringIO to cstringio; Third party renaming of any of the above. Two use cases supported by this PEP include renaming simple top-level modules, such as StringIO, as well as modules within packages, such as email.MIMEText. In the former case, PEP 3108 currently recommends StringIO be renamed to stringio, following PEP 8 recommendations. In the lat...
...subscript access and use a special-check for integers to check for the slot as well. Add the nb_index slot to integers and long_integers (which just return themselves) Add PyNumber_Index C-API to return an integer from any Python Object that has the nb_index slot. Add the operator.index(x) function. Alter arrayobject.c and mmapmodule.c to use the new C-API for their sub-scripting and other needs. Add unit-tests Discussion Questions Speed Implementation should not slow down Python because int...
...sub-variants: EXCEPTION may be an exception class or an instance of an exception class; valid exception classes are BaseException and its subclasses (PEP 352). If EXCEPTION is a subclass, it will be called with no arguments to obtain an exception instance. To raise anything else is an error. There is a further, more tangible benefit to be obtained through this consolidation, as noted by A.M. Kuchling [2]. PEP 8 doesn't express any preference between the two forms of raise statements: raise Va...
...subpackage1/ __init__.py moduleX.py moduleY.py subpackage2/ __init__.py moduleZ.py moduleA.py Assuming that the current file is either moduleX.py or subpackage1/__init__.py, following are correct usages of the new syntax: from .moduleY import spam from .moduleY import spam as ham from . import moduleY from ..subpackage1 import moduleY from ..subpackage2.moduleZ import eggs from ..moduleA import foo from ...package import bar from ...sys import pa...
...sub() replaces only several matches" https://bugs.python.org/issue12078 [5]An example of meta issue using dependencies to track sub-issues: "Meta-issue: support of the android platform"" https://bugs.python.org/issue26865 [6]Support logging in with GitHub https://github.com/python/bugs.python.org/issues/7 [7]Re: [Roundup-devel] PEP 581 and Google Summer of Code https://sourceforge.net/p/roundup/mailman/message/36667828/ [8] [Tracker-discuss] [issue624] bpo emails contain ...
...subscripts. Why not use a sublocal scope and prevent namespace pollution? Previous revisions of this proposal involved sublocal scope (restricted to a single statement), preventing name leakage and namespace pollution. While a definite advantage in a number of situations, this increases complexity in many others, and the costs are not justified by the benefits. In the interests of language simplicity, the name bindings created here are exactly equivalent to any other name bindings, including ...
...submodule or subpackage proceeds, using that virtual path to find the submodule or subpackage. (Just as it would have with the parent's __path__, if the parent package had existed and had a __path__.) When a submodule or subpackage is found (but not yet loaded), the parent package is created and added to sys.modules (if it didn't exist before), and its __path__ is set to the computed virtual path (if it wasn't already set). In this way, when the actual loading of the submodule or subpackage occ...