Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue26792>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue46785>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
New submission from Antony Cardazzi :
SimpleQueue.put_nowait(item) documentation says it is equivalent to
SimpleQueue.put(item) when it's actually equivalent to Simple que.put(item,
block=False)
--
assignee: docs@python
components: Documentation
messages: 413087
nosy: antonycar
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue43721>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue26120>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue24253>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue43286>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue33581>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue27161>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue23991>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue25477>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue44019>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
&
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
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
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
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
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
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue38956>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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)
...:
...
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue20012>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue34389>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue42385>
___
___
Python-bugs-list mailing list
Unsubscribe:
Antony Lee added the comment:
Thanks for implementing!
--
___
Python tracker
<https://bugs.python.org/issue42385>
___
___
Python-bugs-list mailing list
Unsub
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue34750>
___
___
Python-bugs-list mailing list
Unsubscribe:
Antony Lee added the comment:
Thanks!
--
___
Python tracker
<https://bugs.python.org/issue34750>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue42451>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue40624>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue27320>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue24970>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue39783>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue31254>
___
___
Python-bugs-list mailing list
Unsubscribe:
Antony Lee added the comment:
Now fixed, I believe.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue39682>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue25024>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue39775>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue23080>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 = {
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
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
Antony Lee added the comment:
It looks good to me, thanks.
--
___
Python tracker
<https://bugs.python.org/issue39775>
___
___
Python-bugs-list mailing list
Unsub
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
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
Antony Lee added the comment:
Sure, https://github.com/python/cpython/pull/18605 it is.
--
___
Python tracker
<https://bugs.python.org/issue39716>
___
___
Pytho
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
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
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
New submission from Antony Lee :
As of Py3.8/Linux:
In [1]: os.environ["foo"] = Path("bar")
-
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
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
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
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
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue37743>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Digin Antony :
The 'is' operator behave differently on two sets of values
please find the attachment below
tested environment
windows 7
python 3.7.3
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit
(AMD64)] on win32
Type "he
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)
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue31006>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue37109>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
New submission from Antony :
Incorrect Multiplication result of number 40.95
>>> 40.94 * 100
4094.0
>>> 40.96 * 100
4096.0
but:
>>> 40.95 * 100
4095.5
checked with:
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
and
Python 3.6.7 (default, Oct 22
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue22964>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue19895>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue36277>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue35232>
___
___
Python-bugs-list mailing list
Unsubscribe:
Antony Lee added the comment:
I'll pass on that for now.
--
___
Python tracker
<https://bugs.python.org/issue36277>
___
___
Python-bugs-list mailing list
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
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
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue33944>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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 the
Change by Antony Lee :
--
nosy: -Antony.Lee
___
Python tracker
<https://bugs.python.org/issue23596>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
1 - 100 of 230 matches
Mail list logo