rdnet.py", line 958, in rewind
if (line[0] != ' '):
IndexError: string index out of range
Is this pywordnet package abandoned, are there weird versioning issues,
or am I just extremely unlucky for the install to fail on two machines?
any help greatly appreciated,
vdrab.
--
http://mail.python.org/mailman/listinfo/python-list
nd it looks readable enough
to try and fiddle around with it, but if possible I'd like to avoid
having to mess with the source file.
Is there any other person / list I can ask for help on this?
thanks a lot.
vdrab.
--
http://mail.python.org/mailman/listinfo/python-list
at startup.
checking the web it seems this is a known issue.
Thanks for the help though... I didn't bother posting the solution as I
thought noone was interested anymore.
cheers,
vdrab.
--
http://mail.python.org/mailman/listinfo/python-list
You can tell everything is well in the world of dynamic languages when
someone posts a question with nuclear flame war potential like "python
vs. ruby" and after a while people go off singing hymns about the
beauty of Scheme...
I love this place.
v.
--
http://mail.python.org/mailman/listinfo/pyt
On a (somewhat) related note,
I've always wondered whether it is possible to emulate ruby blocks
using a python generator '+ alpha'. In my limited understanding of the
ruby block, the generator can inject values into a block, I suppose,
but what is the block itself? can it be a function? a class in
> >>> isinstance(1, object)
> True
>
> What's 1 . len() ?
That's easy!
since 1 is actually syntactic sugar for set([set([])]), clearly 1.len()
== 1.
;-)
v.
(actually, make that frozenset([frozenset([])])...)
--
http://mail.python.org/mailman/listinfo/python-list
I WISH TO KNOW THE TRUTH:
WHEN WILL WE HAVE PYPY?
--
http://mail.python.org/mailman/listinfo/python-list
Wow, so, to see if I understand correctly:
>>> r = 0
>>> s = 0
>>> t = 11
>>> u = 11
>>> r == s
True
>>> t == u
True
>>> r is s
True
>>> t is u
False
>>> ... ?
what the...?
does anybody else get mighty uncomfortable about this?
s.
--
http://mail.python.org/mailman/listinfo/python-list
> No. Why should you ever care about whether two integers representing
> values are the same object? Your tests should be with `==`, not `is`.
Given this though, what other such beauties are lurking in the
interpreter, under the name of 'implementation accidents'? One of the
things that drew me
> beasts. It can get even worse: I can define an object (in C++ as well as in
> python) that is not even equal to itself. Not that I felt the need for that
> so far
hehe... now you've picked my curiosity... how?
ps.
def __eq__(self, other): return False
does not count !
--
http://mail.pytho
> so anything you don't understand, and cannot be bothered to look up in
> the documentation, just has to be an inconsistent ad-hoc weird-gotcha
> design ?
Does the documentation mention that "x is y" returns True when they are
both 0 but not when they are 11 ? If so, I stand corrected. *plonk
>
language reference, objects:
"Even the importance of object identity is affected in some sense:
for
immutable types, operations that compute new values may actually
return a reference to any existing object with the same type and
value,
while for mutable objects this is not allow
> """
> E.g., after "a = 1;
> b = 1",
> a and b may or may not refer to the same object with the value one,
> depending on the implementation,
> """
But when in a specific implementation this property _does_ hold for
ints having value 1, I expect the
same behaviour for ints with other valu
> Are you telling us that you *had* read that doc,
> and tripped because it says "depending on the implementation",
> when it should say "at the choice of the implementation" ?
no.
let's see, where to start ... ?
let's say there's a certain property P, for the sake of this lng
discussion, some
oh wow... it gets better...
>>> x = "test!"
>>> y = "test!"
>>> x is y
False
>>> x = "test"
>>> y = "test"
>>> x is y
True
>>>
... I had no clue.
I guess the take-away lesson is to steer clear from any reliance on
object identity checks, if at all possible. Are there any other such
"optimization
> You've been told that quite a few times before that "is" is not intended for
> what you used it.
I got that. I was cleaning up some code that used "is" incorrectly
immediately after.
> Some people actually listen to what others tell. Others seem to be driven by
> the deep desire to make even th
Depending on what concrete use you have for binary trees, you may want
to consider tuples. What's cool about them is that you get pattern
matching on your tree for free.
>>> x = ((2,4),(5,6))
>>> y, _ = x
>>> y
(2, 4)
>>> (_,y), _ = x
>>> y
4
>>>
Or you could code your own binary tree class subcl
> I'm completely on board with the semantics for any(). But all() bothers
> me. If all() receives an empty list, it will return True, and I don't
> like that. To me, all() should be a more restrictive function than any(),
> and it bothers me to see a case where any() returns False but all()
> re
Thank you.
The original question was not meant to sound particularly arrogant, and
as you point out
a book covering ONLY things like metaprogramming would probably be
pretty useless in its own way. I have been using python on and off for
about a year or so but still find myself staring at some of
Hi all,
Is there some sort of coherent source (dead tree format, maybe?) on
some of the more advanced features
of python (decorators, metaclasses, etc)? I'm sort of looking for a
python book that actually gets to the good stuff at some point, without
first spending 6 chapters on how to append ints
wow, this looks nice.
thanks a lot.
--
http://mail.python.org/mailman/listinfo/python-list
21 matches
Mail list logo