ave Parker here any minute to tell us how Flaming Thunder
isn't slow.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
I believe it's happening because you mixed old-style and new-style
classes. But it's not the right solution anyway.
> Any help on this?
Probably the best piece of advice is "Don't try to use Decorator
pattern". :)
Seriously, you might want to see what other people have done in
similar cases. This stuff is tricky to get right, so maybe you should
shamelessly ride the coattails of someone who already ran into all the
issues. One example I can think of is the ZODB Persistent class (it's
a proxy class, so some of the same issues are involved). Perhaps
searching Python cookbook for some proxy or decorator class recipes
will give you ideas.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
anguages and
not-so-fast non-machine-coded languages. And like it or not, the
world rarely cares to make the distinction between language and
implementation, and frankly, it's usually not necessary to.
What Brad said is perfectly acceptable, and good advice IMHO, under
the common usage of the terms. I
fault_hello(self):
print "hello, children"
A.say_hello = new_default_hello
Notice that you need to use self when assigning it to the class
object, and not to use self when assigning it to an instance of the
class.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
print p
(I recommend doing it this way in C, too.)
For the case where you want to do this in an elif-clause, look for the
recent thread "C-like assignment expression?" which list some
workarounds. Or just Google this newsgroup for "assignment
expression". It's one of few minor irritating things in Python
syntax.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On May 24, 1:56 am, cm_gui <[EMAIL PROTECTED]> wrote:
> i'm not trying to 'troll' here.
Maybe you're not trying, but you're succeeding.
If you want to criticize be constructive about it, otherwise get out.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On May 24, 7:12 am, Johannes Bauer <[EMAIL PROTECTED]> wrote:
> Carl Banks schrieb:
>
> > p = myfunction()
> > if p:
> > print p
>
> > (I recommend doing it this way in C, too.)
>
> This is okay for if-clauses, but sucks for whil
r purpose and when combined with Jackson structured
> > programming could be used straight away by rooky programmers in business
> > systems programming. I am sure it has progressed since ANSI 68.
>
> > The Inuit have 13 terms for snow. Microsoft advocate DSLs. Why have DSLs
> > if language does not matter?
>
> > My 2c worth.
>
> http://www.fukung.net/v/7729/php_vs_python.png
> :)
Ha ha. Took me a second.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
n evolutionary search, so mutate in this sense relates to a
> genetic algorithm, perhaps a gradient decent?
A gradient descent method is not an evolutionary search and involves
no randomness (unless noise is added to the objective, which is a
possible way to attack a function with unimportant small scale
features, and in that case normalvariate would be the thing used).
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
worry about, and most
of the time you can and should add (object) and the code will still
work." And leave it at that--let the interested newbie seek out more
information on their own.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
consistent and
reasonable usage.
For open source, mom-and-pop operations, and other smaller projects, I
think it adds a whole lot of complexity over what otherwise is a
simple thing.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ct, I'd say this is even worse than useless. Creating accessor
functions is a sort of blessing for external use. Knowing that there
are accessor functions is likely to cause a user to show even less
restraint.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 2, 6:40 am, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2008-06-02, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 2, 5:38 am, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> >> If you really need it, you can do data hiding in
On Jun 2, 8:14 am, Carl Banks <[EMAIL PROTECTED]> wrote:
> Fair enough, but I don't see anything in your example that suggests a
> way to discriminate between access from within the class and access
> from outside the class, which is the crucial aspect of data hiding.
And, if
On Jun 2, 9:07 am, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2008-06-02, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 2, 6:40 am, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> >> On 2008-06-02, Carl Banks <[EMAIL PROTECTED]> wrote
On Jun 2, 4:50 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
> On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > You are not realizing that only useful(**) thing about data hiding is
> > that some code has access to the data, other code does n
On Jun 2, 6:39 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
> On Jun 2, 3:04 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 2, 4:50 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
>
> > > On Jun 2, 6:41 am, Carl Banks <[EM
s. Thus, the client would have
> access, but he would know very well that he is using something that
> the original designer did not intend for him to use.
Reasonable enough. I've always thought C++ should have a
private_cast.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 2, 10:14 am, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2008-06-02, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 2, 9:07 am, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> >> On 2008-06-02, Carl Banks <[EMAIL PROTECTED]> wrote
d use an environment variable to choose which
one:
if os.environ.get("USENEWMODULE") == "yes":
from newwhatever import *
else:
from oldwhatever import *
Or, you could set a flag in some sort of configuration module and
check that:
import config
if config.use_new_module
n between different
branches depending on whether you're using the tools or changing the
model. (Subversion can do this, but I'm not sure if it's for
individual files or only directories.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
T",
> move to the 35th character of the line and read 5 characters from
> there.
> Capture these 5 characters and write them to a new text file, each 5
> characters separated by a comma.
Your professor possibly reads comp.lang.python, and if so, is likely
to know how to track yo
oc
And then you could do this:
@doc("This is the docstring.")
def some_function():
do_whatever()
I think most tools that use docstrings actually execute the module,
which means by the time the tool sees it the docstring will have been
assigned, though I'm not
onfig.debug_options:
print_debugging_info()
But again, the logging modules handles all this for you so no point
for this particular task.
P.S. I'd do it more or less this way in C, too.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ds like a sentinel would work for this. The producer puts a
specific object (say, None) in the queue and the consumer checks for
this object and stops consuming when it sees it. But that seems so
obvious I suspect there's something else up.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
he += is atomic. Otherwise you have to use a lock.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
Tuples will have an index method in Python 2.6.
I promise I won't indiscriminately use tuples for homogenous data.
Honest. Scout's honor. Cross my heart.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 19, 10:17 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > Tuples will have an index method in Python 2.6.
>
> > I promise I won't indiscriminately use tuples for homogenous data.
> > Honest. Scout's honor. Cross my heart.
>
On Jun 19, 11:26 pm, Dan Bishop <[EMAIL PROTECTED]> wrote:
> On Jun 19, 9:24 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 19, 10:17 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
> > > Carl Banks wrote:
> > > > Tuples will hav
ener is a subclass of URLopener?
Yes. Anthimeria is very common in English.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
before the number:
$112 and $45
In which case your regexp should be somehting like this: \$[0-9]+
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
If so, change
it to use a different instance each time. (If you just use the module-
level load function you are already using a different instance each
time.)
Unpicklers hold a reference to everything they've seen, which prevents
objects it unpickles from being garbage collected until it i
;
> f = open('c:/scripts/myFeeds.htm', 'w')
> f.write(s)
> f.close
>
> print
> print 'myFeeds.htm written'
Using the += operator on strings is a common bottleneck in programs.
First thing you should try is to get rid of that. (Recent versions o
such guarantee,
so you have to arrange your modules so that code that depends on
another module is run after the dependent module. (One common time
where this happens is when subclassing a class from another module:
the module with the base class needs to run first.)
If you have circular imports in
to occur, without
using CPU cycles.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 28, 6:49 pm, defn noob <[EMAIL PROTECTED]> wrote:
> On 28 Juni, 08:32, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > On Jun 27, 10:58 pm, defn noob <[EMAIL PROTECTED]> wrote:
>
> > > right. im an idiot anyway. i can just draw the lines befo
On Jun 30, 1:55 pm, Tom Davis <[EMAIL PROTECTED]> wrote:
> On Jun 26, 5:38 am, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 26, 5:19 am, Tom Davis <[EMAIL PROTECTED]> wrote:
>
> > > I am having a problem where a long-running function will c
nce of the regexp that I'm aware of.
> but why would you say this particular
> regex isn't common enough in real code?
When re.search regexps start with things like [^...]* or .*, typically
the excluded characters are a typically found frequently in the
input. For example, the pattern .*hello.* could be used to find a
line with hello in it, with the expectation that there are lots of
newlines. But if there aren't any newlines the regexp wouldn't be
very useful.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
r algorithm that is used in grep. Python RE's have
> > more capabilities than grep RE's which need a slower, more complex
> > algorithm.
>
> FWIW, grep itself can confirm this statement. The following command roughly
> takes as long as Python's re.search:
>
> # grep -P '[^ "=]*/' input
>
> -P tells grep to use real perl-compatible regular expressions.
This confirms that a particular engine might not be optimized for it,
but it's not necessarily a reflection that the engine is more complex.
I'm not sure of the specifics and maybe that is the case, but it could
also be a case of a different codebase which is optimized differently.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 5, 6:44 am, "Sebastian \"lunar\" Wiesner"
<[EMAIL PROTECTED]> wrote:
> Carl Banks <[EMAIL PROTECTED]>:
>
>
>
> > On Jul 5, 4:12 am, "Sebastian \"lunar\" Wiesner"
> > <[EMAIL PROTECTED]> wrote:
> >> P
is so if you look at the MRO:
Foo, _Foo, Base, object
Which is the same MRO that would occur if _Foo derived from Base
directly.
The drawback (which is also a drawback to the hypothetical base
reassignment) is that Foo's __init__ method won't call Base's. The
only way you can make SWIG __init__ call it's superclass's __init__ is
apparently a patch.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
m manipulate it?
> Makes more sense to draw the line to not access any attributes at all
> no?
Much of what you're arguing is only true if you accept it as a given
that data hiding is important. The designers of Python don't really
think it is, and that's why they don't have it.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
motorcycle.py:
from carsim import car
def create_car():
global a
a = car.Car()
This last limitation is due to a wart in the import logic.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
would reference
> the global X, rather than previous X.
Do you have a specific use case in mind? Where would this sort of
thing be useful?
(The be sure, I can think of a use case for something like this,
namely optimizing away hash lookups for frequently used globals. But
such an optimi
odule in as the first argument. I have
reasons for doing it but it doesn't do anything the above method
does. It would be used like this:
@modmethod
def something(self):
self.var = 1
self.max = 10
]
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
find that out myself (I'm pretty excited about the thing
> already ^^), but I'd be happy to hear of people who have used it already.
Pyglet runs on top of OpenGL, which might have performance problems on
an embedded device, if OpenGL or Mesa is even supported. If it's
suppo
a loss if you
decide to learn some other language.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
www.mathworks.com
If you're only interested in sine waves you most certainly should not
give Matlab a try; even with student pricing it's going to be way
expensive for something that simple.
For just popping up a window and drawing on it I recommend PyGame.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
instead
of "if x==0", or "if s" instead of "if len(s)==0".
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
-
no in Python. Or how about this:
a = 1 # a is an integer
a += "hello" # oops, now it's a string
Let me suggest that such things are a Very Bad Idea and so that line
is better left in place.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
etty weak.
The use case of simply passing something to a function that accepts
any boolean doesn't count. For instance, I could write:
def nand(a,b):
return not (a and b)
And then I could use it like this, even if x is an interger and y a
string:
if nand(x,y):
But that doesn't b
On Jul 27, 5:14 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sat, 26 Jul 2008 15:58:16 -0700, Carl Banks wrote:
> > On Jul 26, 5:07 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> >> Whether or not one should write 'if x' or
On Jul 28, 10:00 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> Cutting to the crux of the discussion...
>
> On Sun, 27 Jul 2008 23:45:26 -0700, Carl Banks wrote:
> > I want something where "if x" will do but a simple explicit test won
On Jul 28, 8:15 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
> > On Jul 28, 10:00 am, Steven D'Aprano <[EMAIL PROTECTED]
> > cybersource.com.au> wrote:
> >> Cutting to the c
On Jul 29, 5:27 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Tue, 29 Jul 2008 01:37:45 -0700, Carl Banks wrote:
> > I am looking for one that can't.
>
> If you are writing code that needs to do the right thing with arbitrary
> types, then your so-called &q
es how "if x" improves polymorphism relative to simple
explicit tests?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 29, 11:12 am, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Jul 28, 8:15 pm, Steven D'Aprano <[EMAIL PROTECTED]
> > cybersource.com.au> wrote:
> >> On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
> >>> O
On Jul 29, 1:30 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Jul 29, 5:15 am, Heiko Wundram <[EMAIL PROTECTED]> wrote:
>
> > I can't dig up a simple example from code I wrote quickly, but because of
> > the
> > fact that explicit comparisons always hamp
On Jul 29, 5:27 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Tue, 29 Jul 2008 01:37:45 -0700, Carl Banks wrote:
> > I would accept as "evidence" something that satisfies my criteria, which
> > your example did not: it could have easily (and more robu
On Jul 29, 4:08 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Jul 29, 1:30 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> >> On Jul 29, 5:15 am, Heiko Wundram <[EMAIL PROTECTED]> wrote:
>
> >>> I can't dig up a
On Jul 29, 3:43 pm, "Heiko Wundram" <[EMAIL PROTECTED]> wrote:
> Am 29.07.2008, 18:30 Uhr, schrieb Carl Banks <[EMAIL PROTECTED]>:
>
> > On Jul 29, 5:15 am, Heiko Wundram <[EMAIL PROTECTED]> wrote:
> >> I can't dig up a simple example from c
On Jul 29, 10:23 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > Bzzt. "if len(x)!=0" is a simple explicit that would work for this
> > class and all built-in containers. (Or should--Steven D'Aprano's
> > objections notwit
On Jul 29, 7:30 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Tue, 29 Jul 2008 10:30:43 -0700, Carl Banks wrote:
> > On Jul 29, 5:15 am, Heiko Wundram <[EMAIL PROTECTED]> wrote:
> >> I can't dig up a simple example from code I wro
On Jul 30, 12:22 am, Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > That's not what I was asking for. I was asking for a use case for "if
> > x" that can't be replaced by a simple explicit test. Your example
> > didn't sa
On Jul 29, 11:17 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> >> As I wrote in the second reply email I sent, check out my integer set
> >> recipe on ASPN (and to save you the search:
> >> http://code.activestate.com/recipes/466286/
On Jul 29, 6:42 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > Much like in Steven D'Aprano's example, still the only actual code
> > snippet I've seen, it seems that this can easily be done with a simple
> > explicit test by
it can backfire to use
"if x" to check whether an iterable is empty since you can get a false
positive if it's an iterator.
Other than that it's maybe slighly less type safe to use explicit
test.
> Having said that, it would sure be nice to be able to write
>
> if
n just how
much polymophism "if x" supports relative to explicit tests, which is
to say, not much.
BTW, I haven't changed my criteria since I asked for the challenge.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 30, 1:58 am, "Russ P." <[EMAIL PROTECTED]> wrote:
> On Jul 29, 10:33 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > On Jul 30, 1:15 am, "Russ P." <[EMAIL PROTECTED]> wrote:
> > > Having said that, it would sure be nice to be able
On Jul 30, 11:07 am, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > That's not what I was asking for. I was asking for a use case for "if
> > x" that can't be replaced by a simple explicit test. Your example
> > didn't satis
On Jul 30, 3:56 am, Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > I mean in general. I wouldn't spell it like that. I would prefer if
> > empty(x), with an __empty__ method. (And support __nonzero__ aka
> > __bool__ dropped completely.)
>
On Jul 30, 4:49 am, Ethan Furman <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Jul 29, 6:42 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote:
> >> I don't have any postable code (it's in a half way state and I haven't
> >> touched it
out
ever considering how rarely this more extensive polymorphism comes up
in practice. I was calling them out to say "prove to me that it
actually happens".
I believe it's very rare not to know enough about the expected type
that explicit tests won't work. We'
On Jul 31, 12:13 am, Ethan Furman <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > So I stand by the point I was trying to make: for your average day-to-
> > day programming, the main benefit of "if x" is to save keystrokes. It
> > doesn't help your c
le who took it literally, those who are not an ass would
have accepted his explanation that he was paraphrasing it and moved
on, rather than rubbing it in.
If you recall, I agreed with his statement. Would you like to claim
that I don't understand the fundamentals of Python?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 31, 11:44 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
[snip excellent explanation of why it's hard to for "if x" to be
extensively polymorphic]
By the way, one thing I forgot to mention is Matt Fitzgibbons' filter
example.
As I said, it's hard to write code
On Aug 1, 8:49 am, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Jul 31, 11:44 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> > [snip excellent explanation of why it's hard to for "if x" to be
> > extensively polymorphic]
&g
t even if you do
that, most of the variables in a program are going to spend their
whole time being bound to a single time.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
is.
Nonzeroness is useful. Emptiness is useful. Singularity a kind of
useful. Nothing and something are vague, ill-defined, ad hoc concepts
that mean nothing to a computer. Have you ever seen an algorithm that
says "if x is something"?
Something and nothing do seem to come
On Aug 1, 4:45 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Aug 1, 3:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
>
>
> > > Nevertheless, I think this is probably the best example of the
> > > enhanced polymorphism of "if x" yet. I'm
On Aug 1, 4:45 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Aug 1, 3:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> > In general, asking code to apply across numeric, container, and other
> > classes is asking too much. Python code can be generic only within
> &
in locked_keys:
global_lock.wait()
locked_keys.add(s3key)
global_lock.release()
def unlock_s3key(s3key):
global_lock.acquire()
locked_keys.remove(s3key)
global_lock.notifyAll()
global_lock.release()
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ll(); notify alone won't
cut it. Consider what happens if you have two threads waiting for
keys A and B respectively. When the thread that has B is done, it
releases B and calls notify, but notify happens to wake up the thread
waiting on A. Thus the thread waiting on B is starved.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
7;C:\\boost-whatever-version\\include']
Notice the doubling of backslashes. Remember to add the directory
where the boost header files lie on your system; don't add this line
exactly.
You should end up with a setup call that looks like this:
setup(name="blah",
ext_modules
;s tp_flags field for Py_TPFLAGS_HEAPTYPE
bit, but I don't know of any simple way to check for it from Python.
It's still possible for it to fail since someone could create heap
types in C though I'd expect that's very rare.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 9, 7:46 am, [EMAIL PROTECTED] wrote:
> On 9 kol, 13:34, [EMAIL PROTECTED] wrote:
>
>
>
> > On 9 kol, 01:27, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > > On Aug 8, 1:11 pm, [EMAIL PROTECTED] wrote:
>
> > > > Thanks for quick reply.Maybe I
like this, but that usually only happens after the
community has had time to explore the problem domain for awhile (cf.
WSGI).
Carl Banks
(**) - Actually there is a minor policy recommendation: that the pydoc
and inspect module learn to understand and display the annotations.
--
http://mail.python.org/mailman/listinfo/python-list
d for Windows, Mac, and
> Linux at:
>
> http://chandlerproject.org/download
>
> Additional information is available from the Chandler Project homepage.
>
> Thanks for your interest in Chandler Desktop!
Cool. Maybe we'll Duke Nukem Forever soon, too.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
import mastergen
BTW, the error message is misleading, and it seems like it'd be a
common error. Maybe it deserves a special case error message. (I.e.
if the call to metaclass.__init__ raises TypeError, check to see if
it's a module and raise a better error message.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ines[self.index]
self.index += 1
return line
function_that_calls_readline(FileMimicker())
(Why would I want to clutter up my module's namespace for that silly
thing?)
So I see no good reason for the compiler to disallow nested class
statements; it's occasionally useful and not a common pitfall.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
are so much about that you will avoid using
a langauge because of it.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 29, 9:23 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sat, 29 Mar 2008 12:49:05 -0700, Carl Banks wrote:
> >> Please set it straight in 3.0, and if not, convince me with a good
> >> reason of doing so, so that I can live with it
it been established that castironpi is a person at all?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
return self.comparison_signature() ==
other.comparison_signature()
This I suspect would handle your problem gracefully, assuming that
objects of different types should be considered not equal and have a
different set of attributes in the signature.
For extra credit, you can factor the __eq__ method into a parent class
and inherit the comparison in A and B.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
lowing the comment "elset they're about
to enter the first item" sets the indent for the other case. You
might want to use that code in all cases. (Warning: this may cause
problems elsewhere, such as nesting function call.)
And once again, all bets are off if you're using python.el in Emacs
21.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
name mangling attributes is to minimize
accidental conflicts, not to enforce data hiding.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
dency to line up the init and finalize statements. In other words,
it looks wrong for open and close to be in different columns:
open()
try:
do_stuff()
finally:
close()
It's almost always wrong for initiazation to be inside of the try
block.
Perhaps the advent of with blocks wil
) * 180/math.pi
Careful there, bud. 5/6 might not give you the value you're expecting
it to, depending on the version of Python you're using. If you're on
Python 2.x, you'll want to use "from __future__ import division", or
to specify 5 and 6 as floats, i.e., 5.0/6.
rdware).
I'm pretty sure I could hack out this structure on my own, but I'd
like to see any prior information if there is any, in case anyone's
figured out things like, Is there an easy way to detect cycles on
insertion? and so on.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 7, 1:13 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Carl Banks" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> | I'm looking for any information about a certain kind of dynamic data
> | structure. Not knowing
901 - 1000 of 1709 matches
Mail list logo