On Thu, May 7, 2020 at 11:56 AM Eric Fahlgren <ericfahlg...@gmail.com> wrote:
>
> On Wed, May 6, 2020 at 6:27 PM David Mertz <me...@gnosis.cx> wrote:
>>
>> I don't think being a function versus a classmethod is important here.  Just 
>> that the underlying name is *callable*.
>
>
> But wait a minute, zip isn't just a "callable", it's a class, and adding more 
> methods to it seems perfectly natural, just like lots of other built-in 
> classes.
>
> >>> zip
> <class 'zip'>
> >>> int
> <class 'int'>
> >>> int.to_bytes(97, 4, 'little')
> b'a\x00\x00\x00'

That one is more normally written as (97).to_bytes(4, 'little') but a
better example would be the converse int.from_bytes(b'a\0\0\0',
'little') == 97, as that's a class method.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ZRGRA6GZMPGSBXVTJ5WQU5WZ7T2U5CVQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to