Repository: apify/crawlee-python
File: src/crawlee/storage_clients/_memory/_memory_storage_client.py (Python)

Code before:

    _TEMPORARY_DIR_NAME = '__CRAWLEE_TEMPORARY'
    """Name of the directory used to temporarily store files during purges."""

    _DATASETS_DIR_NAME = 'datasets'
    """Name of the directory containing datasets."""

    _KEY_VALUE_STORES_DIR_NAME = 'key_value_stores'
    """Name of the directory containing key-value stores."""

    _REQUEST_QUEUES_DIR_NAME = 'request_queues'
    """Name of the directory containing request queues."""

    def __init__(
        self,
        *,
        write_metadata: bool,
        persist_storage: bool,
        storage_dir: str,
        default_request_queue_id: str,
        default_key_value_store_id: str,
        default_dataset_id: str,
    ) -> None:
        """A default constructor.

        In the most cases you should use the `from_config` constructor to create an new instance based on
        the provided configuration.

        Args:
            write_metadata: Whether to write metadata to the storage.
            persist_storage: Whether to persist the storage.
            storage_dir: Path to the storage directory.
            default_request_queue_id: The default request queue ID.
            default_key_value_store_id: The default key-value store ID.
            default_dataset_id: The default dataset ID.
        """
        # Set the internal attributes.
        self._write_metadata = write_metadata
        self._persist_storage = persist_storage
        self._storage_dir = storage_dir
        self._default_request_queue_id = default_request_queue_id
        self._default_key_value_store_id = default_key_value_store_id
        self._default_dataset_id = default_dataset_id

        self.datasets_handled: list[DatasetClient] = []
        self.key_value_stores_handled: list[KeyValueStoreClient] = []
        self.request_queues_handled: list[RequestQueueClient] = []

        self._purged_on_start = False  # Indicates whether a purge was already performed on this instance.
        self._purge_lock = asyncio.Lock()


Review comment (suggestion):
```suggestion
        In most cases you should use the `from_config` constructor to create an new instance based on
```

Code after:

    _TEMPORARY_DIR_NAME = '__CRAWLEE_TEMPORARY'
    """Name of the directory used to temporarily store files during purges."""

    _DATASETS_DIR_NAME = 'datasets'
    """Name of the directory containing datasets."""

    _KEY_VALUE_STORES_DIR_NAME = 'key_value_stores'
    """Name of the directory containing key-value stores."""

    _REQUEST_QUEUES_DIR_NAME = 'request_queues'
    """Name of the directory containing request queues."""

    def __init__(
        self,
        *,
        write_metadata: bool,
        persist_storage: bool,
        storage_dir: str,
        default_request_queue_id: str,
        default_key_value_store_id: str,
        default_dataset_id: str,
    ) -> None:
        """A default constructor.

        In most cases, you should use the `from_config` constructor to create a new instance based on
        the provided configuration.

        Args:
            write_metadata: Whether to write metadata to the storage.
            persist_storage: Whether to persist the storage.
            storage_dir: Path to the storage directory.
            default_request_queue_id: The default request queue ID.
            default_key_value_store_id: The default key-value store ID.
            default_dataset_id: The default dataset ID.
        """
        # Set the internal attributes.
        self._write_metadata = write_metadata
        self._persist_storage = persist_storage
        self._storage_dir = storage_dir
        self._default_request_queue_id = default_request_queue_id
        self._default_key_value_store_id = default_key_value_store_id
        self._default_dataset_id = default_dataset_id

        self.datasets_handled: list[DatasetClient] = []
        self.key_value_stores_handled: list[KeyValueStoreClient] = []
        self.request_queues_handled: list[RequestQueueClient] = []

        self._purged_on_start = False  # Indicates whether a purge was already performed on this instance.
        self._purge_lock = asyncio.Lock()