On Jul 12, 5:52 pm, Robert Dailey <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a way to force a specific parameter in a function to be a
> specific type?
Yes; have a look at typecheck (http://oakwinter.com/code/typecheck/)
and FormEncode (http://formencode.org/Validator.html).
ook". You want "Python Programming on Win32"
By Mark J.. Hammond, Andy Robinson. It covers exactly this case.
--
Harry George
PLM Engineering Architecture
--
http://mail.python.org/mailman/listinfo/python-list
x27;t know anything more about static typing than it does
now. FWIW, there is already a typechecking module [1] providing a
syntax as friendly as it gets without function annotations. If the
number of its downloads from the Cheeshop is any indication of static
typing's popularity among Pythonis
On Jul 3, 5:05 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > I posted this on the Pyro list but I'm not sure if it's related
> > specifically to Pyro. The "finally" clause below is not executed when
> > f() r
estLoop()
finally:
# nothing is printed if f() runs in a thread
print "i am here!!"
DAEMON.shutdown()
print "i am over!!"
Is "finally" not guaranteed to be executed in a non-main thread or is
there something else going on ?
George
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] (John J. Lee) writes:
> Harry George <[EMAIL PROTECTED]> writes:
>> [EMAIL PROTECTED] (John J. Lee) writes:
> [...]
>>> 2. You can run your own private egg repository. IIRC, it's as simple
>>> as a directory of eggs and a plain old web
Robert Kern <[EMAIL PROTECTED]> writes:
> Harry George wrote:
>
>> We need to know the dependencies, install them in dependency order,
>> and expect the next package to find them. "configure" does this for
>> hundreds of packages. cmake, scons, and other
(Function Signature Object) in place.
What you claim about introspection code though I think holds for code
in general. There are quite often edge cases which the programmer
doesn't anticipate or care to handle. A tool that covers X% of real-
world use cases for some large X and doc
Ben Finney <[EMAIL PROTECTED]> writes:
> Harry George <[EMAIL PROTECTED]> writes:
>
> > Historically, python packages played well in this context. Install
> > was a simple download, untar, setup.py build/install.
> >
> > Eggs and with other setupt
Robert Kern <[EMAIL PROTECTED]> writes:
> Harry George wrote:
> > ...at least around here.
> >
> > I run a corporate Open Source Software Toolkit, which makes hundreds
> > of libraries and apps available to thousands of technical employees.
> > The
[EMAIL PROTECTED] (John J. Lee) writes:
> Harry George <[EMAIL PROTECTED]> writes:
> [...]
> > These are unacceptable behaviors. I am therefore dropping ZODB3, and
> > am considering dropping TurboGears and ZSI. If the egg paradigm
> > spreads, yet more packages
On Jun 21, 4:42 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On Jun 21, 8:51 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > I wonder if there is a (preferably not too-hackish) solution to the
> > following introspection problem: given
ll available as well. You
can have dependencies, as long as they are documented and can be
obtained by separate manual download.
Thanks for listening.
--
Harry George
PLM Engineering Architecture
--
http://mail.python.org/mailman/listinfo/python-list
> get_init_locals(f, 3, 4, 5)
{'a': (5,), 'k': {}, 'x': 3, 'y': 4}
>>> get_init_locals(f, 3, q=-1)
{'a': (), 'k': {'q': -1}, 'x': 3, 'y': 1}
Any takers ?
George
--
http://mail.python.org/mailman/listinfo/python-list
e (and sometimes less) restrictive than necessary. Still,
If you're addicted to manifest typing [1], the typechecking module [2]
may give you a warm and fuzzy feeling:
from typecheck import accepts
@accepts(int, str)
my_func(some_non_hungarian_notation_meaningful_name,
othe
-- code a bit, save, the other guy codes a bit.
But when someone uses vi and then forgets how to do block moves, or
uses eclipse and bogs down the session, or uses MS Notepad and can't
enforce language-specific indents, I get frustrated.
--
Harry George
PLM Engineering Architecture
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 17, 6:46 pm, Philipp Leitner <[EMAIL PROTECTED]> wrote:
> Ever came to your mind that there are people (programmers and others)
> who will not use emacs for their day-to-day work simply because they
> have tools that suit them better for the work they have to do (Eclipse
> for me, as an exa
g one) comment on how they compare to the standard
logging ?
George
* among other shortcomings, such as unpickleable handlers, absurdly
verbose config files, etc.
--
http://mail.python.org/mailman/listinfo/python-list
gt; value. I don't care which items I get so now I just use a couple of
> pops or a for loop for more than two.
>
> Thanks
>
> jh
>>> x = range(10)
>>> y = []
>>> y.append(x.pop(4))
>>> print x, y
[0, 1, 2, 3, 5, 6, 7, 8, 9] [4]
>>> y
gt; >http://stickpeople.com/projects/python/win-psycopg/
>
> > It may well be, thanks.
>
> On second thoughts, is there one anywhere without an extra multi-
> megabyte dependency? This seems to rely on the eGenix 'mx' library.
>
> --
> Ben Sizer
IIRC v
.com/ASPN/Cookbook/Python/Recipe/117119:
from itertools import count, ifilter
def sieve():
seq = count(2)
while True:
p = seq.next()
seq = ifilter(p.__rmod__, seq)
yield p
I suspect that it violates your second rule though :)
George
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 12, 11:36 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 12 Jun., 16:54, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > > On 12 Jun., 14:57, Facundo Batista <[EMAIL P
eptable syntax for multiline lambdas; TOOWTDI is a
secondary reason (as one can easily come up with a dozen TOOWTDI
violations in other parts of the language). I agree though that in
practice it's a very small limitation.
George
--
http://mail.python.org/mailman/listinfo/python-list
allel version in a few lines, with minimal boilerplate
code overhead.
To get a copy, visit http://code.google.com/p/papyros/; also available
from the Cheeseshop at http://www.python.org/pypi/papyros/.
George
Sample code
==
Here's a basic example; for more details go through the READ
On Jun 11, 10:37 am, Frank Millman <[EMAIL PROTECTED]> wrote:
> On Jun 11, 3:38 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> >The boilerplate code can be minimal too with an appropriate
> > decorator, something like:
>
> > class A(object):
>
> > d
are a better
way to go. The boilerplate code can be minimal too with an appropriate
decorator, something like:
class A(object):
def __init__(self,x,y):
self.x = x
self.y = y
@cachedproperty
def z(self):
return self.x * self.y
where cachedproperty is
def
a difference for tight
loops).
I usually go for (1), at least until the number of global imports in
the top remains in single digits. After some point though I often
localize the standard library imports that are used only once or twice
(the third-party and local application imports are a
On Jun 2, 4:58 pm, [EMAIL PROTECTED] (Aahz) wrote:
> In article <[EMAIL PROTECTED]>,
> George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> >I had probably stumbled on many/most of the common pitfalls usually
> >mentioned (e.g.http://www.ferg.or
enerators-itertools, not only for the productivity gains
but perhaps even more for changing the way of thinking about
programming, making Python worth learning [1]. But in general it's the
overall design, making the right tradeoffs in most cases.
George
[1] "A language that doesn'
k
> prototype implementation of this. I'm off to work
> soon, so I can't do it today, but maybe Sunday.
I'm afraid I beat you to it :)
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/521877
George
--
http://mail.python.org/mailman/listinfo/python-list
ing multiple
processes in one or more hosts (through PYRO) and one singlethreaded
(for the sake of completeness, probably not very useful). I'll write
up some docs and I'll announce it, hopefully within the week.
George
--
http://mail.python.org/mailman/listinfo/python-list
t suggested,
> it isn't likely to be implemented. The first step would be to write a
> PEP though.
The time machine did it again: http://www.python.org/dev/peps/pep-3132/.
George
--
http://mail.python.org/mailman/listinfo/python-list
roupby(x, key=lambda div: div%n),
[[] for _ in xrange(n)])
George
--
http://mail.python.org/mailman/listinfo/python-list
xists...
George
--
http://mail.python.org/mailman/listinfo/python-list
On May 29, 1:21 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Tue, 29 May 2007 13:51:09 -0300, George Sakkis
> <[EMAIL PROTECTED]> escribió:
>
> > The traceback module is handy if you want a text representation of the
> > traceback, not the a
On May 29, 9:46 am, [EMAIL PROTECTED] wrote:
> On May 28, 10:46 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm reading the docs on sys.exc_info() but I can't tell for sure
> > whether I'm using it safely to get a snapshot of an exceptio
l Message-
> From: Dan Fabrizio [mailto:[EMAIL PROTECTED]
> Sent: Saturday, May 26, 2007 3:46 PM
> To: python-list@python.org; George, Harry G
> Subject: Using python for a CAD program
>
> Hello,
>
> I saw your post from last year about using python for a EE
> CAD pr
ssedRequestError()
class UnprocessedRequestError(RuntimeError):
pass
So far it seems it works as expected but I'd like to know if this is
error-prone and why.
George
--
http://mail.python.org/mailman/listinfo/python-list
eld next()
except StopIteration:
num_left[0] -= 1
nextfuncs[i] = next = repeat(default).next
yield next()
while True:
t = tuple(iter_next_tuple_values())
if not num_left[0]:
break
yield t
# example
lista = [
other way?
>
> W
Yes; check out the following:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502243
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698
George
--
http://mail.python.org/mailman/listinfo/python-list
On May 23, 4:22 pm, Paul McGuire <[EMAIL PROTECTED]> wrote:
> On May 23, 2:58 pm, [EMAIL PROTECTED] wrote:
>
>
>
> > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote:
>
> > > I'm looking for any existing packages or ideas on how to implem
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote:
> On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm looking for any existing packages or ideas on how to implement the
> > equivalent of a generator (in the Python sense,
> > i.e.http:
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote:
> On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm looking for any existing packages or ideas on how to implement the
> > equivalent of a generator (in the Python sense,
> > i.e.http:
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote:
> On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm looking for any existing packages or ideas on how to implement the
> > equivalent of a generator (in the Python sense,
> > i.e.http:
On May 23, 3:35 pm, [EMAIL PROTECTED] wrote:
> On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm looking for any existing packages or ideas on how to implement the
> > equivalent of a generator (in the Python sense,
> > i.e.http:
On May 23, 2:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > I'm looking for any existing packages or ideas on how to implement the
> > equivalent of a generator (in the Python sense, i.e.
> >http://www.python.org/dev
On May 23, 2:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > I'm looking for any existing packages or ideas on how to implement the
> > equivalent of a generator (in the Python sense, i.e.
> >http://www.python.org/dev
able to do something along the following lines:
def iterprimes(start=1, end=None):
# ...
yield prime
# rpc-related initialization
...
rpc_proxy = some_rpc_lib(iterprimes, start=1e6, end=1e12)
for prime in proxy:
print prime
Is there any module out there that does anything close to this
s does, lookup for "list
comprehensions". By the way, I hope these were shortened examples and
you're not actually using names such as 'Class' or 'ClassXYZ' in
your actual code...
George
--
http://mail.python.org/mailman/listinfo/python-list
ew datasets with the same or similar structure but it
soon gets tiring.
I had a similar task recently so I wrote a general and efficient (at
least as far as pure python goes) row transformer that does the
repetitive work. Below are some examples from an Ipython session; let
me know if this might be
es?
No, and I would refuse to maintain code that did use them*.
George
* Unless I start teaching programming to preschoolers or something.
--
http://mail.python.org/mailman/listinfo/python-list
to it. Accepting this PEP would upset lots of people
as it seems, and it's interesting that quite a few are not even native
english speakers.
George
--
http://mail.python.org/mailman/listinfo/python-list
On May 15, 5:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> George Sakkis <[EMAIL PROTECTED]> wrote:
> > I'm trying to figure out why Popen captures the stderr of a specific
> > command when it runs through the shell but not without it. IOW:
>
> &
PE, stdout=PIPE)
else: # this captures only stdout
pipe = Popen(cmd, shell=False, stderr=PIPE, stdout=PIPE)
# this prints the empty string if not run through the shell
print "stderr:", pipe.stderr.read()
# this prints correctly in both cases
print "stdout:", pipe.stdout.re
bc are the
main players.
http://www.unixodbc.org/
http://www.iodbc.org/
3. For *NIX you need python bindings. This is where mxODBC has
operated (e.g., with iodbc). But there is an OSS effort at:
https://sourceforge.net/projects/pyodb
--
Harry George
PLM Engineering Architecture
--
http://mail.python.org/mailman/listinfo/python-list
decisions you want.
archtool_path= os.getenv('ARCHTOOL_PATH')
archtool_cfg = os.getenv('ARCHTOOL_CFG')
sys.path.insert(0,archtool_path)
import archtool
exec "import archtool.%s as cfg" % archtool_cfg
--
Harry George
PLM Engineering Architecture
--
http://mail.python.org/mailman/listinfo/python-list
e classobjs defined in there? Or finding any constant strings in the
> caller's module would also be just fine. Or is there a completely
> different way to do such a thing?
Yes, there is: use an ORM to do the SQL generation for you. Check out
SQLAlchemy, it will buy you much more than what you asked for.
George
--
http://mail.python.org/mailman/listinfo/python-list
took", secondsToStr(t2-t1),"seconds"
>
> and get nicely-formatted 0:00:12.345 style output.
>
> (I also posted this to the Python Cookbook.)
>
> -- Paul
Cute... for obfuscated python contests :-) Whenever I needed this, a
simple
"Completed in %d minutes and %.1f seconds" % divmod(end-start, 60)
was more than enough.
George
--
http://mail.python.org/mailman/listinfo/python-list
ably impossible.
>
>Perhaps somebody could ask the chinese government to put him in jail
>for "hurting international society" :)
That's going to be tough because, according to his web page, he's
living in a Honda Civic somewhere in Illinois, USA.
http://xahlee.org/PageTw
and numarray.
> scipy
> > provides a bunch of computational routines (linear algebra, optimization,
> > statistics, signal processing, etc.) built on top of numpy.
>
> Thank you.
>
>
Also see gsl and its python binding.
http://www.gnu.org/software/gsl/
http://
o python script share a common object?
>
For the CPU to use the object, it needs to be in RAM. But it is
possible to save the RAM image onto disk, and then bring it back
later. The common approach is called "pickling", though there are
several variants on this:
http://docs.pyth
RAM boxes and
setting a big buffer (1GB or more) reduces the wall time by 30 to 50%
compared to the default value. BerkeleyDB should have a buffering
option too, make sure you use it and don't synchronize on every line.
Best,
George
--
http://mail.python.org/mailman/listinfo/python-list
ne reverse:
>
> first_word = line.split(' ', 1)[0]
> last_word = line.rsplit(' ', 1][-1]
> db[first_word] = last_word
I'd guess the following is in theory faster, though it might not make
a measurable difference:
first_word = line[:line.i
This information
is part of the context (e.g. an http request), not stored persistently
somewhere. It should be doable at the framework/orm level but I'm
rather green on Turbogears/SQLAlchemy.
George
--
http://mail.python.org/mailman/listinfo/python-list
;modified_by", and every
write operation on it would automatically record the time and the id
of the user who did the addition or change (I'm not sure how to deal
with deletions let's leave this for now). Has anyone done something
like that or knows where to start from ?
George
--
http://mail.python.org/mailman/listinfo/python-list
ial problem in general, but in my case every thread is
exclusively responsible for the subprocesses it forks; no subprocess
is inherited from the main thread or is shared in among the worker
threads.
George
--
http://mail.python.org/mailman/listinfo/python-list
be the worst of both worlds. The main alternative to the
> present behavior is re-computing the default value every time the
> function is entered.
One can do this is today's Python if he's so inclined, albeit with a
more verbose syntax:
http://aspn.activestate.com/ASP
table values from defaults. The fact that an object is
mutable doesn't mean that the function will try to mutate it:
def paintWall(ind, colormap={1:'red', 2:'blue', 5:'green'}):
print "Let's paint the wall %s" % colormap[ind]
George
--
http://mail.python.org/mailman/listinfo/python-list
I have a pure python program (no C extensions) that occasionally core
dumps in a non-reproducible way. The program is started by a (non-
python) cgi script when a form is submitted. It involves running a
bunch of other programs through subprocess in multiple threads and
writing its output in severa
self.m()
>
> m = B()
> m.am() # prints 'A.m'
> m.bm() # prints 'B.m'
>
> -
>
> P.S. Here's a link to the descriptor how-to:
>http://users.rcn.com/python/download/Descriptor.htm
What would the semantics be if m is decorated as local only in A or
only in B ?
George
--
http://mail.python.org/mailman/listinfo/python-list
ocess' stdin that causes it to somehow proceed, I can read
> from its stdout.
>
> Thus a useful dialogue is not possible.
>
> Regards,
> -Justin
>
>
>
Have you considered using pexpect: http://pexpect.sourceforge.net/ ?
George
--
http://mail.python.org/mailman/listinfo/python-list
or addition/removal/insertion of elements not making sense for a
heterogeneous data structure, have you heard of database schema
change ?
Heterogeneous data structures are well known for several decades now;
they are commonly spelled "records" though, not tuples, and have a
more reasonable API to support their semantics.
George
--
http://mail.python.org/mailman/listinfo/python-list
ot on 2.4
print os.waitpid(p.pid, 0)
What gives ?
George
--
http://mail.python.org/mailman/listinfo/python-list
ly? seems like a big kludge.
Unless I missed something, this is a simple string replacement:
''.join(packet).replace('01110', '011100')
George
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 20, 3:54 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 20 fév, 05:39, "George Sakkis" <[EMAIL PROTECTED]> wrote:
>
> > I was kinda surprised that setting __class__ or __dict__ goes through
> > the __setattr__ mechanism, like a norm
On Feb 20, 7:57 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Mon, 19 Feb 2007 23:18:02 -0800, Ziga Seilnacht wrote:
> > George Sakkis wrote:
> >> I was kinda surprised that setting __class__ or __dict__ goes through
> >> the __setattr__ mechanism, lik
f.__class__ is Foo
True
Is there a way (even hackish) to bypass this, or at least achieve
somehow the same goal (change f's class) ?
George
--
http://mail.python.org/mailman/listinfo/python-list
is this a typo?).
If you insist on using exec (which, again, you have no reason to for
this example), take the union of d's globals and locals as f's
globals, and store f in d's locals():
from math import *
G = 1
def d():
L = 1
g = dict(globals())
g.update(locals())
exec "def f(x): return L + log(G) " in g, locals()
return f(1)
George
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 18, 4:44 am, Gregor Horvath <[EMAIL PROTECTED]> wrote:
> George Sakkis schrieb:
>
> > I'd like to gather advice and links to any existing solutions (e.g.
> > libraries, frameworks, design patterns) on general ways of writing
> > complex web forms, as oppos
s the specific command, and only
then they appear (typically by Javascript). When the form is
submitted, the selected options are passed in the server in some form
that preserves the hierarchy, i.e. not as a flat dict. Is there
anything close to such a beast around ?
George
--
http://mail.python.org/ma
se IronPython?
An alternative might be to work (cross-platform) wit the vxd (XML)
file format. A good reader/writer for that would be handy.
--
Harry George
PLM Engineering Architecture
--
http://mail.python.org/mailman/listinfo/python-list
rophile
Here's another one, adapted from the example (in Java) in Wikipedia's
entry (http://en.wikipedia.org/wiki/Sierpinski_triangle):
N=15
for x in xrange(N,0,-1):
print ''.join('* '[x&y!=0] for y in xrange(N+1-x))
George
--
http://mail.python.org/mailman/listinfo/python-list
quot;similar to python" when the following is a program
> written in it? Compared to that, even Perl is a wonder of readability...
>
> (cryptic gibberish snipped)
>
> http://www.jsoftware.com/jwiki/Essays/The_Ball_Clock_Problem
>
> Diez
Please avoid posting code looking like garbled profanities in c.l.py.
This was outright offensive.
George
--
http://mail.python.org/mailman/listinfo/python-list
>>> f(1, y='bar')
Supplied: {'y': 'bar', 'x': 1}
Default: {'z': None}
>>> f(1, z=None)
Supplied: {'x': 1, 'z': None}
Default: {'y': 'bar'}
>>> f(1, 'bar', None)
Supplied: {'y': 'bar', 'x': 1, 'z': None}
Default: {}
>>> f(1, 'bar', z=None)
Supplied: {'y': 'bar', 'x': 1, 'z': None}
Default: {}
>>> f(1, z=None, y='bar')
Supplied: {'y': 'bar', 'x': 1, 'z': None}
Default: {}
Regards,
George
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 2, 3:39 pm, Mister Newbie <[EMAIL PROTECTED]> wrote:
> I have no programming experience. I want to learn Python so I can make
> simple, 2D games. Where should I start? Can you recommend a good book?
>
> Thank you.
http://www.amazon.com/Game-Programming-Python-Development/dp/1584502584
--
print
>print '==== test 2 '
>print adict
>print construct(C, adict)
>
> if __name__ == "__main__":
>test()
What's the point of this ? You can call C simply by C(**adict). Am I
missing something ?
George
--
http://mail.python.org/mailman/listinfo/python-list
nd add Numpy, Zope, Django, PIL,
pretty much everything actually. Even better, make CheeseShop just a
frontend to a build system that adds and updates automatically
submitted packages to the core. Problem solved ! .
George
--
http://mail.python.org/mailman/listinfo/python-list
chain(seq, repeat(fill, minlen-len(seq)))
>>> list(ipad('one;two;three;four'.split(";"), 7, ''))
['one', 'two', 'three', 'four', '', '', '']
>>> tuple(ipad(xrange(1,5), 7))
(1, 2, 3, 4, None, None, None)
George
--
http://mail.python.org/mailman/listinfo/python-list
ation isn't arbitrary.
Indeed, and that's because it is arbitrary. Python has the arbitrary
limitation that it's not Perl (or C, or Lisp or what have you).
George
--
http://mail.python.org/mailman/listinfo/python-list
s that the vertices iterator creates new vertex objects every
time instead of iterating over the existing ones. This essentially
prevents, among other things, storing vertices as keys in a dictionary
since the hashes of the stored and the new vertex differ although they
compare equal. Is this real
h the
complexity and the error-proneness of having two new
similar-but-not-quite-the-same APIs with sets. Not only iteration is
arguably the most common operation on a view, but the cost (in extra
keystrokes and runtime performance) of populating any container that
the user may need from an iterator is pretty low.
George
--
http://mail.python.org/mailman/listinfo/python-list
ions by running python with '-O' or '-OO'.
Optimization flags should never change the behavior of a program, so
using assertions for what's part of the normal program behavior
(validating user-provided input) is wrong.
George
--
http://mail.python.org/mailman/listinfo/python-list
other, using strictly Open Source Software, and enjoying
the process. .NET/Mono and C# don't pass either the "lots" or the
"enjoy" tests.
> -Original Message-
> From: egbert [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 24, 2007 10:05 AM
> To: Ge
on" and any other kind, and I'm not aware of any
> case law that does so either. This distinction is also not codified in
> the GPL itself anywhere, so it's not a necessary condition of the
> license - it is an interpretation by the FSF and that is all.
[snip]
It is
ust works. Same scripts run on every platform. Bindings
available to every C/C++/FORTRAN library I've needed so far. Often
the bindings are not complete, but oddly enough the binding developers
have chosen to do just the functions I need, so who cares. A clean
architecture for adding more f
ey do not have the authority to actually define its
legal ramifications. Check with your company legal staff.
Having said that, I have been troubled by trolltech's approach from
the beginning, and therefore stay away from it. PyGTK and wdxPython
are solid GUIs, without the legal uncertainty.
--
Harry George
PLM Engineering Architecture
--
http://mail.python.org/mailman/listinfo/python-list
(float, line.split()) for line in
open('my_space_separated_file.txt')]
This stores the values as a list of lists, each list corresponding to a
row in the file. Depending on what you plan to do next with these
numbers, this may or may not be the best way to go about it, but since
you only mentioned the file reading part, we can't assume much.
George
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
> On 21 Jan 2007 13:32:19 -0800, "George Sakkis" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> >
> > The file is written once and then opened as read-only, there's no
> > flushing. So if cachi
Martin v. Löwis wrote:
> George Sakkis schrieb:
> > I've been trying to track down a memory leak (which I initially
> > attributed erroneously to numpy) and it turns out to be caused by a
> > memory mapped file. It seems that mmap caches without limit the chunks
> &g
Nick Craig-Wood wrote:
> George Sakkis <[EMAIL PROTECTED]> wrote:
> > I've been trying to track down a memory leak (which I initially
> > attributed erroneously to numpy) and it turns out to be caused by a
> > memory mapped file. It seems that mmap caches withou
801 - 900 of 1559 matches
Mail list logo