Terry J. Reedy <tjre...@udel.edu> added the comment:

The opening message confused me by using 'need' as 'currently required to call' 
rather than 'required to compute (test) and necessarily needed to call'; but 
after reading the code, I believe I understand and modified title to match.  
More simply, one could call what(h=b'...') after the change instead of 
what(None, b'...').  This is the change in the tests (but the old form must 
still be tested also).

I don't see how the change would affect correct legacy use.  (The TypeError to 
ValueError change is wrong, and I don't understand the other exception change.) 
 However, what('') should get the same error as currently (see additional 
change in review).

However, what is very problemmatic is requiring 1 of 2 different arguments.  
For range, the first parameter is really 'start_or_stop', an int either way, 
with the interpretation depending on the presence of a second.  This is a 
nuisance for understanding, but a convenience in usage.  But I think requiring 
an argument (usually) passed positionally or an argument that now has to be 
passed by keyword, with an arbitrary letter name, is worse and less justified.  
So my current view is that this change should be rejected.

----------
nosy: +terry.reedy
title: Little improve on imghdr library -> Allow omission of imghdr.what file 
arg if bytes are given
type: behavior -> enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41749>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to