Re: How to add a built-in library in pyhton

2017-03-17 Thread Lutz Horn
Am 17.03.2017 05:08 schrieb chenchao: I use python2.7.10 and want to add a c language library in python. So how can i built it as a built-in module in python? Why do you want to build it as a built-in module? Why not a simple module as described on https://docs.python.org/2/extending/index.

Re: Dynamically replacing an objects __class__; is it safe?

2017-03-17 Thread Tony van der Hoff
On 17/03/17 04:18, Gregory Ewing wrote: Dennis Lee Bieber wrote: I'd say satellites do "not" fly, as they have no force/action opposing the fall caused by the pull of gravity. Arrows, bullets, thrown stones, etc. are often said to be flying. Seems to me the word gets applied to anything t

__del__ is not called after creating a new reference

2017-03-17 Thread Oleg Nesterov
I started to learn python a few days ago and I am trying to understand what __del__() actually does. https://docs.python.org/3/reference/datamodel.html says: object.__del__(self) ... Note that it is possible (though not recommended!) for the __del__() method to post

Re: __del__ is not called after creating a new reference

2017-03-17 Thread Terry Reedy
On 3/17/2017 10:54 AM, Oleg Nesterov wrote: I started to learn python a few days ago and I am trying to understand what __del__() actually does. https://docs.python.org/3/reference/datamodel.html says: object.__del__(self) ... Note that it is possible (though not recommen

Re: __del__ is not called after creating a new reference

2017-03-17 Thread Oleg Nesterov
On 03/17, Terry Reedy wrote: > > On 3/17/2017 10:54 AM, Oleg Nesterov wrote: >> I started to learn python a few days ago and I am trying to understand what >> __del__() actually does. https://docs.python.org/3/reference/datamodel.html >> says: >> >> object.__del__(self) >> ... >> Not

Re: Dynamically replacing an objects __class__; is it safe?

2017-03-17 Thread jladasky
On Thursday, March 16, 2017 at 9:27:56 PM UTC-7, Gregory Ewing wrote: > Chris Angelico wrote: > > Maybe what the ISS does isn't flying - it's falling with style? > > Yep. They didn't really launch it into orbit with rockets, > that was all faked. They actually hauled it up there with > a crane, le

Re: Dynamically replacing an objects __class__; is it safe?

2017-03-17 Thread Chris Angelico
On Sat, Mar 18, 2017 at 8:24 AM, wrote: > On Thursday, March 16, 2017 at 9:27:56 PM UTC-7, Gregory Ewing wrote: >> Chris Angelico wrote: >> > Maybe what the ISS does isn't flying - it's falling with style? >> >> Yep. They didn't really launch it into orbit with rockets, >> that was all faked. The

Re: Dynamically replacing an objects __class__; is it safe?

2017-03-17 Thread jladasky
On Thursday, March 16, 2017 at 7:07:17 PM UTC-7, Deborah Swanson wrote: > Steve D'Aprano wrote,on March 16, 2017 5:07 AM > > > > On Thu, 16 Mar 2017 09:03 am, Gregory Ewing wrote: > > > > > Steve D'Aprano wrote: > > >> You probably can't make a whale fly just by changing the class to > > >> bird

Who are the "spacists"?

2017-03-17 Thread Mikhail V
So Python supports both spaces and tabs for indentation. I just wonder, why not forbid spaces in the beginning of lines? How would one come to the idea to use spaces for indentation at all? Space is not even a control/format character, but a word separator. And when editors will be proportional f

Re: Who are the "spacists"?

2017-03-17 Thread Joel Goldstick
On Fri, Mar 17, 2017 at 8:52 PM, Mikhail V wrote: > So Python supports both spaces and tabs for indentation. > > I just wonder, why not forbid spaces in the beginning of lines? > How would one come to the idea to use spaces for indentation at all? > > Space is not even a control/format character,

Re: Who are the "spacists"?

2017-03-17 Thread Ben Finney
Mikhail V writes: > I just wonder, why not forbid spaces in the beginning of lines? > How would one come to the idea to use spaces for indentation at all? Those are two very different questions. I think you may be under the false impression that the decision you refer to was made in a vacuum. T

Re: Who are the "spacists"?

2017-03-17 Thread William Ray Wing
> On Mar 17, 2017, at 8:52 PM, Mikhail V wrote: > > So Python supports both spaces and tabs for indentation. > > I just wonder, why not forbid spaces in the beginning of lines? > How would one come to the idea to use spaces for indentation at all? > That convention dates all the way back to t