Re: To whoever hacked into my Database

2013-11-12 Thread Ian Kelly
On Tue, Nov 12, 2013 at 9:27 AM, Antoon Pardon wrote: > Op 12-11-13 14:02, Ian Kelly schreef: >> On Tue, Nov 12, 2013 at 2:09 AM, Antoon Pardon >> wrote: >>> So you are complaining about people being human. Yes that is >>> how people tend to react when they

Re: To whoever hacked into my Database

2013-11-12 Thread Ian Kelly
On Tue, Nov 12, 2013 at 2:59 PM, Ethan Furman wrote: > Every time he uses foul language against somebody he's acting like a bully. > > Every time he reposts questions and ignores answers he's acting like a > bully. > > Every time he declares that what he wants is the most important and so he is >

Re: To whoever hacked into my Database

2013-11-12 Thread Ian Kelly
On Tue, Nov 12, 2013 at 4:38 PM, Mark Lawrence wrote: > What would you classify insulting my late mother as? Rudeness. I'm not defending Nikos here, but let's not call it something that it isn't. -- https://mail.python.org/mailman/listinfo/python-list

Re: To whoever hacked into my Database

2013-11-13 Thread Ian Kelly
On Tue, Nov 12, 2013 at 6:19 PM, Ethan Furman wrote: > On 11/12/2013 03:27 PM, Ian Kelly wrote: >> >> On Tue, Nov 12, 2013 at 2:59 PM, Ethan Furman wrote: >>> >>> Every time he uses foul language against somebody he's acting like a >>> bully. >

Re: To whoever hacked into my Database

2013-11-13 Thread Ian Kelly
On Wed, Nov 13, 2013 at 2:08 AM, Antoon Pardon wrote: >> That doesn't mean that when somebody >> misbehaves, you can do whatever you want in retaliation without regard >> for others who might be involved. > > But I didn't do whatever. What I did was similar in what others > had been doing before.

Re: Bullying [was Re: To whoever hacked into my Database]

2013-11-13 Thread Ian Kelly
On Tue, Nov 12, 2013 at 8:40 PM, Steven D'Aprano wrote: > Is "bullying" the new "terrorism", which in turn is the new "socialism"? > That is, a meaningless term of opprobrium used on anything you don't > like? That's what it sounds like to me. > > Nikos has practically no power in this community.

Re: Fire Method by predefined string!

2013-11-17 Thread Ian Kelly
On Sun, Nov 17, 2013 at 2:46 PM, Tamer Higazi wrote: > Hi people! > > Assume we have 2 methods, one called Fire and the other __DoSomething. > > I want the param which is a string to be converted, that I can fire > directly a method. Is it somehow possible in python, instead of writing > if else s

Re: Oh look, another language (ceylon)

2013-11-18 Thread Ian Kelly
On Nov 18, 2013 3:06 AM, "Chris Angelico" wrote: > > I'm trying to figure this out. Reading the docs hasn't answered this. > If each character in a string is a 32-bit Unicode character, and (as > can be seen in the examples) string indexing and slicing are > supported, then does string indexing me

Re: Why do only callable objects get a __name__?

2013-11-18 Thread Ian Kelly
On Mon, Nov 18, 2013 at 1:13 PM, John Ladasky wrote: > A few days ago, I asked about getting the original declared name of a > function or method, and learned about the __name__ attribute. > > https://groups.google.com/forum/#!topic/comp.lang.python/bHvcuXgvdfA > > Of course, I have used __name__

Re: Automation

2013-11-19 Thread Ian Kelly
On Fri, Nov 15, 2013 at 1:45 PM, Alister wrote: > and if you haven't seen it before :- > > Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in > waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht > the frist and lsat ltteer be at the rghit pclae. The rset ca

Re: Automation

2013-11-19 Thread Ian Kelly
On Tue, Nov 19, 2013 at 2:26 AM, Chris Angelico wrote: > It couldn't figure out "Absytrytewh", "picsbeliud", or > "hnasoa/tw.nartswdbvweos/utrtek:p./il". That's not a bad result. (And > as a human, I'm guessing that the second one isn't an English word - > maybe it's Scots?) Here's the code: It's

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-22 Thread Ian Kelly
On Fri, Nov 22, 2013 at 7:13 AM, rusi wrote: > 2) del will delete objects -- like free in C >Except that like above, thinking in C will cause more problems than it > solves No, del will only delete name bindings. Whether the bound object is also deleted depends on whether it is still refere

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-22 Thread Ian Kelly
On Fri, Nov 22, 2013 at 7:18 PM, Steven D'Aprano wrote: > I'm not an expert on Indian English, but I understand that in that > dialect it is grammatically correct to say "the codes", just as in UK and > US English it is grammatically correct to say "the programs". I wouldn't necessarily even cons

Re: Importing by file name

2013-11-24 Thread Ian Kelly
On Nov 23, 2013 9:42 PM, "Chris Angelico" wrote: > As part of a post on python-ideas, I wanted to knock together a quick > little script that "imports" a file based on its name, in the same way > that the Python interpreter will happily take an absolute pathname for > the main script. I'm sure th

Re: Importing by file name

2013-11-24 Thread Ian Kelly
On Sun, Nov 24, 2013 at 2:18 AM, Christian Gollwitzer wrote: > Am 24.11.13 04:41, schrieb Chris Angelico: > >> As part of a post on python-ideas, I wanted to knock together a quick >> little script that "imports" a file based on its name, in the same way >> that the Python interpreter will happily

Re: Behavior of staticmethod in Python 3

2013-11-24 Thread Ian Kelly
On Sun, Nov 24, 2013 at 3:30 AM, Antoon Pardon wrote: > Op 23-11-13 22:51, Peter Otten schreef: >> Antoon Pardon wrote: >> >>> Op 23-11-13 10:01, Peter Otten schreef: >>> Your script is saying that a staticmethod instance is not a callable object. It need not be because Fo

Re: Importing by file name

2013-11-24 Thread Ian Kelly
On Sun, Nov 24, 2013 at 4:05 AM, Chris Angelico wrote: > Undocumented... that explains why I didn't know about it! But that > does appear to be what I'm looking for, so is there some equivalent > planned as a replacement? Hmm, playing around with importlib a bit, this seems to work: from importl

Re: python-list history

2013-11-26 Thread Ian Kelly
On Tue, Nov 26, 2013 at 2:47 AM, Drew Crawford wrote: > Hello folks, > > I’m interested in digging up some Python mailing list archives from ages > past. Google Groups’ archive goes sporadically back to ’94, but clearly the > list is older. > > Does any one have a lead on where I could get an a

Re: '_[1]' in .co_names using builtin compile() in Python 2.6

2013-11-27 Thread Ian Kelly
On Nov 27, 2013 2:11 PM, "Ned Batchelder" wrote: > > On 11/27/13 2:40 PM, magnus.ly...@gmail.com wrote: >> >> So, in the case of "a.b + x" I'm really just interested in a and x, not b. So the (almost) whole story is that I do: >> >> # Find names not starting with ".", i.e a & b in "a.c + b" >

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Ian Kelly
On Fri, Nov 29, 2013 at 10:37 PM, Roy Smith wrote: > I was speaking specifically of "ligatures like fi" (or, if you prefer, > "ligatures like ό". By which I mean those things printers invented > because some letter combinations look funny when typeset as two distinct > letters. I think the encod

Re: extracting a heapq in a for loop - there must be more elegant solution

2013-12-03 Thread Ian Kelly
On Tue, Dec 3, 2013 at 2:13 PM, Cameron Simpson wrote: > On 03Dec2013 12:18, Helmut Jarausch wrote: >> I'd like to extracted elements from a heapq in a for loop. >> I feel my solution below is much too complicated. >> How to do it more elegantly? > > I can't believe nobody has mentioned PriorityQ

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Ian Kelly
On Tue, Dec 3, 2013 at 11:31 PM, rusi wrote: > Its a more fundamental problem than that: > It emerges from the OP's second post) that he wants '-' in the attributes. > Is that all? > > Where does this syntax-enlargement stop? Spaces? Newlines? At non-strings. >>> setattr(foo, 21+21, 42) Tracebac

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Ian Kelly
On Wed, Dec 4, 2013 at 3:09 AM, rusi wrote: > On Wednesday, December 4, 2013 2:27:28 PM UTC+5:30, Ian wrote: >> On Tue, Dec 3, 2013 at 11:31 PM, rusi wrote: >> > Its a more fundamental problem than that: >> > It emerges from the OP's second post) that he wants '-' in the attributes. >> > Is that

Re: interactive help on the base object

2013-12-09 Thread Ian Kelly
On Sun, Dec 8, 2013 at 4:01 PM, Mark Janssen wrote: > Likewise, WITH A COMPUTER, there is a definite order which can't be > countermanded by simply having this artifice called "Object". If you > FEE(L)s hadn't noticed (no longer using the insult "foo"s out of > respect for the sensativities of th

Re: interactive help on the base object

2013-12-10 Thread Ian Kelly
On Mon, Dec 9, 2013 at 8:19 PM, Steven D'Aprano wrote: > While I'm very confident at this point that he is a crank, in the same > category as circle-squarers, cold fusion proponents, pi-is-a-rational- > number theorists, perpetual motion machine inventors, evolution or AGW > Denialists[1], and oth

Re: Figuring out what dependencies are needed

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:38 AM, Robert Kern wrote: > On 2013-12-11 13:27, Steven D'Aprano wrote: >> >> On Wed, 11 Dec 2013 04:44:53 -0800, sal wrote: >> >>> Now I'd like to use the backtesting package from zipline (zipline.io), >> >> >> ".io" is not normally a file extension for Python files. Are

Re: grab dict keys/values without iterating ?!

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 7:30 AM, Tim Chase wrote: > On 2013-12-11 13:44, Steven D'Aprano wrote: >> If necessary, I would consider having 26 dicts, one for each >> initial letter: >> >> data = {} >> for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": >> data[c] = {} >> >> then store keys in the particular d

Re: grab dict keys/values without iterating ?!

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:02 PM, Ian Kelly wrote: > This is what I did not so long ago when writing a utility for > typeahead lookup, except that to save some space and time I only > nested the dicts as deeply as there were still multiple entries. As > an example of what the da

Re: Disable HTML in forum messages (was: Movie (MPAA) ratings and Python?)

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:12 PM, Ben Finney wrote: >> I found a "remove formatting" button in gmail's composer, and used it >> on this message. Does this message look like plain text? > > Still sent with an HTML part, so some other change must be needed to > disable that. Check the default format

Re: Movie (MPAA) ratings and Python?

2013-12-11 Thread Ian Kelly
On Wed, Dec 11, 2013 at 6:01 PM, Ned Batchelder wrote: >> I've also been wondering if ISO-8859-1 is just an octet-oriented codec, >> so it'll read about anything. There are clearly non-7-bit-ASCII >> characters in the file that look like line noise in an mrxvt. > > > Both ISO-8859-1 and Windows-1

Re: Threading In Python

2013-12-12 Thread Ian Kelly
On Thu, Dec 12, 2013 at 1:08 AM, marcinmltd wrote: > Adding subject to the message. > Hello, > > I'm big fan of multiprocessing module, but recently I started looking at > threading in Python more closely and got couple of questions I hope You can > help me with: > > 1. When I run two or more thre

Re: Knapsack Problem Without Value

2013-12-13 Thread Ian Kelly
On Thu, Dec 12, 2013 at 7:08 PM, wrote: > Hi, > > I wanna ask about Knapsack. I do understand what Knapsack is about. But this > one i faced is a different problem. There is no value. I mean, it's like > this, for example. > > I have 4 beams [X0, X1, X2, X3]. Each 1, 2, 2, 3 cm long. I want to

Re: outsmarting context managers with coroutines

2013-12-28 Thread Ian Kelly
On Sat, Dec 28, 2013 at 5:35 PM, Burak Arslan wrote: > On 12/29/13 00:13, Burak Arslan wrote: >> Hi, >> >> Have a look at the following code snippets: >> https://gist.github.com/plq/8164035 >> >> Observations: >> >> output2: I can break out of outer context without closing the inner one >> in Pyth

Re: outsmarting context managers with coroutines

2013-12-29 Thread Ian Kelly
On Sun, Dec 29, 2013 at 7:44 AM, Burak Arslan wrote: > On 12/29/13 07:06, Ian Kelly wrote: >> On Sat, Dec 28, 2013 at 5:35 PM, Burak Arslan >> wrote: >>> On 12/29/13 00:13, Burak Arslan wrote: >>>> Hi, >>>> >>>> Have a look at the follo

Re: print range in python3.3

2014-01-05 Thread Ian Kelly
On Jan 5, 2014 1:04 AM, "Mark Lawrence" wrote: > > On 05/01/2014 07:38, luofeiyu wrote: > > range(1,10) >> >> range(1, 10) > > print(range(1,10)) >> >> range(1, 10) >> >> how can i get 1,2,3,4,5,6,7,8,9 in python3.3 ? >> > > for i in range(1,10): > print(i, end=',') > print() >

Re: Monkeypatching a staticmethod?

2014-01-09 Thread Ian Kelly
On Thu, Jan 9, 2014 at 10:23 PM, Roy Smith wrote: > This is kind of surprising. I'm running Python 2.7.1. I've got a class > with a staticmethod that I want to monkeypatch with a lambda: > > -- > class Foo: > @staticmethod > def x(): > return 1 > >

Re: plotting slows down

2014-01-13 Thread Ian Kelly
On Mon, Jan 13, 2014 at 6:26 AM, Dave Angel wrote: > Next, please repost any source code with indentation preserved. > Your message shows it all flushed to the left margin, probably > due to posting in html mode. Use text mode here. That's odd, the message that I got includes proper indentatio

Re: plotting slows down

2014-01-13 Thread Ian Kelly
On Mon, Jan 13, 2014 at 1:15 AM, wrote: > First let me say I have not done much python programming! > I am running Python 2.7.3. > I am trying to use python as a front end to a simple oscilloscope. > Ultimately I intend to use it with my micropython board. > > At the moment I am just developing i

Re: 'Straße' ('Strasse') and Python 2

2014-01-15 Thread Ian Kelly
On Wed, Jan 15, 2014 at 9:55 AM, Robin Becker wrote: > The fact that unicoders want to take over the meaning of encoding is not > relevant. A virus is a small infectious agent that replicates only inside the living cells of other organisms. In the context of computing however, that definition is

Re: graphical python

2014-01-19 Thread Ian Kelly
On Sat, Jan 18, 2014 at 10:40 PM, buck wrote: > I'm trying to work through Skienna's algorithms handbook, and note that the > author often uses graphical representations of the diagrams to help > understand (and even debug) the algorithms. I'd like to reproduce this in > python. > > How would y

Re: graphical python

2014-01-19 Thread Ian Kelly
On Sun, Jan 19, 2014 at 12:30 PM, buck wrote: > Thanks Ian. > Have you personally used pyjs successfully? > It's ominous that the examples pages are broken... I don't have any personal experience with either project. I don't know what's going on with pyjs.org currently, but the examples at the p

Re: Try-except-finally paradox

2014-01-29 Thread Ian Kelly
On Jan 29, 2014 11:01 PM, "Jessica Ross" wrote: > > I found something like this in a StackOverflow discussion. > >>> def paradox(): > ... try: > ... raise Exception("Exception raised during try") > ... except: > ... print "Except after try" > ... return

Re: 1 > 0 == True -> False

2014-01-30 Thread Ian Kelly
On Thu, Jan 30, 2014 at 1:08 PM, Dave Angel wrote: > Rotwang Wrote in message: >> Really? I take advantage of it quite a lot. For example, I do things >> like this: >> >> 'You have scored %i point%s' % (score, 's'*(score != 1)) >> > > I also did that kind of thing when computer resources > were

Re: 1 > 0 == True -> False

2014-01-30 Thread Ian Kelly
On Jan 30, 2014 1:40 PM, "Chris Angelico" wrote: > > On Fri, Jan 31, 2014 at 7:28 AM, Ian Kelly wrote: > > Of course if you're at all concerned about i18n then the proper way to > > do it would be: > > > > ngettext("You have scored %d point&quo

Re: __init__ is the initialiser

2014-02-03 Thread Ian Kelly
On Mon, Feb 3, 2014 at 6:44 AM, Dennis Lee Bieber wrote: > On Sun, 02 Feb 2014 18:40:59 -0500, Roy Smith declaimed the > following: > >>I'm reasonably sure you posted this as humor, but there is some truth in >>what you said. In the crypto/security domain, you often want to keep a >>key or clear

Re: Calculator Problem

2014-02-03 Thread Ian Kelly
On Feb 3, 2014 3:26 PM, "Steven D'Aprano" < steve+comp.lang.pyt...@pearwood.info> wrote: > > On Mon, 03 Feb 2014 10:04:35 -0800, Charlie Winn wrote: > > > excuse me but don't be so *** rude , i did run this program and it > > did run correctly > > Charlie, you may have run *some* program, but i

Re: What is a function parameter =[] for?

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 9:41 AM, Antoon Pardon wrote: > Op 24-11-15 om 16:48 schreef Chris Angelico: >> () is not a literal either. > > The byte code sure suggests it is. > > Take the following code: > > import dis > > def f(): > i = 42 > t = () > l = [] > > dis.dis(f) > > That produces the

Re: What is a function parameter =[] for?

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 10:32 AM, Antoon Pardon wrote: > Op 24-11-15 om 17:56 schreef Ian Kelly: > >> >>> So on what grounds would you argue that () is not a literal. >> >> This enumerates exactly what literals are in Python: >> >> https://docs

Re: What is a function parameter =[] for?

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 10:53 AM, Ian Kelly wrote: > On Tue, Nov 24, 2015 at 10:32 AM, Antoon Pardon > wrote: >> Op 24-11-15 om 17:56 schreef Ian Kelly: >> >>> >>>> So on what grounds would you argue that () is not a literal. >>> >>

Re: What is a function parameter =[] for?

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 11:45 AM, Antoon Pardon wrote: > I think limiting literals to lexical tokens is too limited. Sure we > can define them like that in the context of the python grammar, but > I don't see why we should limit ourselves to such a definition outside > that context. > > I see noth

Re: What is a function parameter =[] for?

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 12:00 PM, Random832 wrote: > On 2015-11-24, Chris Angelico wrote: >> Probably the grammar. In other words, it's part of the language's very >> definition. > > Then the definition is wrong. I think "literal" is a word whose meaning is > generally agreed on, rather than some

Re: What is a function parameter =[] for?

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 1:54 PM, Antoon Pardon wrote: > Op 24-11-15 om 20:15 schreef Ian Kelly: > >>> But no matter what you want to call it. The dis module shows that >>> -42 is treated in exactly the same way as 42, which is treated >>> exactly the same wa

Re: Bi-directional sub-process communication

2015-11-24 Thread Ian Kelly
On Mon, Nov 23, 2015 at 10:25 PM, Cameron Simpson wrote: > Then #3. I would have a common function/method for submitting a request to > go to the subprocess, and have that method return an Event on which to wait. > Then caller then just waits for the Event and collects the data. Obviously, > the m

Re: list slice and generators

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 3:07 AM, Peter Otten <__pete...@web.de> wrote: > to get down to one intermediate list. Avoiding the last one is a bit tricky: > > metrics = (converter(x.metric(name)) for x in self._server_per_proc) > metrics = (x for x in metrics if x is not None) > try: > # if there is

Re: list slice and generators

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 10:44 AM, Ian Kelly wrote: > On Wed, Nov 25, 2015 at 3:07 AM, Peter Otten <__pete...@web.de> wrote: >>> elif name in METRICS_AVG: >> # writing a function that calculates the average without >> # materialisin

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 10:18 AM, BartC wrote: >> We have no way of evaluating their power or simplicity, >> since they are not available to us. > > I'll see if I can rustle up a comparison so that Python users can see what > they're missing! Unless you're going to make the actual languages avail

Re: What is a function parameter =[] for?

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon wrote: > I don't know what you are talking about. The first thing I have argued > is that () is a literal. Then I have expaned that to that something > like (3, 5, 8) is a literal. I never argued that tuple expressions > in general are literals. And

Re: What is a function parameter =[] for?

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 2:05 PM, Antoon Pardon wrote: > Op 25-11-15 om 21:39 schreef Ian Kelly: >> On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon >> wrote: >>> I don't know what you are talking about. The first thing I have argued >>> is that () is a lit

Re: What is a function parameter =[] for?

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 7:25 PM, Chris Angelico wrote: > On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden wrote: >> (Note that nothing in the documentation I can find actually _guarantees_ >> that a Python implementation will only have one unique empty tuple, but >> I wouldn't be suprised if the foll

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 5:52 PM, Random832 wrote: > On 2015-11-25, Ben Finney wrote: >> That is, the ‘2’ in ‘cartesian_point = (2, 3)’ means something different >> than in ‘cartesian_point = (3, 2)’. >> >> Whereas the ‘2’ in ‘test_scores = [2, 3]’ means exactly the same as in >> ‘test_scores = [3

Re: Question about code writing '% i, callback'

2015-11-30 Thread Ian Kelly
On Mon, Nov 30, 2015 at 10:44 AM, fl wrote: > I come across the following code snippet. > > for i in range(10): > def callback(): > print "clicked button", i > UI.Button("button %s" % i, callback) > > The content inside parenthesis in last line is strange to me. > > "button %s" % i

Re: Question about code writing '% i, callback'

2015-11-30 Thread Ian Kelly
On Mon, Nov 30, 2015 at 10:36 AM, fl wrote: > Thanks for the replies. Now, I have the following code: > > > > class buibutton(): > print 'sd' > def __nonzero__(self): >return False > > def Button(self, ii, callbackk): > callbackk() > return > UI=buibutton() > >

Re: Question about code writing '% i, callback'

2015-12-01 Thread Ian Kelly
On Mon, Nov 30, 2015 at 7:44 PM, Dennis Lee Bieber wrote: > On Mon, 30 Nov 2015 10:55:23 -0800 (PST), fl declaimed > the following: > >>Thanks Ian. I created the class because I want to use the original example >>line >> >> UI.Button("button %s" % i, callback) >> >>Is there another way to use the

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-01 Thread Ian Kelly
On Tue, Dec 1, 2015 at 12:49 PM, Steve Hayes wrote: > On Tue, 1 Dec 2015 03:19:39 +0100, "Skybuck Flying" > wrote: > >>Hello, >> >>The question is: >> >>Is Microsoft Windows secretly downloading childporn to your computer ?! > > You download things FROM a computer, you upload them TO a computer.

Re: Could you explain this rebinding (or some other action) on "nums = nums"?

2015-12-01 Thread Ian Kelly
On Tue, Dec 1, 2015 at 2:32 PM, Denis McMahon wrote: > On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote: > >> In the case of: >> >> tup[1] += [6, 7] >> >> what it's trying to do is: >> >> tup[1] = tup[1].__iadd__([6, 7]) >> >> tup[1] refers to a list, and the __iadd__ method _does_ mutate

Re: "Downloading"

2015-12-01 Thread Ian Kelly
On Tue, Dec 1, 2015 at 5:05 PM, Chris Angelico wrote: > On Wed, Dec 2, 2015 at 6:05 AM, Random832 wrote: >> On 2015-12-01, Steve Hayes wrote: >>> You download things FROM a computer, you upload them TO a computer. >> >> I'm a little bit confused as to what kinds of file transfers >> you think do

Re: Is vars() the most useless Python built-in ever?

2015-12-01 Thread Ian Kelly
On Dec 1, 2015 1:36 PM, "Rick Johnson" wrote: > > On Tuesday, December 1, 2015 at 1:55:59 AM UTC-6, Steven D'Aprano wrote: > > Python was never intended to be "merely" a teaching language. I think > > Guido's original vision was for it to be a glue language between C > > libraries, and a scri

Re: static variables

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 7:41 AM, Antoon Pardon wrote: > Op 02-12-15 om 14:11 schreef Steven D'Aprano: >> On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote: >> >>> If you want your arguments to be taken seriously, then you better should. >>> If you use an argument when it suits you and ignore it when

Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 10:36 AM, Keith Thompson wrote: > Juha Nieminen writes: >> In comp.lang.c++ Steve Hayes wrote: >>> You download things FROM a computer, you upload them TO a computer. >> >> It's a matter of perspective. If a hacker breaks into your computer and >> starts a download from so

Re: HELP PLEASE printing single characters!

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 12:58 PM, Dylan Riley wrote: > hi all, > I have been trying to figure out all day why my code is printing single > characters from my list when i print random elements using random.choice the > elements in the list are not single characters for example when i print, > pri

Re: HELP PLEASE printing single characters!

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 1:44 PM, Dylan Riley wrote: > hi ian what would be the correct code to use in this situation then because > as far as i am aware the elements of my list should be printed as whole > elements and not just characters of the elements. order.append(choice) -- https://mail.py

Re: static variables

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 9:30 AM, Antoon Pardon wrote: > Op 02-12-15 om 15:15 schreef Ian Kelly: >> On Wed, Dec 2, 2015 at 7:41 AM, Antoon Pardon >> wrote: >>> Op 02-12-15 om 14:11 schreef Steven D'Aprano: >>>> On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wro

Re: Question about split method

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 2:37 PM, Robert wrote: > Hi, > > I learn split method online. When I try to run the line with ss1 beginning, > I don't understand why its output of ss1 and ss2. I have check the help > about split. It looks like that it is a numpy method. > What is the split method parameter

Re: Python 3.5.0: python.exe is not a valid Windows 32 application

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 4:09 PM, wrote: > Hi. > > https://mail.python.org/pipermail/python-dev/2015-July/140823.html > Python 3.5 was dropped the support Windows XP and 2003. > > > > It's just an aside, but Python 3.5.1 works on my customized Windows 2000 :P > http://blog.livedoor.jp/blackwingcat/

Re: Subclassing tuple and introspection

2015-12-02 Thread Ian Kelly
On Wed, Dec 2, 2015 at 4:32 PM, Joseph L. Casale wrote: > I need to return a collection of various types, since python doesn't > have the terse facility of extension methods like C#, subclassing tuple > and adding a method seems like a terse way to accommodate this. If you're not already familiar

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Ian Kelly
On Thu, Dec 3, 2015 at 9:00 AM, Robin Koch wrote: > Now *I* am confused. > > Shouldn't it be > > ", ".join(['1', '2', '4', '8', '16']) > > instead? Without any importing? That would be the normal way to write it. The FAQ entry is suggesting the string module function as an alternative for those w

Re: [Python-ideas] Missing Core Feature: + - * / | & do not call __getattr__

2015-12-04 Thread Ian Kelly
On Fri, Dec 4, 2015 at 7:20 AM, Stephan Sahm wrote: > Dear all, > > I just stumbled upon a very weird behaviour of python 2 and python 3. At > least I was not able to find a solution. > > The point is to dynamically define __add__, __or__ and so on via __getattr__ > (for example by deriving them f

Re: Frozen apps (py2exe, cx_freeze) built with Python 3.5

2015-12-04 Thread Ian Kelly
On Fri, Dec 4, 2015 at 10:21 AM, d...@forestfield.co.uk wrote: > Python 3.5 will not run under Windows XP, but what about applications created > using py2exe or cx_freeze under Windows 7, 8 or 10, is there any knowledge of > whether they will run under XP? I wouldn't expect them to. Those bundl

Re: [Python-ideas] Using functools.lru_cache only on some arguments of a function

2015-12-04 Thread Ian Kelly
On Fri, Dec 4, 2015 at 2:44 PM, Bill Winslow wrote: > This is a question I posed to reddit, with no real resolution: > https://www.reddit.com/r/learnpython/comments/3v75g4/using_functoolslru_cache_only_on_some_arguments/ > > The summary for people here is the following: > > Here's a pattern I'm us

Re: Issue

2015-12-07 Thread Ian Kelly
On Sun, Dec 6, 2015 at 5:16 PM, Steven D'Aprano wrote: > Oh, I can make one guess... if you're using Windows XP, I'm afraid that > Python 3.5 is not supported. You'll have to either downgrade to Python 3.4, > or upgrade to Windows 7 or higher, or another operating system. For the sake of accuracy

Re: Accessing container's methods

2015-12-07 Thread Ian Kelly
On Mon, Dec 7, 2015 at 11:10 AM, Tony van der Hoff wrote: > Hi, > > I have a class A, containing embedded embedded classes, which need to access > methods from A. > . > A highly contrived example, where I'm setting up an outer class in a Has-a > relationship, containing a number of Actors. The inn

Re: Understanding Python from a PHP coder's perspective

2015-12-07 Thread Ian Kelly
On Mon, Dec 7, 2015 at 2:07 PM, wrote: > Hello all! Just started getting into Python, and am very excited about the > prospect. > > I am struggling on some general concepts. My past experience with > server-side code is mostly limited to PHP and websites. I have some file > called "whatever

Re: Understanding Python from a PHP coder's perspective

2015-12-07 Thread Ian Kelly
On Mon, Dec 7, 2015 at 2:40 PM, Chris Angelico wrote: > So that's a quick potted summary of why the URLs don't reflect the > language used. Python is event-driven, but instead of defining events > at the file level, the way PHP does, they're defined at the function > level. Of course, if you *want

Re: Understanding Python from a PHP coder's perspective

2015-12-07 Thread Ian Kelly
On Mon, Dec 7, 2015 at 3:27 PM, wrote: > Thank you all! > > Okay, the concept of a WSGI along with a framework provides insight on my > main questions. > > In regards to Chris's statement: "It openly and honestly does NOT reset its > state between page requests" > > With PHP, I have sessions to

Re: increment/decrement operators

2015-12-07 Thread Ian Kelly
On Dec 5, 2015 10:21 AM, "BartC" wrote: > > > The latter is not the same. Some of the differences are: > > * ++ and -- are often inside inside expressions and return values (unlike x+=1 in Python) > > * x++ and x-- return the /current/ value of x, unlike x+=1 even if it were to return a val

Re: Accessing container's methods

2015-12-08 Thread Ian Kelly
On Tue, Dec 8, 2015 at 3:37 PM, Erik wrote: > On 08/12/15 19:02, Thomas 'PointedEars' Lahn wrote: >> >> Erik wrote: >> >> Please fix, Erik #75656. > > > Fixed(*) [SNIP] > (*) In the sense that it's not going to change ;) Then I think you mean "Working as Intended", not "Fixed". B-) -- ht

Re: Python variable assigning problems...

2015-12-11 Thread Ian Kelly
On Fri, Dec 11, 2015 at 9:10 AM, ICT Ezy wrote: > Dear All, > Very Sorry for the my mistake here. I code here with mu question ... > > My Question: > > A,B=C,D=10,11 > print(A,B,C,D) > #(10,11,10,11) --> This is OK! > > a=1; b=2 > a,b=b,a > print(a,b) > # (1,2) --> This is OK! This actually resul

Re: Python variable assigning problems...

2015-12-11 Thread Ian Kelly
On Fri, Dec 11, 2015 at 9:24 AM, Robin Koch wrote: > Assigning goes from right to left: > > x,y=y,x=2,3 > > <=> > > y, x = 2, 3 > x, y = y, x > > Otherwise the assignment x, y = y, x would not make any sense, since x and y > haven't any values yet. > > And the execution from right to left is also

Re: python 351x64

2015-12-11 Thread Ian Kelly
On Fri, Dec 11, 2015 at 9:30 AM, Jay Hamm wrote: > Hi > > I was trying to use your windows version of python 3.5.1 x64. > > It has a conflict with a notepad++ plugin NppFTP giving > api-ms-win-crt-runtime-I1-1-0.dll error on start up. > > This seems pretty well documented on the web. The work aro

Re: Hello

2015-12-11 Thread Ian Kelly
On Fri, Dec 11, 2015 at 11:43 AM, Seung Kim wrote: > See message below. > > On Fri, Dec 11, 2015 at 1:13 PM, Seung Kim wrote: > >> I would like to have Python 3.5.1 MSI installer files for both 32-bit and >> 64-bit so that I can deploy the software on managed computers on campus. >> >> When I ran

Re: Calling a list of functions

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 10:26 AM, Ganesh Pal wrote: > Hi Team, > > Iam on linux and python 2.7 . I have a bunch of functions which I > have run sequentially . > I have put them in a list and Iam calling the functions in the list as > shown below , this works fine for me , please share your > op

Re: Weird list conversion

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 12:45 PM, wrote: > Hi all, > > f = open("stairs.bin", "rb") > data = list(f.read(16)) > print data > > returns > > ['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '\x00', > '\x00', '\x00', '\x00', '\x00', '\x00', '\x00'] > > The fir

Re: Weird list conversion

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 1:05 PM, KP wrote: > On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: >> In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: >> >Hi all, >> > >> > f = open("stairs.bin", "rb") >> > data = list(f.read(16)) >> > print data >> > >> >re

Re: Try: rather than if :

2015-12-14 Thread Ian Kelly
On Mon, Dec 14, 2015 at 3:38 PM, Vincent Davis wrote: > In the code below try is used to check if handle has the attribute name. It > seems an if statement could be used. Is there reason one way would be > better than another? http://www.oranlooney.com/lbyl-vs-eafp/ -- https://mail.python.org/ma

Re: Try: rather than if :

2015-12-14 Thread Ian Kelly
On Mon, Dec 14, 2015 at 4:48 PM, Vincent Davis wrote: > On Mon, Dec 14, 2015 at 4:14 PM, Cameron Simpson wrote: > >> First, notice that the code inside the try/except _only_ fetches the >> attribute. Your version calls the "write" attribute, and also accesses >> handle.name. Either of those migh

Re: subclassing collections.Counter

2015-12-15 Thread Ian Kelly
On Tue, Dec 15, 2015 at 8:49 AM, Pavlos Parissis wrote: > Hi, > > I need to store values for metrics and return the average for some > and the sum for the rest. Thus, I thought I could extend > collections.Counter class by returning averages for some keys. Leave Counter out of it, as this is not

Re: subclassing collections.Counter

2015-12-15 Thread Ian Kelly
On Tue, Dec 15, 2015 at 9:20 AM, Pavlos Parissis wrote: > On 15/12/2015 05:11 μμ, Ian Kelly wrote: >> On Tue, Dec 15, 2015 at 8:49 AM, Pavlos Parissis >> wrote: >>> Hi, >>> >>> I need to store values for metrics and return the average for some >&

Re: subclassing collections.Counter

2015-12-15 Thread Ian Kelly
On Tue, Dec 15, 2015 at 10:43 AM, Pavlos Parissis wrote: >> If you want your metrics container to act like a dict, then my >> suggestion would be to just use a dict, with pseudo-collections for >> the values as above. >> > > If I understood you correctly, you are saying store all metrics in a > di

Re: error reading api with urllib

2015-12-16 Thread Ian Kelly
On Tue, Dec 15, 2015 at 7:46 PM, Simian wrote: > I added > > except urllib.error.HTTPError as e: > print('HTTP Errpr') > print('Error code: ', e.code) > > to my try and I recieve... > > 400: ('Bad Request', > 'Bad request syntax or unsupported method'), > > but processing the string

Re: error reading api with urllib

2015-12-16 Thread Ian Kelly
On Wed, Dec 16, 2015 at 3:12 PM, John Gordon wrote: > In <9aa21642-765b-4666-8c66-a6dab9928...@googlegroups.com> > simian...@gmail.com writes: > >> Bad Request >> b'' > > > That probably means you aren't using one of the recognized methods > (i.e. GET, POST, etc.) > > It doesn't look like you are

<    11   12   13   14   15   16   17   18   19   20   >