Question: In Gitlab, is there a way with CI/CD or another trick to generate a .zip package with chosen folders after each commit? A script to use in CI/CD ?

I know we can download a whole repository with the button "download source code" but I need to create a package .zip with only some folders of the repository.

Thanks :).

Answer: 
> 
> New is used to create class instances. What are the other uses of **new**
> method?
> 
> 
> 

You can use `__new__` to implement singleton pattern (where pattern must be understand as thing described in *Design Patterns: Elements of Reusable Object-Oriented Software*), take look at example provided by [geeksforgeeks.org](https://www.geeksforgeeks.org/singleton-pattern-in-python-a-complete-guide/) of **Classic Singleton**

```
class SingletonClass(object):
  def __new__(cls):
    if not hasattr(cls, 'instance'):
      cls.instance = super(SingletonClass, cls).__new__(cls)
    return cls.instance

singleton = SingletonClass()
new_singleton = SingletonClass()

print(singleton is new_singleton)

singleton.singl_variable = "Singleton Variable"
print(new_singleton.singl_variable)

```
**new** is basically a standard Python method that is invoked before **init** when a class instance is created. For further information, see the python **new** manual: <https://docs.python.org/3/reference/datamodel.html#object.__new>\_\_

There is not other direct usage of it.

Regarding the difference between Init/New: The constructor function in python is called **new** and **init** is the initializer function. According to the Python documentation, **new** is used to control the creation of a new instance, whereas **init** is used to handle its initialization.