[EMAIL PROTECTED] wrote:
> If I then wanted to see what scheme's value
> compared to, the string's comparison method would have to recognize that it
> wasn't truly NUL-terminated, copy it, call strncmp() or whatever underlying
> routine is used for string comparisons.

Python string comparisons can't be using anything that
relies on nul-termination, because Python strings can
contain embedded nuls. Possibly it uses memcmp(), but
that takes a length.

You have a point when it comes to passing strings to
other C routines, though. For those that don't have a
variant which takes a maximum length, the substring type
might have to keep a cached nul-terminated copy created
on demand. Then the copying overhead would only be
incurred if you did happen to pass a substring to such
a routine.

Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to