Steven D'Aprano wrote:
> Ron Adam wrote:
>> def count_records(record_obj, start=0, end=len(record_obj)):
>
>
> That would work really well, except that it doesn't work at all.
Yep, and I have to stop trying to post on too little sleep.
Ok, how about... ?
George Sakkis wrote:
>
> How about using the right way of comparing with None ?
>
> x = None
> t = time.time()
> for i in range(100):
> if x is None:
> pass
> print 'is None:',time.time()-t
>
> I get:
>
> None: 0.54952316
> String: 0.498000144958
> is None: 0.450476
George Sakkis wrote:
> I get:
>
> None: 0.54952316
> String: 0.498000144958
> is None: 0.45047684
What do yo get for "name is 'string'" expressions?
Or is that a wrong way too?
On my system testing "if string is string" is slightly faster than "if
True/ if False" expressions.
But th
Kay Schluehr wrote:
>
> Leif K-Brooks schrieb:
>
>>Kay Schluehr wrote:
>>
>>>Well, I want to offer a more radical proposal: why not free squared
>>>braces from the burden of representing lists at all? It should be
>>>sufficient to write
>>>
>>>
>>list()
>>>
>>>list()
>>
>>So then what would t
Leif K-Brooks wrote:
> Kay Schluehr wrote:
>
>list.from_str("abc")
>>
>>list("a", "b", "c" )
>
>
>
> I assume we'll also have list.from_list, list.from_tuple,
> list.from_genexp, list.from_xrange, etc.?
List from list isn't needed, nor list from tuple. That's what the * is
for. And for t
Scott David Daniels wrote:
> Ron Adam wrote:
>
>> George Sakkis wrote:
>>
>>> I get:
>>>
>>> None: 0.54952316
>>> String: 0.498000144958
>>> is None: 0.45047684
>>
>>
>>
>> What do yo get for "na
Bengt Richter wrote:
> ;-)
> We have
Have we?
Looks like not a lot of interested takers so far.
But I'll bite. ;-)
> So why not
>
> @deco
> foo = lambda:pass
> equivalent to
> foo = deco(lambda:pass)
>
> and from there,
> @deco
> =
> being equivalent to
> = deco(
Reinhold Birkenfeld wrote:
> Ron Adam wrote:
>
>
>>>>>> 'abc' is 'abcd'[:3]
>>>False
>>
>>Well of course it will be false... your testing two different strings!
>>And the resulting slice creates a third.
>&g
Roy Smith wrote:
> Thomas Lotze <[EMAIL PROTECTED]> wrote:
>
>>Basically, I agree with the "make it run, make it right, make it fast"
>>attitude. However, FWIW, I sometimes can't resist optimizing routines that
>>probably don't strictly need it. Not only does the resulting code run
>>faster, but
Bengt Richter wrote:
> On Sun, 10 Jul 2005 05:35:01 GMT, Ron Adam <[EMAIL PROTECTED]> wrote:
>>So far they are fairly equivalent. So there's not really any advantage
>>over the equivalent inline function. But I think I see what you are
>>going towards. Decora
Bengt Richter wrote:
> E.g., so we could write
>
> for x in seq if x is not None:
> print repr(x), "isn't None ;-)"
>
> instead of
>
> for x in (x for x in seq if x is not None):
> print repr(x), "isn't None ;-)"
>
> just a thought.
>
> Regards,
> Bengt Richter
Is it n
Kay Schluehr wrote:
> Here might be an interesting puzzle for people who like sorting
> algorithms ( and no I'm not a student anymore and the problem is not a
> students 'homework' but a particular question associated with a
> computer algebra system in Python I'm currently developing in my
> spare
Raymond Hettinger wrote:
>>Variant of Paul's example:
>>
>>a = ((1,2), (3, 4), (5, 6), (7, 8), (9, 10))
>>zip(*a)
>>
>>or
>>
>>[list(t) for t in zip(*a)] if you need lists instead of tuples.
>
>
>
> [Peter Hansen]
>
>>(I believe this is something Guido considers an "abuse of *args", but I
>>jus
Kay Schluehr wrote:
>
> Ron Adam wrote:
>
>>Kay Schluehr wrote:
>>On a more general note, I think a constrained sort algorithm is a good
>>idea and may have more general uses as well.
>>
>>Something I was thinking of is a sort where instead of giving a
Raymond Hettinger wrote:
> [Ron Adam]
>
>>Currently we can implicitly unpack a tuple or list by using an
>>assignment. How is that any different than passing arguments to a
>>function? Does it use a different mechanism?
>
>
> It is the same mechanism, so it
Simon Dahlbacka wrote:
> Oooh.. you make my eyes bleed. IMO that proposal is butt ugly (and
> looks like the C++.NET perversions.)
I haven't had the displeasure of using C++.NET fortunately.
point = [5,(10,20,5)]
size,t = point
x,y,z = t
size,x,y,z = point[0], point[1][0], poi
Kay Schluehr wrote:
> Here might be an interesting puzzle for people who like sorting
> algorithms ( and no I'm not a student anymore and the problem is not a
> students 'homework' but a particular question associated with a
> computer algebra system in Python I'm currently developing in my
> spare
t really that different from what I suggested. And since my
example is based on your first example. It has a lot in common but the
arrangement (organization) is a bit different.
> Regards,
> Kay
Here's the current version... It now handles more complex equations
including exponents and
Kay Schluehr wrote:
> Ron Adam wrote:
>
>> Kay Schluehr wrote:
>> BTW.. Usually when people say "I don't want to discourage...", They
>> really want or mean the exact oppisite.
>
> Yes, but taken some renitence into account they will provoke the
&g
Peter Hansen wrote:
> Michael Hoffman wrote:
>
>> Reinhold Birkenfeld wrote:
>>
>>> Tony Meyer wrote:
>>>
Do people really like using __div__ to mean join?
>>>
>>>
>>> I'm not too happy with it, too, but do we have alternatives? ...
>>> Of course, one can use joinwith() if he doesn't like '
Toby Dickenson wrote:
> On Wednesday 27 July 2005 05:37, Meyer, Tony wrote:
>
>
>>I can see that this would make sense in some situations, but ISTM that it
>>would make a great deal more sense (and be much more intuitive) to have
>>concatenation include the separator character (i.e. be join).
>
Michael Hoffman wrote:
> Ron Adam wrote:
>
>> In all current cases, (that I know of), of differing types, '+' raises
>> an error.
>
>
> Not quite:
>
> >>> "hello " + u"world"
> u'hello world'
> >>
Peter Hansen wrote:
> Ron Adam wrote:
>
>> Michael Hoffman wrote:
>>
>>> Ron Adam wrote:
>>>
>>>> In all current cases, (that I know of), of differing types, '+'
>>>> raises an error.
>>>
>>>
>>>
Bengt Richter wrote:
> >
>
> Say, how about
>
> if Pathobject('gui://message_box/yn/continue
> processing?').open().read().lower()!='y':
> raise SystemExit, "Ok, really not continuing ;-)"
>
> An appropriate registered subclass for the given platform, returned when the
> Patho
Ivan Van Laningham wrote:
>>People can subclass Path and add it if they really want it. They can use
>>Jason's original module. My position is that the PEP without this use of
>>__div__ is (a) better as a standard module, and (b) improves the chance of
>>the PEP being accepted.
>>
>
>
> I dis
I'm wondering if a class that acts as a interface to a tree data
structure stored in a dictionary could also be useful as a base class
for accessing filesystems, urls, and zip (or rar) files.
Then a path object could then be used as a dictionary_tree key.
This idea seems much more useful to m
Brian Beck wrote:
> Ron Adam wrote:
>
>> This give a more general purpose for path objects. Working out ways
>> to retrieve path objects from a dictionary_tree also would be useful I
>> think. I think a Tree class would also be a useful addition as well.
>>
>
t all if anyone posted
improvements. (hint hint) ;-)
Cheers,
Ron Adam
+ output --
Define paths:
path1 = ['hello', 'world']
path2 = ['hello', 'there', 'world']
path3 = ['hello', 'there', 'wide',
giampiero mu wrote:
> hi everyone
Hi, you appear to be fairly new to Python, so you might want to take a
look at the tutorial at Python.org
Kents suggestion to use RE is good.
This should be faster than your example by quite a bit if you don't want
to use RE.
def controlla(test, size=4):
[EMAIL PROTECTED] wrote:
> I've heard 2 people complain that word 'global' is confusing.
>
> Perhaps 'modulescope' or 'module' would be better?
>
> Am I the first peope to have thought of this and suggested it?
>
> Is this a candidate for Python 3000 yet?
>
> Chris
After reading though some o
Simon Brunning wrote:
> On 8/14/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote:
>
>>After profiling a small python script I found that approximately 50% of
>>the runtime of my script was consumed by one line: "import copy".
>>Another 15% was the startup of the interpreter, but that is OK for an
>>
Antoon Pardon wrote:
> I disagree here. The problem with "global", at least how it is
> implemented in python, is that you only have access to module
> scope and not to intermediate scopes.
>
> I also think there is another possibility. Use a symbol to mark
> the previous scope. e.g. x would be t
Michael Hudson wrote:
> Simon Brunning <[EMAIL PROTECTED]> writes:
>
>
>>I think that copy is very rarely used. I don't think I've ever imported it.
>>
>>Or is it just me?
>
>
> Not really. I've used it once that I can recall, to copy a kind of
> generic "default value", something like:
>
> d
Martin v. Löwis wrote:
>>Can we at least undo this unfortunate move in time for 2.5? I would be
>>grateful
>>if *at least* the CJK codecs (which are like 1Mb big) are splitted out of
>>python25.dll. IMHO, I would prefer having *more* granularity, rather than
>>*less*.
>
> If somebody would formu
Martin v. Löwis wrote:
> Ron Adam wrote:
>
>>I would put the starting minimum boundary as:
>>
>> 1. "The minimum required to start the python interpreter with no
>>additional required files."
>>
>>Currently python 2.4 (on windows) does not
Is there any built-in way for BaseHTTPServer to handle multiple
connections at once, e.g. with threads? If not, can this existing
module be easily extended to do this, or will I have to do lower-level
socket things (and probably thus have to write my own HTTP code)?
Thanks.
Adam
--
http
is good enough for my current needs aside from
its lack of threading, does PooledThreadedServer have any advantages
over the method I linked above?
- Adam
--
http://mail.python.org/mailman/listinfo/python-list
roblems. Is there something
simple I'm forgetting to do? I'm out of ideas. Does anybody have any
ideas about how to attack this problem?
Thanks,
Adam Tomjack
--
http://mail.python.org/mailman/listinfo/python-list
chris patton wrote:
> I need to convert a python file to an '.exe'. I've tried py2exe, and I
> don't like it because you have to include that huge dll and libraries.
>
> Thanks for the Help!!
Do you want to create an exe to give to others, or so that you can use
it in windows easier just like a
elf.t = t
bin = {}
for a, b in foo:
x = 42 - a
bin_item = bin.setdefault(x, BinItem(1, 0))
bin_item.s += 1
for x, item in bin.iteritems():
print x, item.s, item.t
Luck in battle,
Adam
Randy Bush wrote:
> i have some code which looks kinda like
>
> bin = {}
>
ou can say:
bin_item = bin.setdefault(x, [0, 0])
bin_item[0] += 1
That should be equivalent. My example with the class is similarly broken.
Adam
Adam Tomjack wrote:
> Randy,
>
> I'd probably use a two element list.
>
> Instead of using an if/else to check if
why it disappears right away when you double click it),
but it also doesn't open than extra window when you use it to run a gui
application.
Adam
Beginner/Not Yet Programmer wrote:
> I've never programmed before, so I thought I'd try and learn a bit by
> using some Pytho
ach element, but for a block of code eight
lines long, doing anything more descriptive would be too verbose.
Adam
--
http://mail.python.org/mailman/listinfo/python-list
ith a class or a
dict so that each element has a name. On the flip side, using such a
heavy solution for such a simple problem also smells bad. The solution
should should be as complicated as the problem -- no more, no less.
Adam
Randy Bush wrote:
>>>bin = {}
>>>for wh
Antoon Pardon wrote:
> Op 2005-08-31, Bengt Richter schreef <[EMAIL PROTECTED]>:
>
>>On 31 Aug 2005 07:26:48 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
>>
>>
>>>Op 2005-08-30, Bengt Richter schreef <[EMAIL PROTECTED]>:
>>>
On 30 Aug 2005 10:07:06 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrot
Does anyone know anything about the aggdraw module for PIL? I think I
would like to use it because I need to do some drawing with
semi-transparent pen styles (I'm simulating using a highlighter). It
seems to be working great, but I think I'm running into a memory leak
that's noted in the documentat
You know, I tried doing it that way, and I must have done something
wrong the first time because I was getting an error. It works now
though, and it performs much better. Thanks!
I'll keep an eye out for the new version, that kind of timeframe will
be in plenty of time for the project I'm currentl
e month name using
a translation table for English to Dutch month names.
--
Adam Monsen
http://adammonsen.com/
(crossposted to Seattle Python Users List)
--
http://mail.python.org/mailman/listinfo/python-list
quot;%d %B %Y om %H:%M")
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/lib/python2.4/_strptime.py", line 292, in strptime
raise ValueError("time data did not match format: data=%s fmt=%s"
%
ValueError: time data did not match format: data=
n August 10th, 2005 in the Europe/Paris timezone
that daylight savings is in effect, and the equivalent UTC datetime
object should contain a time two hours prior. At least, that's what I
like to happen.
Also, anyone know if there is a more appropriate choice for timezone
than "Europe/Paris&q
Excellent! Thank you, Fredrik!
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
last):
File "", line 1, in ?
File "/usr/lib/python2.4/_strptime.py", line 292, in strptime
raise ValueError("time data did not match format: data=%s fmt=%s"
%
ValueError: time data did not match format: data=10 August 2005 at
17:26 fmt=%d %B %Y at %H:
ch back to previous locale
locale.setlocale(locale.LC_TIME, old_loc)
-->8--
If I try to do further date parsing in the same scope (with a different
locale), it fails. Let me know if you have any ideas about why.
--
Adam Monsen
http
The 9-integer time tuple could be fetched using the code posted here:
http://snipurl.com/hcvs
same URL, not snipped:
http://groups.google.com/group/comp.lang.python/msg/65d8f116dfd59dd1
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Ron Adam wrote:
>
>
>>The problem with negative index's are that positive index's are zero
>>based, but negative index's are 1 based. Which leads to a non
>>symmetrical situations.
>
>
> indices point to the "gap&q
Terry Reedy wrote:
> "Ron Adam" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Fredrik Lundh wrote:
>>
>>>Ron Adam wrote:
>>>
>>>>The problem with negative index's are that positive index'
Terry Reedy wrote:
>>b[-1:] = ['Z']# replaces last item
>>b[-1:-0] = ['Z'] # this doesn't work
>>
>>If you are using negative index slices, you need to check for end
>>conditions because you can't address the end of the slice in a
>>sequential/numerical way.
>
> OK, now I understand
Bengt Richter wrote:
> IMO the problem is that the index sign is doing two jobs, which for zero-based
> reverse indexing have to be separate: i.e., to show direction _and_ a _signed_
> offset which needs to be realtive to the direction and base position.
Yes, that's definitely part of it.
> A l
y, it would be nice to get
a few opinions at this point. So blast away... or hopefully tell me
what you like about it instead. ;-)
(Any suggestions or contributions to make it better would be appreciated.)
Cheers,
Ron Adam
"""
IMPROVED SLICING
Slicing is one
Terry Reedy wrote:
> "Ron Adam" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Slicing is one of the best features of Python in my opinion, but
>>when you try to use negative index's and or negative step increments
>>it can be
Patrick Maupin wrote:
>>After considering several alternatives and trying out a few ideas with a
>> modified list object Bengt Richter posted, (Thank You), I think I've
>>found a way to make slice operation (especially far end indexing)
>>symmetrical and more consistent.
>
>
> I don't know that
Scott David Daniels wrote:
> Magnus Lycka wrote:
>
>> Ron Adam wrote:
>>
>>> ONES BASED NEGATIVE INDEXING
>
>
> I think Ron's idea is taking off from my observation that if one's
> complement, rather than negation, was used to specify measure
Szabolcs Nagy wrote:
> with the current syntax L[i:i+1] returns [L[i]], with nxlist it returns
> L[i+1] if i<0.
>
> L=range(10)
> L[1:2]==[L[1]]==[1]
> L[-2:-1]==[L[-2]]==[8]
>
> L=nxlist(range(10))
> L[1:2]==[L[1]]==[1]
> L[-2:-1]==[L[-1]]==[9] # not [L[-2]]
>
> IMHO in this case current list
Magnus Lycka wrote:
> Ron Adam wrote:
>
>> Slicing is one of the best features of Python in my opinion, but
>> when you try to use negative index's and or negative step increments
>> it can be tricky and lead to unexpected results.
>
>
> Hm... Just as w
Fredrik Lundh wrote:
> Steve Holden wrote:
>
>
>>Yes, I've been surprised how this thread has gone on and on.
>
>
> it's of course a variation of
>
> "You can lead an idiot to idioms, but you can't make him
> think ;-)"
>
> as long as you have people that insist that their original m
Steve Holden wrote:
> It's a common misconception that all ideas should be explainable simply.
> This is not necessarily the case, of course. When a subject is difficult
> then all sorts of people bring their specific misconceptions to the
> topic, and suggest that if only a few changes were ma
Bengt Richter wrote:
> On Mon, 5 Sep 2005 18:09:51 +0200, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
> OTOH, ISTM we must be careful not to label an alternate alpha-version
> "way to model the real world" as a "misunderstanding" just because it is
> alpha,
> and bugs are apparent ;-)
Thanks! I
Terry Reedy wrote:
>>Ron Adam wrote:
>>
>>
>>>However, I would like the inverse selection of negative strides to be
>>>fixed if possible. If you could explain the current reason why it does
>>>not return the reverse order of the selected ra
Patrick Maupin wrote:
> I previously wrote (in response to a query from Ron Adam):
>
>
>>In any case, you asked for a rationale. I'll give you mine:
>>
>>
>>>>>L = range(10)
>>>>>L[3:len(L):-1] == [L[i] for i in range(3,len(L),-1)]
Steve Holden wrote:
> Ron Adam wrote:
>
>> Steve Holden wrote:
>>
>> What misconception do you think I have?
>>
> This was not an ad hominem attack but a commentary on many attempts to
> "improve" the language.
Ok, No problem. ;-)
>> No o
Patrick Maupin wrote:
> Ron Adam wrote:
>
>
>>>This should never fail with an assertion error. You will note that it
>>>shows that, for non-negative start and end values, slicing behavior is
>>>_exactly_ like extended range behavior.
>
>
>>Yes,
Magnus Lycka wrote:
> Ron Adam wrote:
>
>> Ok, lets see... This shows the problem with using the gap indexing
>> model.
>>
>> L = range(10)
>>
>> [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] # elements
>> 0 1 2 3 4 5 6 7 8 9
Bengt Richter wrote:
> Then the question is, do we need sugar for reversed(x.[a:b])
> or list(reversed(x.[a:b])) for the right hand side of a statement,
> and do we want to to use both kinds of intervals in slice assignment?
> (maybe and yes ;-)
Yes, I think this is the better way to do it, as th
st disabling networking within that virtual
machine would possibly work, too.
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
ctags indexes procedures/variables in source code, perhaps it would
help: http://ctags.sf.net/
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
I know very little about socket programming and even less about
sockey.py... any idea what behavior would have to be modified?
Further complicating matters (for me), it appears some of the socket
programming code is in C, and my C skills are lacking.
--
Adam Monsen
http://adammonsen.com
_)
return 'name="%(name)s" value="%(value)s' % vals
j = J()
j.name = "j object"
print j
>8
A couple of questions:
* is there a simpler or more elegant way to do this?
* how can I get this to work for new-style
#x27; % vals
> What's wrong with the obvious version:
[...]
Oh, that looks nice and clean. I like it.
I also found a recipe in the Python cookbook that works great for
"dumping" objects:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/137951
(shortened: http://snipurl.com/
Nice!!
Since that works, this also works (any socket operations appear to
raise an IOError):
import socket
socket.setdefaulttimeout(0)
Thanks!
-Adam
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
t f.read()
>From this code I get the following exception:
"IOError: [Errno socket error] timed out"
...and that fits my needs nicely.
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
Michael Hudson wrote:
> Ron Adam <[EMAIL PROTECTED]> writes:
>>With current slicing and a negative step...
>>
>>[ 1 2 3 4 5 6 7 8 9 ]
>> -9 -8 -7 -6 -5 -4 -3 -2 -1 -0
>>
>>r[-3:] -> [7, 8, 9]# as expected
>&
Kirk Job Sluder wrote:
> The only way to keep confidential stuff secure is to shred it, burn it,
> and grind the ashes.
>
> I think the fundamental problem is that that most customers don't want
> actual security. They want to be able to get their information by
> calling a phone number and sa
James Stroud wrote:
> On Saturday 10 September 2005 15:02, Ron Adam wrote:
>
>>Kirk Job Sluder wrote:
>>I would think that any n digit random number not already in the data
>>base would work for an id along with a randomly generated password that
>>the student
Kirk Job Sluder wrote:
> Ron Adam <[EMAIL PROTECTED]> writes:
>>I would think that any n digit random number not already in the data
>>base would work for an id along with a randomly generated password
>>that the student can change if they want. The service provid
attr_matches = attrs_re.finditer(d.get('attrs', None))
for match in attr_matches:
da = match.groupdict()
name = da.get('name', None)
a[name] = da.get('value', None)
ancs.append(a)
return ancs
if __name__ == '__mai
o that bug.
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
I've got a wxPython based windows GUI application that takes some input
and creates a PDF file output. At the end, I need to create an email
message with this pdf file attached ready for the user to just hit
"send". I don't want to actually send the email automatically, I just
want to pop up a mess
url:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/ce4909280561458b/
).
I did notice that the Python docs mention %Z is deprecated, so
http://snipurl.com/hoqz is possibly the best solution available for
now.
Thoughts?
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the MAPI suggestion. I did a bit more googling, and combined
a few things, along with some trial and error to come up with something
that works. Here it is for posterity:
import win32com.client
olMailItem = 0x0
obj = win32com.client.Dispatch("Outlook.App
Paul Rubin wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> writes:
>
>>But there is a difference: writing assembly is *hard*, which is why we
>>prefer not to do it. Are you suggesting that functional programming is
>>significantly easier to do than declarative?
>
>
> I think you mean imperative. Y
Terry Reedy wrote:
> You cannot tell whether a function object will act
> recursive or not just by looking at its code body. Trivial examples:
I was thinking last night that maybe it would be useful to be able to
define a function explicitly as a recursive object where it's frame is
reused on
10, 17, 26, 0, 2, 222, 1)
Works (unsuprisingly) as advertised at the bottom of this page:
http://docs.python.org/lib/module-time.html
And now I'm a little closer to understanding why. :)
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
;in A.f()"
By "wrong" I mean, is there any reason why this is just a Bad Idea?
Seems helpful to me, if I change the name of the 'B' class, I don't
have to change super() calls as well.
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
Brett Cannon fixed this bug last week. Thanks, Brett!
--
Adam Monsen
http://adammonsen.com/
--
http://mail.python.org/mailman/listinfo/python-list
While playing around with the inspect module I found that the
Blockfinder doesn't recognize single line function definitions.
Adding the following two lines to it fixes it, but I'm not sure if it
causes any problems anywhere else.
elif self.indent == 0:
raise EndOfBlock, self.las
Delaney, Timothy (Tim) wrote:
> Ron Adam wrote:
>
>
>>While playing around with the inspect module I found that the
>>Blockfinder doesn't recognize single line function definitions.
>>
>>Adding the following two lines to it fixes it, but I'm not sur
Steven D'Aprano wrote:
> On Mon, 19 Sep 2005 12:16:15 +0200, sven wrote:
>
>
>>to make sure that an operation yields a boolean value wrap a bool()
>>around an expression.
>>None, 0 and objects which's len is 0 yield False.
>>so you can also do stuff like that:
>
>
> Are there actually any usa
[EMAIL PROTECTED] wrote:
> Dear all,
>
> Can anyone point me to a resource that describes the best way of
> organising a python project? My project (gausssum.sf.net) is based
> around a class, and has a GUI that allows 'easy-access' to the methods
> of the class. What is the best or typical direc
Steven D'Aprano wrote:
>>So..
>>
>>bool(a and b) * value
>>
>>Would return value or zero, which is usually what I want when I do this
>>type of expression.
> That's all very interesting, and valuable advice for somebody who doesn't
> understand how Python's logical operators work, but the qu
Steven D'Aprano wrote:
> Ah, that's a good example, thanks, except I notice you didn't actually
> cast to bool in them, eg: (min < value < max) * value
It wasn't needed in these particular examples. But it could be needed
if several comparisons with 'and' between them are used.
It just seems o
401 - 500 of 1390 matches
Mail list logo