Re: Python is DOOMED! Again!

2015-01-27 Thread Chris Angelico
On Tue, Jan 27, 2015 at 5:36 PM, Steven D'Aprano wrote: > I consider return type to be part of the function signature. The signature > of a function is the parameters it accepts and the result it returns. It is, but there are times when it isn't significant. For instance, C++ overloaded functions

Re: Python is DOOMED! Again!

2015-01-27 Thread Steven D'Aprano
Chris Angelico wrote: > On Tue, Jan 27, 2015 at 5:36 PM, Steven D'Aprano > wrote: >> I consider return type to be part of the function signature. The >> signature of a function is the parameters it accepts and the result it >> returns. > > It is, but there are times when it isn't significant. Fo

Re: Running a .py file iteratively at the terminal

2015-01-27 Thread Philip Keogh
On Mon, 26 Jan 2015, varun...@gmail.com wrote: > Thanks a lot Mark but that would be a bit trivial. How can I run the > same file multiple times? Or if I need to run two commands: > srva@hades:~$ python NFV_nw_eu_v3_14_1_15.py --output eu_v3_14_1_15 > --demand demands_v3_21_1_15.xml --xml nobel-eu.

Re: Fwd: Re: Comparisons and sorting of a numeric class....

2015-01-27 Thread Andrew Robinson
On 01/26/2015 02:22 PM, Ian Kelly wrote: On Jan 26, 2015 6:42 AM, "Andrew Robinson" > wrote: > ... If you're going to descend into insults and name-calling, then I'm not going to waste any more of my time on this thread. I don't believe I've actually, int

aging Products And skin care products

2015-01-27 Thread morristurnies
Belladerm all your skin's brands Skin Care Tips products. You will likely realize that these items are mostly filled up with chemicals and dysfunctional water-content. Using compounds to your skin could worsen it and make it dried or cause it make oils to compensate for the dryness. These products

Re: Fwd: Re: Comparisons and sorting of a numeric class....

2015-01-27 Thread Gregory Ewing
Andrew Robinson wrote: The spelling caveat is great -- and in Python the object named in bool's honor is spelled bool (lowercase too). ;) That doesn't change the fact that the man was called George Boole (not Charles!). If you're going to refer to him by name, it's only courteous to make some

ANN: JuliaBase -- LIMS for specimen-based research published as open source

2015-01-27 Thread Torsten Bronger
We are proud to announce that our in-house samples database solution is now published as open source software (AGPL). It is a Python/Django-based framework for creating Web databases for samples. So far, it is used successfully by four in-house departments. For all the details and a demo, visit

Re: Idiomatic backtracking in Python

2015-01-27 Thread sjmsoft
On Sunday, January 25, 2015 at 4:15:58 PM UTC-4, Johannes Bauer wrote: > Hi folks, > > I have a problem at hand that needs code for backtracking as a solution. > And I have no problem coding it, but I can't get rid of the feeling that > I'm always solving backtracking problems in a non-Pythonic >

Is there a more elegant way to spell this?

2015-01-27 Thread Neal Becker
Is there a more elegant way to spell this? for x in [_ for _ in seq if some_predicate]: -- -- Those who don't understand recursion are doomed to repeat it -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Chris Warrick
On Jan 27, 2015 2:16 PM, "Neal Becker" wrote: > > Is there a more elegant way to spell this? > > for x in [_ for _ in seq if some_predicate]: for x in seq: if some_predicate: do_something_to(x) -- Chris Warrick Sent from my Galaxy S3. -- https://mail.pyt

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Jean-Michel Pichavant
- Original Message - > From: "Neal Becker" > To: python-list@python.org > Sent: Tuesday, 27 January, 2015 2:15:12 PM > Subject: Is there a more elegant way to spell this? > > Is there a more elegant way to spell this? > > for x in [_ for _ in seq if some_predicate]: You could use a gene

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Rustom Mody
On Tuesday, January 27, 2015 at 6:45:41 PM UTC+5:30, Neal Becker wrote: > Is there a more elegant way to spell this? > > for x in [_ for _ in seq if some_predicate]: Depends on what follows the ':' In the trivial case all thats outside the comprehension can be dropped: >>> [x for x in [y for y

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Jussi Piitulainen
Neal Becker writes: > Is there a more elegant way to spell this? > > for x in [_ for _ in seq if some_predicate]: If you mean some_predicate(_), then possibly this. for x in filter(some_predicate, seq): handle(x) If you mean literally some_predicate, then perhaps this. if some_predicate:

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Neal Becker
Jussi Piitulainen wrote: > Neal Becker writes: > >> Is there a more elegant way to spell this? >> >> for x in [_ for _ in seq if some_predicate]: > > If you mean some_predicate(_), then possibly this. > > for x in filter(some_predicate, seq): >handle(x) > I like this best, except probabl

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Jussi Piitulainen
Neal Becker writes: > Jussi Piitulainen wrote: > > Neal Becker writes: > > > >> Is there a more elegant way to spell this? > >> > >> for x in [_ for _ in seq if some_predicate]: > > > > If you mean some_predicate(_), then possibly this. > > > > for x in filter(some_predicate, seq): > >handl

kivy: python on android

2015-01-27 Thread Rustom Mody
Following some posts here I thought I'd try python on android via kivy. Followed the tutorials -- involved a couple of GBs(!!) of downloads using something called buildozer Finally got a hello world running on a phone -- Yay! Now when I try to go from hello world to something a more (kivy-exampl

Re: unicode question

2015-01-27 Thread random832
On Tue, Jan 27, 2015, at 00:17, Rehab Habeeb wrote: > Hi there python staff > does python support arabic language for texts ? and what to do if it > support it? > i wrote hello in Arabic using codeskulptor and the powershell just for > testing and the same error appeared( a sytanx error in unicode)

Re: unicode question

2015-01-27 Thread Mark Lawrence
On 27/01/2015 16:13, random...@fastmail.us wrote: On Tue, Jan 27, 2015, at 00:17, Rehab Habeeb wrote: Hi there python staff does python support arabic language for texts ? and what to do if it support it? i wrote hello in Arabic using codeskulptor and the powershell just for testing and the same

Re: Python is DOOMED! Again!

2015-01-27 Thread random832
On Tue, Jan 27, 2015, at 01:36, Steven D'Aprano wrote: > I consider return type to be part of the function signature. The > signature > of a function is the parameters it accepts and the result it returns. It's part of it, but not the whole of it, and early C compilers had no information about th

Re: Python is DOOMED! Again!

2015-01-27 Thread random832
On Mon, Jan 26, 2015, at 19:11, Steven D'Aprano wrote: > > (header files in the 1970s didn't even actually include function > > signature information) - which did not even participate in compilation > > at all. > > If C compilers didn't use the header files, what were they for? My sentence may ha

Re: Python is DOOMED! Again!

2015-01-27 Thread random832
On Mon, Jan 26, 2015, at 19:11, Steven D'Aprano wrote: > random...@fastmail.us wrote: > - lexical analysis has to look for twice as many files (it has to > hit the hard drive for a stub file before looking at the source), > and we know from importing that file system access is a > significa

Re: Python is DOOMED! Again!

2015-01-27 Thread Mark Lawrence
On 27/01/2015 17:26, random...@fastmail.us wrote: On Tue, Jan 27, 2015, at 01:36, Steven D'Aprano wrote: I consider return type to be part of the function signature. The signature of a function is the parameters it accepts and the result it returns. It's part of it, but not the whole of it, an

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Rob Gaddi
On Tue, 27 Jan 2015 14:20:10 +0100 Chris Warrick wrote: > On Jan 27, 2015 2:16 PM, "Neal Becker" wrote: > > > > Is there a more elegant way to spell this? > > > > for x in [_ for _ in seq if some_predicate]: > > for x in seq: > if some_predicate: > do_something_to(x) > > -- > Chri

Re: Python is DOOMED! Again!

2015-01-27 Thread Mario Figueiredo
In article , random...@fastmail.us says... > > On Mon, Jan 26, 2015, at 19:11, Steven D'Aprano wrote: > > random...@fastmail.us wrote: > > - lexical analysis has to look for twice as many files (it has to > > hit the hard drive for a stub file before looking at the source), > > and we know f

Re: unicode question

2015-01-27 Thread random832
On Tue, Jan 27, 2015, at 12:25, Mark Lawrence wrote: > People might find this http://bugs.python.org/issue1602 and hence this > https://github.com/Drekin/win-unicode-console useful. The latter is > available on pypi. However, Arabic is one of those scripts that runs up against the real limitati

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Mario Figueiredo
In article , jpiit...@ling.helsinki.fi says... > > If you mean literally some_predicate, then perhaps this. > > if some_predicate: >for x in seq: > handle(x) > Careful. See Chris Warrick answer for the correct position of the 'if' statement. -- https://mail.python.org/mailman/listi

Re: Is there a more elegant way to spell this?

2015-01-27 Thread random832
On Tue, Jan 27, 2015, at 13:05, Mario Figueiredo wrote: > In article , > jpiit...@ling.helsinki.fi says... > > > > If you mean literally some_predicate, then perhaps this. > > > > if some_predicate: > >for x in seq: > > handle(x) > > > > Careful. See Chris Warrick answer for the corr

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Neal Becker
Jussi Piitulainen wrote: > Neal Becker writes: > >> Is there a more elegant way to spell this? >> >> for x in [_ for _ in seq if some_predicate]: > > If you mean some_predicate(_), then possibly this. > > for x in filter(some_predicate, seq): >handle(x) > > If you mean literally some_pred

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Emile van Sebille
On 1/27/2015 9:49 AM, Rob Gaddi wrote: Or the somewhat less indenty for x in seq: if not some_predicate: continue do_something_to(x) ... or shorter and equally less indenty for x in seq: if some_predicate: do_something_to(x) -- https://mail.python.org/mailman/listinfo/python

Re: Formatting string with accented characters for printing

2015-01-27 Thread John Ladasky
Jerry, I can tell from your code that you are using Python 2. If you are a new Python programmer, and you do not HAVE to use Python 2, use Python 3 instead. In Python 3, text objects are something called "Unicode" rather than just sequences of bytes. Unicode makes it much easier to handle cha

An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
This is a follow up from a previous discussion in which it is argued that the following code produces the correct error message terminology, considering that in Python an object is also an instance. >>> class Sub: >>> pass >>> foo = Sub() >>> foo.__bases__ [...]

Re: An object is an instance (or not)?

2015-01-27 Thread Ethan Furman
On 01/27/2015 12:12 PM, Mario Figueiredo wrote: > > Because, from my own study of Python, I've came to realize that the > distinction between objects and instances of objects actually exists. In > Python, class objects cannot participate in OOP, only their instances. I haven't followed the othe

Re: Python is DOOMED! Again!

2015-01-27 Thread Chris Angelico
On Wed, Jan 28, 2015 at 4:59 AM, Mario Figueiredo wrote: > An optional feature says nothing of its requirements. The requirements > for PEP 484 are heavy. Not only will they force an update to the > interpreter, but will also force many users to reformate their function > headers in order for them

Re: An object is an instance (or not)?

2015-01-27 Thread André Roberge
On Tuesday, 27 January 2015 16:12:47 UTC-4, Mario Figueiredo wrote: > This is a follow up from a previous discussion in which it is argued > that the following code produces the correct error message terminology, > considering that in Python an object is also an instance. > > >>> class Sub:

Re: Python is DOOMED! Again!

2015-01-27 Thread Mario Figueiredo
In article , ros...@gmail.com says... > > On Wed, Jan 28, 2015 at 4:59 AM, Mario Figueiredo wrote: > > An optional feature says nothing of its requirements. The requirements > > for PEP 484 are heavy. Not only will they force an update to the > > interpreter, but will also force many users to re

Re: Python is DOOMED! Again!

2015-01-27 Thread Chris Angelico
On Wed, Jan 28, 2015 at 7:58 AM, Mario Figueiredo wrote: > Looking at PEP 3107, i'm left wondering: what if I have for instance > already annotated my functions for parameter marshalling, following the > syntax expected of that specific library, and now I want to annotate > them for type hinting f

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article <80a9f882-6b13-45a7-b514-8c47b3a4c...@googlegroups.com>, andre.robe...@gmail.com says... > > You keep writing "an object is not an instance", making statements > such as "the terminology keeps indicating that in Python an object is > an instance" and yet, none of the examples you show

Re: Python is DOOMED! Again!

2015-01-27 Thread Mario Figueiredo
In article , ros...@gmail.com says... > > On Wed, Jan 28, 2015 at 7:58 AM, Mario Figueiredo wrote: > > Looking at PEP 3107, i'm left wondering: what if I have for instance > > already annotated my functions for parameter marshalling, following the > > syntax expected of that specific library, an

Re: Python is DOOMED! Again!

2015-01-27 Thread Chris Angelico
On Wed, Jan 28, 2015 at 8:19 AM, Mario Figueiredo wrote: > @typehint@ some crazy syntax for static analysis > @marshallib@ more crazy syntax for the marshall lib > @anotherlib@ Whoohoo! a 3rd annotation for another lib > """ > > Are you telling me this is not a viable alternative.

Re: An object is an instance (or not)?

2015-01-27 Thread André Roberge
On Tuesday, 27 January 2015 17:06:50 UTC-4, Mario Figueiredo wrote: > In article <80a9f882-6b13-45a7-b514-8c47b3a4c...@googlegroups.com>, > andre.robe...@gmail.com says... > > > > You keep writing "an object is not an instance", making statements > > such as "the terminology keeps indicating tha

Re: Python is DOOMED! Again!

2015-01-27 Thread Mario Figueiredo
In article , ros...@gmail.com says... > > Sure you can! But this is *itself* a weak argument, unless you > actually have a codebase that uses it. Wait. Are you saying that unless I show you a codebase that requires marshalling and static analysis, you will ignore the fact that a project, no ma

Re: Python is DOOMED! Again!

2015-01-27 Thread Mario Figueiredo
I can now start to understand the criticism of how Python is evolving coming from many corners, either long term python educators like Mark Lutz. -- https://mail.python.org/mailman/listinfo/python-list

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article , andre.robe...@gmail.com says... > > It is appropriate to refer to an instance as an object. It might not > be appropriate to refer to an object as an instance ... but Python > does not do so as your explicit examples demonstrate, and contrary to > your claim. I'll try one more ti

Re: An object is an instance (or not)?

2015-01-27 Thread André Roberge
On Tuesday, 27 January 2015 17:43:38 UTC-4, Mario Figueiredo wrote: > In article , > andre.robe...@gmail.com says... > > > > It is appropriate to refer to an instance as an object. It might not > > be appropriate to refer to an object as an instance ... but Python > > does not do so as your ex

Re: Python is DOOMED! Again!

2015-01-27 Thread Chris Angelico
On Wed, Jan 28, 2015 at 8:35 AM, Mario Figueiredo wrote: > In other words, lets suggest function annotations as a restrictive > feature, instead of a feature that can adapt to more than one use case. PEP 3107 made a feature that can adapt to more than one use case. It's been years now, and the us

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article <9a2cf6ca-2eb8-4a87-9e83-e87d90d5f...@googlegroups.com>, andre.robe...@gmail.com says... > > **This is a follow up from a previous discussion in which it is argued > that the following code produces the correct error message terminology ** > > I pointed out to you that the word objec

Re: An object is an instance (or not)?

2015-01-27 Thread Ben Finney
Mario Figueiredo writes: > People were saying to me that in Python object = instance. I'm trying > to argue why I believe it isn't and asking for arguments to convince > me otherwise. In Python: * Every value is an object. * Every object is an instance of some class. * To say “object” is upro

Re: An object is an instance (or not)?

2015-01-27 Thread Mark Lawrence
On 27/01/2015 21:58, Mario Figueiredo wrote: In article <9a2cf6ca-2eb8-4a87-9e83-e87d90d5f...@googlegroups.com>, andre.robe...@gmail.com says... **This is a follow up from a previous discussion in which it is argued that the following code produces the correct error message terminology ** I po

Re: An object is an instance (or not)?

2015-01-27 Thread Ned Batchelder
On 1/27/15 3:12 PM, Mario Figueiredo wrote: This is a follow up from a previous discussion in which it is argued that the following code produces the correct error message terminology, considering that in Python an object is also an instance. I don't know what the difference is between "object"

Re: Python simple Code

2015-01-27 Thread Salem Alqahtani
On Saturday, January 24, 2015 at 7:16:27 PM UTC-5, Salem Alqahtani wrote: > Hi Guys, > > I just joined the group and I hope that I can help and be active. > > I have a question about python. I wrote a code on python 2.7 and I want to > choose from the list of names that I provide n!. I execute t

Re: An object is an instance (or not)?

2015-01-27 Thread Ben Finney
Ned Batchelder writes: > On 1/27/15 3:12 PM, Mario Figueiredo wrote: > > This is a follow up from a previous discussion in which it is argued > > that the following code produces the correct error message terminology, > > considering that in Python an object is also an instance. > > I don't know

Re: An object is an instance (or not)?

2015-01-27 Thread Chris Angelico
On Wed, Jan 28, 2015 at 10:22 AM, Ned Batchelder wrote: > I don't know what the difference is between "object" and "instance". An > object is an instance of a class. The two words are interchangeable as far > as I know. My understanding is that "instance" is meaningless unless followed by "of".

Re: Python simple Code

2015-01-27 Thread Ian Kelly
On Tue, Jan 27, 2015 at 4:22 PM, Salem Alqahtani wrote: > I appreciate your answers and the output that I am expected from my simple > code is the following: > > ['salem','Ali','sultan'] > ['salem','sultan','Ali'] > ['Ali','sultan','salem'] > ['Ali','salem','sultan'] > ['sultan','Ali','salem'] >

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article , n...@nedbatchelder.com says... > > A common mistake is to believe that "OOP" is a well-defined term. It's > not it's a collection of ideas that are expressed slightly differently > in each language. A common mistake is thinking just because OOP has different implementations, it

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article , ben+pyt...@benfinney.id.au says... > > > This is why I say that even in Python, where a class is an object, > > > an object is not always an instance. The language itself forces that > > > distinction. > > You have not, to my knowledge, shown any object (in Python 2.2 or later) > whi

Re: An object is an instance (or not)?

2015-01-27 Thread Grant Edwards
On 2015-01-27, Ned Batchelder wrote: > On 1/27/15 3:12 PM, Mario Figueiredo wrote: >> This is a follow up from a previous discussion in which it is argued >> that the following code produces the correct error message terminology, >> considering that in Python an object is also an instance. > > I d

Re: An object is an instance (or not)?

2015-01-27 Thread Chris Angelico
On Wed, Jan 28, 2015 at 11:17 AM, Mario Figueiredo wrote: > Means the object is capable of participating in inheritance and/or > polymorphism. An instance of an object is capable of doing so, per its > class definitions. Whereas a Python class object is not. > > >>> class Master: >

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article , ros...@gmail.com says... > > On Wed, Jan 28, 2015 at 10:22 AM, Ned Batchelder > wrote: > > I don't know what the difference is between "object" and "instance". An > > object is an instance of a class. The two words are interchangeable as far > > as I know. > > My understanding i

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article , ros...@gmail.com says... > > On Wed, Jan 28, 2015 at 11:17 AM, Mario Figueiredo wrote: > > Means the object is capable of participating in inheritance and/or > > polymorphism. An instance of an object is capable of doing so, per its > > class definitions. Whereas a Python class obje

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article , breamore...@yahoo.co.uk says... > > Mario and Andre, when you have to write code to meet the deadline to get > the stage payment, does either of your bosses really care whether or not > you are dealing with an object, an instance, or a piece of dead meat > dropped by the neighbour

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Steven D'Aprano
Neal Becker wrote: > Is there a more elegant way to spell this? > > for x in [_ for _ in seq if some_predicate]: Don't use _ as the loop variable here. There are three common conventions for _ and this is none of them: (1) n the interactive interpreter _ is used for the result of the last exp

Re: An object is an instance (or not)?

2015-01-27 Thread Ben Finney
Mario Figueiredo writes: > It is true that a class object is an instance of 'type'. But this is a > special type (can't avoid the pun). Nevertheless it is a class, and can do everything that classes do. And every class is an object, and can do everything that objects do. You seem to agree with

Re: Python is DOOMED! Again!

2015-01-27 Thread Steven D'Aprano
random...@fastmail.us wrote: > On Mon, Jan 26, 2015, at 19:11, Steven D'Aprano wrote: >> random...@fastmail.us wrote: >> - lexical analysis has to look for twice as many files (it has to >> hit the hard drive for a stub file before looking at the source), >> and we know from importing that fil

Re: An object is an instance (or not)?

2015-01-27 Thread Mario Figueiredo
In article , ben+pyt...@benfinney.id.au says... > > Mario Figueiredo writes: > > > It is true that a class object is an instance of 'type'. But this is a > > special type (can't avoid the pun). > > Nevertheless it is a class, and can do everything that classes do. > > And every class is an ob

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Mario Figueiredo
In article <54c8339f$0$13008$c3e8da3$54964...@news.astraweb.com>, steve+comp.lang.pyt...@pearwood.info says... > (3) _ is also commonly used as a "don't care" variable name: > > a, _, b, _ = get_four_items() # but I only care about two of them > According to the following link, it is actually

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Ben Finney
Mario Figueiredo writes: > In article <54c8339f$0$13008$c3e8da3$54964...@news.astraweb.com>, > steve+comp.lang.pyt...@pearwood.info says... > > (3) _ is also commonly used as a "don't care" variable name: > > > > a, _, b, _ = get_four_items() # but I only care about two of them > > > > Accord

Re: Python is DOOMED! Again!

2015-01-27 Thread Steven D'Aprano
Mario Figueiredo wrote: > Static analysis cannot and should not clutter executable code. (1) It isn't clutter. The human reader uses that information as well as the compiler, interpreter, type-checker, IDE, text editor, correctness tester, etc. (2) Algol, Ada, Boo, C, C#, C++, Cobol, Cobra, D, F

Re: Python simple Code

2015-01-27 Thread Salem Alqahtani
On Tuesday, January 27, 2015 at 6:51:10 PM UTC-5, Ian wrote: > On Tue, Jan 27, 2015 at 4:22 PM, Salem Alqahtani wrote: > > I appreciate your answers and the output that I am expected from my simple > > code is the following: > > > > ['salem','Ali','sultan'] > > ['salem','sultan','Ali'] > > ['Ali'

Re: Python is DOOMED! Again!

2015-01-27 Thread Steven D'Aprano
Mario Figueiredo wrote: > Looking at PEP 3107, i'm left wondering: what if I have for instance > already annotated my functions for parameter marshalling, following the > syntax expected of that specific library, and now I want to annotate > them for type hinting for the purposes of static analysi

Re: An object is an instance (or not)?

2015-01-27 Thread Rustom Mody
On Wednesday, January 28, 2015 at 1:42:47 AM UTC+5:30, Mario Figueiredo wrote: > This is a follow up from a previous discussion in which it is argued > that the following code produces the correct error message terminology, > considering that in Python an object is also an instance. > > >>>

Re: An object is an instance (or not)?

2015-01-27 Thread Ian Kelly
On Tue, Jan 27, 2015 at 5:17 PM, Mario Figueiredo wrote: > In article , > n...@nedbatchelder.com says... >> What does "participate in OOP" mean? > > Means the object is capable of participating in inheritance and/or > polymorphism. An instance of an object is capable of doing so, per its > class d

Re: Is there a more elegant way to spell this?

2015-01-27 Thread Steven D'Aprano
Mario Figueiredo wrote: > In article <54c8339f$0$13008$c3e8da3$54964...@news.astraweb.com>, > steve+comp.lang.pyt...@pearwood.info says... >> (3) _ is also commonly used as a "don't care" variable name: >> >> a, _, b, _ = get_four_items() # but I only care about two of them >> > > According to

Re: An object is an instance (or not)?

2015-01-27 Thread Ned Batchelder
On 1/27/15 7:17 PM, Mario Figueiredo wrote: In article , n...@nedbatchelder.com says... A common mistake is to believe that "OOP" is a well-defined term. It's not it's a collection of ideas that are expressed slightly differently in each language. A common mistake is thinking just because OO

Re: An object is an instance (or not)?

2015-01-27 Thread Rustom Mody
On Wednesday, January 28, 2015 at 7:55:12 AM UTC+5:30, Ned Batchelder wrote: > On 1/27/15 7:17 PM, Mario Figueiredo wrote: > > Ned Batchelder says... > >> > >> A common mistake is to believe that "OOP" is a well-defined term. It's > >> not it's a collection of ideas that are expressed slightly dif

Re: Python simple Code

2015-01-27 Thread Denis McMahon
On Tue, 27 Jan 2015 15:22:01 -0800, Salem Alqahtani wrote: > I appreciate your answers and the output that I am expected from my > simple code is the following: > > ['salem','Ali','sultan'] > ['salem','sultan','Ali'] > ['Ali','sultan','salem'] > ['Ali','salem','sultan'] > ['sultan','Ali','salem']

Re: An object is an instance (or not)?

2015-01-27 Thread alex23
On 28/01/2015 10:35 AM, Mario Figueiredo wrote: I admit it was a contrived example. I couldn't think of a way to demonstrate that a class object does not participate in its own inheritance rules. Only instances of it can. A class object isn't an instance of itself, it's an instance of the Clas

Re: An object is an instance (or not)?

2015-01-27 Thread alex23
On 28/01/2015 10:24 AM, Mario Figueiredo wrote: In other words, the object know as "Sub class" is not an instance object. True, it is an instance of the object 'type'. >>> class Foo: ... pass ... >>> isinstance(Foo, type) True >>> isinstance(Foo, object) True A

Re: An object is an instance (or not)?

2015-01-27 Thread Rustom Mody
On Wednesday, January 28, 2015 at 10:18:07 AM UTC+5:30, alex23 wrote: > On 28/01/2015 10:24 AM, Mario Figueiredo wrote: > > In other words, the object know as "Sub class" is not an instance > > object. True, it is an instance of the object 'type'. > > >>> class Foo: > ... pass >

Re: An object is an instance (or not)?

2015-01-27 Thread Marko Rauhamaa
Mario Figueiredo : > That is valuable input. You don't care how a type or an instance of a > type differ. Should be intersting to ask you to make a Cat object. I > wonder if you are not going to ask if they mean a class or an instance > of that class. > > Anyways, more to the point, this is simply

Re: An object is an instance (or not)?

2015-01-27 Thread random832
On Tue, Jan 27, 2015, at 16:06, Mario Figueiredo wrote: > That error message has me start that thread arguing that the error is > misleading because the Sub object does have the __bases__ attribute. > It's the Sub instance object that does not have it. What do you think "Sub object" means? Sub

Re: An object is an instance (or not)?

2015-01-27 Thread Devin Jeanpierre
On Tue, Jan 27, 2015 at 9:37 PM, wrote: > On Tue, Jan 27, 2015, at 16:06, Mario Figueiredo wrote: >> That error message has me start that thread arguing that the error is >> misleading because the Sub object does have the __bases__ attribute. >> It's the Sub instance object that does not have it.

Re: An object is an instance (or not)?

2015-01-27 Thread random832
On Tue, Jan 27, 2015, at 23:47, alex23 wrote: > On 28/01/2015 10:24 AM, Mario Figueiredo wrote: > > In other words, the object know as "Sub class" is not an instance > > object. True, it is an instance of the object 'type'. > > >>> class Foo: > ... pass > ... > >>> isinstan

Re: An object is an instance (or not)?

2015-01-27 Thread Rustom Mody
On Wednesday, January 28, 2015 at 10:55:32 AM UTC+5:30, Marko Rauhamaa wrote: > Python itself has answers to your questions: > >>>> isinstance(3, int) >True >>>> isinstance("3", int) >False >>>> isinstance(int, type) >True >>>> isinstance(type, int) >False >>>>

Re: An object is an instance (or not)?

2015-01-27 Thread Mark Lawrence
On 28/01/2015 00:52, Mario Figueiredo wrote: In article , breamore...@yahoo.co.uk says... Mario and Andre, when you have to write code to meet the deadline to get the stage payment, does either of your bosses really care whether or not you are dealing with an object, an instance, or a piece of

Re: An object is an instance (or not)?

2015-01-27 Thread random832
On Wed, Jan 28, 2015, at 00:43, Devin Jeanpierre wrote: > On Tue, Jan 27, 2015 at 9:37 PM, wrote: > > Sub itself is not a Sub object, it is a type object. "instance" is > > implicit in the phrase "foo object". > > Yes. Unfortunately, it's still not really completely clear. "Sub > instance" would

Re: An object is an instance (or not)?

2015-01-27 Thread Rustom Mody
On Wednesday, January 28, 2015 at 11:31:46 AM UTC+5:30, random wrote: > On Wed, Jan 28, 2015, at 00:43, Devin Jeanpierre wrote: > > On Tue, Jan 27, 2015 at 9:37 PM, random832 wrote: > > > Sub itself is not a Sub object, it is a type object. "instance" is > > > implicit in the phrase "foo object".

Re: An object is an instance (or not)?

2015-01-27 Thread Ben Finney
random...@fastmail.us writes: > On Wed, Jan 28, 2015, at 00:43, Devin Jeanpierre wrote: > > On Tue, Jan 27, 2015 at 9:37 PM, wrote: > > > Sub itself is not a Sub object, it is a type object. "instance" is > > > implicit in the phrase "foo object". > > > > Yes. Unfortunately, it's still not real

Re: An object is an instance (or not)?

2015-01-27 Thread Ben Finney
Rustom Mody writes: > Me(Rusi): Prefer a not so cavalier adjective-noun equivalencing I can sympathise with that preference. It really is a lost cause, though; the English language just works that way. We use nouns as verbs, nouns as modifiers, adjectives as nouns; and rather than wish it were

Re: unicode question

2015-01-27 Thread Terry Reedy
On 1/27/2015 12:17 AM, Rehab Habeeb wrote: Hi there python staff does python support arabic language for texts ? and what to do if it support it? i wrote hello in Arabic using codeskulptor and the powershell just for testing and the same error appeared( a sytanx error in unicode)!! I do not kno

Re: An object is an instance (or not)?

2015-01-27 Thread Gregory Ewing
Mario Figueiredo wrote: That error message has me start that thread arguing that the error is misleading because the Sub object does have the __bases__ attribute. It's the Sub instance object that does not have it. Some of the answers that were given argued that in Python object = instance.

Re: An object is an instance (or not)?

2015-01-27 Thread Ben Finney
Devin Jeanpierre writes: > […] as Ben Finney pointed out. (BTW I agree with literally every > single thing he said in this thread, it's really amazing.) Hmm, writing that doesn't annoy somebody is not worth writing [0]. It shouldn't annoy *everyone* though, so I'm glad to know you can agree wit