0

Ruby's OpenStruct for Python

Project Type
Existing open source project
Summary

Ruby's OpenStruct for Python

Description
An early stage attempt to emulate Ruby's OpenStruct for Python. For starters, it converts a dictionary to an object. Anyone can contribute if they want.
Tech Stack
Python
Current Team Size
1
URL
Comments
  • 0
    wait you mean something like this ?
    https://pastebin.com/m2Ppmrqi
  • 0
  • 0
    @Prakhar96 you got me to computer for 20 minutes to construct this pastebin xD
    Feel free to take code if you like it.
    Some advise:
    Write some issues so people can know what they need to contribute.
    I don't know what object construct is in Ruby but you can override almost everything in Python so it's nice to ex add + dictionaries etc.
  • 0
    @vane No, I don't really need the code. Did you check the project link? 😅😅

    The basic is completed. The idea is to make it as extensive as the OpenStruct. The link to the OpenStruct is mentioned in the project link.

    Also, merging dictionary is already supported in the project.

    Thanks for the advice 😄
  • 1
    @Prakhar96 yeah but in your library you can't write
    a = FlexibleObject({})
    a.b.c.d.e.f.g.h.i.j.k = "k"
    and with 3 more lines you can write it with my code ;)
  • 0
    @Prakhar96 sorry for stealing your name.
    I made some changes ;)
    https://pastebin.com/4RzRsW3x
    I go back to watching hbo go now.
    Need to rest a bit.

    Have fun !
Add Comment