<> and DeprecationWarning

G

Gerrit Holl

Hi,

the <> inequality test operator has been deprecated for a loooooong time.

Is there a reason that it doesn't trigger a DeprecationWarning?

$ python2.2 -Wall -c "print 0 <> 0"
0
$ python2.3 -Wall -c "print 0 <> 0"
False

Or is the only reason that is has never been implemented?
IANACS, but this doesn't seem very complicated to implement to me...

yours,
Gerrit.
 
W

Wojtek Walczak

Dnia Mon, 20 Oct 2003 12:18:31 +0200, Gerrit Holl napisa³(a):
the <> inequality test operator has been deprecated for a loooooong time.
Who said that?
 
T

Todd Stephens

Gerrit Holl wrote in article
Hi,

the <> inequality test operator has been deprecated for a loooooong time.

Deprecated where? Possibly it is kept for backwards compatability, but it
still works fine in Python 2.3:
False
 
B

Barry Warsaw

Dnia Mon, 20 Oct 2003 12:18:31 +0200, Gerrit Holl napisa³(a):
Who said that?

Well, Guido doesn't like it, but Just does, so that cancels out the Van
Rossum vote <wink>. I'm on Just's side though, but this is about as
religious an argument as Pythoneers get. I'm confident there's no way
<> can be officially deprecated as long as Python 2.x is alive.

-Barry


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iQCVAwUAP5QC0XEjvBPtnXfVAQJbtAP+Jk7p783PUDnclFvYW0h6lddjPENkkBr3
YUbE5DbjNkBG+bDspyX2lNU3z3k60jBlhHKLXEe3wdccysi4adEpGRdFiSM+iUU0
suvcN2Y4FnRXG4t+xKi+qAcoXdU/Qy8EjPddWD7J0Q0PPq2O2yoOgwxUDDYm30dv
ApwafLLHPZ8=
=1J2M
-----END PGP SIGNATURE-----
 
J

Just

Barry Warsaw said:
Well, Guido doesn't like it, but Just does, so that cancels out the Van
Rossum vote <wink>. I'm on Just's side though, but this is about as
religious an argument as Pythoneers get.

I've long since given in, though... I don't like having two ways to
spell one thing any more than the next guy. In the end it's just a
matter of what you're used to, and I'm totally used to != now. (Heck,
you can even find me occasionally indenting with _spaces_, that's how
low I've sunk ;-)
I'm confident there's no way
<> can be officially deprecated as long as Python 2.x is alive.

That's for sure.

Just
 
S

Skip Montanaro

Gerrit> Is there a difference between obsolescent, obsolete and
Gerrit> deprecated?

Yes, but it's sort of like the Eskimos ("arctic native americans"?) having
several different words for "snow". The subtle differences are lost on
people who've never seen snow. ;-)

Dictionary.com (via Google) shows these relevant (and related) definitions:

obsolescent - Being in the process of passing out of use or usefulness;
becoming obsolete. (Also, in a biological sense "gradually
disappearing".

obsolete - No longer in use or outmoded in design, style, or
construction (two definitions).

deprecate - To express disapproval of; deplore, or to belittle;
depreciate.

Of these, deprecate's computer meaning seems to be quite far from it's
using in non-computer English. Further down the page, it shows a couple
more-to-our-needs definitions of deprecate:

Said of a program or feature that is considered obsolescent and in the
process of being phased out, usually in favour of a specified
replacement. Deprecated features can, unfortunately, linger on for many
years. This term appears with distressing frequency in standards
documents when the committees writing the documents realise that large
amounts of extant (and presumably happily working) code depend on the
feature(s) that have passed out of favour. (from The Free On-line
Dictionary of Computing)

Said of a program or feature that is considered obsolescent and in the
process of being phased out, usually in favor of a specified
replacement. Deprecated features can, unfortunately, linger on for many
years. This term appears with distressing frequency in standards
documents when the committees writing the documents realize that large
amounts of extant (and presumably happily working) code depend on the
feature(s) that have passed out of favor. (from the Jargon File)

In the context of discussions about '<>', I think "obsolecent" and
"deprecated" mean roughly the same thing, though "deprecated" suggests a
more formal notion. In Python, if a language feature is deprecated, there
is generally a specified sunset period. As Barry suggests, even though '<>'
is obsolescent, it's likely to be around for a long while.

One might speculate that as 3.0 nears, the last release or two in the 2.x
line might provide a way for programmers to run their code with a __future__
import something like

from __future__ import deprecated_in_3

or if the effect is desired more globally, to specify a --three or -3 flag
on the interpreter command line.

Skip
 
R

Richard Brodie

In the context of discussions about '<>', I think "obsolecent" and
"deprecated" mean roughly the same thing, though "deprecated" suggests a
more formal notion. In Python, if a language feature is deprecated, there
is generally a specified sunset period. As Barry suggests, even though '<>'
is obsolescent, it's likely to be around for a long while.

In Fortran, it's the other way round. Heinous constructs like computed
GOTOs are obsolesecent in Fortran 90 and removed in Fortran 95,
whilst COMMON blocks are merely deprecated.

As you suggest, the subtle distinctions that may exist probably have to give
way to locally accepted usage.
 
L

Lulu of the Lotus-Eaters

|I'm confident there's no way <> can be officially deprecated

Heck, we true believers should be more ambitious: Deprecate the
heretical '!=' pseudo-assignment!
 
B

Barry Warsaw

Now comes the argument over whether _obsolescent_ and _deprecated_ are
synonymous in this context :).

Technically, I'd say they aren't because <> constructs don't generate
deprecation warnings.

-Barry


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iQCVAwUAP5Qve3EjvBPtnXfVAQKqqQP9F8Cssp43inCQT5SG8FKKjBrZQ6kodJZX
D0MTBEtFR/BMnXo5ZRSaTgd16jwKc8c60ZNC48WTIij9pmQB0Qvi/JSHwIrJcI1r
wjfh/B3O6BQXHtiqtJtyMhgt5kdYtJgDo5UKE2TOHjppu3/5zPSmtfDROm6nELBG
wyAtPIi2EsE=
=LwG0
-----END PGP SIGNATURE-----
 
A

Alex Martelli

Barry said:
Technically, I'd say they aren't because <> constructs don't generate
deprecation warnings.

So let's introduce obsolescence warnings...!-)


Alex
 
E

Erik Max Francis

Barry said:
Technically, I'd say they aren't because <> constructs don't generate
deprecation warnings.

I was being semifacetious. In my experience, usually they are used in
different ways. Deprecation is a stricter form of obsolescence.
Obsolescent just means that the feature should no longer be used, since
it has been replaced by superior forms. Deprecated means that an
obsolescent form has actually been marked for future removal. A
deprecated feature can be removed, an obsolescent feature can become
deprecated.
 
B

Barry Warsaw

|I'm confident there's no way <> can be officially deprecated

Heck, we true believers should be more ambitious: Deprecate the
heretical '!=' pseudo-assignment!

Now there's a bold and enlightened Pythoneer! Three cheers!

-Barry


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iQCVAwUAP5Q6BnEjvBPtnXfVAQIW3QP/YfcIce7L8JJ/oWwjbY49wTjUHd2j6lGm
zTwhC3rUs7ISpCkZtt0O0Yj+vOTPmLIgAZopbRu/VGxJo5JMOmigWxxI+f9PEliI
H0Hs/Ly9GDcXntyF71w9rAHK0oOiSgCZttdHeybADcPx/x0bTw+kOD1Q96rhRejT
EXAAk/uAg3Y=
=9DHp
-----END PGP SIGNATURE-----
 
B

Barry Warsaw

So let's introduce obsolescence warnings...!-)

class
SilentPendingMisguidedObsolescenceSuggestion(PendingDeprecationWarning):
pass

:)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iQCVAwUAP5Q6X3EjvBPtnXfVAQJ9mAP/f51+7+eVX3gKDWVifqI3sDM4MNv8Y345
Tk0kvPsqKEYpM60U2DrkVmpVCinkuEQnP+9nBbNye7M/30VRt8VGqbBpNjdNCvSu
mJPjt51kjd4cQaejSHY7/3Kr0Fn8SXHVXvKRcXegadX27ZuFQj2sonsIuRtfWnTm
yk36wyRta4M=
=KW/x
-----END PGP SIGNATURE-----
 
W

Wojtek Walczak

Dnia Mon, 20 Oct 2003 11:44:17 -0400, Barry Warsaw napisa³(a):
Well, Guido doesn't like it, but Just does, so that cancels out the Van
Rossum vote <wink>. I'm on Just's side though, but this is about as
religious an argument as Pythoneers get. I'm confident there's no way
<> can be officially deprecated as long as Python 2.x is alive.

Is there any outline to mark it as deprecated in docs and the code
somewhere between 2.x and 3.0? I know that this is _distant future_,
but we can think about it and maybe vote. I'm on Guido's side not
because I don't like it, but because I think that Python doesn't need
two 'not equal' operators. It reminds me about ruby and its methods
for built-in classes which are doubled in some cases. This is nothing more
than a pollution.
 
D

Dennis Lee Bieber

Skip Montanaro fed this fish to the penguins on Monday 20 October 2003
10:08 am:
Yes, but it's sort of like the Eskimos ("arctic native americans"?)

I believe (but will admit that there is a chance that it is a
localized group) that "Eskimo" has been superceded by "Inuit". (Which,
to most of the US, is probably on par with stating that <> has been
superceded by !=)


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top