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.
...minus sign were handled inconsistently. This has been fixed in accordance with PEP 237. (New in 2.3a2.) Functions now have a __module__ attribute too. (New in 2.3a2.) Passing a float to C functions expecting an integer now issues a DeprecationWarning; in the future this will become a TypeError. (New in 2.3a2.) Package index and metadata for distutils. This is support for the Python catalog, now open for business at cheeseshop.python.org/pypi. (PEP 301) Support for generators is on by defau...
...minus operator differently for intra- and inter-zone operations. For example, one can easily construct datetime instances t and s with some variable offset tzinfo and a datetime u with tzinfo=timezone.utc such that (t - u) - (s - u) != t - s. The explanation for this paradox is that the minuses inside the parentheses and the two other minuses are really three different operations: inter-zone datetime subtraction, timedelta subtraction, and intra-zone datetime subtraction, which each have the ma...
...minus: minus(d) plus: plus(d) multiply: multiply(d, n) normalize: normalize(d) quantize: quantize(d, d) remainder: remainder(d) remainder-near: remainder_near(d) round-to-integral-value: to_integral(d) same-quantum: same_quantum(d, d) square-root: sqrt(d) power: power(d, n) The divmod(d, n) method supports decimal functionality through Context. These are methods that return useful information from the Context: Etiny(): Minimum exponent considering precision. >>> c.Emin -999999999 >...
...minus sign. This will be changed to use the long int semantics in all cases (but without the trailing L that currently distinguishes the output of hex() and oct() for long ints). Note that this means that %u becomes an alias for %d. It will eventually be removed. Currently, repr() of a long int returns a string ending in L while repr() of a short int doesn't. The L will be dropped; but not before Python 3.0. Currently, an operation with long operands will never return a short int. This may ch...
...minus zero. The only solution without either downside is multiplying an argument (typically the first) by 1.0. This leaves the value and sign unchanged for float and complex, and turns int and long into a float with the corresponding value. It is the opinion of the authors that this is a real design bug in Python, and that it should be fixed sooner rather than later. Assuming Python usage will continue to grow, the cost of leaving this bug in the language will eventually outweigh the cost of f...
...minus libncursesw.so.5 and libpanelw.so.5. [7] libpythonX.Y remains ineligible for inclusion for the same reasons outlined in PEP 513. libcrypt.so.1 was retrospectively removed from the whitelist after Fedora 30 was released with libcrypt.so.2 instead. On Debian-based systems, these libraries are provided by the packages: Package Libraries libc6 libdl.so.2, libresolv.so.2, librt.so.1, libc.so.6, libpthread.so.0, libm.so.6, libutil.so.1, libnsl.so.1 libgcc1 libgcc_s.so.1 libgl1 libGL.s...
...minus x *= y # In-place multiply x @= y # In-place matrix multiply x /= y # In-place division x //= y # In-place int division x %= y # In-place mod x &= y # In-place bitwise and x |= y # In-place bitwise or x ^= y # In-place bitwise xor x <<= y # In-place left shift x >>= y # In-place right shift x **= y # In-place power Of those additional binary operators, the most questionable would be the bitshift assignment operators, since they're each only one doubled character awa...
...minus) for ints: types like Literal[-5] are accepted. Tuples containing valid literal types like Literal[(1, "foo", "bar")]. The user could always express this type as Tuple[Literal[1], Literal["foo"], Literal["bar"]] instead. Also, tuples are likely to be confused with the Literal[1, 2, 3] shortcut. Mutable literal data structures like dict literals, list literals, or set literals: literals are always implicitly final and immutable. So, Literal[{"a": "b", "c": "d"}] is illegal. Any other type...
...minus the @overload decorator) already exists there. The implementation of all of these features in peak.rules.core is 656 lines of Python at this writing. peak.rules.core currently relies on the DecoratorTools and BytecodeAssembler modules, but both of these dependencies can be replaced, as DecoratorTools is used mainly for Python 2.3 compatibility and to implement structure types (which can be done with named tuples in later versions of Python). The use of BytecodeAssembler can be replaced u...
...minus e. Use A Method A dict.merged() method would avoid the need for an operator at all. One subtlety is that it would likely need slightly different implementations when called as an unbound method versus as a bound method. As an unbound method, the behavior could be similar to: def merged(cls, *mappings, **kw): new = cls() # Will this work for defaultdict? for m in mappings: new.update(m) new.update(kw) return new As a bound method, the behavior could be similar ...
...minus hidden and special files sdist.add(os.getcwd(), arcname=SDIST_NAME, filter=_exclude_hidden_and_special_files) return sdist, SDIST_FILENAME def build_sdist(sdist_dir, config_settings): """PEP 517 sdist creation hook""" sdist, sdist_filename = _make_sdist(sdist_dir) return sdist_filename ################# # wheel creation ################# def get_requires_for_build_wheel(config_settings): """PEP 517 wheel building dependency definition hook""" # ...
...minus, they are considered literals for the purpose of pattern matching. Unary plus is not allowed. Binary plus and minus are allowed only to join a real number and an imaginary number to form a complex number, such as 1+1j. Note that because equality (__eq__) is used, and the equivalency between Booleans and the integers 0 and 1, there is no practical difference between the following two: case True: ... case 1: ... Triple-quoted strings are supported. Raw strings and byte strings ar...
...minus.) This syntax has a slight advantage over 'as' in that it does not conflict with with, except and import, but otherwise is equivalent. But it is entirely unrelated to Python's other use of -> (function return type annotations), and compared to := (which dates back to Algol-58) it has a much weaker tradition. Adorning statement-local names with a leading dot: stuff = [[(f(x) as .y), x/.y] for x in range(5)] # with "as" stuff = [[(.y := f(x)), x/.y] for x in range(5)] # with ":=" This...
...minus sign would come out with the wrong sign. ("Unsigned" hex/oct constants are those with a face value in the range sys.maxint+1 through sys.maxint*2+1, inclusive; these have always been interpreted as negative numbers through sign folding.) E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would come out as -4294967295. This was the case in Python 2.2 through 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that value, but according to PEP 237 it really needs...