@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet


Comments:

<0> re
<1> can someone please give me a reason why you should never, ever ***ign to an instance's __cl***__ attribute?
<2> it kills innocent penguins that never did anything to harm you
<2> oh, you meant a REAL reason?
<2> there's certainly no prohibition against doing it
<1> well someone wants to do it
<1> in a project I'm a part of
<2> well, there's nothing "wrong" with doing that, although it's clearly unconventional



<2> Python is certainly dynamic enough to allow that to be possible
<1> the documentation seems to say it should be read-only
<1> and I had ***umed it wasn't possible
<2> does it?
<1> http://docs.python.org/lib/specialattrs.html#l2h-274
<2> hmm
<1> but it works, so there must be a reason for that.. :/
<2> well there's an obvious problem with that -- __dict__ is DEFINITELY not readonly
<2> mutating __dict__ is completely legitimate
<1> right
<1> and I think we might already do that
<2> so at the very least that "read-only" qualification is inaccurate to all of those attributes
<2> well changing __cl***__ definitely works in both CPython and Jython
<2> and like I said, mutating __dict__ is definitely legitimate, so I think that documentation is just wrong
<3> how do i get at a variable of an object's method
<3> def A:
<3> x = 1
<2> well that's illegal syntax for starters
<3> def A(self,foo):
<3> x = 1
<2> ok what about it
<2> x is a variable local to A
<3> it would be nice to peek inside and see what value x is at now
<2> how could you do that
<2> if A is not running then there is no local variables to A and x does not exist
<3> hm but i made an object
<3> i omitted the cl*** part
<2> whether it's a function or a method makes no difference
<2> is it self.x = 1 or x = 1?
<2> if it's an attribute on the instance, then you can query it at any time
<2> if it's a local variable inside the function/method, then asking what its value is when the function is not running is nonsensical



<3> it's not, i don't think. so i have to find a way to for the method to return x and save it outside
<3> then p*** it back to the method if i want to push it in again
<2> if you want access to it outside of A, then you need to store it on an instance, save it in a global, or return it
<3> ok tnx
<4> Haha, I took a look at Gamers.IRC. It's a mIRC script, and it seems the most advanced piece of code of it lies in the about box.
<1> sounds fun
<3> i guess there's no write/overstrike in python?
<3> just write or append?
<3> and no seeking when writing?
<4> What? Files?
<3> just text files
<3> write one line
<3> write next line
<3> overstrike first line with new info
<4> That would be troublesome, yes.
<3> i can get around it i guess
<3> i'll just read the file, find any duplicate and skip reading, then write buffer to a new file
<3> and append the new duplicate info
<5> hi
<6> anyone here knows what a MUD is?
<4> That stuff a PIG would ROLL in?
<6> oh well that too
<6> i'm refering to M.U.D.s thou
<4> I'm sure there's a dictionary that can help you.
<6> no , i know what it is
<6> i'm wondering if you know too :)
<4> Good for you.
<6> ok let me be more direct. anyone here willing to collaborate to create a text-based roleplaying game in python? i'm a programmer to, but i need partnership
<2> the Twisted guys are allegedly starting up their MUD-like project again
<6> oh well i dont play multiplayer games
<6> i dont have time to :). but sounds like a fun kill-time for a programmer ;)
<6> i mean , developing one
<7> mhmhmhm
<8> hey
<8> is there any method to turn off restricted mode in 2.4.2 ?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

paedophiles.com
openwrt perlmagick
Matty's mom
#politics
#computers
godaddy No available certificate corresponds to the SSL cipher suites which are
#politics
difference between SDCFH4096901 and SDCFH 4096
#politics
#gentoo



Home  |  disclaimer  |  contact  |  submit quotes