Re: Uniform Function Call Syntax (UFCS)

2014-06-09 Thread jongiddy
So, just to summarise the discussion: There was some very mild support for readable pipelines, either using UFCS or an alternative syntax, but the Pythonic way to make combinations of function and method applications readable is to assign to variables over multiple lines. Make the code read do

Re: Suds 4.1 Beta Assertion Failure

2014-06-09 Thread dieter
1stpo...@gmail.com writes: > Hello group, I have been using Python suds to try to consume a web service. > I am able to use tools like SOAPUI and it works but when I it in python I > get Assertion Failure. > ... > suds.WebFault: Server raised fault: 'Assertion failure: criteria at line 296 >

Re: OT: This Swift thing

2014-06-09 Thread alex23
On 6/06/2014 9:11 PM, Alain Ketterlin wrote: The nice thing with optional type annotations and an hypothetical Python compiler would be that you could, e.g., continue using the interpreter during development and then compile for production use. s/annotations/decorators/ and you effectively have

Re: os.startfile hanging onto the launched app, or my IDE?

2014-06-09 Thread Tim Golden
On 09/06/2014 23:31, Ethan Furman wrote: On 06/09/2014 03:21 PM, Josh English wrote: So this quirk is coming from PyScripter, which is a shame, because I don't think it's under development, so it won't be fixed. The nice thing about Python code is you can at least fix your copy. :) IIRC, P

Re: Is MVC Design Pattern good enough?

2014-06-09 Thread Chris Angelico
On Tue, Jun 10, 2014 at 1:54 PM, Stefan Ram wrote: > Chris Angelico writes: >>On Tue, Jun 10, 2014 at 12:57 PM, Stefan Ram wrote: >>>AFAIK standard Python has no GUI library at all, so Java SE >>>and C# already are better than Python insofar as they >>>include a standard GUI toolkit at all! In P

Re: Is MVC Design Pattern good enough?

2014-06-09 Thread Chris Angelico
On Tue, Jun 10, 2014 at 12:57 PM, Stefan Ram wrote: > AFAIK standard Python has no GUI library at all, so Java SE > and C# already are better than Python insofar as they > include a standard GUI toolkit at all! In Python one first > has to choose between more than a dozen of »GUI framework

Re: os.startfile hanging onto the launched app, or my IDE?

2014-06-09 Thread Ethan Furman
On 06/09/2014 03:21 PM, Josh English wrote: So this quirk is coming from PyScripter, which is a shame, because I don't think it's under development, so it won't be fixed. The nice thing about Python code is you can at least fix your copy. :) -- ~Ethan~ -- https://mail.python.org/mailman/lis

Re: os.startfile hanging onto the launched app, or my IDE?

2014-06-09 Thread Josh English
On Saturday, June 7, 2014 1:24:43 PM UTC-7, Tim Golden wrote: > > I'm not 100% sure what your scenario is, but you can certainly help > yourself and us by running the same test on the raw interpreter and then > under PyScripter to determine if the behaviour is to do with IDLE or > with Python it

Re: Is MVC Design Pattern good enough?

2014-06-09 Thread Wolfgang Keller
> > The most intuitive approach to database applications would be: > > > > http://en.wikipedia.org/wiki/Naked_objects > > http://www.nakedobjects.org/ > > > > [...] > > > > Unfortunately, there's no Python framework (yet?) that implements > > this design. > > It could be a blessing in disguise. To

Re: Interfacing Fortran applications

2014-06-09 Thread Sturla Molden
On 09/06/14 14:24, Michael Welle wrote: >> If you are to rewrite the Fortran app you can just as well use f2py from >> NumPy. > a rewrite of the application isn't possible. That would require > knowledge about what the used algorithms are, why they are implemented > as they are, that would require

Re: lists vs. NumPy arrays for sets of dates and strings

2014-06-09 Thread Denis McMahon
On Mon, 09 Jun 2014 12:48:12 -0700, beliavsky wrote: > I am going to read a multivariate time series from a CSV file that looks > like > > Date,A,B 2014-01-01,10.0,20.0 2014-01-02,10.1,19.9 ... > > The numerical data I will store in a NumPy array, since they are more > convenient to work with th

First time I looked at Python was(...)

2014-06-09 Thread Carlos Anselmo Dias
Hi ... I'm finishing my messages with this ... The first time I looked into Python was +- 10 years ago ... and in the last 10 years I did not spent more than 30 minutes looking at ... but I like it ... it's easy to read ... even if I'm not familiar with the syntax of ... When you look at th

lists vs. NumPy arrays for sets of dates and strings

2014-06-09 Thread beliavsky
I am going to read a multivariate time series from a CSV file that looks like Date,A,B 2014-01-01,10.0,20.0 2014-01-02,10.1,19.9 ... The numerical data I will store in a NumPy array, since they are more convenient to work with than lists of lists. What are the advantages and disadvantages of st

Re: None in string => TypeError?

2014-06-09 Thread Chris Angelico
On Tue, Jun 10, 2014 at 3:58 AM, Ian Kelly wrote: > On Mon, Jun 9, 2014 at 11:40 AM, Chris Angelico wrote: >> Also, this is the first time I've seen None as a constant other than >> the first. Usually co_consts[0] is None, but this time co_consts[4] is >> None. > > Functions always seem to have N

Re: None in string => TypeError?

2014-06-09 Thread Ian Kelly
On Mon, Jun 9, 2014 at 11:40 AM, Chris Angelico wrote: > Also, this is the first time I've seen None as a constant other than > the first. Usually co_consts[0] is None, but this time co_consts[4] is > None. Functions always seem to have None as the first constant, but modules and classes are othe

Re: None in string => TypeError?

2014-06-09 Thread Chris Angelico
On Tue, Jun 10, 2014 at 3:22 AM, Ian Kelly wrote: > On Mon, Jun 9, 2014 at 10:59 AM, Chris Angelico wrote: >> On Tue, Jun 10, 2014 at 2:53 AM, Roy Smith wrote: >>> In retrospect, I suspect: >>> >>> hourly_data = [(t if status in set('CSRP') else None) for (t, >>> status) in hours] >>>

Re: None in string => TypeError?

2014-06-09 Thread Ian Kelly
On Mon, Jun 9, 2014 at 10:59 AM, Chris Angelico wrote: > On Tue, Jun 10, 2014 at 2:53 AM, Roy Smith wrote: >> In retrospect, I suspect: >> >> hourly_data = [(t if status in set('CSRP') else None) for (t, >> status) in hours] >> >> is a little cleaner. > > I'd go with this. It's clearer

Re: None in string => TypeError?

2014-06-09 Thread Chris Angelico
On Tue, Jun 10, 2014 at 2:53 AM, Roy Smith wrote: > In retrospect, I suspect: > > hourly_data = [(t if status in set('CSRP') else None) for (t, > status) in hours] > > is a little cleaner. I'd go with this. It's clearer that a status of 'SR' should result in False, not True. (Presumably

Re: try/except/finally

2014-06-09 Thread Skip Montanaro
On Mon, Jun 9, 2014 at 11:23 AM, Shiyao Ma wrote: > > It would be great if someone could discuss it from the viewpoint of bytecode. > e.g., how the stack is popped, etc. BITD, you couldn't have try/except/finally. You could have try/except or try/finally. You could nest the two, which is what pe

Re: None in string => TypeError?

2014-06-09 Thread Roy Smith
On Jun 9, 2014, at 11:57 AM, Paul Sokolovsky wrote: > This is very Pythonic, Python is strictly typed language. There's no > way None could possibly be "inside" a string, so if you're trying to > look for it there, you're doing something wrong, and told so. Well, the code we've got is:

Re: None in string => TypeError?

2014-06-09 Thread Chris Angelico
On Tue, Jun 10, 2014 at 2:14 AM, Steven D'Aprano wrote: >> This is very Pythonic, Python is strictly typed language. There's no way >> None could possibly be "inside" a string, > > Then `None in some_string` could immediately return False, instead of > raising an exception. Note, by the way, that

Re: try/except/finally

2014-06-09 Thread Shiyao Ma
It would be great if someone could discuss it from the viewpoint of bytecode. e.g., how the stack is popped, etc. 2014-06-09 17:40 GMT+08:00 Marko Rauhamaa : > Philip Shaw : > > > OTOH, it could just be that Guido didn't think of banning [return from > > finally] when exceptions were first added

Re: None in string => TypeError?

2014-06-09 Thread Steven D'Aprano
On Mon, 09 Jun 2014 18:57:28 +0300, Paul Sokolovsky wrote: > Hello, > > On Mon, 9 Jun 2014 08:34:42 -0700 (PDT) Roy Smith wrote: > >> We noticed recently that: >> >> >>> None in 'foo' >> >> raises (at least in Python 2.7) >> >> TypeError: 'in ' requires string as left operand, not NoneType >

Re: None in string => TypeError?

2014-06-09 Thread Shiyao Ma
2014-06-09 23:34 GMT+08:00 Roy Smith : > We noticed recently that: > > >>> None in 'foo' > > raises (at least in Python 2.7) > > TypeError: 'in ' requires string as left operand, not NoneType > > This is surprising. The description of the 'in' operatator is, 'True if > an item of s is equal to x,

Re: None in string => TypeError?

2014-06-09 Thread Steven D'Aprano
On Mon, 09 Jun 2014 08:34:42 -0700, Roy Smith wrote: > We noticed recently that: > None in 'foo' > > raises (at least in Python 2.7) That goes back to at least Python 1.5, when member tests only accepted a single character, not a substring: >>> None in "abc" Traceback (innermost last):

Re: None in string => TypeError?

2014-06-09 Thread MRAB
On 2014-06-09 16:34, Roy Smith wrote: We noticed recently that: None in 'foo' raises (at least in Python 2.7) TypeError: 'in ' requires string as left operand, not NoneType This is surprising. The description of the 'in' operatator is, 'True if an item of s is equal to x, else False '. F

Re: None in string => TypeError?

2014-06-09 Thread Paul Sokolovsky
Hello, On Mon, 9 Jun 2014 08:34:42 -0700 (PDT) Roy Smith wrote: > We noticed recently that: > > >>> None in 'foo' > > raises (at least in Python 2.7) > > TypeError: 'in ' requires string as left operand, not NoneType > > This is surprising. The description of the 'in' operatator is, 'True >

Re: None in string => TypeError?

2014-06-09 Thread Ian Kelly
On Mon, Jun 9, 2014 at 9:34 AM, Roy Smith wrote: > We noticed recently that: > None in 'foo' > > raises (at least in Python 2.7) > > TypeError: 'in ' requires string as left operand, not NoneType > > This is surprising. The description of the 'in' operatator is, 'True if an > item of s is e

Suds 4.1 Beta Assertion Failure

2014-06-09 Thread 1stpoint
Hello group, I have been using Python suds to try to consume a web service. I am able to use tools like SOAPUI and it works but when I it in python I get Assertion Failure. Here is my code if __name__== '__main__': from suds.client import Client import logging logging.basicConfig(

Re: None in string => TypeError?

2014-06-09 Thread Ryan Hiebert
On Mon, Jun 9, 2014 at 10:34 AM, Roy Smith wrote: > We noticed recently that: > > >>> None in 'foo' > > raises (at least in Python 2.7) > > TypeError: 'in ' requires string as left operand, not NoneType > > This is surprising. > > It's the same in 3.4, and I agree that it's surprising, at least t

Re: embedding ipython kernel in a thread

2014-06-09 Thread Carlos Anselmo Dias
On 06/09/2014 04:07 PM, Carlos Anselmo Dias wrote: On 06/09/2014 03:55 PM, Gelonida N wrote: Not sure what you are trying to tell me with attached PHP code. Hi ... Nothing important I'd write for what you're seeking ... I'm not one Python expert ... just reading fast what you wrote ... i

None in string => TypeError?

2014-06-09 Thread Roy Smith
We noticed recently that: >>> None in 'foo' raises (at least in Python 2.7) TypeError: 'in ' requires string as left operand, not NoneType This is surprising. The description of the 'in' operatator is, 'True if an item of s is equal to x, else False '. From that, I would assume it behaves as

Re: embedding ipython kernel in a thread

2014-06-09 Thread Carlos Anselmo Dias
On 06/09/2014 03:55 PM, Gelonida N wrote: Not sure what you are trying to tell me with attached PHP code. Hi ... Nothing important I'd write for what you're seeking ... I'm not one Python expert ... just reading fast what you wrote ... it's certainly one interesting issue if you can contro

Re: Interfacing Fortran applications

2014-06-09 Thread Chris Angelico
On Mon, Jun 9, 2014 at 10:24 PM, Michael Welle wrote: > I can change everything until after the > initialisation of the application and the output of the results. That, > hopefully, will not break something. Okay. So you should be able to go for the socket approach, fairly easily. Or possibly you

Re: embedding ipython kernel in a thread

2014-06-09 Thread Gelonida N
On 6/9/2014 3:34 PM, Carlos Anselmo Dias wrote: On 06/09/2014 01:59 PM, Gelonida N wrote: Hi, I'd like to embed an ipython kernel in an appliction, such, that I can use ipython console --existing kernel-.json lateron to connect to it and to look at some values Due to various reason I don no

Re: OT: This Swift thing

2014-06-09 Thread Marko Rauhamaa
Michael Torrie : > We used to tell people that computers make very efficient space > heaters. Because in fact they do. And that's no joke. Our home in Finland is heated with electric radiators. They are on 8-9 months a year. During those months, the use of all electrical appliances is free (apart

Re: Uniform Function Call Syntax (UFCS)

2014-06-09 Thread Ian Kelly
On Jun 8, 2014 9:56 PM, "Steven D'Aprano" > > which means that hasattr (which is defined by > > attempting to get the attribute and seeing if an exception is thrown) > > has to return True. > > Yes. And this is a problem why? Earlier in this thread I pointed out that returning True creates problem

Re: OT: This Swift thing

2014-06-09 Thread Marko Rauhamaa
Gene Heskett : > Looking at the whole system, about the only energy input that is not > converted to heat, would be the milliwatt or 3 of sound from the speaker > when it beeps at you, and the additional energy to spin the fans. That all becomes heat as well. The dust particles that stick to t

Re: OT: This Swift thing

2014-06-09 Thread Michael Torrie
On 06/08/2014 10:20 PM, Steven D'Aprano wrote: > A typical desktop computer uses less than 500 watts for *everything* > except the screen. Hard drives. DVD burner. Keyboard, mouse, USB devices, > network card, sound card, graphics card, etc. (Actually, 350W is more > typical.) > > Moore's Law o

Re: OT: This Swift thing

2014-06-09 Thread Gene Heskett
On Monday 09 June 2014 02:32:33 Rustom Mody did opine And Gene did reply: > On Monday, June 9, 2014 9:50:38 AM UTC+5:30, Steven D'Aprano wrote: > > On Sun, 08 Jun 2014 19:24:52 -0700, Rustom Mody wrote: > > > On Monday, June 9, 2014 7:14:24 AM UTC+5:30, Steven D'Aprano wrote: > > >> CPU technology

Re: Uniform Function Call Syntax (UFCS)

2014-06-09 Thread Steven D'Aprano
On Mon, 09 Jun 2014 19:13:40 +1000, Chris Angelico wrote: > On Mon, Jun 9, 2014 at 7:09 PM, Steven D'Aprano > wrote: >> On Mon, 09 Jun 2014 09:25:33 +0300, Marko Rauhamaa wrote: >> >>> In a word, >>> Python has predefined a handful of *generic functions/methods*, >> >> >> That's nine words :-) >

Re: embedding ipython kernel in a thread

2014-06-09 Thread Carlos Anselmo Dias
On 06/09/2014 01:59 PM, Gelonida N wrote: Hi, I'd like to embed an ipython kernel in an appliction, such, that I can use ipython console --existing kernel-.json lateron to connect to it and to look at some values Due to various reason I don not want to start it in the main thread. If yo

Re: OT: This Swift thing

2014-06-09 Thread Roy Smith
In article <53953616$0$29988$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Moore's Law observes that processing power has doubled about every two > years. Over the last decade, processing power has increased by a factor > of 32. If *efficiency* had increased at the same rate, t

embedding ipython kernel in a thread

2014-06-09 Thread Gelonida N
Hi, I'd like to embed an ipython kernel in an appliction, such, that I can use ipython console --existing kernel-.json lateron to connect to it and to look at some values Due to various reason I don not want to start it in the main thread. If you look at following example you will see, that

ANN: eGenix pyOpenSSL Distribution 0.13.3.1.0.1.8

2014-06-09 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.13.3.1.0.1.8 An easy-to-install and easy-to-use distribution of the pyOpenSSL Python interface fo

Re: OT: This Swift thing

2014-06-09 Thread Rustom Mody
On Monday, June 9, 2014 2:57:26 PM UTC+5:30, Steven D'Aprano wrote: >http://en.wikipedia.org/wiki/Landauer's_principle Hey thanks for that! Always thought something like this should exist but did not know what/where/how! > On Sun, 08 Jun 2014 23:32:33 -0700, Rustom Mody wrote: > > On Monday

Re: Interfacing Fortran applications

2014-06-09 Thread Sturla Molden
Michael Welle wrote: > I thought about equipping the Fortran application with sockets, so that > I can send input data and commands (which is now done via cmd line) and > reading output data back. Any opinions on this? Best pratices? If you are to rewrite the Fortran app you can just as well u

Re: try/except/finally

2014-06-09 Thread Marko Rauhamaa
Philip Shaw : > OTOH, it could just be that Guido didn't think of banning [return from > finally] when exceptions were first added and doesn't want to > introduce an incompatability later. You don't have to ban all nonsensical things. Most guns allow you to shoot yourself in the foot, even those

Re: Interfacing Fortran applications

2014-06-09 Thread Chris Angelico
On Mon, Jun 9, 2014 at 5:43 PM, Michael Welle wrote: > I want to build a Python based user interface for an existing Fortran > application (as everyone wants to do ;)). Lets assume the application is > parametrised via cmdline parameters and it calculates tons of numbers > that have to find their

Re: OT: This Swift thing

2014-06-09 Thread Steven D'Aprano
On Sun, 08 Jun 2014 23:32:33 -0700, Rustom Mody wrote: > On Monday, June 9, 2014 9:50:38 AM UTC+5:30, Steven D'Aprano wrote: >> On Sun, 08 Jun 2014 19:24:52 -0700, Rustom Mody wrote: >> >> >> > On Monday, June 9, 2014 7:14:24 AM UTC+5:30, Steven D'Aprano wrote: >> >> CPU technology is the triump

Re: How to use SQLite (sqlite3) more efficiently

2014-06-09 Thread Philip Shaw
On 2014-06-06, Mark Lawrence wrote: > On 06/06/2014 22:58, Dave Angel wrote: >> Chris Angelico Wrote in message: >>> On Sat, Jun 7, 2014 at 4:15 AM, R Johnson >>> wrote: > The subject line isn't as important as a header, carried invisibly > through, that says that you were replying to an

Re: try/except/finally

2014-06-09 Thread Philip Shaw
On 2014-06-08, Dave Angel wrote: > Frank B Wrote in message: >> Ok; this is a bit esoteric. >> >> So finally is executed regardless of whether an exception occurs, so states >> the docs. >> >> But, I thought, if I from my function first, that should take >> precedence. >> >> au contraire >>

Re: Uniform Function Call Syntax (UFCS)

2014-06-09 Thread Chris Angelico
On Mon, Jun 9, 2014 at 7:09 PM, Steven D'Aprano wrote: > On Mon, 09 Jun 2014 09:25:33 +0300, Marko Rauhamaa wrote: > >> In a word, >> Python has predefined a handful of *generic functions/methods*, > > > That's nine words :-) I'll explain in two words: We propose to marry your daughters. http://

Re: Uniform Function Call Syntax (UFCS)

2014-06-09 Thread Steven D'Aprano
On Mon, 09 Jun 2014 09:25:33 +0300, Marko Rauhamaa wrote: > In a word, > Python has predefined a handful of *generic functions/methods*, That's nine words :-) -- Steven D'Aprano http://import-that.dreamwidth.org/ -- https://mail.python.org/mailman/listinfo/python-list