Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
Op 24/10/2022 om 4:29 schreef Chris Angelico: Parsing ancient HTML files is something Beautiful Soup is normally great at. But I've run into a small problem, caused by this sort of sloppy HTML: from bs4 import BeautifulSoup # See: https://gsarchive.net/gilbert/plays/princess/tennyson/tenniv.htm

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Mon, 24 Oct 2022 at 18:43, Roel Schroeven wrote: > > Op 24/10/2022 om 4:29 schreef Chris Angelico: > > Parsing ancient HTML files is something Beautiful Soup is normally > > great at. But I've run into a small problem, caused by this sort of > > sloppy HTML: > > > > from bs4 import BeautifulSou

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
Op 24/10/2022 om 9:42 schreef Roel Schroeven: Using html5lib (install package html5lib) instead of html.parser seems to do the trick: it inserts right before the next , and one before the closing . On my system the same happens when I don't specify a parser, but IIRC that's a bit fragile beca

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
(Oops, accidentally only sent to Chris instead of to the list) Op 24/10/2022 om 10:02 schreef Chris Angelico: On Mon, 24 Oct 2022 at 18:43, Roel Schroeven wrote: > Using html5lib (install package html5lib) instead of html.parser seems > to do the trick: it inserts right before the next , and

Re: need help

2022-10-24 Thread Peter J. Holzer
On 2022-10-24 01:02:24 +, rbowman wrote: > On Mon, 24 Oct 2022 10:02:10 +1100, Cameron Simpson wrote: > > I'd say GMail are rudely dropping traffic to port 2525. Maybe try just > > 25, > > the normal SMTP port? > > 2525 is an alternative to 587, the standard TLS port. Port 587 is not the stan

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-24 13:29:13 +1100, Chris Angelico wrote: > Parsing ancient HTML files is something Beautiful Soup is normally > great at. But I've run into a small problem, caused by this sort of > sloppy HTML: > > from bs4 import BeautifulSoup > # See: https://gsarchive.net/gilbert/plays/princess/tenn

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. |_|_) || | | | h...@hjp.

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
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 and contains a number of li > elements at the same level directly below the ol element, not lots of >

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 and contains a number of li > > element

RE: A trivial question that I don't know - document a function/method

2022-10-24 Thread Schachner, Joseph (US)
I head a small software team much of whose output is Python. I would gratefully accept any of the formats you show below. My preference is #1. --- Joseph S. Teledyne Confidential; Commercially Sensitive Business Data -Original Message- From: Paulo da Silva Sent: Saturday, October

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Mon, 24 Oct 2022 at 23:22, Peter J. Holzer wrote: > > 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 f

Re: score function in linear regression model

2022-10-24 Thread Reto
On Sun, Oct 23, 2022 at 05:11:10AM -0700, Fatemeh Heydari wrote: > model.score(X,Y) That will basically check how good your model is. It takes a bunch of X values with known values, which you provide in Y and compares the output of model.Predict(X) with the Y's and gives you some metrics as to ho

Re: Python For TinyML

2022-10-24 Thread Kisakye Moses
On Sunday, October 23, 2022 at 8:23:26 PM UTC+3, rbowman wrote: > On Sun, 23 Oct 2022 08:46:10 -0700 (PDT), Kisakye Moses wrote: > > > Hello am a (M) and glad that I've joined this group. > > Any help in python for TinyML, i will honored > https://tinynet.autoai.org/en/latest/ Thank you so much

RE: Are Floating Point Numbers still a Can of Worms?

2022-10-24 Thread Schachner, Joseph (US)
Floating point will always be a can of worms, as long as people expect it to represent real numbers with more precision that float has. Usually this is not an issue, but sometimes it is. And, although this example does not exhibit subtractive cancellation, that is the surest way to have less p

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Jon Ribbens via Python-list
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 say was that this is indeed a bug in >> html.parser and not an error (or sloppyness, as you called it) in the >> input or ambiguity in the HTML standard. > > I describe

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
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 say was that this is indeed a bug in > >> html.parser and not an error (or sloppyness, as you

Re: A trivial question that I don't know - document a function/method

2022-10-24 Thread Mats Wichmann
On 10/23/22 14:20, Paulo da Silva wrote: Às 21:58 de 22/10/22, Paulo da Silva escreveu: Hi all! What is the correct way, if any, of documenting a function/method? Thank you all for the, valuable as usual, suggestions. I am now able to make my choices. Paulo It also matters whether you exp

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Jon Ribbens via Python-list
On 2022-10-24, 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 say was that this is indeed a bug in >> >> html.p

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 say was that this is indeed a bug

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Roel Schroeven
Jon Ribbens via Python-list schreef op 24/10/2022 om 19:01: On 2022-10-24, Chris Angelico wrote: > On Tue, 25 Oct 2022 at 02:45, Jon Ribbens via Python-list wrote: >> Adding in the omitted , , , , and >> would make no difference and there's no particular reason to recommend >> doing so as fa

python 3.11

2022-10-24 Thread jschwar
Is python 3.11 still being release today? Just wondering. Not sure when during the day this is done. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Are Floating Point Numbers still a Can of Worms?

2022-10-24 Thread Dennis Lee Bieber
On Mon, 24 Oct 2022 14:52:28 +, "Schachner, Joseph (US)" declaimed the following: >Floating point will always be a can of worms, as long as people expect it to >represent real numbers with more precision that float has. Usually this is >not an issue, but sometimes it is. And, although thi

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Tue, 25 Oct 2022 at 04:22, Peter J. Holzer wrote: > There may be several reasons: > > * Historically, some browsers differed in which end tags were actually > optional. Since (AFAIK) no mainstream browser ever implemented a real > SGML parser (they were always "tag soup" parsers with lots o

[RELEASE] Python 3.11 final (3.11.0) is available

2022-10-24 Thread Pablo Galindo Salgado
Python 3.11 is finally released. In the CPython release team, we have put a lot of effort into making 3.11 the best version of Python possible. Better tracebacks, faster Python, exception groups and except*, typing improvements and much more. Get it here: https://www.python.org/downloads/release/p

Re: Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

2022-10-24 Thread Barry Scott
> On 8 Oct 2022, at 11:50, Weatherby,Gerard wrote: > > Logging does support passing a callable, if indirectly. It only calls __str__ > on the object passed if debugging is enabled. > > class Defer: > > def __init__(self,fn): > self.fn = fn > > def __str__(self): > r

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Peter J. Holzer
On 2022-10-25 06:56:58 +1100, Chris Angelico wrote: > On Tue, 25 Oct 2022 at 04:22, Peter J. Holzer wrote: > > There may be several reasons: > > > > * Historically, some browsers differed in which end tags were actually > > optional. Since (AFAIK) no mainstream browser ever implemented a real >

Re: Beautiful Soup - close tags more promptly?

2022-10-24 Thread Chris Angelico
On Tue, 25 Oct 2022 at 09:34, Peter J. Holzer wrote: > > One thing I find quite interesting, though, is the way that browsers > > *differ* in the face of bad nesting of tags. Recently I was struggling > > to figure out a problem with an HTML form, and eventually found that > > there was a spurious