inclusive-lower-bound, exclusive-upper-bound (was Re: Range Operation pre-PEP)

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sat May 19 21:51:56 CEST 2001


Sat, 19 May 2001 09:03:23 GMT, Greg Jorgensen <greg at pdxperts.com> pisze:

> char s[] = "literal string" is preferred unless s really needs to
> change to point at something else at run time.

I disagree: if it's a local variable, the whole string must be
copied into it, because the compiler can't assume that we won't
modify individual characters. If the string is immutable, it's better
to define
    char *s = "literal string";
so it doesn't need to be copied.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list