I'm sorry, but your claim that everything is an ob...
Dan Villiom Podlaski Christiansen · 2009-05-21T14:18:57.579000
I'm sorry, but your claim that everything is an object in Python isn't entirely accurate. For instance, keywords aren't objects. I haven't checked, but integers and so on may not be either. I find that what makes Python so appealing is that it's a well designed, practical language; and it is so to an extent that makes it beautiful, in my opinion. As a language, it consistently consistently avoids purity, no matter what you consider pure; perhaps that's the only purity it possesses?
@Dan: sorry if I seem to be being pedantic, but if...
Steve · 2009-05-21T14:29:53.266000
@Dan: sorry if I seem to be being pedantic, but if you are prepared to regard keywords as "things that aren't objects" then why not also list the punctuation? Colons aren't objects, and neither is the whitespace.
I think you will find that if you try to pass a keyword as an argument to a function you will get a syntax error. This is the interpreter's way of telling you that what you wrote isn't actually Python.
Integers, longs, floating point numbers, lists, tuples, dicts, functions, modules, etc. are all objects. In that respect Python is much more like SmallTalk than Java, which has the distinction between (for example) integer and Integer to confuse new users.
Aficionados of the "Zen of Python" will doubtless be muttering "practicality beats purity" to themselves after reading your words. I think you have successfully identified Python's attraction to most of its users.
We also have a fair control over keywords and punc...
rgz · 2009-05-21T16:51:51.486000
We also have a fair control over keywords and punctuation too. At least we can control indexation, calling and bitwise boolean operators. We can't control regular boolean operators but we can control the boolean value of arbitrary objects. metaclasses let you control much of the effect of the class keyword, and decorators let you control the result of the def keyword. print can be substituted by a function and we can control all but the simplest assignment statements*.
So not everything you see in a python script is an object but pretty much so.
But what Steve really is talking about is that all objects have equal standing. You can pass a class as an argument to a function and you can pass a function as a base class!
Oddly enough there is one domain where python consistently denies you control and that is name binding.
I'm sorry, but your claim that everything is an ob...
Dan Villiom Podlaski Christiansen · 2009-05-21T14:18:57.579000
I'm sorry, but your claim that everything is an object in Python isn't entirely accurate. For instance, keywords aren't objects. I haven't checked, but integers and so on may not be either. I find that what makes Python so appealing is that it's a well designed, practical language; and it is so to an extent that makes it beautiful, in my opinion. As a language, it consistently consistently avoids purity, no matter what you consider pure; perhaps that's the only purity it possesses?@Dan: sorry if I seem to be being pedantic, but if...
Steve · 2009-05-21T14:29:53.266000
@Dan: sorry if I seem to be being pedantic, but if you are prepared to regard keywords as "things that aren't objects" then why not also list the punctuation? Colons aren't objects, and neither is the whitespace.I think you will find that if you try to pass a keyword as an argument to a function you will get a syntax error. This is the interpreter's way of telling you that what you wrote isn't actually Python.
Integers, longs, floating point numbers, lists, tuples, dicts, functions, modules, etc. are all objects. In that respect Python is much more like SmallTalk than Java, which has the distinction between (for example) integer and Integer to confuse new users.
Aficionados of the "Zen of Python" will doubtless be muttering "practicality beats purity" to themselves after reading your words. I think you have successfully identified Python's attraction to most of its users.
We also have a fair control over keywords and punc...
rgz · 2009-05-21T16:51:51.486000
We also have a fair control over keywords and punctuation too. At least we can control indexation, calling and bitwise boolean operators. We can't control regular boolean operators but we can control the boolean value of arbitrary objects. metaclasses let you control much of the effect of the class keyword, and decorators let you control the result of the def keyword. print can be substituted by a function and we can control all but the simplest assignment statements*.So not everything you see in a python script is an object but pretty much so.
But what Steve really is talking about is that all objects have equal standing. You can pass a class as an argument to a function and you can pass a function as a base class!
Oddly enough there is one domain where python consistently denies you control and that is name binding.
Page 1 of 1
Back to post