Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: reduce nested for-loops
Post: RE: reduce nested for-loops

(Mar-14-2023, 09:24 PM)bowlofred Wrote: The code doesn't look awful to me. OK, accepting this. But normally i have more that only 3 nested loops. When there's > 8, the pylint complains about it.
Phaze90 General Coding Help 11 1,919 Mar-16-2023, 09:26 AM
    Thread: reduce nested for-loops
Post: RE: reduce nested for-loops

(Mar-15-2023, 11:30 AM)DeaD_EyE Wrote: Yes, you can: from itertools import product for a, b, c in product(a.list_of_bs, b.list_of_cs, c.list_of_ds): do_something(a, b, c)Docs: itertools.produ...
Phaze90 General Coding Help 11 1,919 Mar-16-2023, 09:20 AM
    Thread: reduce nested for-loops
Post: reduce nested for-loops

Hi, i have lots of "search"-loops which looks like this: for b in a.list_of_bs: for c in b.list_of_cs: for d in c.list_of_ds: d...
Phaze90 General Coding Help 11 1,919 Mar-14-2023, 08:34 PM
    Thread: "unexpected keyword arg" when initializing my subclasses
Post: RE: "unexpected keyword arg" when initializing my ...

Yes, first classes. But why you assume it will adding complexity? What is the alternative? IMHO when using common attributes (and methods), why I shouldn't inherit from that Base-Class? This way it l...
Phaze90 General Coding Help 3 3,162 Nov-25-2022, 07:12 PM
    Thread: "unexpected keyword arg" when initializing my subclasses
Post: "unexpected keyword arg" when initializing my subc...

Hi, i get confused when i build my class stuctures. I got 2 questions. 1. Since all of my classes will use the some base attributes i collected them in a base class. When i call my constructor for ...
Phaze90 General Coding Help 3 3,162 Nov-25-2022, 11:42 AM
    Thread: which design / pattern when building classes and subclasses
Post: which design / pattern when building classes and s...

I need to build a mother-child-like class tree. Dont know which is the best practice how to structure it. I could define a top-level class A which has some own attributes and at least 1 sub class B....
Phaze90 General Coding Help 2 1,127 Nov-18-2022, 08:53 PM
    Thread: too many methods in class - redesign idea?
Post: RE: too many methods in class - redesign idea?

i can't - it's protected
Phaze90 General Coding Help 3 2,511 Mar-05-2021, 07:56 PM
    Thread: too many methods in class - redesign idea?
Post: too many methods in class - redesign idea?

I have one xml file (famtree.xml) that I read in, that holds many parameters about family tree data. It has many levels, root level is me, then parents, grandparents.... Now I am currently creating o...
Phaze90 General Coding Help 3 2,511 Mar-04-2021, 10:17 PM
    Thread: best way to add item to list only once
Post: best way to add item to list only once

Hi, what is the more effective way of the both below? Or is there a third variant? def add_only_once_to_list(in_obj, in_list,): if in_obj not in in_list: in_list.append(in_obj)Or with a ...
Phaze90 General Coding Help 1 2,532 Apr-30-2020, 09:27 PM
    Thread: generate UML design from python code
Post: RE: generate UML design from python code

thanks, but i can't sort to number of downloads. This makes it hard to check them. I found pyreverse. I am still experimenting. However, if you recommend some other tool, please add here. Thanks!
Phaze90 General Coding Help 2 2,484 Apr-13-2020, 11:36 AM
    Thread: generate UML design from python code
Post: generate UML design from python code

Hello, i am looking for a possibility to reverse engineer my code to have a class design / diagram. It helps to see the dependencies between the classes. Can you recommend some good tool for doing t...
Phaze90 General Coding Help 2 2,484 Apr-07-2020, 09:34 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020