ter
may in fact be the more ideal usage? This isn't hypothetical
either.
Your example is a fine one, and some kind of table to resolve
the function according to type of input argument is a good idea.
I'm just saying that more general application of this idea is
best left to languages li
ely enough to be very interesting.
In the functional language approach I'm familiar with, you
introduce a variable into a scope with a bind -
let a = expr in
... do something with a
and initialization is part of the package. Type is usually
inferred. The kicker though is that the variab
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Bengt Richter) wrote:
> On Tue, 04 Oct 2005 10:18:24 -0700, Donn Cave <[EMAIL PROTECTED]> wrote:
> [...]
> >In the functional language approach I'm familiar with, you
> >introduce a variable into a scope with
_the_
definition. The word is used in such broad and vague ways that to
use it is practically a sign of sloppy thinking.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
an be performed
| automatically.
I don't think the shell is any exception - I think it's reasonable to
see it as a control+UI language embedded in the UNIX operating system.
It wouldn't really be a very useful stand-alone application on a computer
platform without the same basic prope
hon runtime doesn't even look at the source code.
Fair to say that byte code is interpreted? Seems to require an
application we commonly call an interpreter.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
> Donn Cave wrote:
>
> > | > Except it is interpreted.
> > |
> > | except that it isn't. Python source code is compiled to byte code, which
> > | is then exec
oesn't have pty functionality. It's hard to say
for sure who said what in that page, after the incredible mess
Google has made of their USENET archives, but I believe that's
why you see dup2 there - the author is using a pty library,
evidently pexpect. As far as I know, things have not moved on
in this respect, not sure what kind of movement you expected
to see in the intervening month. I don't think you need ptys,
though, so I wouldn't worry about it.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]>
wrote:
> Donn Cave <[EMAIL PROTECTED]> writes:
> > I agree that there are many shades of grey here, but there's also a
> > real black that's sharply distinct and easy to find -- real n
re, as opposed to the way we are
typically more interested in positional access to a tuple. Maybe
a more computer literate reader will have a better word for this,
that doesn't collide with Python terminology. My semi-formal
operational definition is "a is similar to a[x:
erve the same pattern with respect to
object identities. Mutability doesn't really play any role here.
> Is there a way to bypass it (or perhaps to write a self-defined
> immutable object)?
Bypass what? What do you need?
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
this. (Interesting that
it's a function parameter, not a method to be overridden by
a subclass.)
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
peek into Python for this, I'm wondering if your module
could set its own signal handler for SIGINT, which would set a library
flag. Then call PyErr_SetInterrupt(), to emulate the normal signal
handler.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
e
for all I know it may have evolved in this respect.) The pipe-like
VMS device was called a "mailbox", and the interesting feature was
that you could be notified when a read had been queued on the device.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
open
Hello, it seems fairly clear that the stdin/stdout in question belongs
to another process, which cannot be instructed at this point to execute
freopen(). If there's a way to do this, it will be peculiar to the
platform and almost certainly not worth the effort.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
_name__,
id(self), special)
def __repr__(self):
return self.make_repr(repr(self.my_favorite_things))
This omits the module qualifier for the class name, but
arguably that's a bit of a nuisance anyway. If there's a
best, common practice way to do it, I wouldn't care to pose
as an expert in such things, so you have to decide for yourself.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
2]
>
> I can understand that Guido was a bit reluctant to introduce
> += etc into Python, and it's important to understand that they
> typically behave differently for immutable and mutable objects.
As far as I know, Guido has never added a feature reluctantly.
He can take full
din.read() or
> os.read() to reliably use a buffer that fits the alignment restriction.
Though of course os.read() would eliminate one layer of buffering
altogether. Might be worth a try.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
, the ability to store some state. This
is of course useful in situations where we want to propagate state
changes, so it naturally comes up in this context, but language per
se does not observe any distinction here so far as I know.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
vague or even wrong statement about
its relationship to the issue. It has been going on for
years, usually I believe from people who understand quite
well how it really works.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ppened to me. As I said, I thought their
design was good, but maybe they just didn't get the word out like
they should have - that threads are scary.
Donn Cave, [EMAIL PROTECTED]
(posting this from a Python/BeOS API newsreader)
--
http://mail.python.org/mailman/listinfo/python-list
sure.
State variables are analogous to goto in a way, similar
sort of spaghetti potential. It may or may not help to
have all the strands come out at the same spot, if the
route to that spot could be complicated.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
for over a decade, wonder if it had any influence
on your C++ zeitgeist?
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
5
In earlier compilers, and I think this one too, "cc_r" (instead of "xlc")
gives you the thread options and libraries.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
cation on VMS?)
The only thing I can think of is a select() with timeout, with
some compromise value that will allow most outputs to complete
without stalling longer than is really convenient.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
m posed in the original post.
But it might be just as well to watch the process status for
any non-zero value, and then call the graceful exit procedure.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
still the most
efficient library of functions for their purpose for use in
supercomputing applications. Apparently hand-optimized assembler
for specific processors.
http://seattlepi.nwsource.com/business/250070_goto29.html
(actually from the NY Times, apparently)
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
two similar things
interchangeable. So we're happy to see that tuple does not have the
features it doesn't need, because it helps in a small way to make Python
code better. If only by giving us a chance to have this little chat once
in a while.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
with something a lot like StructSequence.
Meanwhile losing a significant overhead.
I wrote a quickie Python API to SequenceStruct and used it to
make an (x, y) coord type, to compare with a Coord.x,y class.
A list of a million coords used 1/5 space, and took 1/10 the
time to create. Hm.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
thout necessarily supporting the effort.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ity and purity. Maybe
it's more like tuples have a primary intended purpose,
and some support for other applications. Not white,
but not pure black either.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
have some interesting historical perspectives there, but
not much of a historical issue, I'd say, without much
going on in the way of a user community.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
a #! or not. csh (the shell language that doesn't
look anything like C, Bill Joy's attempt at language design
before he started over with Java) does that only if the first
line is "#"; otherwise it invokes the Bourne shell.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Quoth Mike Meyer <[EMAIL PROTECTED]>:
| Donn Cave <[EMAIL PROTECTED]> writes:
...
|> For me, conceptually, if an object can't be accessed
|> sequentially, then it can't be mapped to a sequence.
|
| So you're saying that for should implicitly invoke list (or mayb
part of the
published API for os.py, so it would be unseemly to complain if it
were to change in later versions. So I guess the right thing to do
is write your own spawn function from the ground up. But at least
you have some ideas there about how it might work.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ly where you actually have complete
coverage from unit testing, which not everyone can claim and I'm sure
even fewer really have. And like the man said, you're doing that work
to find a lot of things that the compiler could have found for you.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ically typed polymorphism. It seems to me they are
kind of at odds with static type analysis, especially if you want
type inference -- kind of a type laundering system, where you can't
tell what was supposed to be there by looking at the code. Some
alternatives would be needed, I
Quoth Paul Rubin <http://[EMAIL PROTECTED]>:
| "Donn Cave" <[EMAIL PROTECTED]> writes:
|> Yes, it would be really weird if Python went that way, and the
|> sort of idle speculations we were reading recently from Guido
|> sure sounded like he knows better. But it&
ipped from Haskell, that would be an atrocity.
It may not be essential, but it's eminently useful and natural.
Is it useful and natural in Python? Is it worth breaking code over?
Why do we even bother to discuss this here? There aren't good answers
to those questions.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
on't by any means agree that this notation is worth adopting, and
in general I think this kind of readability issue is more or less a lost
cause for a language with Python's scoping rules, but the motive makes
sense to me. One way to look at it might be, if I observe that "wo
sonally I wouldn't care to predict anything here. For all I know,
someday we may decide that we need cooler and more efficient computers
more than we need faster ones.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
e left
hand side of the where clause. What you're trying to do here seems
to have almost nothing to do with that.
If Python 3 is going to get assignment-as-expression, it will be
because GvR accepts that as a reasonable idea. You won't bootleg it
in by trying to hide it behind this "where" notion, and you're not
doing "where" any good in trying to twist it this way either.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
her. :)
I'm with him. List incomprehensions do not parse well in
my eyes. I am reduced to guessing what they mean by a kind
of process of elimination. map is simply a function, so
it doesn't pose any extra reading problem, and while lambda
is awkward it isn't syntactically a
In article <[EMAIL PROTECTED]>,
Jacek Generowicz <[EMAIL PROTECTED]> wrote:
> Donn Cave <[EMAIL PROTECTED]> writes:
>
> > List incomprehensions do not parse well in my eyes.
>
> Are you familiar with the Haskell syntax for list comprehensions?
>
> Fo
d spawn call in test.py I do not get any output to
| /tmp/test.out and it also returns immediatly. Can anyone tell me why?
Might be a problem finding 'sh', since in this case you call spawnl(),
not spawnlp(). Just a guess. Also you ought to know that the return
from os.spawnl(os.P_WAIT, ...) will not be a pid, rather a status that
carries a little (very little) information about the problem.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
t close
the pipe. The parent could then read the pipe, even
for a NOWAIT case like this, and possibly contrive to
re-raise the fork's exception if one showed up. This
would account for the class of errors that occurs between
the fork and the exec. The _spawnvef I'm looking at
doesn't account for these very well - 127 covers a lot
of ground, and there wouldn't be much in the way of
error output.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
doubt there are situations where a path lookup
is essential, but it just hasn't been happening to me.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
r.
Rigorous application of the model can be a little awkward, though,
if you're trying to adapt it to a basically procedural application.
The original Stackless Python implementation had some interesting
options along those lines.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
t unexplained is ``true "is-a" relationships''. Sounds
like an implicit contradiction -- you can't implement
something that truly is something else. Without that, and
maybe a more nuanced replacement for "is-implemented-using-a",
I don't see how you could really be sure of the point.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
s your "is-a" test? What is-a dictionary, or is-not-a
dictionary? If you ask me, there isn't any obvious principle,
it's just a question of how we arrive at a sound implementation --
and that almost always militates against inheritance, because
of liabilities you mentioned els
a lot
like Rectangle, it still has a couple of differences, and
the difference could be a problem in some contexts designed
for Rectangle - but no one can fix that. If you need Square,
you'll implement it, and whether you choose to inherit from
Rectangle is left as a matter of implementation
really attractive FP language, maybe out
of the "links" initiative by Wadler et al.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ry about the
first one, since if data could be lost in this way it would
be much more complicated to close a file descriptor without
running this risk.
But I don't see the second one as much of a problem either.
The writer blocks - so?
Now, what would really be useful is a way for the writer to
detect whether open will block, and potentially time out.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
hut them out of the hardware internals. They use a Metrowerks
PPC compiler that of course hasn't seen much development in the last
6 years, probably a lot longer.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
the
nearest equivalent thing in their own familiar context. Say good
things about language X, and people will hear you saying "give up
using language Y and rewrite everything in language X." Then they
will conclude that if you would say that, you don't know very much
about their e
r temporary
files or something. You probably don't need to call Python from C,
may as well just invoke python (cf. os.spawnv)
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
et, provided along with a
callback function by the application.
Am I hearing that wxWindows or other popular toolkits don't provide
any such feature, and need multiple threads for this reason?
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
he problem is with the (Python)
program on the other end - it's buffering output,
because the output device is not a terminal.
Donn Cave, [EMAIL PROTECTED]
> Here is the child process script (bufcallee.py):
> import time
> print 'START'
> time.sleep(10)
&
quot;use the subprocess module."
If that's not helpful, either because it doesn't provide any
feature that allows you to close a descriptor in a fork (I seem
to recall it does), or it isn't supported in your version of
Python (< 2.4), then you have your choice of two slightly a
outside of North
America, citing failure to penetrate the "enterprise" market as a
reason. Ask the enterprise world if they think Python is changing
fast enough. Maybe they're giving up on Python because they decided
they'd never get code blocks. (Ha ha.)
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
concepts you need most e.g. concurrency:
|
| http://cml.cs.uchicago.edu/
My vote would be Haskell first, then other functional languages.
Learning FP with Objective CAML is like learning to swim in a
wading pool -- you won't drown, but there's a good chance you
won't really learn to swim either. H
In article <[EMAIL PROTECTED]>,
Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> "Donn Cave" <[EMAIL PROTECTED]> writes:
> > My vote would be Haskell first, then other functional languages.
> > Learning FP with Objective CAML is like learning to swim i
m even (gasp) thinking of checking out Ada.
It's up to you, I'm just saying. Speaking of C++, would
you start someone with Python or Java for their first OOPL?
Kind of the same idea.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
;s global lock, instead of locks around each
memory management function etc.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
In article
<[EMAIL PROTECTED]>,
Michael Hudson <[EMAIL PROTECTED]> wrote:
> Donn Cave <[EMAIL PROTECTED]> writes:
>
> > On the contrary, there are a couple. Ghc is probably the
> > leading implementation these days, and by any reasonable
> > measure
e (period.) They claim conformance
with the ISO C90 standard. I couldn't dig up a (free) copy
of that document, so don't know what it says on this matter.
GNU C man pages say it positions the stream at end for
write and at beginning for read.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Quoth "Terry Reedy" <[EMAIL PROTECTED]>:
| "Donn Cave" <[EMAIL PROTECTED]> wrote in message
| news:[EMAIL PROTECTED]
| > I don't think Python pretends to have any intentions here,
| > it has to take what it gets from the C library fopen(3)
| > funct
.
Along with already documented FreeBSD, I find MacOS X, NetBSD 2
and Ultrix 4.2 position the read stream to EOF. Linux, AIX and
DEC/OSF1 (or whatever it's called these days) position it to 0.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ly needed.
You are no doubt wondering when I'm going to get to the part where
you can exploit this to save you those 3 lines of code. Sorry,
it won't help with that.
| Is this related to Python's expression vs. statement syntactic
| separation? How can I be write this code more nic
Sure, if your function's type is "None | int", then certainly
you must explicitly check for None. That is not the case with
fileobject read(), nor with many functions in Python that
reasonably and ideally return a value of a type that may
meaningfully test false. In this cas
's
interpreter provides a cheap and moderately effective support
that compensates for most programmers' unrealistic assessment
of their skill and discipline. Not that you can't go wrong,
but the chances you'll get nailed for it are greatly reduced -
especially in an SMP environment.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
mply whether or how Python could support SMP.
Mike, care to mention an example or two of the better models you
had in mind there?
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
uot;Timber" with some
added support for time as an event source. The most on topic thing
about it -- its author implemented a robot controller in Timber, and
the robot is a little 4-wheeler called ... "Timbot".
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
't
go anywhere, but she goes on to write a well articulated
case that makes very interesting reading, and possibly has
had some effect on how people think about it around here.
http://groups-beta.google.com/group/comp.lang.python/msg/2de5e1c8384c0360
Donn Cave, [EMAIL PROTECTED
ot
a shell command.
The basic problem is that you have to fork first, then
exec, and by the time the forked interpreter finds out
that the exec didn't work, its parent has gone on to
do the I/O it's expecting. I think subprocess gets
around that, on UNIX, with a trick involving an extra
p
adline() instead (in a loop,
of course, I think you'll get the data one line
at a time, but "in file" apparently reads the
whole file first. That's what I vaguely remember,
I don't use it myself.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
What do you mean by, "the 9 element tuple need to be populated
correctly"? Do you need someone to tell you what values it
needs? What happens if you use (2005, 9, 1, 0, 0, 0, 0, 0, 0),
for example? If you make this tuple with localtime or gmtime,
do you know what the 7th (tm[6]) element of
, 0, 0, 0, 0, 0, 0),
> > for example? If you make this tuple with localtime or gmtime,
> > do you know what the 7th (tm[6]) element of the tuple is?
> > What tricks did you try, exactly?
> >
> >Donn Cave, [EMAIL PROTECTED]
>
> Thanks for pointing out. tm[6
ing it there are supposed
to be two separate pipes from the same process, since if one is
allowed to fill up, that process will block, causing a deadlock if
the reading process blocks on the other pipe.
Hope I'm not missing anything here. I just follow this group
to answer this question over and over, so after a while it
gets sort of automatic.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
he mix, there are even more issues
as signals may be delivered to one thread and handled in another,
etc.
If you're dispatching on I/O, for example with select, you
can use an otherwise unused pipe to notice the child fork's
exit -- close the parent's write end right away, and th
figuration. The documentation
is probably the place to find out more about this stuff.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
sn't clear that this is all still allocated -
malloc() doesn't necessarily reuse a freed block right
away, and in fact the most interesting thing about this
experiment is how different this part looks on different
platforms. Of course we're still a bit in the dark as
to how much memory is really allocated for overhead.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
e tend to
be a lot of undefined behaviors in events like termination of the main
thread, receipt of signals, etc.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Dave Brueck <[EMAIL PROTECTED]> wrote:
> Donn Cave wrote:
[... re stackless inside-out event loop ]
> > I put that together with real OS threads once, where the I/O loop was a
> > message queue instead of select. A message queueing mult
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Aahz)
wrote:
> Yes. I just get a bit irritated with some of the standard lines that
> people use.
Hey, stop me if you've heard this one: "I used threads to solve
my problem - and now I have two problems!"
ses a function f over x and y this way
f(x, y)
sometimes this way (+ is a function, really)
x f y
and sometimes this way
x.f(y)
?
I don't know, I'm just thinking that while Python's notation might
be just fine for people who've gotten here the way most of us have,
it's not obvious from this that it's just fine 4 everyone.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
x27;t see ?)
>
> Why does the server block ?
Probably you're seeing the initial exchange of data during
the SSL connection - certificates and so forth. You may
find that after this is done, further exchanges will work
OK with select(). Or maybe not -- I really don't know enou
s
multiple file descriptors as data becomes available on them.
When using select(), you should read from the file descriptor,
using os.read(fd, size), socketobject.recv(size) etc., to
avoid reading into local buffers as would happen with a file
object.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
uot;. I have no idea what he was talking about, but you
might be interested in this issue.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Quoth Kenneth Pronovici <[EMAIL PROTECTED]>:
...
| If ignoreStderr=False, I use popen2.Popen4 so that stderr and stdout are
| intermingled. If ignoreStderr=True, I use popen2.Popen3 with
| capturestderr=True so stderr doesn't appear in the output. This
| functionality exists so I have an equivale
ot to mix buffered I/O (like file object
I/O functions) with select() at all, because select()
actually applies to system level file descriptors and
doesn't know anything about the buffer.
Get the file descriptor with fileno(), and never refer
to the file object again after that.
Donn Ca
a pipe, socket or similar, but it's
kind of implied by the use of select() also mentioned.
It's also kind of implied by use of the term "block" -
disk files don't block.
If we are indeed talking about a pipe or something that
really can block, and you call fileobject.read(1024),
it will block until it gets 1024 bytes.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Greg Ewing <[EMAIL PROTECTED]> wrote:
> Donn Cave wrote:
> > If we are indeed talking about a pipe or something that
> > really can block, and you call fileobject.read(1024),
> > it will block until it gets 1024 bytes.
>
>
01]
You will get something more like what you want with
the str() function instead. str(1.775) == '1.775'
from types import FloatType
class ClassicFloat(FloatType):
def __repr__(self):
return self.__str__()
print map(ClassicFloat, [1.775, 1.949])
yields
rser seems to be ignoring the progress that
os.spawnv and popen2.Popen3 made on this. Of course you don't need
to repeat their blunders either and accept either string or list of
strings in the same parameter, which makes for kind of a shabby API,
but maybe a keyword parameter or a separate function would make sense.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
'/bin/su', ['su', '-c', '%s %s %s' % (cmd,
parameter1, parameter2)])
so you have almost as much work to scan the parameters for shell
metacharacters as you would have with system().
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
in scope
than what Haskell et al. do.
Donn Cave, [EMAIL PROTECTED]
---== Posted via Newsfeed.Com - Uncensored Usenet News ==--
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =--
Quoth [EMAIL PROTECTED] (Alex Martelli):
| Donn Cave <[EMAIL PROTECTED]> wrote:
...
| > He didn't dwell much on it, but there was some mention of type
| > inference, kind of as though that could be taken for granted.
| > I guess this would necessarily be much more limited in
han I did and you can decide for oneself whether
it's an important one.
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ramming? What would he
say about unit testing to catch up with changes in
dependent modules, do you think? Do we have a
combinatorial explosion potential here?
Donn Cave, [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 283 matches
Mail list logo