You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What should be in util instead of directly in lib?
What if I have a generic helper function? Do I put it in util/__init__.py or create util/misc.py or just misc.py under lib?
The historical answer is - stuff under lib directly are meant to be large categories of many classes/functions falling under that identifier, eg. big python modules.
Stuff under util/ was originally just util.py, basically "misc stuff that didn't fit elsewhere", but got split up when it became too big.
This is probably not a great structure, but the separation was meant to allow newcomers to Contest to find useful test-facing functions easily in big lib/ modules.
Also to have miscellaneous utilities accessible under util.* directly, not having to care whether they come from content.py or log.py.
It's hard to say what a better structure would be, but a better option might be to put everything directly in lib/ and turn bigger modules into directories, further splitting them as necessary. Or something like that. Investigate.
The text was updated successfully, but these errors were encountered:
comps
changed the title
Clean up lib/ a bit
Re-think the lib/ module structure a bit
Aug 25, 2023
The current structure,
Is somewhat confusing.
util
instead of directly inlib
?util/__init__.py
or createutil/misc.py
or justmisc.py
underlib
?The historical answer is - stuff under
lib
directly are meant to be large categories of many classes/functions falling under that identifier, eg. big python modules.Stuff under
util/
was originally justutil.py
, basically "misc stuff that didn't fit elsewhere", but got split up when it became too big.This is probably not a great structure, but the separation was meant to allow newcomers to Contest to find useful test-facing functions easily in big
lib/
modules.Also to have miscellaneous utilities accessible under
util.*
directly, not having to care whether they come fromcontent.py
orlog.py
.It's hard to say what a better structure would be, but a better option might be to put everything directly in
lib/
and turn bigger modules into directories, further splitting them as necessary. Or something like that. Investigate.The text was updated successfully, but these errors were encountered: