Other Notes

 
   

Ruby Way
By Hal Fulton
Slots : 1.0
Table of Contents
 


There is no UserString, etc., in Ruby. Use the actual classes themselves, since they can be opened and changed at any time. Use the Regexp class instead of importing the re module.

There is no cStringIO or codec module, but they seem like good candidates for porting.

See also: GC and ObjectSpace for garbage collection, WeakRef class (weakref.rb), Config module (rbconfig.rb), and the DBM class (dbm.rb).

Always remember that Ruby does not use dictionaries of objects as namespaces. When you use the Ruby equivalents of __methods__ and __members__, you will get arrays of strings representing the names of the methods or members.

There are intricate differences between Ruby's Marshal and Python's pickle/marshal modules (such as bytecode), but Ruby has load and dump, along with _load and _dump, which if defined will override the former.


   

 

 



The Ruby Way
The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition)
ISBN: 0672328844
EAN: 2147483647
Year: 2000
Pages: 119
Authors: Hal Fulton

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net