Re: Fast lookup of bulky "table"

2023-01-15 Thread dn via Python-list
On 16/01/2023 08.36, Weatherby,Gerard wrote: I think any peformance improvements would have to come from a language change or better indexing of the data. Exactly! Expanding on @Peter's post: databases (relational or not) are best organised according to use. Some must accept rapid insert/upd

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread dn via Python-list
On 19/01/2023 08.56, Mats Wichmann wrote: On 1/18/23 12:29, Paul Bryan wrote: ... import os as    os import sys as   sys import importlib as importlib A general comment: there are some very common "import ... as" idioms (for example, i

Re: evaluation question

2023-01-27 Thread dn via Python-list
On 28/01/2023 05.37, mutt...@dastardlyhq.com wrote: This is probably a dumb newbie question but I've just started to learn python3 and eval() isn't behaving as I'd expect in that it works for some things and not others. eg: eval("1+1") 2 eval("print(123)") 123 eval("for i in range(1,10): i"

Re: logically Boolean

2023-01-28 Thread dn via Python-list
On 29/01/2023 09.28, Chris Angelico wrote: The REAL boolean is the friends we made along the way? By REAL did you mean float - True or False? (for the FORTRAN-free: https://fortranwiki.org/fortran/show/real) -- -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: evaluation question

2023-01-31 Thread dn via Python-list
On 01/02/2023 11.59, Greg Ewing wrote: On 31/01/23 10:24 pm, mutt...@dastardlyhq.com wrote: All languages have their ugly corners due to initial design mistakes and/or constraints. Eg: java with the special behaviour of its string class, C++ with "=0" pure virtual declaration. But they don't du

Re: Organizing modules and their code

2023-02-03 Thread dn via Python-list
On 04/02/2023 16.24, Thomas Passin wrote: On 2/3/2023 5:14 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: Keep It Simple:  Put all four modules at the top level, and run with it until you falsify it.  Yes, I would give you that same advice no matter what language you're using. In my recent mess

Typing Number, PyCharm

2023-02-04 Thread dn via Python-list
Do we have a typing type-hint for numbers yet? Often wanting to combine int and float, discovered that an application was doing a walk-through with/for uses three numeric types. Was intrigued to note variance, in that the code-set features two different methods for typing, in this situation:

Re: Typing Number, PyCharm

2023-02-05 Thread dn via Python-list
rint(double(Fraction(7, 8))) /# print(double("7")) PyCharm properly complains/ *From: *Python-list on behalf of dn via Python-list *Date: *Saturday, February 4, 2023 at 9:32 PM *To: *'Python' *Subject: *Typing Number, PyCharm *** Attention: This is an external email. Use caution

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 22/02/2023 21.49, Robert Latest via Python-list wrote: I found myself building a complicated logical condition with many ands and ors which I made more manageable by putting the various terms on individual lines and breaking them with the "\" line continuation character. In this context it wou

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 24/02/2023 12.45, Weatherby,Gerard wrote: “ NB my PyCharm-settings grumble whenever I create an identifier which is only used once (and perhaps, soon after it was established). I understand the (space) optimisation, but prefer to trade that for 'readability'. “ I haven’t seen that one. What I

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread dn via Python-list
On 23/02/2023 09.05, Hen Hanna wrote: > py bug.py Traceback (most recent call last): File "C:\Usenet\bug.py", line 5, in print( a + 12 ) TypeError: can only concatenate str (not "int") to str Why doesn't Python (error msg) do t

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread dn via Python-list
On 25/02/2023 08.12, Peter J. Holzer wrote: On 2023-02-24 16:12:10 +1300, dn via Python-list wrote: In some ways, providing this information seems appropriate. Curiously, this does not even occur during an assert exception - despite the value/relationship being the whole point of using the

Re: Line continuation and comments

2023-02-24 Thread dn via Python-list
On 25/02/2023 10.04, Mark Bourne wrote: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line.  I find it makes it more difficult to see where the sco

Re: TypeError: can only concatenate str (not "int") to str

2023-02-24 Thread dn via Python-list
On 25/02/2023 09.36, Hen Hanna wrote: TypeError: can only concatenate str (not "int") to str thanks for the comments, --- esp. 2 or 3 (?) ppl who directly addressed it or commented on it. If you haven't already, please review the Python Software Foundation's Code o

Re: Python 3.10 Fizzbuzz

2023-02-28 Thread dn via Python-list
On 28/02/2023 12.55, Rob Cliffe via Python-list wrote: On 27/02/2023 21:04, Ethan Furman wrote: On 2/27/23 12:20, rbowman wrote: > "By using Black, you agree to cede control over minutiae of hand- > formatting. In return, Black gives you speed, determinism, and freedom > from pycodestyle nagg

Re: Python list insert iterators

2023-03-03 Thread dn via Python-list
On 03/03/2023 21.22, Guenther Sohler wrote: Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i jus

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread dn via Python-list
On 04/03/2023 20.47, Peter J. Holzer wrote: On 2023-03-03 13:51:11 -0500, avi.e.gr...@gmail.com wrote: ... No. Even before Python existed there was the adage "a real programmer can write FORTRAN in any language", indicating that idiomatic usage of a language is not governed by syntax and libra

Re: Cutting slices

2023-03-05 Thread dn via Python-list
On 06/03/2023 11.59, aapost wrote: On 3/5/23 17:43, Stefan Ram wrote:    The following behaviour of Python strikes me as being a bit    "irregular". A user tries to chop of sections from a string,    but does not use "split" because the separator might become    more complicated so that a regula

Re: test

2023-03-07 Thread dn via Python-list
On 08/03/2023 11.48, Jim Byrnes wrote: haven't received anything from the list for quite awhile. Got no response when I tried to contact the administrator. ACK -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

ANN: The long white computing cloud

2023-03-07 Thread dn via Python-list
The long white computing cloud - hybrid meeting, ie both in-person and virtual attendance Wed 15 March, 1800 for 1830 (NZDT) = 0530 UTC 1 Cloud and Proud - Digital Sovereignty in Aotearoa Doug Dixon, CEO of Catalyst Cloud, Aotearoa New Zealand's cloud provider. 2 Python in the cloud How to get-

Re: Implementing a plug-in mechanism

2023-03-15 Thread dn via Python-list
On 16/03/2023 01.47, Loris Bennett wrote: I have written a program which, as part of the non-core functionality, contains a module to generate email. This is currently very specific to my organisation, so the main program contains import myorg.mailer This module is specific to my organisati

Friday finking: IDE 'macro expansions'

2023-03-16 Thread dn via Python-list
It is a long, long, time since I've thrown one of these into the maelstrom of our musings. (have the nightmares receded?) Do you make use of your IDE's expansionist tendencies, and if-so, which ones? NB this is where vi/emacs enthusiasts start chuckling (polite term for 'insane cackling').

Re: Friday finking: IDE 'macro expansions'

2023-03-17 Thread dn via Python-list
On 18/03/2023 02.44, Thomas Passin wrote: On 3/17/2023 9:38 AM, Simon Ward wrote: On Fri, Mar 17, 2023 at 02:05:50PM +0100, Roel Schroeven wrote: Even better than simply highlighting is (IMO) a thing called "Rainbow Braces" or "Bracket Pair Colorization" I recently learned about: both braces o

Re: Friday finking: IDE 'macro expansions'

2023-03-18 Thread dn via Python-list
On 19/03/2023 01.27, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2023-03-18 at 11:49:24 +, "Weatherby,Gerard" wrote: For templating, I have two Python programs for starting new work. One generates a standalone Python program with the Python shebang, a __main__ which calls def main(), and

Re: Standard class for time *period*?

2023-03-28 Thread dn via Python-list
1. Is there a standard class for a 'period', i.e. length of time specified by a start point and an end point? The start and end points could obviously be datetimes and the difference a timedelta, but the period '2022-03-01 00:00 to 2022-03-02 00:00' would be different to '2023-03-01 0

Re: Python file location

2023-03-29 Thread dn via Python-list
On 30/03/2023 09.47, windhorn wrote: I have an older laptop I use for programming, particularly Python and Octave, running a variety of Debian Linux, and I am curious if there is a "standard" place in the file system to store this type of program file. OK, I know they should go in a repository

Re: When is logging.getLogger(__name__) needed?

2023-03-31 Thread dn via Python-list
On 01/04/2023 02.01, Loris Bennett wrote: Hi, In my top level program file, main.py, I have def main_function(): parser = argparse.ArgumentParser(description="my prog") ... args = parser.parse_args() config = configparser.ConfigParser() if args.config_f

Re: Windows Gui Frontend

2023-04-02 Thread dn via Python-list
On 03/04/2023 02.45, Michael Torrie wrote: On 4/2/23 05:09, Dietmar Schwertberger wrote: I also did evaluate all the GUI builder from time to time between 2000 and 2016 to find one that I could recommend to colleagues, but could not find one. Then I started contributing to wxGlade and I can s

Re: [Python-Dev] Small lament...

2023-04-03 Thread dn via Python-list
On 04/04/2023 12.14, Guido van Rossum wrote: A bit late, this reached my inbox: https://peternorvig.medium.com/new-python-operators-9f31b56ddcc7 Did you notice that Peter Norvig's factorial-operator attempts to replace one of the very first diamond-grade provisions of [the] FLUFL? Disgracefu

Re: When is logging.getLogger(__name__) needed?

2023-04-05 Thread dn via Python-list
Thank you for carefully considering suggestions (and implications) - and which will 'work' for you. Further comment below (and with apologies that, unusually for me, there are many personal opinions mixed-in):- On 06/04/2023 01.06, Loris Bennett wrote: "Loris Bennett" writes: dn writes:

Re: Initialising a Config class

2023-04-11 Thread dn via Python-list
On 12/04/2023 02.29, Loris Bennett wrote: Hi, Having solved my problem regarding setting up 'logger' such that it is ... My reading suggests that setting up a module with a Config class which can be imported by any part of the program might be a reasonable approach: ... However, in my conf

Dataclasses, immutability(?), and ChatGPT

2023-04-11 Thread dn via Python-list
Are dataclasses (or instances thereof) mutable or immutable? - and in what sense? Have been experimenting with ChatGPT. In particular: its possibilities as a trainer, good ideas for methods of introducing new topics, its capability for drawing-up demonstrations or examples, its interpretation

Re: Pycharm IDE

2023-04-18 Thread dn via Python-list
On 19/04/2023 11.18, Kevin M. Wilson via Python-list wrote: Greetings... Kevin here:I need help, as you have guessed!I have this line: The Print Statement... Why complain about a 'comma', or a ')'???def play_game(): number = random.randint(1, LIMIT) print (f'"I am thinking of a number

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
Kevin, As mentioned in another response, the format of these messages seems very confused. Please copy-paste all of (the pertinent part of) the code, and ensure that the line-endings are in the correct places, tab/indentation looks correct, etc? (this will allow us to copy the same code into

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
On 19/04/2023 21.13, Kevin M. Wilson wrote: Sorry the code snippet I sent was what is written in PyCharm. LIMIT is defined and is not causing an error! PyCharm is flagging the Parentheses at the end. It is not seeing the Parentheses as the end of the print function. def play_game(): number= ra

Re: PyCharm's strict PEP and not so strict?

2023-04-19 Thread dn via Python-list
On 20/04/2023 04.25, Alan Gauld wrote: On 19/04/2023 10:51, Kevin M. Wilson via Python-list wrote:  I'm in a bit of a quandary, I want some strict syntax errors to be flagged, OK, You might want to use a "linter" in that case because most tools use the interpreter itself to flag syntax errors

Re: PyCharm's strict PEP and not so strict?

2023-04-19 Thread dn via Python-list
there'll be many who are unable to understand your/my aphorisms and allusions. Hence trying to stay with a more 'international English'. "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you wal

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
On 20/04/2023 08.59, Thomas Passin wrote: On 4/19/2023 4:06 PM, Mark Bourne wrote: print(f'{LIMIT}) ^ I think this one should be: print(f'{LIMIT}') with the closing quote ;o) Yup a typo!  Where's pylint when I need it? but (and you designed it this way - right?) an excellent object-less

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-20 Thread dn via Python-list
On 21/04/2023 10.44, Lorenzo Catoni wrote: I am writing to seek your assistance in understanding an unexpected behavior that I encountered while using the __enter__ method. I have provided a code snippet below to illustrate the problem: It is expected behavior - just not what WE might have expe

Re: Disable 'style PEP' messages

2023-05-04 Thread dn via Python-list
On 05/05/2023 04.28, Kevin M. Wilson via Python-list wrote: Hi... How do I set Pycharm to find only syntax errors?!! Please review response to previous message re:configuring PyCharm's helpful features towards to coders and quality-coding... -- Regards, =dn -- https://mail.python.org/mailman

Re: Addition of a .= operator

2023-05-20 Thread dn via Python-list
On 21/05/2023 05.54, Alex Jando wrote: I have many times had situations where I had a variable of a certain type, all I cared about it was one of it's methods. For example: import hashlib hash = hashlib.sha256(b'word') hash = hash.he

OT: Addition of a .= operator

2023-05-23 Thread dn via Python-list
On 24/05/2023 10.21, Rob Cliffe via Python-list wrote: This sort of code might be better as a single expression. For example: user = ( request.GET["user"] .decode("utf-8") .strip() .lower() ) user = orm.user.get(name=user) LOL.  And I thought I was the one with a (self-co

Re: OT: Addition of a .= operator

2023-05-23 Thread dn via Python-list
On 24/05/2023 12.27, Chris Angelico wrote: On Wed, 24 May 2023 at 10:12, dn via Python-list wrote: However, (continuing @Peter's theme) such confuses things when something goes wrong - was the error in the input() or in the float()? - particularly for 'beginners' - and yes, we

Re: complaint

2023-05-30 Thread dn via Python-list
Hi Daniel, On 31/05/2023 02.40, Daniel Ifechukwude Dibie wrote: i tried to uninstall the python 3.11.3 program from my machine so that i can re-install it is showing successful but it is ligerning on the program and features Is that word "lingering". If so, do you mean that Python did not uni

Re: Best practice for database connection

2023-05-31 Thread dn via Python-list
On 01/06/2023 06.45, Thomas Passin wrote: On 5/31/2023 2:10 PM, Jason Friedman wrote: I'm trying to reconcile two best practices which seem to conflict. 1) Use a _with_ clause when connecting to a database so the connection is closed in case of premature exit. class_name = 'oracle.jdbc.OracleD

Enum + new in 3.11

2023-06-15 Thread dn via Python-list
Have you figured-out a use for the @enum.member and @enum.nonmember decorators (new in Python 3.11)? "What's New" says: Added the member() and nonmember() decorators, to ensure the decorated object is/is not converted to an enum member. The PSL docs say: @enum.member A decorator for use

Re: Enum + new in 3.11

2023-06-16 Thread dn via Python-list
On 16/06/2023 23.47, Thomas Passin via Python-list wrote: On 6/16/2023 1:40 AM, dn via Python-list wrote: Have you figured-out a use for the @enum.member and @enum.nonmember decorators (new in Python 3.11)? mypy is having trouble with 3.11 enums: "There are 83 open Enum mypy issues a

Re: Should NoneType be iterable?

2023-06-19 Thread dn via Python-list
On 20/06/2023 06.12, Neal Becker via Python-list wrote: On Mon, Jun 19, 2023 at 12:42 PM Chris Angelico via Python-list < python-list@python.org> wrote: On Tue, 20 Jun 2023 at 02:37, Peter Bona via Python-list wrote: Hi I am wondering if there has been any discussion why NoneType is not i

Re: Python Issue

2023-06-21 Thread dn via Python-list
On 22/06/2023 03.28, Pickle Pork via Python-list wrote: Python is unable to open. Exit Code: 1 This is not good. Please give some useful information: - from where did you download Python? - which operating system? - how do you "open" Python? etc. -- Regards, =dn -- https://mail.python.org/mai

Re: my excel file is not updated to add new data

2023-06-26 Thread dn via Python-list
Marc, Apologies for writing in English (the language of this Discussion List). I have attempted to keep the code in French... Thanks for this question. If it's OK with you, I would like to use it as an example-problem (and 'solution') challenge for some future Python Users' Group meeting (su

Hybrid meeting ANN: Using properties and descriptors

2023-07-11 Thread dn via Python-list
This month's meeting (Wed 19 July, 1800 for 1830 NZST = 0600/0630 UTC) will cover more-advanced OOP Python skills. You will be most-welcome to join us... "Using properties and descriptors" will look at a series of code-examples exploring problems and how these constructs offer solutions. The

isinstance()

2023-08-02 Thread dn via Python-list
Can you please explain why a multi-part second-argument must be a tuple and not any other form of collection-type? The signature is: isinstance(object, classinfo) leading to "classinfo" of: 1/ a single class/type, eg int 2/ a tuple of same, eg ( int, str, ) 3/ a union type, eg int | str (v3.10

Re: How to find the full class name for a frame

2023-08-03 Thread dn via Python-list
On 04/08/2023 15.34, Jason Friedman via Python-list wrote: import inspect def my_example(arg1, arg2): print(inspect.stack()[0][3]) my_frame = inspect.currentframe() args,_,_,values = inspect.getargvalues(my_frame) args_rendered = [f"{x}: {values[x]}" for x in args] print(args_rendered) my_examp

Re: isinstance()

2023-08-04 Thread dn via Python-list
On 03/08/2023 11.38, Jon Ribbens via Python-list wrote: On 2023-08-02, dn wrote: Can you please explain why a multi-part second-argument must be a tuple and not any other form of collection-type? The following comment may hold a clue: if (PyTuple_Check(cls)) { /* Not a general

Re: isinstance()

2023-08-04 Thread dn via Python-list
On 05/08/2023 11.18, Chris Angelico via Python-list wrote: On Sat, 5 Aug 2023 at 09:08, dn via Python-list wrote: On 03/08/2023 11.38, Jon Ribbens via Python-list wrote: On 2023-08-02, dn wrote: Can you please explain why a multi-part second-argument must be a tuple and not any other form

Re: Where is the error?

2023-08-06 Thread dn via Python-list
On 07/08/2023 08.41, Peter J. Holzer via Python-list wrote: Mostly, error messages got a lot better in Python 3.10, but this one had me scratching my head for a few minutes. ... The error message is now a lot better, of course, but the fact that it points at the expression *before* the error

Mtg ANN: Using computer vision AI to help protect the worlds rarest dolphin

2023-08-08 Thread dn via Python-list
Wed 16 Aug 2023, 1800~20:30 NZST (0600~0830 UTC, late-Tue in US) Details and RSVP at https://www.meetup.com/nzpug-auckland/events/295091858/ Teaching a computer to see. How computer vision is helping to protect the world’s rarest dolphin and how you can train your own model. Tane van der Boon

Re: Planning a Python / PyData conference

2023-08-08 Thread dn via Python-list
Hi Wilber, On 09/08/2023 14.28, Wilber H via Python-list wrote: Hi, I would like to plan a Python / PyData conference in the country of the Dominican Republic, and would like your feedback on how to best plan for the conference. Recommend making your request of the folks who organise EuroPyt

Re: Imports and dot-notation

2023-08-09 Thread dn via Python-list
On 09/08/2023 22.30, Oliver Schinagl via Python-list wrote: ...> Looking at a python projects code and repository layout, we see the following directory structure. /project/core /project/components/module1 ... /project/components/moduleN /projects/util ...> Some modules import other modules, an

Re: Context manager for database connection

2023-08-23 Thread dn via Python-list
On 24/08/2023 03.41, Jason Friedman via Python-list wrote: I want to be able to write code like this: with Database() as mydb: conn = mydb.get_connection() cursor = conn.get_cursor() cursor.execute("update table1 set x = 1 where y = 2") cursor.close() cursor = conn.get_cursor() cursor.execute("u

Re: Context manager for database connection

2023-08-23 Thread dn via Python-list
On 24/08/2023 06.11, dn via Python-list wrote: On 24/08/2023 03.41, Jason Friedman via Python-list wrote: with Database() as mydb: conn = mydb.get_connection() cursor = conn.get_cursor() cursor.execute("update table1 set x = 1 where y = 2") cursor.close() cursor = conn.

Co-op Group: Django web framework

2023-08-28 Thread dn via Python-list
Are you interested in learning Django? Would like to improve your Django knowledge and skills? Have you been picking-up Django piecemeal, and need to consolidate and clarify? Do you know some Django and would like to acquire mentoring and coaching skills? If so, please join us to form a L

ANN: Wed 20 Sep: Terminal-based user interfaces (TUIs) with ease using Textual

2023-09-07 Thread dn via Python-list
Rodrigo's back! Fresh from his successes at EuroPython... You are invited to join the next virtual NZPUG Auckland Branch meeting (Wed 20 Sep, 1830~2030 local, ie 0630~0830 UTC) Learn how to build powerful terminal-based user interfaces (TUIs) with ease using Textual - an open-source Python fr

Re: Python Launcher Pops Up When Py-based App Is Running (Mac)

2023-09-18 Thread dn via Python-list
On 17/09/2023 13.20, James Greenham via Python-list wrote: Hello, On the face of it, the Python-Mac mailing list is largely inactive so I'm posting here since it looks like this one is livelier. What happens when doGrab() is called from the REPL, after being 'fed' data you expect is valid?

Re: path to python in venv

2023-09-27 Thread dn via Python-list
On 28/09/2023 09.32, Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: I was under the impression that in a venv the python used would be in the venv's bin dir. But

Re: type annotation vs working code

2023-09-30 Thread dn via Python-list
On 01/10/2023 08.00, Karsten Hilbert via Python-list wrote: A type annotation isn't supposed to change what code does, or so I thought: # class Borg: _instances:dict = {} def __new__(cls, *args, **kargs):

Re: type annotation vs working code

2023-09-30 Thread dn via Python-list
On 01/10/2023 11.25, Karsten Hilbert via Python-list wrote: Am Sun, Oct 01, 2023 at 09:04:05AM +1300 schrieb dn via Python-list: class WorkingSingleton(Borg): def __init__(self): print(self.__class__.__name__, ':')

Re: type annotation vs working code

2023-10-03 Thread dn via Python-list
On 02/10/2023 00.57, Karsten Hilbert via Python-list wrote: Sorry for having conflated the core of the matter with all the Borg shenanigans, that's where I found the problem in my real code, so there :-) The first question when dealing with the Singleton Pattern is what to do when more than on

Re: type annotation vs working code

2023-10-04 Thread dn via Python-list
On 04/10/2023 19.41, Chris Angelico via Python-list wrote: On Wed, 4 Oct 2023 at 15:27, dn via Python-list wrote: - should the class have been called either; class SomethingSingleton(): or a Singleton() class defined, which is then sub-classed, ie class Something( Singleton

Re: Where I do ask for a new feature

2023-10-20 Thread dn via Python-list
On 21/10/2023 01.32, Thomas Passin via Python-list wrote: On 10/19/2023 11:16 PM, Bongo Ferno via Python-list wrote: On Thursday, October 19, 2023 at 11:26:52 PM UTC-3, avi.e...@gmail.com wrote: There are many ways to make transient variables that disappear at some time and do we need yet ano

Re: return type same as class gives NameError.

2023-10-22 Thread dn via Python-list
On 23/10/2023 04.50, Antoon Pardon via Python-list wrote: I have the following small module: =-=-=-=-=-=-=-=-=-=-=-= 8< =-=-=-=-=-=-=-=-=-=-=-=-= from typing import NamedTuple, TypeAlias, Union from collections.abc import Sequence PNT: TypeAlias = tuple[float, float] class Pnt (NamedTuple):

Re: Too Broad of an exception

2023-10-25 Thread dn via Python-list
On 26/10/2023 04.49, rsutton via Python-list wrote: On 10/25/2023 11:06 AM, Stefan Ram wrote: r...@zedat.fu-berlin.de (Stefan Ram) writes: outer quotation marks) prints some prominent exception types. After ...    "Manually removing" above was meant to be a fast first pass,    where I only e

Re: Checking if email is valid

2023-11-01 Thread dn via Python-list
On 02/11/2023 00.35, Simon Connah via Python-list wrote: OK. I've been doing some reading and that you should avoid regex to check email addresses. This operation used to be a BIG THING back in the days of 'everyone' building PHP web-sites. When there were only a handful of TLDs (top-level do

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
On 02/11/2023 19.46, Simon Connah via Python-list wrote: On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list python-list@python.org wrote: Could someone push me in the right direction please? I just want to find out if a string is a valid email address. There is only one way t

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
On 02/11/2023 19.56, Chris Angelico via Python-list wrote: On Thu, 2 Nov 2023 at 17:47, Simon Connah wrote: My goal is to make a simple mailing list platform. I guess I could just send email to an address and if it bounces then I can remove it from the database. Thing is I'm not sure how

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
On 02/11/2023 20.28, Simon Connah wrote: I'm not sure that would be practical. As I'm setting up a mailing list server I don't know if someone in the future is going to need to use one of those aliases and testing manually would be tedious. Please re-read. Discussion is about "closeness". Th

Safe package removal

2023-11-05 Thread dn via Python-list
After thread: "pip/pip3 confusion and keeping up to date" Over the years?centuries, have added various packages, using all of: - distribution-installer (dnf/yum - per apt-get) - su pip install, and - (user) pip install Because Fedora-Linux can be upgraded in-place. an amount of 'crud' hangs-a

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread dn via Python-list
On 08/11/2023 06.47, Egon Frerich via Python-list wrote: I've no idea why this happens. In a module there are lists and definitions: ...     ["%s%s%s " % (i[fCONV_AUSRICHTG], i[fLG2], i[fTYP]) for i in Felder])   File "/home/egon/Entw/Geldspur/geldspur/gui/GUI_Konfig.py", line 90, in    

Clearing the Deque • Picturing Python’s `deque` data structure

2023-11-07 Thread dn via Python-list
You will be welcome to join us at our next (hybrid) meeting: Wednesday, 15 November 2023, 1815~2030 NZDT (0515~0730 UTC). How often do you use a deque*? “Not very” is a common answer. Perhaps you’ve never used it. In this presentation, Stephen won’t try to convince you to use it more often. I

Re: Newline (NuBe Question)

2023-11-15 Thread dn via Python-list
On 15/11/2023 20.25, Grizzy Adams via Python-list wrote: Hi & thanks for patience with what could be simple to you Have this (from an online "classes" tutorial) There are lots of on-line classes! --- Start Code Snippit --- students = [] grades = [] for s in geographyClass: student

NZPUG Mtg: Making Python faster, and "Dependency Inversion"

2023-11-22 Thread dn via Python-list
Virtual meeting: Wednesday 6 December, 1815 for 1830 NZDT/UTC+13 Book at https://www.meetup.com/nzpug-auckland/events/295433876/ 1 Making Python faster - using type hints Tushar will lead us through: A brief history of type hints Using type checkers to verify your type hints Compil

FridayFinking - Was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread dn via Python-list
On 14/01/2021 04.54, Grimble wrote: > On 11/01/2021 20:37, DonK wrote: >> >> Hi, I'm thinking about learning Python but I'm 74 years old and will >> very likely not ever have a programming job again. > At 83, I have no intention of having a programming job again! I last > coded something professi

Re: Application window geometry specifier

2021-01-13 Thread dn via Python-list
On 14/01/2021 15.25, boB Stepp wrote: > On Wed, Jan 13, 2021 at 7:28 PM Chris Angelico wrote: > >> I love how "I think" is allowed to trump decades of usability research. I'm just pleased that @Chris has found love! (not detracting from the point though) > Can you recommend a good reference fo

Friday Finking: Abstract Base Classes - love or hate

2021-01-14 Thread dn via Python-list
Do you make frequent use of Abstract Base Classes (ABCs), prefer to use an ordinary super-class for the same purpose, or steer-clear? Are they more-usually employed when the project includes an extensive design stage, and the meta-class integral to some hierarchy of entities? Previous Friday Fink

Re: why sqrt is not a built-in function?

2021-01-15 Thread dn via Python-list
On 16/01/2021 10.49, Michael F. Stemper wrote: ... > Es ist Feierabend You had me there for a moment, because spotting a 'double meaning" (actually triple) my mind succumbing to dissonance, refused to translate (into English), instead latching onto the last two syllables:- At one time, tech-jar

Re: why sqrt is not a built-in function?

2021-01-15 Thread dn via Python-list
On 15/01/2021 06.44, Denys Contant wrote: > I don't understand why sqrt is not a built-in function. > Why do we have to first import the function from the math module? > I use it ALL THE TIME! > > That felt good. Thank you. Are you 'venting', or do you have a specific frustration-induced questi

Re: why sqrt is not a built-in function?

2021-01-15 Thread dn via Python-list
On 16/01/2021 11.40, Michael F. Stemper wrote: > On 15/01/2021 16.01, Chris Angelico wrote: >> On Sat, Jan 16, 2021 at 8:56 AM Michael F. Stemper >> wrote: >>> >>> On 15/01/2021 15.26, Stefan Ram wrote: "Michael F. Stemper" writes: > On 15/01/2021 14.01, Stefan Ram wrote: > >> __imp

Re: open sentinel-2image python

2021-01-17 Thread dn via Python-list
On 18/01/2021 08.12, omid mohammadi wrote: > On Sunday, January 17, 2021 at 9:31:58 PM UTC+3:30, MRAB wrote: >> On 2021-01-17 13:57, Karsten Hilbert wrote: >>> Am Sun, Jan 17, 2021 at 02:20:24AM -0800 schrieb omid mohammadi: >>> When I open the sentinel-2 image in Python, I get the following

Re: Response for PING in ircbot.

2021-02-03 Thread dn via Python-list
On 04/02/2021 07.07, Dennis Lee Bieber wrote: > On Tue, 02 Feb 2021 20:26:34 -0500, Random832 > declaimed the following: > > >> 1. It looks like you're forgetting to send \n\r > > Isn't the convention \r\n -- from the days of teletype, when the return > took longer to complete than the

Re: Selenium finds object that is interactible but says otherwise

2021-02-06 Thread dn via Python-list
On 07/02/2021 08.21, Philipp Daher via Python-list wrote: > Hello, > > > I recently programmed some code for a webdriver with selenium. > I asked the program to find an input tag, which is interactible, with this: >     > searchbar=driver.find_element_by_class_name("ut-player-search-control--inpu

Re: Python cannot count apparently

2021-02-07 Thread dn via Python-list
On 08/02/2021 09.49, Kevin M. Wilson via Python-list wrote: > Set i = 0 at the begin of the code, that way each entry starts at Logical 0 > of the array/container/list... FYI: https://docs.python.org/3/library/stdtypes.html#typesseq-range See also @Chris' contribution regarding the pythonic idi

Re: Fwd: Inconveniente

2021-02-09 Thread dn via Python-list
On 09/02/2021 15.13, Juan Jose Reyna Figuera wrote: > *Buenas tardes, le escribo breve y puntualmente para reportar este el > siguiente error al cual no le pude dar solución.* > > *Instalé Python 3.9.1 (64 bits), todo había funcionado bien hasta que > necesité usar la librería seaborn. Al ejecutar

Re: installation issues

2021-02-09 Thread dn via Python-list
On 10/02/2021 12.23, Martin Lopez wrote: > Hello, > > My name is Martin Lopez. I just downloaded Python 3.9.1 (64 bit) Setup. > > After I install the program then try to run it, with no success. > > I've uninstalled all previous versions and reinstalled them, but it does > not seem to help. > >

Re: New Python implementation

2021-02-11 Thread dn via Python-list
On 12/02/2021 07.14, Mr Flibble wrote: > On 11/02/2021 18:06, Chris Angelico wrote: >> On Fri, Feb 12, 2021 at 5:01 AM Mr Flibble >> wrote: >>> >>> On 11/02/2021 16:31, Dan Stromberg wrote: On Thu, Feb 11, 2021 at 4:35 AM Mr Flibble wrote: > I am starting work on creating

Re: New Python implementation

2021-02-11 Thread dn via Python-list
On 12/02/2021 08.53, Chris Angelico wrote: > On Fri, Feb 12, 2021 at 6:47 AM dn via Python-list > wrote: >> 3 >> My mind is whirling in an attempt to understand "show me a better time". >> Does this perhaps indicate that @Chris' social life leaves somet

Re: mutating a deque whilst iterating over it

2021-02-11 Thread dn via Python-list
On 12/02/2021 09.22, duncan smith wrote: > Hello, > It seems that I can mutate a deque while iterating over it if I > assign to an index, but not if I append to it. Is this the intended > behaviour? It seems a bit inconsistent. Cheers. Yes, and no! Agree and disagree. (see how decisive I ca

Re: PSYCOPG2

2021-02-13 Thread dn via Python-list
On 13/02/2021 18.34, Mladen Gogala via Python-list wrote: > On Fri, 12 Feb 2021 18:29:48 +, Tony Ogilvie wrote: > >> I am trying to write a program to open a PostgesSQL 13 database using >> psycopg2. All seems to work if I write direct to Python but if I write >> the script into IDLE it does n

Re: Is email.message.get() case insensitive for the header name?

2021-02-15 Thread dn via Python-list
On 15/02/2021 09.50, Chris Green wrote: > It isn't clear from the documentation. Does email.message.get() care > about the case of the header it's getting? > > I checking mailing list mails and the "List-Id:" header is a bit > 'mixed', i.e. it can be List-Id:, or List-ID: or list-id:, will > email

Re: Mr. Flibble

2021-02-15 Thread dn via Python-list
On 16/02/2021 07.09, Ethan Furman wrote: > Thank you to those who pointed out this individual to the moderators. As > Mr. Flibble accurately noted, he is not on the mailing list -- so his > posts won't be here either. Appreciating the work you(s) invest on my/our behalf! -- Regards, =dn -- https

Re: New Python implementation

2021-02-15 Thread dn via Python-list
On 16/02/2021 17.57, Dan Stromberg wrote: > On Mon, Feb 15, 2021 at 8:52 PM Igor Korot wrote: > >> Hi, guys, >> Let me try to throw in another one - PL/1. >> This guys used to be very popular with the accounting community... >> > > Actually PL/I is basically proprietary Pascal - from IBM. My

  1   2   3   4   5   >