Awful code of the week

2016-08-06 Thread Steven D'Aprano
Seen in the office IRC channel: (13:23:07) fred: near_limit = [] (13:23:07) fred: near_limit.append(1) (13:23:07) fred: near_limit = len(near_limit) (13:23:09) fred: WTF Speaks for itself. -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: where is it

2016-08-06 Thread eryk sun
On Sat, Aug 6, 2016 at 5:16 PM, Dave via Python-list wrote: > I am trying to associate the .py file extension with idle...where IS > idle? Can you > make it a bit more difficult to load/use your software please. You can run IDLE from the command-line as follows: 3.x:python[3][w] -m

Re: Win32 API in pywin32

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 2:59 PM, Rustom Mody wrote: > To be fair my head spins in Linux-land trying to work out what all these > 32's and 64's mean: mingw-w64-x86-64 There aren't any 32s in that. The beginning of that probably means the Win64 version of MinGW, which (IIRC) is distinctly different

Re: Win32 API in pywin32

2016-08-06 Thread Rustom Mody
On Friday, August 5, 2016 at 5:29:37 PM UTC+5:30, Matt Wheeler wrote: > On Fri, 5 Aug 2016, 02:23 Lawrence D’Oliveiro, wrote: > > > On Friday, August 5, 2016 at 12:06:23 PM UTC+12, Igor Korot wrote: > > > > > > On Thu, Aug 4, 2016 at 4:57 PM, Lawrence D’Oliveiro wrote: > > >> On Friday, August 5,

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 1:42 PM, Steven D'Aprano wrote: > When you read a book, there are two ways of stopping: > > - reach the end, and run out of pages to read, so you stop; > - give up reading early, and just put the book away. > > (Or possibly throw the book across the room.) > Or someone migh

Re: Me, myself and I [was Re: Python slang]

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 1:22 PM, Steven D'Aprano wrote: > But using it in place of "me"? I don't think so. > > "The research was done by myself." > "He punched myself in the head." > > I wouldn't say it is *wrong*, just inelegant and rather pretentious. I'm sure there's good poetic reason for writ

Re: How do I make a game in Python ?

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 1:14 PM, Michael Torrie wrote: > On 08/06/2016 03:51 PM, Cai Gengyang wrote: >> As in, any recommended websites that helps users create complex games in >> Python ? > > I imagine you create a complex game in Python the same way you'd do it > in just about any other language

Re: where is it

2016-08-06 Thread Steven D'Aprano
On Sun, 7 Aug 2016 01:31 pm, Steven D'Aprano wrote: > If there is a shortcut on the desktop, right click on the desktop and use > that to locate IDLE. Sorry, I meant right-click on the SHORTCUT. > Or use Start Menu > Find File (or whatever Windows calls it) to find IDLE. > > But I think you may

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Steven D'Aprano
On Sun, 7 Aug 2016 08:05 am, Lawrence D’Oliveiro wrote: > On Saturday, August 6, 2016 at 12:08:30 PM UTC+12, bream...@gmail.com > wrote: >> A couple or three years old but this is well worth seeing for anybody, >> regardless of your Python expertise. >> http://nedbatchelder.com/text/iter.html > >

Re: where is it

2016-08-06 Thread Steven D'Aprano
On Sun, 7 Aug 2016 03:16 am, Dave wrote: > I am trying to associate the .py file extension with idle...where IS > idle? Can you make it a bit more difficult to load/use your software > please. We certainly could, but we're not going to make it more difficult just to suit you. You can make it

Me, myself and I [was Re: Python slang]

2016-08-06 Thread Steven D'Aprano
On Sun, 7 Aug 2016 07:33 am, Michael Torrie wrote: > On 08/05/2016 07:14 PM, Steven D'Aprano wrote: >> In English, we refer to ourselves in the first person as I, me, myself, >> and sometimes "self", never as "this". One can say "this one has a hat", >> for example, but it sounds weird, like somet

Re: How do I make a game in Python ?

2016-08-06 Thread Michael Torrie
On 08/06/2016 03:51 PM, Cai Gengyang wrote: > As in, any recommended websites that helps users create complex games in > Python ? I imagine you create a complex game in Python the same way you'd do it in just about any other language. Thus any website on game design would be broadly applicable.

Re: Python slang

2016-08-06 Thread Michael Torrie
On 08/06/2016 08:27 PM, Clayton Kirkwood wrote: > You can always tell the correctness by removing the other person. If it > doesn't sound right then, then it is wrong. You don't say 'I gave to I', or > 'I gave to me', it is 'I gave to myself'. Yup good point, and I failed at that obviously. Good

Re: Python slang

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 12:32 PM, Steven D'Aprano wrote: > By "atomic type", I mean a class which "feels" like it is a primitive, > low-level structure rather than an object with attributes, for example: > > - builtins int, float, str, bytes, dict, list, tuple, set, frozenset, bool; > - array from

Re: Python slang

2016-08-06 Thread Rustom Mody
On Sunday, August 7, 2016 at 1:25:43 AM UTC+5:30, Marco Sulla wrote: > On 6 August 2016 at 02:13, Chris Angelico wrote: > > On Sat, Aug 6, 2016 at 9:21 AM, Marco Sulla wrote: > >> I want to clarify that when I say "different from the other > >> languages", I mean "different from the most used langu

Re: Python slang

2016-08-06 Thread Steven D'Aprano
On Sun, 7 Aug 2016 04:33 am, Terry Reedy wrote: > On 8/6/2016 2:30 AM, Michael Selik wrote: > >> When people ask me why the core classes are lowercased, > > Int, float, list, dict, etc were once functions that return objects of > type 'int', 'float', 'list', 'dict', etc, before they became 'new-

RE: Python slang

2016-08-06 Thread Clayton Kirkwood
You can always tell the correctness by removing the other person. If it doesn't sound right then, then it is wrong. You don't say 'I gave to I', or 'I gave to me', it is 'I gave to myself'. crk > -Original Message- > From: Python-list [mailto:python-list- > bounces+crk=godblessthe...@pyt

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 9:21:24 PM UTC-4, Lawrence D’Oliveiro wrote: > On Sunday, August 7, 2016 at 11:36:06 AM UTC+12, Ned Batchelder wrote: > > > Didn't we already do this debate? > > I understand. You want to discuss loops, just not *those* sorts of loops... I didn't post this link her

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Lawrence D’Oliveiro
On Sunday, August 7, 2016 at 11:36:06 AM UTC+12, Ned Batchelder wrote: > Didn't we already do this debate? I understand. You want to discuss loops, just not *those* sorts of loops... -- https://mail.python.org/mailman/listinfo/python-list

Re: Python slang

2016-08-06 Thread Gregory Ewing
Ian Kelly wrote: (not grammar, since "myself" is grammatically correct) Not sure about that. "Myself" is a reflexive pronoun, used when the subject and object of a verb are the same. So "I did this research by myself" is correct. But if Bob is involved, the subject and object are different, so

Re: Ide or code editor confusion

2016-08-06 Thread Lawrence D’Oliveiro
On Friday, August 5, 2016 at 6:36:45 AM UTC+12, Michael Torrie wrote: > On 08/04/2016 01:23 AM, Lawrence D’Oliveiro wrote: >> That’s why I’ve come to the conclusion it’s a waste of time buying books >> on computing topics. They start to reek of decay while they’re still on >> the shelf. > > Except

Re: Win32 API in pywin32

2016-08-06 Thread Lawrence D’Oliveiro
On Saturday, August 6, 2016 at 8:05:40 AM UTC+12, eryk sun wrote: > I don't know all of the compatibility problems and > constraints (and pressure from important customers) that they faced ... Given some of their more recent (and not-so-recent) decisions, one wonders how much of this “pressure fr

Re: How do I make a game in Python ?

2016-08-06 Thread Terry Reedy
On 8/6/2016 5:51 PM, Cai Gengyang wrote: As in, any recommended websites that helps users create complex games in Python ? For 2D graphics, try pygame among others. For 3D, I don't know what is current. On Sunday, August 7, 2016 at 5:41:25 AM UTC+8, Ian wrote: On Aug 6, 2016 11:57 AM, "C

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 7:36:06 PM UTC-4, Ned Batchelder wrote: > On Saturday, August 6, 2016 at 6:06:27 PM UTC-4, Lawrence D’Oliveiro wrote: > > On Saturday, August 6, 2016 at 12:08:30 PM UTC+12, bream...@gmail.com wrote: > > > A couple or three years old but this is well worth seeing for a

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 6:06:27 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, August 6, 2016 at 12:08:30 PM UTC+12, bream...@gmail.com wrote: > > A couple or three years old but this is well worth seeing for anybody, > > regardless of your Python expertise. http://nedbatchelder.com/tex

Re: Python slang

2016-08-06 Thread Grant Edwards
On 2016-08-06, Michael Torrie wrote: > Sadly it has become an epidemic of late for folks to misuse the > word, "myself." I think it comes from people not wanting to sound > presumptuous when referring to themselves. It drives me crazy to > hear so many people say something like, "this research

Announcing HarfPy

2016-08-06 Thread Lawrence D’Oliveiro
HarfPy is a Python binding for the HarfBuzz typographic shaping library. It is designed to work in conjunction with my Python wrappers for the other major parts of the Linux typography stack: * Qahirah -- my binding for the Cairo

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Lawrence D’Oliveiro
On Saturday, August 6, 2016 at 12:08:30 PM UTC+12, bream...@gmail.com wrote: > A couple or three years old but this is well worth seeing for anybody, > regardless of your Python expertise. http://nedbatchelder.com/text/iter.html A loop like for i in ... : ... if ... cond ... :

Re: How do I make a game in Python ?

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 5:51:40 PM UTC-4, Cai Gengyang wrote: > As in, any recommended websites that helps users create complex games in > Python ? http://inventwithpython.com/ --Ned. -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I make a game in Python ?

2016-08-06 Thread Cai Gengyang
As in, any recommended websites that helps users create complex games in Python ? On Sunday, August 7, 2016 at 5:41:25 AM UTC+8, Ian wrote: > On Aug 6, 2016 11:57 AM, "Cai Gengyang" wrote: > > How do I make a game in Python ? > > > import random > > answer = random.randint(0, 100) > while T

Re: Python slang

2016-08-06 Thread Ian Kelly
On Aug 6, 2016 3:36 PM, "Michael Torrie" wrote: Sadly it has become an epidemic of late for folks to misuse the word, "myself." I think it comes from people not wanting to sound presumptuous when referring to themselves. It drives me crazy to hear so many people say something like, "this resear

Re: How do I make a game in Python ?

2016-08-06 Thread Ian Kelly
On Aug 6, 2016 11:57 AM, "Cai Gengyang" wrote: How do I make a game in Python ? import random answer = random.randint(0, 100) while True: guess = input("What number am I thinking of? ") if int(guess) == answer: print("Correct!") break print("Wrong!") And now you've

Re: Python slang

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 7:33 AM, Michael Torrie wrote: > Sadly it has become an epidemic of late for folks to misuse the word, > "myself." I think it comes from people not wanting to sound > presumptuous when referring to themselves. It drives me crazy to hear > so many people say something like,

Re: Python slang

2016-08-06 Thread Ian Kelly
On Aug 6, 2016 2:10 PM, "Marco Sulla via Python-list" < python-list@python.org> wrote: Yes, I was thinking manly to SQL. That furthermore is NOT a programming language. Why not? It's claimed to be Turing complete. http://beza1e1.tuxen.de/articles/accidentally_turing_complete.html -- https://m

Re: Python slang

2016-08-06 Thread Michael Torrie
On 08/05/2016 07:14 PM, Steven D'Aprano wrote: > In English, we refer to ourselves in the first person as I, me, myself, and > sometimes "self", never as "this". One can say "this one has a hat", for > example, but it sounds weird, like something the Borg would say about a > specific Borg unit. Sa

Re: Python slang

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 5:37 AM, Bernd Nawothnig wrote: >> But SQL's NULL is a cross between C's NULL, IEEE's NaN, Cthulhu, and >> Emrakul. > > SQL NULL has the semantic of "unknown". So if one or both operands of > a comparison (or any other operation) are unknown the result is > unknown too. And

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 03:35, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 11:14 AM, Steven D'Aprano > wrote: >>> I don't ask about `None` instead of `null` because I suppose here it's >>> a matter of disambiguation (null, in many languages, is not equal to >>> null). >> >> Really? Which languages

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 03:14, Steven D'Aprano wrote: > On Sat, 6 Aug 2016 08:00 am, Marco Sulla wrote: >> I'm referring to: >> * `except` instead of `catch` > > Because this isn't a game of "catch the ball". They're called "exceptions", > not "catchions". You *try* something, and if an *exception* ha

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 02:13, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 9:21 AM, Marco Sulla > wrote: >> I want to clarify that when I say "different from the other >> languages", I mean "different from the most used languages", that in >> my mind are C/C++, C#, Java, PHP and Javascript, mainly

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 20:03, Michael Selik wrote: > On Sat, Aug 6, 2016, 10:10 AM Marco Sulla via Python-list > wrote: >> >> On 6 August 2016 at 00:31, Chris Angelico wrote: >> > "map" has many other meanings (most notably the action wherein you >> > call a function on every member of a collection

where is it

2016-08-06 Thread Dave via Python-list
I am trying to associate the .py file extension with idle...where IS idle? Can you make it a bit more difficult to load/use your software please. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python slang

2016-08-06 Thread Bernd Nawothnig
On 2016-08-06, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 11:14 AM, Steven D'Aprano > wrote: >>> I don't ask about `None` instead of `null` because I suppose here it's >>> a matter of disambiguation (null, in many languages, is not equal to >>> null). >> >> Really? Which languages? That's not t

Re: Python slang

2016-08-06 Thread Chris Angelico
On Sun, Aug 7, 2016 at 5:17 AM, Marco Sulla wrote: > > Nope, I was thinking that "map()" should be a method of an iterable. > But this is another topic :) The problem with that is that it has to become a method of _every_ iterable type, which means it becomes part of the protocol of iterables. Mu

Re: Python slang

2016-08-06 Thread Terry Reedy
On 8/6/2016 2:30 AM, Michael Selik wrote: When people ask me why the core classes are lowercased, Int, float, list, dict, etc were once functions that return objects of type 'int', 'float', 'list', 'dict', etc, before they became 'new-style classes', which are not just 'classes'. The lowerc

Re: Python slang

2016-08-06 Thread Michael Selik via Python-list
On Sat, Aug 6, 2016, 10:10 AM Marco Sulla via Python-list < python-list@python.org> wrote: > On 6 August 2016 at 00:31, Chris Angelico wrote: > > On Sat, Aug 6, 2016 at 8:00 AM, Marco Sulla via Python-list > > wrote: > >> * `dict` instead of `map` > > > > "map" has many other meanings (most nota

How do I make a game in Python ?

2016-08-06 Thread Cai Gengyang
How do I make a game in Python ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 00:31, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 8:00 AM, Marco Sulla via Python-list > wrote: > This isn't slang; it's jargon Right. >> * `raise` instead of `throw` > > Quite a few other languages talk about raising exceptions rather than > throwing them. Those would

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-06 Thread Matt Ruffalo
On 2016-08-04 15:45, Random832 wrote: > On Thu, Aug 4, 2016, at 15:22, Malcolm Greene wrote: >> Hi Chris, >> >> Thanks for your suggestions. I would like to capture the specific bad >> codes *before* they get replaced. So if a line of text has 10 bad codes >> (each one raising UnicodeError), I woul

Ned Batchelder: Loop Like A Native

2016-08-06 Thread breamoreboy
A couple or three years old but this is well worth seeing for anybody, regardless of your Python expertise. http://nedbatchelder.com/text/iter.html Kindest regards. Mark Lawrence. -- https://mail.python.org/mailman/listinfo/python-list

Out of line posts (was datetime vs Arrow vs Pendulum vs Delorean vs udatetime)

2016-08-06 Thread Rustom Mody
On Saturday, August 6, 2016 at 5:19:08 PM UTC+5:30, Mario R. Osorio wrote: > ... so you decided to start the post already hijacked by yourself ... > > very clever!! If you see https://mail.python.org/pipermail/python-list/2016-August/thread.html#start you will see that there was only one post th

Re: datetime vs Arrow vs Pendulum vs Delorean vs udatetime

2016-08-06 Thread Mario R. Osorio
... so you decided to start the post already hijacked by yourself ... very clever!! On Friday, August 5, 2016 at 8:19:53 PM UTC-4, bream...@gmail.com wrote: > On Friday, August 5, 2016 at 7:15:37 PM UTC+1, DFS wrote: > > On 8/4/2016 6:41 PM, breamore...@gmail.com wrote: > > > Fascinating stuff h

Re: Python slang

2016-08-06 Thread BartC
On 06/08/2016 04:10, Steven D'Aprano wrote: On Sat, 6 Aug 2016 10:13 am, Chris Angelico wrote: On Sat, Aug 6, 2016 at 9:21 AM, Marco Sulla wrote: I want to clarify that when I say "different from the other languages", I mean "different from the most used languages", that in my mind are C/C++,