| Deutsch English Français Italiano |
|
<v5bi4k$7182$5@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Sebastian Wells <sebastian@here.com.invalid> Newsgroups: comp.lang.python Subject: Re: Lists in Python versus other languages Date: Mon, 24 Jun 2024 10:35:00 -0000 (UTC) Organization: A noiseless patient Spider Lines: 36 Message-ID: <v5bi4k$7182$5@dont-email.me> References: <LISP-20240624112258@ram.dialup.fu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 24 Jun 2024 12:35:01 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2787d93bb44b66d3fe4dceb9b5d2d9b9"; logging-data="230658"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/obmX9EQ6ALTEzj61yuVtKv1M5fL3h050=" User-Agent: Pan/0.154 (Izium; 517acf4) Cancel-Lock: sha1:PQ13ZfpXxxaPgtrvUtpIMAnjkyw= Bytes: 2093 On 24 Jun 2024 10:24:27 GMT, Stefan Ram wrote: > Sebastian Wells <sebastian@here.com.invalid> wrote or quoted: |..etc, > taking into account that Python "lists" are really |arrays, and there's > no real Lisp equivalent to tuples, > > Well, you could say that, in LISP, the dotted pair > > ( 1 . ( 2 . NIL )) > > represents the list (1 2) while > > ( 1 . 2 ) > > represent the tuple "1,2". > > |but they're essentially arrays also. The thing that makes Python tuples different from Python lists is that tuples are immutable. Lisp doesn't have a type that is "a list (or array) but it's immutable." > |Lisp, there's no reader that will give you the original structure |from > its string representation without having to also evaluate it > > In Python, the ast module can yield the structure of a module of > Python code (including list and tuple literals) without the need to > execute that code. > It doesn't yield actual lists or tuples, so you can't use it the way OP was suggesting, that is, the way you'd use the corresponding Lisp feature.