[Tutor] The sane default choice is entry_points console_scripts Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread Thomas Güttler
Am 08.08.2017 um 12:56 schrieb Chris Warrick: On 8 August 2017 at 03:30, Ben Finney wrote: Thomas Güttler writes: Why is "the sane default is 'use console_scripts entry-point in setup.py'" not a good answer? Because third-party Setuptools is required for entry points, which means entry p

[Tutor] What exactly does the three dots do? Why such as thing?

2017-08-09 Thread C W
Dear Python experts, What exactly does the three dots do? > aList = ... > type(pList) ellipsis It's an ellipsis, a spot holder to later. But what data type is it: vector, matrix? In every other language, you initialize a variable you want to use. What's the point of ellipsis? Thanks! __

Re: [Tutor] Tutor Digest, Vol 162, Issue 25

2017-08-09 Thread Jaroslaw Michalski
> > > The machine I'm on here is writing big endian UTF-16 and UTF-32. > > > > As you note, the 16 and 32 forms are (6 + 1) times 2 or 4 respectively. This > > is because each encoding has a leading byte order marker to indicate the big > > endianness or little endianness. For big endian data that

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread Steven D'Aprano
On Tue, Aug 08, 2017 at 12:56:56PM +0200, Chris Warrick wrote: > While setuptools is not officially part of the stdlib, This is the critical factor. How can you use *by default* something that is *NOT* supplied by default? Obviously you cannot. It is physically impossible. > it *is* > recomme

Re: [Tutor] If tuple cannot be sorted, then why sorted() on a tuple is fine?

2017-08-09 Thread C W
This is a follow up. I actually ran into this today: import numpy as np xArray = np.ones((3, 4)) > xArray.shape (3, 4) > np.shape(xArray) (3, 4) It was confusing to see that both xArray.shape and np.shape() worked. Are they equivalent? In the case of sort() vs sorted(), they are different, but

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread Alan Gauld via Tutor
On 09/08/17 22:15, Steven D'Aprano wrote: > On Tue, Aug 08, 2017 at 12:56:56PM +0200, Chris Warrick wrote: > >> While setuptools is not officially part of the stdlib, > > This is the critical factor. How can you use *by default* something that > is *NOT* supplied by default? I have to agree wit

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread eryk sun
On Wed, Aug 9, 2017 at 11:32 PM, Alan Gauld via Tutor wrote: > On 09/08/17 22:15, Steven D'Aprano wrote: >> >> This is the critical factor. How can you use *by default* something that >> is *NOT* supplied by default? > > I have to agree with Steven here. Any mature language should > ship with all