8
[原文]P116
start_xxx and do_xxx methods are not called directly; the tag, method, and attributes are passed to this function, handle_starttag, so that descendants can override it and change the way all start tags are dispatched. You don't need that level of control, so you just let this method do its thing, which is to call the method (start_xxx or do_xxx) with the list of attributes. Remember, method is a function, returned from getattr, and functions are objects.
[pope译]start_xxx 和 do_xxx 方法没有直接被使用;tag,method,和属性(attributes) 是通过handle_statttage,所以子类可以覆盖它并且改变全部的tags的派遣(dispatched).你并不需求那个水平的控制力(the level of control){[?]这个翻译好牵强啊!还是在查查吧},所以你仅需要调用method时,让method做它自己的事(start_xxx或是do_xxx)使用属性(attributes)列表.记住,method 是 一个从getattrf返回的函数,并且函数是对象{[?]and functions are objects 的翻译,郁闷怎么看都感觉有问题。查一下别人的翻译吧!}()
[net 译 来源:http://woodpecker.org.cn/diveintopython/html_processing/dialect.html]
start_xxx 和 do_xxx 方法并不被直接调用;标记名、方法和属性被传给 handle_starttag 这个方法,以便继承者可以覆盖它,并改变全部 开始标记分发的方式。我们不需要控制这个层面,所以我们只让这个方法做它自已的事,就是用属性 list 来调用方法 (start_xxx 或 do_xxx) 。记住 method 是一个从 getattr 返回的函数,而函数是对象。
[popexizhi
so that descendants can override it and change the way all start tags are dispatched.
[pope译]所以子类可以覆盖它并且改变全部的tags的派遣(dispatched)
[net 译]以便继承者可以覆盖它,并改变全部 开始标记分发的方式
[popexizhi] and 之前的descendants can override it 说的是继承者重载此对象的start_xxx 或do_xxx 方法,这个没有问题;但是这个 change the way all start tags are dispatched 理解有点儿问题,应该是 descendants change the way all start tags are dispatched , 就是说 descendants change,change什么呢? the way ,这个 all start tags are dispatched 的way 。现在想来这个 tags的dispathed 应该说的是子类和父类同名方法哪个被调用的过程,所以net 译的开始标记分发的方式 的直译没有问题,只是这样理解成中文也很别扭,而pope的翻译是惨不忍睹的 dispatched :)
which is to call the method (start_xxx or do_xxx) with the list of attributes.
[pope译](start_xxx或是do_xxx)使用属性(attributes)列表
[net 译]就是用属性 list 来调用方法 (start_xxx 或 do_xxx)
[popexizhi] pope忘记翻译call the method 了,:) 这里说的属性列表应该是do 或者 start 吗?不是的应该是最后一个传入的参数attrs的列表才对,好吧这里都翻译成中文后理解上好麻烦的,我到感觉将参数时,是不是不翻译参数名称后可以好理解一点儿呢?!我猜想啊!
Remember, method is a function, returned from getattr, and functions are objects.
]
(I know you're getting tired of hearing it, and I promise I'll stop saying it as soon as I run out of ways to use it to my advantage.)
[pope译](我知道你在努力听懂,我承诺(promise) 我在你的学会擅长使用它后才停止讲述[?]嘻嘻,查查吧,我自己都被自己说晕了I run out of ways to use it to my advantage)
[net 译 来源:http://woodpecker.org.cn/diveintopython/html_processing/dialect.html]
(我知道您已经听腻了,我发誓,一旦我们停止寻找新的使用方法来为我们服务时,我就决不再提它了。)
[popexizhi:
you're getting tired of hearing it
[pope译]你在努力听懂
[net 译]您已经听腻了
[popexizhi] 哈哈哈!tired pf 是努力在 ,不过仔细想想 中文这个词也可以这样讲 ,单单说“努力的”可以做委屈求全的动作,不过加上“听懂”就太牵强了:).还是说 你在努力听好点儿,嘻嘻,借口中翻译为 你听烦了还是对的。
I run out of ways to use it to my advantage
[pope译]你的学会擅长使用它
[net 译]我们停止寻找新的使用方法来为我们服务
[popexizhi] pope的就不用说了太不着方向了,net的感觉也不知所云,这里读原文这个 my advantage 感觉像说这个例子中的,这里认为作者表示的是这个例子中使用getattr 讲述完之后就不再提它了,应该是这样吧?!
]
Here, the function object is passed into this dispatch method as an argument, and this method turns around and calls the function.
[pope译] 这里,函数对象(the function object)作为方法(as an argumnet )被传递到(is passed into) 调度方法(this dispath method ),此方法轮流调用此函数(this method turns around and calls the function)[?]查查吧,我晕死了刚知道自己的中文好晕乎啊:)
[net 译 来源:http://woodpecker.org.cn/diveintopython/html_processing/dialect.html]
这时,函数对象作为一个参数传入这个分发方法,这个方法反过来再调用这个函数。
[popexizhi:
the function object is passed into this dispatch method as an argument, and this method turns around and calls the funciton
[popexizhi] 首先这个this disatch method 是指传入参数method 为 要调用的方法的入口地址这个事情,感觉这个事 还是直接翻译为函数指针可能我理解起来更方便:) 好吧我是C出身了:) ;之后 这个 this method 就是说的 传入的这个method参数了,实际这句话和下文说的都是 method(attrs) 这句,不过这里重点说的 是method 调用函数的地址入口,而下面这句重点倒是说的是那个attrs 这个参数。(自己近来感觉翻译像是一个原文描述一个实物或过程,自己再用中文转述这个object 的过程,只是这个转述过程中自己的中文表达欠佳就都显示出来了。而那个原文描述过程中自己原文的语言欠缺就表现的淋漓尽致,这个出问题是不知所云,转述出问题,恨自己语言无力,面目可憎啊:))
[pope改进译] 这个函数对象通过函数指针方式作为一个参数传入,反过来通过这传入的指针地址调用此函数。
]
At this point, you don't need to know what the function is, what it's named, or where it's defined; the only thing you need to know about the function is that it is called with one argument, attrs.
[pope译]这里,你不需要知道此函数的名称,或者它在哪里定义;这里你唯一要求知道的就是这个函数作为attrs的一个参数被调用了。
[net 译 来源:http://woodpecker.org.cn/diveintopython/html_processing/dialect.html]
在这里,我们不需要知道函数是什么,叫什么名字,或是在哪时定义的;我们只需要知道用一个参数 attrs 调用它
[popexizhi:
ok,上面解释这句了,不多说了。
]
没有评论:
发表评论