Re: os.startfile hanging onto the launched app, or my IDE?

2014-06-10 Thread Ethan Furman
On 06/09/2014 09:46 PM, Tim Golden wrote: On 09/06/2014 23:31, Ethan Furman wrote: On 06/09/2014 03:21 PM, Josh English wrote: So this quirk is coming from PyScripter, which is a shame, because I don't think it's under development, so it won't be fixed. The nice thing about

Re: First time I looked at Python was(...)

2014-06-10 Thread Ethan Furman
On 06/09/2014 01:54 PM, Carlos Anselmo Dias wrote: [snip] *plonk* -- https://mail.python.org/mailman/listinfo/python-list

Re: try/except/finally

2014-06-10 Thread Ethan Furman
rule, doesn't at some point cause suboptimal code. How about, "Don't use PHP"? Sounds like the exception that proves the rule! ;) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-10 Thread Ethan Furman
On 06/10/2014 04:29 PM, Devin Jeanpierre wrote: Please don't be unnecessarily cruel and antagonistic. I completely agree. jmf should leave us alone and stop cruelly and antagonizingly baiting us with stupidity and falsehoods. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/p

Re: Are there performance concerns with popping from front of long lists vs. the end of long lists?

2014-06-22 Thread Ethan Furman
removing items from the end, so anywhere else will have an impact. You'll have to do measurements to see if the impact is worth worrying about in your code. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Error in PyDev but not in the standard python interpreter

2014-06-24 Thread Ethan Furman
On 06/24/2014 08:58 AM, Chris Angelico wrote: Basically, C is for writing high level languages in, and Python and Pike are for writing applications. Life is good. +1 QOTW -- https://mail.python.org/mailman/listinfo/python-list

Re: Error in PyDev but not in the standard python interpreter

2014-06-24 Thread Ethan Furman
d. Thanks, Chris! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: How to get Timezone from latitude/longitude ?

2014-06-25 Thread Ethan Furman
impressive feat. Maybe he learned using one of those language classes I keep hearing about in my email... -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Ethan Furman
need to provide your own copies of any dict method that calls __getitem__. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Ethan Furman
confusion and frustration that decision has caused, I do not think it was a good one. :( -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread Ethan Furman
parid with self._loc, so RainyDay is good there. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the "right" way to abandon an open source package?

2014-07-01 Thread Ethan Furman
es me even less interested in lockfile maintenance). Is there a "correct" way to abandon the damn thing? I'm willing to take it on. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Ethan Furman
On 07/02/2014 04:22 PM, Wolfgang Maier wrote: So, everything's just fine except that it may be more convenient to use Popen().communicate() to avoid raising the error in the first place :) Nice sleuthing! :) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Ethan Furman
in Python are all wrong -- have you been using a custom interpreter? Python 2.7.4 (default, Sep 26 2013, 03:20:26) [GCC 4.7.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> float('inf') - float('inf') nan -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Ethan Furman
On 07/08/2014 12:04 PM, Anders J. Munch wrote: Ethan Furman skrev: What exception? Apparently your claims about NaN in Python are all wrong -- have you been using a custom interpreter? >>> float('inf') - float('inf') nan If you deliberately try to manufacture

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Ethan Furman
On 07/08/2014 12:50 PM, Ian Kelly wrote: On Tue, Jul 8, 2014 at 1:16 PM, Ethan Furman wrote: What you said is: "They just don't appear in normal computation, because the interpreter raises an exception instead." I just ran a calculation that created a NaN, the same as 4 - 3 c

Re: NaN comparisons - Call For Anecdotes

2014-07-08 Thread Ethan Furman
On 07/08/2014 11:54 AM, Anders J. Munch wrote: If a standard tells you to jump of a cliff... because a bunch of tanks are chasing you down, there's water at the bottom, and not a helicopter in sight... well, jumping off the cliff could easily be your best chance. ;) -- ~Ethan~ --

Re: PyPy-STM: first "interesting" release

2014-07-08 Thread Ethan Furman
t one requires Java, and the other .NET. :/ -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: === and !=== operators

2014-07-09 Thread Ethan Furman
On 07/09/2014 12:00 AM, Steven D'Aprano wrote: I propose: [adding new operators] -1 Too much added confusion, too little gain. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Ethan Furman
r the next time I'm at PyCon. I would suggest you ask for this on the numerical mailing lists instead of here -- and you may not want to offer a beer to everyone that has an anecdote for NaN behavior being useful. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Ethan Furman
On 07/09/2014 02:09 PM, Anders J. Munch wrote: Ethan Furman: I would suggest you ask for this on the numerical mailing lists instead of here -- and you may not want to offer a beer to everyone that has an anecdote for NaN behavior being useful. I don't have time to start this discu

Re: NaN comparisons - Call For Anecdotes

2014-07-09 Thread Ethan Furman
e-py lists there are, and get affirmative answers from them that yeah, NaN != NaN is just a huge pain and everyone is working around it, then brought that information back here -- well, then you will have made the point that you want to make. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: context manager based alternative to Re: Proposal: === and !===

2014-07-10 Thread Ethan Furman
that already (I don't know if it supports allowing NaNs to equal each other, though). Rather than adding the whole thing to float, perhaps extending Decimal's context with that option is a possible route. I would also prefer something like this to a new equals operator. -- ~Ethan~ -

Re: Proposal: === and !=== operators

2014-07-11 Thread Ethan Furman
(self, other): if this is that or this == that: continue break else: return True return False -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: === and !=== operators

2014-07-12 Thread Ethan Furman
On 07/11/2014 11:39 PM, Chris Angelico wrote: On Sat, Jul 12, 2014 at 4:11 PM, Ethan Furman wrote: class list: def __eq__(self, other): if len(self) != len(other): return False for this, that in zip(self, other): if this is that or this == that

Re: [Python-Dev] Python Job Board

2014-07-14 Thread Ethan Furman
http://www.pythonjobs.com/ * http://www.djangojobs.org/ Nice, thanks! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Ethan Furman
ther. "rr" is "rantingrickjohnson@...". As someone just recently said, "The clue is in the name." ;) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: initializing "parameters" class in Python only once?

2014-07-16 Thread Ethan Furman
__file__ ...to the class definition to help with debugging. But this is really just bikeshedding. Just make sure the 'sys.modules' assignment happens at the *end* of params.py. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Using pyVmomi

2014-07-24 Thread Ethan Furman
entry that can check and, if necessary, revalidate - create a helper that checks and, if necessary, revalidate, which is then called where ever needed - create a decorator that does the above for each function that needs it -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: What is best way to learn Python for advanced developer?

2014-07-30 Thread Ethan Furman
very good Python courses, which are not free. -- ~Ethan~ [1] https://www.udacity.com [2] http://www.oreillyschool.com/search/?search=Python -- https://mail.python.org/mailman/listinfo/python-list

Re: What is best way to learn Python for advanced developer?

2014-07-31 Thread Ethan Furman
On 07/31/2014 10:46 AM, Je Ph wrote: Ethan et al, has anyone completed the oreilly python 1 through python 4 training courses (part of their Python Certificate track)? Looks like it will take over 2 months to complete it and it's expensive. I have completed all four courses. The ti

Re: Test for an empty directory that could be very large if it is not empty?

2014-08-07 Thread Ethan Furman
simple, easy way is not going to be sufficient. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Specifying `blocking` and `timeout` when acquiring lock as a context manager

2014-08-08 Thread Ethan Furman
n 'if' with a 'with' block -- how would your code know whether it ran or not? -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Why does str not have a __radd__ method?

2014-08-13 Thread Ethan Furman
On 08/13/2014 09:00 AM, Steven D'Aprano wrote: What is the rationale for str not having __radd__ method? At a guess I would say because string only knows how to add itself to other strings, so __add__ is sufficient. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Why does str not have a __radd__ method?

2014-08-13 Thread Ethan Furman
On 08/13/2014 10:55 AM, Steven D'Aprano wrote: Ethan Furman wrote: On 08/13/2014 09:00 AM, Steven D'Aprano wrote: What is the rationale for str not having __radd__ method? At a guess I would say because string only knows how to add itself to other strings, so __add__ is

Re: what is the "/" mean in __init__(self, /, *args, **kwargs) ?

2014-08-13 Thread Ethan Furman
uld not be specified by name, the next two could be either name or position, and the last two by name only. Oh, and the * is valid Python now (the / is not -- it's solely a documentation feature at this point). -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: what is the "/" mean in __init__(self, /, *args, **kwargs) ?

2014-08-13 Thread Ethan Furman
On 08/13/2014 07:12 PM, Tim Chase wrote: Where are you seeing this? Probably in 3.4, or the tip (what will be 3.5). -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Why Python 4.0 won't be like Python 3.0

2014-08-18 Thread Ethan Furman
eries of incremental "bug fix and minor enhancements without breaking backwards incompatibility" releases, you simply do not call it vers x.0. Yup. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Why Python 4.0 won't be like Python 3.0

2014-08-18 Thread Ethan Furman
bugs and a few more minor releases have come out. "Three shall be the number thou shalt count, and the number of the counting shall be three, no more, no less. .." https://www.youtube.com/watch?v=xOrgLj9lOwk (1:30) Right. 5.0 it is, then. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: 'is not' or '!='

2014-08-18 Thread Ethan Furman
e not dealing with singletons (which is most cases), such as numbers, strings, lists, and most other arbitrary objects, you will need to use "!=" or anytime the two objects you are comparing are not the exact same object, you can easily get the wrong answer. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: 'is not' or '!='

2014-08-18 Thread Ethan Furman
On 08/18/2014 03:04 PM, Chris Kaynor wrote: On Mon, Aug 18, 2014 at 2:42 PM, Ethan Furman wrote: If you are not dealing with singletons (which is most cases), such as numbers, strings, lists, and most other arbitrary objects, you will need to use "!=" or anytime the two objec

hg, git, fossil, ... [was Re: What is acceptable as 'open-source'? [was Python vs C++]]

2014-08-27 Thread Ethan Furman
merge, and a rare rollback -- not complicated stuff. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: hg, git, fossil, ... [was Re: What is acceptable as 'open-source'? [was Python vs C++]]

2014-08-27 Thread Ethan Furman
On 08/27/2014 11:51 AM, Skip Montanaro wrote: Thank God for StackOverflow. :-) +1 QotW -- https://mail.python.org/mailman/listinfo/python-list

Re: PyPI password rules

2014-08-28 Thread Ethan Furman
mmon words? I would think the more the merrier! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

suckitude classifications [was Re: Keeping python code and database in sync]

2014-08-29 Thread Ethan Furman
d classify technologies that way: xml: major suckitude rpc: no suckitude python: negative suckitude oh, and suckitude is neither cruft nor corpus ! Polly want a cracker? ;) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Keeping python code and database in sync

2014-08-29 Thread Ethan Furman
end of a sentence, does it not count? That would be suckitude indeed! ;) ] -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is going to be hard

2014-09-03 Thread Ethan Furman
list index out of range Python will be incredibly hard if you don't read any of the docs or tutorials available. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is going to be hard

2014-09-03 Thread Ethan Furman
the loop 'x' is the first item in the list. The /second/ time through the loop 'x' is the second item in the list. The /third/ time through the loop 'x' is the third item in the list. . . . Keep persisting! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is going to be hard

2014-09-03 Thread Ethan Furman
On 09/03/2014 11:41 AM, Seymore4Head wrote: On Wed, 03 Sep 2014 11:33:46 -0700, Ethan Furman wrote: Python will be incredibly hard if you don't read any of the docs or tutorials available. You can't accuse me of that. I have actually read quite a bit. I may not be picking it up

Re: O'Reilly Python Certification

2014-09-03 Thread Ethan Furman
On 09/03/2014 02:52 PM, jaron.br...@gmail.com wrote: Ethan, Steve, Tim, and others: I'm thinking of taking the program. How long, in hours, does it take to complete all four Python courses? That is an impossible question to answer accurately. I took the classes already having exte

Re: Python is going to be hard

2014-09-03 Thread Ethan Furman
answer your question: print statements are side-effecting and therefore obstruct compositional reasoning. Ridiculous argument after ridiculous argument. Please do not waste our time with nonsense. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: My backwards logic

2014-09-05 Thread Ethan Furman
ch-type of 'for' loop: while True: a=random.randrange(1,8) print (a) for x in range(2,a): if a%x==0: print ("Number is not prime") break else: print ("Number is prime&q

Re: My backwards logic

2014-09-05 Thread Ethan Furman
or search loops" is a good thing. I still get tripped up by this as I didn't learn it that way. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Dynamically swapping between two algorithms

2014-09-25 Thread Ethan Furman
me is impractical. Have your setup script do some timings to figure out where CUTOFF is on any particular machine. You can then store it in a .conf file, or directly modify the source file with the value, or ... -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: "Fuzzy" Counter?

2014-09-26 Thread Ethan Furman
You might want to take a look at the reference implementation for PEP 455 [1]. If you can decide on a method to transform your keys (such as taking the floor, or the half, or something like that), then that should work as is. -- ~Ethan~ [1] http://legacy.python.org/dev/peps/pep-0455/ -- https://m

Re: Microsoft Visual C++ Compiler for Python 2.7

2014-09-26 Thread Ethan Furman
On 09/26/2014 06:30 PM, Dave Angel wrote: Not Found Worked fine for me. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Reticulated Python

2014-10-02 Thread Ethan Furman
On 10/02/2014 10:01 AM, Mark Lawrence wrote: My apologies if this has been discussed before but I thought it may be of interest wphomes.soic.indiana.edu/jsiek/files/2014/08/retic-python-v3.pdf Looks interesting, thanks for the link! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo

Re: operator module functions

2014-10-08 Thread Ethan Furman
I bother using the operator module is for the readability of not seeing the dunders, and the writability of not having to type them. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: operator module functions

2014-10-08 Thread Ethan Furman
[redirecting back to the list] On 10/08/2014 02:23 PM, random...@fastmail.us wrote: On Wed, Oct 8, 2014, at 15:53, Ethan Furman wrote: On 10/08/2014 12:49 PM, random...@fastmail.us wrote: On Wed, Oct 8, 2014, at 15:38, Ethan Furman wrote: LOL, no kidding! The main reason I bother using the

Re: operator module functions

2014-10-08 Thread Ethan Furman
On 10/08/2014 03:46 PM, Terry Reedy wrote: On 10/8/2014 5:49 PM, Ethan Furman wrote: [redirecting back to the list] I'm not sure what situation you would have to type them (as opposed to simply a + b) that the operator module would help with. unittest springs to

Re: Doctest failing

2011-09-11 Thread Ethan Furman
en needed, but if don't *need* it, and you have more than a few, debugging can be a nightmare... "Okay, so this is function ... and that is function ... and over here we also have function ... ARGH!" ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Idioms combining 'next(items)' and 'for item in items:'

2011-09-11 Thread Ethan Furman
tially agree with; however, in this case where the uncaught exception can mess up flow control elsewhere I do not -- the StopIteration should be caught and changed to something appropriate, such as EmptyTitle (assuming blank titles are errors -- which they probably should be... "Hello, do you have the book '' for sale here?") ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: Itertools module needs attention

2011-09-12 Thread Ethan Furman
Nick Stinemates wrote: I'm honestly missing the point of this mail. rantingrick is a well-known troll, and doesn't need to have a point. Please do not feed the troll. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: stackoverflow and c.l.py

2011-09-13 Thread Ethan Furman
Steven D'Aprano wrote: On Wed, 14 Sep 2011 02:12 pm Stefan Behnel wrote: Matt Joiner, 14.09.2011 04:23: i'm curious as to what can be done with (and handled better) by adjusting sys.setswitchinterval i've opened a question on SO for this, that people might find of interest: http://stackoverflo

Re: Operator commutativity

2011-09-19 Thread Ethan Furman
, and the right-hand operand is *not* a subclass of the left-hand operand, then you are correct -- the right-hand operand wil not be called. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Operator commutativity

2011-09-20 Thread Ethan Furman
Peter Pearson wrote: On Mon, 19 Sep 2011 05:48:07 -0700, Ethan Furman wrote: [snip] Also, if the right-hand operand is a subclass of the left-hand operand then Python will try right-hand_operand.__radd__ first. I don't think it works that way for me: Python 2.6.5 (r265:79063, Apr 16

Re: Operator commutativity

2011-09-21 Thread Ethan Furman
her) class C3(C2): pass C1() + C2() # --> C2.__radd__(<...C2...>, <...C1...) C1() + C3() # --> C2.__radd__(<...C3...>, <...C1...>) C2() + C3() # --> C1.__add__(<...C2...>, <...C3...>) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Operator commutativity

2011-09-21 Thread Ethan Furman
son to call __radd__ instead is if it has been defined for a subclass, and the only reason to define it is because it needs something different from a + b that a doesn't know about. Probably not a clear explanation -- maybe somebody else can dress it up a bit. ~Ethan~ -- http://mail.py

syntactic sugar for def?

2011-09-28 Thread Ethan Furman
I remember that 'class' is sugar for type(). I don't remember if 'def' is sugar for something besides lambda. Any clues for me? Heck, I'll even be grateful for outright answers! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Benefit and belief

2011-09-29 Thread Ethan Furman
n/nq050616.gif Okay, now that's funny. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Benefit and belief

2011-09-29 Thread Ethan Furman
Um, wasn't it RantingRick who made this 'joke'? Do you honestly believe he /wasn't/ trying to be offensive? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Benefit and belief

2011-09-29 Thread Ethan Furman
Ethan Furman wrote: Ben Finney wrote: But whoever takes that joke and says it's deliberately hurtful is being presumptuous and censorious and unreasonable. If they then castigate the joker for supposedly hurting someone's feelings, it's at that point the atmosphere turns hostil

Re: Benefit and belief

2011-09-30 Thread Ethan Furman
illy (man-made) languages but even over the editors they use No kidding! Vim is *obviously* the best one out there! *ducks and runs* ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing properties that are date-related

2011-10-07 Thread Ethan Furman
ked up the new function, but otherwise it worked like a charm. Another option is injection: import foo def window_date(...): ... foo.window_date = window_date ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Python hangs: Problem with wxPython, threading, pySerial, or events?

2011-10-15 Thread Ethan Swint
window. My attached device is transmitting <160><1><2><3><4><80> and is received correctly when I run the sample pyserial script 'wxTerminal.py'. In my application, however, the message appears to get characters out of order or drop by

Re: Python hangs: Problem with wxPython, threading, pySerial, or events?

2011-10-17 Thread Ethan Swint
I just wanted to bump this back onto the list since I posted over the weekend. Thanks, Ethan On 10/15/2011 11:17 AM, Ethan Swint wrote: Hi- I'm experiencing crashes in my Win32 Python 2.7 application which appear to be linked to pyzmq. At the moment, I can't even kill the "

Re: compare range objects

2011-10-20 Thread Ethan Furman
asy: list(range1) == list(range2) The biggest reason in my mind for implementing range equality is that currently two ranges compare equal iff they are the same range. In other words: --> range(10) == range(10) False ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to mix-in __getattr__ after the fact?

2011-10-28 Thread Ethan Furman
lf, not on the instances. So this works: 8< class Cow(object): pass def attrgetter(self, a): print "CAUGHT: Attempting to get attribute", a bessie = Cow() Cow.__getattr__ = attrgetter print bessie.milk 8<------

Re: all() is slow?

2011-11-10 Thread Ethan Furman
in certain projects that used > namedtuple in certain ways? So you think somevar = getattr(my_named_tuple, '--') is more readable than somevar = my_named_tuple.spam ? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: The python implementation of the "relationships between classes".

2011-11-10 Thread Ethan Furman
Benjamin Kaplan wrote: You're still misunderstanding Python's object model. del does NOT delete an object. It deletes a name. The only way for an object to be deleted is for it to be inaccessible (there are no references to it, or there are no reachable references to it). foo = object() bar = fo

Re: all() is slow?

2011-11-10 Thread Ethan Furman
work. So, no, it has nothing to do with 'exec', and everything to do with the problem namedtuple was designed to solve. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

How to dynamically create a derived type in the Python C-API

2011-11-11 Thread Ethan Furman
ddy_new() in a Python function object and create a dictionary mapping __new__ to this function object, which seems silly. What is the best way to go about this? Is my approach correct? Is there an interface function I missed? ----

Re: How to dynamically create a derived type in the Python C-API

2011-11-11 Thread Ethan Furman
The question is on StackOverflow if you want to answer it directly: http://stackoverflow.com/questions/8066438 ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

else in try/except

2011-11-14 Thread Ethan Furman
The code in 'else' in a 'try/except/else[/finally]' block seems pointless to me, as I am not seeing any difference between having the code in the 'else' suite vs having the code in the 'try' suite. Can anybody shed some light on this for me? ~Ethan~ --

Re: else in try/except

2011-11-14 Thread Ethan Furman
Thanks, all! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: staticmethod makes my brain hurt

2011-11-16 Thread Ethan Furman
off the '@staticmethod', and give 'self' a default of 'None': def _get_next_id(self=None): [blah, blah, blah] return id user_id = IntField(required=True, default=_get_next_id) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Pragmatics of the standard is() function

2011-11-28 Thread Ethan Furman
Den wrote: With respect, I disagree with advice that the use of a language construct should be rare. All constructs should be used *appropriately*. +1 ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: remove characters before last occurance of "."

2011-11-28 Thread Ethan Furman
plsulliv...@gmail.com wrote: s = GIS.GIS.Cadastral\GIS.GIS.Citylimit NeededValue = Citylimit NeededValue = s.rsplit('.', 1)[1] ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: order independent hash?

2011-12-04 Thread Ethan Furman
I"m convince that you're trolling. Welcome to my killfile. I think he's a bot, and he's been in my killfile for a while now. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading error message of the day

2011-12-08 Thread Ethan Furman
return 24 items instead of 14, or would never stop returning items. Not so. There could be fewer, in which you could see "expected 13 args, got 7." ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading error message of the day

2011-12-08 Thread Ethan Furman
? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading error message of the day

2011-12-08 Thread Ethan Furman
Benjamin Kaplan wrote: On Thu, Dec 8, 2011 at 2:09 PM, Ethan Furman wrote: Benjamin Kaplan wrote: If the RHS was a tuple or a list, yes you could know immediately. But unpacking works with any iterable, so it probably doesn't special-case lists and tuples. Iterables don't have a

Re: I love the decorator in Python!!!

2011-12-08 Thread Ethan Furman
ts return wrapped return func ------ The downside (which you get even with Michele's decorator module) is that tracebacks aren't quite as clean. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: I love the decorator in Python!!!

2011-12-08 Thread Ethan Furman
uot;a simple test" print("Test! "+x) return 5 ---- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading error message of the day

2011-12-09 Thread Ethan Furman
Jean-Michel Pichavant wrote: Ethan Furman wrote: Jean-Michel Pichavant wrote: You have to opportunity to not use unpacking anymore :o) There is a recent thread were the dark side of unpacking was exposed. Unpacking is a cool feautre for very small applications but should be avoided whenever

Re: Dynamic variable creation from string

2011-12-09 Thread Ethan Furman
hod won't make the problem any better in Python 3. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic variable creation from string

2011-12-11 Thread Ethan Furman
hen get annoyed that it was just to avoid typing. For me, half of it is to avoid the typing, the other half to avoid the reading. ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: I love the decorator in Python!!!

2011-12-12 Thread Ethan Furman
of it is: http://docs.python.org/library/functools#functools.update_wrapper Ah, cheers :) Is that a recent addition? The lack of note makes it seem like it was there from the beginning? Not sure how recent it is, but I do know it does *not* handle the signature. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: boolean from a function

2011-12-13 Thread Ethan Furman
... Heh, I do believe I've been bitten by that a couple times. The only defense I'm aware of is good unit tests. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

xml, minidom, ElementTree

2011-12-13 Thread Ethan Furman
In the near future I will need to parse and rewrite parts of a xml files created by a third-party program (PrintShopMail, for the curious). It contains both binary and textual data. There has been some strong debate about the merits of minidom vs ElementTree. Recommendations? ~Ethan~ -- http

<    8   9   10   11   12   13   14   15   16   17   >