Re: for / while else doesn't make sense

2016-05-21 Thread Erik
On 20/05/16 01:06, Steven D'Aprano wrote: In my experience, some people (including me) misunderstand "for...else" to mean that the else block runs if the for block *doesn't*. It took me the longest time to understand why this didn't work as I expected: for x in seq: pass else: print("

Re: for / while else doesn't make sense

2016-05-21 Thread Chris Angelico
On Sat, May 21, 2016 at 5:20 PM, Erik wrote: > On 20/05/16 01:06, Steven D'Aprano wrote: > >> In my experience, some people (including me) misunderstand "for...else" to >> mean that the else block runs if the for block *doesn't*. It took me the >> longest time to understand why this didn't work as

Re: How to memory dump an object?

2016-05-21 Thread jfong
Make a quick experiment under version 3.4.4 through this simple "tool" Chris had provided, now I know how the unicode string was stored in memory:-) >>> s1 = '\x80abc' >>> s1 '\x80abc' >>> len(s1) 4 >>> sys.getsizeof(s1) 41 >>> s1ptr = ctypes.cast(id(s1), ctypes.POINTER(ctypes.c_uint8)) >>> bytes

problem regarding installation

2016-05-21 Thread bhagyadhar sahoo
i have downloaded the software from your site.. but while installing it shows some problem .. plz help me out..or let me know how can i get the solution,.. i am waiting for ur replay thanks bhagya -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-05-21 Thread Marko Rauhamaa
Erik : > On 20/05/16 01:06, Steven D'Aprano wrote: >> In my experience, some people (including me) misunderstand >> "for...else" to mean that the else block runs if the for block >> *doesn't*. It took me the longest time to understand why this didn't >> work as I expected: >> >> for x in seq: >>

Re: problem regarding installation

2016-05-21 Thread mm0fmf
On 21/05/2016 08:55, bhagyadhar sahoo wrote: i have downloaded the software from your site.. but while installing it shows some problem .. plz help me out..or let me know how can i get the solution,.. i am waiting for ur replay thanks bhagya We don't know which web site you are talking about.

Re: problem regarding installation

2016-05-21 Thread Peter Otten
bhagyadhar sahoo wrote: > i have downloaded the software from your site.. > but while installing it shows some problem .. > plz help me out..or let me know how can i get the solution,.. i am waiting > for ur replay We are sorry, your operating system is no longer supported by current versions of

Re: problem regarding installation

2016-05-21 Thread Chris Angelico
On Sat, May 21, 2016 at 7:14 PM, Peter Otten <__pete...@web.de> wrote: > bhagyadhar sahoo wrote: > >> i have downloaded the software from your site.. >> but while installing it shows some problem .. >> plz help me out..or let me know how can i get the solution,.. i am waiting >> for ur replay > > W

Re: for / while else doesn't make sense

2016-05-21 Thread Steven D'Aprano
On Sat, 21 May 2016 02:01 pm, Chris Angelico wrote: > On Sat, May 21, 2016 at 1:50 PM, Steven D'Aprano > wrote: >> Would you classify the second line here: >> >> print("Hello World!") >> pass >> >> >> as a bug? What exactly would your bug report be? "pass statement does >> nothing, as expected.

PyData EuroPython 2016

2016-05-21 Thread M.-A. Lemburg
We are excited to announce a complete PyData (http://pydata.org/) track at EuroPython 2016 in Bilbao, Basque Country, Spain, from July 14-24. *** PyData EuroPython 2016 *** https://ep2016.europython.eu/en/events/pydata/ The PyData track will be part of the EuroPy

Re: for / while else doesn't make sense

2016-05-21 Thread Chris Angelico
On Sat, May 21, 2016 at 7:56 PM, Steven D'Aprano wrote: > On Sat, 21 May 2016 02:01 pm, Chris Angelico wrote: > >> On Sat, May 21, 2016 at 1:50 PM, Steven D'Aprano >> wrote: > >>> Would you classify the second line here: >>> >>> print("Hello World!") >>> pass >>> >>> >>> as a bug? What exactly wo

Education [was Re: for / while else doesn't make sense]

2016-05-21 Thread Steven D'Aprano
On Sat, 21 May 2016 03:18 pm, Rustom Mody wrote: > Given that for the most part, most of us are horribly uneducated [ > http://www.creativitypost.com/education/9_elephants_in_the_classroom_that_should_unsettle_us > ] > how do we go about correcting our wrong primacies? An interesting article, bu

Re: for / while else doesn't make sense

2016-05-21 Thread Steven D'Aprano
On Sat, 21 May 2016 05:20 pm, Erik wrote: > On 20/05/16 01:06, Steven D'Aprano wrote: > >> In my experience, some people (including me) misunderstand "for...else" >> to mean that the else block runs if the for block *doesn't*. It took me >> the longest time to understand why this didn't work as I

Re: for / while else doesn't make sense

2016-05-21 Thread Steven D'Aprano
On Sat, 21 May 2016 08:08 pm, Chris Angelico wrote: > On Sat, May 21, 2016 at 7:56 PM, Steven D'Aprano > wrote: >> On Sat, 21 May 2016 02:01 pm, Chris Angelico wrote: >> >>> On Sat, May 21, 2016 at 1:50 PM, Steven D'Aprano >>> wrote: >> Would you classify the second line here: pri

Re: for / while else doesn't make sense

2016-05-21 Thread Chris Angelico
On Sat, May 21, 2016 at 8:55 PM, Steven D'Aprano wrote: > I think we agree that it's not the compiler's job to enforce good coding > standards. Yep. I believe we are in (possibly belligerent) agreement. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-05-21 Thread Steven D'Aprano
On Sat, 21 May 2016 04:03 pm, Marko Rauhamaa wrote: > theh...@gmail.com: > >> You seem to have missed the point. Nobody is suggesting, I don't >> believe, that all of a language should be intuitive. Rather that if >> any part of it is unnecessarily counter-intuitive, it may be worth >> looking fo

Re: for / while else doesn't make sense

2016-05-21 Thread Steven D'Aprano
On Sat, 21 May 2016 09:57 am, Dennis Lee Bieber wrote: > On Fri, 20 May 2016 11:55:34 - (UTC), Jon Ribbens > declaimed the following: > >> >>I would find that very confusing. "then:" makes it sound like >>executing that block is the usual case, when in practice it is >>usually the exception

Re: How do I subclass the @property setter method?

2016-05-21 Thread Dirk Bächle
Hi Christopher, On 20.05.2016 20:50, Christopher Reimer wrote: Greetings, My chess engine has a Piece class with the following methods that use the @property decorator to read and write the position value. slightly off topic: is your chess engine available in a public repo somewhere? I think

Re: for / while else doesn't make sense

2016-05-21 Thread Ian Kelly
On Sat, May 21, 2016 at 5:26 AM, Steven D'Aprano wrote: > Does anyone know of other languages that include the same feature? It's very > rare for Python to innovate in language features. > > (I wonder if it came from ABC?) According to Raymond Hettinger starting at about 15:50 in this video: htt

Re: for / while else doesn't make sense

2016-05-21 Thread Grant Edwards
On 2016-05-21, Ian Kelly wrote: > On Sat, May 21, 2016 at 5:26 AM, Steven D'Aprano wrote: > >> Does anyone know of other languages that include the same feature? >> It's very rare for Python to innovate in language features. >> >> (I wonder if it came from ABC?) > > According to Raymond Hettinger

Image loading problem

2016-05-21 Thread sweating_...@yahoo.com
Hi All, I am working on an image project, and I can display my image in main(). I mean, I can load my image in my main(). Needless, it is awkward. I am trying to load my image with a function, but got an empty image window popped up, no image content loaded. Please take a look at code: rom

Re: How do I subclass the @property setter method?

2016-05-21 Thread Christopher Reimer
On 5/21/2016 1:52 AM, Dirk Bächle wrote: Hi Christopher, On 20.05.2016 20:50, Christopher Reimer wrote: Greetings, My chess engine has a Piece class with the following methods that use the @property decorator to read and write the position value. slightly off topic: is your chess engine a

Re: Education [was Re: for / while else doesn't make sense]

2016-05-21 Thread Christopher Reimer
On 5/21/2016 3:05 AM, Steven D'Aprano wrote: On Sat, 21 May 2016 03:18 pm, Rustom Mody wrote: Given that for the most part, most of us are horribly uneducated [ http://www.creativitypost.com/education/9_elephants_in_the_classroom_that_should_unsettle_us ] how do we go about correcting our wr

Re: Image loading problem

2016-05-21 Thread Peter Otten
sweating_...@yahoo.com wrote: > I am working on an image project, and I can display my image in main(). I mean, I can load my image in my main(). Needless, it is awkward. I am trying to load my image with a function, but got an empty image window popped up, no image content loaded. Please take

Re: Education [was Re: for / while else doesn't make sense]

2016-05-21 Thread Marko Rauhamaa
Christopher Reimer : > Under various proposals in the U.S., everyone will soon learn how to > program and/or become a computer scientist. Won't be long before some > snotty-nosed brat graduates from preschool, takes a look at your code, > and poops in his diapers. He will then dips his finger into

Re: Image loading problem

2016-05-21 Thread Peter Pearson
On Sat, 21 May 2016 08:22:41 -0700 (PDT), sweating_...@yahoo.com wrote: > > I am working on an image project, and I can display my image in > main(). I mean, I can load my image in my main(). Needless, it is > awkward. I am trying to load my image with a function, but got an > empty image window po

Python and GPSD

2016-05-21 Thread John McKenzie
Good day, all. I need help using the Python bindings for GPSD. Specifically, I would like to take a latitude reading, put it in a variable and use it later. The problem is that every example I see involves constantly taking changing readings. That part I have working for myself by following

Re: Image loading problem

2016-05-21 Thread Gary Herron
On 05/21/2016 08:22 AM, sweating_...@yahoo.com wrote: Hi All, I am working on an image project, and I can display my image in main(). I mean, I can load my image in my main(). Needless, it is awkward. I am trying to load my image with a function, but got an empty image window popped up, no im

Re: Image loading problem

2016-05-21 Thread Terry Reedy
On 5/21/2016 12:54 PM, Peter Otten wrote: sweating_...@yahoo.com wrote: I am working on an image project, and I can display my image in main(). I mean, I can load my image in my main(). Needless, it is awkward. I am trying to load my image with a function, but got an empty image window popped

Re: Image loading problem

2016-05-21 Thread Random832
On Sat, May 21, 2016, at 12:54, Peter Otten wrote: > It's not your fault, there's an odd quirk in the library: you have to > keep a reference of the PhotoImage instance around to prevent the > image from being garbage-collected. Just out of curiosity, why is this a "quirk" and not a bug? Why isn't

Re: for / while else doesn't make sense

2016-05-21 Thread Erik
On 21/05/16 11:39, Steven D'Aprano wrote: Just for the record, that's not my mental model *now*. Sure. And I should have written "one's mental model" - the model of anyone writing that code (not you personally) who thought the same at the time. It took me a long time to work out what for..

Re: for / while else doesn't make sense

2016-05-21 Thread Michael Selik
On Sat, May 21, 2016, 4:52 PM Erik wrote: > So I guess my question is perhaps whether Python compilers should start > to go down the same path that C compilers did 30 years ago (by starting > to include some linter functionality) > Well, there's that whole optional type hints thing. You should b

Re: for / while else doesn't make sense

2016-05-21 Thread Steven D'Aprano
On Sun, 22 May 2016 06:48 am, Erik wrote: > Let me tell you a story ;) Back in the mid-to-late > 1980s I worked with C compilers on hardware that could take several > minutes to compile even a fairly trivial program. They errored on > syntactically incorrect code and happily compiled syntacticall

Re: Image loading problem

2016-05-21 Thread huey . y . jiang
Thanks so much! All of methods works! -- https://mail.python.org/mailman/listinfo/python-list