Movatterモバイル変換
[0]ホーム
[Python-Dev] Internal representation of strings and Micropython
Paul Sokolovskypmiscml at gmail.com
Wed Jun 4 20:29:29 CEST 2014
Hello,On Wed, 04 Jun 2014 20:52:14 +0300Serhiy Storchaka <storchaka at gmail.com> wrote:[]> > That's sad, I agree.>> Other languages (Go, Rust) can be happy without O(1) indexing of> strings. All string and regex operations work with iterators or> cursors, and I believe this approach is not significant worse than> implementing strings as O(1)-indexable arrays of characters (for some> applications it can be worse, for other it can be better). But Python> is different language, it has different operations for strings and> different idioms. A language which doesn't support O(1) indexing is> not Python, it is only Python-like language.Sorry, but that's just your personal opinion, not shared by otherdevelopers, as this thread showed. And let's not pretend we live inhappy-ever world of Python 1.5.2 which doesn't need anything morebecause it's perfect as it is. Somebody added all those iterators anditerator-returning functions to Pythons. And then the problem Pythonhas is a typical "last mile" problem, that iterators were not appliedcompletely everywhere. There's little choice but to move in thatdirection, though.What you call "idioms", other people call "sloppy programmingpractices". There's common suggestion how to be at peace with Python'sindentation for those who find it a problem - "get over it". Well,somehow it itches to say same for people who think that Python3 shouldbe used the same way as Python1: Get over the fact that Python is nolonger little funny language being laughed at by Perl crowd for beingorder of magnitude slower at processing text files. While you still cando little funny tricks we all love Python for, it now also offersframework to do it right, and it makes little sense saying that doing itlittle funny way is the definitive trait of Python.(And for me it's easy to be such categorical - the only way I couldsubscribe to idea of running Python on an MCU and not be laughable is bytrusting Python to provide framework for being efficient. I quitworking on another language because I have trusted that iterator,generator, buffer protocols are not little funny things but thoroughlyengineered efficient concepts, and I don't feel betrayed.)-- Best regards, Paul mailto:pmiscml at gmail.com
More information about the Python-Devmailing list
[8]ページ先頭