473,698 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

that is it is not it (logic in Python)

I want to know if iter(iterator) returns always its argument (when
argument is an iterator)

So :
iterable = range(10)
it = iter(iterable)
that = iter(it)
that is it True # Good! that is it is not it False # What ?
Python = map(bool, it)
logic = True
logic in Python is not it True # That was close!
that is it or it is not it True
# from physics.constan t import N
N = 6.02e+27
big = 192 # cm 1.92 meter is big for me (see my name)
N is big False # what ?


--
Seriously on an April fool's day.
Jul 18 '05 #1
6 1787

"F. Petitjean" <li***********@ news.proxad.net > wrote in message
news:42******** **************@ news.free.fr...
I want to know if iter(iterator) returns always its argument (when
argument is an iterator)
By the strict definition of iterator (versus iterable) that requires that
as a condition to be an iterator, then yes. If you use a looser definition
of iterator, then perhaps not.
iterable = range(10)
it = iter(iterable)
that = iter(it)
that is it True # Good! that is it is not it


This is equivalent to '(that is it) and (it is not it)' which is clearly
false.
False # What ?


Reread the ref manual on chained comparison operators.

Terry J. Reedy

Jul 18 '05 #2
Le Fri, 1 Apr 2005 13:39:47 -0500, Terry Reedy a écrit :

"F. Petitjean" <li***********@ news.proxad.net > wrote in message
news:42******** **************@ news.free.fr...
> iterable = range(10)
> it = iter(iterable)
> that = iter(it)
> that is it True # Good!
> that is it is not it


This is equivalent to '(that is it) and (it is not it)' which is clearly
false.
False # What ?


Reread the ref manual on chained comparison operators.

And see the date of the post :-)
that is it isn't it ?
Terry J. Reedy

Jul 18 '05 #3
On Fri, 01 Apr 2005 22:01:25 +0000, F. Petitjean wrote:
Le Fri, 1 Apr 2005 13:39:47 -0500, Terry Reedy a écrit :
This is equivalent to '(that is it) and (it is not it)' which is clearly
false.
False # What ?


Reread the ref manual on chained comparison operators.


And see the date of the post :-)
that is it isn't it ?


Nope, nothing to do with it. Read the ref manual on chained comparision
operators.

http://www.python.org/doc/2.4/ref/co...s.html#l2h-430

For proof, run the given code in the original post. It's not faked in the
slightest, and the manual holds the key to understanding.
Jul 18 '05 #4
Le Fri, 01 Apr 2005 17:42:30 -0500, Jeremy Bowers a écrit :
On Fri, 01 Apr 2005 22:01:25 +0000, F. Petitjean wrote:
Le Fri, 1 Apr 2005 13:39:47 -0500, Terry Reedy a écrit :
This is equivalent to '(that is it) and (it is not it)' which is clearly
false.

False # What ?

Reread the ref manual on chained comparison operators.


And see the date of the post :-)
that is it isn't it ?


Nope, nothing to do with it. Read the ref manual on chained comparision
operators.

http://www.python.org/doc/2.4/ref/co...s.html#l2h-430

For proof, run the given code in the original post. It's not faked in the
slightest, and the manual holds the key to understanding.

*I* wrote the original post. and am pretty sure it is not faked. And I
run it before posting to be sure not to say anything wrong. it is a kind
of relief to learn that computers in 2005 (even Python powered) are
humor-impaired and follow the « ref manual » every time even on first
April.
There = True
Python = map(bool, range(5))
logic = True
There is logic in Python

True # naturally
Jul 18 '05 #5

"F. Petitjean" <li***********@ news.proxad.net > wrote in message
news:42******** *************** @news.free.fr.. .
Le Fri, 1 Apr 2005 13:39:47 -0500, Terry Reedy a écrit :
Reread the ref manual on chained comparison operators.
And see the date of the post :-)


Ditto for the reply ;-)

TJR

Jul 18 '05 #6
F. Petitjean wrote:
[...]

*I* wrote the original post. and am pretty sure it is not faked. And I
run it before posting to be sure not to say anything wrong. it is a kind
of relief to learn that computers in 2005 (even Python powered) are
humor-impaired and follow the « ref manual » every time even on first
April.
But you also wrote in your original post:
Seriously on an April fool's day.


which would seem to be falsely denying that your post was an April
Fool's prank. Rather bad form, old chap ;-)

regards
Steve
--
Steve Holden +1 703 861 4237 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/

Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4044
by: BBands | last post by:
Does anyone know of any fuzzy logic work done in Python? The only thing I have found is logic.py, which has gone missing from the Vaults of Parnassus and the original site, http://www.ourobourus.com/logic.py. --jab
3
1484
by: | last post by:
I am new to python and I am not in computer science. In fact I am a biologist and I ma trying to learn python. So if someone can help me, I will appreciate it. Thanks #!/cbi/prg/python/current/bin/python # -*- coding: iso-8859-1 -*- import sys import os from progadn import *
22
1946
by: James H. | last post by:
Greetings! I'm new to Python and am struggling a little with "and" and "or" logic in Python. Since Python always ends up returning a value and this is a little different from C, the language I understand best (i.e. C returns non-zero as true, and zero as false), is there anything I should be aware of given Python's different approach? Namely any pitfalls or neat tricks that make the Python approach cool or save my butt. Thank you!
0
1906
by: Wim Vanhoof | last post by:
----------------------------------------------------------- WLPE' 06 - CALL FOR PAPERS Workshop on Logic-based Methods in Programming Environments (satellite workshop of ICLP’06) August 16, 2006
1
1660
by: MaR | last post by:
Yes! The question rears its head once again! ;o) I have done some search and trial and horrors.. (PyLog has vanished?) But I fail to find anything useful when it comes to do Logic Programming (e.g. Prolog'ish) in the context of Python. And yes, I tend to beleive that I need to! No, I do not really like the idea of piping def's and queries to SWI-prolog ála PyProlog.
25
1776
by: Rehceb Rotkiv | last post by:
Hello everyone, I'm using Linux since quite a while now and I'm happy to notice that I'm beginning to "know my way round". I can write little bash, sed and awk scripts to help me with my everyday tasks and I've also had a thorough look at Python, which is ideally suited for helping me with my work, which is linguistic research, i.e. mainly text processing. However, this does not seem to be of much use in understanding and modifying...
5
3277
by: felciano | last post by:
Hello -- Is there a convention, library or Pythonic idiom for performing lightweight relational operations on flatfiles? I frequently find myself writing code to do simple SQL-like operations between flat files, such as appending columns from one file to another, linked through a common id. For example, take a list of addresses and append a 'district' field by looking up a congressional district from a second file that maps zip codes to...
2
1223
by: rohitsharma1980 | last post by:
hi , i am new to Python. I am trying to make a script to stimulate virtual users. But i am getting some errors while doing so...can some one help me in this. the error is NameError: random at org.python.core.Py.NameError(Py.java)
15
2392
by: erik.oosterwaal | last post by:
Hi All, I have been developing websites in classic asp using VB script for a long while now. Due to the fact that I also took a detour to developing ColdFusion, and the fact the companies I work(ed) for never had time or money for courses, I am now in the awkward position that I am -still- developing classic ASP. In it, I have become quite resourceful, I wrote a framework using WSC (windows scripting components) to separate logic from...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.