Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53027

Re: TypeError: 'int' object is not callable

References <f4dd4f8e-a694-4a86-b2ff-1d91a9b37792@googlegroups.com>
Date 2013-08-27 08:53 +0530
Subject Re: TypeError: 'int' object is not callable
From Krishnan Shankar <i.am.songoku@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.253.1377573795.19984.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

The problem is in the second line.

a = time.daylight()

The daylight is not a method in time module. It is clear here,
http://docs.python.org/2/library/time.html

Since it is not a method we cannot call it. It is just a integer variable .
It returns zero if DST timezone is not defined and returns non zero if
defined.

>>> import time
>>> a = time.daylight()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
>>> a = time.daylight
>>> a
0
>>> type(time.daylight)
<type 'int'>

Regards,
Krishnan


On Tue, Aug 27, 2013 at 8:15 AM, <autobotprime.17@gmail.com> wrote:

> dear friends when i try to execute following lines
>
> import time
> a = time.daylight()
> print(a)
>
>
> result is
> TypeError: 'int' object is not callable
>
>
> why is this error and how can i solve this problem?
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

TypeError: 'int' object is not callable autobotprime.17@gmail.com - 2013-08-26 19:45 -0700
  Re: TypeError: 'int' object is not callable Krishnan Shankar <i.am.songoku@gmail.com> - 2013-08-27 08:53 +0530
  Re: TypeError: 'int' object is not callable Terry Reedy <tjreedy@udel.edu> - 2013-08-27 04:12 -0400

csiph-web