[As requested, repost from comp.lang.python]
Hi,
today I have released the following packages for fast arbitrary precision
decimal arithmetic:
1. libmpdec
Libmpdec is a C (C++ ready) library for arbitrary precision decimal
arithmetic. It is a complete implementation of Mike
[Paul Rubin]
The idea was that you have a list of trees that you want to sort, and
an ordering relation between trees:
def gt(tree1, tree2): ...
where you recursively descend both trees until you find an unequal
pair of nodes. You're not trying to sort the nodes within a single
tree.
[Paul Rubin]
The idea was that you have a list of trees that you want to sort, and
an ordering relation between trees:
def gt(tree1, tree2): ...
Are the trees user defined classes? Can the gt() function be added
incorporated as __lt__ method so that you can just run a plain sort:
Philip Semanchuk phi...@semanchuk.com writes:
Our project uses some libraries that were written by 3rd parties (i.e.
not us). These libraries fit into a single Python file and live in our
source tree alongside other modules we've written.
Why in the same source tree? They are maintained
On Fri, 2009-10-02 at 20:22 -0400, Simon Forman wrote:
2.5 +1
I'd like to suggest 2.46 instead.
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
Haskell has a new logo. A fantastic one. Beautiful. For creator,
context, detail, see bottom of:
What does this have to do with Python? Nothing.
So why are you posting it to comp.lang.python?
Chris
--
Simplistix - Content Management, Batch Processing Python Consulting
On Oct 2, 9:50 pm, Philip Semanchuk phi...@semanchuk.com wrote:
Hi all,
PEP 8 http://www.python.org/dev/peps/pep-0008/ says the following:
Imports should be grouped in the following order:
1. standard library imports
2. related third party imports
3. local
Raymond Hettinger pyt...@rcn.com writes:
Can you give an example of a list of trees and a cmp function
that recursively compares them?
Example of list of trees (nested dicts). In practice you could get
such a list from the simplejson module:
list_of_trees = [{'value':1,
Paul Rubin http://phr...@nospam.invalid writes:
Example comparison function:
def compare(tree1, tree2):
c = cmp(tree1['value'], tree2['value'])
if c != 0: return c
c = cmp(tree1['left'], tree2['left'])
if c != 0: return c
return cmp(tree1['right'],
Hi,
I am trying to send compressed data to a server written in django. But
it shows error while decompressing the data in the server. After some
experiment I found that the server is not receiving the exact data I
am sending.
data = 'hello, this is a test message this is another message'
data =
bukzor wrote:
I would assume that putting scripts into a folder with the aim of re-
using pieces of them would be called a package, but since this is an
anti-pattern according to Guido, apparently I'm wrong-headed here.
(Reference:
On Fri, 02 Oct 2009 18:14:44 -0700, bukzor wrote:
I would assume that putting scripts into a folder with the aim of re-
using pieces of them would be called a package,
A package is a special arrangement of folder + modules. To be a package,
there must be a file called __init__.py in the
Hi all,
I have some calendar data in three arrays corresponding to yr, month,
day that I would like to convert to day since data and be consistent
with changes in leap year. I've included a sample of the data
structures below. Any suggestions??? Thanks in advance
yr mnth
On 2 Okt, 21:30, Dave Angel da...@ieee.org wrote:
There could very well be multiprocess support in wxPython. I'd check
there first, before re-inventing the wheel.
I don't think there is. But one can easily make a thread in the
subprocess that polls a pipe and calls wx.PostEvent or
J Wolfe vorticitywo...@gmail.com wrote:
Hi,
Is there a way to flag re.sub not to replace a portion of the string?
I have a very long string that I want to add two new line's to rather
than one, but keep the value X:
string = testX.\n.today -- note X is a value
string =
http://blog.plover.com/prog/haskell/logo.html
Oops...
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 03 Oct 2009 10:24:13 +0200, Stef Mientki wrote:
I still don't use (because I don't fully understand them) packages, but
by trial and error I found a reasonable good working solution, with the
following specifications
I find that fascinating. You haven't used packages because you don't
The Python: Rag October issue available
The October issue of The Python: Rag is available at:
http://www.pythonrag.org
A monthly, free, community run, Python magazine - issues are in pdf
format, intended for anyone interested in Python, without being
particularly serious. If you have
Hi,
Is there a way to flag re.sub not to replace a portion of the string?
I have a very long string that I want to add two new line's to rather
than one, but keep the value X:
string = testX.\n.today -- note X is a value
string = re.sub(testX.\n.,testX.\n\n., string)
Great description - wish the Python docs could be as clear. Thanks.
\d
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin http://phr...@nospam.invalid writes:
c = compare(tree1['left'], tree2['left'])
Of course this recursive call crashes if either branch is None.
Oh well, I'll stop trying to correct it since I'm sure you get the idea.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 27, 6:39 pm, Mark Tolonen metolone+gm...@gmail.com wrote:
Junaid junu...@gmail.com wrote in message
news:0267bef9-9548-4c43-bcdf-b624350c8...@p23g2000vbl.googlegroups.com...
I want to do replacements in a utf-8 text file. example
f=open(test.txt,r) #this file is uft-8 encoded
raw
2009/10/3 Xah Lee xah...@gmail.com:
for my criticism or comment on logos, typical response by these people
are showcases of complete ignorance of social function of logos
[snip and rearrange]
discussed now and then in these communities often without my
involvement.
“you are a fucking
subeen tamim.shahr...@gmail.com (s) wrote:
s Hi,
s I am trying to send compressed data to a server written in django. But
s it shows error while decompressing the data in the server. After some
s experiment I found that the server is not receiving the exact data I
s am sending.
s data = 'hello,
skorpi...@gmail.com skorpi...@gmail.com (sc) wrote:
sc Hi all,
sc I have some calendar data in three arrays corresponding to yr, month,
sc day that I would like to convert to day since data and be consistent
sc with changes in leap year. I've included a sample of the data
sc structures below.
Mark Dickinson dicki...@gmail.com wrote:
On Oct 2, 8:53 pm, Stefan Krah stefan-use...@bytereef.org wrote:
Hi,
today I have released the following packages for fast arbitrary precision
decimal arithmetic:
[...]
Nice! I'd been wondering how you'd been finding all those decimal.py
I'm relatively new to Python, and I'm trying to get the hang of
using Python's subprocess module. As an exercise, I wrote the Tac
class below, which can prints output to a file in reverse order,
by piping it through the Unix tac utility. (The idea is to delegate
the problem of managing the
On 3 Oct, 00:33, Xah Lee xah...@gmail.com wrote:
Haskell has a new logo. A fantastic one. Beautiful. For creator,
context, detail, see bottom of:
• A Lambda Logo Tour
http://xahlee.org/UnixResource_dir/lambda_logo.html
I'm amazed he thinks anyone would donate 3 USD
to that site
--
Hi, py.folk!
I need your help to understand how
http://www.spoj.pl/problems/INOUTEST/
can be passed in Python.
I see two guys who managed to get accepted:
http://www.spoj.pl/ranks/INOUTEST/lang=PYTH
My code for this is:
===
import psyco
psyco.full()
On Oct 2, 7:04 am, Patrick Sabin patrick.just4...@gmail.com wrote:
I use setuptools to create a package. In this package I included some
images and I checked that they are in the egg-file. The problem is how
can I access the images in the package?
I tried pkgutil.get_data, but only got an
On Oct 2, 11:14 pm, greg g...@cosc.canterbury.ac.nz wrote:
Brian D wrote:
This isn't merely a question of knowing when to use the right
tool. It's a question about how to become a better developer using
regular expressions.
It could be said that if you want to learn how to use a
hammer,
Hi;
I want to create option elements within a select element in which I
could insert html, which, of course, is illegal (don't tell the police ;) so
I'm looking at recreating the form elements using my own customized
elements, that is, hacking the equivalent from scratch, but how do I
proceed? I
In 7xtyyhikrl@ruckus.brouhaha.com Paul Rubin
http://phr...@nospam.invalid writes:
Python 2.x provides two ways
and you can use whichever one fits the application better. I have
never understood why Python 3.x finds it necessary to break one of
them. Maybe I can migrate to Haskell by the
On Fri, 02 Oct 2009 11:32:41 -0700, steven.oldner wrote:
Hi, no -its just put on the website. Unless there's a method you can
suggest?
Cheers
Bernie
On Oct 2, 11:14 am, Bernie edi...@pythonrag.org wrote:
The Python: Rag October issue available
The October issue of The Python: Rag
Laszlo Nagy wrote:
I'm looking for an open source, AJAX based widget/windowing framework.
Here is what I need:
- end user opens up a browser, points it to a URL, logs in
- on the server site, sits my application, creating a new session for
each user that is logged in
- on the server site,
Dear group
I'm trying to use PIL to write an array (a NumPy array to be exact) to
an image.
Peace of cake, but it comes out looking strange.
I use the below mini code, that I wrote for the purpose. The print of
a looks like expected:
[[ 200. 200. 200. ...,0.0.0.]
[ 200. 200.
It's Xah Lee, he's been trolling this and every other programing
language group for over 10 years (preferably all at once). Let it go.
On Sat, Oct 3, 2009 at 2:53 AM, Chris Withers ch...@simplistix.co.uk wrote:
Xah Lee wrote:
Haskell has a new logo. A fantastic one. Beautiful. For creator,
kj no.em...@please.post writes:
!!!
Maybe Haskell is much handier than I give it credit for, but it's
hard for me to imagine that it is as convenient as Python 3, even
without the cmp sort option...
Heh, yeah, I was being a bit snarky/grouchy. Haskell has a very steep
learning curve and
On Oct 2, 4:47 pm, Andrew MacIntyre andy...@bullseye.apana.org.au
wrote:
There are two things you need to be aware of in this situation:
- not all Python's memory is allocated through Python's specialised
malloc() - int and float objects in particular (in 2.x at least) are
allocated
Martin wrote:
Dear group
I'm trying to use PIL to write an array (a NumPy array to be exact) to
an image.
Peace of cake, but it comes out looking strange.
I use the below mini code, that I wrote for the purpose. The print of
a looks like expected:
[[ 200. 200. 200. ...,0.0.0.]
I want to create option elements within a select element in which
I could insert html, which, of course, is illegal (don't tell the
police ;) so I'm looking at recreating the form elements using my own
customized elements, that is, hacking the equivalent from scratch, but
how do I proceed? I
Martin wrote:
Dear group
I'm trying to use PIL to write an array (a NumPy array to be exact) to
an image.
Peace of cake, but it comes out looking strange.
I use the below mini code, that I wrote for the purpose. The print of
a looks like expected:
[[ 200. 200. 200. ...,0.0.
On Oct 2, 11:20 am, Francis Moreau francis.m...@gmail.com wrote:
Hello,
I'm looking at gcmodule.c and in move_unreachable() function, the code
assumes that if an object has its gc.gc_refs stuff to 0 then it *may*
be unreachable.
How can an object tagged as unreachable could suddenly become
Hi
I know that in python, we can do the same with regexps or *.split()*,
but thats longer and less practical method than *scanf()*. I also found
that ( http://code.activestate.com/recipes/502213/ ), but the code
doesn't looks so simple for beginners. So, whether it is or has been
planned the
Hi,
Shaun wrote:
I'm trying to create a dictionary with lists as the value for each
key. I was looking for the most elegant way of doing it...
from collections import defaultdict
d = defaultdict(list)
d[joe].append(something)
d[joe].append(another)
d[jim].append(slow down, grasshopper)
Shaun wrote:
testDict = {}
...
testDict [1] = testDict.get (1, []).append (Test0) # 1 does not
exist, create empty array
print testDict
testDict [1] = testDict.get (1, []).append (Test1)
print testDict
[ ... ]
However, the first printout gives {1: None} instead of the desired
{1:
ryniek90 wrote:
Hi
I know that in python, we can do the same with regexps or *.split()*,
but thats longer and less practical method than *scanf()*. I also found
that ( http://code.activestate.com/recipes/502213/ ), but the code
doesn't looks so simple for beginners. So, whether it is or has
On Sat, Oct 3, 2009 at 6:54 AM, n00m n...@narod.ru wrote:
Hi, py.folk!
I need your help to understand how
http://www.spoj.pl/problems/INOUTEST/
can be passed in Python.
snip
def foo():
##sys.stdin = open('D:/1583.txt', 'rt')
a = sys.stdin.readlines()
That line is probably a Very Bad
n00m wrote:
Hi, py.folk!
I need your help to understand how
http://www.spoj.pl/problems/INOUTEST/
can be passed in Python.
I see two guys who managed to get accepted:
http://www.spoj.pl/ranks/INOUTEST/lang=PYTH
My code for this is:
===
import psyco
On Oct 2, 7:33 pm, Xah Lee xah...@gmail.com wrote:
Haskell has a new logo. A fantastic one. Beautiful. For creator,
context, detail, see bottom of:
• A Lambda Logo Tour
http://xahlee.org/UnixResource_dir/lambda_logo.html
Interesting.. rant. Thanks for the logo collection, though, some of
When I run this little test program on Linux:
import subprocess
subprocess.call([python,-V], stderr=open(log.tmp,a))
the file log.tmp is appended to each time I run it.
When I run it on Windows, however, the file log.tmp gets
overwritten each time I run it.
Though I can make it append on
On Oct 3, 6:35 am, Piet van Oostrum p...@cs.uu.nl wrote:
skorpi...@gmail.com skorpi...@gmail.com (sc) wrote:
sc Hi all,
sc I have some calendar data in three arrays corresponding to yr, month,
sc day that I would like to convert to day since data and be consistent
sc with changes in leap
On 2009-10-03, ryniek90 rynie...@gmail.com wrote:
So, whether it is or has been planned the core Python
implementation of *scanf()* ?
One of the fist things I remember being taught as a C progrmmer
was to never use scanf. Programs that use scanf tend to fail
in rather spectacular ways when
On Oct 4, 2:29 am, Chris Rebert c...@rebertia.com wrote:
That line is probably a Very Bad Idea (TM) as it reads the *entire*
enormous file into memory *at once*. It would probably be much better
to iterate over the file, thus only reading one individual line at a
time. I'm betting the
PS
Time Limit for this problem = 20s
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I have a data structure in a list as in: [0 0 0 3 0 5 0 0 0 0 1 0 4 0
5 0 0 7 0 0 0 0 0 12 0 0 4]
I would like to extract three list from this data:
1) runsOfZero: [3 4 5]
2) runsOfNonZero: [3 8 4]
3) SumOfRunsOfNonZero: [8 17 16]
Any suggestions would be appreciated
--
On Sat, Oct 3, 2009 at 7:21 PM, skorpi...@gmail.com skorpi...@gmail.com wrote:
Hi all,
I have a data structure in a list as in: [0 0 0 3 0 5 0 0 0 0 1 0 4 0
5 0 0 7 0 0 0 0 0 12 0 0 4]
I would like to extract three list from this data:
1) runsOfZero: [3 4 5]
2) runsOfNonZero: [3 8 4]
3)
On Oct 3, 10:36 pm, Chris Rebert c...@rebertia.com wrote:
On Sat, Oct 3, 2009 at 7:21 PM, skorpi...@gmail.com skorpi...@gmail.com
wrote:
Hi all,
I have a data structure in a list as in: [0 0 0 3 0 5 0 0 0 0 1 0 4 0
5 0 0 7 0 0 0 0 0 12 0 0 4]
I would like to extract three list from
On Sat, Oct 3, 2009 at 7:53 PM, skorpi...@gmail.com skorpi...@gmail.com wrote:
On Oct 3, 10:36 pm, Chris Rebert c...@rebertia.com wrote:
snip
Since this sounds like homework, I won't give actual code, but here's
a gameplan:
1. Split the list into sublists based on where the runs of zeros stop
On Oct 3, 4:29 pm, Bernie edi...@pythonrag.org wrote:
Hi, no -its just put on the website. Unless there's a method you can
suggest?
Not to butt in, but off the top of my head, you could probably set up
a mailing list and post the link to the file every cycle - simple but
effective.
--
All,
I've got a strange one..
I'm trying to create a class object inside another class object by
using the code template below (note.. this isn't the exact code.. I'm
having difficulty reproducing it without posting the whole thing)
Anyways, the upshot is that the first time the Myclass()
On Oct 3, 11:54 pm, n00m n...@narod.ru wrote:
I need your help to understand howhttp://www.spoj.pl/problems/INOUTEST/
can be passed in Python.
My code for this is:
===
import psyco
psyco.full()
import sys
def noo(b):
b = b.split()
return
On Sat, Oct 3, 2009 at 11:32 PM, horos11 horo...@gmail.com wrote:
All,
I've got a strange one..
I'm trying to create a class object inside another class object by
using the code template below (note.. this isn't the exact code.. I'm
having difficulty reproducing it without posting the whole
Do you know how big the input data set actually is?
Of course, I don't know exact size of input.
It's several MBs, I guess. And mind the fact:
their testing machines are PIII (750MHz).
--
http://mail.python.org/mailman/listinfo/python-list
Shaun wrote:
Hi,
I'm trying to create a dictionary with lists as the value for each
key. I was looking for the most elegant way of doing it...
Try using a tuple, instead of a list, for each key. Tuples
are immutable, so there's no issue about a key changing while
being used in a
On Oct 4, 1:58 pm, n00m n...@narod.ru wrote:
Do you know how big the input data set actually is?
Of course, I don't know exact size of input.
It's several MBs, I guess. And mind the fact:
their testing machines are PIII (750MHz).
Well, then, that's moved the problem from challenging to
On my machine, the above code handles ~50MB in ~10sec.
Means their input 40-50MB
2.
I just see: two guys did it in Python
and I feel myself curious how on earth?.
--
http://mail.python.org/mailman/listinfo/python-list
skorpi...@gmail.com skorpi...@gmail.com writes:
Any suggestions would be appreciated
Look at the docs of the groupby function in the itertools module.
--
http://mail.python.org/mailman/listinfo/python-list
a
__main__.Myclass instance at 0x95cd3ec b
__main__.Myclass instance at 0x95cd5ac
What's the problem?
Like I said, the code was a sample of what I was trying to do, not the
entire thing.. I just wanted to see if the metaphor was kosher.
It sounds to me from your answer that this is
And *without* Psyco the above code gets TLE verdict...
A kind of mystery :(
--
http://mail.python.org/mailman/listinfo/python-list
Anyways, I see what's going on here:
With the line,
for state in curstate.next_states():
if not state.to_string() in seen_states:
dq.append(state)
Inadvertently using the name of a module as a variable seems to be
causing this.
In any case, this shouldn't cause issues with
On Oct 3, 11:58 pm, n00m n...@narod.ru wrote:
Do you know how big the input data set actually is?
Of course, I don't know exact size of input.
It's several MBs, I guess. And mind the fact:
their testing machines are PIII (750MHz).
You know the maximum size of the input, if you can trust the
Ezio Melotti ezio.melo...@gmail.com added the comment:
Benjamin already replaced hasattr(x, __call__) with hasattr(type(x),
__call__) in the Python 3.0 What's New in r75090 and r75094, but
this still doesn't match completely the behavior of callable():
class Foo(object): pass
...
foo = Foo()
Jan Hosang jan.hos...@gmail.com added the comment:
This is a 64 bit machine and the test failed for the checkout of the
python26-maint branch. I just configured and made it without any flags.
(Does that produce a 64 bit build?)
--
___
Python
Mark Dickinson dicki...@gmail.com added the comment:
2.6 fix applied in r75203.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7019
___
Martin v. Löwis mar...@v.loewis.de added the comment:
I can't reproduce that; it prints fine for me.
Notice that it is perfectly fine for Python to represent this as two
code points in UCS-2 mode (so that len(s)==2); this is called UTF-16.
--
nosy: +loewis
Ned Deily n...@acm.org added the comment:
By default, 10.6 prefers to run 64-bit architectures when available. You
can easily tell whether a python 2.x is running as 32-bit or 64-bit by
checking sys.maxint:
$ /usr/local/bin/python2.6 -c 'import sys; print sys.maxint'
2147483647
$
Georg Brandl ge...@python.org added the comment:
Sounds like a useful new API. Two comments:
* The version without *base* is not needed. Passing an explicit NULL
for *base* is easy enough.
* The name PyErr_Create is needlessly different from
PyErr_NewException. Something like
Jan Hosang jan.hos...@gmail.com added the comment:
$ ./python.exe -c 'import sys; print sys.maxint'
9223372036854775807
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7042
___
Ezio Melotti ezio.melo...@gmail.com added the comment:
I can't reproduce it either on Ubuntu 9.04 32-bit. I tried both from the
terminal and from the file, using Py3.2a0.
As Martin said, the fact that in narrow builds of Python the codepoints
outside the BMP are represented with two surrogate
Mark Dickinson dicki...@gmail.com added the comment:
Rejecting the request to add int.hex.
I've added a note to the hex() docs pointing to float.hex(), in revisions
r75025 through r75028.
It doesn't really seem worth adding pointers from float.hex and
float.fromhex back to integer analogues:
Trundle andy-pyt...@hammerhartes.de added the comment:
As every type is an instance of `type`, every type also has a
`__call__` attribute which means ``hasattr(type(x), '__call__')`` is
always true. `callable()` checks whether `tp_call` is set on the type,
which cannot be done in Python
Arc Riley arcri...@gmail.com added the comment:
Python 3.1.1 (r311:74480, Sep 13 2009, 22:19:17)
[GCC 4.4.1] on linux2
Type help, copyright, credits or license for more information.
import sys
sys.maxunicode
1114111
u = 'ё'
print(u)
Traceback (most recent call last):
File stdin, line 1, in
New submission from Stefan Krah stefan-use...@bytereef.org:
In many cases, decimal.py sets InvalidOperation instead of
DivisionImpossible or DivisionUndefined.
Mark, could I persuade you to isolate these cases by running a modified
deccheck2.py from mpdecimal (See attachment), which does not
New submission from Stefan Krah stefan-use...@bytereef.org:
decimal.py sets InvalidOperation if the payload of a NaN is too large:
c = getcontext()
c.prec = 4
c.create_decimal(NaN12345)
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/lib/python2.7/decimal.py,
Changes by Stefan Krah stefan-use...@bytereef.org:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7047
___
___
New submission from Stefan Krah stefan-use...@bytereef.org:
from decimal import *
c = getcontext()
c.prec = 2
c.logb(Decimal(1E123456))
Decimal('123456')
This result agrees with the result of decNumber, but the spec says:
All results are exact unless an integer result does not fit in the
New submission from Stefan Krah stefan-use...@bytereef.org:
If precision 1 is aupported, the following results should not be NaN:
Python 2.7a0 (trunk:74738, Sep 10 2009, 11:50:08)
[GCC 4.3.2] on linux2
Type help, copyright, credits or license for more information.
from decimal import *
Changes by Stefan Krah stefan-use...@bytereef.org:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7049
___
___
Mark Fitzgerald mark.fitzgera...@sympatico.ca added the comment:
Agreed that this is clearly not a bug. One way to get the desired
behavior from IDLE is to move up to Python 2.7a0+ or Python 3.1.1+,
where the 'exit' parameter of unittest.main(), which when set to False,
disables the sys.exit()
New submission from Mark Fitzgerald mark.fitzgera...@sympatico.ca:
Start up IDLE. Type (x,y) += (1,2) (without the double-quotes), then
press Enter. IDLE unexpectedly terminates without message, pop-up, or
warning. Admittedly, this line of code is likely not legal, but
shouldn't it just raise
Changes by Mark Fitzgerald mark.fitzgera...@sympatico.ca:
--
title: (x,y) += (1,2) crashes IDLE - Augmented assignment of tuple crashes IDLE
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7050
Mark Dickinson dicki...@gmail.com added the comment:
Just to be clear, the decimal context doesn't (and shouldn't) know about
DivisionImpossible: there's
no DivisionImpossible signal or trap described in the specification, but just a
DivisionImpossible
heading in the 'exceptional
Mark Dickinson dicki...@gmail.com added the comment:
This is essentially the same issue as issue 7046: the relevant lines in
decimal.py read:
if d._isnan() and len(d._int) self.prec - self._clamp:
return self._raise_error(ConversionSyntax,
Mark Dickinson dicki...@gmail.com added the comment:
Closed issue 7047 as a duplicate of this one:
_raise_error(ConversionSyntax) also raises (if trapped) the
InvalidOperation exception, when it could reasonably raise
ConversionSyntax instead. It's the same cause as above: _raise_error
Changes by Mark Dickinson dicki...@gmail.com:
--
assignee: - mark.dickinson
priority: - normal
stage: - needs patch
type: - behavior
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2
___
Python tracker rep...@bugs.python.org
Mark Dickinson dicki...@gmail.com added the comment:
This behaviour was deliberate: since the standard doesn't cover three-
argument pow, I more-or-less made up my own rules here. :)
In this case, I (somewhat arbitrarily) decided that to ensure that any
possible pow(a, b, m) result could be
Mark Dickinson dicki...@gmail.com added the comment:
Hmm. The problem here is that the specification says nothing at all
about what should happen if the integer result does *not* fit in the
available precision, so in this case we went with the decNumber
behaviour.
Rather than rounding, I'd
Naoki INADA songofaca...@gmail.com added the comment:
add sample implementation.
--
keywords: +patch
Added file: http://bugs.python.org/file15030/compile_with_encoding.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5911
Mark Dickinson dicki...@gmail.com added the comment:
Unless anyone else disagrees, I'm going to call this a 'won't fix': I'm
happy with the current behaviour. I would like to relax the condition on
the modulus from 'modulus 10**prec' to 'modulus = 10**prec', though, so
I'm leaving the
1 - 100 of 119 matches
Mail list logo