Skip to content

Instantly share code, notes, and snippets.

@vi4m
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save vi4m/ab296d0edfa641ebb10c to your computer and use it in GitHub Desktop.

Select an option

Save vi4m/ab296d0edfa641ebb10c to your computer and use it in GitHub Desktop.

Revisions

  1. vi4m revised this gist Mar 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Write simple Singleton.
    ## Write simple Singleton.

    Write Singleton which returns the same object every time. You can use the implementation you want.

  2. vi4m revised this gist Mar 12, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    # Write simple Singleton.

    Write Singleton which returns the same object every time. You can use the implementation you want.

    ```python
    first_object = Singleton(name='test1')
    second_object = Singleton(name='test2')
    print(first_object.name == second_object.name)
    print(first_object.name == second_object.name)
    ```
  3. vi4m renamed this gist Mar 12, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.txt → gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    Write class Singleton.
    ======================
    # Write simple Singleton.

    first_object = Singleton(name='test1')
    second_object = Singleton(name='test2')
  4. vi4m revised this gist Mar 12, 2015. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    a1 = A(name='test1')
    a2 = A(name='test2')
    print(a1.name)
    print(a2.name)
    Write class Singleton.
    ======================

    first_object = Singleton(name='test1')
    second_object = Singleton(name='test2')
    print(first_object.name == second_object.name)
  5. vi4m created this gist Mar 12, 2015.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    a1 = A(name='test1')
    a2 = A(name='test2')
    print(a1.name)
    print(a2.name)