Does hashlib support a file mode?
Andrew Berg
bahamutzero8825 at gmail.com
Thu Jul 7 09:58:48 EDT 2011
On 2011.07.07 08:39 AM, Phlip wrote:
> On Jul 7, 6:24 am, Andrew Berg <bahamutzero8... at gmail.com> wrote:
> > On 2011.07.07 08:11 AM, Phlip wrote:> No, I was pointing out that passing a type is more ... typesafe.
> >
> > None is a type.
>
> I never said it wasn't.
You are talking about this code, right?
def file_to_hash(path, m=None):
if m is None:
m = hashlib.md5()
What's not a type? The is operator compares types (m's value isn't the
only thing compared here; even an separate instance of the exact same
type would make it return False), and m can't be undefined.
More information about the Python-list
mailing list