Re: C-style static variables in Python?

2010-04-02 Thread Ethan Furman
delayed in case spam is never called, it can go in __init__ instead. As a matter of fact, I have an object that is usually not called during it's modules use, so I put in __getattr__. Sped the modules load time back up to pert near instantaneous. :) ~Ethan~ -- http://mail.python.org/ma

Re: C-style static variables in Python?

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

Traits implementation for Python 3

2010-04-02 Thread Ethan Furman
uired to support Python 2. The more I learn of 3, the more I love it. Many improvements in simplicity and elegance. At any rate, what I have is below. My (very limited) initial tests are working fine. super() appears to work as is. Feedback appreciated! ~Etha

Re: C-style static variables in Python?

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

Re: Packages at Python.org

2010-12-01 Thread Ethan Furman
The dbf package does not yet support index files. Normal indexes won't be too hard to add in, but I have been unable to find the algorithms used to create/work with compact index files. Does anybody know where I might find those? ~Ethan~ (author of said package) -- http://mail.python.o

Re: DBF (VFP) to XLS (Excel) in pure Python

2010-12-02 Thread Ethan Furman
ue) Does this still happen with the latest code? (Not yet on PyPI for those following along -- hope to get a new package released this week.) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception handling in Python 3.x

2010-12-03 Thread Ethan Furman
yError: > raise CommandError("Unknown command") > > # Include the context > try: > command_dict[command]() > except KeyError: > raise with CommandError("Unknown command") ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception handling in Python 3.x

2010-12-03 Thread Ethan Furman
n exc is raised. http://www.python.org/dev/peps/pep-3134/ ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposed changes to logging defaults

2010-12-09 Thread Ethan Furman
uld be for itself? (My apologies if this question only reveals my own ignorance.) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception handling in Python 3.x

2010-12-13 Thread Ethan Furman
ement in > iterable? No, it hit's return instead. > And would your second suggestion throw an exception after normal > processing of all elements in the interator? Looks like the second solution doesn't process the entire iterable, just it's first element. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception handling in Python 3.x

2010-12-13 Thread Ethan Furman
oesn't fix the unwanted nesting of exceptions problem. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception handling in Python 3.x

2010-12-13 Thread Ethan Furman
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

Re: Exception handling in Python 3.x

2010-12-13 Thread Ethan Furman
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

Re: Request for feedback on API design

2010-12-13 Thread Ethan Furman
er, I may drop support for the other. Don't currently need/use stats, but B seems clearer to me. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pop the interpreter's stack?

2010-12-14 Thread Ethan Furman
Hope this helps! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

O'Reilly Python Certification

2010-12-15 Thread Ethan Furman
So I just got an e-mail from O'Reilly and their School of Technology about a Python Certification course... anybody have any experience with this? It also says Steve Holden is involved -- is this True? (Steve?) ~Ethan~ PS Can you tell I've been programming? ;) -- http://mail.

Re: How to pop the interpreter's stack?

2010-12-16 Thread Ethan Furman
Tim Arnold wrote: "Ethan Furman" wrote in message news:mailman.4.1292379995.6505.python-l...@python.org... kj wrote: The one thing I don't like about this strategy is that the tracebacks of exceptions raised during the execution of __pre_spam include one unwanted stack level (

Re: while True or while 1

2010-12-16 Thread Ethan Furman
ter putting the functional method in place, a run that took about 16 minutes using the old exec method ran two (2!) seconds faster. Great learning experience, for both the function method (which I prefer), and the need for profiling. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: O'Reilly Python Certification

2010-12-16 Thread Ethan Furman
a 25% discount promotional. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: while True or while 1

2010-12-16 Thread Ethan Furman
Arnaud Delobelle wrote: Ethan Furman writes: ...I timed exec vs function, and found the function style to be about 200% faster... So it finished before it started? Hmmm Let me check my calculator... . . . Ah! Okay, that was 200x faster. :) I think -- it was a few months ago

Re: If/then style question

2010-12-16 Thread Ethan Furman
Bad2() elif yet_another_bad_condition: raise Bad3() do_some_useful_stuff # no need to return 'good' code -- success means no problems ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: If/then style question

2010-12-17 Thread Ethan Furman
ondition was set to cond2. The exitCode no longer needs to be checked inside the function, because there is no chance of do_some_useful_stuff running if any of the conditions are False. Hope this helps. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd listcomp behaviour

2010-12-17 Thread Ethan Furman
applied. ... Splitting an empty string or a string consisting of just whitespace returns an empty list. Note the bit in the second paragraph. Here's my code snippet: Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. --> test = '' --> test.split() [] --> test.split(' ') [''] --> test.split(',') [''] --> test.split(None) [] Hope this helps! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: class inheritance

2010-12-21 Thread Ethan Furman
-> n - m CloseFraction(-3, 4) --> n + m CloseFraction(15, 4) --> n.real CloseFraction(3, 2) --> n.imag 0 # this is an int Hope this helps! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: issubclass(dict, Mapping)

2010-12-22 Thread Ethan Furman
apping, even though none of the bases of dict is either Mapping or a subclass of Mapping. Great. I suspect this is another abstraction leak My take on abstraction leaks is when the underlying actuality shows through in a non-ignorable way -- so I ask again, how is this discrepancy making it so you can't ignore it? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pop the interpreter's stack?

2010-12-24 Thread Ethan Furman
pposed to custom object, I don't think the traceback should be monkied with -- either use a decorator to keep the traceback short, or give the _pre_func name a good name and don't worry about it. I know when I see a traceback, I start at the bottom and only work my way up if I need to. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pop the interpreter's stack?

2010-12-26 Thread Ethan Furman
ing information that could be crucial for debugging. +100 ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pop the interpreter's stack?

2010-12-26 Thread Ethan Furman
Steven D'Aprano wrote: On Sat, 25 Dec 2010 09:17:27 -0500, Robert Kern wrote: On 12/24/10 5:14 PM, Ethan Furman wrote: There are also times when I change the exception being raised to match what python expects from that type of object -- for example, from WhatEverException to KeyError

Re: How to pop the interpreter's stack?

2010-12-26 Thread Ethan Furman
are back to passing errors in-band, pretty much completely defeating the point of have an out-of-band channel. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pop the interpreter's stack?

2010-12-26 Thread Ethan Furman
the user one level of traceback was that high a priority to me, I would make the validation be either a decorator, or have the validation *be* the main routine, and the *real work* routine be the private one. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pop the interpreter's stack?

2010-12-27 Thread Ethan Furman
Steven D'Aprano wrote: On Sun, 26 Dec 2010 09:15:32 -0800, Ethan Furman wrote: Steven D'Aprano wrote: Right. But I have thought of a clever trick to get the result KJ was asking for, with the minimum of boilerplate code. Instead of this: def _pre_spam(args): if cond

Re: Career path - where next?

2011-01-13 Thread Ethan Furman
u have any information that would help me, I would be very grateful! ~Ethan~ *http://pypi.python.org/pypi/dbf/0.88.16 -- http://mail.python.org/mailman/listinfo/python-list

Re: __pycache__, one more good reason to stck with Python 2?

2011-01-18 Thread Ethan Furman
e file would have been, not in the __pycache__ directory (it'll be considered stale otherwise). Typo? According to PEP 3147 a standalone *.pyc *should* (not should not) be put in the same directory where the source file would have been. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: move to end, in Python 3.2 Really?

2011-01-18 Thread Ethan Furman
by the name of "ranting rick", and you're suggesting that instead of talking he rolls up his sleeves and does something. I suspect you're barking into the wind... To borrow from Dilbert*, perhaps rr is more of an idea rat. ~Ethan~ *http://www.dilbert.com/strips/comic/1994-12-17/

Re: [Code Challenge] WxPython versus Tkinter.

2011-01-24 Thread Ethan Furman
Octavian Rasnita wrote: From: "rantingrick" WxPython versus Tkinter (A code battle to the death!) by Rick Johnson. [...] Octavian, Please do not repost rr's crap in its entirety, or you'll find yourself added to many killfiles -- just like he is. ~Ethan~ -- ht

Re: WxPython versus Tkinter.

2011-01-24 Thread Ethan Furman
Mark Roseman wrote: I don't object and in fact commend you for advocating for accessibility. I do feel you are not acknowledging and fully respecting that others may be in situations where accessibility may not be the primary concern. Well said. ~Ethan~ -- http://mail.python.org/ma

Re: WxPython versus Tkinter.

2011-01-24 Thread Ethan Furman
! So you want to steal our code to fix yours? Why am I not surprised? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-25 Thread Ethan Furman
-plonk- -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to pass CSV Reader Object As Argument to another Python File ???

2011-01-26 Thread Ethan Furman
case The problem as you've described it so far is best solved by having a single process accessing the CSV reader object in memory. If that doesn't suit your use case, you'll need to explain why not. In other words, why can't you use Python 2.7 to accept input and

Re: WxPython versus Tkinter.

2011-01-27 Thread Ethan Furman
? ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Behaviour-based interface/protocol implementation?

2011-01-27 Thread Ethan Furman
as an example) might just fool my signature check. When you signature check, do you mean counting the number of arguments, or actually checking argument types? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Return Statement

2011-01-27 Thread Ethan Furman
bool(statement) is True: >, or < if bool(statement): >, or, simplest, < if statement: > As to return False if statement equals true, look at the function name. It is testing to see if it is a lie, and if it is true, then it's not a lie. Your

Re: multiple values for keyword argument

2011-01-29 Thread Ethan Furman
x27; or 'x'... although, when posting sample code to c.l.py I do try to use 'self' to avoid possible confusion. :) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple values for keyword argument

2011-01-29 Thread Ethan Furman
e as the programmer, it's all going to be interpreted anyway. And the other email equating to C's argv, etc. - now I get it. Careful about the names you make-up -- to aid yourself and others you don't want to have dozen's of different names that all basically mean 'thi

Re: How can I tell if I am inside a context manager?

2011-02-01 Thread Ethan Furman
Gerald Britton wrote: I'd like to know how (perhaps with the inspect module) I can tell if I am running in a context manager. What's your use-case? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.join doubt

2011-02-03 Thread Ethan Furman
:/temp\control.FPT Or is there an option I'm missing so backslashes are not returned by stdlib functions? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: [python-list] - what do you think ?

2011-02-08 Thread Ethan Furman
atically sorted into folders, having [python-list] in the subject line would be incredibly redundant. Also, it's a waste of horizontal space. I believe you could use a mail preprocessor, like Fetchmail or Procmail, to modify your e-mails before you receive them, though. Good luck! ~Ethan~

Re: frequency of values in a field

2011-02-09 Thread Ethan Furman
z in sorted(freq): print z, freq[z] - Numeric/Float field types are returned as python floats*, so there may be slight discrepancies between the stored value and the returned value. Hope this helps. ~Ethan~ *Unless created with zero decimal places, in which case they are returned as python integers. -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-09 Thread Ethan Furman
decimals before converting to a string, etc. Or use recursion! >>> def num_digits(n): ...if n == 0: ... return 0 ...else: ... return num_digits(n//10) + 1 ... >>> num_digits(1) 1 >>> num_digits(0) 0 0 is still one digit. ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-10 Thread Ethan Furman
Jason Swails wrote: On Wed, Feb 9, 2011 at 8:16 PM, Ethan Furman wrote: while n: is plenty readable. n is either something or nothing, and something evaluates to True, nothing to False. Sure it's readable. But then you have to make sure that the loop will eventually take n down

Re: Executing functions

2011-02-11 Thread Ethan Furman
be 3 :) fList = ["Two()","Three()"] for func in fList: func This is not calling func (no () at the end), and in fact doesn't do anything if called as a script besides evaluate func -- it's a string, but not being assigned anywhere, so unless you are running

Re: Class or Dictionary?

2011-02-11 Thread Ethan Furman
parameter to judge. I strongly disagree. Code readability is one of the most important issues. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Ethan Furman
hould work? Please. Experiment and read the manual. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: C-style static variables in Python?

2010-04-05 Thread Ethan Furman
Ethan Furman wrote: 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 r

Re: python as pen and paper substitute

2010-04-06 Thread Ethan Furman
break source = ''.join([line[lead_space:] for line in source]) print('\n' + source) intermed_result = {} final_result = PropertyObj() exec(source, func.__globals__, intermed_result) for key, value in intermed_result.items(): setattr(final_result, key, value) return final_result 8<-- Hope this helps! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Imports again...

2010-04-09 Thread Ethan Furman
here are *both* .py & .pyw... Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. --> open ("xxx.pyw", "w").write ("print ('hello')") --> open ("xxx.py", "w").write ("print ('good-bye')") --> import xxx good-bye ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Regular Expressions

2010-04-10 Thread Ethan Furman
;t mean you should write those commands manually, even if you can. It's perfectly ok to write the program in Python instead. Stefan And it's even more perfectly okay to use Python when it's the best tool for the job, and re when *it's* the best tool for the job. ~Etha

Re: Incorrect scope of list comprehension variables

2010-04-17 Thread Ethan Furman
There's no RightAnswer(tm), just our best guess as to what is the most useful behavior for the most number of people. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Code redundancy

2010-04-20 Thread Ethan Furman
it once your brain starts working pythonically. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Teaching Programming

2010-05-04 Thread Ethan Furman
figure it out from the different (nested) braces at the 'right' location. For me, at least, it's much easier to get that information from the already indented Python code, as opposed to indenting (and double-checking the indents) on the braces language. ~Ethan~ -- http://mail.py

Re: Picking a license

2010-05-15 Thread Ethan Furman
the compiling/linking/generating himself, thus saving his customers the effort. You're a smart man, Steven, surely you could have figured that out? ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Picking a license

2010-05-15 Thread Ethan Furman
s that all subsequent generations of derivative works have the freedom to access all previous derivative works. Just because you have the code for the _current_ version of something, doesn't mean you have the code for that something three versions ago... after all, it may have been modified.

Re: Picking a license

2010-05-15 Thread Ethan Furman
available under a proprietary licence that you (or your client) was unwilling to use? Lucky you! Steven, did you actually read what he wrote? If you did, why would you say something so stupid? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: classes and __init__ question

2010-05-17 Thread Ethan Furman
constructor (__init__): a_dog = dog('Ralph', 'big', RED) this_app = myapp() fred = contact('Fred Flinstone','f...@flinstone.gv','active','exemplary') Hope this helps. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Picking a license

2010-05-18 Thread Ethan Furman
ly Pat has defended himself quite well, while being very reasonable, and has said at least twice (more, I'm sure) that the choice of license is up to the author, and that there are good reasons for choosing any of the free licenses (including the GPL). ~Ethan~ -- http://mail.python.org/m

Re: recall function definition from shell

2010-05-18 Thread Ethan Furman
does not, but maybe the *shell* does, or so i thought. i just wanted to dump the code for the function in a file, after i tested in the shell... Take a look at ipython -- it has many enhancements: ipython.scipy.org ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Picking a license

2010-05-18 Thread Ethan Furman
errals for new work. It really is practical to sell free software. This doesn't make sense to me, but I'm willing to learn -- how do you do this in practice? Are you really selling the software, or rather selling things like setup, support, new code (or time to code), etc? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this an ok thing to do in a class

2010-05-18 Thread Ethan Furman
self.x=self.letter[x] >>> afoo = foo('b') >>> afoo.x 2 >>> afoo.A 1 >>> afoo.letter['a'] 1 >>> afoo.letter.items() [('a', 1), ('c', 3), ('b', 2)] Do you expect afoo.letter[x] to always be afoo.x? Becaus

Re: Is this an ok thing to do in a class

2010-05-18 Thread Ethan Furman
Vincent Davis wrote: On Tue, May 18, 2010 at 2:41 PM, Ethan Furman <mailto:et...@stoneleaf.us>> wrote: Do you expect afoo.letter[x] to always be afoo.x? Because they aren't: >>> afoo.A = 9 >>> afoo.letter['a'] 1 What you are

Re: how to cause a request for a missing class attribute cause its calculation

2010-05-18 Thread Ethan Furman
calculation of inst.xy I don't what to have self.xy calculated before it is called. My current favorite method: def __getattr__(self, name): if name != 'xy': raise AttributeError("%s not found" % name) self.xy = self.x + self.y return

Re: how to cause a request for a missing class attribute cause its calculation

2010-05-18 Thread Ethan Furman
Ethan Furman wrote: Vincent Davis wrote: Lets say I have class foo(object): def __init__(self, x, y): self.x=x self.y=y def xplusy(self): self.xy = x+y ^ this needs to be self.x + self.y inst = foo(1,2) inst.xy # no value, but I what

Re: optional argument to a subclass of a class

2010-05-21 Thread Ethan Furman
ll keyword arguments that Battleship doesn't directly support will be passed through to Craft. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

dbf files and indexes

2010-05-27 Thread Ethan Furman
code can apply the key function to the record (implicit, as in method 1 above) or the calling code can do it (explicit, as in method 2 above). I'm leaning towards method 1, even though the key function is then called behind the scenes, because I think it makes the calling code cleaner. Op

Re: dbf files and indexes

2010-05-27 Thread Ethan Furman
Ethan Furman wrote: Let's say I have two tables: Okay, let's say I have three tables instead. ;p -- http://mail.python.org/mailman/listinfo/python-list

Re: dbf files and indexes

2010-05-27 Thread Ethan Furman
D'Arcy J.M. Cain wrote: On Thu, 27 May 2010 12:45:58 -0700 Ethan Furman wrote: Let's say I have two tables: CatLoversDogLovers --- --- | name | age | | name

Re: GUIs - A Modest Proposal

2010-06-08 Thread Ethan Furman
True. Were Tcl removed from the equation, then some feautures would have to be re-implemented in Python. So what functionality is available from Tk alone? From the very cursory glance at the source files (mostly the readmes), it seems pretty entwined with Tcl. ~Ethan~ -- http://mail.py

Re: Syntax problem - cannot solve it by myself

2010-06-08 Thread Ethan Furman
_function before you can do the same in 2.6. Not sure, but I seem to recall some very slight differences between the __future__ version of print and the actual version in 3.x (although, with my memory, it could easily be one of the other __future__ items). ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-09 Thread Ethan Furman
that they may not be there on other platforms, though. ~Ethan~ P.S. Now that I think about it, actually installing them is optional... -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-09 Thread Ethan Furman
f you're running any kind of desktop at all. *Alert* Potentially dumb question following: On the MS Windows platform, Gtk is not required, just win32? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the difference?

2010-06-10 Thread Ethan Furman
whatever of the info object. Hope this helps! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-10 Thread Ethan Furman
Stephen Hansen wrote: Another thing you can look at is QT/PyQT. If you're doing GPL'd software, that might be a very good solution for you-- you can design your whole app in the beautiful QTDesigner, and the .ui files can be used in any language with a QT binding, PyQT included. But you gotta be

Re: What's the difference?

2010-06-10 Thread Ethan Furman
Ethan Furman wrote: Anthony Papillion wrote: Someone helped me with some code yesterday and I'm trying to understand it. The way they wrote it was subjects = (info[2] for info in items) Perhaps I'm not truly understanding what this does. Does this do anything different than if I

Re: [OT]romantic poetry

2010-06-11 Thread Ethan Furman
appreciated! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Deformed Form

2010-06-13 Thread Ethan Furman
leall -f ." whenever you edit a file and before testing. I thought python (well, cpython, at least) didn't use .pyc files for the main script? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Will and Abe's "Guide to Pyjamas"

2010-06-14 Thread Ethan Furman
lkcl wrote: oh look - there's a common theme, there: "web technology equals useless" :) this is getting sufficiently ridiculous, i thought it best to summarise the discussions of the past few days, from the perspective of four-year-olds: AH hahahahahahahahahahahaha -- http://mail.python.org

Re: Efficiency/style issues of import vs. from import , ...

2010-06-17 Thread Ethan Furman
a shortcut for: import = . There should also be a third line: del ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficiency/style issues of import vs. from import , ...

2010-06-17 Thread Ethan Furman
Stephen Hansen wrote: On 6/17/10 10:01 AM, Ethan Furman wrote: Stephen Hansen wrote: On 6/17/10 9:12 AM, pyt...@bdurham.com wrote: Now, this is all IMHO: the style guide does not define any 'guidelines' on this, except that its okay to use "from ... import ..." to

Re: Efficiency/style issues of import vs. from import , ...

2010-06-17 Thread Ethan Furman
ting that may change, don't call it a constant and name it accordingly. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: super() woes (n00b)

2010-06-17 Thread Ethan Furman
e Lanaro said in that same thread: > else take a book that covers python 2.x syntax Cut-and-pasting-ly yours, ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: super() woes (n00b)

2010-06-18 Thread Ethan Furman
Deadly Dirk wrote: On Thu, 17 Jun 2010 12:18:33 -0700, Ethan Furman wrote: Deadly Dirk wrote: On Thu, 17 Jun 2010 13:48:45 -0400, J. Cliff Dyer wrote: super gives you an instantiated version of the super class, which means that you don't have to explicitly send self to any methods you

Re: GUIs - A Modest Proposal

2010-06-18 Thread Ethan Furman
! Is there a good web-site / tutorial / book / etc that you would recommend for getting a good handle on Tk 8.5? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dynamic attribute creation

2010-06-25 Thread Ethan Furman
ror: class test has no attribute 'a' Looks pretty simple to me... ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: hex question

2010-06-25 Thread Ethan Furman
Sneaky Wombat wrote: Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? '\x0a' == '\n' -- http://mail.python.org/mailman/listinfo/python-list

Python v3.1.2 documentation question

2010-06-29 Thread Ethan Furman
will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. Doesn't the nonlocal keyword make variables in outer scopes writable? ~Ethan~ -- http://mail.python.org/ma

Re: Python dynamic attribute creation

2010-06-29 Thread Ethan Furman
Also, since it is easier, why not drop the harder one, setattr()? Because setattr and friends are needed when the variable names are constructed dynamically. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dynamic attribute creation

2010-06-29 Thread Ethan Furman
ate needs, patterns of thought, etc. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python v3.1.2 documentation question

2010-06-29 Thread Ethan Furman
Stephen Hansen wrote: On 6/29/10 10:01 AM, Ethan Furman wrote: In the glossary section it states: nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to variables in the outer function. Note that

Re: Why are String Formatted Queries Considered So Magical?

2010-06-30 Thread Ethan Furman
nti-hammer sentiment' to suggest another tool, like pliers or a jackhammer. I took the time to learn REs about a year ago. It was well worth it, even though I've only used REs a handful of times since, because when you need them there is no good substitute. But when you don't, there are plenty. ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Solutions for hand injury from computer use

2010-07-01 Thread Ethan Furman
ng my wrist for that operation. Quite cheap and simple, and I've thereby had no recurrence of injury for the past 3 years. I'll have to give the left-handed mouse a try... hmmm -- not too bad so far. I also switched over to the Dvorak keyboard layout. Made a world of differ

Re: Python v3.1.2 documentation question

2010-07-01 Thread Ethan Furman
Aahz wrote: In article , Ethan Furman wrote: Stephen Hansen wrote: On 6/29/10 10:01 AM, Ethan Furman wrote: In the glossary section it states: nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to

<    12   13   14   15   16   17   18   19   20   >