473,769 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Misleading wikipedia article on Python 3?

I'm surprised to read this:

http://en.wikipedia.org/wiki/Python_3

"""Note that while there is no explicit requirement that code be able
to run unmodified in both versions, in practice it is quite likely for
most code. As of January 2007, it looks like most reasonable code
should run quite well under either branch."""
I haven't been following Python 3 development recently. Have things
really changed that much? Last time I looked, e.g. dict.items() no
longer returned a list. Seems unlikely that most code will run on 2
and 3, in that case, and IIUC Guido has said all along that not much
code will run on both.

Maybe somebody who's following current Py3k goings-on can fix the
article if needed...
John
Aug 5 '07
27 1515
On 6 Aug, 12:11, Paul Rubin <http://phr...@NOSPAM.i nvalidwrote:
Carsten Haese <cars...@uniqsy s.comwrites:
For instance, if you never use print statements in your code, you won't
notice that print is becoming a function. If you do, you'll have to make
appropriate accommodations.

Why on earth did they make this change? It just seems gratuitous. Is
the assert statement also being changed? Are they going to update all
the docs that say that the yield statement works like the print statement?
Indeed: practicality beats purity [1]. Uh, wait a moment!

Paul

[1] http://www.python.org/dev/culture/

Aug 6 '07 #11
Carsten Haese <ca*****@uniqsy s.comwrites:
On Sun, 2007-08-05 at 23:09 +0000, John J. Lee wrote:
>I just wanted to know: is it easy to make my code so it
runs on 2.6 and 3.0, without funny stuff like a code translator?

That depends on your definitions of "easy" and "funny stuff." I'm pretty
sure you'll be able to run the same source code on Python 2.6 and Python
3.0 without either one breaking, as long as the code is written
sufficiently carefully. You may have to give up some Python 3.0 features
and/or write compatibility shims depending on what features you'll need.
Whether that's acceptable depends on the features you need and how much
"yak shaving" you find acceptable.
[...]

If I had wanted to start analysing requirements for some specific
project, I'd have gone and done that!-) I was actually interested in
the general case (all existing projects), as perhaps you'll see if you
read my original post (my followup question you quote above was
deliberately blunt for rhetorical let's-move-this-discussion-along
purposes -- <sighhonestly , these literal-minded programmer types,
what CAN you do with them?-).

Do you *really* think that projects will fall 50-50 into the "yes" and
"no" camps, as you seem to imply -- after all, if you thought that one
case was more common, why wouldn't you mention which it was?

(where "yes" == "feasible to keep a single source code working in both
2.6 and 3.0", and of course it's taken as read that you can do the
generalisation to the -- I hope -- obvious continuum of cases
"between" "yes" and "no" without our needing to tiresomely spell it
out here)

I'll also add that previous comments from Guido have implied (to my
reading, admittedly without studying them like biblical texts) that
the great majority of projects will/should fall pretty squarely, in
his judgement, into the "no" camp -- i.e. NOT practical to keep 2.6
and 3.0 comptibility from a single source code without use of a
translation tool. Does your "pretty sure"-ness stem from 1) a
knowledge of how 3.0 will look when it's done, 2) experience of
playing with the Py3k project as it is right now or 3) other? What
sort of frequencies does your understanding of Py3k predict for the
"yes" and "no" cases? By all means "use your skill and judgement" in
answering, rather than asking for clarification -- since that would
rather defeat the point of the question.
John
Aug 7 '07 #12
Do you *really* think that projects will fall 50-50 into the "yes" and
"no" camps, as you seem to imply -- after all, if you thought that one
case was more common, why wouldn't you mention which it was?
I know you didn't ask me this time, but I answer anyway: I don't know.

I *really* think that only experience can tell, and that any kind of
prediction on that matter is futile FUD (as FUD, it might be successful,
of course). I do so using all my skill and judgment. Only when people
actually start to try porting, list specific issues that they actually
ran into (rather than listing issues they anticipate to run into),
only then I can make guesses as to what the common case will be.

Ask this question a year from now again.

Regards,
Martin
Aug 7 '07 #13
"Martin v. Löwis" <ma****@v.loewi s.dewrites:
>Do you *really* think that projects will fall 50-50 into the "yes" and
"no" camps, as you seem to imply -- after all, if you thought that one
case was more common, why wouldn't you mention which it was?

I know you didn't ask me this time, but I answer anyway: I don't know.

I *really* think that only experience can tell, and that any kind of
prediction on that matter is futile FUD (as FUD, it might be successful,
of course). I do so using all my skill and judgment. Only when people
actually start to try porting, list specific issues that they actually
ran into (rather than listing issues they anticipate to run into),
only then I can make guesses as to what the common case will be.
[...]

By this criterion, Guido himself is engaging in FUD, as near as I can
tell (of course, I don't believe he is doing that; I also can't
believe that the effective requirements for the project are quite as
decoupled from source compatibility considerations as has sometimes
been implied by some of those working on the project).
John
Aug 7 '07 #14
On Aug 6, 6:49 am, Neil Cerutti <horp...@yahoo. comwrote:
Incidentally, from the second link I find it shocking that the
keyword parameter "file" shadows a builtin. It seems to endorse a
bad practice.
I believe that the "file" builtin has been removed as well so it won't
shadow anything.

i.

Aug 8 '07 #15
On Aug 6, 6:11 am, Paul Rubin <http://phr...@NOSPAM.i nvalidwrote:
Why on earth did they make this change? It just seems gratuitous.
Having print a function (with parameters) makes is very easy to modify
where the output goes.

Say you want to have some prints go to one particular file, today you
cannot easily do it, you have to either do a regex based search/
replace or fiddle with the sys.stdout etc. both have substantial
drawbacks.

A solution would be writing the code with a logging function to begin
with, alas many times that is out of one's hand. I wished print was a
function great many times. I bet Guido has had similar experiences,
note that attempt to keep print in the current form but have it print
to a file ... with that crazy syntax, print >>f, ... alas that did not
solve anything

It is time to fix it for good.

i.
Aug 8 '07 #16
On 8 Aug, 16:26, Istvan Albert <istvan.alb...@ gmail.comwrote:
On Aug 6, 6:11 am, Paul Rubin <http://phr...@NOSPAM.i nvalidwrote:
Why on earth did they make this change? It just seems gratuitous.

Having print a function (with parameters) makes is very easy to modify
where the output goes.
I'm not arguing with this.
Say you want to have some prints go to one particular file, today you
cannot easily do it, you have to either do a regex based search/
replace or fiddle with the sys.stdout etc. both have substantial
drawbacks.
Well, you could find all print statements reliably using various
parsing solutions provided with Python. It's interesting that for this
reason, migrating from the print statement is not particularly
difficult whereas identifying invocations of the upcoming print built-
in function will not be a trivial task. I'm not passing judgement on
the introduction of the print function here, but I find such
properties of the language very interesting - it's not too far removed
from the static typing debate or people's fascination with making
domain-specific languages.
A solution would be writing the code with a logging function to begin
with, alas many times that is out of one's hand. I wished print was a
function great many times. I bet Guido has had similar experiences,
note that attempt to keep print in the current form but have it print
to a file ... with that crazy syntax, print >>f, ... alas that did not
solve anything
Yes, print >>f is a bit of a hack which I must admit to using
occasionally. However, for every enthusiast of one approach, there
will always be an enthusiast for another (see point #6):

http://mechanicalcat.net/cgi-bin/log...#anti-pitfalls
It is time to fix it for good.
Well, it has always been possible to use a logging function, just not
one called "print" exactly.

Paul

Aug 8 '07 #17
On Aug 8, 12:08 pm, Paul Boddie <p...@boddie.or g.ukwrote:
However, for every enthusiast of one approach, there
will always be an enthusiast for another (see point #6):
True.

For example I for one also like the way the current print adds a
newline, the vast majority of the time that is exactly what I want. I
don't know if this will be kept when print becomes a function (might
be that some default parameters make it work the same way)

Which reminds me of an experience I had when I originally learned how
to program in Pascal, then moved on to C. At first it felt wrong that
I had to include the "\n" to print a new line at the end, seemed
unreadable (Pascal had separate functions: write and a writeln for
it). Today I'd consider it appallingly bad design to have separate
functions for such a small difference.

i.

Aug 8 '07 #18
On 2007-08-08, Istvan Albert <is***********@ gmail.comwrote:
On Aug 6, 6:49 am, Neil Cerutti <horp...@yahoo. comwrote:
>Incidentally , from the second link I find it shocking that the
keyword parameter "file" shadows a builtin. It seems to
endorse a bad practice.

I believe that the "file" builtin has been removed as well so
it won't shadow anything.
I can't find any evidence of that in the PEPs. Do you have a
reference?

I thought, in fact, that open was on more shaky ground. ;)

--
Neil Cerutti
Aug 8 '07 #19
On Aug 8, 2:00 pm, Neil Cerutti <horp...@yahoo. comwrote:
I thought, in fact, that open was on more shaky ground. ;)
yeah, that too ...
I can't find any evidence of that in the PEPs. Do you have a reference?
here is something:

http://svn.python.org/view/python/br...6685&view=auto

look for :

- Removed these Python builtins:
apply(), callable(), coerce(), file(), reduce(), reload()

i.

Aug 8 '07 #20

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

Similar topics

0
1161
by: Laurence Parry | last post by:
Some people over on Wikipedia seem to have the idea that VB.NET is not a major programming language: http://en.wikipedia.org/wiki/Template_talk:Major_programming_languages_small#Visual_Basic_.NET I think they're wrong. But I had to agree with what one guy said - the general view in the geeky programming community is that VB.NET is a poor brother to C#; some still think it's just a slightly improved version of VB! I don't think this will...
24
2380
by: Luis M. González | last post by:
For those interested in the simplest, easiest and most pythonic web framework out there, there's a new page in Wikipedia: http://en.wikipedia.org/wiki/Karrigell
9
4963
by: AES | last post by:
I fairly often make PDF copies of web pages or sites by copying the web page link from the web page itself and pasting it into the Acrobat 7.0 Standard "Create PDF From Web Page" command. (Not trying to steal material; usually just want to make a temporary copy to read offline, e.g. on a plane flight.) This almost always works remarkably well, but when I tried it recently with a Wikipedia article
8
2131
by: Claudio Grondi | last post by:
Here an example of what I mean (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte large file): Traceback (most recent call last): File "<pyshell#1>", line 1, in -toplevel- f = file('veryBigFile.dat','r+') IOError: No such file or directory: 'veryBigFile.dat'
7
1419
by: Pitaridis Aristotelis | last post by:
There is a free encyclopedia called wikipedia (http://wikimediafoundation.org/). Does anyone knows how to use it in order to get various articles for diplaying them in my application?
5
7669
by: jkn | last post by:
Hi all Python 2.4.2 (#1, Apr 26 2006, 23:35:31) on linux2 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "<stdin>", line 1, in ? IOError: invalid mode: a
11
2318
by: Paddy | last post by:
I just had a link to Tim peters first post on doctest: http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763 removed from http://en.wikipedia.org/wiki/Doctest as it doesn't fit their guidelines for external links. I wonder, could maybe the official website be persuaded to host a copy so that it could be linked to? Tim, would you object? - Paddy.
2
2626
by: John Nagle | last post by:
For some reason, Python's parser for "robots.txt" files doesn't like Wikipedia's "robots.txt" file: False The Wikipedia robots.txt file passes robots.txt validation, and it doesn't disallow unknown browsers. But the Python parser doesn't see it that way. No matter what user agent or URL is specified; for that robots.txt file, the only answer is "False". It's failing in Python 2.4 on Windows and 2.5 on Fedora Core.
13
2464
by: Paddy | last post by:
I would value the opinion of fellow Pythoneers who have also contributed to Wikipedia, on the issue of "Is Python Standardized". Specifically in the context of this table: http://en.wikipedia.org/wiki/Comparison_of_programming_languages#General_comparison (Comparison of programming languages) And this entry in the talk page http://en.wikipedia.org/wiki/Talk:Comparison_of_programming_languages#Standardized_Python.3F (Talk:Comparison of...
0
9423
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
10211
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
10045
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
9994
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,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
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
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.