473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

bool value 'False' no memory address?

such as:
>>>b = False
id(b)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'bool' object is not callable

---
how to desc it?

Apr 4 '07 #1
6 1651
On Apr 4, 12:36 pm, "autin" <plutoinch...@gmail.comwrote:
such as:>>>b = False
>>id(b)

Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'bool' object is not callable

---
how to desc it?
>>b = False
id(b)
135311308
>>>
python 2.4, FreeBSD 6.2

Apr 4 '07 #2
autin a écrit :
such as:
>>>b = False
id(b)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'bool' object is not callable
IMVHO, you shadowed the builtin id() function with a boolean somewhere
else...

Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>b = False
id(b)
135506080
>>>
id = False
id(b)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'bool' object is not callable
>>>
My 2 cents...
Apr 4 '07 #3
Python 2.4.4 Linux debian 2.6.8-3-386
any wrong?
---
how to desc it?
>b = False
id(b)
135311308

python 2.4, FreeBSD 6.2

Apr 4 '07 #4
Jakub Stolarski wrote:
On Apr 4, 12:36 pm, "autin" <plutoinch...@gmail.comwrote:
>such as:>>>b = False
>>>>id(b)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'bool' object is not callable

---
how to desc it?
>>>b = False
id(b)
135311308

python 2.4, FreeBSD 6.2
The OP's almost certainly accidentally used
"id" as a flag somewhere previously:

<code>
id = True
#
# .. do other stuff
#
b = False
id (b)
</code>

Also, I'm not quite sure what he wants to
do with the id, which is only the machine
address (if that's what it is) by implementation
detail.

TJG
Apr 4 '07 #5
and test on
Python 2.3.5
2.4.32 debian
is ok!maybe its bug for unstable debian version!

Apr 4 '07 #6
My false!uh,i didnot understand it clearly.
On Apr 4, 6:46 am, Bruno Desthuilliers <bruno.
42.desthuilli...@wtf.websiteburo.oops.comwrote:
autin a écrit :
such as:
>>b = False
id(b)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'bool' object is not callable

IMVHO, you shadowed the builtin id() function with a boolean somewhere
else...

Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>b = False
>>id(b)
135506080
>>>
>>id = False
>>id(b)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'bool' object is not callable
>>>

My 2 cents...

Apr 4 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Fred | last post by:
Why was the bool type introduced into c++? What does it provide that int does not and are the two entirely interchangable in conditional expressions? Thanks Fred
2
by: Ian | last post by:
When I have an unmanaged class (compiled without /clr or with #pragma unmanaged) with return type virtual bool, the return value always comes out true when called in managed code. Only happens...
3
by: Mochuelo | last post by:
Hi, In the constructor of a class, I am taking as a parameter the reference to a "bool", as in this code: ----------------------- public class TCP_synch_client { public string address...
10
by: Mark Jerde | last post by:
I'm trying to learn the very basics of using an unmanaged C++ DLL from C#. This morning I thought I was getting somewhere, successfully getting back the correct answers to a C++ " int SumArray(int...
7
by: Naveen | last post by:
I posted this message to another board and have hardly had any views on it, leave alone answers. So I am cross-posting here. This may be a very simple question but I can't get my head around it....
6
by: Travis | last post by:
I'm curious what the most reliable way to convert a char * (or a char for that matter) to a bool is. It's safe to assume that char * will be either '0' and or '1' and I want the bool set...
13
by: a2z | last post by:
Hi all, Can someone throw some light on the implemetation of bool data type in C++? I have heard that it is bit based, but want to confirm this information. Is there any source code where I can...
20
by: Virtual_X | last post by:
Why bool type take 1 byte and as we know it must have only true or false (1 or 0) that mean that it need only one bit not the a whole byte
32
by: Simon L | last post by:
BOOL bMyarray; memset(bMyArray , 0xFF, sizeof(BOOL) * 1000); clean & quick until someone else's code found I was returning -1 to mean true Because my BOOL is 4 bytes long, TRUE in memory...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.