Re: Why inspect.isclass says iter() a class?

2019-04-10 Thread Chris Angelico
On Thu, Apr 11, 2019 at 3:31 PM Gregory Ewing wrote: > > Chris Angelico wrote: > > At the moment, it isn't defined particularly as either a function or a > > class, > > Well, it's listed under a section called "Functions", so the reader > could be forgiven for assuming that it's a function. Ah, f

Re: Why inspect.isclass says iter() a class?

2019-04-10 Thread Gregory Ewing
Chris Angelico wrote: At the moment, it isn't defined particularly as either a function or a class, Well, it's listed under a section called "Functions", so the reader could be forgiven for assuming that it's a function. From a high level point of view, it is -- you call it and it returns somet

Re: Why inspect.isclass says iter() a class?

2019-04-10 Thread Chris Angelico
On Thu, Apr 11, 2019 at 3:02 PM dieter wrote: > > Arup Rakshit writes: > > From docs https://docs.python.org/3/library/itertools.html#itertools.chain > > I see that itertools.chain is defined as a function. > > Maybe, it would have been better to state that "chain" > is a "callable": something w

Re: Why inspect.isclass says iter() a class?

2019-04-10 Thread dieter
Arup Rakshit writes: > From docs https://docs.python.org/3/library/itertools.html#itertools.chain I > see that itertools.chain is defined as a function. Maybe, it would have been better to state that "chain" is a "callable": something which can be called on arguments. For many people, "callable

Re: Why inspect.isclass says iter() a class?

2019-04-10 Thread Arup Rakshit
Well. I thought so far, all class in python is defined as CamelCase. A function can be a class to is something I am surprised. So does this mean, any callable function if produce an instance is called class in Python? Thanks, Arup Rakshit a...@zeit.io > On 11-Apr-2019, at 12:53 AM, Calvin

Re: Why inspect.isclass says iter() a class?

2019-04-10 Thread Calvin Spealman
Because it is. Many things are classes. calling itertools.chain(a, b) creates an itertools.chain instance that you can iterate over. What else did you think it would be? On Wed, Apr 10, 2019 at 3:17 PM Arup Rakshit wrote: > From docs https://docs.python.org/3/library/itertools.html#itertools.cha

Why inspect.isclass says iter() a class?

2019-04-10 Thread Arup Rakshit
>From docs https://docs.python.org/3/library/itertools.html#itertools.chain I >see that itertools.chain is defined as a function. But then why >inspect.isclass(chain) is saying it as class. from itertools import chain inspect.isclass(chain) # True Thanks, Arup Rakshit a...@zeit.io -- htt