In article ,
Daniel Fetchinson wrote:
>>> what is the character limit on a one liner :P.
>>
>> For PEP 8 compliance, 80 characters. :-)
>
>Yeah, but we don't live in the 80's or 90's anymore and our screens
>can support xterms (or let alone IDE widows) much wider than 80
>characters. I'm using 14
On 04/06/11 01:07, Steven D'Aprano wrote:
> On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote:
> Personally, I find that the discipline of keeping to 80 characters is
> good for me. It reduces the temptation of writing obfuscated Python one-
> liners when two lines would be better. The
On the right hand side of my gmail window, Google posited that I might
be interested in "One-liner jokes". And I have to confess, the first
thing I thought of was "So I was writing a one-liner in assembly
and..."
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger writes:
> On Apr 5, 6:38 am, Daniel Fetchinson
> wrote:
> > Yeah, but we don't live in the 80's or 90's anymore and our screens
> > can support xterms (or let alone IDE widows) much wider than 80
> > characters. I'm using 140 for python these days. Seriously, who
> > would want
On Apr 5, 6:38 am, Daniel Fetchinson
wrote:
> >> what is the character limit on a one liner :P.
>
> > For PEP 8 compliance, 80 characters. :-)
>
> Yeah, but we don't live in the 80's or 90's anymore and our screens
> can support xterms (or let alone IDE widows) much wider than 80
> characters. I'm
On Wed, Apr 6, 2011 at 3:48 AM, Steven D'Aprano
wrote:
>> and has on occasion gone as far as 12-16.
>
> I would consider anything more than four indents a code smell. That is,
> four is unexceptional; five would make me look over the code to see if it
> could be refactored; six would make me look
what is the character limit on a one liner :P.
>>>
>>> For PEP 8 compliance, 80 characters. :-)
>>
>> Yeah, but we don't live in the 80's or 90's anymore and our screens can
>> support xterms (or let alone IDE widows) much wider than 80 characters.
>> I'm using 140 for python these days. Serio
On Wed, 06 Apr 2011 01:19:06 +1000, Chris Angelico wrote:
> On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano
> wrote:
>> On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote:
>>
>>> Seriously, who would want to limit
>>> him/herself to 80 characters in 2011?
>>
>> Seriously, or is that a rh
On Tue, 2011-04-05 at 15:38 +0200, Daniel Fetchinson wrote:
> Yeah, but we don't live in the 80's or 90's anymore and our screens
> can support xterms (or let alone IDE widows) much wider than 80
> characters. I'm using 140 for python these days. Seriously, who would
> want to limit him/herself to
On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano
wrote:
> On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote:
>
>> Seriously, who would want to limit
>> him/herself to 80 characters in 2011?
>
> Seriously, or is that a rhetorical question?
>
> People who like to have two source files side-
On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote:
>>> what is the character limit on a one liner :P.
>>
>> For PEP 8 compliance, 80 characters. :-)
>
> Yeah, but we don't live in the 80's or 90's anymore and our screens can
> support xterms (or let alone IDE widows) much wider than 80
>> what is the character limit on a one liner :P.
>
> For PEP 8 compliance, 80 characters. :-)
Yeah, but we don't live in the 80's or 90's anymore and our screens
can support xterms (or let alone IDE widows) much wider than 80
characters. I'm using 140 for python these days. Seriously, who would
w
Chris Angelico writes:
>> def f(x,n,w): return x if n==1 else\
>> (lambda x0=f(x[::2],n/2,w[::2]),\
>> x1=f(x[1::2],n/2,w[::2]): reduce(lambda a,b: a+b ,\
>> zip(*[(x0[k]+w[k]*x1[k],\
>> x0[k]-w[k]*x1[k
On 4/4/2011 3:16 PM Gregory Ewing said...
Chris Angelico wrote:
(Remind me how it is that Python code is more readable than line noise
or Perl code?)
Crazy thought: I wonder if Perl programmers have "multi
line Perl" competitions where they laugh their heads off
at how readable the code is, a
On Tue, Apr 5, 2011 at 8:16 AM, Gregory Ewing
wrote:
> Chris Angelico wrote:
>
> Crazy thought: I wonder if Perl programmers have "multi
> line Perl" competitions where they laugh their heads off
> at how readable the code is, and how nobody in their
> right mind would ever write Perl code that wa
Chris Angelico wrote:
(Remind me how it is that Python code is more readable than line noise
or Perl code?)
Crazy thought: I wonder if Perl programmers have "multi
line Perl" competitions where they laugh their heads off
at how readable the code is, and how nobody in their
right mind would eve
On Tue, Apr 5, 2011 at 6:09 AM, gb wrote:
> harrismh777 writes:
>
>> Seriously, these little one liners teach me more about the python
>> language in less time than [...]
>
> def f(x,n,w): return x if n==1 else\
> (lambda x0=f(x[::2],n/2,w[::2]),\
> x1=f(x[1::2],n/2,w[::2]): reduce(
harrismh777 writes:
> Seriously, these little one liners teach me more about the python
> language in less time than [...]
def f(x,n,w): return x if n==1 else\
(lambda x0=f(x[::2],n/2,w[::2]),\
x1=f(x[1::2],n/2,w[::2]): reduce(lambda a,b: a+b ,\
Martin De Kauwe wrote:
what is the character limit on a one liner :P.
For PEP 8 compliance, 80 characters. :-)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 30, 2:19 am, Martin De Kauwe wrote:
> what is the character limit on a one liner :P. Very interesting
> jesting apart, any more?
Sure, here are three one-liners using itertools.groupby() to emulate
some Unix pipelines:
sort letters | uniq # list unique values
sort letters | uniq
On Wed, Mar 30, 2011 at 8:19 PM, Martin De Kauwe wrote:
> what is the character limit on a one liner :P. Very interesting
> jesting apart, any more?
Not sure if this can be redone as a one-liner; currently it's two.
for i in range(3):
print '\n\t"'+("minor","medium","major")[i]+'
":({\n\t\t
what is the character limit on a one liner :P. Very interesting
jesting apart, any more?
--
http://mail.python.org/mailman/listinfo/python-list
On 3/29/2011 5:50 AM, Raymond Hettinger wrote:
from collections import Counter
from itertools import product
print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum,
product(range(6), repeat=8))).items(
The line break makes that hard to read; the axis is not labeled (and
labels he
Raymond Hettinger wrote:
almost-normally-yours,
Raymond
thanks ... interesting
Seriously, these little one liners teach me more about the python
language in less time than *all* of the books I'm trying to digest right
now. The toughest part of learning python is learning about what's
avai
On Tue, Mar 29, 2011 at 11:24 AM, Raymond Hettinger wrote:
print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum,
product(range(6), repeat=8))).items(
>
>
>
>
>
>
>
>
> *
> ***
> *
>
>
> **
> *
> ***
>>> print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum,
>>> product(range(6), repeat=8))).items(
*
***
*
**
*
*
**
http://www.ideone.com/infch
^ Result of the below code
On 29 March 2011 19:50, Raymond Hettinger wrote:
> from collections import Counter
> from itertools import product
>
> print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum,
> product(range(6), repeat=8))).items(
>
>
> almost-n
27 matches
Mail list logo