ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
a is b
by Sebastian other posts by this author
Nov 4 2009 10:38AM messages near this date
Re: Using logging module for conditional nested logs | Re: a is b
I have a question from the pyar  list that may have been discussed on this
list, but i didn't catch it.
Have some common objects been somewhat hardcoded into python, like some
integers as shown in the examples below? What other object have been
hardcoded (strings ,etc) and what was the criteria used to select them?  Any
hints?
cheers,
- Seb

> >> p = 500
> >> q = 500
> >> p == q
True
> >> p is q
False
> >> n = 50
> >> m = 50
> >> n == m
True
> >> n is m
True
> >> p = 500; q = 500
> >> p is q
True

 > >> for i in range(-20,258):
...   a = i
...   b = i+0
...   if not (a is b): print i
...
-20
-19
-18
-17
-16
-15
-14
-13
-12
-11
-10
-9
-8
-7
-6
257
Thread:
Sebastian
Chris Rebert
Jitendra Gupta

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved