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

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

[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 Path wh

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

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

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

[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

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

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

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

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

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

[issue44019] operator.call/operator.__call__

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

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

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

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

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

[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

[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

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

[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

[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) ...: ...

[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

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

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

[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 ServerName > one s

[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

[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

[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

[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

[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). Currently

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

[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

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

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

[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), especially

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

[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

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

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

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

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

[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 of C

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

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

[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

[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

[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/issu

[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

[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

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

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

[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-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 = {

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

[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

[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

[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

[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

[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

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

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

[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") -

[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

[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

[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

[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

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

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

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

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

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

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

[issue22964] dbm.open(..., "x")

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

[issue19895] Cryptic error when subclassing multiprocessing classes

2019-04-26 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue19895> ___ ___ 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:

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

[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: docs@python

[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

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

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

2018-11-13 Thread Antony Lee
New submission from Antony Lee : Currently, dataclasses created by make_dataclass are not picklable, because their __module__ is set to "types". It seems that this would be easily fixed by letting make_dataclass gain a `module` and a `qualname` kwarg, similarly to the Enum funct

[issue33944] Deprecate and remove pth files

2018-10-25 Thread Antony Lee
Antony Lee added the comment: There are a number of packages that can "self-import" into any Python process depending on the presence of an environment variable, by installing a pth file that contains something like `import os; __import__("thepkg") if os.environ.get(&q

[issue35063] Checking for abstractmethod implementation fails to consider MRO for builtins

2018-10-25 Thread Antony Lee
New submission from Antony Lee : When checking whether a class implements all abstractmethods (to know whether the class can be instantiated), one should only consider methods that come *before* the abstractmethod in the MRO -- methods that come after cannot be said to override

[issue23596] gzip argparse interface

2018-10-09 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker <https://bugs.python.org/issue23596> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34807] pathlib.[r]glob fails when the toplevel directory is not readable, whereas glob.glob "succeeds"

2018-09-26 Thread Antony Lee
New submission from Antony Lee : After $ mkdir -p foo/bar && chmod 000 foo one gets In [1]: glob.glob("foo/bar") Out[1]: [] but In [2]: list(Path("foo/bar").glob("*")) gives a PermissionError. I'm not arguing that pathlib should repr

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

2018-09-22 Thread Antony Lee
Antony Lee added the comment: > I agree though that adding an update method would be nice though and can be > done in just a few lines of code. Again, this can be done just be inheriting the methods from MutableMapping. In fact even now one can just write class

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

2018-09-21 Thread Antony Lee
Antony Lee added the comment: > encourage the common assumption that locals() returns a dict where mutating > it actually works, since it usually doesn't. It does at global and class scope, not at function scope. FWIW, PEP558 (admittedly not accepted yet) proposes to

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

2018-09-20 Thread Antony Lee
Antony Lee added the comment: I have a personal helper function for writing (Qt) GUIs that generates ComboBoxes from Enums; essentially something like class Choices(Enum): choice1 = "text for choice 1" choice2 = "text for choice 2" def call

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

2018-09-20 Thread Antony Lee
New submission from Antony Lee : A quick check suggests that enum entries can be programmatically created by assigning to locals() in the Enum body: class E(Enum): locals()["a"] = 1 E.a # -> However, using locals().update(...) doesn't, and silently does the wrong thing

[issue34526] Path.relative_to() taking multiple arguments could be better documented

2018-08-28 Thread Antony Lee
New submission from Antony Lee : Currently, the docs for Path.relative_to read PurePath.relative_to(*other) Compute a version of this path relative to the path represented by other. If it’s impossible, ValueError is raised: (examples follow) It's a bit confusing why other is a star

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

2018-08-12 Thread Antony Lee
New submission from Antony Lee : I have a ~/.pydistutils.cfg with the following contents: [build_ext] force = true inplace = true (--force is useful because sometimes just comparing timestamps is insufficient to know whether a package needs to be rebuilt, e.g. in the presence

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

2018-05-19 Thread Antony Lee
New submission from Antony Lee <anntzer@gmail.com>: The stdlib docs intro include the following sentences: It also describes some of the optional components that are commonly included in Python distributions. For Unix-like operating systems Python is normally pr

  1   2   3   >