Re: Your Regex Brain

2012-03-27 Thread Peter J. Holzer
s* ([\'"]) \s* (?.*?) \s* \g{-2} ) > | (?> (?!\s*[\'"]) \s* (?[^\s>]*) (?=\s|>) ) > ) > ) > (?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) alt \s*= > (?: (?> \s* ([\'"]) \s* (?.*?) \s* \g{-2} ) >

Re: f python?

2012-04-08 Thread Peter J. Holzer
chronous orbit. So we have another contender for the Most Expensive One-byte Mistake? Poul-Henning Kamp nominated the C/Unix guys: http://queue.acm.org/detail.cfm?id=2010365 hp -- _ | Peter J. Holzer| Deprecating human carelessness and |_|_) | Sysadmin WSR | ignorance has

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Peter J. Holzer
ys.stdin.fileno()? I'm not conviced that this is much more portable: A platform where stdin doesn't use file descriptor 0 under the hood might not even use simple integers as file descriptors at all. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textver

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
? Short of putting it into /usr/lib or so, but that would make it hard to use in a pipe. I can see some merit in the idea that filters could print a short help message when reading from a terminal, but creating a second "interactive" version of each filter with a different name seems to

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
utf8dump). I'm sure I've used sort this way, too, though rather rarely. I usually don't type the input but paste it in, but the program can't distinguish that: All it sees is some input from the terminal at stdin. hp -- _ | Peter J. Holzer| Fluch der elektronis

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 13:24, bartc wrote: > On 06/10/2017 14:11, Peter J. Holzer wrote: >> On 2017-10-06 12:38, bartc wrote: >>> On 06/10/2017 12:51, Chris Angelico wrote: >>>> What you REALLY mean is that you can't see the point of an interactive >>>>

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
then read by cc1. In any case, that -E writes to stdout and -S to file is an inconsistency which looks more like a historical accident than a planned feature to me. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt s

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 15:08, Dennis Lee Bieber wrote: > On Fri, 6 Oct 2017 15:06:03 +0200, "Peter J. Holzer" > declaimed the following: > > >>I can see some merit in the idea that filters could print a short help >>message when reading from a terminal, but creating a

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Peter J. Holzer
one of your output files (there have been a few security holes because of this). hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteil

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
good interface for entering 33000 lines of text, even though pasting 33000 lines from the clipboard into xterm works (I vaguely recall that there is or was a size limit, but 33000 shortish lines doesn't seem to be enough to reach it). hp -- _ | Peter J. Holzer| Fluch der elekt

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
n the same packet. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr __/ | http://www.hjp.at/ | zusammen

Python platforms without long long

2017-10-08 Thread Peter J. Holzer
was standardized in C99 (and was a popular extension before that). Python 3.3 was released in 2012 - 13 years later. Were any of the supported platforms of Python3 really still missing this type at that time? hp -- _ | Peter J. Holzer| Fluch der elektronisc

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
On 2017-10-08 12:53, Gregory Ewing wrote: > Peter J. Holzer wrote: >> In any case, that -E writes to stdout and -S to file is an inconsistency >> which looks more like a historical accident than a planned feature to >> me. > > A possible reason is that with -S there is

Re: The "loop and a half"

2017-10-09 Thread Peter J. Holzer
lso use the mouse. They are just restricted to a rectangular grid of characters for display purposes. Not much of a restriction if you want to edit only text. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange

Re: The "loop and a half"

2017-10-09 Thread Peter J. Holzer
So where does the redrawing happen? The machine youre sitting on (let's >>> call it 'A') and send remote commands or retrieving text files? Or the >>> redrawing must be synced on both A and >>> the remote machine? If so, then why so? > > Peter J. Holzer w

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
would result in a 16 bit byte and char (and most likely UTF-16 as the multibyte character representation). > Not only does "byte" not always mean "8 bits", but > "char" isn't always short for "character"... True. A character often occu

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
ould be a bit >> useless! > > Macs used a ROM for at least a decade and probably more. The ROM contained > data such as mouse cursors, toolbox routines, icons, sounds, and a > bootloader. No Mac was capable of writing to their ROMs any more than they > could write to their mou

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
/2 probably used segments because it was originally designed for the 286.) hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
y homogenous. hp [1] Except in a demo: "As you can see, this button is now disabled. Nothing happens when I click on it!" Everbody dives under the table just in time before the espresso machine in the corner explodes. -- _ | Peter J. Holzer| Fluch der elekt

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
the is "not read-only". Obviously the wafer is modified during the etching process and afterwards it contains information it didn't before. Would you say a piece of paper is "read-only" because you can't program it using address and data lines? I can write on it, I ju

Re: Lies in education [was Re: The "loop and a half"]

2017-10-14 Thread Peter J. Holzer
On 2017-10-14 01:05, Steve D'Aprano wrote: > On Sat, 14 Oct 2017 07:15 am, Peter J. Holzer wrote: >> On 2017-10-13 15:11, alister wrote: >>> On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >>>> Steve D'Aprano wrote: >>>>> I w

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-14 Thread Peter J. Holzer
mming language and therefore deemed it safer. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr __/ | ht

Re: An endless loop

2017-10-15 Thread Peter J. Holzer
7;t familiar enough with it to see what it does without running the program: It displays a turtle running through the same (pentagon-shaped) loop over and over again. Yes, that's a very nice visualization of an endless loop. hp -- _ | Peter J. Holzer| Fluch der elek

Re: Compression of random binary data

2017-10-24 Thread Peter J. Holzer
ee. If the distribution is not equal, then the average needs to take the different probabilities into account. Let's assume that (0, 0) has a probability of 90 %, (0, 1) a probability of 10 % and (1, 0) and (1, 1) a probability of 5 % each. Then the average length is 0.9 * 1 bit

Re: Compression of random binary data

2017-10-26 Thread Peter J. Holzer
On 2017-10-24 22:30, Steve D'Aprano wrote: > On Wed, 25 Oct 2017 07:09 am, Peter J. Holzer wrote: > >> On 2017-10-23 04:21, Steve D'Aprano wrote: >>> On Mon, 23 Oct 2017 02:29 pm, Stefan Ram wrote: >>>> >>> If the probability of certain codes

Re: Python noob having a little trouble with strings

2017-10-27 Thread Peter J. Holzer
ly between 2.x and 3.x) and you'll be hopelessly confused if you use 2.6 and your professor's examples are written for 3.5. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | |

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-04 Thread Peter J. Holzer
ame lookup and therefore is faster. What is the > one way to do it?) I'm not worried about performance unless there is clear performance advantage (for real programs, not benchmarks). hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) |

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-27 Thread Peter J. Holzer
gmatical basis? When I use German identifiers (which I generally don't) I do use umlauts. When I need to do some physical computations, I might use greek letters (or maybe not - as a vim user I can type Δt easily enough, but can the colleague using PyCharm on Windows? I have no idea). S

Re: What is wrong with this regex for matching emails?

2017-12-21 Thread Peter J. Holzer
ive mail without an MX record. This is rare, but I have seen it in the wild (although usually not for email addresses for people but for services (e.g. trouble ticket systems). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || beca

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Peter J. Holzer
where you would use goto in C (the rest is probably mostly in micro-optimizations: If you care about the run-time difference between a goto and a subroutine call, you probably shouldn't use Python in the first place). hp -- _ | Peter J. Holzer| we build much bigger, be

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Peter J. Holzer
On 2017-12-30 11:07:56 -0500, Dennis Lee Bieber wrote: > On Sat, 30 Dec 2017 13:46:14 +0100, "Peter J. Holzer" > declaimed the following: > > >I don't think this is correct. Structured programming is much older: > >ALGOL 60 was already a block structured

Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread Peter J. Holzer
as zero > privilege? Because they pay for the server which runs the list. Their server, their rules. If you set up a server which hosts a mailing list, a web forum, or whatever, you get to decide ther rules for your server. hp -- _ | Peter J. Holzer| we build m

Re: 7z archive reader akin to zipfile?

2018-01-06 Thread Peter J. Holzer
hive)? I think it does what you want and it transparently supports several archive types (including zip and 7z). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at |

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Peter J. Holzer
audio-clips as signatures. Thank god he was wrong about that. hp [1] 280 now. -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.a

Re: New to Python and understanding problem

2018-02-03 Thread Peter J. Holzer
, not under /usr/lib/python-3.5/site-packages or /usr/lib/python-3.5/dist-packages (although the latter is on sys.path). Unless you have modified this yourself, please report it to Debian. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: 2.6.7: Does socket.gethostbyaddr truncate?

2018-02-03 Thread Peter J. Holzer
> When I call socket.gethostbyaddr(IP) entry [1] of the result is a list of > > 34 addresses. gethostbyaddr just calls the underlying C library function. It is possibly that this has a limit (either on the number of names or more likely on the packet size). hp -- _ | Pet

Re: auto-correct a speech-to-text output and relate to of the words based on syllables

2018-02-03 Thread Peter J. Holzer
;l" or an "r"? This not as unambiguous as you seem to think. So a speech-to-text program may hear "right" when the speaker was really saying "light". If you have only the output from that program you must determine whether "right" is correct or must be corre

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Groups

2018-02-03 Thread Peter J. Holzer
;t have a spam problem, and it is already (lightly) moderated. The newsgroup does have a spam problem (as well as a few other problems, like gmane mangling message-ids and breaking threads). Google groups is an interface to the newsgroup. There is a bi-directional gateway between them, but th

Re: Where has the practice of sending screen shots as source code come from?

2018-02-05 Thread Peter J. Holzer
te publishes source-code: https://video.golem.de/files/1/9/20542/twitterreplybotpython.pdf?start=0.00 hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-17 Thread Peter J. Holzer
On 2022-04-16 20:35:22 -, Jon Ribbens via Python-list wrote: > On 2022-04-16, Peter J. Holzer wrote: > > On 2022-04-16 14:22:04 -, Jon Ribbens via Python-list wrote: > >> ... although now having looked into the new 'zoneinfo' module slightly, > >&

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-17 Thread Peter J. Holzer
On 2022-04-17 06:08:54 +1000, Chris Angelico wrote: > On Sun, 17 Apr 2022 at 03:37, Peter J. Holzer wrote: > > Datetime arithmetic in the real world is typically not done in seconds, > > but in calendaric units: Hours, days, weeks, months, years, ... > > The problem is that

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-17 Thread Peter J. Holzer
On 2022-04-17 10:15:54 +0200, Peter J. Holzer wrote: > On 2022-04-17 06:08:54 +1000, Chris Angelico wrote: > > On Sun, 17 Apr 2022 at 03:37, Peter J. Holzer wrote: > > > Therefore a new class (provisionally called timedeltacal, because it is > > > calendaric, not a

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-18 Thread Peter J. Holzer
this thread. It doesn't test canonicalization yet (and indeed the prototype implementation is a mess in this regard) and subtracting timedeltacals from datetimes is also still missing. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: tail

2022-04-23 Thread Peter J. Holzer
gt; that I'm not going to end up iterating over it all, I would pay the > memory price. Me, too. Problem with a library function (as Marco proposes) is that you don't know how it will be used. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_

Re: How to have python 2 and 3 both on windows?

2022-04-24 Thread Peter J. Holzer
that question with the information you gave us. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signatur

Re: Why no list as dict key?

2022-04-25 Thread Peter J. Holzer
dicts are a good fit if want to group records by subset of their attributes (think "group by" in SQL) * Objects in general are often though of as units, even if they have composite values and you might want to look up something by that value. hp -- _ | Peter J. Holzer

Re: Python/New/Learn

2022-05-07 Thread Peter J. Holzer
r: Most people are probably even worse at observing the position of their various mouth parts while speaking than at listening, so without feedback from a native speaker (preferably a trained voice coach) they can't really tell whether they are doing it right.

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-17 Thread Peter J. Holzer
ially when neither the search nor the replacement terms are > regular expressions) with simple string operations... > > stripped = "".join(quoted.split("'")) Whether that's easier to understand it very much in the eye of the beholder. hp --

Re: Tkinter module test: widget class not inserted in application frame

2022-06-18 Thread Peter J. Holzer
et is placed. In my case, as > MRAB taught me, the proper syntax is > self,'lname'... There is a comma (U+002C) here ... > self.'fname'... And a dot (U+002E) here. I don't think this is correct. I would also recommend to always add a space after a

Re: Subtract n months from datetime

2022-06-27 Thread Peter J. Holzer
ermail/python-list/2022-April/906045.html (the latter also contains some prototype code). (I apologize for not pursuing that further at the time. I wanted to bolster that case with some real world applications, but I was a bit swamped with Real Work™ and didn't find anything suitable.)

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-27 Thread Peter J. Holzer
WatchedFileHandler (https://docs.python.org/3/library/logging.handlers.html#watchedfilehandler) to automatically detect when a logile has been rotated. Alternatively you can use a central logging service (like syslog) which handles all that stuff. hp -- _ | Peter J. Holze

Re: Why do I see digest replies to posts I never saw in a digest?

2022-07-23 Thread Peter J. Holzer
to the start of the thread (although the one by Barry has neither an In-Reply-To nor a References header so it isn't sorted in at the correct spot). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

Re: mailbox misbehavior with non-ASCII

2022-07-30 Thread Peter J. Holzer
What would be nice if you could get at that content directly. There doesn't seem to be documented method to do that. You can use h._chunks, but as the _ in the name implies, that's implementation detail which might change in future versions (and it's not quite straightf

Re: Parallel(?) programming with python

2022-08-08 Thread Peter J. Holzer
elease the lock while they are busy. hp PS: I also agree with what others have said about the perils of multi-threaded programming. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Cr

Re: Parallel(?) programming with python

2022-08-10 Thread Peter J. Holzer
or maybe even 20 seconds, the producer might not even notice. (This of course depends very much on the details which we know nothing about.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

Re: Problem using cx_Freeze

2022-08-17 Thread Peter J. Holzer
h more convenient to extend/shorten/reorder a list. Otherwise you alway have to remember add or remove a comma in the right place. (Some people (especially SQL programmers for some reason) resorted to put the comma at the start of each line to get around this, which is really ugly.) h

Re: Mutating an HTML file with BeautifulSoup

2022-08-21 Thread Peter J. Holzer
lem can be solved with regular expressions (and given the constraints I think I would prefer that to using Beautiful Soup), but getting the regexps right is not trivial, at least in the general case. It may become a lot easier if you know that certain conventions

Re: Mutating an HTML file with BeautifulSoup

2022-08-22 Thread Peter J. Holzer
On 2022-08-22 00:09:01 -, Jon Ribbens via Python-list wrote: > On 2022-08-21, Peter J. Holzer wrote: > > On 2022-08-20 21:51:41 -, Jon Ribbens via Python-list wrote: > >> result = re.sub( > >> r"""(<\s*a\s+[^>]*href\s*=\s*

Re: Mutating an HTML file with BeautifulSoup

2022-08-22 Thread Peter J. Holzer
tly) then you have to know the the character set. (By parsing I mean only "create a syntax tree". Obviously you have to know the encoding to know whether to display «c3 bc» as «ü» or «Ã¼».) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Mutating an HTML file with BeautifulSoup

2022-08-23 Thread Peter J. Holzer
On 2022-08-22 19:27:28 -, Jon Ribbens via Python-list wrote: > On 2022-08-22, Peter J. Holzer wrote: > > On 2022-08-22 00:45:56 -, Jon Ribbens via Python-list wrote: > >> With the offset though, BeautifulSoup made an arbitrary decision to > >> use ISO-8859

Re: What can I do about this?

2022-08-28 Thread Peter J. Holzer
first thing to do is to create the venv and activate it. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" si

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

2022-08-29 Thread Peter J. Holzer
at this name must be hidden later. But I don't think this is the case. The module is imported but it isn't bound to any name in the current (global) namespace (obviously there must be some variable bound to it, but that's probably a local variable in the importer and it isn't cal

Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
mes of the packages depend on the distribution, it will often be vague unless you happen to use the same distribution as the developer. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles

Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
On 2022-08-29 11:12:17 -0400, gene heskett wrote: > I've not had to deal with venv's before. Can more than one of these > venv things peacefully coexist? Yes. Having multiple venvs is the main reason for their existence. hp -- _ | Peter J. Holzer| Story must

Re: Local variable definition in Python list comprehension

2022-09-01 Thread Peter J. Holzer
robably a bit more complex than `x**2`, but by the time a temporary variable really improves readability it's probably a good time to split that across multiple lines, too.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h..

Re: any author you find very good has written a book on Python?

2022-09-06 Thread Peter J. Holzer
quite ware of authors who write books on lots of different languages. hp [1] Possibly the hand of a carpenter. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative

Re: memoization (original Subject lost because mailer lost the whole thread)

2022-09-20 Thread Peter J. Holzer
tml#functools.lru_cache hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Des

Re: python developer

2022-09-30 Thread Peter J. Holzer
s indeed "Peter J. Holzer", you can be sure that all the messages signed with the same key came from the same person and that they were not modified by somebody else (at least not the signed part). I've been signing all my (private) mails for 25 years or so. hp -- _ | P

Re: python developer

2022-10-01 Thread Peter J. Holzer
[2] Yeah! Anniversary! (Throws confetti, blows a vuvuzela) -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature

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

2022-10-09 Thread Peter J. Holzer
special case first", but ordering the cases in an if/elif/else statement by length seems like ordering books by color: It may be pretty, but it doesn't make them easy to find. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

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

2022-10-09 Thread Peter J. Holzer
;t say anything about its quality. The blog entry about Lezer was interesting, though. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http:/

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

2022-10-09 Thread Peter J. Holzer
_some_more(item) we_are_done(item) which shows visually what the main purpose of the loop (or function or other block) is. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross

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

2022-10-09 Thread Peter J. Holzer
simplified it into a simple generator expression. In fact I would say that I code tends to be shorter after I fixed a bug than before. > So although size may matter, so can sighs. :-) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

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

2022-10-09 Thread Peter J. Holzer
27;s requirement of continuing after an error. It uses just the normal python parser so it has exactly the same limitations. Some of the mentioned tools may do what Antoon wants, though. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

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

2022-10-09 Thread Peter J. Holzer
d got the result back next week. So neither the parser nor you need to be perfect. Just better than one error at a time. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creat

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

2022-10-09 Thread Peter J. Holzer
possible and they are also better equipped to do this. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"

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

2022-10-09 Thread Peter J. Holzer
On 2022-10-09 15:32:13 -0400, Avi Gross wrote: > and of course no pipelines. Since you've now used that term repeatedly: What is a pipeline in Python? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h..

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

2022-10-10 Thread Peter J. Holzer
On 2022-10-10 12:40:44 +1300, dn wrote: > On 10/10/2022 05.56, Peter J. Holzer wrote: > > On 2022-10-09 12:18:09 -0400, Avi Gross wrote: > > > Some would argue for a rule related to efficiency of execution. When you > > > have multiple blocks as in an if-else or c

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

2022-10-10 Thread Peter J. Holzer
hought you might be referring to that. I've just never seen the term "pipeline" for that construct (I think "method chaining" is reasonably common). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | |

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

2022-10-10 Thread Peter J. Holzer
t you can usually get away with recompiling only a small part, so you don't have to wait that long during normal development. That cobol compiler couldn't do that. [2] "Recently" means "in the last 10 years or so". -- _ | Peter J. Ho

Re: Find the path of a shell command

2022-10-12 Thread Peter J. Holzer
what the actual environment is. A simple * * * * * nobody echo $PATH >> /tmp/path.$$ should do that. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing

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

2022-10-12 Thread Peter J. Holzer
cost. From the Web: Ah yes. Your infamous aversion against useful citations strikes again. For those too lazy to use a search engine, the excerpt seems to be from https://softwarebyscience.com/very-short-functions-are-a-code-smell-an-overview-of-the-science-on-function-length/ hp -- _

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

2022-10-12 Thread Peter J. Holzer
> > as taking a test: do easy and quick things first and boring and > > difficult ones later. > > Yes, but in that case you have a very long indented "else" block, If you return you don't have to indent the rest. hp -- _ | Peter J. Holzer

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

2022-10-12 Thread Peter J. Holzer
h a much simpler grammar. I very much doubt that. Python doesn't have a particularly complicated grammar, and C certainly doesn't have a particularly simple one. The argument that it's impossible in Python (unlike any other language), because Python is oh so special doesn't hold

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

2022-10-12 Thread Peter J. Holzer
On 2022-10-13 11:23:40 +1100, Chris Angelico wrote: > On Thu, 13 Oct 2022 at 11:19, Peter J. Holzer wrote: > > On 2022-10-11 09:47:52 +1100, Chris Angelico wrote: > > > On Tue, 11 Oct 2022 at 09:18, Cameron Simpson wrote: > > > > > > > Consider: > > &

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

2022-10-12 Thread Peter J. Holzer
o recover from errors. So since every sequence of bytes results in a well-defined DOM tree you might argue (a bit tongue in cheek) that there are no syntax errors in HTML5. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h.

Re: What might suddenly provoke this poplib error?

2022-10-13 Thread Peter J. Holzer
P server. > if so there's not much I can do about it as it's my hosting provider's > mail server. You can call you hosting provider and ask them to fix the problem. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: What might suddenly provoke this poplib error?

2022-10-14 Thread Peter J. Holzer
olute assertions like this with a grain of salt. There are always misleading error messages, weird edge cases, etc. But consider those only after ruling out everything else. [2] What may be obvious to one person is of course not necessarily obvious to another. -- _ | Peter J. Holz

Re: Find the path of a shell command

2022-10-14 Thread Peter J. Holzer
most reliable) way to find out the environment a cronjob has is to write a cronjob which just dumps the environment. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creat

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

2022-10-16 Thread Peter J. Holzer
p further and dissociate the program from its linear text representation? Add footnotes, different views, hyperlinks, format mathematical expressions like formulas, etc. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp

Re: Find the path of a shell command [POSTPONED]

2022-10-16 Thread Peter J. Holzer
own long before systemd. Anyway he doesn't have to restart cron to add a cron-job (nor for any other reason during normal operation), so what happens if you manually restart cron is almost certainly irrelevant for the OP. hp -- _ | Peter J. Holzer| Story must make more s

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

2022-10-16 Thread Peter J. Holzer
On 2022-10-16 19:52:47 +0200, Antoon Pardon wrote: > Op 16/10/2022 om 19:01 schreef Peter J. Holzer: > > On 2022-10-16 12:17:39 +0200, Antoon Pardon wrote: > > > Op 16/10/2022 om 00:50 schreefavi.e.gr...@gmail.com: > > > > That might not easily solve this prob

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

2022-10-18 Thread Peter J. Holzer
want it to integrate with a lot of other infrastructure. So that alone might make it a non-starter, even if it was really good (which realistically early iterations wouldn't be). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

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

2022-10-22 Thread Peter J. Holzer
On 2022-10-19 12:10:52 +1100, Chris Angelico wrote: > On Wed, 19 Oct 2022 at 12:01, Peter J. Holzer wrote: > > On 2022-10-17 09:25:00 +0200, Karsten Hilbert wrote: > > > http://literateprogramming.com/ > > > > Right. That's one of the inspirations for my commen

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

2022-10-22 Thread Peter J. Holzer
On 2022-10-22 15:04:58 +0200, Peter J. Holzer wrote: > On 2022-10-19 12:10:52 +1100, Chris Angelico wrote: > > On Wed, 19 Oct 2022 at 12:01, Peter J. Holzer wrote: > > > On 2022-10-17 09:25:00 +0200, Karsten Hilbert wrote: > > > > http://literateprogramming.com/ &g

Re: need help

2022-10-24 Thread Peter J. Holzer
orts TLS and the client can then send a STARTTLS command to start a TLS session. If you want to start the connection with TLS, you can (usually) use port 465. Like 587, this is only intended for mail submission, not mail transport. hp -- _ | Peter J. Holzer| Story m

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
-formed and contains a number of li elements at the same level directly below the ol element, not lots of nested li elements. The end tag of the li element is optional (except in XHTML) and li elements don't nest. hp -- _ | Peter J. Holzer| Story must make more sense than rea

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-24 12:32:11 +0200, Peter J. Holzer wrote: > Ron has already noted that the lxml and html5 parser do the right thing, ^^^ Oops, sorry. That was Roel. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | |

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-24 21:56:13 +1100, Chris Angelico wrote: > On Mon, 24 Oct 2022 at 21:33, Peter J. Holzer wrote: > > Ron has already noted that the lxml and html5 parser do the right thing, > > so just for the record: > > > > The HTML fragment above is well-formed

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-25 03:09:33 +1100, Chris Angelico wrote: > On Tue, 25 Oct 2022 at 02:45, Jon Ribbens via Python-list > wrote: > > On 2022-10-24, Chris Angelico wrote: > > > On Mon, 24 Oct 2022 at 23:22, Peter J. Holzer wrote: > > >> Yes, I got that. What I wanted to

  1   2   3   4   5   6   7   >