Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Grant Edwards wrote: > On 2023-03-09, Cameron Simpson wrote: > >> [...] >>>It finally dawned on me after seeing an example I found elsewhere that >>>you don't call some module method to fetch the next user-entered line. >>> >>&g

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Chris Angelico wrote: > On Fri, 10 Mar 2023 at 10:04, Grant Edwards wrote: > >> Yeesh. What's _really_ embarassing is that I just stumbled across a >> small test program with which I had apparently figured this out >> 10-12 years ago. Must be ab

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-10, Greg Ewing via Python-list wrote: > On 10/03/23 10:08 am, Grant Edwards wrote: >> It finally dawned on me after seeing an example I found elsewhere that >> you don't call some module method to fetch the next user-entered line. >> >> You call the i

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-10, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2023-03-10 at 12:57:48 +1100, > Chris Angelico wrote: > >> On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list >> wrote: >> > >> > On 10/03/23 1:

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
inherit bash-like history-list editing (e.g. Control-P scrolls back to the last command, Control-N forward to the next one, Control-F moves the cursor to the right non-destructively, Control-B moves the cursor to the left non-destructively, etc.). -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
On 2023-03-10, Weatherby,Gerard wrote: > On our Linux systems, I can up-arrow to go back to prior commands > and use the left and right arrows to navigate a line. The > functionality may be provided internally by readline. I’ve never had > to dig into it because it meets my needs out of the box.

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
On 2023-03-10, Cameron Simpson wrote: > On 10Mar2023 09:12, Grant Edwards wrote: >>On 2023-03-10, Weatherby,Gerard wrote: >>> On our Linux systems, I can up-arrow to go back to prior commands >>> and use the left and right arrows to navigate a line. The >&g

Re: Friday finking: IDE 'macro expansions'

2023-03-16 Thread Grant Edwards
On 2023-03-16, Thomas Passin wrote: > In general, I don't like a lot of popups and code completions, so I > tend to avoid them. I don't even like automatic parens or brace > insertion. I _hate_ it when the "editor" decides to insert stuff I didn't type. There's an html editor I use occasionally

Re: What kind of "thread safe" are deque's actually?

2023-03-27 Thread Grant Edwards
on > > I guess this surprised me. When I see “thread safe”, I don’t expect > to get errors. Well, I guess it doesn't say that iteration of a deque is thread safe. It only claims that appends and pops from either end are thread safe. It doesn't even claim that inserts, removes,

Re: Standard class for time *period*?

2023-03-28 Thread Grant Edwards
e obvious representation, but it's six of one and a horse of the same color. If one really needs it to be a class, then it woulnd't be much more than a dozen or two lines of code... -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Standard class for time *period*?

2023-03-28 Thread Grant Edwards
On 2023-03-28, Thomas Passin wrote: > On 3/28/2023 12:13 PM, Grant Edwards wrote: >> On 2023-03-28, Dennis Lee Bieber wrote: >> >>> So far, you seem to be the only person who has ever asked for a >>> single entity incorporating an EPOCH (datetime.datetime) + a

Re: What kind of "thread safe" are deque's actually?

2023-03-29 Thread Grant Edwards
ed). At some point that old, unsorted object will "go away" completely and cease to exist. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Grant Edwards
assume you do "from import *". I think that leads people to believe it's a good practice when, in fact, it's a frequent source of trouble as the OP found out. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows Gui Frontend

2023-04-01 Thread Grant Edwards
apps going. As the apps get larger and more complex, I find it easier to use wxPython or pyGTK (never tried pyQt). However, if you want to package that small app using cxfreeze (or whatever) tk tends to produce pretty large bundles compared to others. -- Grant -- https://mail.python.org/mailman/l

Re: Windows Gui Frontend

2023-04-02 Thread Grant Edwards
ow > sizes. Ah, that's the brilliant thing about VB6 apps! They only work properly on machines with the same resoultion and display/font configuration as the developer. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Dataclasses, immutability(?), and ChatGPT

2023-04-12 Thread Grant Edwards
27;s how ChatGPT works. It's a program to generate output language that sounds right based on a huge training set of text. Whether that "right sounding" language agrees with real world facts or not is irrelevent to the language-generating algorithm. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Weak Type Ability for Python

2023-04-12 Thread Grant Edwards
On 2023-04-12, Ali Mohseni Roodbari wrote: > Hi all, > Please make this command for Python (if possible): > x=1 y='a' wprint (x+y) 1a If that's what you want, use PHP or some other language. Don't try to ruin Python. > In fact make a new type of print command which can print

Re: Weak Type Ability for Python

2023-04-13 Thread Grant Edwards
On 2023-04-13, Cameron Simpson wrote: > On 12Apr2023 22:12, avi.e.gr...@gmail.com wrote: > >>I suspect the OP is thinking of languages like PERL or JAVA which guess >>for you and make such conversions when it seems to make sense. > > JavaScript guesses. What a nightmare. So does PHP. What's rea

Is npyscreen still alive?

2023-04-21 Thread Grant Edwards
I recently googled across the ncurses application framework npyscreen, and was thinking about giving it a try for a small but real project (something that would be distributed to customers), but I'm a bit concerned that npyscreen no longer "alive". The pypi page says the homepage is http://www.npc

Re: Is npyscreen still alive?

2023-04-24 Thread Grant Edwards
requires it to be "installed" or require that users install dependencies via pip/apt/yum/whatever. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Python curses missing form library?

2023-04-24 Thread Grant Edwards
Does the Python curses support in the standard library not include support for the curses form library? It seems to include support for the panel library, but I can't find any mention of the form library. I see in the docs that menu support is still missing. :/ -- Grant --

Re: Is npyscreen still alive?

2023-04-24 Thread Grant Edwards
On 2023-04-24, Grant Edwards wrote: > The other big advantage of an ncurses program is that since curses > support is in the std library, a curses app is simpler to > distribute. Right now, the application is a single .py file you > just copy to the destination machine and run.

Re: Python curses missing form library?

2023-04-24 Thread Grant Edwards
On 2023-04-24, Alan Gauld wrote: > On 24/04/2023 17:26, Grant Edwards wrote: >> Does the Python curses support in the standard library not include >> support for the curses form library? It seems to include support for >> the panel library, but I can't find any mention

Re: Is npyscreen still alive?

2023-04-24 Thread Grant Edwards
On 2023-04-24, Mats Wichmann wrote: > On 4/24/23 10:32, Grant Edwards wrote: > >> However... I just realized that Python's curses support is missing two >> huge chunks: both menu and form support are not there. I guess that >> explains why people feel the need to wri

What to use instead of nntplib?

2023-05-15 Thread Grant Edwards
I got a nice warning today from the inews utility I use daily: DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13 What should I use in place of nntplib? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: What to use instead of nntplib?

2023-05-15 Thread Grant Edwards
On 2023-05-15, Skip Montanaro wrote: >> I got a nice warning today from the inews utility I use daily: >> >> DeprecationWarning: 'nntplib' is deprecated and slated for >> removal in Python 3.13 >> >> What should I use in place of nntplib? > > I'd recommend creating a PyPI project with the

Re: What to use instead of nntplib?

2023-05-16 Thread Grant Edwards
ted out to me that Perl still has a supported NNTP library. That stung. However, it's a CPAN module, which is more equivalent to PyPI than to the standard library, so I guess that it isn't as bad a loss of face as I feared. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: What to use instead of nntplib?

2023-05-16 Thread Grant Edwards
On 2023-05-16, Chris Green wrote: > Grizzy Adams wrote: >> Tuesday, May 16, 2023 at 9:26, Alan Gauld wrote: >> Re: What to use instead of nntplib? (at least in part) >> >> >On 15/05/2023 22:11, Grant Edwards wrote: >> >> I got a nice warnin

Re: Learning tkinter

2023-05-18 Thread Grant Edwards
On 2023-05-12, Rob Cliffe via Python-list wrote: > > Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 > bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import tkinter > >>> tkinter.messagebox > Traceback (most recent cal

Re: Tkinter (related)~

2023-05-18 Thread Grant Edwards
nstall something, I always do a --dry-run first and make a note of any dependancies that pip is going to try to install -- so I can install those using the package manager if possible. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: What to use instead of nntplib?

2023-05-22 Thread Grant Edwards
e now very stable) that lack of "activity" is interpreted as "unpopular" regardless of how many people are using the module. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: What to use instead of nntplib?

2023-05-22 Thread Grant Edwards
t again, because the first time they installed pip for the wrong version of python. [I don't really get how that happens, but there seem to be a constant stream of postings from people with that problem.] -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter docs?

2023-05-23 Thread Grant Edwards
9149564/dp/1999149564/ https://www.amazon.com/Python-GUI-Programming-Tkinter-user-friendly/dp/1801815925/ -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Invalid literal for int() with base 10?

2023-05-25 Thread Grant Edwards
On 2023-05-25, Kevin M. Wilson via Python-list wrote: > Ok, I'm not finding any info. on the int() for converting a str to > an int (that specifies a base parameter)?! Where are you looking? https://docs.python.org/3/library/functions.html#int > The picture is of the code I've written... And

Re: Invalid literal for int() with base 10?

2023-05-26 Thread Grant Edwards
On 2023-05-26, Grant Edwards wrote: > On 2023-05-25, Kevin M. Wilson via Python-list wrote: > >> Ok, I'm not finding any info. on the int() for converting a str to >> an int (that specifies a base parameter)?! > > Where are you looking? > > https://docs.pyth

Re: Tkinter docs?

2023-05-30 Thread Grant Edwards
On 2023-05-26, Rob Cliffe via Python-list wrote: > Grant, I may well buy one of the books you suggested. I haven't had look at either of the newer books, but I got a lot of good out of the Grayson book (20 years ago). I also had a Tcl/Tk book that I found useful even when usng tkin

Re: Resolution of paths in tracebacks

2023-05-31 Thread Grant Edwards
On 2023-05-31, Vishal Chandratreya wrote: > When an exception occurs, the full path to the file from which it > originates is displayed, but redundant elements are not removed. For > instance: > $ ./python ./foo > Traceback (most recent call last): > File "/home/User/cpython/./foo", line 4, in

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Grant Edwards
On 2021-01-12, Chris Angelico wrote: > On Wed, Jan 13, 2021 at 3:18 AM Grant Edwards > wrote: >> >> On 2021-01-12, songbird wrote: >> >> > it can be used for pretty much anything except perhaps >> > high pressure real time things, but i bet someone

Re: Application window geometry specifier

2021-01-12 Thread Grant Edwards
suspect that Slackware will continue with X11. And those X11 users will swear at you if you override their window managers configured window placement. Application code should not care about or try to control window geometry. Period. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Grant Edwards
On 2021-01-12, Chris Angelico wrote: > * Command-line calculator - pressing Ctrl-Alt-P will open up a > terminal with Python, and that's the normal way that I do quick > calculations I do that a lot too. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Grant Edwards
On 2021-01-13, Dennis Lee Bieber wrote: > On Tue, 12 Jan 2021 15:18:05 - (UTC), Grant Edwards > declaimed the following: >>On 2021-01-12, songbird wrote: >> >>> it can be used for pretty much anything except perhaps high >>> pressure real time things, b

Re: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Grant Edwards
changes. Is there a way to span columns/rows in a grid or control which columns grow/shrink? Have I missed something? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-14 Thread Grant Edwards
r I'd just use the > ANSI escape sequences directly. Or use a terminfo library: https://github.com/DirectXMan12/py-terminfo It _may_ be possible to use ncurses to get the terminfo strings required for various functions without actually having ncurses to any I/O, but I've never tried t

Re: Exploring terminfo

2021-01-14 Thread Grant Edwards
On 2021-01-14, Eli the Bearded <*@eli.users.panix.com> wrote: > When I've wanted to do simple things like bold and clear, I've used the > tput(1) tool. You can capture stdout from the tool and use the output > over and over. Typically I've done this in shell scripts: > > #!/bin/sh > bold=$(tput sm

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
"stdout" FILE stream that's declaredin . That stream layer/object has buffering that is invisible to Python. Python's sys.stdout.flush() is flushing the Python file object's output buffers to the standard output file descriptor(fd 2). It is not flushing the the libc

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
On 2021-01-15, Grant Edwards wrote: > I suspect that the problem is that putp is writing to the libc > "stdout" FILE stream that's declaredin . That stream > layer/object has buffering that is invisible to Python. Python's > sys.stdout.flush() is flushing the Pyt

How to flush 's stdout stream?

2021-01-15 Thread Grant Edwards
In Python 3.7+, how does one flush the stdout FILE stream? I mean the FILE *declared as 'stdio' in . I'm _not_ asking how to flush the Python file object sys.stdio. The problem is that some Python modules write to FILE *stdio, but don't flush the stream so that the data gets written to the standar

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
On 2021-01-15, Alan Gauld via Python-list wrote: > On 15/01/2021 17:31, Grant Edwards wrote: > >> I suspect that the problem is that putp is writing to the libc >> "stdout" FILE stream that's declaredin . That stream >> layer/object has buffering that

Re: How to flush 's stdout stream?

2021-01-15 Thread Grant Edwards
On 2021-01-15, Eryk Sun wrote: > On 1/15/21, Grant Edwards wrote: >> In Python 3.7+, how does one flush the stdout FILE stream? I mean the >> FILE *declared as 'stdio' in . I'm _not_ asking how to flush the >> Python file object sys.stdio. > > You can

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
On 2021-01-15, Alan Gauld via Python-list wrote: > On 15/01/2021 17:31, Grant Edwards wrote: > >>>> cur.putp(cls) >>>> name = input("Hello, what's your name? ") >>>> >>>> cur.putp(bold) >>>> print("Nice to mee

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
On 2021-01-15, Grant Edwards wrote: > On 2021-01-15, Alan Gauld via Python-list wrote: >> On 15/01/2021 17:31, Grant Edwards wrote: >> >>> I suspect that the problem is that putp is writing to the libc >>> "stdout" FILE stream that's declaredin .

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
On 2021-01-15, Grant Edwards wrote: > Entities that are parameterized (e.g. goto location) would need to be > passed through curses.tiparm() before they're decoded and printed. I'm > goign to try that next. The curses module doesn't expose tiparm, but you can use tparm

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
On 2021-01-15, Grant Edwards wrote: > On 2021-01-15, Grant Edwards wrote: > >> Entities that are parameterized (e.g. goto location) would need to be >> passed through curses.tiparm() before they're decoded and printed. I'm >> goign to try that next. > >

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
lush the FILE* stream every time you do Python output. Or you have to keep track of which you did last time. It's very ugly. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
On 2021-01-16, Greg Ewing wrote: > On 16/01/21 7:33 am, Grant Edwards wrote: > >> Starting in Python 3., python's stdio file objects are _not_ >> on top of the libc FILE streams: they're directly on top of the file >> descriptor. > > This sounds like rathe

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
n was to call ncurses tputs() function and pass it a 'putchar' callback that passes the output bytes to sys.stdout.buffer.write(). I haven't gotten that working yet (it's going to require some cytyptes magic). -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-15 Thread Grant Edwards
My previous code didn't work if the terminfo entities contained delay specifiers because the delay specifier was left in the output datastream. The case where the terminfo description contains delays, but the delays aren't needed can be handled by simply removing the delay specifiers by wrapping nc

Re: HEKLP

2021-01-16 Thread Grant Edwards
Perhaps once you get your 'K' key fixed it'll work better. -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-17 Thread Grant Edwards
it should be used. > > I'm wondering whether the problem in this particular case stems > from trying to use parts of curses without initialising it > properly. No. > I expect that initialising curses would put stdout into some kind of > unbuffered mode, and the rest of i

Re: Exploring terminfo

2021-01-17 Thread Grant Edwards
On 2021-01-17, Grant Edwards wrote: > On 2021-01-17, Greg Ewing wrote: >> On 17/01/21 12:40 pm, Chris Angelico wrote: >>> This is true. However, at some point, the boundary is crossed from >>> Python into the C library. Something, at that point, knows. It's very &

Re: Exploring terminfo

2021-01-18 Thread Grant Edwards
On 2021-01-18, Random832 wrote: > On Fri, Jan 15, 2021, at 13:36, Alan Gauld via Python-list wrote: >> That could make a big difference, the putp() function specifically >> states that it writes to stdout. > > I think there is a reasonable argument that this is a deficiency of > the curses module.

Re: Exploring terminfo

2021-01-19 Thread Grant Edwards
callback, but I couldn't get it to work (the callback never got called). -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-19 Thread Grant Edwards
s binding, then the user could write a useful putp(), or better yet a function that just does the padding and returns a new bytestring. > I've been using curses (C and python) for nearly 30 years and > this is the first time I've ever used the tiXXX functions, and it > was mainly just out of curiosity rather than real need. Same here. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-19 Thread Grant Edwards
int attr_set(attr_t attrs, short pair, void *opts); > int getch(void); > int addch(const chtype ch); > int printw(const char *fmt, ...); Exactly. _Those_ are curses library calls. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Exploring terminfo

2021-01-19 Thread Grant Edwards
On 2021-01-19, Grant Edwards wrote: >> >> int tgetent(char *bp, const char *name); >> int tgetflag(char *id); >> int tgetnum(char *id); >> char *tgetstr(char *id, char **area); >> char *tgoto(const char *cap, int col, int row); >>

Re: Mailing

2021-01-21 Thread Grant Edwards
lient (slrn) via nntp://news.gmane.io/gmane.comp.python.general -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Grant Edwards
nstrates the problem. > I know hardcore computer scientists would tell me about Python debugger. I've been writing Python for 20+ years. I've never tried a debugger. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Grant Edwards
On 2021-01-27, Cameron Simpson wrote: > Me either. Like grant, i fall into the "look at the stack trace and > think a bit, then put in print() calls or similar to show me whether > things are what I expect them to be when the code runs". > > I actually have a Compu

Re: IDE tools to debug in Python?

2021-01-27 Thread Grant Edwards
My favorite (I'm using now) is VS Code with Python extension, it's very > light. Recently also started background scanning, but that's generally done > in 30 seconds. Same question, what is it scanning? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Grant Edwards
On 2021-01-27, C W wrote: > My main takeaway from the discussion so far is that: you can't troubleshoot > Python without some kind of breakpoint or debugger. How odd. I do it all the time. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: IDE tools to debug in Python?

2021-02-06 Thread Grant Edwards
your Python type). Windows only. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: IDE tools to debug in Python?

2021-02-06 Thread Grant Edwards
On 2021-02-06, Barry wrote: > > >> On 6 Feb 2021, at 08:06, Grant Edwards wrote: >> >> On 2021-02-05, Schachner, Joseph wrote: >> >>> Indeed there are many. One I have not seen listed here yet, that is >>> quite light, starts quickly

Re: Mutable defaults

2021-02-10 Thread Grant Edwards
On 2021-02-11, J. Pic wrote: > I just meant removing the whole "default value mutating" story, not > removing mutable variables. Really, I was wondering if there was a use case > where this actually turns to an advantage, I've seen people show how it can be used to provide function-scope persist

Re: New Python implementation

2021-02-13 Thread Grant Edwards
On 2021-02-14, Ned Batchelder wrote: > On Saturday, February 13, 2021 at 7:19:58 PM UTC-5, Chris Angelico wrote: > >> At the absolute least, show that you have something that can run Python >> code. > > The OP has been making these claims on IRC for a (at least two > years). He has never cared t

Re: Change first occurrence of character x in a string - how?

2021-02-15 Thread Grant Edwards
On 2021-02-14, Mr Flibble wrote: > On 14/02/2021 21:14, Chris Green wrote: >> What's the easiest way to change the first occurrence of a specified >> character in a string? > > By using a grown up (i.e. non-toy) programming language. [gotta love slrn's scoring feature...] -- https://mail.pyth

Re: New Python implementation

2021-02-15 Thread Grant Edwards
On 2021-02-15, Roel Schroeven wrote: > Is it your intention to not only compile procedural and object-oriented > languages, or also functional languages such as Haskell, Ocaml, Scheme? And Prolog! -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Mr. Flibble

2021-02-15 Thread Grant Edwards
e-way traffic. That's new -- it always used to be two-way. When did it change? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-15 Thread Grant Edwards
Smalltalk system. I don't recall if Digitalk Prolog was written entirely in Smalltalk, or if it was just integrated into the Smalltalk system as an opaque object. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-19 Thread Grant Edwards
l, it had all the > theoretical bits by-passed or removed. Back in the 80's we wrote real-time embedded software for cellular telephone radios in Pascal. We even wrote the OS kernel in Pascal. It worked great and was less error-prone than C. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-19 Thread Grant Edwards
t; which was less annoying to use. ITYM Pascal. ;) -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread Grant Edwards
conversions, then I'd avise using the "dumb" method. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread Grant Edwards
On 2021-02-20, Dan Stromberg wrote: > Convert to a str. > Convert to a list of ints, one for each digit > Add 7 mod 10, for each digit in the list I'd probably subtract 3 (mod 10), so as to more obviously match the stated requirement. > Convert to a list of single-character str's > Catenate tho

Re: editor recommendations?

2021-02-26 Thread Grant Edwards
tty much only use emacs for editing text... -- Grant Edwards grant.b.edwardsYow! Hmmm ... a CRIPPLED at ACCOUNTANT with a FALAFEL gmail.comsandwich is HIT by a

Re: Tkinter needed as a legacy version 2.7 imports the module...

2021-02-27 Thread Grant Edwards
on 2.7. That said, MRAB is right that you don't install Tkinter seperately. You 1. Include it when you configure and build python 2. Install a binary Python distribution that aleady includes it. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: weirdness with list()

2021-03-01 Thread Grant Edwards
On 2021-03-01, Greg Ewing wrote: > On 28/02/21 1:17 pm, Cameron Simpson wrote: >> [its length in bytes] is presented via the object's __len__ method, > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. > > You're misusing __len__ here. If an object is iterab

Re: Why assert is not a function?

2021-03-03 Thread Grant Edwards
point of asser being a keyword was so that if you disable asserts then they go away completely: the arguments aren't even evaluated. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Why assert is not a function?

2021-03-04 Thread Grant Edwards
On 2021-03-03, Chris Angelico wrote: > On Thu, Mar 4, 2021 at 1:40 AM Grant Edwards > wrote: > >> I thought the entire point of asser being a keyword was so that if you >> disable asserts then they go away completely: the arguments aren't >> even evaluated. >

Re: Choosable dependency

2021-03-07 Thread Grant Edwards
nt functions/features depending on which one they choose? If you're just using a common subset to provide a fixed set of features regardless, then just use whatever is installed. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Choosable dependency

2021-03-07 Thread Grant Edwards
On 2021-03-07, Manfred Lotz wrote: > On Sat, 6 Mar 2021 15:40:41 - (UTC) > Grant Edwards wrote: > >> On 2021-03-06, Manfred Lotz wrote: >> > Let us say I have a package which reads a TOML file. >> > >> > I want to give the user of my package the ch

Re: Please don't feed the trolls

2021-03-08 Thread Grant Edwards
On 2021-03-08, D'Arcy Cain wrote: > On 2021-03-06 4:24 p.m., Terry Reedy wrote: >> Trolling, among other things, is fishing with a moving line, especially >> with a revolving lure, as from a moving boat.  A troll, among other >> things, is that method or the lure used. > > You are confusing "tro

Re: .title() - annoying mistake

2021-03-19 Thread Grant Edwards
d to what the OP is reporting. Issue 12737 is about Unicode combining marks. The OP's problem is related to the apostrophe used to form a possessive. -- Grant Edwards grant.b.edwardsYow! Civilization is fun!

Re: .title() - annoying mistake

2021-03-19 Thread Grant Edwards
quot; to > become "L'Homme". It's language-dependant. In English, certain words are not capitalized in titles unless they're the first word in the title (short articles and prepositions), and .title() doesn't get that right either: >>> "the man in t

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
ment. It makes specific > assumptions > about a specific use case of one specific language. It doesn't get more > idiotic, frankly. Ah, you've never used PHP then? I haven't checked but it's a fair bit that PHP has 3-4 different built-in ways to do it, and they're

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
you will be calling both .lower() and .title() on individual characters, > but you will probably _never_ be calling .upper(). Does Python have any way to convert a character to titlecase? The documentation for .title() explicitly states that it will convert a character to upper case, not

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
ding to the docs. The doc states that .title() converts the first character characger in each "word" to _upper_ case. Is the doc wrong? If you want titlecase, then you should call str.capitalize() which (again according to the doc) converts the first character to _title_ case (starting in v3.8). -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-22 Thread Grant Edwards
are all digraphs, so is it > correct to say that .title() uppercases the first character? Kind of. I guess it depends on what you mean by "character". In my mind, the first character of string s is s[1], and I would then expect that s.title()[1] == s[1].upper() -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-22 Thread Grant Edwards
On 2021-03-22, Chris Angelico wrote: > On Tue, Mar 23, 2021 at 1:18 AM Grant Edwards > wrote: > >> I guess it depends on what you mean by "character". In my mind, the >> first character of string s is s[1], and I would then expect that >> >> s.title()

Re: python documentation

2021-03-27 Thread Grant Edwards
ges I've used in my career. Though I still somtimes pine for the fixed length integer types that were lost in the py1.5->py2 transition... -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Ann: New Python curses book

2021-03-30 Thread Grant Edwards
e it virtually useless to me). [1] Linux Driver Development for Embedded Processors - Second Edition -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Ann: New Python curses book

2021-03-30 Thread Grant Edwards
it migrates to the other Amazon stores fairly > quickly. It's available in the US: https://www.amazon.com/dp/B091B85B77/ $1.49 kindle $5.99 paperback -- Grant -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >