Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #71001 > unrolled thread
| Started by | Ned Batchelder <ned@nedbatchelder.com> |
|---|---|
| First post | 2014-05-06 21:19 -0400 |
| Last post | 2014-05-08 10:47 -0400 |
| Articles | 15 on this page of 155 — 34 participants |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: The “does Python have variables?” debate Ned Batchelder <ned@nedbatchelder.com> - 2014-05-06 21:19 -0400
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-07 09:18 +0300
Re: The “does Python have variables?” debate Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-07 09:51 +0100
Re: The “does Python have variables?” debate Ethan Furman <ethan@stoneleaf.us> - 2014-05-07 06:00 -0700
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-07 17:17 +0300
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-08 00:30 +1000
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-08 00:14 +1000
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-07 17:20 +0300
Re: The “does Python have variables?” debate Jerry Hill <malaclypse2@gmail.com> - 2014-05-07 11:48 -0400
Re: The “does Python have variables?” debate Mark H Harris <harrismh777@gmail.com> - 2014-05-07 14:31 -0500
Re: The “does Python have variables?” debate Ben Finney <ben@benfinney.id.au> - 2014-05-08 05:57 +1000
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-08 00:15 +0300
Re: The “does Python have variables?” debate Mark H Harris <harrismh777@gmail.com> - 2014-05-07 16:35 -0500
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-08 01:27 +0000
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-08 12:09 +1000
Re: The “does Python have variables?” debate Steven D'Aprano <steve@pearwood.info> - 2014-05-08 03:41 +0000
Re: The “does Python have variables?” debate Dan Sommers <dan@tombstonezero.net> - 2014-05-08 03:43 +0000
Re: The “does Python have variables?” debate Mark H Harris <harrismh777@gmail.com> - 2014-05-09 17:34 -0500
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-10 01:11 +0000
Re: The “does Python have variables?” debate Larry Hudson <orgnut@yahoo.com> - 2014-05-10 00:46 -0700
Re: The “does Python have variables?” debate Ben Finney <ben@benfinney.id.au> - 2014-05-08 10:35 +1000
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-08 01:32 +0000
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-08 09:19 +0300
Re: The “does Python have variables?” debate Ben Finney <ben@benfinney.id.au> - 2014-05-08 16:40 +1000
Re: The "does Python have variables?" debate Rustom Mody <rustompmody@gmail.com> - 2014-05-07 23:50 -0700
Re: The "does Python have variables?" debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-08 10:03 +0300
Re: The “does Python have variables?” debate Ned Batchelder <ned@nedbatchelder.com> - 2014-05-07 21:33 -0400
Re: The “does Python have variables?” debate Johannes Schneider <johannes.schneider@galileo-press.de> - 2014-05-08 09:26 +0200
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-09 00:54 +0000
Re: The “does Python have variables?” debate Joseph Martinot-Lagarde <joseph.martinot-lagarde@m4x.org> - 2014-05-08 10:07 +0200
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-08 18:14 +1000
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-08 13:22 +0000
Re: The “does Python have variables?” debate Ben Finney <ben@benfinney.id.au> - 2014-05-08 18:34 +1000
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-08 12:43 +0300
Re: The “does Python have variables?” debate Ben Finney <ben@benfinney.id.au> - 2014-05-08 21:14 +1000
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-08 15:01 +0300
Re: The “does Python have variables?” debate Ben Finney <ben@benfinney.id.au> - 2014-05-09 05:14 +1000
Re: The “does Python have variables?” debate Ethan Furman <ethan@stoneleaf.us> - 2014-05-08 14:50 -0700
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-09 00:02 +0000
Re: The � debate Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-05-09 13:10 +1200
Re: The � debate Ben Finney <ben@benfinney.id.au> - 2014-05-09 13:13 +1000
Re: The � debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-10 01:34 +0000
Re: The � debate Mark H Harris <harrismh777@gmail.com> - 2014-05-09 21:34 -0500
Re: The � debate Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-05-10 17:58 +1200
Re: The � debate Chris Angelico <rosuav@gmail.com> - 2014-05-10 17:10 +1000
Re: The � debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-10 07:48 +0000
Re: The � debate Chris Angelico <rosuav@gmail.com> - 2014-05-10 18:01 +1000
Re: The � debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-10 11:21 +0300
Re: The � debate Rustom Mody <rustompmody@gmail.com> - 2014-05-10 02:05 -0700
Re: The � debate Ethan Furman <ethan@stoneleaf.us> - 2014-05-10 12:30 -0700
Re: The � debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-10 11:18 +0300
Re: The � debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-10 09:31 +0000
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-08 13:18 +0000
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-08 23:46 +1000
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-08 14:22 +0000
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-09 00:51 +1000
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-08 16:04 +0000
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-09 02:10 +1000
Re: The “does Python have variables?” debate Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-08 21:02 -0400
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-09 01:32 +0000
Re: The “does Python have variables?” debate Roy Smith <roy@panix.com> - 2014-05-08 22:21 -0400
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-09 12:31 +1000
Re: The "does Python have variables?" debate Rustom Mody <rustompmody@gmail.com> - 2014-05-08 22:40 -0700
Re: The "does Python have variables?" debate Chris Angelico <rosuav@gmail.com> - 2014-05-09 15:51 +1000
Re: The "does Python have variables?" debate Rustom Mody <rustompmody@gmail.com> - 2014-05-09 07:09 -0700
Re: The "does Python have variables?" debate Chris Angelico <rosuav@gmail.com> - 2014-05-10 00:29 +1000
Re: The "does Python have variables?" debate Rustom Mody <rustompmody@gmail.com> - 2014-05-09 09:07 -0700
Re: The “does Python have variables?â€瑩 debate Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-09 19:51 -0400
Re: The “does Python have variables?â€瑩 debate Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-10 01:03 +0100
Fortran (Was: The "does Python have variables?" debate) Roy Smith <roy@panix.com> - 2014-05-10 09:42 -0400
Re: Fortran (Was: The "does Python have variables?" debate) Terry Reedy <tjreedy@udel.edu> - 2014-05-10 14:31 -0400
Re: Fortran (Was: The "does Python have variables?" debate) Mark H Harris <harrismh777@gmail.com> - 2014-05-11 01:17 -0500
Re: Fortran (Was: The "does Python have variables?" debate) Rustom Mody <rustompmody@gmail.com> - 2014-05-11 00:01 -0700
Re: Fortran (Was: The "does Python have variables?" debate) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-11 07:09 +0000
Re: Fortran (Was: The "does Python have variables?" debate) Tomasz Rola <rtomek@ceti.pl> - 2014-05-11 18:09 +0200
Re: Fortran Marko Rauhamaa <marko@pacujo.net> - 2014-05-11 19:27 +0300
Re: Fortran Roy Smith <roy@panix.com> - 2014-05-11 13:51 -0400
Re: Fortran Chris Angelico <rosuav@gmail.com> - 2014-05-12 04:08 +1000
Re: Fortran Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-11 23:51 +0000
Re: Fortran Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-12 01:27 +0100
Re: Fortran Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-12 02:28 +0000
Re: Fortran Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-12 10:05 +0100
Re: Fortran Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-12 20:52 -0400
Re: Fortran Ethan Furman <ethan@stoneleaf.us> - 2014-05-11 11:05 -0700
Re: Fortran Chris Angelico <rosuav@gmail.com> - 2014-05-12 04:33 +1000
Re: Fortran Roy Smith <roy@panix.com> - 2014-05-11 14:43 -0400
Re: Fortran Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-11 23:15 +0000
Re: Fortran MRAB <python@mrabarnett.plus.com> - 2014-05-12 00:51 +0100
Re: Fortran Roy Smith <roy@panix.com> - 2014-05-11 20:14 -0400
Re: Fortran alister <alister.nospam.ware@ntlworld.com> - 2014-05-12 14:14 +0000
Re: Fortran Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-12 01:11 +0000
Re: Fortran Dave Angel <d@davea.name> - 2014-05-11 23:27 -0400
Re: Fortran Grant Edwards <invalid@invalid.invalid> - 2014-05-12 14:07 +0000
Re: Fortran Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-11 21:12 -0400
Re: Fortran (Was: The "does Python have variables?" debate) Chris Angelico <rosuav@gmail.com> - 2014-05-12 02:42 +1000
Re: Fortran Tomasz Rola <rtomek@ceti.pl> - 2014-05-11 20:04 +0200
Re: Fortran Chris Angelico <rosuav@gmail.com> - 2014-05-12 04:12 +1000
Re: Fortran (Was: The "does Python have variables?" debate) Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2014-05-11 19:05 +0200
Re: Fortran (Was: The "does Python have variables?" debate) Mark H Harris <harrismh777@gmail.com> - 2014-05-11 13:54 -0500
Re: Fortran (Was: The "does Python have variables?" debate) Chris Angelico <rosuav@gmail.com> - 2014-05-12 04:59 +1000
Re: Fortran (Was: The "does Python have variables?" debate) Mark H Harris <harrismh777@gmail.com> - 2014-05-11 14:14 -0500
Re: Fortran (Was: The "does Python have variables?" debate) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-05-29 14:06 +0000
Re: Fortran (Was: The "does Python have variables?" debate) Peter Pearson <ppearson@nowhere.invalid> - 2014-05-29 17:53 +0000
Re: Fortran (Was: The "does Python have variables?" debate) Dave Angel <davea@davea.name> - 2014-05-11 23:10 -0400
Re: Fortran (Was: The "does Python have variables?" debate) Mark H Harris <harrismh777@gmail.com> - 2014-05-11 23:10 -0500
Re: Fortran (Was: The "does Python have variables?" debate) Mark H Harris <harrismh777@gmail.com> - 2014-05-11 23:26 -0500
Re: Fortran (Was: The "does Python have variables?" debate) Chris Angelico <rosuav@gmail.com> - 2014-05-12 14:53 +1000
Re: Fortran (Was: The "does Python have variables?" debate) Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2014-05-12 10:44 +0200
Re: Fortran (Was: The "does Python have variables?" debate) Mark H Harris <harrismh777@gmail.com> - 2014-05-13 00:33 -0500
Re: Fortran (Was: The "does Python have variables?" debate) Steven D'Aprano <steve@pearwood.info> - 2014-05-13 05:48 +0000
Re: Fortran (Was: The "does Python have variables?" debate) Mark H Harris <harrismh777@gmail.com> - 2014-05-13 00:55 -0500
Re: Fortran (Was: The "does Python have variables?" debate) Chris Angelico <rosuav@gmail.com> - 2014-05-13 15:56 +1000
Re: Fortran (Was: The "does Python have variables?" debate) Steven D'Aprano <steve@pearwood.info> - 2014-05-13 09:34 +0000
Re: Fortran (Was: The "does Python have variables?" debate) Chris Angelico <rosuav@gmail.com> - 2014-05-13 20:00 +1000
Re: Fortran (Was: The "does Python have variables?" debate) Rustom Mody <rustompmody@gmail.com> - 2014-05-13 03:44 -0700
Re: Fortran (Was: The "does Python have variables?" debate) Chris Angelico <rosuav@gmail.com> - 2014-05-13 20:50 +1000
Re: Fortran (Was: The "does Python have variables?" debate) Gene Heskett <gheskett@wdtv.com> - 2014-05-13 02:31 -0400
Re: Fortran (Was: The "does Python have variables?" debate) Steven D'Aprano <steve@pearwood.info> - 2014-05-13 07:22 +0000
Re: Fortran (Was: The "does Python have variables?" debate) Roy Smith <roy@panix.com> - 2014-05-13 07:16 -0400
Re: Fortran (Was: The "does Python have variables?" debate) Chris Angelico <rosuav@gmail.com> - 2014-05-13 21:21 +1000
Re: Fortran (Was: The "does Python have variables?" debate) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-13 14:42 +0100
Re: Fortran (Was: The "does Python have variables?" debate) Gene Heskett <gheskett@wdtv.com> - 2014-05-13 07:42 -0400
Re: Fortran Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2014-05-13 19:33 +0200
Re: Fortran Marko Rauhamaa <marko@pacujo.net> - 2014-05-13 22:57 +0300
Re: Fortran Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-14 00:10 +0000
Re: Fortran Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-13 21:43 -0600
Re: Fortran Marko Rauhamaa <marko@pacujo.net> - 2014-05-14 07:35 +0300
Re: Fortran Steven D'Aprano <steve@pearwood.info> - 2014-05-14 06:58 +0000
Re: Fortran Marko Rauhamaa <marko@pacujo.net> - 2014-05-14 11:46 +0300
Re: Fortran Sturla Molden <sturla.molden@gmail.com> - 2014-05-14 23:05 +0000
struct.unpack: why 's' fmt char convert to bytestring GuoChao <cx63@outlook.com> - 2014-05-15 20:34 +0800
Re: struct.unpack: why 's' fmt char convert to bytestring Dave Angel <davea@davea.name> - 2014-05-15 09:49 -0400
Re: struct.unpack: why 's' fmt char convert to bytestring MRAB <python@mrabarnett.plus.com> - 2014-05-15 15:47 +0100
Re: Fortran Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2014-05-14 15:13 +0200
Re: Fortran albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-05-29 14:26 +0000
Re: Fortran Marko Rauhamaa <marko@pacujo.net> - 2014-05-29 17:50 +0300
Re: Fortran Chris Angelico <rosuav@gmail.com> - 2014-05-30 00:58 +1000
Re: Fortran Marko Rauhamaa <marko@pacujo.net> - 2014-05-29 18:09 +0300
Re: Fortran Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-29 17:57 +0000
Re: Fortran Marko Rauhamaa <marko@pacujo.net> - 2014-05-29 21:55 +0300
Re: The “does Python have variables?” debate Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-09 09:13 +0100
Re: The “does Python have variables?” debate Michael Torrie <torriem@gmail.com> - 2014-05-08 08:06 -0600
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-09 00:13 +1000
Re: The “does Python have variables?” debate Terry Reedy <tjreedy@udel.edu> - 2014-05-08 15:21 -0400
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-08 23:06 +0300
Re: The “does Python have variables?” debate Ethan Furman <ethan@stoneleaf.us> - 2014-05-08 15:36 -0700
Re: The “does Python have variables?” debate Ethan Furman <ethan@stoneleaf.us> - 2014-05-08 17:05 -0700
Re: The “does Python have variables?” debate Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-09 01:47 +0100
Re: The “does Python have variables?” debate Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-08 00:57 +0000
Re: The “does Python have variables?” debate Roy Smith <roy@panix.com> - 2014-05-08 08:41 -0400
Re: The “does Python have variables?” debate Chris Angelico <rosuav@gmail.com> - 2014-05-08 22:54 +1000
Re: The “does Python have variables?” debate Ethan Furman <ethan@stoneleaf.us> - 2014-05-08 06:18 -0700
Re: The “does Python have variables?” debate Marko Rauhamaa <marko@pacujo.net> - 2014-05-08 17:03 +0300
Re: The “does Python have variables?” debate Ethan Furman <ethan@stoneleaf.us> - 2014-05-08 16:09 -0700
Re: The “does Python have variables?” debate "Neil D. Cerutti" <neilc@norwich.edu> - 2014-05-08 10:47 -0400
Page 8 of 8 — ← Prev page 1 2 3 4 5 6 7 [8]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2014-05-09 09:13 +0100 |
| Message-ID | <mailman.9814.1399623212.18130.python-list@python.org> |
| In reply to | #71112 |
On 09/05/2014 02:02, Dennis Lee Bieber wrote: > On 08 May 2014 16:04:51 GMT, Steven D'Aprano > <steve+comp.lang.python@pearwood.info> declaimed the following: > >> Personally, I think that trying to be general and talk about "many other >> languages" is a failing strategy. Better to be concrete: C, Pascal, >> Algol, Fortran, VB (I think) are good examples of the "value in a box at >> a fixed location" model. Of those, Algol, Pascal and Fortran are either >> obsolete or legacy, and C is by far the most well-known by people here. >> (For some reason, few people seem to migrate from VB to Python.) Hence, >> "C-like". >> > > Obsolete and Legacy? Fortran still receives regular standards updates > (currently 2008, with the next revision due in 2015). > http://arstechnica.com/science/2014/05/scientific-computings-future-can-any-coding-language-top-a-1950s-behemoth/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
[toc] | [prev] | [next] | [standalone]
| From | Michael Torrie <torriem@gmail.com> |
|---|---|
| Date | 2014-05-08 08:06 -0600 |
| Message-ID | <mailman.9780.1399558017.18130.python-list@python.org> |
| In reply to | #71095 |
On 05/08/2014 07:18 AM, Steven D'Aprano wrote: > Nobody has suggested flogging anyone, not even figuratively. Unless you > believe that correcting a misapprehension, no matter how gently it is > done, is a flogging, I don't see how you draw the conclusion that Ben is > talking about flogging anyone. Agreed, although this entire thread of conversation kind of illustrates a kind of debating of issues that happen regularly on this mailing list and probably does turn off a lot of newbies, and probably turned off the original poster a long time ago. Kind of reminds me of the three-headed knight scene in Monty Python. While the heads debate amongst themselves, Robin sneaks off and the heads don't even notice. Here, someone comes along and asks the list a question, and while answering the question, the discussion rapidly takes off in its own direction as members debate some underlying fact that may or may not be important to the original poster. In fact by now I'm sure most people have completely forgotten the original post entirely and I'm can't even remember if we even answered his question. But I am pretty sure he's long gone from the lists. Of course there is also a problem of drive-by questions on this list, so we often never know if the poster did get an answer. Obviously there's nothing wrong with having this discussion in general. I think it's been quite interesting.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-05-09 00:13 +1000 |
| Message-ID | <mailman.9781.1399558387.18130.python-list@python.org> |
| In reply to | #71095 |
On Fri, May 9, 2014 at 12:06 AM, Michael Torrie <torriem@gmail.com> wrote: > Agreed, although this entire thread of conversation kind of illustrates > a kind of debating of issues that happen regularly on this mailing list > and probably does turn off a lot of newbies, and probably turned off the > original poster a long time ago. The subject line has been changed. I don't see a problem with tangential discussions that were spawned by someone's question. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2014-05-08 15:21 -0400 |
| Message-ID | <mailman.9794.1399576909.18130.python-list@python.org> |
| In reply to | #71054 |
On 5/8/2014 4:14 AM, Chris Angelico wrote: > On Thu, May 8, 2014 at 6:07 PM, Joseph Martinot-Lagarde > <joseph.martinot-lagarde@m4x.org> wrote: >> For me, names bound to values is the same concept as pointer pointing to >> memory. You are missing a level of indirection. In CPython, a name (always in some namespace) represents a pointer to a pointer. The first pointer is calculated as an offset from the base pointer of the namespace. For a C array namespace (used for functions), the offset is constant (for that function and namespace). For a python dict namespace, the offset is calculated from the hash of the name, the size of the dict, and the previous contents of the hash table. This complication allows the namespace to grow and shrink. In either case, the second pointer if overwritten to 'rebind' the name. >> bar = foo copies the pointer and not the underlying memory. It copies the second pointer of foo, in the underlying memory pointed at by the foo's first pointer, to the memory pointed at by bar's first pointer. >> This is not a foreign concept to C programmers. Once one gets the indirection correct. > That is how it's implemented in CPython, after all... modulo the whole > refcounting thing, of course. But that's not strictly a part of the > definition of Python; it's just implementation. You could implement > Python on pencil-and-paper (aka a dry run), and as long as you have a > concept of names that reference objects, it's going to be fine. For paper-aided mental execution, most people would not bother to implement version and run dependent features, such as 'id()' and most of the possible uses of 'is' (other than 'is None', etc.). For code that also avoids such features, such shortcuts would indeed be fine. > "reference" might be done with a physical piece of string connecting a > Post-It note with a name to a box with the object's state, meaning > there's no way of copying any pointer, and it's still Python. -- Terry Jan Reedy
[toc] | [prev] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2014-05-08 23:06 +0300 |
| Message-ID | <87lhuct4qk.fsf@elektro.pacujo.net> |
| In reply to | #71122 |
Terry Reedy <tjreedy@udel.edu>:
>> On Thu, May 8, 2014 at 6:07 PM, Joseph Martinot-Lagarde
>> <joseph.martinot-lagarde@m4x.org> wrote:
>>> For me, names bound to values is the same concept as pointer
>>> pointing to memory.
>
> You are missing a level of indirection. In CPython, a name (always in
> some namespace) represents a pointer to a pointer. The first pointer
> is calculated as an offset from the base pointer of the namespace. For
> a C array namespace (used for functions), the offset is constant (for
> that function and namespace). For a python dict namespace, the offset
> is calculated from the hash of the name, the size of the dict, and the
> previous contents of the hash table. This complication allows the
> namespace to grow and shrink. In either case, the second pointer if
> overwritten to 'rebind' the name.
Terry, you are talking about an implementation. Joseph is talking about
the concept.
You can tell a C programmer that a Python variable always holds a
pointer to an object, and they get the idea right away ("Oh, so '.' in
Python is the same as '->' in C") and start producing efficient, correct
Python code.
Marko
[toc] | [prev] | [next] | [standalone]
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Date | 2014-05-08 15:36 -0700 |
| Message-ID | <mailman.9800.1399591581.18130.python-list@python.org> |
| In reply to | #71127 |
On 05/08/2014 01:06 PM, Marko Rauhamaa wrote:
> Terry Reedy <tjreedy@udel.edu>:
>
>>> On Thu, May 8, 2014 at 6:07 PM, Joseph Martinot-Lagarde
>>> <joseph.martinot-lagarde@m4x.org> wrote:
>>>> For me, names bound to values is the same concept as pointer
>>>> pointing to memory.
>>
>> You are missing a level of indirection. In CPython, a name (always in
>> some namespace) represents a pointer to a pointer. The first pointer
>> is calculated as an offset from the base pointer of the namespace. For
>> a C array namespace (used for functions), the offset is constant (for
>> that function and namespace). For a python dict namespace, the offset
>> is calculated from the hash of the name, the size of the dict, and the
>> previous contents of the hash table. This complication allows the
>> namespace to grow and shrink. In either case, the second pointer if
>> overwritten to 'rebind' the name.
>
> Terry, you are talking about an implementation. Joseph is talking about
> the concept.
>
> You can tell a C programmer that a Python variable always holds a
> pointer to an object, and they get the idea right away ("Oh, so '.' in
> Python is the same as '->' in C") and start producing efficient, correct
> Python code.
Right up until they want to dereference.
--
~Ethan~
[toc] | [prev] | [next] | [standalone]
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Date | 2014-05-08 17:05 -0700 |
| Message-ID | <mailman.9803.1399595191.18130.python-list@python.org> |
| In reply to | #71054 |
Back when I was trying to learn the differences between Python's name-binding and C-like variables, a couple folks stepped up and provided great assistance. This first email, while delving into details that are not accessible in Python, still helped a great deal: https://mail.python.org/pipermail/python-list/2009-February/526880.html This next explained why the previous, while accurate from a CS standpoint, was not useful in Python as Python simply does not allow access to one of the layers, so trying to think about that layer when working with Python is not productive: https://mail.python.org/pipermail/python-list/2009-February/526909.html -- ~Ethan~
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2014-05-09 01:47 +0100 |
| Message-ID | <mailman.9804.1399596462.18130.python-list@python.org> |
| In reply to | #71054 |
On 09/05/2014 01:05, Ethan Furman wrote: > Back when I was trying to learn the differences between Python's > name-binding and C-like variables, a couple folks stepped up and > provided great assistance. > > This first email, while delving into details that are not accessible in > Python, still helped a great deal: > > https://mail.python.org/pipermail/python-list/2009-February/526880.html > > > This next explained why the previous, while accurate from a CS > standpoint, was not useful in Python as Python simply does not allow > access to one of the layers, so trying to think about that layer when > working with Python is not productive: > > https://mail.python.org/pipermail/python-list/2009-February/526909.html > > -- > ~Ethan~ Please, please can the link directly above be regarded as the final, final say on this matter? Thank you in anticipation. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2014-05-08 00:57 +0000 |
| Message-ID | <536ad67b$0$29965$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #71036 |
On Wed, 07 May 2014 11:48:15 -0400, Jerry Hill wrote: > On Wed, May 7, 2014 at 2:18 AM, Marko Rauhamaa <marko@pacujo.net> wrote: >> Ned Batchelder <ned@nedbatchelder.com>: >> >>> Why is "variable" sacrosanct and can only be used to describe C >>> semantics, but we're OK reusing class, int, and function? >> >> The Python language specification calls them variables; the terminology >> discussion should end there. > > Personally, I found the idea that a python variable is a name + value > pairing to be useful when learning the language, especially when I was > struggling with the calling semantics (that is, the differences between > call-by-value, call-by-reference, and call-by-object). I think it's > rather silly for someone to insist that python doesn't have variables. > On the other hand, I think it can be useful to point out that python > variable aren't like C variables, and that thinking of python variables > as having two parts -- names and values -- really can help people who > are struggling to learn the language. I know it certainly helped me. +1 I was in the same position, and I found that while I saw people talking about "name bindings" and similar, the difference never sank in until somebody (I forget who) said "Python doesn't have variables, it has name bindings". Until then, I was still labouring under the misapprehension that my mental model of variables I learned from Pascal (equivalent to that of C) applied to Python too. Being exposed to an outrageous claim like "Python has no variables" lead me to question my assumptions. Most of the time, when you're just assigning values to a variable name, it's a difference that makes no difference. But at the edges, you run into some of the differences: * If you think that variables are necessarily known at compile-time, then Python has no variables. * If you think that variables have an address, then Python has no variables. * If you think of variables as a box inside of which the compiler puts a value, then Python has no variables. * If you think of id(x) as the identity of the *name* "x" rather than the identity of the object bound to "x", that is, if you think of id(x) as like a pointer to x, then you are mistaken. -- Steven D'Aprano http://import-that.dreamwidth.org/
[toc] | [prev] | [next] | [standalone]
| From | Roy Smith <roy@panix.com> |
|---|---|
| Date | 2014-05-08 08:41 -0400 |
| Message-ID | <roy-682174.08413008052014@news.panix.com> |
| In reply to | #71036 |
In article <mailman.9742.1399477705.18130.python-list@python.org>,
Jerry Hill <malaclypse2@gmail.com> wrote:
> thinking of python variables as having two parts -- names and values
> -- really can help people who are struggling to learn the language.
There's many levels of learning, and we see them all on this list.
For people who are just learning programming, and are learning Python as
their first language, we need to keep things simple. These are the
people who are still struggling to understand basic concepts such as
algorithms, loops, and the most fundamental data structures. For those
people, talking about variables as a container to hold a value is the
right level of abstraction.
At some point, that model no longer fits reality well enough that it
becomes a barrier to further learning. When I write:
def mutate(x, y):
x = 42
y[0] = 42
x = 4
y = [4]
mutate(x, y)
print x, y
and run it, unless I really understand about name binding and argument
passing, I'm going to be totally befuddled by the result. At that
point, I need to unlearn something I thought I understood, and that's
really hard (en.wikipedia.org/wiki/Principles_of_learning#Primacy).
So, this leads us to the classic dilemma in teaching. If I simplify
things at first, it's easier to learn initially, but I'm setting the
student up for problems later. If I try to be 100% correct about
everything initially, it's like drinking from a firehose. It's hard to
say which is better. I do know that when I first learned F = M * A in
high-school physics, we didn't worry about what happens if the M is
moving very fast, or is very small, or if its quarks are spinning in the
wrong direction.
OK, so that takes care of newbies. There's another whole class of
people who learn Python. These are the people who have been doing this
for a long time. They already know several of C, C++, Java, Lisp,
Javascript, Go, Fortran, Pascal, Forth, etc. For them, learning a new
language is an entirely different process from the newbie. For them,
it's just a matter of "Oh, yeah, Python does classes this way, and has
that kind of scoping, and the standard library includes this bunch of
data structures, and ints are really bignums, and this flavor of
strings, and there's some funky whitespace thing going on". Those are
the people who want to know about name binding up front.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-05-08 22:54 +1000 |
| Message-ID | <mailman.9776.1399553673.18130.python-list@python.org> |
| In reply to | #71093 |
On Thu, May 8, 2014 at 10:41 PM, Roy Smith <roy@panix.com> wrote:
> At some point, that model no longer fits reality well enough that it
> becomes a barrier to further learning. When I write:
>
> def mutate(x, y):
> x = 42
> y[0] = 42
>
> x = 4
> y = [4]
>
> mutate(x, y)
> print x, y
>
> and run it, unless I really understand about name binding and argument
> passing, I'm going to be totally befuddled by the result.
Easiest way to explain that is probably to just say, right at the
beginning, that *assignment to a name is special*. When you assign to
x inside mutate(), stuff happens. You're not assigning to y, so
different stuff happens. If you called a method on y, or anything like
that, it'd be the same kind of "stuff" as you're seeing here; but
assigning directly to the name is a different sort of operation from
everything else. (Explaining the difference between "x = x + 1" and "x
+= 1" can come later. MUCH later, probably when you try to augassign
to a tuple's element.)
The advantage of singling out assignment is that, as well as handling
the difference between rebinding and mutation, it also picks up the
magic "this is now local" mode change. Compare:
x = [1,2,3]
def mutate1():
x += [4]
def mutate2():
x.append(4)
One of them needs a 'global' declaration to work, and the other
doesn't, because assigning is special.
ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Date | 2014-05-08 06:18 -0700 |
| Message-ID | <mailman.9777.1399556543.18130.python-list@python.org> |
| In reply to | #71093 |
On 05/08/2014 05:41 AM, Roy Smith wrote: > In article <mailman.9742.1399477705.18130.python-list@python.org>, > Jerry Hill <malaclypse2@gmail.com> wrote: > >> thinking of python variables as having two parts -- names and values >> -- really can help people who are struggling to learn the language. > > There's many levels of learning, and we see them all on this list. > > For people who are just learning programming, and are learning Python as > their first language, we need to keep things simple. These are the > people who are still struggling to understand basic concepts such as > algorithms, loops, and the most fundamental data structures. For those > people, talking about variables as a container to hold a value is the > right level of abstraction. -1 There is nothing wrong with simplifying concepts for newbies, but use one that fits the language. There is nothing difficult with either the sticky note analogy or the pieces of paper and a string analogy. Teaching someone that Python variables are containers is a massive fail. > OK, so that takes care of newbies. There's another whole class of > people who learn Python. These are the people who have been doing this > for a long time. There's also the whole class of programmers who only know one language, or only a small handful of related languages that all pretty much operate the same as far as variables are concerned. The simple analogies is also helpful for them. -- ~Ethan~
[toc] | [prev] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2014-05-08 17:03 +0300 |
| Message-ID | <87y4ycfjuj.fsf@elektro.pacujo.net> |
| In reply to | #71099 |
Ethan Furman <ethan@stoneleaf.us>: > On 05/08/2014 05:41 AM, Roy Smith wrote: >> For those people, talking about variables as a container to hold a >> value is the right level of abstraction. > > [...] > > Teaching someone that Python variables are containers is a massive fail. But that's what they are. We are really debating on the suitability of a metaphor. The palm of my hand is a "container" for a horse. You can ask, Which horse are you holding? when it's only the reins I'm holding. Or maybe we can think of Python's data model as a city with structures of different sizes and shapes. A variable is a container that holds the address of a structure... Marko
[toc] | [prev] | [next] | [standalone]
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Date | 2014-05-08 16:09 -0700 |
| Message-ID | <mailman.9801.1399591894.18130.python-list@python.org> |
| In reply to | #71102 |
On 05/08/2014 07:03 AM, Marko Rauhamaa wrote: > Ethan Furman <ethan@stoneleaf.us>: >> On 05/08/2014 05:41 AM, Roy Smith wrote: >>> >>> For those people, talking about variables as a container to hold a >>> value is the right level of abstraction. >> >> Teaching someone that Python variables are containers is a massive fail. > > But that's what they are. No, it's not. > We are really debating on the suitability of a metaphor. Exactly. And the "a variable is a box that holds the value" is a great metaphor for languages that assign a name to a fixed location -- languages such as Pascal, Basic, FoxPro, and C. In these languages when you say `a = b` you now have *two* copies of the data (at least for the most part); in Python (and similar languages) you have two *names* for one copy of the data. > Or maybe we can think of Python's data model as a city with structures > of different sizes and shapes. A variable is a container that holds the > address of a structure... If that helps as a stepping stone to a true model, fine; but if that's the final destination of your understanding then you don't truly understand Python's data model. -- ~Ethan~
[toc] | [prev] | [next] | [standalone]
| From | "Neil D. Cerutti" <neilc@norwich.edu> |
|---|---|
| Date | 2014-05-08 10:47 -0400 |
| Message-ID | <mailman.9783.1399560485.18130.python-list@python.org> |
| In reply to | #71093 |
On 5/8/2014 8:41 AM, Roy Smith wrote: > In article <mailman.9742.1399477705.18130.python-list@python.org>, > Jerry Hill <malaclypse2@gmail.com> wrote: > >> thinking of python variables as having two parts -- names and values >> -- really can help people who are struggling to learn the language. > > There's many levels of learning, and we see them all on this list. > > For people who are just learning programming, and are learning Python as > their first language, we need to keep things simple. These are the > people who are still struggling to understand basic concepts such as > algorithms, loops, and the most fundamental data structures. For those > people, talking about variables as a container to hold a value is the > right level of abstraction. > > At some point, that model no longer fits reality well enough that it > becomes a barrier to further learning. When I write: > > def mutate(x, y): > x = 42 > y[0] = 42 > > x = 4 > y = [4] > > mutate(x, y) > print x, y > > and run it, unless I really understand about name binding and argument > passing, I'm going to be totally befuddled by the result. At that > point, I need to unlearn something I thought I understood, and that's > really hard (en.wikipedia.org/wiki/Principles_of_learning#Primacy). The "surprising" things can be demonstrated without using functions. Once assignment statements are mastered, the way argument passing works can be extrapolated. New programmers will have to further be taught about shadowing and scopes, while experienced programmers should already be up and running (until they try to get cute). Of course everybody has to eventually learn about the special syntax usable in function definitions and function calls. -- Neil Cerutti
[toc] | [prev] | [standalone]
Page 8 of 8 — ← Prev page 1 2 3 4 5 6 7 [8]
Back to top | Article view | comp.lang.python
csiph-web