Re: Hiding a progressbar in tkinter

2019-06-28 Thread Cecil Westerhof
MRAB writes: > On 2019-06-26 16:47, Cecil Westerhof wrote: >> I just started with GUI stuff in tkinter. I have a progressbar, but I >> want it to be only visible when it is used. So I tried the following: >> window = Tk() >> window.title(window_str) >> frame = Frame(window) >>

Re: Hiding a progressbar in tkinter

2019-06-26 Thread MRAB
On 2019-06-26 16:47, Cecil Westerhof wrote: I just started with GUI stuff in tkinter. I have a progressbar, but I want it to be only visible when it is used. So I tried the following: window = Tk() window.title(window_str) frame = Frame(window) frame.pack(side = "top", fill =

Re: Hiding a progressbar in tkinter

2019-06-26 Thread Wildman via Python-list
On Wed, 26 Jun 2019 17:47:39 +0200, Cecil Westerhof wrote: > I just started with GUI stuff in tkinter. I have a progressbar, but I > want it to be only visible when it is used. So I tried the following: > window = Tk() > window.title(window_str) > frame = Frame(window) > frame.pac

Hiding a progressbar in tkinter

2019-06-26 Thread Cecil Westerhof
I just started with GUI stuff in tkinter. I have a progressbar, but I want it to be only visible when it is used. So I tried the following: window = Tk() window.title(window_str) frame = Frame(window) frame.pack(side = "top", fill = "both", expand = True) Button(window, text =

Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread Ian Kelly
On Thu, Oct 8, 2015 at 9:46 AM, alister wrote: > Oh please > the Caesar cypher was mentioned as a simplification for the purpose of > demonstration. > it was not intended to be even a remotely serious suggestion > > which I am sure at least Denis understood when he posted his tongue in > cheek rep

Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread alister
On Thu, 08 Oct 2015 08:44:43 -0600, Ian Kelly wrote: > On Wed, Oct 7, 2015 at 6:01 PM, Dennis Lee Bieber > wrote: >> On Wed, 7 Oct 2015 13:05:07 + (UTC), alister >> declaimed the following: >> >> >>>With a simple Cesar the method is "shift the alphabet by 'X' characters >>>and X is the key >

Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread Ian Kelly
On Wed, Oct 7, 2015 at 6:01 PM, Dennis Lee Bieber wrote: > On Wed, 7 Oct 2015 13:05:07 + (UTC), alister > declaimed the following: > > >>With a simple Cesar the method is "shift the alphabet by 'X' characters >>and X is the key >> >>if the key is unknown then the attacker still has to brute f

Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread cl
Dennis Lee Bieber wrote: > On Wed, 7 Oct 2015 13:05:07 + (UTC), alister > declaimed the following: > > > >With a simple Cesar the method is "shift the alphabet by 'X' characters > >and X is the key > > > >if the key is unknown then the attacker still has to brute force the > >method (admi

Re: Hiding code from intruders, a different slant on an old question

2015-10-07 Thread alister
that enables me to > do things easily in Python. > > > This is for protecting against any possible intruder who has gained > access to my system by breaking an ssh password or stealing my laptop > for example. It's *not* for hiding code that I'm giving to others, > I&#

Re: Hiding code from intruders, a different slant on an old question

2015-10-07 Thread Littlefield, Tyler
gt; script will show the program I have used. > You have two options here: 1) Use a strong encryption like aes256 etc and don't bother trying to "hide" the code because it's just a blob of data and they'll not crack it. 2) Encrypt the whole drive if you use something l

Hiding code from intruders, a different slant on an old question

2015-10-07 Thread cl
ams, if they're done separately this would be fairly well hidden but I was wondering if there's anything more obvious I can do that enables me to do things easily in Python. This is for protecting against any possible intruder who has gained access to my system by breaking an ssh password or

Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

2013-04-04 Thread Rotwang
On 04/04/2013 20:00, Jason Swails wrote: On Thu, Apr 4, 2013 at 1:30 PM, Rotwang mailto:sg...@hotmail.co.uk>> wrote: [...] I don't know whether this applies to the OP's code, but I can think of at least one reason why one would want both "import module" and "from module import*" at t

Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

2013-04-04 Thread Jason Swails
On Thu, Apr 4, 2013 at 1:30 PM, Rotwang wrote: > On 04/04/2013 14:49, Jason Swails wrote: > >> I've added some comments about the code in question as well... >> >> On Wed, Apr 3, 2013 at 11:45 PM, > > wrote: >> >> Hi, I am working with Tkinter, and I have set

Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

2013-04-04 Thread Rotwang
On 04/04/2013 14:49, Jason Swails wrote: I've added some comments about the code in question as well... On Wed, Apr 3, 2013 at 11:45 PM, mailto:teslafreque...@aol.com>> wrote: Hi, I am working with Tkinter, and I have set up some simple code to run: import tkinter import re

Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

2013-04-04 Thread teslafrequency
Thanks a lot for your help, I've implemented the code you suggested and it seems to be functioning properly now. I've cleaned up the code a bit as well. I'll also take into account not destroying the master. Thanks again for your help! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

2013-04-04 Thread Jason Swails
I've added some comments about the code in question as well... On Wed, Apr 3, 2013 at 11:45 PM, wrote: > Hi, I am working with Tkinter, and I have set up some simple code to run: > > import tkinter > import re > from tkinter import * > If you import everything from tkinter into your top-level n

Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

2013-04-03 Thread teslafrequency
Hi, I am working with Tkinter, and I have set up some simple code to run: import tkinter import re from tkinter import * global master master = Tk() # Start game Launcher def FormGUI(): master.title("GAME TITLE") SW = master.winfo_screenwidth() / 3.2 SH = master.winfo_screenheight()

Re: Hiding token information from users

2011-08-24 Thread Nobody
On Tue, 23 Aug 2011 06:27:39 -0700, Tobiah wrote: > I am making QR codes that cell phone users scan in order to make use of an > application. Part of the information is a token that needs to be passed > on to the server, but I'd rather not allow a person examining the QR code > to be able to see

Re: Hiding token information from users

2011-08-23 Thread Tobiah
On 08/23/2011 09:55 AM, Steven D'Aprano wrote: Tobiah wrote: I really need some sort of algorithm that will let me take an unknown string and generate the encrypted bit on the fly. Google broken for you? *wink* I had some requirements in the OP that I could not find a solution for. Seriou

Re: Hiding token information from users

2011-08-23 Thread Steven D'Aprano
Tobiah wrote: > I really need some sort of > algorithm that will let me take an unknown string and generate > the encrypted bit on the fly. Google broken for you? *wink* Seriously, there are about a bazillion algorithms for encrypting and obfuscating strings. Depending on your security requireme

Re: Hiding token information from users

2011-08-23 Thread Tobiah
On 08/23/2011 08:08 AM, Ian Kelly wrote: How many of these codes do you need, and do they only need to be decrypted at a central server? You might be able to just create random strings of whatever form you want and associate them with the tokens in a database. Then they will be completely opaque.

Re: Hiding token information from users

2011-08-23 Thread Ian Kelly
How many of these codes do you need, and do they only need to be decrypted at a central server? You might be able to just create random strings of whatever form you want and associate them with the tokens in a database. Then they will be completely opaque. -- http://mail.python.org/mailman/listinf

Hiding token information from users

2011-08-23 Thread Tobiah
I am making QR codes that cell phone users scan in order to make use of an application. Part of the information is a token that needs to be passed on to the server, but I'd rather not allow a person examining the QR code to be able to see that plain bit of information. I'd like to scramble up th

Re: hiding modules in __init__.py

2008-10-20 Thread Gabriel Genellina
En Sat, 18 Oct 2008 16:03:19 -0300, Brendan Miller <[EMAIL PROTECTED]> escribió: How would I implement something equivalent to java's package private in python? Say if I have package/__init__.py package/utility_module.py and utility_module.py is an implementation detail subject to change.

Re: hiding modules in __init__.py

2008-10-20 Thread Chris Rebert
On Sat, Oct 18, 2008 at 12:03 PM, Brendan Miller <[EMAIL PROTECTED]> wrote: > How would I implement something equivalent to java's package private in > python? > > Say if I have > > package/__init__.py > package/utility_module.py > > and utility_module.py is an implementation detail subject to chan

hiding modules in __init__.py

2008-10-18 Thread Brendan Miller
How would I implement something equivalent to java's package private in python? Say if I have package/__init__.py package/utility_module.py and utility_module.py is an implementation detail subject to change. Is there some way to use __init__.py to hide modules that I don't want clients to see?

Re: Why does python not have a mechanism for data hiding?

2008-06-12 Thread Luis Zarrabeitia
Quoting Dennis Lee Bieber <[EMAIL PROTECTED]>: > On Wed, 11 Jun 2008 21:54:33 -0700 (PDT), Michele Simionato > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > > > It looks like in French (as in Italian) *experimented* has the > > meaning of "tried and tested on the fiel

[OT] Re: Why does python not have a mechanism for data hiding?

2008-06-12 Thread Bruno Desthuilliers
Dennis Lee Bieber a écrit : On Wed, 11 Jun 2008 10:10:14 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: are some *very* talented and *experimented* programmers here. Pardon, but I think you mean "experienced". Indeed. Tim Golden already c

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Ben Finney
Michele Simionato <[EMAIL PROTECTED]> writes: > On Jun 12, 6:43 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > Pardon, but I think you mean "experienced". > > > > Of course, GvR may qualify as "experimented" if one considers > > designing a language from scratch to be an expe

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Michele Simionato
On Jun 12, 6:43 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 11 Jun 2008 10:10:14 +0200, Bruno Desthuilliers > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > are some *very* talented and *experimented* programmers here. > > Pardon, but I think you mea

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Paul Boddie
On 11 Jun, 21:28, "Russ P." <[EMAIL PROTECTED]> wrote: > > All I did was to suggest that a keyword be added to Python to > designate private data and methods without cluttering my cherished > code with those ugly leading underscores all over the place. I don't > like that clutter any more than I li

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Patrick Mullen
On Wed, Jun 11, 2008 at 12:28 PM, Russ P. <[EMAIL PROTECTED]> wrote: > > If Desthuilliers doesn't like my suggestion, then fine. If no other > Python programmer in the world likes it, then so be it. But do we > really need to get personal about it? Python will not be ruined if it > gets such a key

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Russ P.
On Jun 11, 2:36 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > Maybe, but I'd hope that some of those programmers would be at least > able to entertain what Russ has been saying rather than setting > themselves up in an argumentative position where to concede any > limitation in Python might be cons

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Paul Boddie
On 11 Jun, 10:10, Bruno Desthuilliers wrote: > Russ P. a écrit : > > > You may be right to an extent for small or medium-sized non-critical > > projects, but you are certainly not right in general. I read something > > a while back about the flight software for the Boeing 777. I think it > > was s

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Maric Michaud
Le Wednesday 11 June 2008 08:11:02 Russ P., vous avez écrit : > http://www.sofcheck.com > > Here is an excerpt from their website: > > "SofCheck’s advanced static error detection solutions find bugs in > programs before programs are run. By mathematically analyzing every > line of software, conside

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 10, 1:04 am, Bruno Desthuilliers wrote: If you hope to get a general agreement here in favor of a useless keyword that don't bring anything to the language, then yes, I'm afraid you're wasting your time. Actually, what I hope to do is to "take something away" from th

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 10, 11:58 am, Jonathan Gardner (snip) Who cares about private declarations, or interface declarations at all? It is only a message to the developers. If you have a problem with your users doing the right thing, that is a social problem, not a technical one, and the sol

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread cokofreedom
On Jun 11, 8:11 am, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 10, 11:58 am, Jonathan Gardner > > > Who cares what the type of an object is? Only the machine. Being able > > to tell, in advance, what the type of a variable is is a premature > > optimization. Tools like psyco prove that computers

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Russ P.
On Jun 10, 11:58 am, Jonathan Gardner > Who cares what the type of an object is? Only the machine. Being able > to tell, in advance, what the type of a variable is is a premature > optimization. Tools like psyco prove that computers (really, > programmers) nowadays are smart enough to figure thing

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Niklas Norrthon
On 6 Juni, 03:09, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 5, 2:57 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > "Russ P." <[EMAIL PROTECTED]> writes: > > > By the way, my recollection is that in C++ access defaults to private > > > if nothing is declared explicity. So normally the "priva

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Samuel Bayer
the attended overhead in merging it with subsequent releases, etc. I'm not going to claim that data hiding has no purpose - it clearly addresses a set of concerns that programmers have about managing APIs. But I've found that its difficulties far outweigh its benefits. Sam Bayer -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Jonathan Gardner
On Jun 10, 11:21 am, "Russ P." <[EMAIL PROTECTED]> wrote: > I took a risk in choosing Python, and I would > feel better about it if Python would move up to the next level with > more advanced features such as (optional) static typing and private > declarations. But every time I propose something li

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Patrick Mullen
Hi Russ, Here are just some pragmatic considerations. Personally I am against data hiding, but I obviously won't convince you in that regard. There are some pros and cons as with anything, and I feel the cons outweight the pros (namely that users of code should be able to use how they

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Russ P.
On Jun 10, 1:04 am, Bruno Desthuilliers wrote: > If you hope to get a general agreement here in favor of a useless > keyword that don't bring anything to the language, then yes, I'm afraid > you're wasting your time. Actually, what I hope to do is to "take something away" from the language, and

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Antoon Pardon
On 2008-06-09, Lie <[EMAIL PROTECTED]> wrote: >> >> That seems strange to me. The and-or simulation that was offerd in the >> FAQ allowed for about the same kind of structures as the ternary >> operator in C and was used in the standard library IIRC. >> >> So the same unreadable was already possibl

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 9, 2:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: But if it takes 6 month to get the mentioned developer to release something I can use, I'm screwed up. Fine. I've lost track of how many times I've said this now, but my suggestion for a "priv" keyword allowed

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Fuzzyman
On Jun 9, 10:23 am, Bruno Desthuilliers wrote: > Mark Wooding a écrit : > > > > > Fuzzyman <[EMAIL PROTECTED]> wrote: > > >> So, you are stating that no API programmer using Python *ever* has a > >> valid or genuine reason for wanting (even if he can

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > But if it takes 6 month to get the mentioned developer to release > something I can use, I'm screwed up. Fine. I've lost track of how many times I've said this now, but my suggestion for a "priv" keyword allowed for "indirect" ac

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread [EMAIL PROTECTED]
On 9 juin, 20:43, "Russ P." <[EMAIL PROTECTED]> wrote: (snip argument about s/private/public/g on a whole source tree not being a fork, and not being by far a worse hack than monkeypatching a small specific part of a whole lib - what can I say ?) > How about some common sense here. Good question

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:22 am, Bruno Desthuilliers wrote: > > Does > > anyone object to not having access from outside a function to local > > variables within the function? I doubt it. The other thing is that the > > vast majority of Python software, I would guess, is provided with > > source code. How many

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:23 am, Bruno Desthuilliers wrote: > Mark Wooding a écrit : > > > > > Fuzzyman <[EMAIL PROTECTED]> wrote: > > >> So, you are stating that no API programmer using Python *ever* has a > >> valid or genuine reason for wanting (even if he can

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Lie
On Jun 9, 7:20 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > > On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> Now of course noone would defend such a limitation on the grounds > >> that one doesn't need th

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Antoon Pardon
On 2008-06-07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> Now of course noone would defend such a limitation on the grounds >> that one doesn't need the general case and that the general case >> will only save you some ve

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Mark Wooding a écrit : Fuzzyman <[EMAIL PROTECTED]> wrote: So, you are stating that no API programmer using Python *ever* has a valid or genuine reason for wanting (even if he can't have it) genuine 'hiding' of internal state or members from consumers of his (or her...) A

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 6, 8:25 am, Bruno Desthuilliers wrote: I also realize, by the way, that Python allows a client of a class to define a new class member from completely outside the class definition. Obviously, that cannot be declared private. Why so ? Why should the client of a class

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 8, 5:40 am, Mark Wooding <[EMAIL PROTECTED]> wrote: Russ P. <[EMAIL PROTECTED]> wrote: The idea of being able to discern properties of an object by its name alone is something that is not normally done in programming in general. Really? You obviously haven't noticed P

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Mark Wooding a écrit : Russ P. <[EMAIL PROTECTED]> wrote: The idea of being able to discern properties of an object by its name alone is something that is not normally done in programming in general. Really? You obviously haven't noticed Prolog, Smalltalk, Haskell, ML, or Erlang then. And

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Patrick Mullen
"Well, "common" in Prolog, Smalltalk, Haskell, ML, and Erlang is hardly common in general. I'll bet that Java and C/C++ are used more in North Dakota than all those languages combined are used in the entire world." I would say python has more in common with the mentioned family than with the C or

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread John Salerno
Sh4wn wrote: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Others touched on this, but I thought I'd throw it in here as well since I was just reading about this. Apparently

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Russ P.
On Jun 8, 5:40 am, Mark Wooding <[EMAIL PROTECTED]> wrote: > Russ P. <[EMAIL PROTECTED]> wrote: > > The idea of being able to discern properties of an object by its name > > alone is something that is not normally done in programming in > > general. > > Really? You obviously haven't noticed Prolog

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Russ P.
On Jun 8, 5:52 am, Mark Wooding <[EMAIL PROTECTED]> wrote: > By enforcing your `data hiding', you're effectively telling me that I'm > too stupid to make rational decisions of this sort. And that's actually > extremely insulting. 1) I suggest you not take i

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Luis Zarrabeitia
I don't know about Erlang (though I'd think it's behaviour sould be similar to prolog), but at least in Prolog, yes, _ and _ are different variables. The whole idea of "_" is that it is a placeholder that can bind to anything, but will be immediately discarded. It's just syntactic sugar so you don

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Mark Wooding <[EMAIL PROTECTED]> wrote: > By enforcing your `data hiding', you're effectively telling me that I'm > too stupid to make rational decisions of this sort. And that's actually > extremely insulting. I think th

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Mark Wooding <[EMAIL PROTECTED]> wrote: > * Prolog and Erlang distinguish atoms from variables by the case of > the first letter; also `_' is magical and is equivalent to a new > variable name every time you use it. Can you explain that in more detail?

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Mark Wooding
Fuzzyman <[EMAIL PROTECTED]> wrote: > So, you are stating that no API programmer using Python *ever* has a > valid or genuine reason for wanting (even if he can't have it) genuine > 'hiding' of internal state or members from consumers of his (or > her...) API?

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Mark Wooding
Russ P. <[EMAIL PROTECTED]> wrote: > The idea of being able to discern properties of an object by its name > alone is something that is not normally done in programming in > general. Really? You obviously haven't noticed Prolog, Smalltalk, Haskell, ML, or Erlang then. And that's just the ones

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Mark Wooding
Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > How about #define class struct Won't work. Consider `template ...'. -- [mdw] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Mark Wooding
Paul Rubin wrote: > This is bogus about 95% of the time though. For the cases where it is > really desired, I think it's best to require the target class to be > enable it specifically somehow, maybe by inheriting from a special > superclass. That could let the compiler statically resolve membe

Re: expression IF (was: Why does python not have a mechanism for data hiding?)

2008-06-07 Thread John Nagle
BJörn Lindqvist wrote: On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: Now of course noone would defend such a limitation on the grounds that one doesn't need the general case and that the general case will only save you some vertical space. But when it came to the tern

Re: Why does python not have a mechanism for data hiding?

2008-06-07 Thread BJörn Lindqvist
On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Now of course noone would defend such a limitation on the grounds > that one doesn't need the general case and that the general case > will only save you some vertical space. > > But when it came to the ternary operator that

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Russ P.
On Jun 6, 8:28 am, Bruno Desthuilliers wrote: > Russ P. a écrit : > > > > > On Jun 5, 2:27 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >> On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), "Russ P." > >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>> would need to use a "man

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Russ P.
On Jun 6, 8:25 am, Bruno Desthuilliers wrote: > >>> I also realize, by the way, that Python allows a client of a class to > >>> define a new class member from completely outside the class > >>> definition. Obviously, that cannot be declared private. > >> Why so ? > > > Why should the client of a

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 5, 2:27 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), "Russ P." <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: would need to use a "mangled" name to access private data or methods. But you will be using the

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 5, 4:53 am, Bruno Desthuilliers wrote: Russ P. a écrit : Given your very recent discovery of what 'dynamic' *really* means in Python (like, for exemple, dynamically adding / replacing attributes - including methods - on a per-class or per-instance basis), possibly, y

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 4, 4:29 am, NickC <[EMAIL PROTECTED]> wrote: On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: What is it about leading underscores that bothers me? To me, they are like a small pebble in your shoe while you are on a hike. Yes, you can live with it, and it does n

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread cokofreedom
Someone asked about Java; class FieldTest { public String publicString = "Foobar"; private String privateString = "Hello, World!"; } import java.lang.reflect.Field; public class Test4 { public static void main(String args[]) { final Field fields[] = FieldTest.class.getDecla

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 2:57 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "Russ P." <[EMAIL PROTECTED]> writes: > > By the way, my recollection is that in C++ access defaults to private > > if nothing is declared explicity. So normally the "private" > > declaration is unnecessary. If it is left out, your littl

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 2:27 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), "Russ P." > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > would need to use a "mangled" name to access private data or methods. > > But you will be using the name many

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Ben Finney <[EMAIL PROTECTED]> wrote: > > > Then what you're really testing is the interactions of the "push > > the button" function with its external interface: you're asserting > > that the "push the red button" functio

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Hrvoje Niksic
"Russ P." <[EMAIL PROTECTED]> writes: > By the way, my recollection is that in C++ access defaults to private > if nothing is declared explicity. So normally the "private" > declaration is unnecessary. If it is left out, your little trick won't > work. How about #define class struct -- http://mai

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread David
On Wed, Jun 4, 2008 at 2:54 PM, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Ben Finney <[EMAIL PROTECTED]> wrote: > >> By definition, "private" functions are not part of the publicly >> documented behaviour of the unit. Any behaviour exhibited by some >> private compon

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Matthieu Brucher
2008/6/5 Russ P. <[EMAIL PROTECTED]>: > On Jun 5, 12:20 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > > > All somebody has to do to get at the private data is: > > > > #define private public > > # include > > #undef private > > Well, that shows the weakness of the C/C++ header files. The "include" >

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Larry Bates
Russ P. wrote: On Jun 2, 5:11 pm, Paul Rubin wrote: "Russ P." <[EMAIL PROTECTED]> writes: I also realize, by the way, that Python allows a client of a class to define a new class member from completely outside the class definition. Obviously, that cannot be declared p

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 12:20 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > All somebody has to do to get at the private data is: > > #define private public > # include > #undef private Well, that shows the weakness of the C/C++ header files. The "include" directive merely does a simple text substitution, which

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Russ P." <[EMAIL PROTECTED]> wrote: > In C++ (and > Java?), on the other hand, the "protected" keyword *really* prevents > the client from accessing the data or method, but it allows access to > derived classes. The "private" keyword goes further and prevents >

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread [EMAIL PROTECTED]
On 5 juin, 20:07, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 5, 4:47 am, Bruno Desthuilliers > > > [EMAIL PROTECTED]> wrote: > > Antoon Pardon a écrit : > > > > On 2008-06-04, NickC <[EMAIL PROTECTED]> wrote: > > >> On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: > > >>> What is it abou

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
> For the record, I have made it abundantly clear that I don't think > Python should not have as rigorous an encapsulation regime as C++ or > Java. The worst that could happen with my proposition is that you > would need to use a "mangled" name to access private data or methods. > But you will be

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
rd, what stops them from doing > s/private/public/g ? Seriously, the "underscores are ugly" argument > has some merit but language enforced data hiding is overrated, if not > downright silly. I did not claim that Python should have the same encapsulation rules as C++. I was mere

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 4:53 am, Bruno Desthuilliers wrote: > Russ P. a écrit : > Given your very recent discovery of what 'dynamic' *really* means in > Python (like, for exemple, dynamically adding / replacing attributes - > including methods - on a per-class or per-instance basis), possibly, yes. My "very r

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread George Sakkis
icious hacker ? A spammer ? Who are you trying to hide your precious classes from that the double leading underscore is not good enough protection ? Even with a 'private' keyword, what stops them from doing s/private/public/g ? Seriously, the "underscores are ugly" argument has so

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 4:47 am, Bruno Desthuilliers wrote: > Antoon Pardon a écrit : > > > On 2008-06-04, NickC <[EMAIL PROTECTED]> wrote: > >> On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: > >>> What is it about leading underscores that bothers me? To me, they are > >>> like a small pebble in your s

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread sturlamolden
On Jun 5, 3:26 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > So, you are stating that no API programmer using Python *ever* has a > valid or genuine reason for wanting (even if he can't have it) genuine > 'hiding' of internal state or members from consumers of his

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Fuzzyman
On Jun 3, 6:54 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On May 24, 3:41 pm, Sh4wn <[EMAIL PROTECTED]> wrote: > > > first, python is one of my fav languages, and i'll definitely keep > > developing with it. But, there's 1 one thing what I -really- miss:

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Bruno Desthuilliers
Russ P. a écrit : (snip) (answering to Carl Bank) I thought you were saying that encapsulation or so-called "data hiding" is worthless. As far as I'm concerned, I view encapsulation as very desirable, and data-hidding as totally worthless when applied to Python's object m

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Bruno Desthuilliers
Antoon Pardon a écrit : On 2008-06-04, NickC <[EMAIL PROTECTED]> wrote: On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: What is it about leading underscores that bothers me? To me, they are like a small pebble in your shoe while you are on a hike. Yes, you can live with it, and it does

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Antoon Pardon
On 2008-06-05, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 05 Jun 2008 08:21:41 +, Antoon Pardon wrote: > >> On 2008-06-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >>> On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote: >>> On 2008-06-04, Marc 'BlackJack'

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Marc 'BlackJack' Rintsch
On Thu, 05 Jun 2008 08:21:41 +, Antoon Pardon wrote: > On 2008-06-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote: >> >>> On 2008-06-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >>> >> it makes sense to me to al

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Antoon Pardon
On 2008-06-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote: > >> On 2008-06-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> > it makes sense to me to also test if they work as documented. If they affect the

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > Then what you're really testing is the interactions of the "push the > button" function with its external interface: you're asserting that > the "push the red button" function actually uses the result from "pick > a random ci

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Ben Finney
Ethan Furman <[EMAIL PROTECTED]> writes: > I must be missing something in this discussion. Perhaps it's the > appropriate point of view. At any rate, it seems to me that any and > every function should be tested to ensure proper results. I restrict that to "every proper behaviour the system is ex

  1   2   3   >