Tim Peters added the comment:
I don't think we have any idea how the OP stumbled into this. Looks like it
"just happened".
The case you construted is quadratic-time, but not quite as bad:
BaB
BB
Fails at once, because 'a' doesn't match the
Tim Peters added the comment:
Yup, they act essentially the same, but yours jumps into the quicksand earlier
;-)
I'm fond of this one:
"""
HUGE = 10**7
BIG = 10**6
bigxs = 'x' * BIG
haystack = 'x' * HUGE
needle = bigxs + 'y' + bigxs
"
Tim Peters added the comment:
Dennis, I think that's expected, right? Two-way on its own can exploit nothing
about individual characters - it only preprocesses the needle to break the
possibility for quadratic-time behavior due to periods in the needle.
It sounds like you switche
Tim Peters added the comment:
I confess I _assumed_ all along that you were generalizing the current code's
Sunday trick to 7-bit equivalence classes (up from 32 bits total) and 64K
possible shift counts (up from just 2 total possibilities: 1 or len(needle)+1).
The Sunday trick cou
Tim Peters added the comment:
Note that Sunday doesn't care (at all) where mismatches occur. The "natural"
way to add Sunday: follow pure C-P unless/until it finds a mismatching
position. Pure C-P then computes a specific shift. Nothing about that changes.
But something
Tim Peters added the comment:
I'm sorry I haven't been able to give more time to this. I love what's been
done, but am just overwhelmed :-(
The main thing here is to end quadratic-time disasters, without doing
significant damage in other cases. Toward that end it would be fin
Tim Peters added the comment:
But that also suggests a different approach: start with the current code, but
add introspection to switch to your enhancement of C&P if the current code is
drifting out of linear-time territory.
--
___
Python tra
Tim Peters added the comment:
+1. If you're feeling more ambitious, it would also be good to change build.bat
and rt.bat to use the same "which platform?" spellings and with the same
defaults.
--
nosy: +tim.peters
___
Python
Tim Peters added the comment:
There's no bug here.
"&" is the bitwise Boolean logical-and operator on integers. For example,
>>> 1 & 2
0
>>> 1 & 3
1
It binds more tightly than the "==" equality-testing operator. To get the
result you w
New submission from Tim Willis :
Argparse documentation in 2.7 indicates support for an 'aliases' kwarg.
(Fourth example down from
http://docs.python.org/dev/library/argparse.html#sub-commands)
While aliases work as expected in 3.2, use in 2.7 results in TypeError:
__init_
New submission from Tim McGreevy :
When selecting from menu:
File --> Recent Files
the 'Recent Files' dropdown list undocks from the IDLE gui / File dropdown
list. Even after selecting a past file, it remains open until closed manually.
Ubuntu LUCID
amd64
IDLE 2.6.5
TK ve
Tim Willis added the comment:
Attaching a patch which merges aliases code from 3.2 back into 2.7.
--
keywords: +patch
Added file: http://bugs.python.org/file24339/argparse_aliases.patch
___
Python tracker
<http://bugs.python.org/issue13
Tim Willis added the comment:
adding package author to nosy list
--
nosy: +bethard
___
Python tracker
<http://bugs.python.org/issue13879>
___
___
Python-bug
Tim Golden added the comment:
This is a duplicate of http://bugs.python.org/issue8036
(which I still haven't got around to applying...)
--
nosy: +tim.golden
___
Python tracker
<http://bugs.python.org/is
Tim Golden added the comment:
This is the Windows x64 file system redirector at work. I can't get
through to msdn at the moment to get a link, but Google for those
terms.
--
nosy: +tim.golden
___
Python tracker
<http://bugs.python.org/is
Tim Willis added the comment:
The documentation appears to be up to date in the current 2.7 repository, so
this can probably be marked as closed/fixed.
--
___
Python tracker
<http://bugs.python.org/issue13
Tim Peters added the comment:
>From the docs, at:
http://docs.python.org/library/datetime.html#time-objects
"""
in Boolean contexts, a time object is considered to be true if and only if,
after converting it to minutes and subtracting utcoffset() (or 0 if that’s
None),
Tim Peters added the comment:
It is odd, but really no odder than "zero values" of other types evaluating to
false in Boolean contexts ;-) Closing as "invalid".
--
resolution: -> invalid
status: open -> closed
___
Tim Lesher added the comment:
This patch should both correct the incorrect acceptance of strings and the
incorrect rejection of buffer objects when using SND_MEMORY.
--
keywords: +patch
Added file: http://bugs.python.org/file24470/11620-PlaySound.patch
Changes by Tim Lesher :
--
nosy: +tlesher
___
Python tracker
<http://bugs.python.org/issue3905>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Tim McNamara :
When developing Python code, I often find myself needing to run "rm *.pyc" so
that the interpreter will ignore any new changes that I have made to source
files. It's really frustrating when forgotten.
Adding a flag to the reload builtin woul
Changes by Tim McNamara :
--
title: reload(module, ignore_pyc=True) flag -> Idea: Add a flag to reload from
source, e.g. reload(module, ignore_pyc=True)
___
Python tracker
<http://bugs.python.org/issu
Tim McNamara added the comment:
No no, I don't want to ignore source files. I want to be able to change a .py
file, then reload in the Python shell and for the changes to be applied.
At the moment, .pyc files within a project complicate
Tim Golden added the comment:
On 25/02/2012 08:09, Ezio Melotti wrote:
> Even if they know the meaning of "shallow" (which is not a really common word
> AFAICT)
FWIW it's pretty much the only way of saying what it means.
I've no idea how many people used it last
Tim Lesher added the comment:
Victor: would you object to ysj.ray's solution?
I don't think it was an option when we last looked at this issue.
--
___
Python tracker
<http://bugs.python.
Tim Lesher added the comment:
Updated patch: use Py_FileSystemDefaultEncoding (if possible) when sys.stdin
is (or becomes) invalid; if none, then fails without entering infinite loop.
Docs for PyRun_InteractiveLoopFlags have been updated.
--
Added file: http://bugs.python.org
Tim Lesher added the comment:
Corrected const warning in previous patch.
--
Added file: http://bugs.python.org/file24794/8070-use-default-encoding-2.patch
___
Python tracker
<http://bugs.python.org/issue8
Changes by Tim Lesher :
--
nosy: +tlesher
___
Python tracker
<http://bugs.python.org/issue8010>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim Golden added the comment:
Brian - I think this is your area
--
nosy: +brian.curtin, tim.golden
___
Python tracker
<http://bugs.python.org/issue14420>
___
___
Tim Golden added the comment:
It's used by some systems (Windows Notepad does this
if you save as UTF8) to indicate that the byte stream
*is* UTF8-encoded. It's not so much a BOM as a magic cookie.
I can't speak for syslog, I'm afraid
TJG
Tim Peters added the comment:
I believe the thrust of Mark's suggestion was that it would allow using `k =
(n-1).bit_length()` even when n == 1, without special-casing n == 1. But you'd
still be adding a new "subtract 1" operation, and would still change results in
so
Change by Tim Smith :
--
nosy: +tdsmith
___
Python tracker
<https://bugs.python.org/issue33725>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim Peters added the comment:
As Steven said, there's an obvious indentation error in the file you actually
attached. So nobody can _guess_ what your problem is. Please upload a file
showing your actual problem.
If I increase the indentation of the `print` Steven identified to matc
Tim Peters added the comment:
Same kind of problem with the new upload, Bob.
Line 38 is:
print(Fore.GREEN,"Installed file ",e,Fore.WHITE)
indented 8 spaces. Lines 39 and 40 are empty. Then line 41 is:
if x>=len(files): # if x is more than or equal to the number of files in t
Change by Tim Peters :
--
keywords: +patch
pull_requests: +13516
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/13612
___
Python tracker
<https://bugs.python.org/issu
Tim Peters added the comment:
Created a PR and assigned myself to this bug.
--
assignee: -> tim.peters
___
Python tracker
<https://bugs.python.org/issu
New submission from Tim Burke :
First, spin up a fairly trivial http server:
import wsgiref.simple_server
def app(environ, start_response):
start_response('200 OK', [
('Some-Canonical', 'headers'),
('sOme-CRAz
Tim Peters added the comment:
Added file arena.py. This adds some code to the OP's original test, to print
out build time and teardown time, and display obmalloc stats.
You'll need at least 80GB of RAM to run it - I don't have that much. Building
the tree may take on the o
Tim Peters added the comment:
Thank you so much, Inada! That's very good to hear :-)
--
___
Python tracker
<https://bugs.python.org/issue37029>
___
___
Tim Peters added the comment:
New changeset 1c263e39c4ed28225a7dc8ca1f24953225ac48ca by Tim Peters in branch
'master':
bpo-37029: keep usable_arenas in sorted order without searching (#13612)
https://github.com/python/cpython/commit/1c263e39c4ed28225a7dc8ca1f2495
Change by Tim Peters :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Tim Peters added the comment:
I prefer that a negative int raise ValueError, but am OK with it using the
absolute value instead (i.e., what it does now).
--
___
Python tracker
<https://bugs.python.org/issue29
Tim Peters added the comment:
Strongly prefer requiring 0 <= k <= n at first. This is a programming
language: it will be applied to real problems, not to abstract proofs where
some slop can be helpful in reducing the number of cases that need to be
considered.
The Twitter fel
Tim Peters added the comment:
I'm not convinced, although I agree relaxing k <= n is less damaging than
relaxing k >= 0.
Python isn't aimed at mathematicians (although some 3rd-party packages
certainly are, and they're free to define things however they like).
Change by Tim Hoffmann :
--
pull_requests: +13627
pull_request: https://github.com/python/cpython/pull/8518
___
Python tracker
<https://bugs.python.org/issue33
Tim Peters added the comment:
I'm going to repeat part of an earlier comment :-)
"""
Please resist pointless feature creep. The original report was about comb(n,
k) for integer n and k with 0 <= k <= n and that's all. Everyone who commented
appeared t
Tim Peters added the comment:
I'm not fatally opposed to relaxing k <= n. David makes some good points about
it, and - as Raymond already noted - "0" is consistent with the behavior of
itertools.combinations().
The docs would need to change, though, because the factorial
Tim Peters added the comment:
Ya, I'm mostly with Raymond. `math` was originally a very thin wrapper around
C's libm, but we've been moving away from that more and more for decades, and
it's no longer the case anyway that the vast bulk of new Python programmers are
inti
Tim Peters added the comment:
Python needs a benevolent dictator ;-)
I'd be happy for Mark, Raymond, or me to play that role here. If it were me,
I'd drop the k <= n requirement: both arguments must be non-negative integers.
Because a combinatorial (not factorial-, and
Tim Peters added the comment:
I haven't looked at anything in this PR, so just popping in to confirm that the
first time I saw stuff like:
len(obj, /)
in the docs I had no idea at all what it was trying to say. I thought it was a
typo.
Also the second, third, fourth, ..., times
Tim Peters added the comment:
Thank you, Friedl! I appreciate the extra confirmation - and especially on
even bigger test cases :-)
--
___
Python tracker
<https://bugs.python.org/issue37
Change by Tim Burke :
--
keywords: +patch
pull_requests: +13672
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/13788
___
Python tracker
<https://bugs.python.org/issu
New submission from Tim Hatch :
inspect.findsource() can trigger IndexError when co_firstlineno is larger than
len(linecache.getlines()).
If you have a situation where the file that linecache finds doesn't match the
imported module, then you're not guaranteed that co_firstlineno o
Change by Tim Hatch :
--
type: -> behavior
___
Python tracker
<https://bugs.python.org/issue37166>
___
___
Python-bugs-list mailing list
Unsubscrib
Tim Peters added the comment:
Also basic: run hardware CPU and memory stress diagnostics, and/or try running
the same thing on a different machine. Hardware isn't infallible, and can fail
in nearly arbitrary ways. For example, perhaps a smidgen of silicon has gone
flaky, so that one
Tim Peters added the comment:
I agree: perm(n) should return factorial(n).
--
___
Python tracker
<https://bugs.python.org/issue37178>
___
___
Python-bugs-list m
New submission from Tim Peters :
On 64-bit Python, many object sizes essentially doubled over 32-bit Python,
because Python objects are so heavy with pointers. More recently, forcing
alignment to 16 bytes on 64-bit boxes boosted the memory requirements more
modestly.
But obmalloc's 25
Change by Tim Peters :
--
keywords: +patch
pull_requests: +13801
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/13934
___
Python tracker
<https://bugs.python.org/issu
Change by Tim Peters :
--
assignee: -> tim.peters
___
Python tracker
<https://bugs.python.org/issue37211>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Tim Peters :
Scenario: all arenas are fully used. A program then runs a loop like:
while whatever:
p = malloc(n)
...
free(p)
At the top, a new arena has to be created, and a single object is taken out of
a single pool. At the bottom, that object is
Change by Tim Peters :
--
type: -> performance
___
Python tracker
<https://bugs.python.org/issue37257>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Tim Peters :
--
keywords: +patch
pull_requests: +13903
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/14039
___
Python tracker
<https://bugs.python.org/issu
Tim Peters added the comment:
New changeset d1c85a27ea9fe70163cad3443d5e534d94f08284 by Tim Peters in branch
'master':
bpo-37257: obmalloc: stop simple arena thrashing (#14039)
https://github.com/python/cpython/commit/d1c85a27ea9fe70163cad3443d5e53
Change by Tim Peters :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Tim Peters added the comment:
Looks likely that the _major_ cause of the quadratic-time delete behavior was
due to that obmalloc used a linear-time method to keep its linked list of
usable arenas sorted in order of number of free pools. When a pool became
unused, its arena's count of
Change by Tim Peters :
--
stage: resolved -> commit review
___
Python tracker
<https://bugs.python.org/issue32846>
___
___
Python-bugs-list mailing list
Un
Tim Peters added the comment:
Raymond, please read my very recent comment one above yours. A (overall)
quadratic-time algorithm (O(A**2) where A is the number of arenas) in
obmalloc.c is (to my eyes) probably the _primary_ cause of the sloth here.
That's been fixed for 3.8, but I
Tim Peters added the comment:
Thanks, Terry! Based on your latest results, "quadratic time" isn't plausible
here anymore, so I'm closing this. Nasty cache effects certainly played a
role, but they were just a flea on the dog ;-)
--
resolution: -> fix
Tim Peters added the comment:
In real life, I expect 99.999%+ of calls will be made with small arguments, so
(1) is worth it. I like Mark's suggestion to use uint64_t so the acceptable
range doesn't depend on platform. At least in the world I live in, 32-bit
boxes are all b
New submission from Tim Hatch :
TL;DR
f"{x+2}" and f"{x=}" do something sensible.
"{x+2}".format(x=1) and "{x=}".format(x=1) raise KeyError.
f"{0.1}" and "{0.1}".format(...) are different.
Having had a feature request to be able t
Tim Hatch added the comment:
ok, I suppose it's just documentation then.
--
assignee: -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
___
Python tracker
<https://bugs.python.org
New submission from Tim Hoffmann :
The documentation of `os` does not use the more specific `OSError` subclasses
introduced in PEP 3151.
--
assignee: docs@python
components: Documentation
messages: 346110
nosy: docs@python, timhoffm
priority: normal
severity: normal
status: open
title
Change by Tim Hoffmann :
--
keywords: +patch
pull_requests: +14090
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/14262
___
Python tracker
<https://bugs.python.org/issu
New submission from Tim Lusk :
I'm working on porting an application from Python 3.6.8 to 3.7.3 and am running
into this segfault.
I'm not able to pin point exactly what Python code is causing this as it's a
very large enterprise application
and I can't seem to pinpoint e
Tim Lusk added the comment:
Alright I was finally able to reproduce the issue with a small code snip and
capture the stack in gdb. It looks like the issue has something to do with an
exception thrown while importing a class (and possibly only when the class is a
c_ext, but I haven
Change by Tim Peters :
--
nosy: +tim.peters
___
Python tracker
<https://bugs.python.org/issue37448>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim Peters added the comment:
I haven't used protobuf, but it's _generally_ true that crashes that occur for
the first time in the presence of C or C++ extension modules are due to subtle
(or not so subtle) mistakes in using the sometimes-delicate Python C API. So
it's t
Tim Peters added the comment:
Mark's analysis is spot-on - good eye :-)
Here under 3.7.3 [MSC v.1916 64 bit (AMD64)] on win32, in the original script
it makes no difference at all for negative "small x" (where, as Mark said, `1 -
random.random()` is exactly representable):
Tim Peters added the comment:
I hate this change :-( The code generated for something like this today:
def f():
if 0:
x = 1
elif 0:
x = 2
elif 1:
x = 3
elif 0:
x = 4
else:
x = 5
print(x)
is the same as for:
def f():
x = 3
Tim Peters added the comment:
There's "correctness" that matters and "correctness" that's merely pedantic ;-)
CPython has acted the current way for about 15 years (since 2.4 was released),
and this is the first time anyone has raised an objection. That'
Tim Peters added the comment:
> This is the expected result of fixing a bug that has been
> open since 2008
It's the expected result of fixing a bug _by_ eliminating the optimization
entirely. It's not an expected result of merely fixing the bug. It's quite
obvious
Tim Peters added the comment:
> Using jumps is not removing the optimization
> entirely, is just a weaker and more incomplete
> way of doing the same.
Sorry, I'm afraid I have no idea what that means. The generated code before
and after was wildly different, as shown in
Tim Peters added the comment:
> we could say that it does not matter if
>
> def f():
> if 0:
> yield
>
> should be or not a generator
Slippery slope arguments play better if they're made _before_ a decade has
passed after the slope was fully greased.
There&
Change by Tim Peters :
--
nosy: +tim.peters
___
Python tracker
<https://bugs.python.org/issue37543>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Tim Peters :
--
nosy: +tim.peters
___
Python tracker
<https://bugs.python.org/issue37537>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim Froehlich added the comment:
Is it possible to amend the documentation
(https://docs.python.org/3.5/library/asyncio-subprocess.html, etc) to include a
note that the loop parameter doesn't work? I'm impacted by this bug and lost a
few hours to it.
--
nosy: +Tim
Change by Tim B :
--
pull_requests: +14665
pull_request: https://github.com/python/cpython/pull/14880
___
Python tracker
<https://bugs.python.org/issue1346
Change by Tim B :
--
versions: +Python 3.9
___
Python tracker
<https://bugs.python.org/issue1346874>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim B added the comment:
I've created a PR to potentially implement this in 3.9. Please take a look and
review/test, if this issue is still relevant to you.
--
nosy: +tbartlett0
___
Python tracker
<https://bugs.python.org/issu
Tim Peters added the comment:
You'll see much the same in every programming language that supports your
computer's floating-point hardware. Start by reading this gentle introduction:
https://docs.python.org/3/tutorial/floatingpoint.html
This bug tracker isn't a place for tu
Tim Peters added the comment:
Python delegates exponentiation with a Python float result to the platform C's
double precision `pow()` function. So this is just what the Windows C pow(2.0,
-1075.0) returns. All native floating point operations are subject various
kinds of error, and
Change by Tim Peters :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.or
Tim Peters added the comment:
Since this depends on the platform libm implementation of pow(), I'm closing
this as "won't fix".
Steve, on the chance you're serious ;-) , there are implementations of the
"constructive reals", which indeed act like infinit
Tim Peters added the comment:
Well, I have no code that would benefit from this change. What's the point?
Sure, I use _parts_ of hash codes at times, but, e.g.,
index = the_hash_code & SOME_LOW_BIT_MASK
in Python couldn't care less about the sign of `the_hash_code`
Tim Peters added the comment:
I agree: we "shouldn't have" documented anything about hash codes beyond the
invariants needed to guarantee they work for their intended purpose, chiefly
that x == y implies hash(x) == hash(y).
Which leads to your other question ;-) That inva
Tim Peters added the comment:
Mark, isn't `int()` the obvious way "to convert an integer-like thing to an
actual int"?
>>> int(True)
1
>>> int(False)
0
For the rest, I'm -True on making ~ do something magical for bools inconsistent
with what
Tim Peters added the comment:
I don't agree that "~" doesn't "work". If people are reading it as "not",
they're in error. The Python docs say ~x
means
the bits of x inverted
and that's what it does. There's no sense it whic
Tim Peters added the comment:
BTW, I should clarify that I think the real "sin" here was making bool a
subclass of int to begin with. For example, there's no sane reason at all for
bools to support division, and no reason for a distinct type not to define "~&quo
New submission from Tim Bell:
Python 3.6 documentation for email.utils.parsedate_to_datetime() says "Performs
the same function as parsedate(), but on success returns a datetime." The docs
for parsedate() say "If it succeeds in parsing the date...; otherwise None will
b
Changes by Tim Bell :
--
pull_requests: +2274
___
Python tracker
<http://bugs.python.org/issue30681>
___
___
Python-bugs-list mailing list
Unsubscribe:
801 - 900 of 2346 matches
Mail list logo