-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
black = "==18.9b0" | ||
flake8 = "*" | ||
isort = "*" | ||
mypy = "*" | ||
mypy = "==0.660" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug in mypy version 0.670
, which was just released:
python/mypy#6364
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
@@ -12,7 +12,7 @@ | |||
|
|||
@dataclass(frozen=True) | |||
class Scale: | |||
chunk_sizes: Tuple[Vec3D] | |||
chunk_sizes: Tuple[Vec3D, ...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tuple
type definitions are expected to specify all fields, or use the ellipsis, which is similar to lists then. This is needed to make from_json
work for tuples of unknown length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want tuples of unknown length instead of plain lists? Does that help with hashability/typechecking etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, tuples can be cached, lists not.
Also, I removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Route categories seem fine. However, I think I still prefer Play’s routes list files as they have all entry points in one overview, but I suppose that’s not so easy to recreate here. It’s also not a super strong preference.
black = "==18.9b0" | ||
flake8 = "*" | ||
isort = "*" | ||
mypy = "*" | ||
mypy = "==0.660" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
@@ -12,7 +12,7 @@ | |||
|
|||
@dataclass(frozen=True) | |||
class Scale: | |||
chunk_sizes: Tuple[Vec3D] | |||
chunk_sizes: Tuple[Vec3D, ...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want tuples of unknown length instead of plain lists? Does that help with hashability/typechecking etc?
@fm3 Actually having something similar like the routes-files should be easy:
The problem here is that it's harder to see if the method's and the url's parameters match. That's why I would leave it like this for now. |
True, fine by me to leave it :) |
This PR mainly extracts the routes into files, as the
__main__.py
grew too big, more routes are coming in the next PR. @fm3 What do you think about the file-structure?Also, I noted a bug from the last PR, which I fixed here as well, see my comment at the code.