Re: How to generate "a, b, c, and d"?

2011-12-15 Thread Ethan Furman
conjunction). If you were willing to forgo the Oxford comma, it would tidy up the code a bit. Sample code below Why go through all that instead of just converting the iterator into a list at the beginning of MRAB's solution and then running with it? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError in "with" statement (3.2.2)

2011-12-16 Thread Ethan Furman
hod (Terry): a function that must be looked up in the class Have I missed anything? Honestly-trying-learn-the-distinctions-ly yours, ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError in "with" statement (3.2.2)

2011-12-16 Thread Ethan Furman
Ethan Furman wrote: Terry Reedy wrote: On 12/16/2011 4:22 AM, Steven D'Aprano wrote: On Thu, 15 Dec 2011 19:39:17 -0500, Terry Reedy wrote: [...] After reading your post, I think I have worked out where our disagreement lies: you think that bound methods and instance methods are no

Re: nesting context managers

2011-12-20 Thread Ethan Furman
of the language, but how, and when, is implementation specific. Resource management (beyond basic memory allocation) should be handled directly. Python 3 encourages this by complaining if there were still open files when it shuts down. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-21 Thread Ethan Furman
Neal Becker wrote: Clarification: where can packing/unpacking syntax be used? It would be great if it were valid essentially anywhere (not limited to parameter passing). What about constructs like: a, @tuple tail, b = sequence? You mean like Python 3's: a, *middle, b = sequence ? -- htt

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ethan Furman
Steven D'Aprano wrote: I'm just glad that you've put your money where your mouth is, and released the package, instead of demanding others do the work. Thank you. +1000! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ethan Furman
Ian Kelly wrote: my goal is to write clear code, not great one-liners. :-D +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Ethan Furman
as the children will import the __main__ module. 8<--- import multiprocessing def f(): print('bla bla') if __name__ == '__main__': p = multiprocessing.Process(target=f) p.start() p.join() 8<--

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Ethan Furman
not write programs in it. However C++ is a vast, complex, and dangerous language -- and industry doesn't seem to be willing to limit itself to using the seven people on the planet who understand it. I'm only half joking... :) Ah -- so there's actually 14? ;) ~Ethan~ -- http://

Re: what does 'a=b=c=[]' do

2011-12-22 Thread Ethan Furman
ne to use an already existing list and get shallow copies of it, yours will only create empty lists. a, b, c = listgen([1, 2, 3]) # a, b, & c are bound to different lists ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't I define a decorator in a separate file and import it?

2011-12-22 Thread Ethan Furman
raise TypeError( > 'Singletons must be accessed through the `Instance` > method.') ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't I define a decorator in a separate file and import it?

2011-12-22 Thread Ethan Furman
that file, it doesn't work. Why can't I import this Singleton decorator from a different file? What's the best work around? Post the code, and the traceback. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: what does 'a=b=c=[]' do

2011-12-23 Thread Ethan Furman
s. And then he will learn about it and not make the mistake again (or if he does, it take much less time to figure it out). ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: what does 'a=b=c=[]' do

2011-12-23 Thread Ethan Furman
ple inheritence was a bug and asking it to be removed. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Test None for an object that does not implement ==

2011-12-25 Thread Ethan Furman
GZ wrote: Hi, I run into a weird problem. I have a piece of code that looks like the following: f(, a=None, c=None): assert (a==None)==(c==None) Um -- if you don't want a and c being passed in, why put them in the function signature? ~Ethan~ -- http://mail.python.org/ma

Re: Test None for an object that does not implement ==

2011-12-25 Thread Ethan Furman
It could be useful for a Null type to == None. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Test None for an object that does not implement ==

2011-12-26 Thread Ethan Furman
Devin Jeanpierre wrote: Um -- if you don't want a and c being passed in, why put them in the function signature? He wants both or neither to be passed in. Ah -- right. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2012-01-02 Thread Ethan Furman
Andrew Berg wrote: On 12/31/2011 12:19 PM, davidfx wrote: Should we always be using .format() for formatting strings or %? >> %-style formatting will eventually go away, but probably not for a long time. %-style formatting isn't going away. ~Ethan~ -- http://mail.python.

Re: Spamming PyPI with stupid packages

2012-01-03 Thread Ethan Furman
ut having to wade through crap. PyPI is not the place for it. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2012-01-03 Thread Ethan Furman
ting it is because Python currently has no fewer than three mechanisms for string formatting (not even including ordinary string concatenation), which according to the Zen of Python is two too many. "one obvious way" != "only one way" ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2012-01-03 Thread Ethan Furman
Ian Kelly wrote: http://mail.python.org/pipermail/python-dev/2009-September/092399.html Thanks, that link is very informative. Here's the link to the last discussion last February: http://mail.python.org/pipermail/python-dev/2011-February/108155.html ~Ethan~ -- http://mail.pytho

Re: .format vs. %

2012-01-03 Thread Ethan Furman
Devin Jeanpierre wrote: "one obvious way" != "only one way" Which way is the obvious way? Why is it obvious? Apparently, %-style is obvious to C and similar coders, while {}-style is obvious to Java and similar coders. :) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2012-01-03 Thread Ethan Furman
x27;%s' % n" 100 loops, best of 3: 0.965 usec per loop C:\WINDOWS>python -m timeit -n 100 -s "n=7.92" "'{}'.format(n)" 100 loops, best of 3: 1.17 usec per loop Good information. Thanks. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Spamming PyPI with stupid packages

2012-01-03 Thread Ethan Furman
accepted norm of our community. And I hope those of us who prefer to think of ourselves as not-sexist will act to clean up our house more. +1 ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: replacing __dict__ with an OrderedDict

2012-01-06 Thread Ethan Furman
their declaration[2], so that the output becomes more readable and structured, just as my test code (hopefully) is. I believe unittest executes tests in alphabetical order, but it does not display them in the same order when it prints error/fail results. ~Ethan~ -- http://mail.python.org/ma

Re: copy on write

2012-01-13 Thread Ethan Furman
--> a += b --> a [1, 2, 3, 'h', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd'] IMO, either both + and += should succeed, or both should fail. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

NaN, Null, and Sorting

2012-01-13 Thread Ethan Furman
ut is a pain in the backside. So I am strongly leaning towards implementing the comparisons such that Null objects are less than other objects so they will always sort together. Thoughts/advice/criticisms/etc? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: LBYL vs EAFP

2013-02-04 Thread Ethan Furman
th cases are LYBL, unless of course your addition was just an example of some mathematical code you have further down. Personally, I go with EAFP unless I'm trying to present friendlier error messages. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Opinion on best practice...

2013-02-05 Thread Ethan Furman
Python is an excellent option for writing shell scripts, particularly if your shell is cmd.exe. I believe having your shell be cmd.exe qualifies as a "good reason"! :) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to share an instance of a class among modules?

2013-02-06 Thread Ethan Furman
;: shared_cursor = ... -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to share an instance of a class among modules?

2013-02-06 Thread Ethan Furman
On 02/06/2013 04:57 PM, Ethan Furman wrote: On 02/06/2013 04:43 PM, c wrote: But the function in the module is also within a *class* so I don't think the function does have access to the module's global namespace. Here's the hierarchy: -- Module namespace

Re: Awsome Python - chained exceptions

2013-02-12 Thread Ethan Furman
On 02/12/2013 10:01 AM, Zero Piraeus wrote: On 12 February 2013 02:15, Steven D'Aprano wrote: As an antidote to the ill-informed negativity of Ranting Rick's illusionary "PyWarts", I thought I'd present a few of Python's more awesome features [...] You could call them PyW00ts. +1 QOTW -- ht

Re: any chance for contracts and invariants in Python?

2013-02-14 Thread Ethan Furman
code. I was under the impression that the real power of contracts was when they are /not/ turned off -- the errors we don't catch in development are the serious ones. ;) -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python 3 enum package

2013-02-16 Thread Ethan Furman
Greetings! There was a recent thread on Python-Ideas about adding an enumeration package to the stdlib. One idea that seemed to be fairly popular (at least I like it a lot ;) was the use of a metaclass to automatically assign values when a name lookup failed. It was also fairly unpopular and

Re: Python Newbie

2013-02-23 Thread Ethan Furman
On 02/23/2013 07:51 AM, Chris Angelico wrote: Steve, why do you say you're not a developer? A score of languages under your belt, choosing to write code in your spare time, and speaking competently on the comparative merits of different languages and why you made the decision you made - sounds li

Re: Python Newbie

2013-02-23 Thread Ethan Furman
On 02/23/2013 10:44 AM, jmfauth wrote: [snip various stupidities] jmf Peter, jmfauth is one of our resident trolls. Feel free to ignore him. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: intX.__str__() ??

2013-02-24 Thread Ethan Furman
cmLength2 = 13 . . . ftLength1 + cmLength2 # hey, that's wrong! better throw in a conversion -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: intX.__str__() ??

2013-02-24 Thread Ethan Furman
On 02/24/2013 09:29 AM, Michael Torrie wrote: On 02/24/2013 09:23 AM, Ethan Furman wrote: On 02/24/2013 07:46 AM, piterrr.dolin...@gmail.com wrote:> Hi guys, Question. Have this code intX = 32 # decl + init int var intX_asString = None # decl + i

Re: Python Newbie

2013-02-24 Thread Ethan Furman
g has a truthy/falsey (something vs nothing) value From a different email you said PyScripter was showing you all the dunder methods? You might want to try one of the others. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie

2013-02-24 Thread Ethan Furman
On 02/24/2013 12:58 PM, Chris Angelico wrote: On Mon, Feb 25, 2013 at 7:34 AM, Ethan Furman wrote: - no variable declarations, just use 'em Variable declarations can go either way; Python requires you to name all globals that you mutate I'm not sure what you mean -- example?

Re: Python Newbie

2013-02-24 Thread Ethan Furman
believe it's already been mentioned) "declaring" intX with some integer value does *nothing* to maintain X as an integer: --> intX = 32 --> intX = intX / 3.0 --> intX 10.66 -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie

2013-02-24 Thread Ethan Furman
off and stuck on some other object. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie

2013-02-24 Thread Ethan Furman
On 02/24/2013 05:53 PM, Chris Angelico wrote: On Mon, Feb 25, 2013 at 12:44 PM, Oscar Benjamin wrote: On 25 February 2013 01:24, Chris Angelico wrote: Once again, Ethan gets the short end of the citations stick... 'twarn't me wrote that, he did. Not that it's at all contrary t

Re: Python Newbie

2013-02-26 Thread Ethan Furman
an his original, as in my int/float example. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3 problem: how to convert an extension method into a class Method

2013-02-26 Thread Ethan Furman
ions... 8<-- class A(): pass A.method = c_method 8<-- -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

ANN: dbf (aka Python dBase)

2013-02-28 Thread Ethan Furman
The latest version, 0.95.001, is available on PyPI: http://python.org/pypi/dbf dbf v0.95.001 = dbf (also known as python dbase) is a module for reading/writing dBase III, FP, VFP, and Clipper .dbf database files. It's an ancient format that still finds lots of use (the most common

good mail readers [was Re: [Python-ideas] string.format() default variable assignment]

2013-03-02 Thread Ethan Furman
ut if it can do that... use mutt devel or [Al]pine. Text based MUA's and News readers are more efficient IMO. I'll take a look at those three. While I certainly prefer Tbird over anything MS has to offer, it certainly has its own list of irritations. -- ~Ethan~ -- http://mail.py

Re: Change in Python 3.3 with the treatment of sys.argv

2013-03-22 Thread Ethan Furman
ult, Sep 29 2012, 17:14:58) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. --> import sys --> sys.argv [''] --> sys.argv[1:] = ('this is a test!', ) --> sys.argv ['', 'th

Re: Help me pick an API design (OO vs functional)

2013-03-25 Thread Ethan Furman
ent objects (which is explicit -- you always know which object is being used) than having a magic function that changes the object in the background (plus you now have to search backwards for the last magic invocation to know -- and what if a called function changes it?). -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of int/long in Python 3

2013-03-25 Thread Ethan Furman
ot worth the trouble. If you're working with numbers, and speed is an issue, you really should be using one of the numeric or scientific packages out there. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: I need a neat way to print nothing or a number

2013-03-26 Thread Ethan Furman
#x27;). Use parens then: ("%.2f" % value) if value else '' -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to define "exec" method on a class object? Get syntax error due to built in command

2013-03-26 Thread Ethan Furman
to do would be to just change the command name from exec to something else. Yeah, that's unfortunate. I suggest 'execute'. :) -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me pick an API design (OO vs functional)

2013-03-27 Thread Ethan Furman
with' support would also be cool. __enter__ sets the new global window object whilst saving the old one, and then __exit__ restores the old one. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-27 Thread Ethan Furman
ed The Trolls (Anyone!) ;) Of course, somebody still has to reply so a newcomer doesn't get taken in by him. Has anybody else thought that his last few responses are starting to sound bot'ish? -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-27 Thread Ethan Furman
jmf has inflicted on us, I find it /very/ hard to believe that he forgot -- which means he was deliberately lying. At some point we have to stop being gentle / polite / politically correct and call a shovel a shovel... er, spade. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread Ethan Furman
that was a troll so I didn't waste time trying to use whatever they said, or be concerned that the language I was trying to use and learn was horribly flawed. If the "truthsquad" posts are so offensive to you, why don't you kill-file them? -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

unicode and the FSR [was: Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]]

2013-03-28 Thread Ethan Furman
t a French document that needs to include one mathematical symbol (or emoji) outside Latin-1 will double in size as a Python string. True. But how often do you have the entire document as a single string? Use readlines() instead of read(). Besides, memory is cheap. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-29 Thread Ethan Furman
On 03/29/2013 07:52 AM, Grant Edwards wrote: On 2013-03-28, Ethan Furman wrote: I cannot speak for the borg mind, but for myself a troll is anyone who continually posts rants (such as RR & XL) or who continuously hijacks threads to talk about their pet peeve (such as jmf). Assuming

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-29 Thread Ethan Furman
On 03/29/2013 02:26 PM, ru...@yahoo.com wrote: On 03/28/2013 02:31 PM, Ethan Furman wrote: On 03/28/2013 12:54 PM, ru...@yahoo.com wrote: On 03/28/2013 01:48 AM, Steven D'Aprano wrote: For someone who delights in pointing out the logical errors of others you are often remarkably sloppy in

Re: collections.Iterator __subclasshook__ does not check if next() is callable

2013-03-31 Thread Ethan Furman
t it is not returning a callable. If it did (and the callable was appropriate for the iterator), that would also work. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Ethan Furman
..] We are all eagerly waitin' for the new GuG (or GuGO?) language! I think the 'U' is silent, making it GAG. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of int/long in Python 3

2013-04-02 Thread Ethan Furman
7;re new so don't have all the history with jmf that many of us do, but consider that the original post was about numbers, had nothing to do with characters or unicode *in any way*, and yet jmf still felt the need to bring unicode up. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of int/long in Python 3

2013-04-02 Thread Ethan Furman
, it seems to me that, for whatever reason, JMF has reached the end of his capacity His capacity, maybe; his time? Not by a long shot. I am positive we will continue to see his uncooperative, bratty* behavior continue ad nauseum. -- ~Ethan~ *I was going to say childish, but I know plenty

Re: Performance of int/long in Python 3

2013-04-03 Thread Ethan Furman
On 04/03/2013 09:10 AM, rusi wrote: On Apr 3, 6:43 pm, Roy Smith wrote: This has to inspect the entire string, no? I posted (essentially) this a few days ago: if all(ord(c) <= 0x for c in s): return "it's all bmp" else: return "it's got astral cr

Re: I hate you all

2013-04-05 Thread Ethan Furman
it. Thank you, Saying 'thank you' does not mitigate you acting like an ass. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of int/long in Python 3

2013-04-06 Thread Ethan Furman
7;t expected to return the exact same values from sys.getsizeof, are they? What it boils down to is: - it can easily be done by hand now - it's a very uncommon need ergo: - it's not worth the time and on-going effort required -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: I hate you all

2013-04-07 Thread Ethan Furman
On 04/07/2013 04:44 AM, Timothy Madden wrote: I am ok with the people that like python the way it is. Really? 'Cause I totally missed that from the subject line... -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: USBLock : lock/unlock your computer with a USB key

2013-04-11 Thread Ethan Furman
listener class. Doesn't BlueTooth have a 30 foot range? For locking I'd rather be at 10 or even 5 feet away. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Message passing syntax for objects | OOPv2

2013-04-11 Thread Ethan Furman
On 04/11/2013 06:57 PM, Mark Janssen wrote: [blah blah not python blah blah] Mark, this list if for Python, about Python, helping with Python. If you want to discuss whatever this idea is, you should do it somewhere else, as it is *not* Python. -- ~Ethan~ -- http://mail.python.org/mailman

Re: API design for Python 2 / 3 compatibility

2013-04-13 Thread Ethan Furman
icode inside the program, and only switch back to some kind of encoding when writing to files/pipes/etc. Since you are going to support python 3 as well you can bump the major version number and note the backward incompatibility. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Grammar question: Englisn and Python: qualified names

2013-04-14 Thread Ethan Furman
On 04/14/2013 02:50 PM, Chris Angelico wrote: Quirky question time! When you read out a qualified name, eg collections.OrderedDict, do you read the qualifier ("collections dot ordered dict"), or do you elide it ("ordered dict")? I ask because it makes a difference to talking about just one of th

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-16 Thread Ethan Furman
x27;slice' is not an acceptable base type Well that bumps our count to five then: --> NoneType = type(None) --> NoneType --> class MoreNone(NoneType): ... pass ... Traceback (most recent call last): File "", line 1, in TypeError: type 'NoneType' is not an

Re: a couple of things I don't understand wrt lists

2013-04-16 Thread Ethan Furman
were expecting, and what you got; it was darn near perfect. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Unicode support so hard...

2013-04-20 Thread Ethan Furman
On 04/20/2013 11:14 AM, Chris Angelico wrote: Flash forward to current date, and jmf has hijacked so many threads to moan about PEP 393 that I'm actually happy about this one, simply because he gave it a new subject line and one appropriate to a discussion about Unicode. +1000 -- http://mail.py

Re: epiphany

2013-04-24 Thread Ethan Furman
r does? And even the interpreter isn't consistent -- sometimes it will return false (__eq__) and sometimes it will raise an Exception (__add__). I hardly think it an abuse of NotImplemented to signal something is not implemented when NotImplemented means, um, not implemented. possibly-

Re: epiphany

2013-04-24 Thread Ethan Furman
you are counting unimplemented rules as true, for some reason which I don't understand. The top-level logic we need to enforce is "this configuration doesn't violate any rules". Then have your unimplemented rules simply return True. Easy! And less clear. -- ~Ethan~ -- htt

Re: Mystery of module bindings!

2013-04-29 Thread Ethan Furman
beats the heck out of typing `import numpy as np` every time you start the interpreter. -- ~Ethan~ *Unless you start playing with injection and stuff. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python teaching book recommendations: 3.3+ and with exercises

2013-05-03 Thread Ethan Furman
Try http://inventwithpython.com/ Al Sweigert is the author, and he has three free ebooks there, and you can also purchase the paper versions if you like. Looks like it targets 3.1. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Wing IDE 4.1.13 released

2013-05-03 Thread Ethan Furman
l day kills my eyes. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Does altering a private member decouple the property's value?

2007-06-18 Thread Ethan Kennerly
made, but once a property's assignment has been called, the property appears. An example follows: >>> import pprint >>> pprint.pprint( a.__dict__ ) {'p': 1} >>> pprint.pprint( b.__dict__ ) {'p': None} >>> c = a_class() >>> pprint.pprint( c.__dict__ ) {} >>> c.p >>> pprint.pprint( c.__dict__ ) {} Is that dictionary population behavior for detecting an uninitialized property? Thanks for your help. When my feet are properly wet, I look forward to contributing to the community. -- Ethan Kennerly -- http://mail.python.org/mailman/listinfo/python-list

RE: Python IDE

2007-06-21 Thread Ethan Kennerly
in the IPython FAQ (http://ipython.scipy.org/moin/FAQ) the doctest was corrupted in IPython. -- Ethan -- http://mail.python.org/mailman/listinfo/python-list

RE: Does altering a private member decouple the property's value?

2007-06-22 Thread Ethan Kennerly
ublic and going "private" later is more efficient when refactoring. And since properties have the same access signature as a public member, it can be done without changes to the client. -- Ethan -- http://mail.python.org/mailman/listinfo/python-list

RE: visual gui ides for python/jythpn

2007-06-24 Thread Ethan Kennerly
ects at OS flash look promising (http://osflash.org/ext_howto), but I haven't found the part that says that my interface made in Macromedia Flash (which is a fantastic design environment) can be used with my code in Python with a real-time frame rate. -- Ethan -- http://mail.python.org/mailman/listinfo/python-list

Decorators and buffer flushing

2008-02-28 Thread Ethan Metsger
ished, even though I'm flushing the output buffer. Any thoughts? Best, Ethan ([EMAIL PROTECTED]) http://uppertank.net/ethanm/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators and buffer flushing

2008-02-28 Thread Ethan Metsger
ust(30),)) sys.stdout.flush() return self Is it possible that flushing is prohibited until __exit__ is called? Best, Ethan ([EMAIL PROTECTED]) http://uppertank.net/ethanm/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators and buffer flushing

2008-02-29 Thread Ethan Metsger
On Thu, 28 Feb 2008 15:04:38 -0500, Ethan Metsger <[EMAIL PROTECTED]> wrote: > > I can reproduce the issue in the console. I'm not convinced it's > actually > a bug, unless for some reason the interpreter is preventing a buffer > flush. Quick question. Havi

Re: Decorators and buffer flushing

2008-03-03 Thread Ethan Metsger
> module? Yes. I haven't investigated its uses in this context due to the constraints of the legacy system and general inertia. I'm trying to duplicate functionality while addressing certain annoyances with the previous system. Thanks again for your help! Best, Ethan -- Ethan Metsger http://uppertank.net/ethanm/ -- http://mail.python.org/mailman/listinfo/python-list

datetime.time and midnight

2009-02-21 Thread Ethan Furman
mount* of time, rather than a certain point during the day, then a time of 0:0:0 should certainly be False as it would mean no time had passed. However, since midnight does indeed exist (as many programmers have observed when deadlines approach ;) I would think it should be true. -- ~Ethan

Re: datetime.time and midnight

2009-02-22 Thread Ethan Furman
Tim Rowe wrote: 2009/2/22 Mark Dickinson : On Feb 21, 10:44 pm, Ethan Furman wrote: --> midnight = datetime.time(0,0,0) --> bool(midnight) False I'd call this a bug. No more so than zero being false. Zero exists too (check my bank balance). Once you'

dBase III files and Visual Foxpro 6 files

2008-12-08 Thread Ethan Furman
won't fit comfortably into memory? ~ethan~ -- http://mail.python.org/mailman/listinfo/python-list

datetime and the rich-companison operators

2008-12-08 Thread Ethan Furman
x27;t cope with? Thanks in advance! ~ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: dBase III files and Visual Foxpro 6 files

2008-12-08 Thread Ethan Furman
sniffer wrote: On Dec 8, 12:53 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: Greetings All! I nearly have support complete for dBase III dbf/dbt files -- just wrapping up support for dates. The null value has been a hindrance for awhile but I nearly have that solved as well. For any wh

Re: datetime and the rich-companison operators

2008-12-08 Thread Ethan Furman
Chris Rebert wrote: On Sun, Dec 7, 2008 at 11:41 PM, Ethan Furman <[EMAIL PROTECTED]> wrote: Greetings All! I am implementing a NullDate class in order to mirror dates and datetimes that have no value (yes, this is for my dbf module :) I'm still a bit fuzzy about class metho

Re: Don't you just love writing this sort of thing :)

2008-12-09 Thread Ethan Furman
ink it's another mark in Python's favor that such self-expression is possible, and functional. Yes, Lawrence, I do love writing fun code. ~ethan~ -- http://mail.python.org/mailman/listinfo/python-list

internal circular class references

2008-12-10 Thread Ethan Furman
hose last two lines into the class definition so that: 1) they are class attributes (not instance), and 2) they are NullDate type objects? ~ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: internal circular class references

2008-12-11 Thread Ethan Furman
Carl Banks wrote: On Dec 10, 5:26 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: Greetings List! I'm writing a wrapper to the datetime.date module to support having no date. Its intended use is to hold a date value from a dbf file, which can be empty. The class is functional at this

Re: internal circular class references

2008-12-11 Thread Ethan Furman
Thanks, Carl! Thanks, RDM! Your examples and ideas are much appreciated. Many thanks also to everyone else who responded. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question: if var1 == var2:

2008-12-12 Thread Ethan Furman
to me. Out of curiosity, what types of .ini files have one text string per line without = ? The ones I have seen follow this format: [section name] setting1 = a value setting2 = another value ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Limit traceback from most recent call

2008-12-15 Thread Ethan Furman
e? Brian A. Vanderburg II If memory serves, you can catch the exception, then re-raise it -- this should hide all the traceback below where you caught it, but still return the actual error. Hope this helps. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Call-By-Object

2008-11-10 Thread Ethan Furman
had never heard of c-b-o (alas, my degree is in Business Administration). The reference to the old articles, and effbot, and the very good explanation of Python's assignment statement have been invaluable to me and are *very much appreciated*. Thank you. ~ethan~ -- http://mail.python.org/m

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