view release on metacpan or search on metacpan
lib/ACME/QuoteDB.pm view on Meta::CPAN
110111021103110411051106110711081109111011111112111311141115111611171118111911201121
"Quote"
,
"Attribution Name"
,
"Attribution Source"
,
"Category"
,
"Rating"
for
example:
"Quote"
,
"Attribution Name"
,
"Attribution Source"
,
"Category"
,
"Rating"
"I hope this has taught you kids a lesson: kids never learn."
,
"Chief Wiggum"
,
"The Simpsons"
,
"Humor"
,9
"Sideshow Bob has no decency. He called me Chief Piggum. (laughs) Oh wait, I get it, he's all right."
,
"Chief Wiggum"
,
"The Simpsons"
,
"Humor"
,8
=item 1 if these dont suit your needs, ACME::QuoteDB::LoadDB is sub-classable,
so one can extract data anyway they like and populate the db themselves.
(there is a test that illustrates overriding the stub method, 'dbload')
you need to populate a record data structure:
$self->set_record(quote => q{}); # mandatory
$self->set_record(name => q{}); # mandatory
$self->set_record(source => q{}); # optional but useful
$self->set_record(catg => q{}); # optional but useful
$self->set_record(rating => q{}); # optional but useful
# then to write the record you call
lib/ACME/QuoteDB.pm view on Meta::CPAN
115211531154115511561157115811591160116111621163116411651166116711681169117011711172=head2 Quote
=head2 Catg
=head2 QuoteCatg
=end comment
=head1 DIAGNOSTICS
An error such as:
C<DBD::SQLite::db prepare_cached failed: no such table: ,...>
probably means that you do not have a database created in the correct format.
basically, you need to create the database, usually, on a first run
you need to add the flag (to the loader):
create_db => 1, # first run, create the db
lib/ACME/QuoteDB.pm view on Meta::CPAN
129812991300130113021303130413051306130713081309131013111312131313141315131613171318=head1 AUTHOR
David Wright, C<< <david_v_wright at yahoo.com> >>
=head1 TODO
=over 2
=item 1 if the database cannot be found, no error is printed!!!
or if you have no write access to it!
"you'll just get 'no attribute can be found,,...", which is cryptic to say
the least!
=item 1 add a dump backup to csv
a backup mechanism for your db to a regular text csv file.
=item 1 clean up tests 'skip if module X' not installed
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
246247248249250251252253254255256257258259260261262263264265266
$self
->write_record;
}
close
$source
or carp $!;
return
$self
;
}
# sub class this - i.e. provide this method in your code (see test
# 01-load_quotes.t)
sub
dbload {
croak
'Override this. Provide this method in a sub class (child) of this object'
;
# see tests: t/01-load_quotes.t for examples
}
sub
_to_utf8 {
my
(
$self
) =
@_
;
RECORD:
foreach
my
$r
(
@QUOTE_FIELDS
){
my
$val
=
$self
->{record}->{
$r
};
if
(
ref
$val
eq
'ARRAY'
){
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
469470471472473474475476477478479480481482483484485486487488489490491492493494#sub create_db_mysql {
# my ($self) = @_;
#
# # hmmmm, what about priv's access, etc
# # maybe user need to supply a db, they have
# # access to, already created (just the db though)
# ## create our db
# #my $dbhc = DBI->connect('DBI:mysql:database=mysql;host='
# # .$self->{host}, $self->{user}, $self->{pass})
# # || croak "db cannot be accessed $! $DBI::errstr";
#
# #my $dbn = $self->{db};
# #my $db = qq(CREATE DATABASE $dbn CHARACTER SET utf8 COLLATE utf8_general_ci);
# # eval {
# # $dbhc->do($db) or croak $dbhc->errstr;
# # };
# # $@ and croak 'Cannot create database!';
# # $dbhc->disconnect; $dbhc = undef;
#
# my $drh = DBI->install_driver('mysql');
# my $rc = $drh->func("dropdb", $self->{db},
# [$self->{host}, $self->{user}, $self->{password}],
# 'admin'
# );
#
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615#}
# XXX refactor with sqlite
sub
create_db_tables_mysql {
my
(
$self
) =
@_
;
# connect to our db
my
$c
=
$self
->{db}.
';host='
.
$self
->{host};
my
$dbh
= DBI->
connect
(
"DBI:mysql:database=$c"
,
$self
->{user},
$self
->{pass})
|| croak
"db cannot be accessed $! $DBI::errstr"
;
eval
{
$dbh
->
do
(
'DROP TABLE IF EXISTS quote;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS quote (
quot_id INTEGER NOT NULL AUTO_INCREMENT,
attr_id INTEGER,
quote TEXT,
source TEXT,
rating REAL,
PRIMARY KEY(quot_id)
);')
#)CHARACTER SET utf8 COLLATE utf8_general_ci;
#) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
or croak
$dbh
->errstr;
$dbh
->
do
(
'DROP TABLE IF EXISTS attribution;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS attribution (
attr_id INTEGER NOT NULL AUTO_INCREMENT,
name TEXT,
PRIMARY KEY(attr_id)
);') or croak
$dbh
->errstr;
$dbh
->
do
(
'DROP TABLE IF EXISTS category;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS category (
catg_id INTEGER NOT NULL AUTO_INCREMENT,
catg TEXT,
PRIMARY KEY(catg_id)
);') or croak
$dbh
->errstr;
$dbh
->
do
(
'DROP TABLE IF EXISTS quote_catg;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS quote_catg (
id INTEGER NOT NULL AUTO_INCREMENT,
catg_id INTEGER,
quot_id INTEGER,
PRIMARY KEY(id)
);') or croak
$dbh
->errstr;
$dbh
->disconnect or
warn
$dbh
->errstr;
$dbh
=
undef
;
};
return
$@ and croak
'Cannot create database tables!'
;
}
sub
create_db_tables_sqlite {
my
$db
= QDBI->get_current_db_path;
#XXX is there really no way to do this with the existing
# connection?!(class dbi)
my
$dbh
= DBI->
connect
(
'dbi:SQLite:dbname='
.
$db
,
''
,
''
)
|| croak
"$db cannot be accessed $! $DBI::errstr"
;
#-- sqlite does not have a varchar datatype: VARCHAR(255)
#-- A column declared INTEGER PRIMARY KEY will autoincrement.
eval
{
$dbh
->
do
(
'DROP TABLE IF EXISTS quote;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS quote (
quot_id INTEGER PRIMARY KEY,
attr_id INTEGER,
quote TEXT,
source TEXT,
rating REAL
);')
or croak
$dbh
->errstr;
$dbh
->
do
(
'DROP TABLE IF EXISTS attribution;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS attribution (
attr_id INTEGER PRIMARY KEY,
name TEXT
);') or croak
$dbh
->errstr;
$dbh
->
do
(
'DROP TABLE IF EXISTS category;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS category (
catg_id INTEGER PRIMARY KEY,
catg TEXT
);') or croak
$dbh
->errstr;
$dbh
->
do
(
'DROP TABLE IF EXISTS quote_catg;'
) or croak
$dbh
->errstr;
$dbh
->
do
('CREATE TABLE IF NOT EXISTS quote_catg (
id INTEGER PRIMARY KEY,
catg_id INTEGER,
quot_id INTEGER
);') or croak
$dbh
->errstr;
$dbh
->disconnect or carp
$dbh
->errstr;
$dbh
=
undef
;
};
return
$@ and croak
'Cannot create database tables!'
;
}
q(My cat's breath smells like cat food. --Ralph Wiggum)
;
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
661662663664665666667668669670671672673674675676677678679680681* csv file (pre determined
format
)
pros: quick and easy to load.
cons: getting the quotes data into the correct
format
need by this module
=item 2
* any source.
One can take quote data from any source, override
L<ACME::QuoteDB::LoadDB/dbload> loader methods to populate a record
and write it to the db.
pros: can get any quote data into the db.
cons: you supply the method. depending on the complexity of the data
source and munging required this will take longer then the other
methods.
=back
=head3 load from csv file
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
698699700701702703704705706707708709710711712713714715716717718
$load_db
->data_to_db;
if
(!
$load_db
->success){
'failed'
}
=head3 load from any source
If those dont catch your interest, ACME::QuoteDB::LoadDB is sub-classable,
so one can extract data anyway they like and populate the db themselves.
(there is a test that illustrates overriding the stub method, 'dbload')
you need to populate a record data structure:
$self->set_record(quote => q{}); # mandatory
$self->set_record(name => q{}); # mandatory
$self->set_record(source => q{}); # optional but useful
$self->set_record(catg => q{}); # optional but useful
$self->set_record(rating => q{}); # optional but useful
# then to write the record you call
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
899900901902903904905906907908909910911912913914915916917918=head2 dbload
if your file format is set to 'html' or 'custom' you must
define this method to do your parsing in a sub class.
Load from html is not supported because there are too many
ways to represt the data. (same with 'custom')
(see tests for examples - there is a test for loading a 'fortune' file format)
One can subclass ACME::QuoteDB::LoadDB and override dbload,
to do our html parsing
=head2 debug_record
dump record (show what is set on the internal data structure)
e.g. Data::Dumper
=head2 set_record
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
973974975976977978979980981982983984985986987988989990991992
=head2 write_record
takes the data structure 'record' '$self->get_record'
(which must exist). checks if attribution name ($self->get_record('name')) exists,
if so, uses existing attribution name, otherwsie creates a new one
Load from html is not supported because there are too many
ways to represt the data. (see tests for examples)
One can subclass ACME::QuoteDB::LoadDB and override dbload,
to do our html parsing
=head2 create_db_tables
create an empty quotes database (with correct tables).
(usually only performed the first time you load data)
B<NOTE: will overwrite ALL existing data>
lib/ACME/QuoteDB/LoadDB.pm view on Meta::CPAN
103310341035103610371038103910401041104210431044104510461047104810491050105110521053
know about them, so I will obfuscate them here
=head2 create_db_tables_sqlite
=head2 create_db_tables_mysql
=end comment
=head1 DIAGNOSTICS
An error such as:
C<DBD::SQLite::db prepare_cached failed: no such table: ,...>
probably means that you do not have a database created in the correct format.
basically, you need to create the database, usually, on a first run
you need to add the flag:
create_db => 1, # first run, create the db
t/01-load_quotes.t view on Meta::CPAN
122123124125126127128129130131132133134135136137138139140141
'Grandpa Simpson'
,
'Ralph Wiggum'
,
);
is(
$sq
->list_attr_names,
join
(
"\n"
,
sort
(
@expected_attribution_list
)));
}
{
# load from html is not supported because there are too many
# ways to represt the data.
# this is an example of extracting quotes from html:
# subclass ACME::QuoteDB::LoadDB and override dbload,
# to do our html parsing
sub
dbload {
my
(
$self
,
$file
) =
@_
;
t/01-load_quotes.t view on Meta::CPAN
244245246247248249250251252253254255256257258259260261262263264'From Kim "Howard" Johnson\'s'
,
'Gareth McCaughan'
,
'Gordon McMillan'
,
'Guido van Rossum'
,
'GvR'
,
'Jack Jansen'
,
'Jeremy Hylton'
,
'Jim Ahlstrom'
,
'Jim Fulton and Paul Everitt on the Bobo list'
,
'Jim Fulton and Tim Peters'
,
'John Eikenberry on the Bobo list'
,
'John Holmgren'
,
'John J. Lehmann'
,
'John Redford'
,
'Joseph Strout'
,
"Kristj\x{E1}n J\x{F3}nsson"
,
'Larry Wall'
,
'Mark Jackson'
,
'Matthew Lewis Carroll Smith'
,
'Michael Palin'
,
'Mike Meyer'
,
t/01-load_quotes.t view on Meta::CPAN
276277278279280281282283284285286287288289290291292293294295
'Told by Nick Leaton'
,
'Tom Christiansen'
,
'Vladimir Marangozov and Tim Peters'
,
);
is(
$sq
->list_attr_names,
join
"\n"
,
sort
@expected_attribution_list
);
}
{
# prove load a fortune format file
# this is an example of importing a file in the 'fortune' format
# subclass ACME::QuoteDB::LoadDB and override dbload, to do our parsing
sub
dbload {
my
(
$self
,
$file
) =
@_
;
open
my
$source
,
'<:encoding(utf8)'
,
$file
|| croak $!;
t/data/python_quotes.txt view on Meta::CPAN
888990919293949596979899100101102103104105106107108One of the things that makes it interesting, is exactly how much Guido
has
managed to exploit that
*one
* implementation trick of
'namespaces'
.
-- Steven D. Majewski, 17 Sep 1993
Anyone familiar
with
Modula-3 should appreciate the difference between a
layered approach,
with
generic Rd/Wr types, and the Python 'C
with
foam
padding' approach.
-- John Redford, 24 Nov 1993
People simply will not agree on what should and shouldn't be
"an error"
, and
once exception-handling mechanisms are introduced to give people a choice, they
will far less agree on what to
do
with
them.
-- Tim Peters, 17 Dec 1993
Note that because of its semantics,
'del'
*can
't* be a function:
"del a"
deletes
'a'
from the current namespace. A function can't
delete
something from
the calling namespace (except
when
written by Steve Majewski :-).
-- Guido van Rossum, 1 Aug 1994
I don
't know a lot about this artificial life stuff -- but I'
m suspicious
t/data/python_quotes.txt view on Meta::CPAN
263264265266267268269270271272273274275276277278279280281282283I mean, just take a look at Joe Strout's brilliant little "python
for
beginners" page. Replace all
-statements
with
sys.stdout.
write
(
string.
join
(
map
(str, args)) +
"\n"
) and you surely won't get any new beginners.
And That Would Be A Very Bad Thing.
-- Fredrik Lundh, 27 Aug 1996
Ya, ya, ya, except ...
if
I were built out of KSR chips, I'd be running at 25
or 50 MHz, and would be wrong about ALMOST EVERYTHING almost ALL THE TIME just
due to being a computer! Think about it --
when
's the
last
time
you spent 20
hours straight debugging your son/wife/friend/neighbor/dog/ferret/snake? And
they
*still
* fell over anyway? Except in a direction you've never seen
before
each
time
you
try
it? The easiest way to
tell
you're dealing
with
a computer is
when
the other side keeps making the same moronic misteakes over and misteakes
over and misteakes over and misteakes over and misteakes over and misteakes
CTRL-C again.
-- Tim Peters, 30 Apr 1997
BTW, a member of the ANSI C committee once told me that the only thing
rand
is
used
for
in C code is to decide whether to pick up the axe or throw the dwarf,
and
if
that's true I guess
"the typical libc rand"
is adequate
for
all but the
t/data/python_quotes.txt view on Meta::CPAN
438439440441442443444445446447448449450451452453454455456457458of it, it probably was. Hee hee.
-- Gordon McMillan, 8 Jun 1998
The majority of programmers aren't really looking
for
flexibility. Most
languages that enjoy huge success seem to
do
so not because they're flexible,
but because they
do
one particular thing
*extremely
* well. Like Fortran
for
fast number-crunching in its day, or Perl
for
regexps, or C++
for
compatibility
with
C, or C
for
... well, C's the exception that proves the rule.
-- Tim Peters, 11 Jun 1998
It
has
also been referred to as the
"Don Beaudry *hack*,"
but that's a
misnomer. There's nothing hackish about it -- in fact, it is rather elegant and
deep, even though there's something dark to it.
-- Guido van Rossum, _Metaclass Programming in Python 1.5_
Just point your web browser at http://www.python.org/search/ and look
for
"program"
,
"doesn't"
,
"work"
, or
"my"
. Whenever you find someone
else
whose
program didn
't work, don'
t
do
what they did. Repeat as needed.
-- Tim Peters, on python-help, 16 Jun 1998
Now some people see unchecked raw power and flee from perceived danger,
while
t/data/python_quotes.txt view on Meta::CPAN
526527528529530531532533534535536537538539540541542543544545far it appears to be a beast that's compatible
with
cuddly pythons.
-- Tim Peters, 6 Aug 1998
I wonder what Guido thinks he might
do
in Python2 (assuming, of course, that he
doesn't hire a bus to run over him
before
then <wink>).
-- Tim Peters, 26 Aug 1998
After writing CGI scripts the traditional way
for
a few years, it is taking
awhile to reshape
my
thinking. No sledgehammer to the head yet, but lots of
small sculpting hammers...
-- John Eikenberry on the Bobo list, 27 Aug 1998
I believe sometimes numbers creep into
my
programs as strings, so
'4'
/2 needs
to also be 2. Other languages
do
this. Since this is due in part to user input,
I guess
'four'
/2,
'quattro/2'
,
'iv/2'
etc. need to be 2 as well; don't know any
other language that does so, but Python could take the lead here in software
reliability. Any white space should be ignored, including between
my
ears. I
don
't have time to write any useful software, so I'
ve decided to devote myself
to proposing various changes to the Python interpreter.
-- Donn Cave uses sarcasm
with
devastating effect, 28 Aug 1998
t/data/python_quotes.txt view on Meta::CPAN
838839840841842843844845846847848849850851852853854855856857
"Can we
kill
this thread? The only thing it does as far as I'm concerned is
increase the posting statistics. :-)"
"don't-open-cans-of-worms-unless-you're-looking-for-a-new-diet-ly y'rs"
-- Guido van Rossum and Tim Peters, 6 Jan 1999
Hey, that was the first truly portable laptop! Of course I'm nostalgic.
Came
with
a mighty 24Kb RAM standard, & I popped the extra $80 to max it out at
32Kb. Much of Cray's register assigner was developed on that beast: unlike the
prototype
Crays of the
time
, the M100 was always available and never crashed.
Even better, I could interrupt it any
time
, poke
around
, and resume right where
it left off <wink>.
m100-basic-reminded-me-a-lot-of-python-except-that-it-sucked-ly y'rs
-- Tim Peters remembering the Model 100, 10 Jan 1999
"Heh -- all it really broke so far was
my
resistance to installing Tk. I
suppose wizardry is inevitable
after
one installs something, though <wink>."
"Spoken like a truly obsessive-compulsive wizard! It-takes-one-to-know
-one..."
-- Tim Peters and Guido van Rossum, 6 Jan 1999
t/data/python_quotes.txt view on Meta::CPAN
106010611062106310641065106610671068106910701071107210731074107510761077107810791080and
prototype
,
until
you've got clean separation of the
system
into managable
pieces, then code in whatever language most suits the need of
each
piece.
-- Gordon McMillan, 15 Dec 1999
When Jim [Fulton] says
"tricky"
it means your brain could explode.
-- Michel Pelletier, 15 Dec 1999
You have start-tags, attributes, end-tags and character data. We have all seen
"XML applications"
and
"XML parsers"
which handle this gang- of-four concepts.
... Now we can peer over the parapet and shout "your parser smells of
elderberries
" or "
I wave
my
mixed content at your ankles", as long as we like
but the simple gang-of-four base apps will not go away.
-- Sean McGrath, 19 Dec 1999
Abstraction is one of those notions that Python tosses out the window, yet
expresses very well.
-- Gordon McMillan, 6 Jan 2000
The set of naming conventions
has
a cardinality equal to the number of Python
users.
-- Gordon McMillan, 6 Jan 2000
t/data/python_quotes.txt view on Meta::CPAN
10821083108410851086108710881089109010911092109310941095109610971098109911001101The way to build large Python applications is to componentize and
loosely-couple the hell out of everything.
-- Aahz Maruch, 6 Jan 2000
It's not the mail volume that bothers me -- I can ignore 100s of messages a day
very quickly. It's the
time
it takes to respond to all of them.
-- Guido van Rossum, 20 Jan 2000
This is the way of Haskell or Design by Contract of Eiffel. This one is like
wearing a XV century armor, you walk very safely but in a very tiring way.
-- Manuel Gutierrez Algaba, 26 Jan 2000
Life's better without braces.
-- Unofficial motto of IPC8, coined by Bruce Eckel
"Aggressive"
means
"sometimes wrong"
.
-- John Aycock at IPC8, during his
"Agressive Type Inferencing"
talk
Do I
do
everything in C++ and teach a course in advanced swearing?
-- David Beazley at IPC8, on choosing a language
for
teaching
t/data/python_quotes.txt view on Meta::CPAN
111411151116111711181119112011211122112311241125112611271128112911301131113211331134dictator, but also wants to treat people like grownups. This probably worked
better
before
Python got a large American audience <0.9 wink>.
-- Tim Peters, 10 Feb 2000
I have formal proofs that any change of the indentation rules results in 35%
increase of the page faults
for
only 63.7% of the cache misses. The net effect
is an overall slowdown of 10%.
-- Vladimir Marangozov
after
Yet Another indentation flamewar, 16 Feb
2000
... let me just
say
that
my
least-favourite Python error message is
"SyntaxError: invalid syntax"
, which somehow manages to be both overly terse
and redundant at the same
time
.
-- Greg Ward, 15 Feb 2000
See, functional programmers are an insular lot. You rarely see them in
public, except at parades
when
they all have antler- hats and silly shoes on.
So they completely missed the infamous
"goto considered harmful"
thread and
didn't even realize they were doing anything wrong.
Now, let
's pretend you'
re writing a 'bot that can pass as a functional
programmer. There's a complex protocol here. When two functional programmers
t/data/python_quotes.txt view on Meta::CPAN
17161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744You didn't
say
what you want to accomplish. If the idea of
"provably correct"
programs appeals to you, Eiffel will give you more help than any other
practical language I know of. But since your post didn't lay out your
assumptions, your goals, or how you view language characteristics as fitting in
with
either, you're not a
*natural
* candidate
for
embracing Design by Contract
<0.6 wink>.
-- Tim Peters, 3 Jun 2001
The static people talk about rigorously enforced interfaces, correctness
proofs, contracts, etc. The dynamic people talk about rigorously enforced
testing and
say
that types only
catch
a small portion of possible errors. The
static people retort that they don't trust tests to cover everything or not
have bugs and why
write
tests
for
stuff the compiler should test
for
you, so
you shouldn
't rely on *only* tests, and besides static types don'
t
catch
a
small portion, but a large portion of errors. The dynamic people
say
no
program
or test is perfect and static typing is not worth the cost in language
complexity and design difficulty
for
the gain in eliminating a few tests that
would have been easy to
write
anyway, since static types
catch
a small portion
of errors, not a large portion. The static people
say
static types don't add
that much language complexity, and it's not design
"difficulty"
but an
essential part of the process, and they
catch
a large portion, not a small
portion. The dynamic people
say
they add enormous complexity, and they
catch
a
small portion, and point out that the static people have bad breath. The static
people assert that the dynamic people must be too stupid to cope
with
a real
language and rigorous requirements, and are ugly besides.
This is
when
both sides start throwing rocks.
-- Quinn Dunkan, 13 Jul 2001
I am becoming convinced that Unicode is a multi-national plot to take over the
t/data/www.amk.ca/quotations/python-quotes/index.html view on Meta::CPAN
155156157158159160161162163164165166167168169170171172173174175<p class=
'source'
>Tim Peters, 16 Sep 1993</p>
<p class=
'quotation'
id=
'q17'
>One of the things that makes it
interesting, is exactly how much Guido
has
managed to exploit that
<em>one</em> implementation trick of
'namespaces'
.</p>
<p class=
'source'
>Steven D. Majewski, 17 Sep 1993</p>
<p class=
'quotation'
id=
'q18'
>Anyone familiar
with
Modula-3 should
appreciate the difference between a layered approach,
with
generic
Rd/Wr types, and the Python
'C with foam padding'
approach.</p>
<p class=
'source'
>John Redford, 24 Nov 1993</p>
<p class=
'quotation'
id=
'q19'
>People simply will not agree on what
should and shouldn't be
"an error"
, and once exception-handling
mechanisms are introduced to give people a choice, they will far
less agree on what to
do
with
them.</p>
<p class=
'source'
>Tim Peters, 17 Dec 1993</p>
<p class=
'quotation'
id=
'q20'
>Note that because of its semantics,
'del'
<em>can
't</em> be a function: "del a" deletes '
a' from the
current namespace. A function can't
delete
something from the
calling namespace (except
when
written by Steve Majewski :-).</p>
<p class=
'source'
>Guido van Rossum, 1 Aug 1994</p>
<p class=
'quotation'
id=
'q21'
>I don't know a lot about this
artificial life stuff -- but I'm suspicious of anything Newsweek
t/data/www.amk.ca/quotations/python-quotes/page-2.html view on Meta::CPAN
127128129130131132133134135136137138139140141142143144145146147Strout's brilliant little
"python for beginners"
page. Replace all
-statements
with
<code>sys.stdout.
write
( string.
join
(
map
(str,
args)) +
"\n"
)</code> and you surely won't get any new beginners.
And That Would Be A Very Bad Thing.</p>
<p class=
'source'
>Fredrik Lundh, 27 Aug 1996</p>
<p class=
'quotation'
id=
'q43'
>Ya, ya, ya, except ...
if
I were
built out of KSR chips, I'd be running at 25 or 50 MHz, and would
be wrong about ALMOST EVERYTHING almost ALL THE TIME just due to
being a computer! Think about it --
when
's the
last
time
you spent
20 hours straight debugging your
son/wife/friend/neighbor/dog/ferret/snake? And they <em>still</em>
fell over anyway? Except in a direction you've never seen
before
each
time
you
try
it? The easiest way to
tell
you're dealing
with
a
computer is
when
the other side keeps making the same moronic
misteakes over and misteakes over and misteakes over and misteakes
over and misteakes over and misteakes CTRL-C again.</p>
<p class=
'source'
>Tim Peters, 30 Apr 1997</p>
<p class=
'quotation'
id=
'q44'
>BTW, a member of the ANSI C committee
once told me that the only thing
rand
is used
for
in C code is to
decide whether to pick up the axe or throw the dwarf, and
if
that's
true I guess
"the typical libc rand"
is adequate
for
all but the
t/data/www.amk.ca/quotations/python-quotes/page-3.html view on Meta::CPAN
979899100101102103104105106107108109110111112113114115116117come to think of it, it probably was. Hee hee.</p>
<p class=
'source'
>Gordon McMillan, 8 Jun 1998</p>
<p class=
'quotation'
id=
'q71'
>The majority of programmers aren't
really looking
for
flexibility. Most languages that enjoy huge
success seem to
do
so not because they're flexible, but because
they
do
one particular thing <em>extremely</em> well. Like Fortran
for
fast number-crunching in its day, or Perl
for
regexps, or C++
for
compatibility
with
C, or C
for
... well, C's the exception that
proves the rule.</p>
<p class=
'source'
>Tim Peters, 11 Jun 1998</p>
<p class=
'quotation'
id=
'q72'
>It
has
also been referred to as the
"Don Beaudry <em>hack</em>,"
but that
's a misnomer. There'
s nothing
hackish about it -- in fact, it is rather elegant and deep, even
though there's something dark to it.</p>
<p class=
'source'
>Guido van Rossum, <cite>Metaclass Programming in
Python 1.5</cite></p>
<p class=
'quotation'
id=
'q73'
>Just point your web browser at
"work"
, or
"my"
. Whenever you find someone
else
whose program
didn
't work, don'
t
do
what they did. Repeat as needed.</p>
<p class=
'source'
>Tim Peters, on python-help, 16 Jun 1998</p>
t/data/www.amk.ca/quotations/python-quotes/page-3.html view on Meta::CPAN
193194195196197198199200201202203204205206207208209210211212213pythons.</p>
<p class=
'source'
>Tim Peters, 6 Aug 1998</p>
<p class=
'quotation'
id=
'q86'
>I wonder what Guido thinks he might
do
in Python2 (assuming, of course, that he doesn't hire a bus to
run over him
before
then
<
;wink
>
;).</p>
<p class=
'source'
>Tim Peters, 26 Aug 1998</p>
<p class=
'quotation'
id=
'q87'
>After writing CGI scripts the
traditional way
for
a few years, it is taking awhile to reshape
my
thinking. No sledgehammer to the head yet, but lots of small
sculpting hammers...</p>
<p class=
'source'
>John Eikenberry on the Bobo list, 27 Aug 1998</p>
<p class=
'quotation'
id=
'q88'
>I believe sometimes numbers creep
into
my
programs as strings, so
'4'
/2 needs to also be 2. Other
languages
do
this. Since this is due in part to user input, I guess
'four'
/2,
'quattro/2'
,
'iv/2'
etc. need to be 2 as well; don't know
any other language that does so, but Python could take the lead
here in software reliability. Any white space should be ignored,
including between
my
ears. I don't have
time
to
write
any useful
software, so I've decided to devote myself to proposing various
changes to the Python interpreter.</p>
<p class=
'source'
>Donn Cave uses sarcasm
with
devastating effect,