Re: "smtplib.SMTPServerDisconnected: please run connect() first"

2009-10-09 Thread Ethan Furman
al (namely, textfile, me, and you) The line preceeding it, s = smtplib.SMTP() needs to have an e-mail server specified. E.g. s = smtplib.SMTP('localhost') # from the 2.5 docs Hope this helps! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: easy install

2009-10-09 Thread Ethan Furman
Robert Kern wrote: On 2009-10-09 19:08 PM, David Robinow wrote: On Fri, Oct 9, 2009 at 5:02 PM, Ethan Furman wrote: A puzzlement: I used easy_install the other day to get xlutils on my system. It automatically installed xlrd and xlwt as well. This is cool. What's not so cool a

Re: easy install

2009-10-09 Thread Ethan Furman
David Robinow wrote: On Fri, Oct 9, 2009 at 5:02 PM, Ethan Furman wrote: A puzzlement: I used easy_install the other day to get xlutils on my system. It automatically installed xlrd and xlwt as well. This is cool. What's not so cool are my tracebacks. E.g. Python 2.5.4 (r254:67916

Re: No threading.start_new_thread(), useful addition?

2009-10-09 Thread Ethan Furman
than that, are there other inherent problems with using that decorator at non-import times? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: easy install

2009-10-10 Thread Ethan Furman
>Ethan Furman wrote: >> A puzzlement: >> >> I used easy_install the other day to get xlutils on my system. It >> automatically installed xlrd and xlwt as well. This is cool. What's >> not so cool are my tracebacks. E.g. >> >> Python 2.5.4 (r25

Re: organizing your scripts, with plenty of re-use

2009-10-10 Thread Ethan Furman
Gabriel Genellina wrote: En Sat, 10 Oct 2009 05:57:08 -0300, Steven D'Aprano escribió: On Fri, 09 Oct 2009 16:37:28 -0700, Buck wrote: Here's a scenario. A user does a cvs checkout into some arbitrary directory and sees this: project/ +-- python/ +-- animals.py +-- mammals/

Re: The rap against "while True:" loops

2009-10-12 Thread Ethan Furman
ut I am not aware of *any* programming costruct that cannot be. If you rule out one way of doing things for every situation you can end up making messes just as bad as the ones you're trying to avoid. Good programming, as all good endeavors, requires thinking too. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: organizing your scripts, with plenty of re-use

2009-10-12 Thread Ethan Furman
, it's not going to start looking all over the hard-drive for it. If that were the case you would have to be extra careful to have every module's name be distinct, and then what's the point of having packages? ~Ethan~ In my humble opinion if these actions are not possib

Re: organizing your scripts, with plenty of re-use

2009-10-13 Thread Ethan Furman
tion"... seems to me that if you have to copy it, check it out, or anything to get the code from point A to point 'usable on your computer', then you have done some sort of installation. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: postprocessing in os.walk

2009-10-13 Thread Ethan Furman
, perhaps you noticed the flag "topdown=False"? With that (un)set, I repeat the question -- why do you need a hook? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-13 Thread Ethan Furman
nd you, I'm not saying you should change the way you program as it seems to work for you, just that there are other ways to write good clean programs. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient running median

2009-10-13 Thread Ethan Furman
? Thanks Janto You might look at http://pypi.python.org/pypi/blist/0.9.4 ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-14 Thread Ethan Furman
-) For what it's worth, most of my loops run to completion, with no sign of a break anywhere. Some have a break, and use it. Some, even, (dare I say it?) use break *and* else! And it's awesome! Go Python! :-D ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient running median

2009-10-14 Thread Ethan Furman
Janto Dreijer wrote: On Oct 13, 7:37 pm, Ethan Furman wrote: Janto Dreijer wrote: I'm looking for code that will calculate the running median of a sequence, efficiently. (I'm trying to subtract the running median from a signal to correct for gradual drift). My naive attempt (

Re: set using alternative hash function?

2009-10-15 Thread Ethan Furman
value already in the dict. Learn something new everyday! I'm still not sure I understand your concern about the values in a set, though. Sets keep the first object of a given key, dicts keep the last object of a given key; in both cases, all other objects with the same key are lost. So i

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Ethan Furman
just that you may not be right. ;-) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Ethan Furman
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

Re: set using alternative hash function?

2009-10-16 Thread Ethan Furman
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

Re: restriction on sum: intentional bug?

2009-10-16 Thread Ethan Furman
nstance, sum(['1', '2', '3']); it's not completely unreasonable for someone to expect a result of 6. It is in Python. '1' + '2' + '3' == '123', and so should sum. If sum already has two code branches to handle strings, let the string branch do a join. That's my vote, anyway. :) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-18 Thread Ethan Furman
r: unsupported operand type(s) for +: 'float' and 'Dummy' >>> test2 = ['a', 'string', 'and', 'a', Dummy()] >>> ''.join(test2) Traceback (most recent call last): File "", line 1, in TypeError: sequence item 4: expected string, Dummy found Looks like a TypeError either way, only the verbage changes. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-18 Thread Ethan Furman
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

Re: File not closed on exception

2009-10-19 Thread Ethan Furman
ception traceback. Since the objects are still alive, they are not GC'ed. That is why this is better: def create(): f = file("tmp", "w") try: do_stuff_that_raises_exception finally: os.remove("tmp") ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: print()

2009-10-19 Thread Ethan Furman
Dave Angel wrote: It was intended to be understood, not copied. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system() question

2009-10-19 Thread Ethan Furman
d non-zero is True in Python, hence the 'success' the second time around. I wonder how the docs phrase it? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking a Number for Palindromic Behavior

2009-10-19 Thread Ethan Furman
problems, but a description of what has been tried, preferably with code snippets and results, should be included with the request. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking a Number for Palindromic Behavior

2009-10-19 Thread Ethan Furman
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

os.path.join

2009-10-19 Thread Ethan Furman
;, 19858] I did have more interesting errors to lead me to this point, but here I am, and my question... shouldn't os.path.join raise an exception if an incompatible type is passed to it? I sure wish it had! ;-) I was expecting, and the documentation led me to believe, that a stri

Re: os.path.join

2009-10-19 Thread Ethan Furman
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

Re: File not closed on exception

2009-10-20 Thread Ethan Furman
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

Re: Checking a Number for Palindromic Behavior

2009-10-20 Thread Ethan Furman
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

Re: A stupid newbie question about output...

2009-10-20 Thread Ethan Furman
pieces of temp individually this that What you probably want on line two is: osVer = os.Name.split("|")[0] + " Service Pack " + \ str(os.ServicePackMajorVersion) or, in Python 2.x: osVer = "%s Service Pack %d" % (os.Name.split("|")[0], os.ServicePackMajorVersion) This way, osVer is a string, and not a tuple. Hope this helps. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Ethan Furman
xisting bugs. It would surprise me. Two issues: 1) Sounds like we should have two more Asserts -- failIfNotEqual, and assertNotNotEqual to handle the dichotomy in Python; and 2) Does this mean (looking at Mark Dickinson's post) that 2.7 and 3.1 are now broken? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread Ethan Furman
er that's correct, would the first version still work in practice regardless of Python / Tkinter implementation? I've looked at the source in Tkinter.py. The positional arguments are collected and then flattened into a tuple (tuples and lists are 'scattered'). Huh. I

Re: Windows file paths, again

2009-10-21 Thread Ethan Furman
t' routine gets a chance to run). Hope this helps. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest wart/bug for assertNotEqual

2009-10-22 Thread Ethan Furman
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

attribute access and indirection

2009-10-22 Thread Ethan Furman
s being able to do: matches = table.search([record.zip4[:5], record.dlvryaddrs]) I could also do: matches = table.search(record('zip4[:5], dlvryaddrs')) or, equivalently, criteria = 'this, that[:7], the_other' matches = table.search(record(criteria)) Any better ideas? Am

unicode and dbf files

2009-10-22 Thread Ethan Furman
possible values and their corresponding code pages. So far I have found this, plus variations: http://support.microsoft.com/kb/129631 Does anyone know of anything more complete? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Ethan Furman
If so, try: print "%s blah %s blah blah %s " % tuple(v) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and dbf files

2009-10-22 Thread Ethan Furman
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

Re: unicode and dbf files

2009-10-23 Thread Ethan Furman
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

Re: unicode and dbf files

2009-10-26 Thread Ethan Furman
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

Re: unicode and dbf files

2009-10-26 Thread Ethan Furman
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

Re: unicode and dbf files

2009-10-27 Thread Ethan Furman
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

Re: restriction on sum: intentional bug?

2009-10-27 Thread Ethan Furman
ldn't make sense as len() works on iterables. Ints do not have a __len__ method, so why should len() work on them? Strs, on the other hand, do have an __add__ method. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and dbf files

2009-10-27 Thread Ethan Furman
so dense. :) Cheers! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-29 Thread Ethan Furman
t, at least, until I have achieved Python Mastery! :) Guess I better find some time to read through my Pylons book... ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Ethan Furman
Mark Looks like in 3.x the name was changed to tkinter. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Ethan Furman
ior when it was moved out of __future__ and made a standard part of the language. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Ethan Furman
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

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Ethan Furman
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

ANN: python-dBase 0.86 Released!

2009-11-03 Thread Ethan Furman
e dbf formats (dBase IV, V, 7 -- any links to these layouts would be /greatly/ appreciated!) This release is available at PyPI -- just search for dbf! As always, success stories and bug reports desired. Happy Hacking! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyfora, a place for python

2009-11-03 Thread Ethan Furman
Not an exclamation, no name calling, just a plain request rooted in reality. And that's a fact. ;-) Shall we now discuss the nature of the space/time continuum and the exact reality of quarks? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: self.__dict__ tricks

2009-11-03 Thread Ethan Furman
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~ -- ht

Re: Pyfora, a place for python

2009-11-04 Thread Ethan Furman
speach the denotations of 'resisting' and 'opposed to' are very different from 'hostile' -- hence such phrases as 'resisting with hostility' and 'hostiley opposed to'. In other words, I'll grant you the win of that hair, but I still would not characterize it as hostile. ;-) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: self.__dict__ tricks

2009-11-04 Thread Ethan Furman
'? sea –noun 1. the salt waters that cover the greater part of the earth's surface. 2. a division of these waters, of considerable extent, more or less definitely marked off by land boundaries: the North Sea. 3. one of the seven seas; ocean. I'd say the Atlantic qualifie

Re: Python as network protocol

2009-11-10 Thread Ethan Furman
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

Re: Python as network protocol

2009-11-10 Thread Ethan Furman
*guarentee* anything, especially something as elusive as the distant future. Program for what your needs are, and document accordingly. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How can a module know the module that imported it?

2009-11-11 Thread Ethan Furman
ave for now is def _get_module(): "get the calling module -- should be the config'ed module" target = os.path.splitext(inspect.stack()[2][1])[0] target = __import__(target) return target If there's a better way, I'd love to know about it! Oh, and I'm using 2.5.4, but I suspect kj is using 2.6. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

using inspect

2009-11-11 Thread Ethan Furman
def _get_module(): "get the calling module -- should be the config'ed module" target = os.path.splitext(inspect.stack()[2][1])[0] target = __import__(target) return target How brittle is this technique? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How can a module know the module that imported it?

2009-11-12 Thread Ethan Furman
the next. I'm using the inspect module (for the moment, at least), and my question boils down to: Will it work correctly on all versions of Python in the 2.x range? 3.x range? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

the unicode saga continues...

2009-11-13 Thread Ethan Furman
gt; locale.getdefaultlocale() ('en_US', 'cp1252') My confusion lies in my apparant codepage (cp1252), and the discrepancy with character u'\xed' which is absolutely an i with an accent; yet when I encode with cp1252 and print it, I get an o with a line. Can anybody clue me in to what's going on here? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Python functions from Excel

2009-11-17 Thread Ethan Furman
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

Re: non-copy slices

2009-11-18 Thread Ethan Furman
__.dummy object at 0x013F1A50>, <__main__.dummy object at 0x00A854F0>] In [11]: list2[0] is list1[1] Out[11]: *True* In [12]: list2[1] is list1[2] Out[12]: *True* No copying of items going on here. What do you get? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: non-copy slices

2009-11-19 Thread Ethan Furman
object". So is your desired behavior to write back to the original list if your sub-list is modified? In other words, you are creating a window onto an existing list? If not, what would happen when a sublist element was modified (or deleted, or appended, or ...)? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: non-copy slices

2009-11-19 Thread Ethan Furman
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

Re: Is an interactive command a block?

2009-11-20 Thread Ethan Furman
cope?). 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'.) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Newsgroup for beginners

2009-11-20 Thread Ethan Furman
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

Re: Relative versus absolute paths on Windows

2009-11-20 Thread Ethan Furman
and other platforms for handling absolute paths in Windows, is there a way forward that handles these cases more elegantly, or is the best approach to just mumble something nasty under our breath and work around these issues on a case-by-case basis? I just go with the mumbling, myself. Hope this helps. ~Ethan~ P.S. And now that I look up the comments in the bug-tracker, I see this was all already pointed out to you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is an interactive command a block?

2009-11-20 Thread Ethan Furman
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.

Re: semantics of [:]

2009-11-20 Thread Ethan Furman
Hope this helps. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

attributes, properties, and accessors -- philosophy

2009-11-23 Thread Ethan Furman
se_deleted() # returns True or False table.use_deleted(False) # skip deleted records instead of result = table.use_deleted table.use_deleted = False My question: is this [ severely | mildly | not at all ] un-pythonic? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative versus absolute paths on Windows

2009-11-23 Thread Ethan Furman
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

Re: Relative versus absolute paths on Windows

2009-11-23 Thread Ethan Furman
n("ignored", "\\bar") '\\bar' Posixpath follows the same rules, too. posixpath.join("..", "egg", "/var") '/var' posixpath.join("..", "egg", "var") '../egg/var' Posix has the luxury of running on sane systems with only one root. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: attributes, properties, and accessors -- philosophy

2009-11-24 Thread Ethan Furman
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

Re: attributes, properties, and accessors -- philosophy

2009-11-24 Thread Ethan Furman
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

Re: attributes, properties, and accessors -- philosophy

2009-11-25 Thread Ethan Furman
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

Re: Python and Ruby

2010-02-05 Thread Ethan Furman
ood explanatory material, and yet some of the points I didn't fully comprehend until much, much later. Every time, though, it's still the same reaction: I *love* Python! :D ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Your beloved python features

2010-02-05 Thread Ethan Furman
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

Re: Python and Ruby

2010-02-05 Thread Ethan Furman
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

Re: How to guard against bugs like this one?

2010-02-05 Thread Ethan Furman
ipt that checks for duplicate modules (not a bad idea for debugging), but don't start throwing errors... next thing you know we won't be able to shadow classes, functions, or built-ins! !-) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: "if {negative}" vs. "if {positive}" style

2010-02-10 Thread Ethan Furman
upid': raise ValueError("that's a stupid argument!") do_something do_something_else etc, etc ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Modifying Class Object

2010-02-10 Thread Ethan Furman
y-expecting-it-to-ly yours, ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with MemoryError

2010-02-12 Thread Ethan Furman
m coined decades ago, and that accurately defines the way that Python (the language) actually does it, should be the term used. My $0.02. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Modifying Class Object

2010-02-14 Thread Ethan Furman
st itself), then I need a tuple like (lst, 48). I think that's the key right there -- if 48 was really a pointer, you wouldn't need to pass lst in as 48 would in fact be the memory address of the object you wanted to manipulate. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: The future of "frozen" types as the number of CPU cores increases

2010-02-18 Thread Ethan Furman
ingly. John Nagle Will the new GIL in 3.2 make this workable? It would still be one thread at a time, though, wouldn't it. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: python dowload

2010-02-23 Thread Ethan Furman
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

Re: Renaming identifiers & debugging

2010-02-25 Thread Ethan Furman
computers talked. [more snippety] Perhaps the lesson to learn from this is that as *you* teach programming to non-english speakers you take the time to say "'if' means 'se', 'print' means 'stampa'", etc. I suspect your early years would have b

Advanced Python Programming Oxford Lectures [was: Re: *Advanced* Python book?]

2010-03-25 Thread Ethan Furman
e-post your lectures -- just did a search for them and came up empty, and I would love to read them! Many thanks in advance! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python database of plain text editable by notepad or vi

2010-03-26 Thread Ethan Furman
re _not_ saved as *files*. Okay, venting over. My point is, if what you are storing is plain ol' source files, providing a way to directly access them is a good thing. If what you are storing is a mangled version, the ability to let the user choose any editor to use is a good thing. :) My $0.02. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Simple Traits Questions

2010-03-27 Thread Ethan Furman
enlightenment appreciated! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Simple Traits

2010-03-27 Thread Ethan Furman
nstruction. Thanks, Michele!! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes as namespaces?

2010-03-27 Thread Ethan Furman
complex code, you have an easy place to go to do it. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Traits Questions

2010-03-28 Thread Ethan Furman
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

Python 3.1, object, and setattr()

2010-04-01 Thread Ethan Furman
test = object() --> setattr(test, 'example', 123) Traceback (most recent call last): File "", line 1, in AttributeError: 'object' object has no attribute 'example' Shouldn't setattr() be creating the 'example' attribute? Any tips greatly appreciated! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.1, object, and setattr()

2010-04-01 Thread Ethan Furman
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

Re: C-style static variables in Python?

2010-04-02 Thread Ethan Furman
frobnicate(x, y, z, mongo) spam = spam() No extra objects, out-of-place underscores, etc. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: subclass of object

2010-04-02 Thread Ethan Furman
. Interesting. I actually read "class" for "def" and replied accordingly. Funny, so did I. I'm sure it had something to do with the subject line. ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: C-style static variables in Python?

2010-04-02 Thread Ethan Furman
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

Re: C-style static variables in Python?

2010-04-02 Thread Ethan Furman
__getattr__ approach faster than the try/except approach (about 20% on my machine). I'll have to think about that for future situations like this. My main point, though, was using __call__, and not some weird _ method. ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: (a==b) ? 'Yes' : 'No'

2010-04-02 Thread Ethan Furman
, so going against it automatically makes code less readable to all who were educated in that tradition. So you're saying that new languages can't change anything already well established? So much for break-through innovations. And what about the programmers? It is good to lear

<    11   12   13   14   15   16   17   18   19   20   >