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
On 06/09/2014 01:54 PM, Carlos Anselmo Dias wrote:
[snip]
*plonk*
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
d.
Thanks, Chris!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
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
need to provide your own copies of any dict method that calls __getitem__.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
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
parid with self._loc,
so RainyDay is good there.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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~
--
t one requires Java, and the other .NET. :/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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~
-
(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
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
http://www.pythonjobs.com/
* http://www.djangojobs.org/
Nice, thanks!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
ther.
"rr" is "rantingrickjohnson@...".
As someone just recently said, "The clue is in the name." ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
__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
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
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
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
simple, easy way is not going to be sufficient.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
merge, and a rare rollback -- not complicated stuff.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 08/27/2014 11:51 AM, Skip Montanaro wrote:
Thank God for StackOverflow. :-)
+1 QotW
--
https://mail.python.org/mailman/listinfo/python-list
mmon words? I would think the more the
merrier!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
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
end of a sentence, does it not count? That would be suckitude indeed! ;) ]
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
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
[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
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
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
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
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
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
, 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
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
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
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
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
n/nq050616.gif
Okay, now that's funny.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
"
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
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<------
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
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
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
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?
----
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
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~
--
Thanks, all!
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
?
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
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
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
uot;a simple test"
print("Test! "+x)
return 5
----
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
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
hod won't make the problem
any better in Python 3.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
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
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
...
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
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
1201 - 1300 of 1941 matches
Mail list logo