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


Groups > comp.lang.python > #53027

Re: TypeError: 'int' object is not callable

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <i.am.songoku@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:not': 0.03; 'problem?': 0.07; "subject:' ": 0.07; 'dst': 0.09; 'cc:addr :python-list': 0.11; 'callable': 0.16; 'defined.': 0.16; 'subject:object': 0.16; 'typeerror:': 0.16; 'url:time': 0.16; 'wrote:': 0.18; 'variable': 0.18; '>>>': 0.22; 'import': 0.22; 'aug': 0.22; 'email addr:gmail.com&gt;': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; '&gt;&gt;&gt;': 0.24; 'integer': 0.24; 'non': 0.24; 'cc:2**0': 0.24; 'second': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'lines': 0.31; '"",': 0.31; 'file': 0.32; 'url:python': 0.33; '(most': 0.33; 'problem': 0.35; 'received:google.com': 0.35; 'module.': 0.36; 'url:listinfo': 0.36; 'method': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'clear': 0.37; 'skip:& 10': 0.38; 'url:library': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'url:mail': 0.40; 'how': 0.40; 'solve': 0.60; 'dear': 0.65; 'to:addr:gmail.com': 0.65; 'friends': 0.81; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=emNVe9tYyYn4py7d6HOUNWdfBWggykmCtlOPJvCfxZA=; b=zaB/qznKSs53wRGUzG+yB4q1Iwz2Aqz3c8su5CBiaCBGFwtQ/LDqjcyoi8J8v/WTb5 dywYgtU3A4UjswSYcznJPUA8AG4YsPgIQowvoJG+AXexaBqJ6SKgzNq9hFVwL/W5U12h gCYcYx5DmG1pCY1LrJbDECKOgIt3AYQ+O1Yyu1zTd8OBJoOG1J9bi2iB9OxpCEiIQ/W4 2/uz6PW9eKKBL2y/LXaXzfjSmKLpIR+EiefkORWELyi4ATE3HcQWf8E7/QYqlefNIMLS xeX7BN/rjXhHvwfQxa7nxXtSbSTJlLpHx1b7mzriitn4XQdIGPOsNKoTljeDS0H2WAer IH9A==
MIME-Version 1.0
X-Received by 10.180.109.35 with SMTP id hp3mr9632631wib.52.1377573788732; Mon, 26 Aug 2013 20:23:08 -0700 (PDT)
In-Reply-To <f4dd4f8e-a694-4a86-b2ff-1d91a9b37792@googlegroups.com>
References <f4dd4f8e-a694-4a86-b2ff-1d91a9b37792@googlegroups.com>
Date Tue, 27 Aug 2013 08:53:08 +0530
Subject Re: TypeError: 'int' object is not callable
From Krishnan Shankar <i.am.songoku@gmail.com>
To autobotprime.17@gmail.com
Content-Type multipart/alternative; boundary=e89a8f3ba25b54544604e4e5642e
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.253.1377573795.19984.python-list@python.org> (permalink)
Lines 94
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1377573795 news.xs4all.nl 15895 [2001:888:2000:d::a6]:51886
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53027

Show key headers only | 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