[issue25863] ISO-2022 seeking forgets state

2015-12-29 Thread John Walker
John Walker added the comment: Here is Martin's message as a unit test. It checks utf-8 and the iso-2022 family except iso-2022-cn and iso-2022-cn-ext because they are not supported. The errors occur with all iso-2022 charsets. -- keywords: +patch Added file: http://bugs.pytho

[issue25977] Typo fixes in Lib/tokenize.py

2015-12-29 Thread John Walker
John Walker added the comment: You're welcome, have a happy new year. :) -- ___ Python tracker <http://bugs.python.org/issue25977> ___ ___ Python-bugs-list m

[issue25863] ISO-2022 seeking forgets state

2015-12-29 Thread John Walker
Changes by John Walker : -- nosy: +johnwalker ___ Python tracker <http://bugs.python.org/issue25863> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25977] Typo fixes in Lib/tokenize.py

2015-12-29 Thread John Walker
New submission from John Walker: Minor fixes to comments and a docstring in Lib/tokenize.py I found while looking for more important bugs. afer -> after alternately -> alternatively intput -> input argment -> argument -- assignee: docs@python components: Documentation fil

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread John Walker
John Walker added the comment: > No, the regular build uses the libmpdec that is shipped with > Python. The external libmpdec.so only comes into play if you > compile --with-system-libmpdec. Oh, OK. I see whats happening. My distro deletes the shipped version and compiles --wi

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread John Walker
John Walker added the comment: > That should only happen if the C version did not build for some reason: Ahh, gotcha. I assume one instance where this happens is when the machine doesn't have libmpdec.so -- ___ Python tracke

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread John Walker
John Walker added the comment: > I guess there's some version mixup here: From Python 3.3 on > the integrated C version of decimal does not store the digits > as a string and does not have the private _int method. Stefan, _int is a slot in Lib/_pydecimal.py. It should be defined

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-22 Thread John Walker
Changes by John Walker : -- type: -> performance ___ Python tracker <http://bugs.python.org/issue25928> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-22 Thread John Walker
John Walker added the comment: Heres the output of running the benchmark on my machine: Testing proposed implementation number = 1 0.07098613299967838 number = 10 0.6952260910002224 number = 100 6.948197601999709 Testing current implementation number = 1 0.141816276996

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-22 Thread John Walker
New submission from John Walker: In statistics, there is a FIXME on Line 250 above _decimal_to_ratio that says: # FIXME This is faster than Fraction.from_decimal, but still too slow. Half of the time is spent in a conversion in d.as_tuple(). Decimal internally stores the digits as a string