gregarican wrote:
> Here are a few languages I recommend most programmers should at least
> have a peek at:
>
(snip)
> 2) Lisp - Along with FORTRAN, one of the oldest programming languages
> still in use. Pure functional programming model
Err... Even if Lisp is the father of functional programmi
[EMAIL PROTECTED] wrote:
> Fredrik is then this a valid "property" use case and pythonic to
> get/set a common varibale across objects
>
> class E(object):
> _i = 0
> def geti(self) : return E._i
> def seti(self,val) : E._i = val
> i = property(geti,seti)
>
> if __name__ == "_
fyhuang wrote:
> Hello all,
>
> I've been wondering a lot about why Python handles classes and OOP the
> way it does. From what I understand, there is no concept of class
> encapsulation in Python, i.e. no such thing as a private variable.
Seems you're confusing encapsulation with data hiding.
>
Roy Smith wrote:
(snip)
> That being said, you can indeed have private data in Python. Just prefix
> your variable names with two underscores (i.e. __foo), and they effectively
> become private.
The double-leading-underscore stuff has nothing to do with "privacy".
It's meant to protect from
Lawrence D'Oliveiro wrote:
> In article <[EMAIL PROTECTED]>,
> bruno at modulix <[EMAIL PROTECTED]> wrote:
>
>
>>gregarican wrote:
>>
>>>Here are a few languages I recommend most programmers should at least
>>>have a peek at:
>>&g
looping wrote:
> Peter Hansen wrote:
>
>>Georg Brandl wrote:
>>
>>>class C():
>>>
>>>is meant to be synonymous with
>>>
>>>class C:
>>>
>>>and therefore cannot create a new-style class.
>>
>>I think "looping" understands that, but is basically asking why anyone
>>is bothering with a change that in
David Bear wrote:
> I'm attempting to use the cgi module with code like this:
>
> import cgi
> fo = cgi.FieldStorage()
> # form field names are in the form if 'name:part'
> keys = fo.keys()
> for i in keys:
> try:
> item,value=i.split(':')
> except NameError, Unboun
[EMAIL PROTECTED] wrote:
> bruno at modulix>Since the class statement without superclass actually
> creates an old-style class, I'd expect the "class MyClass():" variant
> to behave the same.<
>
> In Python 3.0 I really hope the
>
> class C: pass
looping wrote:
> bruno at modulix wrote:
>
>>looping wrote:
>>
>>>Peter Hansen wrote:
>>>
>>>
>>>>Georg Brandl wrote:
>>>>
>>>>
>>>>>class C():
>>>>>
>>>>>is meant
gregarican wrote:
> bruno wrote:
>
>
>>Err...
>
>
>>And ?
>
>
> It's the snide, curt replies such as your recent ones in this thread
> that reinforce the generalization that the Python community can be
> rude.
I'm afraid you're right, at least for the second one, and I do apologise
NB : the
Ben C wrote:
> On 2006-04-11, Michele Simionato <[EMAIL PROTECTED]> wrote:
>
>>Roy Smith wrote:
>>
>>
>>>That being said, you can indeed have private data in Python. Just prefix
>>>your variable names with two underscores (i.e. __foo), and they effectively
>>>become private. Yes, you can bypass
Casey Hawthorne wrote:
>>I think it's important not to wrongly confuse 'OOP' with ''data hiding'
>>or any other aspect you may be familiar with from Java or C++. The
>>primary concept behind OOP is not buzzwords such as abstraction,
>>encapsulation, polymorphism, etc etc, but the fact that your pro
Gregor Horvath wrote:
> Steven D'Aprano schrieb:
>
>
>>I don't know of many other OO languages that didn't/don't have
>>inheritance,
>
>
> VB4 - VB6
>
VB6 has a kind of inheritance via interface/delegation. The interface
part is for subtyping, the delegation part (which has to be done
manuall
robin wrote:
> thanks for your answer. split gives me a list of strings,
Of course, why should it be otherwise ?-)
More seriously : Python doesn't do much automagical conversions. Once
you've got your list of strings, you have to convert'em to floats.
> but i found a
> way to do what i want:
>
robin wrote:
> yo!
>
> thank you everone! here's how i finally did it:
> converting the string into a list:
>
> input = net.receiveUDPData()
> input = list(eval(input[0:-2]))
You'll run into trouble with this.
> converting the list into a string:
>
> sendout = "%.6f %.6f %.6f
News wrote:
> Hi everyone,
>
> My goal is to pull command switches/options from a file and then assign
> the values to select variables which would eventually be included in a
> class object.
>
> The data file looks something like this but the switches could be in any
> order and not all may be us
News wrote:
> bruno at modulix wrote:
>
>>News wrote:
>>
>>>Hi everyone,
>>>
>>>My goal is to pull command switches/options from a file and then assign
>>>the values to select variables which would eventually be included in a
>>>class
Grzegorz Ĺšlusarek wrote:
> Hi all. I my application i have situation when i have some lists and i
> must get from lists common elements. Exacly i don't know how many list I
> have so at the moment of creation each of one I append them to one
> list. So I get list wchich consist of lists of objects
News wrote:
(snip)
> sometimes you can't see the forest .. trees and all that :)
Yes, been here too... I wrote a CSV parser before realising there was a
pretty good one in the standard lib :(
(snip)
> OT: I saw several references to "OP". What does this mean?
Original Poster
--
bruno desthuill
Thomas Girod wrote:
> Or maybe I'm mixing up what we call a "classmethod" with what we could
> call an "instance method" ?
>
That's what I was about to point out !-)
> class Data(list):
> __slots__ = ["width", "height", "label"]
>
> def __init__(self,width,height,label=None):
> l
Thomas Girod wrote:
> It's alright I found where my mistake came from. I was misunderstanding
> the meaning of "classmethod", thinking of it as an instance method.
Given that 'instance methods' being most of the time attributes of the
class object, such a confusion is not so surprising !-)
--
br
News wrote:
> Hi Everyone,
>
>
> The attached code creates client connections to websphere queue managers
> and then processes an inquiry against them.
>
> The program functions when it gets options from the command line.
>
> It also works when pulling the options from a file.
>
> My issue is
Burton Samograd wrote:
> Duncan Booth <[EMAIL PROTECTED]> writes:
>
>
>>Burton Samograd wrote:
>>
>>>Is there any way to 'prototype' functions in python, as you would in
>>>C? Would that be what the 'global' keyword is for, or is there a more
>>>elegant or 'pythonic' way of doing forward referen
Burton Samograd wrote:
> bruno at modulix <[EMAIL PROTECTED]> writes:
(snip)
>>*But* is it necessary to have the main() in the same file that defines
>>a_fun and b_fun ? It's quite common (and not only in Python) to use a
>>distinct file for the main(). So you
Burton Samograd wrote:
> "infidel" <[EMAIL PROTECTED]> writes:
>
>
>>If you want the user to be able to (re)define them in config.py, why
>>not just define them there in the first place? I may be wrong, but I
>>think "global" means "module level" rather than "interpreter level".
>
>
> That's w
Szabolcs Berecz wrote:
> On 14 Apr 2006 04:37:54 -0700, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
>
>>def a():
>> def b():
>>print "b"
>> def c():
>>print "c"
>>
>>how can i call c() ??
>
>
> Function c() is not meant to be called from outside function a().
> That's what a nested
501 - 526 of 526 matches
Mail list logo