Re: What to do to correct the error written below:

2022-04-12 Thread Greg Ewing
On 12/04/22 2:28 am, Peter Pearson wrote: By looping over elements in "books" and incrementing counter i, which is used as an index both for "books" and for "students", you will produce an error whenever the number of books exceeds the number of students. More fundamentally, it assumes there is

Re: What to do to correct the error written below:

2022-04-12 Thread Peter Pearson
On Tue, 12 Apr 2022 04:56:22 -0700 (PDT), NArshad wrote: > >>By looping over elements in "books" and incrementing counter i, >>which is used as an index both for "books" and for "students", >>you will produce an error whenever the number of books exceeds >>the number of students. Is there some rea

Circular Import

2022-04-12 Thread Stefano Ovus
How can I avoid circular imports keeping separated modules ? -- square.py from circle import Cirle class Square: def __init__(self): ... @classmethod def from_circle(cls, circle: Circle) -> Square: ... return cls(...) -- circle.py from square import Square class Circle: def

Re: Circular Import

2022-04-12 Thread Stefano Ovus
found a solution: importing modules instead of classes, ex. -- square.py import circle ... @classmethod def from_circle(cls, circle: circle.Circle) -> Square: ... return cls(...) -- https://mail.python.org/mailman/listinfo/python-list

Re: Circular Import

2022-04-12 Thread Chris Angelico
On Wed, 13 Apr 2022 at 03:37, Stefano Ovus wrote: > > found a solution: importing modules instead of classes, ex. > > -- square.py > > import circle > > ... > @classmethod > def from_circle(cls, circle: circle.Circle) -> Square: > ... > return cls(...) Yep! Good solution. Be aware that

Re: Suggestion for Linux Distro (from PSA: Linux vulnerability)

2022-04-12 Thread Marco Sulla
On Tue, 29 Mar 2022 at 00:10, Peter J. Holzer wrote: > They are are about a year apart, so they will usually contain different > versions of most packages right from the start. So the Ubuntu and Debian > security teams probably can't benefit much from each other. Well, this is what my updater on