Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #111513
| Path | csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Gerald Britton <gerald.britton@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | re: Operator Precedence/Boolean Logic |
| Date | Sat, 16 Jul 2016 09:58:31 -0400 |
| Lines | 64 |
| Message-ID | <mailman.34.1468677515.2307.python-list@python.org> (permalink) |
| References | <CAPxRSnZX-x7ZpBYJrYtGiRDiBL9dRqmhZWLM5n=jD4mvREaYUw@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | news.uni-berlin.de dlmt2AQTgTSijY2k0prPWQq4AJsVC6E3GfQRyi98sWDQ== |
| Return-Path | <gerald.britton@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.009 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'operator': 0.03; 'europython': 0.04; 'url:pipermail': 0.05; 'false.': 0.07; 'override': 0.07; 'logic': 0.09; 'objects.': 0.09; 'thread': 0.10; 'boolean': 0.16; 'non-empty': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sure.': 0.16; 'url:subject': 0.16; 'url:thread': 0.16; 'else,': 0.18; "shouldn't": 0.18; '>': 0.18; 'recruiting': 0.18; '(by': 0.22; 'default,': 0.22; 'all.': 0.24; 'define': 0.27; 'message-id:@mail.gmail.com': 0.27; 'object,': 0.27; 'objects': 0.29; 'subject:/': 0.30; 'url:wiki': 0.30; 'url:mailman': 0.30; "i'd": 0.31; 'skip:- 30': 0.32; 'maybe': 0.33; 'useful': 0.33; 'url:python': 0.33; 'url:listinfo': 0.34; 'members.': 0.34; 'previous': 0.34; 'list': 0.34; 'skip:& 20': 0.35; 'received:google.com': 0.35; 'next': 0.35; 'something': 0.35; 'should': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'say': 0.37; 'presence': 0.38; 'mailing': 0.38; 'why': 0.39; 'url:en': 0.39; 'url:in': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'easy': 0.60; 'default': 0.61; 'more': 0.63; 'information': 0.63; 'linkedin': 0.66; 'python-list': 0.66; 'said:': 0.66; 'subject': 0.70; 'special': 0.73; 'hand': 0.82; '>how': 0.84; 'answer,': 0.84; 'serious': 0.97 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=5DOkxpSl9N+FLD1pEeg30BP4EKTFCbnA3BaD1CciwEs=; b=Ndi7HFUcenPWnOxk60w1t6WbfuPxiqLlu6lhCSyzWrgVCRq6syDzyKPfa+Ra1elFRS d0bACmqU1mDqaWXMpEftP2oVK8xPOwPwFzoks9zTaZ3nrSbNSRkM6ST4BkotX3PLyUG9 iOt9VJ3IXRJN/AsypiUpNMr8mOAxVVHBmxlh9UcwDzVRsNz73NpRn9GuDRR3U65LOO/N wA3uaeeIxEol79l3KIP3mWM/u54+6aN3HPrDaYR6GjwYXIyowSUqLljFmBO5WVLGnWEt YnhSkzwNEwlcJ3UL8n/+Z0RWlJNYdPI4HUZ4Auzi8MnXKSbWZd0tlTVYiKhOp7KVborG AEyA== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5DOkxpSl9N+FLD1pEeg30BP4EKTFCbnA3BaD1CciwEs=; b=YkBpTm4q7Kdv3+jwmV1thqF5dJBD74XYjjZpYXnI7UMDvQx7a6RtDrI8XtqtQnq1nS hCMfgH5w0PeJe7befLZwVKvQoK0/Ads+2bxZEPl0RujbJYgqOnpbqT4Wp3bgxJFFNTPu ZzHH0lMtRNyf8okSKL8sQOYIxIsDm50vFX8GA+H7vBeEXTRolEhMlBzr8LKWSaR3DZDQ 40qCT7GgtaA0VvLDMSxX3suIAgHOVNheFUiwflGMRBf8XaqvMqdqlP/Dax4WMfs4BzPH qJyihiRmZawz1ua5CLt46Fpdr4AUY8IdTzMPPitfYhnQr6KDKN5tGt0kDag8n3hOJQyk xY1Q== |
| X-Gm-Message-State | ALyK8tJLJF7OSTs/WC5gENqBFXsgmzRFh3/JXI6Nv+2Id1IjGmq5DlLI3me0wMoqgD84cYUOwkQpz09QqMtvrg== |
| X-Received | by 10.107.46.198 with SMTP id u67mr29443732iou.122.1468677511845; Sat, 16 Jul 2016 06:58:31 -0700 (PDT) |
| X-Content-Filtered-By | Mailman/MimeDel 2.1.22 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.22 |
| 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 | <http://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 | <CAPxRSnZX-x7ZpBYJrYtGiRDiBL9dRqmhZWLM5n=jD4mvREaYUw@mail.gmail.com> |
| Xref | csiph.com comp.lang.python:111513 |
Show key headers only | View raw
>Earlier you said:
>* > 1. Graphs -- the kind mathematicians define with "Let G =(V,E) be a
*>* > graph..."
*> >* I would make the empty graph (zero nodes) falsey, and non-empty
graphs (one
*>* or more nodes) truthy.
*> > >* > 2. Automata which in a way are special kinds of graphs
*> >* As above.
*
>Now you say:
>* > If on the other hand you are giving that “return True”as a serious useful
*>* > definition?
*> >* Sure. An automata is an object, and by default, all objects are
"something"
*>* and hence truthy. That's the "no-brainer" answer, it requires no
*>* justification at all. If you think the answer should be something else,
*>* *that* is what needs justification. Why shouldn't it be truthy?
*
>How do we put these two together>
easy peasy: lists, tuples, dicts etc are also objects. They define
their truthiness by the presence of members. An empty list has a
boolean value of false.
for a custom object, you can accept the default boolean value of true
or override __bool__ so that it returns what you want. So for a graph
G, I'd say if |V| = |E| = 0, G has a boolean value of false.
Maybe thusly?https://en.wikibooks.org/wiki/Sufism/Nasrudin#Of_any_two_options_choose_the_third
------------------------------
- Previous message (by thread): Operator Precedence/Boolean Logic
<https://mail.python.org/pipermail/python-list/2016-July/711778.html>
- Next message (by thread): EuroPython 2016: Recruiting Offers
<https://mail.python.org/pipermail/python-list/2016-July/711769.html>
- *Messages sorted by:* [ date ]
<https://mail.python.org/pipermail/python-list/2016-July/date.html#711777>
[ thread ]
<https://mail.python.org/pipermail/python-list/2016-July/thread.html#711777>
[ subject ]
<https://mail.python.org/pipermail/python-list/2016-July/subject.html#711777>
[ author ]
<https://mail.python.org/pipermail/python-list/2016-July/author.html#711777>
------------------------------
More information about the Python-list mailing list
<https://mail.python.org/mailman/listinfo/python-list>
--
Gerald Britton, MCSE-DP, MVP
LinkedIn Profile: http://ca.linkedin.com/in/geraldbritton
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
re: Operator Precedence/Boolean Logic Gerald Britton <gerald.britton@gmail.com> - 2016-07-16 09:58 -0400
csiph-web