In article mailman.46.1302010711.9059.python-l...@python.org,
Daniel Fetchinson fetchin...@googlemail.com 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
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
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
want
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
On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info 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
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 80
On Wed, 06 Apr 2011 01:19:06 +1000, Chris Angelico wrote:
On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info 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?
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
On Wed, Apr 6, 2011 at 3:48 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info 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
On Apr 5, 6:38 am, Daniel Fetchinson fetchin...@googlemail.com
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
Raymond Hettinger pyt...@rcn.com writes:
On Apr 5, 6:38 am, Daniel Fetchinson fetchin...@googlemail.com
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
harrismh777 harrismh...@charter.net 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 ,\
On Tue, Apr 5, 2011 at 6:09 AM, gb g...@cabiate.it wrote:
harrismh777 harrismh...@charter.net 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]),\
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 ever
On Tue, Apr 5, 2011 at 8:16 AM, Gregory Ewing
greg.ew...@canterbury.ac.nz 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
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,
Chris Angelico ros...@gmail.com 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],\
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 Wed, Mar 30, 2011 at 8:19 PM, Martin De Kauwe mdeka...@gmail.com 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]+'
On Mar 30, 2:19 am, Martin De Kauwe mdeka...@gmail.com 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
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
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-normally-yours,
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
http://www.ideone.com/infch
^ Result of the below code
On 29 March 2011 19:50, Raymond Hettinger pyt...@rcn.com 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(
print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum,
product(range(6), repeat=8))).items(
*
***
*
**
*
*
On Tue, Mar 29, 2011 at 11:24 AM, Raymond Hettinger pyt...@rcn.com wrote:
print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum,
product(range(6), repeat=8))).items(
*
***
*
**
*
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
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
28 matches
Mail list logo