Joshua Bronson added the comment:
Dear Raymond,
Thanks so much for the detailed response!
I wonder if you could explain how this case is different from the following:
>>> c = collections.ChainMap({1: 1}, {1: 2})
>>> iter(c)
>>> isinstance(c, dict) # it'
New submission from Joshua Bronson :
collections.abc.Set provides a _hash() method that includes the following in
its docstring:
"""
Note that we don't define __hash__: not all sets are hashable.
But if you define a hashable set type, its __hash__ should
call this functi
Joshua Bronson added the comment:
Thanks for the explanation, Raymond.
Regarding:
> Lastly, pure python hashable sets based on the ABC are not common
This would have implications for other use cases though, that are perhaps more
common.
See, for example, the following code:
ht
New submission from Joshua Bronson :
As suggested by @rhettinger in https://bugs.python.org/msg409443, I'm creating
a feature request for C implementations of collections.abc.KeysView,
ValuesView, and ItemsView.
Because these do not currently benefit from C speedups, they're a
Joshua Bronson added the comment:
Thank you for confirming that ChainMap.__iter__() would be in the same boat as
bidict if a similar .mapping attribute were ever added to dict_keyiterators.
The specifics of this issue are interesting, but even more interesting to me is
whatever learnings we
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue46771>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Joshua Bronson :
This issue was originally opened in the PyPI tracker but was dismissed on the
theory that it's a bug in Python:
https://sourceforge.net/tracker/index.php?func=detail&aid=3396924&group_id=66150&atid=513503
"""
If in
Joshua Bronson added the comment:
Thanks for the great additions.
--
___
Python tracker
<http://bugs.python.org/issue7734>
___
___
Python-bugs-list mailin
New submission from Joshua Bronson :
Though the heapq module does not support changing the priority of a particular
element of the heap (a necessary operation for the A* search family of
algorithms), such an element can be marked as invalid and a new element can be
added with different
New submission from Joshua Bronson :
os.makedirs' mode argument defaults to a hardcoded value of 511 (0777 in
octal). This forces the caller to either pass in a different hardcoded value
(commonly 0750), or to implement a workaround that calculates the expected
mode based on the pr
Joshua Bronson added the comment:
Ah, I was misunderstanding the behavior of mkdir, thank you for the
explanation.
My misunderstanding stemmed from recently coming across two widely-used
packages which both pass mode=0750 to os.makedirs. I have no idea why
they would be doing this (as it
Joshua Bronson added the comment:
> My suspicion is that people setting explicit file permissions
> typically know what they are doing, and that you will find that
> your tickets get closed as invalid, explaining to you that this
> mode usage is fully intentional.
For what it'
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue27815>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue43751>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue43468>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue44963>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
nosy_count: 6.0 -> 7.0
pull_requests: +27187
pull_request: https://github.com/python/cpython/pull/28892
___
Python tracker
<https://bugs.python.org/issu
New submission from Joshua Bronson :
As of bpo-40890 (released in Python 3.10), dict views now provide a public
.mapping attribute, intended to allow users to recover a mappingproxy pointing
to the original mapping.
However, this new attribute can actually point to the wrong mapping for some
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue31122>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
pull_requests: +22708
pull_request: https://github.com/python/cpython/pull/23847
___
Python tracker
<https://bugs.python.org/issue31
Joshua Bronson added the comment:
Please see https://github.com/python/cpython/pull/23847 for the C
implementation of aiter and anext added to builtins, as requested.
--
title: add aiter() and anext() functions to operator module -> add aiter() and
anext() functi
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue14757>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Joshua Bronson :
If I understand correctly, it should be an invariant that in the code below,
for all "Parent" classes, for all "method"s, Child1.method should return the
same result as Child2.method:
```
class Parent:
def __init__(self, value):
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue32884>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue32561>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue13322>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue22239>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue40816>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Joshua Bronson :
This appears to be a bug in Python 3.6 that I hit while trying to add type
hints to my bidirectional mapping library (https://bidict.rtfd.io).
Pasting a working, minimal repro below for easier inline viewing, and also
attaching for easier downloading and
Joshua Bronson added the comment:
It turns out that this bug reproduces with any subclass of the generic type
with a weakref slot, even without any multiple inheritance going on.
For example:
class Invertible2(Invertible[KT1, KT2]): pass
is enough to trigger this bug along with the
Joshua Bronson added the comment:
Whittled this down to an even more minimal repro:
"""Repro for Python 3.6 slots + weakref + typing.Generic subclass bug."""
from typing import Generic, TypeVar
from weakref import ref
T = TypeVar("T")
class MyGen
Joshua Bronson added the comment:
Thanks so much, @oremanj! Indeed, merely subscripting the class triggers the
bug, and your 'del slots' workaround does the trick!
For completeness, there is an updated (yet more minimal) repro below/attached.
"""Repro for P
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue41303>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue7946>
___
___
Python-bugs-list mailing list
Unsubscribe:
Joshua Bronson added the comment:
Nice to see there is still interest in this from someone else! Thanks, John.
Are any core developers still interested in this?
If I can get a new PR together that adds C implementations of `aiter` and
`anext` to builtins, would a committer still be
Joshua Bronson added the comment:
If the deciders prefer to have these in the operator module for 3.8 (as Yury
and Jelle requested above), my PR from a few months ago which implements this
(https://github.com/python/cpython/pull/8895) can still be merged with no
conflicts. I don't thin
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue36054>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
pull_requests: +5780
___
Python tracker
<https://bugs.python.org/issue32999>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue32999>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Joshua Bronson :
Creating this issue by request of INADA Naoki to discuss my proposed patch in
https://github.com/python/cpython/pull/5944.
Copy/pasting from that PR:
If you try something like issubclass('not a class', str), you get a helpful
error me
Joshua Bronson added the comment:
I'll share the use case that prompted me to submit this PR in the first place.
I am the author of bidict (https://pypi.python.org/pypi/bidict), which provides
a bidirectional dict class. A bidict is just like a dict, except it
automatically maintain
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue31861>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
pull_requests: +8266
___
Python tracker
<https://bugs.python.org/issue20849>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<https://bugs.python.org/issue20849>
___
___
Python-bugs-list mailing list
Unsubscribe:
Joshua Bronson added the comment:
I submitted a new PR in https://github.com/python/cpython/pull/8792 that
addresses the outstanding concerns in @ofekmeister's original PR. It includes
passing tests and passes all the GitHub PR status checks. Does it look ok to
merge? T
Change by Joshua Bronson :
--
keywords: +patch
pull_requests: +8368
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31861>
___
___
Py
Joshua Bronson added the comment:
Updating the issue title to reflect the decision to add these to the operator
module rather than to built-ins.
Submitted a PR here: https://github.com/python/cpython/pull/8895
--
title: aiter() and anext() built-in functions -> add aiter() and an
Joshua Bronson added the comment:
Interesting, thanks Yury!
I only saw the discussion here which implied these wouldn't go directly into
builtins for 3.8 (and I searched here and in GitHub, and couldn't find the PR
you mentioned either), so I'm curious if that was tracked som
Joshua Bronson added the comment:
This was so surprising to me that I had to check some other languages that I
had handy. It turns out that not one of JavaScript, Ruby, Perl, C++, Java, Go,
or Rust agrees with Python. In fact they all agreed with one another that 2.5
should round to 3
Joshua Bronson added the comment:
Thanks Serhiy, I read the Python-Dev thread you linked to, but that doesn't
resolve the issues:
- Its topic is Python 2.6 (where this behavior does not occur) rather than
Python 3 (where it does).
- A few messages into the thread Guido does address P
Joshua Bronson added the comment:
Thanks, Mark. Yes, I saw where Tim said round-half-even should be the default,
but I didn't see any proposal to expose it as e.g. math.round_half_even()
instead, nor a more complete look at what other languages do. That, along with
the subject being 2.
Joshua Bronson added the comment:
I spent a few minutes with git blame/checkout/show and so far have found
https://bugs.python.org/issue1869 (via
https://github.com/python/cpython/commit/e6a076d). Still reading -- looks like
there were a number of different changes made to round() at the
Changes by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<http://bugs.python.org/issue18652>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Joshua Bronson :
>From http://docs.python.org/library/heapq.html:
> The latter two functions (nlargest and nsmallest) perform best for
> smaller values of n. For larger values, it is more efficient to use
> the sorted() function. Also, when n==1, it is more effi
Joshua Bronson added the comment:
Oh, that's great!
(I also noticed that the previously inutile line "_heappushpop = heappushpop"
is now doing something in the heapq.py you linked to, nice.)
It looks like the docs haven't been updated yet though. For instance,
http:/
Joshua Bronson added the comment:
> I prefer the docs the way they are. They help the reader understand
> the relationship between min, max, nsmallest, nlargest, and sorted.
Except that it's no longer true that "when n==1, it is more efficient to use
the
builtin min() and
Joshua Bronson added the comment:
One more thing:
> I prefer the docs the way they are. They help the reader understand
> the relationship between min, max, nsmallest, nlargest, and sorted.
The docs still use the unspecific language "for smaller values of n" and
"for la
Joshua Bronson added the comment:
> That is in the pure python version of nsmallest() and that
> code is not used (it is overriden by the C version).
So just because it isn't used by CPython it should remain in there even
though as you said yourself it's completely without b
Changes by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<http://bugs.python.org/issue6626>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<http://bugs.python.org/issue6763>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<http://bugs.python.org/issue4753>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Joshua Bronson:
Since code can be clearer than prose, I just sketched this idea out in the
attached patch. Please take a look at it as a minimum demonstration of the
concept.
Rationale:
The Python standard library provides collections.OrderedDict, along with
several ABCs
Joshua Bronson added the comment:
This patch improves the OrderedMapping.__eq__ implementation to be more generic
in the case that ``other`` is an unordered Mapping of the same length as
``self``.
--
Added file: http://bugs.python.org/file45805/jab-orderedmapping-2.patch
Joshua Bronson added the comment:
Come to think of it, to be exact, rather than extending Reversible,
OrderedMapping could extend a narrower interface, something like
collections.abc.Ordered, along with extending Mapping. (Reversible implies
Ordered, but Ordered does not imply Reversible: a
Joshua Bronson added the comment:
I only just found the "[Python-ideas] Adding collections.abc.Ordered" thread at
https://mail.python.org/pipermail/python-ideas/2015-November/037146.html -
sorry for not seeing it sooner. Looking forward to catching up on wha
Joshua Bronson added the comment:
Sorry to hear but thanks for the consideration. To follow up on your comments:
> nice to see Guido's reasons for giving a -0 on the proposal.
(Guido was giving his -0 on a proposal for collections.abc.Ordered, whereas the
main proposal
Joshua Bronson added the comment:
For the record, it looks like Victor Stinner suggested doing this in
https://mail.python.org/pipermail/python-dev/2016-September/146349.html
Brett Cannon replied in
https://mail.python.org/pipermail/python-dev/2016-September/146350.html to
suggest adding
New submission from Joshua Bronson:
Is it intentional that the second assertion in the following code fails?
```
from collections import OrderedDict
d = dict(C='carbon')
o = OrderedDict(d)
assert d == o
assert d.viewitems() == o.viewitems()
```
Since d == o, I'm surprised t
New submission from Joshua Bronson:
ConfigParser.getboolean[1] has logic to convert strings like '0' and 'False' to
False. This logic is generally useful in other contexts and need not be coupled
to ConfigParser. Would you consider accepting a patch that factored this
str
Joshua Bronson added the comment:
One way this could be offered is as a new static method on bool (something like
bool.parse_str?), but I of course defer to the better judgment of the Python
core developers. I'd be happy to take a crack at a patch adding it wherever you
like, if you
Changes by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<http://bugs.python.org/issue17006>
___
___
Python-bugs-list mailing list
Unsubscribe:
Joshua Bronson added the comment:
My friend @novalis_dt and I worked up a patch for this including tests
(attached). First time working with the CPython codebase but hope it's a
reasonable start.
Here's a preview:
~>
Joshua Bronson added the comment:
Hi Raymond, I'm a bit confused by your comment. The patch I attached to my
previous message adds the static method `bool.parse_config_str`. So there's no
need to `import configparser` to use this, and "from" is no longer included in
the
Joshua Bronson added the comment:
Actually, looks like the version of the patch I attached did use the name
`bool.from_config_str`, sorry about that -- I'll attach a new patch renaming
this to `bool.parse_config_str` if there is interest in further consider
Joshua Bronson added the comment:
Though come to think of it, the issue you raised with using "from" in the
method name wouldn't apply here, since the static method is on the bool class,
and the method does return bool.
--
___
Python
Joshua Bronson added the comment:
Quoting Victor Stinner:
> I may workaround the bug during Python finalization if more users report
> this issue.
Read the above so reporting I'm hitting this too fwiw.
Thanks for the great work on asyncio.
--
Joshua Bronson added the comment:
Not sure if it's related / helpful but just in case, since upgrading from 3.4.2
to 3.4.3, I'm now seeing this printed to stderr sometimes when my program exits:
Exception ignored in: Exception ignored in: Exception ignored in: Exception
ignored in:
Changes by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<http://bugs.python.org/issue23894>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Joshua Bronson :
--
nosy: +jab
___
Python tracker
<http://bugs.python.org/issue27350>
___
___
Python-bugs-list mailing list
Unsubscribe:
79 matches
Mail list logo