On Wednesday, July 28, 2010, Carl Witty wrote:
> On Wed, Jul 28, 2010 at 7:07 PM, William Stein wrote:
>> On Wednesday, July 28, 2010, kcrisman wrote:
>>> But for True and False, we would rather have
>>>
>>> if n is True:
>>>
>>> not
>>>
>>> if n==True:
>>>
>>> correct? I've seen that cause som
On Wed, Jul 28, 2010 at 7:07 PM, William Stein wrote:
> On Wednesday, July 28, 2010, kcrisman wrote:
>> But for True and False, we would rather have
>>
>> if n is True:
>>
>> not
>>
>> if n==True:
>>
>> correct? I've seen that cause some problems in code I've reviewed,
>> where things that shoul
On Wednesday, July 28, 2010, kcrisman wrote:
> But for True and False, we would rather have
>
> if n is True:
>
> not
>
> if n==True:
>
> correct? I've seen that cause some problems in code I've reviewed,
> where things that shouldn't be True were True.
>
I would use
If n:
If you want to mak
On Wed, Jul 28, 2010 at 1:28 PM, William Stein wrote:
> On Wed, Jul 28, 2010 at 1:14 PM, Jason Grout
> wrote:
>> Someone pointed this out to me recently, and it sounded like a useful gotcha
>> to know about python. Apparently small python integers are cached, while
>> larger ones are not. Somet
On Wed, Jul 28, 2010 at 1:14 PM, Jason Grout
wrote:
> Someone pointed this out to me recently, and it sounded like a useful gotcha
> to know about python. Apparently small python integers are cached, while
> larger ones are not. Sometimes.
>
> % sage -ipython
> Python 2.6.4 (r264:75706, May 25 2
Someone pointed this out to me recently, and it sounded like a useful
gotcha to know about python. Apparently small python integers are
cached, while larger ones are not. Sometimes.
% sage -ipython
Python 2.6.4 (r264:75706, May 25 2010, 15:42:09)
Type "copyright", "credits" or "license" for m