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
{{ message }}
Repository navigation
DEPR: should we deprecate astropy.utils.console.terminal_size ? #16042
This function was added in #2878, and first released in astropy 1.0 (feb 2015)
At the time, it made perfect sense to ship our own function for this, since Python 2 was still supported, and os.get_terminal_size was never fully portable (to this day, it only supports UNIX and Windows).
While not a 1:1 replacement (shutil.get_terminal_size doesn't have a file argument), I note that console.terminal_size is very rarely used internally (only twice, one of which is a test !), so I think it'd make sense to just deprecate it. Thoughts ?
Hmm weird that file= was implemented but we don't actually use it. Since this would affect Table, I would like to see if there are objections from astropy.table maintainers: @taldcroft and @mhvk
If no objection, maybe open a draft PR to deprecate it. @saimn , should such deprecation happen in v6.1 or v7.0 given how long it has already existed?
Personally, I am fine with deprecating this, especially if Python standard library already gives something similar now. Thanks for bringing this up!
Looks to me like it can be deprecated indeed - the file argument seems used only in a context where one is resizing, so clearly connected to a real terminal.
Activity
pllim commentedon Feb 14, 2024
Hmm weird that
file=was implemented but we don't actually use it. Since this would affectTable, I would like to see if there are objections fromastropy.tablemaintainers: @taldcroft and @mhvkIf no objection, maybe open a draft PR to deprecate it. @saimn , should such deprecation happen in v6.1 or v7.0 given how long it has already existed?
Personally, I am fine with deprecating this, especially if Python standard library already gives something similar now. Thanks for bringing this up!
mhvk commentedon Feb 14, 2024
Looks to me like it can be deprecated indeed - the
fileargument seems used only in a context where one is resizing, so clearly connected to a real terminal.saimn commentedon Feb 16, 2024
6.1 is fine, the question is more when to remove it and actually break things.