[issue40397] Refactor typing._GenericAlias

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Looks like there's nothing left to do here. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37923] Combining typing.get_type_hints and inspect.signature

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: As of Python 3.10, thanks to Larry Hastings inspect.signature will have a new eval_str= parameter that lets you evaluate string annotations. This isn't quite what you're asking for, though, because typing.get_type_hints does more work than eval_str does

[issue32752] no information about accessing typing.Generic type arguments

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We have typing.get_args() as of 3.8. -- nosy: +Jelle Zijlstra resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue28556] typing.py upgrades

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Looks like this is no longer relevant. -- nosy: +Jelle Zijlstra resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We could add a new argument to `@functools.wraps()` to differentiate between a wrapper with the same signature and one with a different signature. Here's a possible design: * functools.wraps adds a new keyword-only argument signature_changed. It defaults

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: That's because inspect.signature by default follows the `.__wrapped__` attribute, so it gives you the signature for the *wrapped* function. That behavior is occasionally problematic (I ran into it in the context of https://github.com/quora/pyanalyze/issues

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We should not do this, because the wrapping function may have different defaults, and updating __defaults__ would make it use the wrapped function's defaults. Example: >>> def f(y=1): ... print(y) ... >>> f() 1 >>>

[issue44006] symbol documentation still exists

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: You're right, the file doesn't exist on master. I guess there must be some sort of caching. For what it's worth, I found it by going to the module documentation on an earlier version and using the dropdown to navigate to 3.10. If you go to the dataclasses

[issue44006] symbol documentation still exists

2021-05-01 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : symbol is being removed in 3.10, but https://docs.python.org/3.10/library/symbol.html still exists and claims it will be removed in "future versions". It was removed in bpo-40939 / GH-21005. -- assignee: docs@python components: Doc

[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +lukasz.langa, ned.deily, pablogsal ___ Python tracker <https://bugs.python.org/issue44000> ___ ___ Python-bugs-list mailin

[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: PEP 440 applies to Python packages, not to CPython itself. The "+" convention has been used in CPython for a long time, and changing it without a strong justification seems risky. -- nosy: +Jelle Zijlstra -lukasz.langa, ned.deily,

[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-01 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : After the changes from bpo-42345, the Literal documentation claims that "Literal objects will now raise a TypeError exception during equality comparisons if one of their parameters are not immutable." But in fact it's *unhashable* types

[issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules

2021-04-27 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: For what it's worth, I checked grep.app and found only one usage of del on __annotations__, in a test suite: https://github.com/go-python/gpython/blob/master/py/tests/function.py#L82. Changing its behavior seems very low risk. -- nosy: +Jelle

[issue32891] Add 'Integer' as synonym for 'Integral' in numbers module.

2021-04-26 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Like Mark I'm opposed to this change. It requires little work in CPython itself, but numbers.Integral has now been a part of the language for many years and the name is used in numerous third-party projects. Forcing all of them to change doesn't seem

[issue43817] Add inspect.get_annotations()

2021-04-26 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I agree with Guido that it's better to design inspect.signature to not throw an error for annotations that don't eval() cleanly. I use inspect.signature for getting information about callables (third-party and first-party) in my type checker: https

[issue43817] Add typing.get_annotations()

2021-04-12 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +Jelle Zijlstra ___ Python tracker <https://bugs.python.org/issue43817> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch nosy: +Jelle Zijlstra nosy_count: 4.0 -> 5.0 pull_requests: +24074 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25339 ___ Python tracker

[issue43803] ctypes string_at/wstring_at bad argument name

2021-04-10 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: It's a bit worse: the actual name is "ptr", the function docstrings say "addr", and the documentation (https://docs.python.org/3.9/library/ctypes.html#ctypes.string_at) has "address". I'd favor updating them all to say &q

[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-08 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +24029 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25298 ___ Python tracker <https://bugs.python.org/issu

[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-08 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- assignee: -> Jelle Zijlstra ___ Python tracker <https://bugs.python.org/issue43783> ___ ___ Python-bugs-list mailing list Un

[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-08 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : Currently, typing.ParamSpec.args and ParamSpec.kwargs are just object() instances, which makes them useless for runtime inspection of __annotations__. This type was introduced by PEP 612. Instead, I propose to make them return some special helper object

[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-03 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +23916 pull_request: https://github.com/python/cpython/pull/25174 ___ Python tracker <https://bugs.python.org/issue37

[issue43723] Deprecate camelCase aliases from threading.py

2021-04-03 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +23915 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25174 ___ Python tracker <https://bugs.python.org/issu

[issue43723] Deprecate camelCase aliases from threading.py

2021-04-03 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : Followup from issue37804: deprecate the remaining camelCase aliases, such as threading.currentThread. PR coming soon. -- assignee: Jelle Zijlstra components: Library (Lib) messages: 390165 nosy: Jelle Zijlstra, pitrou priority: normal severity

[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Sure, I can submit a PR. While we're at it, we should probably also deprecate the setter/getter methods that you mention. Here's what I propose doing: - On 3.10 (or 3.11 if it's too late for 3.10), make getName and friends throw a DeprecationWarning

[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The threading documentation for 3.9 still claims "While they are not listed below, the camelCase names used for some methods and functions in this module in the Python 2.x series are still supported by this module." It would be better to me

[issue43616] random.shuffle() crashes with Unhandled exception

2021-03-24 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Could you post code that fully reproduces the problem? I suspect the root cause for the bug is in lxml (a third-party library), not in CPython itself. -- nosy: +Jelle Zijlstra ___ Python tracker <ht

[issue40826] Segfaults on io.FileIO(0).name in 3.9

2020-05-30 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : $ gdb ./python ... (gdb) r ... Python 3.9.0b1 (tags/v3.9.0b1:97fe9cfd9f8, May 30 2020, 05:26:48) ... >>> import io >>> io.FileIO(0).name 0 >>> Program received signal SIGSEGV, Segmentation fault. _PyInterpreterState_G

[issue40397] Refactor typing._GenericAlias

2020-05-10 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks Serhyi! I can confirm that the issue I posted is fixed. -- priority: release blocker -> normal ___ Python tracker <https://bugs.python.org/issu

[issue40397] Refactor typing._GenericAlias

2020-05-08 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The most recent change here caused a regression. The following file: ``` from typing import Generic, TypeVar, Union class CannotTransform(Exception): pass T = TypeVar("T") E = TypeVar("E", bound=Exception) class Ok(Generic[T]): pass

[issue37384] Compiling Python 3.7.3 from source and getting all sorts of errors on Debian?

2019-06-24 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: As Ned and Christian hinted, the issue might be related to --enable-optimizations. Have you tried compiling without that flag? -- nosy: +Jelle Zijlstra ___ Python tracker <https://bugs.python.org/issue37

[issue33482] codecs.StreamRecoder.writelines is broken

2019-05-22 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +13417 ___ Python tracker <https://bugs.python.org/issue33482> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33482] codecs.StreamRecoder.writelines is broken

2019-05-22 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +13416 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issue33482> ___ ___ Python-

[issue34648] Confirm the types of parameters of traceback.format_list and traceback.StackSummary.from_list post-3.5

2018-09-24 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: > How people can get Iterable[FrameSummary] as an input and pass it to > format_list()? If I want to format a traceback, but omit traceback lines that refer to a particular module (for example, code for a coroutine runner), I could write `forma

[issue31861] aiter() and anext() built-in functions

2018-06-14 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Do these really need to be builtins? They seem too specialized to be widely useful; I've personally never needed them in any async code I've written. It would make more sense to me to put them in a module like operators. -- nosy: +Jelle Zijlstra

[issue33519] Should MutableSequence provide .copy()?

2018-05-17 Thread Jelle Zijlstra
Change by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- keywords: +patch pull_requests: +6623 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue33519] Should MutableSequence provide .copy()?

2018-05-15 Thread Jelle Zijlstra
Jelle Zijlstra <jelle.zijls...@gmail.com> added the comment: Makes sense. I can provide a patch to the docs. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33519] Should MutableSequence provide .copy()?

2018-05-15 Thread Jelle Zijlstra
New submission from Jelle Zijlstra <jelle.zijls...@gmail.com>: https://docs.python.org/3.7/library/stdtypes.html#mutable-sequence-types lists .copy() among the methods provided by mutable sequences. However, MutableSequence does not actually define .copy(): https://github.com/python/c

[issue33482] codecs.StreamRecoder.writelines is broken

2018-05-13 Thread Jelle Zijlstra
Change by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- keywords: +patch pull_requests: +6465 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue33482] codecs.StreamRecoder.writelines is broken

2018-05-13 Thread Jelle Zijlstra
New submission from Jelle Zijlstra <jelle.zijls...@gmail.com>: codecs.StreamRecoder.writelines is implemented as: def writelines(self, list): data = ''.join(list) data, bytesdecoded = self.decode(data, self.errors) return self.writer.write(data) It can'

[issue30406] async and await should be keywords in 3.7

2018-03-18 Thread Jelle Zijlstra
Change by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +5900 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener}

2017-11-06 Thread Jelle Zijlstra
New submission from Jelle Zijlstra <jelle.zijls...@gmail.com>: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.connection.Client claims that there is an "authenticate" argument, but it does not exist in the implementation (https://github.com/python/cpy

[issue31698] Add REQ_NAME to the node.h API

2017-10-08 Thread Jelle Zijlstra
Change by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- keywords: +patch pull_requests: +3900 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31698] Add REQ_NAME to the node.h API

2017-10-04 Thread Jelle Zijlstra
New submission from Jelle Zijlstra <jelle.zijls...@gmail.com>: See https://github.com/python/cpython/pull/1669#pullrequestreview-67229284 -- assignee: Jelle Zijlstra components: Interpreter Core messages: 303739 nosy: Jelle Zijlstra, yselivanov priority: low severity: normal

[issue30984] traceback.print_exc return value documentation

2017-07-21 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: The documentation for traceback.format_tb says "Return a list of “pre-processed” stack trace entries extracted from the traceback object tb. It is useful for alternate formatting of stack traces. The optional limit argument has the same me

[issue28638] Optimize namedtuple creation

2017-07-18 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks Joe! I adapted your benchmark suite to also run my implementation. See https://github.com/JelleZijlstra/cnamedtuple/commit/61b6fbf4de37f8131ab43c619593327004974e52 for the code and results. The results are consistent with what we've seen before. Joe's

[issue28638] Optimize namedtuple creation

2017-07-18 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I benchmarked some common namedtuple operations with the following script: #!/bin/bash echo 'namedtuple creation' ./python -m timeit -s 'from collections import namedtuple' 'x = namedtuple("x", ["a", "b", "c"])' ech

[issue28638] Optimize namedtuple creation

2017-07-17 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- resolution: rejected -> ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue28638] Optimize namedtuple creation

2017-07-17 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Should we consider a C-based implementation like https://github.com/ll/cnamedtuple? It could improve speed even more, but would be harder to maintain and test and harder to keep compatible. My sense is that it's not worth it unless benchmarks show

[issue28638] Optimize namedtuple creation

2017-07-16 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +2796 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2017-07-15 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I'm also concerned that the slowness of namedtuple creation is causing people to avoid using it. I can see why we wouldn't want a complicated solution like using Argument Clinic, but it's not clear to me why Serhiy's approach in namedtuple-no-compile.patch

[issue30896] BytesWarning in re module when compiling certain bytes patterns

2017-07-10 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: This code in sre_parse (line 738 and down): warnings.warn( 'Flags not at the start of the expression %s%s' % ( source.string[:20], # truncate long regexes

[issue30623] python-nightly import numpy fails since recently

2017-06-10 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Sounds like the issue is with numpy, not CPython, so there's little reason to keep this CPython bug open. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30623] python-nightly import numpy fails since recently

2017-06-10 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The error is /home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/numpy/core/multiarray.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyTraceMalloc_Untrack. On a quick look I couldn't find any recent changes in CPython related to tracemalloc

[issue30266] AbstractContextManager should support __method__ = None

2017-06-09 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for doing the merge and backport! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30518] Import type aliases from another module

2017-05-30 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: This is likely an issue with the setup of your project, not with type aliases. You haven't given enough information to tell me what the real problem is. I'm not sure what you mean by "I still can't compile 'Blocks'". -- nosy: +Jell

[issue30484] Garbage Collector can cause Segfault whilst iterating dictionary items

2017-05-29 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I could reproduce this on 3.4, but not on 3.3, 2.7, or master. -- nosy: +Jelle Zijlstra versions: +Python 3.4 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-05-23 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Even with the patch, I don't think it's safe to modify os.environ while it's being accessed concurrently in another thread. The other thread's modification could arrive while the dict() call in your patch is running (in CPython the GIL might protect you

[issue30424] make pydoc-topics fails

2017-05-21 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- assignee: -> docs@python components: +Documentation nosy: +docs@python stage: -> needs patch versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <h

[issue30424] make pydoc-topics fails

2017-05-21 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: Running `make pydoc-topics` in Doc/ on master fails with $ make pydoc-topics sphinx-build -b pydoc-topics -d build/doctrees -D latex_elements.papersize= . build/pydoc-topics Running Sphinx v1.6.1 making output directory... loading pickled environment

[issue30359] Annotating a function as returning an (async) context manager?

2017-05-20 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- nosy: +Jelle Zijlstra ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30406] async and await should be keywords in 3.7

2017-05-19 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +1763 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30406] async and await should be keywords in 3.7

2017-05-19 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: According to PEP 492, async and await should be full keywords in Python 3.7, but this hasn't been implemented yet. I have a patch ready that I'll submit as a PR soon. -- components: Interpreter Core messages: 293976 nosy: Jelle Zijlstra

[issue30266] AbstractContextManager should support __method__ = None

2017-05-03 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +1546 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30266] AbstractContextManager should support __method__ = None

2017-05-03 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: Like other ABCs, contextlib.AbstractContextManager should support the pattern where setting a method to None disables structural subtyping, which was introduced across the standard library in issue 25958. Ivan Levkivskyi suggested making

[issue30241] Add contextlib.AbstractAsyncContextManager

2017-05-02 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +1520 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30241] Add contextlib.AbstractAsyncContextManager

2017-05-02 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: It would be useful to have an abstract base class for asynchronous context managers, similar to the existing contextlib.AbstractContextManager. We can then also add this class to typing and use it as a PEP 544 Protocol. I have code ready

[issue30235] Validate shutil supports path-like objects, update docs accordingly

2017-05-02 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +1501 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30218] shutil.unpack_archive doesn't support PathLike

2017-04-30 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +1476 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30218] shutil.unpack_archive doesn't support PathLike

2017-04-30 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: According to PEP 519, it should. I'll submit a PR soon. -- components: Library (Lib) messages: 292642 nosy: Jelle Zijlstra, brett.cannon, tarek priority: normal severity: normal status: open title: shutil.unpack_archive doesn't support PathLike

[issue30174] Duplicate code in pickletools.py

2017-04-26 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: The bytes1 ArgumentDescriptor is duplicated in pickletools.py. -- messages: 292364 nosy: Jelle Zijlstra, alexandre.vassalotti priority: normal pull_requests: 1408 severity: normal status: open title: Duplicate code in pickletools.py

[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The example is actually correct; I just confirmed by running it in my shell. Type annotations on local variables are not evaluated at runtime; see PEP 526. -- nosy: +Jelle Zijlstra ___ Python tracker <

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I agree with George that supporting None here is the better option. This problem also applies to collections.deque. tuple, list, and deque all have very similar index implementations, and it would be nice to merge their argument parsing boilerplate

[issue29162] pyshell.py: name 'sys' is not defined

2017-03-26 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +735 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29847] Path takes and ignores **kwargs

2017-03-20 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks, I'll add a PR. This doesn't need to be documented, right? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29847] Path takes and ignores **kwargs

2017-03-18 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: pathlib.Path.__new__ takes **kwargs, but doesn't do anything with them (https://github.com/python/cpython/blob/master/Lib/pathlib.py#L979). This doesn't appear to be documented. This feature should presumably be either documented or removed (probably

[issue29825] PyFunction_New() not validate code object

2017-03-17 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I don't think this is a bug; it is known and expected that you can do all kinds of bad things by writing bytecode manually. (You can already make Python write to random memory by giving it LOAD_FAST or STORE_FAST opcodes with incorrect offsets.) This doesn't

[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I'll look into creating a PR when I have some time. It would also be useful to tweak the Travis/coverage configuration so that it fails loudly if one of the tests doesn't pass in the coverage check. -- ___ Python

[issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError

2017-03-02 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- nosy: +Jelle Zijlstra ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29691] Some tests fail in coverage Travis check

2017-03-02 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: A few tests fail in the coverage Travis target (see e.g. https://travis-ci.org/python/cpython/jobs/206480468): test_traceback and test_xml_etree. I extracted the actual failures by running in verbose mode locally

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks, I'll address your PR comments. issue 29302 is asking for AsyncExitStack, but that can be an independent change. I haven't personally felt the need for AsyncExitStack. -- ___ Python tracker <

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- pull_requests: +307 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29679] Add @contextlib.asynccontextmanager

2017-02-28 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: An async equivalent of @contextmanager would be an obvious use case for async generators and the async with statement. In my own code, I have several async context objects that could have been written more concisely if @asynccontextmanager was available

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Fixed the typo -- Added file: http://bugs.python.org/file46445/issue29310-3.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-27 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks! Uploaded a revised patch. -- Added file: http://bugs.python.org/file46442/issue29310-2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-24 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- assignee: Jelle Zijlstra -> ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-24 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- keywords: +patch Added file: http://bugs.python.org/file46410/issue29310.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-18 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: Document https://github.com/python/typing/pull/338 I should have a patch in the next few days; creating this issue to remind myself. -- assignee: Jelle Zijlstra components: Documentation messages: 285740 nosy: Jelle Zijlstra priority: normal

[issue29198] AsyncGenerator is missing from typing

2017-01-08 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: Added file: http://bugs.python.org/file46220/typingindentation.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29198] AsyncGenerator is missing from typing

2017-01-08 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: Added file: http://bugs.python.org/file46219/asyncgenerator3.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29205] col_offset for AsyncFunctionDef AST nodes is wrong

2017-01-08 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: -- keywords: +patch Added file: http://bugs.python.org/file46215/issue29205.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29205] col_offset for AsyncFunctionDef AST nodes is wrong

2017-01-08 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The col_offset is actually correct when there is a decorator: In [26]: code = '@decorator\nasync def f(): pass' In [27]: tree = ast.parse(code) In [28]: tree.body[0].col_offset Out[28]: 0 The same issue appears with async for and async with: In [31]: code

[issue29205] col_offset for AsyncFunctionDef AST nodes is wrong

2017-01-08 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: The col_offset attribute for ast.AsyncFunctionDef objects points to the "def" keyword, not to the "async" keyword that actually starts the node. Test case: In [18]: code = 'async def f(): pass' In [19]: tree = ast.parse(code) In [20]:

[issue29198] AsyncGenerator is missing from typing

2017-01-07 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: Added file: http://bugs.python.org/file46203/asyncgenerator2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29198] AsyncGenerator is missing from typing

2017-01-07 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: PEP 525 async generators weren't added to typing.py, probably by oversight. I sent pull requests to typing and typeshed on GitHub to add an AsyncGenerator class and stub: - https://github.com/python/typing/pull/346 - https://github.com/python/typeshed/pull

[issue28967] copy.copy fails on threading.local subclass

2016-12-13 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: This might be due to issue22995. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28967> ___ ___

[issue28967] copy.copy fails on threading.local subclass

2016-12-13 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: Calling copy.copy on a threading.local subclass copies attributes over correctly in Python 2.7, but creates an empty object in Python 3.3-3.5 and fails with a pickle-related error in 3.6. Marking this as a release blocker and assigning to Ned because

[issue28962] Crash when throwing an exception with a malicious __hash__ override

2016-12-13 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: $ cat baderror.py class BadError(Exception): def __init__(self): self.i = 0 def __hash__(self): self.i += 1 return self.i e = BadError() raise e from e $ ./python.exe -V Python 3.5.2+ $ ./python.exe baderror.py Segmentation

[issue28603] traceback module can't format/print unhashable exceptions

2016-12-13 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: Added file: http://bugs.python.org/file45872/issue28603-list.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue28603] traceback module can't format/print unhashable exceptions

2016-12-13 Thread Jelle Zijlstra
Changes by Jelle Zijlstra <jelle.zijls...@gmail.com>: Added file: http://bugs.python.org/file45871/issue28603-ignore.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

<    1   2   3   4   5   6   >