On 2011-08-10, Chris Angelico wrote:
> And if we require {} then truly free indentation should be OK too! But
> it wouldn't be Python any more.
Would it really not be Python at all?
I've seen bits of code in preprocessing-based "Python with {}" type things,
and they still look like Python to me,
On 2011-08-11, Steven D'Aprano wrote:
> Seebs wrote:
>> On 2011-08-10, Chris Angelico wrote:
>>> And if we require {} then truly free indentation should be OK too! But
>>> it wouldn't be Python any more.
>> Would it really not be Python at all?
> O
On 2011-08-10, Ben Finney wrote:
> Seebs writes:
>> On 2011-08-10, Chris Angelico wrote:
>> > And if we require {} then truly free indentation should be OK too!
>> > But it wouldn't be Python any more.
>> Would it really not be Python at all?
> See the
On 2011-08-11, Ben Finney wrote:
> What evidence do you have of these? The latter, especially, seems to be
> mere opinion unfounded in any measurement.
Well, on new collection of data, I'm less convinced.
The basic rule is:
Engineers are nearly always aware of tradeoffs. If I suddenly encounte
On 2011-08-11, Steven D'Aprano wrote:
> Seebs wrote:
>> I have seen all the counterarguments, and what I've
>> mostly become convinced of is this:
>> 1. Indentation as flow control was a bad idea.
> I'm not aware of any language where indentation is use
On 2011-08-11, Steven D'Aprano wrote:
> Steven D'Aprano wrote:
>> indentation as flow control
> Gah! Of course, I meant indentation for blocks... after making the earlier
> point that indentation is *not* used for flow control, this was a
> particularly egregious error.
> How embarrassment.
My
Before I get to the rest of this:
Thinking it through, I've been unreasonable and grumpy here, and I'm trying
to figure this out a bit more.
A general observation: There's no real data here, so far as I can tell.
There is no pair of languages which are exactly identical except for whether
they u
On 2011-08-12, Ben Finney wrote:
> Seebs writes:
>> I am pretty sure Python is a pretty nice language. However, the
>> indentation thing has screwed me a few times. Furthermore, I know
>> people who like Python a great deal and acknowledge, without much
>> difficulty,
On 2011-08-12, Ben Finney wrote:
> Seebs writes:
>> Question for y'all:
>>
>> Has anyone here ever ACTUALLY encountered a case where braces -- not
>> indentation -- did not match intent in a C-like language? I'm talking
>> only about cases where brace
On 2011-08-12, Chris Angelico wrote:
> On Fri, Aug 12, 2011 at 7:34 AM, Seebs wrote:
>> If Python with braces wouldn't be Python at all, why on earth does the
>> language even exist?
> Every language has its philosophy.
Yes.
> Etcetera. These are the philosophical
On 2011-08-12, rantingrick wrote:
> What is with you guys and this need to have your hand held to read
> code.
Good question! Great to see that the helpful and welcoming community
is living up to its reputation.
My brain has quirks. Some people call them defects, some don't, but it
really does
On 2011-08-12, Chris Rebert wrote:
> One argument I've heard from braces fans is that sometimes they want
> their own structure, which does not match the actual block structure.
EWW!
> Example:
>
> FILE* f = fopen(...);
> // do stuff with f
> // at this indent level
> fclose(f);
> // bac
On 2011-08-12, Chris Angelico wrote:
> Why is left-to-right inherently more logical than
> multiplication-before-addition?
I'd say it's certainly "more Pythonic in a vacuum".
Multiplication-before-addition, and all the related rules, require
you to know a lot of special rules which are not visibl
On 2011-08-12, rantingrick wrote:
> On Aug 12, 11:33?am, Seebs wrote:
>> My brain has quirks. ?Some people call them defects, some don't, but it
>> really doesn't matter; there are things about which my brain is just plain
>> unreliable and I rely moderately
On 2011-08-12, Chris Angelico wrote:
> On Fri, Aug 12, 2011 at 5:33 PM, Seebs wrote:
>> I've seen people in C do stuff like:
>> ? ? ? ?for (i = 0; i < N; ++i);
>> ? ? ? ? ? ? ? ?a[i] = 0;
>> This is clearly a case where indentation matches intent, but doesn&
On 2011-08-12, Steven D'Aprano wrote:
> Please don't feed the troll. Responding to Rick's standard obnoxious posts
> is like wrestling with a pig -- you get tired and filthy, you never
> accomplish anything useful, and after a while, you realise that the pig is
> enjoying it. Save yourself a lot o
On 2011-08-12, Steven D'Aprano wrote:
> Seebs wrote:
>> You know, that's why the outdents-without-symbols bug me; I have a
>> thing with a colon on it introducing something, and then there's nothing
>> ending it.
> But there is something ending it: a c
On 2011-08-13, Terry Reedy wrote:
> I have been indenting code neatly for at least 32 years whenever the
> language I used allowed it. Just over 14 years ago, when Python was an
> obscure little known or used languge, I adopted it *because* it dropped
> all the redundant bracket noise and looke
On 2011-08-13, Ben Finney wrote:
> Seebs writes:
>> What's being pushed into the stream to indicate that the first outdent
>> is two outdents and the second is one?
> See http://docs.python.org/reference/lexical_analysis.html> for a
> comprehensive discussion of the
On 2011-08-14, rantingrick wrote:
> Follow these simply rules to become an accepted member of the Python
> community.
> 1. Bash rantingrick and Xah Lee every chance you get.
... If I'd known you were in the same category as him, I wouldn't have
needed to wait until now to know to plonk you.
-s
On 2011-08-14, Steven D'Aprano wrote:
> Seebs wrote:
>> I guess... The parser is explicitly pushing those tokens, but I can't
>> *SEE* those tokens. If I am looking at the end of a really long
>> thing, and I see:
>>
>> bla
On 2011-08-14, Chris Angelico wrote:
> Yes. Not everything's an expression; a block of code is not an
> expression that returns a code object, and variable assignment is a
> statement. Some day, I'd like to play around with a language where
> everything's an expression and yet it doesn't look like
On 2011-08-14, Steven D'Aprano wrote:
> Seebs wrote:
>> "Destroy data" is a sort of fungible concept. I was reading a comic book
>> recently and it contained a URL for a poem which had been parodied. The
>> URL had been hand-lettered... in block capitals
On 2011-08-14, Teemu Likonen wrote:
> I understand that Python philosophy does not value freedom of expression
> that much. It values a general Pythonic rule which must obeyed and is
> called "readability". Other languages give too little or too much
> freedom. :-)
There is an interesting tradeof
On 2011-08-14, Chris Angelico wrote:
> Just to confuse things even further, it's not unlikely that a Mac or
> Linux or Windows computer will have DOSBox installed. Is *that* DOS?
> Technically no, but practically yes.
Depending on how you define "unlikely", I'd guess it is.
Assume that "unlikely
On 2011-08-15, Steven D'Aprano wrote:
> And yet, here you are, engaging him in conversation and feeding him the
> attention he craves :(
Many cultures have a tradition of almsgiving.
-s
--
Copyright 2011, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net
http://www.seebs.net/log/ <-
On 2011-08-15, Steven D'Aprano wrote:
>> Interesting! I tend to really like the ability to chain methods,
>> depending
>> on context. I find the side-effect/expression mix pretty normal, so I'm
>> used to it.
> As a rule, chaining method calls risks violating the Law of Demeter. Just
> sayin'.
On 2011-08-15, Chris Rebert wrote:
> On Sun, Aug 14, 2011 at 6:54 PM, Steven D'Aprano
> wrote:
>> As a rule, chaining method calls risks violating the Law of Demeter. Just
>> sayin'.
> Not in the specific case of fluent interfaces[1] though, which could
> have been what Seebach had in mind.
They
On 2011-08-15, Steven D'Aprano wrote:
> Seebs wrote:
>> I tend to write stuff like
>>
>> foo.array_of_things.sort.map { block }.join(", ")
>>
>> I like this a lot more than
>> array = foo.array_of_things
>> sorted_array = ar
On 2011-08-15, Roy Smith wrote:
> Demand, no, but sometimes it's a good idea. I've been writing computer
> programs for close to 40 years, and I still have no clue what most of
> the order of operations is. It's just not worth investing the brain
> cells to remember such trivia (especially si
On 2011-08-15, Ethan Furman wrote:
> Gerrat Rickert wrote:
>> What sayest the Python community about having an explicit warning
>> against such un-pythonic behaviour (re-assigning builtin names)?
> What makes you think this behavior is unpythonic? Python is not about
> hand-holding.
It seems
On 2011-08-16, Roy Smith wrote:
> In article <4e492d08$0$30003$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>> I'm reminded of this quote from John Baez:
>> "The real numbers are the dependable breadwinner of the family, the complete
>> ordered field we all rely on. The complex
On 2011-08-16, Roy Smith wrote:
> In article <9att9mf71...@mid.individual.net>,
> Gregory Ewing wrote:
>
>> I don't mind people using e.g. and i.e. as long
>> as they use them *correctly*.
>
> The only correct way to use i.e. is to use it to download a better
> browser.
Similarly:
Boy, is the
On 2011-08-16, smith jack wrote:
> what is the advantage of Django over RoR:)
This question is pretty much... I mean, you're not gonna get useful
answers. They're based on such different languages that I think any
comparison past that is likely going to be uninteresting to a programmer,
and I'm
On 2011-08-16, Steven D'Aprano wrote:
> On Tue, 16 Aug 2011 01:23 pm Philip Semanchuk wrote:
>>> Why should built-ins be treated as more sacred than your own objects?
>> Because built-ins are described in the official documentation as having a
>> specific behavior, while my objects are not.
> *
On 2011-08-16, Ethan Furman wrote:
> I think warnings should be reserved for language changes and such (like
> DeprecationWarning, RuntimeWarning, and FutureWarning), not for possible
> programmer mistakes.
I disagree, on the basis of the following:
The quality of C code I have to deal with ha
On 2011-08-16, Ethan Furman wrote:
> What makes you think it's unintentional?
Programming experience.
People *often* do things unintentionally.
> Seems to me the real issue is somebody using a builtin, such as str or
> int, and that they somehow manage to do this without realizing, "wait a
>
On 2011-08-16, Ethan Furman wrote:
> Seebs wrote:
>> The quality of C code I have to deal with has increased dramatically as
>> gcc's aggressive use of warnings has spread.
> With gcc you pay the cost once, with Python you would pay it with every
> run. A linter wou
On 2011-08-16, Prasad, Ramit wrote:
>What exactly is the downside to indentation as flow control?
I think a lot of it is personal taste or differences in how peoples'
brains work.
I don't want "free form code", I don't want to write stuff that isn't
correctly indented. I want a visual cue I can
On 2011-08-16, Terry Reedy wrote:
> On 8/16/2011 2:56 PM, Seebs wrote:
>> I wonder whether there's a way to mitigate the cost of these things by
>> messing with -W settings, such that runtime that wants to be fast can
>> omit the checks, but the default could still b
On 2011-08-17, Chris Angelico wrote:
> On Wed, Aug 17, 2011 at 12:49 AM, Seebs wrote:
>> Yes, but is it a *significant* cost? ?My assumption is that the suppression
>> would be of checking, not just of displaying messages.
> It mightn't be very significant, but the
On 2011-08-17, Steven D'Aprano wrote:
> Seebs wrote:
>> On 2011-08-16, Steven D'Aprano
>> wrote:
>>> *My* objects certainly are, because I write documentation for my code. My
>>> docs are no less official than Python's docs.
>> Sure the
On 2011-08-17, John Doe wrote:
> Using "does your code have a GUI" produces zero search results.
> Maybe that works better in some other language.
You shouldn't need a search engine to answer a question about your code.
If you do, it suggests that perhaps one or more of the terms are unfamiliar
On 2011-08-17, John Doe wrote:
> Context is lost when you quote only one level.
Not significantly.
> I was not answering a question about my code. I was pointing out
> the fact that my questioner's terminology is strange/corrupt.
Well, that's the thing. There was a question there, with perf
On 2011-08-17, peter wrote:
> Is there an equivalent to msvcrt for Linux users? I haven't found
> one, and have resorted to some very clumsy code which turns off
> keyboard excho then reads stdin. Seems such an obvious thing to want
> to do I am surprised there is not a standard library module fo
On 2011-08-17, Chris Angelico wrote:
> def foo(list):
>"""Foo's the list provided and returns True on success or False on
> failure."""
>
> def bar(list):
> """Counts the number of bars in the list, assuming it to be made
> of music."""
> if not foo(list): return
> You call foo() once
On 2011-08-17, Steven D'Aprano wrote:
> On Wed, 17 Aug 2011 01:17 pm Seebs wrote:
> [...]
>> "Another" scope is normally a horizontal thing -- you're talking about
>> a different scope such that you are *either* in this one *or* in that
>> one.
>&
On 2011-08-17, Steven D'Aprano wrote:
> I shouldn't need to say this to anyone over the age of four, but being
> obnoxious to people trying to help does not encourage others to answer your
> question. You don't win points for insulting people who are trying to solve
> your problems.
The frustrati
On 2011-08-17, Terry Reedy wrote:
> The difference is between "Hit to continue" (which we can do in
> portable Python) versus "Hit any key to continue" (which we cannot, and
> which also leads to the joke about people searching for the 'any' key
> ;-).
And more importantly, frustration and co
On 2011-08-17, Ethan Furman wrote:
> Seebs wrote:
>> On 2011-08-17, Steven D'Aprano wrote:
>>> Ah, well you see the thing is, this is Python. As soon as you call any
>>> function you don't control, you no longer know what your environment is
>>> with
On 2011-08-17, Chris Angelico wrote:
> On Wed, Aug 17, 2011 at 5:33 PM, Seebs wrote:
>> If it's such a bad thing, *why is it allowed*? ?Why are you proud of the
>> ability to do something that you are never socially-allowed to do?
> Going back to my original three exa
On 2011-08-17, Ethan Furman wrote:
> Part of the fun of Python is experimentation. And how much fun is it to
> be told over and over, "No, you can't do that"?
Okay, I buy that.
Actually, this sort of fits with my experience of how (sane) people do it
in Ruby.
And I'm really the wrong person t
On 2011-08-18, Prasad, Ramit wrote:
>>> Or 'Enter a Python keyword (search the tutorial if you do not know any)
>>> '
>>
>>Sounds good, but now you've trained the spammer who is without a doubt
>>watching this list.
>
> Teach them Python before they can post, I like it!
I don't. If I want
On 2011-08-18, Ethan Furman wrote:
> Yes, we still use Word Perfect, and will as long as it is available.
> The ability to see the codes in use (bold, margins, columns, etc) has so
> far been unequaled in anything else I have looked at.
I have used other software that had this functionality, bu
On 2011-08-19, Steven D'Aprano wrote:
> Even if you don't think it's the ethical thing to do, consider that someday
> you might be maintaining code written by the OP :)
A common further conclusion people reach is "but then I will be able to get
a job fixing it!"
Trust me, this is NOT where you w
On 2011-08-21, Andreas L?scher wrote:
> Am Sonntag, den 21.08.2011, 14:52 -0400 schrieb Roy Smith:
>> In article ,
>> Christian Heimes wrote:
>> > I don't think that's the reason. Modern compiles turn a switch statement
>> > into a jump or branch table rather than a linear search like chained
>>
On 2011-08-23, smith jack wrote:
> i have heard that function invocation in python is expensive, but make
> lots of functions are a good design habit in many other languages, so
> is there any principle when writing python function?
Lots of them. None of them have to do with performance.
> for
On 2011-08-23, Roy Smith wrote:
> I want to log a string but only the first bunch of it, and add "..."
> to the end if it got truncated. This certainly works:
> logger.error("FAILED: '%s{50}', '%s', %s, %s" % (message,
> route, params, e.code))
> does anything like this exist?
%.50s
On 2011-08-23, Ethan Furman wrote:
> Seebs wrote:
>> On 2011-08-23, Roy Smith wrote:
>>> logger.error("FAILED: '%s{50}', '%s', %s, %s" % (message,
>>> route, params, e.code))
>>> does anything like this exist?
>>
On 2011-08-23, Ethan Furman wrote:
> Ah -- that's only part of it -- the OP wants '...' to print as well. :)
O. Hmm.
That's harder. I can't think of a pretty way, so I think I'd probably
write a "prettytrunc(string, len)" or something similar.
-s
--
Copyright 2011, all wrongs reversed.
On 2011-08-29, Steven D'Aprano wrote:
> This is not exactly fresh (it was written back in March), but it's the first
> time I saw it and I thought I'd share. Barry Warsaw, one of the lead Python
> developers, describes one of his most ... interesting ... debugging
> experiences.
That is a truly e
On 2011-08-31, Chris Torek wrote:
> (I realize this thread is old. I have been away for a few weeks.
> I read through the whole thread, though, and did not see anyone
> bring up this one particular point: there is already a linting
> script that handles this.)
Yes. I've found pylint... A weird
On 2011-09-02, Steven D'Aprano wrote:
> Roy Smith wrote:
>> I have a function I want to run in a thread and return a value. It
>> seems like the most obvious way to do this is to have my target
>> function return the value, the Thread object stash that someplace, and
>> return it as the return va
On 2010-11-14, Jorge Biquez wrote:
> I was wondering if you can share what was the strategy you followed
> to master Python (Yes I know I have to work hard study and practice a
> lot). I mean did you use special books, special sites, a plan to
> learn each subject in a special way. I would like
On 2010-07-15, bolega wrote:
> This makes some sense. He replied on the newsgroup in a lengthy post
> that there are sufficient resources out there giving hint that no one
> need help me out. Then I was called "lazy" in one email and tersely
> given JUST the last name of an author who has many boo
On 2010-09-18, Steven D'Aprano wrote:
> On Fri, 17 Sep 2010 16:01:54 -0400, Andreas Waldenburger wrote:
>> On Thu, 16 Sep 2010 16:20:33 -0400 AK wrote:
>>> I also like this construct that works, I think, since 2.6:
>>> code = dir[int(num):] if side == 'l' else dir[:-1*int(num)]
>> I wonder when
On 2010-09-18, AK wrote:
> On 09/18/2010 06:56 PM, Seebs wrote:
>> Basically, I can handle
>> do x if y
>> pretty well, but
>> do x if y else z
>> always breaks my parser.
>> So in English, I might say "I'll go to the store if I have t
On 2010-09-19, AK wrote:
> Funny that you should say that, because I thought quite a few times that
> it would be really awesome if some texts in English had syntax
> highlighting. Obviously, not Brothers Karamazov, but something like a
> tutorial, or a manual, or an online article. If key words w
On 2010-09-19, AK wrote:
> On 09/18/2010 08:35 PM, Seebs wrote:
>> That wouldn't be *syntax* highlighting, that'd be *semantic* highlighting.
> In case of programming, the effect is similar.
I have not found that to be the case. It's been exactly the same as syn
On 2010-09-19, Steven D'Aprano wrote:
> Define "unbalanced".
I'm not sure that's the word I'd use. I'm not even sure what it would mean
here.
> Putting aside the over-use of punctuation, The C syntax feels unbalanced
> to me. You have:
> condition IF true-clause ELSE false-clause
> so both c
On 2010-09-19, Steven D'Aprano wrote:
> I'm not entirely sure I agree with you here... you can't ignore syntax in
> order to understand the meaning of code.
No, but the syntax should be invisible. When I read English, I don't have
to think about nouns and verbs and such unless something is very
On 2010-09-19, AK wrote:
> On 09/19/2010 03:31 AM, Seebs wrote:
>> Just like:
>> if condition:
>> foo
>> else:
>> bar
>> The condition is the primary, the clauses are secondary to it.
> To me, the problem with C ternary i
On 2010-09-19, AK wrote:
> Because that's what 'if' and 'else' mean.
My point is, I don't want the order of the clauses in if/else to change.
If it is sometimes "if else ", then
it should *ALWAYS WITHOUT EXCEPTION* be condition first, then true clause,
then false clause. If it's sometimes "if
On 2010-09-19, MRAB wrote:
> On 19/09/2010 22:32, Seebs wrote:
>> On 2010-09-19, AK wrote:
>>> Because that's what 'if' and 'else' mean.
>> My point is, I don't want the order of the clauses in if/else to change.
>> If it is sometim
On 2010-09-19, Gregory Ewing wrote:
> AK wrote:
>> Afaik the idea is that you can read a novel at the speed of half a page
>> a second or so and understand it to the same extent as people who'd read
>> at a normal rate.
> I've never understood why anyone would *want* to read a
> novel that fast,
On 2010-09-20, alex23 wrote:
> AK wrote:
>> When I was reading The book of the new sun, though, I could stop and
>> read a single sentence a few times over and reflect on it for a minute.
> Totally understandable, Wolfe is a far, far greater writer than
> Rowling :)
Certainly true. On the othe
On 2010-09-20, John Bokma wrote:
> Heh, to me speed reading those 70 pages in a very short while,
> concluding that it's a good book, and start over again would be quite
> the spoiler.
I rarely encounter substantive spoilers in the first 70 pages or so of
a book. That said, I'm pretty much immun
On 2010-09-20, Steven D'Aprano wrote:
> On Sun, 19 Sep 2010 06:16:49 -0700, Aahz wrote:
>> Please don't use tinyurl -- it's opaque and provides zero help to anyone
>> who might later want to look it up (and also no accessibility if tinyurl
>> ever goes down). At the very least, include the origin
On 2010-09-20, John Bokma wrote:
> I didn't mean that there are spoilers in the first 70 pages, just that
> to me the excercise would spoil the book, so, I wouldn't do it. I
> consider a book like a meal, I wouldn't gobble down food, regurgitate
> it, and eat it again at a slower pace. Books, movi
On 2010-09-20, Tim Harig wrote:
> On 2010-09-20, Seebs wrote:
>> * No hint as to what site you'll be getting redirected to.
> Tinyurl, in particular, allows you to preview the url if you choose to do
> so. Other URL shortning services have a similar feature.
I have no i
On 2010-09-20, Tim Harig wrote:
> 1. Don't bother to manually paste when you can use something like urlview
> to lauch directly.
I don't know that this would actually be better than what I currently do,
which is grab text and middle-click in another window.
> If you want this behavio
On 2010-09-20, Steven D'Aprano wrote:
> I don't know about how other people speed-read, but I can assure you that
> when my wife speed-reads, she's not just scanning a few words and
> interpolating between them. She can give you a detailed summary of what
> *actually* happened, not just a good
On 2010-09-20, Steven D'Aprano wrote:
> On Sun, 19 Sep 2010 07:36:11 +0000, Seebs wrote:
>> No, but the syntax should be invisible. When I read English, I don't
>> have to think about nouns and verbs and such unless something is very
>> badly written.
> That
On 2010-09-20, Tim Harig wrote:
> You could simply place the filter in slrn; then, any urls that you see in
> your reader would already be shown with the preview prefix suitable for cut
> and paste mechanisms. If you wanted, you can even have your script
> download the preview and automatically c
On 2010-09-20, Antoon Pardon wrote:
> Not necessarily. Some of us have the impression that Guido deliberatly
> chose an ugly format for the ternary operator. Guido has alwasys been
> against a ternary operator but the requests kept coming. So eventually
> he introduced one. But the impression is t
On 2010-09-21, Steven D'Aprano wrote:
> On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote:
>> Not necessarily. Some of us have the impression that Guido deliberatly
>> chose an ugly format for the ternary operator.
> If he did, then he must have changed his mind, because there is nothing
>
On 2010-09-21, geremy condra wrote:
> I use them when I want to conceal the target of the link. Usually here
> that just means its a letmegooglethatforyou.com link, which I find
> more amusing than is probably healthy.
I thought the idea was funny at first.
Then I posted a question on an IRC cha
On 2010-09-21, Steven D'Aprano wrote:
> On Tue, 21 Sep 2010 03:01:53 +0000, Seebs wrote:
>> On 2010-09-21, geremy condra wrote:
>> Then I posted a question on an IRC channel. I had done a ton of
>> searching already, and I started by explaining the top three
>>
On 2010-09-21, Steven D'Aprano wrote:
> Yes, I know that. I sympathized with your experience and explicitly said
> I was talking about "generic you".
Hah! Then it was *I* who wasn't reading carefully enough! I bet you
didn't expect *THAT*!
-s
--
Copyright 2010, all wrongs reversed. Peter Se
On 2010-09-23, Steven D'Aprano wrote:
> Yes, it certainly is. Describing it as "an ugly format" is also a matter
> of taste -- taste which in my opinion simply isn't justified by anything
> other than familiarity.
It may not be convincing to other people, but the logical inversion strikes
me as
On 2010-09-23, Steven D'Aprano wrote:
> On Thu, 23 Sep 2010 01:49:44 +0000, Seebs wrote:
>> But I do think it's unfair to dismiss it as purely a matter of baby duck
>> syndrome. Consistency in ordering of corresponding idioms seems a
>> reasonable goal.
>
On 2010-09-23, John Bokma wrote:
> Seebs writes:
>> I dunno. I like the "next if /^$/" idiom,
> I don't (as a Perl programmer), I prefer:
Huh, those are actually nicer. I didn't know that was possible; it
wouldn't have occurred to me to try to put &q
On 2010-09-23, loial wrote:
> How can I check whether a file is being written to by another process
> before I access it?
You mean "written to" or "open for possible writing"?
It may be possible (with sufficient privileges) to determine that a
file has been opened for writing. I don't think you
On 2010-09-23, Andreas Waldenburger wrote:
> On 23 Sep 2010 03:54:52 GMT Seebs wrote:
>> I don't generally like constructs where important structural
>> information comes late in the construct. [snip]
> I think that is precisely the reason that the elements of the lis
On 2010-09-26, Steven D'Aprano wrote:
> On Sat, 25 Sep 2010 23:46:57 -0700, Paul Rubin wrote:
>> I think the idea is you should not be able to do mathematical operations
>> on strings, and if you try to do one, Python should raise an exception,
>> rather than using hokey analogies to guess at what
On 2010-09-26, Xah Lee wrote:
> On Sep 25, 11:17??pm, Paul Rubin wrote:
>> Python solution follows (earlier one with an error cancelled). ??All
>> crossposting removed since crossposting is a standard trolling tactic.
> btw, i disagree about your remark on crossposting.
You're wrong. Crosspost
On 2010-09-26, J?rgen Exner wrote:
> It was livibetter who without any motivation or reasoning posted Python
> code in CLPM.
Not exactly; he posted it in a crossposted thread, which happened to include
CLPM and other groups, including comp.lang.python.
It is quite possible that he didn't know ab
On 2010-09-28, John Bokma wrote:
> Seebs writes:
>> On 2010-09-26, J?rgen Exner wrote:
>>> It was livibetter who without any motivation or reasoning posted Python
>>> code in CLPM.
>> Not exactly; he posted it in a crossposted thread, which happened to
On 2010-09-28, Nick Donohue wrote:
> why would I use these? wouldn't it be more flexible to not write the
> decorator before the function definition, so I could choose to wrap it
> or not?
The utility is that it lets you modify all calls to a function at once,
without changing all the instances i
On 2010-09-28, Gary Herron wrote:
> Python does have "s+=t" as a statement, and it does have list
> comprehensions [... for ...] as expressions, but you cannot put a
> statement inside an expression.
I've inferred that, in Python, all assignments are by definition
statements, rather than expre
1 - 100 of 253 matches
Mail list logo