[issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned

2022-02-01 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue43721> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-02-18 Thread Antony Lee
New submission from Antony Lee : In a first Python process, repeatedly create and delete a file: from pathlib import Path while True: Path("foo").touch(); Path("foo").unlink() In another process, repeatedly check for the path's existence: from pathlib import Pa

[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-03-13 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue46785> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26792] docstrings of runpy.run_{module,path} are rather sparse

2022-04-03 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue26792> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37881] __text_signature__ parser doesn't handle globals in extension module

2019-08-18 Thread Antony Lee
New submission from Antony Lee : Starting from the custom2 example at https://docs.python.org/3/extending/newtypes_tutorial.html#adding-data-and-methods-to-the-basic-example, change the methods table to static PyMethodDef Custom_methods[] = { {"foo", (PyCFunction)

[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-09-03 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue37743> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38045] Flag instance creation is slow

2019-09-06 Thread Antony Lee
New submission from Antony Lee : Consider the following example from enum import Flag F = Flag("F", list("abcdefghijklm")) for idx in range(2**len(F) - 1): F(idx) creating all possible combos of 13 flags, so 8192 instances (yes, I know the instances a

[issue38045] enum.Flag instance creation is slow

2019-09-06 Thread Antony Lee
Antony Lee added the comment: Actually, microoptimizing _power_of_two is a red herring and the problem is the quadratic complexity of _decompose (_value2member_map_ becomes bigger and bigger at each iteration). Replacing the implementation of _decompose by the following fixes the

[issue38603] inspect.getdoc could examine the __class__ cell for dynamically generated subclasses

2019-10-27 Thread Antony Lee
New submission from Antony Lee : Currently, `inspect.getdoc()` fails to inherit docstrings in dynamically generated subclasses, such as ``` class Base: def method(self): "some docstring" def make_subclass(): class subclass(Base): def method(self): return supe

[issue38603] inspect.getdoc could examine the __class__ cell for dynamically generated subclasses

2019-10-27 Thread Antony Lee
Change by Antony Lee : -- keywords: +patch pull_requests: +16485 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16957 ___ Python tracker <https://bugs.python.org/issu

[issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned

2021-04-03 Thread Antony Lee
New submission from Antony Lee : property.{getter,setter,deleter} returns a new property with a new {fget,fset,fdel}. This is documented at https://docs.python.org/3/library/functions.html#property, and intended behavior (see e.g. https://bugs.python.org/issue1620). However the

[issue44019] operator.call/operator.__call__

2021-05-03 Thread Antony Lee
New submission from Antony Lee : Adding a call/__call__ function to the operator module (where `operator.call(*args, **kwargs)(func) == func(*args, **kwargs)`, similarly to operator.methodcaller) seems consistent with the design with the rest of the operator module. An actual use case I had

[issue44189] multiprocessing AF_PIPE name format is slightly confusing in the docs

2021-05-20 Thread Antony Lee
New submission from Antony Lee : https://docs.python.org/3/library/multiprocessing.html#address-formats currently states > An 'AF_PIPE' address is a string of the form r'\.\pipe{PipeName}'. To use > Client() to connect to a named pipe on a remote computer called Se

[issue34389] CPython may fail to build in the presence of a ~/.pydistutils.cfg

2021-06-23 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue34389> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths

2021-06-23 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue20012> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44019] operator.call/operator.__call__

2021-08-03 Thread Antony Lee
Antony Lee added the comment: Actually, upon further thought, the semantics I suggested above should go into `operator.caller` (cf. `operator.methodcaller`), and `operator.call`/`operator.__call__` should instead be defined as `operator.call(f, *args, **kwargs) == f(*args, **kwargs)`, so

[issue44850] Could operator.methodcaller be optimized using LOAD_METHOD?

2021-08-06 Thread Antony Lee
New submission from Antony Lee : Currently, methodcaller is not faster than a plain lambda: ``` In [1]: class T: ...: a = 1 ...: def f(self): pass ...: In [2]: from operator import * In [3]: %%timeit t = T(); mc = methodcaller("f") ...: mc(t) ...: ...

[issue44850] Could operator.methodcaller be optimized using LOAD_METHOD?

2021-08-16 Thread Antony Lee
Change by Antony Lee : -- keywords: +patch pull_requests: +26252 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27782 ___ Python tracker <https://bugs.python.org/issu

[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2021-08-17 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue38956> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44019] operator.call/operator.__call__

2021-08-22 Thread Antony Lee
Change by Antony Lee : -- keywords: +patch pull_requests: +26342 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27888 ___ Python tracker <https://bugs.python.org/issu

[issue44019] operator.call/operator.__call__

2021-08-30 Thread Antony Lee
Antony Lee added the comment: > I'm not convinced that operator.caller() would be useful to me. To be clear, as noted above, I have realized that the semantics I initially proposed (now known as "caller") are not particularly useful; the semantics I am proposing (and i

[issue27175] Unpickling Path objects

2021-08-31 Thread Antony Lee
Change by Antony Lee : -- keywords: +patch pull_requests: +26526 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28083 ___ Python tracker <https://bugs.python.org/issu

[issue27175] Unpickling Path objects

2021-08-31 Thread Antony Lee
Antony Lee added the comment: It means the Path/PurePath that would be constructed with the same single str parameter, or equivalently that has the same os.fspath(). -- ___ Python tracker <https://bugs.python.org/issue27

[issue27175] Unpickling Path objects

2021-08-31 Thread Antony Lee
Antony Lee added the comment: You are correct as to the meaning of "convert". The alternative approach you suggest would also work, but that seems to go much more against the design of pathlib to me. OTOH I guess it is up to Antoine to ru

[issue27175] Unpickling Path objects

2021-08-31 Thread Antony Lee
Antony Lee added the comment: Despite the now well-known security limitations of pickle, it is still used as a simple way (from the user PoV) to exchange arbitrary Python objects (see e.g. https://joblib.readthedocs.io/en/latest/persistence.html). Such objects can sometimes include Paths

[issue27175] Unpickling Path objects

2021-09-01 Thread Antony Lee
Antony Lee added the comment: I guess I could instead add some OS-dependent entries for Path classes into _compat_pickle (to do the remapping at load time) if you prefer? I don't have a strong preference either-way. -- ___ Python tracker &

[issue44019] operator.call/operator.__call__

2021-09-01 Thread Antony Lee
Antony Lee added the comment: Python2's apply has different semantics: it takes non-unpacked arguments, i.e. def apply(f, args, kwargs={}): return f(*args, **kwargs) rather than def call(f, *args, **kwargs): return f(*args, **kwargs) I agree that both functions can be writt

[issue44019] operator.call/operator.__call__

2021-10-20 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue44019> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25477] text mode for pkgutil.get_data

2021-11-27 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue25477> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23991] ZipFile sanity checks

2021-11-27 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue23991> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27161] Confusing exception in Path().with_name

2021-11-27 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue27161> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33581] Document "optional components that are commonly included in Python distributions."

2021-11-27 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue33581> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43286] [doc] Clarify that Popen.returncode does not get auto-set when the process terminates

2021-11-27 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue43286> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45962] Clarify that PyModule_AddString{Constant, Macro} use utf-8

2021-12-02 Thread Antony Lee
New submission from Antony Lee : The documentation for PyModule_AddString{Constant,Macro} does not specify the encoding used. Checking the source shows that these simply call PyUnicode_FromString and thus use utf8, but perhaps this could be made explicit. -- assignee: docs@python

[issue24253] pydoc for namespace packages indicates FILE as built-in

2021-12-07 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue24253> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26120] pydoc: move __future__ imports out of the DATA block

2021-12-07 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue26120> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2019-12-02 Thread Antony Lee
New submission from Antony Lee : https://bugs.python.org/issue8538 recently added to Py3.9 a much welcome addition to argparse, namely the capability to generate --foo/--no-foo flag pairs. A small issue with the implementation is that it *always* appends the default value to the help string

[issue39461] os.environ does not support Path-like values, but subprocess(..., env=...) does

2020-01-27 Thread Antony Lee
New submission from Antony Lee : As of Py3.8/Linux: In [1]: os.environ["foo"] = Path("bar") -

[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-01-28 Thread Antony Lee
Antony Lee added the comment: FWIW, I'm actually fine with not supporting Path objects in os.environ, as long as the behavior is *consistent* with the env kwarg to subprocess.run() -- note that the original title of the thread only pointed out to the inconsistency, and did not str

[issue39716] argparse.ArgumentParser does not raise on duplicated subparsers, even though it does on duplicated flags

2020-02-21 Thread Antony Lee
New submission from Antony Lee : If one tries to add twice the same flag to an ArgumentParser, one gets a helpful exception: from argparse import ArgumentParser p = ArgumentParser() p.add_argument("--foo") p.add_argument("--foo") results in ar

[issue39716] argparse.ArgumentParser does not raise on duplicated subparsers, even though it does on duplicated flags

2020-02-22 Thread Antony Lee
Change by Antony Lee : -- keywords: +patch pull_requests: +17971 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18605 ___ Python tracker <https://bugs.python.org/issu

[issue39716] argparse.ArgumentParser does not raise on duplicated subparsers, even though it does on duplicated flags

2020-02-22 Thread Antony Lee
Antony Lee added the comment: Sure, https://github.com/python/cpython/pull/18605 it is. -- ___ Python tracker <https://bugs.python.org/issue39716> ___ ___ Pytho

[issue23080] BoundArguments.arguments should be unordered

2020-02-27 Thread Antony Lee
Antony Lee added the comment: Done in bugs.python.org/issue36350 / https://github.com/python/cpython/pull/12412. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-27 Thread Antony Lee
New submission from Antony Lee : https://bugs.python.org/issue36350 / https://github.com/python/cpython/pull/12412 changed Signature.parameters and BoundArguments.arguments to be plain dicts, not OrderedDicts (for Py3.9a4). Even though I agree for BoundArguments.arguments (in fact I argued

[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-02-28 Thread Antony Lee
Antony Lee added the comment: It looks good to me, thanks. -- ___ Python tracker <https://bugs.python.org/issue39775> ___ ___ Python-bugs-list mailing list Unsub

[issue39783] Optimize construction of Path from other Paths by just returning the same object?

2020-02-28 Thread Antony Lee
New submission from Antony Lee : Many functions which take a path-like object typically also accept strings (sorry, no hard numbers here). This means that if the function plans to call Path methods on the object, it needs to first call Path() on the arguments to convert them, well, to Paths

[issue39783] Optimize construction of Path from other Paths by just returning the same object?

2020-02-28 Thread Antony Lee
Antony Lee added the comment: Decorating __new__ with lru_cache would likely run into memory leakage problems? (one would need a "weak lru_cache", I guess). I didn't know about the _closed attribute. From a quick look it appears to only be settable by using the path (not the

[issue39682] pathlib.Path objects can be used as context managers

2020-02-28 Thread Antony Lee
Antony Lee added the comment: A problem of having this bit of state in paths is that it violates assumptions based on immutability/hashability, e.g. with from pathlib import Path p = Path("foo") q = Path("foo") with p: pass unique_paths = {

[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict

2020-03-02 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue39775> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23080] BoundArguments.arguments should be unordered

2020-03-02 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue23080> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39682] pathlib.Path objects can be used as context managers

2020-03-02 Thread Antony Lee
Antony Lee added the comment: Immutability and hashability are listed first among "general properties" of paths (https://docs.python.org/3/library/pathlib.html#general-properties), and in the PEP proposing pathlib (https://www.python.org/dev/peps/pep-0428/#immutability). Loo

[issue25024] Allow passing "delete=False" to TemporaryDirectory

2020-03-17 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue25024> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39682] pathlib.Path objects can be used as context managers

2020-04-01 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue39682> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40313] bytes.hex(sep, bytes_per_sep) is many times slower than manually inserting the separators

2020-04-17 Thread Antony Lee
New submission from Antony Lee : Consider the following example, linewrapping 10^4 bytes in hex form to 128 characters per line, on Py 3.8.2 (Arch Linux repo package): In [1]: import numpy as np, math In [2]: data = np.random.randint(0, 256, (100, 100), dtype=np.uint8).tobytes

[issue40470] Make inspect.signature able to parse format strings.

2020-05-01 Thread Antony Lee
New submission from Antony Lee : It would be nice if inspect.signature was able to understand bound str.format methods, e.g. `inspect.signature("{a} {b}".format) == inspect.signature(lambda *args, a, b, **kwargs: None)` (`*args, **kwargs` are there because str.format ignores

[issue40624] add support for != (not-equals) in ElementTree XPath

2020-05-14 Thread Antony Lee
New submission from Antony Lee : It would be a small usability improvement if ElementTree's XPath support also supported the != (not-equals) operator. I am specifically mentioning only != and not >/ <https://bugs.python.org

[issue40625] Autogenerate signature for METH_NOARGS and perhaps METH_O extension functions

2020-05-14 Thread Antony Lee
New submission from Antony Lee : It would be nice if METH_NOARGS extension methods had an autogenerated signature (or rather, autogenerated __text_signature__ that gets picked up by inspect.signature). After all, the signature is trivially known at compile time. The same *could* possibly

[issue38045] enum.Flag instance creation is slow

2020-05-14 Thread Antony Lee
Antony Lee added the comment: Now fixed, I believe. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42451] Indicate in the docs that PyTuple_GetItem does not support negative indices

2020-11-30 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue42451> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42520] add_dll_directory only accepts absolute paths

2020-12-01 Thread Antony Lee
New submission from Antony Lee : os.add_dll_directory appears to only accept absolute paths, inheriting this restriction from AddDllDirectory. That's absolutely fine, but could perhaps be mentioned in the docs (https://docs.python.org/3/library/os.html#os.add_dll_directory), espec

[issue34750] locals().update doesn't work in Enum body, even though direct assignment to locals() does

2020-12-10 Thread Antony Lee
Antony Lee added the comment: Thanks! -- ___ Python tracker <https://bugs.python.org/issue34750> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34750] locals().update doesn't work in Enum body, even though direct assignment to locals() does

2020-12-10 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue34750> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42385] adjust enum.auto's behavior for StrEnum to return the enum name

2020-12-10 Thread Antony Lee
Antony Lee added the comment: Thanks for implementing! -- ___ Python tracker <https://bugs.python.org/issue42385> ___ ___ Python-bugs-list mailing list Unsub

[issue42385] adjust enum.auto's behavior for StrEnum to return the enum name

2020-12-10 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue42385> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42684] Improvements to documentation for PyUnicode_FS{Converter, Decoder}

2020-12-19 Thread Antony Lee
New submission from Antony Lee : The docs for PyUnicode_FSConverter and PyUnicode_FSDecoder could be improved on two points: - The functions also reject str/bytes that contain null bytes (one can easily verify that there's a specific check for them in the C implementations). Currentl

[issue42976] __text_signature__ parser silently drops arguments with certain unsupported default forms

2021-01-20 Thread Antony Lee
New submission from Antony Lee : Starting from the keyword-arguments example at https://docs.python.org/3/extending/extending.html#keyword-parameters-for-extension-functions, change the docstring of `parrot` to "parrot(voltage, state, action, type=1<<5)\n--\n\n" (yes, the do

[issue43286] Clarify that Popen.returncode does not get auto-set when the process terminates

2021-02-21 Thread Antony Lee
New submission from Antony Lee : Currently, the documentation for Popen.returncode states The child return code, set by poll() and wait() (and indirectly by communicate()). A None value indicates that the process hasn’t terminated yet. A negative value -N indicates that the child was

[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2020-06-07 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue31254> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39783] Optimize construction of Path from other Paths by just returning the same object?

2020-06-21 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue39783> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34750] locals().update doesn't work in Enum body, even though direct assignment to locals() does

2020-09-13 Thread Antony Lee
Antony Lee added the comment: To be honest, I don't really remember what exact use case I had in my mind 2 years ago (as I probably worked around it in one way or another). However, one example that I can think of (and that I have actually implemented before) is auto-conversion

[issue24970] Make distutils.Command an ABC

2020-10-22 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue24970> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27320] ./setup.py --help-commands should sort extra commands

2020-10-22 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue27320> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40624] add support for != (not-equals) in ElementTree XPath

2020-11-09 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue40624> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42385] Should enum.auto's behavior be adjusted for StrEnum to return the enum name?

2020-11-17 Thread Antony Lee
New submission from Antony Lee : Currently, enum.auto doesn't work with the new (Py3.10) StrEnum: `class E(enum.StrEnum): a = enum.auto()` results in `TypeError: 1 is not a string`. I would guess that the most reasonable behavior for auto() in a StrEnum would be to return the name itsel

[issue42451] Indicate in the docs that PyTuple_GetItem does not support negative indices

2020-11-24 Thread Antony Lee
New submission from Antony Lee : Unlike `PySequence_GetItem`, `PyTuple_GetItem` does not support negative indices ("indexing from the end"). That is fine, but warrants a notice in the docs (as that behavior is certainly not obvious). The same wording as for `PyList_GetItem` (chan

[issue37109] Inacurrate documentation regarding return type of math.factorial

2019-05-31 Thread Antony Lee
New submission from Antony Lee : https://docs.python.org/3/library/math.html says The following functions are provided by this module. Except when explicitly noted otherwise, all return values are floats. and math.factorial(x) Return x factorial. Raises ValueError if x is not integral or is

[issue37109] Inacurrate documentation regarding return type of math.factorial

2019-05-31 Thread Antony Lee
Antony Lee added the comment: oops, missed that, thanks for pointing that out. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue37109] Inacurrate documentation regarding return type of math.factorial

2019-05-31 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue37109> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31006] typing.NamedTuple should add annotations to its constructor (__new__) parameters.

2019-06-04 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue31006> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-08-01 Thread Antony Lee
New submission from Antony Lee : The docs for ContextDecorator (of which contextmanager is a case) describe its semantics as: ... for any construct of the following form: def f(): with cm(): # Do stuff ContextDecorator lets you instead write: @cm

[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2017-06-30 Thread Antony Lee
New submission from Antony Lee: Python 3.6.1, virtualenv 15.1.0 (Arch Linux, distro packages) ``` export PIP_CONFIG_FILE=/dev/null # just to be sure # python -mvirtualenv outer-env # using /usr/bin/python(3) python2 -mvirtualenv outer-env # using /usr/bin/python(3) source outer-env/bin

[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2017-06-30 Thread Antony Lee
Antony Lee added the comment: Sorry, that was a sloppy report. This is a better repro: $ export PIP_CONFIG_FILE=/dev/null # just to be sure python -mvirtualenv outer-env # using /usr/bin/python(3) source outer-env/bin/activate python -mvenv inner-env # using outer-env's python source

[issue19896] Exposing "q" and "Q" to multiprocessing.sharedctypes

2017-07-14 Thread Antony Lee
Changes by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <http://bugs.python.org/issue19896> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31006] typing.NamedTuple should add annotations to its constructor (__new__) parameters.

2017-07-24 Thread Antony Lee
New submission from Antony Lee: Currently, the fields, types and defaults used to define a typing.NamedTuple need to be retrieved from three different attributes: `_fields`, `_field_types`, and `_field_defaults` (the first two are combined in `__annotations__`, but that still misses the

[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2017-07-26 Thread Antony Lee
Antony Lee added the comment: For cross-referencing purposes: I have proposed in http://bugs.python.org/issue25293 to allow passing a Thread/Process subclass as argument instead of an initializer function, which would both handle Mark Dickinson's comment (http://bugs.python.org/issue

[issue31006] typing.NamedTuple should add annotations to its constructor (__new__) parameters.

2017-07-28 Thread Antony Lee
Antony Lee added the comment: I'll just repost the issue there for now (https://github.com/python/typing/issues/454). May work on a patch at some point (looks relatively simple) but no guarantees, so if someone else wants to take over feel free to

[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2017-08-22 Thread Antony Lee
New submission from Antony Lee: The following example, which raises a KeyError, shows that in a WeakKeyDictionary subclass that defines __missing__, that method doesn't get called. from weakref import WeakKeyDictionary class WeakKeyDictionaryWithMissing(WeakKeyDicti

[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2017-08-24 Thread Antony Lee
Antony Lee added the comment: The use case is to generate a mapping of weakly-held objects to unique ids, with something like id_map = WeakKeyDictionaryWithMissing(lambda *, _counter=itertools.count(): next(_counter)) Of course, as always when using defaultdict, it is easy enough to instead

[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2017-08-24 Thread Antony Lee
Antony Lee added the comment: The original example did not cover the use case and was only there to show the current behavior. The real use case is more something like obj = (get obj as argument to function, caller has a hard reference to it) uid = d[obj

[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2017-08-24 Thread Antony Lee
Antony Lee added the comment: For my use case, it was easy enough to wrap the `uid = d[obj]` in a try... catch... plus locking. Using setdefault would cause the counter to be incremented every time. In truth, here I did not care about having consecutive uids, so that would have worked just

[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2017-08-25 Thread Antony Lee
Antony Lee added the comment: Thanks for the clarification! "at least if the original key is not `obj` but some other object equal to `obj`" does not apply in my case so I'm fine, but the example shows that this is tric

[issue31295] typo in __hash__ docs

2017-08-28 Thread Antony Lee
New submission from Antony Lee: In https://docs.python.org/3.7/reference/datamodel.html#object.__hash__ I think x.__hash__() returns an appropriate value such that x == y implies both that x is y and hash(x) == hash(y). should be x.__hash__() returns an appropriate value such that x == y and

[issue31330] argparse.RawTextHelpFormatter does not maintain lines separated by more than one newline

2017-09-01 Thread Antony Lee
New submission from Antony Lee: The doc for argparse.RawTextHelpFormatter states that it "maintains whitespace for all sorts of help text, including argument descriptions." But the following example (which outputs "Foo", "Bar", and "Baz", each separate

[issue31542] pth files in site-packages of venvs are executed twice

2017-09-21 Thread Antony Lee
New submission from Antony Lee: All's in the title: "pth files in site-packages of venvs are executed twice". For example, the following code sample prints "1" twice. python -mvenv /tmp/tmpenv echo 'import os; print(1)' >/tmp/tmpenv/lib/python3.6/site

[issue33944] Deprecate and remove pth files

2019-01-13 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue33944> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35874] Clarify that the (...) convertor to PyArg_ParseTuple... accepts any sequence.

2019-02-01 Thread Antony Lee
New submission from Antony Lee : The documentation for the accepted types for each format unit in PyArg_ParseTuple (and its variants) is usually quite detailed; compare for example y* (bytes-like object) [Py_buffer] This variant on s* doesn’t accept Unicode objects, only bytes-like

[issue36277] pdb's recursive debug command is not listed in the docs

2019-03-12 Thread Antony Lee
New submission from Antony Lee : pdb's recursive debug command (mentioned e.g. in https://bugs.python.org/issue35931) is not listed in https://docs.python.org/3/library/pdb.html#debugger-commands. (I haven't checked whether any other command is missing.) -- assignee: d

[issue36277] pdb's recursive debug command is not listed in the docs

2019-03-13 Thread Antony Lee
Antony Lee added the comment: I'll pass on that for now. -- ___ Python tracker <https://bugs.python.org/issue36277> ___ ___ Python-bugs-list mailing list

[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2019-04-11 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue35232> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36277] pdb's recursive debug command is not listed in the docs

2019-04-18 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue36277> ___ ___ Python-bugs-list mailing list Unsubscribe:

  1   2   3   >