Re: Proposal: Syntax for attribute initialisation in __init__ methods

2022-04-16 Thread dn
-parameters? This removes the order/sequence of arguments from the list of potential problems/gotchas one can fall into! In which case, I'm wondering just how often the criticism applies 'in real life'? So, now the question becomes: what are the cases/examples which require/desire im

Re: Receive a signal when waking or suspending?

2022-04-23 Thread dn
q=python+battery+status pointed-out several ideas which require MS-Windows, but apparently the psutil library could be bent to your will: https://www.geeksforgeeks.org/python-script-to-shows-laptop-battery-percentage/ Please let us know how you get on... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: tail

2022-04-23 Thread dn
;s I/O, and undemanding of storage-space! Running a few timing trials should reveal the 'sweet spot', at which one algorithm takes-over from the other! NB quite a few of IBM's (extensively researched) algorithms which formed utility program[me]s on mainframes, made similar such algorithmic choices, in the pursuit of efficiencies. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Style for docstring

2022-04-23 Thread dn
e language of a specification should be imperative, ie you will *do* 'this'. A second reason, is that the docstring should document the function, which is subtly-different from describing the return-value (and that has become a task for typing anyway). (OK, the flames are getting-good, and it's time to break-out the marsh-mallows and crumpets...) So, 'nr2' describes what the function DOES! PS would you mind passing-over the fire-extinguisher? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Style for docstring

2022-04-24 Thread dn
s a free lunch" (https://treyhunner.com/2019/04/why-you-shouldnt-inherit-from-list-and-dict-in-python/) Since then, we've been given (and I haven't had a reason to try it, yet) "PEP 589 – TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" which may offer an alternate approach. This comes with the advantage of 'compile-time' static analysis/checking (https://peps.python.org/pep-0589/). When I get around to experimenting with this, I'll be referring to "TypedDict vs dataclasses in Python" (https://dev.to/meeshkan/typeddict-vs-dataclasses-in-python-epic-typing-battle-onb) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: tail

2022-04-24 Thread dn
On 25/04/2022 04.21, pjfarl...@earthlink.net wrote: >> -Original Message- >> From: dn >> Sent: Saturday, April 23, 2022 6:05 PM >> To: python-list@python.org >> Subject: Re: tail >> > >> NB quite a few of IBM's (extensively researched) a

Re: tail

2022-04-25 Thread dn
hat else is going-on in the machine/total-application. (and that's 'probably not much' as far as resource-mix is concerned!) However, I can't speak for the OP, the reason behind the post, and/or his circumstances... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Style for docstring

2022-04-25 Thread dn
iption: >> >> def f(x): >> ''' Return the frobnangle of `x`. >> >> This iterates over the internals of `x` in blah order >> gathering the earliest items which are frobby and composes a >> nangle of the items. >> ''' >> >> I very much like the concise imperative opening sentence, sometimes 2 >> sentences. Then the elaboration if the function isn't trivially obvious. >> >> Cheers, >> Cameron Simpson > -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Question re Executing a Script

2022-04-30 Thread dn
> C:\Users\Brent\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python > 3.10 ) > > > 1. How do I automatically run a python app at Windows startup? > > Thank you! > > Brent Hunter Please start with https://docs.python.org/3/using/windows.html -- Rega

Fwd: Python Question re Executing a Script (dn)

2022-05-02 Thread dn
Perhaps an MS-Win user can help the OP, please? -- Regards, =dn--- Begin Message --- Hello dn, Thanks for your reply. My apologies, I should have provided more background information. I was recently running a Windows 10 machine and I believe it was running Python 3.8. All I did was create a

Re: Python/New/Learn

2022-05-06 Thread dn
er to hear whereas others to read. Sadly, whilst this idea has immediate appeal because a casual introspection will have many readily saying "I'm a ... learner"), the theory has been debunked - both by primary-research and by secondary-researchers critiquing the 'evidence

Re: .0 in name

2022-05-13 Thread dn
This is not what @Avi menat by "silly variable names" but: 3D_position 2nd_floor_area 3M_PostIt_size 3rd_degree_polynomial 360_degree_view 12_hours_later and ??? 2_fast_2_furious -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: EAFP

2022-05-13 Thread dn
lling-routine can decide how to respond to the exception - which many vary according to the specifics of do()'s re-use. However, is it "EAFP"? We had to introduce the exact if-condition which makes it "LBYL"! Perhaps time for me to bow-out, and leave such to the philosophers... Sent from Samsung tablet. There are pills for that... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Changing calling sequence

2022-05-14 Thread dn
function which has the sole task of re-stating the datetime whilst calling the existing three-parameter function. The readability consideration here, is to make a good choice of (new) function-name! * Python version >= 10? Consider using match-case construct keyed on parameter-type -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Changing calling sequence

2022-05-14 Thread dn
On 15/05/2022 11.34, 2qdxy4rzwzuui...@potatochowder.com wrote: > On 2022-05-15 at 10:22:15 +1200, > dn wrote: > >> That said, a function which starts with a list of ifs-buts-and-maybes* >> which are only there to ascertain which set of arguments have been >> prov

Re: bug in python 3.10.4

2022-05-25 Thread dn
(minimal) example code so that we can reproduce the problem and, if necessary, help find a solution... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: bug in python 3.10.4

2022-05-26 Thread dn
you could see the result? On 26/05/2022 15.44, dn wrote: >>When double clicking a .py file when have python install. It run file but >>at a spot of the program it stop running. But using the built-in ide for >>python this problem does not happen also any other ide it

Re: terminate called after throwing an instance of 'boost::python::error_already_set

2022-05-27 Thread dn
nyone have any thoughts on what could cause this > and/or how I can track it down? 1 a change to Python interpreter being used 2 a change to the boost library being used 3 a change to lower levels in 'the s/w stack' or h/w 4 a change to the data being passed-across -- Regards,

Re: terminate called after throwing an instance of 'boost::python::error_already_set

2022-05-27 Thread dn
On 28/05/2022 11.11, Larry Martell wrote: > > > On Fri, May 27, 2022 at 5:51 PM dn <mailto:pythonl...@danceswithmice.info>> wrote: > > On 28/05/2022 08.14, Larry Martell wrote: > > I have a script that has literally been running for 10 years. > >

Re: help, please, with 3.10.4 install

2022-05-29 Thread dn
r 23 2022, > 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32 in CMD prompt > > for the life of me I can't figure out how to launch python?? > > I did click add to path in the install > > thanks Please advise if https://docs.python.org/3/using/windows.html does no

Re: Problems with Python

2022-05-31 Thread dn
nnecessarily-advanced features are described here. No wonder your head is spinning! Which course? How does *it* recommend setting-up the Python environment? Failing that, start PyCharm, open a new project, open a new Python file, type: a = 2 + 2 print( a ) and use the PyCharm command to

Re: min, max with position

2022-06-04 Thread dn
) ...and remembering the special case: if the what value appears more than once in the list, the where?at will report the first/'left-most' index only. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: min, max with position

2022-06-04 Thread dn
work fine: > >>>> min(enumerate(l), key=lambda x: x[1]) > (0, 1.618033) >>>> max(enumerate(l), key=lambda x: x[1]) > (1, 3.141593) An elegant solution! But, but, but which of the above characters is an 'el' and which a 'one'??? (please have pit

Re: How to test characters of a string

2022-06-07 Thread dn
ial. Reading that in its entirety may be a good investment of time! Are you aware of the Python Tutor list? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to test characters of a string

2022-06-07 Thread dn
the PSF Code of Conduct (https://www.python.org/psf/conduct/), eg respect, acknowledgement, grace... Such also encourages (positive) responses when asking future questions... Now that you (@Dave) have revealed yourself as more than a raw-beginner, and to have skills transferable to the Python world, it'll be great to see you 'here', contributing to others' posts... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to test characters of a string

2022-06-07 Thread dn
worth learning for this reason), but are only 'readable' to those who use them frequently. Has either of you performed a timeit comparison? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Need help in blockchain coding.

2022-06-11 Thread dn
**t1 = Time_sensitive_df > t2 = "abcdefghijklmnopqrstuvwxyz" > t3 = normal_df > myblockchain = Blockchain() > myblockchain.create_block_from_transaction(t1) > myblockchain.create_block_from_transaction(t2) > myblockchain.create_block_from_transaction(t3) > myblockchain.display_chain()** -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: fill out bulletins

2022-06-13 Thread dn
illable) but it works badly here: >> >> https://www.guardiacostiera.gov.it/venezia/Documents/Bollettino%20MOD.%20TD123.pdf >> > > Probably best to just call it a "form". pygame might offer a simple way to add text to a 'form' at appropriate x,y co-ordinates. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Call for speakers/guides (virtual Python User Group meetings)

2022-06-16 Thread dn
ether, and/or making the best use of the BBB web-conferencing tool. Please follow-up with Pete and myself - offline from this list. -- Regards =dn, Facilitator and General Factotum to: Pete Mayes, Benevolent Dictator/Leader for life, of: NZPUG - Auckland Branch -- https://mail.python.org/mailman/listinfo/python-list

Re: pycharm issue

2022-06-17 Thread dn
is for Python (cf PyCharm)! However, many of us use PyCharm... What are you typing or clicking-on to start Python/Idle/PyCharm? Which operating system? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: pycharm issue

2022-06-17 Thread dn
.org/3/using/windows.html If it is a matter of choosing which/how to open .py files, that is an MS-Win question. There may be a decision to be made: does clicking on a .py file mean that you wish to edit it (in PyCharm), or do you wish to run the code in the Python interpreter. > *

Re: "CPython"

2022-06-20 Thread dn
you can C that the only important part is the Python! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: "CPython"

2022-06-20 Thread dn
On 21/06/2022 10.02, Chris Angelico wrote: > On Tue, 21 Jun 2022 at 08:01, dn wrote: >> >> On 21/06/2022 09.47, Roel Schroeven wrote: >> ... >> >>> So we have an untrustworthy site that's the only one to claim that >>> CPython is short for C

Re: why this code giving recursion error????

2022-06-26 Thread dn
rsion error? With recursion problems, the first question to ask is: how does this thing stop? Have you built some test-data with only a handful of items, and thus a predictable result. Does that result occur? If not, where are the differences occurring? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: why this code giving recursion error????

2022-06-26 Thread dn
On 26/06/2022 23.00, נתי שטרן wrote: > I FIXED THE CODE  For the benefit of future-readers: how did you go about fixing it? What was wrong? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Include mailing list

2022-07-09 Thread dn
Dear Mxolisi, On 09/07/2022 22.08, Mxolisi Mbandezi wrote: > Dear Python developers > Please,include me in your mailing list. Please follow the instructions, at the link which appears below:- -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

FYI: Kiwi PyCon

2022-07-17 Thread dn
fered to students and others. Professionals and corporations are invited to provide valuable support through the Kiwi tradition of buying two tickets - donating the second to someone more 'flush' with enthusiasm for Python than with cash. More info at kiwipycon.nz. -- Regards

UML, CVS, and Crafting Software: NZPUG Auckland Branch

2022-07-17 Thread dn
nch's 'Coding Evenings' (our second set of monthly meetings) currently complement the above with a 'code along at home' series called 'Crafting Software' led by dn and DJ. It aims to help coders learn some Python, acquire coding techniques, and to reflect-on and ben

Re: script folder is empty

2022-07-17 Thread dn
indows.html?highlight=windows DuckDuckGo's first 'hit' for "How to Install PIP for Python on Windows" is https://www.liquidweb.com/kb/install-pip-windows/ - but please be aware that what comes-with varies according to the source used to obtain the copy of Python, and (perhaps) the version of MS-Win. YMMV! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Information about updating my python notebook

2022-07-23 Thread dn
On 24/07/2022 04.16, nhlanhlah198506 wrote: > Can I update my python account Sent from my Galaxy How did you install Python, and on which OpSys? In what respect to you want to "update"? What do you mean by "notebook" - and "account"? -- Regards, =dn -- https:/

Re: Object in List : how?

2022-07-23 Thread dn
to implement might include such functionality as connecting nodes 10 and 20 with a path/edge, being able to traverse edges, and so-on... Thus, we've covered two categories of class/object: one, a 'data-class' which contains data about a single node; the other a 'collection-class' which contains multiple nodes making-up the graph. A useful distinction and a common related-pair of data-constructs! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Object in List : how?

2022-07-24 Thread dn
Accordingly, if the "b" argument will only ever be a "dummy", there is absolutely no need for it - indeed one could argue that its presence is confusing because it gives the impression than it could assume any value. (see elsewhere in this thread). So, with assumptions and shor

Re: Python code: brief

2022-07-26 Thread dn
e a great help . Which lines of code, specifically? Is it some Python idiom that is problematic, or the code-logic? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread dn
ferent dev.projects; and secondly you will form your own opinions of "best"! (it's not difficult to change distro) PS most of us will qualify for RedHat's Developer program[me] and free copies of software. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread dn
run a different version of Python. Similarly, using a VM... The question is relatively minor. More important to 'get going'! (also mentioned previously: relatively easy to change (Python or distro) 'later'!) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand nested loops

2022-08-05 Thread dn
spaces/tabs ... print( "i is", i ) ... print( indent + "j is", j ) ... print( indent + indent, var ) # add sep="" if pernickety ... Thus, the output matches the code and each complements the other's view of structure! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand nested loops

2022-08-05 Thread dn
tly indented in the OP, could have been written with three different indentations, and thus have three very different effects (cf that they are all to be used, as-is). -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Exclude 'None' from list comprehension of dicts

2022-08-15 Thread dn
empty ones will >>> be processed >>> fast enough. >> When the list of dictionaries is processed, I would have to check each >> element to see if it is empty.  That strikes me as being less efficient >> than filtering out the empty dictionaries in one go, although obv

Re: UTF-8 and latin1

2022-08-17 Thread dn
made long ago. Unfortunately, much of our data was collected long before then - and as we've discovered, the OP is still living in Python 2 times. What about if the path "name" (above) is not in utf-8? eg the OP's Montréal in Latin1, as Montréal.txt or Montréal.rpt -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: install

2022-08-17 Thread dn
the documentation: 4. Using Python on Windows https://docs.python.org/3/using/windows.html and advise if that does not solve the problem. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Mutating an HTML file with BeautifulSoup

2022-08-19 Thread dn
rm. > > I'm inclined to the first option, honestly. The others just seem like > hard work, and I became a programmer so I could be lazy... +1 - but I've noticed that sometimes I have to work quite hard to be this lazy! Am assuming that http -> https is not the only 'change' (if it were, you'd just do that without BS). How many such changes are planned/need checking? Care to list them? -- -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Mutating an HTML file with BeautifulSoup

2022-08-20 Thread dn
On 20/08/2022 12.38, Chris Angelico wrote: > On Sat, 20 Aug 2022 at 10:19, dn wrote: >> On 20/08/2022 09.01, Chris Angelico wrote: >>> On Sat, 20 Aug 2022 at 05:12, Barry wrote: >>>>> On 19 Aug 2022, at 19:33, Chris Angelico wrote: >>>>> >&g

Re: Mutating an HTML file with BeautifulSoup

2022-08-20 Thread dn
On 21/08/2022 13.00, Chris Angelico wrote: > On Sun, 21 Aug 2022 at 09:48, dn wrote: >> On 20/08/2022 12.38, Chris Angelico wrote: >>> On Sat, 20 Aug 2022 at 10:19, dn wrote: >>>> On 20/08/2022 09.01, Chris Angelico wrote: >>>>> On Sat, 20 Aug 2022 a

Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread dn
Traceback (most recent call last): File "", line 1, in NameError: name 'module' is not defined # name module is bound as m, and not available as module >>> import module >>> locals() {'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': , '__spec__': None, '__annotations__': {}, '__builtins__': , 'f': , 'm': , 'module': } >>> module.func >>> module.CONSTANT 1 >>> module # now it is available # also notice how the function (func) now has three 'names'/access-methods but all lead to the same location *** -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make a variable's late binding crosses the module boundary?

2022-08-30 Thread dn
same > things we want to be global. > > Joseph S. > > Teledyne Confidential; Commercially Sensitive Business Data > > -Original Message- > From: Stefan Ram > Sent: Tuesday, August 30, 2022 1:09 AM > To: python-list@python.org > Subject: Re: How t

Re: How to make a variable's late binding crosses the module boundary?

2022-08-31 Thread dn
On 31/08/2022 19.38, Antoon Pardon wrote: > > > Op 30/08/2022 om 23:52 schreef dn: >> The conversation seems to be wandering some way from the OP. Whereas >> both of these answers are clever (and I assume work), the question >> becomes: why would you want to do this? (

Re: Question about learning Python

2022-09-07 Thread dn
gramming AIs, thinking that such tools will replace programmers (one of the aims of the COBOL language back in the 1960s). His short-form description spoke volumes: 'it saves anyone from having to look-up Stack Overflow any more' - a 'blind' cut-and-paste prospect that saves the 'author' from the difficulties of 'learning stuff'; until it is time to, um, learn-stuff - to know why one needs to learn-stuff BEFORE taking from SO/AI. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Virtual PUG-meeting: An applied introduction to Finite State Machines

2022-09-13 Thread dn
re details from https://www.meetup.com/nzpug-auckland/ -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Virtual PUG-meeting: An applied introduction to Finite State Machines

2022-09-13 Thread dn
x27;ll be most welcome! > Kind regards, > Sam Ezeh > > On Tue, 13 Sept 2022 at 22:53, dn <mailto:pythonl...@danceswithmice.info>> wrote: > > An applied introduction to Finite State Machines > 0730 UTC, Wed 21 Sep 2022 > > The basics of Finite State Mac

Re: Python is not working on my desktop

2022-09-19 Thread dn
-Tutor Discussion List which handles beginner and learner conversations. On 19/09/2022 23.43, python 3.0 is not working wrote: >  > >  > >Sent from [1]Mail for Windows -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

NZPUG: Smart Iterator Challenge

2022-09-22 Thread dn
ssions are mine. To avoid OT traffic on-list, please find all details, and file any follow-up questions through the Meetup-site: https://www.meetup.com/nzpug-auckland/ (or email myself directly). Are you up for a challenge? Regards =dn (for Pete and DJ) -- https://mail.python.org/mailman/listinfo/python-list

Re: Implementation of an lru_cache() decorator that ignores the first argument

2022-09-28 Thread dn
+1 @Chris: depending upon how many transactions-between, it seems likely find that the RDBMS will cache sufficiently, as SOP. YMMV, ie there's only one way to find-out! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Changing 'Scripts/*.exe'

2022-10-01 Thread dn
ting a symbolic-link at the old 'programfiler' location which points to the new 'gv' installation. Regret that not using MS-Windows, can't give exact instruction. Please review: Symbolic link: https://www.computerhope.com/jargon/s/symblink.htm Symbolic Links: https://learn.microsoft.com/en-us/windows/win32/fileio/symbolic-links -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Changing 'Scripts/*.exe'

2022-10-03 Thread dn
On 03/10/2022 20.48, Gisle Vanem via Python-list wrote: > dn wrote: > >>> E.g. 'Scripts/pip2.exe' has the path >>> "f:\programfiler\python27\python.exe" hard-coded >>> inside it. >>> >>> Is there a easy way to fix this w/o r

Re: Changing 'Scripts/*.exe'

2022-10-03 Thread dn
curity features such as apparmor which limit the types of usage of files (as well as resisting external threats). Extending this a little further: such philosophy enables Linux users to more-easily install (and run) multiple versions of Python*, Firefox, Chromium, etc, without resorting to contain

From NZPUG: Smart Iterator Challenge

2022-10-06 Thread dn
that said, all errors and omissions are mine. To avoid OT traffic on-list, please find all details, and file any follow-up questions through the Meetup-site: https://www.meetup.com/nzpug-auckland/events/288813698/ (or email myself directly). Are you up for a challenge? Regards =dn (for Pete an

Re: for -- else: what was the motivation?

2022-10-09 Thread dn
ith me to point to useful references. What I do have to-hand, because it has just arrived, is Mariano Anaya's "Clean Code in Python", (also 2e), Packt, 2020* - although I didn't see its previous edition, and have read nothing beyond the Contents(!) to-date; it talks of "Design by Contract", "Defensive Programming", "Separation of Concerns" indicating it may have thinking to offer. * the reviewer was Tarek Ziadé, author of "Expert Python", which is worth reading - as are his other works (in English and in French) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: for -- else: what was the motivation?

2022-10-09 Thread dn
On 10/10/2022 13.47, MRAB wrote: On 2022-10-10 00:40, dn wrote: On Sun, 9 Oct 2022 at 15:39, Axy via Python-list wrote: "shortest block first" Have never heard this advice before. Kind-of rankled with me, as it did for others. Enquiring minds want to know... Played Duck, d

[Meeting] Problem-solving, perspectives, programming, and presentation, 19Oct

2022-10-11 Thread dn
etup.com/nzpug-auckland/events/njdjssydcnbzb/ Regards =dn (Pete and DJ) -- https://mail.python.org/mailman/listinfo/python-list

Re: for -- else: what was the motivation?

2022-10-11 Thread dn
loying the (specific, programming) language to best advantage. At which time, one's JS-knowledge is almost irrelevant, because the task is to convert a design outline or planned-solution, into Python. (idiomatic, pythonic, efficient, readable, ...) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: flattening lists

2022-10-11 Thread dn
ary and then employing the speedy method, or using a (built-in) for-loop at Python-speed with no import-overhead? (results will vary significantly according to len( l ), but do they remain consistently in-favor or one method or the other?) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Help, PyCharm fails to recognize my tab setting...See attached picture of the code.

2022-10-11 Thread dn
ction of the OP (above), any comment on formatting would be a guess. Please copy-paste the entire block of the if-statement and its nested suites... (this list will not pass-along images) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: What to use for finding as many syntax errors as possible.

2022-10-12 Thread dn
7; NB the content displayed in the Problems Tool Window is dynamic. Accordingly, because of the way Python works, if one 'fixes' errors in line-number sequence, closing an error 'higher up' may well cause a(nother) error 'lower down' to disappear - thus reducing the number of spurious errors one is likely to encounter as a limitation of the automated code-evaluation! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: for -- else: what was the motivation?

2022-10-12 Thread dn
On 11/10/2022 02.13, Grant Edwards wrote: On 2022-10-10, Chris Angelico wrote: On Mon, 10 Oct 2022 at 11:52, MRAB wrote: On 2022-10-10 00:40, dn wrote: On Sun, 9 Oct 2022 at 15:39, Axy via Python-list wrote: "shortest block first" Have never heard this advice befor

Re: What might suddenly provoke this poplib error?

2022-10-13 Thread dn
and 'forgotten' to let mere-clients know. (although, if your standard email access continues unabated, this seems less-likely) That said, it never hurts to ask/be in friendly-contact... PS is that really your password? If so, ... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Third round of the Smart Iterator Challenge: September-October 2022

2022-10-20 Thread dn
: Sat 22 Oct Office Hours: 1830*, Wed 26 Oct Concluding: midnight after Sun 30 Oct * all times NZDT (UTC+13) Are you up for a challenge? Regards =dn (for Pete and DJ) -- https://mail.python.org/mailman/listinfo/python-list

Crafting Software (PUG practical meeting)

2022-10-27 Thread dn
e RSVP to be advised of the web-conference URL, and QuickStart Guide. https://www.meetup.com/nzpug-auckland/events/hgxmwsydcpbdb/ -- Regards, =dn Auckland Branch, New Zealand Python Users' Group -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: A typing question

2022-10-29 Thread dn
ine by GLOBALS.foos=Foos() and running mypy still gives the second error. pt9.py:18: error: Incompatible types in assignment (expression has type "Foos", variable has type "None") What is the common practice in these cases? Thank you. -- https://mail.python.org/mailman/list

Re: Fwd: A typing question

2022-10-29 Thread dn
s been designed so that we can implement it a bit at a time, eg only one function amongst many contained by a module - if that's the only code that requires maintenance/update. Best not to create "technical debt" though! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: A typing question

2022-10-30 Thread dn
On 30/10/2022 17.48, Paulo da Silva wrote: Às 02:32 de 30/10/22, dn escreveu: On 30/10/2022 11.59, Paulo da Silva wrote: Solution (below) will not work if the mention of Foos in GLOBALS is a forward-reference. Either move GLOBALS to suit, or surround "Foos" with quotes. This is t

Re: Fwd: A typing question

2022-10-30 Thread dn
* yes, each word sounds about-right, but is totally wrong... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: A typing question

2022-10-30 Thread dn
On 31/10/2022 11.44, Chris Angelico wrote: On Mon, 31 Oct 2022 at 09:39, dn wrote: On 31/10/2022 06.06, Stefan Ram wrote: Paulo da Silva writes: Is there anything to do without loosing my script structure and usual practice? to lose (losing): to stop having something to loose

Re: an oop question

2022-10-30 Thread dn
urning to the OP) Like @Gerard, am confused. There are two types: Pair and Empty. Thereafter the need is to keep them on a stack. The stack is a collection, an aggregate of 'whatever'. Why inherit from/to Stack? (is this a 'Lisp thing'?) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Weired behaviour - The slice of empty string not return an error

2022-10-30 Thread dn
https://docs.python.org/3/reference/datamodel.html?highlight=slicing#the-standard-type-hierarchy for "sequences" and "slice objects" Note that a Python set is "collection" but not a "sequence". Which means that neither indexing nor slicing (per above) will work on a set. We can ask if a particular value appears in a set ("contains") but cannot ask for the n-th element. To be able to index or slice it, a sequence must offer a __getitem__() method - tuple, list, and string do; but set does not. (check for yourself: help( set ) ) https://docs.python.org/3/library/collections.abc.html?highlight=collection -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: A typing question

2022-10-31 Thread dn
On 01/11/2022 01.56, Stefan Ram wrote: dn writes: On 31/10/2022 11.44, Chris Angelico wrote: ... I'm curious to what extent sloppy English correlates with sloppy code. ... When it comes to CVs/resumés (see what I did there?), I must admit that the most egregious of errors in spelli

Re: typing: property/setter and lists?

2022-11-03 Thread dn
, and not "i", or "_"? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Challenge-week 4: Groups of solutions, starts today!

2022-11-03 Thread dn
ou from 'catching up' and gaining full benefit from the exercise). There's some 'template code' which will enable starting from this week. Challenge Schedule: Groups of solutions Starting: Sat 5 Nov Office Hours: 1830*, Wed 9 Nov Concluding: midnight after Sun 13 Nov * al

Re: Fwd: Issues in python 3.11.0 (64-bit) installation

2022-11-03 Thread dn
p me in solving this issue. My operating system is Windows 11. Kindly guide me in this regard. Has the documentation left questions? https://docs.python.org/3/using/windows.html -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: typing: property/setter and lists? [RESOLVED ERRATA]

2022-11-04 Thread dn
owed by: "I'm sorry. A bad transposition of the text." copy-paste for the win! (and to keep others happy to spend their voluntary time helping you - more working-with-the-team thinking to consider - please) -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Argument name should be lowercase

2022-11-11 Thread dn
E_NAME" ] Am not particularly concerned by the IDE raising this as a 'problem' - will quite happily ignore and carry-on; but am curious as to the logic behind the analysis - and why it doesn't come readily to mind. Advice, comments, critique welcome! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Argument name should be lowercase

2022-11-11 Thread dn
Thanks for the thoughts! On 11/11/2022 21.54, dn wrote: PyCharm is warning against using an identifier of all upper-case letters as a function's parameter, saying "Argument name should be lowercase". (weak, code smell) ... PEP-008: makes no mention, and is but a guide any

Re: Persisting functions typed into the shell

2022-11-12 Thread dn
rt from using the product, have no other connection! Similarly, have not looked at such within VS-Codium or other editors/IDEs... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: In code, list.clear doesn't throw error - it's just ignored

2022-11-13 Thread dn
l-routine can be used with any suitably-lengthy sequence as its data-source, and/or selection-criteria function! Accordingly, using the name of a function can be as useful as using the result of a function-call - even if the latter is far more common. -- -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Help Merging Of Separate Python Codes

2022-11-19 Thread dn
, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Passing information between modules

2022-11-19 Thread dn
icular form (an interface!), which must be documented and understood by both the provider and consumer (people and software) - which sounds like the same 'solution' to the 'globals problem'... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 01.03, Stefan Ram wrote: dn writes: In some respects we have the (OP) problem because Python does not have "interfaces" as a formal component of the language. What one can do today is, class my_interface( metaclass=abc.ABCMeta ): "&

Re: Passing information between modules

2022-11-20 Thread dn
eryone who is not at your 'level' has no worth? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 01.29, Stefan Ram wrote: dn writes: A 'standard' solution is to collect all such configuration-data at the start of the application, into an object (or other data-structure) - I usually call it "env" (an instantiation of "Environment"). Ye

Re: NEO6 GPS with Py PICO with micropython

2022-11-29 Thread dn
reducing length of cable, ... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

AuckPUG's last (virtual) Coding Evening for 2022

2022-11-30 Thread dn
ment is available to participants/upon request. Advice and assistance will continue to be available - please email off-list. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   >