Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-08-26 Thread Greg Ewing
On 23/07/20 12:23 pm, dn wrote: You be sure to have a nice day, now! How do you feel about you be sure to have a nice day, now? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-26 Thread Samuel Marks
The main thing I want is type safety. I want Python to complain if the callee uses the wrong argument types, and to provide suggestions on what's needed and info about it. Without a base class I can just have docstrings and type annotations to achieve that. What can I use that will require all im

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread Cameron Simpson
On 26Aug2020 15:09, Chris Green wrote: >2qdxy4rzwzuui...@potatochowder.com wrote: >> Join bytes objects with a byte object: >> >> b"\n".join(popmsg[1]) > >Aaahhh! Thank you (and the other reply). But note: joining bytes like strings is uncommon, and may indicate that you should be working i

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Cameron Simpson
On 26Aug2020 22:10, Marco Sulla wrote: >As title. The reasons that came in my mind are: >1. speed >2. security Various reasons come to mind: - it is overkill for what __hash__ has to do (computational and feature overkill) - requires importing the uuid module (overkill again) - speed - the has

Re: About float/double type number in range.

2020-08-26 Thread Rob Cliffe via Python-list
On 26/08/2020 12:02, Peter J. Holzer wrote: On 2020-08-26 22:40:36 +1200, dn via Python-list wrote: On 26/08/2020 19:58, Joel Goldstick wrote: [...] <<< Code NB Python v3.8 >>> def fp_range( start:float, stop:float, step:float=1.0 )->float: """Generate a range of floating-point number

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Chris Angelico
On Thu, Aug 27, 2020 at 7:52 AM Richard Damon wrote: > > On 8/26/20 5:13 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: > > On 2020-08-26 at 22:10:26 +0200, > > Marco Sulla wrote: > > > >> As title ... > > Assuming that the title appears prominently with the content of your > > email. For the res

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Richard Damon
On 8/26/20 5:13 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: > On 2020-08-26 at 22:10:26 +0200, > Marco Sulla wrote: > >> As title ... > Assuming that the title appears prominently with the content of your > email. For the rest of us: > > Why __hash__() does not return an UUID4? > >> ... The

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread 2QdxY4RzWzUUiLuE
On 2020-08-26 at 22:10:26 +0200, Marco Sulla wrote: > As title ... Assuming that the title appears prominently with the content of your email. For the rest of us: Why __hash__() does not return an UUID4? > ... The reasons that came in my mind are: > > 1. speed > 2. security Correctness?

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Richard Damon
On 8/26/20 4:10 PM, Marco Sulla wrote: > As title. The reasons that came in my mind are: > > 1. speed > 2. security My guess is that the typical use of the value for __hash__() doesn't need that level of guarantee of uniqueness, so requiring it would be unnecessarily expensive. Since the typical

Why __hash__() does not return an UUID4?

2020-08-26 Thread Marco Sulla
As title. The reasons that came in my mind are: 1. speed 2. security -- https://mail.python.org/mailman/listinfo/python-list

Re: Another 2 to 3 mail encoding problem

2020-08-26 Thread Terry Reedy
On 8/26/2020 11:10 AM, Chris Green wrote: I have a simple[ish] local mbox mail delivery module as follows:- ... It has run faultlessly for many years under Python 2. I've now changed the calling program to Python 3 and while it handles most E-Mail OK I have just got the following error:-

Unsubscrip (Re: Another 2 to 3 mail encoding problem)

2020-08-26 Thread Terry Reedy
On 8/26/2020 11:27 AM, Alexa Oña wrote: Don’t send me more emails -- https://mail.python.org/mailman/listinfo/python-list Unsubscribe yourself by going to the indicated url. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: About float/double type number in range.

2020-08-26 Thread Terry Reedy
On 8/26/2020 6:40 AM, dn via Python-list wrote: def fp_range( start:float, stop:float, step:float=1.0 )->float:     """Generate a range of floating-point numbers."""     if stop <= start:     raise OverflowError( "RangeError: start must be less than stop" )     x = start     while x < st

Re: Another 2 to 3 mail encoding problem

2020-08-26 Thread Michael Torrie
On 8/26/20 9:27 AM, Alexa Oña wrote: > Don’t send me more emails > > https://mail.python.org/mailman/listinfo/python-list ^ Please unsubscribe from the mailing list. Click on the link above. Thank you. -- https://mail.python.org/mailman/listinfo/pyth

Re: Another 2 to 3 mail encoding problem

2020-08-26 Thread Peter J. Holzer
On 2020-08-26 16:10:35 +0100, Chris Green wrote: > I'm unearthing a few issues here trying to convert my mail filter and > delivery programs from 2 to 3! > > I have a simple[ish] local mbox mail delivery module as follows:- > [...] > class mymbox(mailbox.mbox): > def _pre_message_ho

Re: Another 2 to 3 mail encoding problem

2020-08-26 Thread Python
Alexa Oña wrote: Don’t send me more emails Obtener Outlook para iOS You are the one spamming the mailing list with unrelated posts. STOP. -- https://mail.python.org/mailman/listinfo/python-list

Re: Another 2 to 3 mail encoding problem

2020-08-26 Thread Chris Green
To add a little to this, the problem is definitely when I receive a message with UTF8 (or at least non-ascci) characters in it. My code is basically very simple, the main program reads an E-Mail message received from .forward on its standard input and makes it into an mbox message as follows:-

Re: Another 2 to 3 mail encoding problem

2020-08-26 Thread Alexa Oña
Don’t send me more emails Obtener Outlook para iOS De: Python-list en nombre de Chris Green Enviado: Wednesday, August 26, 2020 5:10:35 PM Para: python-list@python.org Asunto: Another 2 to 3 mail encoding problem I'm unearthing a few iss

Another 2 to 3 mail encoding problem

2020-08-26 Thread Chris Green
I'm unearthing a few issues here trying to convert my mail filter and delivery programs from 2 to 3! I have a simple[ish] local mbox mail delivery module as follows:- import mailbox import logging import logging.handlers import os import time # # # Class derived

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2020-08-26 at 14:22:10 +0100, > Chris Green wrote: > > > I have the following line in Python 2:- > > > > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing > the lines of the message > > > > ... so I changed it to:- > > > >

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread MRAB
On 2020-08-26 14:22, Chris Green wrote: I have the following line in Python 2:- msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing the lines of the message ... so I changed it to:- s = "\n" msgstr = s.join(popmsg[1]) # popmsg[1] is a list containin

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread D'Arcy Cain
On 2020-08-26 09:22, Chris Green wrote: > I have the following line in Python 2:- > > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list > containing the lines of the message > > ... so I changed it to:- > > s = "\n" > msgstr = s.join(popmsg[1]) # popmsg[1] is a l

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread 2QdxY4RzWzUUiLuE
On 2020-08-26 at 14:22:10 +0100, Chris Green wrote: > I have the following line in Python 2:- > > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list > containing the lines of the message > > ... so I changed it to:- > > s = "\n" > msgstr = s.join(popmsg[1]) # po

How do I do this in Python 3 (string.join())?

2020-08-26 Thread Chris Green
I have the following line in Python 2:- msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing the lines of the message ... so I changed it to:- s = "\n" msgstr = s.join(popmsg[1]) # popmsg[1] is a list containing the lines of the message However this sti

Re: About float/double type number in range.

2020-08-26 Thread Richard Damon
On 8/25/20 10:39 PM, ADITYA wrote: >Dear Sir/Ma’am > >I am requesting you to satisfy me about float number in Range function, >because in the argument of range we can take integer but not double or >float whenever double as well as float are integer in nature but when we >use do

Re: About float/double type number in range.

2020-08-26 Thread Peter J. Holzer
On 2020-08-26 22:40:36 +1200, dn via Python-list wrote: > On 26/08/2020 19:58, Joel Goldstick wrote: > > On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote: > > > Dear Sir/Ma’am > > > > > > I am requesting you to satisfy me about float number in Range > > > function, because in the argument

Re: About float/double type number in range.

2020-08-26 Thread dn via Python-list
On 26/08/2020 19:58, Joel Goldstick wrote: On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote: Dear Sir/Ma’am I am requesting you to satisfy me about float number in Range function, because in the argument of range we can take integer but not double or float whenever double as well

Re: stat_result.st_ino from os.stat isn't constant on a network drive.

2020-08-26 Thread Eryk Sun
On 8/25/20, Andrew Nelson wrote: > > st_ino is supposed to "uniquely identify the file for a given value of > st_dev." That assurance only applies to POSIX systems, not Windows. st_ino is the file ID in Windows. Some filesystems do not support reliable file IDs, if any at all. I would only rely

Re: About float/double type number in range.

2020-08-26 Thread Joel Goldstick
On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote: > >Dear Sir/Ma’am > >I am requesting you to satisfy me about float number in Range function, >because in the argument of range we can take integer but not double or >float whenever double as well as float are integer in nature but when

About float/double type number in range.

2020-08-26 Thread ADITYA
Dear Sir/Ma’am I am requesting you to satisfy me about float number in Range function, because in the argument of range we can take integer but not double or float whenever double as well as float are integer in nature but when we use double/float in, it gives error that- “'float' o

stat_result.st_ino from os.stat isn't constant on a network drive.

2020-08-26 Thread Andrew Nelson
OS: windows 7 Python: 3.8 I am trying to track which files have been modified in a directory on a network mount. When I call the os.stat function for a given file in that directory the stat_result.st_ino changes every time I call it: ``` >>> os.stat('U:\data\current\myfile') os.stat_result(st_mod

Re: Output showing "None" in Terminal

2020-08-26 Thread Terry Reedy
On 8/24/2020 4:41 PM, Calvin Spealman wrote: "None" is the default return value of all functions in Python. But, the interpreter is supposed to suppress it as a displayed result. In batch mode, expressions are not echoed. In interactive move, expression values other than None are echoed. Th

Re: "filterwarnings"

2020-08-26 Thread Peter Otten
Stefan Ram wrote: > I'm not sure I understand "filterwarnings" correctly. > It does not suppress the warning within the "with" statement below. > Outside of the "with" statement, it does work, but according > to sources it also should work within the "with" statement. > > Console transc

Re: Embedded python: How to debug code in an isolated way

2020-08-26 Thread Barry Scott
> On 24 Aug 2020, at 12:52, Eko palypse wrote: > > Thank you very much for your interest in my little problem. > >> When the app calls into python does the event loop of the gui block? > > Yes, the cpp app calls a callback function from the embedded python > interpreter synchronously. > >>