[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-04-07 Thread Gobot1234
Gobot1234 added the comment: I was just looking through the git diff for this PR and found a bug in this https://github.com/python/cpython/pull/30887/files#diff-2828caacf5c85c7bd6023ea0e4a381cc5c65179a9822398534c5e9ad9ccbd90dR73. There's a missing f on the io __getattr__'

[issue46743] Enable usage of object.__orig_class__ in __init__

2022-02-14 Thread Gobot1234
Gobot1234 added the comment: > Which classes? Every class that inherits from Generic? That would be > problematic -- we don't want the addition of typing information to change the > behavior of a construct (or at least as little as possible). The class itself would remain

[issue46743] Enable usage of object.__orig_class__ in __init__

2022-02-14 Thread Gobot1234
Gobot1234 added the comment: On the general class instanciation point would there be anything wrong with just adding a big red warning saying (on the non-existent) docs for these classes that they don't follow normal class initization or is this too insignificant of an issue to bother?

[issue46743] Enable usage of object.__orig_class__ in __init__

2022-02-13 Thread Gobot1234
Gobot1234 added the comment: ```py class DefaultBox(Generic[T]): def __init__(self, value: T | None = None): self.value = ( value if value is not None else # the arg self.__orig_class__.__args__[0]() # or the default for the type argument

[issue46743] Enable usage of object.__orig_class__ in __init__

2022-02-13 Thread Gobot1234
Gobot1234 added the comment: Currently I have code that uses the generic argument to a class as the constructor for its `items` https://github.com/Gobot1234/steam.py/blob/f99cb77d58b552f1d493663e7b3455f94977347e/steam/trade.py#L380. As this is called from `BaseInventory.__init__` it

[issue46743] Enable usage of object.__orig_class__ in __init__

2022-02-13 Thread Gobot1234
New submission from Gobot1234 : When using `__call__` on a `typing/types.GenericAlias` `__orig_class__` is set to the `GenericAlias` instance, however currently the mechanism for this does not allow the `__origin__` to access the `GenericAlias` from `__origin__.__init__` as it performs

[issue46644] typing: remove callable() check from typing._type_check

2022-02-05 Thread Gobot1234
Gobot1234 added the comment: I also support this change. I've had to write a lot of code to make SpecialForms able to accept my types where the code has to look like: ```py class Something: ... def __call__(self, *args, **kwargs): raise NotImplementedError ``` I also know

[issue46534] Implementing PEP 673 (Self type)

2022-01-26 Thread Gobot1234
Change by Gobot1234 : -- keywords: +patch pull_requests: +29103 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30924 ___ Python tracker <https://bugs.python.org/issu

[issue46534] Implementing PEP 673 (Self type)

2022-01-26 Thread Gobot1234
New submission from Gobot1234 : See [PEP 673](https://www.python.org/dev/peps/pep-0673) I'm planning to implement this in cpython some point today. -- components: Library (Lib) messages: 411736 nosy: Gobot1234, Jelle Zijlstra, gvanrossum, kj priority: normal severity: normal s

[issue46170] Improving the error message when subclassing NewType

2021-12-26 Thread Gobot1234
Gobot1234 added the comment: > Do you have evidence that people make this particular mistake often? And that > the suggested solution is indeed what they should use? Why would you want to > subclass UserId? I was just trying to implement something that I thought had a non-obvi

[issue46170] Improving the error message when subclassing NewType

2021-12-26 Thread Gobot1234
Change by Gobot1234 : -- keywords: +patch pull_requests: +28485 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30268 ___ Python tracker <https://bugs.python.org/issu

[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 th

[issue46170] Improving the error message when subclassing NewType

2021-12-23 Thread Gobot1234
New submission from Gobot1234 : I'd like to propose making the error message when subclassing typing.NewType much more understandable. Currently it looks like: ``` TypeError: NewType.__init__() takes 3 positional arguments but 4 were given ``` But I think we could do much better by a

[issue45946] RecursionError when annotating a field with the same name as a field

2021-12-01 Thread Gobot1234
New submission from Gobot1234 : Small snippet to reproduce: ``` from dataclasses import dataclass, field @dataclass class Foo: bool: bool = field() ``` Raises ``` --- RecursionErrorTraceback

[issue42183] Stack overflow error with asyncio.all_tasks and wait_for

2020-10-28 Thread Gobot1234
New submission from Gobot1234 : Using asyncio.wait_for and asyncio.all_tasks in combination causes a stack overflow error. Code to reproduce issue: ``` import asyncio async def func(): return asyncio.all_tasks() async def main(): print(await asyncio.wait_for(func(), timeout=10