Error in python.org homepage.

2007-05-01 Thread alessiogiovanni . baroni
Hi to all!!!

I sended an email to webmaster at python dot org, but was blocked...
why?

In the homepage of python.org there is an error: the link that point
to source distribution is not
updated to Python 2.5.1.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: keyword checker - keyword.kwlist

2007-05-10 Thread alessiogiovanni . baroni
On 10 Mag, 15:38, [EMAIL PROTECTED] wrote:
> Hi
>
> I try to check whether a given input is keyword or not. However this
> script won't identify keyword input as a keyword. How should I modify it
> to make it work?
>
> #!usr/bin/env python
> import keyword
>
> input = raw_input('Enter identifier to check >> ')
> if input in keyword.kwlist:
>  print input + "is keyword"
>
> else:
>  print input + "is not keyword"

Hmm... I tried, and identify it.
Try to change the 'input' variable name with other...

-- 
http://mail.python.org/mailman/listinfo/python-list


Interpreter & Thread state & Frame structures.

2009-01-07 Thread alessiogiovanni . baroni
Hi to all,
there are some fields in the PyInterpreterState and PyThreadState
obscures.
PyInterpreterState:
  1) Why there are the fields *next and *tstate_head?

PyThreadState:
  1) Why there is the field *next?

An object PyFrameObject is a portion of code, with a state. But
exactly? Contents of a method/function, or more simply any block
indented of code? For example, this code:
def foo(s):
if s > 0:
return True
else:
return False

how much frames are?

Thank you!
--
http://mail.python.org/mailman/listinfo/python-list


Python unit tests.

2009-04-15 Thread alessiogiovanni . baroni
Hi to all,
how do I read the info at http://coverage.livinglogic.de ? For
example, in http://coverage.livinglogic.de/Objects/funcobject.c.html,
the count field, what it means?

Thanks.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python unit tests.

2009-04-16 Thread alessiogiovanni . baroni
On 15 Apr, 16:18, s...@pobox.com wrote:
>     > how do I read the info athttp://coverage.livinglogic.de? For
>     > example, inhttp://coverage.livinglogic.de/Objects/funcobject.c.html,
>     > the count field, what it means?
>
> Most likely it's the number of times that line was executed.  Strong support
> for that comes from the fact that the lines with a count of 0 are
> highlighted, implying they weren't executed at all.
>
> --
> Skip Montanaro - s...@pobox.com -http://www.smontanaro.net/
>         "XML sucks, dictionaries rock" - Dave Beazley

Yes, I thinked to number of times. However, I ask the question because
here
( http://www.python.org/dev/contributing/ ) says to consider
http://coverage.livinglogic.de/
to contributing unit tests, and I asked how to interpret it.

Thanks.
--
http://mail.python.org/mailman/listinfo/python-list


PEP 401

2009-04-20 Thread alessiogiovanni . baroni
Are 19 days that I read this PEP; it's all true?
--
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 401

2009-04-20 Thread alessiogiovanni . baroni
On 20 Apr, 10:22, Steven D'Aprano
 wrote:
> On Sun, 19 Apr 2009 11:02:35 -0700, alessiogiovanni.baroni wrote:
> > Are 19 days that I read this PEP; it's all true?
>
> For the benefit of people who are not aware of the tradition of "April
> Fools":
>
> http://en.wikipedia.org/wiki/April_fool
>
> Look at the date of the PEP and the status.
>
> --
> Steven

Yes, yes, I know it; in Italy its name is "pesce d'aprile" ("April's
fish")
(we aren't so out of the world ); I haven't read simply the
status .

Hi to all!
--
http://mail.python.org/mailman/listinfo/python-list


Re: when can i expect libraries and third party tools to be updated for python 3 ?

2009-04-20 Thread alessiogiovanni . baroni
On 20 Apr, 15:47, Deep_Feelings  wrote:
> every one is telling "dont go with python 3 , 3rd party tools and
> libraries have no compitability with python 3"
>
> so from previous experience : when can i expect libraries and third
> party tools to be updated for python 3 ? (especially libraries )

When the authors of a every library wants update to 3 :-D.
--
http://mail.python.org/mailman/listinfo/python-list


Re: out of memory with processing module

2009-04-20 Thread alessiogiovanni . baroni
On 20 Apr, 17:03, Brian  wrote:
> I'm using the third-party "processing" module in Python 2.5, which may
> have become the "multiprocessing" module in Python 2.6, to speed up
> the execution of a computation that takes over a week to run. The
> relevant code may not be relevant, but it is:
>
>             q1, q2 = processing.Queue(), processing.Queue()
>             p1 = processing.Process(target=_findMaxMatch, args=
> (reciprocal, user, clusters[1:(numClusters - 1)/2], questions,
> copy.copy(maxMatch), q1))
>             p2 = processing.Process(target=_findMaxMatch, args=
> (reciprocal, user, clusters[(numClusters - 1)/2:], questions, copy.copy
> (maxMatch), q2))
>             p1.start()
>             p2.start()
>             maxMatch1 = q1.get()[0]
>             maxMatch2 = q2.get()[0]
>             p1.join()
>             p2.join()
>             if maxMatch1[1] > maxMatch2[1]:
>                 maxMatch = maxMatch1
>             else:
>                 maxMatch = maxMatch2
>
> This code just splits up the calculation of the cluster that best
> matches 'user' into two for loops, each in its own process, rather
> than one. (It's not important what the cluster is.)
>
> The error I get is:
>
> [21661.903889] Out of memory: kill process 14888 (python) score 610654
> or a child
> [21661.903930] Killed process 14888 (python)
> Traceback (most recent call last):
> ...etc. etc. ...
>
> Running this process from tty1, rather than GNOME, on my Ubuntu Hardy
> system allowed the execution to get a little further than under GNOME.
>
> The error was surprising because with just 1 GB of memory and a single
> for loop I didn't run into the error, but with 5 GB and two processes,
> I do. I believe that in the 1 GB case there was just a lot of
> painfully slow swapping going on that allowed it to continue.
> 'processing' appears to throw its hands up immediately, instead.
>
> Why does the program fail with 'processing' but not without it? Do you
> have any ideas for resolving the problem? Thanks for your help.

If your program crashes with more of one process, maybe you handle the
Queue objects
not properly? If you can, post the code of _findMaxMatch.
--
http://mail.python.org/mailman/listinfo/python-list


Python and GMP.

2009-04-20 Thread alessiogiovanni . baroni
There are reasons why Python not used the GMP library for implementing
its long type?
--
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 401

2009-04-21 Thread alessiogiovanni . baroni
On 19 Apr, 21:28, Stefan Behnel  wrote:
> alessiogiovanni.bar...@gmail.com wrote:
> > Are 19 days that I read this PEP; it's all true?
>
> Yep. Actually, the Cython project was lucky that the FLUFL did not
> recognise it as an "alternative implementation of Python". That way, we can
> easily finish up world domination, say, 10-20 years before Python on Parrot
> reaches 2.7 feature completeness.
>
> Stefan

mm .. I noticed some inconsistencies in PEP, and I suspected
of a joke,
but ... only now I realize the Status :-( ... Excuse me  At least
the heart
will not blow up to someone else . :-D
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and GMP.

2009-04-21 Thread alessiogiovanni . baroni
On 21 Apr, 09:11, Paul Rubin  wrote:
> casevh  writes:
> > Python 3.1 is significantly faster than Python 2.x on 64-bit
> > platforms. The following times are for multiplication with 2, 30 and
> > 300 decimal digits.
>
> Could you test pow(a,b,c) where a,b,c are each 300 decimal digits?
> This is an important operation in cryptography, that GMP is carefully
> optimized for.  Thanks.

Ok, thanks for your answers. I understand the problems of licensing,
but
we could to learn from GMP's source code to improve the Python's int
implementation,
mainly because, GMP is very fast. We could violate the GPL?
--
http://mail.python.org/mailman/listinfo/python-list


Re: out of memory with processing module

2009-04-21 Thread alessiogiovanni . baroni
On 20 Apr, 18:32, Brian  wrote:
> On Apr 20, 9:18 am, alessiogiovanni.bar...@gmail.com wrote:
>
>
>
> > On 20 Apr, 17:03, Brian  wrote:
>
> > > I'm using the third-party "processing" module in Python 2.5, which may
> > > have become the "multiprocessing" module in Python 2.6, to speed up
> > > the execution of a computation that takes over a week to run. The
> > > relevant code may not be relevant, but it is:
>
> > >             q1, q2 = processing.Queue(), processing.Queue()
> > >             p1 = processing.Process(target=_findMaxMatch, args=
> > > (reciprocal, user, clusters[1:(numClusters - 1)/2], questions,
> > > copy.copy(maxMatch), q1))
> > >             p2 = processing.Process(target=_findMaxMatch, args=
> > > (reciprocal, user, clusters[(numClusters - 1)/2:], questions, copy.copy
> > > (maxMatch), q2))
> > >             p1.start()
> > >             p2.start()
> > >             maxMatch1 = q1.get()[0]
> > >             maxMatch2 = q2.get()[0]
> > >             p1.join()
> > >             p2.join()
> > >             if maxMatch1[1] > maxMatch2[1]:
> > >                 maxMatch = maxMatch1
> > >             else:
> > >                 maxMatch = maxMatch2
>
> > > This code just splits up the calculation of the cluster that best
> > > matches 'user' into two for loops, each in its own process, rather
> > > than one. (It's not important what the cluster is.)
>
> > > The error I get is:
>
> > > [21661.903889] Out of memory: kill process 14888 (python) score 610654
> > > or a child
> > > [21661.903930] Killed process 14888 (python)
> > > Traceback (most recent call last):
> > > ...etc. etc. ...
>
> > > Running this process from tty1, rather than GNOME, on my Ubuntu Hardy
> > > system allowed the execution to get a little further than under GNOME.
>
> > > The error was surprising because with just 1 GB of memory and a single
> > > for loop I didn't run into the error, but with 5 GB and two processes,
> > > I do. I believe that in the 1 GB case there was just a lot of
> > > painfully slow swapping going on that allowed it to continue.
> > > 'processing' appears to throw its hands up immediately, instead.
>
> > > Why does the program fail with 'processing' but not without it? Do you
> > > have any ideas for resolving the problem? Thanks for your help.
>
> > If your program crashes with more of one process, maybe you handle the
> > Queue objects
> > not properly? If you can, post the code of _findMaxMatch.
>
> Thanks for your interest. Here's _findMaxMatch:
>
> def _findMaxMatch(reciprocal, user, clusters, sources, maxMatch,
> queue):
>     for clusternumminusone, cluster in enumerate(clusters):
>         clusterFirstData, clusterSecondData = cluster.getData(sources)
>         aMatch = gum.calculateMatchGivenData(user.data, None, None,
> None, user2data=clusterSecondData)[2]
>         if reciprocal:
>             maxMatchB = gum.calculateMatchGivenData(clusterFirstData,
> None, None, None, user2data=user.secondUserData)[2]
>             aMatch = float(aMatch + maxMatchB) / 2
>         if aMatch > maxMatch[1]:
>             maxMatch = [clusternumminusone + 1, aMatch]
>     queue.put([maxMatch])

You can post the entire error message + full traceback?
--
http://mail.python.org/mailman/listinfo/python-list