| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> Zalamander, for a file object <1> but that has nothing to do with the usefulness of constructors. No one is saying that we shouldn't have a file object constructor <2> but file() isnt a constructor ;-) <1> polpak yes, that's fine with me. The problem, as I noted before, is that it is probably a bad idea to "want a file specifically" <0> Zalamander, I doubt it. If I want a dict, I construct one. <2> thus the need for streams where a file is a generalization of a stream <3> Tantalum: by the same argument are str,int and float also not constructors <2> hold on and let me cheack <2> yes they arent constructors
<0> Zalamander, Tantalum was arguing that I shouldn't use file() instead of open() even when I want a file(). Mostly he was just parroting GvR's sentiment. But if I want a file() I prefer to make a file() and see in my code that that's what I made <3> but: type(file("/dev/null")) is file gives True, so how do you call them? <3> file and the rest are definitely cl***es and e.g. calling file with the correct arguments gives an instance of file <2> ChrisLong: you should use isinstance(file("/dev/null"), file) ... type() is absoulete <1> polpak hm, that's not how I read what Tantalum said. It seems to me he said that file() shouldn't be used *because* GvR said so ... not "because of the reason GvR said so" <4> obsolete? <4> really? why? <2> incase no one noticed I cant spell :'( <0> Zalamander, true enough. I was therefore having to argue with GvR using Tantalum as a proxy ;p <1> polpak indeeed :-) And your point seems valid to me ... but so does Tantalum's <2> just dont shoot the messanger <0> Zalamander, since Tantalum didn't provide any reasoning of his own I had to fall back to arguing against GvR's <5> Let's get things in order, just like Java has. In Python 3000, I should abe able to type: from filesystem.SequentialStreams import SequentialTextStreamReaderWriter before opening any files. that will be clear, unambigous and truly ENTERPRISE! <1> polpak he did provide reasoning -- the reasoning is that it is good practice to "do what GvR says", for that sake alone. <0> Zalamander, yeah, that didn't work for me in church either.. ;p <1> Erwin ooo, you said "Enterprise"! <2> but god is an idiot and GvR created python <1> polpak in this case though it has practical merit, not just moral imperative <6> it is good because it makes future/past compatability more likely <6> to work <1> and because the conformity makes the existing body of Python code more homogenous, and thus easier to share <0> Zalamander, I just dislike idiosyncrasy. I prefer consistancy. And while python is one of the most internally consistant language I have found.. it still has it's oddball "warts" <0> Zalamander, I consider the open/file controvercy one of them.. ;) <2> "there are two types of programming languages, the type tht no one uses and they typr that every one bitches about" - not me <7> join #mplayer <8> werneck: this is #python :) <9> what is python's version of 'try' and 'catch' ? <10> try... except <2> yi <2> ; no <5> What's the ~ method? <8> Tantalum: ?
<0> Erwin, ? <2> misspell in the wrong window <11> Erwin: __invert__, it looks like <8> interesting that one 'inverts' methods :) <5> roryy: Thanks. <5> Hmm, damn, that's not going to work out right. I need to write an en expression evaluator that I can scan for usage of variables and attributes, to prepare some database queries to give it data to work on. <5> But I'll need it to build up a delayed evaluation tree if I am to find out exactly what attributes are used. Or do some analysis of the AST, I'm not sure which is easier. <5> I.e. given "a + b > c.r1" I need to know that "a", "b" and attribute "r1 of c" are involved in the evaluation <5> I have some 1000 lines of really ancient static type checking code for Python which used logilab's AST functions ,but I can't remember a thing about the API anymore <12> people, Google release GWT, anyone know if are there some binding (somenthing) ro programming python using GWT (Google Web Toolkit) ? <5> Fun AST tricks -- this replaces constant names with their values at compile time. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/435694 <5> Hmm, using the AST module to analyse your code to find all globals & their named attribute access turns out to be very easy :) <4> what's a good way to communicate with an oracle (9 or 10) database from python? i mean, i haven't seen an official python package from oracle, so it's iether open-source ones or odbc, or some other thing i don't know <4> how'd you do that? <5> Yes, there are several Oracle interfaces. <2> either odbc(Shudder) or DCOracle2 <5> http://www.python.org/topics/database/modules.html shows 4 <5> cx_Oracle seems the most up-to-date <4> i think i'll try cx_oracle. i'll have to look for other people using it, i guess. open-source can't go right hte first time <13> hi! When I start a thread...in this thread I create a new thread which job is to monitoring the current running thread. How to create this monitoring thread so that it runs in the background? <2> you mean like thread.setDeamon() <13> Tantalum: hm this doesn't work for me <2> what do you mean when you say you want it to woek in the background? <2> any way I'd love to help but I'v got to go... <14> hm <14> can anyone recommend a simple library in python to do simple string substitutions? <14> er, that's kind of vague. hmm. I made up a little configuration language for a piece of software <5> Define "simple". <14> i'd like to have a way to replace all instances of "$FILE" with something the software will actually replace <14> maybe i should just use regular expressions. hm. <15> Hello. Anyone here with a little experience with Python on a Mac? <16> simple? 'foo'.replace('o','a')? <5> >>> vars = dict(foo=42,bar=55); print re.sub(r'\$\{(.*?)}', lambda x: str(vars.get(x.group(1))), "My ${foo} is ${bar}.") <5> My 42 is 55. <5> ${variable} replacement in one line :- <14> thanks <14> :P <17> is it possible to read a text file inside a bzip2 with python?
Return to
#python or Go to some related
logs:
#debian #web gentoo cannot find xmkmf #css #mysql bt868krf driver #math #postfix #lisp phpmyAdmin extension dir
|
|