Skip to main content
Code Review

Return to Answer

edited body
Source Link
MarianD
  • 2k
  • 1
  • 11
  • 20

Oh! My first impression is that you feltfell 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.

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.

Oh! My first impression is that you fell 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.

added 2 characters in body
Source Link
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_dicclass_dic by PEP 8 - Style Guide for Python Code) is something horrible!

Why?

Mainly because it so contradictcontradicts 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 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.

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 contradict 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 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 refactor your ClassDic multi-level dictionary - maybe the solution will then emerge as a miracle.

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.

Source Link
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 contradict 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 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 refactor your ClassDic multi-level dictionary - maybe the solution will then emerge as a miracle.

lang-py

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