Re: Version Control Software

2013-06-15 Thread Chris Angelico
On Sun, Jun 16, 2013 at 4:29 AM, Dan Sommers wrote: > On Sat, 15 Jun 2013 15:29:27 +, Giorgos Tzampanakis wrote: > >> Also, is working without connection to the server such big an issue? >> One would expect that losing access to the central server would >> indicate significant problems that wo

Re: Don't feed the troll...

2013-06-15 Thread Chris Angelico
On Sun, Jun 16, 2013 at 3:47 AM, Steven D'Aprano wrote: > On Sat, 15 Jun 2013 19:25:21 +0200, Chris “Kwpolska” Warrick wrote: >> The source code seems to think otherwise: > > Mailman is not the only mailing list software in the world, and the > feature you are referring to is optional. > >> http:/

Re: Version Control Software

2013-06-15 Thread Chris Angelico
On Sun, Jun 16, 2013 at 12:16 AM, Roy Smith wrote: > The advantage of DVCS is that everybody has a full copy of the repo. > The disadvantage of the DVCS is that every MUST have a full copy of the > repo. When a repo gets big, you may not want to pull all of that data > just to get the subtree you

Re: Version Control Software

2013-06-15 Thread Chris Angelico
On Sun, Jun 16, 2013 at 1:55 PM, rusi wrote: > On Jun 16, 4:14 am, Chris Angelico wrote: >> On Sun, Jun 16, 2013 at 12:16 AM, Roy Smith wrote: >> > The advantage of DVCS is that everybody has a full copy of the repo. >> > The disadvantage of the DVCS is that every M

Re: Version Control Software

2013-06-15 Thread Chris Angelico
On Sun, Jun 16, 2013 at 3:20 PM, Steven D'Aprano wrote: > On Sun, 16 Jun 2013 14:13:13 +1000, Chris Angelico wrote: > >> I didn't think there would be that much difference, tbh. Mainly, I'm >> just seeing cpython as not being 200MB of history, or so I'd thoug

Re: Version Control Software

2013-06-16 Thread Chris Angelico
On Sun, Jun 16, 2013 at 7:15 PM, Terry Reedy wrote: > On 6/16/2013 1:29 AM, Chris Angelico wrote: >> >> On Sun, Jun 16, 2013 at 3:20 PM, Steven D'Aprano >>> keep in mind that it includes the equivalent of four independent >>> implementations: &

Re: My son wants me to teach him Python

2013-06-16 Thread Chris Angelico
On Mon, Jun 17, 2013 at 5:04 AM, Rick Johnson wrote: > Chris, a GUI interface can be created for *ANY* command line > functionality. By utilizing the GUI you can be more > productive because a "point" and a "click" are always faster > than "peck-peck-peck" * INFINITY. > Okay... I'm trying to get

Re: Using Python to automatically boot my computer at a specific time and play a podcast

2013-06-16 Thread Chris Angelico
On Mon, Jun 17, 2013 at 5:06 AM, C. N. Desrosiers wrote: > Hi, > > I'm planning to buy a Macbook Air and I want to use it as a sort of alarm. > I'd like to write a program that boots my computer at a specific time, loads > iTunes, and starts playing a podcast. Is this sort of thing possible in

Re: Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.]

2013-06-16 Thread Chris Angelico
On Mon, Jun 17, 2013 at 6:02 AM, Steven D'Aprano wrote: > On Sun, 16 Jun 2013 12:31:59 -0700, Mark Janssen wrote: >>> The line between compilers >>> and interpreters is quite fuzzy. >> >> It shouldn't be. > > Of course it should be, because that reflects reality. It's fuzzy AND it seldom even mat

Re: Imports (in Py3), please help a novice

2013-06-16 Thread Chris Angelico
On Mon, Jun 17, 2013 at 4:46 AM, John Ladasky wrote: > I was trying to RTFM linearly, beginning (naturally) at the beginning Alas, the King of Hearts's good advice [1] doesn't work so well with large documentation. :) It seems distutils is rather more complicated than could be desired; but wasn't

Re: Don't feed the troll...

2013-06-17 Thread Chris Angelico
On Mon, Jun 17, 2013 at 3:04 PM, Ferrous Cranus wrote: > The only thing i'm feeling guilty is that instead of reading help files and > PEP's which seem too technical for me, i prefer the live help of an actual > expert human being. > This is definitely a reason to feel guilty. You are asking peo

Re: Don't feed the troll...

2013-06-17 Thread Chris Angelico
On Tue, Jun 18, 2013 at 12:41 AM, wrote: > On 06/17/2013 01:23 AM, Chris Angelico wrote: >> On Mon, Jun 17, 2013 at 3:04 PM, Ferrous Cranus wrote: >>> The only thing i'm feeling guilty is that instead of reading help files and >>> PEP's which seem too techni

Re: Don't feed the troll...

2013-06-18 Thread Chris Angelico
On Tue, Jun 18, 2013 at 11:03 AM, wrote: >> if Python had perfect documentation, >> he still wouldn't read it. > > If your crystal ball is that good, could you try using it > to solve some of Nikos' problems? I have done so, many times. Sometimes it helps, often it doesn't. Once, it led me to ac

Re: Don't feed the troll...

2013-06-18 Thread Chris Angelico
On Tue, Jun 18, 2013 at 6:15 AM, Guy Scree wrote: > I recommend that all participants in this thread, especially Alex and > Anton, research the term "Pathological Altruism" I don't intend to buy a book about it, but based on flipping through a few Google results and snippets, I'm thinking that th

Re: Don't feed the troll...

2013-06-18 Thread Chris Angelico
On Tue, Jun 18, 2013 at 2:39 PM, alex23 wrote: > tl;dr Stop acting like a troll and we'll stop perceiving you as such. This being Python-list, we duck-type. You don't have to declare that you're a troll, like you would in C; you just react like a troll and we'll treat you as one. We never ask "ar

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-18 Thread Chris Angelico
On Tue, Jun 18, 2013 at 7:51 PM, Νίκος wrote: > Στις 18/6/2013 12:05 μμ, ο/η Steven D'Aprano έγραψε: > >> Names are *always* linked to objects, not to other names. >> >> a = [] >> b = a # Now a and b refer to the same list >> a = {} # Now a refers to a dict, and b refers to the same list as befor

Re: Why is regex so slow?

2013-06-18 Thread Chris Angelico
On Wed, Jun 19, 2013 at 3:08 AM, Roy Smith wrote: > I'm tempted to open this up as a performance bug against the regex module > (which I assume will be rejected, at least for the 2.x series). Yeah, I'd try that against 3.3 before opening a performance bug. Also, it's entirely possible that perf

Re: Don't feed the troll...

2013-06-19 Thread Chris Angelico
On Wed, Jun 19, 2013 at 1:49 PM, wrote: > On 06/18/2013 01:21 AM, Chris Angelico wrote: >> On Tue, Jun 18, 2013 at 2:39 PM, alex23 wrote: >>> tl;dr Stop acting like a troll and we'll stop perceiving you as such. >> >> This being Python-list, we duck-t

Re: A certainl part of an if() structure never gets executed.

2013-06-19 Thread Chris Angelico
On Wed, Jun 19, 2013 at 3:42 PM, Dave Angel wrote: > Names are *one of* the ways we specify which objects are to be used. (We can > also specify objects via an container and a subscript or slice, or via an > attribute of another object. And probably another way or two.) But you always have to bo

Re: Don't feed the troll...

2013-06-19 Thread Chris Angelico
On Wed, Jun 19, 2013 at 5:27 PM, Steven D'Aprano wrote: > On Wed, 19 Jun 2013 17:07:28 +1000, Chris Angelico wrote: > >> On the contrary, stereotyping is "You are-a , therefore you >> will behave in ". > > I don't think that's how stereotypes usu

Re: A certainl part of an if() structure never gets executed.

2013-06-19 Thread Chris Angelico
On Wed, Jun 19, 2013 at 6:06 PM, Dave Angel wrote: > On 06/19/2013 03:14 AM, Chris Angelico wrote: >> >> On Wed, Jun 19, 2013 at 3:42 PM, Dave Angel wrote: >>> >>> Names are *one of* the ways we specify which objects are to be used. (We >>> can >&

Re: A certainl part of an if() structure never gets executed.

2013-06-19 Thread Chris Angelico
On Wed, Jun 19, 2013 at 6:55 PM, Steven D'Aprano wrote: > On Wed, 19 Jun 2013 18:21:40 +1000, Chris Angelico wrote: > >> You can't reference an object without >> somewhere having either a name or a literal to start it off. > > True, but not necessarily a name bo

Re: A Beginner's Doubt

2013-06-19 Thread Chris Angelico
On Wed, Jun 19, 2013 at 11:58 PM, wrote: > My goal is to learn and program it by myself, as good as the time allows me. > That said, what I seek here is advice from people who definitively have more > experience than me on topics like: is it possible to develop this kind of > program in such a

Re: Idea for key parameter in all() builting, would it be feasible?

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 2:14 AM, wrote: > And the following, although the same thing really as all(xrange(10**9)), is > not as instant and will take even longer than the above. > all(map(lambda x: bool(x), xrange(10**9))) > > However if all by some chance (I don't know how this stuff works

Re: Idea for key parameter in all() builting, would it be feasible?

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 2:32 AM, wrote: >>All you need is the iterator version of map(). In Python 3, that's the >>normal map(); in Python 2, use this: > > from itertools import imap > all(imap(lambda x: bool(x), xrange(10**9))) >>False > >>It's roughly instant, like you would expect. > >

Re: A Beginner's Doubt

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 2:53 AM, Joshua Landau wrote: > Now, as I'm probably the most new programmer here I'll point out that > I don't agree with Chris when he says that: > >> One way or >> another, you will probably spend the next week writing code you throw >> away; if you try to tackle the pri

Re: Problem with the "for" loop syntax

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:02 AM, Arturo B wrote: > Fixed, the problem was in > HANGMANPICS > > I didn't open the brackets. > > Thank you guys :) General debugging tip: Syntax errors are sometimes discovered quite some way below the actual cause. The easiest way to figure out what's the real caus

Re: About GIL Questions!

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 2:13 PM, Thanatos xiao wrote: > Hey everyone! > Recently I see the python source code, but i still not understand about gil. > first, why single core quicker multi-core ? who can explan this in bottom > layery ? > second, what the different between the mult-core and the si

Re: A Beginner's Doubt

2013-06-20 Thread Chris Angelico
On Thu, Jun 20, 2013 at 1:31 AM, Rick Johnson wrote: > On Wednesday, June 19, 2013 8:58:19 AM UTC-5, augus...@gmail.com wrote: >> This is my first post in this group and the reason why I >> came across here is that, despite my complete lack of >> knowledge in the programming area, I received an or

Re: A few questiosn about encoding

2013-06-20 Thread Chris Angelico
On Fri, Jun 21, 2013 at 1:12 AM, Rick Johnson wrote: > On Thursday, June 20, 2013 9:04:50 AM UTC-5, Andrew Berg wrote: >> On 2013.06.20 08:40, Rick Johnson wrote: > >> > then what is the purpose of a Unicode Braille character set? >> Two dimensional characters can be made into 3 dimensional sh

Re: A few questiosn about encoding

2013-06-20 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:40 PM, Rick Johnson wrote: > Your generalization is analogous to explaining web browsers > as: "software that allows a user to view web pages in the > range www.*" Do you think someone could implement a web > browser from such limited specification? (if that was all > th

Re: Default Value

2013-06-20 Thread Chris Angelico
On Fri, Jun 21, 2013 at 12:49 AM, Rick Johnson wrote: > When the subroutine is completed, all inputs and local > variables are expected to be destroyed. If the programmer > wants a return value, he need simply ask. Data persistence > is not a function of subroutines! Funny, C violates your descri

Re: Idea for key parameter in all() builting, would it be feasible?

2013-06-20 Thread Chris Angelico
On Fri, Jun 21, 2013 at 12:49 AM, Russel Walker wrote: > On Thursday, June 20, 2013 12:45:27 PM UTC+2, Antoon Pardon wrote: >> Op 19-06-13 18:14, russ.po...@gmail.com schreef: >> >> > >> >> all(map(lambda x: bool(x), xrange(10**9))) >> >> Since you already have your answer, I just like to get

Re: Problem with the "for" loop syntax

2013-06-20 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:55 PM, Neil Cerutti wrote: > On 2013-06-20, Joshua Landau wrote: >> On 20 June 2013 04:11, Cameron Simpson wrote: >>> Also, opening-and-not-closing a set of brackets is almost the >>> only way in Python to make this kind of error (syntax at one >>> line, actual mistake

Re: A few questiosn about encoding

2013-06-20 Thread Chris Angelico
On Fri, Jun 21, 2013 at 2:27 AM, wrote: > And all these coding schemes have something in common, > they work all with a unique set of code points, more > precisely a unique set of encoded code points (not > the set of implemented code points (byte)). > > Just what the flexible string representati

Re: A few questiosn about encoding

2013-06-20 Thread Chris Angelico
On Fri, Jun 21, 2013 at 3:17 AM, MRAB wrote: > On 20/06/2013 17:37, Chris Angelico wrote: >> >> On Fri, Jun 21, 2013 at 2:27 AM, wrote: >>> >>> And all these coding schemes have something in common, >>> they work all with a unique set of code points,

Re: Default Value

2013-06-20 Thread Chris Angelico
On Fri, Jun 21, 2013 at 3:12 AM, rusi wrote: > Python (and all the other 'cool' languages) dont have gotchas because > someone malevolently put them there. > In most cases, the problem is seen too late and the cost of changing > entrenched code too great. > Or the problem is clear, the solution is

Re: Default Value

2013-06-21 Thread Chris Angelico
On Fri, Jun 21, 2013 at 1:16 PM, Rick Johnson wrote: > On Thursday, June 20, 2013 7:57:28 PM UTC-5, Steven D'Aprano wrote: >> Python functions are >> created *once*, when defined. The cost of building the >> function -- compiling the source code to byte code, >> assembling the pieces into a functi

Re: Default Value

2013-06-21 Thread Chris Angelico
On Sat, Jun 22, 2013 at 4:26 AM, Rick Johnson wrote: > I could cast a "virtual net" over my poor lemmings before > they jump off the cliff by throwing an exception: > > Traceback (most recent screw-up last): >Line BLAH in SCRIPT > def f(x = [None, b, [a, [4]]]): > ArgumentError: No mut

Re: Default Value

2013-06-21 Thread Chris Angelico
On Sat, Jun 22, 2013 at 11:15 AM, Rick Johnson wrote: > # Literal > py> d = {[1]:2} > Traceback (most recent call last): > File "", line 1, in > d = {[1]:2} > TypeError: unhashable type: 'list' > # Symbol > py> lst = [1] > py> d = {lst:2} > Traceback

Re: Default Value

2013-06-21 Thread Chris Angelico
On Sat, Jun 22, 2013 at 11:31 AM, Steven D'Aprano wrote: > Thinking about this, I think that the only safe thing to do in Rickython > 4000 is to prohibit putting mutable objects inside tuples. Putting a list > or a dict inside a tuple is just a bug waiting to happen! I think you're onto something

Re: Default Value

2013-06-21 Thread Chris Angelico
On Sat, Jun 22, 2013 at 11:27 AM, Ian Kelly wrote: > On Fri, Jun 21, 2013 at 7:15 PM, Steven D'Aprano > wrote: >> On Fri, 21 Jun 2013 23:49:51 +0100, MRAB wrote: >> >>> On 21/06/2013 21:44, Rick Johnson wrote: >> [...] Which in Python would be the "MutableArgumentWarning". *school-

Re: Default Value

2013-06-21 Thread Chris Angelico
On Sat, Jun 22, 2013 at 12:01 PM, Rotwang wrote: class hashablelist(list): > ... def __hash__(self): > ... return hash(tuple(self)) There's a vulnerability in that definition: >>> a=hashablelist((1,[],3)) >>> a [1, [], 3] >>> {a:1} Traceback (most recent call last): File "", l

Re: Simple I/O problem can't get solved

2013-06-22 Thread Chris Angelico
On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@web.de> wrote: > Combining these modifications: > > for line in f: > word = line.strip() > if is_palindrome.is_palindrome(word): > print word Minor quibble: I wouldn't use the name 'word' here, unless you're expecting the file

Re: n00b question on spacing

2013-06-22 Thread Chris Angelico
On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson wrote: > _fmtstr = "Item wrote to MongoDB database {0}, {1}" > msg = _fmtstr.format(_arg1, _arg2) As a general rule, I don't like separating format strings and their arguments. That's one of the more annoying costs of i18n. Keep them in a single e

Re: n00b question on spacing

2013-06-22 Thread Chris Angelico
On Sun, Jun 23, 2013 at 9:28 AM, Dave Angel wrote: > On 06/22/2013 07:12 PM, Chris Angelico wrote: >> >> On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson >> wrote: >>> >>>_fmtstr = "Item wrote to MongoDB database {0}, {1}" >>>msg =

Re: n00b question on spacing

2013-06-22 Thread Chris Angelico
On Sun, Jun 23, 2013 at 9:56 AM, Dave Angel wrote: > On 06/22/2013 07:37 PM, Chris Angelico wrote: >>> On the contrary, i18n should be done with config files. The format >>> string > > > **as specified in the physical program** > > >>> is the key to t

Re: n00b question on spacing

2013-06-22 Thread Chris Angelico
On Sun, Jun 23, 2013 at 10:48 AM, Rick Johnson wrote: > On Saturday, June 22, 2013 6:12:50 PM UTC-5, Chris Angelico wrote: >> As a general rule, I don't like separating format strings and their >> arguments. > > Huh? Format strings don't take arguments because Pyth

Re: newbie question

2013-06-22 Thread Chris Angelico
On Sun, Jun 23, 2013 at 12:39 PM, wrote: > Writing simple program asking a question with the answer being "yes"...how do > I allow the correct answer if user types Yes, yes, or YES? The thing you're looking for is case-folding, or possibly lower-casing. You should be able to find what you want

Re: n00b question on spacing

2013-06-22 Thread Chris Angelico
On Sun, Jun 23, 2013 at 1:22 PM, Steven D'Aprano wrote: > On Sat, 22 Jun 2013 23:12:49 -0400, Roy Smith wrote: > >> In article <51c66455$0$2$c3e8da3$54964...@news.astraweb.com>, >> Steven D'Aprano wrote: >> >>> http://infiniteundo.com/post/25326999628/falsehoods-programmers- > believe-about-

Re: n00b question on spacing

2013-06-22 Thread Chris Angelico
On Sun, Jun 23, 2013 at 12:58 PM, Steven D'Aprano wrote: > On Sun, 23 Jun 2013 02:20:56 +0100, MRAB wrote: > >> One vs not-one isn't good enough. Some languages use the singular with >> any numbers ending in '1'. Some languages have singular, dual, and >> plural. Etc. It's surprising how inventive

Re: Is this PEP-able? fwhile

2013-06-24 Thread Chris Angelico
On Tue, Jun 25, 2013 at 5:52 AM, wrote: > (NOTE: Many people are being taught to avoid 'break' and 'continue' at all > costs... Why? Why on earth should break/continue be avoided? I think that's the solution: teach people that loops are there to be interrupted and manipulated. And then it's a s

Re: Is this PEP-able? fwhile

2013-06-24 Thread Chris Angelico
On Tue, Jun 25, 2013 at 8:30 AM, Tim Chase wrote: > On 2013-06-25 07:38, Chris Angelico wrote: >> Python has no issues with breaking out of loops, and even has >> syntax specifically to complement it (the 'else:' clause). Use >> break/continue when appropriat

Re: Is this PEP-able? fwhile

2013-06-24 Thread Chris Angelico
On Tue, Jun 25, 2013 at 8:43 AM, Ian Kelly wrote: > On Mon, Jun 24, 2013 at 4:41 PM, Fábio Santos > wrote: >> >> On 24 Jun 2013 22:29, "Ian Kelly" wrote: >>> >>> On Mon, Jun 24, 2013 at 2:34 PM, Fábio Santos >>> wrote: >>> > This can probably be best achieved by adding to the existing for loop

Re: Is this PEP-able? fwhile

2013-06-24 Thread Chris Angelico
On Tue, Jun 25, 2013 at 12:01 PM, rusi wrote: > On Tuesday, June 25, 2013 3:08:57 AM UTC+5:30, Chris Angelico wrote: >> On Tue, Jun 25, 2013 at 5:52 AM, <> wrote: >> >> > (NOTE: Many people are being taught to avoid 'break' and 'continue' a

Re: Is this PEP-able? fwhile

2013-06-25 Thread Chris Angelico
On Tue, Jun 25, 2013 at 2:20 PM, Benjamin Kaplan wrote: > On Mon, Jun 24, 2013 at 8:54 PM, Chris Angelico wrote: >> On Tue, Jun 25, 2013 at 12:01 PM, rusi wrote: >>> On Tuesday, June 25, 2013 3:08:57 AM UTC+5:30, Chris Angelico wrote: >>>> On Tue, Jun

Re: n00b question on spacing

2013-06-25 Thread Chris Angelico
On Tue, Jun 25, 2013 at 9:19 PM, Robert Kern wrote: > There is quite a bit of Python's lexical analysis that is specified in > places other than the formal notation. That does not mean it is undefined. > It is well defined in the lexer code and the documentation. You suggest that > a "rule probabl

Re: n00b question on spacing

2013-06-25 Thread Chris Angelico
On Tue, Jun 25, 2013 at 9:59 PM, Robert Kern wrote: > On 2013-06-25 12:48, Chris Angelico wrote: >> >> On Tue, Jun 25, 2013 at 9:19 PM, Robert Kern >> wrote: >>> >>> There is quite a bit of Python's lexical analysis that is specified in >>>

Re: Inconsistency on getting arguments

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 12:17 AM, Dave Angel wrote: > On 06/25/2013 09:55 AM, Peter Otten wrote: >> >> Marco Perniciaro wrote: >> >>> Hi, >>> I've been working with Python for a long time. >>> Yet, I came across an issue which I cannot explain. >>> >>> Recently I have a new PC (Windows 7). >>> Pre

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 3:44 AM, Ian Kelly wrote: > On Sun, Jun 23, 2013 at 1:33 PM, Antoon Pardon > wrote: >> Op 23-06-13 18:35, Steven D'Aprano schreef: >>> Please don't. This is false economy. The time you save will be trivial, >>> the overhead of inheritance is not going to be the bottleneck

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 8:25 AM, Ian Kelly wrote: > On Tue, Jun 25, 2013 at 4:17 PM, Chris Angelico wrote: >> The main problem is getting to the top/end of the call chain. Classic >> example is with __init__, but the same problem can also happen with >> other calls. Jus

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 8:27 AM, Mark Janssen wrote: > Here's how it *should* be made: the most superest, most badassed > object should take care of its children. New instances should > automatically call up the super chain (and not leave it up to the > subclasses), so that the parent classes ca

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 8:38 AM, Mark Janssen wrote: > Combining integers with sets I can make > a Rational class and have infinite-precision arithmetic, for example. Combining two integers lets you make a Rational. Python integers are already infinite-precision. Or are you actually talking of us

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 9:00 AM, Mark Janssen wrote: >> 1) That breaks the Liskov Substitution Principle. A subclass of list >> ought to fulfill the contracts of a basic list. > > We don't need LSP. I write about this on the WIkiWikiWeb where there > were many arguments documented and many hairs

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Chris Angelico
On Wed, Jun 26, 2013 at 11:07 AM, Mark Janssen wrote: Combining two integers lets you make a Rational. >>> >>> Ah, but what is going to group them together? You see you've already >>> gotten seduced. Python already uses a set to group them together -- >>> it's called a Dict and it's in ever

Re: Is this PEP-able? fwhile

2013-06-26 Thread Chris Angelico
On Wed, Jun 26, 2013 at 10:47 AM, Dennis Lee Bieber wrote: > On Tue, 25 Jun 2013 17:20:43 +1000, Neil Hodgson > declaimed the following: > >>jim...@aol.com: >> >>> Syntax: >>> fwhile X in ListY and conditionZ: >> >>There is precedent in Algol 68: >> >>for i from 0 to n while safe(i) do .. od

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Chris Angelico
On Wed, Jun 26, 2013 at 9:19 AM, Mark Janssen wrote: > Did you ever hear of the Glass Bead Game? Yeah, it's Magic: The Gathering and its counters. http://www.wizards.com/magic/magazine/Article.aspx?x=mtgcom/daily/mr195 :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Chris Angelico
On Thu, Jun 27, 2013 at 1:16 AM, Rotwang wrote: > On 25/06/2013 23:57, Chris Angelico wrote: >> >> On Wed, Jun 26, 2013 at 8:38 AM, Mark Janssen >> wrote: >>> >>> Combining integers with sets I can make >>> a Rational class and have infinite-preci

Re: Limit Lines of Output

2013-06-26 Thread Chris Angelico
On Thu, Jun 27, 2013 at 1:24 AM, Joshua Landau wrote: > On 25 June 2013 22:48, Gene Heskett wrote: >> On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine: > > I did not. Beg pardon? It looked like an accurate citation to me - you quoted the OP's second post, then added the line beginning "S

Re: looking for a linguistical/semiotic quote

2013-06-27 Thread Chris Angelico
On Thu, Jun 27, 2013 at 9:14 PM, rusi wrote: > I am looking for a quote > (from Whorf/Sapir/Wittgenstein/Humboldt dunno... that 'school') > > It goes something like this: > > What characterizes a language is not what we can say in it but what we must > -- like it or not -- say. I think you may b

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Chris Angelico
On Fri, Jun 28, 2013 at 8:19 AM, Grant Edwards wrote: > On 2013-06-27, Jason Swails wrote: > >> He _is_ using cmd. He's subclassed cmd.Cmd and trying to use >> argparse to handle argument parsing in the Cmd.precmd method to >> preprocess the user input. > > [...] > >> Having subclassed cmd.Cmd m

Re: indexerror: list index out of range??

2013-06-28 Thread Chris Angelico
mework assignments. Honesty won't hurt you (since we can all tell anyway), and it means we know you're trying to learn, not to cheat. And yes, there are a discouraging number of people who do try to cheat, so setting yourself apart from them is well worth it. :) Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a name for a deployment framework...

2013-06-29 Thread Chris Angelico
On Wed, Jun 26, 2013 at 9:40 PM, Roy Smith wrote: > For further hack value, require that all pull requests to the project be > done entirely in iambic pentameter: > > for host in hosts: >deploy(the_code).remote() For further hack delight, require a patch Submitted for this code restrict itsel

Re: Closures in leu of pointers?

2013-06-29 Thread Chris Angelico
On Sun, Jun 30, 2013 at 2:32 PM, Terry Reedy wrote: > On 6/29/2013 5:21 PM, Ian Kelly wrote: >> >> On Sat, Jun 29, 2013 at 2:53 PM, Terry Reedy wrote: >>> >>> # The alternative for either program or people is a 1-pass + backtracking >>> process where all understandings are kept provisional until

Re: Closures in leu of pointers?

2013-06-29 Thread Chris Angelico
On Sun, Jun 30, 2013 at 3:46 PM, Ian Kelly wrote: > On a related note, I think that generator functions should in some way > be explicitly marked as such in the declaration, rather than needing > to scan the entire function body for a yield statement to determine > whether it's a generator or not.

Stupid ways to spell simple code

2013-06-29 Thread Chris Angelico
There's a bit of a discussion on python-ideas that includes a function that raises StopIteration. It inspired me to do something stupid, just to see how easily I could do it... On Sun, Jun 30, 2013 at 3:45 PM, Nick Coghlan wrote: Re: [Python-ideas] "Iteration stopping" syntax def stop(): > .

Re: Stupid ways to spell simple code

2013-06-30 Thread Chris Angelico
On Mon, Jul 1, 2013 at 1:08 AM, Joshua Landau wrote: > On 30 June 2013 15:58, Rick Johnson wrote: >> Chris, i'm sorry, but your challenge is decades too late. If you seek >> amusement you need look no further than the Python stdlib. If you REALLY >> want to be amused, peruse the "idlelib" -- no

Re: password protect file

2013-06-30 Thread Chris Angelico
On Mon, Jul 1, 2013 at 8:17 AM, wrote: > > i just want something simple that basicly asks for a password and then > replies to u if you are wrong nothing hevay just for learning exsperience > -- Then your task is pretty easy. Look up these things in the Python docs: * input (or raw_input if yo

Re: Stupid ways to spell simple code

2013-07-01 Thread Chris Angelico
On Mon, Jul 1, 2013 at 10:59 PM, Neil Cerutti wrote: > On 2013-06-30, Chris Angelico wrote: >> So, here's a challenge: Come up with something really simple, >> and write an insanely complicated - yet perfectly valid - way >> to achieve the same thing. Bonus p

Re: Stupid ways to spell simple code

2013-07-02 Thread Chris Angelico
On Tue, Jul 2, 2013 at 2:30 AM, Joshua Landau wrote: > Beautiful, see? Truly a work of art! I am awed. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-07-02 Thread Chris Angelico
On Tue, Jul 2, 2013 at 12:02 AM, wrote: > ... engaging in flame wars with trolls simply produces more > flames, hostility begets hostility ... It does. Please can these threads die quietly now? ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: python adds an extra half space when reading from a string or list

2013-07-02 Thread Chris Angelico
On Tue, Jul 2, 2013 at 5:55 PM, Antoon Pardon wrote: > Fine you give me an opportunity to point out the problems in your thinking > without giving yourself the opportunity to respond. I can live with that. And by continuing to rant, you just make other people sick of reading your posts. Please, d

Re: how to calculate reputation

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 10:18 AM, Steven D'Aprano wrote: > It's very easy to come up with lousy algorithms for calculating > reputation, much harder to come up with good algorithms. Yes. Reminder: Don't just average your users' ratings. http://xkcd.com/937/ In fact, mere upvotes and downvotes mig

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 5:34 PM, Tim Golden wrote: > On 03/07/2013 02:34, Andrew Berg wrote: >> DOS is long >> dead, and is much, much different under the hood from the console >> subsystem in modern versions of Windows. > > > While this is clearly true, it's by no means unusual for people to refer

Re: Bug reports [was Re: Python list code of conduct]

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 10:52 AM, Steven D'Aprano wrote: > A popular language like Python has been around for about 20 years. It is > in daily use by tens of thousands of people around the world. What are > the chances that you, in your first week of using Python, just happened > to stumble across

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 7:21 PM, Antoon Pardon wrote: > Op 03-07-13 02:30, ru...@yahoo.com schreef: >> If your going to point out something negative about someone >> then do so politely. Ask yourself if you were pointing out >> incompetence to your boss (or anyone else where impoliteness >> could

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 10:50 PM, Tim Chase wrote: > On 2013-07-03 09:51, Tim Golden wrote: >> We can certainly agree on this. I can't count the number of emails >> I've deleted as too hot-headed in response to dismissive comments >> about Windows as a platform. Some of them, at least, appear to be

Re: [SPOILERS] Python easter eggs

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 12:03 AM, Ian Foote wrote: > import antigravity Having checked its docstring, I am now left wondering what I can do with the Munroe geohashing algorithm and if there's any way I could use that at work somehow. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is CPython 2.5 a dependency for Jython 2.5?

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 10:55 PM, rusi wrote: > On Wednesday, July 3, 2013 5:52:12 PM UTC+5:30, Steven D'Aprano wrote: >> I'm running a box with Debian squeeze, and I just ran: >> sudo aptitude install jython >> which ended up installing Python 2.5: > > BTW trying to install jython out here gave me

Re: Bug reports [was Re: Python list code of conduct]

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 12:03 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> Of course, it's possible for there to be dark corners. But if you're >> working with those, you know it full well. The dark corners of Python >> might be in some

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 8:04 PM, Antoon Pardon wrote: >> If my boss gave a random stranger from a mailing list the root >> password to one of our servers, I would say to his face that he had >> betrayed his (our) customers' trust. I would say it with strong >> emphasis and a raised tone, too, and n

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 8:00 PM, Νίκος wrote: > Στις 3/7/2013 12:45 μμ, ο/η Chris Angelico έγραψε: > >>> ] You have betrayed the trust of all your customers. >>> >>> Which seemed to be accepted on this list without a problem. >> >> >> If my boss

Re: Bug reports [was Re: Python list code of conduct]

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 12:23 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> On Thu, Jul 4, 2013 at 12:03 AM, Roy Smith wrote: >> > In article , >> > Chris Angelico wrote: >> > >> >> Of course, it's possible for

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 1:36 AM, Νίκος wrote: > I will *not* give away my root pass to anyone for any reason but i will open > a norla user account for someone if i feel like trusting him and copy my > python file to his homr dir to take alook from within. Well... well... baby steps. That's someth

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 2:47 AM, Νίκος wrote: > Στις 3/7/2013 6:44 μμ, ο/η Chris Angelico έγραψε: >> >> On Thu, Jul 4, 2013 at 1:36 AM, � wrote: >>> >>> I will *not* give away my root pass to anyone for any reason but i will >>> open >>&

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 3:07 AM, Νίκος wrote: > Στις 3/7/2013 7:53 μμ, ο/η Chris Angelico έγραψε: >> What are the file permissions (file modes) on all your home >> directories? Do you know what they mean? > > > root@nikos [~]# ls -al /home > total 88 > drwx--x--x 22

Re: Default scope of variables

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 1:27 PM, Steven D'Aprano wrote: > With respect to the Huffman coding of declarations, Javascript gets it > backwards. Locals ought to be more common, but they require more typing. > Locals are safer, better, more desirable than globals, and so it should > be easier to use lo

Re: Why this code works in python3, but not python 2:

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 1:52 PM, Maciej Dziardziel wrote: > Out of curiosity: Does anyone know why the code below is valid in python3, > but not python2: > > def foo(*args, bar=1, **kwargs): > pass Keyword-only arguments are (IIRC) a Py3-only feature. There are lots of features that don't wor

Re: Default scope of variables

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 2:30 PM, Joshua Landau wrote: > That said, I'm not too convinced. Personally, the proper way to do > what you are talking about is creating a new closure. Like: > > for i in range(100): > with new_scope(): > for i in range(100): > func(i) > func(i

Re: Default scope of variables

2013-07-03 Thread Chris Angelico
On Thu, Jul 4, 2013 at 3:32 PM, Steven D'Aprano wrote: > Accidental shadowing can be a problem, but I've never heard of anyone > saying that they were *forced* to shadow a global they needed access to. > Just pick a different name. Here's one example of shadowing that comes from a C++ project at

<    1   2   3   4   5   6   7   8   9   10   >