You could say that all translated languages lose something in translation.
It's all symbolism.
I say sunshine, and you might say Great Ball of' Fire in the s ky.
Isay x = 10 in python
print x
and in c++
something like
unsigned int x
cin << x;
cout >> x;
or something like that.
It's someth
On Sun, 11 Aug 2013 18:58:25 +0200, Xavi wrote:
> Respect to the "Names starting and ending with double-underscore". I
> don't know how to get the name of a classe without them.
> obj.__class__.__name__
I didn't say you should *never* use them, but most of the time, you don't.
However type(obj).
Thanks to all for your answers,
I guess it is more flexible with isinstance (the duck test :)
I'm going to change the type checks.
Respect to the "Names starting and ending with double-underscore".
I don't know how to get the name of a classe without them.
obj.__class__.__name__
Thanks.
--
Xavi
On Sat, 10 Aug 2013 16:42:22 -0400, Roy Smith wrote:
> In article ,
> Dennis Lee Bieber wrote:
>
>> Because id(n) is not giving you the address of the NAME. It is giving
>> you the address of the "10"
>
> Actually, it is giving you the id of the int(10) object. Maybe it's an
> address, maybe
On Sat, 10 Aug 2013 20:21:46 -0700, Gary Herron wrote:
> Our knee-jerk reaction to beginners using "is" should be:
> Don't do that! You almost certainly want "==". Consider "is" an
> advanced topic.
>
> Then you can spend as much time as you want trying to coach them into an
> understandi
On Sat, 10 Aug 2013 17:42:21 -0700, Gary Herron wrote:
> But for each of your examples, using "==" is equivalent to using "is".
> Each of
> if something == None
> if device == _not passed
> if device != None
> would all work as expected. In none of those cases is "is" actually
> ne
On Sun, Aug 11, 2013 at 5:29 AM, Gary Herron
wrote:
> A beginner, on his first program or two, can understand 1, and perhaps
> parrot 2 without understanding (or needing to). But the step from there to
> 3 is huge. It's folly to dump that on a first-time programmer. (It's
> probably even folly
On Sun, Aug 11, 2013 at 5:04 AM, Joshua Landau wrote:
> On 11 August 2013 04:43, Chris Angelico wrote:
>> The
>> distinction between the two is important when the objects are mutable
>> (so they have an identity that's distinct from their current values).
>
> I don't follow this argument. Tuples
On 08/10/2013 08:43 PM, Chris Angelico wrote:
On Sun, Aug 11, 2013 at 4:21 AM, Gary Herron
wrote:
On 08/10/2013 06:00 PM, Chris Angelico wrote:
Wrong. If you do equality comparisons, it's entirely possible for
something to be passed in that compares equal to the RHS without
actually being it,
On 11 August 2013 04:43, Chris Angelico wrote:
> On Sun, Aug 11, 2013 at 4:21 AM, Gary Herron
> wrote:
>> On 08/10/2013 06:00 PM, Chris Angelico wrote:
>>> All it takes is a slightly odd or buggy __eq__ implementation and the
>>> == versions will misbehave. To check if an argument is something, y
On Sun, Aug 11, 2013 at 4:21 AM, Gary Herron
wrote:
> On 08/10/2013 06:00 PM, Chris Angelico wrote:
>> Wrong. If you do equality comparisons, it's entirely possible for
>> something to be passed in that compares equal to the RHS without
>> actually being it, so "is" is precisely what's wanted. (Pl
On 08/10/2013 09:09 PM, Krishnan Shankar wrote:
> i.e. Is this code possible
>
> if a is False:
> print 'Yes'
> if b is False:
> print 'No'
>
> Because i recommended this should not be done. But my colleagues say it is
> correct.
You are probably correct in your believe that this idiom
On 08/10/2013 06:00 PM, Chris Angelico wrote:
On Sun, Aug 11, 2013 at 1:42 AM, Gary Herron
wrote:
On 08/10/2013 03:09 PM, Chris Angelico wrote:
_notpassed = object()
def frob(appendage, device=_notpassed):
"""Use some appendage to frob some device, or None to frob nothing.
Omit dev
On 08/10/2013 08:09 PM, Krishnan Shankar wrote:
Thanks Tim,
This takes me to one more question.
'is' operator is used to compare objects and it should not be used to
compare data.
So can it be compared with 'False'.
i.e. Is this code possible
if a is False:
print 'Yes'
if b is False:
On Sun, Aug 11, 2013 at 4:09 AM, Krishnan Shankar
wrote:
> i.e. Is this code possible
>
> if a is False:
> print 'Yes'
> if b is False:
> print 'No'
You would use that if you want to check if a/b is the exact bool value
False. Normally you would simply spell it thus:
if not a:
print
Thanks Tim,
This takes me to one more question.
'is' operator is used to compare objects and it should not be used to
compare data.
So can it be compared with 'False'.
i.e. Is this code possible
if a is False:
print 'Yes'
if b is False:
print 'No'
Because i recommended this should not
On Sun, Aug 11, 2013 at 2:25 AM, Terry Reedy wrote:
> On 8/10/2013 8:42 PM, Gary Herron wrote:
>
>> But for each of your examples, using "==" is equivalent to using "is".
>> Each of
>> if something == None
>> if device == _not passed
>> if device != None
>> would all work as expecte
On 8/10/2013 8:42 PM, Gary Herron wrote:
But for each of your examples, using "==" is equivalent to using "is".
Each of
if something == None
if device == _not passed
if device != None
would all work as expected. In none of those cases is "is" actually
needed.
class EqualAll:
On Sun, Aug 11, 2013 at 1:42 AM, Gary Herron
wrote:
> On 08/10/2013 03:09 PM, Chris Angelico wrote:
>> _notpassed = object()
>> def frob(appendage, device=_notpassed):
>> """Use some appendage to frob some device, or None to frob nothing.
>> Omit device to frob whatever is currently held
On 08/10/2013 03:09 PM, Chris Angelico wrote:
On Sat, Aug 10, 2013 at 10:48 PM, Gary Herron
wrote:
This is an oversimplification, but generally useful for all beginner (and
most advanced) programmers:
Don't use "is" for comparisons. Use "==".
It 20 years of programming Python, I've *neede
On Sat, Aug 10, 2013 at 10:48 PM, Gary Herron
wrote:
> This is an oversimplification, but generally useful for all beginner (and
> most advanced) programmers:
> Don't use "is" for comparisons. Use "==".
> It 20 years of programming Python, I've *needed* to use "is" ... only once
> or twice.
On 08/10/2013 11:00 AM, Xavi wrote:
Hello,
El 10/08/2013 18:40, Tim Chase escribió:
Generally, if you are using the "is" operator to compare against
anything other than None, you're doing it wrong. There are exceptions
to this, but it takes knowing the particulars.
Now I have one doubt, I use
On Sat, Aug 10, 2013 at 7:00 PM, Xavi wrote:
> Now I have one doubt, I use 'is' to compare basic types in python 3, for
> example .-
>
> v = []
> if type(v) is list:
> print('Is list...')
>
> Because I think it is more clear and faster than .-
> type(v) == [].__class__ ... or ... isinstance(v
Peter Otten wrote:
>
> doubt
>
Oh bother, said Pooh, what's in a word ?
http://en.wikipedia.org/wiki/Curry
https://pypi.python.org/pypi/curry/
http://en.wikipedia.org/wiki/Currying
--
Stanley C. Kitching
Human Being
Phoenix, Arizona
--
http://mail.python.org/mailm
In article ,
Dennis Lee Bieber wrote:
> Because id(n) is not giving you the address of the NAME. It is giving
> you the address of the "10"
Actually, it is giving you the id of the int(10) object. Maybe it's an
address, maybe it's not. Only your implementation knows for sure.
--
http://mail
On 8/10/2013 2:36 PM, Peter Otten wrote:
Terry Reedy wrote:
On 8/10/2013 11:33 AM, Krishnan Shankar wrote:
Hi Fellow Python Friends,
I am new to Python and recently subscribed to the mailing list.I have a
doubt regarding the basics of Python. Please help me in understanding
the below concept.
On 8/10/2013 2:00 PM, Xavi wrote:
Hello,
El 10/08/2013 18:40, Tim Chase escribió:
Generally, if you are using the "is" operator to compare against
anything other than None, you're doing it wrong. There are exceptions
to this, but it takes knowing the particulars.
Now I have one doubt, I use '
On Sat, 10 Aug 2013 20:36:52 +0200, Peter Otten wrote:
> Terry Reedy wrote:
>
>> On 8/10/2013 11:33 AM, Krishnan Shankar wrote:
>>> Hi Fellow Python Friends,
>>>
>>> I am new to Python and recently subscribed to the mailing list.I have
>>> a doubt regarding the basics of Python. Please help me in
On Sat, 10 Aug 2013 20:00:58 +0200, Xavi wrote:
> Now I have one doubt, I use 'is' to compare basic types in python 3, for
> example .-
>
> v = []
> if type(v) is list:
> print('Is list...')
No, do not do this. This is unnecessarily restrictive.
> Because I think it is more clear and faste
In article ,
Peter Otten <__pete...@web.de> wrote:
> Quoting http://en.wikipedia.org/wiki/Indian_English
>
> """
> doubt = question or query; e.g. one would say, 'I have a doubt' when one
> wishes to ask a question.
> """
>
> I'd say if Brits can cope (hard as it may be) with the American vari
Terry Reedy wrote:
> On 8/10/2013 11:33 AM, Krishnan Shankar wrote:
>> Hi Fellow Python Friends,
>>
>> I am new to Python and recently subscribed to the mailing list.I have a
>> doubt regarding the basics of Python. Please help me in understanding
>> the below concept.
>>
>> So doubt is on variabl
Hello,
El 10/08/2013 18:40, Tim Chase escribió:
Generally, if you are using the "is" operator to compare against
anything other than None, you're doing it wrong. There are exceptions
to this, but it takes knowing the particulars.
Now I have one doubt, I use 'is' to compare basic types in pytho
On 8/10/2013 11:33 AM, Krishnan Shankar wrote:
Hi Fellow Python Friends,
I am new to Python and recently subscribed to the mailing list.I have a
doubt regarding the basics of Python. Please help me in understanding
the below concept.
So doubt is on variables and their contained value.
It woul
On Sat, Aug 10, 2013 at 4:33 PM, Krishnan Shankar
wrote:
> Hi Fellow Python Friends,
>
> I am new to Python and recently subscribed to the mailing list.I have a
> doubt regarding the basics of Python. Please help me in understanding the
> below concept.
>
> So doubt is on variables and their conta
On 2013-08-10 21:03, Krishnan Shankar wrote:
> >>> a=10
> >>> id(a)
> 21665504
> >>> b=a
> >>> id(b)
> 21665504
> >>> c=10
> >>> id(c)
> 21665504
>
> I am actually assigning new value to c. But from the value of id()
> all three variables take same location. With variables a and b it
> is ok. But
In article ,
Krishnan Shankar wrote:
> Hi Fellow Python Friends,
>
> I am new to Python and recently subscribed to the mailing list.I have a
> doubt regarding the basics of Python. Please help me in understanding the
> below concept.
>
> So doubt is on variables and their contained value.
>
>
Hi Fellow Python Friends,
I am new to Python and recently subscribed to the mailing list.I have a
doubt regarding the basics of Python. Please help me in understanding the
below concept.
So doubt is on variables and their contained value.
Why does in the below example from Interpreter exploratio
On 17Jun2010 05:11, Gabriel Genellina wrote:
| En Thu, 17 Jun 2010 02:06:54 -0300, madhuri vio
| escribió:
|
| >def h(self,event):
| >handle = open("myco.fasta","r")
| >for seq_record in SeqIO.parse(handle, "fasta"):
| > messenger_rna = coding_myco.fasta.transcribe()
| >
En Thu, 17 Jun 2010 02:06:54 -0300, madhuri vio
escribió:
def h(self,event):
handle = open("myco.fasta","r")
for seq_record in SeqIO.parse(handle, "fasta"):
messenger_rna = coding_myco.fasta.transcribe()
han1 = open("mycorna.fasta","wU")
han1.close()
ely in
academia, doing bioinformatics research. You would be wise to seek out
help from a computer science student or professor. In fact you're
likely to receive more help by doing that than from this mailing list,
at least at this stage.
In your next post, please do at least the following
def h(self,event):
handle = open("myco.fasta","r")
for seq_record in SeqIO.parse(handle, "fasta"):
messenger_rna = coding_myco.fasta.transcribe()
han1 = open("mycorna.fasta","wU")
han1.close()
return self.messenger_rna
the error is...
File "/usr/lib/py
41 matches
Mail list logo