# Extending the standard library

**URL:** <https://discourse.julialang.org/t/extending-the-standard-library/18480>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 9, 2018, 6:36am UTC](https://discourse.julialang.org/t/extending-the-standard-library/18480 "2018-12-09T06:36:08Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [December 9, 2018, 11:35am UTC](https://discourse.julialang.org/t/extending-the-standard-library/18480/3 "2018-12-09T11:35:39Z")

</div>

When you are worried about type piracy, you can also use `ForceImport` to make it an optional extension,

> **[GitHub - chakravala/ForceImport.jl: Macro that force imports conflicting...](https://github.com/chakravala/ForceImport.jl)**
>
> Macro that force imports conflicting methods in modules - GitHub - chakravala/ForceImport.jl: Macro that force imports conflicting methods in modules

Which I previously explained on here before

> [@Operations on expressions](https://discourse.julialang.org/t/operations-on-expressions/13666/12):
>
> The principle which all @force users must keep in mind is this: the goal is to extend Base methods locally without affecting the global method table by type piracy, and to be able to import them into another package to have the same local effect. In order to avoid the type piracy, one must define a new local complementary n-ary method that will fall back on the base method with Any arguments. Then there will be a tiered alternative dispatch layer within the local package scope that redirects to …

This way you don’t have to extend the `Base` methods by default and modified methods can be located inside your custom module; while giving the option to locally `force` their import contained in a namespace with `@force using Module`, giving you the best of both worlds locally and globally.

---

_[View the full topic](https://discourse.julialang.org/t/extending-the-standard-library/18480)._
