Python Forum
2to3 fails on very simple script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2to3 fails on very simple script
#18
(Oct-19-2016, 04:11 PM)sparkz_alot Wrote:
(Oct-19-2016, 03:53 PM)buran Wrote:
(Oct-19-2016, 03:36 PM)sparkz_alot Wrote: Yes, I understand, I was pointing out the the example "print(())" is actually not a tuple

the output, i.e.
Output:
()
IS EXACTLY the string representation of the tuple class (empty tuple instance to be precise)

Logically, one would think so, but Python does not. As shown in my example, Python see it as class 'NoneType', not class 'tuple'

You DO make difference between the type of the argument you pass to the print function and the type of the return value of the function, right? If you don't make that difference, then I don't see how I can explain it better

Output:
>>> type(print('something')) something <class 'NoneType'>
You would not say that 'something' is of NoneType, right?
Reply


Messages In This Thread
2to3 fails on very simple script - by Skaperen - Oct-18-2016, 07:08 AM
RE: 2to3 fails on very simple script - by wavic - Oct-18-2016, 10:14 AM
RE: 2to3 fails on very simple script - by buran - Oct-18-2016, 10:38 AM
RE: 2to3 fails on very simple script - by wavic - Oct-18-2016, 10:46 AM
RE: 2to3 fails on very simple script - by buran - Oct-18-2016, 10:51 AM
RE: 2to3 fails on very simple script - by nilamo - Oct-18-2016, 03:04 PM
RE: 2to3 fails on very simple script - by Skaperen - Oct-19-2016, 04:25 AM
RE: 2to3 fails on very simple script - by snippsat - Oct-19-2016, 04:48 AM
RE: 2to3 fails on very simple script - by Skaperen - Oct-19-2016, 06:51 AM
RE: 2to3 fails on very simple script - by buran - Oct-19-2016, 07:28 AM
RE: 2to3 fails on very simple script - by wavic - Oct-19-2016, 10:17 AM
RE: 2to3 fails on very simple script - by buran - Oct-19-2016, 12:56 PM
RE: 2to3 fails on very simple script - by buran - Oct-19-2016, 03:23 PM
RE: 2to3 fails on very simple script - by buran - Oct-19-2016, 03:53 PM
RE: 2to3 fails on very simple script - by buran - Oct-19-2016, 04:15 PM
RE: 2to3 fails on very simple script - by Yoriz - Oct-19-2016, 04:55 PM
RE: 2to3 fails on very simple script - by snippsat - Oct-19-2016, 07:35 PM
RE: 2to3 fails on very simple script - by Skaperen - Oct-20-2016, 02:04 AM
RE: 2to3 fails on very simple script - by snippsat - Oct-20-2016, 08:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Python script, path not defined dubinaone 3 2,837 Nov-06-2021, 07:36 PM
Last Post: snippsat
  Need help creating a simple script Nonameface 12 4,882 Jul-14-2020, 02:10 PM
Last Post: BitPythoner
  Python 3.6.10 fails when running a localized script. Mikee 2 2,253 Jul-09-2020, 10:25 PM
Last Post: Mikee
  Simple text to binary python script gmills13 2 2,918 Feb-04-2020, 08:44 PM
Last Post: snippsat
  python script fails with a lot of data bluethundr 2 2,265 Nov-11-2019, 01:35 PM
Last Post: bluethundr
  Made a simple script for android (really simple) but it is not running anddontyoucomebacknomore 2 2,490 Mar-06-2019, 12:19 AM
Last Post: anddontyoucomebacknomore
  How to use 2to3.py converter under Windows OS samsonite 2 7,475 Mar-02-2019, 05:49 AM
Last Post: samsonite
  Confusing output from 2to3 about what files need change Moonwatcher 1 4,933 Dec-30-2018, 04:07 PM
Last Post: Gribouillis
  Error during 2to3 conversion krow4869 3 4,101 Oct-14-2018, 08:19 AM
Last Post: Larz60+
  Simple script that seems to misbehave? Nwb 1 2,436 Jun-10-2018, 05:30 AM
Last Post: Nwb

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020