Austin Bingham wrote:
Yes, I can construct a dict as you
specify, where all of the keys map to values with name attributes
equal to the key. My point is that dict doesn't really help me enforce
that beyond simply letting me set it up; it doesn't care about the
values at all, just the keys. All th
Mick Krippendorf wrote:
Steve Holden wrote:
Many such designs make mistakes like using multiple columns
(or, even worse, comma-separated values) instead of many-to-many
relationships.
BTW, the comma-separted-values-in-a-field is officially called the First
Anormal Form. There *has to be* som
Mick Krippendorf wrote:
Ethan Furman schrieb:
Mick Krippendorf wrote:
BTW, the comma-separted-values-in-a-field is officially called the First
Anormal Form. There *has to be* some value to it since I've seen it used
quite a few times...
Just because you've seen something, doesn
Austin Bingham wrote:
On Thu, Oct 15, 2009 at 7:49 PM, Ethan Furman wrote:
Austin Bingham wrote:
I'm feeling really dense about now... What am I missing?
What you're missing is the entire discussion up to this point. I was
looking for a way to use an alternative uniqueness cri
Jon Clements wrote:
On Oct 16, 5:59 pm, Tim Chase wrote:
Stephen Hansen wrote:
Why doesn't duck typing apply to `sum`?
Because it would be so hideously slow and inefficient that it'd be way too
easy a way for people to program something they think should work fine but
really doesn't... al
Dave Angel wrote:
Dieter Maurer wrote:
Christian Heimes writes on Fri, 16 Oct 2009
17:58:29 +0200:
Alan G Isaac schrieb:
I expected this to be fixed in Python 3:
sum(['ab','cd'],'')
Traceback (most recent call last):
File "", line 1, in
TypeError: sum() ca
Carl Banks wrote:
On Oct 18, 4:07 pm, Ethan Furman wrote:
Dave Angel wrote:
Earlier, I would have agreed with you. I assumed that this could be
done invisibly, with the only difference being performance. But you
can't know whether join will do the trick without error till you know
arve.knud...@gmail.com wrote:
Hi
I thought that file objects were supposed to be garbage-collected and
automatically closed once they go out of scope, at least that's what
I've been told by more merited Python programmers. I'm also quite sure
that this is quite a common assumption in various pro
Dave Angel wrote:
It was intended to be understood, not copied.
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
Bryan Irvine wrote:
I'm a python n00b and so pardon me in advance if this is really stupid
question.
I have my suspicions but why does the following not work the way I'm
anticipating it will?
(python 2.4.4)
import os
if (os.system('echo test')):
...print 'success'
... else:
...prin
gslindstrom wrote:
On Oct 18, 5:56 pm, Gary Herron wrote:
Benjamin Middaugh wrote:
Thanks to everyone who helped with my query on reversing integers. I
have one more simple problem I'm having trouble solving. I want to
check a number for palindromic behavior (reading the same backwards
and f
ru...@yahoo.com wrote:
On Oct 19, 12:41 pm, Ethan Furman wrote:
gslindstrom wrote:
On Oct 18, 5:56 pm, Gary Herron wrote:
Benjamin Middaugh wrote:
Thanks to everyone who helped with my query on reversing integers. I
have one more simple problem I'm having trouble solving. I wa
Following closely on the heels of the whole sum()ing strings debate, I
think I found an error -- at least, it's not documented to behave this
way...
def uncompress_job(job_num,
save_path='z:\\old_jobs',
restore_path='z:\\orders'):
destination = os.path.
Ethan Furman wrote:
Following closely on the heels of the whole sum()ing strings debate, I
think I found an error -- at least, it's not documented to behave this
way...
def uncompress_job(job_num,
save_path='z:\\old_jobs',
restore_p
arve.knud...@gmail.com wrote:
On Oct 19, 3:48 pm, Ethan Furman wrote:
arve.knud...@gmail.com wrote:
Hi
I thought that file objects were supposed to be garbage-collected and
automatically closed once they go out of scope, at least that's what
I've been told by more meri
Steven D'Aprano wrote:
On Mon, 19 Oct 2009 13:29:52 -0700, Ethan Furman wrote:
Your arguments are most persuasive. Consider me convinced.
Even if the worst-case scenario is true (homework problem, ack!), either
the poster will learn from the answer in which case all is well, or the
p
J wrote:
Can someone explain why this code results in two different outputs?
for os in comp.CIM_OperatingSystem ():
print os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVersion
osVer = os.Name.split("|")[0] + " Service Pack", os.ServicePackMajorVersion
print osVer
the first pri
Steven D'Aprano wrote:
On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote:
My preference would be that failIfEqual checks both != and ==. This is
practical, and would benefit almost all use cases. If "!=" isn't "not
==" (IEEE NaNs I hear is the only known use case)
numpy uses == and != as
MRAB wrote:
Alf P. Steinbach wrote:
Hi all.
I'm just learning Python from scratch, on my own. Apologies if this
question is too newbie... Or perhaps answered in some FAQ (where?).
Here's my original code for simple starter program, using the
ActivePython implementation in Windows XP Prof,
Dan Guido wrote:
I'm trying to write a few methods that normalize Windows file paths.
I've gotten it to work in 99% of the cases, but it seems like my code
still chokes on '\x'. I've pasted my code below, can someone help me
figure out a better way to write this? This seems overly complicated
for
Gabriel Genellina wrote:
En Tue, 20 Oct 2009 19:57:19 -0300, Ethan Furman
escribió:
Steven D'Aprano wrote:
On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote:
My preference would be that failIfEqual checks both != and ==. This is
practical, and would benefit almost all use case
Greetings, List!
Say I have an old-fashioned dbf style table, with a single name field of
50 characters:
names = dbf.Table(':memory:', 'name C(40)')
Then I add a bunch of names from who-knows-where:
for name in some_iterable():
names.append((name))
Now I want to know how many start wi
Greetings, all!
I would like to add unicode support to my dbf project. The dbf header
has a one-byte field to hold the encoding of the file. For example,
\x03 is code-page 437 MS-DOS.
My google-fu is apparently not up to the task of locating a complete
resource that has a list of the 256 p
KB wrote:
Hi,
I have to pass over 150 parameters to a print statement ala:
print "%s %s %s <150'th unique text> %s" % (v
[0], v[1], ... v[150])
I can't use a for loop like I normally would over the list "v" due to
the different text fragments between each var.
Is there a lambda function
John Machin wrote:
On Oct 23, 7:28 am, Ethan Furman wrote:
Greetings, all!
I would like to add unicode support to my dbf project. The dbf header
has a one-byte field to hold the encoding of the file. For example,
\x03 is code-page 437 MS-DOS.
My google-fu is apparently not up to the task
John Machin wrote:
On Oct 23, 3:03 pm, Ethan Furman wrote:
John Machin wrote:
On Oct 23, 7:28 am, Ethan Furman wrote:
Greetings, all!
I would like to add unicode support to my dbf project. The dbf header
has a one-byte field to hold the encoding of the file. For example,
\x03 is
John Machin wrote:
On Oct 24, 4:14 am, Ethan Furman wrote:
John Machin wrote:
On Oct 23, 3:03 pm, Ethan Furman wrote:
John Machin wrote:
On Oct 23, 7:28 am, Ethan Furman wrote:
Greetings, all!
I would like to add unicode support to my dbf project. The dbf header
has a one
John Machin wrote:
On Oct 27, 3:22 am, Ethan Furman wrote:
John Machin wrote:
Try this:
http://webhelp.esri.com/arcpad/8.0/referenceguide/
Wow. Question, though: all those codepages mapping to 437 and 850 --
are they really all the same?
437 and 850 *are* codepages. You mean &quo
John Machin wrote:
On Oct 27, 7:15 am, Ethan Furman wrote:
>
Let me rephrase -- say I get a dbf file with an LDID of \x0f that maps
to a cp437, and the file came from a german oem machine... could that
file have upper-ascii codes that will not map to anything reasonable on
my \x01 cp
Steve wrote:
On Oct 17, 8:28 pm, Tim Chase wrote:
Christian Heimes wrote:
Alan G Isaac wrote:
On 10/16/2009 5:03 PM, Christian Heimes wrote:
It's not going to happen.
That's a prediction, not a justification.
It's not a prediction, it's a statement. It's not going to happend
because
John Machin wrote:
There may possibly different interpretations of a codepage out there
somewhere, but they are all *intended* to be the same, and I advise
you to cross the different-cp437s bridge *if* it exists and you ever
come to it.
Have you got access to files with LDID not in (0, 1) that y
Bruno Desthuilliers wrote:
Dotan Cohen a écrit :
I don't want to learn some
"templating language" that duplicates what Python already has built
in!
Then use Mako - it uses plain Python to manage the presentation logic.
And if you go for Mako, then you might as well switch to Pylons. Great
f
Mark Hammond wrote:
On 29/10/2009 11:06 AM, Alf P. Steinbach wrote:
So I suggest switching to some other more light-weight installer
technology.
Thanks for the suggestion, but I expect we will stick with MSI even with
its shortcomings. Using MSI files has significant other advantages,
par
Alf P. Steinbach wrote:
* James Harris:
You get way too deep into Python in places (for a beginner's course in
programming). For example, "from now on I’ll always use from
__future__ in any program that uses print."
Sorry, but I think that hiding such concerns is a real disservice.
The diss
Alf P. Steinbach wrote:
* Ethan Furman:
Mark Hammond wrote:
On 29/10/2009 11:06 AM, Alf P. Steinbach wrote:
So I suggest switching to some other more light-weight installer
technology.
Thanks for the suggestion, but I expect we will stick with MSI even
with its shortcomings. Using
Alf P. Steinbach wrote:
* Ethan Furman:
Alf P. Steinbach wrote:
* James Harris:
You get way too deep into Python in places (for a beginner's course in
programming). For example, "from now on I’ll always use from
__future__ in any program that uses print."
Sorry, but I th
Greetings!
I am happy to announce the latest release of python-dBase (dbf for
short)! At this point it supports dBase III and Visual FoxPro 6 dbf files.
It's a bit quicker now since it's using array.array to hold the records
and not strings, and the API has been standardized. It also now ha
Daniel Fetchinson wrote:
I was referring to this comment by Ben:
"Suggestion: Please don't make efforts to fragment the community."
This IMHO is hostile, because it presupposes that the mere goal of the
OP is fragmenting the community
It presupposes nothing of any goal. It describes a predict
Simon Brunning wrote:
2009/11/1 Steven D'Aprano :
The only stupid question is the one you are afraid to ask.
I was once asked, and I quote exactly, "are there any fish in the Atlantic sea?"
That's pretty stupid. ;-)
Are there any fish in the Dead Sea?
~Ethan~
--
http://mail.python.org/m
Daniel Fetchinson wrote:
I was referring to this comment by Ben:
"Suggestion: Please don't make efforts to fragment the community."
This IMHO is hostile, because it presupposes that the mere goal of the
OP is fragmenting the community
It presupposes nothing of any goal. It describes a predict
Dennis Lee Bieber wrote:
> Perfectly valid answer -- there are no fish as there is no
> Atlantic sea
Steven D'Aprano wrote:
> Once in the distant past, there were no fish in what would become the
> Atlantic Ocean (not sea)
What's with the bias against the word 'sea'?
sea
–noun
1. the salt w
Daniel Fetchinson wrote:
I'm the king in my castle, although I'm fully aware of the fact that my castle
might be ugly from the outside :)
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
I can only repeat what I said to Daniel: can you guarantee that the nice
safe, low-risk environment will never change? If not, then choose a more
realistic threat model, and build the walls of your locked box
accordingly.
Seems to me you can't really *guarentee* anythin
Aahz wrote:
In article , kj wrote:
The subject line says it all.
You are probably trying to remove a screw with a hammer -- why don't you
tell us what you really want to do and we'll come up with a Pythonic
solution?
Well, I don't know what kj is trying to do, but my project is another
Greetings!
How wise is it to base code on inspect? Specifically on things like
live frames on the stack and whatnot. It occurs to me that this is
leaning towards implementation details, and away from pure, pristine Python.
As an example, I have this routine in a module I'm working on:
def
AK Eric wrote:
so:
# moduleA.py
import moduleB
# moduleB.py
import sys
stuff = sys._getframe(1).f_locals
print stuff
Prints:
{'__builtins__': ,
'__file__': 'C:\\Documents and SettingsMy Documents\
\python\\moduleA.py',
'__name__': '__main__',
'__doc__': None}
Looks like you could query s
So I've added unicode support to my dbf package, but I also have some
rather large programs that aren't ready to make the switch over yet. So
as a workaround I added a (rather lame) option to convert the
unicode-ified data that was decoded from the dbf table back into an
encoded format.
Here
Chris Withers wrote:
Mark Tolonen wrote:
The book Python: Programming on Win32 has a whole chapter on COM, and
a section on COM servers.
...and it's generally accepted that COM sucks rocks through straws, so
explore alternatives when they're available ;-)
+1 QOTW :D
--
http://mail.python.o
tbour...@doc.ic.ac.uk wrote:
Hi,
I was looking for a facility similar to slices in python library that
would avoid the implicit creation of a new list and copy of elements
that is the default behaviour. Instead I'd rather have a lazy iteratable
object on the original sequence. Well, in the en
Please don't top post. :)
tbour...@doc.ic.ac.uk wrote:
On Thu, Nov 19, 2009 at 3:00 AM, Rami Chowdhury
mailto:rami.chowdh...@gmail.com>> wrote:
I'm not sure you're understanding the point others have been making. A
list item is merely another reference to an existing object -- it
Themis Bourdenas wrote:
On Thu, Nov 19, 2009 at 2:44 PM, Ethan Furman <mailto:et...@stoneleaf.us>> wrote:
So "shallow copy" == "new label created for existing object".
So is your desired behavior to write back to the original list if your
sub-list is m
Alf P. Steinbach wrote:
* Benjamin Kaplan:
On Thu, Nov 19, 2009 at 4:42 PM, Alf P. Steinbach wrote:
>>>
I feel that there's still something lacking in my understanding
though, like
how/where the "really actually just pure local not also global" is
defined
for function definition, but it's n
Aahz wrote:
In article ,
Grant Edwards wrote:
You've really got to try pretty hard to create one. But if you
want to, here's how to do it:
1) Start by complaining that your program doesn't work because
of a bug in Python.
[...]
Post of the month!
I'll second that! I really needed a
Jason R. Coombs wrote:
The current implementation of Python (2.6.4, 3.1.1) treats \bar as a
relative path but reports it as an absolute path.
ntpath.isabs('\\bar')
True
ntpath.abspath('\\bar')
'C:\\bar'
os.chdir('d:\\')
ntpath.abspath('\\bar')
'd:\\bar'
os.chdir('server\\share'
Steven D'Aprano wrote:
On Fri, 20 Nov 2009 08:02:38 -0800, Ethan Furman wrote:
module scope == global scope
That is, there is nothing higher than module scope. (So, yes, global is
a slight misnomer... in Python it means 'global to a module'.)
Actually there is: built-ins.
Dave Angel wrote:
Esmail wrote:
Esmail schrieb:
Could someone help confirm/clarify the semantics of the [:] operator
in Python?
a = range(51,55)
# 1 ##
b = a[:] # b receives a copy of a, but they are independent
Semi-aside, if I wanted to make local copy of a li
The problem I have with properties is my typing. I'll end up assigning
to an attribute, but get the spelling slightly wrong (capitalized, or
missing an underscore -- non-obvious things when bug-hunting), so now I
have an extra attribute which of course has zero effect on what I'm
trying to do
Jason R. Coombs wrote:
On Nov 20, 3:52 pm, Ethan Furman wrote:
It is often said on this list that 'Python is not Java'. It is also
true that 'Windows is not Unix'.
Unlike the *nix world where there is a *single* root, and everything
else is relative to that, in the Win
Christian Heimes wrote:
Gregory Ewing wrote:
ntpath.join('d:\\foo', '\\bar')
'\\bar'
This does seem like a bug, though -- the correct result
should really be 'd:\\bar', since that's what you would
get if you used the name '\\bar' with 'd:' as your current
drive.
No, it's not a bug. Since
Bruno Desthuilliers wrote:
Ethan Furman a écrit :
The problem I have with properties is my typing. I'll end up
assigning to an attribute, but get the spelling slightly wrong
(capitalized, or missing an underscore -- non-obvious things when
bug-hunting), so now I have an extra attr
Chris Rebert wrote:
On Tue, Nov 24, 2009 at 9:39 AM, Ethan Furman wrote:
Bruno Desthuilliers wrote:
Ethan Furman a écrit :
The problem I have with properties is my typing. I'll end up assigning
to an attribute, but get the spelling slightly wrong (capitalized, or
missing an under
Bruno Desthuilliers wrote:
Ethan Furman a écrit :
Let's head towards murkier waters (at least murkier to me -- hopefully
they can be easily clarified): some of the attributes are read-only,
such as record count; others are not directly exposed, but still
settable, such as table ve
Robert Kern wrote:
On 2010-02-04 14:55 PM, Jonathan Gardner wrote:
On Feb 3, 3:39 pm, Steve Holden wrote:
Robert Kern wrote:
On 2010-02-03 15:32 PM, Jonathan Gardner wrote:
I can explain all of Python in an hour; I doubt anyone will understand
all of Python in an hour.
With all respect,
Julian wrote:
Hello,
I've asked this question at stackoverflow a few weeks ago, and to make
it clear: this should NOT be a copy of the stackoverflow-thread
"hidden features of Python".
I want to design a poster for an open source conference, the local
usergroup will have a table there, and in t
Robert Kern wrote:
On 2010-02-04 17:46 PM, Ethan Furman wrote:
Robert Kern wrote:
On 2010-02-04 14:55 PM, Jonathan Gardner wrote:
On Feb 3, 3:39 pm, Steve Holden wrote:
Robert Kern wrote:
On 2010-02-03 15:32 PM, Jonathan Gardner wrote:
I can explain all of Python in an hour; I doubt
John Nagle wrote:
kj wrote:
...
Through a *lot* of trial an error I finally discovered that the
root cause of the problem was the fact that, in the same directory
as buggy.py, there is *another* innocuous little script, totally
unrelated, whose name happens to be numbers.py.
The right ans
Tim Chase wrote:
Any thoughts on how others make the choice?
-tkc
If one branch is only a few lines, it comes first. As often as not,
that tiny branch is checking for errors, and the "else" branch doesn't
need to be indented.
def func(arg1):
if arg1 is 'stupid':
raise ValueErr
Steven D'Aprano wrote:
Believe me Alf, the fact that people are taking the time to try to argue
with you instead of just kill-filing you is a compliment.
It's a compliment I am not paying, although I am grateful to those who
are attempting to teach him. At the rate it's going, though, I don
mk wrote:
John Posner wrote:
http://effbot.org/zone/call-by-object.htm
http://en.wikipedia.org/wiki/Evaluation_strategy
[1] http://mail.python.org/pipermail/edu-sig/2008-May/008583.html
Hmm how about "call by label-value"?
That is, you change labels by assignment, but pass the v
Steve Howell wrote:
On Feb 14, 7:11 am, Steven D'Aprano wrote:
On Sat, 13 Feb 2010 23:45:47 -0800, Steve Howell wrote:
The term "pointer" is very abstract. Please give me a concrete
definition of a pointer.
A programming language data type whose value directly specifies (or
"points to") a
John Nagle wrote:
John Nagle wrote:
I look at this as Python's answer to multicore CPUs and "Go".
On that note, I went to a talk at Stanford yesterday by one of the
designers of Intel's Nelahem core. The four-core, eight thread
version is out now. The six-core, twelve thread version i
monkeys paw wrote:
NEW QUESTION if y'all are still reading:
Is there an integer increment operation in Python? I tried
using i++ but had to revert to 'i = i + 1'
Nope, but try i += 1.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
Luca wrote:
[snippety]
Maybe you are right, but being italian myself i can remember when i was
a middle schooler (no computer before that) and the hours spent on my
MSX figuring out how the thing worked. I learned all the commands as
"brandnames" without really understanding them. I had _no_
Michele Simionato wrote:
On Jan 16, 9:27 pm, mk wrote:
Hello everyone,
I looked for it I swear, but just can't find it.
Most Python books seem to focus on examples of how to call functions
from standard library. I don't need that, I have online Python
documentation for that.
I mean really a
Jon Clements wrote:
On 26 Mar, 09:49, James Harris wrote:
On 25 Mar, 22:56, Jon Clements wrote:
On 25 Mar, 22:40, James Harris wrote:
I am looking to store named pieces of text in a form that can be
edited by a standard editor such as notepad (under Windows) or vi
(under Unix) and th
Okay, different post for my actual questions. :)
On the PyPI page for strait (http://pypi.python.org/pypi/strait/0.5.1)
it has the example of choosing which methods to keep in the composed class:
class TOSWidget(BaseWidget):
__metaclass__ = include(Pack, Place, Grid)
info = Pack.info.
Wow.
I just stumbled across one of Michele Simionato's offerings, called
simple traits (strait for short) which looks *really* cool.
You can find it here: http://pypi.python.org/pypi/strait/0.5.1
Extremely quick summary:
Instead of multiple inheritance, with it's range of problems, use singl
Jonathan Hartley wrote:
Hey everyone. By coincidence, only yesterday I was wondering about
using classes as a way of labeling a block of code, ie. an lightweight
alternative to defining a function that would only be called from one
location.
eg. instead of:
x = 1
((some complex logic))
y = 2
Robert Kern wrote:
On 2010-03-27 08:19 , Ethan Furman wrote:
Okay, different post for my actual questions. :)
On the PyPI page for strait (http://pypi.python.org/pypi/strait/0.5.1)
it has the example of choosing which methods to keep in the composed
class:
class TOSWidget(BaseWidget
Greetings!
Perhaps I woke up too early this morning, but this behaviour has me baffled:
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
--> test = object()
--> setattr(test, 'example'
Many thanks for the replies, and especially for the very detailed
explanation. Makes much more sense now.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
kj wrote:
class _Spam(object):
@classmethod
def _(cls, x, y, z):
try:
mongo = cls.mongo
except AttributeError:
mongo = cls.mongo = heavy_lifting_at_runtime()
return frobnicate(x, y, z, mongo)
ham = _Spam._(1, 2, 3)
Is this really more n
Steve Holden wrote:
Alf P. Steinbach wrote:
* Jason Friedman:
Hi, what is the difference between:
def MyClass(object):
pass
and
def MyClass():
pass
If you really meant 'def', then the first is a routine taking one
argument, and the second is a routine of no arguments.
If you meant
Patrick Maupin wrote:
On Apr 2, 1:21 pm, Ethan Furman wrote:
For this type of situation, my preference would be:
class spam(object):
def __call__(self, x, y, z):
try:
mongo = self.mongo
except AttributeError:
mongo = self.mongo
Patrick Maupin wrote:
[snippage]
Well, I think the whole discussion has basically been about personal
preference. OTOH, but if you call the function a few million times,
you might find the cost of try/except to be something that you would
rather not incur -- it might become a performance issue
kj wrote:
In Steve Holden
writes:
John Nagle wrote:
Chris Rebert wrote:
On Tue, Mar 30, 2010 at 8:40 AM, gentlestone
wrote:
Hi, how can I write the popular C/JAVA syntax in Python?
Java example:
return (a==b) ? 'Yes' : 'No'
My first idea is:
return ('No','Yes')[bool(a==b)]
Is th
Terry Reedy wrote:
In Duncan
Booth writes:
class Spam(object):
mongo = None
def __call__(self, x, y, z):
if self.mongo is None:
self.mongo = heavy_lifting_at_runtime()
return frobnicate(x, y, z, self.mongo)
Unless one wants the intialization of mongo delayed
Steven D'Aprano wrote:
On Fri, 02 Apr 2010 12:39:16 -0700, Patrick Maupin wrote:
On Apr 2, 2:38 pm, Ethan Furman wrote:
[...]
Sounds like a personal preference issue, rather than a necessary /
unnecessary issue -- after all, if you call that function a thousand
times, only once is
Well, it's been said than imitation is the sincerest form of flattery,
so be flattered, Michele!
In order to gain a better understanding of the whole metaclass issue, I
decided to make my own implementation, targeting Python 3. I figured I
could leave out a bunch of the complexity required to
Steven D'Aprano wrote:
On Fri, 02 Apr 2010 19:48:59 -0700, Ethan Furman wrote:
The heuristic I use is, if I expect the try block to raise an exception
more than about one time in ten, I change to an explicit test. In this
case, since the exception should only be raised once, and then
kirby.ur...@gmail.com wrote:
With Microsoft abandoning Visual FoxPro come 2015, we have 100K
developers
jumping ship (rough guess), perhaps to dot NET, but not necessarily.**
This page is potentially getting a lot of hits (I'm not privy to the
analytics):
http://packages.python.org/dbf/
The
kirby.ur...@gmail.com wrote:
Some ideas:
for (i, name) in enumerate(thedbf.field_names):
sheet1.write(0, i, name, header_style)
thetype = thedbf.type(name)
thelen, thedec = thedbf.size(name)
if thetype == "M":
thelen = 100
elif thelen == 0:
Peter Otten wrote:
> http://mail.python.org/pipermail/python-list/2010-October/1258606.html
http://mail.python.org/pipermail/python-list/2010-October/1259024.html
I found #6210 on bugs.python.org -- does anyone know if there are any
others regarding this issue? Or any progress on MRAB's idea
Peter Otten wrote:
Hrvoje Niksic wrote:
Peter Otten <__pete...@web.de> writes:
Note that StopIteration is an internal detail of no relevance whatsoever
to the caller. Expose this is unnecessary at best and confusing at
worst.
http://mail.python.org/pipermail/python-list/2010-October/1258606.
Vinay Sajip wrote:
Some changes are being proposed to how logging works in default
configurations.
I like the changes proposed.
Question about the "handler of last resort": is there only one of them,
or will each library have its own so it can decide what the minimum
severity should be for
Please don't top-post.
Rob Richardson wrote:
-Original Message-
I missed the start of this discussion but there are two simpler ways:
def func(iterable):
for x in iterable:
print(x)
return
raise ValueError("... empty iterable")
Or using 3.x's next's optional
Arnaud Delobelle wrote:
I missed the start of this discussion but there are two simpler ways:
def func(iterable):
for x in iterable:
print(x)
return
raise ValueError("... empty iterable")
For the immediate case this is a cool solution.
Unfortunately, it doesn't fix t
Ethan Furman wrote:
Please don't top-post.
Rob Richardson wrote:
-Original Message-
I missed the start of this discussion but there are two simpler ways:
def func(iterable):
for x in iterable:
print(x)
return
raise ValueError("... empty iterable&q
Ethan Furman wrote:
Arnaud Delobelle wrote:
I missed the start of this discussion but there are two simpler ways:
def func(iterable):
for x in iterable:
print(x)
return
raise ValueError("... empty iterable")
For the immediate case this is a cool solutio
Steven D'Aprano wrote:
I am soliciting feedback regarding the API of my statistics module:
http://code.google.com/p/pycalcstats/
Specifically the following couple of issues:
(1) Multivariate statistics such as covariance have two obvious APIs:
A pass the X and Y values as two separate it
1501 - 1600 of 1928 matches
Mail list logo