Re: To whoever hacked into my Database

2013-11-12 Thread Tim Chase
On 2013-11-11 22:24, ru...@yahoo.com wrote: > And your suggestion is not necessarily best either: why a 1:M > relationship? why not a M:M relationship? There may be duplicate > file downloads resulting in your suggestion being non-normalized. You think that, after rejecting the addition of *one*

Re: To whoever hacked into my Database

2013-11-12 Thread Ned Batchelder
On Tuesday, November 12, 2013 1:31:32 AM UTC-5, ru...@yahoo.com wrote: > On 11/11/2013 06:16 PM, Ned Batchelder wrote: > > Nikos has received a good deal of genuine advice. He has also been > > genuinely difficult to help. > > Yes. If he is too difficult to help without getting > angry because h

Re: PyMyth: Global variables are evil... WRONG!

2013-11-12 Thread Ricardo Aráoz
El 12/11/13 01:46, Rick Johnson escribió: No, Python modules can be poked, prodded, and violated by any pervert who can spell the word "import". Attribute values can be reassigned and state can be externally manipulated resulting in all types of undefined behaviors -- Nice! My code, my respo

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Steven D'Aprano
On Tue, 12 Nov 2013 18:12:43 +1100, Chris Angelico wrote: > def isimmutable(x): > try: > hash(x) > return True > except TypeError: > return False I'm afraid that doesn't test for immutability. It tests for hashability, which is different. No well-behaved mutable

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Frank-Rene Schäfer
> So how do you figure out whether something's immutable or not? Are you > going to ask the object itself? If so, stick with __hash__, and just > follow the rule that mutable objects aren't hashable - which is, if > I'm not mistaken, how things already are. And if not, then how? How > will you know

Re: Basic Python Questions - Oct. 31, 2013

2013-11-12 Thread E.D.G.
"E.D.G." wrote in message news:yo-dnwfmi7_7d-jpnz2dnuvz_hqdn...@earthlink.com... Posted by E.D.G. on November 12, 2013 The following is part of a note that I just posted to the Perl Newsgroup. But it is actually intended for all computer programmers who are circulating free download s

Re: Creating a function for a directory

2013-11-12 Thread Peter Otten
unknown wrote: > On Mon, 11 Nov 2013 14:26:46 -0800, Matt wrote: > >> So I want to take the file, "desktop/test.txt" and write it to >> "desktop/newfolder/test.txt". I tried the below script, and it gave me: >> "IOError: [Errno 2] No such file or directory: 'desktop/%s.txt'". Any >> suggestions w

Re: To whoever hacked into my Database

2013-11-12 Thread Antoon Pardon
Op 12-11-13 10:35, Chris Angelico schreef: > On Tue, Nov 12, 2013 at 8:34 PM, Mark Lawrence > wrote: >> On 12/11/2013 05:21, Gregory Ewing wrote: >>> >>> Ned Batchelder wrote: I don't know how best to make things better overall. I know that overlooking Nikos' faults won't do it. >

Re: datetime question

2013-11-12 Thread Ferrous Cranus
Στις 8/11/2013 11:11 μμ, ο/η Νίκος Αλεξόπουλος έγραψε: Is there someway to write the following line even better with the ability to detect daylight saving time by itself so i don't have to alter the line manually when time changes? lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(

Re: Creating a function for a directory

2013-11-12 Thread unknown
On Mon, 11 Nov 2013 14:26:46 -0800, Matt wrote: > So I want to take the file, "desktop/test.txt" and write it to > "desktop/newfolder/test.txt". I tried the below script, and it gave me: > "IOError: [Errno 2] No such file or directory: 'desktop/%s.txt'". Any > suggestions would be great. > > >

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Chris Angelico
On Tue, Nov 12, 2013 at 8:39 PM, Frank-Rene Schäfer wrote: >> All you've done is proven that you can subvert things. By fiddling >> with __hash__, __eq__, and so on, you can make sets and dicts behave >> very oddly. Means nothing. > > To the contrary, it means everything about what 'isimmutable' c

Re: To whoever hacked into my Database

2013-11-12 Thread Chris Angelico
On Tue, Nov 12, 2013 at 8:34 PM, Mark Lawrence wrote: > On 12/11/2013 05:21, Gregory Ewing wrote: >> >> Ned Batchelder wrote: >>> >>> I don't know how best to make things better overall. I know that >>> overlooking Nikos' faults won't do it. >> >> >> If everyone who reached the point where they d

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Frank-Rene Schäfer
> All you've done is proven that you can subvert things. By fiddling > with __hash__, __eq__, and so on, you can make sets and dicts behave > very oddly. Means nothing. To the contrary, it means everything about what 'isimmutable' could contribute: security against advert or inadvert insertion of

Re: To whoever hacked into my Database

2013-11-12 Thread Dotan Cohen
On Fri, Nov 8, 2013 at 7:11 PM, wrote: > Long before you showed up here, I noticed the tendency > to not answer questions directly but to jerk people off > by giving hints or telling them to do something other > than they want to do. > > Often that is good because the original request was > for s

Re: To whoever hacked into my Database

2013-11-12 Thread Mark Lawrence
On 12/11/2013 05:21, Gregory Ewing wrote: Ned Batchelder wrote: I don't know how best to make things better overall. I know that overlooking Nikos' faults won't do it. If everyone who reached the point where they don't think they can help any more would simply say so in a calm manner and then

Re: datetime question

2013-11-12 Thread Mark Lawrence
On 12/11/2013 07:25, alex23 wrote: On 12/11/2013 2:49 PM, Grant Edwards wrote: Don't forget that there are also some differences between American and Imperial whitespace. Since it's ASCII whitespace, you should probably assume American... >>> sys.getsizeof(' ') 34 >>> sys.getsizeof(u' ') 52

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Chris Angelico
On Tue, Nov 12, 2013 at 8:12 PM, Frank-Rene Schäfer wrote: > (1) hash()-ability != immutability (!) > > Proof: > > class X: > def __hash__(self): return 0 > x == y != y == x Proof: class X: def __eq__(self,other): return True class Y: def __eq__(self,other): return False All you've d

Re: UTF-32 decoder optimization in Python 3.4

2013-11-12 Thread Mark Lawrence
On 12/11/2013 02:11, Terry Reedy wrote: On 11/11/2013 4:41 PM, Mark Lawrence wrote: From http://docs.python.org/dev/whatsnew/3.4.html#optimizations "The UTF-32 decoder is now 3x to 4x faster.". Does anybody have any references to this work? All I can find is the 3.3 what's new which refers to

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Frank-Rene Schäfer
(1) hash()-ability != immutability (!) Proof: class X: def __hash__(self): return 0 def pseudo_isimmutable(this): try: hash(this) return True except TypeError: return False shapeshifter = (1, 2, X()) print pseudo_isimmutable(shapeshifter) shapeshifter[2].chan

Re: To whoever hacked into my Database

2013-11-12 Thread Antoon Pardon
Op 12-11-13 07:31, ru...@yahoo.com schreef: > On 11/11/2013 06:16 PM, Ned Batchelder wrote: >> On Monday, November 11, 2013 5:47:28 PM UTC-5, ru...@yahoo.com wrote: >>> On 11/08/2013 11:08 AM, Chris Angelico wrote: On Sat, Nov 9, 2013 at 4:11 AM, wrote: > On 11/08/2013 03:05 AM, Νίκος Αλ

Re: Conditional breakpoints in ceval.c

2013-11-12 Thread David Froger
Quoting Ned Batchelder (2013-11-09 14:24:34) > On Friday, November 8, 2013 9:03:51 PM UTC-5, Demian Brecht wrote: > > Hi all, > > > > I have an .py file with a simple assignment in it: > > foo = 'bar' > > > > Now, I want to set a conditional breakpoint in gdb, breaking on that > > assignment (I'm

Re: Getting globals of the caller, not the defining module

2013-11-12 Thread Rotwang
On 12/11/2013 01:57, Terry Reedy wrote: On 11/11/2013 7:02 AM, sg...@hotmail.co.uk wrote: (Sorry for posting through GG, I'm at work.) On Monday, November 11, 2013 11:25:42 AM UTC, Steven D'Aprano wrote: Suppose I have a function that needs access to globals: # module A.py def spam(): g

<    1   2