Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Life is a game. Money is how we keep score. -- Ted Turner


devel / comp.lang.python / AttributeError: 'NoneType' object has no attribute 'get'

SubjectAuthor
* AttributeError: 'NoneType' object has no attribute 'get'NArshad
+- Re: AttributeError: 'NoneType' object has no attribute 'get'Kushal Kumaran
+- Re: AttributeError: 'NoneType' object has no attribute 'get'Mats Wichmann
+- Re: AttributeError: 'NoneType' object has no attribute 'get'2QdxY4RzWzUUiLuE
`- Re: AttributeError: 'NoneType' object has no attribute 'get'Chris Angelico

1
AttributeError: 'NoneType' object has no attribute 'get'

<9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:d05:: with SMTP id 5mr48674319qvh.46.1641368061316;
Tue, 04 Jan 2022 23:34:21 -0800 (PST)
X-Received: by 2002:a05:622a:1902:: with SMTP id w2mr48443745qtc.498.1641368061178;
Tue, 04 Jan 2022 23:34:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 4 Jan 2022 23:34:20 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=37.111.139.63; posting-account=IftX_woAAACUMrPm_t7tPycPRLi3x_9J
NNTP-Posting-Host: 37.111.139.63
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
Subject: AttributeError: 'NoneType' object has no attribute 'get'
From: narshad....@gmail.com (NArshad)
Injection-Date: Wed, 05 Jan 2022 07:34:21 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: NArshad - Wed, 5 Jan 2022 07:34 UTC

How to correct what is written below:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Dani Brothers\Anaconda3\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "D:/Python/Book Bank/New folder/PyCharm/Final/Excel.py", line 57, in SaveBook
e_pissue.get(),
AttributeError: 'NoneType' object has no attribute 'get'

Process finished with exit code 0

Re: AttributeError: 'NoneType' object has no attribute 'get'

<mailman.114.1641492604.3079.python-list@python.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: kus...@locationd.net (Kushal Kumaran)
Newsgroups: comp.lang.python
Subject: Re: AttributeError: 'NoneType' object has no attribute 'get'
Date: Thu, 06 Jan 2022 10:02:59 -0800
Lines: 25
Message-ID: <mailman.114.1641492604.3079.python-list@python.org>
References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
<87r19kbv3g.fsf@locationd.net>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: news.uni-berlin.de OUYvLwrN5bKXf2NWS6qZCQMEg8oF/iFM0QmVBMPyneLQ==
Return-Path: <kushal@locationd.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.005
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'looks': 0.02; 'traceback':
0.04; '(most': 0.05; '2022': 0.05; 'last):': 0.05; 'exercises':
0.07; 'exit': 0.07; 'tkinter': 0.07; '__call__': 0.16; 'kushal':
0.16; 'wrote:': 0.16; 'instead': 0.17; 'pm,': 0.19; 'tue,': 0.19;
'to:addr:python-list': 0.20; 'written': 0.22; 'exception': 0.22;
'code': 0.23; 'section': 0.25; 'cannot': 0.25; 'programming':
0.25; 'object': 0.26; 'error': 0.29; 'header:User-Agent:1': 0.30;
'code,': 0.31; 'book.': 0.32; 'suitable': 0.32; 'path': 0.33;
'header:In-Reply-To:1': 0.34; 'following': 0.35; 'fix': 0.36;
'file': 0.38; 'means': 0.38; 'rest': 0.39; 'method': 0.61;
'below:': 0.63; 'finished': 0.64; 'your': 0.64; 'look': 0.65;
'skip:b 40': 0.69; 'subject:get': 0.70; 'skip:f 30': 0.71;
'attribute': 0.84; 'callback': 0.84; 'received:88': 0.84;
'subject:skip:A 10': 0.91
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
arsenic.locationd.net
X-Spam-Level:
X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00
autolearn=ham autolearn_force=no version=3.4.2
X-Clacks-Overhead: GNU Terry Pratchett
In-Reply-To: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
(NArshad's message of "Tue, 4 Jan 2022 23:34:20 -0800 (PST)")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <87r19kbv3g.fsf@locationd.net>
X-Mailman-Original-References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
 by: Kushal Kumaran - Thu, 6 Jan 2022 18:02 UTC

On Tue, Jan 04 2022 at 11:34:20 PM, NArshad <narshad.380@gmail.com> wrote:
> How to correct what is written below:
>
> Exception in Tkinter callback
> Traceback (most recent call last):
> File "C:\Users\Dani Brothers\Anaconda3\lib\tkinter\__init__.py", line 1705, in __call__
> return self.func(*args)
> File "D:/Python/Book Bank/New folder/PyCharm/Final/Excel.py", line 57, in SaveBook
> e_pissue.get(),
> AttributeError: 'NoneType' object has no attribute 'get'
>
> Process finished with exit code 0

The error means that e_pissue is None, so your code cannot call the get
method on it. You need to fix the code so that e_pissue is not None and
is instead referring to an object that has a suitable get method.

Without looking at the rest of your code, it is not possible to get any
more specific. Looking at the path of the file, it looks like you may
be following some programming exercises from a book. If so, perhaps you
need to look up the section about understanding exception tracebacks.

--
regards,
kushal

Re: AttributeError: 'NoneType' object has no attribute 'get'

<mailman.115.1641504281.3079.python-list@python.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: mat...@wichmann.us (Mats Wichmann)
Newsgroups: comp.lang.python
Subject: Re: AttributeError: 'NoneType' object has no attribute 'get'
Date: Thu, 6 Jan 2022 14:21:48 -0700
Lines: 28
Message-ID: <mailman.115.1641504281.3079.python-list@python.org>
References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
<87r19kbv3g.fsf@locationd.net>
<17b830d4-d2f9-0a62-41a6-eff38a85c66a@wichmann.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de HFCO9mVEXxnzwz+cKxzJ8wFtobS1Z1NJlts1NiO3x24w==
Return-Path: <mats@wichmann.us>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=pobox.com header.i=@pobox.com header.b=DnTimdgo;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.069
X-Spam-Evidence: '*H*': 0.87; '*S*': 0.01; 'traceback': 0.04; '(most':
0.05; '2022': 0.05; 'last):': 0.05; 'exit': 0.07; 'tkinter': 0.07;
'__call__': 0.16; 'kumaran': 0.16; 'kushal': 0.16;
'received:64.147': 0.16; 'wrote:': 0.16; 'python': 0.16;
'instead': 0.17; 'pm,': 0.19; 'tue,': 0.19; 'to:addr:python-list':
0.20; 'written': 0.22; 'exception': 0.22; 'code': 0.23; 'cannot':
0.25; 'object': 0.26; 'purpose': 0.28; 'error': 0.29; 'header
:User-Agent:1': 0.30; 'returning': 0.32; 'suitable': 0.32; 'header
:In-Reply-To:1': 0.34; 'fix': 0.36; 'functions': 0.36; "it's":
0.37; 'received:192.168': 0.37; 'file': 0.38; 'way': 0.38;
'could': 0.38; 'means': 0.38; 'happen': 0.40; 'method': 0.61;
'come': 0.62; 'below:': 0.63; 'check.': 0.64; 'finished': 0.64;
'thus': 0.64; 'your': 0.64; 'received:64': 0.67; 'skip:b 40':
0.69; 'subject:get': 0.70; 'skip:f 30': 0.71; 'success': 0.73;
'easy': 0.74; 'attribute': 0.84; 'callback': 0.84; 'naturally':
0.84; 'proceed': 0.88; 'subject:skip:A 10': 0.91; 'hole': 0.93;
'fall': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id
:date:mime-version:subject:to:references:from:in-reply-to
:content-type:content-transfer-encoding; s=sasl; bh=vTKeKevTDMoK
2k7dW7tLzAqmvvvgka8sky9sVSdWc8Y=; b=DnTimdgocNniw1lsG4vSRy56W6l7
OY5re53+VZL6ZEjcdIRUFrKTPXq/7CC95X3NcvUF+fiST9w9LTUJlqrPyqOWzj8n
DRnrRidkoeWSqXr2sSWDdp8h/KM9InXtbHx7hBHBt1B7sMW9C8VWpls6O9OyXiB0
8aOu1dJ9Qasimmk=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=wichmann.us;
h=message-id:date:mime-version:subject:to:references:from:in-reply-to:content-type:content-transfer-encoding;
s=2018-07.pbsmtp; bh=vTKeKevTDMoK2k7dW7tLzAqmvvvgka8sky9sVSdWc8Y=;
b=sFl9paM0rlb4hGMNNyjtnKRywgkFdPNagPDEy/pjeffA6RhrlpRlXTnJyiBW6WWg5l5ceRAwWAWKz6jF3AgyiOATECzwwJfj1rl1AtZlIct6+TLbd87piy23gVC9wFbYOMfix1VHzX5X6WjS++r29yhoKQenqIp+zYgG+exDwxc=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Content-Language: en-US
In-Reply-To: <87r19kbv3g.fsf@locationd.net>
X-Pobox-Relay-ID: A9501A12-6F36-11EC-B93F-CB998F0A682E-81526775!pb-smtp2.pobox.com
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <17b830d4-d2f9-0a62-41a6-eff38a85c66a@wichmann.us>
X-Mailman-Original-References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
<87r19kbv3g.fsf@locationd.net>
 by: Mats Wichmann - Thu, 6 Jan 2022 21:21 UTC

On 1/6/22 11:02, Kushal Kumaran wrote:
> On Tue, Jan 04 2022 at 11:34:20 PM, NArshad <narshad.380@gmail.com> wrote:
>> How to correct what is written below:
>>
>> Exception in Tkinter callback
>> Traceback (most recent call last):
>> File "C:\Users\Dani Brothers\Anaconda3\lib\tkinter\__init__.py", line 1705, in __call__
>> return self.func(*args)
>> File "D:/Python/Book Bank/New folder/PyCharm/Final/Excel.py", line 57, in SaveBook
>> e_pissue.get(),
>> AttributeError: 'NoneType' object has no attribute 'get'
>>
>> Process finished with exit code 0
>
> The error means that e_pissue is None, so your code cannot call the get
> method on it. You need to fix the code so that e_pissue is not None and
> is instead referring to an object that has a suitable get method.

And at a more meta level: many functions in the Python world return
None as an indication that the operation did not succeed. It's useful
because in many circumstances None is an "out of band" value - one that
could not happen naturally - and thus returning it provides an easy way
for the caller to check for success or failure.

However... if that is the case, you have to actually do that check. If
you just proceed as if a vaild value had come back, you're defeating the
purpose - and are sure to fall into a hole like the one you've encountered.

Re: AttributeError: 'NoneType' object has no attribute 'get'

<mailman.116.1641505563.3079.python-list@python.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: 2QdxY4Rz...@potatochowder.com
Newsgroups: comp.lang.python
Subject: Re: AttributeError: 'NoneType' object has no attribute 'get'
Date: Thu, 6 Jan 2022 13:45:52 -0800
Lines: 21
Message-ID: <mailman.116.1641505563.3079.python-list@python.org>
References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
<87r19kbv3g.fsf@locationd.net>
<17b830d4-d2f9-0a62-41a6-eff38a85c66a@wichmann.us>
<YddjEPaiF9pfLXf7@scrozzle>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de U38a5TPUFBp2yYIgiUUFTACjjuNApEwTSkXii82uD2aA==
Return-Path: <2QdxY4RzWzUUiLuE@potatochowder.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.066
X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; 'explicitly': 0.07;
'-0700,': 0.09; 'received:78': 0.09; 'from:addr:2qdxy4rzwzuuilue':
0.16; 'from:addr:potatochowder.com': 0.16; 'mats': 0.16; 'message-
id:@scrozzle': 0.16; 'received:136.243': 0.16; 'received:www458
.your-server.de': 0.16; 'received:your-server.de': 0.16;
'wichmann': 0.16; 'wrote:': 0.16; 'python': 0.16; "aren't": 0.19;
'to:addr:python-list': 0.20; 'exception': 0.22; 'received:de':
0.23; "i'd": 0.24; 'actual': 0.25; 'space': 0.26; 'received:136':
0.32; 'returning': 0.32; 'unless': 0.32; 'but': 0.32; 'header:In-
Reply-To:1': 0.34; 'errors': 0.36; 'functions': 0.36; "it's":
0.37; 'way': 0.38; 'could': 0.38; 'happen': 0.40; 'something':
0.40; 'should': 0.40; 'pass': 0.64; 'thus': 0.64; 'back': 0.67;
'raised': 0.70; 'subject:get': 0.70; 'success': 0.73;
'charset:iso-8859-1': 0.73; 'easy': 0.74; 'causing': 0.75; 'url-
ip:199/8': 0.84; 'exceptions': 0.84; 'naturally': 0.84;
'subject:skip:A 10': 0.91
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <17b830d4-d2f9-0a62-41a6-eff38a85c66a@wichmann.us>
X-Authenticated-Sender: 2QdxY4RzWzUUiLuE@potatochowder.com
X-Virus-Scanned: Clear (ClamAV 0.103.3/26414/Thu Jan 6 10:26:00 2022)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <YddjEPaiF9pfLXf7@scrozzle>
X-Mailman-Original-References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
<87r19kbv3g.fsf@locationd.net>
<17b830d4-d2f9-0a62-41a6-eff38a85c66a@wichmann.us>
 by: 2QdxY4Rz...@potatochowder.com - Thu, 6 Jan 2022 21:45 UTC

On 2022-01-06 at 14:21:48 -0700,
Mats Wichmann <mats@wichmann.us> wrote:

> And at a more meta level: many functions in the Python world return
> None as an indication that the operation did not succeed. It's useful
> because in many circumstances None is an "out of band" value - one
> that could not happen naturally - and thus returning it provides an
> easy way for the caller to check for success or failure.

Errors should never pass silently.

Unless explicitly silenced.

https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/

Exceptions aren't perfect, but when something fails, I'd much rather
have an exception raised and thrown at me than to get back None. An
exception is immediate,¹ but None often ends up causing trouble far
away¹ from where the actual failure occurred.

¹ in space and in time

Re: AttributeError: 'NoneType' object has no attribute 'get'

<mailman.117.1641515881.3079.python-list@python.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: AttributeError: 'NoneType' object has no attribute 'get'
Date: Fri, 7 Jan 2022 11:37:47 +1100
Lines: 26
Message-ID: <mailman.117.1641515881.3079.python-list@python.org>
References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
<87r19kbv3g.fsf@locationd.net>
<17b830d4-d2f9-0a62-41a6-eff38a85c66a@wichmann.us>
<YddjEPaiF9pfLXf7@scrozzle>
<CAPTjJmp0dX15vR54JXQH6JFciTutg7w4FmFaTL5rubDDPx6UFQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de ArUymoDr/VcSj+uLvxUO0w7lRhUQLai03hJSNYVfgDoQ==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=D1LUmoFr;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.064
X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; '2022': 0.05; 'explicitly':
0.07; '-0700,': 0.09; 'that.': 0.15; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'mats': 0.16; 'pointers': 0.16; 'wichmann': 0.16; 'wrote:': 0.16;
'python': 0.16; 'to:addr:python-list': 0.20; 'fri,': 0.22;
'everyone': 0.32; 'returning': 0.32; 'message-id:@mail.gmail.com':
0.32; 'unless': 0.32; 'but': 0.32; 'same': 0.34; 'header:In-Reply-
To:1': 0.34; 'received:google.com': 0.34; 'definitely': 0.35;
'from:addr:gmail.com': 0.35; 'also,': 0.36; 'errors': 0.36;
'functions': 0.36; "it's": 0.37; 'received:209.85': 0.37; 'way':
0.38; 'could': 0.38; 'received:209': 0.39; 'happen': 0.40;
'should': 0.40; 'pass': 0.64; 'thus': 0.64; 'figures': 0.69;
'subject:get': 0.70; 'success': 0.73; 'easy': 0.74; 'url-
ip:199/8': 0.84; 'dispute': 0.84; 'naturally': 0.84;
'subject:skip:A 10': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=0PqnDv4QAQmEYAR1NaN0LTWMvHCBMMWlNiOBLHHk8jM=;
b=D1LUmoFrKBFfSHfVnY/S8FdzS84l+e3PvYNQ+x7BgOpJcGl4q2mLZBJfRRVcSCy53j
PVl7SORsPUVx2SwznkyYY2V7tAdDwTZQGmUEXzmZewqwyRxWvvjD30Yy852kXgr5mKUX
U9BqScCnKdNhTMNP2gsDs+cZOpR86bMw1s7XkkJKFpistSfM+G4pGtT+ZGaorTHX9qJC
kfHPOBwIQK7dmaNsPnELxiYf5zi4XRENl1+d265QxSIl/qhj4Gk5v6NkSrPsibiGXnI9
YstThiBRRehJTfSH3H4DJ7YlfzZjyA/Zmb7PF+a5n95pj/ow/4dLjnD05gGGxjoz+GWH
cw4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=0PqnDv4QAQmEYAR1NaN0LTWMvHCBMMWlNiOBLHHk8jM=;
b=YFsBSHLkZmJcEC1uz9bTEv3iftRzg8Aq7kV3VyDgP+03vfmfWp07iateAiPZXul1f6
fCufCsgSZ3c0ZVycMkxcJaNbs5O0+3Lnubjn9JXZvxFh59GMpgsTEDu4UP/TwVT6o1O7
n0lKj8YYVVB/dK7qIcT85AcZYi5qLt5I8nXToWW2SUPBNJdcMgRZdTYxsuB0eWST747E
VFOOslHoep4Rws7EMj7MgCRzNDVgQZBnCExmht1SFADpWZzTARjuTCaN+ahkHJTtmVKc
IRIc0JNYnjMrEcjgthIEttGdjbRzS48uFmvyiaJZwtBUbxkRKOdHbjoFdonzAuSC7uIJ
69pw==
X-Gm-Message-State: AOAM531mCbdrBKP4xGNmP6IBZxXJYz5RGWKzvcoE+SKCLGsU4Blc7oTx
k/420VSDm33ixnM68lFqWMzEL0A/G72qDfaOwxQF1OqJ
X-Google-Smtp-Source: ABdhPJxHsx3eXuTHBFc3Dul4kRwicd1QhAl+AdSNlyjnR25LqojaTavpVyN5vM+VcqU9rSiw5xAVVggIWDgkom3hyYU=
X-Received: by 2002:a05:6000:156c:: with SMTP id
12mr51460854wrz.104.1641515878801;
Thu, 06 Jan 2022 16:37:58 -0800 (PST)
In-Reply-To: <YddjEPaiF9pfLXf7@scrozzle>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmp0dX15vR54JXQH6JFciTutg7w4FmFaTL5rubDDPx6UFQ@mail.gmail.com>
X-Mailman-Original-References: <9f86242d-81cf-4deb-b681-ce760aeac69an@googlegroups.com>
<87r19kbv3g.fsf@locationd.net>
<17b830d4-d2f9-0a62-41a6-eff38a85c66a@wichmann.us>
<YddjEPaiF9pfLXf7@scrozzle>
 by: Chris Angelico - Fri, 7 Jan 2022 00:37 UTC

On Fri, Jan 7, 2022 at 8:47 AM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote:
>
> On 2022-01-06 at 14:21:48 -0700,
> Mats Wichmann <mats@wichmann.us> wrote:
>
> > And at a more meta level: many functions in the Python world return
> > None as an indication that the operation did not succeed. It's useful
> > because in many circumstances None is an "out of band" value - one
> > that could not happen naturally - and thus returning it provides an
> > easy way for the caller to check for success or failure.
>
> Errors should never pass silently.
>
> Unless explicitly silenced.
>
> https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/
>

Python is not C, and returning None is not the same as returning a
null pointer. Also, I dispute that null pointers are the
"billion-dollar mistake" described there, but of course, everyone
loves to talk about figures like that.

Returning None is most definitely not a flaw.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor