Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python what

Name: Anonymous 2007-07-20 10:50 ID:7YlxCtHe

Recently I tried making a web application in Django and found Python to be baffling because I couldn't find in any book/tutorial  how to write a goddamn class method.  And the dude made it seem like it was a totally obscure and pointless question.  I don't know how to accomplish anything without them.  Python is whack.  The only reason I used it is because it sort of resembles Ruby but isn't as slow as a turd like Ruby is.

Name: Anonymous 2007-07-20 10:52 ID:Heaven

And the dude made it seem like it was a totally obscure and pointless question.

The dude was right.

Name: Anonymous 2007-07-20 10:53 ID:JHLO9FC2

What did you try?

Name: Anonymous 2007-07-20 10:55 ID:Heaven

He tried to get ENTERPRISE.

Name: Anonymous 2007-07-20 11:07 ID:7YlxCtHe

Class methods are very necessary.  Sometimes I want to accomplish something that is related to a particular class but not an instantiated object.  Is that too much to ask?

Name: Anonymous 2007-07-20 11:09 ID:zhr3vnHs

>>5

Yes

Name: The dude 2007-07-20 11:11 ID:CsyamrGf

Just fuck you already. @classmethod.

Name: Anonymous 2007-07-20 13:11 ID:zE1Q/aYp

How is ORM implemented in Python?

Name: Anonymous 2007-07-20 13:14 ID:CsyamrGf

Name: Anonymous 2007-07-20 16:04 ID:zE1Q/aYp

A broken clock is right twice a day. :(

As ENTERPRISEY as ORM is, it really does beat mixing your code with SQL.

Name: Anonymous 2007-07-20 16:28 ID:Heaven

>>10
not necessarily... it could be a digital clock and be broken in such a way as to not display any time at all.
also, you're an EXPERT PROGRAMMER, your code is SQL.

Name: Anonymous 2007-07-20 16:33 ID:Heaven

>>11
s/o,/o, if/

Name: Anonymous 2007-07-20 17:33 ID:ZkG71VX+

test

Name: Anonymous 2007-07-21 3:01 ID:WEbAIB0T

Hopefully Ruby 1.9 will be fast enough so it won't matter.

Name: Anonymous 2007-07-21 7:23 ID:Nz8HKjSm

>>1
What?

#inside some class
@classmethod
def lol(cls, stupid):
    if stupid:
        print "Yes you're stupid"


Of course that's a class method, which may not be what you're looking for. It receives the class of the object used to call it as first param. If you want a static method, which receives no class, use @staticmethod .

>>10
No, if you can do SQL. Declarative language > OO imperative language, even if the former is ugly. The kind of shit you can do with SQL makes life easier, and then you can easily treat the results it as a value, a list, or a table.

>>14
Weeaboo

Name: Anonymous 2007-07-21 10:06 ID:4QoRZCUW

| ID:WEbAIB0T
Please tell me this ID isn't forged.

Name: Anonymous 2007-07-21 14:26 ID:y1KPqM5A

No, if you can do SQL.
Well, see, I can do SQL just fine. It's just that it makes refactoring a nightmare with SQL interspersed throughout the code. I've worked on non-trivial apps that do things the old way, and it's ugly.

ORM has problems, but it does one thing nicely: it isolates the SQL away from everything else.

The kind of shit you can do with SQL makes life easier, and then you can easily treat the results it as a value, a list, or a table.
Uh... I don't think you've used ORM. If you have, and you still believe the above, then it was probably something hamstrung.

Name: sli 2007-07-21 15:14 ID:Rpn9W2/u

class ClassName:
    def __init__(self,arguments,go,here):
        self.arguments = arguments
        self.go = go
        self.here = here

    def PrintIt(self):
        print self.arguments
        print self.go
        print self.here

c = ClassName('hello','mr.','4chonz')
c.PrintIt()

--------------
Output:
--------------
hello
mr.
4chonz

Name: Anonymous 2007-07-21 18:01 ID:ydGRMLIJ

Purebasic

Name: Anonymous 2007-07-21 21:14 ID:Nz8HKjSm

>>17
Ok, let's see how you do a selection of certain group and non-group functions applied to a group by of several joined tables (some with outer joins, some with inner joins) with rollup, ordered by three different criteria, one of them functional and descendent with an ORM.

Name: Anonymous 2007-07-22 14:43 ID:ercKe2jm

>>20
zOMG wrap the SQL up in a single method call.

Wow, what a hard solution to a corner case. Can you flaunt your ignorance any harder?

Name: Anonymous 2007-07-22 18:39 ID:Ow+NwxWK

>>21
Then you're writing SQL and mixing it with your code you fucking retard! If you're willing to do that, then why are you bitching?

Name: Anonymous 2007-07-22 19:48 ID:ercKe2jm

>>22
Hello Captain Obvious: isolation, locality, and a large degree of automation.

I'm convinced you're a PHP moron. Everyone else has seen the light.

Name: Anonymous 2007-07-22 22:21 ID:Heaven

Name: Anonymous 2007-07-24 22:13 ID:H7mtPBXN

>>16
I'm not sure how I got it.  And I have no idea how textboard IDs are generated or what they actually represent.

Name: Anonymous 2007-07-25 3:50 ID:J6Gczrg1

>>24
BIGINT UNSIGNED UNIQUE PRIMARY KEY AUTO_INCREMENT NOT NULL

Name: Anonymous 2007-07-25 4:28 ID:d0TrwRWt

>>25

As far as I know, they're generated randomly from the IP address and current time (quantized to a few hours), so you can tell if you are responding to the same Anonymous.

Name: Anonymous 2009-01-14 15:05

VALID PERL CODE

Name: Anonymous 2009-08-17 0:18

Lain.

Name: Anonymous 2010-12-17 1:20

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-02-04 18:15


Don't change these.
Name: Email:
Entire Thread Thread List