Michael Selik added the comment:
The docs for ``os.replace`` says "If dst is a directory, OSError will be
raised." That's helpful, but the docs for ``pathlib.Path.replace`` make it
seem like the target will be unconditionally replaced regardless of whether
it's a file
New submission from Michael Selik :
The pathlib module ``Path.replace(target)`` states that "If target points to an
existing file or directory, it will be unconditionally replaced." However,
this does not appear to be true. I experience an OSError ``[Errno 66]
Directory not em
Michael Selik added the comment:
+1 for this use case. Until it's resolved, perhaps there should be a note in
the singledispatch docs that types from the ``typing`` module should not be
used?
--
nosy: +selik
___
Python tracker
&
Michael Selik added the comment:
+1, This would be useful for quick analyses, avoiding the overhead of
installing scipy and looking through its documentation.
Given that it's in the statistics namespace, I think the name can be simply
``Normal`` rather than ``NormalDist``. Also, inste
Michael Selik added the comment:
I searched for previously submitted issues, but somehow didn't spot #32339.
I'll do some searching for whether anyone uses ``move_to_end`` on DictReader
rows and respond to the mailing list wit
Change by Michael Selik :
--
components: +Library (Lib)
___
Python tracker
<https://bugs.python.org/issue34003>
___
___
Python-bugs-list mailing list
Unsub
Change by Michael Selik :
--
type: -> performance
___
Python tracker
<https://bugs.python.org/issue34003>
___
___
Python-bugs-list mailing list
Unsubscrib
Michael Selik added the comment:
Pull request.
https://github.com/python/cpython/pull/8014
--
___
Python tracker
<https://bugs.python.org/issue34003>
___
___
Change by Michael Selik :
--
keywords: +patch
pull_requests: +7622
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34003>
___
___
Py
New submission from Michael Selik :
Since dicts are now keeping insertion order as of 3.7, we can switch to the
more efficient construction of dict rather than OrderedDict for each row in the
CSV file.
--
messages: 320734
nosy: selik
priority: normal
severity: normal
status: open
Change by Michael Selik :
--
components: +email
nosy: +barry, r.david.murray
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issue34
Change by Michael Selik :
--
keywords: +patch
pull_requests: +7620
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34002>
___
___
Py
New submission from Michael Selik :
The primary motivation for these improvements was avoiding a while/pop pattern
for looping. A for-loop is a big improvement over copying a list, then
repeatedly popping the 0th element.
A lesser improvement is the use of ``a.intersection(b)`` instead of
Michael Selik added the comment:
It looks like there's general agreement on python-dev that this is appropriate
for v3.8 (not v3.7).
Guido van Rossum and Ramsey D'silva gave a +1. Raymond Hettinger noted some use
cases. INADA Naoki raised a point about waiting for other imple
Michael Selik added the comment:
I changed the PR to simply replace OrderedDict with dict. For the docs
warnings, if I'm understanding correctly, those should be separate pulls for
older branches?
--
___
Python tracker
<https://bugs.py
Michael Selik added the comment:
Right, a blend of the code from dictiterobject
(https://github.com/python/cpython/blob/master/Objects/dictobject.c#L3309) and
listreviterobject
(https://github.com/python/cpython/blob/master/Objects/listobject.c#L3128
Change by Michael Selik :
--
keywords: +patch
pull_requests: +6461
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33463>
___
___
Py
Michael Selik added the comment:
Is this warning what you had in mind?
https://github.com/python/cpython/pull/6772
--
___
Python tracker
<https://bugs.python.org/issue33
New submission from Michael Selik :
Since the basic dict is now keeping insertion order, can we switch
namedtuple._asdict to return a basic dict? Other than OrderedDict.move_to_end
and the repr, I believe there is no compatibility issue.
--
messages: 316387
nosy: selik
priority
New submission from Michael Selik :
Now that dicts are tracking insertion order, they can be made reversible via
the built-in reversed, just like OrderedDict.
--
messages: 316386
nosy: selik
priority: normal
severity: normal
status: open
title: reversible dict
type: enhancement
Michael Selik added the comment:
If you're going to tackle this problem, this should probably be solved for the
general case of n <= 0 rather than just n == 0.
In [1]: import random
In [2]: class Random(random.Random):
...: def random(self):
...: return super(
Michael Selik added the comment:
You're referring to something like this:
+def test_count_and_summary(self):
+name = TESTFN + '.py'
+with open(name, 'w') as fd:
+self.addCleanup(unlink, name)
+fd.write("""\
+x
Change by Michael Selik :
--
nosy: +selik
___
Python tracker
<https://bugs.python.org/issue31908>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael Selik :
What behavior did you expect from your code?
What behavior did you get instead?
It looks like you're not calling the list copy method correctly. Try writing
"tables2.copy()" instead of "tables2.copy". It also looks like you have
Michael Selik added the comment:
Ok, pull request submitted:
https://github.com/python/cpython/pull/4205
--
___
Python tracker
<https://bugs.python.org/issue31
Change by Michael Selik :
--
keywords: +patch
pull_requests: +4174
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31908>
___
___
Py
Michael Selik added the comment:
While writing a patch for this, I noticed the ``lnotab`` parameter seems nearly
unused. It's a dict, but is only used for its keys.
https://github.com/python/cpython/blob/master/Lib/trace.py#L333
Further, the choice to count unreached lines only
Michael Selik added the comment:
The problem appears to be a mistake in commit
f026dae130bf6f9015c4b212f16852ba4a3f3dec
https://github.com/python/cpython/commit/f026dae130bf6f9015c4b212f16852ba4a3f3dec
This made the writing of cover files conditional on ``show_missing`` which is
the option
New submission from Michael Selik :
The trace module command-line utility doesn't write cover files. I've noticed
this issue for some years now. It works fine in Python 2. When using Python 3,
no ".cover" files are written, regardless of how "--coverdir" is spec
Michael Selik added the comment:
Sorry, it looks like I got the issue number wrong. My comparison should not
have been with #24454, but instead with an issue I can't locate at the moment.
Reproducing the example:
for g0, g1, g2 in re.finditer(r'(\d+)/(\d+)', 'Is
Michael Selik added the comment:
Yesterday I wanted to do a destructuring bind on a slice of groups in a
finditer. Similar situation to the use case of Issue #24454. It might not be
"normal code" but I end up in that situation every month or so when parsing
semi-structured document
Michael Selik added the comment:
This would also enable negative indexing, which currently raises "IndexError:
no such group".
Edit: I meant whole numbers, not natural numbers.
--
versions: +Python 3.7
___
Python tracker
<http://bu
Changes by Michael Selik :
--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett
type: -> enhancement
___
Python tracker
<http://bugs.python.org/issu
New submission from Michael Selik:
Currently, slicing a MatchObject causes an IndexError and len() a TypeError.
It's natural to expect slicing and len to work on objects of a finite length
that index by natural numbers.
--
messages: 291050
nosy: selik
priority: normal
severity: n
Michael Selik added the comment:
Ok, I'll change the PR.
--
___
Python tracker
<http://bugs.python.org/issue29957>
___
___
Python-bugs-list mailing list
Michael Selik added the comment:
PR submitted. I also signed the contributor agreement, but the bot doesn't seem
to have noticed.
--
___
Python tracker
<http://bugs.python.org/is
Michael Selik added the comment:
I'll submit a pull request momentarily.
--
___
Python tracker
<http://bugs.python.org/issue29957>
___
___
Python-bugs-list m
New submission from Michael Selik:
Minor, but it looks like someone decided to use a defaultdict but forgot to
remove the checks for whether a key exists.
Creating a defaultdict(list):
https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/lib2to3/btm_matcher.py
Michael Selik added the comment:
@Martin, my mistake. You're correct. I forgot I was using Python v3.4.
--
___
Python tracker
<http://bugs.python.org/is
Michael Selik added the comment:
many things are not present in os.__all__ that should be, including
os.getcwd
--
nosy: +selik
___
Python tracker
<http://bugs.python.org/issue23
40 matches
Mail list logo