Here is a useful rule of thumb from what I have seen of typical Java projects:
The bottom-most package in Java should be a file in Python
What does that mean?
If your Java project was organized:
toplevel/
subproject/
Foo.java
Bar.java
subproject2/
Baz.java
Qux.java
Then your Python project should look like:
toplevel/
subproject.py <-- put class Foo, Bar here
subproject2.py <-- put class Baz, Qux here
Things to notice re: organization:
- Do not use inner classes. Just put
classes in the same module
- By convention, things that start with _ are "private"
- It's OK to have "public variables"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…