Kay Schluehr [EMAIL PROTECTED] writes:
Having a good FFI is certainly an important feature but Python
programs should first and foremost be Python programs.
Python was originally created as an extension language for C. In some
sense it is an abstraction layer for C libs.
I'd have to
Cliff Wells [EMAIL PROTECTED] writes:
The second presentation (I don't recall the speaker's name) specifically
covered metaprogramming (writing DSLs) and one of the things I found
interesting was that despite Ruby having far more syntax than Python in
general, the resulting Ruby-based DSLs
Donn Cave [EMAIL PROTECTED] writes:
I'm not sure what you mean by that about OCAML. That its functional
model is not pure enough? I'd like to look at Haskell as well, but I
have the impression that its implementation is not as serious as
OCaml's, i.e. no native-code compiler.
On the
Evil Bastard [EMAIL PROTECTED] writes:
Yes, this approach sucks. But can anyone offer any suggestions which
suck less?
I don't think you want to do this. Runtime type tags and the overhead
of checking them on every operation will kill you all by themselves.
Processors like that haven't been
Mike Meyer [EMAIL PROTECTED] writes:
Well, I tried sending this via email, but I can't derive a valid
address from Paul's anti-spammed address.
Yeah, I should update that url since they turned off the forwarding.
It should be http://paulrubin.com. But a thread titled decline and
fall of
bill [EMAIL PROTECTED] writes:
What's the pythonic thing to do here? How can I
guarantee timely response to the creation of a file in the directory
referenced by fd?
Use asynchronous calls and/or a separate thread.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
This is on Linux... I have a daemon running as root and I want to
execute another Python program as another user (a regular user). I have
the name of the user and can use the 'pwd' and 'grp' modules to get
that user's user and group ids. What I don't
Michael Goettsche [EMAIL PROTECTED] writes:
Assuming the server accepts connections in an endless loop, how
would I handle communication without additional threads and create
new games in that loop? Could you give me pseudo-code for this?
I've always done this kind of thing with the
David Isaac [EMAIL PROTECTED] writes:
Just found this:
http://trevp.net/tlslite/
I haven't even had time to try it,
but I thought you'd want to know.
Tlslite is a very well done and promising package, but in its present
form it's not really complete. It's missing important functionality
(the
Mateusz £oskot [EMAIL PROTECTED] writes:
Thank you for any piece of advice in advance.
Ask yourself why you want a GUI toolkit. Maybe you can write a web
application instead, and use a browser as the GUI. That's a lot
easier to write (just use html), and makes it trivial to run the
application
[EMAIL PROTECTED] (Bengt Richter) writes:
built-in concurrency support. OCaml seems to crush Haskell and Erlang
(and even Java) in performance. Occam isn't used for much practical
any more, but takes a purist approach to concurrency that seems worth
studying.
IIRC, I've seen something about
Paul Rubin http://[EMAIL PROTECTED] writes:
So I think a (maybe not achievable) performance goal
is for the web app to use 50% of the available cycles making html, and
the other 50% go to gzipping the html. That means that the app should
make dynamic output as fast as gzip can compress
Carl [EMAIL PROTECTED] writes:
IBITS(I, POS, LEN)
Extracts a sequence of bits.
The result has the value of the sequence of LEN bits in I beginning at bit
POS, right-adjusted and with all other bits zero.
The bits are numbered from 0 to BIT_SIZE(I)-1, from right to left.
Examples
IBITS
[EMAIL PROTECTED] writes:
i tried using type(var) but that only seemed to produce a response in the
command line.
is there a built in python function to determine if a variable is an
integer?
type(var) returns the type. For example:
if type(x) == type(3):
print 'x is an
km [EMAIL PROTECTED] writes:
is true parallelism possible in python ? or atleast in the coming versions ?
is global interpreter lock a bane in this context ?
http://poshmodule.sf.net
--
http://mail.python.org/mailman/listinfo/python-list
Robin Becker [EMAIL PROTECTED] writes:
http://poshmodule.sf.net
Is posh maintained? The page mentions 2003 as the last date.
Dunno, and I suspect not. I've been wondering about it myself.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
import itertools
f = open(blah.txt, r)
for c in itertools.chain(*f):
print c
# ...
The f is iterable itself, yielding a new line from the file every time.
Lines are iterable as well, so the itertools.chain iterates through each
line and yields a
42 [EMAIL PROTECTED] writes:
Googling for information on securing Python in a sandbox seems
indicate that there are some built in features, but they aren't really
trustworthy. Is that correct?
Yes.
For my purposes, I really just want to let users run in a sandbox, with
access to only the
42 [EMAIL PROTECTED] writes:
I want the 'worst case' a malicious script to be able to accompish to be
a program crash or hang.
You should not rely on Python to provide any kind of security from
malicious users who can run Python scripts.
--
Robert Kern [EMAIL PROTECTED] writes:
http://www.catb.org/~esr/faqs/smart-questions.html
Is it a *smart* way or *necessary* way?
It's the polite way. And probably the only way you're going to get
your questions actually answered.
I wonder if there's a way to killfile posts that contain
Mike Meyer [EMAIL PROTECTED] writes:
Even simpler to program in is the model used by Erlang. It's more CSP
than threading, though, as it doesn't have shared memory as part of
the model. But if you can use the simpler model to solve your problem
- you probably should.
Well, ok, the Python
James Sungjin Kim [EMAIL PROTECTED] writes:
Now I realized that Command 'lambda' is a similar to Command 'inline'
in C++. In addition, Command 'iter' is something new but not much new
to c engineers, since it is related to 'for loops', e.g.,
Actually not related at all. Nothing like lambda or
Chris Tavares [EMAIL PROTECTED] writes:
Is this normal behavior for urllib? Is there a way to force that initial
socket closed earlier? Is there something else I need to do?
I'd say open a sourceforge bug. There may be a way around it with the
fancy opener methods of urllib2, but it's a bug if
Bryan Olson [EMAIL PROTECTED] writes:
seq[3 : -4]
we write:
seq[3 ; $ - 4]
+1
When square-brackets appear within other square-brackets, the
inner-most bracket-pair determines which sequence '$' describes.
(Perhaps '$$' should be the length of the next containing
bracket
Reinhold Birkenfeld [EMAIL PROTECTED] writes:
Don't forget
for line in f:
for c in line:
# do stuff
As mentioned before, that's careless programming, since it can read
the whole file into memory if the file contains no newlines.
--
Chris Tavares [EMAIL PROTECTED] writes:
Is there a way to do HTTP 1.1 with urllib? The docs say 0.9 and 1.0 only.
I'm not sure. Try urllib2, but I'm still not sure.
--
http://mail.python.org/mailman/listinfo/python-list
Greg McIntyre [EMAIL PROTECTED] writes:
while c = f.read(1):
# ...
I couldn't find any general PEPs along these lines, only specific ones
(e.g. 308 re. an if-then-else expression).
I often end up doing something like this:
class foo:
def set(self, x):
self.x = x
Fredrik Lundh [EMAIL PROTECTED] writes:
(Python has even been told to be used by Yahoo! and Google, among others,
but nobody was able to demonstrate this, so far)
hint:
http://mail.google.com/support/bin/answer.py?answer=6554
I don't see anything about Python at that url. I've heard
class x: pass
z = x()
z.a = 'a'
d = {'a': z}
for i in range(5):
print id(d['a'])
prints the same id 5 times as you'd expect.
d = shelve('filename')
d['a'] = z
for i in range(5):
print id(d['a'])
prints five different id's. So, for example,
y =
Richie Hindle [EMAIL PROTECTED] writes:
I can't speak for linode.org, but I have a Xen VPS from rimuhosting.com
and it's early days but so far I've been very impressed. It's $19/mo
(normally $20 but they kindly gave me a 5% Open Source Developer discount)
Do you get enough resources in that
Steve Holden [EMAIL PROTECTED] writes:
As far as position reporting goes, it seems pretty clear that find()
will always report positive index values. In a five-character string
then -1 and 4 are effectively equivalent.
What on earth makes you call this a bug? And what are you proposing
that
Mike Meyer [EMAIL PROTECTED] writes:
Another advantage is that evewry internet-enabled computer today already
comes with an HTML renderer (AKA browser)
No, they don't. Minimalist Unix distributions don't include a browser
by default. I know the BSD's don't, and suspect that gentoo Linux
Nice. Note that the Sourceforge bug for this issue indicates that
something is already being done about it. It just happens to have
been updated a day or so ago:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1123660group_id=5470
Note to skeptics: the attacks are pretty serious.
Bryan Olson [EMAIL PROTECTED] writes:
The module provides classes and functions. The functions are:
string_to_hex(str): Return a string with two hex digits for
each byte of str, representing the ord() of the byte. The
case of the hex digits A-F/a-f is up to Python's built-in
Terry Reedy [EMAIL PROTECTED] writes:
I agree in this sense: the use of any int as an error return is an
unPythonic *nix-Cism, which I believe was copied therefrom. Str.find is
redundant with the Pythonic exception-raising str.index and I think it
should be removed in Py3.
I like having
Kenneth McDonald [EMAIL PROTECTED] writes:
I'm curious about this because, quite aside their function as web
browsers, it is now possible to build some very useable interfaces
using browsers with HTML, CSS, and JavaScript. (The biggest problem
is still the lack of a decent text widget.)
Terry Reedy [EMAIL PROTECTED] writes:
The try/except pattern is a pretty basic part of Python's design. One
could say the same about clutter for *every* function or method that raises
an exception on invalid input. Should more or even all be duplicated? Why
just this one?
Someone must
[EMAIL PROTECTED] (phil hunt) writes:
Let's see. Reality is that writing correct programs is hard. Writing
correct programs that use concurrency is even harder, because of the
exponential explosion of the order that operations can happen
in. Personally, I'm willing to use anything I can find
Steve Holden [EMAIL PROTECTED] writes:
Of course. But onc you (sensibly) decide to use an if then there
really isn't much difference between -1, None, () and sys.maxint as
a sentinel value, is there?
Of course there is. -1 is (under Python's perverse semantics) a valid
subscript. sys.maxint
Steve Holden [EMAIL PROTECTED] writes:
If you want an exception from your code when 'w' isn't in the string
you should consider using index() rather than find.
The idea is you expect w to be in the string. If w isn't in the
string, your code has a bug, and programs with bugs should fail as
Steve Holden [EMAIL PROTECTED] writes:
A corrected find() that returns None on failure is a five-liner.
If I wanted to write five lines instead of one everywhere in a Python
program, I'd use Java.
--
http://mail.python.org/mailman/listinfo/python-list
Chris Dewin [EMAIL PROTECTED] writes:
(1) Can this be done with python? If so, what module do I need to look up?
You could do it with PIL, or run jpegtran in an external process.
jpegtran may be easier.
--
http://mail.python.org/mailman/listinfo/python-list
Adriaan Renting [EMAIL PROTECTED] writes:
He seems to think the GNU man pages are nice, but I find them very
awkward as they have no hierarchical organization, and most miss examples.
The GNU man pages are an afterthought to meet expectations of Un*x
users who were used to man pages and the man
Fredrik Lundh [EMAIL PROTECTED] writes:
You could do it with PIL, or run jpegtran in an external process.
jpegtran may be easier.
eh? are you sure you know what jpegtran does?
JPEGTRAN(1)
Whoops, sorry, right, jpegtran is for rotating the images. I meant:
use a pipeline like
rh0dium [EMAIL PROTECTED] writes:
Thanks much - Alternatively if anyone else has a better way to do what
I am trying to get done always looking for better ways. I still want
this to work though..
You don't have to use select, since you can use timeouts with normal
socket i/o. So you could
Sidd [EMAIL PROTECTED] writes:
I tried finding and example of multithreaded client-serve program in
python. Can any one please tell me how to write a multithreaded
client-server programn in python such that
1.It can handle multiple connections
2.It uses actual threads and not select() or
Terry Reedy [EMAIL PROTECTED] writes:
The fact that the -1 return *has* lead to bugs in actual code is the
primary reason Guido has currently decided that find and rfind should go.
A careful review of current usages in the standard library revealed at
least a couple bugs even there.
Really
Terry Reedy [EMAIL PROTECTED] writes:
Really it's x[-1]'s behavior that should go, not find/rfind.
I complete disagree, x[-1] as an abbreviation of x[len(x)-1] is extremely
useful, especially when 'x' is an expression instead of a name.
There are other abbreviations possible, for example
[EMAIL PROTECTED] writes:
What it does do, is handle each request (from the same client too) in a
new separate thread. Convenient if your processing intensive handle may
otherwise slow down the main server process becoming less responsive to
other requests.
What it doesn't do (and what Sidd
Bryan Olson [EMAIL PROTECTED] writes:
Specifically, to support new-style slicing, a class that
accepts index or slice arguments to any of:
__getitem__
__setitem__
__delitem__
__getslice__
__setslice__
__delslice__
Meo [EMAIL PROTECTED] writes:
Somebody understand what's going on here?
Yes, []*3 gives you three references to the same empty list, not three
separate empty lists. You need something like
[[] for i in xrange(3)]
to get separate lists.
Another example:
a = [1,2,3]
b = a
a[0]
Evil Bastard [EMAIL PROTECTED] writes:
Has anyone done any serious work on producing a subset of python's
language definition that would suit it to a tiny microcontroller
environment?
We just had this thread a few weeks ago and you decided to use FORTH
that time. The answers are the same this
jdonnell [EMAIL PROTECTED] writes:
This script has worked without a problem for months, but I did make
some changes recently. I don't see how those changes would cause
this error though. It's also on a VPS so it's possible that they
changed something in the OS. Does anyone have any suggestions
Michael Sparks [EMAIL PROTECTED] writes:
A plausible theory. I have some possibly-illustrative examples
of what I ran into within the last few weeks.
hypothetical Did you take what you learnt, and use that to create better
documentation to be posted on python's SF project as a patch?
Mike Meyer [EMAIL PROTECTED] writes:
Sure. I tried to be helpful there, but maybe I need to be more
specific. The ref from my previous post, Google-able as The
C10K problem is good but now a little dated.
That appears to be a discussion on squeezing the most out of a network
server,
talin at acm dot org [EMAIL PROTECTED] writes:
membership within a container -- instead we're testing for membership
with a type hierarchy, where 'type' can be defined to mean whatever the
programmer wants.
Well, if type means a (possibly infinite) set of objects, then you
can use in. E.g, 3
Alessandro Bottoni [EMAIL PROTECTED] writes:
1) What would you use to decrypt the messages? The GPG module created by
Andrew Kuchling is declared incomplete and no more maintained on his
web pages (http://www.amk.ca/python/code/gpg) so I think it is out of the
game.
I think I'd just run gpg
Fredrik Lundh [EMAIL PROTECTED] writes:
another problem is that to be able to do really good work on the
documentation, you need to know things well enough to have the
big picture. and once you have that, you'll find that the docs aren't
really as bad as you once thought they were.
One thing
[EMAIL PROTECTED] writes:
I suspect he was trying to say that BaseHTTPServer has no mechanism for
handling state. As you know, of course, this is most relevant across
multiple successive connections to a server from the same client, and
has little to do with threads.
Usually you would do
Ron Adam [EMAIL PROTECTED] writes:
All of the following get the center 'd' from the string.
a = 'abcdefg'
print a[3] # d 4 gaps from beginning
print a[-4]# d 5 gaps from end
print a[3:4] # d
print a[-4:-3] # d
print a[-4:4] # d
print a[3:-3] # d
Fred L. Drake, Jr. [EMAIL PROTECTED] writes:
Ideally, emails to docs at python.org would result in issues being
created somewhere, simply so they don't get lost. It probably
doesn't make sense for those to land in SourceForge automatically,
since then everyone has to read every plea for a
Michael Sparks [EMAIL PROTECTED] writes:
I've submitted a number of doc bugs to sourceforge and the ones that
are simple errors and omissions do get fixed.
Cool.
Better than nothing, but it's only one class of problem, and maybe the
easiest kind to report.
There's another type of doc
Laguna [EMAIL PROTECTED] writes:
I want to find the expiration date of stock options (3rd Friday of the
month) for an any give month and year. I have tried a few tricks with
the functions provided by the built-in module time, but the problem was
that the 9 element tuple need to be populated
[EMAIL PROTECTED] writes:
Also, not that long ago must mean different things for different people.
I think we've required logins for three years or more.
I hope you're not right and that it hasn't really been that long.
Yikes ;-).
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen [EMAIL PROTECTED] writes:
(And, if I were optimizing, I would of course dispense with the
dynamic creation of the static table upon every execution of
expiration(), and move it outside the function.)
Replacing it with a tuple might be enough for that.
--
Alessandro Bottoni [EMAIL PROTECTED] writes:
I'm going to use my own implementation of OTP because the existing
mechanism are devoted to protect the remote login channel and cannot
be easily adapted to my weird e-mail-based mechanism. Anyway, I'm
going to use a (encrypted) very long
Terry Reedy [EMAIL PROTECTED] writes:
1. A DocImprovement wiki. People could optionally sign up for update
reports on specific wiki pages.
2. A new SF tracker, only for doc bugs, that would accept anonymous
submissions. The other trackers require login because most items need
Steve Holden [EMAIL PROTECTED] writes:
legitimate. Python's core developers are in a leadership position for
Python whether they like it or not; and users and volunteers absorb
the attitudes of the leaders.
So, what you are saying is because the developers (I explain in
another post on
morphex [EMAIL PROTECTED] writes:
does anyone of you know of some code I can use to generate validation
code images?
Those images you can see on various login forms used to prevent bots
for performing a brute-force attack..
http://en.wikipedia.org/wiki/CAPTCHA
--
John Brawley [EMAIL PROTECTED] writes:
However, the thought occurs that Python (2.4.1) may not have the ability to
take advantage of the dual processors, so my question:
Does it?
No.
If not, who knows where there might be info from people trying to make
Python run 64-bit, on multiple
Jeremy Jones [EMAIL PROTECTED] writes:
to pass data around between processes. Or an idea I've been tinkering
with lately is to use a BSD DB between processes as a queue just like
Queue.Queue in the standard library does between threads. Or you
could use Pyro between processes. Or CORBA.
I
[EMAIL PROTECTED] writes:
However, it is very ugly. Does anyone have any tips on how I could get
this optimisation to occor magically, via a decorator perhaps?
Have you tried psyco?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
My use case involves 1000 iterators, so psyco is not much help. It
doesn't solve the magic creation of locals from instance vars either.
How about using __slots__ to put those instance vars at fixed offsets
in the pool object (self then needs to be a new-style class
Huron [EMAIL PROTECTED] writes:
Sopinspace, Society For Public Information Spaces (specialized in Web-based
citizen public debate and collaborative initiatives) is looking for a new
developer / RD engineer with strong Plone focus.
The position is located in Paris, France (11eme).
All
[EMAIL PROTECTED] writes:
I would like to
create a subclass of socket that fixes the problem.
The socket module is in a messy state right now and subclassing
sockets doesn't work for implementation-specific reasons besides the
issue you described. Take a look at socket.py to see the situation.
[EMAIL PROTECTED] writes:
for example,can we do something like this:
curButton.bind(Button-1,self.StopServer)
def StopServer(self,event):
curButton[text] = Start Server
Yes.
--
http://mail.python.org/mailman/listinfo/python-list
Mike Meyer [EMAIL PROTECTED] writes:
Whether the '==' operation conforms to your idea of what equality
means is unclear.
Care to say what it does mean, then?
class boffo(int):
def __eq__(x,y): return True
a,b = boffo(2), boffo(3)
print a+b, a==b, (a+2)==(b+2)
I'd say
[EMAIL PROTECTED] writes:
The problem is once i set the textvariable property of the button,i
cannot change the text.For example,
curButton = Button(root,text=Stop Server,textvariable=this)
1. I don't think you can use text and textvariable at the same time.
2. I don't think you're using
Mike Meyer [EMAIL PROTECTED] writes:
I'd say a==b doesn't necessarily mean a and b have the same value.
Care to say what it does mean (as opposed to what it doesn't mean), then?
a==b simply means that a.__eq__(b) returns True.
--
http://mail.python.org/mailman/listinfo/python-list
Mike Meyer [EMAIL PROTECTED] writes:
I'd like to work on that. The idea would be that all the numeric types
are representations of reals with different properties that make them
appropriate for different uses.
2+3j?
--
http://mail.python.org/mailman/listinfo/python-list
Mike [EMAIL PROTECTED] writes:
Correct. I didn't quite see the issue as assembly vs. python, having
direct translation to programming hours I figured the day I
upgrade my python, I would write a python script to upgrade the
data. I take my word back.
Writing that script sounds potentially
I find pretty often that I want to loop through characters in a file:
while True:
c = f.read(1)
if not c: break
...
or sometimes of some other blocksize instead of 1. It would sure
be easier to say something like:
for c in f.iterbytes(): ...
or
for c in
Jean-Paul Calderone [EMAIL PROTECTED] writes:
Which is only very slightly longer than your version. I would like
it even more if iter() had been written with the impending doom of
lambda in mind, so that this would work:
for chunk in iter('', f.read, blocksize):
...
But it's
Gregory Petrosyan [EMAIL PROTECTED] writes:
As you can see, PEP 204 was rejected, mostly because of not-so-obvious
syntax. But IMO the idea behind this pep is very nice. So, maybe
there's a reason to adopt slightly modified Haskell's syntax?
I like this with some issues: Python loops tend to
I came across this while looking up some data compression info today.
David J.C. MacKay
Information Theory, Inference, and Learning Algorithms
Full text online:
http://www.inference.phy.cam.ac.uk/mackay/itila/
It's a really excellent book, on the level of SICP but about
Steven D'Aprano [EMAIL PROTECTED] writes:
For finite sequences, your proposal adds nothing new to existing
solutions like range and xrange.
Oh come on, [5,4,..0] is much easier to read than range(5,-1,-1).
The only added feature this proposal
introduces is infinite iterators, and they aren't
Grant Edwards [EMAIL PROTECTED] writes:
That made me smile on a Monday morning (not an insignificant
accomplishment). I noticed in the one footnote that the H.P.
book had been translated into American. I've always wondered
about that. I noticed several spots in the H.P. books where
the
[EMAIL PROTECTED] (Alex Martelli) writes:
Oh come on, [5,4,..0] is much easier to read than range(5,-1,-1).
But not easier than reversed(range(6))
Heh, I like that, and reversed(xrange(6)) appears to do the right
thing too. I didn't know about __reversed__ before.
[[the 5 in one of the
Tim Peters [EMAIL PROTECTED] writes:
For example, I think the
Japanese translator deserves a Major Award for their heroic attempt to
translate Ron's Uranus pun:
http://www.cjvlang.com/Hpotter/wordplay/uranus.html
Gad, I'm surprised that was in the original.
For an absolutely amazing
Xavier Morel [EMAIL PROTECTED] writes:
The only thing that bothers me about the initial proposal is that
there would not, in fact, be any range object, but merely a
syntactic sugar for list/generator creation.
Well, it could create something like an xrange. Maybe that's preferable.
Not
Gregory Petrosyan [EMAIL PROTECTED] writes:
1) both in [5,6,10] and [5,7,10] 10 is included ;-)
And as for [5,6 .. 10] and [5,7 .. 10]... First one should look
like [5 .. 10] I think. But you are right:
it looks like a problem that in one case 10 is included and in
other not. I should
Gregory Petrosyan [EMAIL PROTECTED] writes:
1) [f(n), f(n)-1 .. 0] can be easily catched by interpreter, and f(n)
can be evaluated only once.
I think it would be counterintuitive for the interpreter to do that.
If I type f(n) twice I expect it to be evaluated twice.
2) if you need right
Bob Greschke [EMAIL PROTECTED] writes:
Just roughly what do you think the effect would be?
Either extremely slight or else nonexistent.
--
http://mail.python.org/mailman/listinfo/python-list
Fried Egg [EMAIL PROTECTED] writes:
(1) Has anybody done something general enough for me to use?
It's sounds like you're writing a glorified version of Emacs's
Dissociated Press command. DP used a simpler algorithm but the
results were about the same.
(3) Would anybody else be interested in
Tom Anderson [EMAIL PROTECTED] writes:
The natural way to implement this would be to make .. a normal
operator, rather than magic, and add a __range__ special method to
handle it. a .. b would translate to a.__range__(b). I note that
Roman Suzi proposed this back in 2001, after PEP 204 was
Steven D'Aprano [EMAIL PROTECTED] writes:
So I don't really know what point you are making. What solution(s) for
1**0.5 were you expecting?
I think it was a sly way of saying plus one or minus one.
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber [EMAIL PROTECTED] writes:
What would be expected from
[1, 3, 6 .. 20]
???
In Haskell:
Hugs.Base [1,3,6..20]
ERROR - Syntax error in expression (unexpected `..')
Hugs.Base
Again, I see [1, 3, 6, 7, 8, 9, 10, ... , 18, 19]
You'd write that in
braver [EMAIL PROTECTED] writes:
I need a magical expanding hash with the following properties: ...
I have such a class in ruby. Can python do that?
Python's built-in dict objects don't do that but you could write such
a class pretty straightforwardly.
--
Gregory Petrosyan [EMAIL PROTECTED] writes:
2) [5 .. 0] - [5,4,3,2,1,0]
So, if next is omited, let the default step be 1 if first last
and -1 otherwise.
So what do you want [a..b] to do? Dynamically decide what direction
to go? Ugh!
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch [EMAIL PROTECTED] writes:
BTW: remember that setdefault() is written setdefault() but it's read
getorset().
I can only second that. The misleading name has - well, mislead me :)
Hmm,
x[a][b][c][d] = e# x is a magic dict
becomes
901 - 1000 of 4752 matches
Mail list logo