[issue46126] Unittest output drives developers to avoid docstrings

2021-12-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45665] Problems caused by isinstance(list[int], type) returning True

2021-12-24 Thread Guido van Rossum
Guido van Rossum added the comment: See https://github.com/python/mypy/issues/9773#issuecomment-1000975000. I may have talked myself into agreeing with Serhiy there! It does seem inconsistent that Any is not considered a type but list[int] is: >>> isinstance(list[int], type) True >>> import

[issue46175] Zero argument super() does not function properly inside generator expressions

2021-12-24 Thread Alex Walters
New submission from Alex Walters : When zero argument super is used inside a generator expression, it raises 'TypeError: super(type, obj): obj must be an instance or subtype of type'. I can find no information on if this is working as intended, a bug, or a known issue, and the error isn't

[issue46174] Feature Request for Python Interfaces

2021-12-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: (IDLE does not support typing.Protocol classes, because no one has proposed that it do so, let alone submit a patch.) A new keyword requires a PEP that specifies the syntax for an 'interface' statement and what such a statement would do. You should start

[issue46172] [doc] Outdated description of `license` object

2021-12-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: On Windows, with the python.orgs 3.9.9, 3.10.1, and 3.11.0b3 installers, 'licence' displays the documented text. Ditto for all 3 build from repository. Ditto for 3.10.1 on Mac. The behavior is set, I believe, in site.py, so your system ignored the doc.

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Cyker Way
Cyker Way added the comment: Alright that helps. I guess I now understand what's happening here. Here are the two numbers in question: >>> M = int('1'*53+'0'*971, 2) >>> N = int('1'*53+'0'+'1'*970, 2) M is the largest number in binary64 range, while N is the largest number that does not

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2021-12-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Pablo, Mark: I am guessing that at least one of you know about this. -- nosy: +Mark.Shannon, pablogsal, terry.reedy ___ Python tracker ___

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I also use comments in lieu of docstrings for text_xyx methods because I find the addition of the first line of the docstring in error reports to be useless, distracting, and sometimes, depending on the content, confusing. If the error is in the test

[issue46162] Make `builtins.property` generic

2021-12-24 Thread Nikita Sobolev
Nikita Sobolev added the comment: Serhiy, no, we can infer that. There are two general cases: 1. `x = property(x_get, x_set)`, it is just ideal 2. `@property x` and `@x.setter`, it is also inferable with a bit of special casing for the mutable type part (we mutate the type of `x` when

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-24 Thread Éric Araujo
Éric Araujo added the comment: > I presume I don't need to explain why docstrings are nice and preferable over > comments. Actually, can you? Docstrings to document regular modules, classes or functions are a fine tool, especially with tools that extract them (pydoc, sphinx). I don’t see

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-24 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28472 pull_request: https://github.com/python/cpython/pull/30250 ___ Python tracker

[issue46162] Make `builtins.property` generic

2021-12-24 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +AlexWaygood ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46162] Make `builtins.property` generic

2021-12-24 Thread Marc Mueller
Change by Marc Mueller : -- nosy: +cdce8p ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 1b30660c3b40da557050948ac8635f2dc50c4ee2 by Nikita Sobolev in branch 'main': bpo-46120: State that `|` is preferred over `Union` (GH-30222) https://github.com/python/cpython/commit/1b30660c3b40da557050948ac8635f2dc50c4ee2 -- nosy:

[issue10202] ftplib doesn't check close status after sending file

2021-12-24 Thread Gregory P. Smith
Change by Gregory P. Smith : -- stage: test needed -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue10202] ftplib doesn't check close status after sending file

2021-12-24 Thread Gregory P. Smith
Change by Gregory P. Smith : -- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 3.2 ___ Python tracker ___

[issue10202] ftplib doesn't check close status after sending file

2021-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: [pasting in my investigation that I replied with on a mailing list:] The possible problem does appear real but it likely not frequently observed and is something most people reading the code wouldn't see as it's rather esoteric:

[issue2756] urllib.request.add_header fails with existing unredirected_header

2021-12-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- title: urllib2 add_header fails with existing unredirected_header -> urllib.request.add_header fails with existing unredirected_header ___ Python tracker

[issue2756] urllib2 add_header fails with existing unredirected_header

2021-12-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Bug needs to be verified on 3.10 or 3.11. -- nosy: +terry.reedy versions: +Python 3.10, Python 3.11 -Python 2.6, Python 2.7 ___ Python tracker

[issue4079] urllib.requst.Request 'timeout' attribute needs to have a default

2021-12-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: urllib2 became urllib.request in 3.x. In 2.6, 'timeout' became a parameter of both urlopen and OpenerDirector.open. In both cases the default was and is the 'global default timeout setting'. So 'timeout' has a default. Both functions take a Request

[issue37295] Possible optimizations for math.comb()

2021-12-24 Thread Tim Peters
Tim Peters added the comment: If people are keen to speed comb() for larger arguments, the approach in Stefan's "comb_with_primes.py" is very much worth looking at. I've played with that idea before, and it runs circles around any other approach I've seen. The only divisions it does are of

[issue46174] Feature Request for Python Interfaces

2021-12-24 Thread Gobot1234
Gobot1234 added the comment: > Protocol class is not supported by IDEs for type hints, completions, bug > findings, etc. I think most good modern IDEs support using Protocols as type hints, offer completions on them and help you to find bugs with static analysis. That was one of the main

[issue46171] venv module produces spurious warning that location has moved

2021-12-24 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46125] Test the preferred API instead of relying on legacy for coverage

2021-12-24 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46118] Migrate importlib.resources into a package

2021-12-24 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Mark Dickinson
Mark Dickinson added the comment: If we wanted to make a change, I think the part of the docs that I'd target would be this sentence: > a floating point number with the same value (within Python’s floating point > precision) is returned It's that "same value (within Python's floating point

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, exactly: Python's intentionally following the normal IEEE 754 rules for rounding a value to the binary64 format using the round-ties-to-even rounding rule, as formalised in section 7.4 of IEEE 754-2019 (and quoted by @cykerway). These are the exact

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Cyker Way
Cyker Way added the comment: IEEE 754, 7.4 Overflow: > The overflow exception shall be signaled if and only if the destination > format’s largest finite number is exceeded in magnitude by what would have > been the rounded floating-point result (see 4) were the exponent range >

[issue46174] Feature Request for Python Interfaces

2021-12-24 Thread Or
New submission from Or : Most object oriented languages provide interfaces as part of the core language, this helps bring better design principles to a team's workflows. Today Python provides the ABC module for abstract base classes and the Protocol class from typing module as something that

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Cyker Way
Cyker Way added the comment: If python's float strictly adheres to IEEE 754 binary64 (is that so?), then the problem may be caused by rounding. However, even in that case I still don't get the benefits of doing range check on a rounded input but not the input itself. Does IEEE 754 itself

[issue46167] Parse assert (x == y, "Descriptive text") as statement params instead of a tuple

2021-12-24 Thread Guido van Rossum
Guido van Rossum added the comment: You don’t have to use the new feature. But people expect it to work. -- ___ Python tracker ___

[issue46169] Same-moment datetimes with different ZoneInfo timezones are not considered ==

2021-12-24 Thread Daniel Diniz
Change by Daniel Diniz : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: float(x) performs rounding. Only if the value after rounding is out of range is OverflowError raised. M + 1, when correctly rounded to the nearest even float, gives sys.float_info.max. Likewise for M+2, M+3 etc all the way to M+K where K equals 2**960

[issue46171] venv module produces spurious warning that location has moved

2021-12-24 Thread Eryk Sun
Eryk Sun added the comment: There's still the problem of the system using short names in %TEMP%, since by default that's under "%USERPROFILE%\AppData". Either an exception could be made for the temp directory, since it's never redirected (AFAIK), or support could be added for

[issue46171] venv module produces spurious warning that location has moved

2021-12-24 Thread Eryk Sun
Eryk Sun added the comment: There's no point to making the user worry about short names, symlinks, or non-canonical mount points in the filesystem path of a virtual environment. It's still accessible where the user expects to find it. The problem for bpo-45337 is filesystem redirection in

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Cyker Way
New submission from Cyker Way : Acccording to: https://docs.python.org/3/library/functions.html#float >If the argument is outside the range of a Python float, an OverflowError > will be raised. It is well known that the maximum value in IEEE 754 binary64 format is: >>> M =

[issue24364] Not all defects pass through email policy

2021-12-24 Thread mike mcleod
mike mcleod added the comment: I would like to help with this issue. -- nosy: +mikecmcleod ___ Python tracker ___ ___

[issue4849] instantiating and populating xml.dom.minidom.Element is cumbersome

2021-12-24 Thread mike mcleod
mike mcleod added the comment: I would like to help with this issue. I'm new to this space hence I am not aware of what patch review means. -- nosy: +mikecmcleod ___ Python tracker

[issue46156] 3.9.9: python built-in SSL module unable to connect to an IIS server (104 Connection reset by peer), but pyopenssl works fine

2021-12-24 Thread lkraav
lkraav added the comment: > I need more information to diagnose the issue. Could you please provide: > - your operating system and vendor/distribution Gentoo, so rolling, but 20 years of maintenance experience. > - your OpenSSL version (ssl.OPENSSL_VERSION) $ python Python 3.9.9 (main, Dec

[issue45865] Old syntax in unittest

2021-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not worth the hassle. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46172] [doc] Outdated description of `license` object

2021-12-24 Thread Alex Waygood
Change by Alex Waygood : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46172] [doc] Outdated description of `license` object

2021-12-24 Thread CCXXXI
New submission from CCXXXI : https://docs.python.org/3/library/constants.html#license > Object that when printed, prints the message “Type license() to see the full > license text”, and when called, displays the full license text in a > pager-like fashion (one screen at a time). It displays

[issue45865] Old syntax in unittest

2021-12-24 Thread Adam Johnson
Adam Johnson added the comment: Okay, I updated the PR to only remove inheritance from object. Should I reopen the ticket? (Not sure of the etiquette.) Perhaps I could later submit a second patch for use of `super()`, and so on? -- ___ Python

[issue46171] venv module produces spurious warning that location has moved

2021-12-24 Thread layday
New submission from layday : After https://github.com/python/cpython/commit/6811fdaec825bd6ab64e358a4b480108f5634d2d the venv module produces spurious warnings for venv paths which contain DOS-encoded parts e.g. "USER\~1" in "C:\Users\USER~1". `tempfile.gettempdir()` returns legacy paths like

[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a9e0b2b49374df91c40fe409508cfcdc6332450e by Miss Islington (bot) in branch '3.10': bpo-45878: convert `try/except` to `self.assertRaises` in `Lib/ctypes/test/test_functions.py` (GH-29721) (GH-29748)

[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 393ff040281db818f2d6e0240919316f58f989a6 by Miss Islington (bot) in branch '3.9': bpo-45878: convert `try/except` to `self.assertRaises` in `Lib/ctypes/test/test_functions.py` (GH-29721) (GH-29723)

[issue46167] Parse assert (x == y, "Descriptive text") as statement params instead of a tuple

2021-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For very long expression or very long message you can add parentheses around the expression or message. Black will format it as: assert ( very very long expression ), ( "very very long " "message" ) With the proposed feature it will be:

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-24 Thread miss-islington
miss-islington added the comment: New changeset d718764f389acd1bf4a5a65661bb58862f14fb98 by Miss Islington (bot) in branch '3.9': bpo-46150: ensure `fakeuser` does not exist in `PosixPathTest.test_expanduser` (GH-30240)

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-24 Thread miss-islington
miss-islington added the comment: New changeset 8005e22c9c71708ead0e5b16e55e005844c5131f by Miss Islington (bot) in branch '3.10': bpo-46150: ensure `fakeuser` does not exist in `PosixPathTest.test_expanduser` (GH-30240)

[issue46162] Make `builtins.property` generic

2021-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does it mean that property[GetType, SetType] will be required and MyPy will complain if the raw property decorator be used? -- nosy: +serhiy.storchaka ___ Python tracker

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28468, 28469, 28470 pull_request: https://github.com/python/cpython/pull/30249 ___ Python tracker ___

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28468, 28469 pull_request: https://github.com/python/cpython/pull/30249 ___ Python tracker ___

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28468 pull_request: https://github.com/python/cpython/pull/30249 ___ Python tracker ___

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset b8de8b7039cee47465b2af9950b0b9ed2d3f2903 by Nikita Sobolev in branch 'main': bpo-46150: ensure `fakeuser` does not exist in `PosixPathTest.test_expanduser` (GH-30240)