Closed
Description
What is the problem or limitation you are having?
Travertino's declaration.py
, at 501 lines, isn't exactly a huge file. But it's got a decent bit going on in it, and will have more once composite_property
is added.
Describe the solution you'd like
I'd like to propose splitting the file in two, at roughly the halfway mark: keep Choices
and the various properties together, and put BaseStyle
in its own file.
If that's a go, then the question would be how precisely to do it. I think the main options are:
- Split it into two (still top-level) files. It would probably makes sense to rename these to
properties
andstyle
. I feel like this is probably what we'd do if starting here from scratch, but it means Toga (and maybe user code, on the slim chance anyone's using it) would need to change their imports. We'd also need to keep an import-onlydeclaration
module at first, as a compatibility shim for Toga <= 0.4.8. - Turn
declaration
into a subpackage containing the two files, with an__all__
exporting all the needed symbols, so all the imports stay the same. - A sort of compromise of the two: two top-level files, named
properties
anddeclaration
, the latter of which imports all the properties from the former.
My instinct would be the first option, but either of the other two would mean less code churn.
Describe alternatives you've considered
Leave it as-is.
Additional context
No response