In article [EMAIL PROTECTED],
Miki Tebeka [EMAIL PROTECTED] wrote:
print SCMError is e.__class__
raise SystemExit
I get to the second except clause, and the printout is:
/home/mikit/work/nightly/scm/common.py:3
/home/mikit/work/nightly/scm/common.py:3
False
How is this
Simon Wittber [EMAIL PROTECTED] wrote:
Is there a legitimate use for classic classes that I am not aware of?
Is there a reason NOT to use them? If a classic class works fine, what
incentive is there to switch to new style classes? I realize it's not
much effort to put (object) after your
Lucas Raab [EMAIL PROTECTED] wrote:
I am currently in the process of porting some C code into Python and am
stuck. I don't claim to be the greatest C/C++ programmer; in fact, my
skills at C are rudimentary at best. My question is I have the
statement: typedef unsigned long int word32 and
In article [EMAIL PROTECTED],
Chris Lasher [EMAIL PROTECTED] wrote:
Hello,
I have a rather large (100+ MB) FASTA file from which I need to
access records in a random order. The FASTA format is a standard format
for storing molecular biological sequences. Each record contains a
header line
vegetax [EMAIL PROTECTED] wrote:
-No naming convention. The speech of it fits in my head is no longer valid
when i use a lot of functionality,modules,classes in a large proyect.
For example if i remember a function i want ie:get attribute, i dont
remember if the module implementer coded it
In article [EMAIL PROTECTED],
Dan Bishop [EMAIL PROTECTED] wrote:
Roy Smith wrote:
Torsten Mohr [EMAIL PROTECTED] wrote:
reading the documentation (and also from a hint from this NG)
i know now that there are some types that are not mutable.
But why is it this way?
From
Paul McGuire [EMAIL PROTECTED] wrote:
A == 'a' is true in Python, not true in C.
It could be true in C, if the string is stored in very low memory :-)
--
http://mail.python.org/mailman/listinfo/python-list
Frans Englich [EMAIL PROTECTED] wrote:
Nah, I don't think it's a function, but rather a builtin statement. But
it's possible to invoke it as an function; print( test ) works fine.
That's not calling it as a function. The parens in this case are simply
evaluated as grouping operators around
In article [EMAIL PROTECTED],
Quest Master [EMAIL PROTECTED] wrote:
I am interested in developing an application where the user has an
ample amount of power to customize the application to their needs, and
I feel this would best be accomplished if a scripting language was
available. However,
Rocco Moretti [EMAIL PROTECTED] wrote:
The OP doesn't mention his application, but there is something to be
said about domain specific scripting languages. A well designed
domain-specific scripting language(*) with the appropriate high level
constructs can make script writing simpler.
This
Carl Banks [EMAIL PROTECTED] wrote:
Imbed
EMBED.
My apologies for being sloppy. And with an initial capital, so it just
jumps off the page at you :-)
Python, or Perl, or TCL, or Ruby, or PHP,
Not PHP. PHP is one of the better (meaning less terrible) examples of
what happens when
Cameron Laird [EMAIL PROTECTED] wrote:
It's also one that brings Tcl, mentioned several
times in this thread, back into focus. Tcl presents
the notion of safe interpreter, that is, a sub-
ordinate virtual machine which can interpret only
specific commands. It's a thrillingly powerful and
correct
In article [EMAIL PROTECTED],
Judi Keplar [EMAIL PROTECTED] wrote:
I am currently taking a course to learn Python and was looking for
some help. I need to write a Python statement to print a comma-
separated repetition of the word, Spam, written 511 times (Spam,
Spam, =85 Spam).
Can anybody
In article [EMAIL PROTECTED],
Chris Wright [EMAIL PROTECTED] wrote:
Hi,
1) I want to iterate over a list N at a time
You could do it with slicing and zip:
l = [1, 2, 3, 4, 5, 6, 7, 8]
zip (l[::2], l[1::2])
[(1, 2), (3, 4), (5, 6), (7, 8)]
To my eyes, that's a bit cryptic, but it works
Alex Hunsley [EMAIL PROTECTED] wrote:
I suppose I'm looking for the equivelant of Java's toString() method...
That would be str(), which for the most part, just calls your object's
__str__() method. If your object doesn't have an __str__() method, there's
nothing magic Python can do to invent
In article [EMAIL PROTECTED],
Mike C. Fletcher [EMAIL PROTECTED] wrote:
Steve Holden wrote:
...
I appreciate that not everyone has control over their .sig,
...
Take control of your sigs, my sisters and brothers! Viva la
Revolution! Follow the Steve into the heat and light of
In article [EMAIL PROTECTED],
System Administrator [EMAIL PROTECTED] wrote:
Does anybody know of a tool that can tell me all possible exceptions
that might occur in each line of code? What I'm hoping to find is
something like the following:
Paul That is impossible. The
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Alexander
Zatvornitskiy) wrote:
And, one more question: do you think code like this:
var S=0
var eps
for eps in xrange(10):
S=S+ups
is very bad? Please explain your answer:)
Let me answer that by way of counter-example.
Yesterday
[EMAIL PROTECTED] wrote:
I've read some posts on Perl versus Python and studied a bit of my
Python book.
I'm a software engineer, familiar with C++ objected oriented
development, but have been using Perl because it is great for pattern
matching, text processing, and automated testing.
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Alex Martelli) wrote:
This is a good development, overall. Against stupidity, the gods
themselves contend in vain; Python's entrance into stupid firms broadens
its potential appeal from less than 10% to around 100% of the market,
which is
EP [EMAIL PROTECTED] wrote:
There are very very few cases where anyone is going to require
you to use Python
Conversely, it pays to understand when you are likely to be permitted to
use it (or any new technology), and when you are likely to be forbidden.
Companies are generally the most
In article [EMAIL PROTECTED],
John M. Gabriele [EMAIL PROTECTED] wrote:
I recently posted this sort of question to the c.l.p.m but
didn't get much of a response. I know a little Perl and a
little Python, but master neither at the moment.
I see that Python is a general purpose OO
Jim [EMAIL PROTECTED] wrote:
Where did this type of structure come from:
mat = ['a' for i in range(3)]?
This will produce a list of three elements but
I don't see reference for it in any of the books.
It's a list comprehension. Unfortunately, this is a bad example of
one, since a much
Jim [EMAIL PROTECTED] wrote:
Thanks for the help. Python is somewhat mysterious to an old fortan
programer.
You might appreciate http://www.python.org/doc/Humor.html#habits
--
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED],
Max M [EMAIL PROTECTED] wrote:
Jeff Epler wrote:
No.
Unlike Perl, Python implements only a *finite turning machine* model of
computation. An easy way to see this limitation is in the following
code:
1.0 / 10.0
0.10001
In an
In article [EMAIL PROTECTED],
rhat [EMAIL PROTECTED] wrote:
Hi Everyone,
I've recently been reading some articles about unit-testing in Python
[1] [2], but I am a bit confused: where do I go to get started with
this? I tried googling for unittest but all I've found are some old
links to
In article [EMAIL PROTECTED],
David Eppstein [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
Leo Breebaart [EMAIL PROTECTED] wrote:
What I can't find an explanation for is why str.join() doesn't
automatically call str() on its arguments, so that e.g.
str.join([1,2,4,5]) would
Robert Boyd [EMAIL PROTECTED] wrote:
As if Plone, Zope, and (non-Python) Shibboleth weren't getting me
enough funny looks. And I haven't even started telling co-workers
about Django.
A couple of years ago, a head-hunter asked me if I knew Plone. I figured
he was just being an idiot and
Duncan Booth [EMAIL PROTECTED] wrote:
If 'a!=b' then it will also be the case that 'a is not b'
That's true for strings, and (as far as I know), all pre-defined
types, but it's certainly possible to define a class which violates
that.
class isButNotEqual:
def __ne__ (self, other):
Stuart Turner [EMAIL PROTECTED] wrote:
Python is a scripting language like Perl, awk, tcl, Java etc...
It is difficult to say whether Python is a scripting language or not until
you define what you mean by scripting language. People throw the term
scripting language around with wild abandon
Dave Hansen [EMAIL PROTECTED] wrote:
Of course, I write _far_ more code in C than Python. But I've seen
enough bugs of the sort where someone wrote 120 when they meant
1200, that I see great value in being able to specify 12_000_000.
I'll admit that being able to write 12_000_000
Yves Glodt [EMAIL PROTECTED] wrote:
My question is: Is there no way to append to a non existing list?
Nope. The problem (well, part of the problem, anyway) is that when you do:
foo.append (bar)
what's happening is you're calling foo's append method. If foo doesn't
already exist, it has no
In article [EMAIL PROTECTED],
Yves Glodt [EMAIL PROTECTED] wrote:
You mean you want to type pkcolumns only once to keep your code short?
Would something like this be useful?
pkcolumns = [row.strip() for row in sqlsth]
I will look into this, maybe it's what I need, thanks!
The list
Robert Hicks [EMAIL PROTECTED] wrote:
Why does there need to be OO in the core? That is one thing I have
never understood. If you want OO, get a package that fits your style of
OO and package require you are off and running. That probably isn't
what you would be looking at Tcl for anyway.
The
In article [EMAIL PROTECTED],
Ben Finney [EMAIL PROTECTED] wrote:
This is a poor design; your tests will each be starting in a different
state, and will likely not run the same way if run in a different
order, making them fragile.
Test cases should each run individually, from a known
In article [EMAIL PROTECTED],
py [EMAIL PROTECTED] wrote:
I have function which takes an argument. My code needs that argument
to be an iterable (something i can loop over)...so I dont care if its a
list, tuple, etc.
My first thought was to just write your loop inside a try block and
catch the
In article [EMAIL PROTECTED],
Steven D'Aprano [EMAIL PROTECTED] wrote:
try:
for item in obj:
do_stuff(item)
except TypeError, msg:
if msg == iteration over non-sequence:
handle_non_iterator()
else:
# re-raise the exception
raise
That's
In article [EMAIL PROTECTED],
Rick Wotnaz [EMAIL PROTECTED] wrote:
Steven D'Aprano [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
def foo(inputVal):
try:
for val in inputVal:
# do stuff
except TypeError, msg:
if msg == iteration over
Steven D'Aprano [EMAIL PROTECTED] wrote:
# Create an instance of the exception you expect:
try:
for i in 0:
pass
except TypeError, ITER_OVER_NON_SEQ:
pass
# Now run your code...
try:
...blah blah blah...
except TypeError, msg
if str(msg) == str(ITER_OVER_NON_SEQ):
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Steven D'Aprano wrote:
WHY WHY WHY the obsession with one-liners? What is wrong with the good old
fashioned way?
if cond:
x = true_value
else:
x = false_value
It is easy to read, easy to
[EMAIL PROTECTED] wrote:
Alternatively the underscore syntax may be used to separate the number
from its base:
22875 == 22875_10 == 595b_16 == 123456_7
But probably this is less commonly useful (and not much explicit).
We already have a perfectly good syntax for entering octal and hex
Steven D'Aprano [EMAIL PROTECTED] wrote:
That's a tad unfair. Dealing with numeric literals with lots of digits is
a real (if not earth-shattering) human interface problem: it is hard for
people to parse long numeric strings.
There are plenty of ways to make numeric literals easier to read
Mike Meyer [EMAIL PROTECTED] wrote:
I've seen at least one language (forget which one) that allowed such
separators, but only for groups of three.
That seems a bit silly. Not all numbers are naturally split into groups of
three. Credit card numbers are (typically) split into groups of four.
Dan Bishop [EMAIL PROTECTED] wrote:
creditCardNumber = int('1234''5678''9012''3456''789')
Wow, I didn't know you could do that. That's better than my idea.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] (David M. Cooke) wrote:
One example I can think of is a large number of float constants used
for some math routine. In that case they usually be a full 16 or 17
digits. It'd be handy in that case to split into smaller groups to
make it easier to match with tables where these
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
Is there a way to instruct Python to import modules from standard
library even if there is one with the same name in the current working
directory? I was trying to import BaseHTTPServer.py from standard
library but was prevented by a
Is there any way to access the RFC 3542 defined macros such as
ICMP6_FILTER_SETPASSALL() from within the socket module? A dir() on the
socket module (Python 2.4.1, built on a solaris box with IPv6 support)
doesn't show anything that looks like it (and socket.has_ipv6 is True).
--
Fredrik Lundh [EMAIL PROTECTED] wrote:
I've said it many times, and I'll say it again: the only fundamentally
new concept that has been added since Python 1.5.2 is generators.
[...]
All the rest is just coloured frosting
In my mind, the biggest thing since 1.5.2 is string methods. They are
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Interestingly, I just saw a thread over at TurboGears(or is it this
group, I forgot) about this multiple return issue and there are people
who religiously believe that a function can have only one exit point.
def f():
r = None
for i in
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I want to write to the pins of an RS232 without using the serial
protocol. The use would be every pin could act to complete a circuit
in customized hardware. I could use python to communicate serially to
a BASIC stamp
Tom Anderson [EMAIL PROTECTED] wrote:
It's modelled after the way cmp treats lists - if a and b are lists,
icmp(iter(a), iter(b)) should always be the same as cmp(a, b).
Is this any good? Would it be any use? Should this be added to itertools?
Whatever happens, please name it something
I've got a large text processing task to attack (it's actually a genomics
task; matching DNA probes against bacterial genomes). I've got roughly
200,000 probes, each of which is a 25 character long text string. My first
thought is to compile these into 200,000 regexes, but before I launch
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Alex Martelli) wrote:
Roy Smith [EMAIL PROTECTED] wrote:
...
Is there any easy way to find out how much memory a Python object takes?
No, but there are a few early attempts out there at supplying SOME ways
(not necessarily easy
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
While I realize this is more on a driver/hardware level it's
interesting that it's so difficult to use a different protocol for an
existing driver. For example, all serial does is a series of high and
low voltages on specific pins. Why should it be
My wife wants to learn Python. Can anybody suggest a good tutorial
for her to read? She's a PhD molecular biologist who is a pretty
advanced Unix user. She mucks about with Perl scripts doing things
like text processing and even some simple CGI scripts, but has no
formal programming training.
In article [EMAIL PROTECTED], Kent Johnson [EMAIL PROTECTED]
wrote:
Roy Smith wrote:
My wife wants to learn Python. Can anybody suggest a good tutorial
for her to read? She's a PhD molecular biologist who is a pretty
advanced Unix user. She mucks about with Perl scripts doing things
[EMAIL PROTECTED] (Tom Locke) wrote:
Anyone know of a good hosting company that offers both server-side
Python and a subversion repository?
Panix (www.panix.com) has svn and python installed on their unix hosts.
You could certainly do CGI in python. Don't know if they have
mod_python
In article [EMAIL PROTECTED],
Brett C. [EMAIL PROTECTED] wrote:
Anthony Baxter, our ever-diligent release manager, mentioned this past week
that Python 2.3.5 will most likely come to fruition some time in January
(this is not guaranteed date).
Interesting. Does that mean that 2.3 and 2.4
I'm playing with the timeit module, and can't figure out how to time a
function call. I tried:
def foo ():
x = 4
return x
t = timeit.Timer (foo())
print t.timeit()
and quickly figured out that the environment the timed code runs under
is not what I expected:
Traceback (most recent
Skip Montanaro [EMAIL PROTECTED] wrote:
Roy BTW, does Python really build the intermediate list and throw it
Roy away after using it to initialize the dictionary, or is it smart
Roy enough to know that it doesn't really need to build the whole list
Roy in memory?
That's why
Roy Smith wrote:
def __cmp__ (self, other):
# I wish there was a less verbose way to do this!
if self.block other.block:
return -1
if self.block other.block:
return 1
if self.lot other.lot:
return -1
In article [EMAIL PROTECTED],
Skip Montanaro [EMAIL PROTECTED] wrote:
Egor i know how to get item by key
...
Egor but i wonder how to get key by item
Assuming your dictionary defines a one-to-one mapping, just invert it:
forward = {10 : 50, 2 : 12, 4 : 43}
reverse
Delaney, Timothy C (Timothy) [EMAIL PROTECTED] wrote:
Python will do what you tell it.
Certainly it does. The problem is that sometimes what I told it to do
and what I think I told it to do are two different things :-)
Using Python 2.4, the above can be rewritten as a generator expression:
[EMAIL PROTECTED] (David M. Cooke) wrote:
It seems kind of surprising that I can't time functions. Am I just not
seeing something obvious?
Like the documentation for Timer? :-)
class Timer([stmt='pass' [, setup='pass' [, timer=timer function]]])
You can't use statements defined
Michael McGarry [EMAIL PROTECTED] wrote:
I am horrible with Regular Expressions, can anyone recommend a book on it?
I just did a search on the Barnes Noble site for regular expression
and came up with a bunch of books. The following looks reasonable:
Jp Calderone [EMAIL PROTECTED] wrote:
Dictionaries support mutable keys just find. What they don't
support is unhashable keys.
For some objects, this is an important distinction: lists are
mutable but not hashable.
Of course, you could subclass list to make a mutable, hashable list:
It's me [EMAIL PROTECTED] wrote:
How can I tell from within a function whether a particular argument is a
sigular type, or a complex type?
...
In C++, you would do it with function overloading. If arg1 is always simple
type, I wouldn't care what it is. But what if I *do* need to know
Grig [EMAIL PROTECTED] wrote:
Problem with porting patterns/api's from java straight to python is
that most of the outcome feels unpythonic. I'll not go about my own
feelings python vs. java here now, but I just want to point out that
there's already a rather large core of hard-python users
In article [EMAIL PROTECTED],
Grant Edwards [EMAIL PROTECTED] wrote:
On 2004-12-29, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Tuples are defined with regards to parentheses ()'s as everyone knows.
Except they're not.
x = 1,2,3,4
type(x)
type 'tuple'
Tuples are defined by
John Roth [EMAIL PROTECTED] wrote:
If Python had originally been invented in a unicode world, I suppose we
wouldn't have this problem. We'd just be using guillemots for tuples
(and have keyboards which made it easy to type them).
I suppose the forces of darkness will forever keep Python
In article [EMAIL PROTECTED],
Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
+ being an operator
Looks more like a smiley for guy wearing a bowtie
--
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Aahz)
wrote:
In article [EMAIL PROTECTED],
Roy Smith [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
+ being an operator
Looks more like a smiley for guy wearing a bowtie
You know
Ian Bicking [EMAIL PROTECTED] wrote:
I think this specific use case -- defining callbacks -- should be
addressed, rather than proposing a solution to something that isn't
necessary. Which is to say, no one *needs* anonymous functions; people
may need things which anonymous functions
In article [EMAIL PROTECTED],
Adam DePrince [EMAIL PROTECTED] wrote:
We can operate on every other class without having to involve the
namespace, why should functions be any different?
def is a weird beast. It does more than just bind a lambda to a name,
it also alters the function so it
Stefan Axelsson [EMAIL PROTECTED] wrote:
Yes, ignoring most of the debate about static vs. dynamic typing, I've
also longed for 'use strict'.
You can use __slots__ to get the effect you're after. Well, sort of; it
only works for instance variables, not locals. And the gurus will argue
that
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Aahz)
wrote:
In article [EMAIL PROTECTED],
Steve Holden [EMAIL PROTECTED] wrote:
Aahz wrote:
In article [EMAIL PROTECTED],
Paul Rubin http://[EMAIL PROTECTED] wrote:
I was pretty skeptical of Java's checked exceptions when I first
[EMAIL PROTECTED] (Cameron Laird) wrote:
Let me add a cautionary note, though: Big Companies,
including Oracle, Software AG, IBM, Cisco, and so on, have
adopted Tcl over and over. All of them still rely on Tcl
for crucial products. All of them also have employees who
sincerely wonder,
Terry Reedy [EMAIL PROTECTED] wrote:
None has been reserved because there is no known good use for overriding
it.
Should I infer from the above that there's a known bad use?
True and False will be reserved someday.
I remember a lisp I used many years ago. If you tried to rebind nil,
you
Stephen Waterbury [EMAIL PROTECTED] wrote:
Shaw-PTI (www.pti-us.com) uses Python in their software.
... but the Python Powered logo is conspicuous by its
absence from their site. Too bad that some commercial
exploiters of Python don't advertise that fact more often.
Companies use all sorts of
Roman Roelofsen [EMAIL PROTECTED] wrote:
These frameworks are using mixedCase but PEP8 suggests
lower_case_with_underscores except in contexts where that's already the
prevailing style which is not the case here IMHO.
So, are there any specific reasons for breaking the rules here? I think
I've got a silly little problem that I'm solving in C++, but I got to
thinking about how much easier it would be in Python. Here's the
problem:
You've got a list of words (actually, they're found by searching a
data structure on the fly, but for now let's assume you've got them as
a list). You
Simon Brunning [EMAIL PROTECTED] wrote:
On 7 Jan 2005 08:10:14 -0800, Luis M. Gonzalez [EMAIL PROTECTED] wrote:
The word self is not mandatory. You can type anything you want
instead of self, as long as you supply a keyword in its place (it can
be self, s or whatever you want).
You *can*,
In article [EMAIL PROTECTED],
John Roth [EMAIL PROTECTED] wrote:
Roy Smith [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Simon Brunning [EMAIL PROTECTED] wrote:
On 7 Jan 2005 08:10:14 -0800, Luis M. Gonzalez [EMAIL PROTECTED] wrote:
The word self is not mandatory. You can type
In article [EMAIL PROTECTED],
Anand S Bisen [EMAIL PROTECTED] wrote:
Hi
Is there a simple way to extract words speerated by a space in python
the way i do it in awk '{print $4 $5}' . I am sure there should be some
but i dont know it.
Something along the lines of:
words = input.split()
print
In article [EMAIL PROTECTED],
flamesrock [EMAIL PROTECTED] wrote:
Hi,
So if I understand correctly, there are NO eof characters in any binary
file. If so, is there an easier way to check for the end of the file
than:
os.path.getsize(infile) = infile.tell()
How you detect EOF depends on
In article [EMAIL PROTECTED],
James Stroud [EMAIL PROTECTED] wrote:
On Friday 07 January 2005 01:24 pm, Paul Rubin wrote:
Nick Coghlan [EMAIL PROTECTED] writes:
Add in the fact that there are many, many Python programmers with
non-CS backgrounds, and the term 'lambda' sticks out like a
Jeremy Bowers [EMAIL PROTECTED] wrote:
were I programming in C++ routinely now I'd prefix this and
dispense with that ugly m_ garbage. (One of the things I ***hate***
about C++ culture is its acceptance of hideously ugly variable names,
but now I'm two parentheticals deep so I probably
Dan Valentine [EMAIL PROTECTED] wrote:
On Fri, 07 Jan 2005 12:15:48 -0500, Anand S Bisen wrote:
Is there a simple way to extract words speerated by a space in python
the way i do it in awk '{print $4 $5}' . I am sure there should be some
but i dont know it.
i guess it depends on how
In article [EMAIL PROTECTED],
Dustan [EMAIL PROTECTED] wrote:
1000
print %e % 1000
1.00e+51
--
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
put self as the first argument in all instance methods of that class.
self is just a convention, referring to the object instance, not a
language feature as in other language like javascript. You can call it
me too if you prefer.
But
In article [EMAIL PROTECTED],
John Hazen [EMAIL PROTECTED] wrote:
* Chris Mellon [EMAIL PROTECTED] [2005-12-15 06:09]:
(Am I dating myself? Do teenagers still put studs on their jackets?)
No. They put studs in their lips, tongues, eyebrows, navels, and sexual
organs.
Oh, and ears.
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
How do I check if a string contains (can be converted to) an int? I
want to do one thing if I am parsing and integer, and another if not.
/David
The most straight-forward thing is to try converting it to an int and
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Alex Martelli) wrote:
gsteff [EMAIL PROTECTED] wrote:
...
that's not really what I'm looking for. So I'm wondering, what is
innovative about Python,
The letter 'y'. Before Python, it was woefully underused in the names
of
Szabolcs Nagy [EMAIL PROTECTED] wrote:
iterpreter (very useful for learning)
In my mind, this is the coolest feature of all. Most of the time, I don't
even bother looking stuff up in the docs; it's faster to just fire up an
interpreter and try something. Functions like:
dir(obj) /
Is there some standard way to signal not implemented yet in
unfinished code? When I'm coding, I'll often only flesh out one side
of a branch, or delay writing some method until later. It would be
nice to be able to identify these right in the code to make sure they
don't get forgotten about.
I
In article [EMAIL PROTECTED],
Tim Peters [EMAIL PROTECTED] wrote:
[Roy Smith]
Is there some standard way to signal not implemented yet in
unfinished code?
raise NotImplementedError
That's a builtin exception.
Ah, that's exactly what I was looking for. Thanks.
--
http://mail.python.org
I think I know the answer to this, but I'll ask it just in case
there's something I hadn't considered...
I'm working on a python interface to a OODB. Communication with the
DB is over a TCP connection, using a model vaguely based on CORBA.
I'll be creating object handles in Python which are
Steven D'Aprano [EMAIL PROTECTED] wrote:
How do you decide whether handle.foo should be treated as an attribute or
an operation?
That's exactly what I'm trying to figure out. In the legacy system I'm
trying to emulate, the interpreter knows the from syntax (i.e. whether
handle.foo is
In article [EMAIL PROTECTED], Mike Meyer [EMAIL PROTECTED]
wrote:
Fnorb (a pure-Python CORBA orb) dealt with this by not allowing
attributes per se. Instead, it provided _get_AttributeName and
_set_AttributeName as appropriate for each attribute in the IDL. Doing
this means that *everything*
In article [EMAIL PROTECTED], Ernst Noch [EMAIL PROTECTED]
wrote:
Couldn't you just, for every access to a member of your object, first
try to treat is as an access to an operation? If this fails (you
mentioned the db will throw an error if this is an attribute instead of
an operation),
1 - 100 of 2572 matches
Mail list logo