Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A mathematician is a device for turning coffee into theorems. -- P. Erdos


devel / comp.lang.python / copy.copy

SubjectAuthor
* copy.copyast
`* Re: copy.copyJon Ribbens
 `- Re: copy.copyast

1
copy.copy

<619bab9d$0$8899$426a34cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16162&group=comp.lang.python#16162

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-a.proxad.net!nnrp1-1.free.fr!not-for-mail
Date: Mon, 22 Nov 2021 15:39:23 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Newsgroups: comp.lang.python
Content-Language: fr
From: ast...@invalid (ast)
Subject: copy.copy
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 16
Message-ID: <619bab9d$0$8899$426a34cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 22 Nov 2021 15:39:25 CET
NNTP-Posting-Host: 91.170.32.5
X-Trace: 1637591965 news-4.free.fr 8899 91.170.32.5:12553
X-Complaints-To: abuse@proxad.net
 by: ast - Mon, 22 Nov 2021 14:39 UTC

Hi,

>>> a = 6
>>> b = 6
>>> a is b
True

ok, we all know that Python creates a sole instance
with small integers, but:

>>> import copy
>>> b = copy.copy(a)
>>> a is b
True

I was expecting False

Re: copy.copy

<slrnspnc7d.383v.jon+usenet@raven.unequivocal.eu>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16163&group=comp.lang.python#16163

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jon+use...@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.python
Subject: Re: copy.copy
Date: Mon, 22 Nov 2021 15:02:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <slrnspnc7d.383v.jon+usenet@raven.unequivocal.eu>
References: <619bab9d$0$8899$426a34cc@news.free.fr>
Injection-Date: Mon, 22 Nov 2021 15:02:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3ed9bd55018679240f8d061056ec22dd";
logging-data="15443"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19P+4snX5k2C6o+ZZ2T8kHsvceSOfUmGKQ="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:0koMyetfDSchJXXXGpjtHXKITlU=
 by: Jon Ribbens - Mon, 22 Nov 2021 15:02 UTC

On 2021-11-22, ast <ast@invalid> wrote:
> Hi,
>
> >>> a = 6
> >>> b = 6
> >>> a is b
> True
>
> ok, we all know that Python creates a sole instance
> with small integers, but:
>
> >>> import copy
> >>> b = copy.copy(a)
> >>> a is b
> True
>
> I was expecting False

Why did you expect False?

For immutable types, copy(foo) just returns foo.

Re: copy.copy

<619bb765$0$8916$426a34cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16164&group=comp.lang.python#16164

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-b.proxad.net!nnrp1-1.free.fr!not-for-mail
Date: Mon, 22 Nov 2021 16:29:41 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Subject: Re: copy.copy
Content-Language: fr
Newsgroups: comp.lang.python
References: <619bab9d$0$8899$426a34cc@news.free.fr>
<slrnspnc7d.383v.jon+usenet@raven.unequivocal.eu>
From: ast...@invalid (ast)
In-Reply-To: <slrnspnc7d.383v.jon+usenet@raven.unequivocal.eu>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 8
Message-ID: <619bb765$0$8916$426a34cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 22 Nov 2021 16:29:41 CET
NNTP-Posting-Host: 91.170.32.5
X-Trace: 1637594981 news-4.free.fr 8916 91.170.32.5:10926
X-Complaints-To: abuse@proxad.net
 by: ast - Mon, 22 Nov 2021 15:29 UTC

Le 22/11/2021 à 16:02, Jon Ribbens a écrit :
> On 2021-11-22, ast <ast@invalid> wrote:

>
> For immutable types, copy(foo) just returns foo.
>

ok, thx

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor