Re: Typing: Is there a "cast operator"?

2022-10-23 Thread Thomas Passin
On 10/23/2022 11:14 PM, Dan Stromberg wrote: On Sun, Oct 23, 2022 at 2:11 PM Paulo da Silva < p_d_a_s_i_l_v_a...@nonetnoaddress.pt> wrote: Hello! I am in the process of "typing" of some of my scripts. Using it should help a lot to avoid some errors. But this is new for me and I'm facing some p

Re: need help

2022-10-23 Thread Cameron Simpson
On 24Oct2022 01:02, 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. Yah. My point was more focussed on GMail's sho

Re: Typing: Is there a "cast operator"?

2022-10-23 Thread Chris Angelico
On Mon, 24 Oct 2022 at 14:15, Dan Stromberg wrote: > I've found that mypy understands simple assert statements. > > So if you: > if f is not None: > assert f is not None > os.write(f, ...) > > You might be in good shape. Why can't it simply understand the if statement? I'm not a f

Re: Typing: Is there a "cast operator"?

2022-10-23 Thread Dan Stromberg
On Sun, Oct 23, 2022 at 2:11 PM Paulo da Silva < p_d_a_s_i_l_v_a...@nonetnoaddress.pt> wrote: > Hello! > > I am in the process of "typing" of some of my scripts. > Using it should help a lot to avoid some errors. > But this is new for me and I'm facing some problems. > > Let's I have the following

Beautiful Soup - close tags more promptly?

2022-10-23 Thread 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 blob = b""" 'THERE sinks the nebulous star we c

Re: need help

2022-10-23 Thread rbowman
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. 25 and 587 work. telnet smtp.gmail.com 587 Trying 2607:f8b0:4023:1004::6d... C

Re: Typing: Is there a "cast operator"?

2022-10-23 Thread Paulo da Silva
Às 23:56 de 23/10/22, Cameron Simpson escreveu: On 23Oct2022 21:36, Paulo da Silva wrote: I am in the process of "typing" of some of my scripts. Using it should help a lot to avoid some errors. But this is new for me and I'm facing some problems. Let's I have the following code (please don't l

Re: need help

2022-10-23 Thread Cameron Simpson
Please try to choose more descriptive subject lines (eg "problem with sock.connect" or similar). That you want help is almost implicit, and what the whole list is for. Anyway, to your problem: On 23Oct2022 10:19, Shuaib Akhtar wrote: How to fix Traceback (most recent call last):   File "

Re: Typing: Is there a "cast operator"? [RESOLVED]

2022-10-23 Thread Paulo da Silva
Às 21:36 de 23/10/22, Paulo da Silva escreveu: Hello! I am in the process of "typing" of some of my scripts. Using it should help a lot to avoid some errors. But this is new for me and I'm facing some problems. Let's I have the following code (please don't look at the program content): f=None 

Re: Typing: Is there a "cast operator"?

2022-10-23 Thread Cameron Simpson
On 23Oct2022 21:36, Paulo da Silva wrote: I am in the process of "typing" of some of my scripts. Using it should help a lot to avoid some errors. But this is new for me and I'm facing some problems. Let's I have the following code (please don't look at the program content): f=None # mypy natu

Re: Update from 3.9 to 3.10.8 and uninstall 3.9

2022-10-23 Thread Mike Dewhirst
On 23/10/2022 9:13 pm, B N wrote: I am new to python and wish to update 3.9 to3.10.8 which I have downloaded. How do I replace 3.9 with the 3.10.8 I downloaded. Kind regards JohnGee It depends on the operating system. Typically, you can just install the new version and adjust your environmen

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

2022-10-23 Thread Karsten Hilbert
Am Sun, Oct 23, 2022 at 05:16:48PM -0400 schrieb Thomas Passin: > > def make_title_from_headline(self, p, h) -> str: > > > > def plot(self, stackposition=MAIN, clearFirst=True) -> None: > 1. Knowing the type of a parameter isn't all you usually want to know; Sure, as I said: > >and use

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

2022-10-23 Thread Paulo da Silva
À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 -- https://mail.python.org/mailman/listinfo/python-list

Re: Python For TinyML

2022-10-23 Thread rbowman
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/ -- https://mail.python.org/mailman/listinfo/python-list

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

2022-10-23 Thread Thomas Passin
On 10/23/2022 2:37 PM, Karsten Hilbert wrote: Am Sat, Oct 22, 2022 at 09:49:55PM -0400 schrieb Thomas Passin: def make_title_from_headline(self, p, h): """From node title, return title with over- and underline- strings. ... RETURNS a string """ def plot(self,

Python For TinyML

2022-10-23 Thread Kisakye Moses
Hello am a (M) and glad that I've joined this group. Any help in python for TinyML, i will honored -- https://mail.python.org/mailman/listinfo/python-list

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

2022-10-23 Thread Pieter van Oostrum
Mostowski Collapse writes: > I also get: > > Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54) 2.718281828459045**0.8618974796837966 > 2.367649 > > Nice try, but isn't this one the more correct? > > ?- X is 2.718281828459045**0.8618974796837966. > X = 2.36764897. > That's probably the a

score function in linear regression model

2022-10-23 Thread Fatemeh Heydari
Hi every one ! Using sklearn and linear model I made a linear regression and I reached out to a function named "score". Does anyone know what does it exactly calculate? The code for this function is like this: model.score(X,Y) Thanks in advance! -- https://mail.python.org/mailman/listinfo/pyt

Typing: Is there a "cast operator"?

2022-10-23 Thread Paulo da Silva
Hello! I am in the process of "typing" of some of my scripts. Using it should help a lot to avoid some errors. But this is new for me and I'm facing some problems. Let's I have the following code (please don't look at the program content): f=None # mypy naturally assumes Optional(int) because

need help

2022-10-23 Thread Shuaib Akhtar
How to fix Traceback (most recent call last):   File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\socket.py", line 833, in create_connection     sock.connect(sa) TimeoutError: [WinError 10060] A connection attempt failed

Update from 3.9 to 3.10.8 and uninstall 3.9

2022-10-23 Thread B N
I am new to python and wish to update 3.9 to3.10.8 which I have downloaded. How do I replace 3.9 with the 3.10.8 I downloaded. Kind regards JohnGee -- https://mail.python.org/mailman/listinfo/python-list

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

2022-10-23 Thread Karsten Hilbert
Am Sat, Oct 22, 2022 at 09:49:55PM -0400 schrieb Thomas Passin: > def make_title_from_headline(self, p, h): > """From node title, return title with over- and underline- strings. ... >RETURNS >a string > """ > def plot(self, stackposition=MAIN, clearFirst=True): > "