Phlip schreef:
> Nobody wrote:
>> Writing robust software from the outset puts you at a competitive
>> disadvantage to those who understand how the system works.
>
> And I, not my language, should pick and chose how to be rigorous. The
> language
> should not make the decision for me.
You can a
On Jan 6, 12:12 pm, Phlip wrote:
> Nobody wrote:
> > Writing robust software from the outset puts you at a competitive
> > disadvantage to those who understand how the system works.
>
> And I, not my language, should pick and chose how to be rigorous. The language
> should not make the decision fo
Phlip wrote:
> And I, not my language, should pick and chose how to be rigorous. The language
> should not make the decision for me.
Since you seem unwilling to put the minimal effort into producing the
support code you'd need to work with Python the way you want, perhaps
Perl might be more to yo
Le Wed, 06 Jan 2010 12:12:08 -0800, Phlip a écrit :
>
> And I, not my language, should pick and chose how to be rigorous. The
> language should not make the decision for me.
And that's why there is the "try: ... except: ..." construct.
Your rant is getting tiring.
--
http://mail.python.org/mai
On Wed, 06 Jan 2010 12:12:08 -0800, Phlip wrote:
> And I, not my language, should pick and chose how to be rigorous. The
> language should not make the decision for me.
All languages make that decision for you by making some thing possible
and other things not. The language designer, not the pro
Nobody wrote:
On Tue, 05 Jan 2010 19:46:01 -0800, alex23 wrote:
They will tell me how to use except: (which is a good example why a
program should not use exceptions for its normal control flow if at
all possible).
Really? Magic functions that coerce and eat errors are a better coding
techniqu
On Tue, 05 Jan 2010 19:46:01 -0800, alex23 wrote:
>> They will tell me how to use except: (which is a good example why a
>> program should not use exceptions for its normal control flow if at
>> all possible).
>
> Really? Magic functions that coerce and eat errors are a better coding
> technique
On Jan 5, 2:40 pm, Phlip wrote:
> On Jan 5, 1:10 pm, Antoine Pitrou wrote:
>
> >http://docs.python.org/library/functions.html
>
> > Don't forget that the Python documentation is rich and structured.
> > And good luck.
>
> Does it say how to convert a string containing either an integer
> represen
On Tue, 05 Jan 2010 12:20:58 -0800, Marco Nawijn wrote:
> You could use the build-in function enumerate inside a list
> comprehension.
>
seq = range(5)
[ (i,s) for i,s in enumerate(seq) ]
> [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]
Just use list(), i.e. "list(enumerate(seq))".
--
http
Steven D'Aprano wrote:
> Stick around and you might learn something,
> but if you bite every time somebody tries to teach you, you'll soon run
> out of people willing to help you.
The ongoing crowdsourced development by this group of "Victor
Subervi's" project would seem to indicate that this isn
On Tue, 05 Jan 2010 15:30:09 -0800, Phlip wrote:
>> > Does it say how to convert a string containing either an integer
>> > representation, or something alphabetic, into an integer, or a zero,
>> > in like 1 method call? (No except: ?)
>>
>> If you mean something like this:
>>
>> >>> int('153')
>>
Phlip wrote:
> They will tell me how to use except: (which is a good example why a
> program should not use exceptions for its normal control flow if at
> all possible).
Really? Magic functions that coerce and eat errors are a better coding
technique than exceptions and explicit handling?
What k
Antoine Pitrou wrote:
The point: int('') or int('something') both throw an error. In general,
this is hand-holding, but in specific I don't think the "rich and
structured" documentation will cover how to beat a 0 out of it in less
than 3 lines.
Because it's a bad idea to do so and Python doesn'
> The point: int('') or int('something') both throw an error. In general,
> this is hand-holding, but in specific I don't think the "rich and
> structured" documentation will cover how to beat a 0 out of it in less
> than 3 lines.
Because it's a bad idea to do so and Python doesn't encourage such
On Jan 5, 2010, at 4:30 PM, Phlip wrote:
The point: int('') or int('something') both throw an error. In
general, this is hand-holding, but in specific I don't think the "rich
and structured" documentation will cover how to beat a 0 out of it in
less than 3 lines. So I will persist in my idio
> > Does it say how to convert a string containing either an integer
> > representation, or something alphabetic, into an integer, or a zero, in
> > like 1 method call? (No except: ?)
>
> If you mean something like this:
>
> >>> int('153')
>
> 153
The point: int('') or int('something') both throw
On Tue, 05 Jan 2010 14:40:49 -0800, Phlip wrote:
> On Jan 5, 1:10 pm, Antoine Pitrou wrote:
>
>> http://docs.python.org/library/functions.html
>>
>> Don't forget that the Python documentation is rich and structured. And
>> good luck.
>
> Does it say how to convert a string containing either an
On Jan 5, 1:10 pm, Antoine Pitrou wrote:
> http://docs.python.org/library/functions.html
>
> Don't forget that the Python documentation is rich and structured.
> And good luck.
Does it say how to convert a string containing either an integer
representation, or something alphabetic, into an integ
>> Couldn't you just use the built-in enumerate() to replace the whole
>> thing?
>
> Because that would involve, like, reading an entire Python book just to
> locate that method?
Actually, no. It just involves reading one of the most important pages in
the documentation, the page which describ
> > My Pythonic sequencing skills are obviously feeble. Can anything think
> > of a way to write that in fewer lines?
Thanks, all!
> Couldn't you just use the built-in enumerate() to replace the whole thing?
Because that would involve, like, reading an entire Python book just
to locate that meth
On Jan 5, 8:58 pm, Phlip wrote:
> Hypo Nt:
>
> def each_with_index(seq):
> index = 0
> result = []
>
> for item in seq:
> result.append([item, index])
> index += 1
>
> return result
>
> My Pythonic sequencing skills are obviously feeble. Can anything think
> of a way to
Phlip wrote:
> Hypo Nt:
>
> def each_with_index(seq):
> index = 0
> result = []
>
> for item in seq:
> result.append([item, index])
> index += 1
>
> return result
>
> My Pythonic sequencing skills are obviously feeble. Can anything think
> of a way to write that in f
On Jan 6, 8:58 am, Phlip wrote:
> Hypo Nt:
>
> def each_with_index(seq):
> index = 0
> result = []
>
> for item in seq:
> result.append([item, index])
> index += 1
>
> return result
>
> My Pythonic sequencing skills are obviously feeble. Can anything think
> of a way to
Hypo Nt:
def each_with_index(seq):
index = 0
result = []
for item in seq:
result.append([item, index])
index += 1
return result
My Pythonic sequencing skills are obviously feeble. Can anything think
of a way to write that in fewer lines?
--
Phlip
http://c2.com/c
24 matches
Mail list logo