On 2018-03-13 23:56, Denis Kasak wrote:
On 2018-03-10 02:13, Steven D'Aprano wrote:
But I've stared at this for an hour and I can't see how to extend the
result to three coordinates. I can lay out a grid in the order I want:
1,1,1 1,1,2 1,1,3 1,1,4 ...
2,1,1 2,1,2
uot;""
n, m = c(i)
return c(n) + (m,)
Applying c3 to the natural numbers gives the sequence you wanted:
s = map(c3, count(1))
pprint([next(s) for _ in range(10)])
[(1, 1, 1),
(2, 1, 1),
(1, 1, 2),
(1, 2, 1),
(2, 1, 2),
(1, 1, 3),
(3, 1, 1),
(1, 2, 2),
(2, 1, 3),
(1, 1, 4)]
--
Denis Kasak
--
https://mail.python.org/mailman/listinfo/python-list
"Forename" : self.forename.randomByWeight(),
>> "Surname" : self.surname.randomByWeight()}
>>
> This will return a dictionary containing both forename and
> surname... Assuming you have forename and surname OBJECTS with contain a
> randomByWeight method.
In all probability, forename and surname *are* instances of RandomName
and contain the randomByWeight() method.
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Feb 23, 2009 at 9:12 PM, Steve Holden wrote:
> Denis Kasak wrote:
>> I assure you I am not confused about Python's object model / calling
>> system. I was arguing, from a purely theoretical standpoint, that the
>> same system Python uses could be described in ter
On Mon, Feb 23, 2009 at 8:41 PM, Christian Heimes wrote:
> Denis Kasak wrote
>> You could, however, argue that the swap function doesn't work as
>> expected (e.g. from a Pascal or a C++ POV) simply because the
>> underlying objects aren't mutable. The objects
, swapping of values would
indeed occur because the function *did* get references to the objects
passed to it.
That said, it's a rather convoluted way of explaining what happens and
calling it pass-by-object feels much better. :-)
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
-1 in the absence of
specification is a better guess than most (since it's more likely to
display the message correctly). However, not specifying the encoding
of a message is just asking for trouble and assuming anything is just
an attempt of cleaning someone's mess. Unfortunately, it is impossible
to detect the encoding scheme just by heuristics and with hundreds of
encodings in existence today, the only real solution to the problem is
clearly stating your content-type. Since MIME is the most accepted way
of doing this, it should be the preferred way, RFC'ed or not.
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
r of UCS-2 because of size concerns.
> UTF-8 was ruled out easily because it doesn't allow constant-size
> indexing; UTF-16 essentially for the same reason (plus there was
> no point to UTF-16, since there were no assigned characters outside
> the BMP).
Yes, I failed to realise how
*not* strictly UCS-2 anymore.
Since we're already discussing this, I'm curious - why was UCS-2
chosen over plain UTF-16 or UTF-8 in the first place for Python's
internal storage?
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
de all Unicode code points, while
the latter can only encode those in the BMP.
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
4:52
> PM'
>
> So, yeah, that seems weird to me. Does anyone get similar results, know why
> this is happening, and/or how to fix it?
It's actually pretty trivial to fix, which you would have also known
if you had read the message of the exception more carefully. :P
You passed the arguments for strptime() the wrong way around. Just
pass them in reverse and your problem will be fixed.
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Feb 2, 2009 at 10:43 PM, Lionel wrote:
> >>> ResourcefilePath
> 'C:\\C8Example1.slc.rsc'
> C:\C8Example1.slc.src
The extension you used in the interactive shell differs from the one
you used in the class code (i.e. "rsc" vs "src").
-
On Tue, Jan 27, 2009 at 7:08 PM, Thorsten Kampe
wrote:
> * Denis Kasak (Tue, 27 Jan 2009 14:22:32 +0100)
>> On Tue, Jan 27, 2009 at 1:52 PM, Giampaolo Rodola'
>> wrote:
>> >>>> print unicode('\u20ac')
>> > \u20ac
>>
>> S
ckslash. In Python 3.0 you don't need
to do this because all strings are "unicode" to start with. I suspect
you will see the same error with 2.6 on Windows once you correct this.
(note to Giampaolo: sorry, resending this because I accidentally
selected "reply" instead of "reply to all")
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten wrote:
Denis Kasak wrote:
Basically, it reverses the list in place, so it modifies the list which
called it. It does not return a /new/ list which is a reversed version
of the original, as you expected it to. Since it doesn't return anything
explicitly, Python makes it return
nything
explicitly, Python makes it return None. Hence, the comparison you are
doing is between the original list and a None, which is False, naturally.
Try this:
spam = ['a', 'n', 'n', 'a']
eggs = spam[:]
if spam.reverse() == eggs:
print &quo
Scott David Daniels wrote:
Denis Kasak wrote:
...
spam = []
for i in range(10):
... spam.append(lambda: i)
spam[0]()
9
spam[1]()
9
Manually creating the lambdas and appending them to a list works as
expected, naturally; I don't see a good reason why it wouldn't work
with a
also yields
incorrect (or at least unintuitive) results:
>>> spam = []
>>> for i in range(10):
... spam.append(lambda: i)
>>> spam[0]()
9
>>> spam[1]()
9
Manually creating the lambdas and appending them to a list works as
expected, naturally; I don't see a good reason why it wouldn't work
with a loop. Am I missing something?
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
rect (or at least unintuitive) results:
>>> spam = []
>>> for i in range(10):
... spam.append(lambda: i)
>>> spam[0]()
9
>>> spam[1]()
9
Manually creating the lambdas and appending them to a list works as
expected, naturally; I don't see a good reason why it wouldn't work
with a loop. Am I missing something?
--
Denis Kasak
--
http://mail.python.org/mailman/listinfo/python-list
type(b) == classobj
> Traceback (most recent call last):
> File "", line 1, in ?
> NameError: name 'classobj' is not defined
You can compare it against the ClassType object located in the types module.
> import types
> class b:
def __init__(self):
...
T Beck wrote:
>
> Wasn't the point... I never said they were. HTML is at version 4.0(I
> think?) now, AND we've added extra layers of stuff you can use
> alongside of it. The internet is a free-flowing evolving place... to
> try to protect one little segment like usenet from ever evolving is
> j
John Bokma wrote:
>
> so use Lynx :-)
>
> One forum I visit is about scorpions. And really, it talks a bit easier
> about scorpions if you have an image to look at :-D.
>
> In short: Usenet = Usenet, and www = www. Why some people want to move
> people from www to Usenet or vice versa is beyond
John Bokma wrote:
> Ulrich Hobelmann <[EMAIL PROTECTED]> wrote:
>
>> John Bokma wrote:
>>> http://www.phpbb.com/mods/
>>
>> Great. How can I, the user, choose, how to use a mod on a given web
>> server?
>
> Ask the admin?
And that is, in your opinion, completely comparable to running your own
John Bokma wrote:
>
> You can't be sure: errors in the handling of threads can cause a buffer
> overflow, same for spelling checking :-D
Yes, they can, provided they are not properly coded. However, those
things only interact locally with the user and have none or very limited
interaction with
Mike Schilling wrote:
>
> Threaded mail-readers too, screen-based editors , spell-checkers, all
> useless frills.
Interestingly enough, I have explained my opinion in the part of the
post you have trimmed. On the other hand, things you mentioned are far
from being useless. They introduce no in
Mike Schilling wrote:
>
> I see a difference between "X would be useful for A, B, and C" and "Y will
> always be the only proper way."
>
> Don't you?
Y would not be useful because of the bandwidth it consumes, the malware
it would introduce, the additional time spent focusing on the format
ra
CBFalconer wrote:
> Mike Schilling wrote:
>> "Mike Meyer" <[EMAIL PROTECTED]> wrote in message
>>> "Mike Schilling" <[EMAIL PROTECTED]> writes:
"l v" <[EMAIL PROTECTED]> wrote in message
> Xah Lee wrote:
>
>> (circa 1996), and email should be text only (anti-MIME, circa 1995),
27 matches
Mail list logo