I've been working on C decimal project during gSoC 2006. After year
of idling (I had extremely busy first year on University, but well, most
of us are extremely busy) I decided, that I will handle further
developing (there is still much development needed, and updating to most
recent standard is just the beginning). I understand, that chances of
merging C Decimal with main tree are much lower than year ago, so I
would like to know if there is still interest in C version of Decimal.
If so - should I write PEP, or just code and 'we'll see later'?
I've made a little benchmark - given loan amount, assets and months that
it's meant to be payed off, find minimal monthly loan cost (It's just
first idea that came to me for use Decimal in financial 'application'
:>) [This solution has complexity O(log(amount) * months) which is far
from optimal, but it's meant to benchmark Decimal, not python itself].
from _decimal import *
gc = getcontext();
def check(loan, percent, monthly):
ret = 0
mult = 1 + (percent / 1200)
if (loan - monthly) * mult >= loan:
return -1 #you cannot payoff loan ;(
while loan > 0:
loan = loan - monthly
loan = loan * mult
ret += 1
def minimize_monthly(loan, percent, months):
lower = Decimal(0)
upper = Decimal(loan)
while(upper > lower + Decimal("1e-3")):
mid = (upper + lower)/2
ret = check(loan, percent, mid)
if(ret > months or ret == -1):
lower = mid
upper = mid
gc.prec = int(sys.argv)
gc.rounding = ROUND_UP
print minimize_monthly(Decimal(sys.argv), Decimal(sys.argv),
and timings (1mln loan, for 15 years, 2% year assets, and precision = 10
../../pyth/python/python loan.py 1000000 2 180 10
../../pyth/python/python loan2.py 1000000 2 180 10
Please don't misunderstand me - I don't want to show python Decimal is
slow, I want to show that C Decimal is worth effort. I am also aware of
simplicity of this benchmark. (This python have been of course compiled
On 18/10/2007, Bill Janssen <janssen(a)parc.com> wrote:
> > > you can
> > > import the socket module and just get socket.error directly off of the
> > > module itself.
> > This is feasible.
> In fact, so feasible I've done it. :-).
On a mostly unrelated note, I just checked a Python 2.4 build on
Windows. The asyncore error I was seeing previously hasn't gone away,
but it has changed. Rather than an exception (followed by the test
hanging) I now get the test hanging in what seems to be the same
place, but no exception :-(
I'm not sure if that's an improvement...
Python 2.3 and 2.5 still pass all tests fine.
On 10/18/07, Bill Janssen <janssen(a)parc.com> wrote:
> > > One thing to watch out for: ssl.SSLError can't
> > > inherit from socket.error, as it does in 2.6+,
> > Why not?
> Mainly because I don't see how to get my hands on the C version of
> socket.error. Patches gratefully accepted, though.
For anyone who wants to write the patch, you can obviously either
expose the variable the exception is stored in globally, or you can
import the socket module and just get socket.error directly off of the
Guido van Rossum suggested I forward this email to you. I contacted him earlier this week regarding the inquiry below. Please read.
> Our company produces hardware for both wired and wireless
> device networking. We recently launched a wireless gateway that supports
> Python for programmability. Our customers use this gateway as part of an
> end-to-end wireless sensor network and Python to add application-specific
> data intelligence. We are looking to assemble a group of third party Python
> developers or Python shops that we can refer customers to who need support
> in developing scripts to support their intended application.
> Do you have any organizations/individuals you might recommend who could
> partner with us in such a capacity or another resource I might pursue to
> find such partners? We are a global company and ideally would like partners
> who can support global opportunities or partners in North America, Europe
> and Asia who specialize in those regions.
> Feel free to contact me directly if you would like further information or
> Thanks much,
> Chris Collis
> Digi Int'l
> Product Marketing
> 952 912 3150
I had been working on getting my box ready to function as one of these:
However, I will help out in whatever way possible. If the team feels it
could be better utilized doing this, let's do it.
VS2005 only fits in because I happen to own a single license :-) It
seems like most people in the community do not have ready-access to one,
so I figured this could be a benefit.
Let me know,
Mr. Joseph Armbruster
> Dear Ms. Armbruster,
> Steve Holden thought I should contact you. We are working on
> developing a network of volunteers to build binary Python extensions
> for Windows. In a thread on c.l.py, Lundh told us that we should
> compile against 2.3 on up.
> I have been experimenting with compiling some extensions with open
> source tools only, namely the MingW compiler. I also have Visual
> Studio 2003 to use for comparison. I guess what I'm asking is if you'd
> like to be a part of the network. Right now, it's just me with
> Holden's backing.
> How does Visual Studio 2005 fit in exactly? From my research, Python
> 2.4/2.5 were compiled with VS2003. Is VS2005 being used for 2.6+?
> Anyway, let me know what you think. You can see some of my stuff here:
> Mike Driscoll
Grzegorz Makarewicz wrote:
>Python in high aritmetic - nice, but in standard ? - using computation
>effective representation as in this "demand" should be put as *must*
>have ? in standard python ? - decimal with it's speed is sufficient - if
>U need more speed use more spohisticated data structures - numpy/scipy
>... - I dont like those additions to python standard.
First of all C Decimal isn't meant to be substitute to numpy in any way.
Second of all, I don't think numpy/scipy is an alternative to Decimal -
it is more complicated, and I am not even sure if it supports Decimal
arithmetic (which is crucial for financial application ie.).
[I couldn't find on google whether scipy supports decimal arithmetic, so
I assumed it doesn't because of name '*scientific* tools for python'.
However, if it supports - ignore following text block]
I bet most computation using Decimal are made with precision < 20, in
that case, you might say 'if you need more performance, use built in
double' - it's performance is superior to Decimal, and precision is the
same, but that's not what all is about. So if one needs Decimal
arithmetic (mostly financial applications), and Py Decimal is not enough
- then pretty big problem arises. And that's why C Decimal is for IMHO :).
>if U need more speed use more spohisticated data structures - numpy/scipy
Why use more sophisticated data structure if less sophisticated, but
written in C is enough?
One more thing - C Decimal is being written such way, that moving from
Py Decimal to C Decimal needs very little to no effort. You cannot say
it about moving from Decimal to some other, more sophisticated libraries.
Anyway - thanks for opinion ;>
On 10/16/07, Wolfgang Langner <tds333+pydev(a)gmail.com> wrote:
> On 10/15/07, skip(a)pobox.com <skip(a)pobox.com> wrote:
> > >> I wonder if we should start maintaining a list of Python developers
> > >> for hire somewhere on python.org, beyond the existing Jobs page. Is
> > >> anyone interested in organizing this?
> > Andrew> What about something a little less formal - a mailing list such
> > Andrew> as python-jobs?
> > How about just creating a page on the wiki and letting those people
> > participate who are interested?
That's a good idea.
Post the page and I add my name.