Re: OT: This Swift thing

2014-06-06 Thread Travis Griggs
On Jun 5, 2014, at 1:14, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Swift's memory management is similar to python's (ref. counting). Which makes me think that a subset of python with the same type safety would be an instant success. Except that while you don't need to regularly

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Akira Li
Marko Rauhamaa ma...@pacujo.net writes: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: Nevertheless, there are important abstractions that are written on top of the bytes layer, and in the Unix and Linux world, the most important abstraction is *text*. In the Unix world, text formats

Re: How to use SQLite (sqlite3) more efficiently

2014-06-06 Thread Steve Hayes
On Thu, 5 Jun 2014 17:17:19 -0500 (CDT), Dave Angel da...@davea.name wrote: R Johnson ps16thypresenceisfullnessof...@gmail.com Wrote in message: I've attached some new sample code in which I've attempted to correct various things that you mentioned. Attachments don't work well for many

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Travis Griggs travisgri...@gmail.com writes: On Jun 5, 2014, at 1:14, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Swift's memory management is similar to python's (ref. counting). Which makes me think that a subset of python with the same type safety would be an instant success.

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Johannes Bauer
On 05.06.2014 20:52, Ryan Hiebert wrote: 2014-06-05 13:42 GMT-05:00 Johannes Bauer dfnsonfsdu...@gmx.de: On 05.06.2014 20:16, Paul Rubin wrote: Johannes Bauer dfnsonfsdu...@gmx.de writes: line = line[:-1] Which truncates the trailing \n of a textfile line. use line.rstrip() for that.

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Johannes Bauer
On 05.06.2014 22:18, Ian Kelly wrote: Personally I tend toward rstrip('\r\n') so that I don't have to worry about files with alternative line terminators. Hm, I was under the impression that Python already took care of removing the \r at a line ending. Checking that right now: (DOS encoded

Re: Matplotlib - specifying bin widths

2014-06-06 Thread Jamie Mitchell
On Thursday, June 5, 2014 4:54:16 PM UTC+1, Jamie Mitchell wrote: Hello all! Instead of setting the number of bins I want to set the bin width. I would like my bins to go from 1.7 to 2.4 in steps of 0.05. How do I say this in the code? Cheers, Jamie That's

Overlaying a boxplot onto a time series figure

2014-06-06 Thread Jamie Mitchell
Hi there, I would like to overlay some boxplots onto a time series. I have tried pylab.hold(True) in between the two plots in my code but this hasn't worked. The problem is that the x-axes of the boxplots and the time series are not the same. Code for time series: python2.7 import netCDF4

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-06 Thread Anssi Saari
Chris Angelico ros...@gmail.com writes: I don't have an actual use-case for this, as I don't target microcontrollers, but I'm curious: What parts of Py3 syntax aren't supported? I meant to say % formatting for strings but that's apparently been added recently. My previous micropython build

Classic Arcade Games for Windows

2014-06-06 Thread Arrant Knave
Classic Arcade Games for Windows at: http://home.eol.ca/~knave/index.htm E-mail questions to: kn...@eol.ca -- Books and Games at: http://home.eol.ca/~knave/index.htm -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Tim Chase
On 2014-06-06 10:47, Johannes Bauer wrote: Personally I tend toward rstrip('\r\n') so that I don't have to worry about files with alternative line terminators. Hm, I was under the impression that Python already took care of removing the \r at a line ending. Checking that right now: (DOS

Re: Having trouble in expressing constraints in Python

2014-06-06 Thread varun7rs
Thanks a lot Ian. Your post helped me understand the problem in a much better way and I've solved the first objective thanks to you but incase of my second objective which is minimize the number of nodes, I have got one of the weirdest looking constraints which I don't know how to express in

Re: any wheel experts

2014-06-06 Thread Robin Becker
On 05/06/2014 22:56, Mark Lawrence wrote: On 05/06/2014 22:42, Ned Deily wrote: In article b91c428a-514d-4ddd-84a2-a4bdeb1ed...@googlegroups.com, Rustom Mody rustompm...@gmail.com wrote: On Thursday, June 5, 2014 10:21:06 PM UTC+5:30, Robin Becker wrote: I used to create exe files for

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Terry Reedy tjre...@udel.edu writes: On 6/5/2014 4:07 PM, Alain Ketterlin wrote: When I compile Cython modules I use LLVM on this computer. Cython is not Python, it is another language, with an incompatible syntax. Cython compiles Python with optional extensions that allow additional

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Sturla Molden sturla.mol...@gmail.com writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Many of these students suggest Python as the development language (they learned it and liked it), and the suggestion is (almost) always rejected, in favor of Java or C# or C/C++. And it was

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Chris Angelico ros...@gmail.com writes: On Fri, Jun 6, 2014 at 7:23 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 05/06/2014 21:07, Alain Ketterlin wrote: Sturla Molden sturla.mol...@gmail.com writes: On 05/06/14 10:14, Alain Ketterlin wrote: Type safety. Perhaps. Python has

Re: Forking PyPI package

2014-06-06 Thread Akira Li
Wiktor look@signature.invalid writes: On Fri, 6 Jun 2014 03:37:56 +1000, Chris Angelico wrote: On Fri, Jun 6, 2014 at 2:56 AM, Wiktor look@signature.invalid wrote: I guess, I'll try to do what Chris proposed. Forget about this implementation and write python script from the scratch looking

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Sturla Molden sturla.mol...@gmail.com writes: On 05/06/14 22:27, Alain Ketterlin wrote: I have seen dozens of projects where Python was dismissed because of the lack of static typing, and the lack of static analysis tools. [...] When is static analysis actually needed and for what purpose?

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Steven D'Aprano
On Fri, 06 Jun 2014 10:47:44 +0200, Johannes Bauer wrote: Hm, I was under the impression that Python already took care of removing the \r at a line ending. Checking that right now: [snip example] This is called Universal Newlines. Technically it is a build-time option which applies when you

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Robin Becker
On 05/06/2014 18:16, Ian Kelly wrote: . How should e.g. bytes.upper() be implemented then? The correct behavior is entirely dependent on the encoding. Python 2 just assumes ASCII, which at best will correctly upper-case some subset of the string and leave the rest unchanged, and at

Re: OT: This Swift thing

2014-06-06 Thread Chris Angelico
On Fri, Jun 6, 2014 at 9:20 PM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: It's impossible to accidentally call a base class's method when you ought to have called the overriding method in the subclass, which is a risk in C++ [2]. I don't how this can happen in C++, unless you

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Steven D'Aprano
On Fri, 06 Jun 2014 02:21:54 +0300, Marko Rauhamaa wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: In any case, I reject your premise. ALL data types are constructed on top of bytes, Only in a very dull sense. I agree with you that this is a very dull, unimportant sense. And

Re: Connect to VectorWise database usin Python

2014-06-06 Thread bhasker . sathyamurthy
On Monday, 2 June 2014 09:38:44 UTC+5:30, sukesh.b...@thomsonreuters.com wrote: Hi, Using python(2.7.2) I am not able to connect to Vector Wise database. Can you suggest me how I can connect to it. If you don't mind step by step L. Regards, Sukesh. --

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: Incorrect. Linux presents data as text all the time. Look at the prompt: its treated as text, not numbers. Of course there is a textual human interface. However, from the point of view of virtually every OS component, it's bytes.

Re: Matplotlib - specifying bin widths

2014-06-06 Thread Mark Lawrence
On 06/06/2014 10:03, Jamie Mitchell wrote: On Thursday, June 5, 2014 4:54:16 PM UTC+1, Jamie Mitchell wrote: Hello all! Instead of setting the number of bins I want to set the bin width. I would like my bins to go from 1.7 to 2.4 in steps of 0.05. How do I say this in the code?

RE: Automating windows media player on win7

2014-06-06 Thread Deogratius Musiige
Thanks a lot mate. You just made my day. I have looked around the net but cannot find the controls available. I would like to be able to: - get current playing track - get wmplayer state (playing/paused/stopped) - get the selected sound device Thanks a lot Br Deo -Original Message-

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Ethan Furman
On 06/05/2014 11:30 AM, Marko Rauhamaa wrote: How text is represented is very different from whether text is a fundamental data type. A fundamental text file is such that ordinary operating system facilities can't see inside the black box (that is, they are *not* encoded as far as the

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Ethan Furman et...@stoneleaf.us: On 06/05/2014 11:30 AM, Marko Rauhamaa wrote: A fundamental text file is such that ordinary operating system facilities can't see inside the black box (that is, they are *not* encoded as far as the applications go). Of course they are. How would you know?

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Grant Edwards
On 2014-06-06, Roy Smith r...@panix.com wrote: Roy is using MT-NewsWatcher as a client. Yes. Except for the fact that it hasn't kept up with unicode, I find the U/I pretty much perfect. I imagine at some point I'll be force to look elsewhere, but then again, netnews is pretty much dead.

Re: Automating windows media player on win7

2014-06-06 Thread Michael Torrie
On 06/06/2014 07:39 AM, Deogratius Musiige wrote: Thanks a lot mate. You just made my day. I have looked around the net but cannot find the controls available. I would like to be able to: - get current playing track - get wmplayer state (playing/paused/stopped) - get the selected

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Ethan Furman
On 06/05/2014 09:32 AM, Steven D'Aprano wrote: But whatever the situation, and despite our differences of opinion about Unicode, THANK YOU for having updated ReportLabs to 3.3. +1000 -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Michael Torrie
On 06/06/2014 08:10 AM, Marko Rauhamaa wrote: Ethan Furman et...@stoneleaf.us: ASCII is *not* the state of this string has no encoding -- that would be Unicode; a Unicode string, as a data type, has no encoding. Huh? It's this very fact that trips of JMF in his rants about FSR. Thank you

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Chris Angelico
On Fri, Jun 6, 2014 at 11:24 PM, Ethan Furman et...@stoneleaf.us wrote: On 06/05/2014 11:30 AM, Marko Rauhamaa wrote: How text is represented is very different from whether text is a fundamental data type. A fundamental text file is such that ordinary operating system facilities can't see

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Michael Torrie torr...@gmail.com: On 06/06/2014 08:10 AM, Marko Rauhamaa wrote: Ethan Furman et...@stoneleaf.us: ASCII is *not* the state of this string has no encoding -- that would be Unicode; a Unicode string, as a data type, has no encoding. Huh? [...] What part of his statement

Re: Da dove prende python il default timezone?

2014-06-06 Thread Strae
Whoops sorry, i thought this was the italian group -- https://mail.python.org/mailman/listinfo/python-list

Da dove prende python il default timezone?

2014-06-06 Thread Strae
Ho acquistato un server di test in canada; Installato debian 7, settato il timezone di Roma tramite dpkg-reconfigure tzdata e sembra tutto ok; Però sembra che python di default prenda sempre il timezone canadese: import os, time from time import strftime strftime(%H) # Le 18 sono le 23! Ora,

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 1:32 AM, Marko Rauhamaa ma...@pacujo.net wrote: Michael Torrie torr...@gmail.com: On 06/06/2014 08:10 AM, Marko Rauhamaa wrote: Ethan Furman et...@stoneleaf.us: ASCII is *not* the state of this string has no encoding -- that would be Unicode; a Unicode string, as a

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Steven D'Aprano
On Fri, 06 Jun 2014 18:32:39 +0300, Marko Rauhamaa wrote: Michael Torrie torr...@gmail.com: On 06/06/2014 08:10 AM, Marko Rauhamaa wrote: Ethan Furman et...@stoneleaf.us: ASCII is *not* the state of this string has no encoding -- that would be Unicode; a Unicode string, as a data type, has

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Rustom Mody
On Friday, June 6, 2014 9:27:51 PM UTC+5:30, Steven D'Aprano wrote: On Fri, 06 Jun 2014 18:32:39 +0300, Marko Rauhamaa wrote: Michael Torri: On 06/06/2014 08:10 AM, Marko Rauhamaa wrote: Ethan Furman : ASCII is *not* the state of this string has no encoding -- that would be Unicode; a

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 2:21 AM, Rustom Mody rustompm...@gmail.com wrote: Combine that with Chris': Yes and no. ASCII means two things: Firstly, it's a mapping from the letter A to the number 65, from the exclamation mark to 33, from the backslash to 92, and so on. And secondly, it's an

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-06 Thread Travis Griggs
On Jun 4, 2014, at 4:01 AM, Tim Chase python.l...@tim.thechases.com wrote: If you use UTF-8 for everything It seems to me, that increasingly other libraries (C, etc), use utf8 as the preferred string interchange format. It’s universal, not prone to endian issues, etc. So one *advantage* you

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: ASCII means two things: Firstly, it's a mapping from the letter A to the number 65, from the exclamation mark to 33, from the backslash to 92, and so on. And secondly, it's an encoding of those numbers into the lowest seven bits of a byte, with the high byte

Re: OT: This Swift thing

2014-06-06 Thread Terry Reedy
On 6/6/2014 7:11 AM, Alain Ketterlin wrote: Terry Reedy tjre...@udel.edu writes: On 6/5/2014 4:07 PM, Alain Ketterlin wrote: When I compile Cython modules I use LLVM on this computer. Cython is not Python, it is another language, with an incompatible syntax. Cython compiles Python with

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Rustom Mody
On Friday, June 6, 2014 10:18:41 PM UTC+5:30, Chris Angelico wrote: On Sat, Jun 7, 2014 at 2:21 AM, Rustom Mody wrote: Combine that with Chris': Yes and no. ASCII means two things: Firstly, it's a mapping from the letter A to the number 65, from the exclamation mark to 33, from the

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Fri, 06 Jun 2014 18:32:39 +0300, Marko Rauhamaa wrote: Unicode, like ASCII, is a code. Representing text in unicode is encoding. A Unicode string as an abstract data type has no encoding. Unicode itself is an encoding. See it in

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Rustom Mody
On Friday, June 6, 2014 10:32:47 PM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : ASCII means two things: Firstly, it's a mapping from the letter A to the number 65, from the exclamation mark to 33, from the backslash to 92, and so on. And secondly, it's an encoding of those numbers

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 3:11 AM, Marko Rauhamaa ma...@pacujo.net wrote: Encoding is not tied to bytes or even computers. People can speak in code, after all. Obligatory: http://xkcd.com/257/ ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Marko Rauhamaa ma...@pacujo.net: Far from it. It is a mapping from symbols to integers. The symbols are the Platonic ones. Well, of course, even the symbols are a code. Letters code sounds and digits code numbers. And the sounds and numbers code ideas. Now we are getting close to being truly

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 3:04 AM, Rustom Mody rustompm...@gmail.com wrote: ASCII was once your one companion, it was all that mattered. ASCII was once a friendly encoding, then your world was shattered. Wishing it were somehow here again, wishing it were somehow near... sometimes it seemed, if

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 3:13 AM, Rustom Mody rustompm...@gmail.com wrote: On Friday, June 6, 2014 10:32:47 PM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : ASCII means two things: Firstly, it's a mapping from the letter A to the number 65, from the exclamation mark to 33, from the

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-06 Thread Roy Smith
In article mailman.10822.1402073958.18130.python-l...@python.org, Travis Griggs travisgri...@gmail.com wrote: On Jun 4, 2014, at 4:01 AM, Tim Chase python.l...@tim.thechases.com wrote: If you use UTF-8 for everything It seems to me, that increasingly other libraries (C, etc), use utf8 as

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Ned Batchelder
On 6/6/14 1:11 PM, Marko Rauhamaa wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Fri, 06 Jun 2014 18:32:39 +0300, Marko Rauhamaa wrote: Unicode, like ASCII, is a code. Representing text in unicode is encoding. A Unicode string as an abstract data type has no encoding.

try/except/finally

2014-06-06 Thread Frank B
Ok; this is a bit esoteric. So finally is executed regardless of whether an exception occurs, so states the docs. But, I thought, if I return from my function first, that should take precedence. au contraire Turns out that if you do this: try: failingthing() except FailException: return

Re: try/except/finally

2014-06-06 Thread Roy Smith
In article 0a89c96d-de62-42ad-be48-6107ce10d...@googlegroups.com, Frank B fbick...@gmail.com wrote: Ok; this is a bit esoteric. So finally is executed regardless of whether an exception occurs, so states the docs. But, I thought, if I return from my function first, that should take

Re: try/except/finally

2014-06-06 Thread Frank B
Ok; thanks for the underscore and clarification. Just need to adjust my thinking a bit. -- https://mail.python.org/mailman/listinfo/python-list

How to use SQLite (sqlite3) more efficiently

2014-06-06 Thread R Johnson
The subject line isn't as important as a header, carried invisibly through, that says that you were replying to an existing post. :) Sorry for my ignorance, but I've never edited email headers before and didn't find any relevant help on Google. Could you please give some more details about

Re: How to use SQLite (sqlite3) more efficiently

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 4:15 AM, R Johnson ps16thypresenceisfullnessof...@gmail.com wrote: The subject line isn't as important as a header, carried invisibly through, that says that you were replying to an existing post. :) Sorry for my ignorance, but I've never edited email headers before and

Re: try/except/finally

2014-06-06 Thread Ned Batchelder
On 6/6/14 1:47 PM, Frank B wrote: Ok; thanks for the underscore and clarification. Just need to adjust my thinking a bit. Did this come up in real code? I've seen this point about finally/return semantics a number of times, but haven't seen real code that needed adjusting based on it.

Re: Da dove prende python il default timezone?

2014-06-06 Thread Andrea D'Amore
On 2014-06-06 15:37:24 +, Strae said: Ho acquistato un server di test in canada; Installato debian 7, settato il timezone di Roma tramite dpkg-reconfigure tzdata e sembra tutto ok; Però sembra che python di default prenda sempre il timezone canadese I'm on a very similar setup (Wheezy,

Regarding Python official website

2014-06-06 Thread Aseem Bansal
The Python website is undergoing an overhaul for better looks. Is there anything like a forum where it is being discussed. I mean where the schedule for this is being maintained or the same is being discussed? -- https://mail.python.org/mailman/listinfo/python-list

Re: Regarding Python official website

2014-06-06 Thread Ned Deily
In article 17ad7280-65dd-4db9-9f4a-7bdd8bb7c...@googlegroups.com, Aseem Bansal asmbans...@gmail.com wrote: The Python website is undergoing an overhaul for better looks. Is there anything like a forum where it is being discussed. I mean where the schedule for this is being maintained or the

os.startfile hanging onto the launched app, or my IDE?

2014-06-06 Thread Josh English
I have been using os.startfile(filepath) to launch files I've created in Python, mostly Excel spreadsheets, text files, or PDFs. When I run my script from my IDE, the file opens as I expect. But if I go back to my script and re-run it, the external program (either Excel, Notepad, or Acrobat

Re: How to use SQLite (sqlite3) more efficiently

2014-06-06 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Sat, Jun 7, 2014 at 4:15 AM, R Johnson ps16thypresenceisfullnessof...@gmail.com wrote: The subject line isn't as important as a header, carried invisibly through, that says that you were replying to an existing post. :) Sorry for my

Re: How to use SQLite (sqlite3) more efficiently

2014-06-06 Thread Mark Lawrence
On 06/06/2014 22:58, Dave Angel wrote: Chris Angelico ros...@gmail.com Wrote in message: On Sat, Jun 7, 2014 at 4:15 AM, R Johnson ps16thypresenceisfullnessof...@gmail.com wrote: The subject line isn't as important as a header, carried invisibly through, that says that you were replying to an

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Denis McMahon
On Sat, 07 Jun 2014 01:50:50 +1000, Chris Angelico wrote: Yes and no. ASCII means two things: ASCII means: American Standard Code for Information Interchange aka ASA Standard X3.4-1963 into the lowest seven bits of a byte, with the high byte left clear. high BIT left clear. -- Denis

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 7:18 AM, Denis McMahon denismfmcma...@gmail.com wrote: into the lowest seven bits of a byte, with the high byte left clear. high BIT left clear. That thing. Unless you have bytes inside bytes (byteception?), you'll only have room for one high bit. Some day I'll get my

http.server.BaseHTTPRequestHandler basic auth logout? Django authentication system for REST interface?

2014-06-06 Thread Dan Stromberg
I have some code for a web server. Right now, it uses BaseHTTPRequestHandler with Basic Auth, but we want to be able to log out, and there doesn't appear to be a general way to log out of something using Basic Auth, short of turning to unportable JavaScript. And this needs first and foremost to

Decorating one method of a class C with another method of class C?

2014-06-06 Thread Dan Stromberg
Is there a way of decorating method1 of class C using method2 of class C? It seems like there's a chicken-and-the-egg problem; the class doesn't seem to know what self is until later in execution so there's apparently no way to specify @self.method2 when def'ing method1. --

Re: Decorating one method of a class C with another method of class C?

2014-06-06 Thread Chris Angelico
On Sat, Jun 7, 2014 at 10:14 AM, Dan Stromberg drsali...@gmail.com wrote: Is there a way of decorating method1 of class C using method2 of class C? It seems like there's a chicken-and-the-egg problem; the class doesn't seem to know what self is until later in execution so there's apparently

Re: Decorating one method of a class C with another method of class C?

2014-06-06 Thread Ben Finney
Dan Stromberg drsali...@gmail.com writes: Is there a way of decorating method1 of class C using method2 of class C? Can you give a concrete example (i.e. not merely hypothetical) where this would be a useful feature (i.e. an actual improvement over the absence of the feature), and why? It

Re: http.server.BaseHTTPRequestHandler basic auth logout? Django authentication system for REST interface?

2014-06-06 Thread Roy Smith
In article mailman.10835.1402098782.18130.python-l...@python.org, Dan Stromberg drsali...@gmail.com wrote: I have some code for a web server. Right now, it uses BaseHTTPRequestHandler with Basic Auth, but we want to be able to log out, and there doesn't appear to be a general way to log out

Re: Decorating one method of a class C with another method of class C?

2014-06-06 Thread Terry Reedy
On 6/6/2014 8:14 PM, Dan Stromberg wrote: Is there a way of decorating method1 of class C using method2 of class C? It seems like there's a chicken-and-the-egg problem; the class doesn't seem to know what self is until later in execution so there's apparently no way to specify @self.method2

Re: OT: This Swift thing

2014-06-06 Thread Sturla Molden
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: When is static analysis actually needed and for what purpose? For example WCET analysis (where predictability is more important than performance). Or code with strong security constraint. Or overflow detection tools. Or race condition

Re: OT: This Swift thing

2014-06-06 Thread Sturla Molden
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Sturla Molden sturla.mol...@gmail.com writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Many of these students suggest Python as the development language (they learned it and liked it), and the suggestion is (almost) always

Re: Missing stack frames?

2014-06-06 Thread Nikolaus Rath
Chris Angelico ros...@gmail.com writes: On Fri, Jun 6, 2014 at 12:16 PM, Nikolaus Rath nikol...@rath.org wrote: - Is there some way to make the call stack for destructors less confusing? First off, either don't have refloops, or explicitly break them. The actual code isn't as simple as the

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-06 Thread Tim Chase
On 2014-06-06 09:59, Travis Griggs wrote: On Jun 4, 2014, at 4:01 AM, Tim Chase wrote: If you use UTF-8 for everything It seems to me, that increasingly other libraries (C, etc), use utf8 as the preferred string interchange format. I definitely advocate UTF-8 for any streaming scenario, as

Re: OT: This Swift thing

2014-06-06 Thread Michael Torrie
On 06/06/2014 12:28 AM, Travis Griggs wrote: On Jun 5, 2014, at 1:14, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Swift's memory management is similar to python's (ref. counting). Which makes me think that a subset of python with the same type safety would be an instant success.

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Larry Hudson
On 06/06/2014 01:42 AM, Johannes Bauer wrote: snip Ah, I didn't know rstrip() accepted parameters and since you wrote line.rstrip() this would also cut away whitespaces (which sadly are relevant in odd cases). No problem. If a parameter is used in the strip() family, than _only_ those

Re: Decorating one method of a class C with another method of class C?

2014-06-06 Thread Steven D'Aprano
On Fri, 06 Jun 2014 17:14:54 -0700, Dan Stromberg wrote: Is there a way of decorating method1 of class C using method2 of class C? Yes. See below. It seems like there's a chicken-and-the-egg problem; the class doesn't seem to know what self is until later in execution so there's apparently

Re: OT: This Swift thing

2014-06-06 Thread Steven D'Aprano
On Fri, 06 Jun 2014 20:41:09 -0600, Michael Torrie wrote: On 06/06/2014 12:28 AM, Travis Griggs wrote: On Jun 5, 2014, at 1:14, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Swift's memory management is similar to python's (ref. counting). Which makes me think that a subset of

[issue21386] ipaddress.IPv4Address.is_global not implemented

2014-06-06 Thread Roger Luethi
Roger Luethi added the comment: Seeing that the patch merged for issue 21513 left the existing test for 100.64.0.0 (IPv4 network) untouched, I think it would make more sense to make that address a constant everywhere in a separate patch (if that is indeed desirable). --

[issue21671] CVE-2014-0224: OpenSSL upgrade to 1.0.1h on Windows required

2014-06-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3dfdcc97250f by Zachary Ware in branch '2.7': Issue #21671, CVE-2014-0224: Update the Windows build to openssl-1.0.1h http://hg.python.org/cpython/rev/3dfdcc97250f New changeset 79f3d25caac3 by Zachary Ware in branch '3.4': Issue #21671,

[issue21676] IDLE - Test Replace Dialog

2014-06-06 Thread Saimadhav Heblikar
New submission from Saimadhav Heblikar: Add unittest for idlelib's replace dialog. 7 lines related to replacedialog logic could not be tested. Any input on how to test those lines? Running the test suite for idlelib emits: ttk::ThemeChanged invalid command name 3069198412callit while

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-06 Thread Martin Panter
New submission from Martin Panter: I made a writer class whose write() and flush() methods (unintentionally) triggered exceptions. I wrapped this in a BufferedWriter. When close() is called, the resulting exception has a string object in its __context__ attribute. Although the original error

[issue21671] CVE-2014-0224: OpenSSL upgrade to 1.0.1h on Windows required

2014-06-06 Thread Georg Brandl
Georg Brandl added the comment: Martin, would you make installers for a new 3.2 and 3.3 release? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21671 ___

[issue634412] RFC 2387 in email package

2014-06-06 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue634412 ___ ___ Python-bugs-list

[issue16958] The sqlite3 context manager does not work with isolation_level=None

2014-06-06 Thread aaugustin
aaugustin added the comment: * Thesis * I belive that using the connection as a context manager is an inadequate API for controlling transactions because it's very likely to result in subtly broken code. As a consequence, my recommendation would be to deprecate this API. * Argumentation *

[issue21678] Add operation plus for dictionaries

2014-06-06 Thread Михаил Мишакин
New submission from Михаил Мишакин: First of all, i'm sorry for my English :) I would like to union dictionaries with operator + (and +=) like this: dict(a=1, b=2) + {'a': 10, 'c': 30} {'a': 10, 'b': 2, 'c': 30} d = dict(a=1, b=2, c={'c1': 3, 'c2': 4}) d += dict(a=10, c={'c1':30}) d {'a':

[issue21678] Add operation plus for dictionaries

2014-06-06 Thread STINNER Victor
STINNER Victor added the comment: You should use dict.update() method. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21678 ___ ___

[issue21678] Add operation plus for dictionaries

2014-06-06 Thread Михаил Мишакин
Михаил Мишакин added the comment: Is's like list's operation + and it's method list.extend(). But dict have no operation +... If I have two lists (A and B), and I want to get third list (not change A and B) i do this: C = A + B If I have two dicts, i can do this: C = dict(A, **B) But if i

[issue21647] Idle unittests: make gui, mock switching easier.

2014-06-06 Thread Saimadhav Heblikar
Saimadhav Heblikar added the comment: Perhaps, we can move GUI/non GUI code into blocks. I will take Text as example. from test import support if support._is_gui_available(): from tkinter import Text else: from idlelib.idle_test.mock_tk import Text . . . if not

[issue19521] parallel build race condition on AIX since python-3.2

2014-06-06 Thread Michael Haubenwallner
Changes by Michael Haubenwallner michael.haubenwall...@salomon.at: -- hgrepos: +251 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19521 ___ ___

[issue21326] asyncio: request clearer error message when event loop closed

2014-06-06 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- components: +Asyncio ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21326 ___ ___

[issue21365] asyncio.Task reference misses the most important fact about it, related info spread around intros and example commentary instead

2014-06-06 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- components: +Asyncio ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21365 ___ ___

[issue21645] test_read_all_from_pipe_reader() of test_asyncio hangs on FreeBSD 9

2014-06-06 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- components: +Asyncio ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21645 ___ ___

[issue1191964] asynchronous Subprocess

2014-06-06 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- components: +Asyncio ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1191964 ___ ___

[issue21599] Argument transport in attach and detach method in Server class in base_events file is not used

2014-06-06 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- components: +Asyncio nosy: +gvanrossum, yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21599 ___

[issue21671] CVE-2014-0224: OpenSSL upgrade to 1.0.1h on Windows required

2014-06-06 Thread Martin v . Löwis
Martin v. Löwis added the comment: I'm unsure. I'd rather stick to the established policy. If there are reasons to change the policy, I'd like to know what they are and what a new policy should look like, instead of making a singular exception from the policy. For the record, the reason *for*

[issue10656] Out of tree build fails on AIX

2014-06-06 Thread Michael Haubenwallner
Changes by Michael Haubenwallner michael.haubenwall...@salomon.at: -- hgrepos: +252 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10656 ___ ___

[issue16189] ld_so_aix not found

2014-06-06 Thread Michael Haubenwallner
Changes by Michael Haubenwallner michael.haubenwall...@salomon.at: -- hgrepos: +253 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16189 ___ ___

  1   2   >