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
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
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
Josh Rosenberg added the comment:
Closing as rejected; to my knowledge, *no* built-in Python method both mutate
an object and returns the object just mutated, precisely because:
1. It allows for chaining that leads fairly quickly to unreadable code (Python
is not Perl/Ruby)
2. It creates
Josh Rosenberg added the comment:
vstinner: The problem isn't the averaging, it's the type inconsistency. In both
examples (median([1]), median([1, 1])), the median is unambiguously 1 (no
actual average is needed; the values are identical), yet it gets converted to
1.0 only in
New submission from Josh Rosenberg :
I don't really expect this to go anywhere until Python 4 (*maybe* 3.9 after a
deprecation period), but it seems like it would have been a good idea to make
NotImplementedType's __bool__ explicitly raise a TypeError (rather than leaving
it
Josh Rosenberg added the comment:
I assume you meant #35662 (based on the superseder note in the history).
--
___
Python tracker
<https://bugs.python.org/issue29
Josh Rosenberg added the comment:
David, the What's New note about weak references no longer being possible
should be removed as part of this change. I'm not sure the note on arbitrary
attributes no longer being addable is needed either (__setattr__ blocked that
beforehand, it
Josh Rosenberg added the comment:
The UUID module documentation (and docstring) begin with:
"This module provides immutable UUID objects"
Immutable is a stronger guarantee than __slots__ enforces already, so the
documentation already ruled out adding arbitrary attributes to UUI
Josh Rosenberg added the comment:
Others can correct me if I'm wrong, but I'm fairly sure 2.7 isn't making
changes unless they fix critical or security-related bugs.
The code here is suboptimal, but it's already been fixed in Python 3 (in
#8052), as part of a C acce
Josh Rosenberg added the comment:
The lack of support for the rich comparison operators on even the most basic
memoryviews (e.g. 'B' format) means that memoryview is still a regression from
some of the functionality buffer offered back in Python 2 (
https://stackoverflow.com/
Josh Rosenberg added the comment:
Not my use case specifically, but my link in the last post (repeated below) was
to a StackOverflow answer to a problem where using buffer was simple and fast,
but memoryview required annoying workarounds. Admittedly, in most cases it's
people wanting
Josh Rosenberg added the comment:
Your analysis would be (almost) correct if a slice object could have a stop
value of NULL. It's wrong in that the error would be a NULL deference, not a
silent use of an uninitialized value, but it would be a bug. In your scenario
where v == NULL, it
Josh Rosenberg added the comment:
Steven: I'm assuming Brett rearranged the title to put emphasis on the new
function and to place it earlier in the title. Especially important if you're
reading e-mails with the old subject on an e-mail client with limited subject
preview length
Josh Rosenberg added the comment:
You've got a reference leak in your __index__ based paths. PyNumber_Index is
returning a new reference (either to the existing obj, or a new one, if the
existing obj isn't already an int). You never release this reference. Simplest
fix is to make
Josh Rosenberg added the comment:
Yes, the 2.7 version of _PyEval_SliceIndex would bypass the NULL pointer
dereference, so *if* you could make a slice with a NULL stop value, you could
trigger a read from uninitialized stack memory, rather than dying due to a NULL
pointer dereference.
But
Josh Rosenberg added the comment:
One additional note, just in case you're wondering. slice explicitly does not
set Py_TPFLAGS_BASETYPE (in either Py2 or Py3), so you can't make a subclass of
slice with NULLable fields by accident (you'll get a TypeError the moment you
t
Josh Rosenberg added the comment:
I've only got 3.7.1 Ubuntu bash on Windows (also amd64) immediately available,
but I'm not seeing a hang, nor is there any obvious memory leak that might
eventually lead to problems (memory regularly drops back to under 10 MB shared,
24 KB priva
Change by Josh Rosenberg :
Removed file: https://bugs.python.org/file48087/core-nix.snapshot.json
___
Python tracker
<https://bugs.python.org/issue35862>
___
___
Pytho
Josh Rosenberg added the comment:
Why is not having the target assign to the relevant os.environ keys before
doing whatever depends on the environment not an option?
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue35
Change by Josh Rosenberg :
Removed file: https://bugs.python.org/file48088/bq-nix.snapshot.json
___
Python tracker
<https://bugs.python.org/issue35862>
___
___
Python-bug
Change by Josh Rosenberg :
--
Removed message: https://bugs.python.org/msg334593
___
Python tracker
<https://bugs.python.org/issue35862>
___
___
Python-bug
Change by Josh Rosenberg :
Removed file: https://bugs.python.org/file48089/bq-nix.manifest
___
Python tracker
<https://bugs.python.org/issue35862>
___
___
Python-bug
Josh Rosenberg added the comment:
Correct me if I'm wrong, but at least initially, the first listed goal of
statistics (per the PEP) was:
"Correctness over speed. It is easier to speed up a correct but slow function
than to correct a fast but buggy one."
numpy already exists
Josh Rosenberg added the comment:
Closed #35958 as a duplicate of this issue (and updated the title, since
clearly the problem is not specific to dict).
Patch probably needs to be rebased/rewritten against latest trunk (given it
dates from Mercurial days).
--
nosy: +Jon McMahon
Change by Josh Rosenberg :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Josh Rosenberg added the comment:
Victor found the same bug I found while I was composing this, posting only to
incorporate proposed solution:
I *think* I have a cause for this, but someone else with greater understanding
of the cycle collector should check me if the suggested fix has non
Josh Rosenberg added the comment:
Ah, I see Victor posted an alternative PR that avoids the reference counting
overhead by explicitly removing the temporary tuples from GC tracking. I'm
mildly worried by that approach, only because the only documented use case for
PyObject_GC_UnTrack
Josh Rosenberg added the comment:
+1 on PR 11830 from me. Can always revisit if #11107 is ever implemented and it
turns out that the reference count manipulation means startup is too slow due
to all the slice interning triggered comparisons (unlikely, but theoretically
possible I guess
Josh Rosenberg added the comment:
"your application is using more memory than what is available in the system."
Well, it alone may not be using more memory, but the cumulative usage on the
system is "too high" by whatever metric the OOM killer is using (IIRC the
default
Josh Rosenberg added the comment:
Moving from pending back to open (not sure what was "pending" about it?).
The workaround is viable (and used by Python implemented dict subclasses in the
standard library since they must accept **kwargs with arbitrary strings,
including self), b
Josh Rosenberg added the comment:
Wait, why should #25737 be closed? This bug is a docs issue; collections.abc
shouldn't claim that all the ABCs do duck-typing checks since Sequence doesn't.
But #25737 is specific: array.array *should* be registered as a Sequence, but
isn't;
Josh Rosenberg added the comment:
This should not be closed as a duplicate. Yes, array.array isn't automatically
a Sequence, but since it isn't, the array module should be modified to
explicitly do the equivalent of:
import _collections_abc
_collections_abc.Sequence.register(
Change by Josh Rosenberg :
--
versions: +Python 3.7, Python 3.8 -Python 3.5
___
Python tracker
<https://bugs.python.org/issue25737>
___
___
Python-bugs-list m
Josh Rosenberg added the comment:
Correction: It should actually be registered as a subclass of MutableSequence
(which should make it a virtual subclass of Sequence too; list is only
registered on MutableSequence as well).
--
___
Python tracker
Josh Rosenberg added the comment:
"One other issue is that the arguments to prod() need not be integers, so a
modulus argument wouldn't make sense in those contexts."
The arguments to pow don't need to be integers either, yet the optional third
argument is only really
Josh Rosenberg added the comment:
The docs (
https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.as_completed
) do seem to indicate it shouldn't do so as long as results were available
before the timeout expired:
"The returned iterato
Josh Rosenberg added the comment:
Right, but Antoine's objection is that suddenly strs pickled in Py3 can end up
as strs in Py2, rather than unicode. If the library enforces a Py3-like type
separation on Py2 (text arguments are unicode only, binary data is str only),
then you have the pr
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue27151>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue23267>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Could that perhaps be intentional? Attribute access seems like something where
the developer would be explicitly naming a single, hard coded, canonical name
for the type, while string construction seems like something where you're
getting a string
Josh Rosenberg added the comment:
Steven: Technically, in CPython, they use both identity and equality testing,
as a function of using RichCompareBool (which tests identity first, then
equality), rather than RichCompare (which only tests equality).
It makes a difference for stuff like NaN
Josh Rosenberg added the comment:
To tie the exceptions to the actual line, would it perhaps make sense to copy
over the traceback of the original exception using .with_traceback?
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.
Josh Rosenberg added the comment:
Particularly when the type of the exception isn't being changed, it's only
altering the message to provide more information?
--
___
Python tracker
<http://bugs.python.o
Josh Rosenberg added the comment:
Yeah, that sounds fine.
--
___
Python tracker
<http://bugs.python.org/issue29752>
___
___
Python-bugs-list mailing list
Unsub
Josh Rosenberg added the comment:
I feel like adding a type check to partial_repr might not be the correct fix
here. If PyUnicode_FromFormat returned NULL and set an exception here, then the
existing code would work as written (raising an exception, but not segfaulting).
Alternatively, if the
Josh Rosenberg added the comment:
That's because os.system is executing the command in a shell (which expands ~).
Without shell support, ~ doesn't mean anything unless used with the APIs that
specifically support it (e.g. os.path.expanduser).
You wanted os.path.exists(os.path.
New submission from Josh Rosenberg:
As currently implemented, Executor.map is not particularly lazy. Specifically,
if given huge argument iterables, it will not begin yielding results until all
tasks have been submitted; if given an infinite input iterable, it will run out
of memory before
Josh Rosenberg added the comment:
Nosying folks suggested by GitHub, hope that's the right etiquette.
For the record, filled out contributor agreement ages ago, but hadn't linked
(or even created) GitHub account until after I got the warning. I've linked
this account to my GitH
Changes by Josh Rosenberg :
--
title: Executor.map should not submit all futures prior to yielding any results
-> Make Executor.map work with infinite/large inputs correctly
___
Python tracker
<http://bugs.python.org/issu
New submission from Josh Rosenberg:
Kristjan wrote improved locking primitives in #15038 that use the new (in
Vista) SRWLock and Condition Variable APIs. SRWLocks (used in exclusive mode
only) replace Critical Sections, which is slower than SRWLock and provides no
features we use that might
Changes by Josh Rosenberg :
--
pull_requests: +670
___
Python tracker
<http://bugs.python.org/issue29871>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Note: Beyond turning on the new primitives by default, I also made a change to
PyCOND_TIMEDWAIT. The original code looked wrong, in that:
1. It assumed that when SleepConditionVariableSRW returned non-zero, you didn't
know if the wait had timed out or no
Josh Rosenberg added the comment:
>From the original bugs, it looks like people liked being able to directly
>produce the hex of the IP addresses using hex(). I'll admit I'm only +0.5 on
>restoring __index__; having them be equivalent to int, not just convertable,
>do
101 - 200 of 727 matches
Mail list logo