Skip to main content
Code Review

Return to Revisions

2 of 3
added 2 characters in body
MarianD
  • 2k
  • 1
  • 11
  • 20

Oh! My first impression is that you felt in love with dictionaries - your multilevel dictionary ClassDic (which name should be class_dic by PEP 8 - Style Guide for Python Code) is something horrible!

Why?

Mainly because it so contradicts the DRY principle (Don't Repeat Yourself). The one set of the keys used completely again and again — so are they necessary? Don't they break the readability and the logic, too?

Probably would be useful first read the PEP 20 - The Zen of Python (or type

import this

in your Python interpreter), particularly these advice:

Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Readability counts.
There should be one - and preferably only one - obvious way to do it.
If the implementation is hard to explain, it's a bad idea.

So my tip is first to refactor your ClassDic multi-level dictionary — maybe the solution will then emerge as a miracle.

MarianD
  • 2k
  • 1
  • 11
  • 20
default

AltStyle によって変換されたページ (->オリジナル) /