Re: name for new Enum decorator

2021-05-29 Thread hw
On 5/28/21 5:23 AM, Ethan Furman wrote: Greetings! The Flag type in the enum module has had some improvements, but I find it necessary to move one of those improvements into a decorator instead, and I'm having a hard time thinking up a name. What is the behavior?  Well, a name in a flag type

Re: imaplib: is this really so unwieldy?

2021-05-29 Thread hw
On 5/28/21 2:36 AM, boB Stepp wrote: On Thu, May 27, 2021 at 6:22 PM Cameron Simpson wrote: On 27May2021 18:42, hw wrote: So it seems that IMAP support through python is virtually non-existent. This still sureprises me, but I've not tried to use IMAP seriously. I read email locally

Re: imaplib: is this really so unwieldy?

2021-05-27 Thread hw
On 5/25/21 3:55 PM, Grant Edwards wrote: On 2021-05-25, hw wrote: I'm about to do stuff with emails on an IMAP server and wrote a program using imaplib My recollection of using imaplib a few years ago is that yes, it is unweildy, oddly low-level, and rather un-Pythonic (excu

Re: learning python ...

2021-05-27 Thread hw
On 5/25/21 3:09 PM, Greg Ewing wrote: On 25/05/21 5:56 pm, Avi Gross wrote: Var = read in something from a file and make some structure like a data.frame Var = remove some columns from the above thing pointed to by Var Var = make some new calculated columns ditto Var = remove some rows ... Var

Re: learning python ...

2021-05-27 Thread hw
-Original Message- From: Python-list On Behalf Of Cameron Simpson Sent: Monday, May 24, 2021 5:34 AM To: python-list@python.org Subject: Re: learning python ... On 24May2021 08:21, hw wrote: On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May

Re: imaplib: is this really so unwieldy?

2021-05-27 Thread hw
On 5/26/21 12:25 AM, Cameron Simpson wrote: On 25May2021 19:21, hw wrote: On 5/25/21 11:38 AM, Cameron Simpson wrote: On 25May2021 10:23, hw wrote: if status != 'OK': print('Login failed') exit Your "exit" won't do what you want. I expect this

Re: learning python ...

2021-05-26 Thread hw
On 5/25/21 10:32 AM, Chris Angelico wrote: On Tue, May 25, 2021 at 1:00 PM hw wrote: On 5/24/21 3:54 PM, Chris Angelico wrote: You keep using that word "unfinished". I do not think it means what you think it does. What do you think I think it means? I think it means that the l

Re: learning python ...

2021-05-26 Thread hw
On 5/25/21 9:42 AM, Greg Ewing wrote: On 25/05/21 2:59 pm, hw wrote: Then what is 'float' in the case of isinstance() as the second parameter, and why can't python figure out what 'float' refers to in this case? You seem to be asking for names to be interpreted

Re: imaplib: is this really so unwieldy?

2021-05-25 Thread hw
On 5/25/21 11:38 AM, Cameron Simpson wrote: On 25May2021 10:23, hw wrote: I'm about to do stuff with emails on an IMAP server and wrote a program using imaplib which, so far, gets the UIDs of the messages in the inbox: #!/usr/bin/python I'm going to assume you're using Pyt

imaplib: is this really so unwieldy?

2021-05-25 Thread hw
Hi, I'm about to do stuff with emails on an IMAP server and wrote a program using imaplib which, so far, gets the UIDs of the messages in the inbox: #!/usr/bin/python import imaplib import re imapsession = imaplib.IMAP4_SSL('imap.example.com', port = 993) status, data = imapsession.login

Re: learning python ...

2021-05-24 Thread hw
On 5/25/21 12:37 AM, Greg Ewing wrote: On 25/05/21 9:27 am, Cameron Simpson wrote: On 24May2021 16:17, hw wrote: > Or it doesn't forget about the old one and the old one becomes inaccessible (unless you have a reference to it, if there is such a thing in python).  How do you c

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:28 PM, Michael Torrie wrote: On 5/24/21 8:17 AM, hw wrote: What does python actually do in the first example? Does it overshadow a variable or does it change one? If it overshadows a variable, it would be dubious, if it doesn't, it won't be dubious. Are you referri

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:37 PM, Chris Angelico wrote: On Tue, May 25, 2021 at 12:31 AM Michael Torrie wrote: On 5/24/21 8:24 AM, Chris Angelico wrote: On Tue, May 25, 2021 at 12:18 AM hw wrote: There are more alternatives: Python might create a new variable with the same name and forget about the old

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:41 PM, Michael Torrie wrote: On 5/24/21 8:21 AM, Michael Torrie wrote: Given your posts thus far, hw, I don't think Python is a good fit for you. You're better off learning a language that more closely aligns with the statically-typed languages you already know. M

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 3:54 PM, Chris Angelico wrote: On Mon, May 24, 2021 at 11:35 PM hw wrote: On 5/24/21 9:52 AM, Chris Angelico wrote: Does C give you a warning if you create a function-local variable called "printf"? No, and it shouldn't. Does any other language complain if you

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 11:33 AM, Cameron Simpson wrote: On 24May2021 08:21, hw wrote: On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. Shadowing is effectively saying “within this bit of

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 9:52 AM, Chris Angelico wrote: On Mon, May 24, 2021 at 3:25 PM hw wrote: On 5/23/21 10:02 PM, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw mailto:h...@adminart.net>> wrote: On 5/23/21 7:28 PM, Peter Otten wrote: > On 23/05/2021 06:37,

Re: learning python ...

2021-05-23 Thread hw
On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. Shadowing is effectively saying “within this bit of code, (scope) I’m going to use an already-used name for my own value” An example

Re: learning python ...

2021-05-23 Thread hw
PS: On 5/24/21 7:20 AM, hw wrote: There is even no indication from the output from the program before it aborts with an error message that something might be wrong:  For 'type(float)', it prints "" just like it does for int. How is anyone supposed to debug stuff like t

Re: learning python ...

2021-05-23 Thread hw
On 5/23/21 10:02 PM, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw <mailto:h...@adminart.net>> wrote: On 5/23/21 7:28 PM, Peter Otten wrote: > On 23/05/2021 06:37, hw wrote: >> >> Hi, >> >> I'm starting to learn pyth

Re: learning python ...

2021-05-23 Thread hw
On 5/23/21 7:28 PM, Peter Otten wrote: On 23/05/2021 06:37, hw wrote: Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last):    File "[...]/hwo

learning python ...

2021-05-23 Thread hw
Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last): File "[...]/hworld.py", line 18, in print(isinstance(int, float)) TypeError: isinstance() arg 2 must be a type o