SSL on 3.2.2

2012-02-24 Thread Jason Friedman
Hello, attempting to build from source on Ubuntu 11.10. Before running ./configure I had set this in Modules/Setup.dist: SSL=/usr/lib/ssl _ssl _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto $ ll /usr/lib/ssl total 4 lrwxrwxrwx 1 root ro

Re: Please verify!!

2012-02-24 Thread Dave Angel
On 02/24/2012 08:25 PM, Chris Angelico wrote: On Sat, Feb 25, 2012 at 11:49 AM, Mark Lawrence wrote: Oo, thou sinner, fancy violating PEP 8 and standardising on tabs. PEP 8 applies only to Python code, our standard is across all our languages :) But yes, I'm a horrible sinner and I like tabs.

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Steven D'Aprano
On Sat, 25 Feb 2012 06:52:09 +0530, Fayaz Yusuf Khan wrote: > On Saturday 25 Feb 2012 12:37:58 AM MRAB wrote: >> We already have arbitrarily long ints, so there could be a special >> infinite int singleton (actually, 2 of them, one positive, the other >> negative). > Seconded. Although would a wis

Re: namespace question

2012-02-24 Thread Steven D'Aprano
On Sat, 25 Feb 2012 00:39:39 +, Mark Lawrence wrote: > On 24/02/2012 22:25, Steven D'Aprano wrote: >> On Fri, 24 Feb 2012 10:08:43 -0800, David wrote: >> >>> Your code updated to show the difference between a variable, a class >>> variable, and an instance variable. >> >> The preferred terms i

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Ian Kelly
On Fri, Feb 24, 2012 at 10:32 AM, Devin Jeanpierre wrote: > On Fri, Feb 24, 2012 at 9:25 AM, Neil Cerutti wrote: >> The only time I've naively pined for such a thing is when >> misapplying C idioms for finding a minimum value. >> >> Python provides an excellent min implementation to use instead.

Re: Please verify!!

2012-02-24 Thread Chris Angelico
On Sat, Feb 25, 2012 at 11:49 AM, Mark Lawrence wrote: > Oo, thou sinner, fancy violating PEP 8 and standardising on tabs. PEP 8 applies only to Python code, our standard is across all our languages :) But yes, I'm a horrible sinner and I like tabs. They separate the display (do you want tabs to

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Fayaz Yusuf Khan
On Saturday 25 Feb 2012 12:37:58 AM MRAB wrote: > We already have arbitrarily long ints, so there could be a special > infinite int singleton (actually, 2 of them, one positive, the other > negative). Seconded. Although would a wish request to bugs.python.org saying "Allow storage of the integer i

Re: Please verify!!

2012-02-24 Thread Mark Lawrence
On 24/02/2012 20:41, Chris Angelico wrote: On Fri, Feb 24, 2012 at 11:20 PM, Steven D'Aprano wrote: Personally, I prefer tabs for theoretical reasons and spaces for practical ones. I think that the world would be better off if we all standardised on tabs instead of spaces, but since that's not

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread MRAB
On 24/02/2012 23:16, Michael Torrie wrote: On 02/24/2012 09:59 AM, Mark Lawrence wrote: The C integer bit doesn't matter since e.g. >>> a=100 >>> a 10

Re: namespace question

2012-02-24 Thread Mark Lawrence
On 24/02/2012 22:25, Steven D'Aprano wrote: On Fri, 24 Feb 2012 10:08:43 -0800, David wrote: Your code updated to show the difference between a variable, a class variable, and an instance variable. The preferred terms in Python circles are class and instance *attributes*, not variables. An i

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Mark Lawrence
On 24/02/2012 23:16, Michael Torrie wrote: On 02/24/2012 09:59 AM, Mark Lawrence wrote: The C integer bit doesn't matter since e.g. >>> a=100 >>> a 100

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Chris Angelico
On Sat, Feb 25, 2012 at 10:16 AM, Michael Torrie wrote: > Sure but that doesn't answer the question posed.  How does Rick plan to > represent an infinite integer? Obviously you've shown that with an > infinite amount of memory we could do it quite easily.  But baring that, > how does Rick suggest

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Michael Torrie
On 02/24/2012 09:59 AM, Mark Lawrence wrote: > The C integer bit doesn't matter since e.g. > >>> > a=100 > >>> a > 1

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Steven D'Aprano
On Fri, 24 Feb 2012 09:23:08 -0700, Michael Torrie wrote: > All this reminds me of the original cray supercomputers. They didn't > use twos compliment for integers so they had two representations of zero > (+0 and -0). Made programming a bit tricky. While there is only one integer zero, I would

Re: How to handle calling functions from cli

2012-02-24 Thread Chris Angelico
On Sat, Feb 25, 2012 at 9:16 AM, Rodrick Brown wrote: > m = { 'a': 'checkDisks()', >          'b': 'checkMemSize()', >          'c': 'checkBondInterfaces()' >    } > >    runlist = [ c for c in m.keys() if c not in r.d ] >    for runable in runlist: >        eval(m[runable]) It's a reasonable tec

Re: How to handle calling functions from cli

2012-02-24 Thread Chris Rebert
On Fri, Feb 24, 2012 at 2:16 PM, Rodrick Brown wrote: > I have a bunch of sub routines that run independently to perform various > system checks on my servers. I wanted to get an opinion on the following code > I have about 25 independent checks and I'm adding the ability to disable > certain c

Re: namespace question

2012-02-24 Thread Steven D'Aprano
On Fri, 24 Feb 2012 10:08:43 -0800, David wrote: > Your code updated to show the difference between a variable, a class > variable, and an instance variable. The preferred terms in Python circles are class and instance *attributes*, not variables. An integer variable is a variable holding an in

How to handle calling functions from cli

2012-02-24 Thread Rodrick Brown
I have a bunch of sub routines that run independently to perform various system checks on my servers. I wanted to get an opinion on the following code I have about 25 independent checks and I'm adding the ability to disable certain checks that don't apply to certain hosts. m = { 'a': 'checkDis

Re: sum() requires number, not simply __add__

2012-02-24 Thread Terry Reedy
On 2/24/2012 8:23 AM, Roy Smith wrote: In article, Antoon Pardon wrote: Python doesn't try to prevent people from shooting themselves in the foot. Yes it does! A simple example is None as a keyword to prevent assignments to it. Hmmm. Just playing around with some bizarre things to do wi

Re: Does turtledemo in Python 3.2 actually work?

2012-02-24 Thread Terry Reedy
On 2/24/2012 7:25 AM, Steven D'Aprano wrote: Python 3.2 includes turtledemo, a demonstration program for the turtle module. When I run it, I can load the turtle scripts, and the GUI application says "Press the start button", but there is no start button. Can anyone else confirm this as a bug?

Parameter guidelines for the Strong AI Singularity

2012-02-24 Thread Mentifex
=== Purpose === A parameter in the AI Mind software serves to guide or limit the operation of a mind-module. If a module is conducting a search of AI memory, one parameter may govern how much of memory will be searched, while other parameters may dictate exactly what is to be looked for. Since it

Re: Please verify!!

2012-02-24 Thread Chris Angelico
On Fri, Feb 24, 2012 at 11:20 PM, Steven D'Aprano wrote: > Personally, I prefer tabs for theoretical reasons and spaces for > practical ones. I think that the world would be better off if we all > standardised on tabs instead of spaces, but since that's not going to > happen, I can interoperate be

Re: namespace question

2012-02-24 Thread David
Your code updated to show the difference between a variable, a class variable, and an instance variable. c = [1, 2, 3, 4, 5] class TEST(): c = [5, 2, 3, 4, 5] ## class variable (TEST.c) def __init__(self): self.c = [1, 2, 3, 4, 5] ## instance variable (a.c) def add(self, c

Re: Python LOC, .exe size, and refactoring

2012-02-24 Thread CM
On Feb 22, 12:29 am, Steven D'Aprano wrote: > On Tue, 21 Feb 2012 19:51:07 -0800, CM wrote: > > I have an application that I was hoping to reduce a bit the size of its > > .exe when "packaged" with py2exe.  I'm removing some Python modules such > > as Tkinter, etc., but now wonder how much I could

Re: multiprocessing, what am I doing wrong?

2012-02-24 Thread MRAB
On 24/02/2012 17:00, Eric Frederich wrote: I can sill get it to freeze and nothing is printed out from the other except block. Does it look like I'm doing anything wrong here? [snip] I don't normally use multiprocessing, so I forgot about a critical detail. :-( When the multiprocessing module

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Devin Jeanpierre
On Fri, Feb 24, 2012 at 9:25 AM, Neil Cerutti wrote: > The only time I've naively pined for such a thing is when > misapplying C idioms for finding a minimum value. > > Python provides an excellent min implementation to use instead. min can be a little inconvenient. As soon as anything complicate

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-24 Thread John Roth
On Feb 23, 2:11 pm, Terry Reedy wrote: > On 2/23/2012 2:34 PM, HoneyMonster wrote: > > > > > > > > > > > On Thu, 23 Feb 2012 14:24:23 -0500, Jerry Hill wrote: > > >> On Thu, Feb 23, 2012 at 2:11 PM, HoneyMonster > >>  wrote: > >>> $ cd /usr/bin $ ls -l python* > >>> -rwxr-xr-x 2 root root 9496 Oc

Re: multiprocessing, what am I doing wrong?

2012-02-24 Thread Eric Frederich
I can sill get it to freeze and nothing is printed out from the other except block. Does it look like I'm doing anything wrong here? On Thu, Feb 23, 2012 at 3:42 PM, MRAB wrote: > On 23/02/2012 17:59, Eric Frederich wrote: > >> Below is some pretty simple code and the resulting output. >> Someti

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Mark Lawrence
On 24/02/2012 16:23, Michael Torrie wrote: On 02/24/2012 08:34 AM, Rick Johnson wrote: Yes i could write my own implementation of INFINITY if i wanted, although i would have returned True and False as apposed to 1 and 0 AND used the identifiers Infinity and Infinitesimal, but i digress :- P. Ho

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Michael Torrie
On 02/24/2012 08:34 AM, Rick Johnson wrote: > Yes i could write my own implementation of INFINITY if i wanted, > although i would have returned True and False as apposed to 1 and 0 > AND used the identifiers Infinity and Infinitesimal, but i digress :- > P. > > However, INFINITY is something i bel

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Rick Johnson
On Feb 24, 7:55 am, Mark Lawrence wrote: > Do you want to test for something that is larger than infinity? Not exactly. I want to set a constant that has a value of infinity and then do comparisons against the constant. ## # Hypothetical 1 # ## def confine(string

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Rick Johnson
On Feb 24, 9:21 am, Mel Wilson wrote: > Easily fixed: > > [...snip code...] Yes i could write my own implementation of INFINITY if i wanted, although i would have returned True and False as apposed to 1 and 0 AND used the identifiers Infinity and Infinitesimal, but i digress :- P. However, INFI

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Steven D'Aprano
On Fri, 24 Feb 2012 10:21:45 -0500, Mel Wilson wrote: > Rick Johnson wrote: > >> I get sick and tired of doing this!!! >> >> if maxlength == UNLIMITED: >> allow_passage() >> elif len(string) > maxlength: >> deny_passage() >> >> What Python needs is some constant that can be compared to

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Rick Johnson
On Feb 24, 8:25 am, Neil Cerutti wrote: > > What Python needs is some constant that can be compared to ANY > > numeric type and that constant will ALWAYS be larger! > > What's the point of that? > > The only time I've naively pined for such a thing is when > misapplying C idioms for finding a min

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Mel Wilson
Rick Johnson wrote: > I get sick and tired of doing this!!! > > if maxlength == UNLIMITED: > allow_passage() > elif len(string) > maxlength: > deny_passage() > > What Python needs is some constant that can be compared to ANY numeric > type and that constant will ALWAYS be larger! Easily

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Rick Johnson
On Feb 24, 8:39 am, Miki Tebeka wrote: > float('infinity') should be good enough. Yes, that is the answer however the implementation is inconsistent. py> float("inf") inf py> float("infinity") inf py> int("inf") Traceback (most recent call last): File "", line 1, in int("inf") ValueError:

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-24 Thread Peter Otten
Steven D'Aprano wrote: >> The code in the else suite executes only when the for loop is left via >> break. A non-empty iterable is required but not sufficient. > > You have a typo there. As your examples show, the code in the else suite > executes only when the for loop is NOT left via break (or

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-24 Thread Arnaud Delobelle
On 24 February 2012 14:54, Steven D'Aprano wrote: > for...else is a very useful construct, but the name is misleading. It > took me a long time to stop thinking that the else clause executes when > the for loop was empty. This is why I think we should call this construct "for / break / else" rat

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-24 Thread Steven D'Aprano
On Fri, 24 Feb 2012 13:44:15 +0100, Peter Otten wrote: for i in []: > ... pass > ... else: > ... print "else" > ... > else for i in [42]: > ... pass > ... else: > ... print "else" > ... > else for i in [42]: > ... break > ... else: > ... print "else" > ... >>

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Miki Tebeka
float('infinity') should be good enough. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Neil Cerutti
On 2012-02-24, Rick Johnson wrote: > I get sick and tired of doing this!!! > > if maxlength == UNLIMITED: > allow_passage() > elif len(string) > maxlength: > deny_passage() > > What Python needs is some constant that can be compared to ANY > numeric type and that constant will ALWAYS be la

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Mark Lawrence
On 24/02/2012 13:37, Rick Johnson wrote: I get sick and tired of doing this!!! if maxlength == UNLIMITED: allow_passage() elif len(string)> maxlength: deny_passage() What Python needs is some constant that can be compared to ANY numeric type and that constant will ALWAYS be larger!

Re: sum() requires number, not simply __add__

2012-02-24 Thread Roy Smith
In article , Antoon Pardon wrote: > > Python doesn't try to prevent people from shooting themselves in the foot. > > > Yes it does! A simple example is None as a keyword to prevent > assignments to it. Hmmm. Just playing around with some bizarre things to do with None, and discovered thi

Re: Please verify!!

2012-02-24 Thread Andrew Berg
On 2/24/2012 6:20 AM, Steven D'Aprano wrote: > Opinions need to be informed to be better than useless. By definition > newbies don't have the experience to have informed opinions. I thought I had implied that I meant informed opinions, but apparently not. > There are many times that we can't affo

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-24 Thread Roy Smith
In article , Thomas Rachel wrote: > Not only that, [hard and symbolic links] have slightly different > semantics. This is true, but only for very large values of "slightly". Symlinks, for example, can cross file system boundaries (including NFS mount points). Symlinks can refer to locat

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-24 Thread Peter Otten
Peter Otten wrote: > The code in the else suite executes only when the for loop is left via > break. Oops, the following statement is nonsense: > A non-empty iterable is required but not sufficient. Let me try again: A non-empty iterable is required but not sufficient to *skip* the else-suite

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-24 Thread Peter Otten
Rick Johnson wrote: > On Feb 23, 6:30 pm, Alex Willmer wrote: >> [...] >> as a standard looping-with-index construct. In Python for loops don't >> create a scope, so the loop variables are available afterward. I've >> sometimes used this to print or return a record count e.g. >> >> for i, x in en

Re: Does turtledemo in Python 3.2 actually work?

2012-02-24 Thread Arnaud Delobelle
On 24 February 2012 12:25, Steven D'Aprano wrote: > Python 3.2 includes turtledemo, a demonstration program for the turtle > module. > > When I run it, I can load the turtle scripts, and the GUI application > says "Press the start button", but there is no start button. > > Can anyone else confirm

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-24 Thread Rick Johnson
On Feb 23, 6:30 pm, Alex Willmer wrote: > [...] > as a standard looping-with-index construct. In Python for loops don't > create a scope, so the loop variables are available afterward. I've > sometimes used this to print or return a record count e.g. > > for i, x in enumerate(seq): >    # do stuff

Does turtledemo in Python 3.2 actually work?

2012-02-24 Thread Steven D'Aprano
Python 3.2 includes turtledemo, a demonstration program for the turtle module. When I run it, I can load the turtle scripts, and the GUI application says "Press the start button", but there is no start button. Can anyone else confirm this as a bug? http://docs.python.org/py3k/library/turtle.ht

Re: Please verify!!

2012-02-24 Thread Steven D'Aprano
On Fri, 24 Feb 2012 03:18:18 -0600, Andrew Berg wrote: > On 2/24/2012 2:32 AM, Ben Finney wrote: >> Are you referring to novice programmers – who, by any reasonable >> definition of “novice”, don't have an opinion on the tabs-versus-spaces >> indentation debate? >> >> Or are you talking about peo

Re: namespace question

2012-02-24 Thread Jean-Michel Pichavant
xixiliguo wrote: c = [1, 2, 3, 4, 5] class TEST(): c = [5, 2, 3, 4, 5] def add( self ): c[0] = 15 a = TEST() a.add() print( c, a.c, TEST.c ) result : [15, 2, 3, 4, 5] [5, 2, 3, 4, 5] [5, 2, 3, 4, 5] why a.add() do not update c in Class TEST? but update c in main file A

Re: sum() requires number, not simply __add__

2012-02-24 Thread Duncan Booth
Stefan Behnel wrote: > I know that you just meant this as an example, but it's worth > mentioning in this context that it's not exactly efficient to "sum up" > lists this way because there is a lot of copying involved. Each adding > of two lists creates a third one and copies all elements into it

Re: sum() requires number, not simply __add__

2012-02-24 Thread Antoon Pardon
On 02/24/2012 12:33 AM, Steven D'Aprano wrote: If your application stops working after you carelessly mess with components your application relies on, the right answer is usually: "Don't do that then." Python doesn't try to prevent people from shooting themselves in the foot. Yes it does! A

Re: Please verify!!

2012-02-24 Thread Andrew Berg
On 2/24/2012 5:21 AM, Duncan Booth wrote: > The original question was about Notepad++ which is nothing at all like > Notepad. And I did give the OP an answer about Notepad++ specifically in another message. -- CPython 3.2.2 | Windows NT 6.1.7601.17640 -- http://mail.python.org/mailman/listinfo/

Re: Please verify!!

2012-02-24 Thread Duncan Booth
Andrew Berg wrote: > Yes. However, there are many editors for various platforms that handle > the different line endings just fine. In fact, Notepad is the only > editor I can think of off the top of my head that has an issue. The original question was about Notepad++ which is nothing at all lik

Re: Please verify!!

2012-02-24 Thread Jugurtha Hadjar
On 23/02/2012 23:13, Manish Sharma wrote: Hi I am new to python language. On my first day, somebody told me that if any python script file is opened with any editor except python editor, the file is corrupted. Some spacing or indentation is changed and script stops working. I was opening the scri

Re: storing in list and retrieving.

2012-02-24 Thread Smiley 4321
Thanks. It was very simple with using 'pickle'. Thanks. -- On Thu, Feb 23, 2012 at 4:01 PM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Smiley 4321 wrote: > >> It requires concepts of 'python persistence' for the code to be designed . >> >> Else it simple. >> >> Looking for

Re: subtraction of floating point numbers

2012-02-24 Thread Chris Rebert
On Fri, Feb 24, 2012 at 12:41 AM, Jaroslav Dobrek wrote: > Hello, > > when I have Python subtract floating point numbers it yields weird > results. Example: > > 4822.40 - 4785.52 = 36.87992 > > Why doesn't Python simply yield the correct result? It doesn't have a > problem with this: > > 4

Re: Please verify!!

2012-02-24 Thread Andrew Berg
On 2/24/2012 2:32 AM, Ben Finney wrote: > Are you referring to novice programmers – who, by any reasonable > definition of “novice”, don't have an opinion on the tabs-versus-spaces > indentation debate? > > Or are you talking about people who are experienced enough to have an > opinion and expect

Re: asynchronous downloading

2012-02-24 Thread Giampaolo Rodolà
Il 24 febbraio 2012 02:10, Plumo ha scritto: > that example is excellent - best use of asynchat I have seen so far. > > I read through the python-dev archives and found the fundamental problem is > no one maintains asnycore / asynchat. Well, actually I do/did. Point with asyncore/asynchat is tha

Re: subtraction of floating point numbers

2012-02-24 Thread Alain Ketterlin
Jaroslav Dobrek writes: > when I have Python subtract floating point numbers it yields weird > results. Example: > > 4822.40 - 4785.52 = 36.87992 We've had this discussion here one or two days ago... The usual answer is: please read "What Every Computer Scientist Should Know About Float

subtraction of floating point numbers

2012-02-24 Thread Jaroslav Dobrek
Hello, when I have Python subtract floating point numbers it yields weird results. Example: 4822.40 - 4785.52 = 36.87992 Why doesn't Python simply yield the correct result? It doesn't have a problem with this: 482240 - 478552 = 3688 Can I tell Python in some way to do this differently?

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-24 Thread Peter Otten
Ethan Furman wrote: > Steven D'Aprano wrote: >> On Thu, 23 Feb 2012 16:30:09 -0800, Alex Willmer wrote: >> >>> This week I was slightly surprised by a behaviour that I've not >>> considered before. I've long used >>> >>> for i, x in enumerate(seq): >>># do stuff >>> >>> as a standard looping-

Re: Please verify!!

2012-02-24 Thread Ben Finney
Andrew Berg writes: > On 2/23/2012 4:43 PM, Dave Angel wrote: > > First thing I'd do is to disable tab logic in the editor. When you > > press the tab key, there's no excuse for an editor to actually put a tab > > in the file. It should adjust the column by adding the appropriate > > number

Re: sum() requires number, not simply __add__

2012-02-24 Thread Peter Otten
Buck Golemon wrote: > I feel like the design of sum() is inconsistent with other language > features of python. Often python doesn't require a specific type, only > that the type implement certain methods. > > Given a class that implements __add__ why should sum() not be able to > operate on that