Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread dn via Python-list
On 12/08/2021 10.32, Dennis Lee Bieber wrote: > On Wed, 11 Aug 2021 11:59:11 -0300, Jack Brandom > declaimed the following: >> Where are these production rules coming from? They're not at >> https://docs.python.org/3/reference/grammar.html >> The word ``stride'' doesn't appear in this grammar.

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread dn via Python-list
On 12/08/2021 02.59, Jack Brandom wrote: > dn writes: > ... >> Also, whereas I prefer to illustrate 'how it works', I perceive that you >> are used to learning 'rules' and only thereafter their application (the >> teaching-practice under which most of us learned) - so, another reason >> for mixi

Re: some problems for an introductory python test

2021-08-11 Thread Chris Angelico
On Thu, Aug 12, 2021 at 9:23 AM Dennis Lee Bieber wrote: > > On Thu, 12 Aug 2021 06:15:28 +1000, Chris Angelico > declaimed the following: > > > >The default command interpreter and shell on OS/2 was fairly primitive > >by today's standards, and was highly compatible with the MS-DOS one, > >but i

Re: some problems for an introductory python test

2021-08-11 Thread Dennis Lee Bieber
On Wed, 11 Aug 2021 09:27:38 -0300, Hope Rouselle declaimed the following: > >I wouldn't. This is all Python-stuff. The course chooses a language >like Python, but it is not trying to teach Python --- it is trying to >teach computer programming, that is, strategies in high-precision. >

Re: some problems for an introductory python test

2021-08-11 Thread Dennis Lee Bieber
On Thu, 12 Aug 2021 06:15:28 +1000, Chris Angelico declaimed the following: >The default command interpreter and shell on OS/2 was fairly primitive >by today's standards, and was highly compatible with the MS-DOS one, >but it also had the ability to run REXX scripts. REXX was *way* ahead >of its

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread Dennis Lee Bieber
On Wed, 11 Aug 2021 11:59:11 -0300, Jack Brandom declaimed the following: > >Where are these production rules coming from? They're not at > > https://docs.python.org/3/reference/grammar.html > >The word ``stride'' doesn't appear in this grammar. > Possibly from older versions of the g

Re: some problems for an introductory python test

2021-08-11 Thread Chris Angelico
On Thu, Aug 12, 2021 at 7:25 AM Rob Cliffe via Python-list wrote: > > On 11/08/2021 19:10, MRAB wrote: > > On 2021-08-11 18:10, Wolfram Hinderer via Python-list wrote: > >> > >> > >> Am 11.08.2021 um 05:22 schrieb Terry Reedy: > >>> Python is a little looser about whitespace than one might expect

RE: some problems for an introductory python test

2021-08-11 Thread Avi Gross via Python-list
This conversation has, of course, veered away from the original question so I am starting afresh. My memory of the original question is about how one sets up a test for material covered in class or associated materials for what sounds like a beginner class. I am not sure whether this would be the

Re: some problems for an introductory python test

2021-08-11 Thread Rob Cliffe via Python-list
On 11/08/2021 19:10, MRAB wrote: On 2021-08-11 18:10, Wolfram Hinderer via Python-list wrote: Am 11.08.2021 um 05:22 schrieb Terry Reedy: Python is a little looser about whitespace than one might expect from reading 'normal' code when the result is unambiguous in that it cannot really mean a

Re: some problems for an introductory python test

2021-08-11 Thread Chris Angelico
On Thu, Aug 12, 2021 at 5:00 AM Hope Rouselle wrote: > > Chris Angelico writes: > > > On Wed, Aug 11, 2021 at 4:18 AM Hope Rouselle > > wrote: > >> > >> Chris Angelico writes: > >> > >> [...] > >> > >> >> not disagreeing... and yeah I could have thought deeper about the > >> >> answer, but I s

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread Jack Brandom
dn writes: > Apologies for lateness. That's alright. Thanks for the marvelous post. > Coincidentally, I've been asked to speak to our local Python Users' > Group on slicing. Herewith an attempt to modify those demos around your > data/question. Apologies if the result is thus somewhat lacking

Re: some problems for an introductory python test

2021-08-11 Thread Hope Rouselle
Chris Angelico writes: > On Wed, Aug 11, 2021 at 4:18 AM Hope Rouselle wrote: >> >> Chris Angelico writes: >> >> [...] >> >> >> not disagreeing... and yeah I could have thought deeper about the >> >> answer, but I still think "notthing has been OOP" -> "yes it has, they >> >> just didn't realiz

Re: some problems for an introductory python test

2021-08-11 Thread Hope Rouselle
Chris Angelico writes: > On Wed, Aug 11, 2021 at 4:18 AM Hope Rouselle wrote: >> >> I totally agree with you but I didn't know that even numbers were like >> that in Python. In fact, I still don't quite believe it... >> >> >>> 2.__add__(3) >> SyntaxError: invalid syntax > > Yeah, that's because

Re: some problems for an introductory python test

2021-08-11 Thread Hope Rouselle
Greg Ewing writes: > On 11/08/21 3:22 pm, Terry Reedy wrote: >> Python is a little looser about whitespace than one might expect >> from reading 'normal' code when the result is unambiguous in that it >> cannot really mean anything other than what it does. >> >>> if3: print('yes!') >> yes! > > T

Re: some problems for an introductory python test

2021-08-11 Thread Greg Ewing
On 11/08/21 3:22 pm, Terry Reedy wrote: Python is a little looser about whitespace than one might expect from reading 'normal' code when the result is unambiguous in that it cannot really mean anything other than what it does. >>> if3: print('yes!') yes! That may not be doing what you think

Re: some problems for an introductory python test

2021-08-11 Thread Hope Rouselle
Terry Reedy writes: > On 8/10/2021 5:27 PM, Hope Rouselle wrote: >> Terry Reedy writes: >> >>> On 8/10/2021 9:15 AM, Hope Rouselle wrote: >>> 2.__add__(3) SyntaxError: invalid syntax But then I tried: >>> (2).__add__(3) 5 >>> >>> Add a space is easier. >> 2 .__ad

Re: some problems for an introductory python test

2021-08-11 Thread MRAB
On 2021-08-11 18:10, Wolfram Hinderer via Python-list wrote: Am 11.08.2021 um 05:22 schrieb Terry Reedy: Python is a little looser about whitespace than one might expect from reading 'normal' code when the result is unambiguous in that it cannot really mean anything other than what it does. 

Re: some problems for an introductory python test

2021-08-11 Thread Wolfram Hinderer via Python-list
Am 11.08.2021 um 05:22 schrieb Terry Reedy: Python is a little looser about whitespace than one might expect from reading 'normal' code when the result is unambiguous in that it cannot really mean anything other than what it does.  Two other examples: >>> if3: print('yes!') yes! >>> [0]  [0]