I've added in some code that Chris Stawarz contributed to allow the
use of non-blocking sockets, with the program thread allowed to do
other things during the handshake while waiting for the peer to
If this is OK with everyone, I'd like to now port this back to 2.6
I just noticed that the 'tags' Makefile target does not work with
ctags 5.7 since the -t option no longer exists.
So question 1 is whether anyone is using the 'tags' target.
If the answer is no, then if you have your own way of generating the
tags, let me know and I will update the target. Otherwise I might
just rip it out.
Long, long ago, I had mentioned dedicating a laptop of mine to the
python project as a buildbot. Well, I finally made it around to
cleaning off my box and putting it all together. I prepared my laptop
with everything (I think...) needed to become a buildbot. The system
specifications are as follows:
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600
Processor: x86 Family 15 Model 2 Stepping 4 GenuineIntel ~1195Mhz
Total Physical Memory: 1,023MB
I have the trunk built with VS2005 and I am doing a clean run of rt.bat
right now to verify everything is reasonably good.
I would like to seek insight from the team as to what steps I could take
next to verify my box is ready to go and make it be used.
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
There were two tracker issues that I want to solve that implies to
touch some PEP text.
So, I checked out the PEP branch...
...and made a "make".
A lot of files started to fail because of not ASCII characters (the
standard Syntax Error of PEP-0263, I'm using Py2.5), like...
# Author: David Goodger
# Contact: goodger(a)users.sourceforge.net
# Revision: $Revision: 4152 $
# Date: $Date: 2005-12-07 20:46:30 -0300 (mié, 07 dic 2005) $
# Copyright: This module has been placed in the public domain.
...(see the date) in the "./docutils/utils.py" program.
A *lot* of files failed this way. I started to fix them (-*- coding
-*- line at the start), but then I thought that maybe *I* was doing
something wrong, because it's strange that nobody noticed this
So, shall I continue fixing these? Or what I'm doing wrong here?
Thank you very much!
I'm having trouble to connect to the anonymous svn server at
$ LC_ALL=C svn up
svn: PROPFIND request failed on '/projects/python/branches/py3k'
svn: PROPFIND of '/projects/python/branches/py3k': could not connect to
$ nmap -v -p80 svn.python.org
Starting Nmap 4.20 ( http://insecure.org ) at 2007-10-08 13:37 CEST
Initiating Parallel DNS resolution of 1 host. at 13:37
Completed Parallel DNS resolution of 1 host. at 13:37, 0.00s elapsed
Initiating Connect() Scan at 13:37
Scanning svn.python.org (184.108.40.206) [1 port]
Completed Connect() Scan at 13:37, 0.06s elapsed (1 total ports)
Host svn.python.org (220.127.116.11) appears to be up ... good.
Interesting ports on svn.python.org (18.104.22.168):
PORT STATE SERVICE
80/tcp closed http
Nmap finished: 1 IP address (1 host up) scanned in 0.401 seconds
The apache server seems to be down.
Shane Hathaway wrote:
> I was aware of Guido's earlier rejections, but I figured the rejection
> was due to the risky implicit optimization proposed by others. Perhaps
> the objection is deeper than that; I suspect Guido specifically objects
> to excessive use of recursion.
As I recall, one of the objections is that it makes
debugging difficult by removing intermediate stack
frames from the traceback.
However, I don't think that the sort of programming
style that requires tail call optimisation is really
part of the Python programming culture. It's used
in languages like Lisp and Haskell because the data
structures used to represent lists in those languages
are themselves recursive.
However, Python doesn't do things that way -- normally
it represents a list as a flat data structure, which
is more naturally iterated over than recursed over.
In my experience, the only time recursion is really
called for in Python is when you're operating on
tree-shaped data structures, in which case tail calls
don't really come into it.
When operating on something linear, I find that
a for-loop or list comprehension usually gets the
job done more clearly and concisely.
A while back I wrote about a problem I was having with
the ordering of -framework options in distutils compilation
commands. Well, now I've discovered something even stranger.
When distutils executes the following link command, I get
a bunch of undefined OpenGL-related symbols. But if I
copy and paste *exactly the same command* into the shell,
What could possibly be going on here?
gcc -Wl,-F. -bundle -framework Python
build/temp.darwin-8.4.0-Power_Macintosh-2.3/chunk.o -L/usr/lib -L/usr/local/lib
-L/usr/X11R6/lib -lm -lGLEW -lfreetype -lcal3d -lstdc++ -lode -o
build/lib.darwin-8.4.0-Power_Macintosh-2.3/soya/_soya.so -framework OpenGL
-framework SDL -framework OpenAL
This is on MacOSX 10.4 with Python 2.3.
I've now got a large complex long-lived threaded server asyncore-based
(Medusa) multi-client server program running on OS X with Python 2.3.5
and the "older-Python" SSL module. I had to make a number of changes
to the code; primarily fixing the way that certain "socket" methods
are called on the SSLSocket, and in the C code, allowing for changes
to the socket blocking attribute that are made out-of-band from use of
the SSL context.
I'll fold that back into the trunk next week, and produce a patch for
the 3K branch after that.
Meanwhile, I've updated the PyPI package to SSL 1.7.
Paul, this also fixes (I hope :-) the setup.py bug you mentioned in
Chris, you might want to try this one with Twisted; I believe it will
One thing to watch out for: ssl.SSLError can't inherit from
socket.error, as it does in 2.6+, so if you are catching exceptions,
you need to trap them like:
except ssl.SSLError, x:
except socket.error, x:
which idiom will continue to work for 2.6 and later.