Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-19 Thread Alan Gauld via Tutor
On 19/06/18 16:52, C W wrote: > Thank you all. I'm relatively new to OOP, I think that's where the problem > is. It's different from C or any C alike language. True, but even in C you can have pointers to functions which work in a similar fashion. > I'm still figuring out what's under the hood

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-19 Thread C W
Thank you all. I'm relatively new to OOP, I think that's where the problem is. It's different from C or any C alike language. I'm still figuring out what's under the hood with OOP. Thanks! On Mon, Jun 18, 2018 at 8:26 PM, Steven D'Aprano wrote: > On Mon, Jun 18, 2018 at 08:50:24AM -0600, Mats

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-19 Thread Steven D'Aprano
On Tue, Jun 19, 2018 at 11:52:08AM -0400, C W wrote: > Thank you all. I'm relatively new to OOP, I think that's where the problem > is. It's different from C or any C alike language. Apart from C-like languages like C++, Objective C, C# and others with objects :-) Actually in this specific

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Steven D'Aprano
On Mon, Jun 18, 2018 at 08:50:24AM -0600, Mats Wichmann wrote: > Python is not like certain other languages. But it is like *other* certain other languages. :-) Python's execution model is different from C, Pascal or Fortran, but it is quite similar to Ruby, Lua and Javascript. -- Steve

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Mats Wichmann
On 06/17/2018 12:02 PM, C W wrote: > Dear Python experts, > > I never figured out when to call a method with parenthesis, when is it not? > It seems inconsistent. > > For example, > If I do > >> data.isnull() > > numberair_pressure_9amair_temp_9amavg_wind_direction_9amavg_wind_speed_9am >

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Steven D'Aprano
Another thought comes to mind... On Sun, Jun 17, 2018 at 02:02:07PM -0400, C W wrote: > Obviously, the second case does not make any senses. But, in data.columns, > it is only correct to do without parenthesis as below: > > > data.columns [...] > # with parenthesis throws an error > >

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Steven D'Aprano
On Sun, Jun 17, 2018 at 02:02:07PM -0400, C W wrote: > Dear Python experts, > > I never figured out when to call a method with parenthesis, when is it not? > It seems inconsistent. You *always* CALL a method (or function) with parentheses. But sometimes you can grab hold of a method (or

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Peter Otten
C W wrote: > Dear Python experts, > > I never figured out when to call a method with parenthesis, when is it > not? It seems inconsistent. > > For example, > If I do > >> data.isnull() > > numberair_pressure_9amair_temp_9amavg_wind_direction_9amavg_wind_speed_9am >

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Alan Gauld via Tutor
On 17/06/18 19:02, C W wrote: > I never figured out when to call a method with parenthesis, when is it not? You call anything in Python (function, method, class, etc) using parentheses. The parentheses are what makes it a call. When you don't use parentheses you are referencing the callable

[Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread C W
Dear Python experts, I never figured out when to call a method with parenthesis, when is it not? It seems inconsistent. For example, If I do > data.isnull() numberair_pressure_9amair_temp_9amavg_wind_direction_9amavg_wind_speed_9am max_wind_direction_9ammax_wind_speed_9amrain_accumulation_9am