On 2010-11-05, Ethan Furman et...@stoneleaf.us wrote:
The verifiable benefit for me is ease of use, ease of thought, ease of
typing... I realize these are not benefits for everyone, but they are
for some -- and I would venture a guess that the ease of thought benefit
is one of the primary
On 2010-11-05, D'Arcy J.M. Cain da...@druid.net wrote:
The simple fact is that the combination of your tools and Python is
broken. The combination of my tools and Python is not. That's lucky
for me since I really, really like IAS. That's unlucky for people who
have to work with tools that
On 2010-11-05, Grant Edwards inva...@invalid.invalid wrote:
On 2010-11-05, Seebs usenet-nos...@seebs.net wrote:
On 2010-11-05, Emile van Sebille em...@fenx.com wrote:
So, which of your tools are you married to that are causing your issues?
Python.
I think you should quit using Python
On 2010-11-05, Nobody nob...@nowhere.com wrote:
However, it's still written for language lawyers.
IMHO, the lack of a reference manual for the language itself is a major
hole in Python's documentation.
I'm a bit lost here. Could you highlight some of the differences
between a reference
On 2010-11-06, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Fri, 05 Nov 2010 18:45:39 +, Seebs wrote:
On 2010-11-05, Steven D'Aprano st...@remove-this-cybersource.com.au
wrote:
Well there's your problem -- you are relying on tools that operate by
magic.
Wrong.
Really
ridiculous to suggest that people should need to change
away from tools which currently suit them fine.
Why is it the responsibility of the programming language syntax to
correct the problem with Seebs' faulty mail server?
It's not. And honestly, if it were just one misconfigured mail server,
no one
On 2010-11-06, Philip Semanchuk phi...@semanchuk.com wrote:
The former refers to something that programmers would use to learn
the language once they've gone through the tutorial a few times.
The latter is great for writing a Python parser but isn't the
friendliest guide to language constructs.
On 2010-11-06, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Fri, 05 Nov 2010 08:17:02 +0530, Rustom Mody wrote:
However the original question -- mixing tabs and spaces is bad -- has
got lost in the flames. Do the most die-hard python fanboys deny this?
And if not is it
On 2010-11-04, Steven D'Aprano steve-remove-t...@cybersource.com.au wrote:
And people have suggested that if your workflow leads to indentation
being mangled and your source code no longer running, the solution is to
change the workflow.
Yup.
But it strikes me as unmistakably a shortcoming
On 2010-11-04, Mark Wooding m...@distorted.org.uk wrote:
Seebs usenet-nos...@seebs.net writes:
Python's the only language I use where an obvious flaw, which is
repeatedly observed by everyone I know who uses the language, is
militantly and stridently defended by dismissing, insulting
On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote:
Right. If you mangle spaces in Python or mangle braces in C then
recovery becomes impossible. I don't think anyone is contesting that.
What we question is the idea that somehow Python is special in this
regard. If you move files around
On 2010-11-04, Grant Edwards inva...@invalid.invalid wrote:
It exists because so many people change whitespace intentionally in C
source code because no two C programmers seem able to agree on how to
format code. Diff -b allows you to attempt to ignore semantically
null stylistic changes made
On 2010-11-04, Terry Reedy tjre...@udel.edu wrote:
I am sorry you feel compelled to use a language you so dislike. Not our
fault though.
I don't dislike it all that much. What I dislike is being told that the
problems don't exist.
If you add the normally redundant information in the form of
On 2010-11-03, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Wed, 03 Nov 2010 02:40:11 +, Seebs wrote:
Sure, but there's also no way for you to spot that something looks
suspicious. In Python, if something is misindented, it does what you
told it to do, and there's no way
On 2010-11-03, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Wed, 03 Nov 2010 01:25:56 +, Seebs wrote:
Whitespace damage is, indeed, wrong. It's a bad thing. It is an
*extremely common* bad thing,
I question that.
You've claimed that you have to deal with broken
On 2010-11-03, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Tue, 02 Nov 2010 19:26:56 +, Tim Harig wrote:
I agree with Seebs, Python is the only language I know that promotes the
use of spaces over tabs;
Really?
Yes.
I'm not aware of *any* language that promotes tabs
On 2010-11-03, Grant Edwards inva...@invalid.invalid wrote:
On 2010-11-03, Seebs usenet-nos...@seebs.net wrote:
Explicit is better than implicit. It is *better* to explicitly mark the
ends of things than to have it be implicit in dropping indentation. That's
not a burden, it's good
On 2010-11-03, Steven D'Aprano steve-remove-t...@cybersource.com.au wrote:
Yes. How does that contradict what I said?
Once you understand that you do have to break the rules occasionally,
it is a good idea to design things that will be robust when the rules
are broken.
Ah, argument by
On 2010-11-03, Steven D'Aprano steve-remove-t...@cybersource.com.au wrote:
On Wed, 03 Nov 2010 20:30:43 +, Seebs wrote:
I'm not expecting it to change;
Then why talk about it?
Because I find technical questions interesting in and of themselves. I
will happily talk with people about
On 2010-11-03, Michael Torrie torr...@gmail.com wrote:
I suggest, then that Pascal or Ruby would suit your needs better than
Python.
In the absence of network effects, I'd just be using Ruby. I have reason
to work with projects that have a lot of existing Python, though, so I
use it too.
As
On 2010-11-04, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message slrnid0ked.t7k.usenet-nos...@guild.seebs.net, Seebs wrote:
It is extremely useful to me to have spaces converted to tabs
for every other file I edit.
I???m thinking of going the other way. After many years
On 2010-11-04, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message slrnid0pgs.1028.usenet-nos...@guild.seebs.net, Seebs wrote:
The answer is because whitespace changes (spaces to tabs, different
tab stops, etcetera) are an extremely common failure mode, such that
it's quite
On 2010-11-02, brf...@gmail.com brf...@gmail.com wrote:
How exactly does this relate to python?
1. It doesn't. It's spam. Duh.
2. Don't respond to spam.
3. Don't top-post.
4. If I see even one more post from you where the entire previous post
is quoted under your text, I will plonk you. I
On 2010-11-02, D'Arcy J.M. Cain da...@druid.net wrote:
You have problems. Indentation as syntax isn't one of them.
In the absence of indentation as syntax, they haven't bugged me.
No one
knows why email is being magically transformed?
Yay for a large company IT department with both MS and
On 2010-11-02, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
I've lost more time to reading people's bitching about indentation than I
have dealing with indentation problems.
Doesn't totally surprise me. :)
But then, I don't insist on using tools which are broken by design.
On 2010-11-02, Grant Edwards inva...@invalid.invalid wrote:
True, but the fact that diff has an option that for Python sources
will produces useless results doesn't seem like a valid indictment of
Python's syntax and semantics.
The question is *why* diff has that option.
The answer is because
On 2010-11-02, Grant Edwards inva...@invalid.invalid wrote:
And you think compatibility with your broken e-mail server is a good
reason to change the syntax of a programming language?
No. I never said that.
Many editors helpfully convert spaces to tabs by default some or all
of the time.
On 2010-11-02, Emile van Sebille em...@fenx.com wrote:
What is right is that there's no question that quux is subsequent to baz
in all cases barring exceptions (and assuming no tabs intermixed)
Yes, but that doesn't mean it does what the programmer intended, just
that it does what it does.
On 2010-11-02, D'Arcy J.M. Cain da...@druid.net wrote:
Large is no excuse for incompetency.
It is in practice.
So configure it to recognize Python files and act accordingly.
So far as I know, it doesn't have a feature to do this. In any event,
I work around it okay.
No, they aren't.
On 2010-11-02, Tim Harig user...@ilthio.net wrote:
This is Python's most noticable blemish outside of the community.
Everybody knows that Python is the language that forces you to use a
particular style of formatting; and, that is a turn-off for many people.
Honestly, I could probably live
On 2010-11-02, Grant Edwards inva...@invalid.invalid wrote:
Huh? Indentation is invisible? You can't see the indentation in
Python source code?
The difference between tabs and spaces is invisible on a great
number of the devices on which people display code.
Indentation is visible, but the
On 2010-11-03, D'Arcy J.M. Cain da...@druid.net wrote:
On 03 Nov 2010 01:20:40 GMT
Seebs usenet-nos...@seebs.net wrote:
However, I have probably seen all of two or three bugs ever related to
mis-indented C, and I've had various things screw up or wreck indentation
Really? I have never seen
On 2010-11-02, Ben Ahrens bahr...@gmail.com wrote:
I did indeed continue to top-post, and you should plonk me.
Edited for accuracy. Done.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net
http://www.seebs.net/log/ -- lawsuits, religion, and funny pictures
On 2010-11-01, Grant Edwards inva...@invalid.invalid wrote:
On 2010-11-01, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message 8j8am4fk2...@mid.individual.net, Peter Pearson wrote:
Warning: diff -b won't detect changes in indentation. Changes in
indentation can change a
On 2010-10-28, Craig McRoberts imprim...@gmail.com wrote:
I've already resigned
myself to starting over from the beginning, but are my books from
that time period even worth using now?
Impression I get is mostly no. I think you'll find life overall a lot
better now, though. Programming
On 2010-10-26, kj no.em...@please.post wrote:
(Though, humorless as it is of me, I still would prefer the ZoP
out of the standard library, to save myself having to tell those
who are even newer to Python than me not to take it seriously.)
Well, not to take it *too* seriously.
It's like any
On 2010-10-25, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message mailman.31.1287517442.2218.python-l...@python.org, Petite
Abeille wrote:
Characters vs. Bytes
And why do certain people insist on referring to bytes as ???octets
One common reason is that there have
On 2010-10-22, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
Seebs wrote:
The one that brought this up, though, was except FooError, e:, and in
that case, there is no need for any further description; the description
is provided by the except, and e is a perfectly reasonable, idiomatic
On 2010-10-22, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
Seebs wrote:
On 2010-10-21, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
list1 = []
for x in theList:
if x[0] == 4:
list1 += x;
return list1
flaggedCells = []
for cell in theBoard:
if cell
On 2010-10-22, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
I'm all for descriptive names, but there's a great deal of benefit to
knowing when a descriptive name will help, and when all you need is a
variable which will be quickly recognized.
Compare:
[theValueInTheList.func()
On 2010-10-21, Martin P. Hellwig martin.hell...@dcuktec.org wrote:
Although intuitively I would say the shorthand, however that is
depending on the context being me knowing at least the basics of 3d
spaces and having the pre-warning that you are going to mention
something with either
On 2010-10-21, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
In the middle of thousand lines of code, when you are reviewing or
debugging, the later is better TMO, the point is that x, y, z = is only
easy to read during the assignement.
Bull.
x, y, z = p.nextpoint()
[snip a dozen of
On 2010-10-21, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
Let me quote the paper I linked in the previous post:
list1 = []
for x in theList:
if x[0] == 4:
list1 += x;
return list1
compare it to:
flaggedCells = []
for cell in theBoard:
if cell[STATUS_VALUE] ==
On 2010-10-21, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
It can be short if descriptive:
for o, c in cars:
park(o)
phone(c)
for owner, car in cars: # by just using meaningful names you give the
info to the reader that you expect cars to be a list of tuple (owner, car)
On 2010-10-20, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
except ValueError, e:
Use meaningful names, this is so important.
It's important, but meaning can come from idiom, not from the word used.
'e' is not meaningful.
Sure it is. It's like i for a loop index.
There's a reason
On 2010-10-20, Matteo Landi landima...@gmail.com wrote:
Another situation in which I needed to disable such kind of warnings
is while working with graphics modules.
I often use variable names such as x, y, z for coordinates, or r,g,b for
colors.
Would longer names make the reader's life
So, I'm messing around with pylint. Quite a lot of what it says
is quite reasonable, makes sense to me, and all that.
There's a few exceptions.
One: I am a big, big, fan of idiomatic short names where appropriate.
For instance:
catch something, e:
I don't want a long, verbose, name --
On 2010-10-19, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Tue, 19 Oct 2010 19:57:36 +, Seebs wrote:
One: I am a big, big, fan of idiomatic short names where appropriate.
For instance:
catch something, e:
That would be except, not catch.
Er, yeah, that.
Well
On 2010-10-19, Shawn Milochik sh...@milochik.com wrote:
Just to be pedantic (or maybe even helpful), the use of the comma
after the exception is deprecated in favor of 'as.'
Not in code that has to run on older Pythons.
I'm pretty sure I have to work with everything from 2.4 to 2.6 or so.
On 2010-10-19, Martin P. Hellwig martin.hell...@dcuktec.org wrote:
Well, as with all styles IMHO, if there is a _good_ reason to break it,
then by all means do, but you might want to consider putting in a
comment why you did that and add the #pylint: disable-msg=message_id
on that line. If
On 2010-10-19, Martin P. Hellwig martin.hell...@dcuktec.org wrote:
Speaking without context here, so take it with as much salt as required
;-), it is not that unusual. However there are some things to consider,
for example are all these attributes related to each other? If so
wouldn't it be
On 2010-10-19, Ben Finney ben+pyt...@benfinney.id.au wrote:
Tools like pylint are far more useful if every message they emit is
something that you must deal with, rather than ignore every time you see
it. That way, it's feasible to get the output to no messages at all, and
have a defensible
On 2010-10-19, Alexander Kapps alex.ka...@web.de wrote:
The general idea is, that modules, classes, methods, and functions
should be small so they are better reusable, manageable and
understandable.
Makes sense.
If you have a huge class or function with many
attributes or local
On 2010-10-20, Ben Finney ben+pyt...@benfinney.id.au wrote:
It's a code smell. Many discrete attributes is a sign that the design
can be improved by combining related attributes into a complex type.
Ahh.
I think that makes sense. In this case, I don't think it's worth it,
but I can see why it
On 2010-10-18, Aahz a...@pythoncraft.com wrote:
In article 4cbcca47$0$29979$c3e8da3$54964...@news.astraweb.com,
Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
[duplicate post]
Maybe, but there's no reason for posting that ten times! ;-)
I would guess that there is almost
On 2010-10-17, Dun Peal dunpea...@gmail.com wrote:
What's the fastest way to implement `all_ascii(L)`?
Start by defining it.
1. Match against a regexp with a character range: `[ -~]`
What about tabs and newlines? For that matter, what about DEL and
BEL? Seems to me that the entire 0-127
On 2010-10-15, Grant Edwards inva...@invalid.invalid wrote:
On 2010-10-15, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
In the Unix world, which includes OS X, text tools tend to have
difficulty with tabs. Or try naming a file with a newline or carriage
return in the file name,
On 2010-10-15, Grant Edwards inva...@invalid.invalid wrote:
Yes, all of the Unix syscalls use NULL-terminated path parameters (AKA
C strings). What I don't know is whether the underlying filesystem
code also uses NULL-terminated strings for filenames or if they have
explicit lengths. If the
On 2010-10-14, Daniel Fetchinson fetchin...@googlemail.com wrote:
I keep getting recruiting emails from charlesngu...@google.com about
working for google as an engineer.
I've gotten one of those, ever, and it named a specific person who had
referred me.
(It turns out to be a moot point,
On 2010-10-14, Hallvard B Furuseth h.b.furus...@usit.uio.no wrote:
A class which holds an OS resource like a file, should provide a context
manager and/or a release function, the latter usually called in a
'finally:' block. When the caller doesn't bother with either, the class
often might as
On 2010-10-14, Roger Davis r...@hawaii.edu wrote:
Seebs, you are of course correct that the example I quoted (`cat |
grep | whatever`) is best done internally with the re module and built-
in language features, and in fact that has already been done wherever
possible. I should have picked
On 2010-10-12, Jonas H. jo...@lophus.org wrote:
Just a few pointers, looks quite good to me for a newbie :)
Thanks!
* Less action in __init__.
I'm a bit curious about this. The __init__ functions in this are, at
least for now, pretty much doing only what's needed to create the objects
from
On 2010-10-12, Chris Rebert c...@rebertia.com wrote:
2.
self.f = file(path, 'r')
if not self.f:
return None
The if here is pointless; I'm reasonably sure files are always
considered boolean true.
I actually seem to have done this wrong anyway -- I was thinking in
terms of the C-like
On 2010-10-12, MRAB pyt...@mrabarnett.plus.com wrote:
The code does require Python 2 and the use of except ... as ... requires
at least version 2.6.
Whoops.
Line 51
The __init__ method should always return None. There's no need to be
explicit about it, just use a plain return.
The real
On 2010-10-12, Hallvard B Furuseth h.b.furus...@usit.uio.no wrote:
list = map(lambda x: x.call(), self.args)
return ', '.join(list)
return ', '.join([x.call() for x in self.args])
I think I wrote that before I found out about list comprehensions. How
new are list comprehensions?
I do like
On 2010-10-13, Chris Rebert c...@rebertia.com wrote:
For future reference, the significant majority of things in Python
raise exceptions upon encountering errors rather than returning error
values of some sort.
Yes. I'm getting used to that -- it's a bit of a shift, because I'm
used to
On 2010-10-13, Jean-Michel Pichavant jeanmic...@sequans.com wrote:
If you wonder about some defects reported by such linters, you can then
ask in this list why something is not that good, because it may not be
always obvious.
'pylint' is one them, pretty effective.
Okay, several questions
On 2010-10-13, Jonas H. jo...@lophus.org wrote:
Not really. Files will be closed when the garbage collector collects the
file object, but you can't be sure the GC will run within the next N
seconds/instructions or something like that. So you should *always* make
sure to close files after
On 2010-10-13, Chris Torek nos...@torek.net wrote:
Unfortunately with is newish and this code currently has to
support python 2.3 (if not even older versions).
I think it might be 2.4 and later. I'm not sure. Of course, this being
the real world, the chances that I'll be able to stick with
On 2010-10-13, Ben Finney ben+pyt...@benfinney.id.au wrote:
Python borrows from C in that consecutive literal strings are
concatenated in the bytecode::
stderr.write(
WARNING:
Pants on fire\n)
Hmm. So I just indent stuff inside the ()s or whatever? I can work with
On 2010-10-13, Roger Davis r...@hawaii.edu wrote:
Hi, I am new to this group, please forgive me if this is a repeat
question. I am a new Python programmer but experienced in C/Unix. I am
converting a shell script to Python which essentially loops
infinitely, each pass through the loop running
So, I'm new to Python, though I've got a bit of experience in a few other
languages. My overall impressions are pretty mixed, but overall positive;
it's a reasonably expressive language which has a good mix between staying
out of my way and taking care of stuff I don't want to waste attention on.
On 2010-10-11, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message slrniaqm69.28f8.usenet-nos...@guild.seebs.net, Seebs wrote:
... but I wasn't aware that it had been deprecated, except in the sense of
being derided and dismissed as of no value.
What more did you want
On 2010-10-09, harryos oswald.ha...@gmail.com wrote:
What I meant by number of characters was the number of edits happened
between the two versions..
Consider two strings:
Hello, world!
Yo, there.
What is the number of edits happened between the two versions? It could
be:
* Zero. I just
On 2010-10-08, k.. m.51ah...@gmail.com wrote:
PLEASE LEARN ME PYTHON
Done!
Please be sure to drop by sometimes to let us know how it's going, now
that we've learned you Python.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net
On 2010-10-07, TP tribulati...@paralleles.invalid wrote:
Diez B. Roggisch wrote:
A safer alternative for these cases is using tuples, because they are
immutable.
The problem with tuples is that it is not easy to modify them:
This is probably the best post-and-response I've seen in the last
On 2010-10-06, geekbuntu gmi...@gmail.com wrote:
in general, what are things i would want to 'watch for/guard against'
in a file upload situation?
This question has virtually nothing to do with Python, which means you
may not get very good answers.
my checklist so far is basically to check
On 2010-10-06, Diez B. Roggisch de...@web.de wrote:
fkr...@aboutrafi.net23.net writes:
plz can u convert this cpp file into python i need that badly as soon as
possible... I am new to python. I just wanna learn it
For such an aspiring student of the art of computer programming, I have
On 2010-10-06, Diez B. Roggisch de...@web.de wrote:
Seebs usenet-nos...@seebs.net writes:
On 2010-10-06, geekbuntu gmi...@gmail.com wrote:
in general, what are things i would want to 'watch for/guard against'
in a file upload situation?
This question has virtually nothing to do with Python
On 2010-10-06, Diez B. Roggisch de...@web.de wrote:
With an impressive amount of technological experience under his belt. So
I'm a bit aghast to see him struggle with this rather simple
problem. Thus my question...
It does seem a bit odd.
I mean, if I had a short time line to get something
On 2010-10-06, Diez B. Roggisch de...@web.de wrote:
From the look of it... he's just trying to get a freebie on a homework
assignment. It certainly is no commercial/useful piece of code
whatsoever... just CS-101 read data from stdin and do stuff.
Ooh, I should go help, then.
I *love* to help
On 2010-10-06, fkr...@aboutrafi.net23.net fkr...@aboutrafi.net23.net wrote:
plz can u convert this cpp file into python i need that badly as soon as
possible... I am new to python. I just wanna learn it
Having come to realize that this is a homework problem, I would of course
be glad to.
On 2010-10-07, John Nagle na...@animats.com wrote:
First, scanf was deprecated over five years ago.
It was? I mean, people have been telling me not to use it since the 80s,
but I wasn't aware that it had been deprecated, except in the sense of being
derided and dismissed as of no value.
-s
On 2010-10-05, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message 87iq1hz6rc@benfinney.id.au, Ben Finney wrote:
Don't ever use a bare ???except??? unless you know exactly why you're doing
so.
In other news, don???t ever put a loaded gun in your mouth and pull the
On 2010-10-05, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message vg3pqvqc9jy@pepper.modeemi.fi, Anssi Saari wrote:
Because for the common case it's simple and easy and one might learn
something interesting?
You consider it ???interesting??? to reinvent stuff that
On 2010-10-03, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message slrniafbbr.2iq9.usenet-nos...@guild.seebs.net, Seebs wrote:
sqlite is a source of joy, a small bright point of decent
and functional software in a world full of misbehaving crap.
Have you learnt how
On 2010-10-02, Sandy dksre...@gmail.com wrote:
I want to find how much free memory (RAM) is available in my system
using python.
The question is essentially incoherent on modern systems. You'd have to
define terms. Consider that on a given system, it's quite possible that
gigabytes of space
On 2010-10-02, Ravi ra.ravi@gmail.com wrote:
The documentation of the sqlite module at
http://docs.python.org/library/sqlite3.html
says:
...allows accessing the database using a nonstandard variant of the
SQL...
But if you see SQLite website they clearly say at
On 2010-10-03, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Sat, 02 Oct 2010 12:50:02 -0700, Dennis Lee Bieber wrote:
Well... We could maybe borrow from REXX... and
use || for concatenation.
|| for concatenation? What's the connection between the pipe
On 2010-10-01, TheFlyingDutchman zzbba...@aol.com wrote:
? ? ? ? in C I can have a function maximum(int a, int b) that will always
? ? ? ? work. Never blow up, and never give an invalid answer. If someone
? ? ? ? tries to call it incorrectly it is a compile error.
I would agree that the
On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote:
Seebs usenet-nos...@seebs.net writes:
The obvious simple maximum() in C will not raise an exception nor return
something which isn't an int in any program which is not on its face
invalid in the call. This is by definite
On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote:
static dynamic
compiler detects wrong type fail at compile fails at run-time
(with exception
On 2010-10-01, RG rnospa...@flownet.com wrote:
Again, you can't have it both ways. Either a warning is a compiler
error according to the claim at issue (see below) or it is not. If it
is, then this is a false positive.
No, it isn't. It's a correctly identified type mismatch.
You keep
On 2010-10-01, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
Now can we (by which I mean *you*) stop cross-posting C talk to multiple
newsgroups that don't have anything to do with C?
Fair enough. The original thread does seem to have been crossposted in
an innovative way.
-s
On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote:
Seebs usenet-nos...@seebs.net writes:
On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote:
compiler passes wrong type wrong resultfails at run-time
(the programmer
On 2010-09-30, TheFlyingDutchman zzbba...@aol.com wrote:
even with the option -Wall (all warnings).
For various historical reasons, -Wall has the semantics you might
expect from an option named -Wsome-common-warnings-but-not-others.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach /
On 2010-09-30, RG rnospa...@flownet.com wrote:
We lost some important context somewhere along the line:
in C I can have a function maximum(int a, int b) that will always
work. Never blow up, and never give an invalid answer. If someone
tries to call it incorrectly it is a compile error.
On 2010-09-30, Paul Rubin no.em...@nospam.invalid wrote:
int maximum(int a, int b);
int foo() {
int (*barf)() = maximum;
return barf(3);
}
This compiles fine for me. Where is the cast?
On the first line of code inside foo().
Where is the error message?
You
On 2010-09-30, RG rnospa...@flownet.com wrote:
You can't have it both ways. Either I am calling it incorrectly, in
which case I should get a compiler error,
You get a warning if you ask for it. If you choose to run without all
the type checking on, that's your problem.
-s
--
Copyright
On 2010-09-30, Pascal Bourguignon p...@invitado-174.medicalis.es wrote:
Nick Keighley nick_keighley_nos...@hotmail.com writes:
do you have any evidence that this is actually so? That people who
program in statically typed languages actually are prone to this well
it compiles so it must be
101 - 200 of 253 matches
Mail list logo