New submission from Stefan Behnel:
Fractions are great for all sorts of exact computations (including
money/currency calculations), but are quite slow due to the need for
normalisation at instantiation time.
I adapted the existing telco benchmark to use Fraction instead of Decimal to
make
Changes by Ned Deily n...@acm.org:
--
nosy: +ezio.melotti, michael.foord
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22457
___
___
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22458
___
___
Senthil Kumaran added the comment:
I addressed Antoine's comments with the patch and committed it. Thank you!
--
assignee: - orsenthil
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 901e4e52b20a by Senthil Kumaran in branch 'default':
Issue #22278: Fix urljoin problem with relative urls, a regression observed
https://hg.python.org/cpython/rev/901e4e52b20a
--
___
Python tracker
Roundup Robot added the comment:
New changeset 901e4e52b20a by Senthil Kumaran in branch 'default':
Issue #22278: Fix urljoin problem with relative urls, a regression observed
https://hg.python.org/cpython/rev/901e4e52b20a
--
nosy: +python-dev
___
Stefan Behnel added the comment:
I just thought that it might also be nice to have a direct comparison with
Decimal, so here's an updated benchmark that has an option --use-decimal to
run the same code with Decimal instead of Fraction.
Decimal is about 66x faster with Py3.4 on my side (due to
New submission from SebKL:
The following example is wrong:
https://docs.python.org/3.4/library/stdtypes.html?highlight=split#str.split
'1,2,3'.split(',', maxsplit=1)
['1', '2 3']
Is actually returning (note the missing , ):
'1,2,3'.split(',', maxsplit=1)
['1', '2,3']
--
assignee:
Raúl Cumplido added the comment:
As it is a simple one I will try to submit a patch today or tomorrow. This will
be my first contribution to Python.
--
nosy: +raulcd
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22459
Alex Willmer added the comment:
Alexander,
http://bugs.python.org/file36417/12006_3.5_complete.patch updates the previous
patches and is ready for review. Unit tests pass as of today.
Regards, Alex W.
--
nosy: +Alex.Willmer
___
Python tracker
New submission from bagrat lazaryan:
say, for renaming a variable in a block of code, or in a function, or renaming
a method name in a class, etc. nothing fancy here, a button in the replace
dialog will do.
i think the proposed functionality is needed much more often than the currently
Денис Кореневский added the comment:
There is an standard way to solve this ambiguity.
There is a special marker '--' used to force argument parsing function treat
all arguments given in command after this marker as positional arguments. It
was invented specially for tasks where you need to
Stefan Krah added the comment:
Since the functions in abstract.c have been committed by Travis Oliphant:
Could there have been a reason why the {shape=[1], strides=[-5]}
case was considered but the general case was not?
Or is it generally accepted among the numpy devs that not considering
the
Sebastian Berg added the comment:
Yeah, the code does much the same as the old numpy code (at least most of the
same funny little things, though I seem to remember the old numpy code had
something yet a bit weirder, would have to check).
To be honest, I do not know. It isn't implausible that
Antoine Pitrou added the comment:
Where are Fractions used in the real world?
--
nosy: +pitrou, skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22458
___
Stefan Behnel added the comment:
As I said, where ever exact calculations are needed. I use them for currency
calculations, for example, as they inherently avoid rounding errors during the
calculations regardless of the relative size of values. They are basically like
Decimal but with
Antoine Pitrou added the comment:
Le 22/09/2014 14:51, Stefan Behnel a écrit :
I use them for currency calculations, for example,
as they inherently avoid rounding errors during the
calculations regardless of the relative size of values.
Do other people use them for that purpose, or are
New submission from Larry Hastings:
I get a test failure in the regression test suite. This appears to be the
important bit:
Traceback (most recent call last):
File /tmp/Python-3.4.2rc1/Lib/test/test_pydoc.py, line 851, in
test_url_requests
self.assertEqual(result, title,
Georg Brandl added the comment:
I have no idea about that code, and I can't reproduce the failure.
(Could the buildbots?)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22461
___
Stefan Behnel added the comment:
I admit that I keep meeting developers who are not aware of their merits,
simply because many other programming languages don't have them available.
Specifically, many developers with a Java background firmly believe that
BigDecimal is the only way to do money
R. David Murray added the comment:
I can't reproduce it either, and none of the failing stable buildbots show this
error. Unfortunately we can only look at tip since we can't see your tag yet.
But I doubt that's the issue...the last commit to pydoc or its tests was on the
17th, and was a
Larry Hastings added the comment:
FWIW, 3.4.2rc1 is based on 7af0315bdfe0. (The release process creates a couple
additional changesets.)
The failure is on my laptop, Ubuntu 14.04 x64.
--
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
No failure running test_pydoc for me on gentoo linux with that changeset.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22461
___
Demian Brecht added the comment:
Heh, I'd finally gotten a few minutes to address the comments... And it's
already taken care of ;) Thanks Senthil.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22278
Alexander Belopolsky added the comment:
I find this footnote somewhat confusing:
(8) Similar to %U and %W, %V is only used in calculations when the day of the
week and the ISO year (%G) are specified when used with the strptime method.
The existing footnote (7) is much clearer:
(7) When
Alexander Belopolsky added the comment:
How was %Y %V issue resolved? I don't see any tests for this case.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12006
___
Antoine Pitrou added the comment:
My point is that if fractions are little used right now, there's little point
in adding a benchmark about them in the official benchmark suite. The
benchmark suite does not aim at measuring every possible aspect of Python
performance, but at showcasing
Alexander Belopolsky added the comment:
[Raymond]
The current behavior has been around for a long time and is implemented in
several modules including decimal and fractions.
No, in the fractions module floor division returns an int:
type(Fraction(2) // Fraction(1))
class 'int'
It is also
New submission from Mark Shannon:
Modules/pyexpat.c includes some archaic code to create temporary frames
so that, in even of an exception being raised, expat appears in the traceback.
The way this is implemented is a problem for three reasons:
1. It violates PEP 384.
2. It is incorrect, see
Changes by Mark Shannon m...@hotpy.org:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22462
___
___
Python-bugs-list mailing list
Mark Dickinson added the comment:
-1 from me, too. It's an unnecessary change, and the conversion from float to
integer potentially expensive compared to the computation of the floating-point
result (especially in extended floating-point implementations that allow a
wider exponent range).
Mark Dickinson added the comment:
I've always viewed the `Fraction` type as more of a teaching tool than
something intended for real-world calculations. If that's not how others see
it, then it might be worth investing some effort in reimplementing
`Fractions.gcd` in C: the `Fraction` type
Alexander Belopolsky added the comment:
[Raymond]
The PEP should be revised to say that floor division is defined to
return a value that is *equal* to an Integral but not place any
restriction on the return type.
If we take this route, what float('inf') // 1 and float('nan') // 1 should
Mark Dickinson added the comment:
If we take this route, what float('inf') // 1 and float('nan') // 1 should
return?
Probably exactly the same as they do right now. I think there's an argument
that `float('inf') // 1` should have been `float('inf')`. But I'm not sure
there's much of a
New submission from Julien ÉLIE:
Building Python 2.7.8 on AIX 7.1 gives the following warnings:
Parser/pgen.c:282:9: warning: variable 'i' set but not used
[-Wunused-but-set-variable]
Include/objimpl.h:164:66: warning: right-hand operand of comma expression has
no effect [-Wunused-value]
New submission from Stefan Behnel:
Fractions are an excellent way to do exact money calculations and largely beat
Decimal in terms of simplicity, accuracy and safety. Clearly not in terms of
speed, though.
The current implementation does some heavy type checking and dispatching in
__new__()
Stefan Behnel added the comment:
Speed improvements for fractions should have their own ticket(s). I created
issue 22464 for this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22458
___
Zachary Ware added the comment:
R. David Murray wrote (on python-committers):
So...Larry broke it, but it is not obvious how. Could it be something
wrong with the pydoc topics update for the release?
Indeed, it looks like somehow the pydoc-topics update turned all of the values
in the
Georg Brandl added the comment:
That is very likely the reason. So far nobody has run the builder with Python 3.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22461
___
Ned Deily added the comment:
Duplicate of Issue21431?
--
nosy: +ned.deily
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22461
___
___
Georg Brandl added the comment:
Yep.
--
resolution: - duplicate
status: open - closed
superseder: - 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are
type bytes not str
___
Python tracker rep...@bugs.python.org
Stefan Behnel added the comment:
Adding Mark Dickinson to the noisy list who mentioned having worked on a C
implementation for gcd(). I think this would be a good thing to try. However,
the most important part would be to restructure and specialise
Fraction.__new__().
--
nosy:
Serhiy Storchaka added the comment:
Where are Fractions used in the real world?
For example Andrew Svetlov uses them in his online game [1]. May be it will
explain this in detail.
[1] http://asvetlov.blogspot.com/2012/08/numerics.html (on Russian).
--
nosy: +asvetlov,
Changes by Serhiy Storchaka storch...@gmail.com:
--
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18629
___
___
Stefan Behnel added the comment:
Here is a straight forward patch that special cases int values in the
constructor. It gives me a 35% speedup in the benchmark.
--
keywords: +patch
Added file: http://bugs.python.org/file36687/special_case_int.patch
Changes by Stefan Behnel sco...@users.sourceforge.net:
--
type: - performance
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22464
___
___
Changes by Zachary Ware zachary.w...@gmail.com:
--
nosy: +zach.ware
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21431
___
___
Python-bugs-list
Changes by David Edelsohn dje@gmail.com:
--
nosy: +David.Edelsohn
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22463
___
___
Python-bugs-list
Stefan Behnel added the comment:
Updated patch - there is a somewhat hidden attempt in the code to keep
nominator and denominater plain int values, not subtypes. That means that it's
safer to restrict the optimisation to plain ints as well, which should still
hit 95% of the use cases.
David Edelsohn added the comment:
Any feedback about which approach would be acceptable?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22396
___
Changes by Stefan Behnel sco...@users.sourceforge.net:
Added file: http://bugs.python.org/file36689/special_case_int3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22464
___
Serhiy Storchaka added the comment:
What speedup give you second change?
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22464
___
Roundup Robot added the comment:
New changeset d71c351a6a0f by Georg Brandl in branch '3.4':
Closes #21431: make docs depend on Sphinx 1.2 and fix pydoc-topics builder to
https://hg.python.org/cpython/rev/d71c351a6a0f
--
nosy: +python-dev
resolution: - fixed
stage: needs patch -
Georg Brandl added the comment:
Should be fixed now. I didn't merge into default since someone (cough) has to
null-merge all the release related stuff first.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21431
Stefan Behnel added the comment:
The second isn't a big difference because it only hits plain instantiations
from integers. They are less likely to be performance critical than those from
a quotient, which happen for all calculations.
It's more for symmetry, I guess.
--
Stefan Behnel added the comment:
I found one more place where special casing helps: equal comparisons to
integers, e.g. f == 0 or f == 1 or so. timeit shows me a speedup by a factor of
three for this, with only a tiny slow-down when comparing fractions on both
sides.
I put all of them in one
Serhiy Storchaka added the comment:
Microbenchmarks show about 2x speedup in both cases.
The patch LGTM.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22464
___
Alexander Belopolsky added the comment:
Mark,
Raymond suggested that The PEP 3141 should be revised to say that floor
division is defined to return a value that is *equal* to an Integral.
Since nan or inf are not *equal* to any Integral, the current implementation
does not comply. In the
Stefan Behnel added the comment:
Benchmark profile after the patch:
5930670 function calls (5930288 primitive calls) in 3.748 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
5196320.8280.0000.8280.000
Stefan Krah added the comment:
Alexander Belopolsky rep...@bugs.python.org wrote:
Raymond suggested that The PEP 3141 should be revised to say that floor
division is defined to return a value that is *equal* to an Integral.
I guess it should say equal to an Integral or a special value.
New submission from Pau Amma:
In
https://docs.python.org/2/reference/datamodel.html#the-standard-type-hierarchy,
under numbers.Real (float), in sentence
the savings in processor and memory usage that are usually the reason for
using these is dwarfed by the overhead of using objects in
Alexander Belopolsky added the comment:
skrah I think both should return inf.
What about this case:
Decimal('1') // Decimal('-inf')
Decimal('-0')
1. // float('-inf')
-1.0
--
___
Python tracker rep...@bugs.python.org
Mark Dickinson added the comment:
I think that one's covered by #22198.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22444
___
___
Changes by Alexander Belopolsky alexander.belopol...@gmail.com:
--
nosy: +belopolsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22198
___
___
Alexander Belopolsky added the comment:
I wonder if it would make sense to rewrite float_divmod using the newer
POSIX/C99 remquo function. I believe it is designed to compute the exact value
of round(x/y), but getting floor instead should not be hard. Its behavior on
special values is fully
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22198
___
Stefan Behnel added the comment:
Here is another little optimisation that removes the redundant property lookups
for the denominator in __add__() and __sub__().
New profile:
5291182 function calls (5290800 primitive calls) in 3.596 seconds
Ordered by: internal time
ncalls
Raúl Cumplido added the comment:
It was also incorrect on the example for bytes split:
b'1,2,3'.split(b',', maxsplit=1)
[b'1', b'2 3']
Patch submitted.
--
keywords: +patch
Added file: http://bugs.python.org/file36692/issue22459.patch
___
paul j3 added the comment:
Proposed patches like this are supposed to be generated against the current
development version (3.5...), especially if they are 'enhancements' (as opposed
to bugs). But there isn't much of a difference in argparse between 2.7+ and
3.4+ (except one nested yield
Roundup Robot added the comment:
New changeset 1248796b7945 by Ned Deily in branch 'default':
Issue #21431: merge from 3.4
https://hg.python.org/cpython/rev/1248796b7945
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21431
Ned Deily added the comment:
To expedite matters, I did the almost-null post-release cleanup merge and then
merged the fix for this issue. So I think this issue is now complete.
--
___
Python tracker rep...@bugs.python.org
Larry Hastings added the comment:
If this is fixed, then how come I hit it again today?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21431
___
Ned Deily added the comment:
It was just fixed today, after the release.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21431
___
___
Larry Hastings added the comment:
Oh, because it was only fixed today. As Emily Litella used to say... never
mind!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21431
___
STINNER Victor added the comment:
10812_aix.patch just hides the problem.
I understand that AIX doesn't declare the function prototype correctly? I would
prefer to disable the function in the posix module (don't declare it) if it's
the case.
--
nosy: +haypo
STINNER Victor added the comment:
I understand that AIX doesn't declare the function prototype correctly?
AIX bug report:
http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170
I like Ruby's patch:
-#ifdef HAVE_POSIX_FADVISE
+/* AIX currently does not support a 32-bit call to
Robert Collins added the comment:
I can certainly write the reporter glue to work with either a string or a full
reference. Note that the existing late-reporting glue captures the import error
into a string, and then raises an exception containing that string - so what
I've done is consistent
New submission from Khalid:
when I'm installing python 2.7.8 I get error there is a problem with this
windows installer package. a DLL required for this install to complete could
not be run. I'm using windows 8.1 64bit
--
components: Installation
files: Capture.JPG
messages: 227319
Eric V. Smith added the comment:
Where did you download the installer from?
How are you running the installer?
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22466
___
Changes by Case Van Horsen cas...@gmail.com:
--
nosy: +casevh
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22198
___
___
Python-bugs-list mailing
Khalid added the comment:
Downloaded from official website I run it by simply double click. by the
way there is no run as admin
On Sep 23, 2014 4:51 AM, Eric V. Smith rep...@bugs.python.org wrote:
Eric V. Smith added the comment:
Where did you download the installer from?
How are you
Changes by Berker Peksag berker.pek...@gmail.com:
--
stage: needs patch - resolved
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22461
___
___
Josh Rosenberg added the comment:
LGTM. About a straightforward as it gets.
--
nosy: +josh.rosenberg
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22459
___
Roundup Robot added the comment:
New changeset 8eb4eec8626c by Benjamin Peterson in branch '3.4':
fix error in split() examples (closes #22459)
https://hg.python.org/cpython/rev/8eb4eec8626c
New changeset 6dcc96fa3970 by Benjamin Peterson in branch 'default':
merge 3.4 (#22459)
New submission from DS6:
Inconsistent casing, such as Content-type vs Content-Type, Content-Length
vs Content-length, while technically not breaking any RFC or other
HTTP-related rules (headers are case-insensitive, after all), can occasionally
cause problems when attempting to retrieve
Senthil Kumaran added the comment:
First thing (and the easiest is), if you find inconsistent casing in
http/server.py itself, then make it consistent in your patch against cpython
default branch (from hg.python.org). Make it Content-Length and Content-Type in
your patch.
Next part is while
DS6 added the comment:
Erp, *retrieve, and I meant copyfile, not sendfile. I'm tired.
Very quick reply, by the way.
I suppose I forgot to mention that _headers_buffer is for sending headers, not
for receiving them. As far as I can read, the received header information is
already
87 matches
Mail list logo