Re: [Tutor] Fwd: Difference between types

2013-05-31 Thread Prasad, Ramit
eryksun wrote: > > Also, when you post code remember to use less than 70 characters per > line. Gmail has a 'feature' to automatically hard wrap plain-text > messages at about 70 characters, which it applies *after* you send > (i.e. there's no indicator in the composer... brilliant). It is not th

Re: [Tutor] Fwd: Difference between types

2013-05-26 Thread Steven D'Aprano
On 25/05/13 02:52, Citizen Kant wrote: When I say "coding", anyone can think about what coding is in his own daily work, but that's not my way. I'll try to refine the concept: right now I'm learning, if I say "coding" I refer to what I type inside my file named learningpythoncode.py that, believe

Re: [Tutor] Fwd: Difference between types

2013-05-25 Thread eryksun
On Fri, May 24, 2013 at 2:53 PM, Albert-Jan Roskam wrote: > Why do I need to use a trailing comma to create a singleton > tuple? Without a comma it seems to mean "parenthesized single > object", ie the parentheses are basically not there. Here are some technical notes and references to augment th

Re: [Tutor] Fwd: Difference between types

2013-05-25 Thread Mark Lawrence
On 25/05/2013 15:56, Dave Angel wrote: On 05/25/2013 08:54 AM, Albert-Jan Roskam wrote: From: Dave Angel The empty tuple is specified with (). But for any tuple with one or more members, it's the commas that turn it into a tuple. The parens are not necessarily needed unless the

Re: [Tutor] Fwd: Difference between types

2013-05-25 Thread Dave Angel
On 05/25/2013 08:54 AM, Albert-Jan Roskam wrote: From: Dave Angel The empty tuple is specified with (). But for any tuple with one or more members, it's the commas that turn it into a tuple. The parens are not necessarily needed unless the statement is complex enough that we need

Re: [Tutor] Fwd: Difference between types

2013-05-25 Thread Steven D'Aprano
On 25/05/13 22:54, Albert-Jan Roskam wrote: From: Dave Angel So x = 3,4 makes a one-tuple out of 3 and 4. Dave means a two-tuple here. If you want a one-tuple (which is NOT a singleton), you need a silly-looking comma to specify it: So you say the term singleton is reserved to on

Re: [Tutor] Fwd: Difference between types

2013-05-25 Thread Albert-Jan Roskam
> From: Dave Angel >To: tutor@python.org >Sent: Friday, May 24, 2013 9:10 PM >Subject: Re: [Tutor] Fwd: Difference between types > > >On 05/24/2013 02:53 PM, Albert-Jan Roskam wrote: >> >> >>> A tuple is defined by commas, depending on context. Howev

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread Dave Angel
On 05/24/2013 02:53 PM, Albert-Jan Roskam wrote: A tuple is defined by commas, depending on context. However, parentheses are typically required because commas have low precedence. >>> 1, 2 + 3, 4 (1, 5, 4) >>> (1, 2) + (3, 4) (1, 2, 3, 4) An empty tuple is a special cas

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread Albert-Jan Roskam
> A tuple is defined by commas, depending on context. However, > parentheses are typically required because commas have low precedence. > >     >>> 1, 2 + 3, 4 >     (1, 5, 4) > >     >>> (1, 2) + (3, 4) >     (1, 2, 3, 4) > > An empty tuple is a special case: > >     >>> x = () >     >>> typ

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread Citizen Kant
It's perfect, even if I'm not able to understand everything that's stated there. Then 2.5 is Operators, and 2.6 is Delimiters, that also goes in the line of what I'm thinking about. Thanks for the "you seem to be talking about", coz I'm learning not by memory but trying to understand, and sometime

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread eryksun
On Fri, May 24, 2013 at 12:52 PM, Citizen Kant wrote: > They are values since they cannot be reduced by rewriting any further. You seem to be talking about the "atoms" of the language: identifiers, literals, parenthesized forms, displays, and so on. Please read sections 2.3 (identifiers), 2.4 (li

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread eryksun
On Fri, May 24, 2013 at 7:04 AM, Citizen Kant wrote: > Same happens with the tuple (100, 'value', 2); where parenthesis and semi > colon work as a rule, setting the shape of a value named tuple that's > different to the shape of a value named list. At the same time both shapes > are equal (since

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread Citizen Kant
When I say "coding", anyone can think about what coding is in his own daily work, but that's not my way. I'll try to refine the concept: right now I'm learning, if I say "coding" I refer to what I type inside my file named learningpythoncode.py that, believe it or not, starts with: # """After the

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread eryksun
On Fri, May 24, 2013 at 9:31 AM, Citizen Kant wrote: > Sorry. I'm not doing this on purpose, but I'm doing it anyway, so I'll check > how to fix it. You're replying with rich text, for which Gmail has a lot of its own custom CSS (e.g. the gmail_quote class). In Gmail I see the quoted text as a pu

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread Citizen Kant
Sorry. I'm not doing this on purpose, but I'm doing it anyway, so I'll check how to fix it. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread Steven D'Aprano
Citizen Kant, will you please fix your email quoting? As it is, you are plagiarizing me, by quoting me word for word without attribution or any hint that you are quoting me. Do you notice that everyone else quotes people by name, and prefixes their words with > quote marks? This is the normal

Re: [Tutor] Fwd: Difference between types

2013-05-24 Thread Dave Angel
On 05/24/2013 07:04 AM, Citizen Kant wrote: Are you referring to this definition? http://en.wikipedia.org/wiki/**Value_%28computer_science%29 Any chance you can fix your use of gmail to conform to the usual standards? It does it rig

[Tutor] Fwd: Difference between types

2013-05-24 Thread Citizen Kant
Are you referring to this definition? http://en.wikipedia.org/wiki/**Value_%28computer_science%29 As far as it goes, that's not an unreasonable rule of thumb, but it isn't bullet-proof. What, for example, do you make of this: 0x09 Is th