how to determine for using c extension or not ?

2015-08-02 Thread umedoblock
Hello everyone. I use bisect module. bisect module developer give us c extension as _bisect. If Python3.3 use _bisect, _bisect override his functions in bisect.py. now, I use id() function to determine for using c extension or not. >>> import bisect >>> id(bisect.bisect) 139679893708880 >>> imp

Re: GvR Europython keynote described on lwn.net

2015-08-02 Thread Chris Angelico
On Mon, Aug 3, 2015 at 1:10 PM, Mark Lawrence wrote: > On 03/08/2015 02:27, Steven D'Aprano wrote: >> >> On Mon, 3 Aug 2015 08:34 am, Rick Johnson wrote: >> >>> So what? If i had to guess, i would guess that the hacks are >>> mostly to bring py3000 features to 2.7 >> >> >> These would be the featu

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Dan Sommers
On Sun, 02 Aug 2015 16:11:14 -0500, Tim Chase wrote: > On 2015-08-02 21:54, Ben Finney wrote: >> So, both XML and JSON should be considered write-only, and produced >> only for consumption by a computer; they are a poor choice for >> presenting to a human. [snip] > I second Ben's thoughts again

Re: GvR Europython keynote described on lwn.net

2015-08-02 Thread Mark Lawrence
On 03/08/2015 02:27, Steven D'Aprano wrote: On Mon, 3 Aug 2015 08:34 am, Rick Johnson wrote: So what? If i had to guess, i would guess that the hacks are mostly to bring py3000 features to 2.7 These would be the features of Python 3 that nobody needs and nobody wants because Python 2 is good

Re: Python 3 May Become Relevant Now

2015-08-02 Thread Chris Angelico
On Mon, Aug 3, 2015 at 12:15 PM, Rick Johnson wrote: > On Sunday, August 2, 2015 at 7:25:37 PM UTC-5, Mark Lawrence wrote: >> rr should have a field day with this one [...] > > You must be nuts if you think i'm going to click that link > for an article that was written today, Hahaha! Quote the > r

Re: Python 3 May Become Relevant Now

2015-08-02 Thread Rick Johnson
On Sunday, August 2, 2015 at 7:25:37 PM UTC-5, Mark Lawrence wrote: > rr should have a field day with this one [...] You must be nuts if you think i'm going to click that link for an article that was written today, Hahaha! Quote the relevant bits. -- https://mail.python.org/mailman/listinfo/pyt

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Tim Chase
On 2015-08-02 21:54, Ben Finney wrote: > So, both XML and JSON should be considered write-only, and produced > only for consumption by a computer; they are a poor choice for > presenting to a human. > > The “INI” format as handled by the Python ‘configparser’ module is > what I would recommend for

Re: GvR Europython keynote described on lwn.net

2015-08-02 Thread Steven D'Aprano
On Mon, 3 Aug 2015 08:34 am, Rick Johnson wrote: >> Just because company X is using 2.7, why does that mean >> that *you* shouldn't using 3.x? Surely you should make >> your own decision, based on your own needs. > > It's not just *ANY* company Steven, it's Guido's freaking > employer! That would

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Ben Finney
Cecil Westerhof writes: > On Sunday 2 Aug 2015 13:54 CEST, Ben Finney wrote: > > > So, both XML and JSON should be considered write-only, and produced > > only for consumption by a computer; they are a poor choice for > > presenting to a human. > > Well, I would use nested data. (A file will hav

Re: __main__ vs official module name: distinct module instances

2015-08-02 Thread Cameron Simpson
On 02Aug2015 18:18, Chris Angelico wrote: On Sun, Aug 2, 2015 at 6:16 PM, Chris Angelico wrote: On Sun, Aug 2, 2015 at 5:41 PM, Steven D'Aprano wrote: * if you don't wish to do that, you're screwed, and I think that the best you can do is program defensively by detecting the problem afte

Re: __main__ vs official module name: distinct module instances

2015-08-02 Thread Cameron Simpson
On 02Aug2015 17:41, Steven D'Aprano wrote: On Sun, 2 Aug 2015 01:53 pm, Cameron Simpson wrote: Maybe this should be over in python-ideas, since there is a proposal down the bottom of this message. But first the background... I've just wasted a silly amount of time debugging an issue that reall

Python 3 May Become Relevant Now

2015-08-02 Thread Mark Lawrence
rr should have a field day with this one http://nafiulis.me/python-3-may-become-relevant-now.html -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: GvR Europython keynote described on lwn.net

2015-08-02 Thread Rick Johnson
On Sunday, August 2, 2015 at 6:25:37 PM UTC-5, Chris Angelico wrote: > Wind the clock back to 2012, when Guido was working for Google. > Dropbox wants him. Is he going to refuse the job unless they *first* > get onto Py3, or is he going to accept the job with a view to > migrating them? Well, i do

Re: GvR Europython keynote described on lwn.net

2015-08-02 Thread Chris Angelico
On Mon, Aug 3, 2015 at 8:34 AM, Rick Johnson wrote: > On Sunday, August 2, 2015 at 3:05:09 AM UTC-5, Steven D'Aprano wrote: > >> If Dropbox were using Python 1.5, would you conclude that >> Python 2 was not worth developing in? > > No, if Dropbox were using py1.5, i would conclude that it was > be

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Cameron Simpson
On 02Aug2015 18:51, Cecil Westerhof wrote: On Sunday 2 Aug 2015 13:54 CEST, Ben Finney wrote: Cecil Westerhof writes: Because of this I think a human readable file would be best. I agree with that criterion; in the absence of compelling reasons otherwise, human-readable and -editable text

Re: GvR Europython keynote described on lwn.net

2015-08-02 Thread Rick Johnson
On Sunday, August 2, 2015 at 3:05:09 AM UTC-5, Steven D'Aprano wrote: > If Dropbox were using Python 1.5, would you conclude that > Python 2 was not worth developing in? No, if Dropbox were using py1.5, i would conclude that it was being managed by monkeys -- since Py1.5 existed before Dropbox w

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-02 Thread Larry Hudson via Python-list
On 08/01/2015 01:34 PM, Lukas Barth wrote: Hi! I have a list of numbers that I treat as "circular", i.e. [1,2,3] and [2,3,1] should be the same. Now I want to rotate these to a well defined status, so that I can can compare them. If all elements are unique, the solution is easy: find the mini

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Lele Gaifax
Cecil Westerhof writes: > Well, I would use nested data. (A file will have extra fields besides > the name.) That is why I was thinking about json. But I will look into > it. An alternative, very similar to JSON but with some good cherries picked from YAML is AXON, which is my preferite these da

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-02 Thread Tim Chase
On 2015-08-01 13:34, Lukas Barth wrote: > I have a list of numbers that I treat as "circular", i.e. [1,2,3] > and [2,3,1] should be the same. Now I want to rotate these to a > well defined status, so that I can can compare them. > > If all elements are unique, the solution is easy: find the minimu

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Cecil Westerhof
On Sunday 2 Aug 2015 13:54 CEST, Ben Finney wrote: > Cecil Westerhof writes: > >> Because of this I think a human readable file would be best. > > I agree with that criterion; in the absence of compelling reasons > otherwise, human-readable and -editable text is a good default. > >> Personally I

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Mark Lawrence
On 02/08/2015 12:54, Ben Finney wrote: Cecil Westerhof writes: Because of this I think a human readable file would be best. The “INI” format as handled by the Python ‘configparser’ module is what I would recommend for a simple flat configuration file. It is more intuitive to edit, and has a

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Ben Finney
Cecil Westerhof writes: > Because of this I think a human readable file would be best. I agree with that criterion; in the absence of compelling reasons otherwise, human-readable and -editable text is a good default. > Personally I do not find XML very readable. So a conf or json file > looks t

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-02 Thread pavlovevidence
On Saturday, August 1, 2015 at 1:34:44 PM UTC-7, Lukas Barth wrote: > Hi! > > I have a list of numbers that I treat as "circular", i.e. [1,2,3] and [2,3,1] > should be the same. Now I want to rotate these to a well defined status, so > that I can can compare them. > > If all elements are unique

Re: Most Pythonic way to store (small) configuration

2015-08-02 Thread Chris Angelico
On Sun, Aug 2, 2015 at 8:11 PM, Cecil Westerhof wrote: > Because of this I think a human readable file would be best. > Personally I do not find XML very readable. So a conf or json file > looks the most promising to me. And I would have a slight preference > for a json file. > > Any comments, tho

Most Pythonic way to store (small) configuration

2015-08-02 Thread Cecil Westerhof
There are a lot of ways to store configuration information: - conf file - xml file - database - json file - and possible a lot of other ways I want to write a Python program to display cleaned log files. I do not think I need a lot of configuration to be stored: - some things relating to the GUI -

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-02 Thread Steven D'Aprano
On Sun, 2 Aug 2015 08:51 am, Lukas Barth wrote: > On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote: >> Well, it looks to me that I don't know what a 'canonical rotation' is -- > > That's because it is not defined. ;) > > I need a way to rotate one of these lists in a way

Re: __main__ vs official module name: distinct module instances

2015-08-02 Thread Chris Angelico
On Sun, Aug 2, 2015 at 6:16 PM, Chris Angelico wrote: > On Sun, Aug 2, 2015 at 5:41 PM, Steven D'Aprano wrote: >> * if you don't wish to do that, you're screwed, and I think that the >> best you can do is program defensively by detecting the problem >> after the event and bailing out: >> >>

Re: __main__ vs official module name: distinct module instances

2015-08-02 Thread Chris Angelico
On Sun, Aug 2, 2015 at 5:41 PM, Steven D'Aprano wrote: > * if you don't wish to do that, you're screwed, and I think that the > best you can do is program defensively by detecting the problem > after the event and bailing out: > > # untested > import __main__ > import myactualfilename >

Re: GvR Europython keynote described on lwn.net

2015-08-02 Thread Steven D'Aprano
On Sun, 2 Aug 2015 04:57 am, Rick Johnson wrote: > On Saturday, August 1, 2015 at 12:45:45 AM UTC-5, Steven D'Aprano wrote: > >> > Yep, even the BDFL is actively developing in 2.7! He's no fool. >> >> Of course not. Dropbox pay him to work on their systems, >> and he wants to keep his job. > >

Re: __main__ vs official module name: distinct module instances

2015-08-02 Thread Steven D'Aprano
On Sun, 2 Aug 2015 01:53 pm, Cameron Simpson wrote: > Hi All, > > Maybe this should be over in python-ideas, since there is a proposal down > the bottom of this message. But first the background... > > I've just wasted a silly amount of time debugging an issue that really I > know about, but had