[Python-ideas] Remember the Vasa

2018-06-18 Thread Paddy3118
I thought it might be helpful for the Python community to be aware of the growth issues that the C++ community has/is discussing, at the moment. I am *not *saying we have those same issues, but we might know to avoid similar issues in our future? Here's and letter: http://open-std.org/JTC1/S

Re: [Python-ideas] Remember the Vasa

2018-06-18 Thread Greg Ewing
Paddy3118 wrote: Here's and letter: http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0977r0.pdf This is why it's important for a language to have a BDFL. -- Greg ___ Python-ideas mailing list [email protected] https://mail.python.org/mail

Re: [Python-ideas] [issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Karthikeyan
> BTW. “cp874” does exist according to the unicode consortium: https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT, and appears to be a codepage for a (the?) Thai language. The user might therefore be running Windows with a Thai locale. This page

Re: [Python-ideas] [issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Ronald Oussoren
> On 18 Jun 2018, at 02:34, Steven D'Aprano wrote: > >> Sure, but for at least one user Python 3.6 fails to start because >> initialising the sys.std* streams fails due to not finding a “874” >> encoding. > > That doesn't mean that the bug is best fixed by adding an alias. I agree, I’ve men

Re: [Python-ideas] Remember the Vasa

2018-06-18 Thread Antoine Pitrou
On Mon, 18 Jun 2018 03:49:35 -0700 (PDT) Paddy3118 wrote: > I thought it might be helpful for the Python community to be aware of the > growth issues that the C++ community has/is discussing, at the moment. I am > *not > *saying we have those same issues, but we might know to avoid similar > i

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Mikhail V
On Mon, Jun 18, 2018 at 4:12 AM, Chris Angelico wrote: > On Mon, Jun 18, 2018 at 10:50 AM, Steven D'Aprano wrote: items[-0:] # failed parallel > ['spam', 'ham', 'foo', 'bar', 'quux'] > > So you use -1 in slices to parallel 1 (unlike using ~1 as with > indexing), and everything works *except

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 5:51 AM, Mikhail V wrote: > On Mon, Jun 18, 2018 at 4:12 AM, Chris Angelico wrote: >> On Mon, Jun 18, 2018 at 10:50 AM, Steven D'Aprano >> wrote: > > items[-0:] # failed parallel >> ['spam', 'ham', 'foo', 'bar', 'quux'] >> >> So you use -1 in slices to parallel 1 (un

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Joao S. O. Bueno
Yes - maybe a proposal to have the MutableSequence protocol to define "<<" as "append" would be something with more traction than the original proposal here. No chanegs needed to to the language core, and a = [1,2, 3] a <<= 4 resulting in a == [1, 2, 3, 4] is quite readable, syntactically valid,

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Michael Selik
On Mon, Jun 18, 2018 at 12:56 PM Mikhail V wrote: > Numpy arrays have also append() and insert() methods, > In [2]: np.arange(1).append(2) AttributeError: 'numpy.ndarray' object has no attribute 'append' In [3]: np.arange(1).insert AttributeError: 'numpy.ndarray' object has no attribute 'insert

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Mikhail V
On Mon, Jun 18, 2018 at 11:43 PM, Michael Selik wrote: > On Mon, Jun 18, 2018 at 12:56 PM Mikhail V wrote: >> >> Numpy arrays have also append() and insert() methods, > > In [2]: np.arange(1).append(2) > AttributeError: 'numpy.ndarray' object has no attribute 'append' > https://docs.scipy.org/do

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Steven D'Aprano
On Mon, Jun 18, 2018 at 05:07:45PM -0300, Joao S. O. Bueno wrote: > a = [1,2, 3] > a <<= 4 > resulting in a == [1, 2, 3, 4] is quite readable Not as readable as a.append(4), which works today and doesn't require the user to memorise the special case that <<= works on lists but (presumably) <<

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Juancarlo Añez
> The idea is to introduce new syntax for the list.append() method. > > > Syntax: > > Variant 1. > Use special case of index, namely omitted index: > > mylist[] = item > For all practical purpose, it would be enough to define that the expression: mylist += [item] gets optimized to mylist.ap

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Michael Selik
On Mon, Jun 18, 2018 at 5:52 PM Juancarlo Añez wrote: > The idea is to introduce new syntax for the list.append() method. >> >> mylist[] = item >> > > For all practical purpose, it would be enough to define that the > expression: > > mylist += [item] > > gets optimized to mylist.append(item).

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Juancarlo Añez
>> For all practical purpose, it would be enough to define that the >> expression: >> >> mylist += [item] >> >> gets optimized to mylist.append(item). >> > > Unfortunately, that would create yet another special case of operators > breaking the rules. Most operators invoke magic methods. This would

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Michael Selik
On Mon, Jun 18, 2018 at 2:55 PM Mikhail V wrote: > On Mon, Jun 18, 2018 at 11:43 PM, Michael Selik wrote: > > On Mon, Jun 18, 2018 at 12:56 PM Mikhail V wrote: > >> Numpy arrays have also append() and insert() methods, > > In [2]: np.arange(1).append(2) > > AttributeError: 'numpy.ndarray' objec

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Michael Selik
On Mon, Jun 18, 2018 at 6:20 PM Juancarlo Añez wrote: > For all practical purpose, it would be enough to define that the >>> expression: >>> >>> mylist += [item] >>> >>> gets optimized to mylist.append(item). >>> >> >> Unfortunately, that would create yet another special case of operators >> brea

Re: [Python-ideas] Fwd: Trigonometry in degrees

2018-06-18 Thread Chris Barker via Python-ideas
On Sat, Jun 16, 2018 at 10:57 PM, Tim Peters wrote: Ya, decimal fp doesn't really solve anything except the shallow surprise > that decimal fractions generally aren't exactly representable as binary > fractions. Which is worth a whole lot for casual users, but doesn't > address any of the deep p

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-18 Thread Michael Selik
On Mon, Jun 18, 2018, 6:59 PM Michael Selik wrote: > > if isinstance(v, ParseResults): > if v: > s = v.dump(indent, depth + 1) > else: > s = _ustr(v) > else: > s = repr(v) >

Re: [Python-ideas] Fwd: Trigonometry in degrees

2018-06-18 Thread Matt Arcidy
On Mon, Jun 18, 2018, 19:25 Chris Barker via Python-ideas < [email protected]> wrote: > On Sat, Jun 16, 2018 at 10:57 PM, Tim Peters wrote: > > Ya, decimal fp doesn't really solve anything except the shallow surprise >> that decimal fractions generally aren't exactly representable as binary

Re: [Python-ideas] Fwd: Trigonometry in degrees

2018-06-18 Thread Robert Kern
On 6/18/18 19:23, Chris Barker via Python-ideas wrote: On Sat, Jun 16, 2018 at 10:57 PM, Tim Peters > wrote: Ya, decimal fp doesn't really solve anything except the shallow surprise that decimal fractions generally aren't exactly representable as binary