Re: Turnign greek-iso filenames => utf-8 iso

2013-06-13 Thread Steven D'Aprano
On Thu, 13 Jun 2013 10:16:42 -0400, Zero Piraeus wrote: > : > >> Steven, i can create a normal user account for you and copy files.py >> into your home folder if you want to take a look from within. > > Nikos, please, DO NOT DO THIS. > > It must be clear to

Re: Debugging memory leaks

2013-06-13 Thread Steven D'Aprano
ks, then I'll probably never fix it and I should just give up and apply palliative reboots to work around the problem." Either that or hire an expert at debugging memory leaks. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a Super Simple WWW Link, Copy, & Paste into Spreadsheet Program

2013-06-13 Thread Steven D'Aprano
ill want to do this? > Please, please help me my wrist is starting to hurt a lot. To much information! You need to do more programming and less choking the chicken. *wink* -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Turnign greek-iso filenames => utf-8 iso

2013-06-13 Thread Steven D'Aprano
On Thu, 13 Jun 2013 19:20:06 +0300, Νικόλαος Κούρας wrote: > But iam not offering Steven full root access, but restricted user level > access. Are you implying that for example one could elevate his > privileges to root level access form within a normal restricted user > account? M

Re: My son wants me to teach him Python

2013-06-13 Thread Steven D'Aprano
ialog. But in any case, there are certainly strengths and weaknesses of both GUIs and text interfaces, and one should design programs around whichever is best for the needs of the program and the user. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Steven D'Aprano
uctive junk doesn't do anyone any favours. Thank you. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrong website loaded when other requested

2013-06-14 Thread Steven D'Aprano
;t shout, it's rude. We're not your servants. This is not a http.conf group, this is a Python group. The only suggestion I have is, find a forum that discusses web config and ask there. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-14 Thread Steven D'Aprano
spare_cash = 11 if today_is_tuesday and finish_work_early and spare_cash > 16: print("Going to the movies") else: print("No movies today.") -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Steven D'Aprano
ors and generators ought to be considered falsey, since they are empty, but because they don't know they are empty until called, they are actually treated as truthy. But otherwise, the model is very clean. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Steven D'Aprano
== 1Invalid sqrt 2Invalid addition, e.g. +INF + -INF 3Invalid division, e.g. 0/0 17 Convert invalid string 21 Attempt to create NAN with 0 as payload etc. (Assigning meaning to the payload is optional, according to the IEEE 754 standard, if I recall correctly.) -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging memory leaks

2013-06-14 Thread Steven D'Aprano
On Fri, 14 Jun 2013 22:57:24 +, Giorgos Tzampanakis wrote: > On 2013-06-14, Steven D'Aprano wrote: > >> On Thu, 13 Jun 2013 20:15:42 +, Giorgos Tzampanakis wrote: >> >>>> Therefore: if the leak seems to be small, it may be much more >>>>

Re: how to use two threads to produce even and odd numbers?

2013-06-14 Thread Steven D'Aprano
: 193 oushu got a value: 195 oushu got a value: 197 oushu got a value: 199 oushu Finished Or something similar to that. Does this help? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

NANs [was Re: Eval of expr with 'or' and 'and' within]

2013-06-14 Thread Steven D'Aprano
ving an actual number. [2] Python doesn't allow you to configure float's behaviour but the Decimal module does. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern Search Regular Expression

2013-06-15 Thread Steven D'Aprano
t; (ii) the > (iii) the > (iv) this > (v) this > (vi) the new > . > > The problem may be handled by converting the string to list and then > index of list. No need for a regular expression. py> sentence = "By the new group" py> words = sentence.split() py> words[1:-1] ['the', 'new'] Does that help? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: A few questiosn about encoding

2013-06-15 Thread Steven D'Aprano
On Sat, 15 Jun 2013 17:49:13 +0300, Nick the Gr33k wrote: > What the difference between a byte and a byte's value? Nothing. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-15 Thread Steven D'Aprano
. Sending them TWO identical replies is just rude. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-15 Thread Steven D'Aprano
On Sat, 15 Jun 2013 18:41:41 +0200, Chris “Kwpolska” Warrick wrote: > On Sat, Jun 15, 2013 at 5:40 PM, Steven D'Aprano > wrote: >> On Sat, 15 Jun 2013 07:58:27 -0400, D'Arcy J.M. Cain wrote: >> >>> I suggested including the poster that you are replying to.

Re: Don't feed the troll...

2013-06-15 Thread Steven D'Aprano
On Sat, 15 Jun 2013 19:25:21 +0200, Chris “Kwpolska” Warrick wrote: > On Sat, Jun 15, 2013 at 7:07 PM, D'Arcy J.M. Cain > wrote: >> On Sat, 15 Jun 2013 18:41:41 +0200 >> Chris “Kwpolska” Warrick wrote: >>> On Sat, Jun 15, 2013 at 5:40 PM, Steven D'Aprano

Re: RFD: rename comp.lang.python to comp.support.superhost

2013-06-15 Thread Steven D'Aprano
iled. If you have nothing helpful to say, send it to /dev/null. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-15 Thread Steven D'Aprano
If you have nothing helpful to say, send it to /dev/null. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-15 Thread Steven D'Aprano
humor... all the best, Buford" http://mail.python.org/pipermail/python-list/2013-June/649680.html If you insist on taking umbrage on behalf of the OP, I can't stop you, but that says more about you than about me. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Why 'files.py' does not print the filenames into a table format?

2013-06-15 Thread Steven D'Aprano
extremely exclusive club. See you in a month. *plonk* -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-15 Thread Steven D'Aprano
On Sun, 16 Jun 2013 09:09:37 +1000, Chris Angelico wrote: > 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

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

2013-06-15 Thread Steven D'Aprano
r even "if a quacks like a true value then return a otherwise return b" to emphasis that this is a form of duck-typing, and avoid any confusion with "if a is True". But otherwise, well said. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Python Greek mailing list [was Re: Why 'files.py' does not print the filenames into a table format?]

2013-06-15 Thread Steven D'Aprano
. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-15 Thread Steven D'Aprano
an awesome language, but it may not be quite as much active development as Python... as you point out yourself, there are nearly three times as many commits to CPython as to Pike, which coincidentally (or not) corresponds to the CPython repo being nearly three times as large as the Pike repo. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Greek mailing list [was Re: Why 'files.py' does not print the filenames into a table format?]

2013-06-16 Thread Steven D'Aprano
On Sun, 16 Jun 2013 11:28:00 +0300, Nick the Gr33k wrote: > On 16/6/2013 8:06 πμ, Steven D'Aprano wrote: >> Nikos, >> >> Have you considered subscribing to this? >> >> http://mail.python.org/mailman/listinfo/python-greece [...] > I prefer staying here

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

2013-06-16 Thread Steven D'Aprano
feature of interpreted languages is not that they are not compiled, but that the compiler is part of the language runtime and that, therefore, it is possible (and easy) to execute code generated on the fly." -- Roberto Ierusalimschy, "Programming In Lua", 2nd Edition, p. 63 -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-16 Thread Steven D'Aprano
it wants. CPython caches small integers, but not floats. Other implementations may cache fewer, or more, immutable objects. One thing which no Python implementation can do though is re-use *mutable* objects. [...] > These are really C terms, not Python terms. Stop thinking that C is > behaving like Python. This is certainly true! -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-16 Thread Steven D'Aprano
e program supposed to run? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-16 Thread Steven D'Aprano
s Fortran. Forth is another such language. It's not quite so old as Lisp, but it is especially interesting because Forth includes commands to switch from "compile mode" to "interpret mode" on the fly. So is it a compiler or an interpreter? Yes. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-16 Thread Steven D'Aprano
rying to start flame wars with Nikos is unacceptable behaviour. It is unproductive, it makes this a hostile, unpleasant place to be, it ruins the environment for the rest of the community, it's off topic, and it simply doesn't work to discourage trolls. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-16 Thread Steven D'Aprano
back (most recent call last): File "", line 1, in NameError: name 'z' is not defined There are other differences in regards to passing arguments to functions. I've written about that before: http://mail.python.org/pipermail/tutor/2010-December/080505.html -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Why 'files.py' does not print the filenames into a table format?

2013-06-17 Thread Steven D'Aprano
r.execute('''UPDATE files SET hits = hits + 1, host = %s, > lastvisit = %s WHERE url = %s''', (host, lastvisit, filename) ) Have you read these links yet? http://sscce.org/‎ http://www.catb.org/esr/faqs/smart-questions.html‎ They will teach you how to succes

Problems with Python documentation [Re: Don't feed the troll...]

2013-06-17 Thread Steven D'Aprano
are not a panacea. If they were, mailing lists like this, and websites like StackOverflow, would not exist. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-17 Thread Steven D'Aprano
On Mon, 17 Jun 2013 14:34:57 +0300, Simpleton wrote: > On 17/6/2013 9:51 πμ, Steven D'Aprano wrote: >> Now, in languages like Python, Ruby, Java, and many others, there is no >> table of memory addresses. Instead, there is a namespace, which is an >> association betwee

Re: Don't feed the troll...

2013-06-17 Thread Steven D'Aprano
On Mon, 17 Jun 2013 09:31:53 +0200, Antoon Pardon wrote: > Op 16-06-13 22:04, Steven D'Aprano schreef: >> On Sun, 16 Jun 2013 20:16:34 +0200, Antoon Pardon wrote: >> >>> You are trying to get it both ways. On the one hand you try to argue >>> that there a

Re: Natural Language Processing with Python .dispersion_plot returns nothing

2013-06-17 Thread Steven D'Aprano
ion_plot command hasn't finished and Python will just wait forever. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Updating a filename's counter value failed each time

2013-06-17 Thread Steven D'Aprano
wer your question. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-17 Thread Steven D'Aprano
On Tue, 18 Jun 2013 02:26:39 +0300, Νίκος wrote: > Στις 18/6/2013 2:09 πμ, ο/η Steven D'Aprano έγραψε: >> {"a": "Hello world"} >> >> Do you see a memory location there? There is no memory location. There >> is the name, "a", and the o

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

2013-06-17 Thread Steven D'Aprano
On Tue, 18 Jun 2013 00:41:53 +, Steven D'Aprano wrote: > In Python 3.2 and older, the data will be either UTF-4 or UTF-8, > selected when the Python compiler itself is compiled. In Python 3.3, the > data will be stored in either Latin-1, UTF-4, or UTF-8, depending on the >

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

2013-06-17 Thread Steven D'Aprano
On Mon, 17 Jun 2013 21:06:57 -0400, Dave Angel wrote: > On 06/17/2013 08:41 PM, Steven D'Aprano wrote: >> >> >> >> In Python 3.2 and older, the data will be either UTF-4 or UTF-8, >> selected when the Python compiler itself is compiled. > > I thi

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

2013-06-17 Thread Steven D'Aprano
On Tue, 18 Jun 2013 02:38:20 +, Steven D'Aprano wrote: > On Tue, 18 Jun 2013 00:41:53 +, Steven D'Aprano wrote: > >> In Python 3.2 and older, the data will be either UTF-4 or UTF-8, >> selected when the Python compiler itself is compiled. In Python 3.3, &

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

2013-06-17 Thread Steven D'Aprano
On Tue, 18 Jun 2013 00:12:34 -0400, Dave Angel wrote: > On 06/17/2013 10:42 PM, Steven D'Aprano wrote: >> On Mon, 17 Jun 2013 21:06:57 -0400, Dave Angel wrote: >> >>> On 06/17/2013 08:41 PM, Steven D'Aprano wrote: >>>> >>>> >>&

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

2013-06-18 Thread Steven D'Aprano
Client VM (Sun Microsystems Inc.)] on java1.6.0_18 Type "help", "copyright", "credits" or "license" for more information. >>> id([]) 1 >>> id('*') 2 That some implementations happen to use a fixed memory address as the ID number

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

2013-06-18 Thread Steven D'Aprano
;b" changes to another object, "a" will not follow. > Can a variable point to another variable or variables never point to > other variables but instead are *only* linked to the objects of those > var's instead? 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 before -- Steven -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Liscensing

2013-06-18 Thread Steven Hern
From: Steven Hern Sent: 06 June 2013 08:49 To: 'webmas...@python.org' Cc: Dave Jordan Subject: Python Liscensing Dear Sir/Madam, We are an educational establishment which wishes to use Python 3.3.2 - Does the license cover multi-users in a classroom environment? Thanks Steven Hern

Re: Why is regex so slow?

2013-06-18 Thread Steven D'Aprano
filter out the lines which cannot possibly match, before spending a few moments to do a more careful match. If the number of non-matching lines is high, as it is in your data, then the cheaper pre-filter pays for itself and then some. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is regex so slow?

2013-06-18 Thread Steven D'Aprano
On Tue, 18 Jun 2013 22:11:01 -0400, Dave Angel wrote: > On 06/18/2013 09:51 PM, Steven D'Aprano wrote: > > >> >> Even if the regex engine is just as efficient at doing simple character >> matching as `in`, and it probably isn't, your regex tries

Re: Beginner Question: 3D Models

2013-06-18 Thread Steven D'Aprano
t; within our CAD system so it would be great if we could utilize those > models. [...] > Is this possible? Is Python the right language? Is Blender the sort of thing you are looking for? https://duckduckgo.com/html/?q=blender%20python -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: decorator to fetch arguments from global objects

2013-06-18 Thread Steven D'Aprano
y: del kwargs['db'] except KeyError: pass if db is None: db = get_current_db() return method(self, db, *args, **kwargs) return inner -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-19 Thread Steven D'Aprano
;He's wearing black, has pale skin, listens to that weird goth music I don't like, therefore he's a school-shooter." "She's good looking and wears short skirts, therefore she's a slut." "He's wearing a police uniform, therefore he's a policeman." -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-19 Thread Steven D'Aprano
d, type, etc.) by referring in some fashion to that callable object, followed by calling it, e.g. functions[9](arg) gives you a reference to some object which may not be any of `functions`, `9`, or `arg`. Have I missed any? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-19 Thread Steven D'Aprano
nd, I do not think it is at all unreasonable to expect > posters not to throw those principles out the window just because a > troll showed up. +1000 -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-19 Thread Steven D'Aprano
ding in Python is with a sentinel value to trigger the re-evaluation of the default. Normally, we would use None and a call-time check: def function(arg, value=None): if value is None: # Re-calculate the default. value = ... # rest of code -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-19 Thread Steven D'Aprano
t; a form that appealed to me. Well said! -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: A few questiosn about encoding

2013-06-19 Thread Steven D'Aprano
On Wed, 19 Jun 2013 18:46:59 -0700, Rick Johnson wrote: > On Thursday, June 13, 2013 2:11:08 AM UTC-5, Steven D'Aprano wrote: > >> Gah! That's twice I've screwed that up. Sorry about that! > > Yeah, and your difficulty explaining the Unicode implementation r

Re: Default Value

2013-06-20 Thread Steven D'Aprano
the question? Because it's not always a bug to use a mutable default, there are good uses for it: def func(arg, cache={}): ... Now you can pass your own cache as an argument, otherwise the function will use the default. The default cache is mutable, and so will remember values from one invocation to the next. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-20 Thread Steven D'Aprano
r expression. That's not to say that there are no arguments in favour of late binding. But on balance, despite the odd sharp corner, I believe that early binding's benefits far outweigh its gotchas. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-20 Thread Steven D'Aprano
here y=expression is late-bound, and the above is compiled to: def func(arg, x=expression, y=None): if y is None: y = expression ... Then Ranting Rick can bitch and moan about how this violates "Explicit is better than implicit". -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-20 Thread Steven D'Aprano
herefore Python is buggy, yes? No. In short, your invalid understanding of Python's execution model is your lack of knowledge, not a bug in Python to be fixed. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-20 Thread Steven D'Aprano
x for both, there would be cases where people used the wrong syntax, not knowing any better, and would trip over unexpected behaviour. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-21 Thread Steven D'Aprano
ve. What you haven't done is define a function which takes a default value that can be overridden when called. Your argument is invalid. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-21 Thread Steven D'Aprano
On Thu, 20 Jun 2013 20:16:19 -0700, Rick Johnson wrote: > On Thursday, June 20, 2013 7:57:28 PM UTC-5, Steven D'Aprano wrote: >> On Thu, 20 Jun 2013 11:05:32 -0700, Rick Johnson wrote: >> They [default argument values] have to be stored *somewhere*, and >> Python c

Re: Default Value

2013-06-21 Thread Steven D'Aprano
On Fri, 21 Jun 2013 11:26:39 -0700, Rick Johnson wrote: > You know, out of all these post, not one of you guys has presented a > valid use-case that will give validity to the existence of this PyWart LOL. Okay, you're trolling. Time for another month in the kill-file. *plonk*

Re: Default Value

2013-06-21 Thread Steven D'Aprano
he > argument was mutable. That's easy. Just call ismutable(arg). The implementation of ismutable is just an implementation detail, somebody else can work that out. A language designer of the sheer genius of Rick can hardly be expected to worry himself about such trivial details. --

Re: n00b question on spacing

2013-06-21 Thread Steven D'Aprano
= "a" "b" "c" This *implicit concatenation* only works with string literals, not variables, but it works with any sort of quoting style: s = "-'-" '-"-' r"\a\b" assert s == "-'--\"-\\a\\b" Like most such features, a little goes a long way. Don't over do it, it is quite possible to end up with an unreadable mess if you overuse it. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Default Value

2013-06-21 Thread Steven D'Aprano
o prohibit putting mutable objects inside tuples. Putting a list or a dict inside a tuple is just a bug waiting to happen! -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: n00b question on spacing

2013-06-22 Thread Steven D'Aprano
a good time to link to these interesting articles: http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2013-06-22 Thread Steven D'Aprano
ng to lowercase will do the job. But if you are using Python 3.3 or better, then I recommend you use casefold() instead of lower() since that is smarter about converting case when you have non-English characters. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-22 Thread Steven D'Aprano
* on the down side, automatic delegation of special double-underscore methods like __getitem__ and __str__ doesn't work with new-style classes. If none of this means anything to you, be glad, and just inherit from object or some other built-in type in all your classes, and all will be good. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: n00b question on spacing

2013-06-22 Thread Steven D'Aprano
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- >> time > > Number 2 on

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

2013-06-22 Thread Steven D'Aprano
On Sat, 22 Jun 2013 22:27:10 -0600, Ian Kelly wrote: > On Sat, Jun 22, 2013 at 9:20 PM, Steven D'Aprano > wrote: >> * on the down side, automatic delegation of special double-underscore >> methods like __getitem__ and __str__ doesn't work with new-style >> clas

Re: A few questiosn about encoding

2013-06-23 Thread Steven D'Aprano
r 4-byte. If it is a 1-byte string, then each byte is one character. If it is a 2-byte string, then it is just like Python 3.2 narrow build, and each two bytes is a character. If it is a 4-byte string, then it is just like Python 3.2 wide build, and each four bytes is a character. Within a singl

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

2013-06-23 Thread Steven D'Aprano
will be trivial, the overhead of inheritance is not going to be the bottleneck in your code, and by ignoring super, you only accomplish one thing: - if you use your class in multiple inheritance, it will be buggy. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-23 Thread Steven D'Aprano
On Sat, 22 Jun 2013 23:40:53 -0600, Ian Kelly wrote: > On Sat, Jun 22, 2013 at 11:23 PM, Steven D'Aprano > wrote: >> On Sat, 22 Jun 2013 22:27:10 -0600, Ian Kelly wrote: >>> I actually consider that an up side. Sure it's inconvenient that you >>> can

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

2013-06-23 Thread Steven D'Aprano
simply prohibit it completely, and it wasn't instantly and correctly intuited by every single programmer based only on the name? Oh my stars, somebody call Ranting Rick, he needs to write a PyWart post to expose this scandal!!! *wink* -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-23 Thread Steven D'Aprano
itled "Super considered Harmful", although the author backs away from this claim, since it turns out that the problems are not *super* but multiple inheritance itself. https://fuhm.net/super-harmful/ Despite telling people not to use super, James Knight doesn't actually give them

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

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 12:04:35 -0600, Ian Kelly wrote: > On Sun, Jun 23, 2013 at 11:36 AM, Steven D'Aprano > wrote: >> On Sun, 23 Jun 2013 11:18:41 -0600, Ian Kelly wrote: >> >>> Incidentally, although super() is useful, it's not perfect, and this >>>

Re: Loop Question

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 16:18:35 -0700, christhecomic wrote: > How do I bring users back to beginning of user/password question once > they fail it? thx Write a loop. If they don't fail (i.e. they get the password correct), then break out of the loop. -- Steven -- http://mail.python.

Re: Python development tools

2013-06-23 Thread Steven D'Aprano
nearly all Linux distros do, it should just work out of the box. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 13:09:21 -0600, Ian Kelly wrote: > On Sun, Jun 23, 2013 at 12:50 PM, Steven D'Aprano > wrote: >> What else would you call a function that does lookups on the current >> object's superclasses? > > Well, as James Knight points out in the &q

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

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 15:24:14 -0400, Roy Smith wrote: > In article <51c74373$0$2$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: >> What else would you call a function that does lookups on the current >> object's superclasses? > > Wel

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

2013-06-23 Thread Steven D'Aprano
On Mon, 24 Jun 2013 02:53:06 +0100, Rotwang wrote: > On 23/06/2013 18:29, Steven D'Aprano wrote: >> On Sat, 22 Jun 2013 23:40:53 -0600, Ian Kelly wrote: >>> [...] >>> >>> Can you elaborate or provide a link? I'm curious to know what other >>

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

2013-06-24 Thread Steven D'Aprano
On Sun, 23 Jun 2013 21:38:33 -0400, Roy Smith wrote: > In article <51c7a087$0$2$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> On Sun, 23 Jun 2013 15:24:14 -0400, Roy Smith wrote: >> >> > In article <51c74373$0$2$c3e8d

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

2013-06-24 Thread Steven D'Aprano
ary operator, like +, -, *, **, but I don't think it could be used as both an operator and an identifier. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie EOL while scanning string literal

2013-06-26 Thread Steven D'Aprano
p://mail.python.org/mailman/listinfo/tutor -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-26 Thread Steven D'Aprano
ity > where very complex "meta-objects" upon meta-objects can be built until > the "whole of human knowledge can be contained". It must be a wonderful view from way, way up there, but how do you breathe? http://www.joelonsoftware.com/items/2008/05/01.html -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this PEP-able? fwhile

2013-06-26 Thread Steven D'Aprano
estricted flow control end up with unmaintainable spaghetti code. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Limit Lines of Output

2013-06-26 Thread Steven D'Aprano
wed by Gene's reply to your reply: http://mail.python.org/pipermail/python-list/2013-June/650750.html And your, or your evil doppelganger's, reply to Gene: http://mail.python.org/pipermail/python-list/2013-June/650773.html -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-26 Thread Steven D'Aprano
On Wed, 26 Jun 2013 13:14:44 -0700, Ethan Furman wrote: > On 06/23/2013 11:50 AM, Steven D'Aprano wrote: >> What else would you call a function that does lookups on the current >> object's superclasses? > > Well, I would call it super(). Trouble is, that is not

Re: Limit Lines of Output

2013-06-26 Thread Steven D'Aprano
think; to suppose. --South. [1913 Webster] > [Or is he opining?] That's just his opinion, man. *wink* -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the purpose of type() and the types module and what is a type?

2013-06-27 Thread Steven D'Aprano
ust a collection of useful names for built-in types that otherwise don't exist in the default namespace. E.g. functions are objects, and have a type, but that type is not available by default: py> FunctionType Traceback (most recent call last): File "", line 1, in NameError: name 'FunctionType' is not defined You need to import it first: py> from types import FunctionType py> FunctionType -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Steven D'Aprano
by default. Libraries should not call sys.exit, or raise SystemExit. Whether to quit or not is not the library's decision to make, that decision belongs to the application layer. Yes, the application could always catch SystemExit, but it shouldn't have to. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Steven D'Aprano
On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote: > On 06/27/2013 03:49 PM, Steven D'Aprano wrote: >> >> [rant] >> I think it is lousy design for a framework like argparse to raise a >> custom ArgumentError in one part of the code, only to catch it >&g

Re: MeCab UTF-8 Decoding Problem

2013-06-29 Thread Steven D'Aprano
ngled beyond recognition due to the way you create it using the implicit encoding from chars to bytes. Change the line text = 'MeCab ...' to use an explicit Unicode string and encode, as above, and maybe the error will go away. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread Steven D'Aprano
.. "nonlocal"? I see I'm not alone in picking > obnoxious names ... Huh? You have "global" for global names. Python require declarations for local names, but if it did it would probably use "local". What name would you pick to declare names nonlocal other than "nonlocal"? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread Steven D'Aprano
ne that some of them differ from C in semantics as well as syntax. So by emphasising the differences ("Python has no variables? It has name bindings?") we increase the likelihood that he'll learn the differences in semantics as well as syntax. So, in a very practical sense, &qu

Re: Closures in leu of pointers?

2013-06-29 Thread Steven D'Aprano
could ever hope (or perhaps fear) to see. If you insist in thinking of Python as "Perl with different syntax", then you won't understand why you can't do certain things -- and you'll equally not realise that you CAN do other things that other languages don't support. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread Steven D'Aprano
On Sat, 29 Jun 2013 18:45:30 +, Steven D'Aprano wrote: > Python require declarations for local names, but if it did it would > probably use "local". Oops, I meant *doesn't* require declarations. Sorry for the error. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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