Josh Rosenberg added the comment:
Looks like someone tried to run python inside an interactive Python shell,
rather than the command line. I'm moving to pending and will eventually close
unless they add a repro for some actual bug.
--
nosy: +josh.r
status: open ->
Josh Rosenberg added the comment:
If this is going to be closed as rejected, I think it still needs some
improvement to the documentation. Right now, the docs for abstractproperty
(deprecated in favor of combining property and abstractmethod) state:
"If only some components are abs
Josh Rosenberg added the comment:
A rough description is not sufficient. If you have code that reproduces the
problem, post the reproducer so we can check, but odds are you've got a bug in
your code.
--
nosy: +josh.r
status: open ->
Josh Rosenberg added the comment:
If you're annoyed by having to use two lines, one to copy, one to call the
mutating method, you can use the walrus operator:
(y := x.copy()).some_method()
or:
(y := deepcopy(x)).some_method()
Does that cover your use case?
For the list case,
Josh Rosenberg added the comment:
Even if making a copy is necessary when the underlying function receives the
dict "raw", preemptively performing the copy (before knowing if the function
being called is a Vectorcall function) means that when it's a Vectorcall
function
Josh Rosenberg added the comment:
Pingback from #42033. Proper fix for that issue likely involves moving the work
for copying kwargs into PyObject_Call, which would fix this bug by side-effect.
--
nosy: +josh.r
___
Python tracker
<ht
Change by Josh Rosenberg :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Josh Rosenberg added the comment:
This is a pessimization given the current implementation of str.join; it calls
PySequence_Fast as the very first step, which is effectively free for a tuple
or list input (just reference count manipulation), but must convert a generator
expression to a list
New submission from Josh Triplett :
fnmatch translates shell patterns to regexes, using an LRU cache of 256
elements. The documentation doesn't mention the cache size, just "They cache
the compiled regular expressions for speed.". Without this knowledge, it's
possible t
Josh Rosenberg added the comment:
As Serhiy says, the glossary term for an iterable is not the same as the
documentation for typing.Iterable (which at this point is largely defined in
terms of collections.abc.Iterable). True, collections.abc.Iterable does not
detect classes that iterate via
Josh Rosenberg added the comment:
Would we remove the functionality of os.environ.copy()? It seems very odd for
types to have a .copy() method that works, while not supporting copy.copy,
especially when there is zero documentation, on the web or the docstring, to
even hint at the difference
Josh Rosenberg added the comment:
Gregory: Even in a low-level compiled language (say, C++), pretty sure the
compiler can't automatically optimize out:
if (x) { }
unless it has sure knowledge of the implementation of operator bool; if
operator bool's implementation isn'
Josh Rosenberg added the comment:
This is a problem with the docstring. The actual docs for it are a bit more
clear, https://docs.python.org/3/library/filecmp.html#filecmp.cmp :
"If shallow is true, files with identical os.stat() signatures are taken to be
equal. Otherwise, the conten
Josh Rosenberg added the comment:
Does this need specific documentation? bytearray itself is documented with:
> As bytearray objects are mutable, they support the mutable sequence
> operations in addition to the common bytes and bytearray operations described
> in Bytes and
Josh Rosenberg added the comment:
Making literally every await equivalent to:
await asyncio.sleep(0)
followed by the actual await (which is effectively what you're proposing when
you expect all await to be preemptible) means adding non-trivial overhead to
all async operations (async
Josh Rosenberg added the comment:
The cause is in dict_merge (see here:
https://github.com/python/cpython/blob/master/Objects/dictobject.c ); it has a
fast path for when the object being merged in (which is what the dict
constructor does; it makes an empty dict, then merges the provided
Change by Josh Rosenberg :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Josh Rosenberg added the comment:
All of the compression modules (gzip, lzma) have this behavior, not just bz2;
it's consistent in that sense. Changing it now, after literally decades with
the old behavior, would needlessly break existing programs. As you say, it's
documented cl
Josh Rosenberg added the comment:
Agreed, stack is a PyObject**, so adding an integer (pto_nargs) to the pointer
(stack) is implicitly by multiples of sizeof(PyObject*). This is how pointer
arithmetic works in all versions of C I'm aware of. The code is correct.
--
nosy: +j
New submission from Josh Rosenberg :
At present, set_intersection (the C name for set.intersection) optimizes for
pairs of sets by iterating the smallest set and only adding entries found in
the larger, meaning work is proportionate to the smallest input.
But when the other input isn't
Josh Rosenberg added the comment:
Was this supposed to deprecate using types.coroutine as a decorator as well?
Because that's not clearly documented, which means people can still use it to
make generator-based coroutines without async def.
--
nosy: +j
Josh Rosenberg added the comment:
Zackery, should this be closed? Or is there something missing from the patch?
--
___
Python tracker
<https://bugs.python.org/issue36
Josh Rosenberg added the comment:
You can do the same thing to replace int, float, dict, len, and all the other
built-in classes and functions. Why is Ellipsis so special that it needs
protection, especially when, as you note, ... is an available unoverrideable
way to refer to it? Making
Josh Rosenberg added the comment:
I'm closing this as not being worth the costs of adding new keywords. You're
welcome to propose it on the python-ideas list (a more appropriate place to
propose and suss out the details of significant language changes), but you'll
need to f
Change by Josh Rosenberg :
--
resolution: -> not a bug
stage: -> resolved
status: pending -> closed
___
Python tracker
<https://bugs.python.or
Josh Rosenberg added the comment:
The problem is a lot simpler than you're making it:
1. You submit a time.sleep(30) task. This begins running immediately
2. You try to submit another task, but a NameError is raised, bypassing the
rest of the code (you never call as_completed, wi
Josh Rosenberg added the comment:
3.8.2 (on Alpine Linux under WSL) produces '0020-10-05', just like your 3.6
example. Not seeing anything obvious in commit history that would break it for
3.7. That said, 3.7 is in security fix only mode at this point (see
https://devguide.
Change by Josh Bode :
--
nosy: +joshbode
___
Python tracker
<https://bugs.python.org/issue41810>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Yes, list comprehensions having their own local scope was a change from Py2 to
Py3. Python 2 did not do this for list comps initially, and it was left that
way during the 2.x timeframe due to back compat constraints, but 2.x did it
from the start for
Josh Rosenberg added the comment:
It's not textwrap that's doing it, which is why the error is so unhelpful; the
input is assumed to be a str, and the translate method is called on it with a
dict argument, which is valid for str.translate, but not for bytes.translate.
You
Josh Friend added the comment:
yes it should be closed, can i do that? (ill try...)
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
Josh Rosenberg added the comment:
Can reproduce on Alpine Linux, with CPython 3.8.2 (running under WSLv2), so
it's not just you. CPU usage is high; seems like it must be stuck in an
infinite loop.
--
nosy: +josh.r
___
Python tracker
&
Change by Josh Rosenberg :
--
type: performance -> behavior
___
Python tracker
<https://bugs.python.org/issue41972>
___
___
Python-bugs-list mailing list
Un
Change by Josh Lee :
--
nosy: +jleedev
___
Python tracker
<https://bugs.python.org/issue16525>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue42033>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Josh Rosenberg :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue42269>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Is the plan to allow an argument to auto-generate __slots__, or would this
require repeating the names once in __slots__, and once for annotations and the
like?
--
___
Python tracker
<https://bugs.python.
Josh Rosenberg added the comment:
For those who find this in the future, the simplest workaround for the:
for line in sys.stdin:
issue on Python 2 is to replace it with:
for line in iter(sys.stdin.readline, ''):
The problem is caused by the way file.__next__'s bufferi
Josh Rosenberg added the comment:
There is an open issue for this already, under #11107 (a reopen of the closed
#2268, where the reopen was justified due to Python 3 making slice objects more
common), just so you know.
I made a stab at this a while ago and gave up due to the problems with
Change by Josh Rosenberg :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Josh Watson :
The test_coverage function in test_cmd.py calls reload(cmd)
--
components: Tests
messages: 155200
nosy: Josh.Watson
priority: normal
severity: normal
status: open
title: test_cmd.py does not correctly call reload()
type: crash
versions: Python 3.3
Josh Watson added the comment:
Accidentally submitted before finishing typing. Anyways, it calls "reload(cmd)"
in the test_coverage function in test_cmd.py, which does not work anymore given
that reload has been moved to imp.
I've uploaded a patch that fixes this.
Changes by Josh Watson :
--
type: crash -> behavior
___
Python tracker
<http://bugs.python.org/issue14235>
___
___
Python-bugs-list mailing list
Unsubscri
Josh Watson added the comment:
That particular function only gets called by running `./python
Lib/test/test_cmd.py -c`, and not through regrtest.py, so I suspect that's why
it wasn't noticed before. I just happened to be exploring test files and ran
into an unhandled exception wh
Josh Triplett added the comment:
I currently use Python 2.7, and I'd like to make use of memoryview.
Specifically, I work on BITS (http://biosbits.org/), which runs Python in ring
0 as part of GRUB, and I'd like to use memoryview to give Python access to data
in physical memory.
Josh Triplett added the comment:
> I currently use Python 2.7, and I'd like to make use of memoryview.
> Specifically, I work on BITS (http://biosbits.org/), which runs Python in
> ring 0 as part of GRUB, and I'd like to use memoryview to give Python access
> to data
Josh Rosenberg added the comment:
Clarification is fine, but "MyClass and MySubclass are instances of Meta:" is
100% true. Declaring a class to have a metaclass (or inheriting from a class
with a metaclass) means that the class itself is an instance of the metaclass.
New instan
Josh Rosenberg added the comment:
Ah, you're right on __call__; I've never bothered to override it on a
metaclass, but yes, since a class using a metaclass is an instance of the
metaclass, like all instances, calling it invokes the __call__ of its type
(it's just that the de
Josh Rosenberg added the comment:
mbussonn: Your new PR looks like it's related to #36953 ("Remove collections
ABCs?"), not this issue specifically. Can you withdraw/reissue attached to the
correct issue?
--
nosy: +josh.r, mbussonn
___
Josh Rosenberg added the comment:
1. This is a bug tracker for bugs in the Python language spec and the CPython
interpreter, not a general problem solving site.
2. The ids will differ for changeValue2 if you actually call it (kernel =
kernel + 2 requires the the old id of kernel differ from
New submission from Josh Rosenberg :
TextIOWrapper explicitly sets the `telling` flag to 0 when .__next__ (
textiowrapper_iternext ) is called (
https://github.com/python/cpython/blob/3.7/Modules/_io/textio.c#L2974 ), e.g.
during standard for loops over the file of this form, trying to call
Josh Rosenberg added the comment:
Left a dangling sentence in there:
"I used two arg iter in both cases to keep the code paths as similar as
possible so the `telling`."
should read:
"I used iter(f.readline, '') in both cases to keep the code paths as similar as
Josh Rosenberg added the comment:
Possibly related to #8260 ("When I use codecs.open(...) and f.readline() follow
up by f.read() return bad result"), which was never fully fixed in that issue,
though #32110 ("Make codecs.StreamReader.read() more compatible with read() of
ot
Josh Rosenberg added the comment:
For that matter, slices are immutable built-ins, but they're not hashable
(presumably to avoid silently working with dictionaries in a non-slice
capacity).
--
nosy: +josh.r
___
Python tracker
&
Josh Rosenberg added the comment:
The docs specify what argparse.FileType() does via the default parameters:
https://docs.python.org/3/library/argparse.html#argparse.FileType
If you mean what does it do when you fail to call it at all (passing
type=argparse.FileType), the answer is the same
Josh Rosenberg added the comment:
Ah, right. It doesn't actually validate the mode string (it just stores it for
when open is called, assuming open will validate it). So yeah, it silently
accepts any string, not just valid mode strings. Not a contractual guarantee or
anything, jus
New submission from Josh Snyder :
Background:
SSLSocket.read drops the GIL and performs exactly one successful call to
OpenSSL's `SSL_read`, whose documentation states "At most the contents of one
record will be returned". TLS records are at most 16KB, so high throughp
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue37340>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
This seems likely to have been caused by the fixes for #37267, which fixes an
issue with os.dup leaving character streams inheritable (when the documentation
specifies that the result must be non-inheritable).
The code originally didn't try to mak
Josh Rosenberg added the comment:
This may have caused a regression, see #37549.
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue37
Josh Rosenberg added the comment:
I'm inclined to close as Not a Bug as well. I'm worried the expanded error
message would confuse people when they simply failed to assign a variable, and
make them try bad workarounds like adding global/nonlocal when it's not the
problem, e.g
Josh Rosenberg added the comment:
Is there a reason to document object_pairs_hook=OrderedDict rather than just
making the decoder populate a regular dict in an order-preserving way? (No idea
if it does this already)
--
nosy: +josh.r
___
Python
Josh Rosenberg added the comment:
Per the docs on the function group that includes os.sched_getaffinity (
https://docs.python.org/3/library/os.html#interface-to-the-scheduler ):
> These functions control how a process is allocated CPU time by the operating
> system. They are only ava
Josh Rosenberg added the comment:
I suspect these fixers were left out simply because no one expected anyone to
call the dunder names directly; the whole point of the dunder names is that
they're not used directly, being invoked by syntax/context (__nonzero__ being
the first thing trie
Josh Rosenberg added the comment:
Serhiy: Did you plan to do any further work, or can this issue be closed?
--
___
Python tracker
<https://bugs.python.org/issue36
Josh Rosenberg added the comment:
Rolling to 4.0 implies backward incompatible changes; doing just to avoid 3.10
is breaking semantic versioning rules.
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue37
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue37648>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
@p-ganssle: Yup. If both sides return NotImplemented, __eq__ and __ne__ return
a result based on an identity comparison; all other rich comparisons raise
TypeError in that case. Code is here:
https://github.com/python/cpython/blob/3.7/Objects/object.c#L679
Josh Rosenberg added the comment:
Serhiy: Is there a reason not to use the functools.total_ordering decorator on
TimerHandle, so you can get rid of __le__/__ge__/__gt__ rather than fixing them
individually? I notice at least one behavioral difference (total_ordering's
le/ge method
Josh Rosenberg added the comment:
Moving to 3.9 target, per Serhiy's request. PR has been rebased against master,
including updating the What's New info to be in the 3.9 version, not 3.8.
--
versions: +Python 3.9 -Python 3.8
___
Pyth
Josh Rosenberg added the comment:
Delaying the write means you don't get an indication of the steps in the
process; if someone is trying to debug a crash caused by corruption of the gc
list (e.g. due to a bad extension module), deferring the writes means they
won't see any output
Josh Rosenberg added the comment:
Reading the docs, I'd definitely expect multiprocessing.Manager().Value to obey
the same interface as multiprocessing.Value. The SyncManager docs say:
> Its methods create and return Proxy Objects for a number of commonly used
> data
Josh Rosenberg added the comment:
To be clear, set().__or__(x) returns NotImplemented, it doesn't raise
NotImplementedError. I've edited the title to match.
One major problem that gets in the way of a fix is that the interface of set
and dict views doesn't match, because
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue37774>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
In the docs for my PR, I mention using NotImplemented in a boolean context is
deprecated, raising DeprecationWarning, and will raise TypeError in a future
version of Python. Serhiy has suggested the end state might be RuntimeWarning
instead of TypeError
Josh Rosenberg added the comment:
Is the intent to make these macros public? If not, shouldn't they be prefixed
with an underscore, like _Py_SIZE_ROUND_DOWN/_Py_SIZE_ROUND_UP in the same
header?
--
___
Python tracker
<https://bugs.py
Josh Rosenberg added the comment:
Have you tried switching to using Popen itself (or run, which keeps it to one
layer of convenience wrapping)?
subprocess.getstatusoutput is three layers of wrapping (it calls check_output,
which in turn calls run, which in turn calls Popen), and (unlike
New submission from Josh Holland :
The empty tuple syntax in type annotations, `Tuple[()]`, is not obvious from
the examples given in the documentation (I naively expected `Tuple[]` to work);
it has been documented in PEP 484[1] and in mypy[2], but not in the
documentation for the typing
Change by Josh Holland :
--
keywords: +patch
pull_requests: +14937
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/15208
___
Python tracker
<https://bugs.python.org/issu
Josh Holland added the comment:
PEP 586 doesn't currently allow Literal to contain tuples, so Tuple[()] is the
only option.
--
___
Python tracker
<https://bugs.python.org/is
Change by Josh Rosenberg :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> ~True is not False
___
Python tracker
<https://bugs.python
Josh Rosenberg added the comment:
Side-note: Some of the objections to a C level namedtuple implementation appear
to be based on the maintenance hurdle, and other have noted that a
structseq-based namedtuple might be an option. I have previously attempted to
write a C replacement for
Josh Rosenberg added the comment:
I'd be -1 on this without a demonstrated broad need for this in at least some
context outside of microbenchmarking utilities (which presumably have already
implemented similar stuff).
If a minimum bar for applicability isn't applied, we'll end
New submission from Josh Rosenberg:
At present, the documentation for the copy module doesn't document anything
about the memo dictionary for deepcopy except to say that it must be received
by custom __deepcopy__ methods and passed along when calling copy.deepcopy, and
that it
Josh Rosenberg added the comment:
The "bug" is the expected behavior for 2.7, as previously noted, and does not
exist on Python 3 (where list comprehensions follow the same rules as generator
expressions for scoping), where NameErrors are raised consistently.
--
nos
Josh Rosenberg added the comment:
This is completely fixed, right? Just making sure there is nothing left to be
done to close the issue.
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue35
Josh Rosenberg added the comment:
Finished typing this while Serhiy was closing, but just for further explanation:
This isn't a bug. fnmatch provides "shell-style" wildcards, but that doesn't
mean it supports every shell's extensions to the globbing syntax. It doesn&
Change by Josh Rosenberg :
--
keywords: +3.2regression
versions: +Python 3.6, Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue19
Change by Josh Rosenberg :
--
keywords: -3.2regression
___
Python tracker
<https://bugs.python.org/issue19865>
___
___
Python-bugs-list mailing list
Unsub
Josh Rosenberg added the comment:
set.union() without constructing the set you call union on only happens to work
for the set.union(a) case because `a` is already a set. union takes arbitrary
iterables, not just sets, and you're just cheating by explicitly passing `a` as
the expected
Change by Josh Rosenberg :
--
versions: +Python 3.8 -Python 3.5
___
Python tracker
<https://bugs.python.org/issue11107>
___
___
Python-bugs-list mailin
New submission from Josh Rosenberg :
https://docs.python.org/3.8/whatsnew/3.8.html#optimizations begins with:
shutil.copyfile(), shutil.copy(), shutil.copy2(), shutil.copytree() and
shutil.move() use platform-specific “fast-copy” syscalls on Linux, macOS and
Solaris in order to copy the file
Josh Rosenberg added the comment:
Batteries-included extension modules aren't limited to the public and/or
limited API; they use tons of undocumented internal APIs (everything to do with
Py_IDENTIFIERs being an obvious and frequently used non-public API).
_PyObject_LookupSpeci
Josh Rosenberg added the comment:
Agreed with everything in Serhiy's comments. This patch disregards why
_PyObject_LookupSpecial and the various _Py_IDENTIFIER related stuff was
created in the first place (to handle a non-trivial task efficiently/correctly)
in favor of trying to av
Josh Rosenberg added the comment:
Given the "feature" in question isn't actually an intended feature (just an
accident of how unbound methods work), I'm closing this. We're not going to try
to make methods callable without self.
--
resolution: -> wont fi
Josh Rosenberg added the comment:
divmod imposes higher fixed overhead in exchange for operating more efficiently
on larger values.
Given the differences are small either way, and using divmod reduces
scalability concerns for larger values (which are more likely to occur in code
that
Josh Rosenberg added the comment:
I don't know what triggered the change, but I strongly suspect this is not a
supported use of the multiprocessing module; Process is for worker processes
(still running Python), and it has a lot of coordination machinery set up
between parent and child
Josh Rosenberg added the comment:
Looks like the cause of the change was when os.pipe was changed to create
non-inheritable pipes by default; if I monkey-patch
multiprocessing.popen_fork.Popen._launch to use os.pipe2(0) instead of
os.pipe() to get inheritable descriptors or just clear
New submission from Josh Rosenberg :
I 100% agree with the aim of #30977 (reduce uuid.UUID() memory footprint), but
it broke compatibility for any application that was weak referencing UUID
instances (which seems a reasonable thing to do; a strong reference to a UUID
can be stored in a
101 - 200 of 839 matches
Mail list logo