new release 0.38 of OpenOpt, FuncDesigner, SpaceFuncs, DerApproximator

2012-03-15 Thread dmitrey
Hi all, I'm glad to inform you about new release 0.38 (2012-March-15): OpenOpt: interalg can handle discrete variables interalg can handle multiobjective problems (MOP) interalg can handle problems with parameters fixedVars/freeVars Many interalg improvements and some bugfixes

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Cameron Simpson
On 15Mar2012 12:22, Ben Finney ben+pyt...@benfinney.id.au wrote: | Roy Smith r...@panix.com writes: | I'll admit I hadn't considered that, but I don't see it as a major | problem. The type intuition could be designed to only work for types | other than NoneType. | | −1, then. It's growing too

Re: Python is readable

2012-03-15 Thread alex23
Rick Johnson rantingrickjohn...@gmail.com wrote: However, when we are talking about the Python programming language readable simply means: neophyte readable. That is, readable to someone with little or no experience with the language. Nonsense. List comprehensions are not immediately obvious

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread xliiv
Like the topic.. . I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. I've no idea if it's even possible on Windows. On Linux, what you want is the prctl function, which (AFAIK) isn't directly

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread xliiv
Like the topic.. . I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. I've no idea if it's even possible on Windows. On Linux, what you want is the prctl function, which (AFAIK) isn't directly

pyserial for GPS data

2012-03-15 Thread Arun p das
I have a USB GPS dongle using this for getting position information. I installed gpsd daemon so that any clients can read data from that. It is working fine used xgps, cgps as clients. *gpsd -n -N -D2 /dev/ttyUSB0 * import gps, os, time g = gps.gps(mode=gps.WATCH_NEWSTYLE) while 1:

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Robert Kern
On 3/15/12 5:59 AM, Cameron Simpson wrote: On 15Mar2012 12:22, Ben Finneyben+pyt...@benfinney.id.au wrote: | Roy Smithr...@panix.com writes: | I'll admit I hadn't considered that, but I don't see it as a major | problem. The type intuition could be designed to only work for types | other

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Cameron Simpson
On 15Mar2012 10:06, Robert Kern robert.k...@gmail.com wrote: | On 3/15/12 5:59 AM, Cameron Simpson wrote: | On 15Mar2012 12:22, Ben Finneyben+pyt...@benfinney.id.au wrote: | | Roy Smithr...@panix.com writes: | | I'll admit I hadn't considered that, but I don't see it as a major | |

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 7:23, alex23 wrote: Rick Johnsonrantingrickjohn...@gmail.com wrote: However, when we are talking about the Python programming language readable simply means: neophyte readable. That is, readable to someone with little or no experience with the language. Nonsense. List

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 9:44 PM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Let's try that. Show me an example of list comprehensions and with (whatever they are). I'll do a list comp, because they lend themselves well to one-liners. what_am_i = '\n'.join([%X\t%c%(i,i) for i in

Re: Python is readable

2012-03-15 Thread Thomas Rachel
Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of list comprehensions and with (whatever they are). with open(filename, w) as f: f.write(stuff) with lock: do_something_exclusively() Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 11:50, Chris Angelico wrote: On Thu, Mar 15, 2012 at 9:44 PM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Let's try that. Show me an example of list comprehensions and with (whatever they are). I'll do a list comp, because they lend themselves well to one-liners.

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 10:27 PM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: On 3/15/2012 11:50, Chris Angelico wrote: I'll do a list comp, because they lend themselves well to one-liners. what_am_i = '\n'.join([%X\t%c%(i,i) for i in range(128)]) A few conjectures: 1) '\n' is an

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of list comprehensions and with (whatever they are). with open(filename, w) as f: f.write(stuff) Here f is created before executing the block and destroyed right after

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 12:47, Chris Angelico wrote: On Thu, Mar 15, 2012 at 10:27 PM, Kiuhnm Your first example suggests that range(n) is a sequence iterator which returns, if queried n times, 0,...,n-1 (which is a bit counterintuitive, IMHO). It's a little odd, perhaps, if seen in a vacuum. But

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: On 3/15/2012 12:47, Chris Angelico wrote: It's a little odd, perhaps, if seen in a vacuum. But everything counts from zero - list indices, etc - so it makes sense for range(len(lst)) to return indices valid

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Steven W. Orr
On 3/14/2012 6:07 AM, Gelonida N wrote: Hi, At the moment I use ConfigParser http://docs.python.org/library/configparser.html for one of my applications. Now I'm looking for a library, which behaves like config parser, but with one minor difference. The write() mehtod should keep existing

Re: Python is readable

2012-03-15 Thread Ben Finney
Chris Angelico ros...@gmail.com writes: Yup. It's amazing how accurate your conjectures are - it's almost like you've been reading the docs! :D But yeah, that's pretty logical IMHO; and having gotten used to [) intervals in many areas of computing, I've come to find [] intervals

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 11:31 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Another good reason to advocate for proper typography. John 14:5-7 indicates a range (because it uses U+2013 EN DASH), whereas 7-5 indicates subtraction (because it uses U+2212 MINUS SIGN). A hyphen ('-' U+002D) is

ANN: python-ldap 2.4.9

2012-03-15 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.4.8 python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related

Re: Python is readable

2012-03-15 Thread Ben Finney
Chris Angelico ros...@gmail.com writes: On Thu, Mar 15, 2012 at 11:31 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Another good reason to advocate for proper typography. John 14:5-7 indicates a range (because it uses U+2013 EN DASH), whereas 7-5 indicates subtraction (because it uses

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Roy Smith
In article mailman.665.1331806024.3037.python-l...@python.org, Robert Kern robert.k...@gmail.com wrote: Yes. Not all type(default) types can be called with a string to produce a valid value. Note that type= is really a misnomer. argparse doesn't really want a type object there; it wants a

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 12:16 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: Chris Angelico ros...@gmail.com writes: On Thu, Mar 15, 2012 at 11:31 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Another good reason to advocate for proper typography. John 14:5-7 indicates a range

Re: Python is readable

2012-03-15 Thread Ben Finney
Chris Angelico ros...@gmail.com writes: On Fri, Mar 16, 2012 at 12:16 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: Hopefully, the fact that your quoting of my text munged the characters down to ASCII is also pure coincidence, and is soon to be corrected at your end? Or has your

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 15/03/2012 11:48, Kiuhnm wrote: On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of list comprehensions and with (whatever they are). with open(filename, w) as f: f.write(stuff) Here f is created before executing the block

Re: Python is readable

2012-03-15 Thread Alec Taylor
On Fri, Mar 16, 2012 at 1:06 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. with open(filename, w) as f  File stdin, line 1    with

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 13:21, Chris Angelico wrote: On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: On 3/15/2012 12:47, Chris Angelico wrote: It's a little odd, perhaps, if seen in a vacuum. But everything counts from zero - list indices, etc - so it makes sense for

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:06, Mark Lawrence wrote: On 15/03/2012 11:48, Kiuhnm wrote: On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of list comprehensions and with (whatever they are). with open(filename, w) as f: f.write(stuff)

Re: Python is readable

2012-03-15 Thread Tim Golden
On 15/03/2012 14:19, Kiuhnm wrote: On 3/15/2012 15:06, Mark Lawrence wrote: On 15/03/2012 11:48, Kiuhnm wrote: BTW, aren't those ':' redundant? Kiuhnm Nope. Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more

Re: Python is readable

2012-03-15 Thread Duncan Booth
Kiuhnm kiuhnm03.4t.yahoo.it wrote: BTW, aren't those ':' redundant? They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make the colons optional and still keep it unambiguous but that would make it harder for other tools (such as text

client ssl verification

2012-03-15 Thread Robin Becker
I'm trying to do client ssl verification with code that looks like the sample below. I am able to reach and read urls that are secure and have no client certificate requirement OK. If I set explicit_check to True then verbose output indicates that the server certs are being checked fine ie I

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Don't worry. Soon you'll be using C++0x :))) I use gcc/g++ with most of the new features enabled. There's some pretty handy features in it. Frankly, though, if I'd known about Cython when I started the current

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:23, Duncan Booth wrote: Kiuhnmkiuhnm03.4t.yahoo.it wrote: BTW, aren't those ':' redundant? They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make the colons optional and still keep it unambiguous but that would make it

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:29, Chris Angelico wrote: On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Don't worry. Soon you'll be using C++0x :))) I use gcc/g++ with most of the new features enabled. There's some pretty handy features in it. Frankly, though, if I'd

Re: Python is readable

2012-03-15 Thread Robert Kern
On 3/15/12 2:30 PM, Kiuhnm wrote: On 3/15/2012 15:23, Duncan Booth wrote: Kiuhnmkiuhnm03.4t.yahoo.it wrote: BTW, aren't those ':' redundant? They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make the colons optional and still keep it

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 1:30 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Sorry, but I can't see how it would make it harder for humans to understand. Are there particular situations you're referring to? In a trivial example, it's mostly just noise: if a == b# who needs the

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:28, Tim Golden wrote: On 15/03/2012 14:19, Kiuhnm wrote: On 3/15/2012 15:06, Mark Lawrence wrote: On 15/03/2012 11:48, Kiuhnm wrote: BTW, aren't those ':' redundant? Kiuhnm Nope. Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type help,

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 1:55 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: By the way, the more elaborate parsing consists of looking for an END_OF_LINE followed by one or more spaces. It doesn't sound that complicated. Only in the trivial case. What if you want to break your

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:48, Chris Angelico wrote: On Fri, Mar 16, 2012 at 1:30 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Sorry, but I can't see how it would make it harder for humans to understand. Are there particular situations you're referring to? In a trivial example, it's mostly

Re: Python is readable

2012-03-15 Thread Robert Kern
On 3/15/12 2:55 PM, Kiuhnm wrote: On 3/15/2012 15:28, Tim Golden wrote: http://docs.python.org/faq/design.html#why-are-colons-required-for-the-if-while-def-class-statements The second one is slightly easier to read because it's syntax-highlighted. Was that on purpose? No, it's an

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 2:05 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: I had thought about the single-line case. What I hadn't thought about is that Python strives to be as regular as possible, so having different cases just for saving one keystroke isn't worth it. Yep. Have you

Re: Python is readable

2012-03-15 Thread Roy Smith
In article mailman.678.1331821755.3037.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: I use gcc/g++ with most of the new features enabled. There's some pretty handy features in it. Frankly, though, if I'd known about Cython when I started the current project, I would have

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:43, Robert Kern wrote: On 3/15/12 2:30 PM, Kiuhnm wrote: On 3/15/2012 15:23, Duncan Booth wrote: Kiuhnmkiuhnm03.4t.yahoo.it wrote: BTW, aren't those ':' redundant? They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 2:14 AM, Roy Smith r...@panix.com wrote: While it's nice to know that we've got the ability to write extensions in C, not once have we ever felt the need.  I suppose if you're running a CPU-bound application, that might not be the case, but surprisingly few applications

Re: Python is readable

2012-03-15 Thread Roy Smith
In article mailman.685.1331825254.3037.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: We're talking about a file that someone's uploaded to us, so it won't matter. Whatever processing we do is massively dwarfed by network time, and both scale linearly with the size of the

Re: Python is readable

2012-03-15 Thread Thomas Rachel
Am 15.03.2012 12:48 schrieb Kiuhnm: On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of list comprehensions and with (whatever they are). with open(filename, w) as f: f.write(stuff) Here f is created before executing the block

Re: Python is readable

2012-03-15 Thread Alec Taylor
On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: On 3/15/2012 13:21, Chris Angelico wrote: On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org  wrote: On 3/15/2012 12:47, Chris Angelico wrote: It's a little odd, perhaps, if seen

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Dave Angel
On 03/15/2012 03:26 AM, xliiv wrote: Like the topic.. . I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. I did google, I've played with Exemaker (it works perfect, but not py3) and i've seen questions on

Pragmas, foreign keys in sqlite3?

2012-03-15 Thread llanitedave
Several questions here, but they're related. I'm trying to incorporate an sqlite3 database that was created using Sqliteman1.2.2. I don't know what version of sqlite3 that one uses, but it seems to have ignored any attempts to create foreign keys for its tables. I'm using Python 2.7.2, and I

Re: Style question (Poll)

2012-03-15 Thread Jon Clements
On Wednesday, 14 March 2012 21:16:05 UTC, Terry Reedy wrote: On 3/14/2012 4:49 PM, Arnaud Delobelle wrote: On 14 March 2012 20:37, Croephacroe...@gmail.com wrote: Which is preferred: for value in list: if not value is another_value: value.do_something() break Do you

Questions about the use of descriptors.

2012-03-15 Thread Steven W. Orr
Question 1: I have a class A with one attribute and I define __get__ and __set__ for that class. Then I create another class B that uses it. Why does B require that the instance of A be a class variable in B and not created as an instance variable in __init__? E.g., # This works fine.

Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Prasad, Ramit
So I have a context manager used to catch errors def __exit__( self, exceptionClass, exception, tracebackObject ): if isinstance( exception, self.exceptionClasses ): #do something here Normally exception would be the exception instance, but for AttributeError it seems to be a

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 15/03/2012 16:01, Alec Taylor wrote: C++0x? You mean C++11? :P On that note, is Python upgrading to use C11? :V Not for Windows given http://mail.python.org/pipermail/python-dev/2012-February/116258.html. I've no idea regarding *nix, os x or whatever. -- Cheers. Mark Lawrence. --

Re: Python is readable

2012-03-15 Thread Devin Jeanpierre
On Wed, Mar 14, 2012 at 8:27 PM, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 15, 2012 at 10:54 AM, Arnaud Delobelle arno...@gmail.com wrote: I don't know this book and there may be a pedagogical reason for the implementation you quote, but pairwise_sum is probably better implemented in

RE: Python is readable

2012-03-15 Thread Prasad, Ramit
Hopefully, the fact that your quoting of my text munged the characters down to ASCII is also pure coincidence, and is soon to be corrected at your end? Or has your client program not joined the rest of us in the third millennium with Unicode? Outlook showed the EN DASH but your MINUS

Re: Questions about the use of descriptors.

2012-03-15 Thread Ian Kelly
On Thu, Mar 15, 2012 at 11:32 AM, Steven W. Orr ste...@syslang.net wrote: Question 1: I have a class A with one attribute and I define __get__ and __set__ for that class. Then I create another class B that uses it. Why does B require that the instance of A be a class variable in B and not

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Grant Edwards
On 2012-03-15, Dave Angel d...@davea.name wrote: On 03/15/2012 03:26 AM, xliiv wrote: Like the topic.. . I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. I did google, I've played with Exemaker (it works

Re: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Peter Otten
Prasad, Ramit wrote: So I have a context manager used to catch errors def __exit__( self, exceptionClass, exception, tracebackObject ): if isinstance( exception, self.exceptionClasses ): #do something here Normally exception would be the exception instance, but for

RE: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Prasad, Ramit
Prasad, Ramit wrote: So I have a context manager used to catch errors def __exit__( self, exceptionClass, exception, tracebackObject ): if isinstance( exception, self.exceptionClasses ): #do something here Normally exception would be the exception instance, but for

Re: Python is readable

2012-03-15 Thread Serhiy Storchaka
15.03.12 16:19, Kiuhnm написав(ла): Ok, so they're mandatory, but I was mainly talking of design. Why are they needed? http://python-history.blogspot.com/2011/07/karin-dewar-indentation-and-colon.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 16:08, Chris Angelico wrote: On Fri, Mar 16, 2012 at 1:55 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: By the way, the more elaborate parsing consists of looking for an END_OF_LINE followed by one or more spaces. It doesn't sound that complicated. Only in the trivial

Re: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Ian Kelly
On Thu, Mar 15, 2012 at 1:10 PM, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: Prasad, Ramit wrote: So I have a context manager used to catch errors def __exit__( self, exceptionClass, exception, tracebackObject ):     if isinstance( exception, self.exceptionClasses ):          #do

RE: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Prasad, Ramit
... (type 'exceptions.AttributeError', 'A' object has no attribute 'x', traceback object at 0x1817F648) AttributeError: 'A' object has no attribute 'x' As you can see, I am getting a string while you are not. Ian Kelly said: Looks like a version difference. I don't have Python 2.6

Re: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Ian Kelly
On Thu, Mar 15, 2012 at 2:25 PM, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: ... (type 'exceptions.AttributeError', 'A' object has no attribute 'x', traceback object at 0x1817F648) AttributeError: 'A' object has no attribute 'x' As you can see, I am getting a string while you are

RE: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Peter Otten
Prasad, Ramit wrote: Prasad, Ramit wrote: So I have a context manager used to catch errors def __exit__( self, exceptionClass, exception, tracebackObject ): if isinstance( exception, self.exceptionClasses ): #do something here Normally exception would be the

Re: Python is readable

2012-03-15 Thread Arnaud Delobelle
On 15 March 2012 00:27, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 15, 2012 at 10:54 AM, Arnaud Delobelle arno...@gmail.com wrote: I don't know this book and there may be a pedagogical reason for the implementation you quote, but pairwise_sum is probably better implemented in Python

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Cameron Simpson
On 15Mar2012 09:28, Roy Smith r...@panix.com wrote: | In article mailman.665.1331806024.3037.python-l...@python.org, | Robert Kern robert.k...@gmail.com wrote: | Yes. Not all type(default) types can be called with a string to produce a | valid | value. Note that type= is really a misnomer.

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Cameron Simpson
On 14Mar2012 13:13, Tim Chase python.l...@tim.thechases.com wrote: | On 03/14/12 12:06, Terry Reedy wrote: | On 3/14/2012 6:07 AM, Gelonida N wrote: | Now I'm looking for a library, which behaves like config parser, but | with one minor difference. | | The write() mehtod should keep existing

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Karim
Le 15/03/2012 03:48, Steven W. Orr a écrit : On 3/14/2012 6:07 AM, Gelonida N wrote: Hi, At the moment I use ConfigParser http://docs.python.org/library/configparser.html for one of my applications. Now I'm looking for a library, which behaves like config parser, but with one minor

Re: Python is readable

2012-03-15 Thread Michael Torrie
On 03/15/2012 01:40 PM, Kiuhnm wrote: Moreover, I think that if ( ): is not very readable anyway. Sure but neither is if ( \ \

Re: Python is readable

2012-03-15 Thread Michael Torrie
On 03/15/2012 09:18 AM, Kiuhnm wrote: After early user testing without the colon, it was discovered that the meaning of the indentation was unclear to beginners being taught the first steps of programming. The addition of the colon clarified it significantly: the colon somehow

Re: Python is readable

2012-03-15 Thread Ben Finney
Kiuhnm kiuhnm03.4t.yahoo.it writes: Moreover, I think that if ( ): is not very readable anyway. I agree, and am glad PEP 8 has been updated to recommend an extra level of

Re: Python is readable

2012-03-15 Thread Arnaud Delobelle
On 15 March 2012 22:35, Ben Finney ben+pyt...@benfinney.id.au wrote: Kiuhnm kiuhnm03.4t.yahoo.it writes: Moreover, I think that   if (             ):                   is not very readable anyway. I agree, and

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 23:17, Michael Torrie wrote: On 03/15/2012 09:18 AM, Kiuhnm wrote: After early user testing without the colon, it was discovered that the meaning of the indentation was unclear to beginners being taught the first steps of programming. The addition of the colon clarified

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/16/2012 0:00, Arnaud Delobelle wrote: On 15 March 2012 22:35, Ben Finneyben+pyt...@benfinney.id.au wrote: Kiuhnmkiuhnm03.4t.yahoo.it writes: Moreover, I think that if ( ):

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Fri, 16 Mar 2012 01:48:09 +1100, Chris Angelico wrote: On Fri, Mar 16, 2012 at 1:30 AM, Kiuhnm kiuhnm03.4t.yahoo...@mail.python.org wrote: Sorry, but I can't see how it would make it harder for humans to understand. Are there particular situations you're referring to? In a trivial

Re: Python is readable

2012-03-15 Thread Ben Finney
Arnaud Delobelle arno...@gmail.com writes: On 15 March 2012 22:35, Ben Finney ben+pyt...@benfinney.id.au wrote: I agree, and am glad PEP 8 has been updated to recommend an extra level of indentation for continuation, to distinguish from the new block that follows

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 15/03/2012 23:46, Kiuhnm wrote: On 3/16/2012 0:00, Arnaud Delobelle wrote: On 15 March 2012 22:35, Ben Finneyben+pyt...@benfinney.id.au wrote: Kiuhnmkiuhnm03.4t.yahoo.it writes: Moreover, I think that if ( ): is

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Fri, 16 Mar 2012 00:46:35 +0100, Kiuhnm wrote: On 3/16/2012 0:00, Arnaud Delobelle wrote: On 15 March 2012 22:35, Ben Finneyben+pyt...@benfinney.id.au wrote: Kiuhnmkiuhnm03.4t.yahoo.it writes: Moreover, I think that if ( ):

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Gelonida N
On 03/15/2012 10:42 PM, Cameron Simpson wrote: On 14Mar2012 13:13, Tim Chase python.l...@tim.thechases.com wrote: | On 03/14/12 12:06, Terry Reedy wrote: | On 3/14/2012 6:07 AM, Gelonida N wrote: | Now I'm looking for a library, which behaves like config parser, but | with one minor

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Thu, 15 Mar 2012 00:34:47 +0100, Kiuhnm wrote: I've just started to read The Quick Python Book (2nd ed.) Is this the one? http://manning.com/ceder/ The author claims that Python code is more readable than Perl code and provides this example: --- Perl --- sub pairwise_sum {

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Dave Angel
On 03/15/2012 02:39 PM, Grant Edwards wrote: On 2012-03-15, Dave Angeld...@davea.name wrote: On 03/15/2012 03:26 AM, xliiv wrote: Like the topic.. . I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. I did

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Thu, 15 Mar 2012 20:54:30 +, Arnaud Delobelle wrote: On 15 March 2012 00:27, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 15, 2012 at 10:54 AM, Arnaud Delobelle arno...@gmail.com wrote: I don't know this book and there may be a pedagogical reason for the implementation you

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 16/03/2012 01:53, Steven D'Aprano wrote: On Thu, 15 Mar 2012 00:34:47 +0100, Kiuhnm wrote: I've just started to read The Quick Python Book (2nd ed.) Is this the one? http://manning.com/ceder/ The author claims that Python code is more readable than Perl code and provides this

Python simulate browser activity

2012-03-15 Thread choi2k
Hi, everyone I am trying to write a small application using python but I am not sure whether it is possible to do so.. The application aims to simulate user activity including visit a website and perform some interactive actions (click on the menu, submit a form, redirect to another pages...etc)

Re: Python simulate browser activity

2012-03-15 Thread Chris Rebert
On Thu, Mar 15, 2012 at 7:23 PM, choi2k rex.0...@gmail.com wrote: Hi, everyone I am trying to write a small application using python but I am not sure whether it is possible to do so.. The application aims to simulate user activity including visit a website and perform some interactive

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 10:52 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 16 Mar 2012 01:48:09 +1100, Chris Angelico wrote: In a trivial example, it's mostly just noise: if a == b    # who needs the colon?     print(c) The reader, for the same reason that above

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 5:39 AM, Grant Edwards invalid@invalid.invalid wrote: Seems like an awfully obtuse way of doing things -- I don't really want to have 15 different copies of Python (or even links), and it requires root privleges every time you want to run a Python program with the

Re: Python simulate browser activity

2012-03-15 Thread Jerry Hill
On Thu, Mar 15, 2012 at 10:54 PM, Chris Rebert c...@rebertia.com wrote: On Thu, Mar 15, 2012 at 7:23 PM, choi2k rex.0...@gmail.com wrote: The application aims to simulate user activity including visit a website and perform some interactive actions (click on the menu, submit a form, redirect to

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Fri, 16 Mar 2012 00:32:52 +0100, Kiuhnm wrote: Pick up two math books about the same topic but on two different levels (e.g. under-graduated and graduated). If you compare the proofs you'll see that those in the higher-level book are almost always sketched. Why is that? Because they're

[issue14278] email.utils.localtime throws exception if time.daylight is False

2012-03-15 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- assignee: - r.david.murray resolution: - fixed stage: - committed/rejected type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14278

[issue14278] email.utils.localtime throws exception if time.daylight is False

2012-03-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Fixed in the email6 feature branch. Thanks Brian. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14278 ___

[issue4199] add shorthand global and nonlocal statements

2012-03-15 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: +1 on the feature as described in the PEP. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4199 ___

[issue14309] Deprecate time.clock()

2012-03-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: New submission from STINNER Victor victor.stin...@gmail.com: Python 3.3 has 3 functions to get time: - time.clock() - time.steady() - time.time() Antoine Pitrou suggested to deprecated time.clock() in

[issue12758] time.time() returns local time instead of UTC

2012-03-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 1559a82a3529 by R David Murray in branch '2.7': #12758: removing confusing mention of UTC from time.time description http://hg.python.org/cpython/rev/1559a82a3529 New changeset 5615d6b91b53 by R David Murray in

[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-15 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: My revised patch, incorporating changes suggested by Antoine and Guido. -- Added file: http://bugs.python.org/file24859/larry.st_mtime_ns.patch.2.txt ___ Python tracker rep...@bugs.python.org

[issue12758] time.time() returns local time instead of UTC

2012-03-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Thanks, Dylan. -- nosy: +r.david.murray resolution: - fixed stage: needs patch - committed/rejected status: open - closed type: - behavior ___ Python tracker rep...@bugs.python.org

[issue14312] Convert PEP 7 to reStructuredText for readability purposes

2012-03-15 Thread Georg Brandl
New submission from Georg Brandl ge...@python.org: Yes, who not. Applied in 5d6ae5e01df6. -- nosy: +georg.brandl resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14312

[issue14312] Convert PEP 7 to reStructuredText for readability purposes

2012-03-15 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Yes, why not. Applied in c1fd4a5af1c5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14312 ___

[issue14312] Convert PEP 7 to reStructuredText for readability purposes

2012-03-15 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- Removed message: http://bugs.python.org/msg155870 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14312 ___

  1   2   3   >