[Python-ideas] Add optional defaults to namedtuple

2016-11-30 Thread Jelte Fennema
It would be nice to have a supported way to add defaults to namedtuple, so 
the slightly hacky solution here does not have to be 
used: http://stackoverflow.com/a/18348004/2570866

Jelte
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] PEP8 dictionary indenting addition

2016-10-08 Thread Jelte Fennema
Alright, I'll make one when I have some time in the near future.

On 8 Oct 2016 10:08 pm, "Guido van Rossum"  wrote:

> Makes sense, maybe you can send a PR to the Python/peps repo?
>
> --Guido (mobile)
>
> On Oct 8, 2016 12:27 PM, "Jelte Fennema"  wrote:
>
>> I have an idea to improve indenting guidelines for dictionaries for
>> better readability: If a value in a dictionary literal is placed on a new
>> line, it should have (or at least be allowed to have) a n additional
>> hanging indent.
>>
>> Below is an example:
>>
>> mydict = {'mykey':
>>   'a very very very very very long value',
>>   'secondkey': 'a short value',
>>   'thirdkey': 'a very very very '
>>   'long value that continues on the next line',
>> }
>>
>>
>> As opposed to this IMHO much less readable version:
>>
>> mydict = {'mykey':
>>   'a very very very very very long value',
>>   'secondkey': 'a short value',
>>   'thirdkey': 'a very very very '
>>   'long value that continues on the next line',
>> }
>>
>> As you can see it is much harder in the second version to distinguish
>> between keys and values.
>>
>>
>> ___
>> Python-ideas mailing list
>> Python-ideas@python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] PEP8 dictionary indenting addition

2016-10-08 Thread Jelte Fennema
I have an idea to improve indenting guidelines for dictionaries for better
readability: If a value in a dictionary literal is placed on a new line, it
should have (or at least be allowed to have) a n additional hanging indent.

Below is an example:

mydict = {'mykey':
  'a very very very very very long value',
  'secondkey': 'a short value',
  'thirdkey': 'a very very very '
  'long value that continues on the next line',
}


As opposed to this IMHO much less readable version:

mydict = {'mykey':
  'a very very very very very long value',
  'secondkey': 'a short value',
  'thirdkey': 'a very very very '
  'long value that continues on the next line',
}

As you can see it is much harder in the second version to distinguish
between keys and values.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/