Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string.': 0.05; 'bits': 0.09; 'exceeds': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:language': 0.09; 'length.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'byte': 0.24; 'bytes': 0.24; 'nearly': 0.26; 'values': 0.27; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'characters': 0.30; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'anyone': 0.31; 'subject: (': 0.35; 'anywhere': 0.35; 'there': 0.35; 'surely': 0.36; 'next': 0.36; 'possible': 0.36; 'two': 0.37; 'bringing': 0.38; 'e.g.': 0.38; 'nov': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'length': 0.61; "you're": 0.61; 'maximum': 0.63; 'more': 0.64; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: Oh look, another language (ceylon) Date: Mon, 18 Nov 2013 15:37:12 -0500 References: <1f0ffad0-f9b1-4154-b048-510d8e38846e@googlegroups.com> <41f332dd-1c31-4699-9176-7e8589f9c8ae@googlegroups.com> <528a16b5$0$29992$c3e8da3$5496439d@news.astraweb.com> <528a249e$0$29992$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 174.32.174.29 In-Reply-To: <528a249e$0$29992$c3e8da3$5496439d@news.astraweb.com> User-Agent: Groundhog Newsreader for Android X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384807021 news.xs4all.nl 15914 [2001:888:2000:d::a6]:39826 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59904 On 18 Nov 2013 14:30:54 GMT, Steven D'Aprano wrote: > - 15 bits for a length. > 15 bits give you a maximum length of 32767. There are ways around that. > E.g. a length of 0 through 32766 means exactly what it says; a length of > 32767 means that the next two bytes are part of the length too, giving > you a maximum of 4294967295 characters per string. That's an 8GB string. > Surely big enough for anyone :-) If you use nearly all of the possible 2 byte values then adding 2 more bytes won't give you anywhere near 4 bI'll ion characters. You're perhaps thinking of bringing in four more bytes when the length exceeds 32k. -- DaveA