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
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
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
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
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
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