Terry Hancock wrote:
> On Friday 01 July 2005 03:36 pm, Ron Adam wrote:
>
>>I find map too limiting, so won't miss it. I'm +0 on removing lambda
>>only because I'm unsure that there's always a better alternative.
>
>
> Seems like some new
Ralf W. Grosse-Kunstleve wrote:
> class grouping:
>
> def __init__(self, .x, .y, .z):
> # real code right here
The way this would work seems a bit inconsistent to me. Args normally
create local variables that receive references to the objects passed to
them.
In this c
Terry Hancock wrote:
> My general attitude towards IDEs and editors has been
> extremely conservative, but today I decided to see what
> this "folding" business was all about.
>
> I see that vim (and gvim, which is what I actually use)
> has this feature, and it is fairly nice, but at present i
Steven D'Aprano wrote:
> On Sat, 02 Jul 2005 20:26:31 -0700, Devan L wrote:
>
>
>> Claiming that sum etc. do the same job is the whimper of
>>someone who doesn't want to openly disagree with Guido.
>>
>>Could you give an example where sum cannot do the job(besides the
>>previously mentioned prod
Erik Max Francis wrote:
> Ron Adam wrote:
>> I'm just estimating, but I think that is the gist of adding those two
>> in exchange for reduce. Not that they will replace all of reduce use
>> cases, but that sum and product cover most situations and can be
>> i
Bengt Richter wrote:
> What if parameter name syntax were expanded to allow dotted names as binding
> targets in the local scope for the argument or default values? E.g.,
>
> def foometh(self, self.x=0, self.y=0): pass
>
> would have the same effect as
>
> def foometh(self, self.y=0, se
Steven D'Aprano wrote:
> On Sun, 03 Jul 2005 19:31:02 +0000, Ron Adam wrote:
>
>
>>First on removing reduce:
>>
>>1. There is no reason why reduce can't be put in a functional module
>
>
> Don't disagree with that.
>
>
>>or
>
Erik Max Francis wrote:
> Ron Adam wrote:
>
>> Each item needs to stand on it's own. It's a much stronger argument
>> for removing something because something else fulfills it's need and
>> is easier or faster to use than just saying we need x becaus
Terry Hancock wrote:
> On Saturday 02 July 2005 10:35 pm, Terry Hancock wrote:
>
>>I tried to load a couple of different scripts to
>>automatically fold Python code in vim, but none of them
>>seems to do a good job.
>>
>>I've tried:
>>python_fold.vim by Jorrit Wiersma
>>http://www.vim.org/sc
George Sakkis wrote:
> And finally for recursive flattening:
>
> def flatten(seq):
> return reduce(_accum, seq, [])
>
> def _accum(seq, x):
> if isinstance(x,list):
> seq.extend(flatten(x))
> else:
> seq.append(x)
> return seq
>
>
flatten(seq)
>
> [1, 2, 3,
---
The results on Python 2.3.5: (maybe someone can try it on 2.4)
recursive flatten: 23.6332723852
flatten in place-non recursive: 22.1817641628
recursive-no copies: 30.909762833
smallest recursive: 35.2678756658
non-recursive flatten in place without copies: 7.8551944451
A 300% improvement!!!
This shows the value of avoiding copies, recursion, and extra function
calls.
Cheers,
Ron Adam
--
http://mail.python.org/mailman/listinfo/python-list
> Ok... How about a non-recursive flatten in place? ;-)
>
> def flatten(seq):
> i = 0
> while i!=len(seq):
> while isinstance(seq[i],list):
> seq.__setslice__(i,i+1,seq[i])
> i+=1
> return seq
>
> seq = [[1,2],[3],[],[4,[5,6]]]
> print flatten(seq)
>
> I
Tom Anderson wrote:
>
> We really ought to do this benchmark with a bigger list as input - a few
> thousand elements, at least. But that would mean writing a function to
> generate random nested lists, and that would mean specifying parameters
> for the geometry of its nestedness, and that wou
Terry Reedy wrote:
> I also suspect that the years of fuss over Python's lambda being what it is
> rather that what it is 'supposed' to be (and is in other languages) but is
> not, has encourage Guido to consider just getting rid of it. I personally
> might prefer keeping the feature but using
Terry Reedy wrote:
> "George Sakkis" <[EMAIL PROTECTED]> wrote in message
>>So, who would object the full-word versions for python 3K ?
>>def -> define
>>del -> delete
>>exec -> execute
>
>
> These three I might prefer to keep.
>
>
>>elif -> else if
>
>
> This one I dislike and would prefer
Robert Kern wrote:
> Dan Bishop wrote:
>
>> There's also the issue of having to rewrite old code.
>
>
> It's Python 3000. You will have to rewrite old code regardless if reduce
> stays.
>
And from what I understand Python 2.x will still be maintained and
supported. It will probably be more
Tom Anderson wrote:
>> del -> delete
>
>
> How about just getting rid of del? Removal from collections could be
> done with a method call, and i'm not convinced that deleting variables
> is something we really need to be able to do (most other languages
> manage without it).
Since this is a
Dan Sommers wrote:
> On Wed, 06 Jul 2005 14:33:47 GMT,
> Ron Adam <[EMAIL PROTECTED]> wrote:
>
>
>>Since this is a Python 3k item... What would be the consequence of
>>making None the default value of an undefined name? And then assigning
>>
Steven D'Aprano wrote:
> On Wed, 06 Jul 2005 10:00:02 -0400, Jp Calderone wrote:
>
>
>>On Wed, 06 Jul 2005 09:45:56 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote:
>>
>>>Tom Anderson wrote:
>>>
How about just getting rid of del? Removal from collections could be
done with a method call, an
Devan L wrote:
>># from a custom numeric class
>># converts a tuple of digits into a number
>>mantissa = sign * reduce(lambda a, b: 10 * a + b, mantissa)
>
>
> I'll admit I can't figure out a way to replace reduce without writing
> some ugly code here, but I doubt these sorts of things appear of
Dan Sommers wrote:
>> AttributeError: 'NoneType' object has no attribute 'read'
>
>
> This is the one of which I was thinking. So you see this error at the
> end of a (long) traceback, and try to figure out where along the (long)
> line of function calls I typed the wrong name. Currently,
Scott David Daniels wrote:
> Ron Adam wrote:
>
>> Dan Sommers wrote:
>>
>>> Lots more hard-to-find errors from code like this:
>>> filehandle = open( 'somefile' )
>>> do_something_with_an_open_file( file_handle )
>>> fil
Ron Adam wrote:
> And accessing an undefined name returned None instead of a NameError?
I retract this. ;-)
It's not a good idea. But assigning to None as a way to unbind a name
may still be an option.
--
http://mail.python.org/mailman/listinfo/python-list
Stian Søiland wrote:
> On 2005-07-06 16:33:47, Ron Adam wrote:
>
>
>>*No more NamesError exceptions!
>> print value
>> >> None
>
>
> So you could do lot's of funny things like:
>
> def my_fun(extra_args=None):
>
Reinhold Birkenfeld wrote:
> Ron Adam wrote:
>
>>Ron Adam wrote:
>>
>>
>>>And accessing an undefined name returned None instead of a NameError?
>>
>>I retract this. ;-)
>>
>>It's not a good idea. But assigning to None as a way
Benji York wrote:
> Ron Adam wrote:
>
>> "if extraargs:" would evaluate to "if None:", which would evaluate to
>> "if:" which would give you an error.
>
>
> In what way is "if None:" equivalent to "if:"?
> --
>
Grant Edwards wrote:
> On 2005-07-06, Ron Adam <[EMAIL PROTECTED]> wrote:
>
>
>>It would be a way to set an argument as being optional without actually
>>assigning a value to it. The conflict would be if there where a global
>>with the name baz as well. Pro
Stian Søiland wrote:
> Or what about a recursive generator?
>
> a = [1,2,[[3,4],5,6],7,8,[9],[],]
>
> def flatten(item):
> try:
> iterable = iter(item)
> except TypeError:
> yield item # inner/final clause
> else:
> for elem in
Grant Edwards wrote:
> On 2005-07-07, Ron Adam <[EMAIL PROTECTED]> wrote:
>
>>Grant Edwards wrote:
>>
>>
>>>On 2005-07-06, Ron Adam <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>
>>>>It would be a way to set an argument
Mike Meyer wrote:
> Ron Adam <[EMAIL PROTECTED]> writes:
>
>>So doing this would give an error for functions that require an argument.
>>
>> def foo(x):
>> return x
>>
>> a = None
>> b = foo(a)# error because a dissap
Reinhold Birkenfeld wrote:
> Ron Adam wrote:
>
>
>>Given the statement:
>>
>>a = None
>>
>>And the following are all true:
>>
>> a == None
>
>
> Okay.
>
>
>>(a) == (None)
>
>
> Okay.
>
>
>>(a) =
Steven D'Aprano wrote:
> On Thu, 07 Jul 2005 09:36:24 +, Duncan Booth wrote:
>
>
>>Steven D'Aprano wrote:
>>
>>>This is something I've never understood. Why is it bad
>>>form to assign an "anonymous function" (an object) to a
>>>name?
>>
>>Because it obfuscates your code for no benefit. Yo
Grant Edwards wrote:
> On 2005-07-07, Ron Adam <[EMAIL PROTECTED]> wrote:
>>>>>>It would be a way to set an argument as being optional without
>>>>>>actually assigning a value to it.
>>
>>So it would still work like you expect even tho
Steven D'Aprano wrote:
> Ron Adam wrote:
>
>> Why would you want to use None as an integer value?
>>
>> If a value isn't established yet, then do you need the name defined?
>> Wouldn't it be better to wait until you need the name then give it a
>
Christopher Subich wrote:
> As others have mentioned, this looks too much like a list comprehension
> to be elegant, which also rules out () and {}... but I really do like
> the infix syntax.
Why would it rule out ()?
You need to put a lambda express in ()'s anyways if you want to use it
righ
Erik Max Francis wrote:
> Ron Adam wrote:
>
>> It's not an empty tuple, it's an empty parenthesis. Using tuples it
>> would be.
>>
>> (a,) == (,)
>>
>> which would be the same as:
>>
>> (,) == (,)
>
>
> &
Erik Max Francis wrote:
> Ron Adam wrote:
>
>> Well in my previous explanation I *mean* it to be empty parenthesis.
>>
>> Does that help?
>
>
> Maybe it might be beneficial to learn a little more of the language
> before proposing such wide-reaching
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
Kay Schluehr wrote:
> Hi Ron,
>
> I really don't want to discourage you in doing your own CAS but the
> stuff I'm working on is already a bit more advanced than my
> mono-operational multiplicative algebra ;)
I figured it was, but you offered a puzzle:
"Here might be an interesting puzzle f
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
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
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
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
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
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
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
101 - 200 of 396 matches
Mail list logo