Re: Python 3.2 has some deadly infection

2014-06-06 Thread Akira Li
Marko Rauhamaa writes: > Steven D'Aprano : > >> 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 and >> text processing is much more common in

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 wrote: >R Johnson 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 people using this list. I > for one can't even s

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Travis Griggs writes: >> On Jun 5, 2014, at 1:14, Alain Ketterlin 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 regu

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 : > >> On 05.06.2014 20:16, Paul Rubin wrote: >>> Johannes Bauer writes: line = line[:-1] Which truncates the trailing "\n" of a textfile line. >>> >>> use line.rstrip() for that. >> >> rstrip has diffe

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 f

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, > > >

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 im

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

2014-06-06 Thread Anssi Saari
Chris Angelico 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 was from Februa

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: >

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 Pyt

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 , Rustom Mody wrote: On Thursday, June 5, 2014 10:21:06 PM UTC+5:30, Robin Becker wrote: I used to create exe files for windows, but the latest and greatest concept is wheels .whl files. If someone

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Terry Reedy 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 > speed

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Sturla Molden writes: > Alain Ketterlin 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 almost always the wrong decision... I think

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Chris Angelico writes: > On Fri, Jun 6, 2014 at 7:23 AM, Mark Lawrence wrote: >> On 05/06/2014 21:07, Alain Ketterlin wrote: >>> >>> Sturla Molden writes: >>> On 05/06/14 10:14, Alain Ketterlin wrote: > Type safety. Perhaps. Python has strong type safety. >>> >>> Come on

Re: Forking PyPI package

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

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Sturla Molden 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? For example WCET a

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 yo

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 wor

Re: OT: This Swift thing

2014-06-06 Thread Chris Angelico
On Fri, Jun 6, 2014 at 9:20 PM, Alain Ketterlin 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 actually have an instance >

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 : > >> 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 I think it's dullness appli

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. -- https://

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Steven D'Aprano : > 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. > Consider: > > [steve@ando ~]$ echo -e '\

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? Cheer

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- F

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 applicati

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Ethan Furman : > 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? > It may b

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

2014-06-06 Thread Grant Edwards
On 2014-06-06, Roy Smith 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. There ar

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 sele

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 : >> 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 to Ethan fo

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 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 inside the

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Michael Torrie : > 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 Unicode string, as a data type, has no encoding. >> >> Huh? > > [...] > > What part of his statement are you saying "Huh

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 wrote: > Michael Torrie : > >> 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 Unicode string, as a data type, has no encoding. >>> >>> Hu

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 : > >> 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 Unicode string, as a data type, has no encoding. >>>

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 >

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 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 encoding of those

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 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 gain for using utf8 internall

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
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 into > the lowest seven bits of a byte, with the high byte left clear.

Re: OT: This Swift thing

2014-06-06 Thread Terry Reedy
On 6/6/2014 7:11 AM, Alain Ketterlin wrote: Terry Reedy 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 extension

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 t

Re: Python 3.2 has some deadly infection

2014-06-06 Thread Marko Rauhamaa
Steven D'Aprano : > 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 action here: 72 101 108 108 11

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 num

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 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 : > 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 Platonic. Mar

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 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 you just dreame

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 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 backslash to >> >

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

2014-06-06 Thread Roy Smith
In article , 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. It¹s universal, not prone to endian > issues, etc. O

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 : 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

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 from my function first, that should take precedence. au contraire Turns out that if you do this: try: failingthing() except FailException: return 0 fina

Re: try/except/finally

2014-06-06 Thread Roy Smith
In article <0a89c96d-de62-42ad-be48-6107ce10d...@googlegroups.com>, Frank B 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 from my function first, that should take > precedence. > > a

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 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 > didn't find any relevant help on

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, se

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 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 same is being di

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

Re: How to use SQLite (sqlite3) more efficiently

2014-06-06 Thread Dave Angel
Chris Angelico Wrote in message: > On Sat, Jun 7, 2014 at 4:15 AM, R Johnson > 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 befo

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 Wrote in message: On Sat, Jun 7, 2014 at 4:15 AM, R Johnson 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 neve

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 Mc

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 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 brain and my fingers to

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 b

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. -- https://mail.python.

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 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 spec

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

2014-06-06 Thread Ben Finney
Dan Stromberg 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 seems like there's

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

2014-06-06 Thread Roy Smith
In article , Dan Stromberg 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 of > something using Basic Auth, short of turning to unportable JavaSc

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 wh

Re: OT: This Swift thing

2014-06-06 Thread Sturla Molden
Alain Ketterlin 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 analyzers. And there are ma

Re: OT: This Swift thing

2014-06-06 Thread Sturla Molden
Alain Ketterlin wrote: > Sturla Molden writes: > >> Alain Ketterlin 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 almost

Re: Missing stack frames?

2014-06-06 Thread Nikolaus Rath
Chris Angelico writes: > On Fri, Jun 6, 2014 at 12:16 PM, Nikolaus Rath 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 example. I wasn't even aware t

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 scenari

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 >> 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 th

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: 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 characters

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 > appa

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 >>> wrote: >>> >>> Swift's memory management is similar to python's (ref. counting). >>> Which makes me think that a subset of python with

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

2014-06-06 Thread dieter
Dan Stromberg writes: > 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. You ca

Elektra 0.8.6

2014-06-06 Thread Markus Raab
Hello Python List, Elektra provides a universal and secure framework to store configuration parameters in a global, hierarchical key database. The core is a small library implemented in C. The plugin-based framework fulfills many configuration-related tasks to avoid any unnecessary code duplica

Uniform Function Call Syntax (UFCS)

2014-06-06 Thread jongiddy
The language D has a feature called Uniform Function Call Syntax, which allows instance methods to be resolved using function calls. In Python terms, the call: x.len() would first check if 'x' has a method 'len', and would then look for a function 'len', passing 'x' as the first argument. The