Re: New computer, new Python

2022-12-09 Thread dn
It is version 3.11 (64 bit). Have you invested time in the documentation? https://docs.python.org/3/using/windows.html -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Does one have to use curses to read single characters from keyboard?

2022-12-11 Thread dn
amongst other functionality) Quick read tutorial: https://www.thepythoncode.com/article/control-keyboard-python Disclaimer: have had it on my 'radar', but never actually employed. (if you have considered, will be interested to hear conclusions...) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Single line if statement with a continue

2022-12-14 Thread dn
'one-liner'. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Download Not Working

2022-12-16 Thread dn
windows.html (or navigate from there to appropriate advice) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: String to Float, without introducing errors

2022-12-17 Thread dn
ghly-accurate answers to a less-than precise (complete) question, by presuming can ignore the latter. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Single line if statement with a continue

2022-12-17 Thread dn
7;re all adults here"! (also (compulsory interjection) PEP-008 is not a set of rules for all Python code - see PEP-008) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: String to Float, without introducing errors

2022-12-18 Thread dn
e into 'the bottom end', than into new/higher sophistications - even given IT's rate-of-change!) -- -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: NoneType List

2022-12-31 Thread dn
n) there is no output-value, hence b == None. For comparison, try: b = a + [ 4 ] and understand why the answer is different, and thus why the first 'problem' behavior works the way it does... print( 'Happy new year!' ) PS are you aware of the Python-Tutor Discussion Lis

Re: NoneType List

2022-12-31 Thread dn
said, we all started somewhere and are happy to help you to become a valued colleague! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Mailing-Lists (pointer)

2023-01-09 Thread dn
e). How many times have you seen a question about how to use Python for the very first time after installing on Windows? See also the wisdom of enabling comp.lang.python and python-list as 'mirrors', enabling those who prefer one mechanism/client to another, yet maintaining a single 'community'. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Invitation to join AuckPUG's virtual meeting on Testing

2022-03-11 Thread dn
t should enable you to join us. No downloads/plug-ins etc. Further details including access instructions: https://www.meetup.com/NZPUG-Auckland/ or email me (off-list)... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: for convenience

2022-03-21 Thread dn
context) ) Remember that the 'relationship' between the two is established at run-time and at the data/address 'level' - and not at compile-time. Thus "context" points to a memory location, and does not 'stand for' "bpy.context" anywhere other than in y

Re: for convenience

2022-03-22 Thread dn
On 23/03/2022 09.23, Paul St George wrote: > On 21/03/2022 18.04, dn wrote: > >> On 22/03/2022 10.17, Chris Angelico wrote: >>> On Tue, 22 Mar 2022 at 08:13, Paul St George >> <https://mail.python.org/mailman/listinfo/python-list>> wrote: >>>> >

Re: can't use Python in Materialise Mimics

2022-03-26 Thread dn
e. In the Documentation, please find: https://docs.python.org/3/using/windows.html https://docs.python.org/3/faq/windows.html Step 2 (if necessary) will be to seek support under the software's license terms. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to detect an undefined method?

2022-03-27 Thread dn
coverage means that a system is fully tested. ... https://breadcrumbscollector.tech/how-to-use-code-coverage-in-python-with-pytest/ -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to detect an undefined method?

2022-04-02 Thread dn
On 03/04/2022 02.28, anthony.flury wrote: > On 27/03/2022 15:59, dn wrote: > >> What is code coverage? >> In the simplest words, code coverage is a measure of exhaustiveness of a >> test suite. 100% code coverage means that a system is fully tested. > > S

Re: No shortcut Icon on Desktop

2022-04-13 Thread dn
t to do? https://docs.python.org/3/using/windows.html -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: code confusion

2022-04-15 Thread dn
2. is there > another i could write this code using if statement? > thank you It is taking a slice from the list: https://docs.python.org/3/glossary.html#term-slice More explanation: https://docs.python.org/3/tutorial/introduction.html?highlight=slice -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Syntax for attribute initialisation in __init__ methods

2022-04-15 Thread dn
ass does allow init=False. There is an argument which says that all data-attributes should be 'created' inside an __init__() or __post_init__(), rather than 'somewhere', 'later'. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Fast lookup of bulky "table"

2023-01-15 Thread dn via Python-list
- and bearing-in-mind that the demands for response-time may vary by type of query/data-access. So many variables to consider ... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-01-18 Thread dn via Python-list
s on the function-name, and it's parameters. 'I need that file so that I can ...'. Using the IDE-as-a-tool argument (similar to above): if I miss-out, mistype, use the wrong abbreviation, or otherwise fail to identify where fetch_the_file() is located, the IDE will immediately

Re: evaluation question

2023-01-27 Thread dn via Python-list
owerful, and therefore rather dangerous in the risks it presents. Thus, seems a strange/advanced question for a "newbie" to be asking. YMMV! Do you know about the Python REPL? If you open python within a terminal, each of the three expressions/compound-statements listed will work, as d

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
learn a new, replacement, language! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Organizing modules and their code

2023-02-03 Thread dn via Python-list
the "D" of SOLID, ie Dependency Inversion. You may pick-up some ideas or reassurance from "Making a Simple Data Pipeline Part 1: The ETL Pattern" (https://www.codeproject.com/Articles/5324207/Making-a-Simple-Data-Pipeline-Part-1-The-ETL-Patte). Let us know how it turns-out... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Typing Number, PyCharm

2023-02-04 Thread dn via Python-list
t to think de-cluttering is a good idea! Do you know of another way to attack this/more properly? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Typing Number, PyCharm

2023-02-05 Thread dn via Python-list
types are to be accepted? PS no Decimal(s) nor Fraction(s) in my situation, but may be worth adding to a wider discussion... On 06/02/2023 04.03, Weatherby,Gerard wrote: dn, I’m missing something here. Method 5 seems to work fine in PyCharm. I’m interpreting your statement as: from f

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
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'. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
ut prefer to trade that for 'readability'. Perhaps that came from AWS CodeWhisperer which I have since abandoned, or maybe from SonarLint (which I've just checked to discover it is not working properly...) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-02-23 Thread dn via Python-list
nd is typing. The IDE should catch most of the situations where an int would be used as an str, or v-v. Remember though, Python's typing is (a) not part of the language, and (b) probably won't help at run-time. PS are you aware that there is a Python-Tutor list for the use of people learning Python? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
for line continuation anyway.  You could almost think of "\ (newline)" in a multiline string as being like an escape sequence meaning "don't actually put a newline character in the string here", in a similar way to "\n" meaning "put a newline character here" and "\t" meaning "put a tab character here". Book title: "Don't Make Me Think" (thoroughly recommended. Author: Steve Krug) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-02-24 Thread dn via Python-list
u to demand others only directly-address you (and only your questions)? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.10 Fizzbuzz

2023-02-28 Thread dn via Python-list
ngs, that it wouldn't meet the PSF's Code of Conduct? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python list insert iterators

2023-03-03 Thread dn via Python-list
i find it ? dict - where the keys indicate relative position linked-list (https://en.wikipedia.org/wiki/Linked_list) where each value is accompanied by a "pointer" which addresses the next value by-index; and insertion/deletion is possible by exchanging pointers. -- R

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

2023-03-04 Thread dn via Python-list
ou want that in a DO-loop with a FORMAT? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Cutting slices

2023-03-05 Thread dn via Python-list
split() or ... ie there may be no reason to work strictly from left to right - can't really help with this because the information above only shows multiple "." characters, and not how multiple separators might be interpreted. A straight-line approach might be to use maketrans

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
o get-started with the admin-stuff, and build a toy-application live-demo. (what could possibly go wrong!?) NB This will be a hybrid event and RSVPs are requested: https://www.meetup.com/nzpug-auckland/events/291789444/ All welcome! -- Regards, =dn -- https://mail.python.org/mailman/lis

Re: Implementing a plug-in mechanism

2023-03-15 Thread dn via Python-list
96171-plug-in-architecture There is a PyPi library called pluggy (not used it). I've used informal approaches using an ABC as a framework/reminder (see @George's response). -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Friday finking: IDE 'macro expansions'

2023-03-16 Thread dn via Python-list
es employed at pretty-much the NotePad level? Web.Refs: https://www.jetbrains.com/help/pycharm/settings-postfix-completion.html https://www.jetbrains.com/help/pycharm/using-live-templates.html#live_templates_types -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday finking: IDE 'macro expansions'

2023-03-17 Thread dn via Python-list
have quickly defined an identifier without a lot of thought, but later (ie when come to make use of it) realise a better alternative and more descriptive name. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday finking: IDE 'macro expansions'

2023-03-18 Thread dn via Python-list
more recently, which helps reinforce said learning. Yes... (guilty as charged!) Equally, may promulgate old habits and a lower-quality (related to the depth of learning, back-then cf 'now'). -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Standard class for time *period*?

2023-03-28 Thread dn via Python-list
t to open a can-of-worms... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python file location

2023-03-29 Thread dn via Python-list
file called "Allan.py", for example), and from which a suggested-solution may be posted afterwards... YMMV! * New Zealand Open Source Society perq of membership -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-03-31 Thread dn via Python-list
e/choe/courses/20fall/315/lectures/slide23-solid.pdf https://www.hanselminutes.com/145/solid-principles-with-uncle-bob-robert-c-martin https://idioms.thefreedictionary.com/sword+of+Damocles https://en.wikipedia.org/wiki/Damocles -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows Gui Frontend

2023-04-02 Thread dn via Python-list
e with later-maintenance) can one start using one approach, switch to using the other, and then go back to the first? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-04-03 Thread dn via Python-list
.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-...@python.org/message/Q62W2Q6R6XMX57WK2CUGEENHMT3C3REF/ Code of Conduct: http://python.org/psf/codeofconduct/ -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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"

Re: Initialising a Config class

2023-04-11 Thread dn via Python-list
ble into the config class - how to collect environment-data, and satisfying any/all demands for its use. Then, the application can be relieved of all detail ("give me what I want"), only asking for whatever it requires, when it requires, and in the format it requires - tailored and ready for immediate-use... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Dataclasses, immutability(?), and ChatGPT

2023-04-11 Thread dn via Python-list
ob' # raises AttributeError: can't set attribute >>> person.age = 21 # raises AttributeError: can't set attribute - note the erroneous comments about exceptions being raised (they weren't/aren't)! Here's a home-grown version illustrating all the point

Re: Pycharm IDE

2023-04-18 Thread dn via Python-list
^ no extraneous/unbalanced apostrophe here? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
am thinking of a number between 1 to {LIMIT}\n") my version says it expects ' first (to close the fstring) then on a new line below it, it mentions the comma and ) I believe that is just showing you after ' it expects you to end the print with ) as you have or , to add additional arguments to print -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
e list communications and ReplyList - you may need to do that manually... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-04-19 Thread dn via Python-list
elete the close whilst editing. After gaining experience, I have a convention of when to use apostrophes and when double-quotes. These old eyes dislike mixing both in a single expression - but sometimes it is the best course to follow. YMMV! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
ause we didn't have 'all those braces' (and other punctuation-characters) cluttering-up the code??? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-20 Thread dn via Python-list
r first CM 42 93904023389520 {'a': (<__main__.Y object at 0x7f9b6bf2c0d0>,), 'kw': {}} a (<__main__.Y object at 0x7f9b6bf2c0d0>,) 140305507712640 1 <__main__.Y object at 0x7f9b6bf2c0d0> kw {} 140305507621376 Traceback (most recent call last): File "/home

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.pytho

Re: Addition of a .= operator

2023-05-20 Thread dn via Python-list
--- A custom-class wrapper? Even, a decorator-able function? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

OT: Addition of a .= operator

2023-05-23 Thread dn via Python-list
p request. It is then transmogrified, until at the end where it is a query-result/object. Yes, however contrived and deliberately drawn-out the example, there is still a difference between the value which the code first produces (request/input) and that which eventually settles-out (orm/float). Accordingly (perhaps), "user_request" or "user_requested" and "user" or "user_record" (according to the way 'that' ORM operates). Perhaps more psychology rather than coding? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
do not use MS-Windows (which is an assumption - not stated in OP), and thus cannot vouch for the veracity of this advice, nor for its accuracy - caveat emptor! Hope one of those sets of ideas will help... - will be interested to hear how you get on... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Best practice for database connection

2023-05-31 Thread dn via Python-list
e) because the RDBMS-interactions are few-and-far between, or only a small part of the total. I don't use one, but others enthuse about ORMs, eg SQLAlchemy. This suits those who combine RDBMS and OOP, and has its own persistence methodology. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Enum + new in 3.11

2023-06-15 Thread dn via Python-list
some 'expensive' computation if/when it is needed. Similarly, it could use the other values within the enum in order to present some 'combination'. Weirdly (given that enums are considered immutable) I imagine that if the 'extra_member' were to call some external function with varying output, the value could be considered mutable when it is eventually called. Other?better ideas... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
" and "return_value", rather than overloading the latter. That said, apparently the OP use-case is for when there is no interest in status/catch, eg where a 'nothing' answer is THE answer. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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.

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

2023-06-26 Thread dn via Python-list
tion2( intermediate_result_1 ) ... NB it seems long-winded (and my IDE often grumbles about this too!) but I often prefer creating 'intermediate results' rather than writing 'earlier' functions as parameters to 'later' functions. If any thing goes wrong (how could it, after all that testing?) it's easier to answer that famous question: "where is the error?". That said: there are exceptions to every 'rule' - and YMMV! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Hybrid meeting ANN: Using properties and descriptors

2023-07-11 Thread dn via Python-list
dance: online or in-person (Parnell, Auckland). Please RSVP to book-in and receive access information:- - Remote attendance RSVP: https://www.meetup.com/nzpug-auckland/events/njdjssyfckbzb/ - In-person RSVP to https://www.meetup.com/nzpug-auckland/events/294745326/ You are cordially invited to

isinstance()

2023-08-02 Thread dn via Python-list
html?highlight=isinstance#isinstance https://docs.python.org/3/c-api/object.html?highlight=isinstance#c.PyObject_IsInstance https://docs.python.org/3/reference/datamodel.html?highlight=isinstance -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-08-03 Thread dn via Python-list
presents"). Frames (must) exist at the C-level (https://docs.python.org/3/c-api/frame.html?highlight=frame#c.PyFrameObject) of the virtual-machine - where typing is not a 'thing'. It's an interesting question. Perhaps a better mind than mine can give a better answer? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
replacing with its 'corrected version'?) - rather than requiring an extra copy-paste step, per above? (and need for my assumption of where the error is located) Hope you've exerted copyright over the "clairvoyant" description! * JetBrains kindly sponsor our PUG with a monthly door-prize. -- -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-08-08 Thread dn via Python-list
press thanks to, and encourage you to investigate, our sponsors: Catalyst Cloud, New Zealand Open Source Society, JetBrains, and IceHouse Ventures. -- Regards =dn -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Planning a Python / PyData conference

2023-08-08 Thread dn via Python-list
EuroPython and/or PyConUS - and then same for smaller gatherings. (would suggest to ours, but those folk are already over-loaded to be ready in a few weeks' time) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Imports and dot-notation

2023-08-09 Thread dn via Python-list
import identifier, ..." does not save storage-space over "import module" (the whole module is imported regardless, IIRC), however it does form an "interface" and thus recommend leaning into the "Interface Segregation Principle", or as our InfoSec brethren would say 'the principle of least privilege'. Accordingly, prefer "from ... import ... as ...". -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Context manager for database connection

2023-08-23 Thread dn via Python-list
mydb.query( "update table1 set x = 1 where y = 2" ) mydb.query( "update table2 set a = 1 where b = 2" ) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
Learning Django Co-op. RSVP at https://www.meetup.com/nzpug-auckland/events/295727130/ -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-09-07 Thread dn via Python-list
s, and IceHouse Ventures. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-09-18 Thread dn via Python-list
//www.python.org/doc/sunset-python-2/) - were this code to be written using today's libraries, it is unlikely to look anything like this (which may also be contributing to the dearth of replies) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: path to python in venv

2023-09-27 Thread dn via Python-list
it will be interesting to see if in-future, I notice when the project is based upon an older system! FYI https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-reloading-interpreter-paths.html (I'd be surprised if the other major tool-sets don't offer something

Re: type annotation vs working code

2023-09-30 Thread dn via Python-list
eady_initialized' for class 'WorkingSingleton'. but: self.already_initialized:bool passes without comment (see @Mats' response). Question: is it a legal expression (without the typing)? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
Values is 'going'? - this article (https://python-patterns.guide/gang-of-four/singleton/) mentions that the original GoF Singleton Pattern preceded Python (particularly Python 3 classes). Also, that Python doesn't have complications present in C++. It further discusses "several drawbacks", which also champion 'readability' over 'trick' or 'sophistication'. I think you'll enjoy it! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
Principle", "do one thing, and do it well", Law of Demeter, ...) Personal comment: my habit is to break specs into many classes and functions - sometimes more-so than others might prefer. Cannot recall when last had that hard-to-locate bug of unwittingly re-using a name/alias. (apologies: not a boast - a recommendation for going modular) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: return type same as class gives NameError.

2023-10-22 Thread dn via Python-list
-reference" (because class has not yet been fully defined) - see https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html#forward-references -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Too Broad of an exception

2023-10-25 Thread dn via Python-list
ppear that (at least one message) did not make it to email - neither to the list-archive. People wishing to learn are unable to benefit a response, if it is not sent to the list! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-01 Thread dn via Python-list
ge.Message: I just don't know why that particular line isn't working. Will need more context. What is the objective? What is the source/pre-processing of these data-items. (etc) * Left-out .au, (a less important geo-TLD) to wind-up @Chris... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
ation that you'd fix the problem with the sender...). However, ... There are some large businesses doing what you've outlined. They have not solved this problem - and not through lack of trying! * as fast as you make something idiot-proof, the world will show you an 'improved' class of idiot! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
, or (more likely) MailAdmin -> me) * however, this can end-up perpetuating the mistake, rather than correcting... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
bout "closeness". Thus, what you might expect from email servers and Admins, NOT what you should do. That part should be quite evident by now! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Safe package removal

2023-11-05 Thread dn via Python-list
n-installer, or if something, somewhere, will 'break'? (yes, there's an upgrade to Fedora 38 in "The Backlog") -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread dn via Python-list
at does mean? Is there a change from python2 to python3? Works for me (Python 3.11 on Fedora-Linux 37) - both as a script, and simple/single import. What happens when you extract the second dimension's definitions into a module of their own, and import that (with/out less-sophisticated join)

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

2023-11-07 Thread dn via Python-list
NZPUG Auckland Branch): https://www.meetup.com/nzpug-auckland/events/295433874/ -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Newline (NuBe Question)

2023-11-15 Thread dn via Python-list
es all mashed together? Yes, what changed after removal of all the .append()-s, and instead, within the (second) for-loop print( school, name, ... ) was used? Is it easier to go on from there? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2023-11-22 Thread dn via Python-list
ctive advice, suggestions, and alternate approaches will be valued ... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   >