On Thu, 7 Apr 2016 05:19 pm, Marko Rauhamaa wrote:
> First, terminology disputes are pointless.
I agree! There's nothing I like more than sitting in front of a blazing open
fire (or even just a warm heater) on a cold winter's evening, drinking a
nice mug of piping hot terminology dispute. Sometim
Ian Kelly :
> Let's take a different example.
>
> class Dialog(Window):
>
> def __init__(self, parent, title, ok_callback):
> super().__init__(parent, title)
> self._ok_callback = ok_callback
> self._ok_button = Button(self, 'Ok')
> self._ok_button.bind(self._ok
On Thu, Apr 7, 2016 at 12:30 AM, Marko Rauhamaa wrote:
> Or:
>
>When a class attribute reference (for class C, say) would yield a
>class method object, it is transformed into an instance method object
>whose __self__ attributes is C.
>https://docs.python.org/3/reference/datamodel.h
Rolf Camps :
> Op 07-04-16 om 00:03 schreef Marko Rauhamaa:
>> IOW, if I have this class:
>>
>> class A:
>> def f(self):
>> print("f")
>>
>> and this object:
>>
>> a = A()
>>
>> then,
>>
>> a.f
>>
>> is a function that doesn't have a self argument. That functio
On Thu, Apr 7, 2016 at 5:30 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> This is the exact sort of shenanigans that it takes to convert
>> recursion into tail recursion - and in MOST cases, it's very little
>> effort to go from there to explicit while loops. That's why TCE is so
>> infrequent
Op 07-04-16 om 00:03 schreef Marko Rauhamaa:
Once you look up an object method, it doesn't have a self argument. The
self argument is cooked up for the benefit of the function definition in
the class.
IOW, if I have this class:
class A:
def f(self):
print("f")
and
On 06/04/2016 21:38, Mark Lawrence wrote:
No it didn't, it was quite clear from the beginning that he knew squat,
and since then he's admitted that he knows squat. About Python.
I see. According to you:
(1) To have an opinion about a language, you have to know everything in
it 100%, inside
Ian Kelly :
> On Wed, Apr 6, 2016 at 2:39 PM, Marko Rauhamaa wrote:
>> Not convinced. Probably just an oversight.
>
> It's documented here:
> https://docs.python.org/3/reference/datamodel.html#special-method-lookup
Ok, not an oversight but some inherent trouble with the way object
methods are re
On Wed, Apr 6, 2016 at 2:39 PM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Wed, Apr 6, 2016 at 1:59 PM, Marko Rauhamaa wrote:
>>> It seems to me CPython is being a bit too picky here. Why should it
>>> care if the method is a class method or an object method?
>>
>> Because the purpose of a class
Ian Kelly :
> On Wed, Apr 6, 2016 at 1:59 PM, Marko Rauhamaa wrote:
>> It seems to me CPython is being a bit too picky here. Why should it
>> care if the method is a class method or an object method?
>
> Because the purpose of a class is to define the behavior of its
> instances. A function store
On 06/04/2016 18:55, Ned Batchelder wrote:
It took us a while to understand where Bart was coming from, but now we
understand, and we don't have to go around in circles.
No it didn't, it was quite clear from the beginning that he knew squat,
and since then he's admitted that he knows squat.
On Wed, Apr 6, 2016 at 1:59 PM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Wed, Apr 6, 2016 at 1:22 PM, Marko Rauhamaa wrote:
>>> Why is a SimpleNamespace object not an iterator even though it
>>> provides __iter__ and __next__?
>>
>> Because Python expects those methods to be defined in the cla
Terry Reedy :
> On 4/6/2016 10:14 AM, Marko Rauhamaa wrote:
>
>> Seriously, Python wouldn't be, couldn't be Turing-complete without
>> "while" (mainly because it doesn't support tail-recursion
>> elimination).
>>
>> Now, if Python had an unlimited range() iterator/iterable, you could
>> use a "for
Ian Kelly :
> On Wed, Apr 6, 2016 at 1:22 PM, Marko Rauhamaa wrote:
>> Why is a SimpleNamespace object not an iterator even though it
>> provides __iter__ and __next__?
>
> Because Python expects those methods to be defined in the class dict,
> not the instance dict.
The documentation does state
On 4/6/2016 10:14 AM, Marko Rauhamaa wrote:
Seriously, Python wouldn't be, couldn't be Turing-complete without
"while" (mainly because it doesn't support tail-recursion elimination).
Now, if Python had an unlimited range() iterator/iterable, you could use
a "for" statement to emulate "while".
On Wed, Apr 6, 2016 at 1:22 PM, Marko Rauhamaa wrote:
> However, BartC's No-Buzzword Python doesn't have classes... If he
> allowed for types.SimpleNamespace, we could have:
>
>
> import types
>
> def While(predicate):
>
Chris Angelico :
> This is the exact sort of shenanigans that it takes to convert
> recursion into tail recursion - and in MOST cases, it's very little
> effort to go from there to explicit while loops. That's why TCE is so
> infrequently important that it's just not worth the cost - which in
> th
Ian Kelly :
> On Wed, Apr 6, 2016 at 8:14 AM, Marko Rauhamaa wrote:
>> Now, if Python had an unlimited range() iterator/iterable, you could use
>> a "for" statement to emulate "while".
>
> You can already do this.
>
class While:
> ... def __init__(self, predicate):
> ... self._pr
On Thu, Apr 7, 2016 at 4:44 AM, Random832 wrote:
> On Wed, Apr 6, 2016, at 14:23, Marko Rauhamaa wrote:
>> Chris Angelico :
>>
>> > Plus, anyone could implement a Python interpreter with TCE.
>>
>> Tricky in practice because None is the default return value.
>>
>> If the programmer were careful to
Random832 :
> On Wed, Apr 6, 2016, at 14:23, Marko Rauhamaa wrote:
>> Chris Angelico :
>> > Plus, anyone could implement a Python interpreter with TCE.
>>
>> Tricky in practice because None is the default return value.
>>
>> If the programmer were careful to return the value of the tail call,
>>
On Wed, Apr 6, 2016 at 8:14 AM, Marko Rauhamaa wrote:
> Now, if Python had an unlimited range() iterator/iterable, you could use
> a "for" statement to emulate "while".
You can already do this.
>>> class While:
... def __init__(self, predicate):
... self._predicate = predicate
...
On Wed, Apr 6, 2016, at 14:23, Marko Rauhamaa wrote:
> Chris Angelico :
>
> > Plus, anyone could implement a Python interpreter with TCE.
>
> Tricky in practice because None is the default return value.
>
> If the programmer were careful to return the value of the tail call, it
> can be eliminat
Chris Angelico :
> Plus, anyone could implement a Python interpreter with TCE.
Tricky in practice because None is the default return value.
If the programmer were careful to return the value of the tail call, it
can be eliminated.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 7, 2016 at 3:40 AM, Steven D'Aprano wrote:
>> I fully agree. But you don't have to use classes, exceptions,
>> decorators, generators, iterators, closures, comprehensions, meta
>> classes, ... the list of meaningless buzzwords just goes on.
>
> Honestly, hearing you say that makes you
On Wednesday, April 6, 2016 at 10:40:36 AM UTC-4, Mark Lawrence wrote:
> On 06/04/2016 15:34, Ned Batchelder wrote:
> > No, please, let's not ask BartC to list these features. We've already
> > well established Bart's point of view, let's not revisit this debate.
> > He prefers very different lang
On Thu, Apr 7, 2016 at 3:04 AM, BartC wrote:
>
>> I get a very strong impression
>> that you've never had to maintain appalingly written code. The overuse
>> of GOTO will certainly help in that area.
>
>
> (I've not defending its use, but there are good reasons for retaining it.
>
> Suppose you h
On Wed, 6 Apr 2016 09:06 pm, BartC wrote:
> On 05/04/2016 06:48, Gordon( Hotmail ) wrote:
>> The problem I am finding is most of the sites claiming to help understand
>> Python devote far too much space bragging about the wonders of Python
>> instead of...
I'd like to see these sites. I suspect
On 06/04/2016 15:20, Mark Lawrence wrote:
On 06/04/2016 14:54, BartC wrote:
Please state why you're still here if Python is such a
poorly designed language that it doesn't fit your needs.
I was replying to the OP who was being put off the language. The vast
majority have to choose an off-th
On 06/04/2016 15:34, Ned Batchelder wrote:
On Wednesday, April 6, 2016 at 10:25:13 AM UTC-4, Mark Lawrence wrote:
On 06/04/2016 14:54, BartC wrote:
On 06/04/2016 12:46, Marko Rauhamaa wrote:
BartC :
It'll cope with ordinary coding as well, although such programs seem
to be frowned upon here
On Wed, Apr 6, 2016 at 10:08 AM, Marko Rauhamaa wrote:
> BartC :
>
>> But you're right in that little is actually essential. Basic has shown
>> that.
>>
>> You need expressions, IF, GOTO, variables and assignments, and some
>> means of doing I/O.
>>
>> Pretty much every language has (had) those, a
On Wednesday, April 6, 2016 at 10:25:13 AM UTC-4, Mark Lawrence wrote:
> On 06/04/2016 14:54, BartC wrote:
> > On 06/04/2016 12:46, Marko Rauhamaa wrote:
> >> BartC :
> >
> >>> It'll cope with ordinary coding as well, although such programs seem
> >>> to be frowned upon here; they are not 'Pythonic
On 06/04/2016 14:54, BartC wrote:
On 06/04/2016 12:46, Marko Rauhamaa wrote:
BartC :
It'll cope with ordinary coding as well, although such programs seem
to be frowned upon here; they are not 'Pythonic'.
I wonder what is left of Python after your list of exclusions.
There are plenty of fe
On Thu, Apr 7, 2016 at 12:14 AM, Marko Rauhamaa wrote:
> Seriously, Python wouldn't be, couldn't be Turing-complete without
> "while" (mainly because it doesn't support tail-recursion elimination).
Side point: Turing completeness actually assumes a mythical Turing
machine with infinite memory. So
Michael Selik :
> On Wed, Apr 6, 2016, 12:51 PM Marko Rauhamaa wrote:
>
>> Really, there's only one high-level construct you can't live without:
>> the "while" statement. Virtually every Python program has at least
>> one "while" statement, and in general, it is unavoidable.
>>
>> Basic programs,
On Wed, Apr 6, 2016 at 11:54 PM, BartC wrote:
> There are plenty of features that /I/ consider must-have, which Python
> doesn't have. It has to emulate them, unsatisfactorily, with variables or
> classes or functions, or do without.
Blub's Paradox epitomized.
> But you're right in that little i
BartC :
> But you're right in that little is actually essential. Basic has shown
> that.
>
> You need expressions, IF, GOTO, variables and assignments, and some
> means of doing I/O.
>
> Pretty much every language has (had) those, although it's fashionable
> now to do away with GOTO, and some are
On 06/04/2016 12:46, Marko Rauhamaa wrote:
BartC :
It'll cope with ordinary coding as well, although such programs seem
to be frowned upon here; they are not 'Pythonic'.
I wonder what is left of Python after your list of exclusions.
There are plenty of features that /I/ consider must-have,
On Wed, Apr 6, 2016, 12:51 PM Marko Rauhamaa wrote:
> BartC :
> Really, there's only one high-level construct you can't live without:
> the "while" statement. Virtually every Python program has at least one
> "while" statement, and in general, it is unavoidable.
>
> Basic programs, on the other h
On 06/04/2016 12:38, Ned Batchelder wrote:
On Wednesday, April 6, 2016 at 7:06:28 AM UTC-4, BartC wrote:
On 05/04/2016 06:48, Gordon( Hotmail ) wrote:
The problem I am finding is most of the sites claiming to help understand
Python devote
far too much space bragging about the wonders of Python
On 06/04/2016 12:06, BartC wrote:
On 05/04/2016 06:48, Gordon( Hotmail ) wrote:
I am struggling to understand the basic principles of Python having
spent many years as a pure Amateur tinkering with a variety of BASIC
Last time I looked, there seemed to be around 250 dialects of Basic, and
with
BartC :
> But you don't have to use classes, exceptions, decorators, generators,
> iterators, closures, comprehensions, meta classes, ... the list of
> meaningless buzzwords just goes on.
Also, you don't have to use the letter "e" in your identifiers or the
number 2 anywhere in your programs.
Re
On Wednesday, April 6, 2016 at 7:06:28 AM UTC-4, BartC wrote:
> On 05/04/2016 06:48, Gordon( Hotmail ) wrote:
> > The problem I am finding is most of the sites claiming to help understand
> > Python devote
> > far too much space bragging about the wonders of Python instead of...
>
> I fully agree
On 05/04/2016 06:48, Gordon( Hotmail ) wrote:
I am struggling to understand the basic principles of Python having
spent many years as a pure Amateur tinkering with a variety of BASIC
Last time I looked, there seemed to be around 250 dialects of Basic, and
with wildly differing implementations
Gregory Ewing :
> Another option for graphical stuff is pygame:
Thanks!
> http://pygame.org/news.html
Especially for this:
No need to mess with installing it outside of your operating systems
package manager.
However:
Does Pygame work with Python 3?
Yes. Pygame 1.9.2 supports Py
Another option for graphical stuff is pygame:
http://pygame.org/news.html
A rough translation of some of your code:
import pygame, sys
from pygame import display, draw, event, font, Color, QUIT
# Set up the display window
screen = display.set_mode((800, 600))
colors = ["red", "orange", "yello
On Tue, 05 Apr 2016 19:47:00 +0100, BartC wrote:
> On 05/04/2016 19:02, alister wrote:
>> On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote:
>
> REM BBC Basic FOR c = 1 TO 15 : COLOUR c
>PRINT "Color ";c
> NEXT c
>
> REM BBC Basic c = 0 FOR x = 80 TO 2000 STEP 96
>>
On 05/04/2016 19:02, alister wrote:
On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote:
REM BBC Basic FOR c = 1 TO 15 : COLOUR c
PRINT "Color ";c
NEXT c
REM BBC Basic c = 0 FOR x = 80 TO 2000 STEP 96
GCOL c: CIRCLE FILL x,500,50 : c = c + 1
NEXT x
If you tell us some more of wha
On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote:
> On Tue, Apr 5, 2016 at 3:31 AM, Rustom Mody
> wrote:
>> On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail )
>> wrote:
>>> I am struggling to understand the basic principles of Python having
>>> spent many years as a pure
Gordon( Hotmail ) wrote:
Welcome!
> I am struggling to understand the basic principles of Python having spent
> many years as a pure Amateur tinkering with a variety of BASIC as you can
> see on my site at http://www.sigord.co.uk/ I think you will agree all
> such versions of Basic I have used
Joaquin Alzola :
> Python is like shell scripting but with Steroids. For a SysAdmin is a must.
> This email is confidential and may be subject to privilege. If you are
> not the intended recipient, please do not copy or disclose its content
> but contact the sender immediately upon receipt.
Oh, I
Dennis Lee Bieber :
> For the OP: Very few languages have built-in graphics commands;
> which is why porting BASIC programs was so difficult. This means you
> have to import some graphical framework and use ITS command functions.
The Racket dialect of the Scheme programming language has an i
>"Gordon( Hotmail )" writes:
>> I am struggling to understand the basic principles of Python
>Welcome! Congratulations for embarking on Python as a language to learn.
>Since as you say you are trying to learn the very basics, please participate
>in our collaborative tutoring forum
>https://m
On Tue, Apr 5, 2016 at 3:31 AM, Rustom Mody wrote:
> On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail ) wrote:
>> I am struggling to understand the basic principles of Python having spent
>> many years as a pure Amateur tinkering with a variety of BASIC as you can
>> see on my
"Gordon( Hotmail )" writes:
> I am struggling to understand the basic principles of Python
Welcome! Congratulations for embarking on Python as a language to learn.
Since as you say you are trying to learn the very basics, please
participate in our collaborative tutoring forum
https://mail.pytho
On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail ) wrote:
> I am struggling to understand the basic principles of Python having spent
> many years as a pure Amateur tinkering with a variety of BASIC as you can
> see on my site at http://www.sigord.co.uk/ I think you will agree
55 matches
Mail list logo