Stargaming [EMAIL PROTECTED] wrote:
On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote:
For the answer I actually want each asterisk substitutes for exactly one
character.
Played around a bit and found that one:
Python 3.0a3+ (py3k:61352, Mar 12 2008, 12:58:20)
[GCC 4.2.3 20080114
Duncan Booth [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Stargaming [EMAIL PROTECTED] wrote:
|
| On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote:
|
| For the answer I actually want each asterisk substitutes for exactly
one
| character.
|
| Played around a bit and
Hi,
I'm reading the Python Reference Manual in order to gain a better understanding
of Python under the hood.
On the last paragraph of 3.1, there is a statement on immutable and mutable
types as such:
paraphrase
Depending on implementation, for immutable types, operations that compute
new
Bernard Lim wrote:
Hi,
I'm reading the Python Reference Manual in order to gain a better
understanding
of Python under the hood.
On the last paragraph of 3.1, there is a statement on immutable and mutable
types as such:
paraphrase
Depending on implementation, for immutable types
Bernard Lim [EMAIL PROTECTED] writes:
paraphrase
Depending on implementation, for immutable types, operations that
compute new values may or may not actually return a reference to any
existing object with the same type and value, while for mutable
objects this is (strictly)? not allowed.
a = 1
b = 1
a is b
True
id(a)
10901000
id(b)
10901000
Isn't this because integers up to a certain range are held in a single
memory location, thus why they are the same?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
a = 1
b = 1
a is b
True
id(a)
10901000
id(b)
10901000
Isn't this because integers up to a certain range are held in a single
memory location, thus why they are the same?
As the OP said:
paraphrase
Depending on implementation, for immutable types,
Diez B. Roggisch [EMAIL PROTECTED] wrote:
Which is exactly what happens - the actual implementation chose to cache
some values based on heuristics or common sense - but no guarantees are
made in either way.
Here's a puzzle for those who think they know Python:
Given that I masked out part of
[EMAIL PROTECTED] wrote:
a = 1
b = 1
a is b
True
id(a)
10901000
id(b)
10901000
Isn't this because integers up to a certain range are held in a single
memory location, thus why they are the same?
Yes, in *some* implementations of Python this is exactly what happens. The
exact
On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote:
Here's a puzzle for those who think they know Python:
Given that I masked out part of the input, which version(s) of Python
might give the following output, and what might I have replaced by
asterisks?
There's too many variables -- at
On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote:
Here's a puzzle for those who think they know Python:
Given that I masked out part of the input, which version(s) of Python
might give the following output, and what might I have replaced by
asterisks?
a = 1
b =
if a is b:
Steven D'Aprano [EMAIL PROTECTED] wrote:
On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote:
Here's a puzzle for those who think they know Python:
Given that I masked out part of the input, which version(s) of Python
might give the following output, and what might I have replaced by
Stargaming [EMAIL PROTECTED] wrote:
On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote:
Here's a puzzle for those who think they know Python:
Given that I masked out part of the input, which version(s) of Python
might give the following output, and what might I have replaced by
On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote:
For the answer I actually want each asterisk substitutes for exactly one
character.
Played around a bit and found that one:
Python 3.0a3+ (py3k:61352, Mar 12 2008, 12:58:20)
[GCC 4.2.3 20080114 (prerelease) (Debian 4.2.2-7)] on linux2
Stargaming [EMAIL PROTECTED] wrote:
On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote:
For the answer I actually want each asterisk substitutes for exactly one
character.
Played around a bit and found that one:
Python 3.0a3+ (py3k:61352, Mar 12 2008, 12:58:20)
[GCC 4.2.3 20080114
In article [EMAIL PROTECTED],
Duncan Booth [EMAIL PROTECTED] wrote:
I don't have a copy of 1.4 to check so I'll believe you, but you can
certainly get the output I asked for with much more recent versions.
For the answer I actually want each asterisk substitutes for exactly one
character.
Matthew Woodcraft [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
Duncan Booth [EMAIL PROTECTED] wrote:
I don't have a copy of 1.4 to check so I'll believe you, but you can
certainly get the output I asked for with much more recent versions.
For the answer I actually want each
17 matches
Mail list logo