Carl Banks writes:
> On Nov 19, 12:20 am, Gregory Ewing
> wrote:
> > They all still seem to work -- presumably generating the appropriate
> > unicode characters now instead of MacRoman.
>
> ³It¹s about time.²
I � Unicode.
(lrf, gung *vf* qryvorengr, sbe gur uhzbhe-vzcnverq nzbat lbh)
--
\
On Nov 19, 12:20 am, Gregory Ewing
wrote:
> Steven D'Aprano wrote:
> > I don't know what the state of the art on Mac is
> > these days, but in 1984s Macs had a standard keyboard layout that let you
> > enter most available characters via the keyboard, using sensible
> > mnemonics. E.g. on a US key
Gregory Ewing writes:
> Steven D'Aprano wrote:
> > I don't know what the state of the art on Mac is these days, but in
> > 1984s Macs had a standard keyboard layout that let you enter most
> > available characters via the keyboard, using sensible mnemonics.
> > E.g. on a US keyboard layout, you c
Steven D'Aprano wrote:
I don't know what the state of the art on Mac is
these days, but in 1984s Macs had a standard keyboard layout that let you
enter most available characters via the keyboard, using sensible
mnemonics. E.g. on a US keyboard layout, you could get ≠ by holding down
the Option
On Nov 18, 5:27 pm, Steven D'Aprano
wrote:
> On Wed, 18 Nov 2009 18:28:11 +1300, greg wrote:
> > r wrote:
> >> I think the syntax was chosen because the alternatives are even worse
> >> AND since assignment is SO common in programming, would you *really*
> >> rather type two chars instead of one?
On Wed, 18 Nov 2009 18:28:11 +1300, greg wrote:
> r wrote:
>> I think the syntax was chosen because the alternatives are even worse
>> AND since assignment is SO common in programming, would you *really*
>> rather type two chars instead of one?
>
> Smalltalk solved the problem by using a left-arr
r wrote:
I think the syntax was chosen because the
alternatives are even worse AND since assignment is SO common in
programming, would you *really* rather type two chars instead of one?
Smalltalk solved the problem by using a left-arrow character
for assignment. But they had an unfair advantage
MRAB wrote:
Fortran uses "=" and ".EQ.", probably because (some) earlier autocodes
did.
I think Fortran used .LT. and .GT. because some early character
sets didn't have < and > symbols. Having done that, it
probably seemed more consistent to use .EQ. for comparison
than to break the pattern an
On Tue, Nov 17, 2009 at 10:15 AM, r wrote:
> On Nov 17, 9:28 am, Jonathan Saxton wrote:
>
> > And if I ever find the genius who had the brilliant idea of using = to
> mean assignment then I have a particularly nasty dungeon reserved just for
> him. Also a foul-smelling leech-infested swamp for
On Nov 17, 7:28 am, Jonathan Saxton wrote:
> On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote:
> >> Congratulations, you just reinvented one of the most infamous source of
> >> bugs in C, C++, Java, PHP, javascript and quite a few other languages.
> >> Believe it or not, but not allow
On Tue, 17 Nov 2009 17:31:18 +, MRAB wrote:
>> And if I ever find the genius who had the brilliant idea of using =
>> to mean assignment then I have a particularly nasty dungeon reserved
>> just for him. Also a foul-smelling leech-infested swamp for those
>> language designers and compiler wr
On Nov 17, 9:28 am, Jonathan Saxton wrote:
> And if I ever find the genius who had the brilliant idea of using = to mean
> assignment then I have a particularly nasty dungeon reserved just for him.
> Also a foul-smelling leech-infested swamp for those language designers and
> compiler writers
Jonathan Saxton wrote:
On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote:
Congratulations, you just reinvented one of the most infamous
source of bugs in C, C++, Java, PHP, javascript and quite a few
other languages. Believe it or not, but not allowing this in
Python was a very deli
On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote:
>> Congratulations, you just reinvented one of the most infamous source of
>> bugs in C, C++, Java, PHP, javascript and quite a few other languages.
>> Believe it or not, but not allowing this in Python was a very deliberate
>> design
On Nov 13, 3:20 pm, Bruno Desthuilliers
wrote:
(...snip...)
> > I think because (like me) Carl
> > put's the language before sewing circles. I think it's just personal
> > like all the times before,
>
> Well, to be true, you did manage to make a clown of yourself more than
> once, so don't be surp
r a écrit :
> On Nov 12, 2:37 pm, Bruno Desthuilliers
> wrote:
>
>>> Oh i get it now! If i assign a valid value to a variable the variable
>>> is also valid...thats...thats... GENUIS! *sarcasm*
>> It's not about "assigning a valid value to a variable", it's about the
>> name being created (or not
r a écrit :
> On Nov 12, 7:44 pm, Steven D'Aprano cybersource.com.au> wrote
>> Oh, but those hundreds of thousands of man-hours lost to bugs caused by
>> assignment-as-an-expression is nothing compared to the dozens of man-
>> minutes saved by having one fewer line of code!
>
> OK, what *if* the
On Thu, Nov 12, 2009 at 8:10 PM, r wrote:
> On Nov 12, 7:44 pm, Steven D'Aprano cybersource.com.au> wrote
> > Oh, but those hundreds of thousands of man-hours lost to bugs caused by
> > assignment-as-an-expression is nothing compared to the dozens of man-
> > minutes saved by having one fewer li
On Nov 12, 7:44 pm, Steven D'Aprano wrote
> Oh, but those hundreds of thousands of man-hours lost to bugs caused by
> assignment-as-an-expression is nothing compared to the dozens of man-
> minutes saved by having one fewer line of code!
OK, what *if* the variable would only be valid in *that* bl
On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote:
> Congratulations, you just reinvented one of the most infamous source of
> bugs in C, C++, Java, PHP, javascript and quite a few other languages.
> Believe it or not, but not allowing this in Python was a very deliberate
> design choi
On Nov 12, 2:37 pm, Bruno Desthuilliers
wrote:
> > Oh i get it now! If i assign a valid value to a variable the variable
> > is also valid...thats...thats... GENUIS! *sarcasm*
>
> It's not about "assigning a valid value to a variable", it's about the
> name being created (or not) in the current n
r a écrit :
> On Nov 11, 2:37 am, Steven D'Aprano
> wrote:
>> On Wed, 11 Nov 2009 00:08:58 -0800, r wrote:
>
>>> Yea it's called a NameError. Would it not also blow up in the current
>>> state of syntax usage?
>> No.
>>
>>> if var:
>>> print 'var'
>>> Traceback (most recent call last):
>>>
Steven D'Aprano a écrit :
(snip)
> Hint to would-be language designers: if you start off by claiming that a
> new feature will save an indent level, when in fact it *doesn't* save an
> indent level, you can save yourself from embarrassment by pressing Close
> on your post instead of Send.
Mouaa
r a écrit :
-snip)
> Just thinking out loud here...what if variable assignments could
> return a value... hmmm? Not to them selfs of course but to a caller,
> like an if statement...
>
> if a=openfile:
> # do something with a
Congratulations, you just reinvented one of the most infamous source
On Wed, 11 Nov 2009 03:52:45 -0800, Carl Banks wrote:
>> This is where a helper function is good. You want a dispatcher:
>
> No I really don't. I want to be able to see the action performed
> adjacent to the test, and not have to scroll up to down ten pages to
> find whatever function it dispatc
On Nov 11, 9:04 pm, Carl Banks wrote:
(Carl's reply to Steven's comments...)
> Well I don't just want to call a method, so I can't take that advice.
> Some actions will do more than just to call a method. And I don't
> want to scroll up or down ten screens to see what the actions
> associated wi
On Nov 11, 4:12 pm, Steven D'Aprano
wrote:
> On Wed, 11 Nov 2009 03:52:45 -0800, Carl Banks wrote:
> >> This is where a helper function is good. You want a dispatcher:
>
> > No I really don't. I want to be able to see the action performed
> > adjacent to the test, and not have to scroll up to dow
On Wed, 11 Nov 2009 04:00:09 -0800, Carl Banks wrote:
>> as has been posted before and again in a slightly different form in
>> Steve's post.
>
> I'm well aware of it, but I didn't think the proposal deserved to be
> called stupid when it was a reasonable solution to a real need, even
> though a
Steven D'Aprano wrote:
Why is the third example, with an if... test, so special that it needs
special syntax to make it a two-liner?
...because Beautiful is better than ugly.
I can quote the Zen too:
Special cases aren't special enough to break the rules.
You haven't demonstrated that your
r wrote:
> Just thinking out loud here...what if variable assignments could
> return a value... hmmm? Not to them selfs of course but to a caller,
> like an if statement...
>
> if a=openfile:
> # do something with a
That's like in C. I sometimes miss it in Python.
robert
--
http://mail.python.
On Nov 10, 1:23 pm, r wrote:
> Forgive me if i don't properly explain the problem but i think the
> following syntax would be quite beneficial to replace some redundant
> "if's" in python code.
>
> if something_that_returns_value() as value:
> #do something with value
>
> # Which can replace t
Hi,
On 11/11/2009 12:30 PM, r wrote:
[...snip...]
I think what has escaped everyone (including myself until my second
post) is the fact that what really needs to happen is for variable
*assignments* to return a boolean to any "statements" that evaluate
the assignment -- like in an "if" or "elif"
On Nov 10, 9:44 pm, Terry Reedy wrote:
> Carl Banks wrote:
>
> > r didn't actually give a good example. Here is case where it's
> > actually useful. (Pretend the regexps are too complicated to be
> > parsed with string method.)
>
> > if re.match(r'go\s+(north|south|east|west)',cmd) as m:
> >
On Nov 10, 9:37 pm, Steven D'Aprano
wrote:
> On Tue, 10 Nov 2009 20:13:21 -0800, Carl Banks wrote:
> > On Nov 10, 7:12 pm, Steven D'Aprano
> > wrote:
> >> On Tue, 10 Nov 2009 12:45:13 -0800, Bearophile wrote:
> >> > r:
>
> >> >> i think the following syntax would be quite beneficial to replace
>
On Nov 11, 2:37 am, Steven D'Aprano
wrote:
> On Wed, 11 Nov 2009 00:08:58 -0800, r wrote:
> > Yea it's called a NameError. Would it not also blow up in the current
> > state of syntax usage?
>
> No.
>
> > if var:
> > print 'var'
>
> > Traceback (most recent call last):
> > File "", line 1,
On Wed, 11 Nov 2009 00:08:58 -0800, r wrote:
>> > #variable "var" will never be created!
>> That will cause no end of trouble.
>> if range(N) as var:
>> do_something_with_var()
>> if var:
>> print "Oops, this blows up if N <= 0"
>> Conditional assignments are a terrible idea.
>
> Yea
On Nov 11, 1:25 am, Steven D'Aprano
wrote:
(snip)
> Incorrect.
> >>> True == None
> False
> >>> False == None
> False
Of course i meant True/False but my fingers were thinking None at the
time. And besides if i don't make a mistake here or there what ever
would you do with your time? ;-)
Seven +
On Tue, 10 Nov 2009 23:00:09 -0800, r wrote:
> I think what has escaped everyone (including myself until my second
> post) is the fact that what really needs to happen
Why?
> is for variable
> *assignments* to return a boolean to any "statements" that evaluate the
> assignment -- like in an "i
On Nov 10, 2:49 pm, steve wrote:
(..snip..)
> However, the same 'effect' can be obtained with the 'with' statement:
(..snip..)
Hardly!,Here is an interactive session with your test case
#--#
>>> class something_that_returns_value:
def
Carl Banks wrote:
r didn't actually give a good example. Here is case where it's
actually useful. (Pretend the regexps are too complicated to be
parsed with string method.)
if re.match(r'go\s+(north|south|east|west)',cmd) as m:
hero.move(m.group(1))
elif re.match(r'take\s+(\w+)',cmd) as m
On Tue, 10 Nov 2009 20:13:21 -0800, Carl Banks wrote:
> On Nov 10, 7:12 pm, Steven D'Aprano
> wrote:
>> On Tue, 10 Nov 2009 12:45:13 -0800, Bearophile wrote:
>> > r:
>>
>> >> i think the following syntax would be quite beneficial to replace
>> >> some redundant "if's" in python code.
>>
>> >http:
On Nov 10, 9:12 pm, Steven D'Aprano
wrote:
(..snip..)
> Hint to would-be language designers: if you start off by claiming that a
> new feature will save an indent level, when in fact it *doesn't* save an
> indent level, you can save yourself from embarrassment by pressing Close
> on your post inst
On Nov 10, 7:12 pm, Steven D'Aprano
wrote:
> On Tue, 10 Nov 2009 12:45:13 -0800, Bearophile wrote:
> > r:
>
> >> i think the following syntax would be quite beneficial to replace some
> >> redundant "if's" in python code.
>
> >http://python.org/dev/peps/pep-3003/
>
> I knew it wouldn't take long f
On Nov 10, 11:23 am, r wrote:
> if something_that_returns_value() as value:
> #do something with value
Been proposed before. No one has bothered to write a PEP for it, so I
can't say for sure how the Python gods would react, but I suspect a
"meh, don't think it's important enough". This, ev
On Tue, 10 Nov 2009 12:45:13 -0800, Bearophile wrote:
> r:
>
>> i think the following syntax would be quite beneficial to replace some
>> redundant "if's" in python code.
>
> http://python.org/dev/peps/pep-3003/
I knew it wouldn't take long for people to start responding to any
proposal with "
On Nov 10, 2:08 pm, Robert Latest wrote:
(..snip..)
> Also it's not the "if" that is (if at all) redundant here but the assignment.
Not exactly. The assignment happens only once just as the boolean
check of "if " happens once. The redundancy is in validating
the existence of a truthful value cont
r:
> i think the following syntax would be quite beneficial
> to replace some redundant "if's" in python code.
http://python.org/dev/peps/pep-3003/
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
On 11/11/2009 12:53 AM, r wrote:
Forgive me if i don't properly explain the problem but i think the
following syntax would be quite beneficial to replace some redundant
"if's" in python code.
if something_that_returns_value() as value:
#do something with value
# Which can replace the
On 11/11/2009 02:05 AM, steve wrote:
Hi,
On 11/11/2009 12:53 AM, r wrote:
[...snip...]
i dunno, just seems to make good sense. You save one line of code but
more importantly one indention level. However i have no idea how much
trouble the implementation would be?
I guess the problem would b
r wrote:
> Forgive me if i don't properly explain the problem but i think the
> following syntax would be quite beneficial to replace some redundant
> "if's" in python code.
>
> if something_that_returns_value() as value:
> #do something with value
>
> # Which can replace the following syntacti
Forgive me if i don't properly explain the problem but i think the
following syntax would be quite beneficial to replace some redundant
"if's" in python code.
if something_that_returns_value() as value:
#do something with value
# Which can replace the following syntactical construct...
value
51 matches
Mail list logo