But either
system comes naturally enough with practice.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ave anything to do with the name of our
>> favorite language? (*Everyone* gets snake jokes! :)
>
> It's people like you wot cause unrest!
I think the decent people of this newsgroup are sick and tired of
being told that the decent people of this newsgroup are sick and
tired. I'
download a Quake 3 mod from
someone, you can be fairly sure it won't hose your system.
In particular, it won't let you access files outside of the game
directory. Is there a way I can accomplish something similar in an
embedded Python application? I probably only have to make it secure
pathname library. I suppose I missed whatever
the point was supposed to be in the midst of the mind-boggling. I
meant to get back to it but haven't yet.
--
Neil Cerutti
We will sell gasoline to anyone in a glass container. --sign at Santa Fe gas
station
--
http://mail.python.org/mailman/listinfo/python-list
es to matching the Python
code), but whatever it is would be a better foundation for
comparing brain units with the above Python.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-12-13, hit_the_lights <[EMAIL PROTECTED]> wrote:
> Neil Cerutti schrieb:
>
>> >> a[i] = b[n]
>> >>
>> >> with
>> >>
>> >> (setf (aref a i) (aref b n))
>> >>
>> >> and the attractions of Py
ups in
> copy-paste cannot be fixed by the editor automatically, because
> it cannot read the original programmer's mind, and you have to
> fix it manually, and risk screwing it up.
It is very easy a manual process, possibly as simple as selecting
the correct s-expr and pasting i
't annoy me that it didn't work, but
it did seem natural to me given the syntax of comprehensions.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Neil Cerutti wrote:
>> On 2006-12-13, [EMAIL PROTECTED]
>> <[EMAIL PROTECTED]> wrote:
>> > Expressions keep the same meaning even if you have to start
>> > breaking them across lines,
On 2006-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Neil Cerutti wrote:
>> On 2006-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> >
>> > Neil Cerutti wrote:
>> >> On 2006-12-13, [EMAIL PROTECTED]
>> >> <[EMAIL
adipiscing [...]'''
> prefix = '>'
>
> import textwrap
> lines = ["%s %s" % (prefix, line) for line in textwrap.wrap(text,
> width=75)]
The solution will need to be instrumented in case of text that is
already quotes to one level. All
oes. It makes perfect sense.
> I did say that I thought it would be a rarely used feature :-)
Though the full rationale no longer applies to strings, which now
have plenty of methods.
--
Neil Cerutti
Weight Watchers will meet at 7 p.m. Please use large double door at the side
entrance. --Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
I like using pattern matching in these simple cases:
last_line, _ = subprocess.Popen([r"tail","-n 1", "x.txt"],
stdout=subprocess.PIPE).communicate()
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
u *really* think
> that the Lisp savings are not worth it, then you would begin
> with my suggestion today.
I don't know how to build a house. It doesn't make me want to
live in a cave. ;-)
--
Neil Cerutti
The third verse of Blessed Assurance will be sung without musical
accomplishment. --Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
ot;, "hello")
>
> But it seems such capability isn't shared with the append:
>
>>>> a.extend("hello")
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: an integer is required
Try:
>>> a.fromstring(&qu
Chris,
If my name is familiar, please contact me.
-Neil--
http://mail.python.org/mailman/listinfo/python-list
my code.
I first came accross it in Stroustrup's _The C++ Programming
Language_. I liked the look and the idea immediately, but my
editor of choice (by historical accident) Vim, doesn't yet
support it.
--
Neil Cerutti
I've had a wonderful evening, but this wasn't it. --Groucho Marx
--
http://mail.python.org/mailman/listinfo/python-list
efinition S, say, rename it to be xyz.cpp
> and feed it to a C++ compiler, the S sure remains a struct and
> the C++ compiler has no difficulty in handling it as a struct,
> so ?!?
That's true.
But it's also true that
struct foo {
int x, y;
};
is exactly equivalent to:
tory that's not stored in a format
that's easy to sort.
>>> a = [("Neil Cerutti", "8025552954"), ("Ted Smith", "8025552281"), ("Barny
>>> Fife", "8025551105")]
>>> b = [(" ".join(reversed(x.
On 2007-01-04, Peter Otten <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> Another trick is to factor the key application out of the
>> sort. This may be a good idea if when you want to minimize the
>> number of times your key function is called.
>>
_x = 'mod2'
>
> And the test is:
>
> from mod1 import B as B1
> from mod2 import B as B2
>
> class A(B1, B2): pass
>
> a = A()
> a.foo()
> print a._B__x
> a.bar()
> print a._B__x
>
> Sure enough, mod2 messes up mod1's pr
gh if only I knew the
> number of keys/lists beforehand
len(dict.keys()).
--
Neil Cerutti
Next Sunday Mrs. Vinson will be soloist for the morning service. The pastor
will then speak on "It's a Terrible Experience." --Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
static int i;
> }
>
>
> Do you agree that i is "private" to test ?
In C one uses the pointer to opaque struct idiom to hide data.
For example, the standard FILE pointer.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-01-08, Jussi Salmela <[EMAIL PROTECTED]> wrote:
> Neil Cerutti kirjoitti:
>> In C one uses the pointer to opaque struct idiom to hide data.
>> For example, the standard FILE pointer.
>
> To Neil Cerutti: If a programmer in C has got a pointer to some
> piece o
foo:
> print "Foo!"
> if bar:
> print "Bar!"
That's the key issue. The colon gives the editor an easy clue
where a block starts, but the there's no simply way to determine
where the block is supposed to end.
--
Neil Cerutti
Remember in prayer the many who are sick of our church and community. --Church
Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
n doesn't
even try to make educated guesses.
class Thing:
pass
class Animal(Thing):
pass
class Dog(Animal):
pass
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
x27;)
o_bracket = re.compile('\\[')
c_bracket = re.compile('\\]')
colon = re.compile(':')
ix = 0
lexed_line = []
m = lambda regex, ix: match(regex, proto, ix, lexed_line)
while ix < len(proto):
old = ix
ix = m(arg_count, i
self.fireNewMessage(strReceivedString)
except:
raise
finally:
self.__objLock.release()
PySerial wraps all the platform specific stuff you, so you should
really use that, it behaves fairly well - the only real problem is a
lack o
ot; with "←" also an improvement. I'm so
used to "/" for division that "÷" now looks strange.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
If you really want to get the operation correct then start with the
serial communication, get a bit of paper and think what could ever
possibly go wrong with the communication. Then design your serial
communication for that. Here's a few communciations thigns to worry about:
Requested p
atch in the first place.
Right. Resuming a generator is faster than calling a function.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
ll may be faster due to CPU cache
effects or branch prediction. In any case, the difference you are
trying to measure is extremely small. Try adding some arguments to
the functions (especially keyword arguments).
What your test does show is that the speed difference should not
come into the d
sibly also lua and C#.
Lua has coroutines rather than threads. It can cooperate with
threading implemented by a host application or library.
See the coroutines chapter in
http://www.lua.org/pil/index.html
Neil
--
http://mail.python.org/mailman/listinfo/python-list
's interpreter will perform synchronization if you create
multiple threads that attach to a shared Lua state. You have to provide
some functions for Lua to call to perform the locking.
If you create multiple Lua states they are completely separate
worlds and do not need to be synchronized.
line endings u'\r\n' ? (This
> sequence obviously encodes to four bytes in UTF16). I would only do
> this to ensure compatibility with other programs the user may use to
> create the text files.
Notepad will read u'\r\n'. It doesn't like '\n' or u
ine
> endings in use.
You can normalise line endings:
>>> x = "a\r\nb\rc\nd\n\re"
>>> y = x.replace("\r\n", "\n").replace("\r","\n")
>>> y
'a\nb\nc\nd\n\ne'
>>> print y
a
b
c
d
e
The empty line is because "\n\r" is 2 line ends.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
CII characters:
The €200 encyclopædia defines the “coördinates” in ¼ ångströms.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
ated smooth
background.
> http://www.wordtech-software.com/ireveal-linux.png
Totally native. If you are still using a 10 year old desktop
environment.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
lf. Wouldn't that be fun?
Your imaginary command makes no sense as it is described. What are
its full semantics? Why was it implemented this way?
BTW, I have been implementing GUIs for over 20 years so maybe me and
the other SciTE users are in our own world. It does feel like a
friendly, enjoyable, comfortable world, though.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
; is common in
much source code particularly in barrier comments and comment sections:
Persistence section
## These functions are responsible for load
## and save for the core media database.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
;replace')
u'AUTHOR: blahblah\n\nTITLE: Reading Course Readings... G. A. \ufffd For
references see blahblah.\n\n\n-\n\n'
BTW, its probably in Windows-1252 where it would be a dash.
Depending on your context it may pay to handle the exception instead of
using "replace" and attempt interpreting as Windows-1252.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
ying that to the
clipboard. It only works on Windows due to the simpler clipboard API
compared to X and since RTF is a common format on Windows. Other
projects sometimes include code from SciTE even though the code isn't
really written for reuse.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
ciTE .api format.
The SciTE editor is shipped with some keyword lists, including some
for POV in the pov.properties file.
To set keywords, call SCI_SETKEYWORDS as described on the
documentation page.
I do not personally use the Qt or PygtkScintilla wrappers for
Scintilla.
Neil
did not give a definitive answer but there
were complaints from people about not being able to do this.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
There is a response to this on John's web site:
http://johnbokma.com/mexit/2005/05/19/daniel-joseph-min.html
Neil
--
http://mail.python.org/mailman/listinfo/python-list
ts
# -- but fixing the website is not one of them.
#
# If anybody here wants this job, it is all yours.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
GujuBoy:
> i am trying to make a "cpp" file which will make an array and pass it
> to python as a list.
>
> how is this possible...i am using BOOST...please can someone point me
> at some examples
This returns a list when called from Python.
static list retrieval_as_list(SplitText &self, in
eded but it was in the code I copied from) to already be in your
code if you are using Boost Python:
#include
#include
using namespace boost::python;
Have you read the Tutorial Introduction?
http://www.boost.org/libs/python/doc/tutorial/doc/html/index.html
Neil
--
http://mail.python.org/mailman/listinfo/python-list
e '=' onto the pixel
grid will distort the text appearance.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
mes cache time values. Even closing and reopening
the properties can show the old value. dir should always read the times
though.
Neil
--
http://mail.python.org/mailman/listinfo/python-list
=re.compile('>|<'), end='---')
> BlockReader(f, start=lambda x: x.startswith('>'))
>
> Maybe make variations for character-based readers and
> line-based readers.
I would prefer, "f.readlines(delim='>')" etc., a la C++
str::getline.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
> I agree with Bruno that i and j should be used only for
> indices, but I'm usually less terse than that.
I find i and j preferable to overly generic terms like "item."
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ntly,
and with similar data inputs and outputs.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-06, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Neil Cerutti a écrit :
>> On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote:
>>> Wildemar Wildenburger wrote:
>>> I agree with Bruno that i and j should be used only for
>>&g
ria?
Consult the Python Docs about the heapq module.
--
Neil Cerutti
Beethoven wrote fewer symphonies than Haydn and Mozart because he wrote
longer, and besides he went death. --Music Lit Essay
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-06, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> On 2007-06-06, rhXX <[EMAIL PROTECTED]> wrote:
>>> and/or
>>>
>>> - SORTED - INSERT in the correct place using some criteria?
>>
>> Consult the Python
that list.
The 'other' program is called 'new.py'. Is that what's causing
my problem?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-07, Robin Becker <[EMAIL PROTECTED]> wrote:
> BartlebyScrivener wrote:
>> On Jun 7, 8:17 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
>> A good habit for naming your scripts: If you have a script and you
>> want to name it text.py, or list.p
On 2007-06-07, Stebanoid <[EMAIL PROTECTED]> wrote:
> if you have a list of functions you can try this:
>
> import random
> import math
> m[int(math.floor(len(m)*random.random()))]() # seems like Lisp
Or rather m[random.randint(0, len(m))]()
--
Neil Cerutti
Caution: Cape
On 2007-06-07, Dustan <[EMAIL PROTECTED]> wrote:
> On Jun 7, 1:30 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>> On 2007-06-07, Stebanoid <[EMAIL PROTECTED]> wrote:
>>
>> > if you have a list of functions you can try this:
>>
>> > i
On 2007-06-08, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> Neil Cerutti a écrit :
>> On 2007-06-06, Bruno Desthuilliers
>> <[EMAIL PROTECTED]> wrote:
>>> Neil Cerutti a écrit :
>>>> On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote:
On 2007-06-08, Stebanoid <[EMAIL PROTECTED]> wrote:
> On 8, 00:07, Dustan <[EMAIL PROTECTED]> wrote:
>> On Jun 7, 1:30 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>>
>> > On 2007-06-07, Stebanoid <[EMAIL PROTECTED]> wrote:
>>
&
ily, the output format has not changed yet, so issues with
maintaining the above haven't arisen.
However, I'd like something better.
Is there already a good module for working with fixed format
records available? I couldn't find one.
If not, please suggest how I might improve the above co
On 2007-06-08, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>> Luckily, the output format has not changed yet, so issues with
>> maintaining the above haven't arisen.
>
> The problem surely is that when you want to ch
On 2007-06-08, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Neil Cerutti wrote:
>
>> new = file("new.dat", "w")
>> if not new:
>> print "Error. Could not open file new.dat for writing
On 2007-06-11, Marius Gedminas <[EMAIL PROTECTED]> wrote:
> On Jun 6, 3:18 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>> > Since 'i' and 'j' are canonically loop indices, I find it
>> > totally confusing to use them to name the iteration var
igned not by piling feature
on top of feature, but by removing the weaknesses and
restrictions that make additional features appear necessary.
Of course, that was written well before Scheme had most of its
current features.
--
Neil Cerutti
These people haven't seen the last of my fa
and non-recursive tail-calls. You
can't reasonably hand-optimize away the stack frame for all
tail-calls.
def foo(x)
bar(x)
The only way to hand-optimize the call to bar is to inline it
yourself.
--
Neil Cerutti
Will the highways on the Internet become more few? --George W. Bush
--
http://mail.python.org/mailman/listinfo/python-list
her behavior would be absurd,
> anyhow.
There's a reason it's generally refered to as "tail-call"
optimization and not "tail-recursive" optimization. The former is
more general, and, I believe, easier to implement than the
latter.
--
Neil Cerutti
The peace-making
ot;, line 525, in bar
raise ValueError
ValueError
shell returned 1
What makes the latter harder to work with?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-13, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-06-13, Anders J. Munch <[EMAIL PROTECTED]> wrote:
>> General tail-call optimisation is of course completely
>> out-of-bounds for Python, because it ruins tracebacks. Unlike
>> tail recursion, w
slowing it down in comparison to the non-method version.
Try the following simple optimization, using a local variable
instead of an attribute to build up the result.
# The method in a class
class bar:
def readgenome(self, filehandle):
s = ''
for line in filehandle.xre
On 2007-06-14, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Neil Cerutti a écrit :
> (snip)
>> class bar:
>> def readgenome(self, filehandle):
>> self.s = ''.join(line.strip() for line in filehandle)
>
>=>
>self.s
t provides to deal with
multiple inheritance, or generic, type-safe code. I don't think
it's inconsistent, though. The complexity of a feature *tends* to
mirror the *real* complexity.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-16, Paul Rubin wrote:
> Neil Cerutti <[EMAIL PROTECTED]> writes:
>> I vote for C++ as being astoundingly complex. But it provides
>> complex features, e.g.,the machanisms it provides to deal with
>> multiple inheritance, or generic, type-safe code.
>
&
ns long before I learned
about functions in Programming 101.
100 NAME$="TED"
110 AGE=40
120 GOSUB 1000
1000 PRINT NAME$, " IS ", AGE, " YEAR(S) OLD."
1010 RETURN
Named functions are so much nicer than numbered ones.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-17, Paul Rubin wrote:
> Neil Cerutti <[EMAIL PROTECTED]> writes:
>> I don't know that much about ML. I know is does a really nice job
>> of generic containers, as does C++. But can it 'foo' any type as
>> easily as C++?
>>
>&
s and what technique I should use.
You could get good results, and save yourself some effort, using
links or lynx with the command line options to dump page text to
a file. Python would still be needed to automate calling links or
lynx on all your documents.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
directory and
read python.vim. Unfortunately, the current version contains no
documention, so it's harder to figure out what you get than it
ought to be.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
impractical discussions of Scheme's dark
corners. Python is either much more free of dark corners, or else
simply doesn't attract that kind of aficionado.
--
Neil Cerutti
Let us join David and Lisa in the celebration of their wedding and bring their
happiness to a conclusion. --Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
an instance of the class:
foo f;
f.bar();
}
In C++ they are used most often for factory functions, since they
conveniently have access to the class's private members, and
don't want or need an existing instance. Python seems to have
adopted this use-case (ConfigParser, for example)
On 2007-06-20, Alex Martelli <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
>> In C++ they are used most often for factory functions, since they
>> conveniently have access to the class's private members, and
>> don't want or n
On 2007-06-20, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-06-20, Alex Martelli <[EMAIL PROTECTED]> wrote:
>> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>>> In C++ they are used most often for factory functions, since
>>> they conveniently have a
s
implementation of your Python curses program.
It doesn't actually use the windows console, however.
You could write your own little console interface, tailored to
your needs, which is implemented using curses on Unix, and the
effbot's 'console' on Windows.
--
Neil Cerutti
Symphonies of the Romantic era were a lot longer in length.
--Music Lit Essay
--
http://mail.python.org/mailman/listinfo/python-list
>
> And so on. Many thanks,
I think I'd put together a simple grammar and then write a
recursive descent parser that spit out my output files. But
that's just because I find that kind of thing fun. ;)
--
Neil Cerutti
I'm tired of hearing about money, money, money, money
open('in.txt', 'r')
>
> for line in f1:
> print line.rsplit(':')[4].strip("'"),
>
> Output:
>
> Afghanistan'
> Albania'
> Algeria'
> American Samoa'
>
> Why is there a apostrophe still at the end?
Most likely it's the newline at the end of each record that's
getting in your way.
You can double-strip it.
for line in f1:
print line.strip().rsplit(':')[4].strip("'")
--
Neil Cerutti
The world is more like it is now than it ever has been before. --Dwight
Eisenhower
--
http://mail.python.org/mailman/listinfo/python-list
t the intended effect.
def f():
a = [12]
def g():
if a[0] < 14:
a[0] = 13
g()
return a[0]
You'll get better results, in Python, by using a class instances
instead of closures. Not that there's anything wrong with Python
closures, but the scoping rules make some fun tricks too tricky.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ge prior to the adoption of CLOS.
Is there a second example? ;)
Seriously, maybe Python looks like 'blub' (thanks, Paul Graham),
to the skilled Lisp user, but it makes a lot of other languages
look like 'blub', too, including, sometimes, Lisp: Lisp has to
'blub' generators.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
27;]
>
> what I need to do is compare l1 against l2 and return the "position"
> of where each object in l1 is in l2
>
> ie: pos = 0, 2, 4
>
> Thanks in advance, -h
Come, come! You can try harder than that.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-21, Douglas Alan <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> writes:
>> Seriously, maybe Python looks like 'blub' (thanks, Paul
>> Graham), to the skilled Lisp user, but it makes a lot of other
>> languages look like 'blu
On 2007-06-22, Douglas Alan <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> writes:
>> That said, I wouldn't give up the summer I spent studying _Simply
>> Scheme_.
>
> Sounds like fun. Is this like a kinder, gentler version of SICP?
No, it i
's see if I get this right.
>
> You create a website for a subject that you know nothing about. Then you
> try to solicit content in a bunch of programming language newsgroups.
>
> Wow, that's pretty pathetic, even for a google-groups poster!
Maybe they lost the business
for the .split method.
x = 'Smith, Ted, 15 Smedly Rd."
last, first, street = x / ', '
Tongue-in-cheekily-yours,
--
Neil Cerutti
Strangely, in slow motion replay, the ball seemed to hang in the air for even
longer. --David Acfield
--
http://mail.python.org/mailman/listinfo/python-list
only those variables?
This is off the cuff. There's likely a better way.
for k, v in MyClass.__dict__.iteritems():
if isinstance(v, property):
print k, v.__doc__
--
Neil Cerutti
22 members were present at the church meeting held at the home of Mrs. Marsha
Crutchfield last evening.
how to make
> the interpreter find instance name space first? Or any way to
> make programmer's life easier?
Try thinking of "self." as a notation that provides vital
information to you, the programmer.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
iliar
> with generators yet so don't laugh) which changed my code just
> a slight bit:
Experimentation with stuff you don't fully understand is a great
way to learn, but not that useful for solving exercises. ;)
--
Neil Cerutti
This team is one execution away from being a very good basketball team. --Doc
Rivers
--
http://mail.python.org/mailman/listinfo/python-list
ation...
> This should be:
>
> class Led(Device):
> #...
Using a naming convention for class objects, e.g., camel-case, is
a practice very similar to hungarian notation.
I would've said something like: start learning the Python
community's naming conventions, and use t
SyntaxError("Ill-formed expression")
return parse_ast(sexp.read(expr))
The sexp parser I wrote returns a tuple that represents the parse
tree of an s-expression, and recognizes only s-expressions,
strings and integers.
How can I make the Python more idiomatic Python?
How can I make it more "beautiful"? A type hierarchy seems
over-engineered in comparison to Scheme's type-case, but I
liked a cascade of isinstance calls (as in parse) even less.
The type hierarchy did allow me to factor out the code
duplication in the (sub ...) and (add ...) types of Scheme, and
seems like a nice benefit over type-case.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-07-02, Laurent Pointal <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> How can I make the Python more idiomatic Python?
>
> Have you taken a look at pyparsing ?
Yes, I have it. PyParsing has, well, so many convenience features
they seem to shout down whatever
On 2007-07-02, Paul McGuire <[EMAIL PROTECTED]> wrote:
> On Jul 2, 3:56 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> from pyparsing import *
It's always good when your messages start like that. ;)
> """
> Ok, here is the step-by-step, beginning with
1001 - 1100 of 2046 matches
Mail list logo